@seamapi/http 1.40.1 → 1.41.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 (81) hide show
  1. package/dist/connect.cjs +312 -203
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +128 -84
  4. package/lib/seam/connect/routes/customers/customers.d.ts +47 -0
  5. package/lib/seam/connect/routes/customers/customers.js +105 -0
  6. package/lib/seam/connect/routes/customers/customers.js.map +1 -0
  7. package/lib/seam/connect/routes/customers/index.d.ts +1 -0
  8. package/lib/seam/connect/routes/{unstable-partner/resources → customers}/index.js +1 -1
  9. package/lib/seam/connect/routes/customers/index.js.map +1 -0
  10. package/lib/seam/connect/routes/devices/simulate/simulate.d.ts +1 -1
  11. package/lib/seam/connect/routes/index.d.ts +1 -0
  12. package/lib/seam/connect/routes/index.js +1 -0
  13. package/lib/seam/connect/routes/index.js.map +1 -1
  14. package/lib/seam/connect/routes/phones/simulate/simulate.d.ts +1 -1
  15. package/lib/seam/connect/routes/seam/customer/index.d.ts +1 -0
  16. package/lib/seam/connect/routes/seam/{partner/v1/resources → customer}/index.js +1 -1
  17. package/lib/seam/connect/routes/seam/customer/index.js.map +1 -0
  18. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +3 -0
  19. package/lib/seam/connect/routes/seam/customer/v1/index.js +8 -0
  20. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -0
  21. package/lib/seam/connect/routes/seam/customer/v1/portals/index.d.ts +1 -0
  22. package/lib/seam/connect/routes/seam/customer/v1/portals/index.js +6 -0
  23. package/lib/seam/connect/routes/seam/customer/v1/portals/index.js.map +1 -0
  24. package/lib/seam/connect/routes/{unstable-partner/resources/resources.d.ts → seam/customer/v1/portals/portals.d.ts} +20 -20
  25. package/lib/seam/connect/routes/{unstable-partner/resources/resources.js → seam/customer/v1/portals/portals.js} +21 -21
  26. package/lib/seam/connect/routes/{unstable-partner/resources/resources.js.map → seam/customer/v1/portals/portals.js.map} +1 -1
  27. package/lib/seam/connect/routes/seam/customer/v1/settings/index.d.ts +1 -0
  28. package/lib/seam/connect/routes/seam/customer/v1/settings/index.js +6 -0
  29. package/lib/seam/connect/routes/seam/customer/v1/settings/index.js.map +1 -0
  30. package/lib/seam/connect/routes/seam/{partner/v1/resources/resources.d.ts → customer/v1/settings/settings.d.ts} +15 -15
  31. package/lib/seam/connect/routes/seam/{partner/v1/resources/resources.js → customer/v1/settings/settings.js} +14 -14
  32. package/lib/seam/connect/routes/seam/customer/v1/settings/settings.js.map +1 -0
  33. package/lib/seam/connect/routes/seam/{partner → customer}/v1/v1.d.ts +11 -11
  34. package/lib/seam/connect/routes/seam/{partner → customer}/v1/v1.js +15 -15
  35. package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -0
  36. package/lib/seam/connect/routes/seam/index.d.ts +1 -0
  37. package/lib/seam/connect/routes/seam/index.js +1 -0
  38. package/lib/seam/connect/routes/seam/index.js.map +1 -1
  39. package/lib/seam/connect/routes/seam/partner/v1/index.d.ts +0 -2
  40. package/lib/seam/connect/routes/seam/partner/v1/index.js +0 -2
  41. package/lib/seam/connect/routes/seam/partner/v1/index.js.map +1 -1
  42. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +9 -6
  43. package/lib/seam/connect/routes/seam-http-endpoints.js +35 -20
  44. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  45. package/lib/seam/connect/routes/seam-http.d.ts +2 -0
  46. package/lib/seam/connect/routes/seam-http.js +4 -0
  47. package/lib/seam/connect/routes/seam-http.js.map +1 -1
  48. package/lib/seam/connect/routes/unstable-partner/index.d.ts +0 -1
  49. package/lib/seam/connect/routes/unstable-partner/index.js +0 -1
  50. package/lib/seam/connect/routes/unstable-partner/index.js.map +1 -1
  51. package/lib/seam/connect/routes/unstable-partner/unstable-partner.d.ts +0 -2
  52. package/lib/seam/connect/routes/unstable-partner/unstable-partner.js +0 -4
  53. package/lib/seam/connect/routes/unstable-partner/unstable-partner.js.map +1 -1
  54. package/lib/version.d.ts +1 -1
  55. package/lib/version.js +1 -1
  56. package/package.json +3 -3
  57. package/src/lib/seam/connect/routes/customers/customers.ts +234 -0
  58. package/src/lib/seam/connect/routes/{seam/partner/v1/resources → customers}/index.ts +1 -1
  59. package/src/lib/seam/connect/routes/devices/simulate/simulate.ts +1 -1
  60. package/src/lib/seam/connect/routes/index.ts +1 -0
  61. package/src/lib/seam/connect/routes/phones/simulate/simulate.ts +1 -1
  62. package/src/lib/seam/connect/routes/{unstable-partner/resources → seam/customer}/index.ts +1 -1
  63. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +8 -0
  64. package/src/lib/seam/connect/routes/seam/customer/v1/portals/index.ts +6 -0
  65. package/src/lib/seam/connect/routes/seam/{partner/v1/resources/resources.ts → customer/v1/portals/portals.ts} +31 -32
  66. package/src/lib/seam/connect/routes/seam/customer/v1/settings/index.ts +6 -0
  67. package/src/lib/seam/connect/routes/{unstable-partner/resources/resources.ts → seam/customer/v1/settings/settings.ts} +30 -33
  68. package/src/lib/seam/connect/routes/seam/{partner → customer}/v1/v1.ts +20 -23
  69. package/src/lib/seam/connect/routes/seam/index.ts +1 -0
  70. package/src/lib/seam/connect/routes/seam/partner/v1/index.ts +0 -2
  71. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +88 -51
  72. package/src/lib/seam/connect/routes/seam-http.ts +5 -0
  73. package/src/lib/seam/connect/routes/unstable-partner/index.ts +0 -1
  74. package/src/lib/seam/connect/routes/unstable-partner/unstable-partner.ts +0 -8
  75. package/src/lib/version.ts +1 -1
  76. package/lib/seam/connect/routes/seam/partner/v1/resources/index.d.ts +0 -1
  77. package/lib/seam/connect/routes/seam/partner/v1/resources/index.js.map +0 -1
  78. package/lib/seam/connect/routes/seam/partner/v1/resources/resources.js.map +0 -1
  79. package/lib/seam/connect/routes/seam/partner/v1/v1.js.map +0 -1
  80. package/lib/seam/connect/routes/unstable-partner/resources/index.d.ts +0 -1
  81. package/lib/seam/connect/routes/unstable-partner/resources/index.js.map +0 -1
@@ -0,0 +1,234 @@
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 SeamHttpCustomers {
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
+ ): SeamHttpCustomers {
55
+ const constructorOptions = { ...options, client }
56
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
57
+ throw new SeamHttpInvalidOptionsError('Missing client')
58
+ }
59
+ return new SeamHttpCustomers(constructorOptions)
60
+ }
61
+
62
+ static fromApiKey(
63
+ apiKey: SeamHttpOptionsWithApiKey['apiKey'],
64
+ options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
65
+ ): SeamHttpCustomers {
66
+ const constructorOptions = { ...options, apiKey }
67
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
68
+ throw new SeamHttpInvalidOptionsError('Missing apiKey')
69
+ }
70
+ return new SeamHttpCustomers(constructorOptions)
71
+ }
72
+
73
+ static fromClientSessionToken(
74
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
75
+ options: Omit<
76
+ SeamHttpOptionsWithClientSessionToken,
77
+ 'clientSessionToken'
78
+ > = {},
79
+ ): SeamHttpCustomers {
80
+ const constructorOptions = { ...options, clientSessionToken }
81
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
82
+ throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
83
+ }
84
+ return new SeamHttpCustomers(constructorOptions)
85
+ }
86
+
87
+ static async fromPublishableKey(
88
+ publishableKey: string,
89
+ userIdentifierKey: string,
90
+ options: SeamHttpFromPublishableKeyOptions = {},
91
+ ): Promise<SeamHttpCustomers> {
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 SeamHttpCustomers.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 SeamHttpCustomers.fromClientSessionToken(token, options)
105
+ }
106
+
107
+ static fromConsoleSessionToken(
108
+ consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
109
+ workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
110
+ options: Omit<
111
+ SeamHttpOptionsWithConsoleSessionToken,
112
+ 'consoleSessionToken' | 'workspaceId'
113
+ > = {},
114
+ ): SeamHttpCustomers {
115
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId }
116
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
117
+ throw new SeamHttpInvalidOptionsError(
118
+ 'Missing consoleSessionToken or workspaceId',
119
+ )
120
+ }
121
+ return new SeamHttpCustomers(constructorOptions)
122
+ }
123
+
124
+ static fromPersonalAccessToken(
125
+ personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
126
+ workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
127
+ options: Omit<
128
+ SeamHttpOptionsWithPersonalAccessToken,
129
+ 'personalAccessToken' | 'workspaceId'
130
+ > = {},
131
+ ): SeamHttpCustomers {
132
+ const constructorOptions = { ...options, personalAccessToken, workspaceId }
133
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
134
+ throw new SeamHttpInvalidOptionsError(
135
+ 'Missing personalAccessToken or workspaceId',
136
+ )
137
+ }
138
+ return new SeamHttpCustomers(constructorOptions)
139
+ }
140
+
141
+ createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
142
+ request: SeamHttpRequest<TResponse, TResponseKey>,
143
+ ): SeamPaginator<TResponse, TResponseKey> {
144
+ return new SeamPaginator<TResponse, TResponseKey>(this, request)
145
+ }
146
+
147
+ async updateClientSessionToken(
148
+ clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
149
+ ): Promise<void> {
150
+ const { headers } = this.client.defaults
151
+ const authHeaders = getAuthHeadersForClientSessionToken({
152
+ clientSessionToken,
153
+ })
154
+ for (const key of Object.keys(authHeaders)) {
155
+ if (headers[key] == null) {
156
+ throw new Error(
157
+ 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
158
+ )
159
+ }
160
+ }
161
+ this.client.defaults.headers = { ...headers, ...authHeaders }
162
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client)
163
+ await clientSessions.get()
164
+ }
165
+
166
+ createPortal(
167
+ parameters?: CustomersCreatePortalParameters,
168
+ options: CustomersCreatePortalOptions = {},
169
+ ): CustomersCreatePortalRequest {
170
+ return new SeamHttpRequest(this, {
171
+ pathname: '/customers/create_portal',
172
+ method: 'POST',
173
+ body: parameters,
174
+ responseKey: 'magic_link',
175
+ options,
176
+ })
177
+ }
178
+
179
+ pushData(
180
+ parameters?: CustomersPushDataParameters,
181
+ options: CustomersPushDataOptions = {},
182
+ ): CustomersPushDataRequest {
183
+ return new SeamHttpRequest(this, {
184
+ pathname: '/customers/push_data',
185
+ method: 'POST',
186
+ body: parameters,
187
+ responseKey: undefined,
188
+ options,
189
+ })
190
+ }
191
+ }
192
+
193
+ export type CustomersCreatePortalParameters =
194
+ RouteRequestBody<'/customers/create_portal'>
195
+
196
+ /**
197
+ * @deprecated Use CustomersCreatePortalParameters instead.
198
+ */
199
+ export type CustomersCreatePortalBody = CustomersCreatePortalParameters
200
+
201
+ /**
202
+ * @deprecated Use CustomersCreatePortalRequest instead.
203
+ */
204
+ export type CustomersCreatePortalResponse = SetNonNullable<
205
+ Required<RouteResponse<'/customers/create_portal'>>
206
+ >
207
+
208
+ export type CustomersCreatePortalRequest = SeamHttpRequest<
209
+ CustomersCreatePortalResponse,
210
+ 'magic_link'
211
+ >
212
+
213
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
214
+ export interface CustomersCreatePortalOptions {}
215
+
216
+ export type CustomersPushDataParameters =
217
+ RouteRequestBody<'/customers/push_data'>
218
+
219
+ /**
220
+ * @deprecated Use CustomersPushDataParameters instead.
221
+ */
222
+ export type CustomersPushDataBody = CustomersPushDataParameters
223
+
224
+ /**
225
+ * @deprecated Use CustomersPushDataRequest instead.
226
+ */
227
+ export type CustomersPushDataResponse = SetNonNullable<
228
+ Required<RouteResponse<'/customers/push_data'>>
229
+ >
230
+
231
+ export type CustomersPushDataRequest = SeamHttpRequest<void, undefined>
232
+
233
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
234
+ export interface CustomersPushDataOptions {}
@@ -3,4 +3,4 @@
3
3
  * Do not edit this file or add other files to this directory.
4
4
  */
5
5
 
6
- export * from './resources.js'
6
+ export * from './customers.js'
@@ -249,7 +249,7 @@ export type DevicesSimulateRemoveParameters =
249
249
  /**
250
250
  * @deprecated Use DevicesSimulateRemoveParameters instead.
251
251
  */
252
- export type DevicesSimulateRemoveParams = DevicesSimulateRemoveParameters
252
+ export type DevicesSimulateRemoveBody = DevicesSimulateRemoveParameters
253
253
 
254
254
  /**
255
255
  * @deprecated Use DevicesSimulateRemoveRequest instead.
@@ -12,6 +12,7 @@ export * from './bridges/index.js'
12
12
  export * from './client-sessions/index.js'
13
13
  export * from './connect-webviews/index.js'
14
14
  export * from './connected-accounts/index.js'
15
+ export * from './customers/index.js'
15
16
  export * from './devices/index.js'
16
17
  export * from './events/index.js'
17
18
  export * from './locks/index.js'
@@ -183,7 +183,7 @@ export type PhonesSimulateCreateSandboxPhoneParameters =
183
183
  /**
184
184
  * @deprecated Use PhonesSimulateCreateSandboxPhoneParameters instead.
185
185
  */
186
- export type PhonesSimulateCreateSandboxPhoneParams =
186
+ export type PhonesSimulateCreateSandboxPhoneBody =
187
187
  PhonesSimulateCreateSandboxPhoneParameters
188
188
 
189
189
  /**
@@ -3,4 +3,4 @@
3
3
  * Do not edit this file or add other files to this directory.
4
4
  */
5
5
 
6
- export * from './resources.js'
6
+ export * from './v1/index.js'
@@ -0,0 +1,8 @@
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 './portals/index.js'
7
+ export * from './settings/index.js'
8
+ export * from './v1.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 './portals.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 SeamHttpSeamPartnerV1Resources {
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
- ): SeamHttpSeamPartnerV1Resources {
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 SeamHttpSeamPartnerV1Resources(constructorOptions)
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
- ): SeamHttpSeamPartnerV1Resources {
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 SeamHttpSeamPartnerV1Resources(constructorOptions)
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
- ): SeamHttpSeamPartnerV1Resources {
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 SeamHttpSeamPartnerV1Resources(constructorOptions)
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<SeamHttpSeamPartnerV1Resources> {
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 SeamHttpSeamPartnerV1Resources.fromPublishableKey',
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 SeamHttpSeamPartnerV1Resources.fromClientSessionToken(token, options)
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
- ): SeamHttpSeamPartnerV1Resources {
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 SeamHttpSeamPartnerV1Resources(constructorOptions)
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
- ): SeamHttpSeamPartnerV1Resources {
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 SeamHttpSeamPartnerV1Resources(constructorOptions)
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
- list(
172
- parameters?: SeamPartnerV1ResourcesListParameters,
173
- options: SeamPartnerV1ResourcesListOptions = {},
174
- ): SeamPartnerV1ResourcesListRequest {
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/partner/v1/resources/list',
181
+ pathname: '/seam/customer/v1/portals/get',
182
182
  method: 'POST',
183
183
  body: parameters,
184
- responseKey: 'partner_resources',
184
+ responseKey: 'customer_portal',
185
185
  options,
186
186
  })
187
187
  }
188
188
  }
189
189
 
190
- export type SeamPartnerV1ResourcesListParameters =
191
- RouteRequestBody<'/seam/partner/v1/resources/list'>
190
+ export type SeamCustomerV1PortalsGetParameters =
191
+ RouteRequestBody<'/seam/customer/v1/portals/get'>
192
192
 
193
193
  /**
194
- * @deprecated Use SeamPartnerV1ResourcesListParameters instead.
194
+ * @deprecated Use SeamCustomerV1PortalsGetParameters instead.
195
195
  */
196
- export type SeamPartnerV1ResourcesListParams =
197
- SeamPartnerV1ResourcesListParameters
196
+ export type SeamCustomerV1PortalsGetParams = SeamCustomerV1PortalsGetParameters
198
197
 
199
198
  /**
200
- * @deprecated Use SeamPartnerV1ResourcesListRequest instead.
199
+ * @deprecated Use SeamCustomerV1PortalsGetRequest instead.
201
200
  */
202
- export type SeamPartnerV1ResourcesListResponse = SetNonNullable<
203
- Required<RouteResponse<'/seam/partner/v1/resources/list'>>
201
+ export type SeamCustomerV1PortalsGetResponse = SetNonNullable<
202
+ Required<RouteResponse<'/seam/customer/v1/portals/get'>>
204
203
  >
205
204
 
206
- export type SeamPartnerV1ResourcesListRequest = SeamHttpRequest<
207
- SeamPartnerV1ResourcesListResponse,
208
- 'partner_resources'
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 SeamPartnerV1ResourcesListOptions {}
211
+ export interface SeamCustomerV1PortalsGetOptions {}
@@ -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 './settings.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 SeamHttpUnstablePartnerResources {
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
- ): SeamHttpUnstablePartnerResources {
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 SeamHttpUnstablePartnerResources(constructorOptions)
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
- ): SeamHttpUnstablePartnerResources {
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 SeamHttpUnstablePartnerResources(constructorOptions)
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
- ): SeamHttpUnstablePartnerResources {
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 SeamHttpUnstablePartnerResources(constructorOptions)
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<SeamHttpUnstablePartnerResources> {
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 SeamHttpUnstablePartnerResources.fromPublishableKey',
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 SeamHttpUnstablePartnerResources.fromClientSessionToken(
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
- ): SeamHttpUnstablePartnerResources {
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 SeamHttpUnstablePartnerResources(constructorOptions)
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
- ): SeamHttpUnstablePartnerResources {
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 SeamHttpUnstablePartnerResources(constructorOptions)
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
- push(
175
- parameters?: UnstablePartnerResourcesPushParameters,
176
- options: UnstablePartnerResourcesPushOptions = {},
177
- ): UnstablePartnerResourcesPushRequest {
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: '/unstable_partner/resources/push',
185
- method: 'POST',
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 UnstablePartnerResourcesPushParameters =
194
- RouteRequestBody<'/unstable_partner/resources/push'>
190
+ export type SeamCustomerV1SettingsUpdateParameters =
191
+ RouteRequestBody<'/seam/customer/v1/settings/update'>
195
192
 
196
193
  /**
197
- * @deprecated Use UnstablePartnerResourcesPushParameters instead.
194
+ * @deprecated Use SeamCustomerV1SettingsUpdateParameters instead.
198
195
  */
199
- export type UnstablePartnerResourcesPushBody =
200
- UnstablePartnerResourcesPushParameters
196
+ export type SeamCustomerV1SettingsUpdateBody =
197
+ SeamCustomerV1SettingsUpdateParameters
201
198
 
202
199
  /**
203
- * @deprecated Use UnstablePartnerResourcesPushRequest instead.
200
+ * @deprecated Use SeamCustomerV1SettingsUpdateRequest instead.
204
201
  */
205
- export type UnstablePartnerResourcesPushResponse = SetNonNullable<
206
- Required<RouteResponse<'/unstable_partner/resources/push'>>
202
+ export type SeamCustomerV1SettingsUpdateResponse = SetNonNullable<
203
+ Required<RouteResponse<'/seam/customer/v1/settings/update'>>
207
204
  >
208
205
 
209
- export type UnstablePartnerResourcesPushRequest = SeamHttpRequest<
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 UnstablePartnerResourcesPushOptions {}
212
+ export interface SeamCustomerV1SettingsUpdateOptions {}