@proveanything/smartlinks 2.0.66 → 2.0.68

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/dist/ai-tools.js CHANGED
@@ -62,7 +62,7 @@ export const BUILTIN_AI_TOOLS = [
62
62
  { name: 'image.transform', group: 'media', capabilities: ['media:image'],
63
63
  description: 'Transform an image: resize/crop/rotate/flip/grayscale/tint/format-convert/compress → hosted URL.' },
64
64
  { name: 'pdf.create', group: 'media', capabilities: ['media:pdf'],
65
- description: 'Render HTML to a PDF and return a hosted URL.' },
65
+ description: 'Render HTML (or one fragment per page) to a PDF, 1:1: exact page sizes (width/height/unit) for labels, many pages per call, text and SVG kept vector, no scripts. Returns a public URL, an expiring private link, or base64; identical inputs reuse the cached render.' },
66
66
  { name: 'pdf.fill', group: 'media', capabilities: ['media:pdf'],
67
67
  description: 'Fill an AcroForm PDF\'s fields from a { field: value } map → hosted URL.' },
68
68
  { name: 'pdf.merge', group: 'media', capabilities: ['media:pdf'],
@@ -1,4 +1,4 @@
1
- import type { AuthLoginResponse, AppleLoginOptions, RefreshResponse, LogoutResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig, AuthKitConfigInput, MagicLinkSendResponse, MagicLinkVerifyResponse, UserProfile, UpdateProfileResponse, ProfileUpdateData, SuccessResponse, SendWhatsAppRequest, SendWhatsAppResponse, ExchangeWhatsAppSessionResponse, VerifyWhatsAppResponse, WhatsAppStatusResponse, SendSmsVerifyRequest, SendSmsVerifyResponse, VerifySmsResponse, UpsertContactRequest, UpsertContactResponse, MfaChallengeSendResponse, MfaFinalizeResponse, MfaEnrollSendResponse, MfaEnrolledResponse, MfaFactorsResponse, TrustedDevice } from "../types/authKit.js";
1
+ import type { AuthLoginResponse, AppleLoginOptions, RefreshResponse, LogoutResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig, AuthKitConfigInput, AuthKitSetIdentityResponse, MagicLinkSendResponse, MagicLinkVerifyResponse, UserProfile, UpdateProfileResponse, ProfileUpdateData, SuccessResponse, SendWhatsAppRequest, SendWhatsAppResponse, ExchangeWhatsAppSessionResponse, VerifyWhatsAppResponse, WhatsAppStatusResponse, SendSmsVerifyRequest, SendSmsVerifyResponse, VerifySmsResponse, UpsertContactRequest, UpsertContactResponse, MfaChallengeSendResponse, MfaFinalizeResponse, MfaEnrollSendResponse, MfaEnrolledResponse, MfaFactorsResponse, TrustedDevice } from "../types/authKit.js";
2
2
  /**
3
3
  * Namespace containing helper functions for the new AuthKit API.
4
4
  * Legacy collection-based authKit helpers retained (marked as *Legacy*).
@@ -268,5 +268,18 @@ export declare namespace authKit {
268
268
  * back via {@link load}.
269
269
  */
270
270
  function update(collectionId: string, authKitId: string, data: AuthKitConfigInput): Promise<AuthKitConfig>;
271
+ /**
272
+ * Give this AuthKit its **own logins** (admin): its members become accounts of this site only —
273
+ * the same email can be a separate account, with its own password, on another site — rather than
274
+ * SmartLinks accounts shared across sites. One way: a site with its own members can't go back to the
275
+ * shared pool. Members who signed up before keep their SmartLinks account until moved across.
276
+ *
277
+ * Errors: `MEMBER_POOL_CONFLICT` (409) when another AuthKit already gives one of its collections its
278
+ * own logins (one per collection); `PERMISSION_DENIED` (403) unless you administer every collection
279
+ * it serves.
280
+ */
281
+ function setIdentity(collectionId: string, authKitId: string, body: {
282
+ mode: 'own';
283
+ }): Promise<AuthKitSetIdentityResponse>;
271
284
  function remove(collectionId: string, authKitId: string): Promise<void>;
272
285
  }
@@ -510,6 +510,21 @@ export var authKit;
510
510
  return put(path, data);
511
511
  }
512
512
  authKit.update = update;
513
+ /**
514
+ * Give this AuthKit its **own logins** (admin): its members become accounts of this site only —
515
+ * the same email can be a separate account, with its own password, on another site — rather than
516
+ * SmartLinks accounts shared across sites. One way: a site with its own members can't go back to the
517
+ * shared pool. Members who signed up before keep their SmartLinks account until moved across.
518
+ *
519
+ * Errors: `MEMBER_POOL_CONFLICT` (409) when another AuthKit already gives one of its collections its
520
+ * own logins (one per collection); `PERMISSION_DENIED` (403) unless you administer every collection
521
+ * it serves.
522
+ */
523
+ async function setIdentity(collectionId, authKitId, body) {
524
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/authKit/${encodeURIComponent(authKitId)}/identity`;
525
+ return post(path, body);
526
+ }
527
+ authKit.setIdentity = setIdentity;
513
528
  async function remove(collectionId, authKitId) {
514
529
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/authKit/${encodeURIComponent(authKitId)}`;
515
530
  return del(path);
@@ -68,27 +68,37 @@ export declare namespace collection {
68
68
  */
69
69
  function claimHub(collectionId: string, hubName: string): Promise<CollectionResponse>;
70
70
  /**
71
- * Register a custom domain for a collection and provision its managed
72
- * certificate (admin only).
71
+ * Connect one of the collection's own domains and start its certificate (admin only).
73
72
  *
74
73
  * @param collectionId – Identifier of the collection
75
- * @param domain – The fully-qualified domain to register (e.g. "hub.acme.com")
76
- * @param target – Which load balancer / certificate map to use. Defaults to
77
- * `"smartlinks"` (the id.smartlinks.app load balancer). Pass `"hub"` to
78
- * register a bring-your-own Hub domain.
74
+ * @param domain – The fully-qualified domain (e.g. "id.acme.com", "hub.acme.com")
75
+ * @param target – `"links"` (default) for a links domain (GS1 Digital Links, short links, portal),
76
+ * or `"site"` for the collection's Hub domain.
79
77
  * @returns Promise resolving when registration has been initiated
80
- * @throws ErrorResponse if the request fails
78
+ * @throws ErrorResponse if the request fails (409 DOMAIN_IN_USE when it's already the other kind)
81
79
  */
82
80
  function registerDomain(collectionId: string, domain: string, target?: DomainTarget): Promise<any>;
83
81
  /**
84
- * Get the managed-certificate status for a collection's custom domain (admin only).
82
+ * Get the certificate status of the collection's own domain (admin only).
85
83
  * @param collectionId – Identifier of the collection
86
- * @param target – Which domain to check: `"smartlinks"` (default, uses `redirectUrl`)
87
- * or `"hub"` (uses `hubCustomDomain`)
88
- * @returns Promise resolving to the certificate details
84
+ * @param target – Which domain to check: `"links"` (default, its `redirectUrl`)
85
+ * or `"site"` (its Hub domain, `hubCustomDomain`)
86
+ * @returns Promise resolving to the certificate / custom hostname details
89
87
  * @throws ErrorResponse (404) if the relevant domain is not set
90
88
  */
91
89
  function getDomainStatus(collectionId: string, target?: DomainTarget): Promise<any>;
90
+ /**
91
+ * Remove the collection's links domain (admin only). It stops working straight away: QR codes,
92
+ * GS1 Digital Links and short links printed with it no longer open. Its certificate goes and
93
+ * `redirectUrl` is cleared. (Site domains are removed from the site's settings.)
94
+ * @param collectionId – Identifier of the collection
95
+ * @param domain – The links domain to remove
96
+ * @returns Promise resolving to `{ released }`
97
+ * @throws ErrorResponse (409 SITE_DOMAIN) if the domain is a site's domain
98
+ */
99
+ function releaseDomain(collectionId: string, domain: string): Promise<{
100
+ released: string;
101
+ }>;
92
102
  /**
93
103
  * Retrieve a specific settings group for a collection.
94
104
  * Public reads return the public view of the settings group. If the stored payload contains
@@ -101,36 +101,48 @@ export var collection;
101
101
  }
102
102
  collection.claimHub = claimHub;
103
103
  /**
104
- * Register a custom domain for a collection and provision its managed
105
- * certificate (admin only).
104
+ * Connect one of the collection's own domains and start its certificate (admin only).
106
105
  *
107
106
  * @param collectionId – Identifier of the collection
108
- * @param domain – The fully-qualified domain to register (e.g. "hub.acme.com")
109
- * @param target – Which load balancer / certificate map to use. Defaults to
110
- * `"smartlinks"` (the id.smartlinks.app load balancer). Pass `"hub"` to
111
- * register a bring-your-own Hub domain.
107
+ * @param domain – The fully-qualified domain (e.g. "id.acme.com", "hub.acme.com")
108
+ * @param target – `"links"` (default) for a links domain (GS1 Digital Links, short links, portal),
109
+ * or `"site"` for the collection's Hub domain.
112
110
  * @returns Promise resolving when registration has been initiated
113
- * @throws ErrorResponse if the request fails
111
+ * @throws ErrorResponse if the request fails (409 DOMAIN_IN_USE when it's already the other kind)
114
112
  */
115
- async function registerDomain(collectionId, domain, target = "smartlinks") {
113
+ async function registerDomain(collectionId, domain, target = "links") {
116
114
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/domain`;
117
115
  return post(path, { domain, target });
118
116
  }
119
117
  collection.registerDomain = registerDomain;
120
118
  /**
121
- * Get the managed-certificate status for a collection's custom domain (admin only).
119
+ * Get the certificate status of the collection's own domain (admin only).
122
120
  * @param collectionId – Identifier of the collection
123
- * @param target – Which domain to check: `"smartlinks"` (default, uses `redirectUrl`)
124
- * or `"hub"` (uses `hubCustomDomain`)
125
- * @returns Promise resolving to the certificate details
121
+ * @param target – Which domain to check: `"links"` (default, its `redirectUrl`)
122
+ * or `"site"` (its Hub domain, `hubCustomDomain`)
123
+ * @returns Promise resolving to the certificate / custom hostname details
126
124
  * @throws ErrorResponse (404) if the relevant domain is not set
127
125
  */
128
- async function getDomainStatus(collectionId, target = "smartlinks") {
126
+ async function getDomainStatus(collectionId, target = "links") {
129
127
  const queryParams = new URLSearchParams({ target });
130
128
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/domain?${queryParams}`;
131
129
  return request(path);
132
130
  }
133
131
  collection.getDomainStatus = getDomainStatus;
132
+ /**
133
+ * Remove the collection's links domain (admin only). It stops working straight away: QR codes,
134
+ * GS1 Digital Links and short links printed with it no longer open. Its certificate goes and
135
+ * `redirectUrl` is cleared. (Site domains are removed from the site's settings.)
136
+ * @param collectionId – Identifier of the collection
137
+ * @param domain – The links domain to remove
138
+ * @returns Promise resolving to `{ released }`
139
+ * @throws ErrorResponse (409 SITE_DOMAIN) if the domain is a site's domain
140
+ */
141
+ async function releaseDomain(collectionId, domain) {
142
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/domain/${encodeURIComponent(domain)}`;
143
+ return del(path);
144
+ }
145
+ collection.releaseDomain = releaseDomain;
134
146
  /**
135
147
  * Retrieve a specific settings group for a collection.
136
148
  * Public reads return the public view of the settings group. If the stored payload contains
@@ -6,9 +6,9 @@ import type { TagIndexEntry, CreateTagRequest, CreateTagResponse, BatchCreateTag
6
6
  * etc.) and products, proofs, or any polymorphic object in the platform.
7
7
  *
8
8
  * ### Two-tier architecture
9
- * - **Per-org shard** (`tags` table) — full tag data; used for all collection-scoped
9
+ * - **Per-org shard** (`tags` table) — full tag data; used for all collection-scoped
10
10
  * queries.
11
- * - **Shared shard** (`tag_index` table) — `tagId → collectionId` routing only; used
11
+ * - **Shared shard** (`tag_index` table) — `tagId → collectionId` routing only; used
12
12
  * when the collection is not yet known.
13
13
  *
14
14
  * 99% of callers will know the collection and should use collection-scoped endpoints
@@ -49,7 +49,7 @@ export declare namespace tags {
49
49
  *
50
50
  * Tags with `productId` but no `proofId` automatically get serial numbers.
51
51
  * Serial number generation is grouped by `(productId, variantId, batchId)` for
52
- * efficiency. Partial success is possible — check `results` for individual outcomes.
52
+ * efficiency. Partial success is possible — check `results` for individual outcomes.
53
53
  *
54
54
  * @param collectionId - Collection context
55
55
  * @param data - Batch payload; `force` applies to all tags in the batch
@@ -78,7 +78,7 @@ export declare namespace tags {
78
78
  /**
79
79
  * Update a tag (admin).
80
80
  *
81
- * Partial update — only provided fields are changed. `metadata` is
81
+ * Partial update — only provided fields are changed. `metadata` is
82
82
  * deep-merged with the existing value. Pass `refType: null, refId: null`
83
83
  * to clear the polymorphic ref.
84
84
  *
@@ -130,7 +130,7 @@ export declare namespace tags {
130
130
  */
131
131
  function list(collectionId: string, params?: ListTagsRequest): Promise<ListTagsResponse>;
132
132
  /**
133
- * Reverse lookup — find all tags linked to a given object (admin).
133
+ * Reverse lookup — find all tags linked to a given object (admin).
134
134
  *
135
135
  * Uses a compound index on `(orgId, refType, refId)` on the per-org shard.
136
136
  * No embed support on the admin side.
@@ -149,7 +149,7 @@ export declare namespace tags {
149
149
  */
150
150
  function byRef(collectionId: string, params: ReverseTagLookupParams): Promise<ReverseTagLookupResponse>;
151
151
  /**
152
- * Global tag resolve — returns `{ tagId, collectionId }` only.
152
+ * Global tag resolve — returns `{ tagId, collectionId }` only.
153
153
  *
154
154
  * Use this **only** when you have a raw `tagId` and do not yet know which
155
155
  * collection it belongs to. Queries the shared `tag_index` shard.
@@ -159,7 +159,7 @@ export declare namespace tags {
159
159
  * > Use the collection-scoped `publicByRef` instead.
160
160
  *
161
161
  * @param tagId - Physical tag identifier
162
- * @returns `{ tagId, collectionId }` — routing info only, no full tag data
162
+ * @returns `{ tagId, collectionId }` — routing info only, no full tag data
163
163
  *
164
164
  * @example
165
165
  * ```typescript
@@ -179,7 +179,7 @@ export declare namespace tags {
179
179
  * `GET /public/collection/:collectionId/tags/:tagId?embed=product,proof,container,ref`
180
180
  *
181
181
  * Supported `embed` values: `'product'`, `'proof'`, `'container'`, `'ref'`
182
- * (`'collection'` is not supported — the collection is already known from the URL).
182
+ * (`'collection'` is not supported — the collection is already known from the URL).
183
183
  *
184
184
  * @param collectionId - Collection context
185
185
  * @param tagId - Physical tag identifier
package/dist/api/tags.js CHANGED
@@ -7,9 +7,9 @@ import { request, post, put, del } from "../http.js";
7
7
  * etc.) and products, proofs, or any polymorphic object in the platform.
8
8
  *
9
9
  * ### Two-tier architecture
10
- * - **Per-org shard** (`tags` table) — full tag data; used for all collection-scoped
10
+ * - **Per-org shard** (`tags` table) — full tag data; used for all collection-scoped
11
11
  * queries.
12
- * - **Shared shard** (`tag_index` table) — `tagId → collectionId` routing only; used
12
+ * - **Shared shard** (`tag_index` table) — `tagId → collectionId` routing only; used
13
13
  * when the collection is not yet known.
14
14
  *
15
15
  * 99% of callers will know the collection and should use collection-scoped endpoints
@@ -58,7 +58,7 @@ export var tags;
58
58
  *
59
59
  * Tags with `productId` but no `proofId` automatically get serial numbers.
60
60
  * Serial number generation is grouped by `(productId, variantId, batchId)` for
61
- * efficiency. Partial success is possible — check `results` for individual outcomes.
61
+ * efficiency. Partial success is possible — check `results` for individual outcomes.
62
62
  *
63
63
  * @param collectionId - Collection context
64
64
  * @param data - Batch payload; `force` applies to all tags in the batch
@@ -95,7 +95,7 @@ export var tags;
95
95
  /**
96
96
  * Update a tag (admin).
97
97
  *
98
- * Partial update — only provided fields are changed. `metadata` is
98
+ * Partial update — only provided fields are changed. `metadata` is
99
99
  * deep-merged with the existing value. Pass `refType: null, refId: null`
100
100
  * to clear the polymorphic ref.
101
101
  *
@@ -175,7 +175,7 @@ export var tags;
175
175
  }
176
176
  tags.list = list;
177
177
  /**
178
- * Reverse lookup — find all tags linked to a given object (admin).
178
+ * Reverse lookup — find all tags linked to a given object (admin).
179
179
  *
180
180
  * Uses a compound index on `(orgId, refType, refId)` on the per-org shard.
181
181
  * No embed support on the admin side.
@@ -201,10 +201,10 @@ export var tags;
201
201
  }
202
202
  tags.byRef = byRef;
203
203
  // ============================================================================
204
- // Public Endpoints — global resolve (collection unknown)
204
+ // Public Endpoints — global resolve (collection unknown)
205
205
  // ============================================================================
206
206
  /**
207
- * Global tag resolve — returns `{ tagId, collectionId }` only.
207
+ * Global tag resolve — returns `{ tagId, collectionId }` only.
208
208
  *
209
209
  * Use this **only** when you have a raw `tagId` and do not yet know which
210
210
  * collection it belongs to. Queries the shared `tag_index` shard.
@@ -214,7 +214,7 @@ export var tags;
214
214
  * > Use the collection-scoped `publicByRef` instead.
215
215
  *
216
216
  * @param tagId - Physical tag identifier
217
- * @returns `{ tagId, collectionId }` — routing info only, no full tag data
217
+ * @returns `{ tagId, collectionId }` — routing info only, no full tag data
218
218
  *
219
219
  * @example
220
220
  * ```typescript
@@ -233,7 +233,7 @@ export var tags;
233
233
  }
234
234
  tags.resolveTag = resolveTag;
235
235
  // ============================================================================
236
- // Public Endpoints — collection-scoped
236
+ // Public Endpoints — collection-scoped
237
237
  // ============================================================================
238
238
  /**
239
239
  * Single tag lookup with optional embedded data (public).
@@ -241,7 +241,7 @@ export var tags;
241
241
  * `GET /public/collection/:collectionId/tags/:tagId?embed=product,proof,container,ref`
242
242
  *
243
243
  * Supported `embed` values: `'product'`, `'proof'`, `'container'`, `'ref'`
244
- * (`'collection'` is not supported — the collection is already known from the URL).
244
+ * (`'collection'` is not supported — the collection is already known from the URL).
245
245
  *
246
246
  * @param collectionId - Collection context
247
247
  * @param tagId - Physical tag identifier
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.0.66 | Generated: 2026-10-14T17:03:31.949Z
3
+ Version: 2.0.68 | Generated: 2026-10-17T10:04:22.637Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -1600,10 +1600,35 @@ interface PdfClip {
1600
1600
  **PdfCreateArgs** (interface)
1601
1601
  ```typescript
1602
1602
  interface PdfCreateArgs {
1603
- html: string
1603
+ html?: string
1604
+ pages?: string[]
1605
+ head?: string
1606
+ width?: number
1607
+ height?: number
1608
+ unit?: 'mm' | 'cm' | 'in' | 'pt' | 'px'
1604
1609
  format?: string
1605
1610
  landscape?: boolean
1606
1611
  margin?: string
1612
+ return?: 'url' | 'signedUrl' | 'base64'
1613
+ expiresIn?: number
1614
+ filename?: string
1615
+ cache?: boolean
1616
+ }
1617
+ ```
1618
+
1619
+ **PdfCreateResult** (interface)
1620
+ ```typescript
1621
+ interface PdfCreateResult {
1622
+ url?: string
1623
+ hostedUrl?: string
1624
+ base64?: string
1625
+ expiresAt?: string
1626
+ contentType: 'application/pdf'
1627
+ size: number
1628
+ pageCount: number
1629
+ cached: boolean
1630
+ renderer?: string
1631
+ warnings?: string[]
1607
1632
  }
1608
1633
  ```
1609
1634
 
@@ -2786,6 +2811,7 @@ interface ServerFunctionSl {
2786
2811
  forCaller(): Promise<{ contactId: string } | null>;
2787
2812
  };
2788
2813
  interactions: { record(event: ServerFunctionInteractionEvent): Promise<{ eventId: string }> };
2814
+ tools: { run<T = any>(name: string, args?: Record<string, any>): Promise<T> };
2789
2815
  products: any;
2790
2816
  attestations: any;
2791
2817
  appData: AppDataHandle & { global: AppDataHandle; collection: AppDataHandle };
@@ -4838,6 +4864,25 @@ interface AuthKitConfig {
4838
4864
  redirectUrl?: string
4839
4865
  updatedAt?: string
4840
4866
  security?: AuthKitSecurityConfig
4867
+ collectionIds?: string[]
4868
+ identity?: AuthKitIdentity
4869
+ }
4870
+ ```
4871
+
4872
+ **AuthKitIdentity** (interface)
4873
+ ```typescript
4874
+ interface AuthKitIdentity {
4875
+ mode: 'shared' | 'own'
4876
+ tenantId?: string
4877
+ createdAt?: string
4878
+ }
4879
+ ```
4880
+
4881
+ **AuthKitSetIdentityResponse** (interface)
4882
+ ```typescript
4883
+ interface AuthKitSetIdentityResponse {
4884
+ identity: AuthKitIdentity
4885
+ message: string
4841
4886
  }
4842
4887
  ```
4843
4888
 
@@ -5336,7 +5381,7 @@ interface InviteUserInput {
5336
5381
 
5337
5382
  **CollectionUpdateRequest** = `Partial<Omit<Collection, 'id' | 'shortId'>>`
5338
5383
 
5339
- **DomainTarget** = `"smartlinks" | "hub"`
5384
+ **DomainTarget** = `"links" | "site"`
5340
5385
 
5341
5386
  **CollectionAccessLevel** = `'Owner' | 'Admin' | 'Assigner' | 'Reporter' | 'User' | 'None'`
5342
5387
 
@@ -11297,8 +11342,11 @@ Create an AuthKit client config (admin). Accepts the account `security` policy
11297
11342
  **update**(collectionId: string, authKitId: string, data: AuthKitConfigInput) → `Promise<AuthKitConfig>`
11298
11343
  Update an AuthKit client config (admin). This is how the account **security policy** is written — pass a `security` block ({@link AuthKitSecurityConfig}). The server validates it and enforces it; the login UI reads the public subset back via {@link load}.
11299
11344
 
11345
+ **setIdentity**(collectionId: string, authKitId: string, body: { mode: 'own' }) → `Promise<AuthKitSetIdentityResponse>`
11346
+ Give this AuthKit its **own logins** (admin): its members become accounts of this site only — the same email can be a separate account, with its own password, on another site — rather than SmartLinks accounts shared across sites. One way: a site with its own members can't go back to the shared pool. Members who signed up before keep their SmartLinks account until moved across. Errors: `MEMBER_POOL_CONFLICT` (409) when another AuthKit already gives one of its collections its own logins (one per collection); `PERMISSION_DENIED` (403) unless you administer every collection it serves.
11347
+
11300
11348
  **remove**(collectionId: string, authKitId: string) → `Promise<void>`
11301
- Update an AuthKit client config (admin). This is how the account **security policy** is written — pass a `security` block ({@link AuthKitSecurityConfig}). The server validates it and enforces it; the login UI reads the public subset back via {@link load}.
11349
+ Give this AuthKit its **own logins** (admin): its members become accounts of this site only — the same email can be a separate account, with its own password, on another site — rather than SmartLinks accounts shared across sites. One way: a site with its own members can't go back to the shared pool. Members who signed up before keep their SmartLinks account until moved across. Errors: `MEMBER_POOL_CONFLICT` (409) when another AuthKit already gives one of its collections its own logins (one per collection); `PERMISSION_DENIED` (403) unless you administer every collection it serves.
11302
11350
 
11303
11351
  ### batch
11304
11352
 
@@ -11488,11 +11536,14 @@ Check whether a Hub subdomain name is available to claim (admin only).
11488
11536
  **claimHub**(collectionId: string, hubName: string) → `Promise<CollectionResponse>`
11489
11537
  Claim or rename the Hub subdomain for a collection (admin only). Maps `{hubName}.smartlinks.host` to the collection. If the collection already had a different hub name, the previous subdomain is released automatically.
11490
11538
 
11491
- **registerDomain**(collectionId: string, domain: string, target: DomainTarget = "smartlinks") → `Promise<any>`
11492
- Register a custom domain for a collection and provision its managed certificate (admin only). `"smartlinks"` (the id.smartlinks.app load balancer). Pass `"hub"` to register a bring-your-own Hub domain.
11539
+ **registerDomain**(collectionId: string, domain: string, target: DomainTarget = "links") → `Promise<any>`
11540
+ Connect one of the collection's own domains and start its certificate (admin only). or `"site"` for the collection's Hub domain.
11493
11541
 
11494
- **getDomainStatus**(collectionId: string, target: DomainTarget = "smartlinks") → `Promise<any>`
11495
- Get the managed-certificate status for a collection's custom domain (admin only). or `"hub"` (uses `hubCustomDomain`)
11542
+ **getDomainStatus**(collectionId: string, target: DomainTarget = "links") → `Promise<any>`
11543
+ Get the certificate status of the collection's own domain (admin only). or `"site"` (its Hub domain, `hubCustomDomain`)
11544
+
11545
+ **releaseDomain**(collectionId: string, domain: string) → `Promise<`
11546
+ Remove the collection's links domain (admin only). It stops working straight away: QR codes, GS1 Digital Links and short links printed with it no longer open. Its certificate goes and `redirectUrl` is cleared. (Site domains are removed from the site's settings.)
11496
11547
 
11497
11548
  **getSettings**(collectionId: string, settingGroup: string, admin?: boolean) → `Promise<any>`
11498
11549
  Retrieve a specific settings group for a collection. Public reads return the public view of the settings group. If the stored payload contains a top-level `admin` object, that block is omitted from public responses and included when `admin === true`.
@@ -11512,29 +11563,29 @@ Update a collection (admin only).
11512
11563
  **remove**(collectionId: string) → `Promise<void>`
11513
11564
  Delete a collection (admin only).
11514
11565
 
11515
- **getSN**(collectionId: string,
11516
- startIndex: number = 0,
11566
+ **getSN**(collectionId: string,
11567
+ startIndex: number = 0,
11517
11568
  count: number = 10) → `Promise<any>`
11518
11569
  Get serial numbers for a collection (admin only).
11519
11570
 
11520
- **lookupSN**(collectionId: string,
11571
+ **lookupSN**(collectionId: string,
11521
11572
  codeId: string) → `Promise<any>`
11522
11573
  Look up a serial number by code for a collection (admin only).
11523
11574
 
11524
- **assignSN**(collectionId: string,
11525
- codeId: string,
11575
+ **assignSN**(collectionId: string,
11576
+ codeId: string,
11526
11577
  value: any) → `Promise<any>`
11527
11578
  Assign a value to a serial number for a collection (admin only).
11528
11579
 
11529
11580
  **getUsers**(collectionId: string) → `Promise<CollectionUser[]>`
11530
11581
  List the users with access to a collection, each with their access level (admin only). Access is stored in the collection's `roles` map (userId → level); this resolves each to name/email. GET /admin/collection/:collectionId/getUsers
11531
11582
 
11532
- **setUserAccess**(collectionId: string,
11533
- userId: string,
11583
+ **setUserAccess**(collectionId: string,
11584
+ userId: string,
11534
11585
  access: CollectionAccessLevel | null) → `Promise<void>`
11535
11586
  Grant, change, or remove a user's access level on a collection (admin only). Pass `null` or `'None'` to remove access. The server enforces privilege-escalation rules — you cannot grant an access level above your own, nor change a user whose level is above yours. POST /admin/collection/:collectionId/updateUserAccess
11536
11587
 
11537
- **inviteUser**(collectionId: string,
11588
+ **inviteUser**(collectionId: string,
11538
11589
  input: InviteUserInput) → `Promise<`
11539
11590
  Invite a user to a collection by email (admin only). Creates or links their account in the login / auth-kit collection (`loginCollectionId`, default `'global'`) and emails them an invite (new account) or an added-to-collection notice (existing account); returns their `uid`. This does NOT grant access on its own — follow with {@link setUserAccess} to set their level (this mirrors the console flow). POST /user/inviteUser
11540
11591
 
@@ -12815,7 +12866,7 @@ Create a single tag mapping (admin). If `productId` is set without `proofId`, a
12815
12866
 
12816
12867
  **createBatch**(collectionId: string,
12817
12868
  data: BatchCreateTagRequest) → `Promise<BatchCreateResult>`
12818
- Batch-create tags (admin). Tags with `productId` but no `proofId` automatically get serial numbers. Serial number generation is grouped by `(productId, variantId, batchId)` for efficiency. Partial success is possible — check `results` for individual outcomes. ```typescript const result = await tags.createBatch('coll_123', { tags: [ { tagId: 'NFC-001', productId: 'prod_456', batchId: 'batch_2026_01' }, { tagId: 'NFC-002', productId: 'prod_456', batchId: 'batch_2026_01' }, ], }) console.log(`Created: ${result.summary.created}, Conflicts: ${result.summary.conflicts}`) ```
12869
+ Batch-create tags (admin). Tags with `productId` but no `proofId` automatically get serial numbers. Serial number generation is grouped by `(productId, variantId, batchId)` for efficiency. Partial success is possible — check `results` for individual outcomes. ```typescript const result = await tags.createBatch('coll_123', { tags: [ { tagId: 'NFC-001', productId: 'prod_456', batchId: 'batch_2026_01' }, { tagId: 'NFC-002', productId: 'prod_456', batchId: 'batch_2026_01' }, ], }) console.log(`Created: ${result.summary.created}, Conflicts: ${result.summary.conflicts}`) ```
12819
12870
 
12820
12871
  **get**(collectionId: string,
12821
12872
  tagId: string) → `Promise<GetTagResponse>`
@@ -12824,7 +12875,7 @@ Get a single tag by `tagId` (admin).
12824
12875
  **update**(collectionId: string,
12825
12876
  tagId: string,
12826
12877
  data: UpdateTagRequest) → `Promise<UpdateTagResponse>`
12827
- Update a tag (admin). Partial update — only provided fields are changed. `metadata` is deep-merged with the existing value. Pass `refType: null, refId: null` to clear the polymorphic ref. ```typescript const updated = await tags.update('coll_123', 'NFC-001', { variantId: 'var_premium', metadata: { notes: 'Updated to premium variant' }, }) // Clear polymorphic ref await tags.update('coll_123', 'NFC-001', { refType: null, refId: null }) ```
12878
+ Update a tag (admin). Partial update — only provided fields are changed. `metadata` is deep-merged with the existing value. Pass `refType: null, refId: null` to clear the polymorphic ref. ```typescript const updated = await tags.update('coll_123', 'NFC-001', { variantId: 'var_premium', metadata: { notes: 'Updated to premium variant' }, }) // Clear polymorphic ref await tags.update('coll_123', 'NFC-001', { refType: null, refId: null }) ```
12828
12879
 
12829
12880
  **remove**(collectionId: string,
12830
12881
  tagId: string) → `Promise<DeleteTagResponse>`
@@ -12836,15 +12887,15 @@ List tags with optional filters and pagination (admin). ```typescript // All tag
12836
12887
 
12837
12888
  **byRef**(collectionId: string,
12838
12889
  params: ReverseTagLookupParams) → `Promise<ReverseTagLookupResponse>`
12839
- Reverse lookup — find all tags linked to a given object (admin). Uses a compound index on `(orgId, refType, refId)` on the per-org shard. No embed support on the admin side. ```typescript const { tags: linked } = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
12890
+ Reverse lookup — find all tags linked to a given object (admin). Uses a compound index on `(orgId, refType, refId)` on the per-org shard. No embed support on the admin side. ```typescript const { tags: linked } = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
12840
12891
 
12841
12892
  **resolveTag**(tagId: string) → `Promise<TagIndexEntry>`
12842
- Global tag resolve — returns `{ tagId, collectionId }` only. Use this **only** when you have a raw `tagId` and do not yet know which collection it belongs to. Queries the shared `tag_index` shard. Once `collectionId` is resolved, call `publicGetByCollection` for full data. > The global `/public/tags/by-ref` endpoint has been removed. > Use the collection-scoped `publicByRef` instead. ```typescript // Step 1: resolve collection const { collectionId } = await tags.resolveTag('NFC-001') // Step 2: full lookup with embedded data const { tag, embedded } = await tags.publicGetByCollection( collectionId, 'NFC-001', 'product,proof' ) ```
12893
+ Global tag resolve — returns `{ tagId, collectionId }` only. Use this **only** when you have a raw `tagId` and do not yet know which collection it belongs to. Queries the shared `tag_index` shard. Once `collectionId` is resolved, call `publicGetByCollection` for full data. > The global `/public/tags/by-ref` endpoint has been removed. > Use the collection-scoped `publicByRef` instead. ```typescript // Step 1: resolve collection const { collectionId } = await tags.resolveTag('NFC-001') // Step 2: full lookup with embedded data const { tag, embedded } = await tags.publicGetByCollection( collectionId, 'NFC-001', 'product,proof' ) ```
12843
12894
 
12844
12895
  **publicGetByCollection**(collectionId: string,
12845
12896
  tagId: string,
12846
12897
  embed?: string) → `Promise<PublicGetTagResponse>`
12847
- Single tag lookup with optional embedded data (public). `GET /public/collection/:collectionId/tags/:tagId?embed=product,proof,container,ref` Supported `embed` values: `'product'`, `'proof'`, `'container'`, `'ref'` (`'collection'` is not supported — the collection is already known from the URL). ```typescript const { tag, embedded } = await tags.publicGetByCollection( 'coll_123', 'NFC-001', 'product,proof' ) const product = embedded.products?.[tag.productId!] const proof = embedded.proofs?.[tag.proofId!] ```
12898
+ Single tag lookup with optional embedded data (public). `GET /public/collection/:collectionId/tags/:tagId?embed=product,proof,container,ref` Supported `embed` values: `'product'`, `'proof'`, `'container'`, `'ref'` (`'collection'` is not supported — the collection is already known from the URL). ```typescript const { tag, embedded } = await tags.publicGetByCollection( 'coll_123', 'NFC-001', 'product,proof' ) const product = embedded.products?.[tag.productId!] const proof = embedded.proofs?.[tag.proofId!] ```
12848
12899
 
12849
12900
  **lookupTags**(collectionId: string,
12850
12901
  data: LookupTagsRequest) → `Promise<TagLookupResponse>`
@@ -29,7 +29,7 @@ needs to call it — a description and an input schema:
29
29
  ```jsonc
30
30
  {
31
31
  "functions": {
32
- "files": { "js": { "umd": "dist/functions.umd.js" } },
32
+ "files": { "js": { "umd": "functions.umd.js" } },
33
33
  "definitions": [
34
34
  {
35
35
  "name": "createFaq",
package/dist/docs/ai.md CHANGED
@@ -323,7 +323,7 @@ in `input`.
323
323
  | `image.fromReference` | Image-to-image: generate guided by reference image(s). |
324
324
  | `image.searchStock` | Search real stock photos (Unsplash). |
325
325
  | `image.transform` | Resize / crop / rotate / grayscale / format-convert / compress → hosted URL. |
326
- | `pdf.create` | Render HTML → PDF → hosted URL. |
326
+ | `pdf.create` | Render HTML (or one fragment per page) → PDF, 1:1: exact `width`/`height`/`unit` for labels, `pages[]` for many pages in one render, no scripts, only SmartLinks/Google Fonts/data: resources. `return`: `url` (public), `signedUrl` (expiring), `base64`. Cached by input. |
327
327
  | `pdf.fill` | Fill an AcroForm PDF's fields (`{ field: value }`) → hosted URL. |
328
328
  | `pdf.merge` | Merge several PDFs into one, in order → hosted URL. |
329
329
  | `pdf.inspect` | Cheap, no-AI introspection: page count/sizes, which pages have a real text layer, raster present, and a routing hint (`text` vs `vision`). |
@@ -402,9 +402,11 @@ if (!ready.result.report.compliant) showFindings(ready.result.report.findings)
402
402
  - **A review UI that flags guessed fields** → `pdf.extract` with `includeConfidence` (per-field
403
403
  confidence + source) and `includeBoxes` (per-field bbox on text-native pages) in `fieldsMeta`.
404
404
  - **Produce a PDF** → `pdf.create` (HTML → PDF), `pdf.fill` (populate an AcroForm's fields),
405
- `pdf.merge` (combine several). These return a hosted `hostedUrl` (`pdf.create` also returns it as
406
- `url`). `pdf.create` loads remote `<img>` URLs before rendering and honours `page-break-inside`; pass
407
- `margin: "0"` when your HTML sets its own body margin (default page margin is 18mm/14mm).
405
+ `pdf.merge` (combine several). `pdf.create` takes an exact page size (`width`, `height`, `unit`) or a
406
+ `format`, `html` or `pages: [html, …]` (one per page, sharing `head`), and returns `url` (public),
407
+ a `signedUrl` that expires, or `base64` (`return`). JavaScript doesn't run, and images, fonts and
408
+ stylesheets load only from SmartLinks hosts, Google Fonts or `data:` URIs. From a server function:
409
+ `ctx.sl.tools.run('pdf.create', …)` with the `tools:pdf.create` capability (server-functions.md).
408
410
 
409
411
  Every tool is also directly callable without the model loop via `ai.tools.run(collectionId, name,
410
412
  args)` — e.g. render a page or extract fields straight from a UI, no agent round-trip:
@@ -428,7 +428,7 @@ this is just the manifest shape.
428
428
 
429
429
  | Field | Type | Description |
430
430
  |-------|------|-------------|
431
- | `files.js.umd` | string | UMD bundle path (e.g. `dist/functions.umd.js`) — a self-contained bundle exporting each handler by name |
431
+ | `files.js.umd` | string | UMD bundle path, relative to the published build like the other bundles (e.g. `functions.umd.js`, built to `dist/functions.umd.js`) — a self-contained bundle exporting each handler by name |
432
432
  | `definitions[]` | object[] | One entry per function |
433
433
  | `definitions[].name` | string | Function name; also the handler export name (override with `handler`) |
434
434
  | `definitions[].trigger` | object | `{ type: "http"|"event"|"cron", … }` |