@seamapi/http 1.40.1 → 1.42.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.
- package/dist/connect.cjs +638 -213
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +256 -224
- package/lib/seam/connect/resolve-action-attempt.d.ts +32 -168
- package/lib/seam/connect/routes/access-methods/access-methods.d.ts +12 -0
- package/lib/seam/connect/routes/access-methods/access-methods.js +9 -0
- package/lib/seam/connect/routes/access-methods/access-methods.js.map +1 -1
- package/lib/seam/connect/routes/acs/encoders/encoders.d.ts +0 -12
- package/lib/seam/connect/routes/acs/encoders/encoders.js +0 -9
- package/lib/seam/connect/routes/acs/encoders/encoders.js.map +1 -1
- package/lib/seam/connect/routes/customers/customers.d.ts +47 -0
- package/lib/seam/connect/routes/customers/customers.js +105 -0
- package/lib/seam/connect/routes/customers/customers.js.map +1 -0
- package/lib/seam/connect/routes/customers/index.d.ts +1 -0
- package/lib/seam/connect/routes/{unstable-partner/resources → customers}/index.js +1 -1
- package/lib/seam/connect/routes/customers/index.js.map +1 -0
- package/lib/seam/connect/routes/devices/simulate/simulate.d.ts +1 -1
- package/lib/seam/connect/routes/index.d.ts +1 -0
- package/lib/seam/connect/routes/index.js +1 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/phones/simulate/simulate.d.ts +1 -1
- package/lib/seam/connect/routes/seam/customer/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/{partner/v1/resources → customer}/index.js +1 -1
- package/lib/seam/connect/routes/seam/customer/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.d.ts +34 -0
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.js +102 -0
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/automations/automations.d.ts +60 -0
- package/lib/seam/connect/routes/seam/customer/v1/automations/automations.js +126 -0
- package/lib/seam/connect/routes/seam/customer/v1/automations/automations.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/automations/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/automations/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/automations/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +5 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js +10 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/portals/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/portals/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/portals/index.js.map +1 -0
- package/lib/seam/connect/routes/{unstable-partner/resources/resources.d.ts → seam/customer/v1/portals/portals.d.ts} +20 -20
- package/lib/seam/connect/routes/{unstable-partner/resources/resources.js → seam/customer/v1/portals/portals.js} +21 -21
- package/lib/seam/connect/routes/{unstable-partner/resources/resources.js.map → seam/customer/v1/portals/portals.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 +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/{partner/v1/resources/resources.d.ts → customer/v1/settings/settings.d.ts} +15 -15
- package/lib/seam/connect/routes/seam/{partner/v1/resources/resources.js → customer/v1/settings/settings.js} +14 -14
- package/lib/seam/connect/routes/seam/customer/v1/settings/settings.js.map +1 -0
- package/lib/seam/connect/routes/seam/{partner → customer}/v1/v1.d.ts +15 -11
- package/lib/seam/connect/routes/seam/{partner → customer}/v1/v1.js +23 -15
- package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -0
- package/lib/seam/connect/routes/seam/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/index.js +1 -0
- package/lib/seam/connect/routes/seam/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/partner/v1/index.d.ts +0 -2
- package/lib/seam/connect/routes/seam/partner/v1/index.js +0 -2
- package/lib/seam/connect/routes/seam/partner/v1/index.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +19 -10
- package/lib/seam/connect/routes/seam-http-endpoints.js +84 -27
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/seam/connect/routes/seam-http.d.ts +2 -0
- package/lib/seam/connect/routes/seam-http.js +4 -0
- package/lib/seam/connect/routes/seam-http.js.map +1 -1
- package/lib/seam/connect/routes/unstable-partner/index.d.ts +0 -1
- package/lib/seam/connect/routes/unstable-partner/index.js +0 -1
- package/lib/seam/connect/routes/unstable-partner/index.js.map +1 -1
- package/lib/seam/connect/routes/unstable-partner/unstable-partner.d.ts +0 -2
- package/lib/seam/connect/routes/unstable-partner/unstable-partner.js +0 -4
- package/lib/seam/connect/routes/unstable-partner/unstable-partner.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/lib/seam/connect/routes/access-methods/access-methods.ts +38 -0
- package/src/lib/seam/connect/routes/acs/encoders/encoders.ts +0 -39
- package/src/lib/seam/connect/routes/customers/customers.ts +234 -0
- package/src/lib/seam/connect/routes/{seam/partner/v1/resources → customers}/index.ts +1 -1
- package/src/lib/seam/connect/routes/devices/simulate/simulate.ts +1 -1
- package/src/lib/seam/connect/routes/index.ts +1 -0
- package/src/lib/seam/connect/routes/phones/simulate/simulate.ts +1 -1
- package/src/lib/seam/connect/routes/{unstable-partner/resources → seam/customer}/index.ts +1 -1
- package/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.ts +215 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/automations/automations.ts +303 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/automations/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +10 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/{partner/v1/resources/resources.ts → customer/v1/portals/portals.ts} +31 -32
- package/src/lib/seam/connect/routes/seam/customer/v1/settings/index.ts +6 -0
- package/src/lib/seam/connect/routes/{unstable-partner/resources/resources.ts → seam/customer/v1/settings/settings.ts} +30 -33
- package/src/lib/seam/connect/routes/seam/{partner → customer}/v1/v1.ts +33 -20
- package/src/lib/seam/connect/routes/seam/index.ts +1 -0
- package/src/lib/seam/connect/routes/seam/partner/v1/index.ts +0 -2
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +216 -72
- package/src/lib/seam/connect/routes/seam-http.ts +5 -0
- package/src/lib/seam/connect/routes/unstable-partner/index.ts +0 -1
- package/src/lib/seam/connect/routes/unstable-partner/unstable-partner.ts +0 -8
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/routes/seam/partner/v1/resources/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/partner/v1/resources/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/partner/v1/resources/resources.js.map +0 -1
- package/lib/seam/connect/routes/seam/partner/v1/v1.js.map +0 -1
- package/lib/seam/connect/routes/unstable-partner/resources/index.d.ts +0 -1
- package/lib/seam/connect/routes/unstable-partner/resources/index.js.map +0 -1
|
@@ -0,0 +1,303 @@
|
|
|
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 SeamHttpSeamCustomerV1Automations {
|
|
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
|
+
): SeamHttpSeamCustomerV1Automations {
|
|
64
|
+
const constructorOptions = { ...options, client }
|
|
65
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
66
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
67
|
+
}
|
|
68
|
+
return new SeamHttpSeamCustomerV1Automations(constructorOptions)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static fromApiKey(
|
|
72
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
73
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
74
|
+
): SeamHttpSeamCustomerV1Automations {
|
|
75
|
+
const constructorOptions = { ...options, apiKey }
|
|
76
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
77
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
78
|
+
}
|
|
79
|
+
return new SeamHttpSeamCustomerV1Automations(constructorOptions)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static fromClientSessionToken(
|
|
83
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
84
|
+
options: Omit<
|
|
85
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
86
|
+
'clientSessionToken'
|
|
87
|
+
> = {},
|
|
88
|
+
): SeamHttpSeamCustomerV1Automations {
|
|
89
|
+
const constructorOptions = { ...options, clientSessionToken }
|
|
90
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
91
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
92
|
+
}
|
|
93
|
+
return new SeamHttpSeamCustomerV1Automations(constructorOptions)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static async fromPublishableKey(
|
|
97
|
+
publishableKey: string,
|
|
98
|
+
userIdentifierKey: string,
|
|
99
|
+
options: SeamHttpFromPublishableKeyOptions = {},
|
|
100
|
+
): Promise<SeamHttpSeamCustomerV1Automations> {
|
|
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 SeamHttpSeamCustomerV1Automations.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 SeamHttpSeamCustomerV1Automations.fromClientSessionToken(
|
|
114
|
+
token,
|
|
115
|
+
options,
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
static fromConsoleSessionToken(
|
|
120
|
+
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
121
|
+
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
122
|
+
options: Omit<
|
|
123
|
+
SeamHttpOptionsWithConsoleSessionToken,
|
|
124
|
+
'consoleSessionToken' | 'workspaceId'
|
|
125
|
+
> = {},
|
|
126
|
+
): SeamHttpSeamCustomerV1Automations {
|
|
127
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
128
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
129
|
+
throw new SeamHttpInvalidOptionsError(
|
|
130
|
+
'Missing consoleSessionToken or workspaceId',
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
return new SeamHttpSeamCustomerV1Automations(constructorOptions)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static fromPersonalAccessToken(
|
|
137
|
+
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
138
|
+
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
139
|
+
options: Omit<
|
|
140
|
+
SeamHttpOptionsWithPersonalAccessToken,
|
|
141
|
+
'personalAccessToken' | 'workspaceId'
|
|
142
|
+
> = {},
|
|
143
|
+
): SeamHttpSeamCustomerV1Automations {
|
|
144
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
145
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
146
|
+
throw new SeamHttpInvalidOptionsError(
|
|
147
|
+
'Missing personalAccessToken or workspaceId',
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
return new SeamHttpSeamCustomerV1Automations(constructorOptions)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
154
|
+
request: SeamHttpRequest<TResponse, TResponseKey>,
|
|
155
|
+
): SeamPaginator<TResponse, TResponseKey> {
|
|
156
|
+
return new SeamPaginator<TResponse, TResponseKey>(this, request)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async updateClientSessionToken(
|
|
160
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
161
|
+
): Promise<void> {
|
|
162
|
+
const { headers } = this.client.defaults
|
|
163
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
164
|
+
clientSessionToken,
|
|
165
|
+
})
|
|
166
|
+
for (const key of Object.keys(authHeaders)) {
|
|
167
|
+
if (headers[key] == null) {
|
|
168
|
+
throw new Error(
|
|
169
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
174
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
175
|
+
await clientSessions.get()
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
delete(
|
|
179
|
+
parameters?: SeamCustomerV1AutomationsDeleteParameters,
|
|
180
|
+
options: SeamCustomerV1AutomationsDeleteOptions = {},
|
|
181
|
+
): SeamCustomerV1AutomationsDeleteRequest {
|
|
182
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
183
|
+
throw new Error(
|
|
184
|
+
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
return new SeamHttpRequest(this, {
|
|
188
|
+
pathname: '/seam/customer/v1/automations/delete',
|
|
189
|
+
method: 'POST',
|
|
190
|
+
body: parameters,
|
|
191
|
+
responseKey: undefined,
|
|
192
|
+
options,
|
|
193
|
+
})
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
get(
|
|
197
|
+
parameters?: SeamCustomerV1AutomationsGetParameters,
|
|
198
|
+
options: SeamCustomerV1AutomationsGetOptions = {},
|
|
199
|
+
): SeamCustomerV1AutomationsGetRequest {
|
|
200
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
201
|
+
throw new Error(
|
|
202
|
+
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
return new SeamHttpRequest(this, {
|
|
206
|
+
pathname: '/seam/customer/v1/automations/get',
|
|
207
|
+
method: 'GET',
|
|
208
|
+
params: parameters,
|
|
209
|
+
responseKey: undefined,
|
|
210
|
+
options,
|
|
211
|
+
})
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
update(
|
|
215
|
+
parameters?: SeamCustomerV1AutomationsUpdateParameters,
|
|
216
|
+
options: SeamCustomerV1AutomationsUpdateOptions = {},
|
|
217
|
+
): SeamCustomerV1AutomationsUpdateRequest {
|
|
218
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
219
|
+
throw new Error(
|
|
220
|
+
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
return new SeamHttpRequest(this, {
|
|
224
|
+
pathname: '/seam/customer/v1/automations/update',
|
|
225
|
+
method: 'PATCH',
|
|
226
|
+
body: parameters,
|
|
227
|
+
responseKey: undefined,
|
|
228
|
+
options,
|
|
229
|
+
})
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export type SeamCustomerV1AutomationsDeleteParameters =
|
|
234
|
+
RouteRequestBody<'/seam/customer/v1/automations/delete'>
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @deprecated Use SeamCustomerV1AutomationsDeleteParameters instead.
|
|
238
|
+
*/
|
|
239
|
+
export type SeamCustomerV1AutomationsDeleteParams =
|
|
240
|
+
SeamCustomerV1AutomationsDeleteParameters
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* @deprecated Use SeamCustomerV1AutomationsDeleteRequest instead.
|
|
244
|
+
*/
|
|
245
|
+
export type SeamCustomerV1AutomationsDeleteResponse = SetNonNullable<
|
|
246
|
+
Required<RouteResponse<'/seam/customer/v1/automations/delete'>>
|
|
247
|
+
>
|
|
248
|
+
|
|
249
|
+
export type SeamCustomerV1AutomationsDeleteRequest = SeamHttpRequest<
|
|
250
|
+
void,
|
|
251
|
+
undefined
|
|
252
|
+
>
|
|
253
|
+
|
|
254
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
255
|
+
export interface SeamCustomerV1AutomationsDeleteOptions {}
|
|
256
|
+
|
|
257
|
+
export type SeamCustomerV1AutomationsGetParameters =
|
|
258
|
+
RouteRequestParams<'/seam/customer/v1/automations/get'>
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @deprecated Use SeamCustomerV1AutomationsGetParameters instead.
|
|
262
|
+
*/
|
|
263
|
+
export type SeamCustomerV1AutomationsGetParams =
|
|
264
|
+
SeamCustomerV1AutomationsGetParameters
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @deprecated Use SeamCustomerV1AutomationsGetRequest instead.
|
|
268
|
+
*/
|
|
269
|
+
export type SeamCustomerV1AutomationsGetResponse = SetNonNullable<
|
|
270
|
+
Required<RouteResponse<'/seam/customer/v1/automations/get'>>
|
|
271
|
+
>
|
|
272
|
+
|
|
273
|
+
export type SeamCustomerV1AutomationsGetRequest = SeamHttpRequest<
|
|
274
|
+
void,
|
|
275
|
+
undefined
|
|
276
|
+
>
|
|
277
|
+
|
|
278
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
279
|
+
export interface SeamCustomerV1AutomationsGetOptions {}
|
|
280
|
+
|
|
281
|
+
export type SeamCustomerV1AutomationsUpdateParameters =
|
|
282
|
+
RouteRequestBody<'/seam/customer/v1/automations/update'>
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @deprecated Use SeamCustomerV1AutomationsUpdateParameters instead.
|
|
286
|
+
*/
|
|
287
|
+
export type SeamCustomerV1AutomationsUpdateBody =
|
|
288
|
+
SeamCustomerV1AutomationsUpdateParameters
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* @deprecated Use SeamCustomerV1AutomationsUpdateRequest instead.
|
|
292
|
+
*/
|
|
293
|
+
export type SeamCustomerV1AutomationsUpdateResponse = SetNonNullable<
|
|
294
|
+
Required<RouteResponse<'/seam/customer/v1/automations/update'>>
|
|
295
|
+
>
|
|
296
|
+
|
|
297
|
+
export type SeamCustomerV1AutomationsUpdateRequest = SeamHttpRequest<
|
|
298
|
+
void,
|
|
299
|
+
undefined
|
|
300
|
+
>
|
|
301
|
+
|
|
302
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
303
|
+
export interface SeamCustomerV1AutomationsUpdateOptions {}
|
|
@@ -0,0 +1,10 @@
|
|
|
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 './automation-runs/index.js'
|
|
7
|
+
export * from './automations/index.js'
|
|
8
|
+
export * from './portals/index.js'
|
|
9
|
+
export * from './settings/index.js'
|
|
10
|
+
export * from './v1.js'
|
|
@@ -36,7 +36,7 @@ import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
|
36
36
|
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
|
|
37
37
|
import type { SetNonNullable } from 'lib/types.js'
|
|
38
38
|
|
|
39
|
-
export class
|
|
39
|
+
export class SeamHttpSeamCustomerV1Portals {
|
|
40
40
|
client: Client
|
|
41
41
|
readonly defaults: Required<SeamHttpRequestOptions>
|
|
42
42
|
readonly ltsVersion = seamApiLtsVersion
|
|
@@ -56,23 +56,23 @@ export class SeamHttpSeamPartnerV1Resources {
|
|
|
56
56
|
static fromClient(
|
|
57
57
|
client: SeamHttpOptionsWithClient['client'],
|
|
58
58
|
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
59
|
-
):
|
|
59
|
+
): SeamHttpSeamCustomerV1Portals {
|
|
60
60
|
const constructorOptions = { ...options, client }
|
|
61
61
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
62
62
|
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
63
63
|
}
|
|
64
|
-
return new
|
|
64
|
+
return new SeamHttpSeamCustomerV1Portals(constructorOptions)
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
static fromApiKey(
|
|
68
68
|
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
69
69
|
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
70
|
-
):
|
|
70
|
+
): SeamHttpSeamCustomerV1Portals {
|
|
71
71
|
const constructorOptions = { ...options, apiKey }
|
|
72
72
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
73
73
|
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
74
74
|
}
|
|
75
|
-
return new
|
|
75
|
+
return new SeamHttpSeamCustomerV1Portals(constructorOptions)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
static fromClientSessionToken(
|
|
@@ -81,24 +81,24 @@ export class SeamHttpSeamPartnerV1Resources {
|
|
|
81
81
|
SeamHttpOptionsWithClientSessionToken,
|
|
82
82
|
'clientSessionToken'
|
|
83
83
|
> = {},
|
|
84
|
-
):
|
|
84
|
+
): SeamHttpSeamCustomerV1Portals {
|
|
85
85
|
const constructorOptions = { ...options, clientSessionToken }
|
|
86
86
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
87
87
|
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
88
88
|
}
|
|
89
|
-
return new
|
|
89
|
+
return new SeamHttpSeamCustomerV1Portals(constructorOptions)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
static async fromPublishableKey(
|
|
93
93
|
publishableKey: string,
|
|
94
94
|
userIdentifierKey: string,
|
|
95
95
|
options: SeamHttpFromPublishableKeyOptions = {},
|
|
96
|
-
): Promise<
|
|
96
|
+
): Promise<SeamHttpSeamCustomerV1Portals> {
|
|
97
97
|
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
98
98
|
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
99
99
|
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
100
100
|
throw new SeamHttpInvalidOptionsError(
|
|
101
|
-
'The client option cannot be used with
|
|
101
|
+
'The client option cannot be used with SeamHttpSeamCustomerV1Portals.fromPublishableKey',
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
const client = createClient(clientOptions)
|
|
@@ -106,7 +106,7 @@ export class SeamHttpSeamPartnerV1Resources {
|
|
|
106
106
|
const { token } = await clientSessions.getOrCreate({
|
|
107
107
|
user_identifier_key: userIdentifierKey,
|
|
108
108
|
})
|
|
109
|
-
return
|
|
109
|
+
return SeamHttpSeamCustomerV1Portals.fromClientSessionToken(token, options)
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
static fromConsoleSessionToken(
|
|
@@ -116,14 +116,14 @@ export class SeamHttpSeamPartnerV1Resources {
|
|
|
116
116
|
SeamHttpOptionsWithConsoleSessionToken,
|
|
117
117
|
'consoleSessionToken' | 'workspaceId'
|
|
118
118
|
> = {},
|
|
119
|
-
):
|
|
119
|
+
): SeamHttpSeamCustomerV1Portals {
|
|
120
120
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
121
121
|
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
122
122
|
throw new SeamHttpInvalidOptionsError(
|
|
123
123
|
'Missing consoleSessionToken or workspaceId',
|
|
124
124
|
)
|
|
125
125
|
}
|
|
126
|
-
return new
|
|
126
|
+
return new SeamHttpSeamCustomerV1Portals(constructorOptions)
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
static fromPersonalAccessToken(
|
|
@@ -133,14 +133,14 @@ export class SeamHttpSeamPartnerV1Resources {
|
|
|
133
133
|
SeamHttpOptionsWithPersonalAccessToken,
|
|
134
134
|
'personalAccessToken' | 'workspaceId'
|
|
135
135
|
> = {},
|
|
136
|
-
):
|
|
136
|
+
): SeamHttpSeamCustomerV1Portals {
|
|
137
137
|
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
138
138
|
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
139
139
|
throw new SeamHttpInvalidOptionsError(
|
|
140
140
|
'Missing personalAccessToken or workspaceId',
|
|
141
141
|
)
|
|
142
142
|
}
|
|
143
|
-
return new
|
|
143
|
+
return new SeamHttpSeamCustomerV1Portals(constructorOptions)
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
@@ -168,45 +168,44 @@ export class SeamHttpSeamPartnerV1Resources {
|
|
|
168
168
|
await clientSessions.get()
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
parameters?:
|
|
173
|
-
options:
|
|
174
|
-
):
|
|
171
|
+
get(
|
|
172
|
+
parameters?: SeamCustomerV1PortalsGetParameters,
|
|
173
|
+
options: SeamCustomerV1PortalsGetOptions = {},
|
|
174
|
+
): SeamCustomerV1PortalsGetRequest {
|
|
175
175
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
176
176
|
throw new Error(
|
|
177
177
|
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
178
178
|
)
|
|
179
179
|
}
|
|
180
180
|
return new SeamHttpRequest(this, {
|
|
181
|
-
pathname: '/seam/
|
|
181
|
+
pathname: '/seam/customer/v1/portals/get',
|
|
182
182
|
method: 'POST',
|
|
183
183
|
body: parameters,
|
|
184
|
-
responseKey: '
|
|
184
|
+
responseKey: 'customer_portal',
|
|
185
185
|
options,
|
|
186
186
|
})
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
export type
|
|
191
|
-
RouteRequestBody<'/seam/
|
|
190
|
+
export type SeamCustomerV1PortalsGetParameters =
|
|
191
|
+
RouteRequestBody<'/seam/customer/v1/portals/get'>
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
|
-
* @deprecated Use
|
|
194
|
+
* @deprecated Use SeamCustomerV1PortalsGetParameters instead.
|
|
195
195
|
*/
|
|
196
|
-
export type
|
|
197
|
-
SeamPartnerV1ResourcesListParameters
|
|
196
|
+
export type SeamCustomerV1PortalsGetParams = SeamCustomerV1PortalsGetParameters
|
|
198
197
|
|
|
199
198
|
/**
|
|
200
|
-
* @deprecated Use
|
|
199
|
+
* @deprecated Use SeamCustomerV1PortalsGetRequest instead.
|
|
201
200
|
*/
|
|
202
|
-
export type
|
|
203
|
-
Required<RouteResponse<'/seam/
|
|
201
|
+
export type SeamCustomerV1PortalsGetResponse = SetNonNullable<
|
|
202
|
+
Required<RouteResponse<'/seam/customer/v1/portals/get'>>
|
|
204
203
|
>
|
|
205
204
|
|
|
206
|
-
export type
|
|
207
|
-
|
|
208
|
-
'
|
|
205
|
+
export type SeamCustomerV1PortalsGetRequest = SeamHttpRequest<
|
|
206
|
+
SeamCustomerV1PortalsGetResponse,
|
|
207
|
+
'customer_portal'
|
|
209
208
|
>
|
|
210
209
|
|
|
211
210
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
212
|
-
export interface
|
|
211
|
+
export interface SeamCustomerV1PortalsGetOptions {}
|
|
@@ -36,7 +36,7 @@ import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
|
36
36
|
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
|
|
37
37
|
import type { SetNonNullable } from 'lib/types.js'
|
|
38
38
|
|
|
39
|
-
export class
|
|
39
|
+
export class SeamHttpSeamCustomerV1Settings {
|
|
40
40
|
client: Client
|
|
41
41
|
readonly defaults: Required<SeamHttpRequestOptions>
|
|
42
42
|
readonly ltsVersion = seamApiLtsVersion
|
|
@@ -56,23 +56,23 @@ export class SeamHttpUnstablePartnerResources {
|
|
|
56
56
|
static fromClient(
|
|
57
57
|
client: SeamHttpOptionsWithClient['client'],
|
|
58
58
|
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
59
|
-
):
|
|
59
|
+
): SeamHttpSeamCustomerV1Settings {
|
|
60
60
|
const constructorOptions = { ...options, client }
|
|
61
61
|
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
62
62
|
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
63
63
|
}
|
|
64
|
-
return new
|
|
64
|
+
return new SeamHttpSeamCustomerV1Settings(constructorOptions)
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
static fromApiKey(
|
|
68
68
|
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
69
69
|
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
70
|
-
):
|
|
70
|
+
): SeamHttpSeamCustomerV1Settings {
|
|
71
71
|
const constructorOptions = { ...options, apiKey }
|
|
72
72
|
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
73
73
|
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
74
74
|
}
|
|
75
|
-
return new
|
|
75
|
+
return new SeamHttpSeamCustomerV1Settings(constructorOptions)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
static fromClientSessionToken(
|
|
@@ -81,24 +81,24 @@ export class SeamHttpUnstablePartnerResources {
|
|
|
81
81
|
SeamHttpOptionsWithClientSessionToken,
|
|
82
82
|
'clientSessionToken'
|
|
83
83
|
> = {},
|
|
84
|
-
):
|
|
84
|
+
): SeamHttpSeamCustomerV1Settings {
|
|
85
85
|
const constructorOptions = { ...options, clientSessionToken }
|
|
86
86
|
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
87
87
|
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
88
88
|
}
|
|
89
|
-
return new
|
|
89
|
+
return new SeamHttpSeamCustomerV1Settings(constructorOptions)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
static async fromPublishableKey(
|
|
93
93
|
publishableKey: string,
|
|
94
94
|
userIdentifierKey: string,
|
|
95
95
|
options: SeamHttpFromPublishableKeyOptions = {},
|
|
96
|
-
): Promise<
|
|
96
|
+
): Promise<SeamHttpSeamCustomerV1Settings> {
|
|
97
97
|
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
98
98
|
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
99
99
|
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
100
100
|
throw new SeamHttpInvalidOptionsError(
|
|
101
|
-
'The client option cannot be used with
|
|
101
|
+
'The client option cannot be used with SeamHttpSeamCustomerV1Settings.fromPublishableKey',
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
const client = createClient(clientOptions)
|
|
@@ -106,10 +106,7 @@ export class SeamHttpUnstablePartnerResources {
|
|
|
106
106
|
const { token } = await clientSessions.getOrCreate({
|
|
107
107
|
user_identifier_key: userIdentifierKey,
|
|
108
108
|
})
|
|
109
|
-
return
|
|
110
|
-
token,
|
|
111
|
-
options,
|
|
112
|
-
)
|
|
109
|
+
return SeamHttpSeamCustomerV1Settings.fromClientSessionToken(token, options)
|
|
113
110
|
}
|
|
114
111
|
|
|
115
112
|
static fromConsoleSessionToken(
|
|
@@ -119,14 +116,14 @@ export class SeamHttpUnstablePartnerResources {
|
|
|
119
116
|
SeamHttpOptionsWithConsoleSessionToken,
|
|
120
117
|
'consoleSessionToken' | 'workspaceId'
|
|
121
118
|
> = {},
|
|
122
|
-
):
|
|
119
|
+
): SeamHttpSeamCustomerV1Settings {
|
|
123
120
|
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
124
121
|
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
125
122
|
throw new SeamHttpInvalidOptionsError(
|
|
126
123
|
'Missing consoleSessionToken or workspaceId',
|
|
127
124
|
)
|
|
128
125
|
}
|
|
129
|
-
return new
|
|
126
|
+
return new SeamHttpSeamCustomerV1Settings(constructorOptions)
|
|
130
127
|
}
|
|
131
128
|
|
|
132
129
|
static fromPersonalAccessToken(
|
|
@@ -136,14 +133,14 @@ export class SeamHttpUnstablePartnerResources {
|
|
|
136
133
|
SeamHttpOptionsWithPersonalAccessToken,
|
|
137
134
|
'personalAccessToken' | 'workspaceId'
|
|
138
135
|
> = {},
|
|
139
|
-
):
|
|
136
|
+
): SeamHttpSeamCustomerV1Settings {
|
|
140
137
|
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
141
138
|
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
142
139
|
throw new SeamHttpInvalidOptionsError(
|
|
143
140
|
'Missing personalAccessToken or workspaceId',
|
|
144
141
|
)
|
|
145
142
|
}
|
|
146
|
-
return new
|
|
143
|
+
return new SeamHttpSeamCustomerV1Settings(constructorOptions)
|
|
147
144
|
}
|
|
148
145
|
|
|
149
146
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
@@ -171,18 +168,18 @@ export class SeamHttpUnstablePartnerResources {
|
|
|
171
168
|
await clientSessions.get()
|
|
172
169
|
}
|
|
173
170
|
|
|
174
|
-
|
|
175
|
-
parameters?:
|
|
176
|
-
options:
|
|
177
|
-
):
|
|
171
|
+
update(
|
|
172
|
+
parameters?: SeamCustomerV1SettingsUpdateParameters,
|
|
173
|
+
options: SeamCustomerV1SettingsUpdateOptions = {},
|
|
174
|
+
): SeamCustomerV1SettingsUpdateRequest {
|
|
178
175
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
179
176
|
throw new Error(
|
|
180
177
|
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
181
178
|
)
|
|
182
179
|
}
|
|
183
180
|
return new SeamHttpRequest(this, {
|
|
184
|
-
pathname: '/
|
|
185
|
-
method: '
|
|
181
|
+
pathname: '/seam/customer/v1/settings/update',
|
|
182
|
+
method: 'PATCH',
|
|
186
183
|
body: parameters,
|
|
187
184
|
responseKey: undefined,
|
|
188
185
|
options,
|
|
@@ -190,26 +187,26 @@ export class SeamHttpUnstablePartnerResources {
|
|
|
190
187
|
}
|
|
191
188
|
}
|
|
192
189
|
|
|
193
|
-
export type
|
|
194
|
-
RouteRequestBody<'/
|
|
190
|
+
export type SeamCustomerV1SettingsUpdateParameters =
|
|
191
|
+
RouteRequestBody<'/seam/customer/v1/settings/update'>
|
|
195
192
|
|
|
196
193
|
/**
|
|
197
|
-
* @deprecated Use
|
|
194
|
+
* @deprecated Use SeamCustomerV1SettingsUpdateParameters instead.
|
|
198
195
|
*/
|
|
199
|
-
export type
|
|
200
|
-
|
|
196
|
+
export type SeamCustomerV1SettingsUpdateBody =
|
|
197
|
+
SeamCustomerV1SettingsUpdateParameters
|
|
201
198
|
|
|
202
199
|
/**
|
|
203
|
-
* @deprecated Use
|
|
200
|
+
* @deprecated Use SeamCustomerV1SettingsUpdateRequest instead.
|
|
204
201
|
*/
|
|
205
|
-
export type
|
|
206
|
-
Required<RouteResponse<'/
|
|
202
|
+
export type SeamCustomerV1SettingsUpdateResponse = SetNonNullable<
|
|
203
|
+
Required<RouteResponse<'/seam/customer/v1/settings/update'>>
|
|
207
204
|
>
|
|
208
205
|
|
|
209
|
-
export type
|
|
206
|
+
export type SeamCustomerV1SettingsUpdateRequest = SeamHttpRequest<
|
|
210
207
|
void,
|
|
211
208
|
undefined
|
|
212
209
|
>
|
|
213
210
|
|
|
214
211
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
215
|
-
export interface
|
|
212
|
+
export interface SeamCustomerV1SettingsUpdateOptions {}
|