From 135e2a166f930807ab774cbec2426aa5fe8e86c5 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 26 Sep 2023 17:41:44 -0700 Subject: [PATCH] Fix types --- generate-routes.ts | 3 +++ .../seam/connect/routes/access-codes-unmanaged.ts | 14 ++++++-------- src/lib/seam/connect/routes/access-codes.ts | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/generate-routes.ts b/generate-routes.ts index 5655c06d..67cc16a7 100644 --- a/generate-routes.ts +++ b/generate-routes.ts @@ -55,6 +55,7 @@ const endpointResources: Partial< Record< keyof typeof openapi.paths, | 'action_attempt' + | 'access_codes' | 'device_providers' | 'generated_code' | 'backup_access_code' @@ -63,7 +64,9 @@ const endpointResources: Partial< > > = { '/access_codes/generate_code': 'generated_code', + '/access_codes/create_multiple': 'access_codes', '/access_codes/pull_backup_access_code': 'backup_access_code', + '/access_codes/unmanaged/convert_to_managed': null, '/acs/access_groups/list_users': 'acs_users', '/acs/access_groups/remove_user': null, '/acs/users/add_to_access_group': null, diff --git a/src/lib/seam/connect/routes/access-codes-unmanaged.ts b/src/lib/seam/connect/routes/access-codes-unmanaged.ts index 71ed4644..9d1be4cf 100644 --- a/src/lib/seam/connect/routes/access-codes-unmanaged.ts +++ b/src/lib/seam/connect/routes/access-codes-unmanaged.ts @@ -66,14 +66,12 @@ export class SeamHttpAccessCodesUnmanaged { async convertToManaged( body: AccessCodesUnmanagedConvertToManagedBody, - ): Promise { - const { data } = - await this.client.request({ - url: '/access_codes/unmanaged/convert_to_managed', - method: 'post', - data: body, - }) - return data.access_code + ): Promise { + await this.client.request({ + url: '/access_codes/unmanaged/convert_to_managed', + method: 'post', + data: body, + }) } async delete(body: AccessCodesUnmanagedDeleteBody): Promise { diff --git a/src/lib/seam/connect/routes/access-codes.ts b/src/lib/seam/connect/routes/access-codes.ts index 76f4a3f7..99d0ef82 100644 --- a/src/lib/seam/connect/routes/access-codes.ts +++ b/src/lib/seam/connect/routes/access-codes.ts @@ -81,14 +81,14 @@ export class SeamHttpAccessCodes { async createMultiple( body: AccessCodesCreateMultipleBody, - ): Promise { + ): Promise { const { data } = await this.client.request({ url: '/access_codes/create_multiple', method: 'post', data: body, }) - return data.access_code + return data.access_codes } async delete(body: AccessCodesDeleteBody): Promise {