@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,53 @@
1
- /*
2
- * The contents of this file were inserted manually and are not generated by Stainless.
1
+ import { generateId } from "./_helpers.mjs";
2
+ // ---------------------------------------------------------------------------
3
+ // Class
4
+ // ---------------------------------------------------------------------------
5
+ /**
6
+ * Defines a page layout and registers it with the manifest.
3
7
  *
4
- * Custom object page layouts (detail page structure).
5
- * Backend schema: CUSTOM_OBJECT_PAGE_LAYOUT (v2)
8
+ * A page layout controls the tab structure, section groupings, header fields,
9
+ * and visibility conditions on a custom object's record detail page. You would
10
+ * normally define one layout per custom object using `apiName: 'default'`.
6
11
  *
7
- * CDK-style: `new CustomObjectPageLayout(customObject, props)` auto-registers
8
- * with the CO's scope. `blueprint_key` defaults to the CO's api_name.
9
- * For the layout that drives **Add** and the default detail view, use
10
- * `apiName: 'default'` (one per custom object). `CustomObjectPageLayout.basic`
11
- * uses `default` automatically.
12
+ * For simple single-tab layouts, use the {@link CustomObjectPageLayout.basic}
13
+ * factory instead of constructing the full props manually.
12
14
  *
13
- * TabEditsDTO / HeaderEditsDTO / VisibilityConditionsDTO are strict
14
- * dataclasses on the backend. They expect camelCase keys on the wire
15
- * (newTabs, systemTabEdits, fieldRqlName, newTitleField, ...). Snake_case
16
- * keys are silently dropped and produce an empty layout on deploy. The
17
- * interfaces below mirror the DTO field aliases exactly.
15
+ * > **Caution:** all keys inside `tabEdits` and `headerEdits` must be camelCase.
16
+ * > Snake_case keys are silently dropped on the wire and produce an empty layout.
18
17
  *
19
- * TS catches misspellings on direct object literals but not on spreads,
20
- * `as` casts, or loosely-typed variables — so be careful when constructing
21
- * these objects dynamically.
18
+ * @example
19
+ * ```ts
20
+ * new CustomObjectPageLayout(memberObj, {
21
+ * apiName: 'default',
22
+ * name: 'Member',
23
+ * layoutId: 'layout_gym_member',
24
+ * headerEdits: { newTitleField: memberDisplayName.getApiName() },
25
+ * tabEdits: {
26
+ * newTabs: [{
27
+ * key: 'member', name: 'Member', type: 'tab_with_sections',
28
+ * sections: [{
29
+ * key: 'profile', name: 'Profile', type: 'fields_section',
30
+ * fields: [
31
+ * { fieldRqlName: memberFirstName.getApiName() },
32
+ * { fieldRqlName: memberEmail.getApiName() },
33
+ * ],
34
+ * }],
35
+ * }],
36
+ * systemTabEdits: {},
37
+ * tabsOrder: ['member'],
38
+ * },
39
+ * visibilityConditions: {},
40
+ * });
41
+ * ```
22
42
  *
23
- * DTO references: types/edits.py, types/layout.py, types/sections.py.
43
+ * @see {@link CustomObjectPageLayout.basic} factory for simple single-tab layouts.
24
44
  */
25
- import { generateId } from "./_helpers.mjs";
26
- // ---------------------------------------------------------------------------
27
- // Class
28
- // ---------------------------------------------------------------------------
29
45
  export class CustomObjectPageLayout {
30
- /** Build a new layout and auto-register with the CO's scope. */
46
+ /**
47
+ * @param customObject - The custom object this layout belongs to.
48
+ * @param props - Initialization properties.
49
+ * @throws {Error} If `apiName` or `name` is empty.
50
+ */
31
51
  constructor(customObject, props) {
32
52
  if (!props.apiName)
33
53
  throw new Error('CustomObjectPageLayout: apiName cannot be empty');
@@ -43,19 +63,29 @@ export class CustomObjectPageLayout {
43
63
  this._blueprintKey = props.blueprintKey;
44
64
  customObject._register(this);
45
65
  }
46
- /** Backend layout_id used as this layout's identifier. */
66
+ /**
67
+ * Returns the stable identifier for this layout record (e.g. `'layout_gym_member'`).
68
+ */
47
69
  getLayoutId() {
48
70
  return this._layoutId;
49
71
  }
50
- /** Stable api_name for this layout. */
72
+ /**
73
+ * Returns the api_name of this layout (e.g. `'default'`).
74
+ */
51
75
  getApiName() {
52
76
  return this._apiName;
53
77
  }
54
- /** api_name of the CustomObject this layout lives on. */
78
+ /**
79
+ * Returns the api_name of the custom object this layout belongs to.
80
+ */
55
81
  getCustomObjectApiName() {
56
82
  return this._customObjectApiName;
57
83
  }
58
- /** Serialize to the backend `CUSTOM_OBJECT_PAGE_LAYOUT` wire shape. */
84
+ /**
85
+ * Serializes this layout to the wire format consumed by the manifest install endpoint.
86
+ *
87
+ * @returns A plain object with `type: 'CUSTOM_OBJECT_PAGE_LAYOUT'`.
88
+ */
59
89
  toDict() {
60
90
  const d = {
61
91
  type: 'CUSTOM_OBJECT_PAGE_LAYOUT',
@@ -72,7 +102,23 @@ export class CustomObjectPageLayout {
72
102
  };
73
103
  return d;
74
104
  }
75
- /** Factory for a single-tab "Details" page listing the given fields. */
105
+ /**
106
+ * Creates a simple single-tab "Details" layout with a single "General" section.
107
+ *
108
+ * Use this factory when you want a straightforward layout without customizing
109
+ * tabs or sections. Always uses `apiName: 'default'`.
110
+ *
111
+ * @param customObject - The custom object to create the layout for.
112
+ * @param props - Optional. Pass `fields` to populate the General section.
113
+ * @returns A new `CustomObjectPageLayout` registered with the manifest.
114
+ *
115
+ * @example
116
+ * ```ts
117
+ * CustomObjectPageLayout.basic(memberObj, {
118
+ * fields: [memberFirstName, memberEmail, memberStatusField],
119
+ * });
120
+ * ```
121
+ */
76
122
  static basic(customObject, props = {}) {
77
123
  const coApiName = customObject.getApiName();
78
124
  const coName = customObject.getName();
@@ -1 +1 @@
1
- {"version":3,"file":"custom-object-page-layout.mjs","sourceRoot":"","sources":["../../src/lib/manifest/custom-object-page-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;OAEI,EAAE,UAAU,EAAE;AAuKrB,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,MAAM,OAAO,sBAAsB;IAUjC,gEAAgE;IAChE,YAAY,YAA0B,EAAE,KAAkC;QACxE,IAAI,CAAC,KAAK,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACvF,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QACjF,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAC5C,IAAI,CAAC,qBAAqB,GAAG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AI,EAAE,SAAS;wBACf,IAAI,EAAE,mBAAmB;wBACzB,QAAQ,EAAE;4BACR;gCACE,GAAG,EAAE,SAAS;gCACd,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,gBAAgB;gCACtB,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC;oCAC9C,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE;iCAC7B,CAAC,CAAC;6BACJ;yBACF;qBACF;iBACF;gBACD,cAAc,EAAE,EAAE;gBAClB,SAAS,EAAE,CAAC,SAAS,CAAC;aACvB;YACD,WAAW,EAAE,EAAE;YACf,oBAAoB,EAAE,EAAE;SACzB,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"custom-object-page-layout.mjs","sourceRoot":"","sources":["../../src/lib/manifest/custom-object-page-layout.ts"],"names":[],"mappings":"OAAO,EAAE,UAAU,EAAE;AAiQrB,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAO,sBAAsB;IAUjC;;;;OAIG;IACH,YAAY,YAA0B,EAAE,KAAkC;QACxE,IAAI,CAAC,KAAK,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACvF,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QACjF,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QAC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,IAAI,sBAAsB,CAAC,YAAY,EAAE;YAC9C,OAAO,EAAE,SAAS;YAClB,IAAI,EAAE,GAAG,MAAM,SAAS;YACxB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,GAAG,EAAE,SAAS;wBACd,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,mBAAmB;wBACzB,QAAQ,EAAE;4BACR;gCACE,GAAG,EAAE,SAAS;gCACd,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,gBAAgB;gCACtB,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC;oCAC9C,YAAY,EAAE,CAAC,CAAC,UAAU,EAAE;iCAC7B,CAAC,CAAC;6BACJ;yBACF;qBACF;iBACF;gBACD,cAAc,EAAE,EAAE;gBAClB,SAAS,EAAE,CAAC,SAAS,CAAC;aACvB;YACD,WAAW,EAAE,EAAE;YACf,oBAAoB,EAAE,EAAE;SACzB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,33 +1,131 @@
1
1
  import { Category } from "./category.mjs";
2
2
  import type { ManifestComponent, ManifestScope } from "./manifest-builder.mjs";
3
+ /**
4
+ * Icon displayed next to the custom object name in the Rippling UI.
5
+ */
3
6
  export interface IconConfig {
7
+ /**
8
+ * A Unicode emoji character, e.g. `'🏋️'`.
9
+ *
10
+ * Optional. Omit all four sources (or pass `null`) to show no icon.
11
+ */
4
12
  emoji?: string | null;
13
+ /**
14
+ * Name of a built-in Rippling icon asset.
15
+ *
16
+ * Optional.
17
+ */
5
18
  ripplingIcon?: string | null;
19
+ /**
20
+ * S3 bucket for a custom image asset.
21
+ *
22
+ * Optional. Must be set together with `s3Key`.
23
+ */
6
24
  s3Bucket?: string;
25
+ /**
26
+ * S3 key (path) within `s3Bucket`.
27
+ *
28
+ * Optional. Must be set together with `s3Bucket`.
29
+ */
7
30
  s3Key?: string;
8
31
  }
32
+ /**
33
+ * Initialization properties for {@link CustomObject}.
34
+ */
9
35
  export interface CustomObjectProps {
10
- /** Required. Unique api_name (must end with `__c`). */
36
+ /**
37
+ * Unique identifier for this custom object.
38
+ *
39
+ * Required. Must end with `__c` (e.g. `'gym_member__c'`). The constructor throws
40
+ * immediately if this suffix is missing.
41
+ */
11
42
  apiName: string;
12
- /** Required. Singular display name. */
43
+ /**
44
+ * Singular display name shown in the Rippling UI (e.g. `'Member'`).
45
+ *
46
+ * Required.
47
+ */
13
48
  name: string;
14
49
  /**
15
- * Required. Category this object belongs to. Accepts a live `Category` ref
16
- * (the SDK reads its api_name) or a raw api_name string for categories
17
- * authored outside this manifest (e.g. Rippling-native or cross-package).
50
+ * The category this object belongs to.
51
+ *
52
+ * Required. Pass a {@link Category} instance defined in the same manifest, or a raw
53
+ * api_name string for categories defined outside this manifest.
18
54
  */
19
55
  category: Category | string;
20
- /** Optional. What this entity represents. @default null */
56
+ /**
57
+ * Human-readable description of what this entity represents.
58
+ *
59
+ * Optional. @default null
60
+ */
21
61
  description?: string | null;
22
- /** Optional. Icon configuration. @default null */
62
+ /**
63
+ * Icon shown next to the object name in the Rippling UI.
64
+ *
65
+ * Optional. @default null
66
+ */
23
67
  icon?: IconConfig | null;
24
- /** Optional. Plural display form. @default null */
68
+ /**
69
+ * Plural form of the display name, used in list headings (e.g. `'Members'`).
70
+ *
71
+ * Optional. @default null
72
+ */
25
73
  pluralLabel?: string | null;
26
- /** Optional. Overrides for autonumber name fields. @default null */
74
+ /**
75
+ * Overrides for the auto-number name field — controls the format string and starting number.
76
+ * Leave `null` to use the default name field behavior.
77
+ *
78
+ * Optional. @default null
79
+ */
27
80
  nameFieldDetails?: Record<string, any> | null;
28
- /** Optional. Default field section name. @default null */
81
+ /**
82
+ * API name of the field section that newly created fields are grouped into by default.
83
+ *
84
+ * Optional. @default null
85
+ */
29
86
  defaultFieldSectionName?: string | null;
30
87
  }
88
+ /**
89
+ * Defines a custom object and registers it with the manifest.
90
+ *
91
+ * A custom object is a new entity type with its own fields, validations, rules, list views,
92
+ * and page layouts. You would normally define all custom objects near the top of your manifest
93
+ * file, then define their children (fields, sections, rules, etc.) below. Each child takes
94
+ * the `CustomObject` instance as its first argument and registers automatically.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const manifest = new ManifestBuilder({
99
+ * key: 'gym_membership_management',
100
+ * name: 'Gym Membership Management',
101
+ * });
102
+ *
103
+ * const gymCategory = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
104
+ *
105
+ * const memberObj = new CustomObject(manifest, {
106
+ * apiName: 'gym_member__c',
107
+ * name: 'Member',
108
+ * pluralLabel: 'Members',
109
+ * category: gymCategory,
110
+ * description: 'Gym member profile, contact, and membership status',
111
+ * icon: { emoji: '🏋️' },
112
+ * });
113
+ *
114
+ * // The object is now a scope — children register through it:
115
+ * const firstName = new TextField(memberObj, {
116
+ * apiName: 'first_name__c',
117
+ * displayName: 'First name',
118
+ * required: true,
119
+ * });
120
+ * ```
121
+ *
122
+ * @remarks
123
+ * **Required: every `CustomObject` must have at least one `CustomObjectPageLayout` in the
124
+ * manifest.** Omitting it passes component-level validation but fails at the package level
125
+ * with `DEPENDENCY_ERROR: Page layout config for CO (api_name=...) not found in package
126
+ * configs. CO requires at least one page layout in the package.`
127
+ * Use {@link CustomObjectPageLayout.basic} for a minimal single-tab layout.
128
+ */
31
129
  export declare class CustomObject implements ManifestScope {
32
130
  private readonly _scope;
33
131
  private readonly _apiName;
@@ -38,15 +136,30 @@ export declare class CustomObject implements ManifestScope {
38
136
  private _pluralLabel;
39
137
  private _nameFieldDetails;
40
138
  private _defaultFieldSectionName;
41
- /** Build a new CO and auto-register with `scope`; enforces `__c` suffix on `apiName`. */
139
+ /**
140
+ * @param scope - The manifest or parent scope to register this object with.
141
+ * @param props - Initialization properties.
142
+ * @throws {Error} If `props.apiName` does not end with `__c`.
143
+ */
42
144
  constructor(scope: ManifestScope, props: CustomObjectProps);
43
- /** @internal Scope hook: forward child registration up to the builder. */
145
+ /** @internal Scope hook forwards child registration up to the root builder. */
44
146
  _register(component: ManifestComponent): void;
45
- /** Backend api_name for this custom object. */
147
+ /**
148
+ * Returns the api_name of this custom object (e.g. `'gym_member__c'`).
149
+ *
150
+ * Use the return value wherever a field or layout needs to reference this object by name.
151
+ */
46
152
  getApiName(): string;
47
- /** Singular display name. */
153
+ /**
154
+ * Returns the singular display name of this custom object (e.g. `'Member'`).
155
+ */
48
156
  getName(): string;
49
- /** Serialize to the backend `CUSTOM_OBJECT` wire shape. */
157
+ /**
158
+ * Serializes this custom object to the wire format consumed by the manifest install endpoint.
159
+ *
160
+ * @returns A plain object with `type: 'CUSTOM_OBJECT'` and all configured fields.
161
+ * Optional fields are omitted when `null`. An `icon` with no populated keys is omitted entirely.
162
+ */
50
163
  toDict(): Record<string, any>;
51
164
  }
52
165
  //# sourceMappingURL=custom-object.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-object.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/custom-object.ts"],"names":[],"mappings":"OAsBO,EAAE,QAAQ,EAAE;OACZ,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE;AA4IhD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kDAAkD;IAClD,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,mDAAmD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AM;IAIpB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CA0B9B"}
@@ -1,33 +1,131 @@
1
1
  import { Category } from "./category.js";
2
2
  import type { ManifestComponent, ManifestScope } from "./manifest-builder.js";
3
+ /**
4
+ * Icon displayed next to the custom object name in the Rippling UI.
5
+ */
3
6
  export interface IconConfig {
7
+ /**
8
+ * A Unicode emoji character, e.g. `'🏋️'`.
9
+ *
10
+ * Optional. Omit all four sources (or pass `null`) to show no icon.
11
+ */
4
12
  emoji?: string | null;
13
+ /**
14
+ * Name of a built-in Rippling icon asset.
15
+ *
16
+ * Optional.
17
+ */
5
18
  ripplingIcon?: string | null;
19
+ /**
20
+ * S3 bucket for a custom image asset.
21
+ *
22
+ * Optional. Must be set together with `s3Key`.
23
+ */
6
24
  s3Bucket?: string;
25
+ /**
26
+ * S3 key (path) within `s3Bucket`.
27
+ *
28
+ * Optional. Must be set together with `s3Bucket`.
29
+ */
7
30
  s3Key?: string;
8
31
  }
32
+ /**
33
+ * Initialization properties for {@link CustomObject}.
34
+ */
9
35
  export interface CustomObjectProps {
10
- /** Required. Unique api_name (must end with `__c`). */
36
+ /**
37
+ * Unique identifier for this custom object.
38
+ *
39
+ * Required. Must end with `__c` (e.g. `'gym_member__c'`). The constructor throws
40
+ * immediately if this suffix is missing.
41
+ */
11
42
  apiName: string;
12
- /** Required. Singular display name. */
43
+ /**
44
+ * Singular display name shown in the Rippling UI (e.g. `'Member'`).
45
+ *
46
+ * Required.
47
+ */
13
48
  name: string;
14
49
  /**
15
- * Required. Category this object belongs to. Accepts a live `Category` ref
16
- * (the SDK reads its api_name) or a raw api_name string for categories
17
- * authored outside this manifest (e.g. Rippling-native or cross-package).
50
+ * The category this object belongs to.
51
+ *
52
+ * Required. Pass a {@link Category} instance defined in the same manifest, or a raw
53
+ * api_name string for categories defined outside this manifest.
18
54
  */
19
55
  category: Category | string;
20
- /** Optional. What this entity represents. @default null */
56
+ /**
57
+ * Human-readable description of what this entity represents.
58
+ *
59
+ * Optional. @default null
60
+ */
21
61
  description?: string | null;
22
- /** Optional. Icon configuration. @default null */
62
+ /**
63
+ * Icon shown next to the object name in the Rippling UI.
64
+ *
65
+ * Optional. @default null
66
+ */
23
67
  icon?: IconConfig | null;
24
- /** Optional. Plural display form. @default null */
68
+ /**
69
+ * Plural form of the display name, used in list headings (e.g. `'Members'`).
70
+ *
71
+ * Optional. @default null
72
+ */
25
73
  pluralLabel?: string | null;
26
- /** Optional. Overrides for autonumber name fields. @default null */
74
+ /**
75
+ * Overrides for the auto-number name field — controls the format string and starting number.
76
+ * Leave `null` to use the default name field behavior.
77
+ *
78
+ * Optional. @default null
79
+ */
27
80
  nameFieldDetails?: Record<string, any> | null;
28
- /** Optional. Default field section name. @default null */
81
+ /**
82
+ * API name of the field section that newly created fields are grouped into by default.
83
+ *
84
+ * Optional. @default null
85
+ */
29
86
  defaultFieldSectionName?: string | null;
30
87
  }
88
+ /**
89
+ * Defines a custom object and registers it with the manifest.
90
+ *
91
+ * A custom object is a new entity type with its own fields, validations, rules, list views,
92
+ * and page layouts. You would normally define all custom objects near the top of your manifest
93
+ * file, then define their children (fields, sections, rules, etc.) below. Each child takes
94
+ * the `CustomObject` instance as its first argument and registers automatically.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const manifest = new ManifestBuilder({
99
+ * key: 'gym_membership_management',
100
+ * name: 'Gym Membership Management',
101
+ * });
102
+ *
103
+ * const gymCategory = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
104
+ *
105
+ * const memberObj = new CustomObject(manifest, {
106
+ * apiName: 'gym_member__c',
107
+ * name: 'Member',
108
+ * pluralLabel: 'Members',
109
+ * category: gymCategory,
110
+ * description: 'Gym member profile, contact, and membership status',
111
+ * icon: { emoji: '🏋️' },
112
+ * });
113
+ *
114
+ * // The object is now a scope — children register through it:
115
+ * const firstName = new TextField(memberObj, {
116
+ * apiName: 'first_name__c',
117
+ * displayName: 'First name',
118
+ * required: true,
119
+ * });
120
+ * ```
121
+ *
122
+ * @remarks
123
+ * **Required: every `CustomObject` must have at least one `CustomObjectPageLayout` in the
124
+ * manifest.** Omitting it passes component-level validation but fails at the package level
125
+ * with `DEPENDENCY_ERROR: Page layout config for CO (api_name=...) not found in package
126
+ * configs. CO requires at least one page layout in the package.`
127
+ * Use {@link CustomObjectPageLayout.basic} for a minimal single-tab layout.
128
+ */
31
129
  export declare class CustomObject implements ManifestScope {
32
130
  private readonly _scope;
33
131
  private readonly _apiName;
@@ -38,15 +136,30 @@ export declare class CustomObject implements ManifestScope {
38
136
  private _pluralLabel;
39
137
  private _nameFieldDetails;
40
138
  private _defaultFieldSectionName;
41
- /** Build a new CO and auto-register with `scope`; enforces `__c` suffix on `apiName`. */
139
+ /**
140
+ * @param scope - The manifest or parent scope to register this object with.
141
+ * @param props - Initialization properties.
142
+ * @throws {Error} If `props.apiName` does not end with `__c`.
143
+ */
42
144
  constructor(scope: ManifestScope, props: CustomObjectProps);
43
- /** @internal Scope hook: forward child registration up to the builder. */
145
+ /** @internal Scope hook forwards child registration up to the root builder. */
44
146
  _register(component: ManifestComponent): void;
45
- /** Backend api_name for this custom object. */
147
+ /**
148
+ * Returns the api_name of this custom object (e.g. `'gym_member__c'`).
149
+ *
150
+ * Use the return value wherever a field or layout needs to reference this object by name.
151
+ */
46
152
  getApiName(): string;
47
- /** Singular display name. */
153
+ /**
154
+ * Returns the singular display name of this custom object (e.g. `'Member'`).
155
+ */
48
156
  getName(): string;
49
- /** Serialize to the backend `CUSTOM_OBJECT` wire shape. */
157
+ /**
158
+ * Serializes this custom object to the wire format consumed by the manifest install endpoint.
159
+ *
160
+ * @returns A plain object with `type: 'CUSTOM_OBJECT'` and all configured fields.
161
+ * Optional fields are omitted when `null`. An `icon` with no populated keys is omitted entirely.
162
+ */
50
163
  toDict(): Record<string, any>;
51
164
  }
52
165
  //# sourceMappingURL=custom-object.d.ts.map
@@ -1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AC;IAC9C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,YAAa,YAAW,aAAa;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,KAAK,CAAgC;IAC7C,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,iBAAiB,CAAyC;IAClE,OAAO,CAAC,wBAAwB,CAA4B;IAE5D;;;;OAIG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB;IAqB1D,iFAAiF;IACjF,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;IAI7C;;;;OAIG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CA0B9B"}
@@ -1,25 +1,4 @@
1
1
  "use strict";
2
- /*
3
- * The contents of this file were inserted manually and are not generated by Stainless.
4
- *
5
- * CustomObject builder. Backend schema: CUSTOM_OBJECT (v2).
6
- *
7
- * Construction is CDK-style: `new CustomObject(scope, props)` where `scope`
8
- * is the `ManifestBuilder` (or any `ManifestScope`). The CO also acts as a
9
- * scope for its own children (fields, validations, rules, list views, page
10
- * layouts, sections, actions) — those take the CO as their first arg and
11
- * auto-register with the manifest through it.
12
- *
13
- * Every CO auto-registers 9 platform-managed standard field stubs at
14
- * construction, matching `STANDARD_FIELDS` in the backend's `constants.py`:
15
- * id, created_at, updated_at, system_updated_at, external_id, name,
16
- * owner_role, last_modified_by, created_by
17
- * The backend's closed-world `extract_from_configs` path (used by
18
- * `POST /metadata/v2/validate`) treats these as hard dependencies of the CO —
19
- * for any brand-new CO their configs must already be present in the submitted
20
- * manifest, else validation raises `DEPENDENCY_ERROR`. Users never declare
21
- * them explicitly; the SDK emits them with `is_standard: true`.
22
- */
23
2
  Object.defineProperty(exports, "__esModule", { value: true });
24
3
  exports.CustomObject = void 0;
25
4
  // ────────────────────────────────────────────────────────────────────────
@@ -148,8 +127,53 @@ class _StandardField {
148
127
  };
149
128
  }
150
129
  }
130
+ /**
131
+ * Defines a custom object and registers it with the manifest.
132
+ *
133
+ * A custom object is a new entity type with its own fields, validations, rules, list views,
134
+ * and page layouts. You would normally define all custom objects near the top of your manifest
135
+ * file, then define their children (fields, sections, rules, etc.) below. Each child takes
136
+ * the `CustomObject` instance as its first argument and registers automatically.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * const manifest = new ManifestBuilder({
141
+ * key: 'gym_membership_management',
142
+ * name: 'Gym Membership Management',
143
+ * });
144
+ *
145
+ * const gymCategory = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
146
+ *
147
+ * const memberObj = new CustomObject(manifest, {
148
+ * apiName: 'gym_member__c',
149
+ * name: 'Member',
150
+ * pluralLabel: 'Members',
151
+ * category: gymCategory,
152
+ * description: 'Gym member profile, contact, and membership status',
153
+ * icon: { emoji: '🏋️' },
154
+ * });
155
+ *
156
+ * // The object is now a scope — children register through it:
157
+ * const firstName = new TextField(memberObj, {
158
+ * apiName: 'first_name__c',
159
+ * displayName: 'First name',
160
+ * required: true,
161
+ * });
162
+ * ```
163
+ *
164
+ * @remarks
165
+ * **Required: every `CustomObject` must have at least one `CustomObjectPageLayout` in the
166
+ * manifest.** Omitting it passes component-level validation but fails at the package level
167
+ * with `DEPENDENCY_ERROR: Page layout config for CO (api_name=...) not found in package
168
+ * configs. CO requires at least one page layout in the package.`
169
+ * Use {@link CustomObjectPageLayout.basic} for a minimal single-tab layout.
170
+ */
151
171
  class CustomObject {
152
- /** Build a new CO and auto-register with `scope`; enforces `__c` suffix on `apiName`. */
172
+ /**
173
+ * @param scope - The manifest or parent scope to register this object with.
174
+ * @param props - Initialization properties.
175
+ * @throws {Error} If `props.apiName` does not end with `__c`.
176
+ */
153
177
  constructor(scope, props) {
154
178
  if (!props.apiName.endsWith('__c')) {
155
179
  throw new Error(`Custom object api_name must end with __c: ${props.apiName}`);
@@ -169,19 +193,30 @@ class CustomObject {
169
193
  scope._register(new _StandardField(this._apiName, spec));
170
194
  }
171
195
  }
172
- /** @internal Scope hook: forward child registration up to the builder. */
196
+ /** @internal Scope hook forwards child registration up to the root builder. */
173
197
  _register(component) {
174
198
  this._scope._register(component);
175
199
  }
176
- /** Backend api_name for this custom object. */
200
+ /**
201
+ * Returns the api_name of this custom object (e.g. `'gym_member__c'`).
202
+ *
203
+ * Use the return value wherever a field or layout needs to reference this object by name.
204
+ */
177
205
  getApiName() {
178
206
  return this._apiName;
179
207
  }
180
- /** Singular display name. */
208
+ /**
209
+ * Returns the singular display name of this custom object (e.g. `'Member'`).
210
+ */
181
211
  getName() {
182
212
  return this._name;
183
213
  }
184
- /** Serialize to the backend `CUSTOM_OBJECT` wire shape. */
214
+ /**
215
+ * Serializes this custom object to the wire format consumed by the manifest install endpoint.
216
+ *
217
+ * @returns A plain object with `type: 'CUSTOM_OBJECT'` and all configured fields.
218
+ * Optional fields are omitted when `null`. An `icon` with no populated keys is omitted entirely.
219
+ */
185
220
  toDict() {
186
221
  const component = {
187
222
  type: 'CUSTOM_OBJECT',