diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index 8b5a9c99..a6f1721b 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -139,7 +139,7 @@ export default { type: 'string', }, email_address: { format: 'email', type: 'string' }, - external_type: { enum: ['pti_user'], type: 'string' }, + external_type: { enum: ['pti_user', 'brivo_user'], type: 'string' }, external_type_display_name: { type: 'string' }, full_name: { type: 'string' }, is_suspended: { type: 'boolean' }, @@ -286,16 +286,46 @@ export default { accepted_providers: { items: { type: 'string' }, type: 'array' }, any_device_allowed: { type: 'boolean' }, any_provider_allowed: { type: 'boolean' }, + authorized_at: { + format: 'date-time', + nullable: true, + type: 'string', + }, + automatically_manage_new_devices: { type: 'boolean' }, connect_webview_id: { format: 'uuid', type: 'string' }, connected_account_id: { format: 'uuid', type: 'string' }, created_at: { format: 'date-time', type: 'string' }, + custom_metadata: { + additionalProperties: { + nullable: true, + oneOf: [ + { maxLength: 500, type: 'string' }, + { type: 'number' }, + { format: 'null', nullable: true, type: 'string' }, + { type: 'boolean' }, + ], + }, + type: 'object', + }, + custom_redirect_failure_url: { + format: 'uri', + nullable: true, + type: 'string', + }, + custom_redirect_url: { + format: 'uri', + nullable: true, + type: 'string', + }, device_selection_mode: { enum: ['none', 'single', 'multiple'], type: 'string', }, login_successful: { type: 'boolean' }, + selected_provider: { nullable: true, type: 'string' }, status: { enum: ['pending', 'failed', 'authorized'], type: 'string' }, url: { format: 'uri', type: 'string' }, + wait_for_device_creation: { type: 'boolean' }, workspace_id: { format: 'uuid', type: 'string' }, }, required: [ @@ -310,6 +340,13 @@ export default { 'created_at', 'login_successful', 'status', + 'custom_redirect_url', + 'custom_redirect_failure_url', + 'custom_metadata', + 'automatically_manage_new_devices', + 'wait_for_device_creation', + 'authorized_at', + 'selected_provider', ], type: 'object', }, @@ -3113,6 +3150,91 @@ export default { 'x-fern-sdk-method-name': 'update', }, }, + '/acs/credentials/assign': { + patch: { + operationId: 'acsCredentialsAssignPatch', + requestBody: { + content: { + 'application/json': { + schema: { + properties: { + acs_credential_id: { format: 'uuid', type: 'string' }, + acs_user_id: { format: 'uuid', type: 'string' }, + }, + required: ['acs_user_id', 'acs_credential_id'], + type: 'object', + }, + }, + }, + }, + responses: { + 200: { + content: { + 'application/json': { + schema: { + properties: { ok: { type: 'boolean' } }, + required: ['ok'], + type: 'object', + }, + }, + }, + description: 'OK', + }, + 400: { description: 'Bad Request' }, + 401: { description: 'Unauthorized' }, + }, + security: [ + { access_token: [], seam_workspace: [] }, + { seam_client_session_token: [] }, + { client_session_token: [] }, + ], + summary: '/acs/credentials/assign', + tags: [], + 'x-fern-ignore': true, + }, + post: { + operationId: 'acsCredentialsAssignPost', + requestBody: { + content: { + 'application/json': { + schema: { + properties: { + acs_credential_id: { format: 'uuid', type: 'string' }, + acs_user_id: { format: 'uuid', type: 'string' }, + }, + required: ['acs_user_id', 'acs_credential_id'], + type: 'object', + }, + }, + }, + }, + responses: { + 200: { + content: { + 'application/json': { + schema: { + properties: { ok: { type: 'boolean' } }, + required: ['ok'], + type: 'object', + }, + }, + }, + description: 'OK', + }, + 400: { description: 'Bad Request' }, + 401: { description: 'Unauthorized' }, + }, + security: [ + { access_token: [], seam_workspace: [] }, + { seam_client_session_token: [] }, + { client_session_token: [] }, + ], + summary: '/acs/credentials/assign', + tags: [], + 'x-fern-sdk-group-name': ['acs', 'credentials'], + 'x-fern-sdk-method-name': 'assign', + }, + }, '/acs/credentials/create': { post: { operationId: 'acsCredentialsCreatePost', @@ -3143,13 +3265,15 @@ export default { acs_user_id: { format: 'uuid', type: 'string' }, code: { nullable: true, type: 'string' }, created_at: { format: 'date-time', type: 'string' }, - external_type: { enum: ['pti_card'], type: 'string' }, + external_type: { + enum: ['pti_card', 'brivo_credential'], + type: 'string', + }, external_type_display_name: { type: 'string' }, workspace_id: { format: 'uuid', type: 'string' }, }, required: [ 'acs_credential_id', - 'acs_user_id', 'acs_system_id', 'code', 'external_type', @@ -3254,13 +3378,15 @@ export default { acs_user_id: { format: 'uuid', type: 'string' }, code: { nullable: true, type: 'string' }, created_at: { format: 'date-time', type: 'string' }, - external_type: { enum: ['pti_card'], type: 'string' }, + external_type: { + enum: ['pti_card', 'brivo_credential'], + type: 'string', + }, external_type_display_name: { type: 'string' }, workspace_id: { format: 'uuid', type: 'string' }, }, required: [ 'acs_credential_id', - 'acs_user_id', 'acs_system_id', 'code', 'external_type', @@ -3342,13 +3468,15 @@ export default { acs_user_id: { format: 'uuid', type: 'string' }, code: { nullable: true, type: 'string' }, created_at: { format: 'date-time', type: 'string' }, - external_type: { enum: ['pti_card'], type: 'string' }, + external_type: { + enum: ['pti_card', 'brivo_credential'], + type: 'string', + }, external_type_display_name: { type: 'string' }, workspace_id: { format: 'uuid', type: 'string' }, }, required: [ 'acs_credential_id', - 'acs_user_id', 'acs_system_id', 'code', 'external_type', @@ -3383,6 +3511,91 @@ export default { 'x-fern-sdk-method-name': 'list', }, }, + '/acs/credentials/unassign': { + patch: { + operationId: 'acsCredentialsUnassignPatch', + requestBody: { + content: { + 'application/json': { + schema: { + properties: { + acs_credential_id: { format: 'uuid', type: 'string' }, + acs_user_id: { format: 'uuid', type: 'string' }, + }, + required: ['acs_user_id', 'acs_credential_id'], + type: 'object', + }, + }, + }, + }, + responses: { + 200: { + content: { + 'application/json': { + schema: { + properties: { ok: { type: 'boolean' } }, + required: ['ok'], + type: 'object', + }, + }, + }, + description: 'OK', + }, + 400: { description: 'Bad Request' }, + 401: { description: 'Unauthorized' }, + }, + security: [ + { access_token: [], seam_workspace: [] }, + { seam_client_session_token: [] }, + { client_session_token: [] }, + ], + summary: '/acs/credentials/unassign', + tags: [], + 'x-fern-ignore': true, + }, + post: { + operationId: 'acsCredentialsUnassignPost', + requestBody: { + content: { + 'application/json': { + schema: { + properties: { + acs_credential_id: { format: 'uuid', type: 'string' }, + acs_user_id: { format: 'uuid', type: 'string' }, + }, + required: ['acs_user_id', 'acs_credential_id'], + type: 'object', + }, + }, + }, + }, + responses: { + 200: { + content: { + 'application/json': { + schema: { + properties: { ok: { type: 'boolean' } }, + required: ['ok'], + type: 'object', + }, + }, + }, + description: 'OK', + }, + 400: { description: 'Bad Request' }, + 401: { description: 'Unauthorized' }, + }, + security: [ + { access_token: [], seam_workspace: [] }, + { seam_client_session_token: [] }, + { client_session_token: [] }, + ], + summary: '/acs/credentials/unassign', + tags: [], + 'x-fern-sdk-group-name': ['acs', 'credentials'], + 'x-fern-sdk-method-name': 'unassign', + }, + }, '/acs/systems/get': { post: { operationId: 'acsSystemsGetPost', @@ -3559,6 +3772,7 @@ export default { format: 'email', type: 'string', }, + email_address: { format: 'email', type: 'string' }, full_name: { type: 'string' }, phone_number: { nullable: true, type: 'string' }, }, @@ -3861,6 +4075,7 @@ export default { format: 'email', type: 'string', }, + email_address: { format: 'email', type: 'string' }, full_name: { type: 'string' }, phone_number: { nullable: true, type: 'string' }, }, @@ -3908,6 +4123,7 @@ export default { format: 'email', type: 'string', }, + email_address: { format: 'email', type: 'string' }, full_name: { type: 'string' }, phone_number: { nullable: true, type: 'string' }, }, @@ -8837,7 +9053,7 @@ export default { tags: ['/workspaces'], 'x-fern-sdk-group-name': ['workspaces'], 'x-fern-sdk-method-name': 'list', - 'x-fern-sdk-return-value': 'workspace', + 'x-fern-sdk-return-value': 'workspaces', }, }, '/workspaces/reset_sandbox': { diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index e3199e4c..70572229 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -632,7 +632,7 @@ export interface Routes { workspace_id: string created_at: string display_name: string - external_type: 'pti_user' + external_type: 'pti_user' | 'brivo_user' external_type_display_name: string is_suspended: boolean full_name?: string | undefined @@ -667,6 +667,18 @@ export interface Routes { formData: {} jsonResponse: {} } + '/acs/credentials/assign': { + route: '/acs/credentials/assign' + method: 'PATCH' | 'POST' + queryParams: {} + jsonBody: { + acs_user_id: string + acs_credential_id: string + } + commonParams: {} + formData: {} + jsonResponse: {} + } '/acs/credentials/create': { route: '/acs/credentials/create' method: 'POST' @@ -680,10 +692,10 @@ export interface Routes { jsonResponse: { acs_credential: { acs_credential_id: string - acs_user_id: string + acs_user_id?: string | undefined acs_system_id: string code: string | null - external_type: 'pti_card' + external_type: 'pti_card' | 'brivo_credential' external_type_display_name: string created_at: string workspace_id: string @@ -713,10 +725,10 @@ export interface Routes { jsonResponse: { acs_credential: { acs_credential_id: string - acs_user_id: string + acs_user_id?: string | undefined acs_system_id: string code: string | null - external_type: 'pti_card' + external_type: 'pti_card' | 'brivo_credential' external_type_display_name: string created_at: string workspace_id: string @@ -743,16 +755,28 @@ export interface Routes { jsonResponse: { acs_credentials: Array<{ acs_credential_id: string - acs_user_id: string + acs_user_id?: string | undefined acs_system_id: string code: string | null - external_type: 'pti_card' + external_type: 'pti_card' | 'brivo_credential' external_type_display_name: string created_at: string workspace_id: string }> } } + '/acs/credentials/unassign': { + route: '/acs/credentials/unassign' + method: 'PATCH' | 'POST' + queryParams: {} + jsonBody: { + acs_user_id: string + acs_credential_id: string + } + commonParams: {} + formData: {} + jsonResponse: {} + } '/acs/systems/get': { route: '/acs/systems/get' method: 'GET' | 'POST' @@ -817,15 +841,16 @@ export interface Routes { route: '/acs/users/create' method: 'POST' queryParams: {} - jsonBody: {} - commonParams: { + jsonBody: { acs_system_id: string acs_access_group_ids?: string[] full_name?: string | undefined /** Deprecated: use email_address. */ email?: string | undefined phone_number?: string | undefined + email_address?: string | undefined } + commonParams: {} formData: {} jsonResponse: { acs_user: { @@ -834,7 +859,7 @@ export interface Routes { workspace_id: string created_at: string display_name: string - external_type: 'pti_user' + external_type: 'pti_user' | 'brivo_user' external_type_display_name: string is_suspended: boolean full_name?: string | undefined @@ -872,7 +897,7 @@ export interface Routes { workspace_id: string created_at: string display_name: string - external_type: 'pti_user' + external_type: 'pti_user' | 'brivo_user' external_type_display_name: string is_suspended: boolean full_name?: string | undefined @@ -899,7 +924,7 @@ export interface Routes { workspace_id: string created_at: string display_name: string - external_type: 'pti_user' + external_type: 'pti_user' | 'brivo_user' external_type_display_name: string is_suspended: boolean full_name?: string | undefined @@ -948,14 +973,15 @@ export interface Routes { route: '/acs/users/update' method: 'PATCH' | 'POST' queryParams: {} - jsonBody: {} - commonParams: { + jsonBody: { acs_user_id: string full_name?: string | undefined /** Deprecated: use email_address. */ email?: string | undefined phone_number?: string | undefined + email_address?: string | undefined } + commonParams: {} formData: {} jsonResponse: {} } @@ -1247,6 +1273,13 @@ export interface Routes { created_at: string login_successful: boolean status: 'pending' | 'failed' | 'authorized' + custom_redirect_url: string | null + custom_redirect_failure_url: string | null + custom_metadata: Record + automatically_manage_new_devices: boolean + wait_for_device_creation: boolean + authorized_at: string | null + selected_provider: string | null } } } @@ -1284,6 +1317,13 @@ export interface Routes { created_at: string login_successful: boolean status: 'pending' | 'failed' | 'authorized' + custom_redirect_url: string | null + custom_redirect_failure_url: string | null + custom_metadata: Record + automatically_manage_new_devices: boolean + wait_for_device_creation: boolean + authorized_at: string | null + selected_provider: string | null } } } @@ -1310,6 +1350,13 @@ export interface Routes { created_at: string login_successful: boolean status: 'pending' | 'failed' | 'authorized' + custom_redirect_url: string | null + custom_redirect_failure_url: string | null + custom_metadata: Record + automatically_manage_new_devices: boolean + wait_for_device_creation: boolean + authorized_at: string | null + selected_provider: string | null }> } } @@ -3297,6 +3344,9 @@ export interface Routes { model: { display_name: string manufacturer_display_name: string + offline_access_codes_supported?: boolean | undefined + access_codes_supported?: boolean | undefined + accessory_keypad_supported?: boolean | undefined } has_direct_power?: boolean | undefined battery_level?: number | undefined @@ -3310,7 +3360,13 @@ export interface Routes { image_url?: string | undefined image_alt_text?: string | undefined serial_number?: string | undefined + /** Currently possible to use online access codes */ + online_access_codes_enabled?: boolean | undefined + /** Currently possible to use offline access codes */ + offline_access_codes_enabled?: boolean | undefined + /** Deprecated: use model.offline_access_codes_enabled. */ supports_accessory_keypad?: boolean | undefined + /** Deprecated: use model.accessory_keypad_supported. */ supports_offline_access_codes?: boolean | undefined } & { august_metadata?: @@ -3874,6 +3930,9 @@ export interface Routes { model: { display_name: string manufacturer_display_name: string + offline_access_codes_supported?: boolean | undefined + access_codes_supported?: boolean | undefined + accessory_keypad_supported?: boolean | undefined } has_direct_power?: boolean | undefined battery_level?: number | undefined @@ -3887,7 +3946,13 @@ export interface Routes { image_url?: string | undefined image_alt_text?: string | undefined serial_number?: string | undefined + /** Currently possible to use online access codes */ + online_access_codes_enabled?: boolean | undefined + /** Currently possible to use offline access codes */ + offline_access_codes_enabled?: boolean | undefined + /** Deprecated: use model.offline_access_codes_enabled. */ supports_accessory_keypad?: boolean | undefined + /** Deprecated: use model.accessory_keypad_supported. */ supports_offline_access_codes?: boolean | undefined } & { august_metadata?: @@ -4572,6 +4637,9 @@ export interface Routes { model: { display_name: string manufacturer_display_name: string + offline_access_codes_supported?: boolean | undefined + access_codes_supported?: boolean | undefined + accessory_keypad_supported?: boolean | undefined } has_direct_power?: boolean | undefined battery_level?: number | undefined @@ -4585,7 +4653,13 @@ export interface Routes { image_url?: string | undefined image_alt_text?: string | undefined serial_number?: string | undefined + /** Currently possible to use online access codes */ + online_access_codes_enabled?: boolean | undefined + /** Currently possible to use offline access codes */ + offline_access_codes_enabled?: boolean | undefined + /** Deprecated: use model.offline_access_codes_enabled. */ supports_accessory_keypad?: boolean | undefined + /** Deprecated: use model.accessory_keypad_supported. */ supports_offline_access_codes?: boolean | undefined } & { august_metadata?: @@ -5149,6 +5223,9 @@ export interface Routes { model: { display_name: string manufacturer_display_name: string + offline_access_codes_supported?: boolean | undefined + access_codes_supported?: boolean | undefined + accessory_keypad_supported?: boolean | undefined } has_direct_power?: boolean | undefined battery_level?: number | undefined @@ -5162,7 +5239,13 @@ export interface Routes { image_url?: string | undefined image_alt_text?: string | undefined serial_number?: string | undefined + /** Currently possible to use online access codes */ + online_access_codes_enabled?: boolean | undefined + /** Currently possible to use offline access codes */ + offline_access_codes_enabled?: boolean | undefined + /** Deprecated: use model.offline_access_codes_enabled. */ supports_accessory_keypad?: boolean | undefined + /** Deprecated: use model.accessory_keypad_supported. */ supports_offline_access_codes?: boolean | undefined } & { august_metadata?: @@ -8173,7 +8256,7 @@ export interface Routes { workspace_id: string created_at: string display_name: string - external_type: 'pti_user' + external_type: 'pti_user' | 'brivo_user' external_type_display_name: string is_suspended: boolean full_name?: string | undefined diff --git a/src/lib/seam/connect/stable/model-types.ts b/src/lib/seam/connect/stable/model-types.ts index 96478285..4c017800 100644 --- a/src/lib/seam/connect/stable/model-types.ts +++ b/src/lib/seam/connect/stable/model-types.ts @@ -1 +1 @@ -export type { ConnectWebview } from './models/index.js' +export type { ConnectWebview, CustomMetadata } from './models/index.js' diff --git a/src/lib/seam/connect/stable/models/connect-webview.ts b/src/lib/seam/connect/stable/models/connect-webview.ts index 5e51e888..3cb64218 100644 --- a/src/lib/seam/connect/stable/models/connect-webview.ts +++ b/src/lib/seam/connect/stable/models/connect-webview.ts @@ -1,5 +1,7 @@ import { z } from 'zod' +import { custom_metadata } from './custom-metadata.js' + export const connect_webview = z.object({ connect_webview_id: z.string().uuid(), connected_account_id: z.string().uuid().optional(), @@ -13,6 +15,13 @@ export const connect_webview = z.object({ created_at: z.string().datetime(), login_successful: z.boolean(), status: z.enum(['pending', 'failed', 'authorized']), + custom_redirect_url: z.string().url().nullable(), + custom_redirect_failure_url: z.string().url().nullable(), + custom_metadata, + automatically_manage_new_devices: z.boolean(), + wait_for_device_creation: z.boolean(), + authorized_at: z.string().datetime().nullable(), + selected_provider: z.string().nullable(), }) export type ConnectWebview = z.infer diff --git a/src/lib/seam/connect/stable/models/custom-metadata.ts b/src/lib/seam/connect/stable/models/custom-metadata.ts new file mode 100644 index 00000000..9095fdf7 --- /dev/null +++ b/src/lib/seam/connect/stable/models/custom-metadata.ts @@ -0,0 +1,12 @@ +import { z } from 'zod' + +export const custom_metadata = z + .record( + z.string().max(40), + z.union([z.string().max(500), z.number(), z.null(), z.boolean()]), + ) + .refine((val) => Object.keys(val).length <= 50, { + message: 'Custom metadata is limited to a maximum of 50 keys', + }) + +export type CustomMetadata = z.infer diff --git a/src/lib/seam/connect/stable/models/index.ts b/src/lib/seam/connect/stable/models/index.ts index 506beb29..50556178 100644 --- a/src/lib/seam/connect/stable/models/index.ts +++ b/src/lib/seam/connect/stable/models/index.ts @@ -1 +1,2 @@ export * from './connect-webview.js' +export * from './custom-metadata.js' diff --git a/src/lib/seam/connect/stable/schemas.ts b/src/lib/seam/connect/stable/schemas.ts index a2dd423d..643dcafc 100644 --- a/src/lib/seam/connect/stable/schemas.ts +++ b/src/lib/seam/connect/stable/schemas.ts @@ -1 +1 @@ -export { connect_webview } from './models/index.js' +export { connect_webview, custom_metadata } from './models/index.js' diff --git a/src/lib/seam/connect/unstable/models/acs/credential.ts b/src/lib/seam/connect/unstable/models/acs/credential.ts index e8933050..e6cf4ec8 100644 --- a/src/lib/seam/connect/unstable/models/acs/credential.ts +++ b/src/lib/seam/connect/unstable/models/acs/credential.ts @@ -1,6 +1,9 @@ import { z } from 'zod' -export const acs_credential_external_type = z.enum(['pti_card']) +export const acs_credential_external_type = z.enum([ + 'pti_card', + 'brivo_credential', +]) export type AcsCredentialExternalType = z.infer< typeof acs_credential_external_type @@ -8,7 +11,7 @@ export type AcsCredentialExternalType = z.infer< export const acs_credential = z.object({ acs_credential_id: z.string().uuid(), - acs_user_id: z.string().uuid(), + acs_user_id: z.string().uuid().optional(), acs_system_id: z.string().uuid(), code: z.string().nullable(), external_type: acs_credential_external_type, diff --git a/src/lib/seam/connect/unstable/models/acs/user.ts b/src/lib/seam/connect/unstable/models/acs/user.ts index 6d069243..4624d906 100644 --- a/src/lib/seam/connect/unstable/models/acs/user.ts +++ b/src/lib/seam/connect/unstable/models/acs/user.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -export const acs_user_external_type = z.enum(['pti_user']) +export const acs_user_external_type = z.enum(['pti_user', 'brivo_user']) export type AcsUserExternalType = z.infer