@seamapi/http 1.39.0 → 1.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/connect.cjs +0 -1128
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +3 -279
  4. package/dist/index.cjs.map +1 -1
  5. package/lib/seam/connect/routes/seam/index.d.ts +0 -3
  6. package/lib/seam/connect/routes/seam/index.js +0 -3
  7. package/lib/seam/connect/routes/seam/index.js.map +1 -1
  8. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +2 -16
  9. package/lib/seam/connect/routes/seam-http-endpoints.js +0 -95
  10. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  11. package/lib/version.d.ts +1 -1
  12. package/lib/version.js +1 -1
  13. package/package.json +3 -3
  14. package/src/lib/seam/connect/routes/seam/index.ts +0 -3
  15. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +0 -252
  16. package/src/lib/version.ts +1 -1
  17. package/lib/seam/connect/routes/seam/bridge/index.d.ts +0 -1
  18. package/lib/seam/connect/routes/seam/bridge/index.js +0 -6
  19. package/lib/seam/connect/routes/seam/bridge/index.js.map +0 -1
  20. package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.d.ts +0 -86
  21. package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.js +0 -150
  22. package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.js.map +0 -1
  23. package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.d.ts +0 -1
  24. package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.js +0 -6
  25. package/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.js.map +0 -1
  26. package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.d.ts +0 -34
  27. package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.js +0 -102
  28. package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.js.map +0 -1
  29. package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.d.ts +0 -1
  30. package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.js +0 -6
  31. package/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.js.map +0 -1
  32. package/lib/seam/connect/routes/seam/bridge/v1/index.d.ts +0 -3
  33. package/lib/seam/connect/routes/seam/bridge/v1/index.js +0 -8
  34. package/lib/seam/connect/routes/seam/bridge/v1/index.js.map +0 -1
  35. package/lib/seam/connect/routes/seam/bridge/v1/v1.d.ts +0 -23
  36. package/lib/seam/connect/routes/seam/bridge/v1/v1.js +0 -97
  37. package/lib/seam/connect/routes/seam/bridge/v1/v1.js.map +0 -1
  38. package/lib/seam/connect/routes/seam/instant-key/index.d.ts +0 -1
  39. package/lib/seam/connect/routes/seam/instant-key/index.js +0 -6
  40. package/lib/seam/connect/routes/seam/instant-key/index.js.map +0 -1
  41. package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.d.ts +0 -34
  42. package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.js +0 -102
  43. package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.js.map +0 -1
  44. package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.d.ts +0 -1
  45. package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.js +0 -6
  46. package/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.js.map +0 -1
  47. package/lib/seam/connect/routes/seam/instant-key/v1/index.d.ts +0 -2
  48. package/lib/seam/connect/routes/seam/instant-key/v1/index.js +0 -7
  49. package/lib/seam/connect/routes/seam/instant-key/v1/index.js.map +0 -1
  50. package/lib/seam/connect/routes/seam/instant-key/v1/v1.d.ts +0 -21
  51. package/lib/seam/connect/routes/seam/instant-key/v1/v1.js +0 -93
  52. package/lib/seam/connect/routes/seam/instant-key/v1/v1.js.map +0 -1
  53. package/lib/seam/connect/routes/seam/mobile-sdk/index.d.ts +0 -1
  54. package/lib/seam/connect/routes/seam/mobile-sdk/index.js +0 -6
  55. package/lib/seam/connect/routes/seam/mobile-sdk/index.js.map +0 -1
  56. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.d.ts +0 -21
  57. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.js +0 -93
  58. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.js.map +0 -1
  59. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.d.ts +0 -34
  60. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.js +0 -102
  61. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.js.map +0 -1
  62. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.d.ts +0 -1
  63. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.js +0 -6
  64. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.js.map +0 -1
  65. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.d.ts +0 -2
  66. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.js +0 -7
  67. package/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.js.map +0 -1
  68. package/lib/seam/connect/routes/seam/mobile-sdk/v1/index.d.ts +0 -3
  69. package/lib/seam/connect/routes/seam/mobile-sdk/v1/index.js +0 -8
  70. package/lib/seam/connect/routes/seam/mobile-sdk/v1/index.js.map +0 -1
  71. package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.d.ts +0 -1
  72. package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.js +0 -6
  73. package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.js.map +0 -1
  74. package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.d.ts +0 -34
  75. package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.js +0 -102
  76. package/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.js.map +0 -1
  77. package/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.d.ts +0 -23
  78. package/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.js +0 -97
  79. package/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.js.map +0 -1
  80. package/src/lib/seam/connect/routes/seam/bridge/index.ts +0 -6
  81. package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/bridge-client-sessions.ts +0 -398
  82. package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-client-sessions/index.ts +0 -6
  83. package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/bridge-connected-systems.ts +0 -215
  84. package/src/lib/seam/connect/routes/seam/bridge/v1/bridge-connected-systems/index.ts +0 -6
  85. package/src/lib/seam/connect/routes/seam/bridge/v1/index.ts +0 -8
  86. package/src/lib/seam/connect/routes/seam/bridge/v1/v1.ts +0 -184
  87. package/src/lib/seam/connect/routes/seam/instant-key/index.ts +0 -6
  88. package/src/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/client-sessions.ts +0 -219
  89. package/src/lib/seam/connect/routes/seam/instant-key/v1/client-sessions/index.ts +0 -6
  90. package/src/lib/seam/connect/routes/seam/instant-key/v1/index.ts +0 -7
  91. package/src/lib/seam/connect/routes/seam/instant-key/v1/v1.ts +0 -176
  92. package/src/lib/seam/connect/routes/seam/mobile-sdk/index.ts +0 -6
  93. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/acs.ts +0 -176
  94. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/credentials.ts +0 -215
  95. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/credentials/index.ts +0 -6
  96. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/acs/index.ts +0 -7
  97. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/index.ts +0 -8
  98. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/index.ts +0 -6
  99. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/phone-sessions/phone-sessions.ts +0 -215
  100. package/src/lib/seam/connect/routes/seam/mobile-sdk/v1/v1.ts +0 -181
@@ -1,176 +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 { seamApiLtsVersion } from 'lib/lts-version.js'
7
- import {
8
- getAuthHeadersForClientSessionToken,
9
- warnOnInsecureuserIdentifierKey,
10
- } from 'lib/seam/connect/auth.js'
11
- import { type Client, createClient } from 'lib/seam/connect/client.js'
12
- import {
13
- isSeamHttpOptionsWithApiKey,
14
- isSeamHttpOptionsWithClient,
15
- isSeamHttpOptionsWithClientSessionToken,
16
- isSeamHttpOptionsWithConsoleSessionToken,
17
- isSeamHttpOptionsWithPersonalAccessToken,
18
- type SeamHttpFromPublishableKeyOptions,
19
- SeamHttpInvalidOptionsError,
20
- type SeamHttpOptions,
21
- type SeamHttpOptionsWithApiKey,
22
- type SeamHttpOptionsWithClient,
23
- type SeamHttpOptionsWithClientSessionToken,
24
- type SeamHttpOptionsWithConsoleSessionToken,
25
- type SeamHttpOptionsWithPersonalAccessToken,
26
- type SeamHttpRequestOptions,
27
- } from 'lib/seam/connect/options.js'
28
- import {
29
- limitToSeamHttpRequestOptions,
30
- parseOptions,
31
- } from 'lib/seam/connect/parse-options.js'
32
- import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
33
- import type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
34
- import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
35
-
36
- import { SeamHttpSeamInstantKeyV1ClientSessions } from './client-sessions/index.js'
37
-
38
- export class SeamHttpSeamInstantKeyV1 {
39
- client: Client
40
- readonly defaults: Required<SeamHttpRequestOptions>
41
- readonly ltsVersion = seamApiLtsVersion
42
- static ltsVersion = seamApiLtsVersion
43
-
44
- constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
45
- const options = parseOptions(apiKeyOrOptions)
46
- if (!options.isUndocumentedApiEnabled) {
47
- throw new Error(
48
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
49
- )
50
- }
51
- this.client = 'client' in options ? options.client : createClient(options)
52
- this.defaults = limitToSeamHttpRequestOptions(options)
53
- }
54
-
55
- static fromClient(
56
- client: SeamHttpOptionsWithClient['client'],
57
- options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
58
- ): SeamHttpSeamInstantKeyV1 {
59
- const constructorOptions = { ...options, client }
60
- if (!isSeamHttpOptionsWithClient(constructorOptions)) {
61
- throw new SeamHttpInvalidOptionsError('Missing client')
62
- }
63
- return new SeamHttpSeamInstantKeyV1(constructorOptions)
64
- }
65
-
66
- static fromApiKey(
67
- apiKey: SeamHttpOptionsWithApiKey['apiKey'],
68
- options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
69
- ): SeamHttpSeamInstantKeyV1 {
70
- const constructorOptions = { ...options, apiKey }
71
- if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
72
- throw new SeamHttpInvalidOptionsError('Missing apiKey')
73
- }
74
- return new SeamHttpSeamInstantKeyV1(constructorOptions)
75
- }
76
-
77
- static fromClientSessionToken(
78
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
79
- options: Omit<
80
- SeamHttpOptionsWithClientSessionToken,
81
- 'clientSessionToken'
82
- > = {},
83
- ): SeamHttpSeamInstantKeyV1 {
84
- const constructorOptions = { ...options, clientSessionToken }
85
- if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
86
- throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
87
- }
88
- return new SeamHttpSeamInstantKeyV1(constructorOptions)
89
- }
90
-
91
- static async fromPublishableKey(
92
- publishableKey: string,
93
- userIdentifierKey: string,
94
- options: SeamHttpFromPublishableKeyOptions = {},
95
- ): Promise<SeamHttpSeamInstantKeyV1> {
96
- warnOnInsecureuserIdentifierKey(userIdentifierKey)
97
- const clientOptions = parseOptions({ ...options, publishableKey })
98
- if (isSeamHttpOptionsWithClient(clientOptions)) {
99
- throw new SeamHttpInvalidOptionsError(
100
- 'The client option cannot be used with SeamHttpSeamInstantKeyV1.fromPublishableKey',
101
- )
102
- }
103
- const client = createClient(clientOptions)
104
- const clientSessions = SeamHttpClientSessions.fromClient(client)
105
- const { token } = await clientSessions.getOrCreate({
106
- user_identifier_key: userIdentifierKey,
107
- })
108
- return SeamHttpSeamInstantKeyV1.fromClientSessionToken(token, options)
109
- }
110
-
111
- static fromConsoleSessionToken(
112
- consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
113
- workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
114
- options: Omit<
115
- SeamHttpOptionsWithConsoleSessionToken,
116
- 'consoleSessionToken' | 'workspaceId'
117
- > = {},
118
- ): SeamHttpSeamInstantKeyV1 {
119
- const constructorOptions = { ...options, consoleSessionToken, workspaceId }
120
- if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
121
- throw new SeamHttpInvalidOptionsError(
122
- 'Missing consoleSessionToken or workspaceId',
123
- )
124
- }
125
- return new SeamHttpSeamInstantKeyV1(constructorOptions)
126
- }
127
-
128
- static fromPersonalAccessToken(
129
- personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
130
- workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
131
- options: Omit<
132
- SeamHttpOptionsWithPersonalAccessToken,
133
- 'personalAccessToken' | 'workspaceId'
134
- > = {},
135
- ): SeamHttpSeamInstantKeyV1 {
136
- const constructorOptions = { ...options, personalAccessToken, workspaceId }
137
- if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
138
- throw new SeamHttpInvalidOptionsError(
139
- 'Missing personalAccessToken or workspaceId',
140
- )
141
- }
142
- return new SeamHttpSeamInstantKeyV1(constructorOptions)
143
- }
144
-
145
- createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
146
- request: SeamHttpRequest<TResponse, TResponseKey>,
147
- ): SeamPaginator<TResponse, TResponseKey> {
148
- return new SeamPaginator<TResponse, TResponseKey>(this, request)
149
- }
150
-
151
- async updateClientSessionToken(
152
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
153
- ): Promise<void> {
154
- const { headers } = this.client.defaults
155
- const authHeaders = getAuthHeadersForClientSessionToken({
156
- clientSessionToken,
157
- })
158
- for (const key of Object.keys(authHeaders)) {
159
- if (headers[key] == null) {
160
- throw new Error(
161
- 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
162
- )
163
- }
164
- }
165
- this.client.defaults.headers = { ...headers, ...authHeaders }
166
- const clientSessions = SeamHttpClientSessions.fromClient(this.client)
167
- await clientSessions.get()
168
- }
169
-
170
- get clientSessions(): SeamHttpSeamInstantKeyV1ClientSessions {
171
- return SeamHttpSeamInstantKeyV1ClientSessions.fromClient(
172
- this.client,
173
- this.defaults,
174
- )
175
- }
176
- }
@@ -1,6 +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
- export * from './v1/index.js'
@@ -1,176 +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 { seamApiLtsVersion } from 'lib/lts-version.js'
7
- import {
8
- getAuthHeadersForClientSessionToken,
9
- warnOnInsecureuserIdentifierKey,
10
- } from 'lib/seam/connect/auth.js'
11
- import { type Client, createClient } from 'lib/seam/connect/client.js'
12
- import {
13
- isSeamHttpOptionsWithApiKey,
14
- isSeamHttpOptionsWithClient,
15
- isSeamHttpOptionsWithClientSessionToken,
16
- isSeamHttpOptionsWithConsoleSessionToken,
17
- isSeamHttpOptionsWithPersonalAccessToken,
18
- type SeamHttpFromPublishableKeyOptions,
19
- SeamHttpInvalidOptionsError,
20
- type SeamHttpOptions,
21
- type SeamHttpOptionsWithApiKey,
22
- type SeamHttpOptionsWithClient,
23
- type SeamHttpOptionsWithClientSessionToken,
24
- type SeamHttpOptionsWithConsoleSessionToken,
25
- type SeamHttpOptionsWithPersonalAccessToken,
26
- type SeamHttpRequestOptions,
27
- } from 'lib/seam/connect/options.js'
28
- import {
29
- limitToSeamHttpRequestOptions,
30
- parseOptions,
31
- } from 'lib/seam/connect/parse-options.js'
32
- import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
33
- import type { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
34
- import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
35
-
36
- import { SeamHttpSeamMobileSdkV1AcsCredentials } from './credentials/index.js'
37
-
38
- export class SeamHttpSeamMobileSdkV1Acs {
39
- client: Client
40
- readonly defaults: Required<SeamHttpRequestOptions>
41
- readonly ltsVersion = seamApiLtsVersion
42
- static ltsVersion = seamApiLtsVersion
43
-
44
- constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
45
- const options = parseOptions(apiKeyOrOptions)
46
- if (!options.isUndocumentedApiEnabled) {
47
- throw new Error(
48
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
49
- )
50
- }
51
- this.client = 'client' in options ? options.client : createClient(options)
52
- this.defaults = limitToSeamHttpRequestOptions(options)
53
- }
54
-
55
- static fromClient(
56
- client: SeamHttpOptionsWithClient['client'],
57
- options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
58
- ): SeamHttpSeamMobileSdkV1Acs {
59
- const constructorOptions = { ...options, client }
60
- if (!isSeamHttpOptionsWithClient(constructorOptions)) {
61
- throw new SeamHttpInvalidOptionsError('Missing client')
62
- }
63
- return new SeamHttpSeamMobileSdkV1Acs(constructorOptions)
64
- }
65
-
66
- static fromApiKey(
67
- apiKey: SeamHttpOptionsWithApiKey['apiKey'],
68
- options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
69
- ): SeamHttpSeamMobileSdkV1Acs {
70
- const constructorOptions = { ...options, apiKey }
71
- if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
72
- throw new SeamHttpInvalidOptionsError('Missing apiKey')
73
- }
74
- return new SeamHttpSeamMobileSdkV1Acs(constructorOptions)
75
- }
76
-
77
- static fromClientSessionToken(
78
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
79
- options: Omit<
80
- SeamHttpOptionsWithClientSessionToken,
81
- 'clientSessionToken'
82
- > = {},
83
- ): SeamHttpSeamMobileSdkV1Acs {
84
- const constructorOptions = { ...options, clientSessionToken }
85
- if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
86
- throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
87
- }
88
- return new SeamHttpSeamMobileSdkV1Acs(constructorOptions)
89
- }
90
-
91
- static async fromPublishableKey(
92
- publishableKey: string,
93
- userIdentifierKey: string,
94
- options: SeamHttpFromPublishableKeyOptions = {},
95
- ): Promise<SeamHttpSeamMobileSdkV1Acs> {
96
- warnOnInsecureuserIdentifierKey(userIdentifierKey)
97
- const clientOptions = parseOptions({ ...options, publishableKey })
98
- if (isSeamHttpOptionsWithClient(clientOptions)) {
99
- throw new SeamHttpInvalidOptionsError(
100
- 'The client option cannot be used with SeamHttpSeamMobileSdkV1Acs.fromPublishableKey',
101
- )
102
- }
103
- const client = createClient(clientOptions)
104
- const clientSessions = SeamHttpClientSessions.fromClient(client)
105
- const { token } = await clientSessions.getOrCreate({
106
- user_identifier_key: userIdentifierKey,
107
- })
108
- return SeamHttpSeamMobileSdkV1Acs.fromClientSessionToken(token, options)
109
- }
110
-
111
- static fromConsoleSessionToken(
112
- consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
113
- workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
114
- options: Omit<
115
- SeamHttpOptionsWithConsoleSessionToken,
116
- 'consoleSessionToken' | 'workspaceId'
117
- > = {},
118
- ): SeamHttpSeamMobileSdkV1Acs {
119
- const constructorOptions = { ...options, consoleSessionToken, workspaceId }
120
- if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
121
- throw new SeamHttpInvalidOptionsError(
122
- 'Missing consoleSessionToken or workspaceId',
123
- )
124
- }
125
- return new SeamHttpSeamMobileSdkV1Acs(constructorOptions)
126
- }
127
-
128
- static fromPersonalAccessToken(
129
- personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
130
- workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
131
- options: Omit<
132
- SeamHttpOptionsWithPersonalAccessToken,
133
- 'personalAccessToken' | 'workspaceId'
134
- > = {},
135
- ): SeamHttpSeamMobileSdkV1Acs {
136
- const constructorOptions = { ...options, personalAccessToken, workspaceId }
137
- if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
138
- throw new SeamHttpInvalidOptionsError(
139
- 'Missing personalAccessToken or workspaceId',
140
- )
141
- }
142
- return new SeamHttpSeamMobileSdkV1Acs(constructorOptions)
143
- }
144
-
145
- createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
146
- request: SeamHttpRequest<TResponse, TResponseKey>,
147
- ): SeamPaginator<TResponse, TResponseKey> {
148
- return new SeamPaginator<TResponse, TResponseKey>(this, request)
149
- }
150
-
151
- async updateClientSessionToken(
152
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
153
- ): Promise<void> {
154
- const { headers } = this.client.defaults
155
- const authHeaders = getAuthHeadersForClientSessionToken({
156
- clientSessionToken,
157
- })
158
- for (const key of Object.keys(authHeaders)) {
159
- if (headers[key] == null) {
160
- throw new Error(
161
- 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
162
- )
163
- }
164
- }
165
- this.client.defaults.headers = { ...headers, ...authHeaders }
166
- const clientSessions = SeamHttpClientSessions.fromClient(this.client)
167
- await clientSessions.get()
168
- }
169
-
170
- get credentials(): SeamHttpSeamMobileSdkV1AcsCredentials {
171
- return SeamHttpSeamMobileSdkV1AcsCredentials.fromClient(
172
- this.client,
173
- this.defaults,
174
- )
175
- }
176
- }
@@ -1,215 +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 SeamHttpSeamMobileSdkV1AcsCredentials {
40
- client: Client
41
- readonly defaults: Required<SeamHttpRequestOptions>
42
- readonly ltsVersion = seamApiLtsVersion
43
- static ltsVersion = seamApiLtsVersion
44
-
45
- constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
46
- const options = parseOptions(apiKeyOrOptions)
47
- if (!options.isUndocumentedApiEnabled) {
48
- throw new Error(
49
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
50
- )
51
- }
52
- this.client = 'client' in options ? options.client : createClient(options)
53
- this.defaults = limitToSeamHttpRequestOptions(options)
54
- }
55
-
56
- static fromClient(
57
- client: SeamHttpOptionsWithClient['client'],
58
- options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
59
- ): SeamHttpSeamMobileSdkV1AcsCredentials {
60
- const constructorOptions = { ...options, client }
61
- if (!isSeamHttpOptionsWithClient(constructorOptions)) {
62
- throw new SeamHttpInvalidOptionsError('Missing client')
63
- }
64
- return new SeamHttpSeamMobileSdkV1AcsCredentials(constructorOptions)
65
- }
66
-
67
- static fromApiKey(
68
- apiKey: SeamHttpOptionsWithApiKey['apiKey'],
69
- options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
70
- ): SeamHttpSeamMobileSdkV1AcsCredentials {
71
- const constructorOptions = { ...options, apiKey }
72
- if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
73
- throw new SeamHttpInvalidOptionsError('Missing apiKey')
74
- }
75
- return new SeamHttpSeamMobileSdkV1AcsCredentials(constructorOptions)
76
- }
77
-
78
- static fromClientSessionToken(
79
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
80
- options: Omit<
81
- SeamHttpOptionsWithClientSessionToken,
82
- 'clientSessionToken'
83
- > = {},
84
- ): SeamHttpSeamMobileSdkV1AcsCredentials {
85
- const constructorOptions = { ...options, clientSessionToken }
86
- if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
87
- throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
88
- }
89
- return new SeamHttpSeamMobileSdkV1AcsCredentials(constructorOptions)
90
- }
91
-
92
- static async fromPublishableKey(
93
- publishableKey: string,
94
- userIdentifierKey: string,
95
- options: SeamHttpFromPublishableKeyOptions = {},
96
- ): Promise<SeamHttpSeamMobileSdkV1AcsCredentials> {
97
- warnOnInsecureuserIdentifierKey(userIdentifierKey)
98
- const clientOptions = parseOptions({ ...options, publishableKey })
99
- if (isSeamHttpOptionsWithClient(clientOptions)) {
100
- throw new SeamHttpInvalidOptionsError(
101
- 'The client option cannot be used with SeamHttpSeamMobileSdkV1AcsCredentials.fromPublishableKey',
102
- )
103
- }
104
- const client = createClient(clientOptions)
105
- const clientSessions = SeamHttpClientSessions.fromClient(client)
106
- const { token } = await clientSessions.getOrCreate({
107
- user_identifier_key: userIdentifierKey,
108
- })
109
- return SeamHttpSeamMobileSdkV1AcsCredentials.fromClientSessionToken(
110
- token,
111
- options,
112
- )
113
- }
114
-
115
- static fromConsoleSessionToken(
116
- consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
117
- workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
118
- options: Omit<
119
- SeamHttpOptionsWithConsoleSessionToken,
120
- 'consoleSessionToken' | 'workspaceId'
121
- > = {},
122
- ): SeamHttpSeamMobileSdkV1AcsCredentials {
123
- const constructorOptions = { ...options, consoleSessionToken, workspaceId }
124
- if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
125
- throw new SeamHttpInvalidOptionsError(
126
- 'Missing consoleSessionToken or workspaceId',
127
- )
128
- }
129
- return new SeamHttpSeamMobileSdkV1AcsCredentials(constructorOptions)
130
- }
131
-
132
- static fromPersonalAccessToken(
133
- personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
134
- workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
135
- options: Omit<
136
- SeamHttpOptionsWithPersonalAccessToken,
137
- 'personalAccessToken' | 'workspaceId'
138
- > = {},
139
- ): SeamHttpSeamMobileSdkV1AcsCredentials {
140
- const constructorOptions = { ...options, personalAccessToken, workspaceId }
141
- if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
142
- throw new SeamHttpInvalidOptionsError(
143
- 'Missing personalAccessToken or workspaceId',
144
- )
145
- }
146
- return new SeamHttpSeamMobileSdkV1AcsCredentials(constructorOptions)
147
- }
148
-
149
- createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
150
- request: SeamHttpRequest<TResponse, TResponseKey>,
151
- ): SeamPaginator<TResponse, TResponseKey> {
152
- return new SeamPaginator<TResponse, TResponseKey>(this, request)
153
- }
154
-
155
- async updateClientSessionToken(
156
- clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
157
- ): Promise<void> {
158
- const { headers } = this.client.defaults
159
- const authHeaders = getAuthHeadersForClientSessionToken({
160
- clientSessionToken,
161
- })
162
- for (const key of Object.keys(authHeaders)) {
163
- if (headers[key] == null) {
164
- throw new Error(
165
- 'Cannot update a clientSessionToken on a client created without a clientSessionToken',
166
- )
167
- }
168
- }
169
- this.client.defaults.headers = { ...headers, ...authHeaders }
170
- const clientSessions = SeamHttpClientSessions.fromClient(this.client)
171
- await clientSessions.get()
172
- }
173
-
174
- list(
175
- parameters?: SeamMobileSdkV1AcsCredentialsListParameters,
176
- options: SeamMobileSdkV1AcsCredentialsListOptions = {},
177
- ): SeamMobileSdkV1AcsCredentialsListRequest {
178
- if (!this.defaults.isUndocumentedApiEnabled) {
179
- throw new Error(
180
- 'Cannot use undocumented API without isUndocumentedApiEnabled',
181
- )
182
- }
183
- return new SeamHttpRequest(this, {
184
- pathname: '/seam/mobile_sdk/v1/acs/credentials/list',
185
- method: 'POST',
186
- body: parameters,
187
- responseKey: 'acs_credentials',
188
- options,
189
- })
190
- }
191
- }
192
-
193
- export type SeamMobileSdkV1AcsCredentialsListParameters =
194
- RouteRequestBody<'/seam/mobile_sdk/v1/acs/credentials/list'>
195
-
196
- /**
197
- * @deprecated Use SeamMobileSdkV1AcsCredentialsListParameters instead.
198
- */
199
- export type SeamMobileSdkV1AcsCredentialsListParams =
200
- SeamMobileSdkV1AcsCredentialsListParameters
201
-
202
- /**
203
- * @deprecated Use SeamMobileSdkV1AcsCredentialsListRequest instead.
204
- */
205
- export type SeamMobileSdkV1AcsCredentialsListResponse = SetNonNullable<
206
- Required<RouteResponse<'/seam/mobile_sdk/v1/acs/credentials/list'>>
207
- >
208
-
209
- export type SeamMobileSdkV1AcsCredentialsListRequest = SeamHttpRequest<
210
- SeamMobileSdkV1AcsCredentialsListResponse,
211
- 'acs_credentials'
212
- >
213
-
214
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
215
- export interface SeamMobileSdkV1AcsCredentialsListOptions {}
@@ -1,6 +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
- export * from './credentials.js'
@@ -1,7 +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
- export * from './acs.js'
7
- export * from './credentials/index.js'
@@ -1,8 +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
- export * from './acs/index.js'
7
- export * from './phone-sessions/index.js'
8
- export * from './v1.js'
@@ -1,6 +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
- export * from './phone-sessions.js'