Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
seambot committed Aug 27, 2024
1 parent 4f3d680 commit b65ea75
Show file tree
Hide file tree
Showing 5 changed files with 509 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/lib/seam/connect/models/acs/acs-credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type AcsCredentialExternalType = z.infer<
typeof acs_credential_external_type
>

export const acs_credential = z.object({
const common_acs_credential = z.object({
acs_credential_id: z.string().uuid(),
acs_user_id: z.string().uuid().optional(),
acs_credential_pool_id: z.string().uuid().optional(),
Expand Down Expand Up @@ -57,4 +57,17 @@ export const acs_credential = z.object({
visionline_metadata: acs_credential_visionline_metadata.optional(),
})

export const acs_credential = common_acs_credential.merge(
z.object({
is_managed: z.literal(true),
}),
)

export const unmanaged_acs_credential = common_acs_credential.merge(
z.object({
is_managed: z.literal(false),
}),
)

export type AcsCredential = z.output<typeof acs_credential>
export type UnmanagedAcsCredential = z.output<typeof unmanaged_acs_credential>
3 changes: 3 additions & 0 deletions src/lib/seam/connect/models/acs/metadata/visionline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const acs_credential_visionline_metadata = z.object({
joiner_acs_credential_ids: z.array(z.string().uuid()).optional(),
guest_acs_entrance_ids: z.array(z.string().uuid()).optional(),
common_acs_entrance_ids: z.array(z.string().uuid()).optional(),
is_valid: z.boolean().optional(),
card_id: z.string().optional(),
credential_id: z.string().optional(),
})

export type AcsCredentialVisionlineMetadata = z.infer<
Expand Down
Loading

0 comments on commit b65ea75

Please sign in to comment.