From 85092e2fbc98d124a506e6f018c7e0c175598277 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Tue, 14 Nov 2023 09:56:37 -0800 Subject: [PATCH] feat: /acs/credentials/assign responds with an acs_credential (#283) --- src/lib/seam/connect/openapi.ts | 106 +++++++++++++++++++++------- src/lib/seam/connect/route-types.ts | 14 +++- 2 files changed, 94 insertions(+), 26 deletions(-) diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index 68742a5d..577dac2e 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -1374,6 +1374,24 @@ export default { ], type: 'object', }, + device_provider: { + properties: { + device_provider_name: { type: 'string' }, + display_name: { type: 'string' }, + image_url: { type: 'string' }, + provider_categories: { + items: { enum: ['stable', 'consumer_smartlocks'], type: 'string' }, + type: 'array', + }, + }, + required: [ + 'device_provider_name', + 'display_name', + 'image_url', + 'provider_categories', + ], + type: 'object', + }, event: { properties: { created_at: { format: 'date-time', type: 'string' }, @@ -3022,8 +3040,37 @@ export default { content: { 'application/json': { schema: { - properties: { ok: { type: 'boolean' } }, - required: ['ok'], + properties: { + acs_credential: { + properties: { + acs_credential_id: { format: 'uuid', type: 'string' }, + acs_system_id: { format: 'uuid', type: 'string' }, + acs_user_id: { format: 'uuid', type: 'string' }, + code: { nullable: true, type: 'string' }, + created_at: { format: 'date-time', type: 'string' }, + display_name: { minLength: 1, 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_system_id', + 'display_name', + 'code', + 'external_type', + 'external_type_display_name', + 'created_at', + 'workspace_id', + ], + type: 'object', + }, + ok: { type: 'boolean' }, + }, + required: ['acs_credential', 'ok'], type: 'object', }, }, @@ -3063,8 +3110,37 @@ export default { content: { 'application/json': { schema: { - properties: { ok: { type: 'boolean' } }, - required: ['ok'], + properties: { + acs_credential: { + properties: { + acs_credential_id: { format: 'uuid', type: 'string' }, + acs_system_id: { format: 'uuid', type: 'string' }, + acs_user_id: { format: 'uuid', type: 'string' }, + code: { nullable: true, type: 'string' }, + created_at: { format: 'date-time', type: 'string' }, + display_name: { minLength: 1, 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_system_id', + 'display_name', + 'code', + 'external_type', + 'external_type_display_name', + 'created_at', + 'workspace_id', + ], + type: 'object', + }, + ok: { type: 'boolean' }, + }, + required: ['acs_credential', 'ok'], type: 'object', }, }, @@ -5594,27 +5670,7 @@ export default { schema: { properties: { device_providers: { - items: { - properties: { - device_provider_name: { type: 'string' }, - display_name: { type: 'string' }, - image_url: { type: 'string' }, - provider_categories: { - items: { - enum: ['stable', 'consumer_smartlocks'], - type: 'string', - }, - type: 'array', - }, - }, - required: [ - 'device_provider_name', - 'display_name', - 'image_url', - 'provider_categories', - ], - type: 'object', - }, + items: { $ref: '#/components/schemas/device_provider' }, type: 'array', }, ok: { type: 'boolean' }, diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 511397a3..61e4e325 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -620,7 +620,19 @@ export interface Routes { } commonParams: {} formData: {} - jsonResponse: {} + jsonResponse: { + acs_credential: { + acs_credential_id: string + acs_user_id?: string | undefined + acs_system_id: string + display_name: string + code: string | null + external_type: 'pti_card' | 'brivo_credential' + external_type_display_name: string + created_at: string + workspace_id: string + } + } } '/acs/credentials/create': { route: '/acs/credentials/create'