@proveanything/smartlinks 3.0.0-alpha.1 → 3.0.0-alpha.3
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 -741
- package/dist/README.md +573 -573
- package/dist/adminCardsView.js +55 -55
- package/dist/api/analytics.d.ts +5 -4
- package/dist/api/analytics.js +5 -4
- package/dist/api/appConfiguration.d.ts +23 -18
- package/dist/api/appConfiguration.js +24 -18
- package/dist/api/appObjects.d.ts +54 -10
- package/dist/api/appObjects.js +75 -40
- package/dist/api/asset.d.ts +28 -22
- package/dist/api/asset.js +45 -56
- package/dist/api/attestation.d.ts +11 -3
- package/dist/api/attestation.js +12 -3
- package/dist/api/attestations.d.ts +12 -8
- package/dist/api/attestations.js +18 -21
- package/dist/api/authKit.d.ts +15 -10
- package/dist/api/authKit.js +17 -11
- package/dist/api/batch.d.ts +36 -25
- package/dist/api/batch.js +46 -39
- package/dist/api/bookings.d.ts +67 -11
- package/dist/api/bookings.js +82 -15
- package/dist/api/broadcasts.js +3 -17
- package/dist/api/claimSet.d.ts +26 -12
- package/dist/api/claimSet.js +32 -24
- package/dist/api/collection.d.ts +15 -10
- package/dist/api/collection.js +17 -11
- package/dist/api/comms.d.ts +12 -6
- package/dist/api/comms.js +12 -6
- package/dist/api/conditions.d.ts +7 -6
- package/dist/api/conditions.js +8 -6
- package/dist/api/contact.d.ts +6 -2
- package/dist/api/contact.js +25 -60
- package/dist/api/containers.d.ts +14 -10
- package/dist/api/containers.js +19 -14
- package/dist/api/crate.js +7 -9
- package/dist/api/dpp.d.ts +20 -13
- package/dist/api/dpp.js +23 -15
- package/dist/api/facets.d.ts +38 -13
- package/dist/api/facets.js +40 -15
- package/dist/api/files.d.ts +5 -2
- package/dist/api/files.js +7 -4
- package/dist/api/form.d.ts +8 -5
- package/dist/api/form.js +9 -5
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/integrations.d.ts +29 -17
- package/dist/api/integrations.js +32 -25
- package/dist/api/interactions.d.ts +11 -6
- package/dist/api/interactions.js +14 -23
- package/dist/api/jobs.d.ts +16 -6
- package/dist/api/jobs.js +30 -20
- package/dist/api/journeys.js +2 -14
- package/dist/api/journeysAnalytics.d.ts +8 -5
- package/dist/api/journeysAnalytics.js +8 -5
- package/dist/api/knowledge.d.ts +20 -14
- package/dist/api/knowledge.js +22 -15
- package/dist/api/location.d.ts +6 -3
- package/dist/api/location.js +8 -22
- package/dist/api/lots.d.ts +9 -5
- package/dist/api/lots.js +22 -26
- package/dist/api/loyalty.d.ts +25 -16
- package/dist/api/loyalty.js +33 -32
- package/dist/api/nfc.d.ts +3 -1
- package/dist/api/nfc.js +3 -1
- package/dist/api/order.d.ts +45 -39
- package/dist/api/order.js +48 -65
- package/dist/api/partner.d.ts +17 -14
- package/dist/api/partner.js +21 -22
- package/dist/api/payments.d.ts +60 -0
- package/dist/api/payments.js +94 -0
- package/dist/api/products.d.ts +35 -12
- package/dist/api/products.js +36 -13
- package/dist/api/proof.d.ts +41 -19
- package/dist/api/proof.js +44 -23
- package/dist/api/realtime.d.ts +3 -0
- package/dist/api/realtime.js +10 -2
- package/dist/api/segments.js +3 -15
- package/dist/api/serviceAccounts.d.ts +8 -5
- package/dist/api/serviceAccounts.js +9 -6
- package/dist/api/shop.d.ts +7 -5
- package/dist/api/shop.js +13 -19
- package/dist/api/subscriptions.d.ts +12 -10
- package/dist/api/subscriptions.js +17 -25
- package/dist/api/tags.d.ts +23 -20
- package/dist/api/tags.js +40 -52
- package/dist/api/template.d.ts +16 -11
- package/dist/api/template.js +19 -13
- package/dist/api/translations.js +2 -12
- package/dist/api/userGroups.d.ts +26 -16
- package/dist/api/userGroups.js +43 -30
- package/dist/api/variant.d.ts +10 -7
- package/dist/api/variant.js +11 -7
- package/dist/api/wallet.d.ts +14 -11
- package/dist/api/wallet.js +15 -12
- package/dist/baseline.css +194 -194
- package/dist/dataChanged.d.ts +74 -0
- package/dist/dataChanged.js +162 -0
- package/dist/docs/API_SUMMARY.md +1443 -1409
- package/dist/docs/admin-cards.md +189 -189
- 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 +1 -1
- package/dist/docs/api-versions.md +85 -85
- 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 +4 -4
- package/dist/docs/app-records-pattern.md +388 -388
- package/dist/docs/appConfig.md +550 -550
- package/dist/docs/assistant-apps.md +172 -172
- package/dist/docs/assistant-context.md +119 -119
- package/dist/docs/attestations.md +8 -8
- package/dist/docs/bookings.md +105 -8
- package/dist/docs/caching.md +32 -3
- package/dist/docs/comms.md +689 -689
- package/dist/docs/connectors.md +340 -340
- package/dist/docs/contact-search.md +2 -3
- package/dist/docs/css-baseline.md +133 -133
- package/dist/docs/customer-guide.md +70 -70
- package/dist/docs/data-changed.md +91 -0
- 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/files.md +69 -69
- package/dist/docs/host-dependency-contract.md +252 -252
- package/dist/docs/iframe-responder.md +11 -0
- package/dist/docs/integrations.md +322 -322
- package/dist/docs/interactions.md +544 -544
- package/dist/docs/item-context.md +181 -181
- package/dist/docs/knowledge.md +105 -105
- package/dist/docs/lists.md +157 -114
- package/dist/docs/lots.md +112 -112
- package/dist/docs/loyalty.md +348 -348
- package/dist/docs/members.md +183 -183
- package/dist/docs/memberships.md +150 -150
- package/dist/docs/mobile-admin-container.md +693 -693
- package/dist/docs/operations.md +281 -281
- package/dist/docs/overview.md +487 -485
- package/dist/docs/payments.md +94 -0
- 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 +149 -139
- package/dist/docs/records-admin-pattern.md +304 -304
- package/dist/docs/service-accounts.md +64 -64
- package/dist/docs/standard-query.md +196 -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/upgrading-to-3.md +550 -430
- package/dist/docs/wallet-passes.md +107 -107
- package/dist/docs/websites.md +123 -123
- package/dist/http.d.ts +6 -3
- package/dist/http.js +48 -19
- package/dist/iframeResponder.d.ts +7 -0
- package/dist/iframeResponder.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/list.d.ts +12 -0
- package/dist/list.js +59 -0
- package/dist/openapi.yaml +722 -660
- package/dist/testing/bookingsMemory.d.ts +29 -1
- package/dist/testing/bookingsMemory.js +89 -1
- package/dist/testing/index.js +4 -1
- package/dist/theme-boot.js +82 -82
- package/dist/theme.css +75 -75
- package/dist/types/analytics.d.ts +7 -3
- package/dist/types/appManifest.d.ts +26 -4
- package/dist/types/appObjects.d.ts +27 -12
- package/dist/types/appOptions.d.ts +2 -2
- package/dist/types/asset.d.ts +5 -6
- package/dist/types/attestations.d.ts +7 -9
- package/dist/types/batch.d.ts +5 -5
- package/dist/types/bookings.d.ts +109 -6
- package/dist/types/comms.d.ts +9 -5
- package/dist/types/contact.d.ts +7 -4
- package/dist/types/containers.d.ts +2 -1
- package/dist/types/facets.d.ts +14 -2
- package/dist/types/files.d.ts +3 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/integrations.d.ts +2 -1
- package/dist/types/interaction.d.ts +15 -7
- package/dist/types/jobs.d.ts +1 -1
- package/dist/types/journeysAnalytics.d.ts +3 -2
- package/dist/types/knowledge.d.ts +6 -3
- package/dist/types/knowledge.js +0 -1
- package/dist/types/list.d.ts +30 -2
- package/dist/types/location.d.ts +7 -2
- package/dist/types/location.js +0 -1
- package/dist/types/lots.d.ts +5 -2
- package/dist/types/lots.js +0 -6
- package/dist/types/order.d.ts +22 -20
- package/dist/types/payments.d.ts +101 -0
- package/dist/types/payments.js +5 -0
- package/dist/types/product.d.ts +28 -11
- package/dist/types/proof.d.ts +7 -8
- package/dist/types/realtime.d.ts +5 -1
- package/dist/types/tags.d.ts +5 -3
- package/dist/types/userGroups.d.ts +3 -3
- package/dist/types/userGroups.js +0 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/API_SUMMARY.md +1443 -1409
- package/docs/admin-cards.md +189 -189
- 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 +1 -1
- package/docs/api-versions.md +85 -85
- 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 +4 -4
- package/docs/app-records-pattern.md +388 -388
- package/docs/appConfig.md +550 -550
- package/docs/assistant-apps.md +172 -172
- package/docs/assistant-context.md +119 -119
- package/docs/attestations.md +8 -8
- package/docs/bookings.md +105 -8
- package/docs/caching.md +32 -3
- package/docs/comms.md +689 -689
- package/docs/connectors.md +340 -340
- package/docs/contact-search.md +2 -3
- package/docs/css-baseline.md +133 -133
- package/docs/customer-guide.md +70 -70
- package/docs/data-changed.md +91 -0
- package/docs/deploying-apps.md +340 -340
- package/docs/dpp.md +115 -115
- package/docs/entitlements.md +90 -90
- package/docs/files.md +69 -69
- package/docs/host-dependency-contract.md +252 -252
- package/docs/iframe-responder.md +11 -0
- package/docs/integrations.md +322 -322
- package/docs/interactions.md +544 -544
- package/docs/item-context.md +181 -181
- package/docs/knowledge.md +105 -105
- package/docs/lists.md +157 -114
- package/docs/lots.md +112 -112
- package/docs/loyalty.md +348 -348
- package/docs/members.md +183 -183
- package/docs/memberships.md +150 -150
- package/docs/mobile-admin-container.md +693 -693
- package/docs/operations.md +281 -281
- package/docs/overview.md +487 -485
- package/docs/payments.md +94 -0
- 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 +149 -139
- package/docs/service-accounts.md +64 -64
- package/docs/standard-query.md +196 -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/upgrading-to-3.md +550 -430
- package/docs/wallet-passes.md +107 -107
- package/docs/websites.md +123 -123
- package/openapi.yaml +722 -660
- package/package.json +91 -91
- 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 +708 -512
- package/scripts/publish.mjs +272 -272
- package/scripts/register-release.mjs +91 -91
- package/scripts/upgrade.mjs +79 -56
- package/upgrade/3.json +2731 -2213
|
@@ -2,16 +2,17 @@ import type { PublicPlan, MySubscription, SubscriptionStartInput, SubscriptionSt
|
|
|
2
2
|
import type { ListResult, ListOptions } from '../types/list.js';
|
|
3
3
|
export declare namespace subscriptions {
|
|
4
4
|
/**
|
|
5
|
-
* Plans open to new members, each with its prices (monthly, yearly, one-off)
|
|
6
|
-
* `
|
|
5
|
+
* Plans open to new members, each with its prices (monthly, yearly, one-off), a page at a time. Page
|
|
6
|
+
* with `limit` (50 unless you say) and `cursor`.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```typescript
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* let page = await subscriptions.plans(collectionId, { limit: 50 })
|
|
11
|
+
* page.items.map((p) => p.prices.map((price) => subscriptions.describePrice(price)))
|
|
12
|
+
* while (page.nextCursor) page = await subscriptions.plans(collectionId, { limit: 50, cursor: page.nextCursor })
|
|
12
13
|
* ```
|
|
13
14
|
*/
|
|
14
|
-
function plans(collectionId: string): Promise<ListResult<PublicPlan>>;
|
|
15
|
+
function plans(collectionId: string, options?: ListOptions): Promise<ListResult<PublicPlan>>;
|
|
15
16
|
/**
|
|
16
17
|
* Join a plan: Stripe's checkout page for the chosen price. Send them to `checkoutUrl`. Signed in only (a
|
|
17
18
|
* membership belongs to an account). The membership exists once Stripe confirms the payment.
|
|
@@ -31,16 +32,17 @@ export declare namespace subscriptions {
|
|
|
31
32
|
*/
|
|
32
33
|
function start(collectionId: string, input: SubscriptionStartInput): Promise<SubscriptionStartResult>;
|
|
33
34
|
/**
|
|
34
|
-
* The signed-in member's memberships, newest first (ended ones too: check `live`)
|
|
35
|
-
*
|
|
35
|
+
* The signed-in member's memberships, newest first (ended ones too: check `live`), a page at a time.
|
|
36
|
+
* Page with `limit` (50 unless you say) and `cursor`.
|
|
36
37
|
*
|
|
37
38
|
* @example
|
|
38
39
|
* ```typescript
|
|
39
|
-
*
|
|
40
|
-
* const current = items.find((s) => s.live)
|
|
40
|
+
* let page = await subscriptions.mine(collectionId)
|
|
41
|
+
* const current = page.items.find((s) => s.live)
|
|
42
|
+
* while (page.nextCursor) page = await subscriptions.mine(collectionId, { cursor: page.nextCursor })
|
|
41
43
|
* ```
|
|
42
44
|
*/
|
|
43
|
-
function mine(collectionId: string): Promise<ListResult<MySubscription>>;
|
|
45
|
+
function mine(collectionId: string, options?: ListOptions): Promise<ListResult<MySubscription>>;
|
|
44
46
|
/**
|
|
45
47
|
* Cancel: it ends at the end of the paid period, and access stays until then. A one-off plan or a staff
|
|
46
48
|
* grant ends now. Undo with `resume` before the period ends.
|
|
@@ -5,33 +5,24 @@
|
|
|
5
5
|
// (the member's `level` and user groups).
|
|
6
6
|
import { request, post, put, patch, del } from '../http.js';
|
|
7
7
|
import { describeRecurring } from '../utils/money.js';
|
|
8
|
+
import { listQuery } from '../list.js';
|
|
8
9
|
const pub = (collectionId) => `/public/collection/${encodeURIComponent(collectionId)}/memberships`;
|
|
9
10
|
const adm = (collectionId) => `/admin/collection/${encodeURIComponent(collectionId)}/memberships`;
|
|
10
|
-
function qs(params) {
|
|
11
|
-
if (!params)
|
|
12
|
-
return '';
|
|
13
|
-
const parts = [];
|
|
14
|
-
for (const [k, v] of Object.entries(params)) {
|
|
15
|
-
if (v === undefined || v === null || v === '')
|
|
16
|
-
continue;
|
|
17
|
-
parts.push(`${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`);
|
|
18
|
-
}
|
|
19
|
-
return parts.length ? `?${parts.join('&')}` : '';
|
|
20
|
-
}
|
|
21
11
|
export var subscriptions;
|
|
22
12
|
(function (subscriptions) {
|
|
23
13
|
/**
|
|
24
|
-
* Plans open to new members, each with its prices (monthly, yearly, one-off)
|
|
25
|
-
* `
|
|
14
|
+
* Plans open to new members, each with its prices (monthly, yearly, one-off), a page at a time. Page
|
|
15
|
+
* with `limit` (50 unless you say) and `cursor`.
|
|
26
16
|
*
|
|
27
17
|
* @example
|
|
28
18
|
* ```typescript
|
|
29
|
-
*
|
|
30
|
-
*
|
|
19
|
+
* let page = await subscriptions.plans(collectionId, { limit: 50 })
|
|
20
|
+
* page.items.map((p) => p.prices.map((price) => subscriptions.describePrice(price)))
|
|
21
|
+
* while (page.nextCursor) page = await subscriptions.plans(collectionId, { limit: 50, cursor: page.nextCursor })
|
|
31
22
|
* ```
|
|
32
23
|
*/
|
|
33
|
-
async function plans(collectionId) {
|
|
34
|
-
return request(`${pub(collectionId)}/plans`);
|
|
24
|
+
async function plans(collectionId, options = {}) {
|
|
25
|
+
return request(`${pub(collectionId)}/plans${listQuery(options)}`);
|
|
35
26
|
}
|
|
36
27
|
subscriptions.plans = plans;
|
|
37
28
|
/**
|
|
@@ -56,17 +47,18 @@ export var subscriptions;
|
|
|
56
47
|
}
|
|
57
48
|
subscriptions.start = start;
|
|
58
49
|
/**
|
|
59
|
-
* The signed-in member's memberships, newest first (ended ones too: check `live`)
|
|
60
|
-
*
|
|
50
|
+
* The signed-in member's memberships, newest first (ended ones too: check `live`), a page at a time.
|
|
51
|
+
* Page with `limit` (50 unless you say) and `cursor`.
|
|
61
52
|
*
|
|
62
53
|
* @example
|
|
63
54
|
* ```typescript
|
|
64
|
-
*
|
|
65
|
-
* const current = items.find((s) => s.live)
|
|
55
|
+
* let page = await subscriptions.mine(collectionId)
|
|
56
|
+
* const current = page.items.find((s) => s.live)
|
|
57
|
+
* while (page.nextCursor) page = await subscriptions.mine(collectionId, { cursor: page.nextCursor })
|
|
66
58
|
* ```
|
|
67
59
|
*/
|
|
68
|
-
async function mine(collectionId) {
|
|
69
|
-
return request(`${pub(collectionId)}/mine`);
|
|
60
|
+
async function mine(collectionId, options = {}) {
|
|
61
|
+
return request(`${pub(collectionId)}/mine${listQuery(options)}`);
|
|
70
62
|
}
|
|
71
63
|
subscriptions.mine = mine;
|
|
72
64
|
/**
|
|
@@ -116,7 +108,7 @@ export var subscriptions;
|
|
|
116
108
|
* ```
|
|
117
109
|
*/
|
|
118
110
|
async function listPlans(collectionId, params) {
|
|
119
|
-
return request(`${adm(collectionId)}/plans${
|
|
111
|
+
return request(`${adm(collectionId)}/plans${listQuery(params)}`);
|
|
120
112
|
}
|
|
121
113
|
admin.listPlans = listPlans;
|
|
122
114
|
/** A plan with its prices and how many live members it has. */
|
|
@@ -167,7 +159,7 @@ export var subscriptions;
|
|
|
167
159
|
* ```
|
|
168
160
|
*/
|
|
169
161
|
async function list(collectionId, params) {
|
|
170
|
-
return request(`${adm(collectionId)}/subscriptions${
|
|
162
|
+
return request(`${adm(collectionId)}/subscriptions${listQuery(params)}`);
|
|
171
163
|
}
|
|
172
164
|
admin.list = list;
|
|
173
165
|
async function get(collectionId, subscriptionId) {
|
package/dist/api/tags.d.ts
CHANGED
|
@@ -140,15 +140,15 @@ export declare namespace tags {
|
|
|
140
140
|
* No embed support on the admin side.
|
|
141
141
|
*
|
|
142
142
|
* @param collectionId - Collection context
|
|
143
|
-
* @param params - `refType` and `refId` are required
|
|
144
|
-
* @returns `{ items: Tag[], nextCursor: null }`:
|
|
143
|
+
* @param params - `refType` and `refId` are required; plus `limit` (default 50) and `cursor`
|
|
144
|
+
* @returns `{ items: Tag[], nextCursor: string | null }`: the linked tags, a page at a time
|
|
145
145
|
*
|
|
146
146
|
* @example
|
|
147
147
|
* ```typescript
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* refId:
|
|
151
|
-
* }
|
|
148
|
+
* let page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50 })
|
|
149
|
+
* while (page.nextCursor) {
|
|
150
|
+
* page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50, cursor: page.nextCursor })
|
|
151
|
+
* }
|
|
152
152
|
* ```
|
|
153
153
|
*/
|
|
154
154
|
function byRef(collectionId: string, params: ReverseTagLookupParams): Promise<ListResult<Tag>>;
|
|
@@ -209,15 +209,15 @@ export declare namespace tags {
|
|
|
209
209
|
* Returns deduplicated embedded objects alongside the tag array.
|
|
210
210
|
*
|
|
211
211
|
* @param collectionId - Collection context
|
|
212
|
-
* @param data - `{ tagIds: string[], embed?: string }`
|
|
213
|
-
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }
|
|
212
|
+
* @param data - `{ tagIds: string[], embed?: string }`, plus `limit` (default 50) and `cursor`
|
|
213
|
+
* @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
|
|
214
|
+
* the tags found, a page at a time
|
|
214
215
|
*
|
|
215
216
|
* @example
|
|
216
217
|
* ```typescript
|
|
217
|
-
* const
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* })
|
|
218
|
+
* const tagIds = ['NFC-001', 'NFC-002', 'NFC-003']
|
|
219
|
+
* // Every tag found comes back in the one answer: a look-up is never paged.
|
|
220
|
+
* const { items, embedded } = await tags.lookupTags('coll_123', { tagIds, embed: 'product,proof' })
|
|
221
221
|
* ```
|
|
222
222
|
*/
|
|
223
223
|
function lookupTags(collectionId: string, data: LookupTagsRequest): Promise<TagLookupResponse>;
|
|
@@ -227,8 +227,9 @@ export declare namespace tags {
|
|
|
227
227
|
* `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product`
|
|
228
228
|
*
|
|
229
229
|
* @param collectionId - Collection context
|
|
230
|
-
* @param params - `tagIds` is comma-separated; `embed` is optional
|
|
231
|
-
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }
|
|
230
|
+
* @param params - `tagIds` is comma-separated; `embed` is optional; plus `limit` (default 50) and `cursor`
|
|
231
|
+
* @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
|
|
232
|
+
* the tags found, a page at a time
|
|
232
233
|
*
|
|
233
234
|
* @example
|
|
234
235
|
* ```typescript
|
|
@@ -245,15 +246,16 @@ export declare namespace tags {
|
|
|
245
246
|
* `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref`
|
|
246
247
|
*
|
|
247
248
|
* @param collectionId - Collection context
|
|
248
|
-
* @param params - `refType` and `refId` are required; `embed` is optional
|
|
249
|
-
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }
|
|
249
|
+
* @param params - `refType` and `refId` are required; `embed` is optional; plus `limit` (default 50) and `cursor`
|
|
250
|
+
* @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
|
|
250
251
|
*
|
|
251
252
|
* @example
|
|
252
253
|
* ```typescript
|
|
253
|
-
* const { items: linked, embedded } = await tags.publicByRef('coll_123', {
|
|
254
|
+
* const { items: linked, embedded, nextCursor } = await tags.publicByRef('coll_123', {
|
|
254
255
|
* refType: 'container',
|
|
255
256
|
* refId: 'container-uuid',
|
|
256
257
|
* embed: 'container',
|
|
258
|
+
* limit: 50,
|
|
257
259
|
* })
|
|
258
260
|
* const container = embedded.containers?.[containerId]
|
|
259
261
|
* ```
|
|
@@ -265,15 +267,16 @@ export declare namespace tags {
|
|
|
265
267
|
* `POST /public/collection/:collectionId/tags/by-ref`
|
|
266
268
|
*
|
|
267
269
|
* @param collectionId - Collection context
|
|
268
|
-
* @param data - `{ refType, refId, embed? }`
|
|
269
|
-
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }
|
|
270
|
+
* @param data - `{ refType, refId, embed? }`, plus `limit` (default 50) and `cursor`
|
|
271
|
+
* @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
|
|
270
272
|
*
|
|
271
273
|
* @example
|
|
272
274
|
* ```typescript
|
|
273
|
-
* const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
|
|
275
|
+
* const { items: linked, embedded, nextCursor } = await tags.publicByRefPost('coll_123', {
|
|
274
276
|
* refType: 'container',
|
|
275
277
|
* refId: 'container-uuid',
|
|
276
278
|
* embed: 'container',
|
|
279
|
+
* limit: 50,
|
|
277
280
|
* })
|
|
278
281
|
* ```
|
|
279
282
|
*/
|
package/dist/api/tags.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/api/tags.ts
|
|
2
2
|
import { request, post, put, del } from "../http.js";
|
|
3
|
+
import { listQuery } from "../list.js";
|
|
3
4
|
/**
|
|
4
5
|
* Tag Management API
|
|
5
6
|
*
|
|
@@ -157,23 +158,16 @@ export var tags;
|
|
|
157
158
|
* ```
|
|
158
159
|
*/
|
|
159
160
|
async function list(collectionId, params) {
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
q.append('batchId', params.batchId);
|
|
171
|
-
if (params === null || params === void 0 ? void 0 : params.refType)
|
|
172
|
-
q.append('refType', params.refType);
|
|
173
|
-
if (params === null || params === void 0 ? void 0 : params.refId)
|
|
174
|
-
q.append('refId', params.refId);
|
|
175
|
-
const qs = q.toString();
|
|
176
|
-
const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags${qs ? `?${qs}` : ''}`;
|
|
161
|
+
const qs = listQuery({
|
|
162
|
+
limit: (params === null || params === void 0 ? void 0 : params.limit) || undefined,
|
|
163
|
+
cursor: params === null || params === void 0 ? void 0 : params.cursor,
|
|
164
|
+
productId: params === null || params === void 0 ? void 0 : params.productId,
|
|
165
|
+
variantId: params === null || params === void 0 ? void 0 : params.variantId,
|
|
166
|
+
batchId: params === null || params === void 0 ? void 0 : params.batchId,
|
|
167
|
+
refType: params === null || params === void 0 ? void 0 : params.refType,
|
|
168
|
+
refId: params === null || params === void 0 ? void 0 : params.refId,
|
|
169
|
+
});
|
|
170
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags${qs}`;
|
|
177
171
|
return request(path);
|
|
178
172
|
}
|
|
179
173
|
tags.list = list;
|
|
@@ -184,22 +178,20 @@ export var tags;
|
|
|
184
178
|
* No embed support on the admin side.
|
|
185
179
|
*
|
|
186
180
|
* @param collectionId - Collection context
|
|
187
|
-
* @param params - `refType` and `refId` are required
|
|
188
|
-
* @returns `{ items: Tag[], nextCursor: null }`:
|
|
181
|
+
* @param params - `refType` and `refId` are required; plus `limit` (default 50) and `cursor`
|
|
182
|
+
* @returns `{ items: Tag[], nextCursor: string | null }`: the linked tags, a page at a time
|
|
189
183
|
*
|
|
190
184
|
* @example
|
|
191
185
|
* ```typescript
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* refId:
|
|
195
|
-
* }
|
|
186
|
+
* let page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50 })
|
|
187
|
+
* while (page.nextCursor) {
|
|
188
|
+
* page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50, cursor: page.nextCursor })
|
|
189
|
+
* }
|
|
196
190
|
* ```
|
|
197
191
|
*/
|
|
198
192
|
async function byRef(collectionId, params) {
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
q.append('refId', params.refId);
|
|
202
|
-
const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags/by-ref?${q.toString()}`;
|
|
193
|
+
const qs = listQuery({ refType: params.refType, refId: params.refId, limit: params.limit, cursor: params.cursor });
|
|
194
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags/by-ref${qs}`;
|
|
203
195
|
return request(path);
|
|
204
196
|
}
|
|
205
197
|
tags.byRef = byRef;
|
|
@@ -278,15 +270,15 @@ export var tags;
|
|
|
278
270
|
* Returns deduplicated embedded objects alongside the tag array.
|
|
279
271
|
*
|
|
280
272
|
* @param collectionId - Collection context
|
|
281
|
-
* @param data - `{ tagIds: string[], embed?: string }`
|
|
282
|
-
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }
|
|
273
|
+
* @param data - `{ tagIds: string[], embed?: string }`, plus `limit` (default 50) and `cursor`
|
|
274
|
+
* @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
|
|
275
|
+
* the tags found, a page at a time
|
|
283
276
|
*
|
|
284
277
|
* @example
|
|
285
278
|
* ```typescript
|
|
286
|
-
* const
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
* })
|
|
279
|
+
* const tagIds = ['NFC-001', 'NFC-002', 'NFC-003']
|
|
280
|
+
* // Every tag found comes back in the one answer: a look-up is never paged.
|
|
281
|
+
* const { items, embedded } = await tags.lookupTags('coll_123', { tagIds, embed: 'product,proof' })
|
|
290
282
|
* ```
|
|
291
283
|
*/
|
|
292
284
|
async function lookupTags(collectionId, data) {
|
|
@@ -300,8 +292,9 @@ export var tags;
|
|
|
300
292
|
* `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product`
|
|
301
293
|
*
|
|
302
294
|
* @param collectionId - Collection context
|
|
303
|
-
* @param params - `tagIds` is comma-separated; `embed` is optional
|
|
304
|
-
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }
|
|
295
|
+
* @param params - `tagIds` is comma-separated; `embed` is optional; plus `limit` (default 50) and `cursor`
|
|
296
|
+
* @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
|
|
297
|
+
* the tags found, a page at a time
|
|
305
298
|
*
|
|
306
299
|
* @example
|
|
307
300
|
* ```typescript
|
|
@@ -312,11 +305,8 @@ export var tags;
|
|
|
312
305
|
* ```
|
|
313
306
|
*/
|
|
314
307
|
async function lookupTagsQuery(collectionId, params) {
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
if (params.embed)
|
|
318
|
-
q.append('embed', params.embed);
|
|
319
|
-
const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/lookup?${q.toString()}`;
|
|
308
|
+
const qs = listQuery({ tagIds: String(params.tagIds), embed: params.embed });
|
|
309
|
+
const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/lookup${qs}`;
|
|
320
310
|
return request(path);
|
|
321
311
|
}
|
|
322
312
|
tags.lookupTagsQuery = lookupTagsQuery;
|
|
@@ -326,26 +316,23 @@ export var tags;
|
|
|
326
316
|
* `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref`
|
|
327
317
|
*
|
|
328
318
|
* @param collectionId - Collection context
|
|
329
|
-
* @param params - `refType` and `refId` are required; `embed` is optional
|
|
330
|
-
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }
|
|
319
|
+
* @param params - `refType` and `refId` are required; `embed` is optional; plus `limit` (default 50) and `cursor`
|
|
320
|
+
* @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
|
|
331
321
|
*
|
|
332
322
|
* @example
|
|
333
323
|
* ```typescript
|
|
334
|
-
* const { items: linked, embedded } = await tags.publicByRef('coll_123', {
|
|
324
|
+
* const { items: linked, embedded, nextCursor } = await tags.publicByRef('coll_123', {
|
|
335
325
|
* refType: 'container',
|
|
336
326
|
* refId: 'container-uuid',
|
|
337
327
|
* embed: 'container',
|
|
328
|
+
* limit: 50,
|
|
338
329
|
* })
|
|
339
330
|
* const container = embedded.containers?.[containerId]
|
|
340
331
|
* ```
|
|
341
332
|
*/
|
|
342
333
|
async function publicByRef(collectionId, params) {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
q.append('refId', params.refId);
|
|
346
|
-
if (params.embed)
|
|
347
|
-
q.append('embed', params.embed);
|
|
348
|
-
const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/by-ref?${q.toString()}`;
|
|
334
|
+
const qs = listQuery({ refType: params.refType, refId: params.refId, embed: params.embed, limit: params.limit, cursor: params.cursor });
|
|
335
|
+
const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/by-ref${qs}`;
|
|
349
336
|
return request(path);
|
|
350
337
|
}
|
|
351
338
|
tags.publicByRef = publicByRef;
|
|
@@ -355,15 +342,16 @@ export var tags;
|
|
|
355
342
|
* `POST /public/collection/:collectionId/tags/by-ref`
|
|
356
343
|
*
|
|
357
344
|
* @param collectionId - Collection context
|
|
358
|
-
* @param data - `{ refType, refId, embed? }`
|
|
359
|
-
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }
|
|
345
|
+
* @param data - `{ refType, refId, embed? }`, plus `limit` (default 50) and `cursor`
|
|
346
|
+
* @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
|
|
360
347
|
*
|
|
361
348
|
* @example
|
|
362
349
|
* ```typescript
|
|
363
|
-
* const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
|
|
350
|
+
* const { items: linked, embedded, nextCursor } = await tags.publicByRefPost('coll_123', {
|
|
364
351
|
* refType: 'container',
|
|
365
352
|
* refId: 'container-uuid',
|
|
366
353
|
* embed: 'container',
|
|
354
|
+
* limit: 50,
|
|
367
355
|
* })
|
|
368
356
|
* ```
|
|
369
357
|
*/
|
package/dist/api/template.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { Template, TemplateInput, TemplateUpdate, TemplatePublic, TemplateRenderRequest, TemplateRenderResponse, TemplateRenderSourceRequest, TemplateRenderSourceResponse } from "../types/index.js";
|
|
2
|
-
import type { ListResult } from "../types/list.js";
|
|
2
|
+
import type { ListResult, ListOptions } from "../types/list.js";
|
|
3
3
|
export declare namespace template {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000).
|
|
6
|
+
* Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
|
|
6
7
|
*
|
|
7
8
|
* @example
|
|
8
9
|
* ```typescript
|
|
9
|
-
*
|
|
10
|
-
* items // Template[]
|
|
10
|
+
* let page = await template.getAll('coll_123', { limit: 100 })
|
|
11
|
+
* page.items // Template[]
|
|
12
|
+
* while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor })
|
|
11
13
|
* ```
|
|
12
14
|
*/
|
|
13
|
-
function getAll(collectionId: string): Promise<ListResult<Template>>;
|
|
15
|
+
function getAll(collectionId: string, options?: ListOptions): Promise<ListResult<Template>>;
|
|
14
16
|
function get(collectionId: string, templateId: string): Promise<Template>;
|
|
15
17
|
function create(collectionId: string, data: TemplateInput): Promise<Template>;
|
|
16
18
|
function update(collectionId: string, templateId: string, data: TemplateUpdate): Promise<Template>;
|
|
@@ -19,27 +21,30 @@ export declare namespace template {
|
|
|
19
21
|
url: string;
|
|
20
22
|
}>;
|
|
21
23
|
/**
|
|
22
|
-
* The collection's templates that may be used publicly,
|
|
24
|
+
* The collection's templates that may be used publicly, 50 at a time unless you give a `limit`
|
|
25
|
+
* (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the
|
|
26
|
+
* last one.
|
|
23
27
|
*
|
|
24
28
|
* @example
|
|
25
29
|
* ```typescript
|
|
26
|
-
* const { items } = await template.getAllowed('coll_123')
|
|
30
|
+
* const { items, nextCursor } = await template.getAllowed('coll_123', { limit: 100 })
|
|
27
31
|
* items // TemplatePublic[]
|
|
28
32
|
* ```
|
|
29
33
|
*/
|
|
30
|
-
function getAllowed(collectionId: string): Promise<ListResult<TemplatePublic>>;
|
|
34
|
+
function getAllowed(collectionId: string, options?: ListOptions): Promise<ListResult<TemplatePublic>>;
|
|
31
35
|
function getPublic(collectionId: string, templateId: string): Promise<TemplatePublic>;
|
|
32
36
|
function getGlobal(templateId: string): Promise<TemplatePublic>;
|
|
33
37
|
/**
|
|
34
|
-
* The global templates this collection may use,
|
|
38
|
+
* The global templates this collection may use, 50 at a time unless you give a `limit` (at most
|
|
39
|
+
* 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
|
|
35
40
|
*
|
|
36
41
|
* @example
|
|
37
42
|
* ```typescript
|
|
38
|
-
* const { items } = await template.getAllowedGlobal('coll_123')
|
|
43
|
+
* const { items, nextCursor } = await template.getAllowedGlobal('coll_123', { limit: 100 })
|
|
39
44
|
* items // TemplatePublic[]
|
|
40
45
|
* ```
|
|
41
46
|
*/
|
|
42
|
-
function getAllowedGlobal(collectionId: string): Promise<ListResult<TemplatePublic>>;
|
|
47
|
+
function getAllowedGlobal(collectionId: string, options?: ListOptions): Promise<ListResult<TemplatePublic>>;
|
|
43
48
|
function render(collectionId: string, templateId: string, body: TemplateRenderRequest): Promise<TemplateRenderResponse>;
|
|
44
49
|
function renderSource(collectionId: string, body: TemplateRenderSourceRequest): Promise<TemplateRenderSourceResponse>;
|
|
45
50
|
}
|
package/dist/api/template.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { request, post, put, del as httpDel } from "../http.js";
|
|
2
|
+
import { listQuery } from "../list.js";
|
|
2
3
|
export var template;
|
|
3
4
|
(function (template) {
|
|
4
5
|
// Admin APIs
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000).
|
|
8
|
+
* Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
|
|
7
9
|
*
|
|
8
10
|
* @example
|
|
9
11
|
* ```typescript
|
|
10
|
-
*
|
|
11
|
-
* items // Template[]
|
|
12
|
+
* let page = await template.getAll('coll_123', { limit: 100 })
|
|
13
|
+
* page.items // Template[]
|
|
14
|
+
* while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor })
|
|
12
15
|
* ```
|
|
13
16
|
*/
|
|
14
|
-
async function getAll(collectionId) {
|
|
15
|
-
const path = `/admin/collection/${encodeURIComponent(collectionId)}/template`;
|
|
17
|
+
async function getAll(collectionId, options = {}) {
|
|
18
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/template${listQuery({ limit: options.limit, cursor: options.cursor })}`;
|
|
16
19
|
return request(path);
|
|
17
20
|
}
|
|
18
21
|
template.getAll = getAll;
|
|
@@ -46,16 +49,18 @@ export var template;
|
|
|
46
49
|
template.uploadAsset = uploadAsset;
|
|
47
50
|
// Public APIs
|
|
48
51
|
/**
|
|
49
|
-
* The collection's templates that may be used publicly,
|
|
52
|
+
* The collection's templates that may be used publicly, 50 at a time unless you give a `limit`
|
|
53
|
+
* (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the
|
|
54
|
+
* last one.
|
|
50
55
|
*
|
|
51
56
|
* @example
|
|
52
57
|
* ```typescript
|
|
53
|
-
* const { items } = await template.getAllowed('coll_123')
|
|
58
|
+
* const { items, nextCursor } = await template.getAllowed('coll_123', { limit: 100 })
|
|
54
59
|
* items // TemplatePublic[]
|
|
55
60
|
* ```
|
|
56
61
|
*/
|
|
57
|
-
async function getAllowed(collectionId) {
|
|
58
|
-
const path = `/public/collection/${encodeURIComponent(collectionId)}/template/getAllowed`;
|
|
62
|
+
async function getAllowed(collectionId, options = {}) {
|
|
63
|
+
const path = `/public/collection/${encodeURIComponent(collectionId)}/template/getAllowed${listQuery({ limit: options.limit, cursor: options.cursor })}`;
|
|
59
64
|
return request(path);
|
|
60
65
|
}
|
|
61
66
|
template.getAllowed = getAllowed;
|
|
@@ -70,16 +75,17 @@ export var template;
|
|
|
70
75
|
}
|
|
71
76
|
template.getGlobal = getGlobal;
|
|
72
77
|
/**
|
|
73
|
-
* The global templates this collection may use,
|
|
78
|
+
* The global templates this collection may use, 50 at a time unless you give a `limit` (at most
|
|
79
|
+
* 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
|
|
74
80
|
*
|
|
75
81
|
* @example
|
|
76
82
|
* ```typescript
|
|
77
|
-
* const { items } = await template.getAllowedGlobal('coll_123')
|
|
83
|
+
* const { items, nextCursor } = await template.getAllowedGlobal('coll_123', { limit: 100 })
|
|
78
84
|
* items // TemplatePublic[]
|
|
79
85
|
* ```
|
|
80
86
|
*/
|
|
81
|
-
async function getAllowedGlobal(collectionId) {
|
|
82
|
-
const path = `/public/template/getAllowed/${encodeURIComponent(collectionId)}`;
|
|
87
|
+
async function getAllowedGlobal(collectionId, options = {}) {
|
|
88
|
+
const path = `/public/template/getAllowed/${encodeURIComponent(collectionId)}${listQuery({ limit: options.limit, cursor: options.cursor })}`;
|
|
83
89
|
return request(path);
|
|
84
90
|
}
|
|
85
91
|
template.getAllowedGlobal = getAllowedGlobal;
|
package/dist/api/translations.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isProxyEnabled, patch, post, put, request } from '../http.js';
|
|
2
2
|
import { clearCachedTranslations, deriveTranslationContextKey, getCachedTranslations, getDefaultTranslationCacheTtlMs, hashTranslationText, normalizeTranslationText, setCachedTranslations, } from '../translationCache.js';
|
|
3
3
|
import { trackTranslation, onActivity as onTranslationActivity, activity as translationActivity, translatingMessage as translatingLine } from '../translationActivity.js';
|
|
4
|
+
import { listQuery } from '../list.js';
|
|
4
5
|
function normalizeLookupRequest(body) {
|
|
5
6
|
var _a, _b, _c;
|
|
6
7
|
const texts = Array.isArray(body.texts)
|
|
@@ -32,16 +33,6 @@ function normalizeLookupRequest(body) {
|
|
|
32
33
|
texts,
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
function buildTranslationListQuery(params = {}) {
|
|
36
|
-
const query = new URLSearchParams();
|
|
37
|
-
for (const [key, value] of Object.entries(params)) {
|
|
38
|
-
if (value === undefined || value === null)
|
|
39
|
-
continue;
|
|
40
|
-
query.append(key, String(value));
|
|
41
|
-
}
|
|
42
|
-
const queryString = query.toString();
|
|
43
|
-
return queryString ? `?${queryString}` : '';
|
|
44
|
-
}
|
|
45
36
|
function sameLanguage(left, right) {
|
|
46
37
|
return left.trim().toLowerCase() === right.trim().toLowerCase();
|
|
47
38
|
}
|
|
@@ -289,8 +280,7 @@ export var translations;
|
|
|
289
280
|
* ```
|
|
290
281
|
*/
|
|
291
282
|
async function list(collectionId, params) {
|
|
292
|
-
const
|
|
293
|
-
const path = `/admin/collection/${encodeURIComponent(collectionId)}/translations${query}`;
|
|
283
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/translations${listQuery(params)}`;
|
|
294
284
|
return request(path);
|
|
295
285
|
}
|
|
296
286
|
translations.list = list;
|