@proveanything/smartlinks 2.2.0 → 3.0.0-alpha.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 +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/i18n.md +9 -9
- 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/i18n.md +9 -9
- 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 +91 -87
- 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
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import type { PublicPlan, MySubscription, SubscriptionStartInput, SubscriptionStartResult, PlanWithPrices, Plan, PlanInput, PlanUpdate, PlanPrice, PlanPriceInput, Membership,
|
|
1
|
+
import type { PublicPlan, MySubscription, SubscriptionStartInput, SubscriptionStartResult, PlanWithPrices, Plan, PlanInput, PlanUpdate, PlanPrice, PlanPriceInput, Membership, SubscriptionListOptions, SubscriptionGrantInput, PlanGrants } from '../types/subscriptions.js';
|
|
2
|
+
import type { ListResult, ListOptions } from '../types/list.js';
|
|
2
3
|
export declare namespace subscriptions {
|
|
3
|
-
/**
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Plans open to new members, each with its prices (monthly, yearly, one-off). All of them in one answer:
|
|
6
|
+
* `nextCursor` is always null.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const { items: plans } = await subscriptions.plans(collectionId)
|
|
11
|
+
* plans.map((p) => p.prices.map((price) => subscriptions.describePrice(price)))
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
function plans(collectionId: string): Promise<ListResult<PublicPlan>>;
|
|
5
15
|
/**
|
|
6
16
|
* Join a plan: Stripe's checkout page for the chosen price. Send them to `checkoutUrl`. Signed in only (a
|
|
7
17
|
* membership belongs to an account). The membership exists once Stripe confirms the payment.
|
|
8
18
|
*
|
|
9
19
|
* @example
|
|
10
20
|
* ```typescript
|
|
11
|
-
* const plans = await subscriptions.plans(collectionId)
|
|
21
|
+
* const { items: plans } = await subscriptions.plans(collectionId)
|
|
12
22
|
* const yearly = plans[0].prices.find((p) => p.interval === 'year')
|
|
13
23
|
* const { checkoutUrl } = await subscriptions.start(collectionId, {
|
|
14
24
|
* priceId: yearly.id,
|
|
@@ -20,8 +30,17 @@ export declare namespace subscriptions {
|
|
|
20
30
|
* @throws `SIGN_IN_REQUIRED`, `ALREADY_MEMBER`, `NOT_FOUND` (closed plan or price), `PAYMENTS_NOT_READY`, `INVALID_INPUT`
|
|
21
31
|
*/
|
|
22
32
|
function start(collectionId: string, input: SubscriptionStartInput): Promise<SubscriptionStartResult>;
|
|
23
|
-
/**
|
|
24
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The signed-in member's memberships, newest first (ended ones too: check `live`). All of them in one
|
|
35
|
+
* answer: `nextCursor` is always null.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const { items } = await subscriptions.mine(collectionId)
|
|
40
|
+
* const current = items.find((s) => s.live)
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
function mine(collectionId: string): Promise<ListResult<MySubscription>>;
|
|
25
44
|
/**
|
|
26
45
|
* Cancel: it ends at the end of the paid period, and access stays until then. A one-off plan or a staff
|
|
27
46
|
* grant ends now. Undo with `resume` before the period ends.
|
|
@@ -50,11 +69,18 @@ export declare namespace subscriptions {
|
|
|
50
69
|
}, locale?: string): string;
|
|
51
70
|
/** The business's side: plans, prices and members (collection admins). Payments use the shop's Stripe set-up. */
|
|
52
71
|
namespace admin {
|
|
53
|
-
|
|
72
|
+
/**
|
|
73
|
+
* The collection's plans with their prices, a page at a time. `active: true` for only the ones open to
|
|
74
|
+
* new members.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const { items, nextCursor } = await subscriptions.admin.listPlans(collectionId, { active: true })
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
function listPlans(collectionId: string, params?: ListOptions & {
|
|
54
82
|
active?: boolean;
|
|
55
|
-
|
|
56
|
-
offset?: number;
|
|
57
|
-
}): Promise<SubscriptionPage<PlanWithPrices>>;
|
|
83
|
+
}): Promise<ListResult<PlanWithPrices>>;
|
|
58
84
|
/** A plan with its prices and how many live members it has. */
|
|
59
85
|
function getPlan(collectionId: string, planId: string): Promise<PlanWithPrices>;
|
|
60
86
|
/** @throws `INVALID_INPUT` */
|
|
@@ -75,8 +101,17 @@ export declare namespace subscriptions {
|
|
|
75
101
|
function removePrice(collectionId: string, priceId: string): Promise<{
|
|
76
102
|
ok: true;
|
|
77
103
|
}>;
|
|
78
|
-
/**
|
|
79
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Memberships, newest first, with each one's plan, a page at a time. `count` is how many match in all.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* let page = await subscriptions.admin.list(collectionId, { live: true, limit: 50 })
|
|
110
|
+
* page.items // Membership[]
|
|
111
|
+
* while (page.nextCursor) page = await subscriptions.admin.list(collectionId, { live: true, limit: 50, cursor: page.nextCursor })
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
function list(collectionId: string, params?: SubscriptionListOptions): Promise<ListResult<Membership>>;
|
|
80
115
|
function get(collectionId: string, subscriptionId: string): Promise<Membership>;
|
|
81
116
|
/** Give someone a plan without payment (free, honorary, paid in cash). Its grants apply at once. */
|
|
82
117
|
function grant(collectionId: string, input: SubscriptionGrantInput): Promise<Membership>;
|
|
@@ -20,7 +20,16 @@ function qs(params) {
|
|
|
20
20
|
}
|
|
21
21
|
export var subscriptions;
|
|
22
22
|
(function (subscriptions) {
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Plans open to new members, each with its prices (monthly, yearly, one-off). All of them in one answer:
|
|
25
|
+
* `nextCursor` is always null.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const { items: plans } = await subscriptions.plans(collectionId)
|
|
30
|
+
* plans.map((p) => p.prices.map((price) => subscriptions.describePrice(price)))
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
24
33
|
async function plans(collectionId) {
|
|
25
34
|
return request(`${pub(collectionId)}/plans`);
|
|
26
35
|
}
|
|
@@ -31,7 +40,7 @@ export var subscriptions;
|
|
|
31
40
|
*
|
|
32
41
|
* @example
|
|
33
42
|
* ```typescript
|
|
34
|
-
* const plans = await subscriptions.plans(collectionId)
|
|
43
|
+
* const { items: plans } = await subscriptions.plans(collectionId)
|
|
35
44
|
* const yearly = plans[0].prices.find((p) => p.interval === 'year')
|
|
36
45
|
* const { checkoutUrl } = await subscriptions.start(collectionId, {
|
|
37
46
|
* priceId: yearly.id,
|
|
@@ -46,7 +55,16 @@ export var subscriptions;
|
|
|
46
55
|
return post(`${pub(collectionId)}/start`, input);
|
|
47
56
|
}
|
|
48
57
|
subscriptions.start = start;
|
|
49
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* The signed-in member's memberships, newest first (ended ones too: check `live`). All of them in one
|
|
60
|
+
* answer: `nextCursor` is always null.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const { items } = await subscriptions.mine(collectionId)
|
|
65
|
+
* const current = items.find((s) => s.live)
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
50
68
|
async function mine(collectionId) {
|
|
51
69
|
return request(`${pub(collectionId)}/mine`);
|
|
52
70
|
}
|
|
@@ -88,6 +106,15 @@ export var subscriptions;
|
|
|
88
106
|
/** The business's side: plans, prices and members (collection admins). Payments use the shop's Stripe set-up. */
|
|
89
107
|
let admin;
|
|
90
108
|
(function (admin) {
|
|
109
|
+
/**
|
|
110
|
+
* The collection's plans with their prices, a page at a time. `active: true` for only the ones open to
|
|
111
|
+
* new members.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const { items, nextCursor } = await subscriptions.admin.listPlans(collectionId, { active: true })
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
91
118
|
async function listPlans(collectionId, params) {
|
|
92
119
|
return request(`${adm(collectionId)}/plans${qs(params)}`);
|
|
93
120
|
}
|
|
@@ -129,7 +156,16 @@ export var subscriptions;
|
|
|
129
156
|
return del(`${adm(collectionId)}/prices/${encodeURIComponent(priceId)}`);
|
|
130
157
|
}
|
|
131
158
|
admin.removePrice = removePrice;
|
|
132
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* Memberships, newest first, with each one's plan, a page at a time. `count` is how many match in all.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* let page = await subscriptions.admin.list(collectionId, { live: true, limit: 50 })
|
|
165
|
+
* page.items // Membership[]
|
|
166
|
+
* while (page.nextCursor) page = await subscriptions.admin.list(collectionId, { live: true, limit: 50, cursor: page.nextCursor })
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
133
169
|
async function list(collectionId, params) {
|
|
134
170
|
return request(`${adm(collectionId)}/subscriptions${qs(params)}`);
|
|
135
171
|
}
|
package/dist/api/tags.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { TagIndexEntry, CreateTagRequest, CreateTagResponse, BatchCreateTagRequest, BatchCreateResult, UpdateTagRequest, UpdateTagResponse, DeleteTagResponse, GetTagResponse, ListTagsRequest,
|
|
1
|
+
import type { Tag, TagIndexEntry, CreateTagRequest, CreateTagResponse, BatchCreateTagRequest, BatchCreateResult, UpdateTagRequest, UpdateTagResponse, DeleteTagResponse, GetTagResponse, ListTagsRequest, LookupTagsRequest, LookupTagsQueryRequest, TagLookupResponse, PublicGetTagResponse, ByRefRequest, ByRefResponse, ReverseTagLookupParams } from "../types/tags.js";
|
|
2
|
+
import type { ListResult } from "../types/list.js";
|
|
2
3
|
/**
|
|
3
4
|
* Tag Management API
|
|
4
5
|
*
|
|
@@ -110,25 +111,28 @@ export declare namespace tags {
|
|
|
110
111
|
*/
|
|
111
112
|
function remove(collectionId: string, tagId: string): Promise<DeleteTagResponse>;
|
|
112
113
|
/**
|
|
113
|
-
* List tags with optional filters
|
|
114
|
+
* List tags with optional filters, a page at a time (admin).
|
|
114
115
|
*
|
|
115
116
|
* @param collectionId - Collection context
|
|
116
|
-
* @param params - Optional
|
|
117
|
-
* @returns `{
|
|
117
|
+
* @param params - Optional filters, plus `limit` and `cursor`
|
|
118
|
+
* @returns `{ items: Tag[], nextCursor: string | null }`
|
|
118
119
|
*
|
|
119
120
|
* @example
|
|
120
121
|
* ```typescript
|
|
121
|
-
* //
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
122
|
+
* // Tags for a product, page by page
|
|
123
|
+
* let page = await tags.list('coll_123', { productId: 'prod_456', limit: 100 })
|
|
124
|
+
* while (page.nextCursor) {
|
|
125
|
+
* page = await tags.list('coll_123', { productId: 'prod_456', limit: 100, cursor: page.nextCursor })
|
|
126
|
+
* }
|
|
127
|
+
*
|
|
128
|
+
* // Tags linked to a container
|
|
129
|
+
* const { items: linked } = await tags.list('coll_123', {
|
|
126
130
|
* refType: 'container',
|
|
127
131
|
* refId: 'container-uuid',
|
|
128
132
|
* })
|
|
129
133
|
* ```
|
|
130
134
|
*/
|
|
131
|
-
function list(collectionId: string, params?: ListTagsRequest): Promise<
|
|
135
|
+
function list(collectionId: string, params?: ListTagsRequest): Promise<ListResult<Tag>>;
|
|
132
136
|
/**
|
|
133
137
|
* Reverse lookup — find all tags linked to a given object (admin).
|
|
134
138
|
*
|
|
@@ -137,17 +141,17 @@ export declare namespace tags {
|
|
|
137
141
|
*
|
|
138
142
|
* @param collectionId - Collection context
|
|
139
143
|
* @param params - `refType` and `refId` are required
|
|
140
|
-
* @returns `{
|
|
144
|
+
* @returns `{ items: Tag[], nextCursor: null }`: every linked tag in one answer
|
|
141
145
|
*
|
|
142
146
|
* @example
|
|
143
147
|
* ```typescript
|
|
144
|
-
* const {
|
|
148
|
+
* const { items: linked } = await tags.byRef('coll_123', {
|
|
145
149
|
* refType: 'container',
|
|
146
150
|
* refId: 'container-uuid',
|
|
147
151
|
* })
|
|
148
152
|
* ```
|
|
149
153
|
*/
|
|
150
|
-
function byRef(collectionId: string, params: ReverseTagLookupParams): Promise<
|
|
154
|
+
function byRef(collectionId: string, params: ReverseTagLookupParams): Promise<ListResult<Tag>>;
|
|
151
155
|
/**
|
|
152
156
|
* Global tag resolve — returns `{ tagId, collectionId }` only.
|
|
153
157
|
*
|
|
@@ -206,11 +210,11 @@ export declare namespace tags {
|
|
|
206
210
|
*
|
|
207
211
|
* @param collectionId - Collection context
|
|
208
212
|
* @param data - `{ tagIds: string[], embed?: string }`
|
|
209
|
-
* @returns `{
|
|
213
|
+
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
|
|
210
214
|
*
|
|
211
215
|
* @example
|
|
212
216
|
* ```typescript
|
|
213
|
-
* const {
|
|
217
|
+
* const { items, count, embedded } = await tags.lookupTags('coll_123', {
|
|
214
218
|
* tagIds: ['NFC-001', 'NFC-002', 'NFC-003'],
|
|
215
219
|
* embed: 'product,proof',
|
|
216
220
|
* })
|
|
@@ -224,7 +228,15 @@ export declare namespace tags {
|
|
|
224
228
|
*
|
|
225
229
|
* @param collectionId - Collection context
|
|
226
230
|
* @param params - `tagIds` is comma-separated; `embed` is optional
|
|
227
|
-
* @returns `{
|
|
231
|
+
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```typescript
|
|
235
|
+
* const { items, embedded } = await tags.lookupTagsQuery('coll_123', {
|
|
236
|
+
* tagIds: 'NFC-001,NFC-002',
|
|
237
|
+
* embed: 'product',
|
|
238
|
+
* })
|
|
239
|
+
* ```
|
|
228
240
|
*/
|
|
229
241
|
function lookupTagsQuery(collectionId: string, params: LookupTagsQueryRequest): Promise<TagLookupResponse>;
|
|
230
242
|
/**
|
|
@@ -234,11 +246,11 @@ export declare namespace tags {
|
|
|
234
246
|
*
|
|
235
247
|
* @param collectionId - Collection context
|
|
236
248
|
* @param params - `refType` and `refId` are required; `embed` is optional
|
|
237
|
-
* @returns `{
|
|
249
|
+
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
|
|
238
250
|
*
|
|
239
251
|
* @example
|
|
240
252
|
* ```typescript
|
|
241
|
-
* const {
|
|
253
|
+
* const { items: linked, embedded } = await tags.publicByRef('coll_123', {
|
|
242
254
|
* refType: 'container',
|
|
243
255
|
* refId: 'container-uuid',
|
|
244
256
|
* embed: 'container',
|
|
@@ -254,7 +266,16 @@ export declare namespace tags {
|
|
|
254
266
|
*
|
|
255
267
|
* @param collectionId - Collection context
|
|
256
268
|
* @param data - `{ refType, refId, embed? }`
|
|
257
|
-
* @returns `{
|
|
269
|
+
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```typescript
|
|
273
|
+
* const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
|
|
274
|
+
* refType: 'container',
|
|
275
|
+
* refId: 'container-uuid',
|
|
276
|
+
* embed: 'container',
|
|
277
|
+
* })
|
|
278
|
+
* ```
|
|
258
279
|
*/
|
|
259
280
|
function publicByRefPost(collectionId: string, data: ByRefRequest): Promise<ByRefResponse>;
|
|
260
281
|
}
|
package/dist/api/tags.js
CHANGED
|
@@ -135,19 +135,22 @@ export var tags;
|
|
|
135
135
|
}
|
|
136
136
|
tags.remove = remove;
|
|
137
137
|
/**
|
|
138
|
-
* List tags with optional filters
|
|
138
|
+
* List tags with optional filters, a page at a time (admin).
|
|
139
139
|
*
|
|
140
140
|
* @param collectionId - Collection context
|
|
141
|
-
* @param params - Optional
|
|
142
|
-
* @returns `{
|
|
141
|
+
* @param params - Optional filters, plus `limit` and `cursor`
|
|
142
|
+
* @returns `{ items: Tag[], nextCursor: string | null }`
|
|
143
143
|
*
|
|
144
144
|
* @example
|
|
145
145
|
* ```typescript
|
|
146
|
-
* //
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
146
|
+
* // Tags for a product, page by page
|
|
147
|
+
* let page = await tags.list('coll_123', { productId: 'prod_456', limit: 100 })
|
|
148
|
+
* while (page.nextCursor) {
|
|
149
|
+
* page = await tags.list('coll_123', { productId: 'prod_456', limit: 100, cursor: page.nextCursor })
|
|
150
|
+
* }
|
|
151
|
+
*
|
|
152
|
+
* // Tags linked to a container
|
|
153
|
+
* const { items: linked } = await tags.list('coll_123', {
|
|
151
154
|
* refType: 'container',
|
|
152
155
|
* refId: 'container-uuid',
|
|
153
156
|
* })
|
|
@@ -157,8 +160,8 @@ export var tags;
|
|
|
157
160
|
const q = new URLSearchParams();
|
|
158
161
|
if (params === null || params === void 0 ? void 0 : params.limit)
|
|
159
162
|
q.append('limit', params.limit.toString());
|
|
160
|
-
if (params === null || params === void 0 ? void 0 : params.
|
|
161
|
-
q.append('
|
|
163
|
+
if (params === null || params === void 0 ? void 0 : params.cursor)
|
|
164
|
+
q.append('cursor', params.cursor);
|
|
162
165
|
if (params === null || params === void 0 ? void 0 : params.productId)
|
|
163
166
|
q.append('productId', params.productId);
|
|
164
167
|
if (params === null || params === void 0 ? void 0 : params.variantId)
|
|
@@ -182,11 +185,11 @@ export var tags;
|
|
|
182
185
|
*
|
|
183
186
|
* @param collectionId - Collection context
|
|
184
187
|
* @param params - `refType` and `refId` are required
|
|
185
|
-
* @returns `{
|
|
188
|
+
* @returns `{ items: Tag[], nextCursor: null }`: every linked tag in one answer
|
|
186
189
|
*
|
|
187
190
|
* @example
|
|
188
191
|
* ```typescript
|
|
189
|
-
* const {
|
|
192
|
+
* const { items: linked } = await tags.byRef('coll_123', {
|
|
190
193
|
* refType: 'container',
|
|
191
194
|
* refId: 'container-uuid',
|
|
192
195
|
* })
|
|
@@ -276,11 +279,11 @@ export var tags;
|
|
|
276
279
|
*
|
|
277
280
|
* @param collectionId - Collection context
|
|
278
281
|
* @param data - `{ tagIds: string[], embed?: string }`
|
|
279
|
-
* @returns `{
|
|
282
|
+
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
|
|
280
283
|
*
|
|
281
284
|
* @example
|
|
282
285
|
* ```typescript
|
|
283
|
-
* const {
|
|
286
|
+
* const { items, count, embedded } = await tags.lookupTags('coll_123', {
|
|
284
287
|
* tagIds: ['NFC-001', 'NFC-002', 'NFC-003'],
|
|
285
288
|
* embed: 'product,proof',
|
|
286
289
|
* })
|
|
@@ -298,7 +301,15 @@ export var tags;
|
|
|
298
301
|
*
|
|
299
302
|
* @param collectionId - Collection context
|
|
300
303
|
* @param params - `tagIds` is comma-separated; `embed` is optional
|
|
301
|
-
* @returns `{
|
|
304
|
+
* @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* ```typescript
|
|
308
|
+
* const { items, embedded } = await tags.lookupTagsQuery('coll_123', {
|
|
309
|
+
* tagIds: 'NFC-001,NFC-002',
|
|
310
|
+
* embed: 'product',
|
|
311
|
+
* })
|
|
312
|
+
* ```
|
|
302
313
|
*/
|
|
303
314
|
async function lookupTagsQuery(collectionId, params) {
|
|
304
315
|
const q = new URLSearchParams();
|
|
@@ -316,11 +327,11 @@ export var tags;
|
|
|
316
327
|
*
|
|
317
328
|
* @param collectionId - Collection context
|
|
318
329
|
* @param params - `refType` and `refId` are required; `embed` is optional
|
|
319
|
-
* @returns `{
|
|
330
|
+
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
|
|
320
331
|
*
|
|
321
332
|
* @example
|
|
322
333
|
* ```typescript
|
|
323
|
-
* const {
|
|
334
|
+
* const { items: linked, embedded } = await tags.publicByRef('coll_123', {
|
|
324
335
|
* refType: 'container',
|
|
325
336
|
* refId: 'container-uuid',
|
|
326
337
|
* embed: 'container',
|
|
@@ -345,7 +356,16 @@ export var tags;
|
|
|
345
356
|
*
|
|
346
357
|
* @param collectionId - Collection context
|
|
347
358
|
* @param data - `{ refType, refId, embed? }`
|
|
348
|
-
* @returns `{
|
|
359
|
+
* @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* ```typescript
|
|
363
|
+
* const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
|
|
364
|
+
* refType: 'container',
|
|
365
|
+
* refId: 'container-uuid',
|
|
366
|
+
* embed: 'container',
|
|
367
|
+
* })
|
|
368
|
+
* ```
|
|
349
369
|
*/
|
|
350
370
|
async function publicByRefPost(collectionId, data) {
|
|
351
371
|
const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/by-ref`;
|
package/dist/api/template.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
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
3
|
export declare namespace template {
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Every template in the collection (admin), in one answer: `nextCursor` is always null.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const { items } = await template.getAll('coll_123')
|
|
10
|
+
* items // Template[]
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
function getAll(collectionId: string): Promise<ListResult<Template>>;
|
|
4
14
|
function get(collectionId: string, templateId: string): Promise<Template>;
|
|
5
15
|
function create(collectionId: string, data: TemplateInput): Promise<Template>;
|
|
6
16
|
function update(collectionId: string, templateId: string, data: TemplateUpdate): Promise<Template>;
|
|
@@ -8,10 +18,28 @@ export declare namespace template {
|
|
|
8
18
|
function uploadAsset(collectionId: string, templateId: string, file: File | Blob): Promise<{
|
|
9
19
|
url: string;
|
|
10
20
|
}>;
|
|
11
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The collection's templates that may be used publicly, in one answer: `nextCursor` is always null.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const { items } = await template.getAllowed('coll_123')
|
|
27
|
+
* items // TemplatePublic[]
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
function getAllowed(collectionId: string): Promise<ListResult<TemplatePublic>>;
|
|
12
31
|
function getPublic(collectionId: string, templateId: string): Promise<TemplatePublic>;
|
|
13
32
|
function getGlobal(templateId: string): Promise<TemplatePublic>;
|
|
14
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The global templates this collection may use, in one answer: `nextCursor` is always null.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const { items } = await template.getAllowedGlobal('coll_123')
|
|
39
|
+
* items // TemplatePublic[]
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
function getAllowedGlobal(collectionId: string): Promise<ListResult<TemplatePublic>>;
|
|
15
43
|
function render(collectionId: string, templateId: string, body: TemplateRenderRequest): Promise<TemplateRenderResponse>;
|
|
16
44
|
function renderSource(collectionId: string, body: TemplateRenderSourceRequest): Promise<TemplateRenderSourceResponse>;
|
|
17
45
|
}
|
package/dist/api/template.js
CHANGED
|
@@ -2,6 +2,15 @@ import { request, post, put, del as httpDel } from "../http.js";
|
|
|
2
2
|
export var template;
|
|
3
3
|
(function (template) {
|
|
4
4
|
// Admin APIs
|
|
5
|
+
/**
|
|
6
|
+
* Every template in the collection (admin), in one answer: `nextCursor` is always null.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const { items } = await template.getAll('coll_123')
|
|
11
|
+
* items // Template[]
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
5
14
|
async function getAll(collectionId) {
|
|
6
15
|
const path = `/admin/collection/${encodeURIComponent(collectionId)}/template`;
|
|
7
16
|
return request(path);
|
|
@@ -36,6 +45,15 @@ export var template;
|
|
|
36
45
|
}
|
|
37
46
|
template.uploadAsset = uploadAsset;
|
|
38
47
|
// Public APIs
|
|
48
|
+
/**
|
|
49
|
+
* The collection's templates that may be used publicly, in one answer: `nextCursor` is always null.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const { items } = await template.getAllowed('coll_123')
|
|
54
|
+
* items // TemplatePublic[]
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
39
57
|
async function getAllowed(collectionId) {
|
|
40
58
|
const path = `/public/collection/${encodeURIComponent(collectionId)}/template/getAllowed`;
|
|
41
59
|
return request(path);
|
|
@@ -51,6 +69,15 @@ export var template;
|
|
|
51
69
|
return request(path);
|
|
52
70
|
}
|
|
53
71
|
template.getGlobal = getGlobal;
|
|
72
|
+
/**
|
|
73
|
+
* The global templates this collection may use, in one answer: `nextCursor` is always null.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const { items } = await template.getAllowedGlobal('coll_123')
|
|
78
|
+
* items // TemplatePublic[]
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
54
81
|
async function getAllowedGlobal(collectionId) {
|
|
55
82
|
const path = `/public/template/getAllowed/${encodeURIComponent(collectionId)}`;
|
|
56
83
|
return request(path);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TranslationActivity } from '../translationActivity.js';
|
|
2
|
-
import type { ResolvedTranslationResponse, TranslationHashOptions, TranslationListParams,
|
|
2
|
+
import type { ResolvedTranslationResponse, TranslationHashOptions, TranslationListParams, TranslationLookupRequest, TranslationLookupResponse, TranslationRecord, TranslationResolveOptions, TranslationRules, TranslationUpdateRequest } from '../types/translations.js';
|
|
3
|
+
import type { ListResult } from '../types/list.js';
|
|
3
4
|
/** @internal tests only */
|
|
4
5
|
export declare function _resetRevisionChecks(): void;
|
|
5
6
|
export declare namespace translations {
|
|
@@ -22,7 +23,21 @@ export declare namespace translations {
|
|
|
22
23
|
/** Whether a first-time translation is under way right now (see onActivity). */
|
|
23
24
|
function activity(): TranslationActivity;
|
|
24
25
|
function resolve(collectionId: string, body: TranslationLookupRequest, options?: TranslationResolveOptions): Promise<ResolvedTranslationResponse>;
|
|
25
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Admin: the collection's stored translations, a page at a time. Filter by language, content type, where
|
|
28
|
+
* the text appears (`contextKey`), a search (`q`), whether a person edited it (`isOverride`), or whether
|
|
29
|
+
* it misses the site's required wording (`termIssues`). `count` is how many match in all.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* let page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50 })
|
|
34
|
+
* page.items // TranslationRecord[]
|
|
35
|
+
* while (page.nextCursor) {
|
|
36
|
+
* page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50, cursor: page.nextCursor })
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
function list(collectionId: string, params?: TranslationListParams): Promise<ListResult<TranslationRecord>>;
|
|
26
41
|
function get(collectionId: string, translationId: string): Promise<TranslationRecord>;
|
|
27
42
|
function update(collectionId: string, translationId: string, body: TranslationUpdateRequest): Promise<TranslationRecord>;
|
|
28
43
|
/** Admin: how many translations exist per language, and how many a person has edited. */
|
package/dist/api/translations.js
CHANGED
|
@@ -274,6 +274,20 @@ export var translations;
|
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
276
|
translations.resolve = resolve;
|
|
277
|
+
/**
|
|
278
|
+
* Admin: the collection's stored translations, a page at a time. Filter by language, content type, where
|
|
279
|
+
* the text appears (`contextKey`), a search (`q`), whether a person edited it (`isOverride`), or whether
|
|
280
|
+
* it misses the site's required wording (`termIssues`). `count` is how many match in all.
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* let page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50 })
|
|
285
|
+
* page.items // TranslationRecord[]
|
|
286
|
+
* while (page.nextCursor) {
|
|
287
|
+
* page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50, cursor: page.nextCursor })
|
|
288
|
+
* }
|
|
289
|
+
* ```
|
|
290
|
+
*/
|
|
277
291
|
async function list(collectionId, params) {
|
|
278
292
|
const query = buildTranslationListQuery(params);
|
|
279
293
|
const path = `/admin/collection/${encodeURIComponent(collectionId)}/translations${query}`;
|
package/dist/api/userGroups.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UserGroup, CreateUserGroupRequest, UpdateUserGroupRequest, UserGroupMember, AddUserGroupMemberRequest, UserGroupRef, MyUserGroups, UserGroupChange, UserGroupHistoryParams } from "../types/userGroups.js";
|
|
2
|
+
import type { ListResult } from "../types/list.js";
|
|
2
3
|
/**
|
|
3
4
|
* User groups: named lists of people in a collection, used to say who may do what.
|
|
4
5
|
*
|
|
@@ -21,8 +22,16 @@ export declare namespace userGroups {
|
|
|
21
22
|
* ```
|
|
22
23
|
*/
|
|
23
24
|
function mine(collectionId: string): Promise<MyUserGroups>;
|
|
24
|
-
/**
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Every user group in the collection (admin), in one answer: `nextCursor` is always null.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const { items } = await userGroups.list('coll_123')
|
|
31
|
+
* items.map((g) => g.name)
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
function list(collectionId: string): Promise<ListResult<UserGroup>>;
|
|
26
35
|
/** One user group (admin). */
|
|
27
36
|
function get(collectionId: string, userGroupId: string): Promise<UserGroup>;
|
|
28
37
|
/**
|
|
@@ -46,8 +55,16 @@ export declare namespace userGroups {
|
|
|
46
55
|
function update(collectionId: string, userGroupId: string, data: UpdateUserGroupRequest): Promise<UserGroup>;
|
|
47
56
|
/** Delete a user group (admin). Its members lose whatever it allowed. */
|
|
48
57
|
function remove(collectionId: string, userGroupId: string): Promise<UserGroup>;
|
|
49
|
-
/**
|
|
50
|
-
|
|
58
|
+
/**
|
|
59
|
+
* The people in a user group, with name and email (admin), in one answer: `nextCursor` is always null.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* const { items } = await userGroups.members('coll_123', qc.id)
|
|
64
|
+
* items // [{ uid, name, email }]
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
function members(collectionId: string, userGroupId: string): Promise<ListResult<UserGroupMember>>;
|
|
51
68
|
/**
|
|
52
69
|
* Add one person (admin), by user id or by email. By email, the person is found in the collection's
|
|
53
70
|
* logins or added to them (no welcome email is sent). Adding someone who is already in changes nothing.
|
|
@@ -65,14 +82,23 @@ export declare namespace userGroups {
|
|
|
65
82
|
* or removed, each with the admin who did it (`actorId`) and when (`at`). Give `userGroupId` for one
|
|
66
83
|
* user group, `userId` for everything about one person, or neither for the whole collection.
|
|
67
84
|
* Covers the last 30 days unless you give `from` / `to` (at most 400 days). Takes about a second.
|
|
85
|
+
* It has no further pages (`nextCursor` is always null): ask for more with `limit`, or narrow the dates.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const { items } = await userGroups.history('coll_123', { userId: 'uid_1' })
|
|
90
|
+
* // items: [{ at, type: 'usergroup.member-added', actorId: 'uid_admin', data: { key: 'qc-controllers', userId: 'uid_1', … } }]
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
function history(collectionId: string, params?: UserGroupHistoryParams): Promise<ListResult<UserGroupChange>>;
|
|
94
|
+
/**
|
|
95
|
+
* The user groups one person is in (admin), in one answer: `nextCursor` is always null.
|
|
68
96
|
*
|
|
69
97
|
* @example
|
|
70
98
|
* ```typescript
|
|
71
|
-
* const
|
|
72
|
-
* // [{
|
|
99
|
+
* const { items } = await userGroups.ofUser('coll_123', 'uid_1')
|
|
100
|
+
* items // [{ id, key, name }]
|
|
73
101
|
* ```
|
|
74
102
|
*/
|
|
75
|
-
function
|
|
76
|
-
/** The user groups one person is in (admin). */
|
|
77
|
-
function ofUser(collectionId: string, userId: string): Promise<UserGroupRef[]>;
|
|
103
|
+
function ofUser(collectionId: string, userId: string): Promise<ListResult<UserGroupRef>>;
|
|
78
104
|
}
|