@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-view.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/list-view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-view.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/list-view.ts"],"names":[],"mappings":"OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE;OAChD,KAAK,EAAE,YAAY,EAAE;OACrB,KAAK,EAAE,KAAK,EAAE;AAErB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAwB;IACnD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0B;IACvD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqB;IAClD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkC;IAChE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAEhD;;;;OAIG;gBACS,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;IAsB/D;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAIhC;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAiB9B"}
|
|
@@ -1,19 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* The contents of this file were inserted manually and are not generated by Stainless.
|
|
4
|
-
*
|
|
5
|
-
* List view definitions for custom objects (column layout + sorting).
|
|
6
|
-
* Backend schema: CUSTOM_OBJECT_LIST_VIEW (v2)
|
|
7
|
-
*
|
|
8
|
-
* Construction is CDK-style: `new ListViewDef(customObject, props)` — the
|
|
9
|
-
* CO is the first positional arg, and the view auto-registers with the
|
|
10
|
-
* manifest via the CO's scope chain.
|
|
11
|
-
*/
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
3
|
exports.ListViewDef = void 0;
|
|
14
4
|
const _helpers_1 = require("./_helpers.js");
|
|
5
|
+
/**
|
|
6
|
+
* Defines a list view and registers it with the manifest.
|
|
7
|
+
*
|
|
8
|
+
* A list view defines which fields appear as columns, their sort order, and an
|
|
9
|
+
* optional RQL filter. You can define multiple views per custom object; each
|
|
10
|
+
* appears as a selectable view in the object's list page.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* new ListViewDef(memberObj, {
|
|
15
|
+
* viewId: 'view_gym_all_members',
|
|
16
|
+
* name: 'All members',
|
|
17
|
+
* description: 'Directory with membership status',
|
|
18
|
+
* fields: [memberDisplayName, memberEmail, memberPhone, memberStatusField, memberJoinDate],
|
|
19
|
+
* orderBy: memberLastName,
|
|
20
|
+
* sortOrder: 'ASC',
|
|
21
|
+
* isPublic: true,
|
|
22
|
+
* objectScope: 'all',
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Filtered view example:
|
|
26
|
+
* new ListViewDef(sessionObj, {
|
|
27
|
+
* viewId: 'view_gym_today_sessions',
|
|
28
|
+
* name: 'Today\'s class sessions',
|
|
29
|
+
* fields: [sessionTrainerRef, sessionStartField, sessionClassTypeField],
|
|
30
|
+
* orderBy: sessionStartField,
|
|
31
|
+
* sortOrder: 'ASC',
|
|
32
|
+
* isPublic: true,
|
|
33
|
+
* objectScope: 'all',
|
|
34
|
+
* rqlFilter: '(session_date__c == TODAY())',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
15
38
|
class ListViewDef {
|
|
16
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @param customObject - The custom object this view belongs to.
|
|
41
|
+
* @param props - Initialization properties.
|
|
42
|
+
* @throws {Error} If `name` is empty, `fields` is empty, or `sortOrder` is set without `orderBy`.
|
|
43
|
+
*/
|
|
17
44
|
constructor(customObject, props) {
|
|
18
45
|
if (!props.name)
|
|
19
46
|
throw new Error('ListViewDef: name cannot be empty');
|
|
@@ -36,15 +63,24 @@ class ListViewDef {
|
|
|
36
63
|
this._rqlFilter = props.rqlFilter;
|
|
37
64
|
customObject._register(this);
|
|
38
65
|
}
|
|
39
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Returns the stable identifier for this view (e.g. `'view_gym_all_members'`).
|
|
68
|
+
*/
|
|
40
69
|
getViewId() {
|
|
41
70
|
return this._viewId;
|
|
42
71
|
}
|
|
43
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Returns the api_name of the custom object this view belongs to.
|
|
74
|
+
*/
|
|
44
75
|
getCustomObjectApiName() {
|
|
45
76
|
return this._customObjectApiName;
|
|
46
77
|
}
|
|
47
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Serializes this list view to the wire format consumed by the manifest install endpoint.
|
|
80
|
+
*
|
|
81
|
+
* @returns A plain object with `type: 'CUSTOM_OBJECT_LIST_VIEW'`.
|
|
82
|
+
* Optional fields are omitted when unset.
|
|
83
|
+
*/
|
|
48
84
|
toDict() {
|
|
49
85
|
const d = {
|
|
50
86
|
type: 'CUSTOM_OBJECT_LIST_VIEW',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-view.js","sourceRoot":"","sources":["../../src/lib/manifest/list-view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-view.js","sourceRoot":"","sources":["../../src/lib/manifest/list-view.ts"],"names":[],"mappings":";;;AAAA,4CAA0E;AAwE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAa,WAAW;IAatB;;;;OAIG;IACH,YAAY,YAA0B,EAAE,KAAuB;QAC7D,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACtE,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,KAAK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AAI,CAAC,KAAK;YAChB,MAAM,EAAE,IAAI,CAAC,SAAS;YACtB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;SAChD,CAAC;QACF,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI;YAAE,CAAC,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACpE,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI;YAAE,CAAC,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACrE,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI;YAAE,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAC/D,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI;YAAE,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtE,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI;YAAE,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QACxE,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI;YAAE,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAC/D,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AA7ED,kCA6EC"}
|
|
@@ -1,16 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { generateId } from "./_helpers.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Defines a list view and registers it with the manifest.
|
|
4
|
+
*
|
|
5
|
+
* A list view defines which fields appear as columns, their sort order, and an
|
|
6
|
+
* optional RQL filter. You can define multiple views per custom object; each
|
|
7
|
+
* appears as a selectable view in the object's list page.
|
|
3
8
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* new ListViewDef(memberObj, {
|
|
12
|
+
* viewId: 'view_gym_all_members',
|
|
13
|
+
* name: 'All members',
|
|
14
|
+
* description: 'Directory with membership status',
|
|
15
|
+
* fields: [memberDisplayName, memberEmail, memberPhone, memberStatusField, memberJoinDate],
|
|
16
|
+
* orderBy: memberLastName,
|
|
17
|
+
* sortOrder: 'ASC',
|
|
18
|
+
* isPublic: true,
|
|
19
|
+
* objectScope: 'all',
|
|
20
|
+
* });
|
|
6
21
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
22
|
+
* // Filtered view example:
|
|
23
|
+
* new ListViewDef(sessionObj, {
|
|
24
|
+
* viewId: 'view_gym_today_sessions',
|
|
25
|
+
* name: 'Today\'s class sessions',
|
|
26
|
+
* fields: [sessionTrainerRef, sessionStartField, sessionClassTypeField],
|
|
27
|
+
* orderBy: sessionStartField,
|
|
28
|
+
* sortOrder: 'ASC',
|
|
29
|
+
* isPublic: true,
|
|
30
|
+
* objectScope: 'all',
|
|
31
|
+
* rqlFilter: '(session_date__c == TODAY())',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
10
34
|
*/
|
|
11
|
-
import { generateId } from "./_helpers.mjs";
|
|
12
35
|
export class ListViewDef {
|
|
13
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @param customObject - The custom object this view belongs to.
|
|
38
|
+
* @param props - Initialization properties.
|
|
39
|
+
* @throws {Error} If `name` is empty, `fields` is empty, or `sortOrder` is set without `orderBy`.
|
|
40
|
+
*/
|
|
14
41
|
constructor(customObject, props) {
|
|
15
42
|
if (!props.name)
|
|
16
43
|
throw new Error('ListViewDef: name cannot be empty');
|
|
@@ -33,15 +60,24 @@ export class ListViewDef {
|
|
|
33
60
|
this._rqlFilter = props.rqlFilter;
|
|
34
61
|
customObject._register(this);
|
|
35
62
|
}
|
|
36
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Returns the stable identifier for this view (e.g. `'view_gym_all_members'`).
|
|
65
|
+
*/
|
|
37
66
|
getViewId() {
|
|
38
67
|
return this._viewId;
|
|
39
68
|
}
|
|
40
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Returns the api_name of the custom object this view belongs to.
|
|
71
|
+
*/
|
|
41
72
|
getCustomObjectApiName() {
|
|
42
73
|
return this._customObjectApiName;
|
|
43
74
|
}
|
|
44
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* Serializes this list view to the wire format consumed by the manifest install endpoint.
|
|
77
|
+
*
|
|
78
|
+
* @returns A plain object with `type: 'CUSTOM_OBJECT_LIST_VIEW'`.
|
|
79
|
+
* Optional fields are omitted when unset.
|
|
80
|
+
*/
|
|
45
81
|
toDict() {
|
|
46
82
|
const d = {
|
|
47
83
|
type: 'CUSTOM_OBJECT_LIST_VIEW',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-view.mjs","sourceRoot":"","sources":["../../src/lib/manifest/list-view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-view.mjs","sourceRoot":"","sources":["../../src/lib/manifest/list-view.ts"],"names":[],"mappings":"OAAO,EAAE,UAAU,EAAoC;AAwEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,WAAW;IAatB;;;;OAIG;IACH,YAAY,YAA0B,EAAE,KAAuB;QAC7D,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACtE,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,CAAC,OAAO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AAY,IAAI,IAAI;YAAE,CAAC,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACpE,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI;YAAE,CAAC,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACrE,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI;YAAE,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAC/D,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI;YAAE,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtE,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI;YAAE,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QACxE,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI;YAAE,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAC/D,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1,44 +1,110 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Any object that can be included in a manifest.
|
|
3
|
+
*
|
|
4
|
+
* Implement `toDict()` to return the component's wire-format dict.
|
|
5
|
+
* All built-in SDK classes implement this interface automatically.
|
|
6
|
+
*/
|
|
2
7
|
export interface ManifestComponent {
|
|
3
8
|
toDict(): Record<string, any>;
|
|
4
9
|
}
|
|
5
10
|
/**
|
|
6
|
-
* A scope — anything that can accept
|
|
7
|
-
*
|
|
8
|
-
*
|
|
11
|
+
* A scope — anything that can accept child component registrations.
|
|
12
|
+
*
|
|
13
|
+
* Implemented by {@link ManifestBuilder} (the root) and by nestable parents
|
|
14
|
+
* like `CustomObject` that forward registrations up to the builder.
|
|
15
|
+
* Pass a scope as the first argument when constructing any manifest component.
|
|
9
16
|
*/
|
|
10
17
|
export interface ManifestScope {
|
|
11
18
|
/** @internal Register a child component; builder-bound scopes forward up. */
|
|
12
19
|
_register(component: ManifestComponent): void;
|
|
13
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Initialization properties for {@link ManifestBuilder}.
|
|
23
|
+
*/
|
|
14
24
|
export interface ManifestBuilderProps {
|
|
15
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Unique project key for this manifest (e.g. `'gym_membership_management'`).
|
|
27
|
+
*
|
|
28
|
+
* Required.
|
|
29
|
+
*/
|
|
16
30
|
key: string;
|
|
17
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Display name for this manifest.
|
|
33
|
+
*
|
|
34
|
+
* Optional. Defaults to `key` when not provided.
|
|
35
|
+
*/
|
|
18
36
|
name?: string;
|
|
19
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Human-readable description of what this manifest contains.
|
|
39
|
+
*
|
|
40
|
+
* Optional.
|
|
41
|
+
*/
|
|
20
42
|
description?: string;
|
|
21
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Root container for a manifest — collects all components and serializes them to JSON.
|
|
46
|
+
*
|
|
47
|
+
* You would normally create one `ManifestBuilder` at the top of your manifest file,
|
|
48
|
+
* then pass it as the scope to all top-level components (categories, custom objects,
|
|
49
|
+
* functions, apps, SDUI pages). Each component auto-registers on construction; there
|
|
50
|
+
* is no separate add or register call.
|
|
51
|
+
*
|
|
52
|
+
* After defining all components, call `preview()` to emit the manifest as a
|
|
53
|
+
* pretty-printed JSON string, or `buildManifest()` to get the plain object.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const manifest = new ManifestBuilder({
|
|
58
|
+
* key: 'gym_membership_management',
|
|
59
|
+
* name: 'Gym Membership Management',
|
|
60
|
+
* description: 'Members, trainers, schedules, and check-in',
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* const category = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
|
|
64
|
+
* const memberObj = new CustomObject(manifest, { apiName: 'gym_member__c', name: 'Member', category });
|
|
65
|
+
* // ... define fields, rules, list views, etc. ...
|
|
66
|
+
*
|
|
67
|
+
* console.log(manifest.preview());
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
22
70
|
export declare class ManifestBuilder implements ManifestScope {
|
|
23
71
|
readonly key: string;
|
|
24
72
|
readonly name: string;
|
|
25
73
|
readonly description: string;
|
|
26
74
|
private readonly _components;
|
|
27
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* @param props - Initialization properties.
|
|
77
|
+
* @throws {Error} If `props.key` is empty or missing.
|
|
78
|
+
*/
|
|
28
79
|
constructor(props: ManifestBuilderProps);
|
|
29
80
|
/**
|
|
30
81
|
* @internal Scope hook invoked by child constructors. Components enter the
|
|
31
82
|
* manifest here — there is no other path.
|
|
32
83
|
*/
|
|
33
84
|
_register(component: ManifestComponent): void;
|
|
34
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Returns the manifest as a plain object with `metadata` and a flat `components` array.
|
|
87
|
+
*
|
|
88
|
+
* @returns `{ metadata: { key, name, description? }, components: Record<string, any>[] }`
|
|
89
|
+
*/
|
|
35
90
|
buildManifest(): {
|
|
36
91
|
metadata: Record<string, any>;
|
|
37
92
|
components: Record<string, any>[];
|
|
38
93
|
};
|
|
39
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Returns the flat list of all registered component dicts.
|
|
96
|
+
*
|
|
97
|
+
* @returns An array of wire-format component objects, in registration order.
|
|
98
|
+
*/
|
|
40
99
|
componentsList(): Record<string, any>[];
|
|
41
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Returns the full manifest as a pretty-printed JSON string.
|
|
102
|
+
*
|
|
103
|
+
* Typically used as the final line of a manifest file to emit the output:
|
|
104
|
+
* `console.log(manifest.preview())`.
|
|
105
|
+
*
|
|
106
|
+
* @returns Indented JSON string of the complete manifest.
|
|
107
|
+
*/
|
|
42
108
|
preview(): string;
|
|
43
109
|
}
|
|
44
110
|
//# sourceMappingURL=manifest-builder.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-builder.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-builder.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,eAAgB,YAAW,aAAa;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2B;IAEvD;;;OAGG;gBACS,KAAK,EAAE,oBAAoB;IASvC;;;OAGG;IACH,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;IAO7C;;;;OAIG;IACH,aAAa,IAAI;QAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE;IAYrF;;;;OAIG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;IAIvC;;;;;;;OAOG;IACH,OAAO,IAAI,MAAM;CAGlB"}
|
|
@@ -1,44 +1,110 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Any object that can be included in a manifest.
|
|
3
|
+
*
|
|
4
|
+
* Implement `toDict()` to return the component's wire-format dict.
|
|
5
|
+
* All built-in SDK classes implement this interface automatically.
|
|
6
|
+
*/
|
|
2
7
|
export interface ManifestComponent {
|
|
3
8
|
toDict(): Record<string, any>;
|
|
4
9
|
}
|
|
5
10
|
/**
|
|
6
|
-
* A scope — anything that can accept
|
|
7
|
-
*
|
|
8
|
-
*
|
|
11
|
+
* A scope — anything that can accept child component registrations.
|
|
12
|
+
*
|
|
13
|
+
* Implemented by {@link ManifestBuilder} (the root) and by nestable parents
|
|
14
|
+
* like `CustomObject` that forward registrations up to the builder.
|
|
15
|
+
* Pass a scope as the first argument when constructing any manifest component.
|
|
9
16
|
*/
|
|
10
17
|
export interface ManifestScope {
|
|
11
18
|
/** @internal Register a child component; builder-bound scopes forward up. */
|
|
12
19
|
_register(component: ManifestComponent): void;
|
|
13
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Initialization properties for {@link ManifestBuilder}.
|
|
23
|
+
*/
|
|
14
24
|
export interface ManifestBuilderProps {
|
|
15
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Unique project key for this manifest (e.g. `'gym_membership_management'`).
|
|
27
|
+
*
|
|
28
|
+
* Required.
|
|
29
|
+
*/
|
|
16
30
|
key: string;
|
|
17
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Display name for this manifest.
|
|
33
|
+
*
|
|
34
|
+
* Optional. Defaults to `key` when not provided.
|
|
35
|
+
*/
|
|
18
36
|
name?: string;
|
|
19
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Human-readable description of what this manifest contains.
|
|
39
|
+
*
|
|
40
|
+
* Optional.
|
|
41
|
+
*/
|
|
20
42
|
description?: string;
|
|
21
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Root container for a manifest — collects all components and serializes them to JSON.
|
|
46
|
+
*
|
|
47
|
+
* You would normally create one `ManifestBuilder` at the top of your manifest file,
|
|
48
|
+
* then pass it as the scope to all top-level components (categories, custom objects,
|
|
49
|
+
* functions, apps, SDUI pages). Each component auto-registers on construction; there
|
|
50
|
+
* is no separate add or register call.
|
|
51
|
+
*
|
|
52
|
+
* After defining all components, call `preview()` to emit the manifest as a
|
|
53
|
+
* pretty-printed JSON string, or `buildManifest()` to get the plain object.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const manifest = new ManifestBuilder({
|
|
58
|
+
* key: 'gym_membership_management',
|
|
59
|
+
* name: 'Gym Membership Management',
|
|
60
|
+
* description: 'Members, trainers, schedules, and check-in',
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* const category = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
|
|
64
|
+
* const memberObj = new CustomObject(manifest, { apiName: 'gym_member__c', name: 'Member', category });
|
|
65
|
+
* // ... define fields, rules, list views, etc. ...
|
|
66
|
+
*
|
|
67
|
+
* console.log(manifest.preview());
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
22
70
|
export declare class ManifestBuilder implements ManifestScope {
|
|
23
71
|
readonly key: string;
|
|
24
72
|
readonly name: string;
|
|
25
73
|
readonly description: string;
|
|
26
74
|
private readonly _components;
|
|
27
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* @param props - Initialization properties.
|
|
77
|
+
* @throws {Error} If `props.key` is empty or missing.
|
|
78
|
+
*/
|
|
28
79
|
constructor(props: ManifestBuilderProps);
|
|
29
80
|
/**
|
|
30
81
|
* @internal Scope hook invoked by child constructors. Components enter the
|
|
31
82
|
* manifest here — there is no other path.
|
|
32
83
|
*/
|
|
33
84
|
_register(component: ManifestComponent): void;
|
|
34
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Returns the manifest as a plain object with `metadata` and a flat `components` array.
|
|
87
|
+
*
|
|
88
|
+
* @returns `{ metadata: { key, name, description? }, components: Record<string, any>[] }`
|
|
89
|
+
*/
|
|
35
90
|
buildManifest(): {
|
|
36
91
|
metadata: Record<string, any>;
|
|
37
92
|
components: Record<string, any>[];
|
|
38
93
|
};
|
|
39
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Returns the flat list of all registered component dicts.
|
|
96
|
+
*
|
|
97
|
+
* @returns An array of wire-format component objects, in registration order.
|
|
98
|
+
*/
|
|
40
99
|
componentsList(): Record<string, any>[];
|
|
41
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Returns the full manifest as a pretty-printed JSON string.
|
|
102
|
+
*
|
|
103
|
+
* Typically used as the final line of a manifest file to emit the output:
|
|
104
|
+
* `console.log(manifest.preview())`.
|
|
105
|
+
*
|
|
106
|
+
* @returns Indented JSON string of the complete manifest.
|
|
107
|
+
*/
|
|
42
108
|
preview(): string;
|
|
43
109
|
}
|
|
44
110
|
//# sourceMappingURL=manifest-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-builder.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-builder.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,eAAgB,YAAW,aAAa;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2B;IAEvD;;;OAGG;gBACS,KAAK,EAAE,oBAAoB;IASvC;;;OAGG;IACH,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;IAO7C;;;;OAIG;IACH,aAAa,IAAI;QAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE;IAYrF;;;;OAIG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;IAIvC;;;;;;;OAOG;IACH,OAAO,IAAI,MAAM;CAGlB"}
|
|
@@ -1,30 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManifestBuilder = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Root container for a manifest — collects all components and serializes them to JSON.
|
|
6
|
+
*
|
|
7
|
+
* You would normally create one `ManifestBuilder` at the top of your manifest file,
|
|
8
|
+
* then pass it as the scope to all top-level components (categories, custom objects,
|
|
9
|
+
* functions, apps, SDUI pages). Each component auto-registers on construction; there
|
|
10
|
+
* is no separate add or register call.
|
|
11
|
+
*
|
|
12
|
+
* After defining all components, call `preview()` to emit the manifest as a
|
|
13
|
+
* pretty-printed JSON string, or `buildManifest()` to get the plain object.
|
|
4
14
|
*
|
|
5
|
-
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const manifest = new ManifestBuilder({
|
|
18
|
+
* key: 'gym_membership_management',
|
|
19
|
+
* name: 'Gym Membership Management',
|
|
20
|
+
* description: 'Members, trainers, schedules, and check-in',
|
|
21
|
+
* });
|
|
6
22
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `CustomObject` / `CustomObjectFieldSection` for nested children.
|
|
11
|
-
* - Constructing a component auto-registers it with the builder via the
|
|
12
|
-
* scope's `_register` hook. There is no public `addComponent` — the
|
|
13
|
-
* only way a component enters the manifest is by being constructed
|
|
14
|
-
* with a scope that forwards up to this builder.
|
|
15
|
-
* - The builder does not walk into components; each component emits the
|
|
16
|
-
* foreign-key fields (`custom_object_api_name`, `model_rql_name`, ...)
|
|
17
|
-
* itself in `toDict()`.
|
|
23
|
+
* const category = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
|
|
24
|
+
* const memberObj = new CustomObject(manifest, { apiName: 'gym_member__c', name: 'Member', category });
|
|
25
|
+
* // ... define fields, rules, list views, etc. ...
|
|
18
26
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - buildManifest() — return the manifest as a plain object
|
|
22
|
-
* - componentsList() — return the flat list of component dicts
|
|
27
|
+
* console.log(manifest.preview());
|
|
28
|
+
* ```
|
|
23
29
|
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ManifestBuilder = void 0;
|
|
26
30
|
class ManifestBuilder {
|
|
27
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @param props - Initialization properties.
|
|
33
|
+
* @throws {Error} If `props.key` is empty or missing.
|
|
34
|
+
*/
|
|
28
35
|
constructor(props) {
|
|
29
36
|
this._components = [];
|
|
30
37
|
if (!props.key) {
|
|
@@ -44,7 +51,11 @@ class ManifestBuilder {
|
|
|
44
51
|
}
|
|
45
52
|
this._components.push(component);
|
|
46
53
|
}
|
|
47
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Returns the manifest as a plain object with `metadata` and a flat `components` array.
|
|
56
|
+
*
|
|
57
|
+
* @returns `{ metadata: { key, name, description? }, components: Record<string, any>[] }`
|
|
58
|
+
*/
|
|
48
59
|
buildManifest() {
|
|
49
60
|
const metadata = {
|
|
50
61
|
key: this.key,
|
|
@@ -56,11 +67,22 @@ class ManifestBuilder {
|
|
|
56
67
|
const components = this._components.map((c) => c.toDict());
|
|
57
68
|
return { metadata, components };
|
|
58
69
|
}
|
|
59
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Returns the flat list of all registered component dicts.
|
|
72
|
+
*
|
|
73
|
+
* @returns An array of wire-format component objects, in registration order.
|
|
74
|
+
*/
|
|
60
75
|
componentsList() {
|
|
61
76
|
return this._components.map((c) => c.toDict());
|
|
62
77
|
}
|
|
63
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Returns the full manifest as a pretty-printed JSON string.
|
|
80
|
+
*
|
|
81
|
+
* Typically used as the final line of a manifest file to emit the output:
|
|
82
|
+
* `console.log(manifest.preview())`.
|
|
83
|
+
*
|
|
84
|
+
* @returns Indented JSON string of the complete manifest.
|
|
85
|
+
*/
|
|
64
86
|
preview() {
|
|
65
87
|
return JSON.stringify(this.buildManifest(), null, 2);
|
|
66
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-builder.js","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"manifest-builder.js","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":";;;AA8CA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,eAAe;IAM1B;;;OAGG;IACH,YAAY,KAA2B;QANtB,gBAAW,GAAwB,EAAE,CAAC;QAOrD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;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