Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,31 @@ const deleting = common_pending_mutation
'Seam is in the process of pushing a credential deletion to the integrated access system.',
)

const updating_user_assignment = common_pending_mutation
.extend({
mutation_code: z
.literal('updating_user_assignment')
.describe(
'Mutation code to indicate that Seam is in the process of assigning or unassigning the credential to a user on the integrated access system.',
),
from: z
.object({
acs_user_id: z.string().uuid().nullable().describe('Previous user ID.'),
})
.describe('Previous user assignment.'),
to: z
.object({
acs_user_id: z.string().uuid().nullable().describe('New user ID.'),
})
.describe('New user assignment.'),
})
.describe(
'Seam is in the process of assigning or unassigning the credential to a user on the integrated access system.',
)

export const acs_credential_pending_mutations = z.discriminatedUnion(
'mutation_code',
[creating, deleting],
[creating, deleting, updating_user_assignment],
)

export type AcsCredentialPendingMutation = z.infer<
Expand All @@ -44,6 +66,7 @@ export type AcsCredentialPendingMutation = z.infer<
const _acs_credential_pending_mutations_map = z.object({
creating: creating.optional().nullable(),
deleting: deleting.optional().nullable(),
updating_user_assignment: updating_user_assignment.optional().nullable(),
})

export type AcsCredentialPendingMutationsMap = z.infer<
Expand Down
35 changes: 35 additions & 0 deletions src/lib/seam/connect/models/acs/acs-users/pending-mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,36 @@ const deferring_group_membership_update_mutation = common_pending_mutation
'A scheduled access group membership change is pending for this user.',
)

const updating_credential_assignment_mutation = common_pending_mutation
.extend({
mutation_code: z
.literal('updating_credential_assignment')
.describe(
'Mutation code to indicate that Seam is in the process of assigning or unassigning a credential to the user on the integrated access system.',
),
from: z
.object({
acs_credential_id: z
.string()
.uuid()
.nullable()
.describe('Previous credential ID.'),
})
.describe('Previous credential assignment.'),
to: z
.object({
acs_credential_id: z
.string()
.uuid()
.nullable()
.describe('New credential ID.'),
})
.describe('New credential assignment.'),
})
.describe(
'Seam is in the process of assigning or unassigning a credential to the user on the integrated access system.',
)

export const acs_user_pending_mutations = z.discriminatedUnion(
'mutation_code',
[
Expand All @@ -190,6 +220,7 @@ export const acs_user_pending_mutations = z.discriminatedUnion(
updating_suspension_state_mutation,
updating_group_membership_mutation,
deferring_group_membership_update_mutation,
updating_credential_assignment_mutation,
],
)

Expand All @@ -210,6 +241,10 @@ const _acs_user_pending_mutations_map = z.object({
.record(z.string().uuid(), deferring_group_membership_update_mutation)
.optional()
.nullable(),
updating_credential_assignment: z
.record(z.string().uuid(), updating_credential_assignment_mutation)
.optional()
.nullable(),
updating_suspension_state: updating_suspension_state_mutation
.optional()
.nullable(),
Expand Down
112 changes: 112 additions & 0 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5716,6 +5716,62 @@ const openapi: OpenAPISpec = {
],
type: 'object',
},
{
description:
'Seam is in the process of assigning or unassigning a credential to the user on the integrated access system.',
properties: {
created_at: {
description:
'Date and time at which the mutation was created.',
format: 'date-time',
type: 'string',
},
from: {
description: 'Previous credential assignment.',
properties: {
acs_credential_id: {
description: 'Previous credential ID.',
format: 'uuid',
nullable: true,
type: 'string',
},
},
required: ['acs_credential_id'],
type: 'object',
},
message: {
description: 'Detailed description of the mutation.',
type: 'string',
},
mutation_code: {
description:
'Mutation code to indicate that Seam is in the process of assigning or unassigning a credential to the user on the integrated access system.',
enum: ['updating_credential_assignment'],
type: 'string',
},
to: {
description: 'New credential assignment.',
properties: {
acs_credential_id: {
description: 'New credential ID.',
format: 'uuid',
nullable: true,
type: 'string',
},
},
required: ['acs_credential_id'],
type: 'object',
},
},
required: [
'created_at',
'message',
'mutation_code',
'from',
'to',
],
type: 'object',
},
],
},
type: 'array',
Expand Down Expand Up @@ -29801,6 +29857,62 @@ const openapi: OpenAPISpec = {
],
type: 'object',
},
{
description:
'Seam is in the process of assigning or unassigning a credential to the user on the integrated access system.',
properties: {
created_at: {
description:
'Date and time at which the mutation was created.',
format: 'date-time',
type: 'string',
},
from: {
description: 'Previous credential assignment.',
properties: {
acs_credential_id: {
description: 'Previous credential ID.',
format: 'uuid',
nullable: true,
type: 'string',
},
},
required: ['acs_credential_id'],
type: 'object',
},
message: {
description: 'Detailed description of the mutation.',
type: 'string',
},
mutation_code: {
description:
'Mutation code to indicate that Seam is in the process of assigning or unassigning a credential to the user on the integrated access system.',
enum: ['updating_credential_assignment'],
type: 'string',
},
to: {
description: 'New credential assignment.',
properties: {
acs_credential_id: {
description: 'New credential ID.',
format: 'uuid',
nullable: true,
type: 'string',
},
},
required: ['acs_credential_id'],
type: 'object',
},
},
required: [
'created_at',
'message',
'mutation_code',
'from',
'to',
],
type: 'object',
},
],
},
type: 'array',
Expand Down
Loading
Loading