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