@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.
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +17 -0
- package/client.js.map +1 -1
- package/client.mjs +17 -0
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/lib/manifest/_helpers.d.mts +91 -0
- package/lib/manifest/_helpers.d.mts.map +1 -0
- package/lib/manifest/_helpers.d.ts +91 -0
- package/lib/manifest/_helpers.d.ts.map +1 -0
- package/lib/manifest/_helpers.js +65 -0
- package/lib/manifest/_helpers.js.map +1 -0
- package/lib/manifest/_helpers.mjs +61 -0
- package/lib/manifest/_helpers.mjs.map +1 -0
- package/lib/manifest/app.d.mts +113 -0
- package/lib/manifest/app.d.mts.map +1 -0
- package/lib/manifest/app.d.ts +113 -0
- package/lib/manifest/app.d.ts.map +1 -0
- package/lib/manifest/app.js +95 -0
- package/lib/manifest/app.js.map +1 -0
- package/lib/manifest/app.mjs +91 -0
- package/lib/manifest/app.mjs.map +1 -0
- package/lib/manifest/category.d.mts +79 -0
- package/lib/manifest/category.d.mts.map +1 -0
- package/lib/manifest/category.d.ts +79 -0
- package/lib/manifest/category.d.ts.map +1 -0
- package/lib/manifest/category.js +72 -0
- package/lib/manifest/category.js.map +1 -0
- package/lib/manifest/category.mjs +68 -0
- package/lib/manifest/category.mjs.map +1 -0
- package/lib/manifest/custom-object-field-section.d.mts +71 -0
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -0
- package/lib/manifest/custom-object-field-section.d.ts +71 -0
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -0
- package/lib/manifest/custom-object-field-section.js +69 -0
- package/lib/manifest/custom-object-field-section.js.map +1 -0
- package/lib/manifest/custom-object-field-section.mjs +65 -0
- package/lib/manifest/custom-object-field-section.mjs.map +1 -0
- package/lib/manifest/custom-object-page-layout.d.mts +318 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -0
- package/lib/manifest/custom-object-page-layout.d.ts +318 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -0
- package/lib/manifest/custom-object-page-layout.js +158 -0
- package/lib/manifest/custom-object-page-layout.js.map +1 -0
- package/lib/manifest/custom-object-page-layout.mjs +154 -0
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -0
- package/lib/manifest/custom-object.d.mts +165 -0
- package/lib/manifest/custom-object.d.mts.map +1 -0
- package/lib/manifest/custom-object.d.ts +165 -0
- package/lib/manifest/custom-object.d.ts.map +1 -0
- package/lib/manifest/custom-object.js +254 -0
- package/lib/manifest/custom-object.js.map +1 -0
- package/lib/manifest/custom-object.mjs +250 -0
- package/lib/manifest/custom-object.mjs.map +1 -0
- package/lib/manifest/field.d.mts +487 -0
- package/lib/manifest/field.d.mts.map +1 -0
- package/lib/manifest/field.d.ts +487 -0
- package/lib/manifest/field.d.ts.map +1 -0
- package/lib/manifest/field.js +461 -0
- package/lib/manifest/field.js.map +1 -0
- package/lib/manifest/field.mjs +438 -0
- package/lib/manifest/field.mjs.map +1 -0
- package/lib/manifest/index.d.mts +15 -0
- package/lib/manifest/index.d.mts.map +1 -0
- package/lib/manifest/index.d.ts +15 -0
- package/lib/manifest/index.d.ts.map +1 -0
- package/lib/manifest/index.js +53 -0
- package/lib/manifest/index.js.map +1 -0
- package/lib/manifest/index.mjs +18 -0
- package/lib/manifest/index.mjs.map +1 -0
- package/lib/manifest/list-view.d.mts +138 -0
- package/lib/manifest/list-view.d.mts.map +1 -0
- package/lib/manifest/list-view.d.ts +138 -0
- package/lib/manifest/list-view.d.ts.map +1 -0
- package/lib/manifest/list-view.js +109 -0
- package/lib/manifest/list-view.js.map +1 -0
- package/lib/manifest/list-view.mjs +105 -0
- package/lib/manifest/list-view.mjs.map +1 -0
- package/lib/manifest/manifest-builder.d.mts +110 -0
- package/lib/manifest/manifest-builder.d.mts.map +1 -0
- package/lib/manifest/manifest-builder.d.ts +110 -0
- package/lib/manifest/manifest-builder.d.ts.map +1 -0
- package/lib/manifest/manifest-builder.js +91 -0
- package/lib/manifest/manifest-builder.js.map +1 -0
- package/lib/manifest/manifest-builder.mjs +87 -0
- package/lib/manifest/manifest-builder.mjs.map +1 -0
- package/lib/manifest/manifest-function.d.mts +119 -0
- package/lib/manifest/manifest-function.d.mts.map +1 -0
- package/lib/manifest/manifest-function.d.ts +119 -0
- package/lib/manifest/manifest-function.d.ts.map +1 -0
- package/lib/manifest/manifest-function.js +85 -0
- package/lib/manifest/manifest-function.js.map +1 -0
- package/lib/manifest/manifest-function.mjs +81 -0
- package/lib/manifest/manifest-function.mjs.map +1 -0
- package/lib/manifest/rule.d.mts +128 -0
- package/lib/manifest/rule.d.mts.map +1 -0
- package/lib/manifest/rule.d.ts +128 -0
- package/lib/manifest/rule.d.ts.map +1 -0
- package/lib/manifest/rule.js +105 -0
- package/lib/manifest/rule.js.map +1 -0
- package/lib/manifest/rule.mjs +101 -0
- package/lib/manifest/rule.mjs.map +1 -0
- package/lib/manifest/sdui-page.d.mts +89 -0
- package/lib/manifest/sdui-page.d.mts.map +1 -0
- package/lib/manifest/sdui-page.d.ts +89 -0
- package/lib/manifest/sdui-page.d.ts.map +1 -0
- package/lib/manifest/sdui-page.js +83 -0
- package/lib/manifest/sdui-page.js.map +1 -0
- package/lib/manifest/sdui-page.mjs +79 -0
- package/lib/manifest/sdui-page.mjs.map +1 -0
- package/lib/manifest/validation.d.mts +116 -0
- package/lib/manifest/validation.d.mts.map +1 -0
- package/lib/manifest/validation.d.ts +116 -0
- package/lib/manifest/validation.d.ts.map +1 -0
- package/lib/manifest/validation.js +83 -0
- package/lib/manifest/validation.js.map +1 -0
- package/lib/manifest/validation.mjs +79 -0
- package/lib/manifest/validation.mjs.map +1 -0
- package/lib/sdui/actions.d.mts +25 -0
- package/lib/sdui/actions.d.mts.map +1 -0
- package/lib/sdui/actions.d.ts +25 -0
- package/lib/sdui/actions.d.ts.map +1 -0
- package/lib/sdui/actions.js +53 -0
- package/lib/sdui/actions.js.map +1 -0
- package/lib/sdui/actions.mjs +42 -0
- package/lib/sdui/actions.mjs.map +1 -0
- package/lib/sdui/component.d.mts +41 -0
- package/lib/sdui/component.d.mts.map +1 -0
- package/lib/sdui/component.d.ts +41 -0
- package/lib/sdui/component.d.ts.map +1 -0
- package/lib/sdui/component.js +95 -0
- package/lib/sdui/component.js.map +1 -0
- package/lib/sdui/component.mjs +91 -0
- package/lib/sdui/component.mjs.map +1 -0
- package/lib/sdui/components.d.mts +149 -0
- package/lib/sdui/components.d.mts.map +1 -0
- package/lib/sdui/components.d.ts +149 -0
- package/lib/sdui/components.d.ts.map +1 -0
- package/lib/sdui/components.js +303 -0
- package/lib/sdui/components.js.map +1 -0
- package/lib/sdui/components.mjs +298 -0
- package/lib/sdui/components.mjs.map +1 -0
- package/lib/sdui/conditions.d.mts +25 -0
- package/lib/sdui/conditions.d.mts.map +1 -0
- package/lib/sdui/conditions.d.ts +25 -0
- package/lib/sdui/conditions.d.ts.map +1 -0
- package/lib/sdui/conditions.js +47 -0
- package/lib/sdui/conditions.js.map +1 -0
- package/lib/sdui/conditions.mjs +35 -0
- package/lib/sdui/conditions.mjs.map +1 -0
- package/lib/sdui/directives.d.mts +18 -0
- package/lib/sdui/directives.d.mts.map +1 -0
- package/lib/sdui/directives.d.ts +18 -0
- package/lib/sdui/directives.d.ts.map +1 -0
- package/lib/sdui/directives.js +28 -0
- package/lib/sdui/directives.js.map +1 -0
- package/lib/sdui/directives.mjs +21 -0
- package/lib/sdui/directives.mjs.map +1 -0
- package/lib/sdui/index.d.mts +362 -0
- package/lib/sdui/index.d.mts.map +1 -0
- package/lib/sdui/index.d.ts +362 -0
- package/lib/sdui/index.d.ts.map +1 -0
- package/lib/sdui/index.js +375 -0
- package/lib/sdui/index.js.map +1 -0
- package/lib/sdui/index.mjs +199 -0
- package/lib/sdui/index.mjs.map +1 -0
- package/lib/sdui/props.d.mts +12 -0
- package/lib/sdui/props.d.mts.map +1 -0
- package/lib/sdui/props.d.ts +12 -0
- package/lib/sdui/props.d.ts.map +1 -0
- package/lib/sdui/props.js +25 -0
- package/lib/sdui/props.js.map +1 -0
- package/lib/sdui/props.mjs +21 -0
- package/lib/sdui/props.mjs.map +1 -0
- package/lib/sdui/render.d.mts +23 -0
- package/lib/sdui/render.d.mts.map +1 -0
- package/lib/sdui/render.d.ts +23 -0
- package/lib/sdui/render.d.ts.map +1 -0
- package/lib/sdui/render.js +40 -0
- package/lib/sdui/render.js.map +1 -0
- package/lib/sdui/render.mjs +37 -0
- package/lib/sdui/render.mjs.map +1 -0
- package/lib/sdui/state.d.mts +22 -0
- package/lib/sdui/state.d.mts.map +1 -0
- package/lib/sdui/state.d.ts +22 -0
- package/lib/sdui/state.d.ts.map +1 -0
- package/lib/sdui/state.js +57 -0
- package/lib/sdui/state.js.map +1 -0
- package/lib/sdui/state.mjs +53 -0
- package/lib/sdui/state.mjs.map +1 -0
- package/package.json +11 -1
- package/resources/draft-hires.d.mts +26 -0
- package/resources/draft-hires.d.mts.map +1 -1
- package/resources/draft-hires.d.ts +26 -0
- package/resources/draft-hires.d.ts.map +1 -1
- package/resources/earnings-inputs.d.mts +99 -1
- package/resources/earnings-inputs.d.mts.map +1 -1
- package/resources/earnings-inputs.d.ts +99 -1
- package/resources/earnings-inputs.d.ts.map +1 -1
- package/resources/earnings-inputs.js +6 -0
- package/resources/earnings-inputs.js.map +1 -1
- package/resources/earnings-inputs.mjs +6 -0
- package/resources/earnings-inputs.mjs.map +1 -1
- package/resources/files.d.mts +164 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +164 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +25 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +21 -0
- package/resources/files.mjs.map +1 -0
- package/resources/headcount-positions.d.mts +2 -2
- package/resources/headcount-positions.d.mts.map +1 -1
- package/resources/headcount-positions.d.ts +2 -2
- package/resources/headcount-positions.d.ts.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/legal-entities.d.mts +1 -1
- package/resources/legal-entities.d.mts.map +1 -1
- package/resources/legal-entities.d.ts +1 -1
- package/resources/legal-entities.d.ts.map +1 -1
- package/resources/location-factors.d.mts +2 -2
- package/resources/location-factors.d.mts.map +1 -1
- package/resources/location-factors.d.ts +2 -2
- package/resources/location-factors.d.ts.map +1 -1
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/workers.d.mts +2 -2
- package/resources/workers.d.mts.map +1 -1
- package/resources/workers.d.ts +2 -2
- package/resources/workers.d.ts.map +1 -1
- package/src/client.ts +29 -0
- package/src/internal/types.ts +6 -8
- package/src/lib/manifest/_helpers.ts +164 -0
- package/src/lib/manifest/app.ts +163 -0
- package/src/lib/manifest/category.ts +100 -0
- package/src/lib/manifest/custom-object-field-section.ts +93 -0
- package/src/lib/manifest/custom-object-page-layout.ts +427 -0
- package/src/lib/manifest/custom-object.ts +360 -0
- package/src/lib/manifest/field.ts +822 -0
- package/src/lib/manifest/index.ts +114 -0
- package/src/lib/manifest/list-view.ts +183 -0
- package/src/lib/manifest/manifest-builder.ts +140 -0
- package/src/lib/manifest/manifest-function.ts +151 -0
- package/src/lib/manifest/rule.ts +191 -0
- package/src/lib/manifest/sdui-page.ts +118 -0
- package/src/lib/manifest/validation.ts +150 -0
- package/src/lib/sdui/actions.ts +58 -0
- package/src/lib/sdui/component.ts +122 -0
- package/src/lib/sdui/components.ts +308 -0
- package/src/lib/sdui/conditions.ts +59 -0
- package/src/lib/sdui/directives.ts +42 -0
- package/src/lib/sdui/index.ts +365 -0
- package/src/lib/sdui/props.ts +32 -0
- package/src/lib/sdui/render.ts +58 -0
- package/src/lib/sdui/state.ts +60 -0
- package/src/resources/draft-hires.ts +31 -0
- package/src/resources/earnings-inputs.ts +127 -0
- package/src/resources/files.ts +203 -0
- package/src/resources/headcount-positions.ts +2 -0
- package/src/resources/index.ts +3 -0
- package/src/resources/legal-entities.ts +1 -0
- package/src/resources/location-factors.ts +2 -0
- package/src/resources/shared.ts +1 -0
- package/src/resources/workers.ts +2 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
3
|
+
*
|
|
4
|
+
* Shared helpers and enum types for the manifest builder.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
let _counter = 0;
|
|
8
|
+
|
|
9
|
+
/** Generate a short unique ID string (e.g. "id_a3f1b2"). */
|
|
10
|
+
export function generateId(prefix = 'id'): string {
|
|
11
|
+
const rand = Math.random().toString(36).slice(2, 8);
|
|
12
|
+
return `${prefix}_${rand}${(_counter++).toString(36)}`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Enum types for strongly-typed setters
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
/** Record-triggered flow trigger type. */
|
|
20
|
+
export type TriggerType = 'CREATE' | 'UPDATE' | 'CREATE_OR_UPDATE';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Update-trigger condition type. Mirrors the backend
|
|
24
|
+
* `FlowUpdateTriggerBehavior` enum (`constants.py`). Note the `OR_AFTER`
|
|
25
|
+
* spelling — `BEFORE_AND_AFTER` is a common typo that /validate will reject.
|
|
26
|
+
*/
|
|
27
|
+
export type UpdateTriggerType = 'MEETS_CONDITION_AFTER_ONLY' | 'MEETS_CONDITION_BEFORE_OR_AFTER';
|
|
28
|
+
|
|
29
|
+
/** Validation rule state. */
|
|
30
|
+
export type ValidationState = 'ACTIVE' | 'INACTIVE';
|
|
31
|
+
|
|
32
|
+
/** Validation rule level. */
|
|
33
|
+
export type ValidationLevel = 'RECORD' | 'FIELD';
|
|
34
|
+
|
|
35
|
+
/** Sort direction for list views. */
|
|
36
|
+
export type SortOrder = 'ASC' | 'DESC';
|
|
37
|
+
|
|
38
|
+
/** Scope for list views. */
|
|
39
|
+
export type ObjectScope = 'all' | 'my_records';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Supported `data_type.field_type` values for CUSTOM_OBJECT_FIELD and
|
|
43
|
+
* CUSTOM_FIELD_V2. Note: lookup and parent-child relationships both use
|
|
44
|
+
* `field_type: 'OG_REFERENCE_FIELD'` and are differentiated by `edge_type`
|
|
45
|
+
* (see `EdgeType`). `'LOOKUP'` and `'PARENT_CHILD'` are NOT valid
|
|
46
|
+
* `field_type` values — emitting them produces invalid manifests.
|
|
47
|
+
*/
|
|
48
|
+
export type FieldType =
|
|
49
|
+
| 'TEXT'
|
|
50
|
+
| 'LONG_TEXT'
|
|
51
|
+
| 'EMAIL'
|
|
52
|
+
| 'URL'
|
|
53
|
+
| 'PHONE_NUMBER'
|
|
54
|
+
| 'NUMBER'
|
|
55
|
+
| 'CURRENCY'
|
|
56
|
+
| 'PERCENTAGE'
|
|
57
|
+
| 'DATE'
|
|
58
|
+
| 'DATETIME'
|
|
59
|
+
| 'TIME'
|
|
60
|
+
| 'SELECT'
|
|
61
|
+
| 'RADIO'
|
|
62
|
+
| 'BOOLEAN'
|
|
63
|
+
| 'FILE'
|
|
64
|
+
| 'OG_REFERENCE_FIELD';
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Discriminator for `OG_REFERENCE_FIELD` data types — distinguishes a plain
|
|
68
|
+
* lookup from a parent-child relationship.
|
|
69
|
+
*/
|
|
70
|
+
export type EdgeType = 'LOOKUP' | 'PARENT_CHILD';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Allowed output `field_type` for Simple Formula Fields. Mirrors the UI
|
|
74
|
+
* "Data type" dropdown in the formula field editor — backend `field_type` is
|
|
75
|
+
* free-form `str`, but the product only validates these 7 variants end-to-end.
|
|
76
|
+
*/
|
|
77
|
+
export type FormulaFieldType = 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'CURRENCY' | 'PERCENTAGE' | 'DATE' | 'URL';
|
|
78
|
+
|
|
79
|
+
/** Runtime for FUNCTION component. */
|
|
80
|
+
export type FunctionRuntime = 'cloudflare-js' | 'lambda-deno' | 'lambda-python';
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Page type inside CUSTOM_APP. Mirrors the backend `PageType` enum
|
|
84
|
+
* (`pages.py`). The SDK currently models the two surfaces it supports —
|
|
85
|
+
* object pages and SDUI pages. `function_page` is NOT a valid backend token;
|
|
86
|
+
* wrap a function in an SDUI page instead.
|
|
87
|
+
*/
|
|
88
|
+
export type PageType = 'object_page' | 'sdui_page';
|
|
89
|
+
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Summary-field constants (for Field.summary)
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
|
|
94
|
+
/** Backend supports exactly these four (`constants.py:1316`). */
|
|
95
|
+
export type SummaryAggregation = 'COUNT' | 'SUM' | 'MIN' | 'MAX';
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* RQL operator for summary filters. Scalar-only, matching the admin
|
|
99
|
+
* condition-builder dropdown.
|
|
100
|
+
*
|
|
101
|
+
* The backend's RQL engine accepts a wider set (WHERE_CLAUSE_OPERATORS
|
|
102
|
+
* includes `LIKE`, `ILIKE`, `IN`, `CONTAINS`, …), but summary filters
|
|
103
|
+
* authored by the UI are restricted to plain scalar comparisons. Emitting
|
|
104
|
+
* anything else from the SDK produces a manifest that /validate accepts
|
|
105
|
+
* but the admin UI cannot render or edit — a split-brain config.
|
|
106
|
+
*/
|
|
107
|
+
export type SummaryFilterOperator =
|
|
108
|
+
| '='
|
|
109
|
+
| '!=' // equality (all scalar types)
|
|
110
|
+
| '>'
|
|
111
|
+
| '>='
|
|
112
|
+
| '<'
|
|
113
|
+
| '<='; // ordered numeric / currency / date
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Mirrors `DERIVED_AGGREGATION_FUNCTIONS_AND_SUPPORTED_TYPES` (constants.py:1316).
|
|
117
|
+
* The output field_type of a summary must be in the aggregation function's
|
|
118
|
+
* supported set. For non-COUNT, backend further requires the output to equal
|
|
119
|
+
* the aggregated field's field_type (parent_child_util.py:217-220).
|
|
120
|
+
*/
|
|
121
|
+
export const ALLOWED_SUMMARY_OUTPUT: Record<SummaryAggregation, ReadonlySet<FieldType>> = {
|
|
122
|
+
COUNT: new Set(['NUMBER']),
|
|
123
|
+
SUM: new Set(['NUMBER', 'PERCENTAGE', 'CURRENCY']),
|
|
124
|
+
MIN: new Set(['NUMBER', 'PERCENTAGE', 'DATE', 'DATETIME', 'TIME', 'CURRENCY']),
|
|
125
|
+
MAX: new Set(['NUMBER', 'PERCENTAGE', 'DATE', 'DATETIME', 'TIME', 'CURRENCY']),
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Per-field-type allow-list for summary filter operators, mirroring the
|
|
130
|
+
* admin condition-builder picker.
|
|
131
|
+
*
|
|
132
|
+
* This is also the single source of truth for "which field types can be
|
|
133
|
+
* used as a summary filter at all": field types **absent from this map**
|
|
134
|
+
* are rejected as filter fields entirely. The UI-hidden types are:
|
|
135
|
+
*
|
|
136
|
+
* SELECT / RADIO — array-valued at the RQL layer; the
|
|
137
|
+
* "is this option selected?" semantics are
|
|
138
|
+
* ambiguous for aggregations. Users are
|
|
139
|
+
* expected to model a plain BOOLEAN on the
|
|
140
|
+
* child CO (updated via Rule) and filter
|
|
141
|
+
* on that.
|
|
142
|
+
* LONG_TEXT — backend hard-rejects (parent_child_util.py).
|
|
143
|
+
* OG_REFERENCE_FIELD — lookup/parent-child: filter-on-what is
|
|
144
|
+
* ambiguous (id vs. name vs. edge metadata).
|
|
145
|
+
*
|
|
146
|
+
* The backend additionally rejects formula and summary fields as filter
|
|
147
|
+
* fields, and rejects the summary's own parent-child `lookup` field as
|
|
148
|
+
* its filter field. Those are enforced at construction-time in
|
|
149
|
+
* `SummaryField` (see `field.ts`) so the error surfaces before /validate.
|
|
150
|
+
*/
|
|
151
|
+
export const FILTER_OPERATORS_BY_TYPE: Partial<Record<FieldType, ReadonlySet<SummaryFilterOperator>>> = {
|
|
152
|
+
TEXT: new Set(['=', '!=']),
|
|
153
|
+
EMAIL: new Set(['=', '!=']),
|
|
154
|
+
URL: new Set(['=', '!=']),
|
|
155
|
+
PHONE_NUMBER: new Set(['=', '!=']),
|
|
156
|
+
BOOLEAN: new Set(['=', '!=']),
|
|
157
|
+
FILE: new Set(['=', '!=']),
|
|
158
|
+
NUMBER: new Set(['=', '!=', '>', '>=', '<', '<=']),
|
|
159
|
+
PERCENTAGE: new Set(['=', '!=', '>', '>=', '<', '<=']),
|
|
160
|
+
CURRENCY: new Set(['=', '!=', '>', '>=', '<', '<=']),
|
|
161
|
+
DATE: new Set(['=', '<', '>']),
|
|
162
|
+
DATETIME: new Set(['=', '<', '>']),
|
|
163
|
+
TIME: new Set(['=', '<', '>']),
|
|
164
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { CustomObject } from './custom-object';
|
|
2
|
+
import type { ManifestScope } from './manifest-builder';
|
|
3
|
+
import { SduiPage } from './sdui-page';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A single page entry in an {@link App}.
|
|
7
|
+
*
|
|
8
|
+
* - Pass a {@link CustomObject} to create an object-page tab.
|
|
9
|
+
* - Pass an {@link SduiPage} to create a custom SDUI surface tab.
|
|
10
|
+
*/
|
|
11
|
+
export type AppPage = CustomObject | SduiPage;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* S3 icon reference for an {@link App}.
|
|
15
|
+
*/
|
|
16
|
+
export interface AppIcon {
|
|
17
|
+
/** S3 bucket holding the icon asset. */
|
|
18
|
+
s3Bucket: string;
|
|
19
|
+
/** S3 key (path) within `s3Bucket`. */
|
|
20
|
+
s3Key: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Initialization properties for {@link App}.
|
|
25
|
+
*/
|
|
26
|
+
export interface AppProps {
|
|
27
|
+
/**
|
|
28
|
+
* Unique identifier for this app (e.g. `'gym_membership_management_app'`).
|
|
29
|
+
*
|
|
30
|
+
* Required.
|
|
31
|
+
*/
|
|
32
|
+
apiName: string;
|
|
33
|
+
/**
|
|
34
|
+
* Display name shown as the app title in the Rippling UI.
|
|
35
|
+
*
|
|
36
|
+
* Required.
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* Human-readable description of what this app does.
|
|
41
|
+
*
|
|
42
|
+
* Optional. @default null
|
|
43
|
+
*/
|
|
44
|
+
description?: string;
|
|
45
|
+
/**
|
|
46
|
+
* App type discriminator.
|
|
47
|
+
*
|
|
48
|
+
* Optional. @default `'custom'`
|
|
49
|
+
*/
|
|
50
|
+
appType?: string;
|
|
51
|
+
/**
|
|
52
|
+
* S3 icon for this app.
|
|
53
|
+
*
|
|
54
|
+
* Optional. @default null
|
|
55
|
+
*/
|
|
56
|
+
icon?: AppIcon;
|
|
57
|
+
/**
|
|
58
|
+
* Pages shown as tabs in the app. Pass {@link CustomObject} instances for object-page
|
|
59
|
+
* tabs and {@link SduiPage} instances for custom SDUI surfaces. Tab order matches
|
|
60
|
+
* the array order.
|
|
61
|
+
*
|
|
62
|
+
* Optional. @default `[]`
|
|
63
|
+
*/
|
|
64
|
+
pages?: AppPage[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function resolvePage(entry: AppPage): Record<string, any> {
|
|
68
|
+
if (entry instanceof CustomObject) {
|
|
69
|
+
const apiName = entry.getApiName();
|
|
70
|
+
return {
|
|
71
|
+
api_name: apiName,
|
|
72
|
+
page_type: 'object_page',
|
|
73
|
+
object_rql_name: apiName,
|
|
74
|
+
};
|
|
75
|
+
} else {
|
|
76
|
+
const sduiPageId = entry.getSduiPageId();
|
|
77
|
+
return {
|
|
78
|
+
api_name: sduiPageId,
|
|
79
|
+
page_type: 'sdui_page',
|
|
80
|
+
sdui_page_id: sduiPageId,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Defines a Rippling app and registers it with the manifest.
|
|
87
|
+
*
|
|
88
|
+
* An app is the top-level navigation container. It groups one or more pages —
|
|
89
|
+
* either custom-object record pages or SDUI surfaces — as tabs visible to users.
|
|
90
|
+
* You would normally define the app last in your manifest file, after all objects,
|
|
91
|
+
* functions, and SDUI pages have been declared.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* new App(manifest, {
|
|
96
|
+
* apiName: 'gym_membership_management_app',
|
|
97
|
+
* name: 'Gym Membership Management',
|
|
98
|
+
* description: 'Members, trainers, schedules, and check-in',
|
|
99
|
+
* appType: 'custom',
|
|
100
|
+
* pages: [memberObj, trainerObj, sessionObj, todaySchedulePage, checkInDeskPage],
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @see {@link CustomObject} — object-page tab source.
|
|
105
|
+
* @see {@link SduiPage} — SDUI surface tab source.
|
|
106
|
+
*/
|
|
107
|
+
export class App {
|
|
108
|
+
private readonly _apiName: string;
|
|
109
|
+
private readonly _name: string;
|
|
110
|
+
private readonly _description: string | undefined;
|
|
111
|
+
private readonly _appType: string | undefined;
|
|
112
|
+
private readonly _icon: AppIcon | undefined;
|
|
113
|
+
/** Wire-format pages, resolved eagerly at construction. */
|
|
114
|
+
private readonly _pages: Record<string, any>[];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @param scope - The manifest to register this app with.
|
|
118
|
+
* @param props - Initialization properties.
|
|
119
|
+
*/
|
|
120
|
+
constructor(scope: ManifestScope, props: AppProps) {
|
|
121
|
+
this._apiName = props.apiName;
|
|
122
|
+
this._name = props.name;
|
|
123
|
+
this._description = props.description;
|
|
124
|
+
this._appType = props.appType;
|
|
125
|
+
this._icon = props.icon;
|
|
126
|
+
this._pages = (props.pages ?? []).map(resolvePage);
|
|
127
|
+
scope._register(this);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Returns the api_name of this app (e.g. `'gym_membership_management_app'`).
|
|
132
|
+
*/
|
|
133
|
+
getApiName(): string {
|
|
134
|
+
return this._apiName;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Returns the display name of this app.
|
|
139
|
+
*/
|
|
140
|
+
getName(): string {
|
|
141
|
+
return this._name;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Serializes this app to the wire format consumed by the manifest install endpoint.
|
|
146
|
+
*
|
|
147
|
+
* @returns A plain object with `type: 'CUSTOM_APP'`. Optional fields are omitted when unset.
|
|
148
|
+
*/
|
|
149
|
+
toDict(): Record<string, any> {
|
|
150
|
+
const component: Record<string, any> = {
|
|
151
|
+
type: 'CUSTOM_APP',
|
|
152
|
+
api_name: this._apiName,
|
|
153
|
+
name: this._name,
|
|
154
|
+
};
|
|
155
|
+
if (this._description != null) component['description'] = this._description;
|
|
156
|
+
if (this._icon != null) {
|
|
157
|
+
component['icon'] = { s3_bucket: this._icon.s3Bucket, s3_key: this._icon.s3Key };
|
|
158
|
+
}
|
|
159
|
+
if (this._appType != null) component['app_type'] = this._appType;
|
|
160
|
+
if (this._pages.length > 0) component['pages'] = this._pages.map((p) => ({ ...p }));
|
|
161
|
+
return component;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ManifestScope } from './manifest-builder';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Initialization properties for {@link Category}.
|
|
5
|
+
*/
|
|
6
|
+
export interface CategoryProps {
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier for this category (e.g. `'gym__c'`). Must end with `__c`.
|
|
9
|
+
*
|
|
10
|
+
* Required.
|
|
11
|
+
*/
|
|
12
|
+
apiName: string;
|
|
13
|
+
/**
|
|
14
|
+
* Display name shown in the Rippling UI (e.g. `'Gym'`).
|
|
15
|
+
*
|
|
16
|
+
* Required.
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* Human-readable description of what this category groups.
|
|
21
|
+
*
|
|
22
|
+
* Optional. @default null
|
|
23
|
+
*/
|
|
24
|
+
description?: string | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Defines a category and registers it with the manifest.
|
|
29
|
+
*
|
|
30
|
+
* A category is the navigation grouping that organizes related custom objects
|
|
31
|
+
* in the Rippling sidebar. You would normally define one category per domain,
|
|
32
|
+
* then pass it (or its api_name string) to each {@link CustomObject} in that domain.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const manifest = new ManifestBuilder({
|
|
37
|
+
* key: 'gym_membership_management',
|
|
38
|
+
* name: 'Gym Membership Management',
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* const gymCategory = new Category(manifest, {
|
|
42
|
+
* apiName: 'gym__c',
|
|
43
|
+
* name: 'Gym',
|
|
44
|
+
* description: 'Memberships, staff, schedules, and attendance',
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* // Pass the instance to any CustomObject in this domain:
|
|
48
|
+
* const memberObj = new CustomObject(manifest, {
|
|
49
|
+
* apiName: 'gym_member__c',
|
|
50
|
+
* name: 'Member',
|
|
51
|
+
* category: gymCategory,
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @see {@link CustomObject} — references this category via instance or api_name string.
|
|
56
|
+
*/
|
|
57
|
+
export class Category {
|
|
58
|
+
private readonly _apiName: string;
|
|
59
|
+
private readonly _name: string;
|
|
60
|
+
private readonly _description: string | null;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param scope - The manifest to register this category with.
|
|
64
|
+
* @param props - Initialization properties.
|
|
65
|
+
*/
|
|
66
|
+
constructor(scope: ManifestScope, props: CategoryProps) {
|
|
67
|
+
this._apiName = props.apiName;
|
|
68
|
+
this._name = props.name;
|
|
69
|
+
this._description = props.description ?? null;
|
|
70
|
+
scope._register(this);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns the api_name of this category (e.g. `'gym__c'`).
|
|
75
|
+
*/
|
|
76
|
+
getApiName(): string {
|
|
77
|
+
return this._apiName;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Returns the display name of this category (e.g. `'Gym'`).
|
|
82
|
+
*/
|
|
83
|
+
getName(): string {
|
|
84
|
+
return this._name;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Serializes this category to the wire format consumed by the manifest install endpoint.
|
|
89
|
+
*
|
|
90
|
+
* @returns A plain object with `type: 'CUSTOM_CATEGORY'` and all configured fields.
|
|
91
|
+
*/
|
|
92
|
+
toDict(): Record<string, any> {
|
|
93
|
+
return {
|
|
94
|
+
type: 'CUSTOM_CATEGORY',
|
|
95
|
+
api_name: this._apiName,
|
|
96
|
+
name: this._name,
|
|
97
|
+
description: this._description ?? null,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { generateId } from './_helpers';
|
|
2
|
+
import type { CustomObject } from './custom-object';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Initialization properties for {@link CustomObjectFieldSection}.
|
|
6
|
+
*/
|
|
7
|
+
export interface CustomObjectFieldSectionProps {
|
|
8
|
+
/**
|
|
9
|
+
* Display name of the section shown as a group header on the detail page
|
|
10
|
+
* (e.g. `'Profile'`, `'Membership'`).
|
|
11
|
+
*
|
|
12
|
+
* Required.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Stable identifier for this section. Pass a human-readable slug
|
|
17
|
+
* (e.g. `'sec_gm_profile'`) to keep it stable across manifest regenerations.
|
|
18
|
+
*
|
|
19
|
+
* Optional. Auto-generated when omitted. @default generateId('sec')
|
|
20
|
+
*/
|
|
21
|
+
sectionId?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Defines a field section and registers it with the manifest.
|
|
26
|
+
*
|
|
27
|
+
* A field section is a named group of fields displayed together on a custom
|
|
28
|
+
* object's detail page. After creating a section, pass it as the `section`
|
|
29
|
+
* prop on any field that should belong to it.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const profileSection = new CustomObjectFieldSection(memberObj, {
|
|
34
|
+
* name: 'Profile',
|
|
35
|
+
* sectionId: 'sec_gm_profile',
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* const firstName = new TextField(memberObj, {
|
|
39
|
+
* apiName: 'first_name__c',
|
|
40
|
+
* displayName: 'First name',
|
|
41
|
+
* section: profileSection,
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see {@link CustomObjectPageLayout} — controls which sections appear on which tab.
|
|
46
|
+
*/
|
|
47
|
+
export class CustomObjectFieldSection {
|
|
48
|
+
private readonly _sectionId: string;
|
|
49
|
+
private readonly _name: string;
|
|
50
|
+
private readonly _model: CustomObject;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param customObject - The custom object this section belongs to.
|
|
54
|
+
* @param props - Initialization properties.
|
|
55
|
+
*/
|
|
56
|
+
constructor(customObject: CustomObject, props: CustomObjectFieldSectionProps) {
|
|
57
|
+
this._sectionId = props.sectionId ?? generateId('sec');
|
|
58
|
+
this._name = props.name;
|
|
59
|
+
this._model = customObject;
|
|
60
|
+
customObject._register(this);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns the stable identifier for this section (e.g. `'sec_gm_profile'`).
|
|
65
|
+
*
|
|
66
|
+
* Use this value in page layout field entries via `getSectionId()`, or pass
|
|
67
|
+
* the section instance directly to field `section` props.
|
|
68
|
+
*/
|
|
69
|
+
getSectionId(): string {
|
|
70
|
+
return this._sectionId;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns the api_name of the custom object this section belongs to.
|
|
75
|
+
*/
|
|
76
|
+
getModelApiName(): string {
|
|
77
|
+
return this._model.getApiName();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Serializes this section to the wire format consumed by the manifest install endpoint.
|
|
82
|
+
*
|
|
83
|
+
* @returns A plain object with `type: 'CUSTOM_OBJECT_FIELD_SECTION'`.
|
|
84
|
+
*/
|
|
85
|
+
toDict(): Record<string, any> {
|
|
86
|
+
return {
|
|
87
|
+
type: 'CUSTOM_OBJECT_FIELD_SECTION',
|
|
88
|
+
section_id: this._sectionId,
|
|
89
|
+
model_name: this._model.getApiName(),
|
|
90
|
+
name: this._name,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|