@proveanything/smartlinks 2.1.33 → 2.1.34

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.
@@ -110,7 +110,7 @@ export interface DestinationInfo {
110
110
  /** The platform's screens any admin screen can open by name. */
111
111
  export declare const DESTINATIONS: DestinationInfo[];
112
112
  /** A destination name. Any string is accepted, so a newer host's names work on an older SDK. */
113
- export type Destination = 'contacts' | 'contact' | 'contact.messages' | 'conversation' | 'segment' | 'message.compose' | 'message.log' | 'campaign.new' | 'campaign' | 'templates' | 'template' | 'product' | 'proof' | 'interaction.type' | 'settings' | 'settings.domain' | 'settings.languages' | 'settings.translations' | 'settings.email' | 'settings.team' | 'settings.userGroups' | 'settings.setupLists' | 'settings.portal' | 'settings.hub' | 'settings.signIn' | 'media' | 'app' | (string & {});
113
+ export type Destination = 'contacts' | 'contact' | 'contact.messages' | 'conversation' | 'segment' | 'message.compose' | 'message.log' | 'campaign.new' | 'campaign' | 'templates' | 'template' | 'product' | 'proof' | 'interaction.type' | 'settings' | 'settings.address' | 'settings.domain' | 'settings.languages' | 'settings.translations' | 'settings.email' | 'settings.team' | 'settings.userGroups' | 'settings.setupLists' | 'settings.portal' | 'settings.hub' | 'settings.signIn' | 'media' | 'app' | (string & {});
114
114
  /** What a message is about (the same shape as `comms.sendTransactional`'s `about`). Ids only. */
115
115
  export interface DestinationAbout {
116
116
  appId?: string;
@@ -279,7 +279,8 @@ export const DESTINATIONS = [
279
279
  { name: 'interaction.type', required: ['interactionId'], description: 'One interaction type in Customers.' },
280
280
  // Settings
281
281
  { name: 'settings', required: [], description: 'The business settings in Studio.' },
282
- { name: 'settings.domain', required: [], description: 'The domain settings.' },
282
+ { name: 'settings.address', required: [], optional: ['appId'], description: "The business's address: its name, front page, app pages (appId: point at that app's page) and links domain." },
283
+ { name: 'settings.domain', required: [], description: 'The links domain (QR codes, GS1 Digital Links), on the Your address page.' },
283
284
  { name: 'settings.languages', required: [], description: 'The languages customers see.' },
284
285
  { name: 'settings.translations', required: [], description: 'Everything translated for customers.' },
285
286
  { name: 'settings.email', required: [], description: 'Email settings: the sending address and its look.' },
@@ -1,10 +1,21 @@
1
- import type { AddressFront, AddressNameAvailability, AddressResponse } from "../types/address.js";
1
+ import type { AddressFront, AddressNameAvailability, AddressResponse, AppPageLink } from "../types/address.js";
2
2
  /**
3
3
  * The business's address in one place (admin): its name, what its front page shows, and its apps' pages
4
4
  * under `/_apps/<name>/` (prove docs/design/business-address.md, app-page-addresses.md). Changes reach
5
5
  * visitors within about a minute.
6
6
  */
7
7
  export declare namespace address {
8
+ /**
9
+ * Where an app's public page is, on the business's own address. Public: use it from the app's admin
10
+ * ("Open the game") and from share buttons, instead of building the CDN address by hand. Add the app's
11
+ * own route to it: `${link.url}#/play`. The page carries no collectionId or appId: the address says it.
12
+ * Resolves null when the app has no page on that collection (not installed, or a connector).
13
+ *
14
+ * @example
15
+ * const link = await SL.address.page(collectionId, appId)
16
+ * window.open(`${link?.url ?? fallback}#/play`, '_blank')
17
+ */
18
+ function page(collectionId: string, appId: string): Promise<AppPageLink | null>;
8
19
  /** Everything about the business's address: name, own domain, front page, websites that can take it, app pages. */
9
20
  function get(collectionId: string): Promise<AddressResponse>;
10
21
  /** Is this name free? (lower-case letters, numbers and hyphens) */
@@ -7,6 +7,27 @@ import { request, post } from "../http.js";
7
7
  export var address;
8
8
  (function (address) {
9
9
  const base = (collectionId) => `/admin/collection/${encodeURIComponent(collectionId)}/address`;
10
+ /**
11
+ * Where an app's public page is, on the business's own address. Public: use it from the app's admin
12
+ * ("Open the game") and from share buttons, instead of building the CDN address by hand. Add the app's
13
+ * own route to it: `${link.url}#/play`. The page carries no collectionId or appId: the address says it.
14
+ * Resolves null when the app has no page on that collection (not installed, or a connector).
15
+ *
16
+ * @example
17
+ * const link = await SL.address.page(collectionId, appId)
18
+ * window.open(`${link?.url ?? fallback}#/play`, '_blank')
19
+ */
20
+ async function page(collectionId, appId) {
21
+ try {
22
+ return await request(`/public/collection/${encodeURIComponent(collectionId)}/app/${encodeURIComponent(appId)}/page`);
23
+ }
24
+ catch (e) {
25
+ if ((e === null || e === void 0 ? void 0 : e.statusCode) === 404)
26
+ return null;
27
+ throw e;
28
+ }
29
+ }
30
+ address.page = page;
10
31
  /** Everything about the business's address: name, own domain, front page, websites that can take it, app pages. */
11
32
  async function get(collectionId) {
12
33
  return request(base(collectionId));
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.1.33 | Generated: 2026-11-20T18:06:02.523Z
3
+ Version: 2.1.34 | Generated: 2026-11-20T19:32:22.299Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -498,6 +498,7 @@ interface AddressPage {
498
498
  name: string
499
499
  defaultName: string
500
500
  listed: boolean
501
+ live: boolean
501
502
  url: string
502
503
  }
503
504
  ```
@@ -533,6 +534,19 @@ interface AddressNameAvailability {
533
534
  }
534
535
  ```
535
536
 
537
+ **AppPageLink** (interface)
538
+ ```typescript
539
+ interface AppPageLink {
540
+ url: string
541
+ pageUrl: string
542
+ name: string
543
+ live: boolean
544
+ isFront: boolean
545
+ host: string
546
+ channel: string | null
547
+ }
548
+ ```
549
+
536
550
  **AddressFront** = ``
537
551
 
538
552
  ### adminCards
@@ -12846,6 +12860,9 @@ interface Gs1DigitalLinkParams {
12846
12860
 
12847
12861
  ### address
12848
12862
 
12863
+ **page**(collectionId: string, appId: string) → `Promise<AppPageLink | null>`
12864
+ Where an app's public page is, on the business's own address. Public: use it from the app's admin ("Open the game") and from share buttons, instead of building the CDN address by hand. Add the app's own route to it: `${link.url}#/play`. The page carries no collectionId or appId: the address says it. Resolves null when the app has no page on that collection (not installed, or a connector). const link = await SL.address.page(collectionId, appId) window.open(`${link?.url ?? fallback}#/play`, '_blank')
12865
+
12849
12866
  **get**(collectionId: string) → `Promise<AddressResponse>`
12850
12867
  Everything about the business's address: name, own domain, front page, websites that can take it, app pages.
12851
12868
 
@@ -191,6 +191,7 @@ const canMessage = await SL.adminViews.canOpen('message.compose')
191
191
  | `proof` | **productId**, **proofId** | One item of a product |
192
192
  | `interaction.type` | **interactionId** | One interaction type (Customers) |
193
193
  | `settings` | | Studio → Settings |
194
+ | `settings.address` | `appId`? | Your address: the business's name, front page, app pages (with `appId`, that app's page: where the owner renames it or makes it the front page) and links domain. Put a "Change this address" link beside any link to your app's page. |
194
195
  | `settings.domain` · `.languages` · `.translations` · `.email` · `.team` · `.userGroups` | | That Studio page |
195
196
  | `settings.setupLists` | appId | Set-up lists, for that app |
196
197
  | `settings.portal` · `.hub` · `.signIn` | | The Portal, the Hub, customer sign-in |
@@ -413,6 +413,11 @@ who it belongs to, so **the URL carries no `collectionId` or `appId`**:
413
413
  - Build with a **relative base** (`base: './'` in Vite) so assets load under `/_apps/<name>/`.
414
414
  - Use hash routes (`#/play`); the path after `/_apps/<name>/` is served the app's `index.html` either way.
415
415
  - Never put `collectionId` in your own share links: the address already says which business it is.
416
+ - **Linking to your page from anywhere else** (your admin's "Open the game", a QR code, an email): ask
417
+ where it is with **`await SL.address.page(collectionId, appId)`** and use its `url` plus your route
418
+ (`${link.url}#/play`). Never build `smartlinks.app/apps/<id>/stable/index.html…` by hand: the business
419
+ may have renamed the page, made it its front page, or put it on its own domain, and `url` follows all of
420
+ that. It's a test build's automatic address until the app is live there.
416
421
 
417
422
  ##### Public views vs the two portal surfaces
418
423
 
package/dist/openapi.yaml CHANGED
@@ -10,6 +10,8 @@ servers:
10
10
  - url: "https://smartlinks.app/api/v1"
11
11
  description: Production
12
12
  tags:
13
+ - name: address
14
+ description: address API
13
15
  - name: responses
14
16
  description: Agentic responses API (server-tool runs).
15
17
  - name: completions
@@ -11954,6 +11956,37 @@ paths:
11954
11956
  description: Unauthorized
11955
11957
  404:
11956
11958
  description: Not found
11959
+ /public/collection/{collectionId}/app/{appId}/page:
11960
+ get:
11961
+ tags:
11962
+ - address
11963
+ summary: "Where an app's public page is, on the business's own address."
11964
+ operationId: address_page
11965
+ security: []
11966
+ parameters:
11967
+ - name: collectionId
11968
+ in: path
11969
+ required: true
11970
+ schema:
11971
+ type: string
11972
+ - name: appId
11973
+ in: path
11974
+ required: true
11975
+ schema:
11976
+ type: string
11977
+ responses:
11978
+ 200:
11979
+ description: Success
11980
+ content:
11981
+ application/json:
11982
+ schema:
11983
+ $ref: "#/components/schemas/AppPageLink"
11984
+ 400:
11985
+ description: Bad request
11986
+ 401:
11987
+ description: Unauthorized
11988
+ 404:
11989
+ description: Not found
11957
11990
  /public/collection/{collectionId}/asset:
11958
11991
  get:
11959
11992
  tags:
@@ -17421,6 +17454,8 @@ components:
17421
17454
  type: string
17422
17455
  listed:
17423
17456
  type: boolean
17457
+ live:
17458
+ type: boolean
17424
17459
  url:
17425
17460
  type: string
17426
17461
  required:
@@ -17429,6 +17464,7 @@ components:
17429
17464
  - name
17430
17465
  - defaultName
17431
17466
  - listed
17467
+ - live
17432
17468
  - url
17433
17469
  AddressWebsite:
17434
17470
  type: object
@@ -17486,6 +17522,31 @@ components:
17486
17522
  required:
17487
17523
  - available
17488
17524
  - host
17525
+ AppPageLink:
17526
+ type: object
17527
+ properties:
17528
+ url:
17529
+ type: string
17530
+ pageUrl:
17531
+ type: string
17532
+ name:
17533
+ type: string
17534
+ live:
17535
+ type: boolean
17536
+ isFront:
17537
+ type: boolean
17538
+ host:
17539
+ type: string
17540
+ channel:
17541
+ type: string
17542
+ required:
17543
+ - url
17544
+ - pageUrl
17545
+ - name
17546
+ - live
17547
+ - isFront
17548
+ - host
17549
+ - channel
17489
17550
  AddressFront:
17490
17551
  type: object
17491
17552
  additionalProperties: true
@@ -14,6 +14,11 @@ export type AddressFront =
14
14
  kind: 'website';
15
15
  appId: string;
16
16
  }
17
+ /** One of the business's apps as its whole front page (its only game, say): installed and live. */
18
+ | {
19
+ kind: 'app';
20
+ appId: string;
21
+ }
17
22
  /** Send visitors to another address. Temporary (302) unless `permanent`; `keepPath` carries /about → target/about. */
18
23
  | {
19
24
  kind: 'redirect';
@@ -36,6 +41,8 @@ export interface AddressPage {
36
41
  defaultName: string;
37
42
  /** Shown on the holding page. */
38
43
  listed: boolean;
44
+ /** Live (stable, released): its page works on the business's chosen name, and it can be the front page. */
45
+ live: boolean;
39
46
  /** The full address of the page, on the business's main address. */
40
47
  url: string;
41
48
  }
@@ -67,3 +74,19 @@ export interface AddressNameAvailability {
67
74
  available: boolean;
68
75
  host: string;
69
76
  }
77
+ /** Where an app's public page is (`address.page`): always a working address. */
78
+ export interface AppPageLink {
79
+ /** The one to link to: the business's address itself when the app IS its front page, else `pageUrl`. */
80
+ url: string;
81
+ /** The app's page under the business's address: `https://<address>/_apps/<name>/`. */
82
+ pageUrl: string;
83
+ /** The page name (the business can rename it in Studio → Your address). */
84
+ name: string;
85
+ /** Live (stable, released): on the business's own domain or name. A test build is on the automatic address. */
86
+ live: boolean;
87
+ /** This app is the business's whole front page. */
88
+ isFront: boolean;
89
+ host: string;
90
+ /** The release channel the collection runs the app on. */
91
+ channel: string | null;
92
+ }
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.1.33 | Generated: 2026-11-20T18:06:02.523Z
3
+ Version: 2.1.34 | Generated: 2026-11-20T19:32:22.299Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -498,6 +498,7 @@ interface AddressPage {
498
498
  name: string
499
499
  defaultName: string
500
500
  listed: boolean
501
+ live: boolean
501
502
  url: string
502
503
  }
503
504
  ```
@@ -533,6 +534,19 @@ interface AddressNameAvailability {
533
534
  }
534
535
  ```
535
536
 
537
+ **AppPageLink** (interface)
538
+ ```typescript
539
+ interface AppPageLink {
540
+ url: string
541
+ pageUrl: string
542
+ name: string
543
+ live: boolean
544
+ isFront: boolean
545
+ host: string
546
+ channel: string | null
547
+ }
548
+ ```
549
+
536
550
  **AddressFront** = ``
537
551
 
538
552
  ### adminCards
@@ -12846,6 +12860,9 @@ interface Gs1DigitalLinkParams {
12846
12860
 
12847
12861
  ### address
12848
12862
 
12863
+ **page**(collectionId: string, appId: string) → `Promise<AppPageLink | null>`
12864
+ Where an app's public page is, on the business's own address. Public: use it from the app's admin ("Open the game") and from share buttons, instead of building the CDN address by hand. Add the app's own route to it: `${link.url}#/play`. The page carries no collectionId or appId: the address says it. Resolves null when the app has no page on that collection (not installed, or a connector). const link = await SL.address.page(collectionId, appId) window.open(`${link?.url ?? fallback}#/play`, '_blank')
12865
+
12849
12866
  **get**(collectionId: string) → `Promise<AddressResponse>`
12850
12867
  Everything about the business's address: name, own domain, front page, websites that can take it, app pages.
12851
12868
 
@@ -191,6 +191,7 @@ const canMessage = await SL.adminViews.canOpen('message.compose')
191
191
  | `proof` | **productId**, **proofId** | One item of a product |
192
192
  | `interaction.type` | **interactionId** | One interaction type (Customers) |
193
193
  | `settings` | | Studio → Settings |
194
+ | `settings.address` | `appId`? | Your address: the business's name, front page, app pages (with `appId`, that app's page: where the owner renames it or makes it the front page) and links domain. Put a "Change this address" link beside any link to your app's page. |
194
195
  | `settings.domain` · `.languages` · `.translations` · `.email` · `.team` · `.userGroups` | | That Studio page |
195
196
  | `settings.setupLists` | appId | Set-up lists, for that app |
196
197
  | `settings.portal` · `.hub` · `.signIn` | | The Portal, the Hub, customer sign-in |
@@ -413,6 +413,11 @@ who it belongs to, so **the URL carries no `collectionId` or `appId`**:
413
413
  - Build with a **relative base** (`base: './'` in Vite) so assets load under `/_apps/<name>/`.
414
414
  - Use hash routes (`#/play`); the path after `/_apps/<name>/` is served the app's `index.html` either way.
415
415
  - Never put `collectionId` in your own share links: the address already says which business it is.
416
+ - **Linking to your page from anywhere else** (your admin's "Open the game", a QR code, an email): ask
417
+ where it is with **`await SL.address.page(collectionId, appId)`** and use its `url` plus your route
418
+ (`${link.url}#/play`). Never build `smartlinks.app/apps/<id>/stable/index.html…` by hand: the business
419
+ may have renamed the page, made it its front page, or put it on its own domain, and `url` follows all of
420
+ that. It's a test build's automatic address until the app is live there.
416
421
 
417
422
  ##### Public views vs the two portal surfaces
418
423
 
package/openapi.yaml CHANGED
@@ -10,6 +10,8 @@ servers:
10
10
  - url: "https://smartlinks.app/api/v1"
11
11
  description: Production
12
12
  tags:
13
+ - name: address
14
+ description: address API
13
15
  - name: responses
14
16
  description: Agentic responses API (server-tool runs).
15
17
  - name: completions
@@ -11954,6 +11956,37 @@ paths:
11954
11956
  description: Unauthorized
11955
11957
  404:
11956
11958
  description: Not found
11959
+ /public/collection/{collectionId}/app/{appId}/page:
11960
+ get:
11961
+ tags:
11962
+ - address
11963
+ summary: "Where an app's public page is, on the business's own address."
11964
+ operationId: address_page
11965
+ security: []
11966
+ parameters:
11967
+ - name: collectionId
11968
+ in: path
11969
+ required: true
11970
+ schema:
11971
+ type: string
11972
+ - name: appId
11973
+ in: path
11974
+ required: true
11975
+ schema:
11976
+ type: string
11977
+ responses:
11978
+ 200:
11979
+ description: Success
11980
+ content:
11981
+ application/json:
11982
+ schema:
11983
+ $ref: "#/components/schemas/AppPageLink"
11984
+ 400:
11985
+ description: Bad request
11986
+ 401:
11987
+ description: Unauthorized
11988
+ 404:
11989
+ description: Not found
11957
11990
  /public/collection/{collectionId}/asset:
11958
11991
  get:
11959
11992
  tags:
@@ -17421,6 +17454,8 @@ components:
17421
17454
  type: string
17422
17455
  listed:
17423
17456
  type: boolean
17457
+ live:
17458
+ type: boolean
17424
17459
  url:
17425
17460
  type: string
17426
17461
  required:
@@ -17429,6 +17464,7 @@ components:
17429
17464
  - name
17430
17465
  - defaultName
17431
17466
  - listed
17467
+ - live
17432
17468
  - url
17433
17469
  AddressWebsite:
17434
17470
  type: object
@@ -17486,6 +17522,31 @@ components:
17486
17522
  required:
17487
17523
  - available
17488
17524
  - host
17525
+ AppPageLink:
17526
+ type: object
17527
+ properties:
17528
+ url:
17529
+ type: string
17530
+ pageUrl:
17531
+ type: string
17532
+ name:
17533
+ type: string
17534
+ live:
17535
+ type: boolean
17536
+ isFront:
17537
+ type: boolean
17538
+ host:
17539
+ type: string
17540
+ channel:
17541
+ type: string
17542
+ required:
17543
+ - url
17544
+ - pageUrl
17545
+ - name
17546
+ - live
17547
+ - isFront
17548
+ - host
17549
+ - channel
17489
17550
  AddressFront:
17490
17551
  type: object
17491
17552
  additionalProperties: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "2.1.33",
3
+ "version": "2.1.34",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",