@rippling/rippling-sdk 0.2.0-alpha.38 → 0.2.0-alpha.39
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 +11 -1
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +11 -1
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +42 -1
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +42 -1
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/category.d.mts +10 -1
- package/lib/manifest/category.d.mts.map +1 -1
- package/lib/manifest/category.d.ts +10 -1
- package/lib/manifest/category.d.ts.map +1 -1
- package/lib/manifest/category.js +23 -1
- package/lib/manifest/category.js.map +1 -1
- package/lib/manifest/category.mjs +23 -1
- package/lib/manifest/category.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts +13 -0
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
- package/lib/manifest/custom-object-field-section.d.ts +13 -0
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
- package/lib/manifest/custom-object-field-section.js +22 -1
- package/lib/manifest/custom-object-field-section.js.map +1 -1
- package/lib/manifest/custom-object-field-section.mjs +22 -1
- package/lib/manifest/custom-object-field-section.mjs.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.mts +21 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +21 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +41 -1
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +41 -1
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +11 -1
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +11 -1
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +55 -2
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +55 -2
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/existing-manifest-context.d.mts +87 -0
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -0
- package/lib/manifest/existing-manifest-context.d.ts +87 -0
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -0
- package/lib/manifest/existing-manifest-context.js +511 -0
- package/lib/manifest/existing-manifest-context.js.map +1 -0
- package/lib/manifest/existing-manifest-context.mjs +506 -0
- package/lib/manifest/existing-manifest-context.mjs.map +1 -0
- package/lib/manifest/field.d.mts +24 -0
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +24 -0
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +114 -1
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +114 -1
- package/lib/manifest/field.mjs.map +1 -1
- package/lib/manifest/index.d.mts +8 -7
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +8 -7
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js +3 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs +5 -4
- package/lib/manifest/index.mjs.map +1 -1
- package/lib/manifest/list-view.d.mts +17 -0
- package/lib/manifest/list-view.d.mts.map +1 -1
- package/lib/manifest/list-view.d.ts +17 -0
- package/lib/manifest/list-view.d.ts.map +1 -1
- package/lib/manifest/list-view.js +38 -1
- package/lib/manifest/list-view.js.map +1 -1
- package/lib/manifest/list-view.mjs +38 -1
- package/lib/manifest/list-view.mjs.map +1 -1
- package/lib/manifest/manifest-builder.d.mts +59 -6
- package/lib/manifest/manifest-builder.d.mts.map +1 -1
- package/lib/manifest/manifest-builder.d.ts +59 -6
- package/lib/manifest/manifest-builder.d.ts.map +1 -1
- package/lib/manifest/manifest-builder.js +61 -3
- package/lib/manifest/manifest-builder.js.map +1 -1
- package/lib/manifest/manifest-builder.mjs +61 -3
- package/lib/manifest/manifest-builder.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +10 -1
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +10 -1
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +36 -1
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +36 -1
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/rule.d.mts +17 -0
- package/lib/manifest/rule.d.mts.map +1 -1
- package/lib/manifest/rule.d.ts +17 -0
- package/lib/manifest/rule.d.ts.map +1 -1
- package/lib/manifest/rule.js +45 -1
- package/lib/manifest/rule.js.map +1 -1
- package/lib/manifest/rule.mjs +45 -1
- package/lib/manifest/rule.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +10 -1
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +10 -1
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +28 -1
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +28 -1
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/lib/manifest/validation.d.mts +17 -0
- package/lib/manifest/validation.d.mts.map +1 -1
- package/lib/manifest/validation.d.ts +17 -0
- package/lib/manifest/validation.d.ts.map +1 -1
- package/lib/manifest/validation.js +31 -1
- package/lib/manifest/validation.js.map +1 -1
- package/lib/manifest/validation.mjs +31 -1
- package/lib/manifest/validation.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/app.ts +46 -2
- package/src/lib/manifest/category.ts +28 -2
- package/src/lib/manifest/custom-object-field-section.ts +37 -1
- package/src/lib/manifest/custom-object-page-layout.ts +61 -1
- package/src/lib/manifest/custom-object.ts +58 -3
- package/src/lib/manifest/existing-manifest-context.ts +673 -0
- package/src/lib/manifest/field.ts +140 -1
- package/src/lib/manifest/index.ts +39 -4
- package/src/lib/manifest/list-view.ts +50 -1
- package/src/lib/manifest/manifest-builder.ts +114 -4
- package/src/lib/manifest/manifest-function.ts +36 -2
- package/src/lib/manifest/rule.ts +60 -1
- package/src/lib/manifest/sdui-page.ts +37 -2
- package/src/lib/manifest/validation.ts +48 -1
- 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
package/lib/manifest/rule.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Rule = void 0;
|
|
4
4
|
const _helpers_1 = require("./_helpers.js");
|
|
5
|
+
const existing_manifest_context_1 = require("./existing-manifest-context.js");
|
|
5
6
|
/** SELECT / RADIO rule actions use list `fixed_value` (Rippling rule builder). */
|
|
6
7
|
function fixedValueToWire(targetField, value) {
|
|
7
8
|
const ft = targetField.getFieldType();
|
|
@@ -25,6 +26,9 @@ function actionToDict(action) {
|
|
|
25
26
|
}
|
|
26
27
|
return out;
|
|
27
28
|
}
|
|
29
|
+
function hasOwn(value, key) {
|
|
30
|
+
return Object.prototype.hasOwnProperty.call(value, key);
|
|
31
|
+
}
|
|
28
32
|
/**
|
|
29
33
|
* Defines a record-triggered automation rule and registers it with the manifest.
|
|
30
34
|
*
|
|
@@ -44,6 +48,13 @@ function actionToDict(action) {
|
|
|
44
48
|
* ```
|
|
45
49
|
*/
|
|
46
50
|
class Rule {
|
|
51
|
+
static toDeletionIdentifier(identifier) {
|
|
52
|
+
return {
|
|
53
|
+
type: Rule.componentType,
|
|
54
|
+
flow_id: identifier.flowId,
|
|
55
|
+
model_rql_name: identifier.modelRqlName,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
47
58
|
/**
|
|
48
59
|
* @param customObject - The custom object this rule is attached to.
|
|
49
60
|
* @param props - Initialization properties.
|
|
@@ -64,6 +75,38 @@ class Rule {
|
|
|
64
75
|
this._actions = [...(props.actions ?? [])];
|
|
65
76
|
customObject._register(this);
|
|
66
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Loads this record-triggered rule from the active existing-manifest JSON context.
|
|
80
|
+
*/
|
|
81
|
+
static loadFromExisting(flowId, options = {}) {
|
|
82
|
+
return (0, existing_manifest_context_1.getExistingManifestContext)(options).loadRule(flowId, options);
|
|
83
|
+
}
|
|
84
|
+
/** @internal Hydrates a record-triggered rule from existing manifest wire JSON. */
|
|
85
|
+
static _fromExistingComponent(customObject, component, resolveField) {
|
|
86
|
+
const props = {
|
|
87
|
+
flowId: component['flow_id'],
|
|
88
|
+
flowName: component['flow_name'] ?? component['flow_id'],
|
|
89
|
+
triggerType: component['trigger_type'],
|
|
90
|
+
actions: (component['actions'] ?? []).map((action) => {
|
|
91
|
+
const out = {
|
|
92
|
+
targetField: resolveField(action['target_field']),
|
|
93
|
+
};
|
|
94
|
+
if (hasOwn(action, 'fixed_value'))
|
|
95
|
+
out.fixedValue = action['fixed_value'];
|
|
96
|
+
if (hasOwn(action, 'rql_formula'))
|
|
97
|
+
out.rqlFormula = action['rql_formula'];
|
|
98
|
+
return out;
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
if (component['description'] !== undefined)
|
|
102
|
+
props.description = component['description'];
|
|
103
|
+
if (component['rql_condition'] !== undefined)
|
|
104
|
+
props.rqlCondition = component['rql_condition'];
|
|
105
|
+
if (component['update_trigger_type'] !== undefined) {
|
|
106
|
+
props.updateTriggerType = component['update_trigger_type'];
|
|
107
|
+
}
|
|
108
|
+
return new Rule(customObject, props);
|
|
109
|
+
}
|
|
67
110
|
/**
|
|
68
111
|
* Returns the stable identifier for this rule (e.g. `'gym_default_enrollment_status'`).
|
|
69
112
|
*/
|
|
@@ -84,7 +127,7 @@ class Rule {
|
|
|
84
127
|
*/
|
|
85
128
|
toDict() {
|
|
86
129
|
const component = {
|
|
87
|
-
type:
|
|
130
|
+
type: Rule.componentType,
|
|
88
131
|
model_rql_name: this._customObjectApiName,
|
|
89
132
|
flow_id: this._flowId,
|
|
90
133
|
flow_name: this._flowName,
|
|
@@ -102,4 +145,5 @@ class Rule {
|
|
|
102
145
|
}
|
|
103
146
|
}
|
|
104
147
|
exports.Rule = Rule;
|
|
148
|
+
Rule.componentType = 'CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW';
|
|
105
149
|
//# sourceMappingURL=rule.js.map
|
package/lib/manifest/rule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/lib/manifest/rule.ts"],"names":[],"mappings":";;;AAAA,4CAAkF;
|
|
1
|
+
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/lib/manifest/rule.ts"],"names":[],"mappings":";;;AAAA,4CAAkF;AAElF,8EAA8G;AA0F9G,kFAAkF;AAClF,SAAS,gBAAgB,CAAC,WAAkB,EAAE,KAAU;IACtD,MAAM,EAAE,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC;IACtC,IAAI,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,OAAO,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,MAAkB;IACtC,MAAM,GAAG,GAAwB;QAC/B,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE;KAC9C,CAAC;IACF,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QAC9B,GAAG,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC/E,CAAC;SAAM,IAAI,MAAM,CAAC,UAAU,I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A9GiB,kBAAa,GAAG,qCAA8C,CAAC"}
|
package/lib/manifest/rule.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { generateId } from "./_helpers.mjs";
|
|
2
|
+
import { getExistingManifestContext } from "./existing-manifest-context.mjs";
|
|
2
3
|
/** SELECT / RADIO rule actions use list `fixed_value` (Rippling rule builder). */
|
|
3
4
|
function fixedValueToWire(targetField, value) {
|
|
4
5
|
const ft = targetField.getFieldType();
|
|
@@ -22,6 +23,9 @@ function actionToDict(action) {
|
|
|
22
23
|
}
|
|
23
24
|
return out;
|
|
24
25
|
}
|
|
26
|
+
function hasOwn(value, key) {
|
|
27
|
+
return Object.prototype.hasOwnProperty.call(value, key);
|
|
28
|
+
}
|
|
25
29
|
/**
|
|
26
30
|
* Defines a record-triggered automation rule and registers it with the manifest.
|
|
27
31
|
*
|
|
@@ -41,6 +45,13 @@ function actionToDict(action) {
|
|
|
41
45
|
* ```
|
|
42
46
|
*/
|
|
43
47
|
export class Rule {
|
|
48
|
+
static toDeletionIdentifier(identifier) {
|
|
49
|
+
return {
|
|
50
|
+
type: Rule.componentType,
|
|
51
|
+
flow_id: identifier.flowId,
|
|
52
|
+
model_rql_name: identifier.modelRqlName,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
44
55
|
/**
|
|
45
56
|
* @param customObject - The custom object this rule is attached to.
|
|
46
57
|
* @param props - Initialization properties.
|
|
@@ -61,6 +72,38 @@ export class Rule {
|
|
|
61
72
|
this._actions = [...(props.actions ?? [])];
|
|
62
73
|
customObject._register(this);
|
|
63
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Loads this record-triggered rule from the active existing-manifest JSON context.
|
|
77
|
+
*/
|
|
78
|
+
static loadFromExisting(flowId, options = {}) {
|
|
79
|
+
return getExistingManifestContext(options).loadRule(flowId, options);
|
|
80
|
+
}
|
|
81
|
+
/** @internal Hydrates a record-triggered rule from existing manifest wire JSON. */
|
|
82
|
+
static _fromExistingComponent(customObject, component, resolveField) {
|
|
83
|
+
const props = {
|
|
84
|
+
flowId: component['flow_id'],
|
|
85
|
+
flowName: component['flow_name'] ?? component['flow_id'],
|
|
86
|
+
triggerType: component['trigger_type'],
|
|
87
|
+
actions: (component['actions'] ?? []).map((action) => {
|
|
88
|
+
const out = {
|
|
89
|
+
targetField: resolveField(action['target_field']),
|
|
90
|
+
};
|
|
91
|
+
if (hasOwn(action, 'fixed_value'))
|
|
92
|
+
out.fixedValue = action['fixed_value'];
|
|
93
|
+
if (hasOwn(action, 'rql_formula'))
|
|
94
|
+
out.rqlFormula = action['rql_formula'];
|
|
95
|
+
return out;
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
if (component['description'] !== undefined)
|
|
99
|
+
props.description = component['description'];
|
|
100
|
+
if (component['rql_condition'] !== undefined)
|
|
101
|
+
props.rqlCondition = component['rql_condition'];
|
|
102
|
+
if (component['update_trigger_type'] !== undefined) {
|
|
103
|
+
props.updateTriggerType = component['update_trigger_type'];
|
|
104
|
+
}
|
|
105
|
+
return new Rule(customObject, props);
|
|
106
|
+
}
|
|
64
107
|
/**
|
|
65
108
|
* Returns the stable identifier for this rule (e.g. `'gym_default_enrollment_status'`).
|
|
66
109
|
*/
|
|
@@ -81,7 +124,7 @@ export class Rule {
|
|
|
81
124
|
*/
|
|
82
125
|
toDict() {
|
|
83
126
|
const component = {
|
|
84
|
-
type:
|
|
127
|
+
type: Rule.componentType,
|
|
85
128
|
model_rql_name: this._customObjectApiName,
|
|
86
129
|
flow_id: this._flowId,
|
|
87
130
|
flow_name: this._flowName,
|
|
@@ -98,4 +141,5 @@ export class Rule {
|
|
|
98
141
|
return component;
|
|
99
142
|
}
|
|
100
143
|
}
|
|
144
|
+
Rule.componentType = 'CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW';
|
|
101
145
|
//# sourceMappingURL=rule.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule.mjs","sourceRoot":"","sources":["../../src/lib/manifest/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C,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACH,MAAM;QACJ,MAAM,SAAS,GAAwB;YACrC,IAAI,EAAE,IAAI,CAAC,aAAa;YACxB,cAAc,EAAE,IAAI,CAAC,oBAAoB;YACzC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;QACF,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI;YAAE,SAAS,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAC5E,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI;YAAE,SAAS,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC;QAChG,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI;YAAE,SAAS,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAChF,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YAAE,SAAS,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACrF,OAAO,SAAS,CAAC;IACnB,CAAC;;AA7Ge,kBAAa,GAAG,qCAA8C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.mjs";
|
|
1
2
|
import type { ManifestFunction } from "./manifest-function.mjs";
|
|
2
|
-
import type { ManifestScope } from "./manifest-builder.mjs";
|
|
3
|
+
import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.mjs";
|
|
3
4
|
/**
|
|
4
5
|
* Initialization properties for {@link SduiPage}.
|
|
5
6
|
*/
|
|
@@ -57,6 +58,8 @@ export interface SduiPageProps {
|
|
|
57
58
|
* @see {@link App} — hosts this page as a tab via `pages`.
|
|
58
59
|
*/
|
|
59
60
|
export declare class SduiPage {
|
|
61
|
+
static readonly componentType: "SDUI_PAGE";
|
|
62
|
+
static toDeletionIdentifier(sduiPageId: string): ManifestComponentDeletion;
|
|
60
63
|
private readonly _sduiPageId;
|
|
61
64
|
private readonly _name;
|
|
62
65
|
private readonly _functionApiName;
|
|
@@ -67,6 +70,12 @@ export declare class SduiPage {
|
|
|
67
70
|
* @throws {Error} If `sduiPageId`, `name`, or `function` is missing.
|
|
68
71
|
*/
|
|
69
72
|
constructor(scope: ManifestScope, props: SduiPageProps);
|
|
73
|
+
/**
|
|
74
|
+
* Loads this SDUI page from the active existing-manifest JSON context.
|
|
75
|
+
*/
|
|
76
|
+
static loadFromExisting(sduiPageId: string, options?: ExistingManifestContextOptions): SduiPage;
|
|
77
|
+
/** @internal Hydrates an SDUI page from existing manifest wire JSON. */
|
|
78
|
+
static _fromExistingComponent(scope: ManifestScope, component: Record<string, any>, resolveFunction: (apiName: string) => ManifestFunction | string): SduiPage;
|
|
70
79
|
/**
|
|
71
80
|
* Returns the unique page identifier (e.g. `'gym_today_schedule'`).
|
|
72
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdui-page.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,gBAAgB,EAAE;OACzB,KAAK,EAAE,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"sdui-page.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"OAAO,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,gBAAgB,EAAE;OACzB,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAG,WAAW,CAAU;IAErD,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,yBAAyB;IAO1E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC;;;;OAIG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa;IAWtD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,8BAAmC,GAAG,QAAQ;IAInG,wEAAwE;IACxE,MAAM,CAAC,sBAAsB,CAC3B,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,gBAAgB,GAAG,MAAM,GAC9D,QAAQ;IAaX;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAI5B;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAS9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.js";
|
|
1
2
|
import type { ManifestFunction } from "./manifest-function.js";
|
|
2
|
-
import type { ManifestScope } from "./manifest-builder.js";
|
|
3
|
+
import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.js";
|
|
3
4
|
/**
|
|
4
5
|
* Initialization properties for {@link SduiPage}.
|
|
5
6
|
*/
|
|
@@ -57,6 +58,8 @@ export interface SduiPageProps {
|
|
|
57
58
|
* @see {@link App} — hosts this page as a tab via `pages`.
|
|
58
59
|
*/
|
|
59
60
|
export declare class SduiPage {
|
|
61
|
+
static readonly componentType: "SDUI_PAGE";
|
|
62
|
+
static toDeletionIdentifier(sduiPageId: string): ManifestComponentDeletion;
|
|
60
63
|
private readonly _sduiPageId;
|
|
61
64
|
private readonly _name;
|
|
62
65
|
private readonly _functionApiName;
|
|
@@ -67,6 +70,12 @@ export declare class SduiPage {
|
|
|
67
70
|
* @throws {Error} If `sduiPageId`, `name`, or `function` is missing.
|
|
68
71
|
*/
|
|
69
72
|
constructor(scope: ManifestScope, props: SduiPageProps);
|
|
73
|
+
/**
|
|
74
|
+
* Loads this SDUI page from the active existing-manifest JSON context.
|
|
75
|
+
*/
|
|
76
|
+
static loadFromExisting(sduiPageId: string, options?: ExistingManifestContextOptions): SduiPage;
|
|
77
|
+
/** @internal Hydrates an SDUI page from existing manifest wire JSON. */
|
|
78
|
+
static _fromExistingComponent(scope: ManifestScope, component: Record<string, any>, resolveFunction: (apiName: string) => ManifestFunction | string): SduiPage;
|
|
70
79
|
/**
|
|
71
80
|
* Returns the unique page identifier (e.g. `'gym_today_schedule'`).
|
|
72
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdui-page.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,gBAAgB,EAAE;OACzB,KAAK,EAAE,aAAa,EAAE;
|
|
1
|
+
{"version":3,"file":"sdui-page.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"OAAO,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,gBAAgB,EAAE;OACzB,KAAK,EAAE,yBAAyB,EA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|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SduiPage = void 0;
|
|
4
|
+
const existing_manifest_context_1 = require("./existing-manifest-context.js");
|
|
4
5
|
/**
|
|
5
6
|
* Defines an SDUI page and registers it with the manifest.
|
|
6
7
|
*
|
|
@@ -28,6 +29,12 @@ exports.SduiPage = void 0;
|
|
|
28
29
|
* @see {@link App} — hosts this page as a tab via `pages`.
|
|
29
30
|
*/
|
|
30
31
|
class SduiPage {
|
|
32
|
+
static toDeletionIdentifier(sduiPageId) {
|
|
33
|
+
return {
|
|
34
|
+
type: SduiPage.componentType,
|
|
35
|
+
sdui_page_id: sduiPageId,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
31
38
|
/**
|
|
32
39
|
* @param scope - The manifest to register this page with.
|
|
33
40
|
* @param props - Initialization properties.
|
|
@@ -46,6 +53,25 @@ class SduiPage {
|
|
|
46
53
|
this._description = props.description ?? '';
|
|
47
54
|
scope._register(this);
|
|
48
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Loads this SDUI page from the active existing-manifest JSON context.
|
|
58
|
+
*/
|
|
59
|
+
static loadFromExisting(sduiPageId, options = {}) {
|
|
60
|
+
return (0, existing_manifest_context_1.getExistingManifestContext)(options).loadSduiPage(sduiPageId);
|
|
61
|
+
}
|
|
62
|
+
/** @internal Hydrates an SDUI page from existing manifest wire JSON. */
|
|
63
|
+
static _fromExistingComponent(scope, component, resolveFunction) {
|
|
64
|
+
const functionApiName = component['function_api_name'];
|
|
65
|
+
const props = {
|
|
66
|
+
sduiPageId: component['sdui_page_id'],
|
|
67
|
+
name: component['name'] ?? component['sdui_page_id'],
|
|
68
|
+
function: typeof functionApiName === 'string' ? resolveFunction(functionApiName) : functionApiName,
|
|
69
|
+
};
|
|
70
|
+
if (component['description'] !== undefined) {
|
|
71
|
+
props.description = component['description'];
|
|
72
|
+
}
|
|
73
|
+
return new SduiPage(scope, props);
|
|
74
|
+
}
|
|
49
75
|
/**
|
|
50
76
|
* Returns the unique page identifier (e.g. `'gym_today_schedule'`).
|
|
51
77
|
*/
|
|
@@ -71,7 +97,7 @@ class SduiPage {
|
|
|
71
97
|
*/
|
|
72
98
|
toDict() {
|
|
73
99
|
return {
|
|
74
|
-
type:
|
|
100
|
+
type: SduiPage.componentType,
|
|
75
101
|
name: this._name,
|
|
76
102
|
sdui_page_id: this._sduiPageId,
|
|
77
103
|
function_api_name: this._functionApiName,
|
|
@@ -80,4 +106,5 @@ class SduiPage {
|
|
|
80
106
|
}
|
|
81
107
|
}
|
|
82
108
|
exports.SduiPage = SduiPage;
|
|
109
|
+
SduiPage.componentType = 'SDUI_PAGE';
|
|
83
110
|
//# sourceMappingURL=sdui-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdui-page.js","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sdui-page.js","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":";;;AAAA,8EAA8G;AAmC9G;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,QAAQ;IAGnB,MAAM,CAAC,oBAAoB,CAAC,UAAkB;QAC5C,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,aAAa;YAC5B,YAAY,EAAE,UAAU;SACzB,CAAC;IACJ,CAAC;IAOD;;;;OAIG;IACH,YAAY,KAAoB,EAAE,KAAoB;QACpD,IAAI,CAAC,KAAK,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC;QACp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AAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,aAAa;YAC5B,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,YAAY,EAAE,IAAI,CAAC,WAAW;YAC9B,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;YACxC,WAAW,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC;IACJ,CAAC;;AA1FH,4BA2FC;AA1FiB,sBAAa,GAAG,WAAoB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getExistingManifestContext } from "./existing-manifest-context.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* Defines an SDUI page and registers it with the manifest.
|
|
3
4
|
*
|
|
@@ -25,6 +26,12 @@
|
|
|
25
26
|
* @see {@link App} — hosts this page as a tab via `pages`.
|
|
26
27
|
*/
|
|
27
28
|
export class SduiPage {
|
|
29
|
+
static toDeletionIdentifier(sduiPageId) {
|
|
30
|
+
return {
|
|
31
|
+
type: SduiPage.componentType,
|
|
32
|
+
sdui_page_id: sduiPageId,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
28
35
|
/**
|
|
29
36
|
* @param scope - The manifest to register this page with.
|
|
30
37
|
* @param props - Initialization properties.
|
|
@@ -43,6 +50,25 @@ export class SduiPage {
|
|
|
43
50
|
this._description = props.description ?? '';
|
|
44
51
|
scope._register(this);
|
|
45
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Loads this SDUI page from the active existing-manifest JSON context.
|
|
55
|
+
*/
|
|
56
|
+
static loadFromExisting(sduiPageId, options = {}) {
|
|
57
|
+
return getExistingManifestContext(options).loadSduiPage(sduiPageId);
|
|
58
|
+
}
|
|
59
|
+
/** @internal Hydrates an SDUI page from existing manifest wire JSON. */
|
|
60
|
+
static _fromExistingComponent(scope, component, resolveFunction) {
|
|
61
|
+
const functionApiName = component['function_api_name'];
|
|
62
|
+
const props = {
|
|
63
|
+
sduiPageId: component['sdui_page_id'],
|
|
64
|
+
name: component['name'] ?? component['sdui_page_id'],
|
|
65
|
+
function: typeof functionApiName === 'string' ? resolveFunction(functionApiName) : functionApiName,
|
|
66
|
+
};
|
|
67
|
+
if (component['description'] !== undefined) {
|
|
68
|
+
props.description = component['description'];
|
|
69
|
+
}
|
|
70
|
+
return new SduiPage(scope, props);
|
|
71
|
+
}
|
|
46
72
|
/**
|
|
47
73
|
* Returns the unique page identifier (e.g. `'gym_today_schedule'`).
|
|
48
74
|
*/
|
|
@@ -68,7 +94,7 @@ export class SduiPage {
|
|
|
68
94
|
*/
|
|
69
95
|
toDict() {
|
|
70
96
|
return {
|
|
71
|
-
type:
|
|
97
|
+
type: SduiPage.componentType,
|
|
72
98
|
name: this._name,
|
|
73
99
|
sdui_page_id: this._sduiPageId,
|
|
74
100
|
function_api_name: this._functionApiName,
|
|
@@ -76,4 +102,5 @@ export class SduiPage {
|
|
|
76
102
|
};
|
|
77
103
|
}
|
|
78
104
|
}
|
|
105
|
+
SduiPage.componentType = 'SDUI_PAGE';
|
|
79
106
|
//# sourceMappingURL=sdui-page.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdui-page.mjs","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sdui-page.mjs","sourceRoot":"","sources":["../../src/lib/manifest/sdui-page.ts"],"names":[],"mappings":"OAAO,EAAE,0BAA0B,EAAuC;AAmC1E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,QAAQ;IAGnB,MAAM,CAAC,oBAAoB,CAAC,UAAkB;QAC5C,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,aAAa;YAC5B,YAAY,EAAE,UAAU;SACzB,CAAC;IACJ,CAAC;IAOD;;;;OAIG;IACH,Y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AC,eAAe;SACnG,CAAC;QACF,IAAI,SAAS,CAAC,aAAa,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3C,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,aAAa;YAC5B,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,YAAY,EAAE,IAAI,CAAC,WAAW;YAC9B,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;YACxC,WAAW,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC;IACJ,CAAC;;AAzFe,sBAAa,GAAG,WAAoB,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type ValidationLevel, type ValidationState } from "./_helpers.mjs";
|
|
2
2
|
import type { CustomObject } from "./custom-object.mjs";
|
|
3
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.mjs";
|
|
3
4
|
import type { Field } from "./field.mjs";
|
|
5
|
+
import type { ManifestComponentDeletion } from "./manifest-builder.mjs";
|
|
6
|
+
export interface ValidationDeletionIdentifier {
|
|
7
|
+
ruleId: string;
|
|
8
|
+
modelRqlName: string;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Initialization properties for {@link Validation}.
|
|
6
12
|
*/
|
|
@@ -57,6 +63,9 @@ export interface ValidationProps {
|
|
|
57
63
|
*/
|
|
58
64
|
fieldRef?: Field;
|
|
59
65
|
}
|
|
66
|
+
export interface ValidationLoadFromExistingOptions extends ExistingManifestContextOptions {
|
|
67
|
+
customObjectApiName?: string;
|
|
68
|
+
}
|
|
60
69
|
/**
|
|
61
70
|
* Defines a validation rule and registers it with the manifest.
|
|
62
71
|
*
|
|
@@ -83,6 +92,8 @@ export interface ValidationProps {
|
|
|
83
92
|
* ```
|
|
84
93
|
*/
|
|
85
94
|
export declare class Validation {
|
|
95
|
+
static readonly componentType: "CUSTOM_OBJECT_VALIDATION_RULE";
|
|
96
|
+
static toDeletionIdentifier(identifier: ValidationDeletionIdentifier): ManifestComponentDeletion;
|
|
86
97
|
private readonly _ruleId;
|
|
87
98
|
private readonly _customObjectApiName;
|
|
88
99
|
private readonly _displayName;
|
|
@@ -97,6 +108,12 @@ export declare class Validation {
|
|
|
97
108
|
* @param props - Initialization properties.
|
|
98
109
|
*/
|
|
99
110
|
constructor(customObject: CustomObject, props: ValidationProps);
|
|
111
|
+
/**
|
|
112
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
113
|
+
*/
|
|
114
|
+
static loadFromExisting(ruleId: string, options?: ValidationLoadFromExistingOptions): Validation;
|
|
115
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
116
|
+
static _fromExistingComponent(customObject: CustomObject, component: Record<string, any>, resolveField: (apiName: string) => Field): Validation;
|
|
100
117
|
/**
|
|
101
118
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
102
119
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE;OAC1D,KAAK,EAAE,YAAY,EAAE;OACrB,KAAK,EAAE,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"validation.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAc,KAAK,e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MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C;;;OAGG;gBACS,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe;IAa9D;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,iCAAsC,GAAG,UAAU;IAIpG,6EAA6E;IAC7E,MAAM,CAAC,sBAAsB,CAC3B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,GACvC,UAAU;IAcb;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAIhC;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAe9B"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type ValidationLevel, type ValidationState } from "./_helpers.js";
|
|
2
2
|
import type { CustomObject } from "./custom-object.js";
|
|
3
|
+
import { type ExistingManifestContextOptions } from "./existing-manifest-context.js";
|
|
3
4
|
import type { Field } from "./field.js";
|
|
5
|
+
import type { ManifestComponentDeletion } from "./manifest-builder.js";
|
|
6
|
+
export interface ValidationDeletionIdentifier {
|
|
7
|
+
ruleId: string;
|
|
8
|
+
modelRqlName: string;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Initialization properties for {@link Validation}.
|
|
6
12
|
*/
|
|
@@ -57,6 +63,9 @@ export interface ValidationProps {
|
|
|
57
63
|
*/
|
|
58
64
|
fieldRef?: Field;
|
|
59
65
|
}
|
|
66
|
+
export interface ValidationLoadFromExistingOptions extends ExistingManifestContextOptions {
|
|
67
|
+
customObjectApiName?: string;
|
|
68
|
+
}
|
|
60
69
|
/**
|
|
61
70
|
* Defines a validation rule and registers it with the manifest.
|
|
62
71
|
*
|
|
@@ -83,6 +92,8 @@ export interface ValidationProps {
|
|
|
83
92
|
* ```
|
|
84
93
|
*/
|
|
85
94
|
export declare class Validation {
|
|
95
|
+
static readonly componentType: "CUSTOM_OBJECT_VALIDATION_RULE";
|
|
96
|
+
static toDeletionIdentifier(identifier: ValidationDeletionIdentifier): ManifestComponentDeletion;
|
|
86
97
|
private readonly _ruleId;
|
|
87
98
|
private readonly _customObjectApiName;
|
|
88
99
|
private readonly _displayName;
|
|
@@ -97,6 +108,12 @@ export declare class Validation {
|
|
|
97
108
|
* @param props - Initialization properties.
|
|
98
109
|
*/
|
|
99
110
|
constructor(customObject: CustomObject, props: ValidationProps);
|
|
111
|
+
/**
|
|
112
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
113
|
+
*/
|
|
114
|
+
static loadFromExisting(ruleId: string, options?: ValidationLoadFromExistingOptions): Validation;
|
|
115
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
116
|
+
static _fromExistingComponent(customObject: CustomObject, component: Record<string, any>, resolveField: (apiName: string) => Field): Validation;
|
|
100
117
|
/**
|
|
101
118
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
102
119
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE;OAC1D,KAAK,EAAE,YAAY,EAAE;OACrB,KAAK,EAAE,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":"OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE;OAC1D,KAAK,EAAE,YAAY,EAAE;OACrB,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,KAAK,EAAE;OACd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AAY,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe;IAa9D;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,iCAAsC,GAAG,UAAU;IAIpG,6EAA6E;IAC7E,MAAM,CAAC,sBAAsB,CAC3B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,GACvC,UAAU;IAcb;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAIhC;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAe9B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Validation = void 0;
|
|
4
4
|
const _helpers_1 = require("./_helpers.js");
|
|
5
|
+
const existing_manifest_context_1 = require("./existing-manifest-context.js");
|
|
5
6
|
/**
|
|
6
7
|
* Defines a validation rule and registers it with the manifest.
|
|
7
8
|
*
|
|
@@ -28,6 +29,13 @@ const _helpers_1 = require("./_helpers.js");
|
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
class Validation {
|
|
32
|
+
static toDeletionIdentifier(identifier) {
|
|
33
|
+
return {
|
|
34
|
+
type: Validation.componentType,
|
|
35
|
+
rule_id: identifier.ruleId,
|
|
36
|
+
model_rql_name: identifier.modelRqlName,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
31
39
|
/**
|
|
32
40
|
* @param customObject - The custom object this rule applies to.
|
|
33
41
|
* @param props - Initialization properties.
|
|
@@ -44,6 +52,27 @@ class Validation {
|
|
|
44
52
|
this._fieldRef = props.fieldRef;
|
|
45
53
|
customObject._register(this);
|
|
46
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
57
|
+
*/
|
|
58
|
+
static loadFromExisting(ruleId, options = {}) {
|
|
59
|
+
return (0, existing_manifest_context_1.getExistingManifestContext)(options).loadValidation(ruleId, options);
|
|
60
|
+
}
|
|
61
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
62
|
+
static _fromExistingComponent(customObject, component, resolveField) {
|
|
63
|
+
const props = {
|
|
64
|
+
ruleId: component['rule_id'],
|
|
65
|
+
displayName: component['display_name'] ?? component['rule_id'],
|
|
66
|
+
rqlFormula: component['rql_formula'] ?? '',
|
|
67
|
+
errorMessage: component['custom_error_message'] ?? '',
|
|
68
|
+
state: component['state'],
|
|
69
|
+
level: component['level'],
|
|
70
|
+
ruleDescription: component['rule_description'] ?? '',
|
|
71
|
+
};
|
|
72
|
+
if (component['field_rql_name'] != null)
|
|
73
|
+
props.fieldRef = resolveField(component['field_rql_name']);
|
|
74
|
+
return new Validation(customObject, props);
|
|
75
|
+
}
|
|
47
76
|
/**
|
|
48
77
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
49
78
|
*/
|
|
@@ -64,7 +93,7 @@ class Validation {
|
|
|
64
93
|
*/
|
|
65
94
|
toDict() {
|
|
66
95
|
const component = {
|
|
67
|
-
type:
|
|
96
|
+
type: Validation.componentType,
|
|
68
97
|
model_rql_name: this._customObjectApiName,
|
|
69
98
|
rule_id: this._ruleId,
|
|
70
99
|
state: this._state,
|
|
@@ -80,4 +109,5 @@ class Validation {
|
|
|
80
109
|
}
|
|
81
110
|
}
|
|
82
111
|
exports.Validation = Validation;
|
|
112
|
+
Validation.componentType = 'CUSTOM_OBJECT_VALIDATION_RULE';
|
|
83
113
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/lib/manifest/validation.ts"],"names":[],"mappings":";;;AAAA,4CAAoF;
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":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