@proveanything/smartlinks 2.0.67 → 2.0.69

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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.0.67 | Generated: 2026-10-15T17:52:10.614Z
3
+ Version: 2.0.69 | Generated: 2026-10-20T19:38:11.744Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -4864,6 +4864,25 @@ interface AuthKitConfig {
4864
4864
  redirectUrl?: string
4865
4865
  updatedAt?: string
4866
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
4867
4886
  }
4868
4887
  ```
4869
4888
 
@@ -5362,7 +5381,7 @@ interface InviteUserInput {
5362
5381
 
5363
5382
  **CollectionUpdateRequest** = `Partial<Omit<Collection, 'id' | 'shortId'>>`
5364
5383
 
5365
- **DomainTarget** = `"smartlinks" | "hub"`
5384
+ **DomainTarget** = `"links" | "site"`
5366
5385
 
5367
5386
  **CollectionAccessLevel** = `'Owner' | 'Admin' | 'Assigner' | 'Reporter' | 'User' | 'None'`
5368
5387
 
@@ -11323,8 +11342,11 @@ Create an AuthKit client config (admin). Accepts the account `security` policy
11323
11342
  **update**(collectionId: string, authKitId: string, data: AuthKitConfigInput) → `Promise<AuthKitConfig>`
11324
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}.
11325
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
+
11326
11348
  **remove**(collectionId: string, authKitId: string) → `Promise<void>`
11327
- 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.
11328
11350
 
11329
11351
  ### batch
11330
11352
 
@@ -11514,11 +11536,14 @@ Check whether a Hub subdomain name is available to claim (admin only).
11514
11536
  **claimHub**(collectionId: string, hubName: string) → `Promise<CollectionResponse>`
11515
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.
11516
11538
 
11517
- **registerDomain**(collectionId: string, domain: string, target: DomainTarget = "smartlinks") → `Promise<any>`
11518
- 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.
11541
+
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`)
11519
11544
 
11520
- **getDomainStatus**(collectionId: string, target: DomainTarget = "smartlinks") → `Promise<any>`
11521
- Get the managed-certificate status for a collection's custom domain (admin only). or `"hub"` (uses `hubCustomDomain`)
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.)
11522
11547
 
11523
11548
  **getSettings**(collectionId: string, settingGroup: string, admin?: boolean) → `Promise<any>`
11524
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`.
@@ -11538,29 +11563,29 @@ Update a collection (admin only).
11538
11563
  **remove**(collectionId: string) → `Promise<void>`
11539
11564
  Delete a collection (admin only).
11540
11565
 
11541
- **getSN**(collectionId: string,
11542
- startIndex: number = 0,
11566
+ **getSN**(collectionId: string,
11567
+ startIndex: number = 0,
11543
11568
  count: number = 10) → `Promise<any>`
11544
11569
  Get serial numbers for a collection (admin only).
11545
11570
 
11546
- **lookupSN**(collectionId: string,
11571
+ **lookupSN**(collectionId: string,
11547
11572
  codeId: string) → `Promise<any>`
11548
11573
  Look up a serial number by code for a collection (admin only).
11549
11574
 
11550
- **assignSN**(collectionId: string,
11551
- codeId: string,
11575
+ **assignSN**(collectionId: string,
11576
+ codeId: string,
11552
11577
  value: any) → `Promise<any>`
11553
11578
  Assign a value to a serial number for a collection (admin only).
11554
11579
 
11555
11580
  **getUsers**(collectionId: string) → `Promise<CollectionUser[]>`
11556
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
11557
11582
 
11558
- **setUserAccess**(collectionId: string,
11559
- userId: string,
11583
+ **setUserAccess**(collectionId: string,
11584
+ userId: string,
11560
11585
  access: CollectionAccessLevel | null) → `Promise<void>`
11561
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
11562
11587
 
11563
- **inviteUser**(collectionId: string,
11588
+ **inviteUser**(collectionId: string,
11564
11589
  input: InviteUserInput) → `Promise<`
11565
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
11566
11591