@rippling/rippling-sdk 0.2.0-alpha.33 → 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 (284) hide show
  1. package/client.d.mts +8 -2
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts +8 -2
  4. package/client.d.ts.map +1 -1
  5. package/client.js +17 -0
  6. package/client.js.map +1 -1
  7. package/client.mjs +17 -0
  8. package/client.mjs.map +1 -1
  9. package/internal/types.d.mts +6 -6
  10. package/internal/types.d.mts.map +1 -1
  11. package/internal/types.d.ts +6 -6
  12. package/internal/types.d.ts.map +1 -1
  13. package/lib/manifest/_helpers.d.mts +91 -0
  14. package/lib/manifest/_helpers.d.mts.map +1 -0
  15. package/lib/manifest/_helpers.d.ts +91 -0
  16. package/lib/manifest/_helpers.d.ts.map +1 -0
  17. package/lib/manifest/_helpers.js +65 -0
  18. package/lib/manifest/_helpers.js.map +1 -0
  19. package/lib/manifest/_helpers.mjs +61 -0
  20. package/lib/manifest/_helpers.mjs.map +1 -0
  21. package/lib/manifest/app.d.mts +113 -0
  22. package/lib/manifest/app.d.mts.map +1 -0
  23. package/lib/manifest/app.d.ts +113 -0
  24. package/lib/manifest/app.d.ts.map +1 -0
  25. package/lib/manifest/app.js +95 -0
  26. package/lib/manifest/app.js.map +1 -0
  27. package/lib/manifest/app.mjs +91 -0
  28. package/lib/manifest/app.mjs.map +1 -0
  29. package/lib/manifest/category.d.mts +79 -0
  30. package/lib/manifest/category.d.mts.map +1 -0
  31. package/lib/manifest/category.d.ts +79 -0
  32. package/lib/manifest/category.d.ts.map +1 -0
  33. package/lib/manifest/category.js +72 -0
  34. package/lib/manifest/category.js.map +1 -0
  35. package/lib/manifest/category.mjs +68 -0
  36. package/lib/manifest/category.mjs.map +1 -0
  37. package/lib/manifest/custom-object-field-section.d.mts +71 -0
  38. package/lib/manifest/custom-object-field-section.d.mts.map +1 -0
  39. package/lib/manifest/custom-object-field-section.d.ts +71 -0
  40. package/lib/manifest/custom-object-field-section.d.ts.map +1 -0
  41. package/lib/manifest/custom-object-field-section.js +69 -0
  42. package/lib/manifest/custom-object-field-section.js.map +1 -0
  43. package/lib/manifest/custom-object-field-section.mjs +65 -0
  44. package/lib/manifest/custom-object-field-section.mjs.map +1 -0
  45. package/lib/manifest/custom-object-page-layout.d.mts +318 -0
  46. package/lib/manifest/custom-object-page-layout.d.mts.map +1 -0
  47. package/lib/manifest/custom-object-page-layout.d.ts +318 -0
  48. package/lib/manifest/custom-object-page-layout.d.ts.map +1 -0
  49. package/lib/manifest/custom-object-page-layout.js +158 -0
  50. package/lib/manifest/custom-object-page-layout.js.map +1 -0
  51. package/lib/manifest/custom-object-page-layout.mjs +154 -0
  52. package/lib/manifest/custom-object-page-layout.mjs.map +1 -0
  53. package/lib/manifest/custom-object.d.mts +165 -0
  54. package/lib/manifest/custom-object.d.mts.map +1 -0
  55. package/lib/manifest/custom-object.d.ts +165 -0
  56. package/lib/manifest/custom-object.d.ts.map +1 -0
  57. package/lib/manifest/custom-object.js +254 -0
  58. package/lib/manifest/custom-object.js.map +1 -0
  59. package/lib/manifest/custom-object.mjs +250 -0
  60. package/lib/manifest/custom-object.mjs.map +1 -0
  61. package/lib/manifest/field.d.mts +487 -0
  62. package/lib/manifest/field.d.mts.map +1 -0
  63. package/lib/manifest/field.d.ts +487 -0
  64. package/lib/manifest/field.d.ts.map +1 -0
  65. package/lib/manifest/field.js +461 -0
  66. package/lib/manifest/field.js.map +1 -0
  67. package/lib/manifest/field.mjs +438 -0
  68. package/lib/manifest/field.mjs.map +1 -0
  69. package/lib/manifest/index.d.mts +15 -0
  70. package/lib/manifest/index.d.mts.map +1 -0
  71. package/lib/manifest/index.d.ts +15 -0
  72. package/lib/manifest/index.d.ts.map +1 -0
  73. package/lib/manifest/index.js +53 -0
  74. package/lib/manifest/index.js.map +1 -0
  75. package/lib/manifest/index.mjs +18 -0
  76. package/lib/manifest/index.mjs.map +1 -0
  77. package/lib/manifest/list-view.d.mts +138 -0
  78. package/lib/manifest/list-view.d.mts.map +1 -0
  79. package/lib/manifest/list-view.d.ts +138 -0
  80. package/lib/manifest/list-view.d.ts.map +1 -0
  81. package/lib/manifest/list-view.js +109 -0
  82. package/lib/manifest/list-view.js.map +1 -0
  83. package/lib/manifest/list-view.mjs +105 -0
  84. package/lib/manifest/list-view.mjs.map +1 -0
  85. package/lib/manifest/manifest-builder.d.mts +110 -0
  86. package/lib/manifest/manifest-builder.d.mts.map +1 -0
  87. package/lib/manifest/manifest-builder.d.ts +110 -0
  88. package/lib/manifest/manifest-builder.d.ts.map +1 -0
  89. package/lib/manifest/manifest-builder.js +91 -0
  90. package/lib/manifest/manifest-builder.js.map +1 -0
  91. package/lib/manifest/manifest-builder.mjs +87 -0
  92. package/lib/manifest/manifest-builder.mjs.map +1 -0
  93. package/lib/manifest/manifest-function.d.mts +119 -0
  94. package/lib/manifest/manifest-function.d.mts.map +1 -0
  95. package/lib/manifest/manifest-function.d.ts +119 -0
  96. package/lib/manifest/manifest-function.d.ts.map +1 -0
  97. package/lib/manifest/manifest-function.js +85 -0
  98. package/lib/manifest/manifest-function.js.map +1 -0
  99. package/lib/manifest/manifest-function.mjs +81 -0
  100. package/lib/manifest/manifest-function.mjs.map +1 -0
  101. package/lib/manifest/rule.d.mts +128 -0
  102. package/lib/manifest/rule.d.mts.map +1 -0
  103. package/lib/manifest/rule.d.ts +128 -0
  104. package/lib/manifest/rule.d.ts.map +1 -0
  105. package/lib/manifest/rule.js +105 -0
  106. package/lib/manifest/rule.js.map +1 -0
  107. package/lib/manifest/rule.mjs +101 -0
  108. package/lib/manifest/rule.mjs.map +1 -0
  109. package/lib/manifest/sdui-page.d.mts +89 -0
  110. package/lib/manifest/sdui-page.d.mts.map +1 -0
  111. package/lib/manifest/sdui-page.d.ts +89 -0
  112. package/lib/manifest/sdui-page.d.ts.map +1 -0
  113. package/lib/manifest/sdui-page.js +83 -0
  114. package/lib/manifest/sdui-page.js.map +1 -0
  115. package/lib/manifest/sdui-page.mjs +79 -0
  116. package/lib/manifest/sdui-page.mjs.map +1 -0
  117. package/lib/manifest/validation.d.mts +116 -0
  118. package/lib/manifest/validation.d.mts.map +1 -0
  119. package/lib/manifest/validation.d.ts +116 -0
  120. package/lib/manifest/validation.d.ts.map +1 -0
  121. package/lib/manifest/validation.js +83 -0
  122. package/lib/manifest/validation.js.map +1 -0
  123. package/lib/manifest/validation.mjs +79 -0
  124. package/lib/manifest/validation.mjs.map +1 -0
  125. package/lib/sdui/actions.d.mts +25 -0
  126. package/lib/sdui/actions.d.mts.map +1 -0
  127. package/lib/sdui/actions.d.ts +25 -0
  128. package/lib/sdui/actions.d.ts.map +1 -0
  129. package/lib/sdui/actions.js +53 -0
  130. package/lib/sdui/actions.js.map +1 -0
  131. package/lib/sdui/actions.mjs +42 -0
  132. package/lib/sdui/actions.mjs.map +1 -0
  133. package/lib/sdui/component.d.mts +41 -0
  134. package/lib/sdui/component.d.mts.map +1 -0
  135. package/lib/sdui/component.d.ts +41 -0
  136. package/lib/sdui/component.d.ts.map +1 -0
  137. package/lib/sdui/component.js +95 -0
  138. package/lib/sdui/component.js.map +1 -0
  139. package/lib/sdui/component.mjs +91 -0
  140. package/lib/sdui/component.mjs.map +1 -0
  141. package/lib/sdui/components.d.mts +149 -0
  142. package/lib/sdui/components.d.mts.map +1 -0
  143. package/lib/sdui/components.d.ts +149 -0
  144. package/lib/sdui/components.d.ts.map +1 -0
  145. package/lib/sdui/components.js +303 -0
  146. package/lib/sdui/components.js.map +1 -0
  147. package/lib/sdui/components.mjs +298 -0
  148. package/lib/sdui/components.mjs.map +1 -0
  149. package/lib/sdui/conditions.d.mts +25 -0
  150. package/lib/sdui/conditions.d.mts.map +1 -0
  151. package/lib/sdui/conditions.d.ts +25 -0
  152. package/lib/sdui/conditions.d.ts.map +1 -0
  153. package/lib/sdui/conditions.js +47 -0
  154. package/lib/sdui/conditions.js.map +1 -0
  155. package/lib/sdui/conditions.mjs +35 -0
  156. package/lib/sdui/conditions.mjs.map +1 -0
  157. package/lib/sdui/directives.d.mts +18 -0
  158. package/lib/sdui/directives.d.mts.map +1 -0
  159. package/lib/sdui/directives.d.ts +18 -0
  160. package/lib/sdui/directives.d.ts.map +1 -0
  161. package/lib/sdui/directives.js +28 -0
  162. package/lib/sdui/directives.js.map +1 -0
  163. package/lib/sdui/directives.mjs +21 -0
  164. package/lib/sdui/directives.mjs.map +1 -0
  165. package/lib/sdui/index.d.mts +362 -0
  166. package/lib/sdui/index.d.mts.map +1 -0
  167. package/lib/sdui/index.d.ts +362 -0
  168. package/lib/sdui/index.d.ts.map +1 -0
  169. package/lib/sdui/index.js +375 -0
  170. package/lib/sdui/index.js.map +1 -0
  171. package/lib/sdui/index.mjs +199 -0
  172. package/lib/sdui/index.mjs.map +1 -0
  173. package/lib/sdui/props.d.mts +12 -0
  174. package/lib/sdui/props.d.mts.map +1 -0
  175. package/lib/sdui/props.d.ts +12 -0
  176. package/lib/sdui/props.d.ts.map +1 -0
  177. package/lib/sdui/props.js +25 -0
  178. package/lib/sdui/props.js.map +1 -0
  179. package/lib/sdui/props.mjs +21 -0
  180. package/lib/sdui/props.mjs.map +1 -0
  181. package/lib/sdui/render.d.mts +23 -0
  182. package/lib/sdui/render.d.mts.map +1 -0
  183. package/lib/sdui/render.d.ts +23 -0
  184. package/lib/sdui/render.d.ts.map +1 -0
  185. package/lib/sdui/render.js +40 -0
  186. package/lib/sdui/render.js.map +1 -0
  187. package/lib/sdui/render.mjs +37 -0
  188. package/lib/sdui/render.mjs.map +1 -0
  189. package/lib/sdui/state.d.mts +22 -0
  190. package/lib/sdui/state.d.mts.map +1 -0
  191. package/lib/sdui/state.d.ts +22 -0
  192. package/lib/sdui/state.d.ts.map +1 -0
  193. package/lib/sdui/state.js +57 -0
  194. package/lib/sdui/state.js.map +1 -0
  195. package/lib/sdui/state.mjs +53 -0
  196. package/lib/sdui/state.mjs.map +1 -0
  197. package/package.json +11 -1
  198. package/resources/draft-hires.d.mts +26 -0
  199. package/resources/draft-hires.d.mts.map +1 -1
  200. package/resources/draft-hires.d.ts +26 -0
  201. package/resources/draft-hires.d.ts.map +1 -1
  202. package/resources/earnings-inputs.d.mts +99 -1
  203. package/resources/earnings-inputs.d.mts.map +1 -1
  204. package/resources/earnings-inputs.d.ts +99 -1
  205. package/resources/earnings-inputs.d.ts.map +1 -1
  206. package/resources/earnings-inputs.js +6 -0
  207. package/resources/earnings-inputs.js.map +1 -1
  208. package/resources/earnings-inputs.mjs +6 -0
  209. package/resources/earnings-inputs.mjs.map +1 -1
  210. package/resources/files.d.mts +164 -0
  211. package/resources/files.d.mts.map +1 -0
  212. package/resources/files.d.ts +164 -0
  213. package/resources/files.d.ts.map +1 -0
  214. package/resources/files.js +25 -0
  215. package/resources/files.js.map +1 -0
  216. package/resources/files.mjs +21 -0
  217. package/resources/files.mjs.map +1 -0
  218. package/resources/headcount-positions.d.mts +2 -2
  219. package/resources/headcount-positions.d.mts.map +1 -1
  220. package/resources/headcount-positions.d.ts +2 -2
  221. package/resources/headcount-positions.d.ts.map +1 -1
  222. package/resources/index.d.mts +2 -1
  223. package/resources/index.d.mts.map +1 -1
  224. package/resources/index.d.ts +2 -1
  225. package/resources/index.d.ts.map +1 -1
  226. package/resources/index.js +4 -2
  227. package/resources/index.js.map +1 -1
  228. package/resources/index.mjs +1 -0
  229. package/resources/index.mjs.map +1 -1
  230. package/resources/legal-entities.d.mts +1 -1
  231. package/resources/legal-entities.d.mts.map +1 -1
  232. package/resources/legal-entities.d.ts +1 -1
  233. package/resources/legal-entities.d.ts.map +1 -1
  234. package/resources/location-factors.d.mts +2 -2
  235. package/resources/location-factors.d.mts.map +1 -1
  236. package/resources/location-factors.d.ts +2 -2
  237. package/resources/location-factors.d.ts.map +1 -1
  238. package/resources/shared.d.mts +1 -1
  239. package/resources/shared.d.mts.map +1 -1
  240. package/resources/shared.d.ts +1 -1
  241. package/resources/shared.d.ts.map +1 -1
  242. package/resources/workers.d.mts +2 -2
  243. package/resources/workers.d.mts.map +1 -1
  244. package/resources/workers.d.ts +2 -2
  245. package/resources/workers.d.ts.map +1 -1
  246. package/src/client.ts +29 -0
  247. package/src/internal/types.ts +6 -8
  248. package/src/lib/manifest/_helpers.ts +164 -0
  249. package/src/lib/manifest/app.ts +163 -0
  250. package/src/lib/manifest/category.ts +100 -0
  251. package/src/lib/manifest/custom-object-field-section.ts +93 -0
  252. package/src/lib/manifest/custom-object-page-layout.ts +427 -0
  253. package/src/lib/manifest/custom-object.ts +360 -0
  254. package/src/lib/manifest/field.ts +822 -0
  255. package/src/lib/manifest/index.ts +114 -0
  256. package/src/lib/manifest/list-view.ts +183 -0
  257. package/src/lib/manifest/manifest-builder.ts +140 -0
  258. package/src/lib/manifest/manifest-function.ts +151 -0
  259. package/src/lib/manifest/rule.ts +191 -0
  260. package/src/lib/manifest/sdui-page.ts +118 -0
  261. package/src/lib/manifest/validation.ts +150 -0
  262. package/src/lib/sdui/actions.ts +58 -0
  263. package/src/lib/sdui/component.ts +122 -0
  264. package/src/lib/sdui/components.ts +308 -0
  265. package/src/lib/sdui/conditions.ts +59 -0
  266. package/src/lib/sdui/directives.ts +42 -0
  267. package/src/lib/sdui/index.ts +365 -0
  268. package/src/lib/sdui/props.ts +32 -0
  269. package/src/lib/sdui/render.ts +58 -0
  270. package/src/lib/sdui/state.ts +60 -0
  271. package/src/resources/draft-hires.ts +31 -0
  272. package/src/resources/earnings-inputs.ts +127 -0
  273. package/src/resources/files.ts +203 -0
  274. package/src/resources/headcount-positions.ts +2 -0
  275. package/src/resources/index.ts +3 -0
  276. package/src/resources/legal-entities.ts +1 -0
  277. package/src/resources/location-factors.ts +2 -0
  278. package/src/resources/shared.ts +1 -0
  279. package/src/resources/workers.ts +2 -0
  280. package/src/version.ts +1 -1
  281. package/version.d.mts +1 -1
  282. package/version.d.ts +1 -1
  283. package/version.js +1 -1
  284. package/version.mjs +1 -1
@@ -0,0 +1,114 @@
1
+ /** Manifest builder public API (hand-written, not Stainless-generated). */
2
+
3
+ export {
4
+ generateId,
5
+ type EdgeType,
6
+ type FieldType,
7
+ type FormulaFieldType,
8
+ type FunctionRuntime,
9
+ type ObjectScope,
10
+ type PageType,
11
+ type SortOrder,
12
+ type SummaryAggregation,
13
+ type SummaryFilterOperator,
14
+ type TriggerType,
15
+ type UpdateTriggerType,
16
+ type ValidationLevel,
17
+ type ValidationState,
18
+ } from './_helpers';
19
+
20
+ export { App, type AppIcon, type AppPage, type AppProps } from './app';
21
+
22
+ export { Category, type CategoryProps } from './category';
23
+
24
+ export { CustomObject, type CustomObjectProps, type IconConfig } from './custom-object';
25
+
26
+ export { CustomObjectFieldSection, type CustomObjectFieldSectionProps } from './custom-object-field-section';
27
+
28
+ export {
29
+ CustomObjectPageLayout,
30
+ type CustomObjectPageLayoutProps,
31
+ type CustomTab,
32
+ type FieldsSection,
33
+ type HeaderEdits,
34
+ type NewHeaderField,
35
+ type PageLayoutSection,
36
+ type PageLayoutTab,
37
+ type SectionField,
38
+ type SectionFieldsLayout,
39
+ type SystemHeaderFieldEdit,
40
+ type SystemSectionEdit,
41
+ type SystemTabEdit,
42
+ type TabEdits,
43
+ type TabWithSections,
44
+ type VisibilityCondition,
45
+ type VisibilityConditions,
46
+ } from './custom-object-page-layout';
47
+
48
+ export {
49
+ Field,
50
+ type FieldProps,
51
+ type SummaryFilter,
52
+
53
+ // Concrete field variants (one class per wire-level field type, mirroring
54
+ // AWS CDK's per-action-class pattern in `aws-codepipeline-actions`).
55
+ TextField,
56
+ type TextFieldProps,
57
+ LongTextField,
58
+ type LongTextFieldProps,
59
+ EmailField,
60
+ type EmailFieldProps,
61
+ UrlField,
62
+ type UrlFieldProps,
63
+ PhoneField,
64
+ type PhoneFieldProps,
65
+ NumberField,
66
+ type NumberFieldProps,
67
+ CurrencyField,
68
+ type CurrencyFieldProps,
69
+ PercentageField,
70
+ type PercentageFieldProps,
71
+ DateField,
72
+ type DateFieldProps,
73
+ DatetimeField,
74
+ type DatetimeFieldProps,
75
+ TimeField,
76
+ type TimeFieldProps,
77
+ SelectField,
78
+ type SelectFieldProps,
79
+ RadioField,
80
+ type RadioFieldProps,
81
+ BooleanField,
82
+ type BooleanFieldProps,
83
+ FileField,
84
+ type FileFieldProps,
85
+ LookupField,
86
+ type LookupFieldProps,
87
+ ParentChildField,
88
+ type ParentChildFieldProps,
89
+ FormulaField,
90
+ type FormulaFieldProps,
91
+ SummaryField,
92
+ type SummaryFieldProps,
93
+ } from './field';
94
+
95
+ export { ListViewDef, type ListViewDefProps } from './list-view';
96
+
97
+ export {
98
+ ManifestBuilder,
99
+ type ManifestBuilderProps,
100
+ type ManifestComponent,
101
+ type ManifestScope,
102
+ } from './manifest-builder';
103
+
104
+ export {
105
+ ManifestFunction,
106
+ ManifestFunction as Function,
107
+ type ManifestFunctionProps,
108
+ } from './manifest-function';
109
+
110
+ export { Rule, type RuleAction, type RuleProps } from './rule';
111
+
112
+ export { SduiPage, type SduiPageProps } from './sdui-page';
113
+
114
+ export { Validation, type ValidationProps } from './validation';
@@ -0,0 +1,183 @@
1
+ import { generateId, type ObjectScope, type SortOrder } from './_helpers';
2
+ import type { CustomObject } from './custom-object';
3
+ import type { Field } from './field';
4
+
5
+ /**
6
+ * Initialization properties for {@link ListViewDef}.
7
+ */
8
+ export interface ListViewDefProps {
9
+ /**
10
+ * Display name of this list view shown in the UI (e.g. `'All members'`).
11
+ *
12
+ * Required.
13
+ */
14
+ name: string;
15
+ /**
16
+ * Columns to display, as live {@link Field} references. At least one field is required.
17
+ *
18
+ * Required.
19
+ */
20
+ fields: Field[];
21
+ /**
22
+ * Whether this view is visible to all users (`true`) or only the record owner (`false`).
23
+ *
24
+ * Required.
25
+ */
26
+ isPublic: boolean;
27
+ /**
28
+ * Stable identifier for this view. Pass a human-readable slug
29
+ * (e.g. `'view_gym_all_members'`) to keep it stable across regenerations.
30
+ *
31
+ * Optional. Auto-generated when omitted. @default generateId('view')
32
+ */
33
+ viewId?: string;
34
+ /**
35
+ * Field to sort by. Required when `sortOrder` is set.
36
+ *
37
+ * Optional.
38
+ */
39
+ orderBy?: Field;
40
+ /**
41
+ * Sort direction. One of `'ASC'` | `'DESC'`. Requires `orderBy` to be set.
42
+ *
43
+ * Optional.
44
+ */
45
+ sortOrder?: SortOrder;
46
+ /**
47
+ * Record scope for this view. One of `'all'` | `'my_records'`.
48
+ *
49
+ * Optional. @default `'all'`
50
+ */
51
+ objectScope?: ObjectScope;
52
+ /**
53
+ * Human-readable description of this view.
54
+ *
55
+ * Optional. @default null
56
+ */
57
+ description?: string;
58
+ /**
59
+ * Per-column configuration overrides (width, visibility, etc.).
60
+ *
61
+ * Optional. @default `{}`
62
+ */
63
+ columnConfig?: Record<string, any>;
64
+ /**
65
+ * RQL filter expression to pre-filter records shown in this view
66
+ * (e.g. `'(session_date__c == TODAY())'`).
67
+ *
68
+ * Optional. @default null
69
+ */
70
+ rqlFilter?: string;
71
+ }
72
+
73
+ /**
74
+ * Defines a list view and registers it with the manifest.
75
+ *
76
+ * A list view defines which fields appear as columns, their sort order, and an
77
+ * optional RQL filter. You can define multiple views per custom object; each
78
+ * appears as a selectable view in the object's list page.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * new ListViewDef(memberObj, {
83
+ * viewId: 'view_gym_all_members',
84
+ * name: 'All members',
85
+ * description: 'Directory with membership status',
86
+ * fields: [memberDisplayName, memberEmail, memberPhone, memberStatusField, memberJoinDate],
87
+ * orderBy: memberLastName,
88
+ * sortOrder: 'ASC',
89
+ * isPublic: true,
90
+ * objectScope: 'all',
91
+ * });
92
+ *
93
+ * // Filtered view example:
94
+ * new ListViewDef(sessionObj, {
95
+ * viewId: 'view_gym_today_sessions',
96
+ * name: 'Today\'s class sessions',
97
+ * fields: [sessionTrainerRef, sessionStartField, sessionClassTypeField],
98
+ * orderBy: sessionStartField,
99
+ * sortOrder: 'ASC',
100
+ * isPublic: true,
101
+ * objectScope: 'all',
102
+ * rqlFilter: '(session_date__c == TODAY())',
103
+ * });
104
+ * ```
105
+ */
106
+ export class ListViewDef {
107
+ private readonly _viewId: string;
108
+ private readonly _customObjectApiName: string;
109
+ private readonly _name: string;
110
+ private readonly _fields: Field[];
111
+ private readonly _isPublic: boolean;
112
+ private readonly _orderBy: Field | undefined;
113
+ private readonly _sortOrder: SortOrder | undefined;
114
+ private readonly _objectScope: ObjectScope | undefined;
115
+ private readonly _description: string | undefined;
116
+ private readonly _columnConfig: Record<string, any> | undefined;
117
+ private readonly _rqlFilter: string | undefined;
118
+
119
+ /**
120
+ * @param customObject - The custom object this view belongs to.
121
+ * @param props - Initialization properties.
122
+ * @throws {Error} If `name` is empty, `fields` is empty, or `sortOrder` is set without `orderBy`.
123
+ */
124
+ constructor(customObject: CustomObject, props: ListViewDefProps) {
125
+ if (!props.name) throw new Error('ListViewDef: name cannot be empty');
126
+ if (!props.fields || props.fields.length === 0) {
127
+ throw new Error('ListViewDef: must have at least one field');
128
+ }
129
+ if (props.sortOrder && !props.orderBy) {
130
+ throw new Error('ListViewDef: sortOrder requires orderBy to be set');
131
+ }
132
+ this._viewId = props.viewId ?? generateId('view');
133
+ this._customObjectApiName = customObject.getApiName();
134
+ this._name = props.name;
135
+ this._fields = [...props.fields];
136
+ this._isPublic = props.isPublic;
137
+ this._orderBy = props.orderBy;
138
+ this._sortOrder = props.sortOrder;
139
+ this._objectScope = props.objectScope ?? 'all';
140
+ this._description = props.description;
141
+ this._columnConfig = props.columnConfig;
142
+ this._rqlFilter = props.rqlFilter;
143
+ customObject._register(this);
144
+ }
145
+
146
+ /**
147
+ * Returns the stable identifier for this view (e.g. `'view_gym_all_members'`).
148
+ */
149
+ getViewId(): string {
150
+ return this._viewId;
151
+ }
152
+
153
+ /**
154
+ * Returns the api_name of the custom object this view belongs to.
155
+ */
156
+ getCustomObjectApiName(): string {
157
+ return this._customObjectApiName;
158
+ }
159
+
160
+ /**
161
+ * Serializes this list view to the wire format consumed by the manifest install endpoint.
162
+ *
163
+ * @returns A plain object with `type: 'CUSTOM_OBJECT_LIST_VIEW'`.
164
+ * Optional fields are omitted when unset.
165
+ */
166
+ toDict(): Record<string, any> {
167
+ const d: Record<string, any> = {
168
+ type: 'CUSTOM_OBJECT_LIST_VIEW',
169
+ object_rql_name: this._customObjectApiName,
170
+ view_id: this._viewId,
171
+ name: this._name,
172
+ public: this._isPublic,
173
+ fields: this._fields.map((f) => f.getApiName()),
174
+ };
175
+ if (this._description != null) d['description'] = this._description;
176
+ if (this._objectScope != null) d['object_scope'] = this._objectScope;
177
+ if (this._sortOrder != null) d['sort_order'] = this._sortOrder;
178
+ if (this._orderBy != null) d['order_by'] = this._orderBy.getApiName();
179
+ if (this._columnConfig != null) d['column_config'] = this._columnConfig;
180
+ if (this._rqlFilter != null) d['rql_filter'] = this._rqlFilter;
181
+ return d;
182
+ }
183
+ }
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Any object that can be included in a manifest.
3
+ *
4
+ * Implement `toDict()` to return the component's wire-format dict.
5
+ * All built-in SDK classes implement this interface automatically.
6
+ */
7
+ export interface ManifestComponent {
8
+ toDict(): Record<string, any>;
9
+ }
10
+
11
+ /**
12
+ * A scope — anything that can accept child component registrations.
13
+ *
14
+ * Implemented by {@link ManifestBuilder} (the root) and by nestable parents
15
+ * like `CustomObject` that forward registrations up to the builder.
16
+ * Pass a scope as the first argument when constructing any manifest component.
17
+ */
18
+ export interface ManifestScope {
19
+ /** @internal Register a child component; builder-bound scopes forward up. */
20
+ _register(component: ManifestComponent): void;
21
+ }
22
+
23
+ /**
24
+ * Initialization properties for {@link ManifestBuilder}.
25
+ */
26
+ export interface ManifestBuilderProps {
27
+ /**
28
+ * Unique project key for this manifest (e.g. `'gym_membership_management'`).
29
+ *
30
+ * Required.
31
+ */
32
+ key: string;
33
+ /**
34
+ * Display name for this manifest.
35
+ *
36
+ * Optional. Defaults to `key` when not provided.
37
+ */
38
+ name?: string;
39
+ /**
40
+ * Human-readable description of what this manifest contains.
41
+ *
42
+ * Optional.
43
+ */
44
+ description?: string;
45
+ }
46
+
47
+ /**
48
+ * Root container for a manifest — collects all components and serializes them to JSON.
49
+ *
50
+ * You would normally create one `ManifestBuilder` at the top of your manifest file,
51
+ * then pass it as the scope to all top-level components (categories, custom objects,
52
+ * functions, apps, SDUI pages). Each component auto-registers on construction; there
53
+ * is no separate add or register call.
54
+ *
55
+ * After defining all components, call `preview()` to emit the manifest as a
56
+ * pretty-printed JSON string, or `buildManifest()` to get the plain object.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const manifest = new ManifestBuilder({
61
+ * key: 'gym_membership_management',
62
+ * name: 'Gym Membership Management',
63
+ * description: 'Members, trainers, schedules, and check-in',
64
+ * });
65
+ *
66
+ * const category = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
67
+ * const memberObj = new CustomObject(manifest, { apiName: 'gym_member__c', name: 'Member', category });
68
+ * // ... define fields, rules, list views, etc. ...
69
+ *
70
+ * console.log(manifest.preview());
71
+ * ```
72
+ */
73
+ export class ManifestBuilder implements ManifestScope {
74
+ readonly key: string;
75
+ readonly name: string;
76
+ readonly description: string;
77
+ private readonly _components: ManifestComponent[] = [];
78
+
79
+ /**
80
+ * @param props - Initialization properties.
81
+ * @throws {Error} If `props.key` is empty or missing.
82
+ */
83
+ constructor(props: ManifestBuilderProps) {
84
+ if (!props.key) {
85
+ throw new Error('key is required');
86
+ }
87
+ this.key = props.key;
88
+ this.name = props.name || props.key;
89
+ this.description = props.description ?? '';
90
+ }
91
+
92
+ /**
93
+ * @internal Scope hook invoked by child constructors. Components enter the
94
+ * manifest here — there is no other path.
95
+ */
96
+ _register(component: ManifestComponent): void {
97
+ if (typeof component.toDict !== 'function') {
98
+ throw new TypeError('Component must have a toDict() method');
99
+ }
100
+ this._components.push(component);
101
+ }
102
+
103
+ /**
104
+ * Returns the manifest as a plain object with `metadata` and a flat `components` array.
105
+ *
106
+ * @returns `{ metadata: { key, name, description? }, components: Record<string, any>[] }`
107
+ */
108
+ buildManifest(): { metadata: Record<string, any>; components: Record<string, any>[] } {
109
+ const metadata: Record<string, any> = {
110
+ key: this.key,
111
+ name: this.name,
112
+ };
113
+ if (this.description) {
114
+ metadata['description'] = this.description;
115
+ }
116
+ const components = this._components.map((c) => c.toDict());
117
+ return { metadata, components };
118
+ }
119
+
120
+ /**
121
+ * Returns the flat list of all registered component dicts.
122
+ *
123
+ * @returns An array of wire-format component objects, in registration order.
124
+ */
125
+ componentsList(): Record<string, any>[] {
126
+ return this._components.map((c) => c.toDict());
127
+ }
128
+
129
+ /**
130
+ * Returns the full manifest as a pretty-printed JSON string.
131
+ *
132
+ * Typically used as the final line of a manifest file to emit the output:
133
+ * `console.log(manifest.preview())`.
134
+ *
135
+ * @returns Indented JSON string of the complete manifest.
136
+ */
137
+ preview(): string {
138
+ return JSON.stringify(this.buildManifest(), null, 2);
139
+ }
140
+ }
@@ -0,0 +1,151 @@
1
+ import type { FunctionRuntime } from './_helpers';
2
+ import type { ManifestScope } from './manifest-builder';
3
+
4
+ /**
5
+ * Initialization properties for {@link ManifestFunction}.
6
+ */
7
+ export interface ManifestFunctionProps {
8
+ /**
9
+ * Unique identifier for this function (e.g. `'gym_today_schedule_fn'`).
10
+ *
11
+ * Required.
12
+ */
13
+ apiName: string;
14
+ /**
15
+ * Display name shown in the Rippling UI.
16
+ *
17
+ * Required.
18
+ */
19
+ name: string;
20
+ /**
21
+ * TypeScript handler source code. Must export an `onRipplingEvent` function.
22
+ *
23
+ * Optional. @default `''`
24
+ */
25
+ code?: string;
26
+ /**
27
+ * Human-readable description of what this function does.
28
+ *
29
+ * Optional. @default `''`
30
+ */
31
+ description?: string;
32
+ /**
33
+ * NPM package dependencies as a `{ packageName: versionRange }` map
34
+ * (e.g. `{ '@rippling/rippling-sdk': '^0.2.0' }`).
35
+ *
36
+ * Optional. @default null
37
+ */
38
+ dependencies?: Record<string, string>;
39
+ /**
40
+ * Raw deployment options object. Prefer `runtime` for the common case.
41
+ *
42
+ * Optional. @default null
43
+ */
44
+ deploymentOptions?: Record<string, any>;
45
+ /**
46
+ * Deployment runtime shorthand. Sets `deploymentOptions.runtime` and is merged
47
+ * with any explicit `deploymentOptions`. One of `'cloudflare-js'` | `'lambda-deno'`
48
+ * | `'lambda-python'`.
49
+ *
50
+ * Optional.
51
+ */
52
+ runtime?: FunctionRuntime;
53
+ /**
54
+ * Outbound domain allowlist. Requests to domains not in this list will be blocked.
55
+ *
56
+ * Optional. @default null
57
+ */
58
+ allowedDomains?: string[];
59
+ /**
60
+ * Whether this function runs asynchronously (fire-and-forget).
61
+ *
62
+ * Optional. @default `false`
63
+ */
64
+ isAsync?: boolean;
65
+ }
66
+
67
+ /**
68
+ * Defines a serverless function and registers it with the manifest.
69
+ *
70
+ * A `ManifestFunction` packages TypeScript handler code that runs on Rippling's
71
+ * serverless infrastructure. Functions are the backing implementation for
72
+ * {@link SduiPage} surfaces. The handler must export `onRipplingEvent`.
73
+ *
74
+ * This class is named `ManifestFunction` to avoid collision with the JavaScript
75
+ * built-in `Function`. It is also re-exported as `Function` from the barrel for
76
+ * convenience.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const todayScheduleFn = new ManifestFunction(manifest, {
81
+ * apiName: 'gym_today_schedule_fn',
82
+ * name: 'Today\'s schedule (SDUI)',
83
+ * description: 'Searchable grid of class sessions',
84
+ * runtime: 'lambda-deno',
85
+ * code: handlerSource,
86
+ * dependencies: {
87
+ * '@rippling/rippling-sdk': '^0.2.0-alpha.33',
88
+ * '@rippling/sdui-builder': '^0.1.0',
89
+ * },
90
+ * isAsync: false,
91
+ * });
92
+ * ```
93
+ *
94
+ * @see {@link SduiPage} — wraps a `ManifestFunction` as a navigable UI surface.
95
+ */
96
+ export class ManifestFunction {
97
+ private readonly _apiName: string;
98
+ private readonly _name: string;
99
+ private readonly _code: string;
100
+ private readonly _description: string;
101
+ private readonly _dependencies: Record<string, string> | undefined;
102
+ private readonly _deploymentOptions: Record<string, any> | undefined;
103
+ private readonly _allowedDomains: string[] | undefined;
104
+ private readonly _isAsync: boolean;
105
+
106
+ /**
107
+ * @param scope - The manifest to register this function with.
108
+ * @param props - Initialization properties.
109
+ */
110
+ constructor(scope: ManifestScope, props: ManifestFunctionProps) {
111
+ this._apiName = props.apiName;
112
+ this._name = props.name;
113
+ this._code = props.code ?? '';
114
+ this._description = props.description ?? '';
115
+ this._dependencies = props.dependencies;
116
+ this._deploymentOptions = props.deploymentOptions;
117
+ if (props.runtime) {
118
+ this._deploymentOptions = { ...(this._deploymentOptions ?? {}), runtime: props.runtime };
119
+ }
120
+ this._allowedDomains = props.allowedDomains;
121
+ this._isAsync = props.isAsync ?? false;
122
+ scope._register(this);
123
+ }
124
+
125
+ /**
126
+ * Returns the api_name of this function (e.g. `'gym_today_schedule_fn'`).
127
+ */
128
+ getApiName(): string {
129
+ return this._apiName;
130
+ }
131
+
132
+ /**
133
+ * Serializes this function to the wire format consumed by the manifest install endpoint.
134
+ *
135
+ * @returns A plain object with `type: 'FUNCTION'`. Empty or unset optional fields are omitted.
136
+ */
137
+ toDict(): Record<string, any> {
138
+ const component: Record<string, any> = {
139
+ type: 'FUNCTION',
140
+ name: this._name,
141
+ api_name: this._apiName,
142
+ };
143
+ if (this._description) component['description'] = this._description;
144
+ if (this._code) component['code_draft'] = this._code;
145
+ if (this._dependencies != null) component['dependencies'] = this._dependencies;
146
+ if (this._deploymentOptions != null) component['deployment_options'] = this._deploymentOptions;
147
+ if (this._allowedDomains != null) component['allowed_domains'] = this._allowedDomains;
148
+ if (this._isAsync) component['is_async'] = true;
149
+ return component;
150
+ }
151
+ }