-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update via seamapi/seam-connect@0565ba9
- Loading branch information
Showing
9 changed files
with
601 additions
and
74 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 113 additions & 21 deletions
134
src/lib/seam/connect/unstable/models/access-codes/managed-access-code.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,119 @@ | ||
import { z } from 'zod' | ||
|
||
export const managed_access_code = z.object({ | ||
common_code_key: z.string().nullable(), | ||
is_scheduled_on_device: z.boolean().optional(), | ||
type: z.enum(['time_bound', 'ongoing']), | ||
is_waiting_for_code_assignment: z.boolean().optional(), | ||
access_code_id: z.string().uuid(), | ||
device_id: z.string().uuid(), | ||
name: z.string().nullable(), | ||
code: z.string().nullable(), | ||
created_at: z.string().datetime(), | ||
errors: z.any(), | ||
warnings: z.any(), | ||
is_managed: z.literal(true), | ||
starts_at: z.string().datetime().nullable().optional(), | ||
ends_at: z.string().datetime().nullable().optional(), | ||
status: z.enum(['setting', 'set', 'unset', 'removing', 'unknown']), | ||
is_backup_access_code_available: z.boolean(), | ||
is_backup: z.boolean().optional(), | ||
pulled_backup_access_code_id: z.string().uuid().nullable().optional(), | ||
is_external_modification_allowed: z.boolean(), | ||
is_one_time_use: z.boolean(), | ||
is_offline_access_code: z.boolean(), | ||
common_code_key: z | ||
.string() | ||
.nullable() | ||
.describe( | ||
'Unique identifier for a group of access codes that share the same code.', | ||
), | ||
is_scheduled_on_device: z | ||
.boolean() | ||
.optional() | ||
.describe( | ||
'Indicates whether the code is set on the device according to a preconfigured schedule.', | ||
), | ||
type: z | ||
.enum(['time_bound', 'ongoing']) | ||
.describe( | ||
'Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration.', | ||
), | ||
is_waiting_for_code_assignment: z | ||
.boolean() | ||
.optional() | ||
.describe( | ||
'Indicates whether the access code is waiting for a code assignment.', | ||
), | ||
access_code_id: z | ||
.string() | ||
.uuid() | ||
.describe('Unique identifier for the access code.'), | ||
device_id: z | ||
.string() | ||
.uuid() | ||
.describe( | ||
'Unique identifier for the device associated with the access code.', | ||
), | ||
name: z | ||
.string() | ||
.nullable() | ||
.describe( | ||
'Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.', | ||
), | ||
code: z | ||
.string() | ||
.nullable() | ||
.describe( | ||
'Code used for access. Typically, a numeric or alphanumeric string.', | ||
), | ||
created_at: z | ||
.string() | ||
.datetime() | ||
.describe('Date and time at which the access code was created.'), | ||
errors: z | ||
.any() | ||
.describe( | ||
'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.', | ||
), | ||
warnings: z | ||
.any() | ||
.describe( | ||
'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.', | ||
), | ||
is_managed: z | ||
.literal(true) | ||
.describe('Indicates whether Seam manages the access code.'), | ||
starts_at: z | ||
.string() | ||
.datetime() | ||
.nullable() | ||
.optional() | ||
.describe( | ||
'Date and time at which the time-bound access code becomes active.', | ||
), | ||
ends_at: z | ||
.string() | ||
.datetime() | ||
.nullable() | ||
.optional() | ||
.describe( | ||
'Date and time after which the time-bound access code becomes inactive.', | ||
), | ||
status: z.enum(['setting', 'set', 'unset', 'removing', 'unknown']).describe(` | ||
Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. | ||
`), | ||
is_backup_access_code_available: z | ||
.boolean() | ||
.describe( | ||
'Indicates whether a backup access code is available for use if the primary access code is lost or compromised.', | ||
), | ||
is_backup: z | ||
.boolean() | ||
.optional() | ||
.describe('Indicates whether the access code is a backup code.'), | ||
pulled_backup_access_code_id: z | ||
.string() | ||
.uuid() | ||
.nullable() | ||
.optional() | ||
.describe( | ||
'Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code.', | ||
), | ||
is_external_modification_allowed: z | ||
.boolean() | ||
.describe( | ||
'Indicates whether changes to the access code from external sources are permitted.', | ||
), | ||
is_one_time_use: z | ||
.boolean() | ||
.describe( | ||
'Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use.', | ||
), | ||
is_offline_access_code: z | ||
.boolean() | ||
.describe( | ||
'Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection.', | ||
), | ||
}) | ||
|
||
export type ManagedAccessCode = z.infer<typeof managed_access_code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/lib/seam/connect/unstable/models/acs/credential_pool.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { z } from 'zod' | ||
|
||
export const acs_credential_pool_external_type = z.enum(['hid_part_number']) | ||
|
||
export type AcsCredentialPoolExternalType = z.infer< | ||
typeof acs_credential_pool_external_type | ||
> | ||
|
||
export const acs_credential_pool = z.object({ | ||
acs_credential_pool_id: z.string().uuid(), | ||
acs_system_id: z.string().uuid(), | ||
display_name: z.string().nonempty(), | ||
external_type: acs_credential_pool_external_type, | ||
external_type_display_name: z.string(), | ||
created_at: z.string().datetime(), | ||
workspace_id: z.string().uuid(), | ||
}) | ||
|
||
export type AcsCredentialPool = z.output<typeof acs_credential_pool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from './access_group.js' | ||
export * from './credential.js' | ||
export * from './credential_pool.js' | ||
export * from './entrance.js' | ||
export * from './system.js' | ||
export * from './user.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters