@proveanything/smartlinks 2.2.1 → 3.0.0-alpha.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.
- package/README.md +741 -754
- package/dist/README.md +573 -573
- package/dist/adminCardsView.js +55 -55
- package/dist/api/adminCards.d.ts +8 -0
- package/dist/api/adminCards.js +9 -1
- package/dist/api/ai.d.ts +22 -11
- package/dist/api/ai.js +18 -14
- package/dist/api/analytics.d.ts +13 -0
- package/dist/api/analytics.js +13 -0
- package/dist/api/appConfiguration.d.ts +17 -14
- package/dist/api/appConfiguration.js +14 -12
- package/dist/api/appObjects.d.ts +80 -16
- package/dist/api/appObjects.js +74 -11
- package/dist/api/asset.d.ts +55 -19
- package/dist/api/asset.js +52 -32
- package/dist/api/attestation.d.ts +3 -2
- package/dist/api/attestation.js +1 -1
- package/dist/api/attestations.d.ts +22 -7
- package/dist/api/attestations.js +22 -7
- package/dist/api/authKit.d.ts +22 -5
- package/dist/api/authKit.js +21 -4
- package/dist/api/batch.d.ts +23 -16
- package/dist/api/batch.js +19 -13
- package/dist/api/bookings.d.ts +45 -9
- package/dist/api/bookings.js +39 -3
- package/dist/api/broadcasts.d.ts +26 -6
- package/dist/api/broadcasts.js +22 -2
- package/dist/api/claimSet.d.ts +48 -13
- package/dist/api/claimSet.js +43 -7
- package/dist/api/collection.d.ts +20 -6
- package/dist/api/collection.js +19 -8
- package/dist/api/comms.d.ts +43 -12
- package/dist/api/comms.js +43 -13
- package/dist/api/conditions.d.ts +12 -2
- package/dist/api/conditions.js +10 -1
- package/dist/api/config.d.ts +15 -2
- package/dist/api/config.js +12 -0
- package/dist/api/contact.d.ts +34 -13
- package/dist/api/contact.js +35 -10
- package/dist/api/containers.d.ts +41 -23
- package/dist/api/containers.js +37 -21
- package/dist/api/crate.d.ts +9 -8
- package/dist/api/crate.js +8 -8
- package/dist/api/dpp.d.ts +58 -10
- package/dist/api/dpp.js +57 -15
- package/dist/api/facets.d.ts +71 -0
- package/dist/api/facets.js +71 -0
- package/dist/api/files.d.ts +11 -5
- package/dist/api/files.js +9 -1
- package/dist/api/form.d.ts +9 -2
- package/dist/api/form.js +7 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +0 -1
- package/dist/api/integrations.d.ts +82 -27
- package/dist/api/integrations.js +63 -7
- package/dist/api/interactions.d.ts +42 -6
- package/dist/api/interactions.js +41 -5
- package/dist/api/jobs.d.ts +9 -2
- package/dist/api/jobs.js +6 -0
- package/dist/api/journeys.d.ts +13 -2
- package/dist/api/journeys.js +10 -1
- package/dist/api/journeysAnalytics.d.ts +12 -3
- package/dist/api/journeysAnalytics.js +9 -1
- package/dist/api/knowledge.d.ts +43 -10
- package/dist/api/knowledge.js +37 -5
- package/dist/api/location.d.ts +10 -3
- package/dist/api/location.js +7 -1
- package/dist/api/lots.d.ts +40 -13
- package/dist/api/lots.js +38 -8
- package/dist/api/loyalty.d.ts +70 -12
- package/dist/api/loyalty.js +60 -3
- package/dist/api/nfc.d.ts +8 -2
- package/dist/api/nfc.js +6 -1
- package/dist/api/order.d.ts +51 -160
- package/dist/api/order.js +46 -208
- package/dist/api/partner.d.ts +41 -8
- package/dist/api/partner.js +36 -4
- package/dist/api/products.d.ts +41 -8
- package/dist/api/products.js +33 -4
- package/dist/api/proof.d.ts +50 -13
- package/dist/api/proof.js +43 -7
- package/dist/api/realtime.d.ts +1 -11
- package/dist/api/realtime.js +1 -22
- package/dist/api/secrets.d.ts +25 -5
- package/dist/api/secrets.js +21 -2
- package/dist/api/segments.d.ts +26 -6
- package/dist/api/segments.js +22 -2
- package/dist/api/serviceAccounts.d.ts +8 -1
- package/dist/api/serviceAccounts.js +8 -1
- package/dist/api/shop.d.ts +41 -13
- package/dist/api/shop.js +35 -4
- package/dist/api/subscriptions.d.ts +47 -12
- package/dist/api/subscriptions.js +40 -4
- package/dist/api/tags.d.ts +40 -19
- package/dist/api/tags.js +38 -18
- package/dist/api/template.d.ts +31 -3
- package/dist/api/template.js +27 -0
- package/dist/api/translations.d.ts +17 -2
- package/dist/api/translations.js +14 -0
- package/dist/api/userGroups.d.ts +35 -9
- package/dist/api/userGroups.js +30 -5
- package/dist/api/variant.d.ts +11 -3
- package/dist/api/variant.js +9 -2
- package/dist/api/wallet.d.ts +23 -10
- package/dist/api/wallet.js +20 -2
- package/dist/apiVersion.d.ts +1 -1
- package/dist/apiVersion.js +1 -1
- package/dist/baseline.css +194 -194
- package/dist/docs/API_SUMMARY.md +1389 -2298
- package/dist/docs/PRODUCT_FACETS_SDK.md +10 -15
- package/dist/docs/admin-cards.md +189 -189
- package/dist/docs/admin-lists-and-pickers.md +1 -1
- package/dist/docs/agent-tools.md +156 -156
- package/dist/docs/ai-tools-and-skills.md +180 -180
- package/dist/docs/ai.md +1721 -1721
- package/dist/docs/analytics.md +3 -2
- package/dist/docs/api-versions.md +85 -76
- package/dist/docs/app-data-storage.md +277 -277
- package/dist/docs/app-docs.md +73 -73
- package/dist/docs/app-manifest.md +852 -852
- package/dist/docs/app-objects.md +38 -50
- package/dist/docs/app-records-pattern.md +388 -388
- package/dist/docs/appConfig.md +550 -550
- package/dist/docs/assets.md +17 -3
- package/dist/docs/assistant-apps.md +172 -172
- package/dist/docs/assistant-context.md +119 -119
- package/dist/docs/attestations.md +5 -4
- package/dist/docs/auth-kit.md +1 -1
- package/dist/docs/bookings.md +442 -442
- package/dist/docs/comms.md +689 -686
- package/dist/docs/connectors.md +340 -340
- package/dist/docs/contact-search.md +4 -3
- package/dist/docs/container-tracking.md +7 -7
- package/dist/docs/css-baseline.md +133 -133
- package/dist/docs/customer-guide.md +70 -70
- package/dist/docs/deploying-apps.md +340 -340
- package/dist/docs/dpp.md +115 -115
- package/dist/docs/entitlements.md +90 -90
- package/dist/docs/executor.md +1 -1
- package/dist/docs/files.md +69 -69
- package/dist/docs/forms.md +1 -1
- package/dist/docs/headless-providers.md +3 -3
- package/dist/docs/host-dependency-contract.md +252 -210
- package/dist/docs/integrations.md +322 -322
- package/dist/docs/interactions.md +544 -545
- package/dist/docs/item-context.md +181 -181
- package/dist/docs/knowledge.md +105 -102
- package/dist/docs/lists.md +114 -0
- package/dist/docs/lots.md +112 -111
- package/dist/docs/loyalty.md +348 -352
- package/dist/docs/members.md +183 -183
- package/dist/docs/memberships.md +150 -149
- package/dist/docs/mobile-admin-container.md +693 -693
- package/dist/docs/operations.md +281 -281
- package/dist/docs/overview.md +485 -485
- package/dist/docs/proof-claiming-methods.md +6 -6
- package/dist/docs/proof-comms-triggers.md +142 -142
- package/dist/docs/proof-ownership-transfer.md +155 -155
- package/dist/docs/proof-product-data-scoping.md +462 -462
- package/dist/docs/proof-share-grants.md +305 -305
- package/dist/docs/realtime.md +139 -138
- package/dist/docs/records-admin-pattern.md +304 -304
- package/dist/docs/server-functions.md +2 -2
- package/dist/docs/service-accounts.md +64 -64
- package/dist/docs/shop.md +4 -2
- package/dist/docs/site-seo.md +2 -1
- package/dist/docs/standard-query.md +187 -187
- package/dist/docs/tag-codes.md +97 -97
- package/dist/docs/tag-ranges.md +106 -106
- package/dist/docs/theme-tokens.md +252 -252
- package/dist/docs/translations.md +6 -1
- package/dist/docs/upgrading-to-3.md +430 -0
- package/dist/docs/user-groups.md +4 -4
- package/dist/docs/utils.md +1 -1
- package/dist/docs/wallet-passes.md +107 -107
- package/dist/docs/websites.md +123 -123
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +2 -2
- package/dist/http.d.ts +15 -2
- package/dist/http.js +60 -2
- package/dist/index.d.ts +7 -8
- package/dist/index.js +2 -0
- package/dist/list.d.ts +24 -0
- package/dist/list.js +80 -0
- package/dist/mobile-admin/types.d.ts +0 -16
- package/dist/openapi.yaml +290 -2723
- package/dist/shared-dependencies.d.ts +3 -3
- package/dist/shared-dependencies.js +13 -5
- package/dist/site.d.ts +1 -7
- package/dist/site.js +1 -14
- package/dist/theme-boot.js +82 -82
- package/dist/theme.css +75 -75
- package/dist/types/adminCards.d.ts +6 -3
- package/dist/types/ai.d.ts +0 -6
- package/dist/types/analytics.d.ts +5 -8
- package/dist/types/appManifest.d.ts +4 -5
- package/dist/types/appObjects.d.ts +14 -18
- package/dist/types/appObjects.js +0 -1
- package/dist/types/appOptions.d.ts +18 -0
- package/dist/types/asset.d.ts +3 -22
- package/dist/types/attestations.d.ts +7 -10
- package/dist/types/batch.d.ts +6 -14
- package/dist/types/bookings.d.ts +22 -4
- package/dist/types/broadcasts.d.ts +5 -13
- package/dist/types/broadcasts.js +0 -1
- package/dist/types/claimSet.d.ts +0 -5
- package/dist/types/comms.d.ts +11 -9
- package/dist/types/contact.d.ts +5 -29
- package/dist/types/contact.js +0 -13
- package/dist/types/containers.d.ts +15 -26
- package/dist/types/crate.d.ts +4 -12
- package/dist/types/dpp.d.ts +3 -3
- package/dist/types/dpp.js +0 -1
- package/dist/types/error.d.ts +8 -5
- package/dist/types/error.js +12 -5
- package/dist/types/facets.d.ts +15 -15
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/integrations.d.ts +3 -28
- package/dist/types/interaction.d.ts +3 -9
- package/dist/types/jobs.d.ts +3 -8
- package/dist/types/jobs.js +0 -1
- package/dist/types/journeys.d.ts +3 -8
- package/dist/types/journeys.js +0 -1
- package/dist/types/journeysAnalytics.d.ts +0 -1
- package/dist/types/list.d.ts +24 -0
- package/dist/types/list.js +2 -0
- package/dist/types/location.d.ts +0 -4
- package/dist/types/lots.d.ts +0 -9
- package/dist/types/loyalty.d.ts +0 -9
- package/dist/types/order.d.ts +7 -134
- package/dist/types/product.d.ts +11 -24
- package/dist/types/proof.d.ts +16 -0
- package/dist/types/realtime.d.ts +0 -29
- package/dist/types/segments.d.ts +5 -13
- package/dist/types/segments.js +0 -1
- package/dist/types/serviceAccounts.d.ts +3 -2
- package/dist/types/serviceAccounts.js +0 -1
- package/dist/types/shop.d.ts +5 -12
- package/dist/types/shop.js +0 -4
- package/dist/types/subscriptions.d.ts +18 -0
- package/dist/types/subscriptions.js +0 -8
- package/dist/types/tags.d.ts +6 -16
- package/dist/types/tags.js +0 -7
- package/dist/types/translations.d.ts +3 -9
- package/dist/types/variant.d.ts +0 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/API_SUMMARY.md +1389 -2298
- package/docs/PRODUCT_FACETS_SDK.md +10 -15
- package/docs/admin-cards.md +189 -189
- package/docs/admin-lists-and-pickers.md +1 -1
- package/docs/agent-tools.md +156 -156
- package/docs/ai-tools-and-skills.md +180 -180
- package/docs/ai.md +1721 -1721
- package/docs/analytics.md +3 -2
- package/docs/api-versions.md +85 -76
- package/docs/app-data-storage.md +277 -277
- package/docs/app-docs.md +73 -73
- package/docs/app-manifest.md +852 -852
- package/docs/app-objects.md +38 -50
- package/docs/app-records-pattern.md +388 -388
- package/docs/appConfig.md +550 -550
- package/docs/assets.md +17 -3
- package/docs/assistant-apps.md +172 -172
- package/docs/assistant-context.md +119 -119
- package/docs/attestations.md +5 -4
- package/docs/auth-kit.md +1 -1
- package/docs/bookings.md +442 -442
- package/docs/comms.md +689 -686
- package/docs/connectors.md +340 -340
- package/docs/contact-search.md +4 -3
- package/docs/container-tracking.md +7 -7
- package/docs/css-baseline.md +133 -133
- package/docs/customer-guide.md +70 -70
- package/docs/deploying-apps.md +340 -340
- package/docs/dpp.md +115 -115
- package/docs/entitlements.md +90 -90
- package/docs/executor.md +1 -1
- package/docs/files.md +69 -69
- package/docs/forms.md +1 -1
- package/docs/headless-providers.md +3 -3
- package/docs/host-dependency-contract.md +252 -210
- package/docs/integrations.md +322 -322
- package/docs/interactions.md +544 -545
- package/docs/item-context.md +181 -181
- package/docs/knowledge.md +105 -102
- package/docs/lists.md +114 -0
- package/docs/lots.md +112 -111
- package/docs/loyalty.md +348 -352
- package/docs/members.md +183 -183
- package/docs/memberships.md +150 -149
- package/docs/mobile-admin-container.md +693 -693
- package/docs/operations.md +281 -281
- package/docs/overview.md +485 -485
- package/docs/proof-claiming-methods.md +6 -6
- package/docs/proof-comms-triggers.md +142 -142
- package/docs/proof-ownership-transfer.md +155 -155
- package/docs/proof-product-data-scoping.md +462 -462
- package/docs/proof-share-grants.md +305 -305
- package/docs/realtime.md +139 -138
- package/docs/server-functions.md +2 -2
- package/docs/service-accounts.md +64 -64
- package/docs/shop.md +4 -2
- package/docs/site-seo.md +2 -1
- package/docs/standard-query.md +187 -187
- package/docs/tag-codes.md +97 -97
- package/docs/tag-ranges.md +106 -106
- package/docs/theme-lookbook.v1.json +120 -120
- package/docs/theme-tokens.md +252 -252
- package/docs/translations.md +6 -1
- package/docs/upgrading-to-3.md +430 -0
- package/docs/user-groups.md +4 -4
- package/docs/utils.md +1 -1
- package/docs/wallet-passes.md +107 -107
- package/docs/websites.md +123 -123
- package/openapi.yaml +290 -2723
- package/package.json +8 -4
- package/scripts/headless-check.mjs +87 -87
- package/scripts/lib/bare-imports.mjs +57 -57
- package/scripts/lib/keyed-app-data.mjs +21 -21
- package/scripts/lib/upgrade.mjs +512 -0
- package/scripts/publish.mjs +272 -272
- package/scripts/register-release.mjs +91 -91
- package/scripts/upgrade.mjs +56 -0
- package/upgrade/3.json +2213 -0
package/dist/types/asset.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListOptions } from './list.js';
|
|
1
2
|
/**
|
|
2
3
|
* Slim reference to an asset embedded inside product and collection documents.
|
|
3
4
|
* Use `asset.get()` with the `id` to retrieve the full `Asset` record.
|
|
@@ -114,15 +115,6 @@ export interface Asset {
|
|
|
114
115
|
createdAt: string;
|
|
115
116
|
updatedAt: string;
|
|
116
117
|
deletedAt: string | null;
|
|
117
|
-
/**
|
|
118
|
-
* @deprecated Use `thumbnail` instead. Legacy multi-size thumbnail map.
|
|
119
|
-
*/
|
|
120
|
-
thumbnails?: {
|
|
121
|
-
x100?: string;
|
|
122
|
-
x200?: string;
|
|
123
|
-
x512?: string;
|
|
124
|
-
[key: string]: string | undefined;
|
|
125
|
-
};
|
|
126
118
|
}
|
|
127
119
|
export type AssetResponse = Asset;
|
|
128
120
|
export interface UploadAssetOptions {
|
|
@@ -201,11 +193,8 @@ export interface ListAssetsOptions {
|
|
|
201
193
|
};
|
|
202
194
|
/** Filter by app ID */
|
|
203
195
|
appId?: string;
|
|
204
|
-
/**
|
|
205
|
-
mimeTypePrefix?: string;
|
|
206
|
-
/** Pagination */
|
|
196
|
+
/** How many to return. These lists are not paged: there is no cursor, and `nextCursor` is always `null`. */
|
|
207
197
|
limit?: number;
|
|
208
|
-
offset?: number;
|
|
209
198
|
}
|
|
210
199
|
export interface GetAssetOptions {
|
|
211
200
|
assetId: string;
|
|
@@ -239,7 +228,7 @@ export interface RemoveAssetOptions {
|
|
|
239
228
|
proofId: string;
|
|
240
229
|
};
|
|
241
230
|
}
|
|
242
|
-
export interface AdminListAssetsOptions {
|
|
231
|
+
export interface AdminListAssetsOptions extends ListOptions {
|
|
243
232
|
collectionId: string;
|
|
244
233
|
productId?: string;
|
|
245
234
|
proofId?: string;
|
|
@@ -249,20 +238,12 @@ export interface AdminListAssetsOptions {
|
|
|
249
238
|
labels?: string;
|
|
250
239
|
sort?: 'createdAt' | 'name' | 'size' | 'assetType';
|
|
251
240
|
order?: 'asc' | 'desc';
|
|
252
|
-
limit?: number;
|
|
253
|
-
offset?: number;
|
|
254
241
|
/**
|
|
255
242
|
* Also list files that are normally left out: `temporary` (not kept yet) and `derived` (text, Markdown or fields
|
|
256
243
|
* extracted from another file). Lists show only what people put there unless asked.
|
|
257
244
|
*/
|
|
258
245
|
include?: Array<'temporary' | 'derived'>;
|
|
259
246
|
}
|
|
260
|
-
export interface AdminListAssetsResponse {
|
|
261
|
-
data: Asset[];
|
|
262
|
-
total: number;
|
|
263
|
-
limit: number;
|
|
264
|
-
offset: number;
|
|
265
|
-
}
|
|
266
247
|
export interface UpdateAssetOptions {
|
|
267
248
|
collectionId: string;
|
|
268
249
|
assetId: string;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @see docs/attestations.md
|
|
10
10
|
*/
|
|
11
|
+
import type { ListResult, ListOptions } from './list.js';
|
|
11
12
|
/** Types of entities that can be the subject of an attestation. */
|
|
12
13
|
export type AttestationSubjectType = 'container' | 'proof' | 'product' | 'tag' | 'serial' | 'order_item' | string;
|
|
13
14
|
/**
|
|
@@ -188,14 +189,13 @@ export interface ModerateAttestationInput {
|
|
|
188
189
|
export interface ModerateAttestationResponse {
|
|
189
190
|
attestation: Attestation;
|
|
190
191
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
192
|
+
/** What `attestations.list` returns: `{ items, nextCursor }`. */
|
|
193
|
+
export type ListAttestationsResponse = ListResult<Attestation>;
|
|
194
194
|
export interface CreateOwnerAttestationResponse {
|
|
195
195
|
attestation: Attestation;
|
|
196
196
|
}
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
/** What `attestations.publicList` and `publicContainerList` return: `{ items, nextCursor, audience }`. */
|
|
198
|
+
export interface PublicListAttestationsResponse extends ListResult<Attestation> {
|
|
199
199
|
/** Resolved audience tier; governs which data zones are populated */
|
|
200
200
|
audience: AttestationAudience;
|
|
201
201
|
}
|
|
@@ -232,7 +232,8 @@ export interface PublicAttestationTreeLatestResponse {
|
|
|
232
232
|
audience: 'public';
|
|
233
233
|
subjectCount: number;
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
/** Paging is `limit` (default 100) and `cursor`: pass the previous page's `nextCursor`. */
|
|
236
|
+
export interface ListAttestationsParams extends ListOptions {
|
|
236
237
|
/** Required */
|
|
237
238
|
subjectType: AttestationSubjectType;
|
|
238
239
|
/** Required */
|
|
@@ -248,10 +249,6 @@ export interface ListAttestationsParams {
|
|
|
248
249
|
recordedAfter?: string;
|
|
249
250
|
/** ISO 8601 upper bound (inclusive) */
|
|
250
251
|
recordedBefore?: string;
|
|
251
|
-
/** Default 100 */
|
|
252
|
-
limit?: number;
|
|
253
|
-
/** Default 0 */
|
|
254
|
-
offset?: number;
|
|
255
252
|
}
|
|
256
253
|
export interface AttestationSummaryParams {
|
|
257
254
|
/** Required */
|
package/dist/types/batch.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Batches moved to Postgres — dates now come back as ISO 8601 strings, never
|
|
3
|
-
* Firestore Timestamp objects. Kept only so request bodies can still pass a legacy value.
|
|
4
|
-
*/
|
|
5
|
-
export interface FirebaseTimestamp {
|
|
6
|
-
seconds: number;
|
|
7
|
-
nanoseconds?: number;
|
|
8
|
-
}
|
|
9
1
|
/**
|
|
10
2
|
* Represents a Batch object. Dates are **ISO 8601 strings**.
|
|
11
3
|
*/
|
|
@@ -29,11 +21,9 @@ export interface BatchResponse {
|
|
|
29
21
|
* Request payload for creating a new batch.
|
|
30
22
|
*/
|
|
31
23
|
export interface BatchCreateRequest {
|
|
32
|
-
/** @deprecated Ignored — the server generates the batch id. */
|
|
33
|
-
id?: string;
|
|
34
24
|
name?: string;
|
|
35
|
-
/** A `Date
|
|
36
|
-
expiryDate?:
|
|
25
|
+
/** A `Date` or an ISO 8601 string. */
|
|
26
|
+
expiryDate?: string | Date;
|
|
37
27
|
[key: string]: any;
|
|
38
28
|
}
|
|
39
29
|
/**
|
|
@@ -41,11 +31,13 @@ export interface BatchCreateRequest {
|
|
|
41
31
|
*/
|
|
42
32
|
export interface BatchUpdateRequest {
|
|
43
33
|
name?: string;
|
|
44
|
-
|
|
34
|
+
/** A `Date` or an ISO 8601 string. */
|
|
35
|
+
expiryDate?: string | Date;
|
|
45
36
|
[key: string]: any;
|
|
46
37
|
}
|
|
47
38
|
/**
|
|
48
|
-
*
|
|
39
|
+
* Options for `batch.searchInCollection`. The search answers in one page (it has no cursor):
|
|
40
|
+
* `limit` is the most it returns.
|
|
49
41
|
*/
|
|
50
42
|
export interface SearchBatchesRequest {
|
|
51
43
|
search?: string;
|
package/dist/types/bookings.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ListResult, ListOptions } from './list.js';
|
|
2
2
|
export type BookingStatus = 'held' | 'pending' | 'confirmed' | 'completed' | 'cancelled' | 'no_show' | 'waitlisted';
|
|
3
3
|
export type BookingVisibility = 'public' | 'owner' | 'admin';
|
|
4
4
|
/** A claim on a resource's time: seats on a slot (`capacity`) or exclusive time (`exclusive`). */
|
|
@@ -169,6 +169,10 @@ export interface MoveBookingInput {
|
|
|
169
169
|
bufferBefore?: number;
|
|
170
170
|
bufferAfter?: number;
|
|
171
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* The filters and paging of `ctx.sl.bookings.query` / `mine` in a server function (which pages with
|
|
174
|
+
* `limit` + `offset`). The SDK's `bookings.list` / `bookings.mine` take {@link BookingListOptions}.
|
|
175
|
+
*/
|
|
172
176
|
export interface BookingListQueryParams {
|
|
173
177
|
status?: string;
|
|
174
178
|
contactId?: string;
|
|
@@ -188,6 +192,9 @@ export interface BookingListQueryParams {
|
|
|
188
192
|
limit?: number;
|
|
189
193
|
offset?: number;
|
|
190
194
|
}
|
|
195
|
+
/** `bookings.list` / `bookings.mine` options: the filters, plus `limit` and `cursor`. */
|
|
196
|
+
export interface BookingListOptions extends Omit<BookingListQueryParams, 'offset'>, ListOptions {
|
|
197
|
+
}
|
|
191
198
|
export interface CreateSlotInput {
|
|
192
199
|
startsAt: string | Date;
|
|
193
200
|
endsAt: string | Date;
|
|
@@ -211,6 +218,7 @@ export interface CreateSlotInput {
|
|
|
211
218
|
admin?: Record<string, any>;
|
|
212
219
|
}
|
|
213
220
|
export type UpdateSlotInput = Partial<Omit<CreateSlotInput, 'blockResource' | 'seriesId' | 'resourceType' | 'resourceId'>>;
|
|
221
|
+
/** `ctx.sl.bookings.slots.query` in a server function (`limit` + `offset`). The SDK's `bookings.slots.list` takes {@link SlotListOptions}. */
|
|
214
222
|
export interface SlotListQueryParams {
|
|
215
223
|
status?: string;
|
|
216
224
|
/** Only slots with places left. */
|
|
@@ -227,6 +235,9 @@ export interface SlotListQueryParams {
|
|
|
227
235
|
limit?: number;
|
|
228
236
|
offset?: number;
|
|
229
237
|
}
|
|
238
|
+
/** `bookings.slots.list` options: the filters, plus `limit` and `cursor`. */
|
|
239
|
+
export interface SlotListOptions extends Omit<SlotListQueryParams, 'offset'>, ListOptions {
|
|
240
|
+
}
|
|
230
241
|
export interface CreateBlockInput {
|
|
231
242
|
resourceType: string;
|
|
232
243
|
resourceId: string;
|
|
@@ -235,6 +246,7 @@ export interface CreateBlockInput {
|
|
|
235
246
|
sourceSystem?: string;
|
|
236
247
|
data?: Record<string, any>;
|
|
237
248
|
}
|
|
249
|
+
/** `ctx.sl.bookings.blocks.query` in a server function (`limit` + `offset`). The SDK's `bookings.blocks.list` takes {@link BlockListOptions}. */
|
|
238
250
|
export interface BlockListQueryParams {
|
|
239
251
|
resourceType?: string;
|
|
240
252
|
resourceId?: string;
|
|
@@ -243,6 +255,9 @@ export interface BlockListQueryParams {
|
|
|
243
255
|
limit?: number;
|
|
244
256
|
offset?: number;
|
|
245
257
|
}
|
|
258
|
+
/** `bookings.blocks.list` options: the filters, plus `limit` and `cursor`. */
|
|
259
|
+
export interface BlockListOptions extends Omit<BlockListQueryParams, 'offset'>, ListOptions {
|
|
260
|
+
}
|
|
246
261
|
/** A resource reference: `{ type, id }` or the string form `'record:staff-1'`. */
|
|
247
262
|
export type BookingResourceRef = {
|
|
248
263
|
type: string;
|
|
@@ -303,9 +318,12 @@ export interface MessageBookersResult {
|
|
|
303
318
|
export interface BookingAccessOptions {
|
|
304
319
|
editToken?: string;
|
|
305
320
|
}
|
|
306
|
-
|
|
307
|
-
export type
|
|
308
|
-
|
|
321
|
+
/** What `bookings.list` / `bookings.mine` return: a page of bookings, `nextCursor`, and `count` (how many in all). */
|
|
322
|
+
export type BookingList = ListResult<Booking>;
|
|
323
|
+
/** What `bookings.slots.list` returns. */
|
|
324
|
+
export type SlotList = ListResult<BookingSlot>;
|
|
325
|
+
/** What `bookings.blocks.list` returns. */
|
|
326
|
+
export type BlockList = ListResult<BookingAllocation>;
|
|
309
327
|
/** Error codes a booking call can fail with (HTTP 409 unless noted). */
|
|
310
328
|
export type BookingErrorCode = 'SLOT_FULL' | 'SLOT_CLOSED' | 'RESOURCE_TAKEN' | 'PER_CONTACT_LIMIT' | 'QUANTITY_LIMIT' | 'HOLD_EXPIRED' | 'INVALID_STATE' | 'SLOT_OVERBOOKED' | 'SLOT_HAS_BOOKINGS' | 'TOO_SOON' | 'TOO_FAR_AHEAD' | 'IN_THE_PAST' | 'DURATION_NOT_ALLOWED' | 'OUTSIDE_SCHEDULE' | 'NO_SCHEDULE' | 'SCHEDULE_INVALID' | 'CUTOFF_PASSED' | 'FORBIDDEN' | 'NOT_FOUND' | 'BAD_REQUEST';
|
|
311
329
|
export interface ScheduleHours {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ListResult, ListOptions } from './list.js';
|
|
2
|
+
/** `broadcasts.list` options: the app that owns them, plus `limit` and `cursor`. */
|
|
3
|
+
export interface ListBroadcastsQuery extends ListOptions {
|
|
4
4
|
appId?: string;
|
|
5
5
|
}
|
|
6
6
|
/** Broadcast channels. Wallet is not one: wallet passes are messaged one-to-one (`comms.send` with `channel: 'wallet'`). */
|
|
@@ -43,16 +43,8 @@ export interface BroadcastRecord {
|
|
|
43
43
|
};
|
|
44
44
|
createdAt: string;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
limit: number;
|
|
49
|
-
offset: number;
|
|
50
|
-
}
|
|
51
|
-
export interface BroadcastRecipientsResponse {
|
|
52
|
-
items: import('./comms.js').Recipient[];
|
|
53
|
-
total: number;
|
|
54
|
-
limit: number;
|
|
55
|
-
offset: number;
|
|
46
|
+
/** What `broadcasts.recipients` returns: a page of contacts (`count` = how many in all), and sometimes a note. */
|
|
47
|
+
export interface BroadcastRecipientsResponse extends ListResult<import('./comms.js').Recipient> {
|
|
56
48
|
note?: string;
|
|
57
49
|
}
|
|
58
50
|
export interface BroadcastPreviewRequest {
|
package/dist/types/broadcasts.js
CHANGED
package/dist/types/claimSet.d.ts
CHANGED
|
@@ -214,11 +214,6 @@ export interface ClaimSetRangeTag {
|
|
|
214
214
|
programmedAt: string | null;
|
|
215
215
|
scans: number;
|
|
216
216
|
}
|
|
217
|
-
export interface ClaimSetRangeTagsPage {
|
|
218
|
-
tags: ClaimSetRangeTag[];
|
|
219
|
-
/** The index to pass as `from` for the next page, or null */
|
|
220
|
-
next: number | null;
|
|
221
|
-
}
|
|
222
217
|
/** The next tag to program on a phone, with what to write. */
|
|
223
218
|
export interface ClaimSetRangeNextTag extends ClaimSetRangeTag {
|
|
224
219
|
url: string;
|
package/dist/types/comms.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IdField } from './common.js';
|
|
2
2
|
import type { BroadcastChannel } from './broadcasts.js';
|
|
3
|
+
import type { ListResult } from './list.js';
|
|
3
4
|
/**
|
|
4
5
|
* Target subject for notifications (product, collection, etc.)
|
|
5
6
|
*/
|
|
@@ -37,26 +38,29 @@ export interface RecipientWithOutcome {
|
|
|
37
38
|
export interface CommsRecipientIdsQuery {
|
|
38
39
|
broadcastId?: string;
|
|
39
40
|
journeyId?: string;
|
|
40
|
-
journeyStepId?: string;
|
|
41
41
|
idField?: IdField;
|
|
42
42
|
from?: string;
|
|
43
43
|
to?: string;
|
|
44
44
|
limit?: number;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/** Who a broadcast or journey reached that did NOT then do an interaction. */
|
|
47
|
+
export interface CommsRecipientsWithoutInteractionQuery {
|
|
47
48
|
broadcastId?: string;
|
|
48
49
|
journeyId?: string;
|
|
49
|
-
|
|
50
|
+
/** The interaction to look for (its id). */
|
|
51
|
+
interactionId?: string;
|
|
50
52
|
appId?: string;
|
|
51
53
|
idField?: IdField;
|
|
52
54
|
from?: string;
|
|
53
55
|
to?: string;
|
|
54
56
|
limit?: number;
|
|
55
57
|
}
|
|
56
|
-
|
|
58
|
+
/** Who a broadcast or journey reached that then did an interaction. */
|
|
59
|
+
export interface CommsRecipientsWithInteractionQuery {
|
|
57
60
|
broadcastId?: string;
|
|
58
61
|
journeyId?: string;
|
|
59
|
-
|
|
62
|
+
/** The interaction to look for (its id). */
|
|
63
|
+
interactionId?: string;
|
|
60
64
|
appId?: string;
|
|
61
65
|
outcome?: string;
|
|
62
66
|
idField?: IdField;
|
|
@@ -266,10 +270,8 @@ export interface CommsListMethodsQuery {
|
|
|
266
270
|
contactId?: string;
|
|
267
271
|
type?: BroadcastChannel;
|
|
268
272
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
methods: import('./contact.js').CommMethod[];
|
|
272
|
-
}
|
|
273
|
+
/** What `comms.listMethods` returns: the contact's registered methods in `items` (all of them; `nextCursor` is always null). */
|
|
274
|
+
export type CommsListMethodsResponse = ListResult<import('./contact.js').CommMethod>;
|
|
273
275
|
export interface RegisterEmailMethodRequest {
|
|
274
276
|
contactId?: string;
|
|
275
277
|
email?: string;
|
package/dist/types/contact.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListResult, ListOptions } from "./list.js";
|
|
1
2
|
export type ContactCustomFields = Record<string, any>;
|
|
2
3
|
export interface Contact {
|
|
3
4
|
contactId: string;
|
|
@@ -29,11 +30,6 @@ export interface Contact {
|
|
|
29
30
|
export type ContactResponse = Contact;
|
|
30
31
|
export type ContactCreateRequest = Omit<Contact, "contactId" | "orgId" | "createdAt" | "updatedAt" | "deletedAt" | "erasedAt">;
|
|
31
32
|
export type ContactUpdateRequest = Partial<ContactCreateRequest>;
|
|
32
|
-
export interface ContactListResponse {
|
|
33
|
-
items: Contact[];
|
|
34
|
-
limit: number;
|
|
35
|
-
offset: number;
|
|
36
|
-
}
|
|
37
33
|
/**
|
|
38
34
|
* Two contacts that look like one person (`contact.findDuplicates`): `keep` has a sign-in but no email
|
|
39
35
|
* (or phone); `merge` has no sign-in and holds that sign-in's verified email (or phone).
|
|
@@ -46,12 +42,10 @@ export interface ContactDuplicatePair {
|
|
|
46
42
|
/** What ties them together. */
|
|
47
43
|
matchedOn: "email" | "phone";
|
|
48
44
|
}
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
/** What `contact.findDuplicates` returns: the pairs found in this call (`items`), and how far it looked. */
|
|
46
|
+
export interface ContactDuplicatesResponse extends ListResult<ContactDuplicatePair> {
|
|
51
47
|
/** How many contacts with a sign-in were checked in this call. */
|
|
52
48
|
scanned: number;
|
|
53
|
-
/** More contacts remain beyond this window: call again with `offset` + `scanned`. */
|
|
54
|
-
more: boolean;
|
|
55
49
|
}
|
|
56
50
|
/** What `contact.merge` did. */
|
|
57
51
|
export interface ContactMergeResponse {
|
|
@@ -89,7 +83,8 @@ export interface ContactLinkLoginResponse {
|
|
|
89
83
|
}
|
|
90
84
|
/** `error` codes `contact.merge` can refuse with. */
|
|
91
85
|
export type ContactMergeErrorCode = "INVALID_CONTACT" | "SAME_CONTACT" | "NOT_FOUND" | "KEEP_DELETED" | "LOGIN_CONFLICT" | "LOYALTY_CONFLICT";
|
|
92
|
-
|
|
86
|
+
/** `contact.search` options: the collection, the filters, plus `limit` and `cursor`. */
|
|
87
|
+
export interface ContactSearchParams extends ListOptions {
|
|
93
88
|
collectionId: string;
|
|
94
89
|
q?: string;
|
|
95
90
|
typeahead?: boolean;
|
|
@@ -107,13 +102,6 @@ export interface ContactSearchParams {
|
|
|
107
102
|
externalIdValue?: string;
|
|
108
103
|
customFieldKey?: string;
|
|
109
104
|
customFieldValue?: string;
|
|
110
|
-
limit?: number;
|
|
111
|
-
offset?: number;
|
|
112
|
-
}
|
|
113
|
-
export interface ContactSearchResponse {
|
|
114
|
-
items: Contact[];
|
|
115
|
-
limit: number;
|
|
116
|
-
offset: number;
|
|
117
105
|
}
|
|
118
106
|
export type PublicContactUpsertRequest = Partial<Pick<Contact, "email" | "phone" | "userId" | "firstName" | "lastName" | "displayName" | "company" | "tags" | "source" | "notes" | "avatarUrl" | "locale" | "timezone" | "externalIds">> & {
|
|
119
107
|
customFields?: ContactCustomFields;
|
|
@@ -309,8 +297,6 @@ export interface ContactSchemaResponse {
|
|
|
309
297
|
/** Pass-through of the collection's SchemaFormConfig styling block */
|
|
310
298
|
styling: Record<string, unknown>;
|
|
311
299
|
}
|
|
312
|
-
/** @deprecated Use ContactSchemaResponse instead */
|
|
313
|
-
export type ContactSchema = ContactSchemaResponse;
|
|
314
300
|
/**
|
|
315
301
|
* Evaluate whether a field's conditions are satisfied given the current form values.
|
|
316
302
|
* Returns `true` if the field should be visible.
|
|
@@ -326,13 +312,3 @@ export type ContactSchema = ContactSchemaResponse;
|
|
|
326
312
|
* ```
|
|
327
313
|
*/
|
|
328
314
|
export declare function evaluateConditions(conditions: FieldCondition[] | undefined, showWhen: 'all' | 'any' | undefined, fieldValues: Record<string, unknown>): boolean;
|
|
329
|
-
/**
|
|
330
|
-
* @deprecated Use evaluateConditions (plural) instead.
|
|
331
|
-
* Shim for code using the old single-condition API.
|
|
332
|
-
*/
|
|
333
|
-
export declare function evaluateCondition(condition: {
|
|
334
|
-
dependsOn?: string;
|
|
335
|
-
targetFieldId?: string;
|
|
336
|
-
operator: string;
|
|
337
|
-
value?: unknown;
|
|
338
|
-
} | undefined, fieldValues: Record<string, unknown>): boolean;
|
package/dist/types/contact.js
CHANGED
|
@@ -54,16 +54,3 @@ export function evaluateConditions(conditions, showWhen, fieldValues) {
|
|
|
54
54
|
? results.some(Boolean)
|
|
55
55
|
: results.every(Boolean);
|
|
56
56
|
}
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated Use evaluateConditions (plural) instead.
|
|
59
|
-
* Shim for code using the old single-condition API.
|
|
60
|
-
*/
|
|
61
|
-
export function evaluateCondition(condition, fieldValues) {
|
|
62
|
-
var _a;
|
|
63
|
-
if (!condition)
|
|
64
|
-
return true;
|
|
65
|
-
const targetFieldId = (_a = condition.dependsOn) !== null && _a !== void 0 ? _a : condition.targetFieldId;
|
|
66
|
-
if (!targetFieldId)
|
|
67
|
-
return true;
|
|
68
|
-
return evaluateConditions([{ targetFieldId, operator: condition.operator, value: condition.value }], 'all', fieldValues);
|
|
69
|
-
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @see docs/container-tracking.md
|
|
9
9
|
*/
|
|
10
|
+
import type { ListResult, ListOptions } from './list.js';
|
|
10
11
|
/** Lifecycle status of a container. Custom strings are permitted. */
|
|
11
12
|
export type ContainerStatus = 'active' | 'archived' | string;
|
|
12
13
|
/**
|
|
@@ -134,24 +135,13 @@ export interface RemoveContainerItemsInput {
|
|
|
134
135
|
/** `ContainerItem` UUIDs to mark as removed */
|
|
135
136
|
ids: string[];
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
export interface PublicListContainersResponse {
|
|
143
|
-
containers: Container[];
|
|
144
|
-
}
|
|
145
|
-
/** What findForItem answers: the item's current membership rows (each has `containerId`) and those containers. */
|
|
146
|
-
export interface FindContainersForItemResponse {
|
|
147
|
-
items: ContainerItem[];
|
|
138
|
+
/**
|
|
139
|
+
* What findForItem answers: the item's current membership rows in `items` (each has `containerId`) and
|
|
140
|
+
* those containers. All of them in one answer: `nextCursor` is always null.
|
|
141
|
+
*/
|
|
142
|
+
export interface FindContainersForItemResponse extends ListResult<ContainerItem> {
|
|
148
143
|
containers: Container[];
|
|
149
144
|
}
|
|
150
|
-
export interface ContainerItemsResponse {
|
|
151
|
-
items: ContainerItem[];
|
|
152
|
-
limit: number;
|
|
153
|
-
offset: number;
|
|
154
|
-
}
|
|
155
145
|
export interface AddContainerItemsResponse {
|
|
156
146
|
items: ContainerItem[];
|
|
157
147
|
}
|
|
@@ -159,7 +149,8 @@ export interface RemoveContainerItemsResponse {
|
|
|
159
149
|
success: true;
|
|
160
150
|
removedCount: number;
|
|
161
151
|
}
|
|
162
|
-
|
|
152
|
+
/** `containers.list` / `containers.publicList` options: the filters, plus `limit` (default 100) and `cursor`. */
|
|
153
|
+
export interface ListContainersParams extends ListOptions {
|
|
163
154
|
/** Filter by container type label */
|
|
164
155
|
containerType?: string;
|
|
165
156
|
/** Filter by status */
|
|
@@ -170,11 +161,9 @@ export interface ListContainersParams {
|
|
|
170
161
|
parentContainerId?: string;
|
|
171
162
|
/** When `true`, return only top-level containers (no `parentContainerId`) */
|
|
172
163
|
topLevel?: boolean;
|
|
173
|
-
/** Default 100 */
|
|
174
|
-
limit?: number;
|
|
175
|
-
/** Default 0 */
|
|
176
|
-
offset?: number;
|
|
177
164
|
}
|
|
165
|
+
/** What `containers.publicList` takes: the public list is always the active containers, so it has no `status` or `ref`. */
|
|
166
|
+
export type PublicListContainersParams = Omit<ListContainersParams, 'status' | 'ref'>;
|
|
178
167
|
export interface GetContainerParams {
|
|
179
168
|
/** When `true`, recursively embed child containers up to `treeDepth` levels */
|
|
180
169
|
tree?: boolean;
|
|
@@ -183,13 +172,13 @@ export interface GetContainerParams {
|
|
|
183
172
|
/** When `true`, embed the current `items` array */
|
|
184
173
|
includeContents?: boolean;
|
|
185
174
|
}
|
|
186
|
-
|
|
175
|
+
/**
|
|
176
|
+
* `containers.listItems` options. `limit` (default 200) and `cursor` page the membership log
|
|
177
|
+
* (`history: true`); the current contents come back whole.
|
|
178
|
+
*/
|
|
179
|
+
export interface ListContainerItemsParams extends ListOptions {
|
|
187
180
|
/** When `true`, include removed items (full membership log); default `false` */
|
|
188
181
|
history?: boolean;
|
|
189
|
-
/** Default 100 */
|
|
190
|
-
limit?: number;
|
|
191
|
-
/** Default 0 */
|
|
192
|
-
offset?: number;
|
|
193
182
|
}
|
|
194
183
|
export interface FindContainersForItemParams {
|
|
195
184
|
/** Required */
|
package/dist/types/crate.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for managing crates (containers for tags/products).
|
|
5
5
|
*/
|
|
6
|
+
import type { ListOptions } from './list.js';
|
|
6
7
|
/**
|
|
7
8
|
* Item within a crate.
|
|
8
9
|
*/
|
|
@@ -27,21 +28,12 @@ export interface Crate {
|
|
|
27
28
|
deletedAt?: string | null;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* `crate.list` options: `limit` (default 100, max 100) and `cursor`, plus whether to include
|
|
32
|
+
* soft-deleted crates.
|
|
31
33
|
*/
|
|
32
|
-
export interface ListCratesRequest {
|
|
33
|
-
limit?: number;
|
|
34
|
-
startAfter?: string;
|
|
34
|
+
export interface ListCratesRequest extends ListOptions {
|
|
35
35
|
includeDeleted?: boolean;
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Response from listing crates.
|
|
39
|
-
*/
|
|
40
|
-
export interface ListCratesResponse {
|
|
41
|
-
items: Crate[];
|
|
42
|
-
hasMore: boolean;
|
|
43
|
-
lastId: string | null;
|
|
44
|
-
}
|
|
45
37
|
/**
|
|
46
38
|
* Response from getting a single crate.
|
|
47
39
|
*/
|
package/dist/types/dpp.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListOptions } from "./list.js";
|
|
1
2
|
/**
|
|
2
3
|
* The registry environments: `acc` = the EU test registry, `prod` = the live EU registry, `practice` = the SmartLinks
|
|
3
4
|
* practice registry (never the EU — for trying the whole flow before a brand is verified with the EU), `local` = a
|
|
@@ -198,13 +199,12 @@ export interface DppPassportVersion {
|
|
|
198
199
|
savedAt: string;
|
|
199
200
|
savedBy: string | null;
|
|
200
201
|
}
|
|
201
|
-
|
|
202
|
+
/** `dpp.passports.list` options: the filters, plus `limit` and `cursor`. */
|
|
203
|
+
export interface DppPassportListQuery extends ListOptions {
|
|
202
204
|
productId?: string;
|
|
203
205
|
batchId?: string;
|
|
204
206
|
proofId?: string;
|
|
205
207
|
status?: "active" | "withdrawn";
|
|
206
|
-
limit?: number;
|
|
207
|
-
offset?: number;
|
|
208
208
|
}
|
|
209
209
|
export interface DppRegisterResult {
|
|
210
210
|
/** One registry request per product group (and kind), up to 100 passports each. */
|
package/dist/types/dpp.js
CHANGED
package/dist/types/error.d.ts
CHANGED
|
@@ -33,14 +33,12 @@ export declare class SmartlinksApiError extends Error {
|
|
|
33
33
|
* Returns the numeric error code from the server response, if available.
|
|
34
34
|
* This is typically the HTTP status code (400, 401, 500, etc.).
|
|
35
35
|
*
|
|
36
|
-
* For server
|
|
37
|
-
* use: `error.details?.errorCode || error.details?.error`
|
|
36
|
+
* For the server's own code (a string such as "NOT_FOUND" or "UNKNOWN_PARAMETER"), use `error.errorCode`.
|
|
38
37
|
*/
|
|
39
38
|
get code(): number | undefined;
|
|
40
39
|
/**
|
|
41
|
-
*
|
|
42
|
-
* This is
|
|
43
|
-
* This is the primary identifier to check for programmatic error handling.
|
|
40
|
+
* The server's code for what went wrong, in UPPER_SNAKE: "NOT_FOUND", "UNKNOWN_PARAMETER",
|
|
41
|
+
* "INVALID_QUERY". This is what to check in code; the message is for people and may change.
|
|
44
42
|
*/
|
|
45
43
|
get errorCode(): string | undefined;
|
|
46
44
|
/**
|
|
@@ -48,6 +46,11 @@ export declare class SmartlinksApiError extends Error {
|
|
|
48
46
|
* This object contains various server-specific fields that may vary by endpoint.
|
|
49
47
|
*/
|
|
50
48
|
get details(): Record<string, any> | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The id of the request on the server, when the answer carried one. Quote it when reporting a problem:
|
|
51
|
+
* it finds the request in the logs.
|
|
52
|
+
*/
|
|
53
|
+
get requestId(): string | undefined;
|
|
51
54
|
/**
|
|
52
55
|
* Check if this is a client error (4xx status code).
|
|
53
56
|
*/
|
package/dist/types/error.js
CHANGED
|
@@ -27,17 +27,15 @@ export class SmartlinksApiError extends Error {
|
|
|
27
27
|
* Returns the numeric error code from the server response, if available.
|
|
28
28
|
* This is typically the HTTP status code (400, 401, 500, etc.).
|
|
29
29
|
*
|
|
30
|
-
* For server
|
|
31
|
-
* use: `error.details?.errorCode || error.details?.error`
|
|
30
|
+
* For the server's own code (a string such as "NOT_FOUND" or "UNKNOWN_PARAMETER"), use `error.errorCode`.
|
|
32
31
|
*/
|
|
33
32
|
get code() {
|
|
34
33
|
var _a;
|
|
35
34
|
return (_a = this.errorResponse) === null || _a === void 0 ? void 0 : _a.code;
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
39
|
-
* This is
|
|
40
|
-
* This is the primary identifier to check for programmatic error handling.
|
|
37
|
+
* The server's code for what went wrong, in UPPER_SNAKE: "NOT_FOUND", "UNKNOWN_PARAMETER",
|
|
38
|
+
* "INVALID_QUERY". This is what to check in code; the message is for people and may change.
|
|
41
39
|
*/
|
|
42
40
|
get errorCode() {
|
|
43
41
|
var _a;
|
|
@@ -51,6 +49,15 @@ export class SmartlinksApiError extends Error {
|
|
|
51
49
|
var _a;
|
|
52
50
|
return (_a = this.errorResponse) === null || _a === void 0 ? void 0 : _a.details;
|
|
53
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* The id of the request on the server, when the answer carried one. Quote it when reporting a problem:
|
|
54
|
+
* it finds the request in the logs.
|
|
55
|
+
*/
|
|
56
|
+
get requestId() {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
const id = (_b = (_a = this.errorResponse) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.requestId;
|
|
59
|
+
return typeof id === 'string' ? id : undefined;
|
|
60
|
+
}
|
|
54
61
|
/**
|
|
55
62
|
* Check if this is a client error (4xx status code).
|
|
56
63
|
*/
|