@seamapi/http 1.73.0 → 1.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/connect.cjs +478 -5
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +169 -3
  4. package/dist/index.cjs +486 -5
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/access-grants/access-grants.d.ts +2 -0
  8. package/lib/seam/connect/routes/access-grants/access-grants.js +4 -0
  9. package/lib/seam/connect/routes/access-grants/access-grants.js.map +1 -1
  10. package/lib/seam/connect/routes/access-grants/index.d.ts +1 -0
  11. package/lib/seam/connect/routes/access-grants/index.js +1 -0
  12. package/lib/seam/connect/routes/access-grants/index.js.map +1 -1
  13. package/lib/seam/connect/routes/access-grants/unmanaged/index.d.ts +1 -0
  14. package/lib/seam/connect/routes/access-grants/unmanaged/index.js +6 -0
  15. package/lib/seam/connect/routes/access-grants/unmanaged/index.js.map +1 -0
  16. package/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.d.ts +47 -0
  17. package/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.js +107 -0
  18. package/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.js.map +1 -0
  19. package/lib/seam/connect/routes/access-methods/access-methods.d.ts +2 -0
  20. package/lib/seam/connect/routes/access-methods/access-methods.js +4 -0
  21. package/lib/seam/connect/routes/access-methods/access-methods.js.map +1 -1
  22. package/lib/seam/connect/routes/access-methods/index.d.ts +1 -0
  23. package/lib/seam/connect/routes/access-methods/index.js +1 -0
  24. package/lib/seam/connect/routes/access-methods/index.js.map +1 -1
  25. package/lib/seam/connect/routes/access-methods/unmanaged/index.d.ts +1 -0
  26. package/lib/seam/connect/routes/access-methods/unmanaged/index.js +6 -0
  27. package/lib/seam/connect/routes/access-methods/unmanaged/index.js.map +1 -0
  28. package/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.d.ts +47 -0
  29. package/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.js +107 -0
  30. package/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.js.map +1 -0
  31. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
  32. package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
  33. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
  34. package/lib/seam/connect/routes/seam/customer/v1/spaces/index.d.ts +1 -0
  35. package/lib/seam/connect/routes/seam/customer/v1/spaces/index.js +6 -0
  36. package/lib/seam/connect/routes/seam/customer/v1/spaces/index.js.map +1 -0
  37. package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.d.ts +34 -0
  38. package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.js +98 -0
  39. package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.js.map +1 -0
  40. package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
  41. package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -3
  42. package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
  43. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +13 -2
  44. package/lib/seam/connect/routes/seam-http-endpoints.js +53 -0
  45. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  46. package/lib/seam/connect/routes/user-identities/index.d.ts +1 -0
  47. package/lib/seam/connect/routes/user-identities/index.js +1 -0
  48. package/lib/seam/connect/routes/user-identities/index.js.map +1 -1
  49. package/lib/seam/connect/routes/user-identities/unmanaged/index.d.ts +1 -0
  50. package/lib/seam/connect/routes/user-identities/unmanaged/index.js +6 -0
  51. package/lib/seam/connect/routes/user-identities/unmanaged/index.js.map +1 -0
  52. package/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.d.ts +47 -0
  53. package/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.js +107 -0
  54. package/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.js.map +1 -0
  55. package/lib/seam/connect/routes/user-identities/user-identities.d.ts +2 -0
  56. package/lib/seam/connect/routes/user-identities/user-identities.js +4 -0
  57. package/lib/seam/connect/routes/user-identities/user-identities.js.map +1 -1
  58. package/lib/version.d.ts +1 -1
  59. package/lib/version.js +1 -1
  60. package/package.json +3 -3
  61. package/src/lib/seam/connect/routes/access-grants/access-grants.ts +6 -0
  62. package/src/lib/seam/connect/routes/access-grants/index.ts +1 -0
  63. package/src/lib/seam/connect/routes/access-grants/unmanaged/index.ts +6 -0
  64. package/src/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.ts +236 -0
  65. package/src/lib/seam/connect/routes/access-methods/access-methods.ts +6 -0
  66. package/src/lib/seam/connect/routes/access-methods/index.ts +1 -0
  67. package/src/lib/seam/connect/routes/access-methods/unmanaged/index.ts +6 -0
  68. package/src/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.ts +237 -0
  69. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
  70. package/src/lib/seam/connect/routes/seam/customer/v1/spaces/index.ts +6 -0
  71. package/src/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.ts +201 -0
  72. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +5 -5
  73. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +131 -0
  74. package/src/lib/seam/connect/routes/user-identities/index.ts +1 -0
  75. package/src/lib/seam/connect/routes/user-identities/unmanaged/index.ts +6 -0
  76. package/src/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.ts +240 -0
  77. package/src/lib/seam/connect/routes/user-identities/user-identities.ts +8 -0
  78. package/src/lib/version.ts +1 -1
@@ -0,0 +1,201 @@
1
+ /*
2
+ * Automatically generated by codegen/smith.ts.
3
+ * Do not edit this file or add other files to this directory.
4
+ */
5
+
6
+ import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
7
+
8
+ import { seamApiLtsVersion } from 'lib/lts-version.js'
9
+ import {
10
+ getAuthHeadersForClientSessionToken,
11
+ warnOnInsecureuserIdentifierKey,
12
+ } from 'lib/seam/connect/auth.js'
13
+ import { type Client, createClient } from 'lib/seam/connect/client.js'
14
+ import {
15
+ isSeamHttpOptionsWithApiKey,
16
+ isSeamHttpOptionsWithClient,
17
+ isSeamHttpOptionsWithClientSessionToken,
18
+ isSeamHttpOptionsWithConsoleSessionToken,
19
+ isSeamHttpOptionsWithPersonalAccessToken,
20
+ type SeamHttpFromPublishableKeyOptions,
21
+ SeamHttpInvalidOptionsError,
22
+ type SeamHttpOptions,
23
+ type SeamHttpOptionsWithApiKey,
24
+ type SeamHttpOptionsWithClient,
25
+ type SeamHttpOptionsWithClientSessionToken,
26
+ type SeamHttpOptionsWithConsoleSessionToken,
27
+ type SeamHttpOptionsWithPersonalAccessToken,
28
+ type SeamHttpRequestOptions,
29
+ } from 'lib/seam/connect/options.js'
30
+ import {
31
+ limitToSeamHttpRequestOptions,
32
+ parseOptions,
33
+ } from 'lib/seam/connect/parse-options.js'
34
+ import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
35
+ import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
36
+ import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
37
+ import type { SetNonNullable } from 'lib/types.js'
38
+
39
+ export class SeamHttpSeamCustomerV1Spaces {
40
+ client: Client
41
+ readonly defaults: Required<SeamHttpRequestOptions>
42
+ readonly ltsVersion = seamApiLtsVersion
43
+ static ltsVersion = seamApiLtsVersion
44
+
45
+ constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
46
+ const options = parseOptions(apiKeyOrOptions)
47
+ this.client = 'client' in options ? options.client : createClient(options)
48
+ this.defaults = limitToSeamHttpRequestOptions(options)
49
+ }
50
+
51
+ static fromClient(
52
+ client: SeamHttpOptionsWithClient['client'],
53
+ options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
54
+ ): SeamHttpSeamCustomerV1Spaces {
55
+ const constructorOptions = { ...options, client }
56
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
57
+ throw new SeamHttpInvalidOptionsError('Missing client')
58
+ }
59
+ return new SeamHttpSeamCustomerV1Spaces(constructorOptions)
60
+ }
61
+
62
+ static fromApiKey(
63
+ apiKey: SeamHttpOptionsWithApiKey['apiKey'],
64
+ options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
65
+ ): SeamHttpSeamCustomerV1Spaces {
66
+ const constructorOptions = { ...options, apiKey }
67
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
68
+ throw new SeamHttpInvalidOptionsError('Missing apiKey')
69
+ }
70
+ return new SeamHttpSeamCustomerV1Spaces(constructorOptions)
71
+ }
72
+
73
+ static fromClientSessionToken(
74
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
75
+ options: Omit<
76
+ SeamHttpOptionsWithClientSessionToken,
77
+ 'clientSessionToken'
78
+ > = {},
79
+ ): SeamHttpSeamCustomerV1Spaces {
80
+ const constructorOptions = { ...options, clientSessionToken }
81
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
82
+ throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
83
+ }
84
+ return new SeamHttpSeamCustomerV1Spaces(constructorOptions)
85
+ }
86
+
87
+ static async fromPublishableKey(
88
+ publishableKey: string,
89
+ userIdentifierKey: string,
90
+ options: SeamHttpFromPublishableKeyOptions = {},
91
+ ): Promise<SeamHttpSeamCustomerV1Spaces> {
92
+ warnOnInsecureuserIdentifierKey(userIdentifierKey)
93
+ const clientOptions = parseOptions({ ...options, publishableKey })
94
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
95
+ throw new SeamHttpInvalidOptionsError(
96
+ 'The client option cannot be used with SeamHttpSeamCustomerV1Spaces.fromPublishableKey',
97
+ )
98
+ }
99
+ const client = createClient(clientOptions)
100
+ const clientSessions = SeamHttpClientSessions.fromClient(client)
101
+ const { token } = await clientSessions.getOrCreate({
102
+ user_identifier_key: userIdentifierKey,
103
+ })
104
+ return SeamHttpSeamCustomerV1Spaces.fromClientSessionToken(token, options)
105
+ }
106
+
107
+ static fromConsoleSessionToken(
108
+ consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
109
+ workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
110
+ options: Omit<
111
+ SeamHttpOptionsWithConsoleSessionToken,
112
+ 'consoleSessionToken' | 'workspaceId'
113
+ > = {},
114
+ ): SeamHttpSeamCustomerV1Spaces {
115
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId }
116
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
117
+ throw new SeamHttpInvalidOptionsError(
118
+ 'Missing consoleSessionToken or workspaceId',
119
+ )
120
+ }
121
+ return new SeamHttpSeamCustomerV1Spaces(constructorOptions)
122
+ }
123
+
124
+ static fromPersonalAccessToken(
125
+ personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
126
+ workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
127
+ options: Omit<
128
+ SeamHttpOptionsWithPersonalAccessToken,
129
+ 'personalAccessToken' | 'workspaceId'
130
+ > = {},
131
+ ): SeamHttpSeamCustomerV1Spaces {
132
+ const constructorOptions = { ...options, personalAccessToken, workspaceId }
133
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
134
+ throw new SeamHttpInvalidOptionsError(
135
+ 'Missing personalAccessToken or workspaceId',
136
+ )
137
+ }
138
+ return new SeamHttpSeamCustomerV1Spaces(constructorOptions)
139
+ }
140
+
141
+ createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
142
+ request: SeamHttpRequest<TResponse, TResponseKey>,
143
+ ): SeamPaginator<TResponse, TResponseKey> {
144
+ return new SeamPaginator<TResponse, TResponseKey>(this, request)
145
+ }
146
+
147
+ async updateClientSessionToken(
148
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
149
+ ): Promise<void> {
150
+ const { headers } = this.client.defaults
151
+ const authHeaders = getAuthHeadersForClientSessionToken({
152
+ clientSessionToken,
153
+ })
154
+ for (const key of Object.keys(authHeaders)) {
155
+ if (headers[key] == null) {
156
+ throw new Error(
157
+ 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
158
+ )
159
+ }
160
+ }
161
+ this.client.defaults.headers = { ...headers, ...authHeaders }
162
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client)
163
+ await clientSessions.get()
164
+ }
165
+
166
+ create(
167
+ parameters?: SeamCustomerV1SpacesCreateParameters,
168
+ options: SeamCustomerV1SpacesCreateOptions = {},
169
+ ): SeamCustomerV1SpacesCreateRequest {
170
+ return new SeamHttpRequest(this, {
171
+ pathname: '/seam/customer/v1/spaces/create',
172
+ method: 'POST',
173
+ body: parameters,
174
+ responseKey: 'space',
175
+ options,
176
+ })
177
+ }
178
+ }
179
+
180
+ export type SeamCustomerV1SpacesCreateParameters =
181
+ RouteRequestBody<'/seam/customer/v1/spaces/create'>
182
+
183
+ /**
184
+ * @deprecated Use SeamCustomerV1SpacesCreateParameters instead.
185
+ */
186
+ export type SeamCustomerV1SpacesCreateBody =
187
+ SeamCustomerV1SpacesCreateParameters
188
+
189
+ /**
190
+ * @deprecated Use SeamCustomerV1SpacesCreateRequest instead.
191
+ */
192
+ export type SeamCustomerV1SpacesCreateResponse = SetNonNullable<
193
+ Required<RouteResponse<'/seam/customer/v1/spaces/create'>>
194
+ >
195
+
196
+ export type SeamCustomerV1SpacesCreateRequest = SeamHttpRequest<
197
+ SeamCustomerV1SpacesCreateResponse,
198
+ 'space'
199
+ >
200
+
201
+ export interface SeamCustomerV1SpacesCreateOptions {}
@@ -39,6 +39,7 @@ import { SeamHttpSeamCustomerV1Events } from './events/index.js'
39
39
  import { SeamHttpSeamCustomerV1Portals } from './portals/index.js'
40
40
  import { SeamHttpSeamCustomerV1Reservations } from './reservations/index.js'
41
41
  import { SeamHttpSeamCustomerV1Settings } from './settings/index.js'
42
+ import { SeamHttpSeamCustomerV1Spaces } from './spaces/index.js'
42
43
 
43
44
  export class SeamHttpSeamCustomerV1 {
44
45
  client: Client
@@ -48,11 +49,6 @@ export class SeamHttpSeamCustomerV1 {
48
49
 
49
50
  constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
50
51
  const options = parseOptions(apiKeyOrOptions)
51
- if (!options.isUndocumentedApiEnabled) {
52
- throw new Error(
53
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
54
- )
55
- }
56
52
  this.client = 'client' in options ? options.client : createClient(options)
57
53
  this.defaults = limitToSeamHttpRequestOptions(options)
58
54
  }
@@ -204,4 +200,8 @@ export class SeamHttpSeamCustomerV1 {
204
200
  get settings(): SeamHttpSeamCustomerV1Settings {
205
201
  return SeamHttpSeamCustomerV1Settings.fromClient(this.client, this.defaults)
206
202
  }
203
+
204
+ get spaces(): SeamHttpSeamCustomerV1Spaces {
205
+ return SeamHttpSeamCustomerV1Spaces.fromClient(this.client, this.defaults)
206
+ }
207
207
  }
@@ -110,6 +110,15 @@ import {
110
110
  type AccessGrantsUpdateRequest,
111
111
  SeamHttpAccessGrants,
112
112
  } from './access-grants/index.js'
113
+ import {
114
+ type AccessGrantsUnmanagedGetOptions,
115
+ type AccessGrantsUnmanagedGetParameters,
116
+ type AccessGrantsUnmanagedGetRequest,
117
+ type AccessGrantsUnmanagedListOptions,
118
+ type AccessGrantsUnmanagedListParameters,
119
+ type AccessGrantsUnmanagedListRequest,
120
+ SeamHttpAccessGrantsUnmanaged,
121
+ } from './access-grants/unmanaged/index.js'
113
122
  import {
114
123
  type AccessMethodsDeleteOptions,
115
124
  type AccessMethodsDeleteParameters,
@@ -128,6 +137,15 @@ import {
128
137
  type AccessMethodsListRequest,
129
138
  SeamHttpAccessMethods,
130
139
  } from './access-methods/index.js'
140
+ import {
141
+ type AccessMethodsUnmanagedGetOptions,
142
+ type AccessMethodsUnmanagedGetParameters,
143
+ type AccessMethodsUnmanagedGetRequest,
144
+ type AccessMethodsUnmanagedListOptions,
145
+ type AccessMethodsUnmanagedListParameters,
146
+ type AccessMethodsUnmanagedListRequest,
147
+ SeamHttpAccessMethodsUnmanaged,
148
+ } from './access-methods/unmanaged/index.js'
131
149
  import {
132
150
  type AcsAccessGroupsAddUserOptions,
133
151
  type AcsAccessGroupsAddUserParameters,
@@ -602,6 +620,12 @@ import {
602
620
  type SeamCustomerV1SettingsUpdateRequest,
603
621
  SeamHttpSeamCustomerV1Settings,
604
622
  } from './seam/customer/v1/settings/index.js'
623
+ import {
624
+ type SeamCustomerV1SpacesCreateOptions,
625
+ type SeamCustomerV1SpacesCreateParameters,
626
+ type SeamCustomerV1SpacesCreateRequest,
627
+ SeamHttpSeamCustomerV1Spaces,
628
+ } from './seam/customer/v1/spaces/index.js'
605
629
  import {
606
630
  SeamHttpSeamPartnerV1BuildingBlocksSpaces,
607
631
  type SeamPartnerV1BuildingBlocksSpacesAutoMapOptions,
@@ -800,6 +824,15 @@ import {
800
824
  type UserIdentitiesUpdateParameters,
801
825
  type UserIdentitiesUpdateRequest,
802
826
  } from './user-identities/index.js'
827
+ import {
828
+ SeamHttpUserIdentitiesUnmanaged,
829
+ type UserIdentitiesUnmanagedGetOptions,
830
+ type UserIdentitiesUnmanagedGetParameters,
831
+ type UserIdentitiesUnmanagedGetRequest,
832
+ type UserIdentitiesUnmanagedListOptions,
833
+ type UserIdentitiesUnmanagedListParameters,
834
+ type UserIdentitiesUnmanagedListRequest,
835
+ } from './user-identities/unmanaged/index.js'
803
836
  import {
804
837
  SeamHttpWebhooks,
805
838
  type WebhooksCreateOptions,
@@ -1273,6 +1306,32 @@ export class SeamHttpEndpoints {
1273
1306
  }
1274
1307
  }
1275
1308
 
1309
+ get '/access_grants/unmanaged/get'(): (
1310
+ parameters?: AccessGrantsUnmanagedGetParameters,
1311
+ options?: AccessGrantsUnmanagedGetOptions,
1312
+ ) => AccessGrantsUnmanagedGetRequest {
1313
+ const { client, defaults } = this
1314
+ return function accessGrantsUnmanagedGet(
1315
+ ...args: Parameters<SeamHttpAccessGrantsUnmanaged['get']>
1316
+ ): ReturnType<SeamHttpAccessGrantsUnmanaged['get']> {
1317
+ const seam = SeamHttpAccessGrantsUnmanaged.fromClient(client, defaults)
1318
+ return seam.get(...args)
1319
+ }
1320
+ }
1321
+
1322
+ get '/access_grants/unmanaged/list'(): (
1323
+ parameters?: AccessGrantsUnmanagedListParameters,
1324
+ options?: AccessGrantsUnmanagedListOptions,
1325
+ ) => AccessGrantsUnmanagedListRequest {
1326
+ const { client, defaults } = this
1327
+ return function accessGrantsUnmanagedList(
1328
+ ...args: Parameters<SeamHttpAccessGrantsUnmanaged['list']>
1329
+ ): ReturnType<SeamHttpAccessGrantsUnmanaged['list']> {
1330
+ const seam = SeamHttpAccessGrantsUnmanaged.fromClient(client, defaults)
1331
+ return seam.list(...args)
1332
+ }
1333
+ }
1334
+
1276
1335
  get '/access_methods/delete'(): (
1277
1336
  parameters?: AccessMethodsDeleteParameters,
1278
1337
  options?: AccessMethodsDeleteOptions,
@@ -1338,6 +1397,32 @@ export class SeamHttpEndpoints {
1338
1397
  }
1339
1398
  }
1340
1399
 
1400
+ get '/access_methods/unmanaged/get'(): (
1401
+ parameters?: AccessMethodsUnmanagedGetParameters,
1402
+ options?: AccessMethodsUnmanagedGetOptions,
1403
+ ) => AccessMethodsUnmanagedGetRequest {
1404
+ const { client, defaults } = this
1405
+ return function accessMethodsUnmanagedGet(
1406
+ ...args: Parameters<SeamHttpAccessMethodsUnmanaged['get']>
1407
+ ): ReturnType<SeamHttpAccessMethodsUnmanaged['get']> {
1408
+ const seam = SeamHttpAccessMethodsUnmanaged.fromClient(client, defaults)
1409
+ return seam.get(...args)
1410
+ }
1411
+ }
1412
+
1413
+ get '/access_methods/unmanaged/list'(): (
1414
+ parameters?: AccessMethodsUnmanagedListParameters,
1415
+ options?: AccessMethodsUnmanagedListOptions,
1416
+ ) => AccessMethodsUnmanagedListRequest {
1417
+ const { client, defaults } = this
1418
+ return function accessMethodsUnmanagedList(
1419
+ ...args: Parameters<SeamHttpAccessMethodsUnmanaged['list']>
1420
+ ): ReturnType<SeamHttpAccessMethodsUnmanaged['list']> {
1421
+ const seam = SeamHttpAccessMethodsUnmanaged.fromClient(client, defaults)
1422
+ return seam.list(...args)
1423
+ }
1424
+ }
1425
+
1341
1426
  get '/acs/access_groups/add_user'(): (
1342
1427
  parameters?: AcsAccessGroupsAddUserParameters,
1343
1428
  options?: AcsAccessGroupsAddUserOptions,
@@ -3072,6 +3157,19 @@ export class SeamHttpEndpoints {
3072
3157
  }
3073
3158
  }
3074
3159
 
3160
+ get '/seam/customer/v1/spaces/create'(): (
3161
+ parameters?: SeamCustomerV1SpacesCreateParameters,
3162
+ options?: SeamCustomerV1SpacesCreateOptions,
3163
+ ) => SeamCustomerV1SpacesCreateRequest {
3164
+ const { client, defaults } = this
3165
+ return function seamCustomerV1SpacesCreate(
3166
+ ...args: Parameters<SeamHttpSeamCustomerV1Spaces['create']>
3167
+ ): ReturnType<SeamHttpSeamCustomerV1Spaces['create']> {
3168
+ const seam = SeamHttpSeamCustomerV1Spaces.fromClient(client, defaults)
3169
+ return seam.create(...args)
3170
+ }
3171
+ }
3172
+
3075
3173
  get '/seam/partner/v1/building_blocks/spaces/auto_map'(): (
3076
3174
  parameters?: SeamPartnerV1BuildingBlocksSpacesAutoMapParameters,
3077
3175
  options?: SeamPartnerV1BuildingBlocksSpacesAutoMapOptions,
@@ -3898,6 +3996,32 @@ export class SeamHttpEndpoints {
3898
3996
  }
3899
3997
  }
3900
3998
 
3999
+ get '/user_identities/unmanaged/get'(): (
4000
+ parameters?: UserIdentitiesUnmanagedGetParameters,
4001
+ options?: UserIdentitiesUnmanagedGetOptions,
4002
+ ) => UserIdentitiesUnmanagedGetRequest {
4003
+ const { client, defaults } = this
4004
+ return function userIdentitiesUnmanagedGet(
4005
+ ...args: Parameters<SeamHttpUserIdentitiesUnmanaged['get']>
4006
+ ): ReturnType<SeamHttpUserIdentitiesUnmanaged['get']> {
4007
+ const seam = SeamHttpUserIdentitiesUnmanaged.fromClient(client, defaults)
4008
+ return seam.get(...args)
4009
+ }
4010
+ }
4011
+
4012
+ get '/user_identities/unmanaged/list'(): (
4013
+ parameters?: UserIdentitiesUnmanagedListParameters,
4014
+ options?: UserIdentitiesUnmanagedListOptions,
4015
+ ) => UserIdentitiesUnmanagedListRequest {
4016
+ const { client, defaults } = this
4017
+ return function userIdentitiesUnmanagedList(
4018
+ ...args: Parameters<SeamHttpUserIdentitiesUnmanaged['list']>
4019
+ ): ReturnType<SeamHttpUserIdentitiesUnmanaged['list']> {
4020
+ const seam = SeamHttpUserIdentitiesUnmanaged.fromClient(client, defaults)
4021
+ return seam.list(...args)
4022
+ }
4023
+ }
4024
+
3901
4025
  get '/webhooks/create'(): (
3902
4026
  parameters?: WebhooksCreateParameters,
3903
4027
  options?: WebhooksCreateOptions,
@@ -4163,9 +4287,13 @@ export type SeamHttpEndpointQueryPaths =
4163
4287
  | '/access_grants/get'
4164
4288
  | '/access_grants/get_related'
4165
4289
  | '/access_grants/list'
4290
+ | '/access_grants/unmanaged/get'
4291
+ | '/access_grants/unmanaged/list'
4166
4292
  | '/access_methods/get'
4167
4293
  | '/access_methods/get_related'
4168
4294
  | '/access_methods/list'
4295
+ | '/access_methods/unmanaged/get'
4296
+ | '/access_methods/unmanaged/list'
4169
4297
  | '/acs/access_groups/get'
4170
4298
  | '/acs/access_groups/list'
4171
4299
  | '/acs/access_groups/list_accessible_entrances'
@@ -4242,6 +4370,8 @@ export type SeamHttpEndpointQueryPaths =
4242
4370
  | '/user_identities/list_acs_users'
4243
4371
  | '/user_identities/enrollment_automations/get'
4244
4372
  | '/user_identities/enrollment_automations/list'
4373
+ | '/user_identities/unmanaged/get'
4374
+ | '/user_identities/unmanaged/list'
4245
4375
  | '/webhooks/get'
4246
4376
  | '/webhooks/list'
4247
4377
  | '/workspaces/find_anything'
@@ -4342,6 +4472,7 @@ export type SeamHttpEndpointMutationPaths =
4342
4472
  | '/seam/customer/v1/automations/delete'
4343
4473
  | '/seam/customer/v1/automations/update'
4344
4474
  | '/seam/customer/v1/settings/update'
4475
+ | '/seam/customer/v1/spaces/create'
4345
4476
  | '/spaces/add_acs_entrances'
4346
4477
  | '/spaces/add_devices'
4347
4478
  | '/spaces/create'
@@ -4,4 +4,5 @@
4
4
  */
5
5
 
6
6
  export * from './enrollment-automations/index.js'
7
+ export * from './unmanaged/index.js'
7
8
  export * from './user-identities.js'
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Automatically generated by codegen/smith.ts.
3
+ * Do not edit this file or add other files to this directory.
4
+ */
5
+
6
+ export * from './unmanaged.js'
@@ -0,0 +1,240 @@
1
+ /*
2
+ * Automatically generated by codegen/smith.ts.
3
+ * Do not edit this file or add other files to this directory.
4
+ */
5
+
6
+ import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
7
+
8
+ import { seamApiLtsVersion } from 'lib/lts-version.js'
9
+ import {
10
+ getAuthHeadersForClientSessionToken,
11
+ warnOnInsecureuserIdentifierKey,
12
+ } from 'lib/seam/connect/auth.js'
13
+ import { type Client, createClient } from 'lib/seam/connect/client.js'
14
+ import {
15
+ isSeamHttpOptionsWithApiKey,
16
+ isSeamHttpOptionsWithClient,
17
+ isSeamHttpOptionsWithClientSessionToken,
18
+ isSeamHttpOptionsWithConsoleSessionToken,
19
+ isSeamHttpOptionsWithPersonalAccessToken,
20
+ type SeamHttpFromPublishableKeyOptions,
21
+ SeamHttpInvalidOptionsError,
22
+ type SeamHttpOptions,
23
+ type SeamHttpOptionsWithApiKey,
24
+ type SeamHttpOptionsWithClient,
25
+ type SeamHttpOptionsWithClientSessionToken,
26
+ type SeamHttpOptionsWithConsoleSessionToken,
27
+ type SeamHttpOptionsWithPersonalAccessToken,
28
+ type SeamHttpRequestOptions,
29
+ } from 'lib/seam/connect/options.js'
30
+ import {
31
+ limitToSeamHttpRequestOptions,
32
+ parseOptions,
33
+ } from 'lib/seam/connect/parse-options.js'
34
+ import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
35
+ import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
36
+ import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
37
+ import type { SetNonNullable } from 'lib/types.js'
38
+
39
+ export class SeamHttpUserIdentitiesUnmanaged {
40
+ client: Client
41
+ readonly defaults: Required<SeamHttpRequestOptions>
42
+ readonly ltsVersion = seamApiLtsVersion
43
+ static ltsVersion = seamApiLtsVersion
44
+
45
+ constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
46
+ const options = parseOptions(apiKeyOrOptions)
47
+ this.client = 'client' in options ? options.client : createClient(options)
48
+ this.defaults = limitToSeamHttpRequestOptions(options)
49
+ }
50
+
51
+ static fromClient(
52
+ client: SeamHttpOptionsWithClient['client'],
53
+ options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
54
+ ): SeamHttpUserIdentitiesUnmanaged {
55
+ const constructorOptions = { ...options, client }
56
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
57
+ throw new SeamHttpInvalidOptionsError('Missing client')
58
+ }
59
+ return new SeamHttpUserIdentitiesUnmanaged(constructorOptions)
60
+ }
61
+
62
+ static fromApiKey(
63
+ apiKey: SeamHttpOptionsWithApiKey['apiKey'],
64
+ options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
65
+ ): SeamHttpUserIdentitiesUnmanaged {
66
+ const constructorOptions = { ...options, apiKey }
67
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
68
+ throw new SeamHttpInvalidOptionsError('Missing apiKey')
69
+ }
70
+ return new SeamHttpUserIdentitiesUnmanaged(constructorOptions)
71
+ }
72
+
73
+ static fromClientSessionToken(
74
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
75
+ options: Omit<
76
+ SeamHttpOptionsWithClientSessionToken,
77
+ 'clientSessionToken'
78
+ > = {},
79
+ ): SeamHttpUserIdentitiesUnmanaged {
80
+ const constructorOptions = { ...options, clientSessionToken }
81
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
82
+ throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
83
+ }
84
+ return new SeamHttpUserIdentitiesUnmanaged(constructorOptions)
85
+ }
86
+
87
+ static async fromPublishableKey(
88
+ publishableKey: string,
89
+ userIdentifierKey: string,
90
+ options: SeamHttpFromPublishableKeyOptions = {},
91
+ ): Promise<SeamHttpUserIdentitiesUnmanaged> {
92
+ warnOnInsecureuserIdentifierKey(userIdentifierKey)
93
+ const clientOptions = parseOptions({ ...options, publishableKey })
94
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
95
+ throw new SeamHttpInvalidOptionsError(
96
+ 'The client option cannot be used with SeamHttpUserIdentitiesUnmanaged.fromPublishableKey',
97
+ )
98
+ }
99
+ const client = createClient(clientOptions)
100
+ const clientSessions = SeamHttpClientSessions.fromClient(client)
101
+ const { token } = await clientSessions.getOrCreate({
102
+ user_identifier_key: userIdentifierKey,
103
+ })
104
+ return SeamHttpUserIdentitiesUnmanaged.fromClientSessionToken(
105
+ token,
106
+ options,
107
+ )
108
+ }
109
+
110
+ static fromConsoleSessionToken(
111
+ consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
112
+ workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
113
+ options: Omit<
114
+ SeamHttpOptionsWithConsoleSessionToken,
115
+ 'consoleSessionToken' | 'workspaceId'
116
+ > = {},
117
+ ): SeamHttpUserIdentitiesUnmanaged {
118
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId }
119
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
120
+ throw new SeamHttpInvalidOptionsError(
121
+ 'Missing consoleSessionToken or workspaceId',
122
+ )
123
+ }
124
+ return new SeamHttpUserIdentitiesUnmanaged(constructorOptions)
125
+ }
126
+
127
+ static fromPersonalAccessToken(
128
+ personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
129
+ workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
130
+ options: Omit<
131
+ SeamHttpOptionsWithPersonalAccessToken,
132
+ 'personalAccessToken' | 'workspaceId'
133
+ > = {},
134
+ ): SeamHttpUserIdentitiesUnmanaged {
135
+ const constructorOptions = { ...options, personalAccessToken, workspaceId }
136
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
137
+ throw new SeamHttpInvalidOptionsError(
138
+ 'Missing personalAccessToken or workspaceId',
139
+ )
140
+ }
141
+ return new SeamHttpUserIdentitiesUnmanaged(constructorOptions)
142
+ }
143
+
144
+ createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
145
+ request: SeamHttpRequest<TResponse, TResponseKey>,
146
+ ): SeamPaginator<TResponse, TResponseKey> {
147
+ return new SeamPaginator<TResponse, TResponseKey>(this, request)
148
+ }
149
+
150
+ async updateClientSessionToken(
151
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
152
+ ): Promise<void> {
153
+ const { headers } = this.client.defaults
154
+ const authHeaders = getAuthHeadersForClientSessionToken({
155
+ clientSessionToken,
156
+ })
157
+ for (const key of Object.keys(authHeaders)) {
158
+ if (headers[key] == null) {
159
+ throw new Error(
160
+ 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
161
+ )
162
+ }
163
+ }
164
+ this.client.defaults.headers = { ...headers, ...authHeaders }
165
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client)
166
+ await clientSessions.get()
167
+ }
168
+
169
+ get(
170
+ parameters?: UserIdentitiesUnmanagedGetParameters,
171
+ options: UserIdentitiesUnmanagedGetOptions = {},
172
+ ): UserIdentitiesUnmanagedGetRequest {
173
+ return new SeamHttpRequest(this, {
174
+ pathname: '/user_identities/unmanaged/get',
175
+ method: 'POST',
176
+ body: parameters,
177
+ responseKey: 'user_identity',
178
+ options,
179
+ })
180
+ }
181
+
182
+ list(
183
+ parameters?: UserIdentitiesUnmanagedListParameters,
184
+ options: UserIdentitiesUnmanagedListOptions = {},
185
+ ): UserIdentitiesUnmanagedListRequest {
186
+ return new SeamHttpRequest(this, {
187
+ pathname: '/user_identities/unmanaged/list',
188
+ method: 'POST',
189
+ body: parameters,
190
+ responseKey: 'user_identities',
191
+ options,
192
+ })
193
+ }
194
+ }
195
+
196
+ export type UserIdentitiesUnmanagedGetParameters =
197
+ RouteRequestBody<'/user_identities/unmanaged/get'>
198
+
199
+ /**
200
+ * @deprecated Use UserIdentitiesUnmanagedGetParameters instead.
201
+ */
202
+ export type UserIdentitiesUnmanagedGetParams =
203
+ UserIdentitiesUnmanagedGetParameters
204
+
205
+ /**
206
+ * @deprecated Use UserIdentitiesUnmanagedGetRequest instead.
207
+ */
208
+ export type UserIdentitiesUnmanagedGetResponse = SetNonNullable<
209
+ Required<RouteResponse<'/user_identities/unmanaged/get'>>
210
+ >
211
+
212
+ export type UserIdentitiesUnmanagedGetRequest = SeamHttpRequest<
213
+ UserIdentitiesUnmanagedGetResponse,
214
+ 'user_identity'
215
+ >
216
+
217
+ export interface UserIdentitiesUnmanagedGetOptions {}
218
+
219
+ export type UserIdentitiesUnmanagedListParameters =
220
+ RouteRequestBody<'/user_identities/unmanaged/list'>
221
+
222
+ /**
223
+ * @deprecated Use UserIdentitiesUnmanagedListParameters instead.
224
+ */
225
+ export type UserIdentitiesUnmanagedListParams =
226
+ UserIdentitiesUnmanagedListParameters
227
+
228
+ /**
229
+ * @deprecated Use UserIdentitiesUnmanagedListRequest instead.
230
+ */
231
+ export type UserIdentitiesUnmanagedListResponse = SetNonNullable<
232
+ Required<RouteResponse<'/user_identities/unmanaged/list'>>
233
+ >
234
+
235
+ export type UserIdentitiesUnmanagedListRequest = SeamHttpRequest<
236
+ UserIdentitiesUnmanagedListResponse,
237
+ 'user_identities'
238
+ >
239
+
240
+ export interface UserIdentitiesUnmanagedListOptions {}