@seamapi/http 1.102.0 → 1.105.1
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.
- package/README.md +0 -1
- package/dist/connect.cjs +601 -235
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +184 -52
- package/dist/index.cjs +609 -239
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/routes/access-codes/access-codes.d.ts +13 -0
- package/lib/seam/connect/routes/access-codes/access-codes.js +9 -0
- package/lib/seam/connect/routes/access-codes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/access-methods/access-methods.d.ts +2 -2
- package/lib/seam/connect/routes/access-methods/access-methods.js +2 -2
- package/lib/seam/connect/routes/access-methods/access-methods.js.map +1 -1
- package/lib/seam/connect/routes/customers/customers.d.ts +2 -0
- package/lib/seam/connect/routes/customers/customers.js +4 -0
- package/lib/seam/connect/routes/customers/customers.js.map +1 -1
- package/lib/seam/connect/routes/customers/index.d.ts +1 -0
- package/lib/seam/connect/routes/customers/index.js +1 -0
- package/lib/seam/connect/routes/customers/index.js.map +1 -1
- package/lib/seam/connect/routes/customers/reservations/index.d.ts +1 -0
- package/lib/seam/connect/routes/{seam/v1 → customers/reservations}/index.js +1 -2
- package/lib/seam/connect/routes/customers/reservations/index.js.map +1 -0
- package/lib/seam/connect/routes/{seam/v1/v1.d.ts → customers/reservations/reservations.d.ts} +23 -10
- package/lib/seam/connect/routes/{seam/v1/v1.js → customers/reservations/reservations.js} +18 -12
- package/lib/seam/connect/routes/customers/reservations/reservations.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.d.ts +13 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.js +12 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/access-methods/access-methods.d.ts +33 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-methods/access-methods.js +104 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-methods/access-methods.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-methods/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-methods/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/access-methods/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/customers/customers.d.ts +14 -1
- package/lib/seam/connect/routes/seam/customer/v1/customers/customers.js +9 -3
- package/lib/seam/connect/routes/seam/customer/v1/customers/customers.js.map +1 -1
- package/lib/seam/connect/routes/seam/{v1/customers/customers.d.ts → customer/v1/encoders/encoders.d.ts} +20 -20
- package/lib/seam/connect/routes/seam/{v1/customers/customers.js → customer/v1/encoders/encoders.js} +26 -20
- package/lib/seam/connect/routes/seam/customer/v1/encoders/encoders.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/encoders/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/{v1/customers → customer/v1/encoders}/index.js +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/encoders/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +2 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js +2 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/settings/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/index.js +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/settings/settings.d.ts +2 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/settings.js +4 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/settings.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/vertical-resource-aliases.d.ts +34 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/vertical-resource-aliases.js +104 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/vertical-resource-aliases.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.d.ts +13 -0
- package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.js +9 -3
- package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +4 -0
- package/lib/seam/connect/routes/seam/customer/v1/v1.js +8 -3
- package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
- package/lib/seam/connect/routes/seam/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/index.js +0 -1
- package/lib/seam/connect/routes/seam/index.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +19 -9
- package/lib/seam/connect/routes/seam-http-endpoints.js +72 -8
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -6
- package/src/lib/seam/connect/routes/access-codes/access-codes.ts +35 -0
- package/src/lib/seam/connect/routes/access-methods/access-methods.ts +8 -4
- package/src/lib/seam/connect/routes/customers/customers.ts +6 -0
- package/src/lib/seam/connect/routes/customers/index.ts +1 -0
- package/src/lib/seam/connect/routes/{seam/v1 → customers/reservations}/index.ts +1 -2
- package/src/lib/seam/connect/routes/{seam/v1/customers/customers.ts → customers/reservations/reservations.ts} +33 -29
- package/src/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.ts +41 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/access-methods/access-methods.ts +217 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/access-methods/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts +38 -6
- package/src/lib/seam/connect/routes/seam/{v1/v1.ts → customer/v1/encoders/encoders.ts} +62 -19
- package/src/lib/seam/connect/routes/seam/{v1/customers → customer/v1/encoders}/index.ts +1 -1
- package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +2 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/settings/index.ts +1 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts +9 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/settings/vertical-resource-aliases/vertical-resource-aliases.ts +228 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.ts +36 -5
- package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +13 -5
- package/src/lib/seam/connect/routes/seam/index.ts +0 -1
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +182 -21
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/routes/seam/v1/customers/customers.js.map +0 -1
- package/lib/seam/connect/routes/seam/v1/customers/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/v1/customers/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/v1/index.d.ts +0 -2
- package/lib/seam/connect/routes/seam/v1/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/v1/v1.js.map +0 -1
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Do not edit this file or add other files to this directory.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
+
|
|
6
8
|
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
7
9
|
import {
|
|
8
10
|
getAuthHeadersForClientSessionToken,
|
|
@@ -30,12 +32,11 @@ import {
|
|
|
30
32
|
parseOptions,
|
|
31
33
|
} from 'lib/seam/connect/parse-options.js'
|
|
32
34
|
import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
|
|
33
|
-
import
|
|
35
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
34
36
|
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
|
|
37
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export class SeamHttpSeamV1 {
|
|
39
|
+
export class SeamHttpSeamCustomerV1Encoders {
|
|
39
40
|
client: Client
|
|
40
41
|
readonly defaults: Required<SeamHttpRequestOptions>
|
|
41
42
|
readonly ltsVersion = seamApiLtsVersion
|
|
@@ -43,6 +44,11 @@ export class SeamHttpSeamV1 {
|
|
|
43
44
|
|
|
44
45
|
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
45
46
|
const options = parseOptions(apiKeyOrOptions)
|
|
47
|
+
if (!options.isUndocumentedApiEnabled) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
50
|
+
)
|
|
51
|
+
}
|
|
46
52
|
this.client = 'client' in options ? options.client : createClient(options)
|
|
47
53
|
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
48
54
|
}
|
|
@@ -50,23 +56,23 @@ export class SeamHttpSeamV1 {
|
|
|
50
56
|
static fromClient(
|
|
51
57
|
client: SeamHttpOptionsWithClient['client'],
|
|
52
58
|
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
53
|
-
):
|
|
59
|
+
): SeamHttpSeamCustomerV1Encoders {
|
|
54
60
|
const constructorOptions = { ...options, client }
|
|
55
61
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
56
62
|
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
57
63
|
}
|
|
58
|
-
return new
|
|
64
|
+
return new SeamHttpSeamCustomerV1Encoders(constructorOptions)
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
static fromApiKey(
|
|
62
68
|
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
63
69
|
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
64
|
-
):
|
|
70
|
+
): SeamHttpSeamCustomerV1Encoders {
|
|
65
71
|
const constructorOptions = { ...options, apiKey }
|
|
66
72
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
67
73
|
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
68
74
|
}
|
|
69
|
-
return new
|
|
75
|
+
return new SeamHttpSeamCustomerV1Encoders(constructorOptions)
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
static fromClientSessionToken(
|
|
@@ -75,24 +81,24 @@ export class SeamHttpSeamV1 {
|
|
|
75
81
|
SeamHttpOptionsWithClientSessionToken,
|
|
76
82
|
'clientSessionToken'
|
|
77
83
|
> = {},
|
|
78
|
-
):
|
|
84
|
+
): SeamHttpSeamCustomerV1Encoders {
|
|
79
85
|
const constructorOptions = { ...options, clientSessionToken }
|
|
80
86
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
81
87
|
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
82
88
|
}
|
|
83
|
-
return new
|
|
89
|
+
return new SeamHttpSeamCustomerV1Encoders(constructorOptions)
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
static async fromPublishableKey(
|
|
87
93
|
publishableKey: string,
|
|
88
94
|
userIdentifierKey: string,
|
|
89
95
|
options: SeamHttpFromPublishableKeyOptions = {},
|
|
90
|
-
): Promise<
|
|
96
|
+
): Promise<SeamHttpSeamCustomerV1Encoders> {
|
|
91
97
|
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
92
98
|
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
93
99
|
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
94
100
|
throw new SeamHttpInvalidOptionsError(
|
|
95
|
-
'The client option cannot be used with
|
|
101
|
+
'The client option cannot be used with SeamHttpSeamCustomerV1Encoders.fromPublishableKey',
|
|
96
102
|
)
|
|
97
103
|
}
|
|
98
104
|
const client = createClient(clientOptions)
|
|
@@ -100,7 +106,7 @@ export class SeamHttpSeamV1 {
|
|
|
100
106
|
const { token } = await clientSessions.getOrCreate({
|
|
101
107
|
user_identifier_key: userIdentifierKey,
|
|
102
108
|
})
|
|
103
|
-
return
|
|
109
|
+
return SeamHttpSeamCustomerV1Encoders.fromClientSessionToken(token, options)
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
static fromConsoleSessionToken(
|
|
@@ -110,14 +116,14 @@ export class SeamHttpSeamV1 {
|
|
|
110
116
|
SeamHttpOptionsWithConsoleSessionToken,
|
|
111
117
|
'consoleSessionToken' | 'workspaceId'
|
|
112
118
|
> = {},
|
|
113
|
-
):
|
|
119
|
+
): SeamHttpSeamCustomerV1Encoders {
|
|
114
120
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
115
121
|
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
116
122
|
throw new SeamHttpInvalidOptionsError(
|
|
117
123
|
'Missing consoleSessionToken or workspaceId',
|
|
118
124
|
)
|
|
119
125
|
}
|
|
120
|
-
return new
|
|
126
|
+
return new SeamHttpSeamCustomerV1Encoders(constructorOptions)
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
static fromPersonalAccessToken(
|
|
@@ -127,14 +133,14 @@ export class SeamHttpSeamV1 {
|
|
|
127
133
|
SeamHttpOptionsWithPersonalAccessToken,
|
|
128
134
|
'personalAccessToken' | 'workspaceId'
|
|
129
135
|
> = {},
|
|
130
|
-
):
|
|
136
|
+
): SeamHttpSeamCustomerV1Encoders {
|
|
131
137
|
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
132
138
|
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
133
139
|
throw new SeamHttpInvalidOptionsError(
|
|
134
140
|
'Missing personalAccessToken or workspaceId',
|
|
135
141
|
)
|
|
136
142
|
}
|
|
137
|
-
return new
|
|
143
|
+
return new SeamHttpSeamCustomerV1Encoders(constructorOptions)
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
@@ -162,7 +168,44 @@ export class SeamHttpSeamV1 {
|
|
|
162
168
|
await clientSessions.get()
|
|
163
169
|
}
|
|
164
170
|
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
list(
|
|
172
|
+
parameters?: SeamCustomerV1EncodersListParameters,
|
|
173
|
+
options: SeamCustomerV1EncodersListOptions = {},
|
|
174
|
+
): SeamCustomerV1EncodersListRequest {
|
|
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: '/seam/customer/v1/encoders/list',
|
|
182
|
+
method: 'POST',
|
|
183
|
+
body: parameters,
|
|
184
|
+
responseKey: 'encoders',
|
|
185
|
+
options,
|
|
186
|
+
})
|
|
167
187
|
}
|
|
168
188
|
}
|
|
189
|
+
|
|
190
|
+
export type SeamCustomerV1EncodersListParameters =
|
|
191
|
+
RouteRequestBody<'/seam/customer/v1/encoders/list'>
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @deprecated Use SeamCustomerV1EncodersListParameters instead.
|
|
195
|
+
*/
|
|
196
|
+
export type SeamCustomerV1EncodersListParams =
|
|
197
|
+
SeamCustomerV1EncodersListParameters
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated Use SeamCustomerV1EncodersListRequest instead.
|
|
201
|
+
*/
|
|
202
|
+
export type SeamCustomerV1EncodersListResponse = SetNonNullable<
|
|
203
|
+
Required<RouteResponse<'/seam/customer/v1/encoders/list'>>
|
|
204
|
+
>
|
|
205
|
+
|
|
206
|
+
export type SeamCustomerV1EncodersListRequest = SeamHttpRequest<
|
|
207
|
+
SeamCustomerV1EncodersListResponse,
|
|
208
|
+
'encoders'
|
|
209
|
+
>
|
|
210
|
+
|
|
211
|
+
export interface SeamCustomerV1EncodersListOptions {}
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export * from './access-grants/index.js'
|
|
7
|
+
export * from './access-methods/index.js'
|
|
7
8
|
export * from './automation-runs/index.js'
|
|
8
9
|
export * from './automations/index.js'
|
|
9
10
|
export * from './connector-customers/index.js'
|
|
10
11
|
export * from './connectors/index.js'
|
|
11
12
|
export * from './customers/index.js'
|
|
13
|
+
export * from './encoders/index.js'
|
|
12
14
|
export * from './events/index.js'
|
|
13
15
|
export * from './portals/index.js'
|
|
14
16
|
export * from './reservations/index.js'
|
|
@@ -40,6 +40,8 @@ import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
|
40
40
|
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
|
|
41
41
|
import type { SetNonNullable } from 'lib/types.js'
|
|
42
42
|
|
|
43
|
+
import { SeamHttpSeamCustomerV1SettingsVerticalResourceAliases } from './vertical-resource-aliases/index.js'
|
|
44
|
+
|
|
43
45
|
export class SeamHttpSeamCustomerV1Settings {
|
|
44
46
|
client: Client
|
|
45
47
|
readonly defaults: Required<SeamHttpRequestOptions>
|
|
@@ -172,6 +174,13 @@ export class SeamHttpSeamCustomerV1Settings {
|
|
|
172
174
|
await clientSessions.get()
|
|
173
175
|
}
|
|
174
176
|
|
|
177
|
+
get verticalResourceAliases(): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases {
|
|
178
|
+
return SeamHttpSeamCustomerV1SettingsVerticalResourceAliases.fromClient(
|
|
179
|
+
this.client,
|
|
180
|
+
this.defaults,
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
175
184
|
get(
|
|
176
185
|
parameters?: SeamCustomerV1SettingsGetParameters,
|
|
177
186
|
options: SeamCustomerV1SettingsGetOptions = {},
|
|
@@ -0,0 +1,228 @@
|
|
|
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 SeamHttpSeamCustomerV1SettingsVerticalResourceAliases {
|
|
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
|
+
): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases {
|
|
60
|
+
const constructorOptions = { ...options, client }
|
|
61
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
62
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
63
|
+
}
|
|
64
|
+
return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases(
|
|
65
|
+
constructorOptions,
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static fromApiKey(
|
|
70
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
71
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
72
|
+
): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases {
|
|
73
|
+
const constructorOptions = { ...options, apiKey }
|
|
74
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
75
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
76
|
+
}
|
|
77
|
+
return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases(
|
|
78
|
+
constructorOptions,
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static fromClientSessionToken(
|
|
83
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
84
|
+
options: Omit<
|
|
85
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
86
|
+
'clientSessionToken'
|
|
87
|
+
> = {},
|
|
88
|
+
): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases {
|
|
89
|
+
const constructorOptions = { ...options, clientSessionToken }
|
|
90
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
91
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
92
|
+
}
|
|
93
|
+
return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases(
|
|
94
|
+
constructorOptions,
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static async fromPublishableKey(
|
|
99
|
+
publishableKey: string,
|
|
100
|
+
userIdentifierKey: string,
|
|
101
|
+
options: SeamHttpFromPublishableKeyOptions = {},
|
|
102
|
+
): Promise<SeamHttpSeamCustomerV1SettingsVerticalResourceAliases> {
|
|
103
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
104
|
+
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
105
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
106
|
+
throw new SeamHttpInvalidOptionsError(
|
|
107
|
+
'The client option cannot be used with SeamHttpSeamCustomerV1SettingsVerticalResourceAliases.fromPublishableKey',
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
const client = createClient(clientOptions)
|
|
111
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client)
|
|
112
|
+
const { token } = await clientSessions.getOrCreate({
|
|
113
|
+
user_identifier_key: userIdentifierKey,
|
|
114
|
+
})
|
|
115
|
+
return SeamHttpSeamCustomerV1SettingsVerticalResourceAliases.fromClientSessionToken(
|
|
116
|
+
token,
|
|
117
|
+
options,
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
static fromConsoleSessionToken(
|
|
122
|
+
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
123
|
+
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
124
|
+
options: Omit<
|
|
125
|
+
SeamHttpOptionsWithConsoleSessionToken,
|
|
126
|
+
'consoleSessionToken' | 'workspaceId'
|
|
127
|
+
> = {},
|
|
128
|
+
): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases {
|
|
129
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
130
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
131
|
+
throw new SeamHttpInvalidOptionsError(
|
|
132
|
+
'Missing consoleSessionToken or workspaceId',
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases(
|
|
136
|
+
constructorOptions,
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static fromPersonalAccessToken(
|
|
141
|
+
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
142
|
+
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
143
|
+
options: Omit<
|
|
144
|
+
SeamHttpOptionsWithPersonalAccessToken,
|
|
145
|
+
'personalAccessToken' | 'workspaceId'
|
|
146
|
+
> = {},
|
|
147
|
+
): SeamHttpSeamCustomerV1SettingsVerticalResourceAliases {
|
|
148
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
149
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
150
|
+
throw new SeamHttpInvalidOptionsError(
|
|
151
|
+
'Missing personalAccessToken or workspaceId',
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
return new SeamHttpSeamCustomerV1SettingsVerticalResourceAliases(
|
|
155
|
+
constructorOptions,
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
160
|
+
request: SeamHttpRequest<TResponse, TResponseKey>,
|
|
161
|
+
): SeamPaginator<TResponse, TResponseKey> {
|
|
162
|
+
return new SeamPaginator<TResponse, TResponseKey>(this, request)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async updateClientSessionToken(
|
|
166
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
167
|
+
): Promise<void> {
|
|
168
|
+
const { headers } = this.client.defaults
|
|
169
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
170
|
+
clientSessionToken,
|
|
171
|
+
})
|
|
172
|
+
for (const key of Object.keys(authHeaders)) {
|
|
173
|
+
if (headers[key] == null) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
180
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
181
|
+
await clientSessions.get()
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
get(
|
|
185
|
+
parameters?: SeamCustomerV1SettingsVerticalResourceAliasesGetParameters,
|
|
186
|
+
options: SeamCustomerV1SettingsVerticalResourceAliasesGetOptions = {},
|
|
187
|
+
): SeamCustomerV1SettingsVerticalResourceAliasesGetRequest {
|
|
188
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
189
|
+
throw new Error(
|
|
190
|
+
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
return new SeamHttpRequest(this, {
|
|
194
|
+
pathname: '/seam/customer/v1/settings/vertical_resource_aliases/get',
|
|
195
|
+
method: 'POST',
|
|
196
|
+
body: parameters,
|
|
197
|
+
responseKey: 'vertical_resource_aliases',
|
|
198
|
+
options,
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export type SeamCustomerV1SettingsVerticalResourceAliasesGetParameters =
|
|
204
|
+
RouteRequestBody<'/seam/customer/v1/settings/vertical_resource_aliases/get'>
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @deprecated Use SeamCustomerV1SettingsVerticalResourceAliasesGetParameters instead.
|
|
208
|
+
*/
|
|
209
|
+
export type SeamCustomerV1SettingsVerticalResourceAliasesGetParams =
|
|
210
|
+
SeamCustomerV1SettingsVerticalResourceAliasesGetParameters
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @deprecated Use SeamCustomerV1SettingsVerticalResourceAliasesGetRequest instead.
|
|
214
|
+
*/
|
|
215
|
+
export type SeamCustomerV1SettingsVerticalResourceAliasesGetResponse =
|
|
216
|
+
SetNonNullable<
|
|
217
|
+
Required<
|
|
218
|
+
RouteResponse<'/seam/customer/v1/settings/vertical_resource_aliases/get'>
|
|
219
|
+
>
|
|
220
|
+
>
|
|
221
|
+
|
|
222
|
+
export type SeamCustomerV1SettingsVerticalResourceAliasesGetRequest =
|
|
223
|
+
SeamHttpRequest<
|
|
224
|
+
SeamCustomerV1SettingsVerticalResourceAliasesGetResponse,
|
|
225
|
+
'vertical_resource_aliases'
|
|
226
|
+
>
|
|
227
|
+
|
|
228
|
+
export interface SeamCustomerV1SettingsVerticalResourceAliasesGetOptions {}
|
|
@@ -44,11 +44,6 @@ export class SeamHttpSeamCustomerV1Spaces {
|
|
|
44
44
|
|
|
45
45
|
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
46
46
|
const options = parseOptions(apiKeyOrOptions)
|
|
47
|
-
if (!options.isUndocumentedApiEnabled) {
|
|
48
|
-
throw new Error(
|
|
49
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
47
|
this.client = 'client' in options ? options.client : createClient(options)
|
|
53
48
|
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
54
49
|
}
|
|
@@ -221,6 +216,19 @@ export class SeamHttpSeamCustomerV1Spaces {
|
|
|
221
216
|
options,
|
|
222
217
|
})
|
|
223
218
|
}
|
|
219
|
+
|
|
220
|
+
pushCommonAreas(
|
|
221
|
+
parameters?: SeamCustomerV1SpacesPushCommonAreasParameters,
|
|
222
|
+
options: SeamCustomerV1SpacesPushCommonAreasOptions = {},
|
|
223
|
+
): SeamCustomerV1SpacesPushCommonAreasRequest {
|
|
224
|
+
return new SeamHttpRequest(this, {
|
|
225
|
+
pathname: '/seam/customer/v1/spaces/push_common_areas',
|
|
226
|
+
method: 'POST',
|
|
227
|
+
body: parameters,
|
|
228
|
+
responseKey: undefined,
|
|
229
|
+
options,
|
|
230
|
+
})
|
|
231
|
+
}
|
|
224
232
|
}
|
|
225
233
|
|
|
226
234
|
export type SeamCustomerV1SpacesCreateParameters =
|
|
@@ -290,3 +298,26 @@ export type SeamCustomerV1SpacesListReservationsRequest = SeamHttpRequest<
|
|
|
290
298
|
>
|
|
291
299
|
|
|
292
300
|
export interface SeamCustomerV1SpacesListReservationsOptions {}
|
|
301
|
+
|
|
302
|
+
export type SeamCustomerV1SpacesPushCommonAreasParameters =
|
|
303
|
+
RouteRequestBody<'/seam/customer/v1/spaces/push_common_areas'>
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @deprecated Use SeamCustomerV1SpacesPushCommonAreasParameters instead.
|
|
307
|
+
*/
|
|
308
|
+
export type SeamCustomerV1SpacesPushCommonAreasBody =
|
|
309
|
+
SeamCustomerV1SpacesPushCommonAreasParameters
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @deprecated Use SeamCustomerV1SpacesPushCommonAreasRequest instead.
|
|
313
|
+
*/
|
|
314
|
+
export type SeamCustomerV1SpacesPushCommonAreasResponse = SetNonNullable<
|
|
315
|
+
Required<RouteResponse<'/seam/customer/v1/spaces/push_common_areas'>>
|
|
316
|
+
>
|
|
317
|
+
|
|
318
|
+
export type SeamCustomerV1SpacesPushCommonAreasRequest = SeamHttpRequest<
|
|
319
|
+
void,
|
|
320
|
+
undefined
|
|
321
|
+
>
|
|
322
|
+
|
|
323
|
+
export interface SeamCustomerV1SpacesPushCommonAreasOptions {}
|
|
@@ -34,11 +34,13 @@ import type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
|
34
34
|
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
|
|
35
35
|
|
|
36
36
|
import { SeamHttpSeamCustomerV1AccessGrants } from './access-grants/index.js'
|
|
37
|
+
import { SeamHttpSeamCustomerV1AccessMethods } from './access-methods/index.js'
|
|
37
38
|
import { SeamHttpSeamCustomerV1AutomationRuns } from './automation-runs/index.js'
|
|
38
39
|
import { SeamHttpSeamCustomerV1Automations } from './automations/index.js'
|
|
39
40
|
import { SeamHttpSeamCustomerV1ConnectorCustomers } from './connector-customers/index.js'
|
|
40
41
|
import { SeamHttpSeamCustomerV1Connectors } from './connectors/index.js'
|
|
41
42
|
import { SeamHttpSeamCustomerV1Customers } from './customers/index.js'
|
|
43
|
+
import { SeamHttpSeamCustomerV1Encoders } from './encoders/index.js'
|
|
42
44
|
import { SeamHttpSeamCustomerV1Events } from './events/index.js'
|
|
43
45
|
import { SeamHttpSeamCustomerV1Portals } from './portals/index.js'
|
|
44
46
|
import { SeamHttpSeamCustomerV1Reservations } from './reservations/index.js'
|
|
@@ -54,11 +56,6 @@ export class SeamHttpSeamCustomerV1 {
|
|
|
54
56
|
|
|
55
57
|
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
56
58
|
const options = parseOptions(apiKeyOrOptions)
|
|
57
|
-
if (!options.isUndocumentedApiEnabled) {
|
|
58
|
-
throw new Error(
|
|
59
|
-
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
59
|
this.client = 'client' in options ? options.client : createClient(options)
|
|
63
60
|
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
64
61
|
}
|
|
@@ -185,6 +182,13 @@ export class SeamHttpSeamCustomerV1 {
|
|
|
185
182
|
)
|
|
186
183
|
}
|
|
187
184
|
|
|
185
|
+
get accessMethods(): SeamHttpSeamCustomerV1AccessMethods {
|
|
186
|
+
return SeamHttpSeamCustomerV1AccessMethods.fromClient(
|
|
187
|
+
this.client,
|
|
188
|
+
this.defaults,
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
|
|
188
192
|
get automationRuns(): SeamHttpSeamCustomerV1AutomationRuns {
|
|
189
193
|
return SeamHttpSeamCustomerV1AutomationRuns.fromClient(
|
|
190
194
|
this.client,
|
|
@@ -220,6 +224,10 @@ export class SeamHttpSeamCustomerV1 {
|
|
|
220
224
|
)
|
|
221
225
|
}
|
|
222
226
|
|
|
227
|
+
get encoders(): SeamHttpSeamCustomerV1Encoders {
|
|
228
|
+
return SeamHttpSeamCustomerV1Encoders.fromClient(this.client, this.defaults)
|
|
229
|
+
}
|
|
230
|
+
|
|
223
231
|
get events(): SeamHttpSeamCustomerV1Events {
|
|
224
232
|
return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults)
|
|
225
233
|
}
|