@seamapi/http 1.79.0 → 1.81.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 +247 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +78 -3
  4. package/dist/index.cjs +251 -0
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.d.ts +47 -0
  8. package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.js +107 -0
  9. package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.js.map +1 -0
  10. package/lib/seam/connect/routes/seam/customer/v1/connectors/index.d.ts +1 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/connectors/index.js +6 -0
  12. package/lib/seam/connect/routes/seam/customer/v1/connectors/index.js.map +1 -0
  13. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +2 -0
  14. package/lib/seam/connect/routes/seam/customer/v1/index.js +2 -0
  15. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
  16. package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
  17. package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -0
  18. package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
  19. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.d.ts +1 -0
  20. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.js +6 -0
  21. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.js.map +1 -0
  22. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.d.ts +1 -0
  23. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.js +6 -0
  24. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.js.map +1 -0
  25. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.d.ts +34 -0
  26. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.js +98 -0
  27. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.js.map +1 -0
  28. package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.d.ts +1 -0
  29. package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.js +6 -0
  30. package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.js.map +1 -0
  31. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +7 -2
  32. package/lib/seam/connect/routes/seam-http-endpoints.js +23 -0
  33. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  34. package/lib/version.d.ts +1 -1
  35. package/lib/version.js +1 -1
  36. package/package.json +3 -3
  37. package/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts +240 -0
  38. package/src/lib/seam/connect/routes/seam/customer/v1/connectors/index.ts +6 -0
  39. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +2 -0
  40. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
  41. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.ts +6 -0
  42. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.ts +6 -0
  43. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts +216 -0
  44. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/index.ts +6 -0
  45. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +67 -0
  46. package/src/lib/version.ts +1 -1
package/lib/version.js CHANGED
@@ -1,3 +1,3 @@
1
- const seamapiJavascriptHttpVersion = '1.79.0';
1
+ const seamapiJavascriptHttpVersion = '1.81.0';
2
2
  export default seamapiJavascriptHttpVersion;
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/http",
3
- "version": "1.79.0",
3
+ "version": "1.81.0",
4
4
  "description": "JavaScript HTTP client for the Seam API written in TypeScript.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -86,7 +86,7 @@
86
86
  "npm": ">=10.1.0"
87
87
  },
88
88
  "peerDependencies": {
89
- "@seamapi/types": "^1.595.0"
89
+ "@seamapi/types": "^1.603.0"
90
90
  },
91
91
  "peerDependenciesMeta": {
92
92
  "@seamapi/types": {
@@ -102,7 +102,7 @@
102
102
  "@seamapi/blueprint": "^0.51.1",
103
103
  "@seamapi/fake-seam-connect": "^1.77.0",
104
104
  "@seamapi/smith": "^0.5.2",
105
- "@seamapi/types": "1.595.0",
105
+ "@seamapi/types": "1.603.0",
106
106
  "@swc/core": "^1.11.29",
107
107
  "@types/jsonwebtoken": "^9.0.6",
108
108
  "@types/node": "^22.15.21",
@@ -0,0 +1,240 @@
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 SeamHttpSeamCustomerV1Connectors {
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
+ ): SeamHttpSeamCustomerV1Connectors {
55
+ const constructorOptions = { ...options, client }
56
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
57
+ throw new SeamHttpInvalidOptionsError('Missing client')
58
+ }
59
+ return new SeamHttpSeamCustomerV1Connectors(constructorOptions)
60
+ }
61
+
62
+ static fromApiKey(
63
+ apiKey: SeamHttpOptionsWithApiKey['apiKey'],
64
+ options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
65
+ ): SeamHttpSeamCustomerV1Connectors {
66
+ const constructorOptions = { ...options, apiKey }
67
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
68
+ throw new SeamHttpInvalidOptionsError('Missing apiKey')
69
+ }
70
+ return new SeamHttpSeamCustomerV1Connectors(constructorOptions)
71
+ }
72
+
73
+ static fromClientSessionToken(
74
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
75
+ options: Omit<
76
+ SeamHttpOptionsWithClientSessionToken,
77
+ 'clientSessionToken'
78
+ > = {},
79
+ ): SeamHttpSeamCustomerV1Connectors {
80
+ const constructorOptions = { ...options, clientSessionToken }
81
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
82
+ throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
83
+ }
84
+ return new SeamHttpSeamCustomerV1Connectors(constructorOptions)
85
+ }
86
+
87
+ static async fromPublishableKey(
88
+ publishableKey: string,
89
+ userIdentifierKey: string,
90
+ options: SeamHttpFromPublishableKeyOptions = {},
91
+ ): Promise<SeamHttpSeamCustomerV1Connectors> {
92
+ warnOnInsecureuserIdentifierKey(userIdentifierKey)
93
+ const clientOptions = parseOptions({ ...options, publishableKey })
94
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
95
+ throw new SeamHttpInvalidOptionsError(
96
+ 'The client option cannot be used with SeamHttpSeamCustomerV1Connectors.fromPublishableKey',
97
+ )
98
+ }
99
+ const client = createClient(clientOptions)
100
+ const clientSessions = SeamHttpClientSessions.fromClient(client)
101
+ const { token } = await clientSessions.getOrCreate({
102
+ user_identifier_key: userIdentifierKey,
103
+ })
104
+ return SeamHttpSeamCustomerV1Connectors.fromClientSessionToken(
105
+ token,
106
+ options,
107
+ )
108
+ }
109
+
110
+ static fromConsoleSessionToken(
111
+ consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
112
+ workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
113
+ options: Omit<
114
+ SeamHttpOptionsWithConsoleSessionToken,
115
+ 'consoleSessionToken' | 'workspaceId'
116
+ > = {},
117
+ ): SeamHttpSeamCustomerV1Connectors {
118
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId }
119
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
120
+ throw new SeamHttpInvalidOptionsError(
121
+ 'Missing consoleSessionToken or workspaceId',
122
+ )
123
+ }
124
+ return new SeamHttpSeamCustomerV1Connectors(constructorOptions)
125
+ }
126
+
127
+ static fromPersonalAccessToken(
128
+ personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
129
+ workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
130
+ options: Omit<
131
+ SeamHttpOptionsWithPersonalAccessToken,
132
+ 'personalAccessToken' | 'workspaceId'
133
+ > = {},
134
+ ): SeamHttpSeamCustomerV1Connectors {
135
+ const constructorOptions = { ...options, personalAccessToken, workspaceId }
136
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
137
+ throw new SeamHttpInvalidOptionsError(
138
+ 'Missing personalAccessToken or workspaceId',
139
+ )
140
+ }
141
+ return new SeamHttpSeamCustomerV1Connectors(constructorOptions)
142
+ }
143
+
144
+ createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
145
+ request: SeamHttpRequest<TResponse, TResponseKey>,
146
+ ): SeamPaginator<TResponse, TResponseKey> {
147
+ return new SeamPaginator<TResponse, TResponseKey>(this, request)
148
+ }
149
+
150
+ async updateClientSessionToken(
151
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
152
+ ): Promise<void> {
153
+ const { headers } = this.client.defaults
154
+ const authHeaders = getAuthHeadersForClientSessionToken({
155
+ clientSessionToken,
156
+ })
157
+ for (const key of Object.keys(authHeaders)) {
158
+ if (headers[key] == null) {
159
+ throw new Error(
160
+ 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
161
+ )
162
+ }
163
+ }
164
+ this.client.defaults.headers = { ...headers, ...authHeaders }
165
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client)
166
+ await clientSessions.get()
167
+ }
168
+
169
+ create(
170
+ parameters?: SeamCustomerV1ConnectorsCreateParameters,
171
+ options: SeamCustomerV1ConnectorsCreateOptions = {},
172
+ ): SeamCustomerV1ConnectorsCreateRequest {
173
+ return new SeamHttpRequest(this, {
174
+ pathname: '/seam/customer/v1/connectors/create',
175
+ method: 'POST',
176
+ body: parameters,
177
+ responseKey: 'connector',
178
+ options,
179
+ })
180
+ }
181
+
182
+ sync(
183
+ parameters?: SeamCustomerV1ConnectorsSyncParameters,
184
+ options: SeamCustomerV1ConnectorsSyncOptions = {},
185
+ ): SeamCustomerV1ConnectorsSyncRequest {
186
+ return new SeamHttpRequest(this, {
187
+ pathname: '/seam/customer/v1/connectors/sync',
188
+ method: 'POST',
189
+ body: parameters,
190
+ responseKey: 'connector_sync',
191
+ options,
192
+ })
193
+ }
194
+ }
195
+
196
+ export type SeamCustomerV1ConnectorsCreateParameters =
197
+ RouteRequestBody<'/seam/customer/v1/connectors/create'>
198
+
199
+ /**
200
+ * @deprecated Use SeamCustomerV1ConnectorsCreateParameters instead.
201
+ */
202
+ export type SeamCustomerV1ConnectorsCreateBody =
203
+ SeamCustomerV1ConnectorsCreateParameters
204
+
205
+ /**
206
+ * @deprecated Use SeamCustomerV1ConnectorsCreateRequest instead.
207
+ */
208
+ export type SeamCustomerV1ConnectorsCreateResponse = SetNonNullable<
209
+ Required<RouteResponse<'/seam/customer/v1/connectors/create'>>
210
+ >
211
+
212
+ export type SeamCustomerV1ConnectorsCreateRequest = SeamHttpRequest<
213
+ SeamCustomerV1ConnectorsCreateResponse,
214
+ 'connector'
215
+ >
216
+
217
+ export interface SeamCustomerV1ConnectorsCreateOptions {}
218
+
219
+ export type SeamCustomerV1ConnectorsSyncParameters =
220
+ RouteRequestBody<'/seam/customer/v1/connectors/sync'>
221
+
222
+ /**
223
+ * @deprecated Use SeamCustomerV1ConnectorsSyncParameters instead.
224
+ */
225
+ export type SeamCustomerV1ConnectorsSyncBody =
226
+ SeamCustomerV1ConnectorsSyncParameters
227
+
228
+ /**
229
+ * @deprecated Use SeamCustomerV1ConnectorsSyncRequest instead.
230
+ */
231
+ export type SeamCustomerV1ConnectorsSyncResponse = SetNonNullable<
232
+ Required<RouteResponse<'/seam/customer/v1/connectors/sync'>>
233
+ >
234
+
235
+ export type SeamCustomerV1ConnectorsSyncRequest = SeamHttpRequest<
236
+ SeamCustomerV1ConnectorsSyncResponse,
237
+ 'connector_sync'
238
+ >
239
+
240
+ export interface SeamCustomerV1ConnectorsSyncOptions {}
@@ -0,0 +1,6 @@
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 './connectors.js'
@@ -5,9 +5,11 @@
5
5
 
6
6
  export * from './automation-runs/index.js'
7
7
  export * from './automations/index.js'
8
+ export * from './connectors/index.js'
8
9
  export * from './events/index.js'
9
10
  export * from './portals/index.js'
10
11
  export * from './reservations/index.js'
11
12
  export * from './settings/index.js'
12
13
  export * from './spaces/index.js'
13
14
  export * from './v1.js'
15
+ export * from './webhooks/index.js'
@@ -35,6 +35,7 @@ import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
35
35
 
36
36
  import { SeamHttpSeamCustomerV1AutomationRuns } from './automation-runs/index.js'
37
37
  import { SeamHttpSeamCustomerV1Automations } from './automations/index.js'
38
+ import { SeamHttpSeamCustomerV1Connectors } from './connectors/index.js'
38
39
  import { SeamHttpSeamCustomerV1Events } from './events/index.js'
39
40
  import { SeamHttpSeamCustomerV1Portals } from './portals/index.js'
40
41
  import { SeamHttpSeamCustomerV1Reservations } from './reservations/index.js'
@@ -182,6 +183,13 @@ export class SeamHttpSeamCustomerV1 {
182
183
  )
183
184
  }
184
185
 
186
+ get connectors(): SeamHttpSeamCustomerV1Connectors {
187
+ return SeamHttpSeamCustomerV1Connectors.fromClient(
188
+ this.client,
189
+ this.defaults,
190
+ )
191
+ }
192
+
185
193
  get events(): SeamHttpSeamCustomerV1Events {
186
194
  return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults)
187
195
  }
@@ -0,0 +1,6 @@
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 './workspace-id/index.js'
@@ -0,0 +1,6 @@
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 './workspace-id.js'
@@ -0,0 +1,216 @@
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 {}
@@ -0,0 +1,6 @@
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 './connectors/index.js'
@@ -596,6 +596,15 @@ import {
596
596
  type SeamCustomerV1AutomationsUpdateRequest,
597
597
  SeamHttpSeamCustomerV1Automations,
598
598
  } from './seam/customer/v1/automations/index.js'
599
+ import {
600
+ type SeamCustomerV1ConnectorsCreateOptions,
601
+ type SeamCustomerV1ConnectorsCreateParameters,
602
+ type SeamCustomerV1ConnectorsCreateRequest,
603
+ type SeamCustomerV1ConnectorsSyncOptions,
604
+ type SeamCustomerV1ConnectorsSyncParameters,
605
+ type SeamCustomerV1ConnectorsSyncRequest,
606
+ SeamHttpSeamCustomerV1Connectors,
607
+ } from './seam/customer/v1/connectors/index.js'
599
608
  import {
600
609
  type SeamCustomerV1EventsListOptions,
601
610
  type SeamCustomerV1EventsListParameters,
@@ -635,6 +644,12 @@ import {
635
644
  type SeamCustomerV1SpacesListRequest,
636
645
  SeamHttpSeamCustomerV1Spaces,
637
646
  } from './seam/customer/v1/spaces/index.js'
647
+ import {
648
+ type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions,
649
+ type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters,
650
+ type SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest,
651
+ SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId,
652
+ } from './seam/customer/v1/webhooks/connectors/workspace-id/index.js'
638
653
  import {
639
654
  SeamHttpSeamPartnerV1BuildingBlocksSpaces,
640
655
  type SeamPartnerV1BuildingBlocksSpacesAutoMapOptions,
@@ -3081,6 +3096,32 @@ export class SeamHttpEndpoints {
3081
3096
  }
3082
3097
  }
3083
3098
 
3099
+ get '/seam/customer/v1/connectors/create'(): (
3100
+ parameters?: SeamCustomerV1ConnectorsCreateParameters,
3101
+ options?: SeamCustomerV1ConnectorsCreateOptions,
3102
+ ) => SeamCustomerV1ConnectorsCreateRequest {
3103
+ const { client, defaults } = this
3104
+ return function seamCustomerV1ConnectorsCreate(
3105
+ ...args: Parameters<SeamHttpSeamCustomerV1Connectors['create']>
3106
+ ): ReturnType<SeamHttpSeamCustomerV1Connectors['create']> {
3107
+ const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults)
3108
+ return seam.create(...args)
3109
+ }
3110
+ }
3111
+
3112
+ get '/seam/customer/v1/connectors/sync'(): (
3113
+ parameters?: SeamCustomerV1ConnectorsSyncParameters,
3114
+ options?: SeamCustomerV1ConnectorsSyncOptions,
3115
+ ) => SeamCustomerV1ConnectorsSyncRequest {
3116
+ const { client, defaults } = this
3117
+ return function seamCustomerV1ConnectorsSync(
3118
+ ...args: Parameters<SeamHttpSeamCustomerV1Connectors['sync']>
3119
+ ): ReturnType<SeamHttpSeamCustomerV1Connectors['sync']> {
3120
+ const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults)
3121
+ return seam.sync(...args)
3122
+ }
3123
+ }
3124
+
3084
3125
  get '/seam/customer/v1/events/list'(): (
3085
3126
  parameters?: SeamCustomerV1EventsListParameters,
3086
3127
  options?: SeamCustomerV1EventsListOptions,
@@ -3221,6 +3262,27 @@ export class SeamHttpEndpoints {
3221
3262
  }
3222
3263
  }
3223
3264
 
3265
+ get '/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'(): (
3266
+ parameters?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdParameters,
3267
+ options?: SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdOptions,
3268
+ ) => SeamCustomerV1WebhooksConnectorsWorkspaceIdConnectorIdRequest {
3269
+ const { client, defaults } = this
3270
+ return function seamCustomerV1WebhooksConnectorsWorkspaceIdConnectorId(
3271
+ ...args: Parameters<
3272
+ SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId['connectorId']
3273
+ >
3274
+ ): ReturnType<
3275
+ SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId['connectorId']
3276
+ > {
3277
+ const seam =
3278
+ SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClient(
3279
+ client,
3280
+ defaults,
3281
+ )
3282
+ return seam.connectorId(...args)
3283
+ }
3284
+ }
3285
+
3224
3286
  get '/seam/partner/v1/building_blocks/spaces/auto_map'(): (
3225
3287
  parameters?: SeamPartnerV1BuildingBlocksSpacesAutoMapParameters,
3226
3288
  options?: SeamPartnerV1BuildingBlocksSpacesAutoMapOptions,
@@ -4459,6 +4521,8 @@ export type SeamHttpEndpointPaginatedQueryPaths =
4459
4521
  | '/seam/console/v1/timelines/get'
4460
4522
  | '/seam/customer/v1/automation_runs/list'
4461
4523
  | '/seam/customer/v1/reservations/list'
4524
+ | '/user_identities/list'
4525
+ | '/user_identities/unmanaged/list'
4462
4526
 
4463
4527
  export type SeamHttpEndpointMutationPaths =
4464
4528
  | '/access_codes/create'
@@ -4538,8 +4602,11 @@ export type SeamHttpEndpointMutationPaths =
4538
4602
  | '/phones/simulate/create_sandbox_phone'
4539
4603
  | '/seam/customer/v1/automations/delete'
4540
4604
  | '/seam/customer/v1/automations/update'
4605
+ | '/seam/customer/v1/connectors/create'
4606
+ | '/seam/customer/v1/connectors/sync'
4541
4607
  | '/seam/customer/v1/settings/update'
4542
4608
  | '/seam/customer/v1/spaces/create'
4609
+ | '/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]'
4543
4610
  | '/spaces/add_acs_entrances'
4544
4611
  | '/spaces/add_devices'
4545
4612
  | '/spaces/create'
@@ -1,3 +1,3 @@
1
- const seamapiJavascriptHttpVersion = '1.79.0'
1
+ const seamapiJavascriptHttpVersion = '1.81.0'
2
2
 
3
3
  export default seamapiJavascriptHttpVersion