@seamapi/http 1.56.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 (46) hide show
  1. package/dist/connect.cjs +0 -698
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +3 -278
  4. package/dist/index.cjs +0 -704
  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 -3
  8. package/lib/seam/connect/routes/index.js +0 -3
  9. package/lib/seam/connect/routes/index.js.map +1 -1
  10. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +2 -21
  11. package/lib/seam/connect/routes/seam-http-endpoints.js +0 -163
  12. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  13. package/lib/seam/connect/routes/seam-http.d.ts +0 -6
  14. package/lib/seam/connect/routes/seam-http.js +0 -12
  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 -3
  20. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +0 -361
  21. package/src/lib/seam/connect/routes/seam-http.ts +0 -15
  22. package/src/lib/version.ts +1 -1
  23. package/lib/seam/connect/routes/unstable-access-grants/index.d.ts +0 -1
  24. package/lib/seam/connect/routes/unstable-access-grants/index.js +0 -6
  25. package/lib/seam/connect/routes/unstable-access-grants/index.js.map +0 -1
  26. package/lib/seam/connect/routes/unstable-access-grants/unstable-access-grants.d.ts +0 -73
  27. package/lib/seam/connect/routes/unstable-access-grants/unstable-access-grants.js +0 -138
  28. package/lib/seam/connect/routes/unstable-access-grants/unstable-access-grants.js.map +0 -1
  29. package/lib/seam/connect/routes/unstable-access-methods/index.d.ts +0 -1
  30. package/lib/seam/connect/routes/unstable-access-methods/index.js +0 -6
  31. package/lib/seam/connect/routes/unstable-access-methods/index.js.map +0 -1
  32. package/lib/seam/connect/routes/unstable-access-methods/unstable-access-methods.d.ts +0 -60
  33. package/lib/seam/connect/routes/unstable-access-methods/unstable-access-methods.js +0 -126
  34. package/lib/seam/connect/routes/unstable-access-methods/unstable-access-methods.js.map +0 -1
  35. package/lib/seam/connect/routes/unstable-locations/index.d.ts +0 -1
  36. package/lib/seam/connect/routes/unstable-locations/index.js +0 -6
  37. package/lib/seam/connect/routes/unstable-locations/index.js.map +0 -1
  38. package/lib/seam/connect/routes/unstable-locations/unstable-locations.d.ts +0 -138
  39. package/lib/seam/connect/routes/unstable-locations/unstable-locations.js +0 -198
  40. package/lib/seam/connect/routes/unstable-locations/unstable-locations.js.map +0 -1
  41. package/src/lib/seam/connect/routes/unstable-access-grants/index.ts +0 -6
  42. package/src/lib/seam/connect/routes/unstable-access-grants/unstable-access-grants.ts +0 -333
  43. package/src/lib/seam/connect/routes/unstable-access-methods/index.ts +0 -6
  44. package/src/lib/seam/connect/routes/unstable-access-methods/unstable-access-methods.ts +0 -295
  45. package/src/lib/seam/connect/routes/unstable-locations/index.ts +0 -6
  46. package/src/lib/seam/connect/routes/unstable-locations/unstable-locations.ts +0 -544
@@ -1,333 +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 { 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 SeamHttpUnstableAccessGrants {
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
- if (!options.isUndocumentedApiEnabled) {
48
- throw new Error(
49
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
50
- )
51
- }
52
- this.client = 'client' in options ? options.client : createClient(options)
53
- this.defaults = limitToSeamHttpRequestOptions(options)
54
- }
55
-
56
- static fromClient(
57
- client: SeamHttpOptionsWithClient['client'],
58
- options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
59
- ): SeamHttpUnstableAccessGrants {
60
- const constructorOptions = { ...options, client }
61
- if (!isSeamHttpOptionsWithClient(constructorOptions)) {
62
- throw new SeamHttpInvalidOptionsError('Missing client')
63
- }
64
- return new SeamHttpUnstableAccessGrants(constructorOptions)
65
- }
66
-
67
- static fromApiKey(
68
- apiKey: SeamHttpOptionsWithApiKey['apiKey'],
69
- options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
70
- ): SeamHttpUnstableAccessGrants {
71
- const constructorOptions = { ...options, apiKey }
72
- if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
73
- throw new SeamHttpInvalidOptionsError('Missing apiKey')
74
- }
75
- return new SeamHttpUnstableAccessGrants(constructorOptions)
76
- }
77
-
78
- static fromClientSessionToken(
79
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
80
- options: Omit<
81
- SeamHttpOptionsWithClientSessionToken,
82
- 'clientSessionToken'
83
- > = {},
84
- ): SeamHttpUnstableAccessGrants {
85
- const constructorOptions = { ...options, clientSessionToken }
86
- if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
87
- throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
88
- }
89
- return new SeamHttpUnstableAccessGrants(constructorOptions)
90
- }
91
-
92
- static async fromPublishableKey(
93
- publishableKey: string,
94
- userIdentifierKey: string,
95
- options: SeamHttpFromPublishableKeyOptions = {},
96
- ): Promise<SeamHttpUnstableAccessGrants> {
97
- warnOnInsecureuserIdentifierKey(userIdentifierKey)
98
- const clientOptions = parseOptions({ ...options, publishableKey })
99
- if (isSeamHttpOptionsWithClient(clientOptions)) {
100
- throw new SeamHttpInvalidOptionsError(
101
- 'The client option cannot be used with SeamHttpUnstableAccessGrants.fromPublishableKey',
102
- )
103
- }
104
- const client = createClient(clientOptions)
105
- const clientSessions = SeamHttpClientSessions.fromClient(client)
106
- const { token } = await clientSessions.getOrCreate({
107
- user_identifier_key: userIdentifierKey,
108
- })
109
- return SeamHttpUnstableAccessGrants.fromClientSessionToken(token, options)
110
- }
111
-
112
- static fromConsoleSessionToken(
113
- consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
114
- workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
115
- options: Omit<
116
- SeamHttpOptionsWithConsoleSessionToken,
117
- 'consoleSessionToken' | 'workspaceId'
118
- > = {},
119
- ): SeamHttpUnstableAccessGrants {
120
- const constructorOptions = { ...options, consoleSessionToken, workspaceId }
121
- if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
122
- throw new SeamHttpInvalidOptionsError(
123
- 'Missing consoleSessionToken or workspaceId',
124
- )
125
- }
126
- return new SeamHttpUnstableAccessGrants(constructorOptions)
127
- }
128
-
129
- static fromPersonalAccessToken(
130
- personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
131
- workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
132
- options: Omit<
133
- SeamHttpOptionsWithPersonalAccessToken,
134
- 'personalAccessToken' | 'workspaceId'
135
- > = {},
136
- ): SeamHttpUnstableAccessGrants {
137
- const constructorOptions = { ...options, personalAccessToken, workspaceId }
138
- if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
139
- throw new SeamHttpInvalidOptionsError(
140
- 'Missing personalAccessToken or workspaceId',
141
- )
142
- }
143
- return new SeamHttpUnstableAccessGrants(constructorOptions)
144
- }
145
-
146
- createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
147
- request: SeamHttpRequest<TResponse, TResponseKey>,
148
- ): SeamPaginator<TResponse, TResponseKey> {
149
- return new SeamPaginator<TResponse, TResponseKey>(this, request)
150
- }
151
-
152
- async updateClientSessionToken(
153
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
154
- ): Promise<void> {
155
- const { headers } = this.client.defaults
156
- const authHeaders = getAuthHeadersForClientSessionToken({
157
- clientSessionToken,
158
- })
159
- for (const key of Object.keys(authHeaders)) {
160
- if (headers[key] == null) {
161
- throw new Error(
162
- 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
163
- )
164
- }
165
- }
166
- this.client.defaults.headers = { ...headers, ...authHeaders }
167
- const clientSessions = SeamHttpClientSessions.fromClient(this.client)
168
- await clientSessions.get()
169
- }
170
-
171
- create(
172
- parameters?: UnstableAccessGrantsCreateParameters,
173
- options: UnstableAccessGrantsCreateOptions = {},
174
- ): UnstableAccessGrantsCreateRequest {
175
- if (!this.defaults.isUndocumentedApiEnabled) {
176
- throw new Error(
177
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
178
- )
179
- }
180
- return new SeamHttpRequest(this, {
181
- pathname: '/unstable_access_grants/create',
182
- method: 'POST',
183
- body: parameters,
184
- responseKey: 'access_grant',
185
- options,
186
- })
187
- }
188
-
189
- delete(
190
- parameters?: UnstableAccessGrantsDeleteParameters,
191
- options: UnstableAccessGrantsDeleteOptions = {},
192
- ): UnstableAccessGrantsDeleteRequest {
193
- if (!this.defaults.isUndocumentedApiEnabled) {
194
- throw new Error(
195
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
196
- )
197
- }
198
- return new SeamHttpRequest(this, {
199
- pathname: '/unstable_access_grants/delete',
200
- method: 'POST',
201
- body: parameters,
202
- responseKey: undefined,
203
- options,
204
- })
205
- }
206
-
207
- get(
208
- parameters?: UnstableAccessGrantsGetParameters,
209
- options: UnstableAccessGrantsGetOptions = {},
210
- ): UnstableAccessGrantsGetRequest {
211
- if (!this.defaults.isUndocumentedApiEnabled) {
212
- throw new Error(
213
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
214
- )
215
- }
216
- return new SeamHttpRequest(this, {
217
- pathname: '/unstable_access_grants/get',
218
- method: 'POST',
219
- body: parameters,
220
- responseKey: 'access_grant',
221
- options,
222
- })
223
- }
224
-
225
- list(
226
- parameters?: UnstableAccessGrantsListParameters,
227
- options: UnstableAccessGrantsListOptions = {},
228
- ): UnstableAccessGrantsListRequest {
229
- if (!this.defaults.isUndocumentedApiEnabled) {
230
- throw new Error(
231
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
232
- )
233
- }
234
- return new SeamHttpRequest(this, {
235
- pathname: '/unstable_access_grants/list',
236
- method: 'POST',
237
- body: parameters,
238
- responseKey: 'access_grants',
239
- options,
240
- })
241
- }
242
- }
243
-
244
- export type UnstableAccessGrantsCreateParameters =
245
- RouteRequestBody<'/unstable_access_grants/create'>
246
-
247
- /**
248
- * @deprecated Use UnstableAccessGrantsCreateParameters instead.
249
- */
250
- export type UnstableAccessGrantsCreateBody =
251
- UnstableAccessGrantsCreateParameters
252
-
253
- /**
254
- * @deprecated Use UnstableAccessGrantsCreateRequest instead.
255
- */
256
- export type UnstableAccessGrantsCreateResponse = SetNonNullable<
257
- Required<RouteResponse<'/unstable_access_grants/create'>>
258
- >
259
-
260
- export type UnstableAccessGrantsCreateRequest = SeamHttpRequest<
261
- UnstableAccessGrantsCreateResponse,
262
- 'access_grant'
263
- >
264
-
265
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
266
- export interface UnstableAccessGrantsCreateOptions {}
267
-
268
- export type UnstableAccessGrantsDeleteParameters =
269
- RouteRequestBody<'/unstable_access_grants/delete'>
270
-
271
- /**
272
- * @deprecated Use UnstableAccessGrantsDeleteParameters instead.
273
- */
274
- export type UnstableAccessGrantsDeleteParams =
275
- UnstableAccessGrantsDeleteParameters
276
-
277
- /**
278
- * @deprecated Use UnstableAccessGrantsDeleteRequest instead.
279
- */
280
- export type UnstableAccessGrantsDeleteResponse = SetNonNullable<
281
- Required<RouteResponse<'/unstable_access_grants/delete'>>
282
- >
283
-
284
- export type UnstableAccessGrantsDeleteRequest = SeamHttpRequest<void, undefined>
285
-
286
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
287
- export interface UnstableAccessGrantsDeleteOptions {}
288
-
289
- export type UnstableAccessGrantsGetParameters =
290
- RouteRequestBody<'/unstable_access_grants/get'>
291
-
292
- /**
293
- * @deprecated Use UnstableAccessGrantsGetParameters instead.
294
- */
295
- export type UnstableAccessGrantsGetParams = UnstableAccessGrantsGetParameters
296
-
297
- /**
298
- * @deprecated Use UnstableAccessGrantsGetRequest instead.
299
- */
300
- export type UnstableAccessGrantsGetResponse = SetNonNullable<
301
- Required<RouteResponse<'/unstable_access_grants/get'>>
302
- >
303
-
304
- export type UnstableAccessGrantsGetRequest = SeamHttpRequest<
305
- UnstableAccessGrantsGetResponse,
306
- 'access_grant'
307
- >
308
-
309
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
310
- export interface UnstableAccessGrantsGetOptions {}
311
-
312
- export type UnstableAccessGrantsListParameters =
313
- RouteRequestBody<'/unstable_access_grants/list'>
314
-
315
- /**
316
- * @deprecated Use UnstableAccessGrantsListParameters instead.
317
- */
318
- export type UnstableAccessGrantsListParams = UnstableAccessGrantsListParameters
319
-
320
- /**
321
- * @deprecated Use UnstableAccessGrantsListRequest instead.
322
- */
323
- export type UnstableAccessGrantsListResponse = SetNonNullable<
324
- Required<RouteResponse<'/unstable_access_grants/list'>>
325
- >
326
-
327
- export type UnstableAccessGrantsListRequest = SeamHttpRequest<
328
- UnstableAccessGrantsListResponse,
329
- 'access_grants'
330
- >
331
-
332
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
333
- export interface UnstableAccessGrantsListOptions {}
@@ -1,6 +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
- export * from './unstable-access-methods.js'
@@ -1,295 +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 { 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 SeamHttpUnstableAccessMethods {
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
- if (!options.isUndocumentedApiEnabled) {
48
- throw new Error(
49
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
50
- )
51
- }
52
- this.client = 'client' in options ? options.client : createClient(options)
53
- this.defaults = limitToSeamHttpRequestOptions(options)
54
- }
55
-
56
- static fromClient(
57
- client: SeamHttpOptionsWithClient['client'],
58
- options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
59
- ): SeamHttpUnstableAccessMethods {
60
- const constructorOptions = { ...options, client }
61
- if (!isSeamHttpOptionsWithClient(constructorOptions)) {
62
- throw new SeamHttpInvalidOptionsError('Missing client')
63
- }
64
- return new SeamHttpUnstableAccessMethods(constructorOptions)
65
- }
66
-
67
- static fromApiKey(
68
- apiKey: SeamHttpOptionsWithApiKey['apiKey'],
69
- options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
70
- ): SeamHttpUnstableAccessMethods {
71
- const constructorOptions = { ...options, apiKey }
72
- if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
73
- throw new SeamHttpInvalidOptionsError('Missing apiKey')
74
- }
75
- return new SeamHttpUnstableAccessMethods(constructorOptions)
76
- }
77
-
78
- static fromClientSessionToken(
79
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
80
- options: Omit<
81
- SeamHttpOptionsWithClientSessionToken,
82
- 'clientSessionToken'
83
- > = {},
84
- ): SeamHttpUnstableAccessMethods {
85
- const constructorOptions = { ...options, clientSessionToken }
86
- if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
87
- throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
88
- }
89
- return new SeamHttpUnstableAccessMethods(constructorOptions)
90
- }
91
-
92
- static async fromPublishableKey(
93
- publishableKey: string,
94
- userIdentifierKey: string,
95
- options: SeamHttpFromPublishableKeyOptions = {},
96
- ): Promise<SeamHttpUnstableAccessMethods> {
97
- warnOnInsecureuserIdentifierKey(userIdentifierKey)
98
- const clientOptions = parseOptions({ ...options, publishableKey })
99
- if (isSeamHttpOptionsWithClient(clientOptions)) {
100
- throw new SeamHttpInvalidOptionsError(
101
- 'The client option cannot be used with SeamHttpUnstableAccessMethods.fromPublishableKey',
102
- )
103
- }
104
- const client = createClient(clientOptions)
105
- const clientSessions = SeamHttpClientSessions.fromClient(client)
106
- const { token } = await clientSessions.getOrCreate({
107
- user_identifier_key: userIdentifierKey,
108
- })
109
- return SeamHttpUnstableAccessMethods.fromClientSessionToken(token, options)
110
- }
111
-
112
- static fromConsoleSessionToken(
113
- consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
114
- workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
115
- options: Omit<
116
- SeamHttpOptionsWithConsoleSessionToken,
117
- 'consoleSessionToken' | 'workspaceId'
118
- > = {},
119
- ): SeamHttpUnstableAccessMethods {
120
- const constructorOptions = { ...options, consoleSessionToken, workspaceId }
121
- if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
122
- throw new SeamHttpInvalidOptionsError(
123
- 'Missing consoleSessionToken or workspaceId',
124
- )
125
- }
126
- return new SeamHttpUnstableAccessMethods(constructorOptions)
127
- }
128
-
129
- static fromPersonalAccessToken(
130
- personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
131
- workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
132
- options: Omit<
133
- SeamHttpOptionsWithPersonalAccessToken,
134
- 'personalAccessToken' | 'workspaceId'
135
- > = {},
136
- ): SeamHttpUnstableAccessMethods {
137
- const constructorOptions = { ...options, personalAccessToken, workspaceId }
138
- if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
139
- throw new SeamHttpInvalidOptionsError(
140
- 'Missing personalAccessToken or workspaceId',
141
- )
142
- }
143
- return new SeamHttpUnstableAccessMethods(constructorOptions)
144
- }
145
-
146
- createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
147
- request: SeamHttpRequest<TResponse, TResponseKey>,
148
- ): SeamPaginator<TResponse, TResponseKey> {
149
- return new SeamPaginator<TResponse, TResponseKey>(this, request)
150
- }
151
-
152
- async updateClientSessionToken(
153
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
154
- ): Promise<void> {
155
- const { headers } = this.client.defaults
156
- const authHeaders = getAuthHeadersForClientSessionToken({
157
- clientSessionToken,
158
- })
159
- for (const key of Object.keys(authHeaders)) {
160
- if (headers[key] == null) {
161
- throw new Error(
162
- 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
163
- )
164
- }
165
- }
166
- this.client.defaults.headers = { ...headers, ...authHeaders }
167
- const clientSessions = SeamHttpClientSessions.fromClient(this.client)
168
- await clientSessions.get()
169
- }
170
-
171
- delete(
172
- parameters?: UnstableAccessMethodsDeleteParameters,
173
- options: UnstableAccessMethodsDeleteOptions = {},
174
- ): UnstableAccessMethodsDeleteRequest {
175
- if (!this.defaults.isUndocumentedApiEnabled) {
176
- throw new Error(
177
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
178
- )
179
- }
180
- return new SeamHttpRequest(this, {
181
- pathname: '/unstable_access_methods/delete',
182
- method: 'POST',
183
- body: parameters,
184
- responseKey: undefined,
185
- options,
186
- })
187
- }
188
-
189
- get(
190
- parameters?: UnstableAccessMethodsGetParameters,
191
- options: UnstableAccessMethodsGetOptions = {},
192
- ): UnstableAccessMethodsGetRequest {
193
- if (!this.defaults.isUndocumentedApiEnabled) {
194
- throw new Error(
195
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
196
- )
197
- }
198
- return new SeamHttpRequest(this, {
199
- pathname: '/unstable_access_methods/get',
200
- method: 'POST',
201
- body: parameters,
202
- responseKey: 'access_method',
203
- options,
204
- })
205
- }
206
-
207
- list(
208
- parameters?: UnstableAccessMethodsListParameters,
209
- options: UnstableAccessMethodsListOptions = {},
210
- ): UnstableAccessMethodsListRequest {
211
- if (!this.defaults.isUndocumentedApiEnabled) {
212
- throw new Error(
213
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
214
- )
215
- }
216
- return new SeamHttpRequest(this, {
217
- pathname: '/unstable_access_methods/list',
218
- method: 'POST',
219
- body: parameters,
220
- responseKey: 'access_methods',
221
- options,
222
- })
223
- }
224
- }
225
-
226
- export type UnstableAccessMethodsDeleteParameters =
227
- RouteRequestBody<'/unstable_access_methods/delete'>
228
-
229
- /**
230
- * @deprecated Use UnstableAccessMethodsDeleteParameters instead.
231
- */
232
- export type UnstableAccessMethodsDeleteParams =
233
- UnstableAccessMethodsDeleteParameters
234
-
235
- /**
236
- * @deprecated Use UnstableAccessMethodsDeleteRequest instead.
237
- */
238
- export type UnstableAccessMethodsDeleteResponse = SetNonNullable<
239
- Required<RouteResponse<'/unstable_access_methods/delete'>>
240
- >
241
-
242
- export type UnstableAccessMethodsDeleteRequest = SeamHttpRequest<
243
- void,
244
- undefined
245
- >
246
-
247
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
248
- export interface UnstableAccessMethodsDeleteOptions {}
249
-
250
- export type UnstableAccessMethodsGetParameters =
251
- RouteRequestBody<'/unstable_access_methods/get'>
252
-
253
- /**
254
- * @deprecated Use UnstableAccessMethodsGetParameters instead.
255
- */
256
- export type UnstableAccessMethodsGetParams = UnstableAccessMethodsGetParameters
257
-
258
- /**
259
- * @deprecated Use UnstableAccessMethodsGetRequest instead.
260
- */
261
- export type UnstableAccessMethodsGetResponse = SetNonNullable<
262
- Required<RouteResponse<'/unstable_access_methods/get'>>
263
- >
264
-
265
- export type UnstableAccessMethodsGetRequest = SeamHttpRequest<
266
- UnstableAccessMethodsGetResponse,
267
- 'access_method'
268
- >
269
-
270
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
271
- export interface UnstableAccessMethodsGetOptions {}
272
-
273
- export type UnstableAccessMethodsListParameters =
274
- RouteRequestBody<'/unstable_access_methods/list'>
275
-
276
- /**
277
- * @deprecated Use UnstableAccessMethodsListParameters instead.
278
- */
279
- export type UnstableAccessMethodsListParams =
280
- UnstableAccessMethodsListParameters
281
-
282
- /**
283
- * @deprecated Use UnstableAccessMethodsListRequest instead.
284
- */
285
- export type UnstableAccessMethodsListResponse = SetNonNullable<
286
- Required<RouteResponse<'/unstable_access_methods/list'>>
287
- >
288
-
289
- export type UnstableAccessMethodsListRequest = SeamHttpRequest<
290
- UnstableAccessMethodsListResponse,
291
- 'access_methods'
292
- >
293
-
294
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
295
- export interface UnstableAccessMethodsListOptions {}
@@ -1,6 +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
- export * from './unstable-locations.js'