@proveanything/smartlinks 2.1.17 → 2.1.19

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.
Files changed (80) hide show
  1. package/dist/adminViews.d.ts +104 -0
  2. package/dist/adminViews.js +275 -0
  3. package/dist/api/ai.d.ts +15 -5
  4. package/dist/api/ai.js +15 -9
  5. package/dist/api/aiGuide.d.ts +108 -0
  6. package/dist/api/aiGuide.js +161 -0
  7. package/dist/api/appObjects.d.ts +21 -0
  8. package/dist/api/appObjects.js +33 -1
  9. package/dist/api/authKit.d.ts +37 -1
  10. package/dist/api/authKit.js +51 -0
  11. package/dist/api/index.d.ts +2 -0
  12. package/dist/api/index.js +2 -0
  13. package/dist/api/operations.d.ts +36 -0
  14. package/dist/api/operations.js +56 -0
  15. package/dist/api/order.d.ts +12 -1
  16. package/dist/api/order.js +15 -0
  17. package/dist/api/userGroups.d.ts +78 -0
  18. package/dist/api/userGroups.js +124 -0
  19. package/dist/docs/API_SUMMARY.md +1111 -80
  20. package/dist/docs/admin-lists-and-pickers.md +140 -0
  21. package/dist/docs/admin-views.md +147 -0
  22. package/dist/docs/app-data-storage.md +277 -276
  23. package/dist/docs/app-manifest.md +2 -0
  24. package/dist/docs/auth-kit.md +872 -741
  25. package/dist/docs/comms.md +686 -644
  26. package/dist/docs/customer-guide.md +70 -0
  27. package/dist/docs/headless-providers.md +112 -112
  28. package/dist/docs/operations.md +281 -0
  29. package/dist/docs/overview.md +3 -0
  30. package/dist/docs/server-functions.md +87 -1
  31. package/dist/docs/ui-utils.md +123 -121
  32. package/dist/docs/user-groups.md +175 -0
  33. package/dist/docs/utils.md +17 -0
  34. package/dist/headless.js +38 -2
  35. package/dist/http.js +8 -0
  36. package/dist/iframeResponder.d.ts +15 -0
  37. package/dist/iframeResponder.js +39 -1
  38. package/dist/index.d.ts +3 -1
  39. package/dist/index.js +2 -0
  40. package/dist/live.d.ts +80 -0
  41. package/dist/live.js +315 -0
  42. package/dist/openapi.yaml +1864 -48
  43. package/dist/testing/index.d.ts +35 -0
  44. package/dist/testing/index.js +86 -0
  45. package/dist/types/appManifest.d.ts +297 -1
  46. package/dist/types/appOptions.d.ts +32 -0
  47. package/dist/types/appOptions.js +3 -0
  48. package/dist/types/authKit.d.ts +193 -4
  49. package/dist/types/comms.d.ts +41 -2
  50. package/dist/types/containers.d.ts +8 -0
  51. package/dist/types/headless.d.ts +49 -1
  52. package/dist/types/iframeResponder.d.ts +16 -1
  53. package/dist/types/index.d.ts +3 -0
  54. package/dist/types/index.js +3 -0
  55. package/dist/types/operations.d.ts +598 -0
  56. package/dist/types/operations.js +8 -0
  57. package/dist/types/order.d.ts +35 -6
  58. package/dist/types/userGroups.d.ts +103 -0
  59. package/dist/types/userGroups.js +5 -0
  60. package/dist/utils/conditions.d.ts +7 -0
  61. package/dist/utils/conditions.js +16 -9
  62. package/docs/API_SUMMARY.md +1111 -80
  63. package/docs/admin-lists-and-pickers.md +140 -0
  64. package/docs/admin-views.md +147 -0
  65. package/docs/app-data-storage.md +277 -276
  66. package/docs/app-manifest.md +2 -0
  67. package/docs/auth-kit.md +872 -741
  68. package/docs/comms.md +686 -644
  69. package/docs/customer-guide.md +70 -0
  70. package/docs/headless-providers.md +112 -112
  71. package/docs/operations.md +281 -0
  72. package/docs/overview.md +3 -0
  73. package/docs/server-functions.md +87 -1
  74. package/docs/ui-utils.md +123 -121
  75. package/docs/user-groups.md +175 -0
  76. package/docs/utils.md +17 -0
  77. package/openapi.yaml +1864 -48
  78. package/package.json +1 -1
  79. package/scripts/doctor.mjs +454 -428
  80. package/scripts/lib/keyed-app-data.mjs +21 -0
@@ -435,20 +435,136 @@ export interface UpsertContactResponse {
435
435
  userId: string | null;
436
436
  created: boolean;
437
437
  }
438
+ /** The sign-in screens' look (read by `@proveanything/smartlinks-auth-ui`). */
438
439
  export interface AuthKitBrandingConfig {
439
- logoUrl?: string;
440
+ /** Absent = the SmartLinks logo; `''` = no logo. An https address (or a small data:image URI). */
441
+ logoUrl?: string | null;
440
442
  title?: string;
441
443
  subtitle?: string;
444
+ registerTitle?: string;
445
+ registerSubtitle?: string;
446
+ /** CSS colours, e.g. `#1D4ED8`. Shown only with `inheritHostStyles: false` (else the host page's colours win). */
442
447
  primaryColor?: string;
443
448
  secondaryColor?: string;
444
449
  backgroundColor?: string;
445
- buttonStyle?: string;
450
+ buttonStyle?: 'rounded' | 'square' | 'pill' | string;
446
451
  fontFamily?: string;
452
+ /** Light or dark screens; `auto` follows the visitor's device. Default `light`. A host `theme` prop wins. */
453
+ theme?: 'light' | 'dark' | 'auto';
454
+ /** Use the host page's colours (default true). Turn off for your own colours to show. */
455
+ inheritHostStyles?: boolean;
456
+ minimal?: boolean;
457
+ customCss?: string;
458
+ termsUrl?: string;
459
+ privacyUrl?: string;
460
+ [key: string]: unknown;
461
+ }
462
+ /** A sign-in method id, as `enabledProviders` / `providerOrder` take them. */
463
+ export type AuthKitProvider = 'email' | 'magic-link' | 'phone' | 'whatsapp' | 'google' | 'apple' | 'microsoft' | 'linkedin';
464
+ /** One account email's wording. A field left out keeps the built-in words. Plain words (no scripts). */
465
+ export interface AuthKitEmailTemplate {
466
+ subject?: string;
467
+ header?: string;
468
+ introText?: string;
469
+ buttonText?: string;
470
+ footerText?: string;
471
+ }
472
+ /** The account emails a sign-in sends, by kind. */
473
+ export type AuthKitEmailKind = 'passwordReset' | 'emailVerification' | 'magicLink' | 'memberInvite' | 'invite' | 'addedToCollection' | 'mfaCode' | 'providerLinked';
474
+ /** Wording on the sign-in screens a site may change (auth-ui reads `texts[key]`). */
475
+ export type AuthKitTextKey = 'signInTitle' | 'signInSubtitle' | 'registerTitle' | 'registerSubtitle' | 'emailLabel' | 'passwordLabel' | 'signInButton' | 'registerButton' | 'forgotPassword' | 'noAccount' | 'haveAccount' | 'continueWithEmail' | 'continueWithGoogle' | 'continueWithApple' | 'continueWithMicrosoft' | 'continueWithLinkedIn' | 'continueWithPhone' | 'continueWithWhatsApp' | 'continueWithMagicLink' | 'sendMagicLink' | 'magicLinkSent' | 'inviteOnlyNotice';
476
+ /** Second step at sign-in (TOTP authenticator app, email or text code, recovery codes). */
477
+ export interface AuthKitMfaConfig {
478
+ /** off; optional (people may add one, never asked); risk-based / always (asked at sign-in once they have one). */
479
+ mode?: 'off' | 'optional' | 'risk-based' | 'always';
480
+ /** Switch a method off with `false`. */
481
+ factorsEnabled?: {
482
+ email?: boolean;
483
+ sms?: boolean;
484
+ totp?: boolean;
485
+ recoveryCodes?: boolean;
486
+ };
487
+ minimumFactors?: number;
488
+ trustedDeviceDurationDays?: number;
489
+ enforceForAdmins?: boolean;
447
490
  }
491
+ /**
492
+ * A sign-in (AuthKit) config — the ONE shape every setting lives in. The server validates every write
493
+ * (`INVALID_CONFIG`, 400, with `problems: [{ path, message }]`) and fills defaults; GET
494
+ * {@link authKit.schema} lists every field with its default and what reads it, and
495
+ * {@link authKit.settings} shows what sign-in does now. See `docs/auth-kit.md` → "Setting up sign-in".
496
+ */
448
497
  export interface AuthKitConfig {
449
498
  id: string;
499
+ /** The name staff see. */
500
+ name?: string;
450
501
  branding?: AuthKitBrandingConfig;
451
- enabledProviders?: string[];
502
+ /** Which ways to sign in the screens offer. Absent = the host page's choice. */
503
+ enabledProviders?: AuthKitProvider[];
504
+ /** The order they appear in. */
505
+ providerOrder?: AuthKitProvider[];
506
+ /** `form` (email + password form straight away, default) or `button` ("Continue with email" first). */
507
+ emailDisplayMode?: 'form' | 'button';
508
+ /** How much the screens push creating an account. `none` = no sign-up link. Default `minimal`. */
509
+ signupProminence?: 'none' | 'minimal' | 'balanced' | 'emphasized';
510
+ signupRedirectUrl?: string;
511
+ /** Your own Google OAuth web client id (public; no secret needed). Absent = SmartLinks' Google app. */
512
+ googleClientId?: string;
513
+ googleOAuthFlow?: 'oneTap' | 'popup' | 'redirect';
514
+ /** Site domains registered on your own Google client (open Google directly, not via the SmartLinks proxy). */
515
+ whitelistedGoogleDomains?: string[];
516
+ /** Sign in with Apple: your Services ID / bundle ids. Required for `apple`. */
517
+ appleClientIds?: string[];
518
+ /** Your own LinkedIn app's client id. Its secret goes through {@link authKit.secretEntryLink}, never here. */
519
+ linkedInClientId?: string;
520
+ whatsappPrefillMessage?: string;
521
+ whatsappReply?: {
522
+ enabled?: boolean;
523
+ text?: string;
524
+ cta?: {
525
+ body?: string;
526
+ buttonLabel?: string;
527
+ buttonUrl?: string;
528
+ mediaUrl?: string;
529
+ };
530
+ };
531
+ /** Extra contact fields on the sign-up form. */
532
+ registrationFields?: Array<{
533
+ key: string;
534
+ showDuringRegistration?: boolean;
535
+ placement?: 'inline' | 'after';
536
+ required?: boolean;
537
+ }>;
538
+ collectNameOnPasswordlessSignup?: boolean;
539
+ /** Default `verify-auto-login`. */
540
+ emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login';
541
+ emailVerificationGracePeriod?: number;
542
+ lockUnverifiedAfterGrace?: boolean;
543
+ /** Offer "Forgot password?" and send reset emails (default true). false → the request answers `PASSWORD_RESET_DISABLED` (403). */
544
+ allowPasswordReset?: boolean;
545
+ /** Second step at sign-in. */
546
+ mfa?: AuthKitMfaConfig;
547
+ /** Where the site sends people after they sign in: your page reads it from {@link authKit.load} in `onAuthSuccess`. */
548
+ afterSignInUrl?: string;
549
+ /** Extra domains emailed links may return to (the collection's own domains are always allowed). */
550
+ allowedRedirectDomains?: string[];
551
+ /** Wording on the screens. */
552
+ texts?: Partial<Record<AuthKitTextKey, string>>;
553
+ /** Wording of the account emails, per email. Preview with {@link authKit.previewEmail}. */
554
+ emailTemplates?: Partial<Record<AuthKitEmailKind, AuthKitEmailTemplate>>;
555
+ /** The account emails' look. The sender is the collection's email settings (verified domain). */
556
+ emailBranding?: {
557
+ logoUrl?: string;
558
+ buttonColor?: string;
559
+ footerHtml?: string;
560
+ };
561
+ /** Where each secret is and a masked hint — never the value. Server-owned. */
562
+ secrets?: Record<string, {
563
+ ref: string;
564
+ hint?: string | null;
565
+ collectionId?: string;
566
+ setAt?: string;
567
+ }>;
452
568
  customCss?: string;
453
569
  termsUrl?: string;
454
570
  privacyUrl?: string;
@@ -539,7 +655,80 @@ export interface AuthKitSetIdentityResponse {
539
655
  * })
540
656
  * ```
541
657
  */
542
- export type AuthKitConfigInput = Partial<Omit<AuthKitConfig, 'id' | 'updatedAt' | 'identity'>> & Record<string, any>;
658
+ export type AuthKitConfigInput = Partial<Omit<AuthKitConfig, 'id' | 'updatedAt' | 'identity' | 'secrets'>> & Record<string, any>;
659
+ /** {@link authKit.schema}: every setting, its default, what reads it, in plain words. */
660
+ export interface AuthKitSchema {
661
+ providers: AuthKitProvider[];
662
+ emailKinds: AuthKitEmailKind[];
663
+ emailFields: Array<keyof AuthKitEmailTemplate>;
664
+ textKeys: AuthKitTextKey[];
665
+ /** Secret names (set through {@link authKit.secretEntryLink}). */
666
+ secrets: string[];
667
+ /** Fields never written through create/update. */
668
+ serverOwned: string[];
669
+ /** where: `screens` (the sign-in UI reads it), `server` (the API enforces it), `both`, `host` (your page reads it from {@link authKit.load}). */
670
+ fields: Array<{
671
+ path: string;
672
+ group: string;
673
+ where: 'screens' | 'server' | 'both' | 'host';
674
+ default: unknown;
675
+ description: string;
676
+ }>;
677
+ }
678
+ /** One thing worth knowing about a sign-in's settings (from {@link authKit.settings}). */
679
+ export interface AuthKitCheck {
680
+ /** `problem`: on but will fail; `warning`: works, probably not meant; `info`: worth knowing. */
681
+ level: 'problem' | 'warning' | 'info';
682
+ code: string;
683
+ message: string;
684
+ /** The setting to change. */
685
+ setting?: string;
686
+ }
687
+ /** {@link authKit.settings}: what sign-in does now. */
688
+ export interface AuthKitSettingsResponse {
689
+ authKitId: string;
690
+ ownLogins: 'own' | 'shared';
691
+ /** As stored (no secret values). */
692
+ config: AuthKitConfig;
693
+ /** Every default filled in. */
694
+ effective: Required<Pick<AuthKitConfig, 'enabledProviders' | 'providerOrder' | 'signUp' | 'allowPasswordReset' | 'emailVerificationMode'>> & AuthKitConfig;
695
+ secrets: Record<string, {
696
+ set: boolean;
697
+ hint?: string | null;
698
+ setAt?: string | null;
699
+ legacy?: boolean;
700
+ }>;
701
+ checks: AuthKitCheck[];
702
+ }
703
+ /** Body of {@link authKit.setup}. */
704
+ export interface AuthKitSetupRequest {
705
+ /** For a new sign-in. */
706
+ name?: string;
707
+ /** Give it its own logins (members of this site only). ONE WAY. Needed for `signUp: 'invite'`. */
708
+ ownLogins?: boolean;
709
+ /** A first settings patch, checked like {@link authKit.update}. No secrets. */
710
+ settings?: AuthKitConfigInput;
711
+ }
712
+ /** Result of {@link authKit.setup}. */
713
+ export interface AuthKitSetupResponse {
714
+ authKit: AuthKitConfig;
715
+ created: boolean;
716
+ ownLogins: 'own' | 'shared';
717
+ /** What this call changed, in plain words (empty when nothing). */
718
+ changed: string[];
719
+ }
720
+ /** Result of {@link authKit.previewEmail}. */
721
+ export interface AuthKitEmailPreview {
722
+ kind: AuthKitEmailKind;
723
+ subject: string;
724
+ html: string;
725
+ }
726
+ /** Result of {@link authKit.secretEntryLink}. */
727
+ export interface AuthKitSecretLink {
728
+ /** A SmartLinks page where the person types the secret. Works once. */
729
+ url: string;
730
+ expiresAt: string;
731
+ }
543
732
  /**
544
733
  * Per-collection account-security policy. The API **enforces** all of this; the
545
734
  * client uses `passwordPolicy` (live checklist) and `session` (idle sign-out) for UX.
@@ -324,8 +324,13 @@ export interface SubscriptionsResolveResponse {
324
324
  export interface TransactionalSendRequest {
325
325
  /** CRM contact UUID */
326
326
  contactId: string;
327
- /** Firestore template ID */
328
- templateId: string;
327
+ /** A saved template's id. Give this or `message`. */
328
+ templateId?: string;
329
+ /**
330
+ * A typed message instead of a template: plain text, Liquid allowed (`{{ contact.firstName }}`).
331
+ * `sms` is the shorter text for SMS and WhatsApp (defaults to `body`).
332
+ */
333
+ message?: TypedMessage;
329
334
  /**
330
335
  * Channel to send on. Defaults to 'preferred', which auto-selects the
331
336
  * contact's best available channel respecting consent, suppression, and
@@ -355,6 +360,17 @@ export interface TransactionalSendRequest {
355
360
  ref?: string;
356
361
  /** App context stored on the comms-events row */
357
362
  appId?: string;
363
+ /**
364
+ * What the message is about: the record it was sent for and the admin screen that shows it, so it is a
365
+ * link in Messages, on the contact's Activity, and on the conversation a reply opens. `appId` defaults
366
+ * to the sending app.
367
+ */
368
+ about?: MessageAbout;
369
+ /**
370
+ * `'service'` (a confirmation, a reminder, an update): an asked-for channel the person turned off, or a
371
+ * suppressed email, is refused (`transactional.opted_out`). Marketing goes out as a campaign.
372
+ */
373
+ category?: 'service';
358
374
  /**
359
375
  * Files to attach (email only; at most 5, 10 MB in all). What can't be made is left out and listed in
360
376
  * `attachmentsLeftOut` — the email still goes.
@@ -391,6 +407,27 @@ export interface TransactionalSendResponse {
391
407
  /** Attachments that couldn't be made, and why (the email went without them) */
392
408
  attachmentsLeftOut?: string[];
393
409
  }
410
+ /** A message written there and then rather than a saved template. */
411
+ export interface TypedMessage {
412
+ subject?: string;
413
+ body: string;
414
+ /** The shorter text for SMS and WhatsApp (defaults to `body`). */
415
+ sms?: string;
416
+ }
417
+ /**
418
+ * What a message is about (docs/comms.md, "What a message is about"). Ids only, never content.
419
+ * `view` and `params` name one of the app's admin views (manifest `adminViews`, docs/admin-views.md).
420
+ */
421
+ export interface MessageAbout {
422
+ appId?: string;
423
+ /** What kind of record: `'booking'`, `'entry'`, `'case'`. */
424
+ type: string;
425
+ id: string;
426
+ view?: string;
427
+ params?: Record<string, string>;
428
+ /** A short label to show without looking the record up: `'Sat 3pm, table for 4'`. */
429
+ label?: string;
430
+ }
394
431
  export interface TransactionalSendError {
395
432
  ok: false;
396
433
  /**
@@ -403,6 +440,8 @@ export interface TransactionalSendError {
403
440
  * - `transactional.whatsapp_missing`
404
441
  * - `transactional.no_push_methods`
405
442
  * - `transactional.no_wallet_methods`
443
+ * - `transactional.opted_out` (category `'service'`: the person turned that channel off, or the email is suppressed)
444
+ * - `transactional.template_or_message` / `transactional.message_invalid` / `transactional.about_invalid`
406
445
  */
407
446
  error: string;
408
447
  }
@@ -41,6 +41,11 @@ export interface Container {
41
41
  metadata?: Record<string, any>;
42
42
  /** UUID of the parent container; `undefined` / `null` for top-level containers */
43
43
  parentContainerId?: string;
44
+ /**
45
+ * A place that doesn't move (a site, a rack, a bin) rather than something carried (a pallet, a drum).
46
+ * "Where is this pallet?" is the first fixed container above it. Default `false`.
47
+ */
48
+ fixed?: boolean;
44
49
  /** Recursively nested children — populated only when `?tree=true` */
45
50
  children?: Container[];
46
51
  /** Current (or historical) items — populated only when `?includeContents=true` */
@@ -91,6 +96,8 @@ export interface CreateContainerInput {
91
96
  metadata?: Record<string, any>;
92
97
  /** UUID of the parent container; omit to create a top-level container */
93
98
  parentContainerId?: string;
99
+ /** A place that doesn't move (a bin), rather than something carried (a pallet). Default `false`. */
100
+ fixed?: boolean;
94
101
  }
95
102
  /**
96
103
  * Request body for `PATCH /containers/:id`.
@@ -105,6 +112,7 @@ export interface UpdateContainerInput {
105
112
  metadata?: Record<string, any>;
106
113
  /** Pass `null` to promote the container to top-level. */
107
114
  parentContainerId?: string | null;
115
+ fixed?: boolean;
108
116
  }
109
117
  /** Request body for `POST /containers/:id/items` — adds items to a container. */
110
118
  export interface AddContainerItemsInput {
@@ -16,8 +16,38 @@ export interface AppDataField {
16
16
  public?: boolean;
17
17
  /** For `ref` / `ref[]`: the declared type id, or 'product' | 'contact' | 'proof'. */
18
18
  to?: string;
19
- /** For `enum`: the allowed values. */
19
+ /**
20
+ * For `enum`: the allowed values, fixed by the app (changed by a release). Use this when the app's
21
+ * code branches on the values (job stages, statuses).
22
+ */
20
23
  options?: string[];
24
+ /**
25
+ * For `enum`: the id of a value list in `data.lists` whose values the admin edits (hold reasons,
26
+ * teams). Instead of `options`. The record stores the value's code. docs/admin-lists-and-pickers.md
27
+ */
28
+ list?: string;
29
+ }
30
+ /** One value of a value list. The code never changes and is never removed (only switched off). */
31
+ export interface AppValueListValue {
32
+ /** Stored on records. Letters, digits, dots, dashes; unique in the list. */
33
+ code: string;
34
+ /** What people see; free to change. Defaults to the code. */
35
+ label?: string;
36
+ /** Switched off: hidden from new choices, still shown on records that carry it. Default true. */
37
+ active?: boolean;
38
+ }
39
+ /**
40
+ * A value list the app declares: values only (a code, a label, on or off), edited by the admin in
41
+ * Studio. The manifest's `values` are the starting values, used until the admin first saves the list.
42
+ */
43
+ export interface AppValueList {
44
+ label: string;
45
+ description?: string;
46
+ values: AppValueListValue[];
47
+ /** The admin may add, rename, reorder and switch off values. Default true. */
48
+ editable?: boolean;
49
+ /** Anyone may read it (`SL.app.options` on the public API). Default false: admins and server code. */
50
+ public?: boolean;
21
51
  }
22
52
  /** How a type's items are stored. */
23
53
  export type AppDataStorage =
@@ -65,11 +95,29 @@ export interface AppDataType {
65
95
  };
66
96
  /** The app version that introduced this type. */
67
97
  since?: string;
98
+ /** The list's name in Studio's Set-up lists (plural, short): "Machines". Default: the description. */
99
+ title?: string;
100
+ /** The field a picker shows. Default: `label` (then `name`, then `title`). */
101
+ label?: string;
102
+ /** A field shown as a picker entry's second line (e.g. a machine's stage). */
103
+ sublabel?: string;
104
+ /** A boolean field that switches an entry off (false = off). Default: the record's status. */
105
+ activeField?: string;
106
+ /** A number field pickers sort by. Default: `sortOrder` (then `order`), then the label. */
107
+ orderField?: string;
108
+ /** A short list (dozens to hundreds): `ctx.sl.appRecords.all` reads it from cache. */
109
+ small?: boolean;
110
+ /** A set-up list the admin keeps: Studio shows a generated list and form for it. Implies `checked`. */
111
+ setup?: boolean;
112
+ /** Records of this type are checked against these fields when saved (400 INVALID_RECORD). */
113
+ checked?: boolean;
68
114
  }
69
115
  export interface AppDataDeclaration {
70
116
  /** Semver of the data contract itself (not the app's version). Major = breaking. */
71
117
  schemaVersion: string;
72
118
  types: Record<string, AppDataType>;
119
+ /** Value lists the admin edits, by id (lowercase, dashes): picked by `enum` fields with `list`. */
120
+ lists?: Record<string, AppValueList>;
73
121
  }
74
122
  /** What kind of content a provider supplies — how site builders find it. */
75
123
  export type HeadlessCategory = 'faq' | 'media' | 'pages' | 'articles' | 'catalog' | 'events' | 'locations' | 'people' | 'reviews' | 'documents' | 'forms' | 'other';
@@ -36,6 +36,21 @@ export interface IframeResponderOptions {
36
36
  onAuthLogin?: (token: string, user: any, accountData?: Record<string, any>) => Promise<void>;
37
37
  onAuthLogout?: () => Promise<void>;
38
38
  onRouteChange?: (path: string, state: Record<string, string>) => void;
39
+ /**
40
+ * The app said it follows `smartlinks:navigate` (docs/admin-views.md): from now on `navigate()` moves
41
+ * it without a reload. `views` are the ids it declared.
42
+ */
43
+ onNavigable?: (info: {
44
+ views: string[];
45
+ chrome: 'none' | 'full';
46
+ }) => void;
47
+ /** The app's answer to a `navigate()`: where it went, or why it couldn't. */
48
+ onNavigateResult?: (result: {
49
+ ok: boolean;
50
+ view: string | null;
51
+ path: string | null;
52
+ reason?: string;
53
+ }) => void;
39
54
  /**
40
55
  * Size the iframe to the app's content, for an app placed in a page (a booking form in a website, a
41
56
  * widget in a section): the page scrolls, never the iframe. The responder sets the iframe's height from
@@ -66,7 +81,7 @@ export interface RouteChangeMessage {
66
81
  }
67
82
  export interface SmartlinksIframeMessage {
68
83
  _smartlinksIframeMessage: true;
69
- type: 'smartlinks:resize' | 'smartlinks:redirect' | 'smartlinks:authkit:login' | 'smartlinks:authkit:logout' | 'smartlinks:authkit:redirect';
84
+ type: 'smartlinks:resize' | 'smartlinks:redirect' | 'smartlinks:authkit:login' | 'smartlinks:authkit:logout' | 'smartlinks:authkit:redirect' | 'smartlinks:navigable' | 'smartlinks:navigate-result' | 'smartlinks:open-app';
70
85
  payload: Record<string, any>;
71
86
  messageId?: string;
72
87
  }
@@ -15,6 +15,8 @@ export * from "./itemContext.js";
15
15
  export * from "./contact.js";
16
16
  export * from "./broadcasts.js";
17
17
  export * from "./segments.js";
18
+ export * from "./userGroups.js";
19
+ export * from "./operations.js";
18
20
  export * from "./common.js";
19
21
  export * from "./journeys.js";
20
22
  export * from "./journeysAnalytics.js";
@@ -45,4 +47,5 @@ export * from "./research.js";
45
47
  export * from "./config.js";
46
48
  export * from "./widgets.js";
47
49
  export * from "./headless.js";
50
+ export * from "./appOptions.js";
48
51
  export * from "./clientLog.js";
@@ -17,6 +17,8 @@ export * from "./itemContext.js";
17
17
  export * from "./contact.js";
18
18
  export * from "./broadcasts.js";
19
19
  export * from "./segments.js";
20
+ export * from "./userGroups.js";
21
+ export * from "./operations.js";
20
22
  export * from "./common.js";
21
23
  export * from "./journeys.js";
22
24
  export * from "./journeysAnalytics.js";
@@ -47,4 +49,5 @@ export * from "./research.js";
47
49
  export * from "./config.js";
48
50
  export * from "./widgets.js";
49
51
  export * from "./headless.js";
52
+ export * from "./appOptions.js";
50
53
  export * from "./clientLog.js";