@rippling/rippling-sdk 0.2.0-alpha.34 → 0.2.0-alpha.35

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 (230) hide show
  1. package/lib/manifest/app.d.mts +81 -13
  2. package/lib/manifest/app.d.mts.map +1 -1
  3. package/lib/manifest/app.d.ts +81 -13
  4. package/lib/manifest/app.d.ts.map +1 -1
  5. package/lib/manifest/app.js +37 -16
  6. package/lib/manifest/app.js.map +1 -1
  7. package/lib/manifest/app.mjs +37 -16
  8. package/lib/manifest/app.mjs.map +1 -1
  9. package/lib/manifest/category.d.mts +63 -7
  10. package/lib/manifest/category.d.mts.map +1 -1
  11. package/lib/manifest/category.d.ts +63 -7
  12. package/lib/manifest/category.d.ts.map +1 -1
  13. package/lib/manifest/category.js +45 -10
  14. package/lib/manifest/category.js.map +1 -1
  15. package/lib/manifest/category.mjs +43 -8
  16. package/lib/manifest/category.mjs.map +1 -1
  17. package/lib/manifest/custom-object-field-section.d.mts +56 -6
  18. package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
  19. package/lib/manifest/custom-object-field-section.d.ts +56 -6
  20. package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
  21. package/lib/manifest/custom-object-field-section.js +41 -14
  22. package/lib/manifest/custom-object-field-section.js.map +1 -1
  23. package/lib/manifest/custom-object-field-section.mjs +39 -12
  24. package/lib/manifest/custom-object-field-section.mjs.map +1 -1
  25. package/lib/manifest/custom-object-page-layout.d.mts +201 -41
  26. package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
  27. package/lib/manifest/custom-object-page-layout.d.ts +201 -41
  28. package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
  29. package/lib/manifest/custom-object-page-layout.js +76 -30
  30. package/lib/manifest/custom-object-page-layout.js.map +1 -1
  31. package/lib/manifest/custom-object-page-layout.mjs +74 -28
  32. package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
  33. package/lib/manifest/custom-object.d.mts +128 -15
  34. package/lib/manifest/custom-object.d.mts.map +1 -1
  35. package/lib/manifest/custom-object.d.ts +128 -15
  36. package/lib/manifest/custom-object.d.ts.map +1 -1
  37. package/lib/manifest/custom-object.js +61 -26
  38. package/lib/manifest/custom-object.js.map +1 -1
  39. package/lib/manifest/custom-object.mjs +61 -26
  40. package/lib/manifest/custom-object.mjs.map +1 -1
  41. package/lib/manifest/field.d.mts +265 -54
  42. package/lib/manifest/field.d.mts.map +1 -1
  43. package/lib/manifest/field.d.ts +265 -54
  44. package/lib/manifest/field.d.ts.map +1 -1
  45. package/lib/manifest/field.js +100 -57
  46. package/lib/manifest/field.js.map +1 -1
  47. package/lib/manifest/field.mjs +100 -57
  48. package/lib/manifest/field.mjs.map +1 -1
  49. package/lib/manifest/list-view.d.mts +105 -14
  50. package/lib/manifest/list-view.d.mts.map +1 -1
  51. package/lib/manifest/list-view.d.ts +105 -14
  52. package/lib/manifest/list-view.d.ts.map +1 -1
  53. package/lib/manifest/list-view.js +50 -14
  54. package/lib/manifest/list-view.js.map +1 -1
  55. package/lib/manifest/list-view.mjs +48 -12
  56. package/lib/manifest/list-view.mjs.map +1 -1
  57. package/lib/manifest/manifest-builder.d.mts +77 -11
  58. package/lib/manifest/manifest-builder.d.mts.map +1 -1
  59. package/lib/manifest/manifest-builder.d.ts +77 -11
  60. package/lib/manifest/manifest-builder.d.ts.map +1 -1
  61. package/lib/manifest/manifest-builder.js +46 -24
  62. package/lib/manifest/manifest-builder.js.map +1 -1
  63. package/lib/manifest/manifest-builder.mjs +44 -22
  64. package/lib/manifest/manifest-builder.mjs.map +1 -1
  65. package/lib/manifest/manifest-function.d.mts +92 -12
  66. package/lib/manifest/manifest-function.d.mts.map +1 -1
  67. package/lib/manifest/manifest-function.d.ts +92 -12
  68. package/lib/manifest/manifest-function.d.ts.map +1 -1
  69. package/lib/manifest/manifest-function.js +40 -11
  70. package/lib/manifest/manifest-function.js.map +1 -1
  71. package/lib/manifest/manifest-function.mjs +38 -9
  72. package/lib/manifest/manifest-function.mjs.map +1 -1
  73. package/lib/manifest/rule.d.mts +94 -16
  74. package/lib/manifest/rule.d.mts.map +1 -1
  75. package/lib/manifest/rule.d.ts +94 -16
  76. package/lib/manifest/rule.d.ts.map +1 -1
  77. package/lib/manifest/rule.js +36 -15
  78. package/lib/manifest/rule.js.map +1 -1
  79. package/lib/manifest/rule.mjs +36 -15
  80. package/lib/manifest/rule.mjs.map +1 -1
  81. package/lib/manifest/sdui-page.d.mts +67 -11
  82. package/lib/manifest/sdui-page.d.mts.map +1 -1
  83. package/lib/manifest/sdui-page.d.ts +67 -11
  84. package/lib/manifest/sdui-page.d.ts.map +1 -1
  85. package/lib/manifest/sdui-page.js +44 -13
  86. package/lib/manifest/sdui-page.js.map +1 -1
  87. package/lib/manifest/sdui-page.mjs +42 -11
  88. package/lib/manifest/sdui-page.mjs.map +1 -1
  89. package/lib/manifest/validation.d.mts +87 -12
  90. package/lib/manifest/validation.d.mts.map +1 -1
  91. package/lib/manifest/validation.d.ts +87 -12
  92. package/lib/manifest/validation.d.ts.map +1 -1
  93. package/lib/manifest/validation.js +41 -15
  94. package/lib/manifest/validation.js.map +1 -1
  95. package/lib/manifest/validation.mjs +39 -13
  96. package/lib/manifest/validation.mjs.map +1 -1
  97. package/lib/sdui/actions.d.mts +25 -0
  98. package/lib/sdui/actions.d.mts.map +1 -0
  99. package/lib/sdui/actions.d.ts +25 -0
  100. package/lib/sdui/actions.d.ts.map +1 -0
  101. package/lib/sdui/actions.js +53 -0
  102. package/lib/sdui/actions.js.map +1 -0
  103. package/lib/sdui/actions.mjs +42 -0
  104. package/lib/sdui/actions.mjs.map +1 -0
  105. package/lib/sdui/component.d.mts +41 -0
  106. package/lib/sdui/component.d.mts.map +1 -0
  107. package/lib/sdui/component.d.ts +41 -0
  108. package/lib/sdui/component.d.ts.map +1 -0
  109. package/lib/sdui/component.js +95 -0
  110. package/lib/sdui/component.js.map +1 -0
  111. package/lib/sdui/component.mjs +91 -0
  112. package/lib/sdui/component.mjs.map +1 -0
  113. package/lib/sdui/components.d.mts +149 -0
  114. package/lib/sdui/components.d.mts.map +1 -0
  115. package/lib/sdui/components.d.ts +149 -0
  116. package/lib/sdui/components.d.ts.map +1 -0
  117. package/lib/sdui/components.js +303 -0
  118. package/lib/sdui/components.js.map +1 -0
  119. package/lib/sdui/components.mjs +298 -0
  120. package/lib/sdui/components.mjs.map +1 -0
  121. package/lib/sdui/conditions.d.mts +25 -0
  122. package/lib/sdui/conditions.d.mts.map +1 -0
  123. package/lib/sdui/conditions.d.ts +25 -0
  124. package/lib/sdui/conditions.d.ts.map +1 -0
  125. package/lib/sdui/conditions.js +47 -0
  126. package/lib/sdui/conditions.js.map +1 -0
  127. package/lib/sdui/conditions.mjs +35 -0
  128. package/lib/sdui/conditions.mjs.map +1 -0
  129. package/lib/sdui/directives.d.mts +18 -0
  130. package/lib/sdui/directives.d.mts.map +1 -0
  131. package/lib/sdui/directives.d.ts +18 -0
  132. package/lib/sdui/directives.d.ts.map +1 -0
  133. package/lib/sdui/directives.js +28 -0
  134. package/lib/sdui/directives.js.map +1 -0
  135. package/lib/sdui/directives.mjs +21 -0
  136. package/lib/sdui/directives.mjs.map +1 -0
  137. package/lib/sdui/index.d.mts +362 -0
  138. package/lib/sdui/index.d.mts.map +1 -0
  139. package/lib/sdui/index.d.ts +362 -0
  140. package/lib/sdui/index.d.ts.map +1 -0
  141. package/lib/sdui/index.js +375 -0
  142. package/lib/sdui/index.js.map +1 -0
  143. package/lib/sdui/index.mjs +199 -0
  144. package/lib/sdui/index.mjs.map +1 -0
  145. package/lib/sdui/props.d.mts +12 -0
  146. package/lib/sdui/props.d.mts.map +1 -0
  147. package/lib/sdui/props.d.ts +12 -0
  148. package/lib/sdui/props.d.ts.map +1 -0
  149. package/lib/sdui/props.js +25 -0
  150. package/lib/sdui/props.js.map +1 -0
  151. package/lib/sdui/props.mjs +21 -0
  152. package/lib/sdui/props.mjs.map +1 -0
  153. package/lib/sdui/render.d.mts +23 -0
  154. package/lib/sdui/render.d.mts.map +1 -0
  155. package/lib/sdui/render.d.ts +23 -0
  156. package/lib/sdui/render.d.ts.map +1 -0
  157. package/lib/sdui/render.js +40 -0
  158. package/lib/sdui/render.js.map +1 -0
  159. package/lib/sdui/render.mjs +37 -0
  160. package/lib/sdui/render.mjs.map +1 -0
  161. package/lib/sdui/state.d.mts +22 -0
  162. package/lib/sdui/state.d.mts.map +1 -0
  163. package/lib/sdui/state.d.ts +22 -0
  164. package/lib/sdui/state.d.ts.map +1 -0
  165. package/lib/sdui/state.js +57 -0
  166. package/lib/sdui/state.js.map +1 -0
  167. package/lib/sdui/state.mjs +53 -0
  168. package/lib/sdui/state.mjs.map +1 -0
  169. package/package.json +1 -1
  170. package/resources/draft-hires.d.mts +4 -0
  171. package/resources/draft-hires.d.mts.map +1 -1
  172. package/resources/draft-hires.d.ts +4 -0
  173. package/resources/draft-hires.d.ts.map +1 -1
  174. package/resources/files.d.mts +16 -1
  175. package/resources/files.d.mts.map +1 -1
  176. package/resources/files.d.ts +16 -1
  177. package/resources/files.d.ts.map +1 -1
  178. package/resources/headcount-positions.d.mts +2 -2
  179. package/resources/headcount-positions.d.mts.map +1 -1
  180. package/resources/headcount-positions.d.ts +2 -2
  181. package/resources/headcount-positions.d.ts.map +1 -1
  182. package/resources/legal-entities.d.mts +1 -1
  183. package/resources/legal-entities.d.mts.map +1 -1
  184. package/resources/legal-entities.d.ts +1 -1
  185. package/resources/legal-entities.d.ts.map +1 -1
  186. package/resources/location-factors.d.mts +2 -2
  187. package/resources/location-factors.d.mts.map +1 -1
  188. package/resources/location-factors.d.ts +2 -2
  189. package/resources/location-factors.d.ts.map +1 -1
  190. package/resources/shared.d.mts +1 -1
  191. package/resources/shared.d.mts.map +1 -1
  192. package/resources/shared.d.ts +1 -1
  193. package/resources/shared.d.ts.map +1 -1
  194. package/resources/workers.d.mts +2 -2
  195. package/resources/workers.d.mts.map +1 -1
  196. package/resources/workers.d.ts +2 -2
  197. package/resources/workers.d.ts.map +1 -1
  198. package/src/lib/manifest/app.ts +81 -26
  199. package/src/lib/manifest/category.ts +63 -14
  200. package/src/lib/manifest/custom-object-field-section.ts +56 -17
  201. package/src/lib/manifest/custom-object-page-layout.ts +201 -66
  202. package/src/lib/manifest/custom-object.ts +128 -37
  203. package/src/lib/manifest/field.ts +265 -75
  204. package/src/lib/manifest/list-view.ts +105 -25
  205. package/src/lib/manifest/manifest-builder.ts +75 -32
  206. package/src/lib/manifest/manifest-function.ts +92 -22
  207. package/src/lib/manifest/rule.ts +95 -29
  208. package/src/lib/manifest/sdui-page.ts +67 -21
  209. package/src/lib/manifest/validation.ts +87 -24
  210. package/src/lib/sdui/actions.ts +58 -0
  211. package/src/lib/sdui/component.ts +122 -0
  212. package/src/lib/sdui/components.ts +308 -0
  213. package/src/lib/sdui/conditions.ts +59 -0
  214. package/src/lib/sdui/directives.ts +42 -0
  215. package/src/lib/sdui/index.ts +365 -0
  216. package/src/lib/sdui/props.ts +32 -0
  217. package/src/lib/sdui/render.ts +58 -0
  218. package/src/lib/sdui/state.ts +60 -0
  219. package/src/resources/draft-hires.ts +5 -0
  220. package/src/resources/files.ts +18 -1
  221. package/src/resources/headcount-positions.ts +2 -0
  222. package/src/resources/legal-entities.ts +1 -0
  223. package/src/resources/location-factors.ts +2 -0
  224. package/src/resources/shared.ts +1 -0
  225. package/src/resources/workers.ts +2 -0
  226. package/src/version.ts +1 -1
  227. package/version.d.mts +1 -1
  228. package/version.d.ts +1 -1
  229. package/version.js +1 -1
  230. package/version.mjs +1 -1
@@ -1,33 +1,89 @@
1
1
  import type { ManifestFunction } from "./manifest-function.js";
2
2
  import type { ManifestScope } from "./manifest-builder.js";
3
+ /**
4
+ * Initialization properties for {@link SduiPage}.
5
+ */
3
6
  export interface SduiPageProps {
4
- /** Required. Unique ID for this page within the package. */
7
+ /**
8
+ * Unique identifier for this page within the package (e.g. `'gym_today_schedule'`).
9
+ *
10
+ * Required.
11
+ */
5
12
  sduiPageId: string;
6
- /** Required. Display name shown as the tab label. */
13
+ /**
14
+ * Display name shown as the tab label in the app (e.g. `'Today\'s schedule'`).
15
+ *
16
+ * Required.
17
+ */
7
18
  name: string;
8
19
  /**
9
- * Required. Backing function. Pass a live `ManifestFunction` ref (the SDK
10
- * reads its api_name) or a raw api_name string for functions authored
11
- * outside this manifest.
20
+ * The function that renders this page. Pass a live {@link ManifestFunction} reference,
21
+ * or a raw api_name string for functions defined outside this manifest.
22
+ *
23
+ * Required.
12
24
  */
13
25
  function: ManifestFunction | string;
14
- /** Optional. Human-readable description. */
26
+ /**
27
+ * Human-readable description of what this page shows.
28
+ *
29
+ * Optional. @default `''`
30
+ */
15
31
  description?: string;
16
32
  }
33
+ /**
34
+ * Defines an SDUI page and registers it with the manifest.
35
+ *
36
+ * An SDUI page is a custom UI surface backed by a {@link ManifestFunction}. It appears
37
+ * as a tab in a Rippling {@link App}. You would normally define SDUI pages after the
38
+ * functions they reference, then pass them to an `App` via `pages`.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const todaySchedulePage = new SduiPage(manifest, {
43
+ * sduiPageId: 'gym_today_schedule',
44
+ * name: 'Today\'s schedule',
45
+ * function: todayScheduleFn,
46
+ * description: 'SDUI list of class sessions for front desk',
47
+ * });
48
+ *
49
+ * new App(manifest, {
50
+ * apiName: 'gym_membership_management_app',
51
+ * name: 'Gym Membership Management',
52
+ * pages: [memberObj, trainerObj, todaySchedulePage],
53
+ * });
54
+ * ```
55
+ *
56
+ * @see {@link ManifestFunction} — provides the handler that renders this page.
57
+ * @see {@link App} — hosts this page as a tab via `pages`.
58
+ */
17
59
  export declare class SduiPage {
18
60
  private readonly _sduiPageId;
19
61
  private readonly _name;
20
62
  private readonly _functionApiName;
21
63
  private readonly _description;
22
- /** Build a new SDUI page and auto-register with `scope`; resolves the function api_name eagerly. */
64
+ /**
65
+ * @param scope - The manifest to register this page with.
66
+ * @param props - Initialization properties.
67
+ * @throws {Error} If `sduiPageId`, `name`, or `function` is missing.
68
+ */
23
69
  constructor(scope: ManifestScope, props: SduiPageProps);
24
- /** Identifier slug for this page within the package. */
70
+ /**
71
+ * Returns the unique page identifier (e.g. `'gym_today_schedule'`).
72
+ */
25
73
  getSduiPageId(): string;
26
- /** Display name (tab label). */
74
+ /**
75
+ * Returns the display name (tab label) of this page.
76
+ */
27
77
  getName(): string;
28
- /** api_name of the function backing this page. */
78
+ /**
79
+ * Returns the api_name of the function backing this page.
80
+ */
29
81
  getFunctionApiName(): string;
30
- /** Serialize to the backend `SDUI_PAGE` wire shape. */
82
+ /**
83
+ * Serializes this SDUI page to the wire format consumed by the manifest install endpoint.
84
+ *
85
+ * @returns A plain object with `type: 'SDUI_PAGE'`.
86
+ */
31
87
  toDict(): Record<string, any>;
32
88
  }
33
89
  //# sourceMappingURL=sdui-page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdui-page.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"OAUO,KAAK,EAAE,gBAAgB,EAAE;OACzB,KAAK,EAAE,aAAa,EAAE;AAE7B,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACpC,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,oGAAoG;gBACxF,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa;IAWtD,wDAAwD;IACxD,aAAa,IAAI,MAAM;IAIvB,gCAAgC;IAChC,OAAO,IAAI,MAAM;IAIjB,kDAAkD;IAClD,kBAAkB,IAAI,MAAM;IAI5B,uDAAuD;IACvD,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAS9B"}
1
+ {"version":3,"file":"sdui-page.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,gBAAgB,EAAE;OACzB,KAAK,EAAE,aAAa,EAAE;AAE7B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC;;;;OAIG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa;IAWtD;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAI5B;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAS9B"}
@@ -1,17 +1,38 @@
1
1
  "use strict";
2
- /*
3
- * The contents of this file were inserted manually and are not generated by Stainless.
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SduiPage = void 0;
4
+ /**
5
+ * Defines an SDUI page and registers it with the manifest.
6
+ *
7
+ * An SDUI page is a custom UI surface backed by a {@link ManifestFunction}. It appears
8
+ * as a tab in a Rippling {@link App}. You would normally define SDUI pages after the
9
+ * functions they reference, then pass them to an `App` via `pages`.
4
10
  *
5
- * SDUI page definitions for Unity packages.
6
- * Backend schema: SDUI_PAGE (v2) — `SDUIPageConfig` in
7
- * `app/hub_platform/sdui/unity_package/sdui_page_interface.py`.
11
+ * @example
12
+ * ```ts
13
+ * const todaySchedulePage = new SduiPage(manifest, {
14
+ * sduiPageId: 'gym_today_schedule',
15
+ * name: 'Today\'s schedule',
16
+ * function: todayScheduleFn,
17
+ * description: 'SDUI list of class sessions for front desk',
18
+ * });
8
19
  *
9
- * Dependency order: FUNCTION → SDUI_PAGE → CUSTOM_APP.
20
+ * new App(manifest, {
21
+ * apiName: 'gym_membership_management_app',
22
+ * name: 'Gym Membership Management',
23
+ * pages: [memberObj, trainerObj, todaySchedulePage],
24
+ * });
25
+ * ```
26
+ *
27
+ * @see {@link ManifestFunction} — provides the handler that renders this page.
28
+ * @see {@link App} — hosts this page as a tab via `pages`.
10
29
  */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SduiPage = void 0;
13
30
  class SduiPage {
14
- /** Build a new SDUI page and auto-register with `scope`; resolves the function api_name eagerly. */
31
+ /**
32
+ * @param scope - The manifest to register this page with.
33
+ * @param props - Initialization properties.
34
+ * @throws {Error} If `sduiPageId`, `name`, or `function` is missing.
35
+ */
15
36
  constructor(scope, props) {
16
37
  if (!props.sduiPageId)
17
38
  throw new Error('sduiPageId is required');
@@ -25,19 +46,29 @@ class SduiPage {
25
46
  this._description = props.description ?? '';
26
47
  scope._register(this);
27
48
  }
28
- /** Identifier slug for this page within the package. */
49
+ /**
50
+ * Returns the unique page identifier (e.g. `'gym_today_schedule'`).
51
+ */
29
52
  getSduiPageId() {
30
53
  return this._sduiPageId;
31
54
  }
32
- /** Display name (tab label). */
55
+ /**
56
+ * Returns the display name (tab label) of this page.
57
+ */
33
58
  getName() {
34
59
  return this._name;
35
60
  }
36
- /** api_name of the function backing this page. */
61
+ /**
62
+ * Returns the api_name of the function backing this page.
63
+ */
37
64
  getFunctionApiName() {
38
65
  return this._functionApiName;
39
66
  }
40
- /** Serialize to the backend `SDUI_PAGE` wire shape. */
67
+ /**
68
+ * Serializes this SDUI page to the wire format consumed by the manifest install endpoint.
69
+ *
70
+ * @returns A plain object with `type: 'SDUI_PAGE'`.
71
+ */
41
72
  toDict() {
42
73
  return {
43
74
  type: 'SDUI_PAGE',
@@ -1 +1 @@
1
- {"version":3,"file":"sdui-page.js","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAoBH,MAAa,QAAQ;IAMnB,oGAAoG;IACpG,YAAY,KAAoB,EAAE,KAAoB;QACpD,IAAI,CAAC,KAAK,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,gBAAgB,GAAG,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC1G,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAC5C,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,wDAAwD;IACxD,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,gCAAgC;IAChC,OAAO;QACL,OA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,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,YAAY,EAAE,IAAI,CAAC,WAAW;YAC9B,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;YACxC,WAAW,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC;IACJ,CAAC;CACF;AAzDD,4BAyDC"}
@@ -1,14 +1,35 @@
1
- /*
2
- * The contents of this file were inserted manually and are not generated by Stainless.
1
+ /**
2
+ * Defines an SDUI page and registers it with the manifest.
3
3
  *
4
- * SDUI page definitions for Unity packages.
5
- * Backend schema: SDUI_PAGE (v2) `SDUIPageConfig` in
6
- * `app/hub_platform/sdui/unity_package/sdui_page_interface.py`.
4
+ * An SDUI page is a custom UI surface backed by a {@link ManifestFunction}. It appears
5
+ * as a tab in a Rippling {@link App}. You would normally define SDUI pages after the
6
+ * functions they reference, then pass them to an `App` via `pages`.
7
7
  *
8
- * Dependency order: FUNCTION → SDUI_PAGE → CUSTOM_APP.
8
+ * @example
9
+ * ```ts
10
+ * const todaySchedulePage = new SduiPage(manifest, {
11
+ * sduiPageId: 'gym_today_schedule',
12
+ * name: 'Today\'s schedule',
13
+ * function: todayScheduleFn,
14
+ * description: 'SDUI list of class sessions for front desk',
15
+ * });
16
+ *
17
+ * new App(manifest, {
18
+ * apiName: 'gym_membership_management_app',
19
+ * name: 'Gym Membership Management',
20
+ * pages: [memberObj, trainerObj, todaySchedulePage],
21
+ * });
22
+ * ```
23
+ *
24
+ * @see {@link ManifestFunction} — provides the handler that renders this page.
25
+ * @see {@link App} — hosts this page as a tab via `pages`.
9
26
  */
10
27
  export class SduiPage {
11
- /** Build a new SDUI page and auto-register with `scope`; resolves the function api_name eagerly. */
28
+ /**
29
+ * @param scope - The manifest to register this page with.
30
+ * @param props - Initialization properties.
31
+ * @throws {Error} If `sduiPageId`, `name`, or `function` is missing.
32
+ */
12
33
  constructor(scope, props) {
13
34
  if (!props.sduiPageId)
14
35
  throw new Error('sduiPageId is required');
@@ -22,19 +43,29 @@ export class SduiPage {
22
43
  this._description = props.description ?? '';
23
44
  scope._register(this);
24
45
  }
25
- /** Identifier slug for this page within the package. */
46
+ /**
47
+ * Returns the unique page identifier (e.g. `'gym_today_schedule'`).
48
+ */
26
49
  getSduiPageId() {
27
50
  return this._sduiPageId;
28
51
  }
29
- /** Display name (tab label). */
52
+ /**
53
+ * Returns the display name (tab label) of this page.
54
+ */
30
55
  getName() {
31
56
  return this._name;
32
57
  }
33
- /** api_name of the function backing this page. */
58
+ /**
59
+ * Returns the api_name of the function backing this page.
60
+ */
34
61
  getFunctionApiName() {
35
62
  return this._functionApiName;
36
63
  }
37
- /** Serialize to the backend `SDUI_PAGE` wire shape. */
64
+ /**
65
+ * Serializes this SDUI page to the wire format consumed by the manifest install endpoint.
66
+ *
67
+ * @returns A plain object with `type: 'SDUI_PAGE'`.
68
+ */
38
69
  toDict() {
39
70
  return {
40
71
  type: 'SDUI_PAGE',
@@ -1 +1 @@
1
- {"version":3,"file":"sdui-page.mjs","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoBH,MAAM,OAAO,QAAQ;IAMnB,oGAAoG;IACpG,YAAY,KAAoB,EAAE,KAAoB;QACpD,IAAI,CAAC,KAAK,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,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ACjE,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,gBAAgB,GAAG,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC1G,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAC5C,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,YAAY,EAAE,IAAI,CAAC,WAAW;YAC9B,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;YACxC,WAAW,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC;IACJ,CAAC;CACF"}
@@ -1,24 +1,87 @@
1
1
  import { type ValidationLevel, type ValidationState } from "./_helpers.mjs";
2
2
  import type { CustomObject } from "./custom-object.mjs";
3
3
  import type { Field } from "./field.mjs";
4
+ /**
5
+ * Initialization properties for {@link Validation}.
6
+ */
4
7
  export interface ValidationProps {
5
- /** Required. Display name of the validation rule. */
8
+ /**
9
+ * Display name of this validation rule shown in the UI.
10
+ *
11
+ * Required.
12
+ */
6
13
  displayName: string;
7
- /** Required. RQL formula — returns true when the record is INVALID. */
14
+ /**
15
+ * RQL formula that returns `true` when the record is **invalid**.
16
+ *
17
+ * Required. Note the violation semantics: a truthy result triggers the error,
18
+ * not a passing check. Example: `'(end_time__c <= start_time__c)'` fires when
19
+ * end is not after start.
20
+ */
8
21
  rqlFormula: string;
9
- /** Required. User-facing error message (empty string for no message). */
22
+ /**
23
+ * User-facing error message shown when the validation fires.
24
+ *
25
+ * Required. Pass an empty string for no message.
26
+ */
10
27
  errorMessage: string;
11
- /** Required. Rule state. */
28
+ /**
29
+ * Whether this rule is active or inactive.
30
+ *
31
+ * Required. One of `'ACTIVE'` | `'INACTIVE'`.
32
+ */
12
33
  state: ValidationState;
13
- /** Required. Rule level. */
34
+ /**
35
+ * Whether the error is shown at the record level or on a specific field.
36
+ *
37
+ * Required. One of `'RECORD'` | `'FIELD'`. When `'FIELD'`, also set `fieldRef`.
38
+ */
14
39
  level: ValidationLevel;
15
- /** Required. Internal description (empty string if unused). */
40
+ /**
41
+ * Internal description of this rule (for developer reference only).
42
+ *
43
+ * Required. Pass an empty string if unused.
44
+ */
16
45
  ruleDescription: string;
17
- /** Identity override. Override the rule identifier. @default generateId('rule') */
46
+ /**
47
+ * Stable identifier for this rule. Pass a human-readable slug
48
+ * (e.g. `'gym_session_end_after_start'`) to keep it stable across regenerations.
49
+ *
50
+ * Optional. Auto-generated when omitted. @default generateId('rule')
51
+ */
18
52
  ruleId?: string;
19
- /** Optional. Field reference (typically paired with `level: 'FIELD'`). */
53
+ /**
54
+ * The field the error is pinned to. Typically paired with `level: 'FIELD'`.
55
+ *
56
+ * Optional.
57
+ */
20
58
  fieldRef?: Field;
21
59
  }
60
+ /**
61
+ * Defines a validation rule and registers it with the manifest.
62
+ *
63
+ * A validation rule evaluates an RQL formula on save and blocks the operation
64
+ * when the formula returns `true`. You would normally define validations after
65
+ * the fields they reference.
66
+ *
67
+ * **Violation semantics:** the formula encodes the *invalid* condition, not the
68
+ * valid one. `'(end_time__c <= start_time__c)'` fires when end is before or equal
69
+ * to start — i.e., it is truthy when the record is wrong.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * new Validation(sessionObj, {
74
+ * ruleId: 'gym_session_end_after_start',
75
+ * displayName: 'End time must be after start',
76
+ * rqlFormula: '(end_time__c <= start_time__c)',
77
+ * errorMessage: 'End time must be after the start time.',
78
+ * ruleDescription: 'Prevents zero-length or inverted intervals',
79
+ * state: 'ACTIVE',
80
+ * level: 'FIELD',
81
+ * fieldRef: sessionEndField,
82
+ * });
83
+ * ```
84
+ */
22
85
  export declare class Validation {
23
86
  private readonly _ruleId;
24
87
  private readonly _customObjectApiName;
@@ -29,13 +92,25 @@ export declare class Validation {
29
92
  private readonly _level;
30
93
  private readonly _ruleDescription;
31
94
  private readonly _fieldRef;
32
- /** Build a new validation rule and auto-register with the CO's scope. */
95
+ /**
96
+ * @param customObject - The custom object this rule applies to.
97
+ * @param props - Initialization properties.
98
+ */
33
99
  constructor(customObject: CustomObject, props: ValidationProps);
34
- /** Backend rule_id used as this validation's identifier. */
100
+ /**
101
+ * Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
102
+ */
35
103
  getRuleId(): string;
36
- /** api_name of the CustomObject this validation lives on. */
104
+ /**
105
+ * Returns the api_name of the custom object this validation rule applies to.
106
+ */
37
107
  getCustomObjectApiName(): string;
38
- /** Serialize to the backend `CUSTOM_OBJECT_VALIDATION_RULE` wire shape. */
108
+ /**
109
+ * Serializes this validation rule to the wire format consumed by the manifest install endpoint.
110
+ *
111
+ * @returns A plain object with `type: 'CUSTOM_OBJECT_VALIDATION_RULE'`.
112
+ * `field_rql_name` is omitted when `fieldRef` was not provided.
113
+ */
39
114
  toDict(): Record<string, any>;
40
115
  }
41
116
  //# sourceMappingURL=validation.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.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,MAAM,EAAE,GAAG,CAAC;CAe9B"}
@@ -1,24 +1,87 @@
1
1
  import { type ValidationLevel, type ValidationState } from "./_helpers.js";
2
2
  import type { CustomObject } from "./custom-object.js";
3
3
  import type { Field } from "./field.js";
4
+ /**
5
+ * Initialization properties for {@link Validation}.
6
+ */
4
7
  export interface ValidationProps {
5
- /** Required. Display name of the validation rule. */
8
+ /**
9
+ * Display name of this validation rule shown in the UI.
10
+ *
11
+ * Required.
12
+ */
6
13
  displayName: string;
7
- /** Required. RQL formula — returns true when the record is INVALID. */
14
+ /**
15
+ * RQL formula that returns `true` when the record is **invalid**.
16
+ *
17
+ * Required. Note the violation semantics: a truthy result triggers the error,
18
+ * not a passing check. Example: `'(end_time__c <= start_time__c)'` fires when
19
+ * end is not after start.
20
+ */
8
21
  rqlFormula: string;
9
- /** Required. User-facing error message (empty string for no message). */
22
+ /**
23
+ * User-facing error message shown when the validation fires.
24
+ *
25
+ * Required. Pass an empty string for no message.
26
+ */
10
27
  errorMessage: string;
11
- /** Required. Rule state. */
28
+ /**
29
+ * Whether this rule is active or inactive.
30
+ *
31
+ * Required. One of `'ACTIVE'` | `'INACTIVE'`.
32
+ */
12
33
  state: ValidationState;
13
- /** Required. Rule level. */
34
+ /**
35
+ * Whether the error is shown at the record level or on a specific field.
36
+ *
37
+ * Required. One of `'RECORD'` | `'FIELD'`. When `'FIELD'`, also set `fieldRef`.
38
+ */
14
39
  level: ValidationLevel;
15
- /** Required. Internal description (empty string if unused). */
40
+ /**
41
+ * Internal description of this rule (for developer reference only).
42
+ *
43
+ * Required. Pass an empty string if unused.
44
+ */
16
45
  ruleDescription: string;
17
- /** Identity override. Override the rule identifier. @default generateId('rule') */
46
+ /**
47
+ * Stable identifier for this rule. Pass a human-readable slug
48
+ * (e.g. `'gym_session_end_after_start'`) to keep it stable across regenerations.
49
+ *
50
+ * Optional. Auto-generated when omitted. @default generateId('rule')
51
+ */
18
52
  ruleId?: string;
19
- /** Optional. Field reference (typically paired with `level: 'FIELD'`). */
53
+ /**
54
+ * The field the error is pinned to. Typically paired with `level: 'FIELD'`.
55
+ *
56
+ * Optional.
57
+ */
20
58
  fieldRef?: Field;
21
59
  }
60
+ /**
61
+ * Defines a validation rule and registers it with the manifest.
62
+ *
63
+ * A validation rule evaluates an RQL formula on save and blocks the operation
64
+ * when the formula returns `true`. You would normally define validations after
65
+ * the fields they reference.
66
+ *
67
+ * **Violation semantics:** the formula encodes the *invalid* condition, not the
68
+ * valid one. `'(end_time__c <= start_time__c)'` fires when end is before or equal
69
+ * to start — i.e., it is truthy when the record is wrong.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * new Validation(sessionObj, {
74
+ * ruleId: 'gym_session_end_after_start',
75
+ * displayName: 'End time must be after start',
76
+ * rqlFormula: '(end_time__c <= start_time__c)',
77
+ * errorMessage: 'End time must be after the start time.',
78
+ * ruleDescription: 'Prevents zero-length or inverted intervals',
79
+ * state: 'ACTIVE',
80
+ * level: 'FIELD',
81
+ * fieldRef: sessionEndField,
82
+ * });
83
+ * ```
84
+ */
22
85
  export declare class Validation {
23
86
  private readonly _ruleId;
24
87
  private readonly _customObjectApiName;
@@ -29,13 +92,25 @@ export declare class Validation {
29
92
  private readonly _level;
30
93
  private readonly _ruleDescription;
31
94
  private readonly _fieldRef;
32
- /** Build a new validation rule and auto-register with the CO's scope. */
95
+ /**
96
+ * @param customObject - The custom object this rule applies to.
97
+ * @param props - Initialization properties.
98
+ */
33
99
  constructor(customObject: CustomObject, props: ValidationProps);
34
- /** Backend rule_id used as this validation's identifier. */
100
+ /**
101
+ * Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
102
+ */
35
103
  getRuleId(): string;
36
- /** api_name of the CustomObject this validation lives on. */
104
+ /**
105
+ * Returns the api_name of the custom object this validation rule applies to.
106
+ */
37
107
  getCustomObjectApiName(): string;
38
- /** Serialize to the backend `CUSTOM_OBJECT_VALIDATION_RULE` wire shape. */
108
+ /**
109
+ * Serializes this validation rule to the wire format consumed by the manifest install endpoint.
110
+ *
111
+ * @returns A plain object with `type: 'CUSTOM_OBJECT_VALIDATION_RULE'`.
112
+ * `field_rql_name` is omitted when `fieldRef` was not provided.
113
+ */
39
114
  toDict(): Record<string, any>;
40
115
  }
41
116
  //# sourceMappingURL=validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAYO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE;OAC1D,KAAK,EAAE,YAAY,EAAE;OACrB,KAAK,EAAE,KAAK,EAAE;AAErB,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB,4BAA4B;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C,yEAAyE;gBAC7D,YA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CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C;;;OAGG;gBACS,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe;IAa9D;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAIhC;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAe9B"}
@@ -1,20 +1,37 @@
1
1
  "use strict";
2
- /*
3
- * The contents of this file were inserted manually and are not generated by Stainless.
4
- *
5
- * Validation rules for custom objects (RQL formulas with violation semantics).
6
- * Backend schema: CUSTOM_OBJECT_VALIDATION_RULE (v2)
7
- *
8
- * VIOLATION SEMANTICS: `rqlFormula` returns true when the record is INVALID.
9
- * Construction is CDK-style: `new Validation(customObject, props)` — the CO
10
- * is the first positional arg, and the validation auto-registers with the
11
- * manifest via the CO's scope chain.
12
- */
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.Validation = void 0;
15
4
  const _helpers_1 = require("./_helpers.js");
5
+ /**
6
+ * Defines a validation rule and registers it with the manifest.
7
+ *
8
+ * A validation rule evaluates an RQL formula on save and blocks the operation
9
+ * when the formula returns `true`. You would normally define validations after
10
+ * the fields they reference.
11
+ *
12
+ * **Violation semantics:** the formula encodes the *invalid* condition, not the
13
+ * valid one. `'(end_time__c <= start_time__c)'` fires when end is before or equal
14
+ * to start — i.e., it is truthy when the record is wrong.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * new Validation(sessionObj, {
19
+ * ruleId: 'gym_session_end_after_start',
20
+ * displayName: 'End time must be after start',
21
+ * rqlFormula: '(end_time__c <= start_time__c)',
22
+ * errorMessage: 'End time must be after the start time.',
23
+ * ruleDescription: 'Prevents zero-length or inverted intervals',
24
+ * state: 'ACTIVE',
25
+ * level: 'FIELD',
26
+ * fieldRef: sessionEndField,
27
+ * });
28
+ * ```
29
+ */
16
30
  class Validation {
17
- /** Build a new validation rule and auto-register with the CO's scope. */
31
+ /**
32
+ * @param customObject - The custom object this rule applies to.
33
+ * @param props - Initialization properties.
34
+ */
18
35
  constructor(customObject, props) {
19
36
  this._ruleId = props.ruleId ?? (0, _helpers_1.generateId)('rule');
20
37
  this._customObjectApiName = customObject.getApiName();
@@ -27,15 +44,24 @@ class Validation {
27
44
  this._fieldRef = props.fieldRef;
28
45
  customObject._register(this);
29
46
  }
30
- /** Backend rule_id used as this validation's identifier. */
47
+ /**
48
+ * Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
49
+ */
31
50
  getRuleId() {
32
51
  return this._ruleId;
33
52
  }
34
- /** api_name of the CustomObject this validation lives on. */
53
+ /**
54
+ * Returns the api_name of the custom object this validation rule applies to.
55
+ */
35
56
  getCustomObjectApiName() {
36
57
  return this._customObjectApiName;
37
58
  }
38
- /** Serialize to the backend `CUSTOM_OBJECT_VALIDATION_RULE` wire shape. */
59
+ /**
60
+ * Serializes this validation rule to the wire format consumed by the manifest install endpoint.
61
+ *
62
+ * @returns A plain object with `type: 'CUSTOM_OBJECT_VALIDATION_RULE'`.
63
+ * `field_rql_name` is omitted when `fieldRef` was not provided.
64
+ */
39
65
  toDict() {
40
66
  const component = {
41
67
  type: 'CUSTOM_OBJECT_VALIDATION_RULE',
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,4CAAoF;AAuBpF,MAAa,UAAU;IAWrB,yEAAyE;IACzE,YAAY,YAA0B,EAAE,KAAsB;QAC5D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,IAAI,IAAA,qBAAU,EAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,oBAAoB,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAA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