@proveanything/smartlinks 2.1.31 → 2.1.33
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/adminViews.d.ts +86 -0
- package/dist/adminViews.js +178 -0
- package/dist/api/address.d.ts +39 -0
- package/dist/api/address.js +45 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/interactions.d.ts +3 -0
- package/dist/api/interactions.js +3 -0
- package/dist/api/translations.d.ts +6 -1
- package/dist/api/translations.js +11 -1
- package/dist/context.d.ts +5 -0
- package/dist/context.js +4 -1
- package/dist/docs/API_SUMMARY.md +104 -10
- package/dist/docs/admin-views.md +93 -0
- package/dist/docs/app-manifest.md +14 -0
- package/dist/docs/translations.md +24 -0
- package/dist/index.d.ts +2 -2
- package/dist/openapi.yaml +187 -0
- package/dist/site.d.ts +5 -0
- package/dist/types/address.d.ts +69 -0
- package/dist/types/address.js +5 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/translations.d.ts +33 -0
- package/docs/API_SUMMARY.md +104 -10
- package/docs/admin-views.md +93 -0
- package/docs/app-manifest.md +14 -0
- package/docs/translations.md +24 -0
- package/openapi.yaml +187 -0
- package/package.json +1 -1
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.33 | Generated: 2026-11-20T18:06:02.523Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -137,6 +137,7 @@ The Smartlinks SDK is organized into the following namespaces:
|
|
|
137
137
|
- **serialNumber** - Assign, lookup, and manage serial numbers across scopes.
|
|
138
138
|
|
|
139
139
|
— Other —
|
|
140
|
+
- **address** - Functions for address operations
|
|
140
141
|
- **adminCards** - Functions for adminCards operations
|
|
141
142
|
- **aiGuide** - Functions for aiGuide operations
|
|
142
143
|
- **analytics** - Functions for analytics operations
|
|
@@ -487,6 +488,53 @@ Examples include:
|
|
|
487
488
|
|
|
488
489
|
## Types
|
|
489
490
|
|
|
491
|
+
### address
|
|
492
|
+
|
|
493
|
+
**AddressPage** (interface)
|
|
494
|
+
```typescript
|
|
495
|
+
interface AddressPage {
|
|
496
|
+
appId: string
|
|
497
|
+
title: string
|
|
498
|
+
name: string
|
|
499
|
+
defaultName: string
|
|
500
|
+
listed: boolean
|
|
501
|
+
url: string
|
|
502
|
+
}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**AddressWebsite** (interface)
|
|
506
|
+
```typescript
|
|
507
|
+
interface AddressWebsite {
|
|
508
|
+
appId: string
|
|
509
|
+
title: string
|
|
510
|
+
live: boolean
|
|
511
|
+
channel: string | null
|
|
512
|
+
}
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
**AddressResponse** (interface)
|
|
516
|
+
```typescript
|
|
517
|
+
interface AddressResponse {
|
|
518
|
+
name: string | null
|
|
519
|
+
host: string
|
|
520
|
+
defaultHost: string | null
|
|
521
|
+
domain: { host: string; live: boolean } | null
|
|
522
|
+
front: AddressFront
|
|
523
|
+
websites: AddressWebsite[]
|
|
524
|
+
pages: AddressPage[]
|
|
525
|
+
}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
**AddressNameAvailability** (interface)
|
|
529
|
+
```typescript
|
|
530
|
+
interface AddressNameAvailability {
|
|
531
|
+
available: boolean
|
|
532
|
+
host: string
|
|
533
|
+
}
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
**AddressFront** = ``
|
|
537
|
+
|
|
490
538
|
### adminCards
|
|
491
539
|
|
|
492
540
|
**AdminCardRefresh** (interface)
|
|
@@ -12079,6 +12127,7 @@ interface TranslationListParams {
|
|
|
12079
12127
|
contextKey?: string
|
|
12080
12128
|
q?: string
|
|
12081
12129
|
isOverride?: boolean
|
|
12130
|
+
termIssues?: boolean
|
|
12082
12131
|
limit?: number
|
|
12083
12132
|
offset?: number
|
|
12084
12133
|
}
|
|
@@ -12104,6 +12153,28 @@ interface TranslationUpdateRequest {
|
|
|
12104
12153
|
}
|
|
12105
12154
|
```
|
|
12106
12155
|
|
|
12156
|
+
**TranslationTerm** (interface)
|
|
12157
|
+
```typescript
|
|
12158
|
+
interface TranslationTerm {
|
|
12159
|
+
source: string
|
|
12160
|
+
keep?: boolean
|
|
12161
|
+
translations?: Record<string, string>
|
|
12162
|
+
note?: string
|
|
12163
|
+
}
|
|
12164
|
+
```
|
|
12165
|
+
|
|
12166
|
+
**TranslationRules** (interface)
|
|
12167
|
+
```typescript
|
|
12168
|
+
interface TranslationRules {
|
|
12169
|
+
guidance: string
|
|
12170
|
+
languages: Record<string, { guidance: string }>
|
|
12171
|
+
terms: TranslationTerm[]
|
|
12172
|
+
version?: string | null
|
|
12173
|
+
updatedAt?: string | null
|
|
12174
|
+
limits?: { guidance: number; languageGuidance: number; terms: number; term: number; note: number }
|
|
12175
|
+
}
|
|
12176
|
+
```
|
|
12177
|
+
|
|
12107
12178
|
**TranslationLookupMode** = `'cache-fill' | 'cache-only'`
|
|
12108
12179
|
|
|
12109
12180
|
**TranslationContentType** = `'text/plain' | 'text/html' | 'text/x-liquid' | (string & {})`
|
|
@@ -12773,6 +12844,23 @@ interface Gs1DigitalLinkParams {
|
|
|
12773
12844
|
|
|
12774
12845
|
## API Functions
|
|
12775
12846
|
|
|
12847
|
+
### address
|
|
12848
|
+
|
|
12849
|
+
**get**(collectionId: string) → `Promise<AddressResponse>`
|
|
12850
|
+
Everything about the business's address: name, own domain, front page, websites that can take it, app pages.
|
|
12851
|
+
|
|
12852
|
+
**checkName**(collectionId: string, name: string) → `Promise<AddressNameAvailability>`
|
|
12853
|
+
Is this name free? (lower-case letters, numbers and hyphens)
|
|
12854
|
+
|
|
12855
|
+
**setName**(collectionId: string, name: string) → `Promise<`
|
|
12856
|
+
Choose (or change) the business's name: `<name>.smartlinks.host`. The previous name is released.
|
|
12857
|
+
|
|
12858
|
+
**setFront**(collectionId: string, front: AddressFront) → `Promise<`
|
|
12859
|
+
What the front page shows. Applies to the business's name, its automatic address and its own domain together. A website must be installed and live; a redirect must be https and not one of its own addresses.
|
|
12860
|
+
|
|
12861
|
+
**setPage**(collectionId: string, appId: string, change: { name?: string; listed?: boolean }) → `Promise<`
|
|
12862
|
+
Rename an app's page (old names keep redirecting) and/or show it on the holding page.
|
|
12863
|
+
|
|
12776
12864
|
### adminCards
|
|
12777
12865
|
|
|
12778
12866
|
**list**(collectionId: string) → `Promise<AdminCardsResponse>`
|
|
@@ -14545,38 +14633,38 @@ POST /api/v1/public/collection/:collectionId/interactions/submit Submits an inte
|
|
|
14545
14633
|
|
|
14546
14634
|
**ensureType**(collectionId: string,
|
|
14547
14635
|
input: EnsureInteractionTypeInput) → `Promise<InteractionTypeRecord>`
|
|
14548
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14636
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14549
14637
|
|
|
14550
14638
|
**get**(collectionId: string,
|
|
14551
14639
|
id: string) → `Promise<InteractionTypeRecord>`
|
|
14552
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14640
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14553
14641
|
|
|
14554
14642
|
**update**(collectionId: string,
|
|
14555
14643
|
id: string,
|
|
14556
14644
|
patchBody: UpdateInteractionTypeBody) → `Promise<InteractionTypeRecord>`
|
|
14557
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14645
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14558
14646
|
|
|
14559
14647
|
**remove**(collectionId: string,
|
|
14560
14648
|
id: string) → `Promise<void>`
|
|
14561
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14649
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14562
14650
|
|
|
14563
14651
|
**publicCountsByOutcome**(collectionId: string,
|
|
14564
14652
|
body: PublicInteractionsCountsByOutcomeRequest,
|
|
14565
14653
|
authToken?: string) → `Promise<OutcomeCount[]>`
|
|
14566
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14654
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14567
14655
|
|
|
14568
14656
|
**publicMyInteractions**(collectionId: string,
|
|
14569
14657
|
body: PublicInteractionsByUserRequest,
|
|
14570
14658
|
authToken?: string) → `Promise<InteractionEventRow[]>`
|
|
14571
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14659
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14572
14660
|
|
|
14573
14661
|
**publicList**(collectionId: string,
|
|
14574
14662
|
query: ListInteractionTypesQuery = {}) → `Promise<InteractionTypeList>`
|
|
14575
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14663
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14576
14664
|
|
|
14577
14665
|
**publicGet**(collectionId: string,
|
|
14578
14666
|
id: string) → `Promise<InteractionTypeRecord>`
|
|
14579
|
-
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId
|
|
14667
|
+
Find this app's interaction type by its readable `key` (data.interactionType), or create it. Returns the type record — its `id` is the server-minted UUID every event must use. ADMIN only (run it in your admin/setup screen), then store the id in your app config so public code can read it: `interactionIds: { vote: type.id }`. Safe to run on every setup. const vote = await SL.interactions.ensureType(collectionId, { appId: 'my-app', key: 'vote', permissions: { allowPublicSubmit: true, uniquePerUser: true }, display: { title: 'Cast a vote', description: 'Someone voted in the poll' }, }) // vote.id → '52bab6fa-…' — store it in config; never hardcode 'vote' as an interactionId // Always give display.title: it's the name staff see in the CRM, on activity and when choosing // "everyone who voted" for a segment. (Without one the platform names it from the key.)
|
|
14580
14668
|
|
|
14581
14669
|
### jobs
|
|
14582
14670
|
|
|
@@ -15538,8 +15626,14 @@ Admin: where translated text appears for one language (context keys), with count
|
|
|
15538
15626
|
**reset**(collectionId: string, translationId: string) → `Promise<TranslationRecord>`
|
|
15539
15627
|
Admin: undo a person's edit with a fresh machine translation.
|
|
15540
15628
|
|
|
15629
|
+
**rules**(collectionId: string) → `Promise<TranslationRules>`
|
|
15630
|
+
Admin: the site's translation rules (brief, notes per language, required terms).
|
|
15631
|
+
|
|
15632
|
+
**saveRules**(collectionId: string, body: Pick<TranslationRules, 'guidance' | 'languages' | 'terms'>) → `Promise<TranslationRules>`
|
|
15633
|
+
Admin: replace the site's translation rules. They apply to new translations from now on.
|
|
15634
|
+
|
|
15541
15635
|
**clearLocalCache**(collectionId?: string) → `Promise<void>`
|
|
15542
|
-
Admin:
|
|
15636
|
+
Admin: replace the site's translation rules. They apply to new translations from now on.
|
|
15543
15637
|
|
|
15544
15638
|
### tts
|
|
15545
15639
|
|
package/dist/docs/admin-views.md
CHANGED
|
@@ -132,6 +132,99 @@ SL.adminViews.openApp({ appId: 'crm', view: 'contact', params: { contactId } })
|
|
|
132
132
|
- **Name the views you link to** in your docs (`crm: contact`, `messages: log` with `contact`), and
|
|
133
133
|
keep their ids stable: other apps use them.
|
|
134
134
|
|
|
135
|
+
## Opening the platform's screens: `open` by name
|
|
136
|
+
|
|
137
|
+
Your admin screens sit inside Studio, next to the platform's own screens. **Link to them; don't copy them.**
|
|
138
|
+
To message someone, open the Messages composer. To show a person, open their contact. Don't build your own
|
|
139
|
+
email pop-up, contact page or message log.
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
// Message this person, tied to the booking: it is logged against the booking and links back to it
|
|
143
|
+
SL.adminViews.open('message.compose', {
|
|
144
|
+
contactId,
|
|
145
|
+
about: { type: 'booking', id: bookingId, view: 'booking', params: { bookingId }, label: 'Sat 3pm' },
|
|
146
|
+
})
|
|
147
|
+
SL.adminViews.open('contact', { contactId }) // the person, in Customers
|
|
148
|
+
SL.adminViews.open('contact.messages', { contactId }) // everything sent to them
|
|
149
|
+
SL.adminViews.open('settings.domain') // a Studio settings page
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
You name **what** to open, never which app has it. Studio decides that, so your link keeps working if
|
|
153
|
+
the screen moves to another app. `open` resolves with `{ ok, reason? }`:
|
|
154
|
+
|
|
155
|
+
| `reason` | Meaning |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `no-host` | Not inside Studio (the admin page opened on its own) |
|
|
158
|
+
| `not-here` | That screen's app isn't on in this business |
|
|
159
|
+
| `unknown` | Studio doesn't know the name |
|
|
160
|
+
| `missing-param` | A required param is missing |
|
|
161
|
+
| `preview` | Forge preview: it showed what would open instead |
|
|
162
|
+
|
|
163
|
+
### Ask first: `canOpen`
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
const canMessage = await SL.adminViews.canOpen('message.compose')
|
|
167
|
+
// SL.adminViews.available() → ['contact', 'message.compose', 'settings.domain', …]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- If it's `false`, hide the button, or tell the owner what to switch on ("Switch on Messages to send
|
|
171
|
+
messages").
|
|
172
|
+
- Build your own version only when the platform has nothing for it.
|
|
173
|
+
- `canOpen` answers at once inside Studio. With no host, it answers `false` after a short wait.
|
|
174
|
+
|
|
175
|
+
### The names
|
|
176
|
+
|
|
177
|
+
| Name | Params (**required**) | Opens |
|
|
178
|
+
|---|---|---|
|
|
179
|
+
| `contacts` | | The contacts list (Customers) |
|
|
180
|
+
| `contact` | **contactId** | One contact |
|
|
181
|
+
| `contact.messages` | **contactId** | The Message log for that person |
|
|
182
|
+
| `conversation` | **conversationId** | One conversation (Messages) |
|
|
183
|
+
| `segment` | **segmentId** | One segment (Customers) |
|
|
184
|
+
| `message.compose` | contactId, about | The composer, to that person (or choose who) |
|
|
185
|
+
| `message.log` | contactId, about | The Message log, filtered |
|
|
186
|
+
| `campaign.new` | segmentId | A new campaign to that segment |
|
|
187
|
+
| `campaign` | **campaignId** | One campaign |
|
|
188
|
+
| `templates` | | The email and message templates |
|
|
189
|
+
| `template` | **templateId** | One template in the editor |
|
|
190
|
+
| `product` | **productId** | One product (Items) |
|
|
191
|
+
| `proof` | **productId**, **proofId** | One item of a product |
|
|
192
|
+
| `interaction.type` | **interactionId** | One interaction type (Customers) |
|
|
193
|
+
| `settings` | | Studio → Settings |
|
|
194
|
+
| `settings.domain` · `.languages` · `.translations` · `.email` · `.team` · `.userGroups` | | That Studio page |
|
|
195
|
+
| `settings.setupLists` | appId | Set-up lists, for that app |
|
|
196
|
+
| `settings.portal` · `.hub` · `.signIn` | | The Portal, the Hub, customer sign-in |
|
|
197
|
+
| `media` | | Images and files |
|
|
198
|
+
| `app` | **appId**, view, params | Another app at one of its screens, as `openApp` |
|
|
199
|
+
|
|
200
|
+
`SL.adminViews.DESTINATIONS` has the same list in code.
|
|
201
|
+
|
|
202
|
+
### `about`: what a message is for
|
|
203
|
+
|
|
204
|
+
`message.compose` and `message.log` take `about`, the same shape as `comms.sendTransactional`
|
|
205
|
+
([comms.md](comms.md), "What a message is about"). `appId` defaults to your app.
|
|
206
|
+
- **The composer** sends it with the message. The Message log then shows the message against your
|
|
207
|
+
record ("Bookings · Sat 3pm"), with a link back to your screen (`view` + `params`).
|
|
208
|
+
- **The log** shows only the messages about that record.
|
|
209
|
+
|
|
210
|
+
### Messaging many people
|
|
211
|
+
|
|
212
|
+
One message to many people (everyone who booked, entered or joined) is a **campaign**: it has opt-in, an
|
|
213
|
+
unsubscribe, a report, and no cap. Never loop over people sending one message each.
|
|
214
|
+
1. Record an interaction or a tag on each person when they book.
|
|
215
|
+
2. Make a segment in Customers for that interaction or tag.
|
|
216
|
+
3. Open `campaign.new` with the segment.
|
|
217
|
+
|
|
218
|
+
A server function may still send one service message itself (a confirmation, a reminder:
|
|
219
|
+
`ctx.sl.messages.send`). A message a person writes goes through the composer.
|
|
220
|
+
|
|
221
|
+
### Hosts
|
|
222
|
+
|
|
223
|
+
The host answers `smartlinks:open` `{ id, to, params, about?, appParams? }` with `smartlinks:open-result`
|
|
224
|
+
`{ id, to, ok, reason? }`. It posts `smartlinks:destinations` `{ available }` on load, on request
|
|
225
|
+
(`smartlinks:destinations-request`) and whenever the list changes. Helpers: `SL.adminViews.postDestinations`
|
|
226
|
+
and `SL.adminViews.postOpenResult`.
|
|
227
|
+
|
|
135
228
|
## `chrome=none`: the host carries the menu
|
|
136
229
|
|
|
137
230
|
When a host's own menu already lists an app's views, it opens the app with `chrome=none`. The app then
|
|
@@ -400,6 +400,20 @@ page. Without this, those routes/modes are invisible to the platform and the Dev
|
|
|
400
400
|
|
|
401
401
|
Read the URL params with **`SL.readContext()`** (merges hash → search) instead of hand-rolling it.
|
|
402
402
|
|
|
403
|
+
##### The app's page on the business's address (`/_apps/<name>/`)
|
|
404
|
+
|
|
405
|
+
Every installed app with a public page also answers on the business's own address:
|
|
406
|
+
`https://<business>.smartlinks.host/_apps/<name>/#/your-route` (or their own domain). The name defaults to
|
|
407
|
+
the app id without its publisher handle and the business can rename it. There, the platform tells the page
|
|
408
|
+
who it belongs to, so **the URL carries no `collectionId` or `appId`**:
|
|
409
|
+
|
|
410
|
+
- Read context with **`SL.readContext()`**: it fills `collectionId` and `appId` from the page's address
|
|
411
|
+
when the URL doesn't carry them, and `basePath` (`/_apps/<name>`) for building share links:
|
|
412
|
+
`` `https://${location.host}${ctx.basePath ?? ''}/#/play` ``.
|
|
413
|
+
- Build with a **relative base** (`base: './'` in Vite) so assets load under `/_apps/<name>/`.
|
|
414
|
+
- Use hash routes (`#/play`); the path after `/_apps/<name>/` is served the app's `index.html` either way.
|
|
415
|
+
- Never put `collectionId` in your own share links: the address already says which business it is.
|
|
416
|
+
|
|
403
417
|
##### Public views vs the two portal surfaces
|
|
404
418
|
|
|
405
419
|
An app can have any combination of three setup styles. Only public views are external:
|
|
@@ -357,6 +357,30 @@ translation or puts a machine one back. When it has changed, that collection's s
|
|
|
357
357
|
dropped and fetched again (from the server's store, no AI). A slow or failed answer never holds the
|
|
358
358
|
page for more than 1.5 s, and the saved copies are used as before.
|
|
359
359
|
|
|
360
|
+
### Translation rules (a site's own terminology)
|
|
361
|
+
|
|
362
|
+
A site can give the AI a brief, notes per language and a list of required terms, for example a
|
|
363
|
+
pharmaceutical company whose leaflets must use regulatory wording. They apply to every new machine
|
|
364
|
+
translation for that collection; existing translations are not changed.
|
|
365
|
+
|
|
366
|
+
```ts
|
|
367
|
+
await translations.saveRules(collectionId, {
|
|
368
|
+
guidance: 'Patient information for prescription medicines. Formal register.',
|
|
369
|
+
languages: { de: { guidance: 'Address the reader with Sie.' } },
|
|
370
|
+
terms: [
|
|
371
|
+
{ source: 'tablet', translations: { de: 'Tablette', 'zh-Hans': '片剂' } },
|
|
372
|
+
{ source: 'Lumora', keep: true, note: 'brand name' }, // never translated
|
|
373
|
+
],
|
|
374
|
+
})
|
|
375
|
+
await translations.rules(collectionId) // what is saved, with its version
|
|
376
|
+
await translations.list(collectionId, { targetLanguage: 'de', termIssues: true }) // translations missing a required term
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Only the terms a text mentions are sent with it. After translating, each result is checked: if the
|
|
380
|
+
source mentions a term and the translation doesn't contain the required wording (any case, endings
|
|
381
|
+
allowed), its `metadata.termIssues` lists the term and `summary()` counts it under `issues`. A person's
|
|
382
|
+
edit is checked the same way. Each machine translation records `metadata.rulesVersion`.
|
|
383
|
+
|
|
360
384
|
## Recommended Usage Pattern
|
|
361
385
|
|
|
362
386
|
For front-end rendering:
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { iframe } from "./iframe.js";
|
|
|
5
5
|
export { readContext } from "./context.js";
|
|
6
6
|
export * as i18n from "./i18n.js";
|
|
7
7
|
export * as adminViews from "./adminViews.js";
|
|
8
|
-
export type { NavigateRequest, NavigateTarget, OpenAppRequest } from "./adminViews.js";
|
|
8
|
+
export type { NavigateRequest, NavigateTarget, OpenAppRequest, Destination, DestinationInfo, DestinationAbout, OpenParams, OpenResult } from "./adminViews.js";
|
|
9
9
|
export { widgetStyleVars, widgetStyleControls, readableOn, WIDGET_STYLE_VARS } from "./widgetStyle.js";
|
|
10
10
|
export type { WidgetStyling } from "./widgetStyle.js";
|
|
11
11
|
export type { SmartLinksContext } from "./context.js";
|
|
@@ -35,7 +35,7 @@ export type { VariantResponse, VariantCreateRequest, VariantUpdateRequest, } fro
|
|
|
35
35
|
export type { BroadcastSendRequest } from "./types/broadcasts.js";
|
|
36
36
|
export type { AppConfigOptions } from "./api/appConfiguration.js";
|
|
37
37
|
export type { AdditionalGtin, ISODateString, JsonPrimitive, JsonValue, ProductCreateRequest, ProductClaimCreateInput, ProductClaimCreateRequestBody, ProductClaimLookupInput, ProductFacetMap, ProductFacetValue, ProductImageUrlInput, ProductKey, ProductQueryRequest, ProductQueryResponse, ProductUpdateRequest, Product, ProductWriteInput, PublicProduct, } from "./types/product.js";
|
|
38
|
-
export type { TranslationLookupMode, TranslationContentType, TranslationQuality, TranslationItemStatus, TranslationContextValue, TranslationContext, TranslationLookupRequestBase, TranslationLookupSingleRequest, TranslationLookupBatchRequest, TranslationLookupRequest, TranslationLookupItem, TranslationLookupResponse, ResolvedTranslationItem, ResolvedTranslationResponse, TranslationHashOptions, TranslationResolveOptions, TranslationRecord, TranslationListParams, TranslationListResponse, TranslationUpdateRequest, } from "./types/translations.js";
|
|
38
|
+
export type { TranslationLookupMode, TranslationContentType, TranslationQuality, TranslationItemStatus, TranslationContextValue, TranslationContext, TranslationLookupRequestBase, TranslationLookupSingleRequest, TranslationLookupBatchRequest, TranslationLookupRequest, TranslationLookupItem, TranslationLookupResponse, ResolvedTranslationItem, ResolvedTranslationResponse, TranslationHashOptions, TranslationResolveOptions, TranslationRecord, TranslationListParams, TranslationListResponse, TranslationUpdateRequest, TranslationRules, TranslationTerm, } from "./types/translations.js";
|
|
39
39
|
export type { TranslationActivity } from "./translationActivity.js";
|
|
40
40
|
export type { FacetBucket, FacetDefinition, FacetDefinitionWriteInput, FacetGetParams, FacetListParams, FacetListResponse, FacetNamespaceListResponse, FacetQueryRequest, FacetQueryResponse, FacetValue, FacetValueDefinition, FacetValueGetParams, FacetValueListParams, FacetValueListResponse, FacetValueResponse, FacetValueWriteInput, PublicFacetListParams, } from "./types/facets.js";
|
|
41
41
|
export type { Collection, CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest, DomainTarget, HubAvailabilityResponse, } from "./types/collection.js";
|
package/dist/openapi.yaml
CHANGED
|
@@ -9380,6 +9380,11 @@ paths:
|
|
|
9380
9380
|
required: false
|
|
9381
9381
|
schema:
|
|
9382
9382
|
type: boolean
|
|
9383
|
+
- name: termIssues
|
|
9384
|
+
in: query
|
|
9385
|
+
required: false
|
|
9386
|
+
schema:
|
|
9387
|
+
type: boolean
|
|
9383
9388
|
- name: limit
|
|
9384
9389
|
in: query
|
|
9385
9390
|
required: false
|
|
@@ -9403,6 +9408,65 @@ paths:
|
|
|
9403
9408
|
description: Unauthorized
|
|
9404
9409
|
404:
|
|
9405
9410
|
description: Not found
|
|
9411
|
+
/admin/collection/{collectionId}/translations/rules:
|
|
9412
|
+
get:
|
|
9413
|
+
tags:
|
|
9414
|
+
- translations
|
|
9415
|
+
summary: "Admin: the site's translation rules (brief, notes per language, required terms)."
|
|
9416
|
+
operationId: translations_rules
|
|
9417
|
+
security:
|
|
9418
|
+
- bearerAuth: []
|
|
9419
|
+
parameters:
|
|
9420
|
+
- name: collectionId
|
|
9421
|
+
in: path
|
|
9422
|
+
required: true
|
|
9423
|
+
schema:
|
|
9424
|
+
type: string
|
|
9425
|
+
responses:
|
|
9426
|
+
200:
|
|
9427
|
+
description: Success
|
|
9428
|
+
content:
|
|
9429
|
+
application/json:
|
|
9430
|
+
schema:
|
|
9431
|
+
$ref: "#/components/schemas/TranslationRules"
|
|
9432
|
+
400:
|
|
9433
|
+
description: Bad request
|
|
9434
|
+
401:
|
|
9435
|
+
description: Unauthorized
|
|
9436
|
+
404:
|
|
9437
|
+
description: Not found
|
|
9438
|
+
put:
|
|
9439
|
+
tags:
|
|
9440
|
+
- translations
|
|
9441
|
+
summary: "Admin: replace the site's translation rules."
|
|
9442
|
+
operationId: translations_saveRules
|
|
9443
|
+
security:
|
|
9444
|
+
- bearerAuth: []
|
|
9445
|
+
parameters:
|
|
9446
|
+
- name: collectionId
|
|
9447
|
+
in: path
|
|
9448
|
+
required: true
|
|
9449
|
+
schema:
|
|
9450
|
+
type: string
|
|
9451
|
+
responses:
|
|
9452
|
+
200:
|
|
9453
|
+
description: Success
|
|
9454
|
+
content:
|
|
9455
|
+
application/json:
|
|
9456
|
+
schema:
|
|
9457
|
+
$ref: "#/components/schemas/TranslationRules"
|
|
9458
|
+
400:
|
|
9459
|
+
description: Bad request
|
|
9460
|
+
401:
|
|
9461
|
+
description: Unauthorized
|
|
9462
|
+
404:
|
|
9463
|
+
description: Not found
|
|
9464
|
+
requestBody:
|
|
9465
|
+
required: true
|
|
9466
|
+
content:
|
|
9467
|
+
application/json:
|
|
9468
|
+
schema:
|
|
9469
|
+
$ref: "#/components/schemas/TranslationRules"
|
|
9406
9470
|
/admin/collection/{collectionId}/translations/{translationId}:
|
|
9407
9471
|
get:
|
|
9408
9472
|
tags:
|
|
@@ -17344,6 +17408,87 @@ components:
|
|
|
17344
17408
|
name: X-API-Key
|
|
17345
17409
|
description: API key for server-to-server calls
|
|
17346
17410
|
schemas:
|
|
17411
|
+
AddressPage:
|
|
17412
|
+
type: object
|
|
17413
|
+
properties:
|
|
17414
|
+
appId:
|
|
17415
|
+
type: string
|
|
17416
|
+
title:
|
|
17417
|
+
type: string
|
|
17418
|
+
name:
|
|
17419
|
+
type: string
|
|
17420
|
+
defaultName:
|
|
17421
|
+
type: string
|
|
17422
|
+
listed:
|
|
17423
|
+
type: boolean
|
|
17424
|
+
url:
|
|
17425
|
+
type: string
|
|
17426
|
+
required:
|
|
17427
|
+
- appId
|
|
17428
|
+
- title
|
|
17429
|
+
- name
|
|
17430
|
+
- defaultName
|
|
17431
|
+
- listed
|
|
17432
|
+
- url
|
|
17433
|
+
AddressWebsite:
|
|
17434
|
+
type: object
|
|
17435
|
+
properties:
|
|
17436
|
+
appId:
|
|
17437
|
+
type: string
|
|
17438
|
+
title:
|
|
17439
|
+
type: string
|
|
17440
|
+
live:
|
|
17441
|
+
type: boolean
|
|
17442
|
+
channel:
|
|
17443
|
+
type: string
|
|
17444
|
+
required:
|
|
17445
|
+
- appId
|
|
17446
|
+
- title
|
|
17447
|
+
- live
|
|
17448
|
+
- channel
|
|
17449
|
+
AddressResponse:
|
|
17450
|
+
type: object
|
|
17451
|
+
properties:
|
|
17452
|
+
name:
|
|
17453
|
+
type: string
|
|
17454
|
+
host:
|
|
17455
|
+
type: string
|
|
17456
|
+
defaultHost:
|
|
17457
|
+
type: string
|
|
17458
|
+
domain:
|
|
17459
|
+
type: object
|
|
17460
|
+
additionalProperties: true
|
|
17461
|
+
front:
|
|
17462
|
+
$ref: "#/components/schemas/AddressFront"
|
|
17463
|
+
websites:
|
|
17464
|
+
type: array
|
|
17465
|
+
items:
|
|
17466
|
+
$ref: "#/components/schemas/AddressWebsite"
|
|
17467
|
+
pages:
|
|
17468
|
+
type: array
|
|
17469
|
+
items:
|
|
17470
|
+
$ref: "#/components/schemas/AddressPage"
|
|
17471
|
+
required:
|
|
17472
|
+
- name
|
|
17473
|
+
- host
|
|
17474
|
+
- defaultHost
|
|
17475
|
+
- domain
|
|
17476
|
+
- front
|
|
17477
|
+
- websites
|
|
17478
|
+
- pages
|
|
17479
|
+
AddressNameAvailability:
|
|
17480
|
+
type: object
|
|
17481
|
+
properties:
|
|
17482
|
+
available:
|
|
17483
|
+
type: boolean
|
|
17484
|
+
host:
|
|
17485
|
+
type: string
|
|
17486
|
+
required:
|
|
17487
|
+
- available
|
|
17488
|
+
- host
|
|
17489
|
+
AddressFront:
|
|
17490
|
+
type: object
|
|
17491
|
+
additionalProperties: true
|
|
17347
17492
|
AdminCardRefresh:
|
|
17348
17493
|
type: object
|
|
17349
17494
|
properties:
|
|
@@ -37145,6 +37290,8 @@ components:
|
|
|
37145
37290
|
type: string
|
|
37146
37291
|
isOverride:
|
|
37147
37292
|
type: boolean
|
|
37293
|
+
termIssues:
|
|
37294
|
+
type: boolean
|
|
37148
37295
|
limit:
|
|
37149
37296
|
type: number
|
|
37150
37297
|
offset:
|
|
@@ -37176,6 +37323,46 @@ components:
|
|
|
37176
37323
|
metadata:
|
|
37177
37324
|
type: object
|
|
37178
37325
|
additionalProperties: true
|
|
37326
|
+
TranslationTerm:
|
|
37327
|
+
type: object
|
|
37328
|
+
properties:
|
|
37329
|
+
source:
|
|
37330
|
+
type: string
|
|
37331
|
+
keep:
|
|
37332
|
+
type: boolean
|
|
37333
|
+
translations:
|
|
37334
|
+
type: object
|
|
37335
|
+
additionalProperties:
|
|
37336
|
+
type: string
|
|
37337
|
+
note:
|
|
37338
|
+
type: string
|
|
37339
|
+
required:
|
|
37340
|
+
- source
|
|
37341
|
+
TranslationRules:
|
|
37342
|
+
type: object
|
|
37343
|
+
properties:
|
|
37344
|
+
guidance:
|
|
37345
|
+
type: string
|
|
37346
|
+
languages:
|
|
37347
|
+
type: object
|
|
37348
|
+
additionalProperties:
|
|
37349
|
+
type: object
|
|
37350
|
+
additionalProperties: true
|
|
37351
|
+
terms:
|
|
37352
|
+
type: array
|
|
37353
|
+
items:
|
|
37354
|
+
$ref: "#/components/schemas/TranslationTerm"
|
|
37355
|
+
version:
|
|
37356
|
+
type: string
|
|
37357
|
+
updatedAt:
|
|
37358
|
+
type: string
|
|
37359
|
+
limits:
|
|
37360
|
+
type: object
|
|
37361
|
+
additionalProperties: true
|
|
37362
|
+
required:
|
|
37363
|
+
- guidance
|
|
37364
|
+
- languages
|
|
37365
|
+
- terms
|
|
37179
37366
|
TranslationLookupMode:
|
|
37180
37367
|
type: string
|
|
37181
37368
|
enum:
|
package/dist/site.d.ts
CHANGED
|
@@ -13,6 +13,11 @@ export interface SiteContext {
|
|
|
13
13
|
channel: string;
|
|
14
14
|
/** Where search engines consolidate the site (custom domain > chosen name > automatic address). */
|
|
15
15
|
canonicalHost: string;
|
|
16
|
+
/**
|
|
17
|
+
* Set when the app is served as a page under the business's address (`/_apps/<name>`): build links and
|
|
18
|
+
* share buttons to the app from it, e.g. `https://${canonicalHost}${basePath}/`.
|
|
19
|
+
*/
|
|
20
|
+
basePath?: string;
|
|
16
21
|
}
|
|
17
22
|
type HeaderSource = {
|
|
18
23
|
headers: Headers | Record<string, string | string[] | undefined>;
|