Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add route_path #1434

Merged
merged 2 commits into from
Jan 9, 2025
Merged
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 @@ -138,6 +138,10 @@ export const access_code = z.object({
.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.',
),
})
}).describe(`
---
route_path: /access_codes
---
`)

export type AccessCode = z.infer<typeof access_code>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export const unmanaged_access_code = access_code
.extend({
is_managed: z.literal(false),
status: z.enum(['set']),
})
}).describe(`
---
route_path: /access_codes/unmanaged
---
`)

export type UnmanagedAccessCode = z.infer<typeof unmanaged_access_code>
10 changes: 7 additions & 3 deletions src/lib/seam/connect/models/acs/acs-access-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@ const common_acs_access_group = z.object({

export const acs_access_group = common_acs_access_group.extend({
is_managed: z.literal(true),
})
.describe(`Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users.
The \`acs_access_group\` object represents an [access group](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups) within an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).`)
}).describe(`
---
route_path: /acs/access_groups
---
Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users.
The \`acs_access_group\` object represents an [access group](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups) within an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).
`)
export const unmanaged_acs_access_group = common_acs_access_group.extend({
is_managed: z.literal(false),
})
Expand Down
6 changes: 5 additions & 1 deletion src/lib/seam/connect/models/acs/acs-credential-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export const acs_credential_pool = z.object({
external_type_display_name: z.string(),
created_at: z.string().datetime(),
workspace_id: z.string().uuid(),
})
}).describe(`
---
route_path: /acs/credential_pools
---
`)

export type AcsCredentialPool = z.output<typeof acs_credential_pool>
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,45 @@ export const acs_credential_provisioning_automation = z.object({
user_identity_id: z.string().uuid(),
created_at: z.string().datetime(),
workspace_id: z.string().uuid(),
})
}).describe(`
---
route_path: /acs/credential_provisioning_automations
---
`)

export const enrollment_automation = z
.object({
enrollment_automation_id: z
.string()
.uuid()
.describe('ID of the enrollment automation.'),
credential_manager_acs_system_id: z
.string()
.uuid()
.describe(
'ID of the associated [ACS system](https://docs.seam.co/latest/capability-guides/access-systems) that serves as the credential manager.',
),
user_identity_id: z
.string()
.uuid()
.describe(
'ID of the associated [user identity](https://docs.seam.co/latest/capability-guides/mobile-access-in-development/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity).',
),
created_at: z
.string()
.datetime()
.describe(
'Date and time at which the enrollment automation was created.',
),
workspace_id: z
.string()
.uuid()
.describe(
'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) that contains the enrollment automation.',
),
})
.describe(
'Represents an [enrollment automation](https://docs.seam.co/latest/capability-guides/mobile-access-in-development/issuing-mobile-credentials-from-an-access-control-system) within the [Seam mobile access solution](https://docs.seam.co/latest/capability-guides/mobile-access-in-development).',
)
export const enrollment_automation = z.object({
enrollment_automation_id: z
.string()
.uuid()
.describe('ID of the enrollment automation.'),
credential_manager_acs_system_id: z
.string()
.uuid()
.describe(
'ID of the associated [ACS system](https://docs.seam.co/latest/capability-guides/access-systems) that serves as the credential manager.',
),
user_identity_id: z
.string()
.uuid()
.describe(
'ID of the associated [user identity](https://docs.seam.co/latest/capability-guides/mobile-access-in-development/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity).',
),
created_at: z
.string()
.datetime()
.describe('Date and time at which the enrollment automation was created.'),
workspace_id: z
.string()
.uuid()
.describe(
'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) that contains the enrollment automation.',
),
}).describe(`
---
route_path: /user_identities/enrollment_automations
---
Represents an [enrollment automation](https://docs.seam.co/latest/capability-guides/mobile-access-in-development/issuing-mobile-credentials-from-an-access-control-system) within the [Seam mobile access solution](https://docs.seam.co/latest/capability-guides/mobile-access-in-development).
`)

export type EnrollmentAutomation = z.output<typeof enrollment_automation>

Expand Down
61 changes: 31 additions & 30 deletions src/lib/seam/connect/models/acs/acs-entrance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,36 @@ import {
} from './metadata/index.js'
import { acs_entrance_salto_space_metadata } from './metadata/salto-space.js'

export const acs_entrance = z
.object({
acs_system_id: z
.string()
.uuid()
.describe('ID of the access control system that contains the entrance.'),
acs_entrance_id: z.string().uuid().describe('ID of the entrance.'),
created_at: z
.string()
.datetime()
.describe('Date and time at which the entrance was created.'),
display_name: z.string().describe('Display name for the entrance.'),
errors: z.array(
z.object({
error_code: z.string(),
message: z.string(),
}),
),
latch_metadata: acs_entrance_latch_metadata.optional(),
visionline_metadata: acs_entrance_visionline_metadata.optional(),
salto_ks_metadata: acs_entrance_salto_ks_metadata.optional(),
dormakaba_community_metadata:
acs_entrance_dormakaba_community_metadata.optional(),
assa_abloy_vostio_metadata:
acs_entrance_assa_abloy_vostio_metadata.optional(),
salto_space_metadata: acs_entrance_salto_space_metadata.optional(),
})
.describe(
'Represents an [entrance](https://docs.seam.co/latest/capability-guides/access-systems/retrieving-entrance-details) within an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).',
)
export const acs_entrance = z.object({
acs_system_id: z
.string()
.uuid()
.describe('ID of the access control system that contains the entrance.'),
acs_entrance_id: z.string().uuid().describe('ID of the entrance.'),
created_at: z
.string()
.datetime()
.describe('Date and time at which the entrance was created.'),
display_name: z.string().describe('Display name for the entrance.'),
errors: z.array(
z.object({
error_code: z.string(),
message: z.string(),
}),
),
latch_metadata: acs_entrance_latch_metadata.optional(),
visionline_metadata: acs_entrance_visionline_metadata.optional(),
salto_ks_metadata: acs_entrance_salto_ks_metadata.optional(),
dormakaba_community_metadata:
acs_entrance_dormakaba_community_metadata.optional(),
assa_abloy_vostio_metadata:
acs_entrance_assa_abloy_vostio_metadata.optional(),
salto_space_metadata: acs_entrance_salto_space_metadata.optional(),
}).describe(`
---
route_path: /acs/entrances
---
Represents an [entrance](https://docs.seam.co/latest/capability-guides/access-systems/retrieving-entrance-details) within an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).
`)

export type AcsEntrance = z.infer<typeof acs_entrance>
10 changes: 6 additions & 4 deletions src/lib/seam/connect/models/acs/acs-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ export const acs_system = z
.array(acs_system_warning)
.describe('Warnings associated with the `acs_system`.'),
})
.merge(acs_system_capability_flags)
.describe(
'Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).',
)
.merge(acs_system_capability_flags).describe(`
---
route_path: /acs/systems
---
Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).
`)

export type AcsSystem = z.output<typeof acs_system>
19 changes: 10 additions & 9 deletions src/lib/seam/connect/models/acs/acs-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,16 @@ const common_acs_user = z
})
.merge(user_fields)

export const acs_user = common_acs_user
.merge(
z.object({
is_managed: z.literal(true),
}),
)
.describe(
'Represents a [user](https://docs.seam.co/latest/capability-guides/access-systems/user-management) in an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).',
)
export const acs_user = common_acs_user.merge(
z.object({
is_managed: z.literal(true),
}),
).describe(`
---
route_path: /acs/users
---
Represents a [user](https://docs.seam.co/latest/capability-guides/access-systems/user-management) in an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).
`)

export const unmanaged_acs_user = common_acs_user
.merge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const action_attempt = z.union([
...set_hvac_mode_action_attempt.options,
...activate_climate_preset_action_attempt.options,
...deprecated_action_attempts,
])
]).describe(`
---
route_path: /action_attempts
---
`)

export type ActionAttempt = z.infer<typeof action_attempt>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const client_session = z.object({
connected_account_ids: z.array(z.string().uuid()),
connect_webview_ids: z.array(z.string().uuid()),
user_identity_ids: z.array(z.string().uuid()),
})
}).describe(`
---
route_path: /client_sessions
---
`)

export type ClientSession = z.infer<typeof client_session>
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export const connect_webview = z.object({
wait_for_device_creation: z.boolean(),
authorized_at: z.string().datetime().nullable(),
selected_provider: z.string().nullable(),
})
}).describe(`
---
route_path: /connect_webviews
---
`)

export type ConnectWebview = z.infer<typeof connect_webview>
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export const connected_account = z.object({
warnings: z.array(connected_account_warning),
custom_metadata,
automatically_manage_new_devices: z.boolean(),
})
}).describe(`
---
route_path: /connected_accounts
---
`)

export type ConnectedAccount = z.infer<typeof connected_account>
6 changes: 5 additions & 1 deletion src/lib/seam/connect/models/devices/device-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export const device_provider = z
image_url: z.string(),
provider_categories: z.array(z.enum(PUBLIC_PROVIDER_CATEGORIES)),
})
.extend(device_capability_flags.shape)
.extend(device_capability_flags.shape).describe(`
---
route_path: /devices
---
`)

export type DeviceProvider = z.infer<typeof device_provider>
6 changes: 5 additions & 1 deletion src/lib/seam/connect/models/devices/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ export const device = z
.describe('Indicates whether Seam manages the device.'),
custom_metadata,
})
.merge(device_capability_flags)
.merge(device_capability_flags).describe(`
---
route_path: /devices
---
`)

export type Device = z.infer<typeof device>
6 changes: 5 additions & 1 deletion src/lib/seam/connect/models/devices/phone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ export const phone = device
.extend({
device_type: z.enum(['android_phone', 'ios_phone']),
})
.merge(z.object({ properties: phone_specific_properties }))
.merge(z.object({ properties: phone_specific_properties })).describe(`
---
route_path: /phones
---
`)
6 changes: 5 additions & 1 deletion src/lib/seam/connect/models/devices/unmanaged-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export const unmanaged_device = device
model: true,
}),
})
.merge(device_capability_flags)
.merge(device_capability_flags).describe(`
---
route_path: /devices/unmanaged
---
`)

export type UnmanagedDevice = z.infer<typeof unmanaged_device>
Loading
Loading