@seamapi/http 1.83.0 → 1.84.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 +0 -119
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +2 -32
- package/dist/index.cjs +0 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/index.js +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +1 -3
- package/lib/seam/connect/routes/seam-http-endpoints.js +0 -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 +3 -3
- package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +0 -1
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +0 -28
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.js +0 -6
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.js +0 -6
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.js.map +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.d.ts +0 -34
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.js +0 -98
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.js.map +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.d.ts +0 -1
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.js +0 -6
- package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.js.map +0 -1
- package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.ts +0 -6
- package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts +0 -216
- package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/index.ts +0 -6
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/lib/seam/connect/routes/seam/customer/v1/webhooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,uBAAuB,CAAA"}
|
|
@@ -1,216 +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 SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
|
|
40
|
-
client: Client
|
|
41
|
-
readonly defaults: Required<SeamHttpRequestOptions>
|
|
42
|
-
readonly ltsVersion = seamApiLtsVersion
|
|
43
|
-
static ltsVersion = seamApiLtsVersion
|
|
44
|
-
|
|
45
|
-
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
46
|
-
const options = parseOptions(apiKeyOrOptions)
|
|
47
|
-
this.client = 'client' in options ? options.client : createClient(options)
|
|
48
|
-
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static fromClient(
|
|
52
|
-
client: SeamHttpOptionsWithClient['client'],
|
|
53
|
-
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
54
|
-
): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
|
|
55
|
-
const constructorOptions = { ...options, client }
|
|
56
|
-
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
57
|
-
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
58
|
-
}
|
|
59
|
-
return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
|
|
60
|
-
constructorOptions,
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
static fromApiKey(
|
|
65
|
-
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
66
|
-
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
67
|
-
): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
|
|
68
|
-
const constructorOptions = { ...options, apiKey }
|
|
69
|
-
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
70
|
-
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
71
|
-
}
|
|
72
|
-
return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
|
|
73
|
-
constructorOptions,
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
static fromClientSessionToken(
|
|
78
|
-
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
79
|
-
options: Omit<
|
|
80
|
-
SeamHttpOptionsWithClientSessionToken,
|
|
81
|
-
'clientSessionToken'
|
|
82
|
-
> = {},
|
|
83
|
-
): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
|
|
84
|
-
const constructorOptions = { ...options, clientSessionToken }
|
|
85
|
-
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
86
|
-
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
87
|
-
}
|
|
88
|
-
return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
|
|
89
|
-
constructorOptions,
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
static async fromPublishableKey(
|
|
94
|
-
publishableKey: string,
|
|
95
|
-
userIdentifierKey: string,
|
|
96
|
-
options: SeamHttpFromPublishableKeyOptions = {},
|
|
97
|
-
): Promise<SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId> {
|
|
98
|
-
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
99
|
-
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
100
|
-
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
101
|
-
throw new SeamHttpInvalidOptionsError(
|
|
102
|
-
'The client option cannot be used with SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromPublishableKey',
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
const client = createClient(clientOptions)
|
|
106
|
-
const clientSessions = SeamHttpClientSessions.fromClient(client)
|
|
107
|
-
const { token } = await clientSessions.getOrCreate({
|
|
108
|
-
user_identifier_key: userIdentifierKey,
|
|
109
|
-
})
|
|
110
|
-
return SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClientSessionToken(
|
|
111
|
-
token,
|
|
112
|
-
options,
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
static fromConsoleSessionToken(
|
|
117
|
-
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
118
|
-
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
119
|
-
options: Omit<
|
|
120
|
-
SeamHttpOptionsWithConsoleSessionToken,
|
|
121
|
-
'consoleSessionToken' | 'workspaceId'
|
|
122
|
-
> = {},
|
|
123
|
-
): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
|
|
124
|
-
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
125
|
-
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
126
|
-
throw new SeamHttpInvalidOptionsError(
|
|
127
|
-
'Missing consoleSessionToken or workspaceId',
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
|
|
131
|
-
constructorOptions,
|
|
132
|
-
)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
static fromPersonalAccessToken(
|
|
136
|
-
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
137
|
-
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
138
|
-
options: Omit<
|
|
139
|
-
SeamHttpOptionsWithPersonalAccessToken,
|
|
140
|
-
'personalAccessToken' | 'workspaceId'
|
|
141
|
-
> = {},
|
|
142
|
-
): SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
|
|
143
|
-
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
144
|
-
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
145
|
-
throw new SeamHttpInvalidOptionsError(
|
|
146
|
-
'Missing personalAccessToken or workspaceId',
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
return new SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
|
|
150
|
-
constructorOptions,
|
|
151
|
-
)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
155
|
-
request: SeamHttpRequest<TResponse, TResponseKey>,
|
|
156
|
-
): SeamPaginator<TResponse, TResponseKey> {
|
|
157
|
-
return new SeamPaginator<TResponse, TResponseKey>(this, request)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
async updateClientSessionToken(
|
|
161
|
-
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
162
|
-
): Promise<void> {
|
|
163
|
-
const { headers } = this.client.defaults
|
|
164
|
-
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
165
|
-
clientSessionToken,
|
|
166
|
-
})
|
|
167
|
-
for (const key of Object.keys(authHeaders)) {
|
|
168
|
-
if (headers[key] == null) {
|
|
169
|
-
throw new Error(
|
|
170
|
-
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
171
|
-
)
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
175
|
-
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
176
|
-
await clientSessions.get()
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
connectorId(
|
|
180
|
-
parameters?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters,
|
|
181
|
-
options: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions = {},
|
|
182
|
-
): SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest {
|
|
183
|
-
return new SeamHttpRequest(this, {
|
|
184
|
-
pathname:
|
|
185
|
-
'/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]',
|
|
186
|
-
method: 'POST',
|
|
187
|
-
body: parameters,
|
|
188
|
-
responseKey: undefined,
|
|
189
|
-
options,
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters =
|
|
195
|
-
RouteRequestBody<'/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'>
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @deprecated Use SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters instead.
|
|
199
|
-
*/
|
|
200
|
-
export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdBody =
|
|
201
|
-
SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* @deprecated Use SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest instead.
|
|
205
|
-
*/
|
|
206
|
-
export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdResponse =
|
|
207
|
-
SetNonNullable<
|
|
208
|
-
Required<
|
|
209
|
-
RouteResponse<'/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'>
|
|
210
|
-
>
|
|
211
|
-
>
|
|
212
|
-
|
|
213
|
-
export type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest =
|
|
214
|
-
SeamHttpRequest<void, undefined>
|
|
215
|
-
|
|
216
|
-
export interface SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions {}
|