@rippling/rippling-sdk 0.2.0-alpha.34 → 0.2.0-alpha.36
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 +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/examples/.keep +4 -0
- package/examples/manifest/dental-practice-management/dental-practice-management.ts +651 -0
- package/examples/manifest/dental-practice-management/manifest.json +1870 -0
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +757 -0
- package/examples/manifest/gym-membership-management/manifest.json +1975 -0
- package/examples/sdui/sdui-crud-todo/rippling-function.ts +367 -0
- package/examples/sdui/sdui-crud-todo/sdui-crud-todo.ts +282 -0
- package/examples/sdui/sdui-showcase/rippling-function.ts +381 -0
- package/examples/sdui/sdui-showcase/sdui-showcase.ts +351 -0
- package/examples/sdui/sdui-tab-multi-view/rippling-function.ts +1061 -0
- package/examples/sdui/sdui-tab-multi-view/sdui-tab-multi-view.ts +924 -0
- package/examples/sdui/vote/rippling-function.ts +330 -0
- package/examples/sdui/vote/vote.ts +298 -0
- package/lib/manifest/app.d.mts +81 -13
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +81 -13
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +37 -16
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +37 -16
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/category.d.mts +63 -7
- package/lib/manifest/category.d.mts.map +1 -1
- package/lib/manifest/category.d.ts +63 -7
- package/lib/manifest/category.d.ts.map +1 -1
- package/lib/manifest/category.js +45 -10
- package/lib/manifest/category.js.map +1 -1
- package/lib/manifest/category.mjs +43 -8
- package/lib/manifest/category.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts +56 -6
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
- package/lib/manifest/custom-object-field-section.d.ts +56 -6
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
- package/lib/manifest/custom-object-field-section.js +41 -14
- package/lib/manifest/custom-object-field-section.js.map +1 -1
- package/lib/manifest/custom-object-field-section.mjs +39 -12
- package/lib/manifest/custom-object-field-section.mjs.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.mts +201 -41
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +201 -41
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +76 -30
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +74 -28
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +128 -15
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +128 -15
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +61 -26
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +61 -26
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/field.d.mts +265 -54
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +265 -54
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +100 -57
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +100 -57
- package/lib/manifest/field.mjs.map +1 -1
- package/lib/manifest/list-view.d.mts +105 -14
- package/lib/manifest/list-view.d.mts.map +1 -1
- package/lib/manifest/list-view.d.ts +105 -14
- package/lib/manifest/list-view.d.ts.map +1 -1
- package/lib/manifest/list-view.js +50 -14
- package/lib/manifest/list-view.js.map +1 -1
- package/lib/manifest/list-view.mjs +48 -12
- package/lib/manifest/list-view.mjs.map +1 -1
- package/lib/manifest/manifest-builder.d.mts +77 -11
- package/lib/manifest/manifest-builder.d.mts.map +1 -1
- package/lib/manifest/manifest-builder.d.ts +77 -11
- package/lib/manifest/manifest-builder.d.ts.map +1 -1
- package/lib/manifest/manifest-builder.js +46 -24
- package/lib/manifest/manifest-builder.js.map +1 -1
- package/lib/manifest/manifest-builder.mjs +44 -22
- package/lib/manifest/manifest-builder.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +92 -12
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +92 -12
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +40 -11
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +38 -9
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/rule.d.mts +94 -16
- package/lib/manifest/rule.d.mts.map +1 -1
- package/lib/manifest/rule.d.ts +94 -16
- package/lib/manifest/rule.d.ts.map +1 -1
- package/lib/manifest/rule.js +36 -15
- package/lib/manifest/rule.js.map +1 -1
- package/lib/manifest/rule.mjs +36 -15
- package/lib/manifest/rule.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +67 -11
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +67 -11
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +44 -13
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +42 -11
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/lib/manifest/validation.d.mts +87 -12
- package/lib/manifest/validation.d.mts.map +1 -1
- package/lib/manifest/validation.d.ts +87 -12
- package/lib/manifest/validation.d.ts.map +1 -1
- package/lib/manifest/validation.js +41 -15
- package/lib/manifest/validation.js.map +1 -1
- package/lib/manifest/validation.mjs +39 -13
- package/lib/manifest/validation.mjs.map +1 -1
- 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/company-legal-entity-workers.d.mts +79 -0
- package/resources/company-legal-entity-workers.d.mts.map +1 -0
- package/resources/company-legal-entity-workers.d.ts +79 -0
- package/resources/company-legal-entity-workers.d.ts.map +1 -0
- package/resources/company-legal-entity-workers.js +30 -0
- package/resources/company-legal-entity-workers.js.map +1 -0
- package/resources/company-legal-entity-workers.mjs +26 -0
- package/resources/company-legal-entity-workers.mjs.map +1 -0
- package/resources/draft-hires.d.mts +4 -0
- package/resources/draft-hires.d.mts.map +1 -1
- package/resources/draft-hires.d.ts +4 -0
- package/resources/draft-hires.d.ts.map +1 -1
- package/resources/files.d.mts +16 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +16 -1
- package/resources/files.d.ts.map +1 -1
- 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 +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- 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 +20 -0
- package/src/lib/manifest/app.ts +81 -26
- package/src/lib/manifest/category.ts +63 -14
- package/src/lib/manifest/custom-object-field-section.ts +56 -17
- package/src/lib/manifest/custom-object-page-layout.ts +201 -66
- package/src/lib/manifest/custom-object.ts +128 -37
- package/src/lib/manifest/field.ts +265 -75
- package/src/lib/manifest/list-view.ts +105 -25
- package/src/lib/manifest/manifest-builder.ts +75 -32
- package/src/lib/manifest/manifest-function.ts +92 -22
- package/src/lib/manifest/rule.ts +95 -29
- package/src/lib/manifest/sdui-page.ts +67 -21
- package/src/lib/manifest/validation.ts +87 -24
- 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/company-legal-entity-workers.ts +115 -0
- package/src/resources/draft-hires.ts +5 -0
- package/src/resources/files.ts +18 -1
- package/src/resources/headcount-positions.ts +2 -0
- package/src/resources/index.ts +7 -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
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Fields for Rippling custom objects (CUSTOM_OBJECT_FIELD v2).
|
|
3
|
-
* Hand-written (not Stainless-generated); mirrors custom_object_field.py.
|
|
4
|
-
*
|
|
5
|
-
* Each concrete field type is its own class that extends the internal `Field`
|
|
6
|
-
* base. Construct like any other component:
|
|
7
|
-
*
|
|
8
|
-
* new TextField(customObject, { apiName, displayName, ... });
|
|
9
|
-
* new LookupField(customObject, { apiName, target: otherCo, ... });
|
|
10
|
-
* new SummaryField(customObject, { apiName, aggregates, using, lookup, ... });
|
|
11
|
-
*
|
|
12
|
-
* This mirrors AWS CDK's per-variant-class pattern (e.g.
|
|
13
|
-
* `new codepipeline_actions.GitHubSourceAction({...})` rather than a single
|
|
14
|
-
* Action class with 30 static factories). Every subclass serializes to the
|
|
15
|
-
* same `CUSTOM_OBJECT_FIELD` wire shape, discriminated by `data_type.field_type`.
|
|
16
|
-
*
|
|
17
|
-
* The parent CO is the first positional arg (the "scope") — its `api_name`
|
|
18
|
-
* becomes `custom_object_api_name` at serialization, and the field
|
|
19
|
-
* auto-registers with the manifest via the CO's scope chain.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
import {
|
|
23
2
|
FILTER_OPERATORS_BY_TYPE,
|
|
24
3
|
type FieldType,
|
|
@@ -29,12 +8,34 @@ import {
|
|
|
29
8
|
import type { CustomObject } from './custom-object';
|
|
30
9
|
import type { CustomObjectFieldSection } from './custom-object-field-section';
|
|
31
10
|
|
|
32
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* A filter condition applied to a {@link SummaryField}.
|
|
13
|
+
*
|
|
14
|
+
* Filters restrict which child records are included in the aggregation.
|
|
15
|
+
* Only scalar field types are supported as filter fields — see
|
|
16
|
+
* `FILTER_OPERATORS_BY_TYPE` in `_helpers.ts` for the per-type operator allow-list.
|
|
17
|
+
*/
|
|
33
18
|
export interface SummaryFilter {
|
|
34
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The child-CO field to filter on.
|
|
21
|
+
*
|
|
22
|
+
* Required. Must be a scalar field on the same child object as `lookup`.
|
|
23
|
+
* Cannot be a formula field, summary field, or the `lookup` field itself.
|
|
24
|
+
*/
|
|
35
25
|
field: Field;
|
|
26
|
+
/**
|
|
27
|
+
* Comparison operator. Allowed operators depend on the field's type —
|
|
28
|
+
* text/boolean fields support `=` and `!=`; numeric/date fields additionally
|
|
29
|
+
* support `>`, `>=`, `<`, `<=`.
|
|
30
|
+
*
|
|
31
|
+
* Required.
|
|
32
|
+
*/
|
|
36
33
|
operator: SummaryFilterOperator;
|
|
37
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Raw RQL value string, e.g. `"'Active'"`, `"50"`, `"true"`, `"DATE(2026,1,1)"`.
|
|
36
|
+
*
|
|
37
|
+
* Required.
|
|
38
|
+
*/
|
|
38
39
|
value: string;
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -94,9 +95,28 @@ export interface FieldProps {
|
|
|
94
95
|
// ────────────────────────────────────────────────────────────────────────
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
|
-
* Base class for every custom-object field.
|
|
98
|
-
*
|
|
99
|
-
*
|
|
98
|
+
* Base class for every custom-object field.
|
|
99
|
+
*
|
|
100
|
+
* Prefer the typed subclasses (`TextField`, `NumberField`, `LookupField`, …) over
|
|
101
|
+
* constructing `Field` directly. Use `Field` only for wire-level field types the
|
|
102
|
+
* SDK does not yet model with a dedicated subclass.
|
|
103
|
+
*
|
|
104
|
+
* All field classes share the same scope-first CDK pattern: pass the parent
|
|
105
|
+
* {@link CustomObject} as the first argument and the field auto-registers with
|
|
106
|
+
* the manifest. Every field api_name must end with `__c`.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* // Prefer typed subclasses:
|
|
111
|
+
* const firstName = new TextField(memberObj, {
|
|
112
|
+
* apiName: 'first_name__c',
|
|
113
|
+
* displayName: 'First name',
|
|
114
|
+
* required: true,
|
|
115
|
+
* maxLength: 80,
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @see {@link TextField}, {@link NumberField}, {@link LookupField}, {@link SummaryField}
|
|
100
120
|
*/
|
|
101
121
|
export class Field {
|
|
102
122
|
private readonly _fieldApiName: string;
|
|
@@ -114,7 +134,11 @@ export class Field {
|
|
|
114
134
|
private readonly _summarySpec: SummarySpec | null;
|
|
115
135
|
private readonly _derivedAggregatedFieldStatic: Record<string, any> | null;
|
|
116
136
|
|
|
117
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* @param customObject - The custom object this field belongs to.
|
|
139
|
+
* @param props - Field configuration. See {@link FieldProps}.
|
|
140
|
+
* @throws {Error} If `props.apiName` does not end with `__c`.
|
|
141
|
+
*/
|
|
118
142
|
constructor(customObject: CustomObject, props: FieldProps) {
|
|
119
143
|
validateApiName(props.apiName);
|
|
120
144
|
this._fieldApiName = props.apiName;
|
|
@@ -150,38 +174,42 @@ export class Field {
|
|
|
150
174
|
|
|
151
175
|
// ── Getters ────────────────────────────────────────────────────────────
|
|
152
176
|
|
|
153
|
-
/**
|
|
177
|
+
/** Returns the api_name of this field (e.g. `'first_name__c'`). */
|
|
154
178
|
getApiName(): string {
|
|
155
179
|
return this._fieldApiName;
|
|
156
180
|
}
|
|
157
|
-
/**
|
|
181
|
+
/** Returns the display name of this field. */
|
|
158
182
|
getDisplayName(): string {
|
|
159
183
|
return this._fieldDisplayName;
|
|
160
184
|
}
|
|
161
|
-
/** api_name of the
|
|
185
|
+
/** Returns the api_name of the custom object this field belongs to. */
|
|
162
186
|
getCustomObjectApiName(): string {
|
|
163
187
|
return this._customObjectApiName;
|
|
164
188
|
}
|
|
165
|
-
/**
|
|
189
|
+
/** Returns the resolved `field_type` (e.g. `'TEXT'`), or `null` if unset. */
|
|
166
190
|
getFieldType(): FieldType | null {
|
|
167
191
|
return (this._dataType['field_type'] as FieldType | undefined) ?? null;
|
|
168
192
|
}
|
|
169
|
-
/**
|
|
193
|
+
/** Returns a read-only view of the raw `data_type` dict. */
|
|
170
194
|
getDataType(): Readonly<Record<string, any>> {
|
|
171
195
|
return this._dataType;
|
|
172
196
|
}
|
|
173
|
-
/**
|
|
197
|
+
/** Returns `true` if this is a formula (computed) field. */
|
|
174
198
|
isFormula(): boolean {
|
|
175
199
|
return this._derivedFieldFormula != null;
|
|
176
200
|
}
|
|
177
|
-
/**
|
|
201
|
+
/** Returns `true` if this is a summary (rollup) field. */
|
|
178
202
|
isSummary(): boolean {
|
|
179
203
|
return this._summarySpec != null;
|
|
180
204
|
}
|
|
181
205
|
|
|
182
206
|
// ── Serialization ──────────────────────────────────────────────────────
|
|
183
207
|
|
|
184
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* Serializes this field to the wire format consumed by the manifest install endpoint.
|
|
210
|
+
*
|
|
211
|
+
* @returns A plain object with `type: 'CUSTOM_OBJECT_FIELD'`.
|
|
212
|
+
*/
|
|
185
213
|
toDict(): Record<string, any> {
|
|
186
214
|
return {
|
|
187
215
|
type: 'CUSTOM_OBJECT_FIELD',
|
|
@@ -243,54 +271,68 @@ export class Field {
|
|
|
243
271
|
|
|
244
272
|
// ── Text-like ──────────────────────────────────────────────────────────
|
|
245
273
|
|
|
274
|
+
/** Initialization properties for {@link TextField}. */
|
|
246
275
|
export interface TextFieldProps extends CommonFieldProps {
|
|
276
|
+
/** Whether a value is required on save. Optional. */
|
|
247
277
|
required?: boolean;
|
|
278
|
+
/** Whether values must be unique across records. Optional. */
|
|
248
279
|
unique?: boolean;
|
|
280
|
+
/** Maximum character length. Optional. */
|
|
249
281
|
maxLength?: number;
|
|
250
282
|
}
|
|
251
|
-
/** Single-line text. */
|
|
283
|
+
/** Single-line text field. */
|
|
252
284
|
export class TextField extends Field {
|
|
253
285
|
constructor(customObject: CustomObject, props: TextFieldProps) {
|
|
254
286
|
super(customObject, { ...props, fieldType: 'TEXT' });
|
|
255
287
|
}
|
|
256
288
|
}
|
|
257
289
|
|
|
290
|
+
/** Initialization properties for {@link LongTextField}. */
|
|
258
291
|
export interface LongTextFieldProps extends CommonFieldProps {
|
|
292
|
+
/** Whether a value is required on save. Optional. */
|
|
259
293
|
required?: boolean;
|
|
294
|
+
/** Maximum character length. Optional. */
|
|
260
295
|
maxLength?: number;
|
|
261
296
|
}
|
|
262
|
-
/** Multi-line text. */
|
|
297
|
+
/** Multi-line text field. */
|
|
263
298
|
export class LongTextField extends Field {
|
|
264
299
|
constructor(customObject: CustomObject, props: LongTextFieldProps) {
|
|
265
300
|
super(customObject, { ...props, fieldType: 'LONG_TEXT' });
|
|
266
301
|
}
|
|
267
302
|
}
|
|
268
303
|
|
|
304
|
+
/** Initialization properties for {@link EmailField}. */
|
|
269
305
|
export interface EmailFieldProps extends CommonFieldProps {
|
|
306
|
+
/** Whether a value is required on save. Optional. */
|
|
270
307
|
required?: boolean;
|
|
308
|
+
/** Whether values must be unique across records. Optional. */
|
|
271
309
|
unique?: boolean;
|
|
272
310
|
}
|
|
273
|
-
/** Email address
|
|
311
|
+
/** Email address field. Format is validated by the Rippling UI. */
|
|
274
312
|
export class EmailField extends Field {
|
|
275
313
|
constructor(customObject: CustomObject, props: EmailFieldProps) {
|
|
276
314
|
super(customObject, { ...props, fieldType: 'EMAIL' });
|
|
277
315
|
}
|
|
278
316
|
}
|
|
279
317
|
|
|
318
|
+
/** Initialization properties for {@link UrlField}. */
|
|
280
319
|
export interface UrlFieldProps extends CommonFieldProps {
|
|
320
|
+
/** Whether a value is required on save. Optional. */
|
|
281
321
|
required?: boolean;
|
|
282
322
|
}
|
|
283
|
-
/** URL
|
|
323
|
+
/** URL field. Format is validated by the Rippling UI. */
|
|
284
324
|
export class UrlField extends Field {
|
|
285
325
|
constructor(customObject: CustomObject, props: UrlFieldProps) {
|
|
286
326
|
super(customObject, { ...props, fieldType: 'URL' });
|
|
287
327
|
}
|
|
288
328
|
}
|
|
289
329
|
|
|
330
|
+
/** Initialization properties for {@link PhoneField}. */
|
|
290
331
|
export interface PhoneFieldProps extends CommonFieldProps {
|
|
332
|
+
/** Whether a value is required on save. Optional. */
|
|
291
333
|
required?: boolean;
|
|
292
334
|
}
|
|
293
|
-
/** Phone number. */
|
|
335
|
+
/** Phone number field. */
|
|
294
336
|
export class PhoneField extends Field {
|
|
295
337
|
constructor(customObject: CustomObject, props: PhoneFieldProps) {
|
|
296
338
|
super(customObject, { ...props, fieldType: 'PHONE_NUMBER' });
|
|
@@ -299,35 +341,46 @@ export class PhoneField extends Field {
|
|
|
299
341
|
|
|
300
342
|
// ── Numeric ────────────────────────────────────────────────────────────
|
|
301
343
|
|
|
344
|
+
/** Initialization properties for {@link NumberField}. */
|
|
302
345
|
export interface NumberFieldProps extends CommonFieldProps {
|
|
346
|
+
/** Whether a value is required on save. Optional. */
|
|
303
347
|
required?: boolean;
|
|
348
|
+
/** Whether values must be unique across records. Optional. */
|
|
304
349
|
unique?: boolean;
|
|
350
|
+
/** Number of decimal places to display and store. Optional. */
|
|
305
351
|
decimalPlaces?: number;
|
|
306
352
|
}
|
|
307
|
-
/**
|
|
353
|
+
/** Numeric field. */
|
|
308
354
|
export class NumberField extends Field {
|
|
309
355
|
constructor(customObject: CustomObject, props: NumberFieldProps) {
|
|
310
356
|
super(customObject, { ...props, fieldType: 'NUMBER' });
|
|
311
357
|
}
|
|
312
358
|
}
|
|
313
359
|
|
|
360
|
+
/** Initialization properties for {@link CurrencyField}. */
|
|
314
361
|
export interface CurrencyFieldProps extends CommonFieldProps {
|
|
362
|
+
/** Whether a value is required on save. Optional. */
|
|
315
363
|
required?: boolean;
|
|
364
|
+
/** ISO 4217 currency code (e.g. `'USD'`). Optional. Forwarded to the wire only when set. */
|
|
316
365
|
currency?: string;
|
|
366
|
+
/** Number of decimal places. Optional. */
|
|
317
367
|
decimalPlaces?: number;
|
|
318
368
|
}
|
|
319
|
-
/** Currency amount
|
|
369
|
+
/** Currency amount field. */
|
|
320
370
|
export class CurrencyField extends Field {
|
|
321
371
|
constructor(customObject: CustomObject, props: CurrencyFieldProps) {
|
|
322
372
|
super(customObject, { ...props, fieldType: 'CURRENCY' });
|
|
323
373
|
}
|
|
324
374
|
}
|
|
325
375
|
|
|
376
|
+
/** Initialization properties for {@link PercentageField}. */
|
|
326
377
|
export interface PercentageFieldProps extends CommonFieldProps {
|
|
378
|
+
/** Whether a value is required on save. Optional. */
|
|
327
379
|
required?: boolean;
|
|
380
|
+
/** Number of decimal places. Optional. */
|
|
328
381
|
decimalPlaces?: number;
|
|
329
382
|
}
|
|
330
|
-
/** Percentage. */
|
|
383
|
+
/** Percentage field. */
|
|
331
384
|
export class PercentageField extends Field {
|
|
332
385
|
constructor(customObject: CustomObject, props: PercentageFieldProps) {
|
|
333
386
|
super(customObject, { ...props, fieldType: 'PERCENTAGE' });
|
|
@@ -336,30 +389,36 @@ export class PercentageField extends Field {
|
|
|
336
389
|
|
|
337
390
|
// ── Date/time ──────────────────────────────────────────────────────────
|
|
338
391
|
|
|
392
|
+
/** Initialization properties for {@link DateField}. */
|
|
339
393
|
export interface DateFieldProps extends CommonFieldProps {
|
|
394
|
+
/** Whether a value is required on save. Optional. */
|
|
340
395
|
required?: boolean;
|
|
341
396
|
}
|
|
342
|
-
/** Date (no time). */
|
|
397
|
+
/** Date field (no time component). */
|
|
343
398
|
export class DateField extends Field {
|
|
344
399
|
constructor(customObject: CustomObject, props: DateFieldProps) {
|
|
345
400
|
super(customObject, { ...props, fieldType: 'DATE' });
|
|
346
401
|
}
|
|
347
402
|
}
|
|
348
403
|
|
|
404
|
+
/** Initialization properties for {@link DatetimeField}. */
|
|
349
405
|
export interface DatetimeFieldProps extends CommonFieldProps {
|
|
406
|
+
/** Whether a value is required on save. Optional. */
|
|
350
407
|
required?: boolean;
|
|
351
408
|
}
|
|
352
|
-
/** Date
|
|
409
|
+
/** Date and time field. */
|
|
353
410
|
export class DatetimeField extends Field {
|
|
354
411
|
constructor(customObject: CustomObject, props: DatetimeFieldProps) {
|
|
355
412
|
super(customObject, { ...props, fieldType: 'DATETIME' });
|
|
356
413
|
}
|
|
357
414
|
}
|
|
358
415
|
|
|
416
|
+
/** Initialization properties for {@link TimeField}. */
|
|
359
417
|
export interface TimeFieldProps extends CommonFieldProps {
|
|
418
|
+
/** Whether a value is required on save. Optional. */
|
|
360
419
|
required?: boolean;
|
|
361
420
|
}
|
|
362
|
-
/** Time
|
|
421
|
+
/** Time-of-day field. */
|
|
363
422
|
export class TimeField extends Field {
|
|
364
423
|
constructor(customObject: CustomObject, props: TimeFieldProps) {
|
|
365
424
|
super(customObject, { ...props, fieldType: 'TIME' });
|
|
@@ -368,34 +427,48 @@ export class TimeField extends Field {
|
|
|
368
427
|
|
|
369
428
|
// ── Choice ─────────────────────────────────────────────────────────────
|
|
370
429
|
|
|
430
|
+
/** Initialization properties for {@link SelectField}. */
|
|
371
431
|
export interface SelectFieldProps extends CommonFieldProps {
|
|
372
|
-
/**
|
|
432
|
+
/**
|
|
433
|
+
* The list of selectable options (e.g. `['Active', 'Frozen', 'Cancelled']`).
|
|
434
|
+
*
|
|
435
|
+
* Required.
|
|
436
|
+
*/
|
|
373
437
|
options: string[];
|
|
438
|
+
/** Whether a value is required on save. Optional. */
|
|
374
439
|
required?: boolean;
|
|
375
440
|
}
|
|
376
|
-
/** Dropdown select. */
|
|
441
|
+
/** Dropdown single-select field. */
|
|
377
442
|
export class SelectField extends Field {
|
|
378
443
|
constructor(customObject: CustomObject, props: SelectFieldProps) {
|
|
379
444
|
super(customObject, { ...props, fieldType: 'SELECT' });
|
|
380
445
|
}
|
|
381
446
|
}
|
|
382
447
|
|
|
448
|
+
/** Initialization properties for {@link RadioField}. */
|
|
383
449
|
export interface RadioFieldProps extends CommonFieldProps {
|
|
384
|
-
/**
|
|
450
|
+
/**
|
|
451
|
+
* The list of selectable options.
|
|
452
|
+
*
|
|
453
|
+
* Required.
|
|
454
|
+
*/
|
|
385
455
|
options: string[];
|
|
456
|
+
/** Whether a value is required on save. Optional. */
|
|
386
457
|
required?: boolean;
|
|
387
458
|
}
|
|
388
|
-
/** Radio button group. */
|
|
459
|
+
/** Radio button group field. */
|
|
389
460
|
export class RadioField extends Field {
|
|
390
461
|
constructor(customObject: CustomObject, props: RadioFieldProps) {
|
|
391
462
|
super(customObject, { ...props, fieldType: 'RADIO' });
|
|
392
463
|
}
|
|
393
464
|
}
|
|
394
465
|
|
|
466
|
+
/** Initialization properties for {@link BooleanField}. */
|
|
395
467
|
export interface BooleanFieldProps extends CommonFieldProps {
|
|
468
|
+
/** Whether a value is required on save. Optional. */
|
|
396
469
|
required?: boolean;
|
|
397
470
|
}
|
|
398
|
-
/** Boolean (checkbox). */
|
|
471
|
+
/** Boolean (checkbox) field. */
|
|
399
472
|
export class BooleanField extends Field {
|
|
400
473
|
constructor(customObject: CustomObject, props: BooleanFieldProps) {
|
|
401
474
|
super(customObject, { ...props, fieldType: 'BOOLEAN' });
|
|
@@ -404,17 +477,21 @@ export class BooleanField extends Field {
|
|
|
404
477
|
|
|
405
478
|
// ── File ───────────────────────────────────────────────────────────────
|
|
406
479
|
|
|
480
|
+
/** Initialization properties for {@link FileField}. */
|
|
407
481
|
export interface FileFieldProps extends CommonFieldProps {
|
|
408
482
|
/**
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
483
|
+
* Restricts which file types can be uploaded. Mirrors the UI's "File type" dropdown.
|
|
484
|
+
*
|
|
485
|
+
* Required.
|
|
486
|
+
* - `'images'` — jpg, jpeg, png, gif, bmp, svg
|
|
487
|
+
* - `'documents'` — doc, docx, pdf, csv, txt, rtf, ppt, pptx
|
|
488
|
+
* - `'any'` — any file type
|
|
413
489
|
*/
|
|
414
490
|
allowedType: 'images' | 'documents' | 'any';
|
|
491
|
+
/** Whether a file is required on save. Optional. */
|
|
415
492
|
required?: boolean;
|
|
416
493
|
}
|
|
417
|
-
/** File attachment
|
|
494
|
+
/** File attachment field. */
|
|
418
495
|
export class FileField extends Field {
|
|
419
496
|
constructor(customObject: CustomObject, props: FileFieldProps) {
|
|
420
497
|
const { allowedType, ...rest } = props;
|
|
@@ -429,13 +506,31 @@ export class FileField extends Field {
|
|
|
429
506
|
|
|
430
507
|
// ── Relational ─────────────────────────────────────────────────────────
|
|
431
508
|
|
|
509
|
+
/** Initialization properties for {@link LookupField}. */
|
|
432
510
|
export interface LookupFieldProps extends CommonFieldProps {
|
|
433
|
-
/**
|
|
511
|
+
/**
|
|
512
|
+
* The object this field points to. Pass a live {@link CustomObject} instance,
|
|
513
|
+
* or a raw api_name string for native Rippling models (e.g. `'role'`).
|
|
514
|
+
*
|
|
515
|
+
* Required.
|
|
516
|
+
*/
|
|
434
517
|
target: CustomObject | string;
|
|
518
|
+
/**
|
|
519
|
+
* Label for the related-records panel on the target object's detail page
|
|
520
|
+
* (e.g. `'Class enrollments'`).
|
|
521
|
+
*
|
|
522
|
+
* Optional.
|
|
523
|
+
*/
|
|
435
524
|
relatedDataLabel?: string;
|
|
525
|
+
/** Whether a value is required on save. Optional. */
|
|
436
526
|
required?: boolean;
|
|
437
527
|
}
|
|
438
|
-
/**
|
|
528
|
+
/**
|
|
529
|
+
* Many-to-one reference field. Links this record to one record on the target object.
|
|
530
|
+
*
|
|
531
|
+
* Use {@link ParentChildField} instead when the relationship should create a
|
|
532
|
+
* parent-child hierarchy with rollup support.
|
|
533
|
+
*/
|
|
439
534
|
export class LookupField extends Field {
|
|
440
535
|
constructor(customObject: CustomObject, props: LookupFieldProps) {
|
|
441
536
|
const targetApiName = typeof props.target === 'string' ? props.target : props.target.getApiName();
|
|
@@ -455,14 +550,42 @@ export class LookupField extends Field {
|
|
|
455
550
|
}
|
|
456
551
|
}
|
|
457
552
|
|
|
553
|
+
/** Initialization properties for {@link ParentChildField}. */
|
|
458
554
|
export interface ParentChildFieldProps extends CommonFieldProps {
|
|
459
|
-
/**
|
|
555
|
+
/**
|
|
556
|
+
* The parent object. Must be a live {@link CustomObject} instance.
|
|
557
|
+
*
|
|
558
|
+
* Required.
|
|
559
|
+
*/
|
|
460
560
|
target: CustomObject;
|
|
561
|
+
/**
|
|
562
|
+
* Label for the child-records panel on the parent's detail page
|
|
563
|
+
* (e.g. `'Enrollments'`).
|
|
564
|
+
*
|
|
565
|
+
* Optional.
|
|
566
|
+
*/
|
|
461
567
|
relatedDataLabel?: string;
|
|
568
|
+
/**
|
|
569
|
+
* Whether this is the primary or secondary parent-child edge.
|
|
570
|
+
* One of `'PRIMARY'` | `'SECONDARY'`.
|
|
571
|
+
*
|
|
572
|
+
* Optional.
|
|
573
|
+
*/
|
|
462
574
|
parentChildType?: 'PRIMARY' | 'SECONDARY';
|
|
575
|
+
/**
|
|
576
|
+
* Whether the child record inherits the owner from the parent.
|
|
577
|
+
*
|
|
578
|
+
* Optional.
|
|
579
|
+
*/
|
|
463
580
|
enableParentOwnerInheritance?: boolean;
|
|
464
581
|
}
|
|
465
|
-
/**
|
|
582
|
+
/**
|
|
583
|
+
* Parent-child reference field. Creates a hierarchical relationship between
|
|
584
|
+
* this object (child) and the target (parent), enabling {@link SummaryField}
|
|
585
|
+
* rollups from the child to the parent.
|
|
586
|
+
*
|
|
587
|
+
* Always emitted as `required: true` on the wire.
|
|
588
|
+
*/
|
|
466
589
|
export class ParentChildField extends Field {
|
|
467
590
|
constructor(customObject: CustomObject, props: ParentChildFieldProps) {
|
|
468
591
|
super(customObject, {
|
|
@@ -487,18 +610,45 @@ export class ParentChildField extends Field {
|
|
|
487
610
|
|
|
488
611
|
// ── Computed ───────────────────────────────────────────────────────────
|
|
489
612
|
|
|
613
|
+
/** Initialization properties for {@link FormulaField}. */
|
|
490
614
|
export interface FormulaFieldProps extends CommonFieldProps {
|
|
491
|
-
/**
|
|
615
|
+
/**
|
|
616
|
+
* The RQL expression that computes this field's value
|
|
617
|
+
* (e.g. `"CONCATENATE(TRIM(first_name__c), ' ', TRIM(last_name__c))"`).
|
|
618
|
+
*
|
|
619
|
+
* Required.
|
|
620
|
+
*/
|
|
492
621
|
formula: string;
|
|
493
|
-
/**
|
|
622
|
+
/**
|
|
623
|
+
* Output data type. One of `'TEXT'` | `'NUMBER'` | `'BOOLEAN'` | `'CURRENCY'`
|
|
624
|
+
* | `'PERCENTAGE'` | `'DATE'` | `'URL'`.
|
|
625
|
+
*
|
|
626
|
+
* Required.
|
|
627
|
+
*/
|
|
494
628
|
fieldType: FormulaFieldType;
|
|
495
|
-
/**
|
|
629
|
+
/**
|
|
630
|
+
* Maximum character length of the computed value.
|
|
631
|
+
*
|
|
632
|
+
* Required when `fieldType === 'TEXT'`. The constructor throws if omitted for text formulas.
|
|
633
|
+
*/
|
|
496
634
|
maxLength?: number;
|
|
497
635
|
}
|
|
498
636
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* required
|
|
637
|
+
* Read-only computed field whose value is derived from an RQL formula.
|
|
638
|
+
*
|
|
639
|
+
* `fieldType` is required and restricted to the 7 output types the Rippling
|
|
640
|
+
* formula editor supports. `maxLength` is required when `fieldType === 'TEXT'`.
|
|
641
|
+
*
|
|
642
|
+
* @example
|
|
643
|
+
* ```ts
|
|
644
|
+
* const memberDisplayName = new FormulaField(memberObj, {
|
|
645
|
+
* apiName: 'member_display_name__c',
|
|
646
|
+
* displayName: 'Display name',
|
|
647
|
+
* fieldType: 'TEXT',
|
|
648
|
+
* maxLength: 200,
|
|
649
|
+
* formula: "CONCATENATE(TRIM(first_name__c), ' ', TRIM(last_name__c))",
|
|
650
|
+
* });
|
|
651
|
+
* ```
|
|
502
652
|
*/
|
|
503
653
|
export class FormulaField extends Field {
|
|
504
654
|
constructor(customObject: CustomObject, props: FormulaFieldProps) {
|
|
@@ -516,22 +666,62 @@ export class FormulaField extends Field {
|
|
|
516
666
|
}
|
|
517
667
|
}
|
|
518
668
|
|
|
669
|
+
/** Initialization properties for {@link SummaryField}. */
|
|
519
670
|
export interface SummaryFieldProps extends CommonFieldProps {
|
|
520
|
-
/**
|
|
671
|
+
/**
|
|
672
|
+
* The child-CO field whose values are aggregated.
|
|
673
|
+
*
|
|
674
|
+
* Required. Must have a known `fieldType` (use a typed subclass, not bare `Field`).
|
|
675
|
+
* Must live on the same child object as `lookup`.
|
|
676
|
+
*/
|
|
521
677
|
aggregates: Field;
|
|
678
|
+
/**
|
|
679
|
+
* Aggregation function. One of `'COUNT'` | `'SUM'` | `'MIN'` | `'MAX'`.
|
|
680
|
+
*
|
|
681
|
+
* Required. `COUNT` always produces a `NUMBER` output; other functions
|
|
682
|
+
* inherit the output type from `aggregates`.
|
|
683
|
+
*/
|
|
522
684
|
using: SummaryAggregation;
|
|
523
|
-
/**
|
|
685
|
+
/**
|
|
686
|
+
* The {@link ParentChildField} on the child CO that points back at this parent object.
|
|
687
|
+
*
|
|
688
|
+
* Required. Must be a `ParentChildField` (the constructor throws otherwise).
|
|
689
|
+
*/
|
|
524
690
|
lookup: Field;
|
|
691
|
+
/**
|
|
692
|
+
* Optional filter conditions applied before aggregating. Each filter restricts
|
|
693
|
+
* which child records are included.
|
|
694
|
+
*
|
|
695
|
+
* Optional. @default `[]`
|
|
696
|
+
*/
|
|
525
697
|
filters?: SummaryFilter[];
|
|
526
|
-
/**
|
|
698
|
+
/**
|
|
699
|
+
* ISO 4217 currency code (e.g. `'USD'`). Only valid when the aggregated field
|
|
700
|
+
* resolves to `'CURRENCY'`.
|
|
701
|
+
*
|
|
702
|
+
* Optional.
|
|
703
|
+
*/
|
|
527
704
|
currencyCode?: string;
|
|
528
705
|
}
|
|
529
706
|
/**
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
*
|
|
707
|
+
* Read-only rollup field that aggregates a child object's field values.
|
|
708
|
+
*
|
|
709
|
+
* Defined on the **parent** object. Requires a {@link ParentChildField} on the
|
|
710
|
+
* child object pointing back at this parent as the `lookup` edge.
|
|
711
|
+
*
|
|
712
|
+
* @example
|
|
713
|
+
* ```ts
|
|
714
|
+
* // Count enrollments on a class session:
|
|
715
|
+
* const enrollmentCount = new SummaryField(sessionObj, {
|
|
716
|
+
* apiName: 'enrollment_count__c',
|
|
717
|
+
* displayName: 'Enrolled (count)',
|
|
718
|
+
* aggregates: enrollmentMemberRef,
|
|
719
|
+
* using: 'COUNT',
|
|
720
|
+
* lookup: enrollmentSessionRef, // ParentChildField on enrollmentObj → sessionObj
|
|
721
|
+
* });
|
|
722
|
+
* ```
|
|
723
|
+
*
|
|
724
|
+
* @see {@link ParentChildField} — must be used as `lookup`.
|
|
535
725
|
*/
|
|
536
726
|
export class SummaryField extends Field {
|
|
537
727
|
constructor(customObject: CustomObject, props: SummaryFieldProps) {
|