@seamapi/http 2.11.1 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -2
- package/lib/client.js +10 -3
- package/lib/client.js.map +1 -1
- package/lib/resources/connect-webview.d.ts +1 -1
- package/lib/resources/connected-account.d.ts +1 -1
- package/lib/resources/device.d.ts +1 -1
- package/lib/resources/event.d.ts +122 -122
- package/lib/resources/phone.d.ts +1 -1
- package/lib/resources/unmanaged-device.d.ts +1 -1
- package/lib/routes/connect-webviews/connect-webviews.d.ts +2 -2
- package/lib/routes/connected-accounts/connected-accounts.d.ts +2 -2
- package/lib/routes/customers/customers.d.ts +4 -4
- package/lib/routes/devices/devices.d.ts +2 -2
- package/lib/routes/devices/unmanaged/unmanaged.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/src/lib/client.ts +13 -3
- package/src/lib/resources/connect-webview.ts +1 -1
- package/src/lib/resources/connected-account.ts +1 -1
- package/src/lib/resources/device.ts +1 -1
- package/src/lib/resources/event.ts +187 -122
- package/src/lib/resources/phone.ts +1 -1
- package/src/lib/resources/unmanaged-device.ts +1 -1
- package/src/lib/routes/connect-webviews/connect-webviews.ts +2 -2
- package/src/lib/routes/connected-accounts/connected-accounts.ts +2 -2
- package/src/lib/routes/customers/customers.ts +4 -4
- package/src/lib/routes/devices/devices.ts +2 -2
- package/src/lib/routes/devices/unmanaged/unmanaged.ts +1 -1
- package/src/lib/version.ts +1 -1
package/lib/resources/phone.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type Phone = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Optional [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for the phone.
|
|
11
11
|
*/
|
|
12
|
-
custom_metadata: Record<string,
|
|
12
|
+
custom_metadata: Record<string, string | boolean>;
|
|
13
13
|
/**
|
|
14
14
|
* ID of the phone.
|
|
15
15
|
*/
|
|
@@ -97,7 +97,7 @@ export type UnmanagedDevice = {
|
|
|
97
97
|
/**
|
|
98
98
|
* Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted.
|
|
99
99
|
*/
|
|
100
|
-
custom_metadata: Record<string,
|
|
100
|
+
custom_metadata: Record<string, string | boolean>;
|
|
101
101
|
/**
|
|
102
102
|
* ID of the device.
|
|
103
103
|
*/
|
|
@@ -58,7 +58,7 @@ export type ConnectWebviewsCreateParameters = {
|
|
|
58
58
|
/**
|
|
59
59
|
* Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview) enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that were connected using the Connect Webview, making it easy to find and filter these resources in your [workspace](https://docs.seam.co/core-concepts/workspaces). You can also [filter Connect Webviews by custom metadata](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
60
60
|
*/
|
|
61
|
-
custom_metadata?: Record<string,
|
|
61
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
62
62
|
/**
|
|
63
63
|
* Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the `custom_redirect_url`.
|
|
64
64
|
*/
|
|
@@ -125,7 +125,7 @@ export type ConnectWebviewsListParameters = {
|
|
|
125
125
|
/**
|
|
126
126
|
* Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.
|
|
127
127
|
*/
|
|
128
|
-
custom_metadata_has?: Record<string,
|
|
128
|
+
custom_metadata_has?: Record<string, string | boolean> | undefined;
|
|
129
129
|
/**
|
|
130
130
|
* Customer key for which you want to list connect webviews.
|
|
131
131
|
*/
|
|
@@ -79,7 +79,7 @@ export type ConnectedAccountsListParameters = {
|
|
|
79
79
|
/**
|
|
80
80
|
* Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.
|
|
81
81
|
*/
|
|
82
|
-
custom_metadata_has?: Record<string,
|
|
82
|
+
custom_metadata_has?: Record<string, string | boolean> | undefined;
|
|
83
83
|
/**
|
|
84
84
|
* Customer key by which you want to filter connected accounts.
|
|
85
85
|
*/
|
|
@@ -143,7 +143,7 @@ export type ConnectedAccountsUpdateParameters = {
|
|
|
143
143
|
/**
|
|
144
144
|
* Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter connected accounts by the desired metadata](https://docs.seam.co/core-concepts/connected-accounts/filtering-connected-accounts-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
145
145
|
*/
|
|
146
|
-
custom_metadata?: Record<string,
|
|
146
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
147
147
|
/**
|
|
148
148
|
* The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer.
|
|
149
149
|
*/
|
|
@@ -471,7 +471,7 @@ export type CustomersCreatePortalParameters = {
|
|
|
471
471
|
/**
|
|
472
472
|
* Set key:value pairs. Accepts string or Boolean values. Adding custom metadata to a property listing enables you to store custom information, like customer details or internal IDs from your application. Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
473
473
|
*/
|
|
474
|
-
custom_metadata?: Record<string,
|
|
474
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
475
475
|
/**
|
|
476
476
|
* Your display name for this location resource.
|
|
477
477
|
*/
|
|
@@ -496,7 +496,7 @@ export type CustomersCreatePortalParameters = {
|
|
|
496
496
|
/**
|
|
497
497
|
* Set key:value pairs for filtering reservations by custom criteria. Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
498
498
|
*/
|
|
499
|
-
custom_metadata?: Record<string,
|
|
499
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
500
500
|
/**
|
|
501
501
|
* Ending date and time for the access grant.
|
|
502
502
|
*/
|
|
@@ -1161,7 +1161,7 @@ export type CustomersPushDataParameters = {
|
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Set key:value pairs. Accepts string or Boolean values. Adding custom metadata to a property listing enables you to store custom information, like customer details or internal IDs from your application. Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
1163
1163
|
*/
|
|
1164
|
-
custom_metadata?: Record<string,
|
|
1164
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
1165
1165
|
/**
|
|
1166
1166
|
* Your display name for this location resource.
|
|
1167
1167
|
*/
|
|
@@ -1186,7 +1186,7 @@ export type CustomersPushDataParameters = {
|
|
|
1186
1186
|
/**
|
|
1187
1187
|
* Set key:value pairs for filtering reservations by custom criteria. Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
1188
1188
|
*/
|
|
1189
|
-
custom_metadata?: Record<string,
|
|
1189
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
1190
1190
|
/**
|
|
1191
1191
|
* Ending date and time for the access grant.
|
|
1192
1192
|
*/
|
|
@@ -89,7 +89,7 @@ export type DevicesListParameters = {
|
|
|
89
89
|
/**
|
|
90
90
|
* Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.
|
|
91
91
|
*/
|
|
92
|
-
custom_metadata_has?: Record<string,
|
|
92
|
+
custom_metadata_has?: Record<string, string | boolean> | undefined;
|
|
93
93
|
/**
|
|
94
94
|
* Customer key for which you want to list devices.
|
|
95
95
|
*/
|
|
@@ -212,7 +212,7 @@ export type DevicesUpdateParameters = {
|
|
|
212
212
|
/**
|
|
213
213
|
* Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter devices by the desired metadata](https://docs.seam.co/core-concepts/devices/filtering-devices-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
214
214
|
*/
|
|
215
|
-
custom_metadata?: Record<string,
|
|
215
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
216
216
|
/**
|
|
217
217
|
* ID of the device that you want to update.
|
|
218
218
|
*/
|
|
@@ -119,7 +119,7 @@ export type DevicesUnmanagedUpdateParameters = {
|
|
|
119
119
|
/**
|
|
120
120
|
* Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to `null` or to an empty string to remove that key from the custom metadata.
|
|
121
121
|
*/
|
|
122
|
-
custom_metadata?: Record<string,
|
|
122
|
+
custom_metadata?: Record<string, string | boolean> | undefined;
|
|
123
123
|
/**
|
|
124
124
|
* ID of the unmanaged device that you want to update.
|
|
125
125
|
*/
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const seamapiJavascriptHttpVersion = "2.
|
|
1
|
+
declare const seamapiJavascriptHttpVersion = "2.12.0";
|
|
2
2
|
export default seamapiJavascriptHttpVersion;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamapi/http",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "JavaScript HTTP client for the Seam API written in TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"axios-retry": "^4.4.2"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@seamapi/blueprint": "^1.
|
|
87
|
+
"@seamapi/blueprint": "^1.7.0",
|
|
88
88
|
"@seamapi/fake-seam-connect": "^2.0.4",
|
|
89
89
|
"@seamapi/smith": "^1.1.0",
|
|
90
90
|
"@seamapi/types": "1.1019.0",
|
package/src/lib/client.ts
CHANGED
|
@@ -20,6 +20,18 @@ export interface ClientOptions {
|
|
|
20
20
|
|
|
21
21
|
type AxiosRetryConfig = Parameters<AxiosRetry>[1]
|
|
22
22
|
|
|
23
|
+
type RequiredAxiosRetryConfig = Required<NonNullable<AxiosRetryConfig>>
|
|
24
|
+
|
|
25
|
+
const defaultAxiosRetryOptions = {
|
|
26
|
+
retries: 2,
|
|
27
|
+
retryCondition: isIdempotentRequestError,
|
|
28
|
+
retryDelay: exponentialDelay,
|
|
29
|
+
shouldResetTimeout: true,
|
|
30
|
+
onRetry: () => undefined,
|
|
31
|
+
onMaxRetryTimesExceeded: () => undefined,
|
|
32
|
+
validateResponse: null,
|
|
33
|
+
} satisfies RequiredAxiosRetryConfig
|
|
34
|
+
|
|
23
35
|
export const createClient = (options: ClientOptions): AxiosInstance => {
|
|
24
36
|
const client = axios.create({
|
|
25
37
|
paramsSerializer: serializeUrlSearchParams,
|
|
@@ -29,9 +41,7 @@ export const createClient = (options: ClientOptions): AxiosInstance => {
|
|
|
29
41
|
})
|
|
30
42
|
|
|
31
43
|
axiosRetry(client, {
|
|
32
|
-
|
|
33
|
-
retryDelay: exponentialDelay,
|
|
34
|
-
retryCondition: isIdempotentRequestError,
|
|
44
|
+
...defaultAxiosRetryOptions,
|
|
35
45
|
...options.axiosRetryOptions,
|
|
36
46
|
})
|
|
37
47
|
|
|
@@ -60,7 +60,7 @@ export type ConnectWebview = {
|
|
|
60
60
|
/**
|
|
61
61
|
* Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted.
|
|
62
62
|
*/
|
|
63
|
-
custom_metadata: Record<string,
|
|
63
|
+
custom_metadata: Record<string, string | boolean>
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* URL to which the Connect Webview should redirect when an unexpected error occurs.
|
|
@@ -40,7 +40,7 @@ export type ConnectedAccount = {
|
|
|
40
40
|
/**
|
|
41
41
|
* Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted.
|
|
42
42
|
*/
|
|
43
|
-
custom_metadata: Record<string,
|
|
43
|
+
custom_metadata: Record<string, string | boolean>
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Your unique key for the customer associated with this connected account.
|
|
@@ -112,7 +112,7 @@ export type Device = {
|
|
|
112
112
|
/**
|
|
113
113
|
* Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted.
|
|
114
114
|
*/
|
|
115
|
-
custom_metadata: Record<string,
|
|
115
|
+
custom_metadata: Record<string, string | boolean>
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* ID of the device.
|