@proveanything/smartlinks 2.1.18 → 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 (53) hide show
  1. package/dist/adminViews.d.ts +19 -0
  2. package/dist/adminViews.js +16 -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/docs/API_SUMMARY.md +509 -40
  12. package/dist/docs/admin-lists-and-pickers.md +140 -0
  13. package/dist/docs/admin-views.md +22 -0
  14. package/dist/docs/app-data-storage.md +277 -276
  15. package/dist/docs/auth-kit.md +872 -741
  16. package/dist/docs/comms.md +686 -644
  17. package/dist/docs/customer-guide.md +70 -0
  18. package/dist/docs/headless-providers.md +112 -112
  19. package/dist/docs/server-functions.md +69 -1
  20. package/dist/docs/ui-utils.md +123 -121
  21. package/dist/docs/user-groups.md +175 -168
  22. package/dist/headless.js +38 -2
  23. package/dist/http.js +4 -0
  24. package/dist/index.d.ts +2 -2
  25. package/dist/live.d.ts +80 -0
  26. package/dist/live.js +315 -0
  27. package/dist/openapi.yaml +888 -34
  28. package/dist/testing/index.d.ts +22 -0
  29. package/dist/testing/index.js +31 -0
  30. package/dist/types/appManifest.d.ts +214 -1
  31. package/dist/types/appOptions.d.ts +32 -0
  32. package/dist/types/appOptions.js +3 -0
  33. package/dist/types/authKit.d.ts +193 -4
  34. package/dist/types/comms.d.ts +41 -2
  35. package/dist/types/headless.d.ts +49 -1
  36. package/dist/types/iframeResponder.d.ts +1 -1
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/index.js +1 -0
  39. package/docs/API_SUMMARY.md +509 -40
  40. package/docs/admin-lists-and-pickers.md +140 -0
  41. package/docs/admin-views.md +22 -0
  42. package/docs/app-data-storage.md +277 -276
  43. package/docs/auth-kit.md +872 -741
  44. package/docs/comms.md +686 -644
  45. package/docs/customer-guide.md +70 -0
  46. package/docs/headless-providers.md +112 -112
  47. package/docs/server-functions.md +69 -1
  48. package/docs/ui-utils.md +123 -121
  49. package/docs/user-groups.md +175 -168
  50. package/openapi.yaml +888 -34
  51. package/package.json +1 -1
  52. package/scripts/doctor.mjs +454 -428
  53. package/scripts/lib/keyed-app-data.mjs +21 -0
@@ -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';
@@ -81,7 +81,7 @@ export interface RouteChangeMessage {
81
81
  }
82
82
  export interface SmartlinksIframeMessage {
83
83
  _smartlinksIframeMessage: true;
84
- type: 'smartlinks:resize' | 'smartlinks:redirect' | 'smartlinks:authkit:login' | 'smartlinks:authkit:logout' | 'smartlinks:authkit:redirect' | 'smartlinks:navigable' | 'smartlinks:navigate-result';
84
+ type: 'smartlinks:resize' | 'smartlinks:redirect' | 'smartlinks:authkit:login' | 'smartlinks:authkit:logout' | 'smartlinks:authkit:redirect' | 'smartlinks:navigable' | 'smartlinks:navigate-result' | 'smartlinks:open-app';
85
85
  payload: Record<string, any>;
86
86
  messageId?: string;
87
87
  }
@@ -47,4 +47,5 @@ export * from "./research.js";
47
47
  export * from "./config.js";
48
48
  export * from "./widgets.js";
49
49
  export * from "./headless.js";
50
+ export * from "./appOptions.js";
50
51
  export * from "./clientLog.js";
@@ -49,4 +49,5 @@ export * from "./research.js";
49
49
  export * from "./config.js";
50
50
  export * from "./widgets.js";
51
51
  export * from "./headless.js";
52
+ export * from "./appOptions.js";
52
53
  export * from "./clientLog.js";