From a4d762109a6907ec521ca2b5cd39ea3332edd140 Mon Sep 17 00:00:00 2001 From: Laure-di Date: Wed, 12 Mar 2025 11:09:38 +0100 Subject: [PATCH] fix(iam): move Connection out of GetUserConnectionResponse --- .../clients/src/api/iam/v1alpha1/index.gen.ts | 6 +- .../src/api/iam/v1alpha1/marshalling.gen.ts | 43 +++--- .../clients/src/api/iam/v1alpha1/types.gen.ts | 126 +++++++++--------- 3 files changed, 83 insertions(+), 92 deletions(-) diff --git a/packages/clients/src/api/iam/v1alpha1/index.gen.ts b/packages/clients/src/api/iam/v1alpha1/index.gen.ts index b985b44ca..25dbbf079 100644 --- a/packages/clients/src/api/iam/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/index.gen.ts @@ -8,6 +8,9 @@ export type { Application, BearerType, ClonePolicyRequest, + Connection, + ConnectionConnectedOrganization, + ConnectionConnectedUser, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, @@ -37,9 +40,6 @@ export type { GetSSHKeyRequest, GetUserConnectionsRequest, GetUserConnectionsResponse, - GetUserConnectionsResponseConnection, - GetUserConnectionsResponseConnectionConnectedOrganization, - GetUserConnectionsResponseConnectionConnectedUser, GetUserRequest, GracePeriod, GracePeriodType, diff --git a/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts index fd48b13c5..9486c7c3a 100644 --- a/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts @@ -13,6 +13,9 @@ import type { AddGroupMemberRequest, AddGroupMembersRequest, Application, + Connection, + ConnectionConnectedOrganization, + ConnectionConnectedUser, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, @@ -23,9 +26,6 @@ import type { CreateUserRequestMember, EncodedJWT, GetUserConnectionsResponse, - GetUserConnectionsResponseConnection, - GetUserConnectionsResponseConnectionConnectedOrganization, - GetUserConnectionsResponseConnectionConnectedUser, GracePeriod, Group, JWT, @@ -300,12 +300,12 @@ export const unmarshalEncodedJWT = (data: unknown): EncodedJWT => { } as EncodedJWT } -const unmarshalGetUserConnectionsResponseConnectionConnectedOrganization = ( +const unmarshalConnectionConnectedOrganization = ( data: unknown, -): GetUserConnectionsResponseConnectionConnectedOrganization => { +): ConnectionConnectedOrganization => { if (!isJSONObject(data)) { throw new TypeError( - `Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary.`, + `Unmarshalling the type 'ConnectionConnectedOrganization' failed as data isn't a dictionary.`, ) } @@ -313,15 +313,15 @@ const unmarshalGetUserConnectionsResponseConnectionConnectedOrganization = ( id: data.id, locked: data.locked, name: data.name, - } as GetUserConnectionsResponseConnectionConnectedOrganization + } as ConnectionConnectedOrganization } -const unmarshalGetUserConnectionsResponseConnectionConnectedUser = ( +const unmarshalConnectionConnectedUser = ( data: unknown, -): GetUserConnectionsResponseConnectionConnectedUser => { +): ConnectionConnectedUser => { if (!isJSONObject(data)) { throw new TypeError( - `Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary.`, + `Unmarshalling the type 'ConnectionConnectedUser' failed as data isn't a dictionary.`, ) } @@ -329,28 +329,22 @@ const unmarshalGetUserConnectionsResponseConnectionConnectedUser = ( id: data.id, type: data.type, username: data.username, - } as GetUserConnectionsResponseConnectionConnectedUser + } as ConnectionConnectedUser } -const unmarshalGetUserConnectionsResponseConnection = ( - data: unknown, -): GetUserConnectionsResponseConnection => { +const unmarshalConnection = (data: unknown): Connection => { if (!isJSONObject(data)) { throw new TypeError( - `Unmarshalling the type 'GetUserConnectionsResponseConnection' failed as data isn't a dictionary.`, + `Unmarshalling the type 'Connection' failed as data isn't a dictionary.`, ) } return { organization: data.organization - ? unmarshalGetUserConnectionsResponseConnectionConnectedOrganization( - data.organization, - ) - : undefined, - user: data.user - ? unmarshalGetUserConnectionsResponseConnectionConnectedUser(data.user) + ? unmarshalConnectionConnectedOrganization(data.organization) : undefined, - } as GetUserConnectionsResponseConnection + user: data.user ? unmarshalConnectionConnectedUser(data.user) : undefined, + } as Connection } export const unmarshalGetUserConnectionsResponse = ( @@ -363,10 +357,7 @@ export const unmarshalGetUserConnectionsResponse = ( } return { - connections: unmarshalArrayOfObject( - data.connections, - unmarshalGetUserConnectionsResponseConnection, - ), + connections: unmarshalArrayOfObject(data.connections, unmarshalConnection), } as GetUserConnectionsResponse } diff --git a/packages/clients/src/api/iam/v1alpha1/types.gen.ts b/packages/clients/src/api/iam/v1alpha1/types.gen.ts index ce3e980dc..cd2d89b06 100644 --- a/packages/clients/src/api/iam/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/types.gen.ts @@ -99,13 +99,13 @@ export type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated' export type UserType = 'unknown_type' | 'guest' | 'owner' | 'member' -export interface GetUserConnectionsResponseConnectionConnectedOrganization { +export interface ConnectionConnectedOrganization { id: string name: string locked: boolean } -export interface GetUserConnectionsResponseConnectionConnectedUser { +export interface ConnectionConnectedUser { id: string username: string type: UserType @@ -203,11 +203,11 @@ export interface CreateUserRequestMember { password: string } -export interface GetUserConnectionsResponseConnection { +export interface Connection { /** Information about the connected organization. */ - organization?: GetUserConnectionsResponseConnectionConnectedOrganization + organization?: ConnectionConnectedOrganization /** Information about the connected user. */ - user?: GetUserConnectionsResponseConnectionConnectedUser + user?: ConnectionConnectedUser } export interface APIKey { @@ -515,7 +515,7 @@ export interface User { locked: boolean } -export type AddGroupMemberRequest = { +export interface AddGroupMemberRequest { /** ID of the group. */ groupId: string /** @@ -532,7 +532,7 @@ export type AddGroupMemberRequest = { applicationId?: string } -export type AddGroupMembersRequest = { +export interface AddGroupMembersRequest { /** ID of the group. */ groupId: string /** IDs of the users to add. */ @@ -541,11 +541,11 @@ export type AddGroupMembersRequest = { applicationIds?: string[] } -export type ClonePolicyRequest = { +export interface ClonePolicyRequest { policyId: string } -export type CreateAPIKeyRequest = { +export interface CreateAPIKeyRequest { /** * ID of the application. * @@ -566,7 +566,7 @@ export type CreateAPIKeyRequest = { description: string } -export type CreateApplicationRequest = { +export interface CreateApplicationRequest { /** Name of the application to create (max length is 64 characters). */ name?: string /** ID of the Organization. */ @@ -577,7 +577,7 @@ export type CreateApplicationRequest = { tags?: string[] } -export type CreateGroupRequest = { +export interface CreateGroupRequest { /** ID of Organization linked to the group. */ organizationId?: string /** @@ -591,14 +591,14 @@ export type CreateGroupRequest = { tags?: string[] } -export type CreateJWTRequest = { +export interface CreateJWTRequest { /** ID of the user the JWT will be created for. */ userId: string /** Referrer of the JWT. */ referrer: string } -export type CreatePolicyRequest = { +export interface CreatePolicyRequest { /** Name of the policy to create (max length is 64 characters). */ name?: string /** Description of the policy to create (max length is 200 characters). */ @@ -639,7 +639,7 @@ export type CreatePolicyRequest = { noPrincipal?: boolean } -export type CreateSSHKeyRequest = { +export interface CreateSSHKeyRequest { /** Name of the SSH key. Max length is 1000. */ name?: string /** @@ -651,12 +651,12 @@ export type CreateSSHKeyRequest = { projectId?: string } -export type CreateUserMFAOTPRequest = { +export interface CreateUserMFAOTPRequest { /** User ID of the MFA OTP. */ userId: string } -export type CreateUserRequest = { +export interface CreateUserRequest { /** ID of the Organization. */ organizationId?: string /** @@ -675,41 +675,41 @@ export type CreateUserRequest = { member?: CreateUserRequestMember } -export type DeleteAPIKeyRequest = { +export interface DeleteAPIKeyRequest { /** Access key to delete. */ accessKey: string } -export type DeleteApplicationRequest = { +export interface DeleteApplicationRequest { /** ID of the application to delete. */ applicationId: string } -export type DeleteGroupRequest = { +export interface DeleteGroupRequest { /** ID of the group to delete. */ groupId: string } -export type DeleteJWTRequest = { +export interface DeleteJWTRequest { /** JWT ID of the JWT to delete. */ jti: string } -export type DeletePolicyRequest = { +export interface DeletePolicyRequest { /** Id of policy to delete. */ policyId: string } -export type DeleteSSHKeyRequest = { +export interface DeleteSSHKeyRequest { sshKeyId: string } -export type DeleteUserMFAOTPRequest = { +export interface DeleteUserMFAOTPRequest { /** User ID of the MFA OTP. */ userId: string } -export type DeleteUserRequest = { +export interface DeleteUserRequest { /** ID of the user to delete. */ userId: string } @@ -723,69 +723,69 @@ export interface EncodedJWT { renewToken: string } -export type GetAPIKeyRequest = { +export interface GetAPIKeyRequest { /** Access key to search for. */ accessKey: string } -export type GetApplicationRequest = { +export interface GetApplicationRequest { /** ID of the application to find. */ applicationId: string } -export type GetGroupRequest = { +export interface GetGroupRequest { /** ID of the group. */ groupId: string } -export type GetJWTRequest = { +export interface GetJWTRequest { /** JWT ID of the JWT to get. */ jti: string } -export type GetLogRequest = { +export interface GetLogRequest { /** ID of the log. */ logId: string } -export type GetOrganizationSecuritySettingsRequest = { +export interface GetOrganizationSecuritySettingsRequest { /** ID of the Organization. */ organizationId?: string } -export type GetPolicyRequest = { +export interface GetPolicyRequest { /** Id of policy to search. */ policyId: string } -export type GetQuotumRequest = { +export interface GetQuotumRequest { /** Name of the quota to get. */ quotumName: string /** ID of the Organization. */ organizationId?: string } -export type GetSSHKeyRequest = { +export interface GetSSHKeyRequest { /** ID of the SSH key. */ sshKeyId: string } -export type GetUserConnectionsRequest = { +export interface GetUserConnectionsRequest { /** ID of the user to list connections for. */ userId: string } export interface GetUserConnectionsResponse { /** List of connections. */ - connections: GetUserConnectionsResponseConnection[] + connections: Connection[] } -export type GetUserRequest = { +export interface GetUserRequest { /** ID of the user to find. */ userId: string } -export type ListAPIKeysRequest = { +export interface ListAPIKeysRequest { /** Criteria for sorting results. */ orderBy?: ListAPIKeysRequestOrderBy /** Page number. Value must be greater or equal to 1. */ @@ -829,7 +829,7 @@ export interface ListAPIKeysResponse { totalCount: number } -export type ListApplicationsRequest = { +export interface ListApplicationsRequest { /** Criteria for sorting results. */ orderBy?: ListApplicationsRequestOrderBy /** Number of results per page. Value must be between 1 and 100. */ @@ -855,7 +855,7 @@ export interface ListApplicationsResponse { totalCount: number } -export type ListGracePeriodsRequest = { +export interface ListGracePeriodsRequest { /** ID of the user to list grace periods for. */ userId?: string } @@ -865,7 +865,7 @@ export interface ListGracePeriodsResponse { gracePeriods: GracePeriod[] } -export type ListGroupsRequest = { +export interface ListGroupsRequest { /** Sort order of groups. */ orderBy?: ListGroupsRequestOrderBy /** Requested page number. Value must be greater or equal to 1. */ @@ -893,7 +893,7 @@ export interface ListGroupsResponse { totalCount: number } -export type ListJWTsRequest = { +export interface ListJWTsRequest { /** Criteria for sorting results. */ orderBy?: ListJWTsRequestOrderBy /** ID of the user to search. */ @@ -911,7 +911,7 @@ export interface ListJWTsResponse { totalCount: number } -export type ListLogsRequest = { +export interface ListLogsRequest { /** Criteria for sorting results. */ orderBy?: ListLogsRequestOrderBy /** Filter by Organization ID. */ @@ -939,7 +939,7 @@ export interface ListLogsResponse { totalCount: number } -export type ListPermissionSetsRequest = { +export interface ListPermissionSetsRequest { /** Criteria for sorting results. */ orderBy?: ListPermissionSetsRequestOrderBy /** Number of results per page. Value must be between 1 and 100. */ @@ -957,7 +957,7 @@ export interface ListPermissionSetsResponse { totalCount: number } -export type ListPoliciesRequest = { +export interface ListPoliciesRequest { /** Criteria for sorting results. */ orderBy?: ListPoliciesRequestOrderBy /** Number of results per page. Value must be between 1 and 100. */ @@ -991,7 +991,7 @@ export interface ListPoliciesResponse { totalCount: number } -export type ListQuotaRequest = { +export interface ListQuotaRequest { /** Criteria for sorting results. */ orderBy?: ListQuotaRequestOrderBy /** Number of results per page. Value must be between 1 and 100. */ @@ -1011,7 +1011,7 @@ export interface ListQuotaResponse { totalCount: number } -export type ListRulesRequest = { +export interface ListRulesRequest { /** Id of policy to search. */ policyId: string /** Number of results per page. Value must be between 1 and 100. */ @@ -1027,7 +1027,7 @@ export interface ListRulesResponse { totalCount: number } -export type ListSSHKeysRequest = { +export interface ListSSHKeysRequest { /** Sort order of the SSH keys. */ orderBy?: ListSSHKeysRequestOrderBy /** Requested page number. Value must be greater or equal to 1. */ @@ -1051,7 +1051,7 @@ export interface ListSSHKeysResponse { totalCount: number } -export type ListUsersRequest = { +export interface ListUsersRequest { /** Criteria for sorting results. */ orderBy?: ListUsersRequestOrderBy /** Number of results per page. Value must be between 1 and 100. */ @@ -1077,7 +1077,7 @@ export interface ListUsersResponse { totalCount: number } -export type LockUserRequest = { +export interface LockUserRequest { /** ID of the user to lock. */ userId: string } @@ -1095,7 +1095,7 @@ export interface OrganizationSecuritySettings { loginAttemptsBeforeLocked: number } -export type RemoveGroupMemberRequest = { +export interface RemoveGroupMemberRequest { /** ID of the group. */ groupId: string /** @@ -1112,13 +1112,13 @@ export type RemoveGroupMemberRequest = { applicationId?: string } -export type SetGroupMembersRequest = { +export interface SetGroupMembersRequest { groupId: string userIds: string[] applicationIds: string[] } -export type SetRulesRequest = { +export interface SetRulesRequest { /** Id of policy to update. */ policyId: string /** Rules of the policy to set. */ @@ -1130,12 +1130,12 @@ export interface SetRulesResponse { rules: Rule[] } -export type UnlockUserRequest = { +export interface UnlockUserRequest { /** ID of the user to unlock. */ userId: string } -export type UpdateAPIKeyRequest = { +export interface UpdateAPIKeyRequest { /** Access key to update. */ accessKey: string /** New default Project ID to set. */ @@ -1144,7 +1144,7 @@ export type UpdateAPIKeyRequest = { description?: string } -export type UpdateApplicationRequest = { +export interface UpdateApplicationRequest { /** ID of the application to update. */ applicationId: string /** New name for the application (max length is 64 chars). */ @@ -1155,7 +1155,7 @@ export type UpdateApplicationRequest = { tags?: string[] } -export type UpdateGroupRequest = { +export interface UpdateGroupRequest { /** ID of the group to update. */ groupId: string /** @@ -1169,7 +1169,7 @@ export type UpdateGroupRequest = { tags?: string[] } -export type UpdateOrganizationSecuritySettingsRequest = { +export interface UpdateOrganizationSecuritySettingsRequest { /** ID of the Organization. */ organizationId?: string /** Defines whether password renewal is enforced during first login. */ @@ -1180,7 +1180,7 @@ export type UpdateOrganizationSecuritySettingsRequest = { loginAttemptsBeforeLocked?: number } -export type UpdatePolicyRequest = { +export interface UpdatePolicyRequest { /** Id of policy to update. */ policyId: string /** New name for the policy (max length is 64 characters). */ @@ -1219,7 +1219,7 @@ export type UpdatePolicyRequest = { noPrincipal?: boolean } -export type UpdateSSHKeyRequest = { +export interface UpdateSSHKeyRequest { sshKeyId: string /** Name of the SSH key. Max length is 1000. */ name?: string @@ -1227,14 +1227,14 @@ export type UpdateSSHKeyRequest = { disabled?: boolean } -export type UpdateUserPasswordRequest = { +export interface UpdateUserPasswordRequest { /** ID of the user to update. */ userId: string /** The new password. */ password: string } -export type UpdateUserRequest = { +export interface UpdateUserRequest { /** ID of the user to update. */ userId: string /** New tags for the user (maximum of 10 tags). */ @@ -1243,14 +1243,14 @@ export type UpdateUserRequest = { email?: string } -export type UpdateUserUsernameRequest = { +export interface UpdateUserUsernameRequest { /** ID of the user to update. */ userId: string /** The new username. */ username: string } -export type ValidateUserMFAOTPRequest = { +export interface ValidateUserMFAOTPRequest { /** User ID of the MFA OTP. */ userId: string /** A password generated using the OTP. */