@rippling/rippling-sdk 0.2.0-alpha.84 → 0.2.0-alpha.86
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/examples/manifest/custom-object-creation-workflow/custom-object-creation-workflow.ts +44 -26
- package/examples/manifest/dental-practice-management/dental-practice-management.ts +470 -142
- package/examples/manifest/dental-practice-management/functions/chair-schedule.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/complete-visit.ts +55 -32
- package/examples/manifest/dental-practice-management/functions/operatory-list.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/patient-list.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/treatment-plan-list.ts +23 -13
- package/examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts +23 -68
- package/examples/manifest/field-service-dispatch/field-service-dispatch.ts +375 -102
- package/examples/manifest/grant-program-management/grant-program-management.ts +419 -125
- package/examples/manifest/gym-membership-management/functions/check-in-desk.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/member-list.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/today-schedule.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/trainer-list.ts +23 -13
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +442 -92
- package/examples/manifest/procurement-approval-hub/procurement-approval-hub.ts +408 -122
- package/examples/manifest/simple-todo-app/functions/mark-done.ts +12 -16
- package/examples/manifest/simple-todo-app/functions/todo-list.ts +23 -13
- package/examples/manifest/simple-todo-app/simple-todo-app.ts +109 -40
- package/examples/manifest/todo-app-without-object-list-view/functions/todo-page.ts +193 -166
- package/examples/manifest/todo-app-without-object-list-view/todo-app-without-object-list-view.ts +47 -24
- package/package.json +13 -7
- package/resources/custom-objects/fields.d.mts +1 -40
- package/resources/custom-objects/fields.d.mts.map +1 -1
- package/resources/custom-objects/fields.d.ts +1 -40
- package/resources/custom-objects/fields.d.ts.map +1 -1
- package/resources/levels.d.mts +25 -4
- package/resources/levels.d.mts.map +1 -1
- package/resources/levels.d.ts +25 -4
- package/resources/levels.d.ts.map +1 -1
- package/src/resources/custom-objects/fields.ts +1 -46
- package/src/resources/levels.ts +28 -4
- package/src/tsconfig.json +1 -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/core/platform/manifest/custom-objects/action.d.mts +0 -58
- package/core/platform/manifest/custom-objects/action.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/action.d.ts +0 -58
- package/core/platform/manifest/custom-objects/action.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/action.js +0 -44
- package/core/platform/manifest/custom-objects/action.js.map +0 -1
- package/core/platform/manifest/custom-objects/action.mjs +0 -40
- package/core/platform/manifest/custom-objects/action.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.d.mts +0 -240
- package/core/platform/manifest/custom-objects/conditions.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.d.ts +0 -240
- package/core/platform/manifest/custom-objects/conditions.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.js +0 -326
- package/core/platform/manifest/custom-objects/conditions.js.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.mjs +0 -321
- package/core/platform/manifest/custom-objects/conditions.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/existing.d.mts +0 -87
- package/core/platform/manifest/custom-objects/existing.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/existing.d.ts +0 -87
- package/core/platform/manifest/custom-objects/existing.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/existing.js +0 -113
- package/core/platform/manifest/custom-objects/existing.js.map +0 -1
- package/core/platform/manifest/custom-objects/existing.mjs +0 -109
- package/core/platform/manifest/custom-objects/existing.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.d.mts +0 -48
- package/core/platform/manifest/custom-objects/field-resolution.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.d.ts +0 -48
- package/core/platform/manifest/custom-objects/field-resolution.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.js +0 -61
- package/core/platform/manifest/custom-objects/field-resolution.js.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.mjs +0 -58
- package/core/platform/manifest/custom-objects/field-resolution.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.d.mts +0 -87
- package/core/platform/manifest/custom-objects/function-file.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.d.ts +0 -87
- package/core/platform/manifest/custom-objects/function-file.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.js +0 -76
- package/core/platform/manifest/custom-objects/function-file.js.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.mjs +0 -69
- package/core/platform/manifest/custom-objects/function-file.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.d.mts +0 -65
- package/core/platform/manifest/custom-objects/list-view.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.d.ts +0 -65
- package/core/platform/manifest/custom-objects/list-view.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.js +0 -33
- package/core/platform/manifest/custom-objects/list-view.js.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.mjs +0 -30
- package/core/platform/manifest/custom-objects/list-view.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.d.mts +0 -43
- package/core/platform/manifest/custom-objects/object-list-page.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.d.ts +0 -43
- package/core/platform/manifest/custom-objects/object-list-page.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.js +0 -54
- package/core/platform/manifest/custom-objects/object-list-page.js.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.mjs +0 -50
- package/core/platform/manifest/custom-objects/object-list-page.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.d.mts +0 -142
- package/core/platform/manifest/custom-objects/page-layout.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.d.ts +0 -142
- package/core/platform/manifest/custom-objects/page-layout.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.js +0 -184
- package/core/platform/manifest/custom-objects/page-layout.js.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.mjs +0 -180
- package/core/platform/manifest/custom-objects/page-layout.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/register.d.mts +0 -87
- package/core/platform/manifest/custom-objects/register.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/register.d.ts +0 -87
- package/core/platform/manifest/custom-objects/register.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/register.js +0 -395
- package/core/platform/manifest/custom-objects/register.js.map +0 -1
- package/core/platform/manifest/custom-objects/register.mjs +0 -391
- package/core/platform/manifest/custom-objects/register.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/rule.d.mts +0 -113
- package/core/platform/manifest/custom-objects/rule.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/rule.d.ts +0 -113
- package/core/platform/manifest/custom-objects/rule.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/rule.js +0 -49
- package/core/platform/manifest/custom-objects/rule.js.map +0 -1
- package/core/platform/manifest/custom-objects/rule.mjs +0 -45
- package/core/platform/manifest/custom-objects/rule.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.d.mts +0 -214
- package/core/platform/manifest/custom-objects/sdui-page.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.d.ts +0 -214
- package/core/platform/manifest/custom-objects/sdui-page.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.js +0 -194
- package/core/platform/manifest/custom-objects/sdui-page.js.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.mjs +0 -182
- package/core/platform/manifest/custom-objects/sdui-page.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.d.mts +0 -28
- package/core/platform/manifest/custom-objects/typed-condition.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.d.ts +0 -28
- package/core/platform/manifest/custom-objects/typed-condition.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.js +0 -434
- package/core/platform/manifest/custom-objects/typed-condition.js.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.mjs +0 -431
- package/core/platform/manifest/custom-objects/typed-condition.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/types.d.mts +0 -29
- package/core/platform/manifest/custom-objects/types.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/types.d.ts +0 -29
- package/core/platform/manifest/custom-objects/types.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/types.js +0 -3
- package/core/platform/manifest/custom-objects/types.js.map +0 -1
- package/core/platform/manifest/custom-objects/types.mjs +0 -2
- package/core/platform/manifest/custom-objects/types.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/validation.d.mts +0 -44
- package/core/platform/manifest/custom-objects/validation.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/validation.d.ts +0 -44
- package/core/platform/manifest/custom-objects/validation.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/validation.js +0 -30
- package/core/platform/manifest/custom-objects/validation.js.map +0 -1
- package/core/platform/manifest/custom-objects/validation.mjs +0 -27
- package/core/platform/manifest/custom-objects/validation.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.d.mts +0 -47
- package/core/platform/manifest/custom-objects/workflow.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.d.ts +0 -47
- package/core/platform/manifest/custom-objects/workflow.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.js +0 -38
- package/core/platform/manifest/custom-objects/workflow.js.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.mjs +0 -34
- package/core/platform/manifest/custom-objects/workflow.mjs.map +0 -1
- package/core/platform/manifest/custom-objects.d.mts +0 -85
- package/core/platform/manifest/custom-objects.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects.d.ts +0 -85
- package/core/platform/manifest/custom-objects.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects.js +0 -84
- package/core/platform/manifest/custom-objects.js.map +0 -1
- package/core/platform/manifest/custom-objects.mjs +0 -55
- package/core/platform/manifest/custom-objects.mjs.map +0 -1
- package/examples/manifest/custom-object-creation-workflow/functions/intake-request-created.ts +0 -20
- package/examples/manifest/custom-object-creation-workflow/schema.ts +0 -29
- package/examples/manifest/dental-practice-management/schema.ts +0 -298
- package/examples/manifest/field-service-dispatch/schema.ts +0 -248
- package/examples/manifest/grant-program-management/schema.ts +0 -269
- package/examples/manifest/gym-membership-management/schema.ts +0 -266
- package/examples/manifest/procurement-approval-hub/functions/route-purchase-request.ts +0 -20
- package/examples/manifest/procurement-approval-hub/schema.ts +0 -256
- package/examples/manifest/simple-todo-app/schema.ts +0 -60
- package/examples/manifest/todo-app-without-object-list-view/schema.ts +0 -28
- package/src/core/platform/README.md +0 -20
- package/src/core/platform/manifest/README.md +0 -26
- package/src/core/platform/manifest/custom-objects/action.ts +0 -87
- package/src/core/platform/manifest/custom-objects/conditions.ts +0 -762
- package/src/core/platform/manifest/custom-objects/existing.ts +0 -221
- package/src/core/platform/manifest/custom-objects/field-resolution.ts +0 -116
- package/src/core/platform/manifest/custom-objects/function-file.ts +0 -149
- package/src/core/platform/manifest/custom-objects/list-view.ts +0 -95
- package/src/core/platform/manifest/custom-objects/object-list-page.ts +0 -87
- package/src/core/platform/manifest/custom-objects/page-layout.ts +0 -380
- package/src/core/platform/manifest/custom-objects/register.ts +0 -555
- package/src/core/platform/manifest/custom-objects/rule.ts +0 -192
- package/src/core/platform/manifest/custom-objects/sdui-page.ts +0 -515
- package/src/core/platform/manifest/custom-objects/typed-condition.ts +0 -617
- package/src/core/platform/manifest/custom-objects/types.ts +0 -92
- package/src/core/platform/manifest/custom-objects/validation.ts +0 -70
- package/src/core/platform/manifest/custom-objects/workflow.ts +0 -71
- package/src/core/platform/manifest/custom-objects.ts +0 -203
- package/src/pebble-sdui-web-custom-apps-shim.d.ts +0 -3
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
const STANDARD_MANIFEST_CONDITION_FIELDS = [
|
|
2
|
-
'id',
|
|
3
|
-
'name',
|
|
4
|
-
'created_at',
|
|
5
|
-
'updated_at',
|
|
6
|
-
'system_updated_at',
|
|
7
|
-
'external_id',
|
|
8
|
-
'owner_role',
|
|
9
|
-
'created_by',
|
|
10
|
-
'last_modified_by',
|
|
11
|
-
];
|
|
12
|
-
function isManifestRegistration(target) {
|
|
13
|
-
return typeof target === 'object' && target != null && 'definition' in target && 'object' in target;
|
|
14
|
-
}
|
|
15
|
-
function resolveTargetDefinition(target) {
|
|
16
|
-
return isManifestRegistration(target) ? target.definition : target;
|
|
17
|
-
}
|
|
18
|
-
/** Creates one immutable manifest-condition fragment. */
|
|
19
|
-
function createFragment(text) {
|
|
20
|
-
return Object.freeze({ text });
|
|
21
|
-
}
|
|
22
|
-
/** Encodes one raw string into single-quoted manifest-condition syntax. */
|
|
23
|
-
function encodeConditionString(value) {
|
|
24
|
-
return `'${value.replace(/\\/g, '\\\\').replace(/'/g, "\\'")}'`;
|
|
25
|
-
}
|
|
26
|
-
/** Encodes one scalar literal into backend-ready manifest-condition syntax. */
|
|
27
|
-
function encodeConditionScalarLiteral(value) {
|
|
28
|
-
if (value === null)
|
|
29
|
-
return 'null';
|
|
30
|
-
if (typeof value === 'string')
|
|
31
|
-
return encodeConditionString(value);
|
|
32
|
-
if (typeof value === 'number') {
|
|
33
|
-
if (!Number.isFinite(value)) {
|
|
34
|
-
throw new Error(`Manifest-condition numeric literals must be finite. Received ${String(value)}.`);
|
|
35
|
-
}
|
|
36
|
-
return String(value);
|
|
37
|
-
}
|
|
38
|
-
if (typeof value === 'boolean')
|
|
39
|
-
return value ? 'True' : 'False';
|
|
40
|
-
return encodeConditionString(value.id);
|
|
41
|
-
}
|
|
42
|
-
/** Encodes one condition operand, which may be a literal, field token, function token, or literal array. */
|
|
43
|
-
function encodeConditionOperand(value) {
|
|
44
|
-
if (Array.isArray(value)) {
|
|
45
|
-
return `[${value
|
|
46
|
-
.map((item) => encodeConditionScalarLiteral(item))
|
|
47
|
-
.join(', ')}]`;
|
|
48
|
-
}
|
|
49
|
-
if (typeof value === 'object' && value != null && 'kind' in value) {
|
|
50
|
-
return value.kind === 'field' ? value.apiName : value.text;
|
|
51
|
-
}
|
|
52
|
-
return encodeConditionScalarLiteral(value);
|
|
53
|
-
}
|
|
54
|
-
/** Resolves the runtime API name and comparable category for one typed field token. */
|
|
55
|
-
function resolveRuntimeFieldMetadata(definition, fieldName) {
|
|
56
|
-
if (STANDARD_MANIFEST_CONDITION_FIELDS.includes(fieldName)) {
|
|
57
|
-
return {
|
|
58
|
-
apiName: fieldName,
|
|
59
|
-
category: fieldName === 'owner_role' || fieldName === 'created_by' || fieldName === 'last_modified_by' ?
|
|
60
|
-
'lookup'
|
|
61
|
-
: 'string',
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const field = definition.fields[fieldName];
|
|
65
|
-
if (field == null) {
|
|
66
|
-
throw new Error(`Unknown manifest-condition field "${fieldName}" for "${definition.apiName}". Valid fields: ${[
|
|
67
|
-
...STANDARD_MANIFEST_CONDITION_FIELDS,
|
|
68
|
-
...Object.keys(definition.fields).sort(),
|
|
69
|
-
].join(', ')}.`);
|
|
70
|
-
}
|
|
71
|
-
switch (field.kind) {
|
|
72
|
-
case 'text':
|
|
73
|
-
case 'long-text':
|
|
74
|
-
case 'email':
|
|
75
|
-
case 'url':
|
|
76
|
-
case 'phone':
|
|
77
|
-
case 'date':
|
|
78
|
-
case 'datetime':
|
|
79
|
-
case 'time':
|
|
80
|
-
case 'select':
|
|
81
|
-
case 'radio':
|
|
82
|
-
case 'formula-text':
|
|
83
|
-
case 'formula-date':
|
|
84
|
-
case 'formula-url':
|
|
85
|
-
return { apiName: field.apiName, category: 'string' };
|
|
86
|
-
case 'number':
|
|
87
|
-
case 'currency':
|
|
88
|
-
case 'percentage':
|
|
89
|
-
case 'formula-number':
|
|
90
|
-
case 'formula-currency':
|
|
91
|
-
case 'formula-percentage':
|
|
92
|
-
return { apiName: field.apiName, category: 'number' };
|
|
93
|
-
case 'boolean':
|
|
94
|
-
case 'formula-boolean':
|
|
95
|
-
return { apiName: field.apiName, category: 'boolean' };
|
|
96
|
-
case 'lookup':
|
|
97
|
-
case 'parent-child':
|
|
98
|
-
return { apiName: field.apiName, category: 'lookup' };
|
|
99
|
-
default:
|
|
100
|
-
return { apiName: field.apiName, category: 'unsupported' };
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function createFieldToken(fieldName, metadata) {
|
|
104
|
-
return Object.freeze({
|
|
105
|
-
kind: 'field',
|
|
106
|
-
fieldName,
|
|
107
|
-
apiName: metadata.apiName,
|
|
108
|
-
category: metadata.category,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function createFunctionToken(text, category) {
|
|
112
|
-
return Object.freeze({ kind: 'function', text, category });
|
|
113
|
-
}
|
|
114
|
-
function joinConditionFragments(operator, fragments) {
|
|
115
|
-
if (fragments.length === 0) {
|
|
116
|
-
throw new Error(`Manifest-condition ${operator} requires at least one fragment.`);
|
|
117
|
-
}
|
|
118
|
-
return createFragment(`(${fragments.map((fragment) => fragment.text).join(` ${operator} `)})`);
|
|
119
|
-
}
|
|
120
|
-
function buildComparison(field, operator, value) {
|
|
121
|
-
return createFragment(`(${field.apiName} ${operator} ${encodeConditionOperand(value)})`);
|
|
122
|
-
}
|
|
123
|
-
function createFieldComparator(field) {
|
|
124
|
-
return Object.freeze({
|
|
125
|
-
field,
|
|
126
|
-
eq(value) {
|
|
127
|
-
return buildComparison(field, '==', value);
|
|
128
|
-
},
|
|
129
|
-
ne(value) {
|
|
130
|
-
return buildComparison(field, '!=', value);
|
|
131
|
-
},
|
|
132
|
-
lt(value) {
|
|
133
|
-
return buildComparison(field, '<', value);
|
|
134
|
-
},
|
|
135
|
-
lte(value) {
|
|
136
|
-
return buildComparison(field, '<=', value);
|
|
137
|
-
},
|
|
138
|
-
gt(value) {
|
|
139
|
-
return buildComparison(field, '>', value);
|
|
140
|
-
},
|
|
141
|
-
gte(value) {
|
|
142
|
-
return buildComparison(field, '>=', value);
|
|
143
|
-
},
|
|
144
|
-
in(values) {
|
|
145
|
-
return buildComparison(field, 'IN', values);
|
|
146
|
-
},
|
|
147
|
-
notIn(values) {
|
|
148
|
-
return buildComparison(field, 'NOT_IN', values);
|
|
149
|
-
},
|
|
150
|
-
isNull() {
|
|
151
|
-
return buildComparison(field, '==', null);
|
|
152
|
-
},
|
|
153
|
-
isNotNull() {
|
|
154
|
-
return buildComparison(field, '!=', null);
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Creates typed manifest-condition helpers for one custom object target.
|
|
160
|
-
*
|
|
161
|
-
* The resulting helper family can be reused anywhere the manifest expects an
|
|
162
|
-
* RQL-like object condition or formula string: list-view filters, validation
|
|
163
|
-
* formulas, workflow guards, and rule conditions.
|
|
164
|
-
*
|
|
165
|
-
* @param target - Typed custom-object definition or manifest registration.
|
|
166
|
-
* @returns Immutable field-aware manifest-condition helper surface.
|
|
167
|
-
* @typeParam TDefinition - Typed custom-object definition whose field namespace should be enforced.
|
|
168
|
-
*/
|
|
169
|
-
export function createManifestConditionHelpers(target) {
|
|
170
|
-
const definition = resolveTargetDefinition(target);
|
|
171
|
-
const fieldTokenCache = new Map();
|
|
172
|
-
const todayToken = createFunctionToken('TODAY()', 'string');
|
|
173
|
-
const helper = {
|
|
174
|
-
definition,
|
|
175
|
-
get fields() {
|
|
176
|
-
const out = {};
|
|
177
|
-
for (const fieldName of STANDARD_MANIFEST_CONDITION_FIELDS) {
|
|
178
|
-
out[fieldName] = helper.field(fieldName);
|
|
179
|
-
}
|
|
180
|
-
for (const fieldName of Object.keys(definition.fields)) {
|
|
181
|
-
out[fieldName] = helper.field(fieldName);
|
|
182
|
-
}
|
|
183
|
-
return Object.freeze(out);
|
|
184
|
-
},
|
|
185
|
-
field(fieldName) {
|
|
186
|
-
const cached = fieldTokenCache.get(fieldName);
|
|
187
|
-
if (cached != null) {
|
|
188
|
-
return cached;
|
|
189
|
-
}
|
|
190
|
-
const metadata = resolveRuntimeFieldMetadata(definition, fieldName);
|
|
191
|
-
const token = createFieldToken(fieldName, metadata);
|
|
192
|
-
fieldTokenCache.set(fieldName, token);
|
|
193
|
-
return token;
|
|
194
|
-
},
|
|
195
|
-
where(fieldName) {
|
|
196
|
-
return createFieldComparator(helper.field(fieldName));
|
|
197
|
-
},
|
|
198
|
-
today() {
|
|
199
|
-
return todayToken;
|
|
200
|
-
},
|
|
201
|
-
eq(field, value) {
|
|
202
|
-
return buildComparison(field, '==', value);
|
|
203
|
-
},
|
|
204
|
-
ne(field, value) {
|
|
205
|
-
return buildComparison(field, '!=', value);
|
|
206
|
-
},
|
|
207
|
-
lt(field, value) {
|
|
208
|
-
return buildComparison(field, '<', value);
|
|
209
|
-
},
|
|
210
|
-
lte(field, value) {
|
|
211
|
-
return buildComparison(field, '<=', value);
|
|
212
|
-
},
|
|
213
|
-
gt(field, value) {
|
|
214
|
-
return buildComparison(field, '>', value);
|
|
215
|
-
},
|
|
216
|
-
gte(field, value) {
|
|
217
|
-
return buildComparison(field, '>=', value);
|
|
218
|
-
},
|
|
219
|
-
in(field, values) {
|
|
220
|
-
return buildComparison(field, 'IN', values);
|
|
221
|
-
},
|
|
222
|
-
notIn(field, values) {
|
|
223
|
-
return buildComparison(field, 'NOT_IN', values);
|
|
224
|
-
},
|
|
225
|
-
isNull(field) {
|
|
226
|
-
return buildComparison(field, '==', null);
|
|
227
|
-
},
|
|
228
|
-
isNotNull(field) {
|
|
229
|
-
return buildComparison(field, '!=', null);
|
|
230
|
-
},
|
|
231
|
-
and(...fragments) {
|
|
232
|
-
return joinConditionFragments('AND', fragments);
|
|
233
|
-
},
|
|
234
|
-
all(...fragments) {
|
|
235
|
-
return joinConditionFragments('AND', fragments);
|
|
236
|
-
},
|
|
237
|
-
or(...fragments) {
|
|
238
|
-
return joinConditionFragments('OR', fragments);
|
|
239
|
-
},
|
|
240
|
-
any(...fragments) {
|
|
241
|
-
return joinConditionFragments('OR', fragments);
|
|
242
|
-
},
|
|
243
|
-
not(fragment) {
|
|
244
|
-
return createFragment(`(NOT ${fragment.text})`);
|
|
245
|
-
},
|
|
246
|
-
none(...fragments) {
|
|
247
|
-
return createFragment(`(NOT ${joinConditionFragments('OR', fragments).text})`);
|
|
248
|
-
},
|
|
249
|
-
raw(text) {
|
|
250
|
-
return createFragment(text);
|
|
251
|
-
},
|
|
252
|
-
render(fragment) {
|
|
253
|
-
return fragment.text;
|
|
254
|
-
},
|
|
255
|
-
};
|
|
256
|
-
return helper;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Resolves one manifest-condition input into final manifest string text.
|
|
260
|
-
*
|
|
261
|
-
* @param target - Typed custom-object definition or manifest registration.
|
|
262
|
-
* @param input - Condition fragment or helper callback to resolve.
|
|
263
|
-
* @returns Final manifest condition/formula string.
|
|
264
|
-
* @typeParam TDefinition - Typed custom-object definition that owns the helper field namespace.
|
|
265
|
-
*/
|
|
266
|
-
export function resolveManifestConditionInput(target, input) {
|
|
267
|
-
const helpers = createManifestConditionHelpers(target);
|
|
268
|
-
const fragment = typeof input === 'function' ? input(helpers) : input;
|
|
269
|
-
return helpers.render(fragment);
|
|
270
|
-
}
|
|
271
|
-
class CustomObjectLifecycleTriggerBuilder {
|
|
272
|
-
constructor(definition, operation, condition) {
|
|
273
|
-
this.definition = definition;
|
|
274
|
-
this.operation = operation;
|
|
275
|
-
this.condition = condition;
|
|
276
|
-
}
|
|
277
|
-
when(condition) {
|
|
278
|
-
return new CustomObjectLifecycleTriggerBuilder(this.definition, this.operation, condition);
|
|
279
|
-
}
|
|
280
|
-
build() {
|
|
281
|
-
return Object.freeze({
|
|
282
|
-
automation_event_type: 'AUTOMATION_EVENT_TYPE_RECORD_CHANGE',
|
|
283
|
-
og_module: 'custom_objects',
|
|
284
|
-
base_model: this.definition.apiName,
|
|
285
|
-
record_change_operation_type: this.operation,
|
|
286
|
-
...(this.condition != null ?
|
|
287
|
-
{ rql_formula: resolveManifestConditionInput(this.definition, this.condition) }
|
|
288
|
-
: {}),
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Creates the typed lifecycle helper namespace for one custom object.
|
|
294
|
-
*
|
|
295
|
-
* The lifecycle helper keeps workflows and custom objects as separate concepts
|
|
296
|
-
* while exposing the custom object's record lifecycle as a fluent, typed join
|
|
297
|
-
* point for workflow composition.
|
|
298
|
-
*
|
|
299
|
-
* @param target - Typed custom-object definition or manifest registration.
|
|
300
|
-
* @returns Immutable lifecycle helper namespace for that custom object.
|
|
301
|
-
* @typeParam TDefinition - Typed custom-object definition whose lifecycle events should be exposed.
|
|
302
|
-
*/
|
|
303
|
-
export function customObjectLifecycle(target) {
|
|
304
|
-
const definition = resolveTargetDefinition(target);
|
|
305
|
-
return Object.freeze({
|
|
306
|
-
definition,
|
|
307
|
-
onCreate() {
|
|
308
|
-
return new CustomObjectLifecycleTriggerBuilder(definition, 'RECORD_CHANGE_OPERATION_TYPE_CREATE');
|
|
309
|
-
},
|
|
310
|
-
onUpdate() {
|
|
311
|
-
return new CustomObjectLifecycleTriggerBuilder(definition, 'RECORD_CHANGE_OPERATION_TYPE_UPDATE');
|
|
312
|
-
},
|
|
313
|
-
onDelete() {
|
|
314
|
-
return new CustomObjectLifecycleTriggerBuilder(definition, 'RECORD_CHANGE_OPERATION_TYPE_DELETE');
|
|
315
|
-
},
|
|
316
|
-
onCreateOrUpdate() {
|
|
317
|
-
return new CustomObjectLifecycleTriggerBuilder(definition, 'RECORD_CHANGE_OPERATION_TYPE_CREATE_OR_UPDATE');
|
|
318
|
-
},
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
//# sourceMappingURL=conditions.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,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;YAC5C,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;gBAC1B,EAAE,WAAW,EAAE,6BAA6B,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE;gBACjF,CAAC,CAAC,EAAE,CAAC;SACN,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAA+C;IAE/C,MAAM,UAAU,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,UAAU;QACV,QAAQ;YACN,OAAO,IAAI,mCAAmC,CAAC,UAAU,EAAE,qCAAqC,CAAC,CAAC;QACpG,CAAC;QACD,QAAQ;YACN,OAAO,IAAI,mCAAmC,CAAC,UAAU,EAAE,qCAAqC,CAAC,CAAC;QACpG,CAAC;QACD,QAAQ;YACN,OAAO,IAAI,mCAAmC,CAAC,UAAU,EAAE,qCAAqC,CAAC,CAAC;QACpG,CAAC;QACD,gBAAgB;YACd,OAAO,IAAI,mCAAmC,CAC5C,UAAU,EACV,+CAA+C,CAChD,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { CustomObjectAction, CustomObjectPageLayout, ExistingManifestContext, type ExistingManifestContextOptions, ListViewDef, Rule, Validation } from "../../../../lib/manifest.mjs";
|
|
2
|
-
import type { AnyCustomObjectDefinition } from "../../custom-objects/types.mjs";
|
|
3
|
-
import type { ManifestRegistration } from "./types.mjs";
|
|
4
|
-
/**
|
|
5
|
-
* Typed binding result for one custom object loaded from an existing manifest.
|
|
6
|
-
*
|
|
7
|
-
* This mirrors the registration shape produced by `registerManifestCustomObject(...)`
|
|
8
|
-
* while pointing at already-existing manifest components instead of creating new ones.
|
|
9
|
-
* It is the typed anchor for existing-manifest extension work: callers can keep
|
|
10
|
-
* using typed fields, sections, layouts, rules, validations, and actions that
|
|
11
|
-
* already exist in the manifest, then drop to raw `lib/manifest` classes only
|
|
12
|
-
* when they intentionally need an escape hatch for brand-new manifest-only
|
|
13
|
-
* components that do not yet have a dedicated typed helper.
|
|
14
|
-
*
|
|
15
|
-
* @typeParam TDefinition - Typed custom-object definition bound to the loaded manifest components.
|
|
16
|
-
*/
|
|
17
|
-
export interface ExistingManifestRegistration<TDefinition extends AnyCustomObjectDefinition> extends ManifestRegistration<TDefinition> {
|
|
18
|
-
/** Existing-manifest context that resolved this binding. */
|
|
19
|
-
readonly context: ExistingManifestContext;
|
|
20
|
-
/** Loads one existing list view scoped to this custom object. */
|
|
21
|
-
loadListView(viewId: string): ListViewDef;
|
|
22
|
-
/** Loads one existing page layout scoped to this custom object. */
|
|
23
|
-
loadPageLayout(layoutIdOrApiName: string): CustomObjectPageLayout;
|
|
24
|
-
/** Loads one existing validation rule scoped to this custom object. */
|
|
25
|
-
loadValidation(ruleId: string): Validation;
|
|
26
|
-
/** Loads one existing record-triggered rule scoped to this custom object. */
|
|
27
|
-
loadRule(flowId: string): Rule;
|
|
28
|
-
/** Loads one existing object action scoped to this custom object. */
|
|
29
|
-
loadAction(actionId: string): CustomObjectAction;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Options for {@link bindExistingManifestCustomObject}.
|
|
33
|
-
*
|
|
34
|
-
* @typeParam TDefinition - Typed custom-object definition being bound.
|
|
35
|
-
*/
|
|
36
|
-
export interface BindExistingManifestCustomObjectOptions<TDefinition extends AnyCustomObjectDefinition> extends ExistingManifestContextOptions {
|
|
37
|
-
/** Optional override for the custom-object API name to load. Defaults to `definition.apiName`. */
|
|
38
|
-
readonly customObjectApiName?: TDefinition['apiName'];
|
|
39
|
-
/** Optional override for the category API name to load. Defaults to `definition.categoryApiName`. */
|
|
40
|
-
readonly categoryApiName?: TDefinition['categoryApiName'];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Options for {@link bindExistingManifestCustomObjects}.
|
|
44
|
-
*
|
|
45
|
-
* @typeParam TDefinitions - Ordered tuple of typed custom-object definitions being bound.
|
|
46
|
-
*/
|
|
47
|
-
export interface BindExistingManifestCustomObjectsOptions<TDefinitions extends readonly AnyCustomObjectDefinition[]> extends ExistingManifestContextOptions {
|
|
48
|
-
/** Ordered tuple of typed custom-object definitions to bind. */
|
|
49
|
-
readonly definitions: TDefinitions;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Registration tuple returned by {@link bindExistingManifestCustomObjects}.
|
|
53
|
-
*
|
|
54
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions that were bound.
|
|
55
|
-
*/
|
|
56
|
-
export type ExistingManifestRegistrationTuple<TDefinitions extends readonly AnyCustomObjectDefinition[]> = {
|
|
57
|
-
readonly [TIndex in keyof TDefinitions]: TDefinitions[TIndex] extends AnyCustomObjectDefinition ? ExistingManifestRegistration<TDefinitions[TIndex]> : never;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
61
|
-
*
|
|
62
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
63
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
64
|
-
* sections, layouts, and actions one by one.
|
|
65
|
-
*
|
|
66
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
67
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
68
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
69
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
70
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
71
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
72
|
-
*
|
|
73
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
74
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
75
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
76
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
77
|
-
*/
|
|
78
|
-
export declare function bindExistingManifestCustomObject<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, options?: BindExistingManifestCustomObjectOptions<TDefinition>): ExistingManifestRegistration<TDefinition>;
|
|
79
|
-
/**
|
|
80
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
81
|
-
*
|
|
82
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
83
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
84
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
85
|
-
*/
|
|
86
|
-
export declare function bindExistingManifestCustomObjects<TDefinitions extends readonly AnyCustomObjectDefinition[]>(options: BindExistingManifestCustomObjectsOptions<TDefinitions>): ExistingManifestRegistrationTuple<TDefinitions>;
|
|
87
|
-
//# sourceMappingURL=existing.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"existing.d.mts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/existing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,WAAW,EACX,IAAI,EACJ,UAAU,EACX,qCAAiC;AAClC,OAAO,KAAK,EAAE,yBAAyB,EAAc,uCAAmC;AAExF,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAgB;AAEpD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,4BAA4B,CAAC,WAAW,SAAS,yBAAyB,CACzF,SAAQ,oBAAoB,CAAC,WAAW,CAAC;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAC;IAC1C,iEAAiE;IACjE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1C,mEAAmE;IACnE,cAAc,CAAC,iBAAiB,EAAE,MAAM,GAAG,sBAAsB,CAAC;IAClE,uEA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,CAQjD"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { CustomObjectAction, CustomObjectPageLayout, ExistingManifestContext, type ExistingManifestContextOptions, ListViewDef, Rule, Validation } from "../../../../lib/manifest.js";
|
|
2
|
-
import type { AnyCustomObjectDefinition } from "../../custom-objects/types.js";
|
|
3
|
-
import type { ManifestRegistration } from "./types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Typed binding result for one custom object loaded from an existing manifest.
|
|
6
|
-
*
|
|
7
|
-
* This mirrors the registration shape produced by `registerManifestCustomObject(...)`
|
|
8
|
-
* while pointing at already-existing manifest components instead of creating new ones.
|
|
9
|
-
* It is the typed anchor for existing-manifest extension work: callers can keep
|
|
10
|
-
* using typed fields, sections, layouts, rules, validations, and actions that
|
|
11
|
-
* already exist in the manifest, then drop to raw `lib/manifest` classes only
|
|
12
|
-
* when they intentionally need an escape hatch for brand-new manifest-only
|
|
13
|
-
* components that do not yet have a dedicated typed helper.
|
|
14
|
-
*
|
|
15
|
-
* @typeParam TDefinition - Typed custom-object definition bound to the loaded manifest components.
|
|
16
|
-
*/
|
|
17
|
-
export interface ExistingManifestRegistration<TDefinition extends AnyCustomObjectDefinition> extends ManifestRegistration<TDefinition> {
|
|
18
|
-
/** Existing-manifest context that resolved this binding. */
|
|
19
|
-
readonly context: ExistingManifestContext;
|
|
20
|
-
/** Loads one existing list view scoped to this custom object. */
|
|
21
|
-
loadListView(viewId: string): ListViewDef;
|
|
22
|
-
/** Loads one existing page layout scoped to this custom object. */
|
|
23
|
-
loadPageLayout(layoutIdOrApiName: string): CustomObjectPageLayout;
|
|
24
|
-
/** Loads one existing validation rule scoped to this custom object. */
|
|
25
|
-
loadValidation(ruleId: string): Validation;
|
|
26
|
-
/** Loads one existing record-triggered rule scoped to this custom object. */
|
|
27
|
-
loadRule(flowId: string): Rule;
|
|
28
|
-
/** Loads one existing object action scoped to this custom object. */
|
|
29
|
-
loadAction(actionId: string): CustomObjectAction;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Options for {@link bindExistingManifestCustomObject}.
|
|
33
|
-
*
|
|
34
|
-
* @typeParam TDefinition - Typed custom-object definition being bound.
|
|
35
|
-
*/
|
|
36
|
-
export interface BindExistingManifestCustomObjectOptions<TDefinition extends AnyCustomObjectDefinition> extends ExistingManifestContextOptions {
|
|
37
|
-
/** Optional override for the custom-object API name to load. Defaults to `definition.apiName`. */
|
|
38
|
-
readonly customObjectApiName?: TDefinition['apiName'];
|
|
39
|
-
/** Optional override for the category API name to load. Defaults to `definition.categoryApiName`. */
|
|
40
|
-
readonly categoryApiName?: TDefinition['categoryApiName'];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Options for {@link bindExistingManifestCustomObjects}.
|
|
44
|
-
*
|
|
45
|
-
* @typeParam TDefinitions - Ordered tuple of typed custom-object definitions being bound.
|
|
46
|
-
*/
|
|
47
|
-
export interface BindExistingManifestCustomObjectsOptions<TDefinitions extends readonly AnyCustomObjectDefinition[]> extends ExistingManifestContextOptions {
|
|
48
|
-
/** Ordered tuple of typed custom-object definitions to bind. */
|
|
49
|
-
readonly definitions: TDefinitions;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Registration tuple returned by {@link bindExistingManifestCustomObjects}.
|
|
53
|
-
*
|
|
54
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions that were bound.
|
|
55
|
-
*/
|
|
56
|
-
export type ExistingManifestRegistrationTuple<TDefinitions extends readonly AnyCustomObjectDefinition[]> = {
|
|
57
|
-
readonly [TIndex in keyof TDefinitions]: TDefinitions[TIndex] extends AnyCustomObjectDefinition ? ExistingManifestRegistration<TDefinitions[TIndex]> : never;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
61
|
-
*
|
|
62
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
63
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
64
|
-
* sections, layouts, and actions one by one.
|
|
65
|
-
*
|
|
66
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
67
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
68
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
69
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
70
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
71
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
72
|
-
*
|
|
73
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
74
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
75
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
76
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
77
|
-
*/
|
|
78
|
-
export declare function bindExistingManifestCustomObject<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, options?: BindExistingManifestCustomObjectOptions<TDefinition>): ExistingManifestRegistration<TDefinition>;
|
|
79
|
-
/**
|
|
80
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
81
|
-
*
|
|
82
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
83
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
84
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
85
|
-
*/
|
|
86
|
-
export declare function bindExistingManifestCustomObjects<TDefinitions extends readonly AnyCustomObjectDefinition[]>(options: BindExistingManifestCustomObjectsOptions<TDefinitions>): ExistingManifestRegistrationTuple<TDefinitions>;
|
|
87
|
-
//# sourceMappingURL=existing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"existing.d.ts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/existing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,WAA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AAG,YAAY,CAAC,MAAM,CAAC,SAAS,yBAAyB,GAC7F,4BAA4B,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAClD,KAAK;CACR,CAAC;AA2CF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gCAAgC,CAAC,WAAW,SAAS,yBAAyB,EAC5F,UAAU,EAAE,WAAW,EACvB,OAAO,GAAE,uCAAuC,CAAC,WAAW,CAAM,GACjE,4BAA4B,CAAC,WAAW,CAAC,CA4D3C;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,YAAY,SAAS,SAAS,yBAAyB,EAAE,EACzG,OAAO,EAAE,wCAAwC,CAAC,YAAY,CAAC,GAC9D,iCAAiC,CAAC,YAAY,CAAC,CAQjD"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bindExistingManifestCustomObject = bindExistingManifestCustomObject;
|
|
4
|
-
exports.bindExistingManifestCustomObjects = bindExistingManifestCustomObjects;
|
|
5
|
-
const existing_manifest_context_1 = require("../../../../lib/manifest/existing-manifest-context.js");
|
|
6
|
-
function resolveSectionId(definition, sectionKey, customObjectApiName, context) {
|
|
7
|
-
const section = definition.sections[sectionKey];
|
|
8
|
-
if (section?.sectionId != null) {
|
|
9
|
-
return section.sectionId;
|
|
10
|
-
}
|
|
11
|
-
const fieldSectionIds = new Set();
|
|
12
|
-
for (const fieldName of Object.keys(definition.fields)) {
|
|
13
|
-
const field = definition.fields[fieldName];
|
|
14
|
-
if (field == null || field.section !== sectionKey)
|
|
15
|
-
continue;
|
|
16
|
-
const loadedField = context.loadField(field.apiName, { customObjectApiName });
|
|
17
|
-
const sectionId = loadedField.getSectionId();
|
|
18
|
-
if (typeof sectionId === 'string' && sectionId.length > 0) {
|
|
19
|
-
fieldSectionIds.add(sectionId);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (fieldSectionIds.size === 1) {
|
|
23
|
-
return [...fieldSectionIds][0];
|
|
24
|
-
}
|
|
25
|
-
if (fieldSectionIds.size > 1) {
|
|
26
|
-
throw new Error(`Could not resolve one existing manifest section for key "${sectionKey}" on "${customObjectApiName}". ` +
|
|
27
|
-
`Fields in that section resolved to multiple section ids: ${[...fieldSectionIds]
|
|
28
|
-
.sort()
|
|
29
|
-
.join(', ')}. ` +
|
|
30
|
-
'Add a stable sectionId to the typed definition to disambiguate.');
|
|
31
|
-
}
|
|
32
|
-
throw new Error(`Could not resolve existing manifest section key "${sectionKey}" for "${customObjectApiName}". ` +
|
|
33
|
-
'Add a stable sectionId to the typed definition or ensure at least one field in that section already exists in the manifest.');
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
37
|
-
*
|
|
38
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
39
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
40
|
-
* sections, layouts, and actions one by one.
|
|
41
|
-
*
|
|
42
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
43
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
44
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
45
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
46
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
47
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
48
|
-
*
|
|
49
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
50
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
51
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
52
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
53
|
-
*/
|
|
54
|
-
function bindExistingManifestCustomObject(definition, options = {}) {
|
|
55
|
-
const context = (0, existing_manifest_context_1.getExistingManifestContext)(options);
|
|
56
|
-
const customObjectApiName = options.customObjectApiName ?? definition.apiName;
|
|
57
|
-
const categoryApiName = options.categoryApiName ?? definition.categoryApiName;
|
|
58
|
-
const category = context.loadCategory(categoryApiName);
|
|
59
|
-
const object = context.loadCustomObject(customObjectApiName);
|
|
60
|
-
const sections = Object.freeze(Object.fromEntries(Object.keys(definition.sections).map((sectionKey) => {
|
|
61
|
-
const sectionId = resolveSectionId(definition, sectionKey, customObjectApiName, context);
|
|
62
|
-
return [
|
|
63
|
-
sectionKey,
|
|
64
|
-
context.loadFieldSection(sectionId, {
|
|
65
|
-
customObjectApiName,
|
|
66
|
-
}),
|
|
67
|
-
];
|
|
68
|
-
})));
|
|
69
|
-
const fields = Object.freeze(Object.fromEntries(Object.keys(definition.fields).map((fieldName) => [
|
|
70
|
-
fieldName,
|
|
71
|
-
context.loadField(definition.fields[fieldName].apiName, {
|
|
72
|
-
customObjectApiName,
|
|
73
|
-
}),
|
|
74
|
-
])));
|
|
75
|
-
return Object.freeze({
|
|
76
|
-
context,
|
|
77
|
-
definition,
|
|
78
|
-
category,
|
|
79
|
-
object,
|
|
80
|
-
sections,
|
|
81
|
-
fields,
|
|
82
|
-
loadListView(viewId) {
|
|
83
|
-
return context.loadListView(viewId, { customObjectApiName });
|
|
84
|
-
},
|
|
85
|
-
loadPageLayout(layoutIdOrApiName) {
|
|
86
|
-
return context.loadPageLayout(layoutIdOrApiName, { customObjectApiName });
|
|
87
|
-
},
|
|
88
|
-
loadValidation(ruleId) {
|
|
89
|
-
return context.loadValidation(ruleId, { customObjectApiName });
|
|
90
|
-
},
|
|
91
|
-
loadRule(flowId) {
|
|
92
|
-
return context.loadRule(flowId, { customObjectApiName });
|
|
93
|
-
},
|
|
94
|
-
loadAction(actionId) {
|
|
95
|
-
return context.loadCustomObjectAction(actionId, { customObjectApiName });
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
101
|
-
*
|
|
102
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
103
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
104
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
105
|
-
*/
|
|
106
|
-
function bindExistingManifestCustomObjects(options) {
|
|
107
|
-
return options.definitions.map((definition) => options.context != null ?
|
|
108
|
-
bindExistingManifestCustomObject(definition, {
|
|
109
|
-
context: options.context,
|
|
110
|
-
})
|
|
111
|
-
: bindExistingManifestCustomObject(definition));
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=existing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"existing.js","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/existing.ts"],"names":[],"mappings":";;AA0IA,4EA+DC;AASD,8EAUC;AAlND,qGAAgG;AAoEhG,SAAS,gBAAgB,CACvB,UAAuB,EACvB,UAA0D,EAC1D,mBAA2B,EAC3B,OAAgC;IAEhC,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAChD,IAAI,OAAO,EAAE,SAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC,SAAS,CAAC;IAC3B,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAC1C,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAA8B,EAAE,CAAC;QACpF,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,KAAK,UAAU;YAAE,SAAS;QAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC9E,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC;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