From 7a0bd51454afa23eca7d1fed0ff70c63d0c3f5b6 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Fri, 11 Oct 2024 16:53:08 -0700 Subject: [PATCH] Revert delete type name changes --- generate-routes.ts | 9 +++++---- src/lib/seam/connect/routes/acs-access-groups.ts | 4 ++-- src/lib/seam/connect/routes/acs-users.ts | 8 ++++---- src/lib/seam/connect/routes/client-sessions.ts | 4 ++-- src/lib/seam/connect/routes/phones.ts | 4 ++-- src/lib/seam/connect/routes/user-identities.ts | 8 ++++---- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/generate-routes.ts b/generate-routes.ts index 71dbf127..ea9812db 100644 --- a/generate-routes.ts +++ b/generate-routes.ts @@ -452,13 +452,14 @@ const renderRequestType = ({ // and https://github.com/seamapi/javascript-http/issues/43 const requestFormatToRequestType = ( name: string, - _namespace: string, + namespace: string, ): 'params' | 'body' => { + if (namespace.includes('simulate')) return 'body' if (['get', 'list', 'view'].includes(name)) return 'params' if (['delete'].includes(name)) return 'params' - if (name.includes('revoke')) return 'body' - if (name.includes('remove')) return 'body' - if (name.includes('deactivate')) return 'body' + if (name.includes('revoke')) return 'params' + if (name.includes('remove')) return 'params' + if (name.includes('deactivate')) return 'params' if (name.startsWith('list')) return 'params' return 'body' } diff --git a/src/lib/seam/connect/routes/acs-access-groups.ts b/src/lib/seam/connect/routes/acs-access-groups.ts index 7cc6d073..32f010d9 100644 --- a/src/lib/seam/connect/routes/acs-access-groups.ts +++ b/src/lib/seam/connect/routes/acs-access-groups.ts @@ -219,7 +219,7 @@ export class SeamHttpAcsAccessGroups { } removeUser( - body?: AcsAccessGroupsRemoveUserBody, + body?: AcsAccessGroupsRemoveUserParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { path: '/acs/access_groups/remove_user', @@ -275,7 +275,7 @@ export type AcsAccessGroupsListUsersResponse = SetNonNullable< export type AcsAccessGroupsListUsersOptions = never -export type AcsAccessGroupsRemoveUserBody = +export type AcsAccessGroupsRemoveUserParams = RouteRequestBody<'/acs/access_groups/remove_user'> export type AcsAccessGroupsRemoveUserResponse = SetNonNullable< diff --git a/src/lib/seam/connect/routes/acs-users.ts b/src/lib/seam/connect/routes/acs-users.ts index a7e4809f..b09257ef 100644 --- a/src/lib/seam/connect/routes/acs-users.ts +++ b/src/lib/seam/connect/routes/acs-users.ts @@ -224,7 +224,7 @@ export class SeamHttpAcsUsers { } removeFromAccessGroup( - body?: AcsUsersRemoveFromAccessGroupBody, + body?: AcsUsersRemoveFromAccessGroupParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { path: '/acs/users/remove_from_access_group', @@ -235,7 +235,7 @@ export class SeamHttpAcsUsers { } revokeAccessToAllEntrances( - body?: AcsUsersRevokeAccessToAllEntrancesBody, + body?: AcsUsersRevokeAccessToAllEntrancesParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { path: '/acs/users/revoke_access_to_all_entrances', @@ -323,7 +323,7 @@ export type AcsUsersListAccessibleEntrancesResponse = SetNonNullable< export type AcsUsersListAccessibleEntrancesOptions = never -export type AcsUsersRemoveFromAccessGroupBody = +export type AcsUsersRemoveFromAccessGroupParams = RouteRequestBody<'/acs/users/remove_from_access_group'> export type AcsUsersRemoveFromAccessGroupResponse = SetNonNullable< @@ -332,7 +332,7 @@ export type AcsUsersRemoveFromAccessGroupResponse = SetNonNullable< export type AcsUsersRemoveFromAccessGroupOptions = never -export type AcsUsersRevokeAccessToAllEntrancesBody = +export type AcsUsersRevokeAccessToAllEntrancesParams = RouteRequestBody<'/acs/users/revoke_access_to_all_entrances'> export type AcsUsersRevokeAccessToAllEntrancesResponse = SetNonNullable< diff --git a/src/lib/seam/connect/routes/client-sessions.ts b/src/lib/seam/connect/routes/client-sessions.ts index e9c64e87..3497fb2f 100644 --- a/src/lib/seam/connect/routes/client-sessions.ts +++ b/src/lib/seam/connect/routes/client-sessions.ts @@ -216,7 +216,7 @@ export class SeamHttpClientSessions { }) } - revoke(body?: ClientSessionsRevokeBody): SeamHttpRequest { + revoke(body?: ClientSessionsRevokeParams): SeamHttpRequest { return new SeamHttpRequest(this, { path: '/client_sessions/revoke', method: 'post', @@ -278,7 +278,7 @@ export type ClientSessionsListResponse = SetNonNullable< export type ClientSessionsListOptions = never -export type ClientSessionsRevokeBody = +export type ClientSessionsRevokeParams = RouteRequestBody<'/client_sessions/revoke'> export type ClientSessionsRevokeResponse = SetNonNullable< diff --git a/src/lib/seam/connect/routes/phones.ts b/src/lib/seam/connect/routes/phones.ts index 006c6ae4..405ab265 100644 --- a/src/lib/seam/connect/routes/phones.ts +++ b/src/lib/seam/connect/routes/phones.ts @@ -159,7 +159,7 @@ export class SeamHttpPhones { return SeamHttpPhonesSimulate.fromClient(this.client, this.defaults) } - deactivate(body?: PhonesDeactivateBody): SeamHttpRequest { + deactivate(body?: PhonesDeactivateParams): SeamHttpRequest { return new SeamHttpRequest(this, { path: '/phones/deactivate', method: 'post', @@ -178,7 +178,7 @@ export class SeamHttpPhones { } } -export type PhonesDeactivateBody = RouteRequestBody<'/phones/deactivate'> +export type PhonesDeactivateParams = RouteRequestBody<'/phones/deactivate'> export type PhonesDeactivateResponse = SetNonNullable< Required> diff --git a/src/lib/seam/connect/routes/user-identities.ts b/src/lib/seam/connect/routes/user-identities.ts index 153604cb..8235aa7e 100644 --- a/src/lib/seam/connect/routes/user-identities.ts +++ b/src/lib/seam/connect/routes/user-identities.ts @@ -260,7 +260,7 @@ export class SeamHttpUserIdentities { } removeAcsUser( - body?: UserIdentitiesRemoveAcsUserBody, + body?: UserIdentitiesRemoveAcsUserParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { path: '/user_identities/remove_acs_user', @@ -271,7 +271,7 @@ export class SeamHttpUserIdentities { } revokeAccessToDevice( - body?: UserIdentitiesRevokeAccessToDeviceBody, + body?: UserIdentitiesRevokeAccessToDeviceParams, ): SeamHttpRequest { return new SeamHttpRequest(this, { path: '/user_identities/revoke_access_to_device', @@ -370,7 +370,7 @@ export type UserIdentitiesListAcsUsersResponse = SetNonNullable< export type UserIdentitiesListAcsUsersOptions = never -export type UserIdentitiesRemoveAcsUserBody = +export type UserIdentitiesRemoveAcsUserParams = RouteRequestBody<'/user_identities/remove_acs_user'> export type UserIdentitiesRemoveAcsUserResponse = SetNonNullable< @@ -379,7 +379,7 @@ export type UserIdentitiesRemoveAcsUserResponse = SetNonNullable< export type UserIdentitiesRemoveAcsUserOptions = never -export type UserIdentitiesRevokeAccessToDeviceBody = +export type UserIdentitiesRevokeAccessToDeviceParams = RouteRequestBody<'/user_identities/revoke_access_to_device'> export type UserIdentitiesRevokeAccessToDeviceResponse = SetNonNullable<