@seamapi/http 1.57.0 → 1.58.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 (30) hide show
  1. package/dist/connect.cjs +0 -328
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +3 -146
  4. package/dist/index.cjs +0 -330
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/index.d.ts +0 -1
  8. package/lib/seam/connect/routes/index.js +0 -1
  9. package/lib/seam/connect/routes/index.js.map +1 -1
  10. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +2 -12
  11. package/lib/seam/connect/routes/seam-http-endpoints.js +0 -91
  12. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  13. package/lib/seam/connect/routes/seam-http.d.ts +0 -2
  14. package/lib/seam/connect/routes/seam-http.js +0 -4
  15. package/lib/seam/connect/routes/seam-http.js.map +1 -1
  16. package/lib/version.d.ts +1 -1
  17. package/lib/version.js +1 -1
  18. package/package.json +3 -3
  19. package/src/lib/seam/connect/routes/index.ts +0 -1
  20. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +0 -201
  21. package/src/lib/seam/connect/routes/seam-http.ts +0 -5
  22. package/src/lib/version.ts +1 -1
  23. package/lib/seam/connect/routes/unstable-locations/index.d.ts +0 -1
  24. package/lib/seam/connect/routes/unstable-locations/index.js +0 -6
  25. package/lib/seam/connect/routes/unstable-locations/index.js.map +0 -1
  26. package/lib/seam/connect/routes/unstable-locations/unstable-locations.d.ts +0 -138
  27. package/lib/seam/connect/routes/unstable-locations/unstable-locations.js +0 -198
  28. package/lib/seam/connect/routes/unstable-locations/unstable-locations.js.map +0 -1
  29. package/src/lib/seam/connect/routes/unstable-locations/index.ts +0 -6
  30. package/src/lib/seam/connect/routes/unstable-locations/unstable-locations.ts +0 -544
@@ -1,544 +0,0 @@
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 {
7
- RouteRequestBody,
8
- RouteRequestParams,
9
- RouteResponse,
10
- } from '@seamapi/types/connect'
11
-
12
- import { seamApiLtsVersion } from 'lib/lts-version.js'
13
- import {
14
- getAuthHeadersForClientSessionToken,
15
- warnOnInsecureuserIdentifierKey,
16
- } from 'lib/seam/connect/auth.js'
17
- import { type Client, createClient } from 'lib/seam/connect/client.js'
18
- import {
19
- isSeamHttpOptionsWithApiKey,
20
- isSeamHttpOptionsWithClient,
21
- isSeamHttpOptionsWithClientSessionToken,
22
- isSeamHttpOptionsWithConsoleSessionToken,
23
- isSeamHttpOptionsWithPersonalAccessToken,
24
- type SeamHttpFromPublishableKeyOptions,
25
- SeamHttpInvalidOptionsError,
26
- type SeamHttpOptions,
27
- type SeamHttpOptionsWithApiKey,
28
- type SeamHttpOptionsWithClient,
29
- type SeamHttpOptionsWithClientSessionToken,
30
- type SeamHttpOptionsWithConsoleSessionToken,
31
- type SeamHttpOptionsWithPersonalAccessToken,
32
- type SeamHttpRequestOptions,
33
- } from 'lib/seam/connect/options.js'
34
- import {
35
- limitToSeamHttpRequestOptions,
36
- parseOptions,
37
- } from 'lib/seam/connect/parse-options.js'
38
- import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
39
- import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
40
- import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
41
- import type { SetNonNullable } from 'lib/types.js'
42
-
43
- export class SeamHttpUnstableLocations {
44
- client: Client
45
- readonly defaults: Required<SeamHttpRequestOptions>
46
- readonly ltsVersion = seamApiLtsVersion
47
- static ltsVersion = seamApiLtsVersion
48
-
49
- constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
50
- const options = parseOptions(apiKeyOrOptions)
51
- if (!options.isUndocumentedApiEnabled) {
52
- throw new Error(
53
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
54
- )
55
- }
56
- this.client = 'client' in options ? options.client : createClient(options)
57
- this.defaults = limitToSeamHttpRequestOptions(options)
58
- }
59
-
60
- static fromClient(
61
- client: SeamHttpOptionsWithClient['client'],
62
- options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
63
- ): SeamHttpUnstableLocations {
64
- const constructorOptions = { ...options, client }
65
- if (!isSeamHttpOptionsWithClient(constructorOptions)) {
66
- throw new SeamHttpInvalidOptionsError('Missing client')
67
- }
68
- return new SeamHttpUnstableLocations(constructorOptions)
69
- }
70
-
71
- static fromApiKey(
72
- apiKey: SeamHttpOptionsWithApiKey['apiKey'],
73
- options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
74
- ): SeamHttpUnstableLocations {
75
- const constructorOptions = { ...options, apiKey }
76
- if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
77
- throw new SeamHttpInvalidOptionsError('Missing apiKey')
78
- }
79
- return new SeamHttpUnstableLocations(constructorOptions)
80
- }
81
-
82
- static fromClientSessionToken(
83
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
84
- options: Omit<
85
- SeamHttpOptionsWithClientSessionToken,
86
- 'clientSessionToken'
87
- > = {},
88
- ): SeamHttpUnstableLocations {
89
- const constructorOptions = { ...options, clientSessionToken }
90
- if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
91
- throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
92
- }
93
- return new SeamHttpUnstableLocations(constructorOptions)
94
- }
95
-
96
- static async fromPublishableKey(
97
- publishableKey: string,
98
- userIdentifierKey: string,
99
- options: SeamHttpFromPublishableKeyOptions = {},
100
- ): Promise<SeamHttpUnstableLocations> {
101
- warnOnInsecureuserIdentifierKey(userIdentifierKey)
102
- const clientOptions = parseOptions({ ...options, publishableKey })
103
- if (isSeamHttpOptionsWithClient(clientOptions)) {
104
- throw new SeamHttpInvalidOptionsError(
105
- 'The client option cannot be used with SeamHttpUnstableLocations.fromPublishableKey',
106
- )
107
- }
108
- const client = createClient(clientOptions)
109
- const clientSessions = SeamHttpClientSessions.fromClient(client)
110
- const { token } = await clientSessions.getOrCreate({
111
- user_identifier_key: userIdentifierKey,
112
- })
113
- return SeamHttpUnstableLocations.fromClientSessionToken(token, options)
114
- }
115
-
116
- static fromConsoleSessionToken(
117
- consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
118
- workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
119
- options: Omit<
120
- SeamHttpOptionsWithConsoleSessionToken,
121
- 'consoleSessionToken' | 'workspaceId'
122
- > = {},
123
- ): SeamHttpUnstableLocations {
124
- const constructorOptions = { ...options, consoleSessionToken, workspaceId }
125
- if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
126
- throw new SeamHttpInvalidOptionsError(
127
- 'Missing consoleSessionToken or workspaceId',
128
- )
129
- }
130
- return new SeamHttpUnstableLocations(constructorOptions)
131
- }
132
-
133
- static fromPersonalAccessToken(
134
- personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
135
- workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
136
- options: Omit<
137
- SeamHttpOptionsWithPersonalAccessToken,
138
- 'personalAccessToken' | 'workspaceId'
139
- > = {},
140
- ): SeamHttpUnstableLocations {
141
- const constructorOptions = { ...options, personalAccessToken, workspaceId }
142
- if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
143
- throw new SeamHttpInvalidOptionsError(
144
- 'Missing personalAccessToken or workspaceId',
145
- )
146
- }
147
- return new SeamHttpUnstableLocations(constructorOptions)
148
- }
149
-
150
- createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
151
- request: SeamHttpRequest<TResponse, TResponseKey>,
152
- ): SeamPaginator<TResponse, TResponseKey> {
153
- return new SeamPaginator<TResponse, TResponseKey>(this, request)
154
- }
155
-
156
- async updateClientSessionToken(
157
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
158
- ): Promise<void> {
159
- const { headers } = this.client.defaults
160
- const authHeaders = getAuthHeadersForClientSessionToken({
161
- clientSessionToken,
162
- })
163
- for (const key of Object.keys(authHeaders)) {
164
- if (headers[key] == null) {
165
- throw new Error(
166
- 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
167
- )
168
- }
169
- }
170
- this.client.defaults.headers = { ...headers, ...authHeaders }
171
- const clientSessions = SeamHttpClientSessions.fromClient(this.client)
172
- await clientSessions.get()
173
- }
174
-
175
- addAcsEntrances(
176
- parameters?: UnstableLocationsAddAcsEntrancesParameters,
177
- options: UnstableLocationsAddAcsEntrancesOptions = {},
178
- ): UnstableLocationsAddAcsEntrancesRequest {
179
- if (!this.defaults.isUndocumentedApiEnabled) {
180
- throw new Error(
181
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
182
- )
183
- }
184
- return new SeamHttpRequest(this, {
185
- pathname: '/unstable_locations/add_acs_entrances',
186
- method: 'PUT',
187
- body: parameters,
188
- responseKey: undefined,
189
- options,
190
- })
191
- }
192
-
193
- addDevices(
194
- parameters?: UnstableLocationsAddDevicesParameters,
195
- options: UnstableLocationsAddDevicesOptions = {},
196
- ): UnstableLocationsAddDevicesRequest {
197
- if (!this.defaults.isUndocumentedApiEnabled) {
198
- throw new Error(
199
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
200
- )
201
- }
202
- return new SeamHttpRequest(this, {
203
- pathname: '/unstable_locations/add_devices',
204
- method: 'PUT',
205
- body: parameters,
206
- responseKey: undefined,
207
- options,
208
- })
209
- }
210
-
211
- create(
212
- parameters?: UnstableLocationsCreateParameters,
213
- options: UnstableLocationsCreateOptions = {},
214
- ): UnstableLocationsCreateRequest {
215
- if (!this.defaults.isUndocumentedApiEnabled) {
216
- throw new Error(
217
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
218
- )
219
- }
220
- return new SeamHttpRequest(this, {
221
- pathname: '/unstable_locations/create',
222
- method: 'POST',
223
- body: parameters,
224
- responseKey: 'location',
225
- options,
226
- })
227
- }
228
-
229
- delete(
230
- parameters?: UnstableLocationsDeleteParameters,
231
- options: UnstableLocationsDeleteOptions = {},
232
- ): UnstableLocationsDeleteRequest {
233
- if (!this.defaults.isUndocumentedApiEnabled) {
234
- throw new Error(
235
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
236
- )
237
- }
238
- return new SeamHttpRequest(this, {
239
- pathname: '/unstable_locations/delete',
240
- method: 'POST',
241
- body: parameters,
242
- responseKey: undefined,
243
- options,
244
- })
245
- }
246
-
247
- get(
248
- parameters?: UnstableLocationsGetParameters,
249
- options: UnstableLocationsGetOptions = {},
250
- ): UnstableLocationsGetRequest {
251
- if (!this.defaults.isUndocumentedApiEnabled) {
252
- throw new Error(
253
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
254
- )
255
- }
256
- return new SeamHttpRequest(this, {
257
- pathname: '/unstable_locations/get',
258
- method: 'POST',
259
- body: parameters,
260
- responseKey: 'location',
261
- options,
262
- })
263
- }
264
-
265
- list(
266
- parameters?: UnstableLocationsListParameters,
267
- options: UnstableLocationsListOptions = {},
268
- ): UnstableLocationsListRequest {
269
- if (!this.defaults.isUndocumentedApiEnabled) {
270
- throw new Error(
271
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
272
- )
273
- }
274
- return new SeamHttpRequest(this, {
275
- pathname: '/unstable_locations/list',
276
- method: 'GET',
277
- params: parameters,
278
- responseKey: 'locations',
279
- options,
280
- })
281
- }
282
-
283
- removeAcsEntrances(
284
- parameters?: UnstableLocationsRemoveAcsEntrancesParameters,
285
- options: UnstableLocationsRemoveAcsEntrancesOptions = {},
286
- ): UnstableLocationsRemoveAcsEntrancesRequest {
287
- if (!this.defaults.isUndocumentedApiEnabled) {
288
- throw new Error(
289
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
290
- )
291
- }
292
- return new SeamHttpRequest(this, {
293
- pathname: '/unstable_locations/remove_acs_entrances',
294
- method: 'POST',
295
- body: parameters,
296
- responseKey: undefined,
297
- options,
298
- })
299
- }
300
-
301
- removeDevices(
302
- parameters?: UnstableLocationsRemoveDevicesParameters,
303
- options: UnstableLocationsRemoveDevicesOptions = {},
304
- ): UnstableLocationsRemoveDevicesRequest {
305
- if (!this.defaults.isUndocumentedApiEnabled) {
306
- throw new Error(
307
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
308
- )
309
- }
310
- return new SeamHttpRequest(this, {
311
- pathname: '/unstable_locations/remove_devices',
312
- method: 'POST',
313
- body: parameters,
314
- responseKey: undefined,
315
- options,
316
- })
317
- }
318
-
319
- update(
320
- parameters?: UnstableLocationsUpdateParameters,
321
- options: UnstableLocationsUpdateOptions = {},
322
- ): UnstableLocationsUpdateRequest {
323
- if (!this.defaults.isUndocumentedApiEnabled) {
324
- throw new Error(
325
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
326
- )
327
- }
328
- return new SeamHttpRequest(this, {
329
- pathname: '/unstable_locations/update',
330
- method: 'PATCH',
331
- body: parameters,
332
- responseKey: 'location',
333
- options,
334
- })
335
- }
336
- }
337
-
338
- export type UnstableLocationsAddAcsEntrancesParameters =
339
- RouteRequestBody<'/unstable_locations/add_acs_entrances'>
340
-
341
- /**
342
- * @deprecated Use UnstableLocationsAddAcsEntrancesParameters instead.
343
- */
344
- export type UnstableLocationsAddAcsEntrancesBody =
345
- UnstableLocationsAddAcsEntrancesParameters
346
-
347
- /**
348
- * @deprecated Use UnstableLocationsAddAcsEntrancesRequest instead.
349
- */
350
- export type UnstableLocationsAddAcsEntrancesResponse = SetNonNullable<
351
- Required<RouteResponse<'/unstable_locations/add_acs_entrances'>>
352
- >
353
-
354
- export type UnstableLocationsAddAcsEntrancesRequest = SeamHttpRequest<
355
- void,
356
- undefined
357
- >
358
-
359
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
360
- export interface UnstableLocationsAddAcsEntrancesOptions {}
361
-
362
- export type UnstableLocationsAddDevicesParameters =
363
- RouteRequestBody<'/unstable_locations/add_devices'>
364
-
365
- /**
366
- * @deprecated Use UnstableLocationsAddDevicesParameters instead.
367
- */
368
- export type UnstableLocationsAddDevicesBody =
369
- UnstableLocationsAddDevicesParameters
370
-
371
- /**
372
- * @deprecated Use UnstableLocationsAddDevicesRequest instead.
373
- */
374
- export type UnstableLocationsAddDevicesResponse = SetNonNullable<
375
- Required<RouteResponse<'/unstable_locations/add_devices'>>
376
- >
377
-
378
- export type UnstableLocationsAddDevicesRequest = SeamHttpRequest<
379
- void,
380
- undefined
381
- >
382
-
383
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
384
- export interface UnstableLocationsAddDevicesOptions {}
385
-
386
- export type UnstableLocationsCreateParameters =
387
- RouteRequestBody<'/unstable_locations/create'>
388
-
389
- /**
390
- * @deprecated Use UnstableLocationsCreateParameters instead.
391
- */
392
- export type UnstableLocationsCreateBody = UnstableLocationsCreateParameters
393
-
394
- /**
395
- * @deprecated Use UnstableLocationsCreateRequest instead.
396
- */
397
- export type UnstableLocationsCreateResponse = SetNonNullable<
398
- Required<RouteResponse<'/unstable_locations/create'>>
399
- >
400
-
401
- export type UnstableLocationsCreateRequest = SeamHttpRequest<
402
- UnstableLocationsCreateResponse,
403
- 'location'
404
- >
405
-
406
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
407
- export interface UnstableLocationsCreateOptions {}
408
-
409
- export type UnstableLocationsDeleteParameters =
410
- RouteRequestBody<'/unstable_locations/delete'>
411
-
412
- /**
413
- * @deprecated Use UnstableLocationsDeleteParameters instead.
414
- */
415
- export type UnstableLocationsDeleteParams = UnstableLocationsDeleteParameters
416
-
417
- /**
418
- * @deprecated Use UnstableLocationsDeleteRequest instead.
419
- */
420
- export type UnstableLocationsDeleteResponse = SetNonNullable<
421
- Required<RouteResponse<'/unstable_locations/delete'>>
422
- >
423
-
424
- export type UnstableLocationsDeleteRequest = SeamHttpRequest<void, undefined>
425
-
426
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
427
- export interface UnstableLocationsDeleteOptions {}
428
-
429
- export type UnstableLocationsGetParameters =
430
- RouteRequestBody<'/unstable_locations/get'>
431
-
432
- /**
433
- * @deprecated Use UnstableLocationsGetParameters instead.
434
- */
435
- export type UnstableLocationsGetParams = UnstableLocationsGetParameters
436
-
437
- /**
438
- * @deprecated Use UnstableLocationsGetRequest instead.
439
- */
440
- export type UnstableLocationsGetResponse = SetNonNullable<
441
- Required<RouteResponse<'/unstable_locations/get'>>
442
- >
443
-
444
- export type UnstableLocationsGetRequest = SeamHttpRequest<
445
- UnstableLocationsGetResponse,
446
- 'location'
447
- >
448
-
449
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
450
- export interface UnstableLocationsGetOptions {}
451
-
452
- export type UnstableLocationsListParameters =
453
- RouteRequestParams<'/unstable_locations/list'>
454
-
455
- /**
456
- * @deprecated Use UnstableLocationsListParameters instead.
457
- */
458
- export type UnstableLocationsListParams = UnstableLocationsListParameters
459
-
460
- /**
461
- * @deprecated Use UnstableLocationsListRequest instead.
462
- */
463
- export type UnstableLocationsListResponse = SetNonNullable<
464
- Required<RouteResponse<'/unstable_locations/list'>>
465
- >
466
-
467
- export type UnstableLocationsListRequest = SeamHttpRequest<
468
- UnstableLocationsListResponse,
469
- 'locations'
470
- >
471
-
472
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
473
- export interface UnstableLocationsListOptions {}
474
-
475
- export type UnstableLocationsRemoveAcsEntrancesParameters =
476
- RouteRequestBody<'/unstable_locations/remove_acs_entrances'>
477
-
478
- /**
479
- * @deprecated Use UnstableLocationsRemoveAcsEntrancesParameters instead.
480
- */
481
- export type UnstableLocationsRemoveAcsEntrancesParams =
482
- UnstableLocationsRemoveAcsEntrancesParameters
483
-
484
- /**
485
- * @deprecated Use UnstableLocationsRemoveAcsEntrancesRequest instead.
486
- */
487
- export type UnstableLocationsRemoveAcsEntrancesResponse = SetNonNullable<
488
- Required<RouteResponse<'/unstable_locations/remove_acs_entrances'>>
489
- >
490
-
491
- export type UnstableLocationsRemoveAcsEntrancesRequest = SeamHttpRequest<
492
- void,
493
- undefined
494
- >
495
-
496
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
497
- export interface UnstableLocationsRemoveAcsEntrancesOptions {}
498
-
499
- export type UnstableLocationsRemoveDevicesParameters =
500
- RouteRequestBody<'/unstable_locations/remove_devices'>
501
-
502
- /**
503
- * @deprecated Use UnstableLocationsRemoveDevicesParameters instead.
504
- */
505
- export type UnstableLocationsRemoveDevicesParams =
506
- UnstableLocationsRemoveDevicesParameters
507
-
508
- /**
509
- * @deprecated Use UnstableLocationsRemoveDevicesRequest instead.
510
- */
511
- export type UnstableLocationsRemoveDevicesResponse = SetNonNullable<
512
- Required<RouteResponse<'/unstable_locations/remove_devices'>>
513
- >
514
-
515
- export type UnstableLocationsRemoveDevicesRequest = SeamHttpRequest<
516
- void,
517
- undefined
518
- >
519
-
520
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
521
- export interface UnstableLocationsRemoveDevicesOptions {}
522
-
523
- export type UnstableLocationsUpdateParameters =
524
- RouteRequestBody<'/unstable_locations/update'>
525
-
526
- /**
527
- * @deprecated Use UnstableLocationsUpdateParameters instead.
528
- */
529
- export type UnstableLocationsUpdateBody = UnstableLocationsUpdateParameters
530
-
531
- /**
532
- * @deprecated Use UnstableLocationsUpdateRequest instead.
533
- */
534
- export type UnstableLocationsUpdateResponse = SetNonNullable<
535
- Required<RouteResponse<'/unstable_locations/update'>>
536
- >
537
-
538
- export type UnstableLocationsUpdateRequest = SeamHttpRequest<
539
- UnstableLocationsUpdateResponse,
540
- 'location'
541
- >
542
-
543
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
544
- export interface UnstableLocationsUpdateOptions {}