@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,109 +0,0 @@
|
|
|
1
|
-
import { getExistingManifestContext } from "../../../../lib/manifest/existing-manifest-context.mjs";
|
|
2
|
-
function resolveSectionId(definition, sectionKey, customObjectApiName, context) {
|
|
3
|
-
const section = definition.sections[sectionKey];
|
|
4
|
-
if (section?.sectionId != null) {
|
|
5
|
-
return section.sectionId;
|
|
6
|
-
}
|
|
7
|
-
const fieldSectionIds = new Set();
|
|
8
|
-
for (const fieldName of Object.keys(definition.fields)) {
|
|
9
|
-
const field = definition.fields[fieldName];
|
|
10
|
-
if (field == null || field.section !== sectionKey)
|
|
11
|
-
continue;
|
|
12
|
-
const loadedField = context.loadField(field.apiName, { customObjectApiName });
|
|
13
|
-
const sectionId = loadedField.getSectionId();
|
|
14
|
-
if (typeof sectionId === 'string' && sectionId.length > 0) {
|
|
15
|
-
fieldSectionIds.add(sectionId);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
if (fieldSectionIds.size === 1) {
|
|
19
|
-
return [...fieldSectionIds][0];
|
|
20
|
-
}
|
|
21
|
-
if (fieldSectionIds.size > 1) {
|
|
22
|
-
throw new Error(`Could not resolve one existing manifest section for key "${sectionKey}" on "${customObjectApiName}". ` +
|
|
23
|
-
`Fields in that section resolved to multiple section ids: ${[...fieldSectionIds]
|
|
24
|
-
.sort()
|
|
25
|
-
.join(', ')}. ` +
|
|
26
|
-
'Add a stable sectionId to the typed definition to disambiguate.');
|
|
27
|
-
}
|
|
28
|
-
throw new Error(`Could not resolve existing manifest section key "${sectionKey}" for "${customObjectApiName}". ` +
|
|
29
|
-
'Add a stable sectionId to the typed definition or ensure at least one field in that section already exists in the manifest.');
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
33
|
-
*
|
|
34
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
35
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
36
|
-
* sections, layouts, and actions one by one.
|
|
37
|
-
*
|
|
38
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
39
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
40
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
41
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
42
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
43
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
44
|
-
*
|
|
45
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
46
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
47
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
48
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
49
|
-
*/
|
|
50
|
-
export function bindExistingManifestCustomObject(definition, options = {}) {
|
|
51
|
-
const context = getExistingManifestContext(options);
|
|
52
|
-
const customObjectApiName = options.customObjectApiName ?? definition.apiName;
|
|
53
|
-
const categoryApiName = options.categoryApiName ?? definition.categoryApiName;
|
|
54
|
-
const category = context.loadCategory(categoryApiName);
|
|
55
|
-
const object = context.loadCustomObject(customObjectApiName);
|
|
56
|
-
const sections = Object.freeze(Object.fromEntries(Object.keys(definition.sections).map((sectionKey) => {
|
|
57
|
-
const sectionId = resolveSectionId(definition, sectionKey, customObjectApiName, context);
|
|
58
|
-
return [
|
|
59
|
-
sectionKey,
|
|
60
|
-
context.loadFieldSection(sectionId, {
|
|
61
|
-
customObjectApiName,
|
|
62
|
-
}),
|
|
63
|
-
];
|
|
64
|
-
})));
|
|
65
|
-
const fields = Object.freeze(Object.fromEntries(Object.keys(definition.fields).map((fieldName) => [
|
|
66
|
-
fieldName,
|
|
67
|
-
context.loadField(definition.fields[fieldName].apiName, {
|
|
68
|
-
customObjectApiName,
|
|
69
|
-
}),
|
|
70
|
-
])));
|
|
71
|
-
return Object.freeze({
|
|
72
|
-
context,
|
|
73
|
-
definition,
|
|
74
|
-
category,
|
|
75
|
-
object,
|
|
76
|
-
sections,
|
|
77
|
-
fields,
|
|
78
|
-
loadListView(viewId) {
|
|
79
|
-
return context.loadListView(viewId, { customObjectApiName });
|
|
80
|
-
},
|
|
81
|
-
loadPageLayout(layoutIdOrApiName) {
|
|
82
|
-
return context.loadPageLayout(layoutIdOrApiName, { customObjectApiName });
|
|
83
|
-
},
|
|
84
|
-
loadValidation(ruleId) {
|
|
85
|
-
return context.loadValidation(ruleId, { customObjectApiName });
|
|
86
|
-
},
|
|
87
|
-
loadRule(flowId) {
|
|
88
|
-
return context.loadRule(flowId, { customObjectApiName });
|
|
89
|
-
},
|
|
90
|
-
loadAction(actionId) {
|
|
91
|
-
return context.loadCustomObjectAction(actionId, { customObjectApiName });
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
97
|
-
*
|
|
98
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
99
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
100
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
101
|
-
*/
|
|
102
|
-
export function bindExistingManifestCustomObjects(options) {
|
|
103
|
-
return options.definitions.map((definition) => options.context != null ?
|
|
104
|
-
bindExistingManifestCustomObject(definition, {
|
|
105
|
-
context: options.context,
|
|
106
|
-
})
|
|
107
|
-
: bindExistingManifestCustomObject(definition));
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=existing.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"existing.mjs","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/existing.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,+DAA2D;AAoEhG,SAAS,gBAAgB,CACvB,UAAuB,EACvB,UAA0D,EAC1D,mBAA2B,EAC3B,OAAgC;IAEhC,MAAM,OAA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V,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,MAAM;QACN,YAAY,CAAC,MAAc;YACzB,OAAO,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,cAAc,CAAC,iBAAyB;YACtC,OAAO,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,cAAc,CAAC,MAAc;YAC3B,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,QAAQ,CAAC,MAAc;YACrB,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,UAAU,CAAC,QAAgB;YACzB,OAAO,OAAO,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAC/C,OAA+D;IAE/D,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAC5C,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;QACvB,gCAAgC,CAAC,UAAU,EAAE;YAC3C,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;QACJ,CAAC,CAAC,gCAAgC,CAAC,UAAU,CAAC,CACI,CAAC;AACvD,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Field } from "../../../../lib/manifest.mjs";
|
|
2
|
-
import type { AnyCustomObjectDefinition, FieldNames, StandardRecordFields } from "../../custom-objects/types.mjs";
|
|
3
|
-
import type { ManifestRegistration } from "./types.mjs";
|
|
4
|
-
/**
|
|
5
|
-
* Standard field-name strings accepted by typed manifest helpers.
|
|
6
|
-
*
|
|
7
|
-
* These names intentionally use the record-shape snake_case surface rather than
|
|
8
|
-
* the low-level manifest layer's camelCase aliases so authoring stays aligned
|
|
9
|
-
* with typed records, validators, and create/update payload helpers.
|
|
10
|
-
*
|
|
11
|
-
* @typeParam TDefinition - Object definition whose standard record fields should be exposed.
|
|
12
|
-
*/
|
|
13
|
-
export type StandardManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = Extract<keyof StandardRecordFields<TDefinition>, string>;
|
|
14
|
-
/**
|
|
15
|
-
* Field-name strings accepted by typed manifest helpers.
|
|
16
|
-
*
|
|
17
|
-
* The union combines the standard per-record fields present on every custom
|
|
18
|
-
* object with the logical custom-field names declared in the typed schema.
|
|
19
|
-
*
|
|
20
|
-
* @typeParam TDefinition - Object definition whose valid field-name strings should be exposed.
|
|
21
|
-
*/
|
|
22
|
-
export type TypedManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = StandardManifestFieldName<TDefinition> | FieldNames<TDefinition>;
|
|
23
|
-
/**
|
|
24
|
-
* Field inputs accepted by typed manifest helpers.
|
|
25
|
-
*
|
|
26
|
-
* Strings provide object-specific IntelliSense for standard and custom fields.
|
|
27
|
-
* Concrete manifest {@link Field} references remain allowed for computed fields
|
|
28
|
-
* such as summary fields that are created after the base schema is registered.
|
|
29
|
-
*
|
|
30
|
-
* @typeParam TDefinition - Object definition whose manifest field inputs are being authored.
|
|
31
|
-
*/
|
|
32
|
-
export type TypedManifestFieldInput<TDefinition extends AnyCustomObjectDefinition> = TypedManifestFieldName<TDefinition> | Field;
|
|
33
|
-
/**
|
|
34
|
-
* Resolves one typed manifest field input into the concrete manifest {@link Field} instance.
|
|
35
|
-
*
|
|
36
|
-
* Assumptions:
|
|
37
|
-
* - standard field names should autocomplete as snake_case strings
|
|
38
|
-
* - custom typed fields should resolve from the manifest registration returned by
|
|
39
|
-
* the typed manifest registration helper
|
|
40
|
-
* - computed fields like summary fields may still be passed directly as manifest field objects
|
|
41
|
-
*
|
|
42
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
43
|
-
* @param field - Typed field input to resolve.
|
|
44
|
-
* @returns Concrete manifest field instance suitable for low-level manifest APIs.
|
|
45
|
-
* @typeParam TDefinition - Object definition whose field reference is being resolved.
|
|
46
|
-
*/
|
|
47
|
-
export declare function resolveTypedManifestField<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, field: TypedManifestFieldInput<TDefinition>): Field;
|
|
48
|
-
//# sourceMappingURL=field-resolution.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-resolution.d.mts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/field-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,KAAK,EAAE,qCAAiC;AACxF,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,oBAAoB,EAAE,uCAAmC;AAC9G,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAgB;AAgBpD;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,IAAI,OAAO,CAC5F,MAAM,oBAAoB,CAAC,WAAW,CAAC,EACvC,MAAM,CACP,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,CAAC,WAAW,SAAS,yBAAyB,IAC5E,yBAAyB,CAAC,WAAW,CAAC,GACtC,UAAU,CAAC,WAAW,CAAC,CAAC;AAE5B;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,CAAC,WAAW,SAAS,yBAAyB,IAC7E,sBAAsB,CAAC,WAAW,CAAC,GACnC,KAAK,CAAC;AAiBV;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,EACrF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAC1C,KAAK,CA0BP"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Field } from "../../../../lib/manifest.js";
|
|
2
|
-
import type { AnyCustomObjectDefinition, FieldNames, StandardRecordFields } from "../../custom-objects/types.js";
|
|
3
|
-
import type { ManifestRegistration } from "./types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Standard field-name strings accepted by typed manifest helpers.
|
|
6
|
-
*
|
|
7
|
-
* These names intentionally use the record-shape snake_case surface rather than
|
|
8
|
-
* the low-level manifest layer's camelCase aliases so authoring stays aligned
|
|
9
|
-
* with typed records, validators, and create/update payload helpers.
|
|
10
|
-
*
|
|
11
|
-
* @typeParam TDefinition - Object definition whose standard record fields should be exposed.
|
|
12
|
-
*/
|
|
13
|
-
export type StandardManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = Extract<keyof StandardRecordFields<TDefinition>, string>;
|
|
14
|
-
/**
|
|
15
|
-
* Field-name strings accepted by typed manifest helpers.
|
|
16
|
-
*
|
|
17
|
-
* The union combines the standard per-record fields present on every custom
|
|
18
|
-
* object with the logical custom-field names declared in the typed schema.
|
|
19
|
-
*
|
|
20
|
-
* @typeParam TDefinition - Object definition whose valid field-name strings should be exposed.
|
|
21
|
-
*/
|
|
22
|
-
export type TypedManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = StandardManifestFieldName<TDefinition> | FieldNames<TDefinition>;
|
|
23
|
-
/**
|
|
24
|
-
* Field inputs accepted by typed manifest helpers.
|
|
25
|
-
*
|
|
26
|
-
* Strings provide object-specific IntelliSense for standard and custom fields.
|
|
27
|
-
* Concrete manifest {@link Field} references remain allowed for computed fields
|
|
28
|
-
* such as summary fields that are created after the base schema is registered.
|
|
29
|
-
*
|
|
30
|
-
* @typeParam TDefinition - Object definition whose manifest field inputs are being authored.
|
|
31
|
-
*/
|
|
32
|
-
export type TypedManifestFieldInput<TDefinition extends AnyCustomObjectDefinition> = TypedManifestFieldName<TDefinition> | Field;
|
|
33
|
-
/**
|
|
34
|
-
* Resolves one typed manifest field input into the concrete manifest {@link Field} instance.
|
|
35
|
-
*
|
|
36
|
-
* Assumptions:
|
|
37
|
-
* - standard field names should autocomplete as snake_case strings
|
|
38
|
-
* - custom typed fields should resolve from the manifest registration returned by
|
|
39
|
-
* the typed manifest registration helper
|
|
40
|
-
* - computed fields like summary fields may still be passed directly as manifest field objects
|
|
41
|
-
*
|
|
42
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
43
|
-
* @param field - Typed field input to resolve.
|
|
44
|
-
* @returns Concrete manifest field instance suitable for low-level manifest APIs.
|
|
45
|
-
* @typeParam TDefinition - Object definition whose field reference is being resolved.
|
|
46
|
-
*/
|
|
47
|
-
export declare function resolveTypedManifestField<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, field: TypedManifestFieldInput<TDefinition>): Field;
|
|
48
|
-
//# sourceMappingURL=field-resolution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-resolution.d.ts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/field-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,KAAK,EAAE,oCAAiC;AACxF,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,oBAAoB,EAAE,sCAAmC;AAC9G,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAgB;AAgBpD;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,IAAI,OAAO,CAC5F,MAAM,oBAAoB,CAAC,WAAW,CAAC,EACvC,MAAM,CACP,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,CAAC,WAAW,SAAS,yBAAyB,IAC5E,yBAAyB,CAAC,WAAW,CAAC,GACtC,UAAU,CAAC,WAAW,CAAC,CAAC;AAE5B;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,CAAC,WAAW,SAAS,yBAAyB,IAC7E,sBAAsB,CAAC,WAAW,CAAC,GACnC,KAAK,CAAC;AAiBV;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,EACrF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAC1C,KAAK,CA0BP"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveTypedManifestField = resolveTypedManifestField;
|
|
4
|
-
const STANDARD_TYPED_MANIFEST_FIELD_NAMES = [
|
|
5
|
-
'id',
|
|
6
|
-
'name',
|
|
7
|
-
'created_at',
|
|
8
|
-
'updated_at',
|
|
9
|
-
'system_updated_at',
|
|
10
|
-
'external_id',
|
|
11
|
-
'owner_role',
|
|
12
|
-
'created_by',
|
|
13
|
-
'last_modified_by',
|
|
14
|
-
];
|
|
15
|
-
const STANDARD_TYPED_MANIFEST_FIELD_NAME_SET = new Set(STANDARD_TYPED_MANIFEST_FIELD_NAMES);
|
|
16
|
-
/**
|
|
17
|
-
* Type-safe `hasOwnProperty` helper for typed manifest field resolution.
|
|
18
|
-
*
|
|
19
|
-
* @param value - Object whose own properties should be checked.
|
|
20
|
-
* @param key - Candidate property key.
|
|
21
|
-
* @returns Whether the object owns that property.
|
|
22
|
-
* @typeParam TObject - Object type being narrowed.
|
|
23
|
-
*/
|
|
24
|
-
function hasOwn(value, key) {
|
|
25
|
-
return Object.prototype.hasOwnProperty.call(value, key);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Resolves one typed manifest field input into the concrete manifest {@link Field} instance.
|
|
29
|
-
*
|
|
30
|
-
* Assumptions:
|
|
31
|
-
* - standard field names should autocomplete as snake_case strings
|
|
32
|
-
* - custom typed fields should resolve from the manifest registration returned by
|
|
33
|
-
* the typed manifest registration helper
|
|
34
|
-
* - computed fields like summary fields may still be passed directly as manifest field objects
|
|
35
|
-
*
|
|
36
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
37
|
-
* @param field - Typed field input to resolve.
|
|
38
|
-
* @returns Concrete manifest field instance suitable for low-level manifest APIs.
|
|
39
|
-
* @typeParam TDefinition - Object definition whose field reference is being resolved.
|
|
40
|
-
*/
|
|
41
|
-
function resolveTypedManifestField(registration, field) {
|
|
42
|
-
if (typeof field !== 'string')
|
|
43
|
-
return field;
|
|
44
|
-
const matchesCustomField = hasOwn(registration.fields, field);
|
|
45
|
-
const matchesStandardField = STANDARD_TYPED_MANIFEST_FIELD_NAME_SET.has(field);
|
|
46
|
-
if (matchesCustomField && matchesStandardField) {
|
|
47
|
-
throw new Error(`Field name "${field}" is ambiguous on "${registration.definition.apiName}" because it matches both a standard field and a custom field. ` +
|
|
48
|
-
'Pass an explicit manifest field reference instead.');
|
|
49
|
-
}
|
|
50
|
-
if (matchesCustomField)
|
|
51
|
-
return registration.fields[field];
|
|
52
|
-
if (matchesStandardField) {
|
|
53
|
-
return registration.object.standardField(field);
|
|
54
|
-
}
|
|
55
|
-
const validFieldNames = [
|
|
56
|
-
...STANDARD_TYPED_MANIFEST_FIELD_NAMES,
|
|
57
|
-
...Object.keys(registration.fields).sort(),
|
|
58
|
-
];
|
|
59
|
-
throw new Error(`Unknown field name "${field}" for "${registration.definition.apiName}". Valid field names: ${validFieldNames.join(', ')}.`);
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=field-resolution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-resolution.js","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/field-resolution.ts"],"names":[],"mappings":";;AAsFA,8DA6BC;AA/GD,MAAM,mCAAmC,GAAG;IAC1C,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,kBAAkB;CACgE,CAAC;AAErF,MAAM,sCAAsC,GAAG,IAAI,GAAG,CAAS,mC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-
'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
|
-
const STANDARD_TYPED_MANIFEST_FIELD_NAME_SET = new Set(STANDARD_TYPED_MANIFEST_FIELD_NAMES);
|
|
13
|
-
/**
|
|
14
|
-
* Type-safe `hasOwnProperty` helper for typed manifest field resolution.
|
|
15
|
-
*
|
|
16
|
-
* @param value - Object whose own properties should be checked.
|
|
17
|
-
* @param key - Candidate property key.
|
|
18
|
-
* @returns Whether the object owns that property.
|
|
19
|
-
* @typeParam TObject - Object type being narrowed.
|
|
20
|
-
*/
|
|
21
|
-
function hasOwn(value, key) {
|
|
22
|
-
return Object.prototype.hasOwnProperty.call(value, key);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Resolves one typed manifest field input into the concrete manifest {@link Field} instance.
|
|
26
|
-
*
|
|
27
|
-
* Assumptions:
|
|
28
|
-
* - standard field names should autocomplete as snake_case strings
|
|
29
|
-
* - custom typed fields should resolve from the manifest registration returned by
|
|
30
|
-
* the typed manifest registration helper
|
|
31
|
-
* - computed fields like summary fields may still be passed directly as manifest field objects
|
|
32
|
-
*
|
|
33
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
34
|
-
* @param field - Typed field input to resolve.
|
|
35
|
-
* @returns Concrete manifest field instance suitable for low-level manifest APIs.
|
|
36
|
-
* @typeParam TDefinition - Object definition whose field reference is being resolved.
|
|
37
|
-
*/
|
|
38
|
-
export function resolveTypedManifestField(registration, field) {
|
|
39
|
-
if (typeof field !== 'string')
|
|
40
|
-
return field;
|
|
41
|
-
const matchesCustomField = hasOwn(registration.fields, field);
|
|
42
|
-
const matchesStandardField = STANDARD_TYPED_MANIFEST_FIELD_NAME_SET.has(field);
|
|
43
|
-
if (matchesCustomField && matchesStandardField) {
|
|
44
|
-
throw new Error(`Field name "${field}" is ambiguous on "${registration.definition.apiName}" because it matches both a standard field and a custom field. ` +
|
|
45
|
-
'Pass an explicit manifest field reference instead.');
|
|
46
|
-
}
|
|
47
|
-
if (matchesCustomField)
|
|
48
|
-
return registration.fields[field];
|
|
49
|
-
if (matchesStandardField) {
|
|
50
|
-
return registration.object.standardField(field);
|
|
51
|
-
}
|
|
52
|
-
const validFieldNames = [
|
|
53
|
-
...STANDARD_TYPED_MANIFEST_FIELD_NAMES,
|
|
54
|
-
...Object.keys(registration.fields).sort(),
|
|
55
|
-
];
|
|
56
|
-
throw new Error(`Unknown field name "${field}" for "${registration.definition.apiName}". Valid field names: ${validFieldNames.join(', ')}.`);
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=field-resolution.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-resolution.mjs","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/field-resolution.ts"],"names":[],"mappings":"AAIA,MAAM,mCAAmC,GAAG;IAC1C,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,kBAAkB;CACgE,CAAC;AAErF,MAAM,sCAAsC,GAAG,IAAI,GAAG,CAAS,mCAAmC,CAAC,CAAC;AAyCpG;;;;;;;GAOG;AACH,SAAS,MAAM,CACb,KAAc,EACd,GAAgB;IAEhB,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAA+C,EAC/C,KAA2C;IAE3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE5C,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9D,MAAM,oBAAoB,GAAG,sCAAsC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAE/E,IAAI,kBAAkB,IAAI,oBAAoB,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACb,eAAe,KAAK,sBAAsB,YAAY,CAAC,UAAU,CAAC,OAAO,iEAAiE;YACxI,oDAAoD,CACvD,CAAC;IACJ,CAAC;IACD,IAAI,kBAAkB;QAAE,OAAO,YAAY,CAAC,MAAM,CAAC,KAAgC,CAAqB,CAAC;IACzG,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,KAAyC,CAAC,CAAC;IACtF,CAAC;IAED,MAAM,eAAe,GAAG;QACtB,GAAG,mCAAmC;QACtC,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE;KAC3C,CAAC;IACF,MAAM,IAAI,KAAK,CACb,uBAAuB,KAAK,UAC1B,YAAY,CAAC,UAAU,CAAC,OAC1B,yBAAyB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { ManifestFunction, type ManifestFunctionProps, SduiPage, type SduiPageProps, type Workflow } from "../../../../lib/manifest.mjs";
|
|
2
|
-
import type { ManifestScope } from "../../../../lib/manifest/manifest-builder.mjs";
|
|
3
|
-
import type { AnyCustomObjectDefinition } from "../../custom-objects/types.mjs";
|
|
4
|
-
import { type TypedWorkflowProps } from "./workflow.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* Shared properties for helpers that load manifest function source code from a
|
|
7
|
-
* file on disk.
|
|
8
|
-
*/
|
|
9
|
-
export interface ManifestFunctionFileSource {
|
|
10
|
-
/** Directory containing the function source file. */
|
|
11
|
-
readonly codeDirectory: string;
|
|
12
|
-
/** File name to read from {@link codeDirectory}. */
|
|
13
|
-
readonly codeFilename: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Initialization properties for {@link defineManifestFunctionFromFile}.
|
|
17
|
-
*/
|
|
18
|
-
export interface ManifestFunctionFromFileProps extends Omit<ManifestFunctionProps, 'code'>, ManifestFunctionFileSource {
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Initialization properties for {@link defineSduiPageFromFunctionFile}.
|
|
22
|
-
*/
|
|
23
|
-
export interface SduiPageFromFunctionFileProps extends Omit<SduiPageProps, 'function' | 'name' | 'sduiPageId'>, ManifestFunctionFromFileProps {
|
|
24
|
-
/** Unique identifier for the SDUI page. */
|
|
25
|
-
readonly pageId: string;
|
|
26
|
-
/** Display name shown as the app tab label. */
|
|
27
|
-
readonly pageName: string;
|
|
28
|
-
}
|
|
29
|
-
/** Result returned by {@link defineSduiPageFromFunctionFile}. */
|
|
30
|
-
export interface SduiPageFromFunctionFileResult {
|
|
31
|
-
/** Manifest function created from the provided source file. */
|
|
32
|
-
readonly function: ManifestFunction;
|
|
33
|
-
/** SDUI page wired to the created manifest function. */
|
|
34
|
-
readonly page: SduiPage;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Initialization properties for {@link defineTypedWorkflowFromFunctionFile}.
|
|
38
|
-
*
|
|
39
|
-
* @typeParam TDefinition - Typed custom-object definition carried by the workflow trigger.
|
|
40
|
-
*/
|
|
41
|
-
export interface TypedWorkflowFromFunctionFileProps<TDefinition extends AnyCustomObjectDefinition = AnyCustomObjectDefinition> extends Omit<TypedWorkflowProps<TDefinition>, 'function'> {
|
|
42
|
-
/** Function metadata and source-file location for the workflow handler. */
|
|
43
|
-
readonly function: ManifestFunctionFromFileProps;
|
|
44
|
-
}
|
|
45
|
-
/** Result returned by {@link defineTypedWorkflowFromFunctionFile}. */
|
|
46
|
-
export interface TypedWorkflowFromFunctionFileResult {
|
|
47
|
-
/** Manifest function created from the provided source file. */
|
|
48
|
-
readonly function: ManifestFunction;
|
|
49
|
-
/** Workflow wired to the created manifest function. */
|
|
50
|
-
readonly workflow: Workflow;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Loads one manifest function source file from disk.
|
|
54
|
-
*
|
|
55
|
-
* @param source - Directory + file-name pair describing the source file to read.
|
|
56
|
-
* @returns UTF-8 TypeScript handler source.
|
|
57
|
-
*/
|
|
58
|
-
export declare function loadManifestFunctionCode(source: ManifestFunctionFileSource): string;
|
|
59
|
-
/**
|
|
60
|
-
* Defines one manifest function by loading its handler source code from disk.
|
|
61
|
-
*
|
|
62
|
-
* @param scope - Manifest scope that should own the function.
|
|
63
|
-
* @param props - Function properties plus the source-file location.
|
|
64
|
-
* @returns Manifest function registered in the provided scope.
|
|
65
|
-
*/
|
|
66
|
-
export declare function defineManifestFunctionFromFile(scope: ManifestScope, props: ManifestFunctionFromFileProps): ManifestFunction;
|
|
67
|
-
/**
|
|
68
|
-
* Defines one SDUI page and its backing manifest function from a source file.
|
|
69
|
-
*
|
|
70
|
-
* @param scope - Manifest scope that should own the function and page.
|
|
71
|
-
* @param props - Function properties, source-file location, and page wiring metadata.
|
|
72
|
-
* @returns Created manifest function plus the SDUI page wired to it.
|
|
73
|
-
*/
|
|
74
|
-
export declare function defineSduiPageFromFunctionFile(scope: ManifestScope, props: SduiPageFromFunctionFileProps): SduiPageFromFunctionFileResult;
|
|
75
|
-
/**
|
|
76
|
-
* Defines one workflow and its backing manifest function from a source file.
|
|
77
|
-
*
|
|
78
|
-
* Prefer this helper when one workflow owns one colocated handler file and the
|
|
79
|
-
* caller wants the file loading plus workflow wiring in one step.
|
|
80
|
-
*
|
|
81
|
-
* @param scope - Manifest scope that should own the function and workflow.
|
|
82
|
-
* @param props - Workflow properties plus the function source-file location.
|
|
83
|
-
* @returns Created manifest function plus the workflow wired to it.
|
|
84
|
-
* @typeParam TDefinition - Typed custom-object definition carried by the workflow trigger.
|
|
85
|
-
*/
|
|
86
|
-
export declare function defineTypedWorkflowFromFunctionFile<TDefinition extends AnyCustomObjectDefinition = AnyCustomObjectDefinition>(scope: ManifestScope, props: TypedWorkflowFromFunctionFileProps<TDefinition>): TypedWorkflowFromFunctionFileResult;
|
|
87
|
-
//# sourceMappingURL=function-file.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-file.d.mts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/function-file.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,QAAQ,EACd,qCAAiC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,sDAAkD;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,uCAAmC;AAC5E,OAAO,EAAuB,KAAK,kBAAkB,EAAE,uBAAmB;AAE1E;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,6BACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,EACzC,0BAA0B;CAAG;AAEjC;;GAEG;AACH,MAAM,WAAW,6BACf,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,EAC7D,6BAA6B;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,iEAAiE;AACjE,MAAM,WAAW,8BAA8B;IAC7C,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC,CACjD,WAAW,SAAS,yBAAyB,GAAG,yBAAyB,CACzE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACzD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,6BAA6B,CAAC;CAClD;AAED,sEAAsE;AACtE,MAAM,WAAW,mCAAmC;IAClD,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,0BAA0B,GAAG,MAAM,CAEnF;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,6BAA6B,GACnC,gBAAgB,CAMlB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,6BAA6B,GACnC,8BAA8B,CAWhC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mCAAmC,CACjD,WAAW,SAAS,yBAAyB,GAAG,yBAAyB,EAEzE,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,kCAAkC,CAAC,WAAW,CAAC,GACrD,mCAAmC,CAUrC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { ManifestFunction, type ManifestFunctionProps, SduiPage, type SduiPageProps, type Workflow } from "../../../../lib/manifest.js";
|
|
2
|
-
import type { ManifestScope } from "../../../../lib/manifest/manifest-builder.js";
|
|
3
|
-
import type { AnyCustomObjectDefinition } from "../../custom-objects/types.js";
|
|
4
|
-
import { type TypedWorkflowProps } from "./workflow.js";
|
|
5
|
-
/**
|
|
6
|
-
* Shared properties for helpers that load manifest function source code from a
|
|
7
|
-
* file on disk.
|
|
8
|
-
*/
|
|
9
|
-
export interface ManifestFunctionFileSource {
|
|
10
|
-
/** Directory containing the function source file. */
|
|
11
|
-
readonly codeDirectory: string;
|
|
12
|
-
/** File name to read from {@link codeDirectory}. */
|
|
13
|
-
readonly codeFilename: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Initialization properties for {@link defineManifestFunctionFromFile}.
|
|
17
|
-
*/
|
|
18
|
-
export interface ManifestFunctionFromFileProps extends Omit<ManifestFunctionProps, 'code'>, ManifestFunctionFileSource {
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Initialization properties for {@link defineSduiPageFromFunctionFile}.
|
|
22
|
-
*/
|
|
23
|
-
export interface SduiPageFromFunctionFileProps extends Omit<SduiPageProps, 'function' | 'name' | 'sduiPageId'>, ManifestFunctionFromFileProps {
|
|
24
|
-
/** Unique identifier for the SDUI page. */
|
|
25
|
-
readonly pageId: string;
|
|
26
|
-
/** Display name shown as the app tab label. */
|
|
27
|
-
readonly pageName: string;
|
|
28
|
-
}
|
|
29
|
-
/** Result returned by {@link defineSduiPageFromFunctionFile}. */
|
|
30
|
-
export interface SduiPageFromFunctionFileResult {
|
|
31
|
-
/** Manifest function created from the provided source file. */
|
|
32
|
-
readonly function: ManifestFunction;
|
|
33
|
-
/** SDUI page wired to the created manifest function. */
|
|
34
|
-
readonly page: SduiPage;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Initialization properties for {@link defineTypedWorkflowFromFunctionFile}.
|
|
38
|
-
*
|
|
39
|
-
* @typeParam TDefinition - Typed custom-object definition carried by the workflow trigger.
|
|
40
|
-
*/
|
|
41
|
-
export interface TypedWorkflowFromFunctionFileProps<TDefinition extends AnyCustomObjectDefinition = AnyCustomObjectDefinition> extends Omit<TypedWorkflowProps<TDefinition>, 'function'> {
|
|
42
|
-
/** Function metadata and source-file location for the workflow handler. */
|
|
43
|
-
readonly function: ManifestFunctionFromFileProps;
|
|
44
|
-
}
|
|
45
|
-
/** Result returned by {@link defineTypedWorkflowFromFunctionFile}. */
|
|
46
|
-
export interface TypedWorkflowFromFunctionFileResult {
|
|
47
|
-
/** Manifest function created from the provided source file. */
|
|
48
|
-
readonly function: ManifestFunction;
|
|
49
|
-
/** Workflow wired to the created manifest function. */
|
|
50
|
-
readonly workflow: Workflow;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Loads one manifest function source file from disk.
|
|
54
|
-
*
|
|
55
|
-
* @param source - Directory + file-name pair describing the source file to read.
|
|
56
|
-
* @returns UTF-8 TypeScript handler source.
|
|
57
|
-
*/
|
|
58
|
-
export declare function loadManifestFunctionCode(source: ManifestFunctionFileSource): string;
|
|
59
|
-
/**
|
|
60
|
-
* Defines one manifest function by loading its handler source code from disk.
|
|
61
|
-
*
|
|
62
|
-
* @param scope - Manifest scope that should own the function.
|
|
63
|
-
* @param props - Function properties plus the source-file location.
|
|
64
|
-
* @returns Manifest function registered in the provided scope.
|
|
65
|
-
*/
|
|
66
|
-
export declare function defineManifestFunctionFromFile(scope: ManifestScope, props: ManifestFunctionFromFileProps): ManifestFunction;
|
|
67
|
-
/**
|
|
68
|
-
* Defines one SDUI page and its backing manifest function from a source file.
|
|
69
|
-
*
|
|
70
|
-
* @param scope - Manifest scope that should own the function and page.
|
|
71
|
-
* @param props - Function properties, source-file location, and page wiring metadata.
|
|
72
|
-
* @returns Created manifest function plus the SDUI page wired to it.
|
|
73
|
-
*/
|
|
74
|
-
export declare function defineSduiPageFromFunctionFile(scope: ManifestScope, props: SduiPageFromFunctionFileProps): SduiPageFromFunctionFileResult;
|
|
75
|
-
/**
|
|
76
|
-
* Defines one workflow and its backing manifest function from a source file.
|
|
77
|
-
*
|
|
78
|
-
* Prefer this helper when one workflow owns one colocated handler file and the
|
|
79
|
-
* caller wants the file loading plus workflow wiring in one step.
|
|
80
|
-
*
|
|
81
|
-
* @param scope - Manifest scope that should own the function and workflow.
|
|
82
|
-
* @param props - Workflow properties plus the function source-file location.
|
|
83
|
-
* @returns Created manifest function plus the workflow wired to it.
|
|
84
|
-
* @typeParam TDefinition - Typed custom-object definition carried by the workflow trigger.
|
|
85
|
-
*/
|
|
86
|
-
export declare function defineTypedWorkflowFromFunctionFile<TDefinition extends AnyCustomObjectDefinition = AnyCustomObjectDefinition>(scope: ManifestScope, props: TypedWorkflowFromFunctionFileProps<TDefinition>): TypedWorkflowFromFunctionFileResult;
|
|
87
|
-
//# sourceMappingURL=function-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-file.d.ts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/function-file.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,QAAQ,EACd,oCAAiC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,qDAAkD;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,sCAAmC;AAC5E,OAAO,EAAuB,KAAK,kBAAkB,EAAE,sBAAmB;AAE1E;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,6BACf,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,EACzC,0BAA0B;CAAG;AAEjC;;GAEG;AACH,MAAM,WAAW,6BACf,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,EAC7D,6BAA6B;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,iEAAiE;AACjE,MAAM,WAAW,8BAA8B;IAC7C,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC,CACjD,WAAW,SAAS,yBAAyB,GAAG,yBAAyB,CACzE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACzD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,6BAA6B,CAAC;CAClD;AAED,sEAAsE;AACtE,MAAM,WAAW,mCAAmC;IAClD,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,0BAA0B,GAAG,MAAM,CAEnF;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,6BAA6B,GACnC,gBAAgB,CAMlB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,6BAA6B,GACnC,8BAA8B,CAWhC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mCAAmC,CACjD,WAAW,SAAS,yBAAyB,GAAG,yBAAyB,EAEzE,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,kCAAkC,CAAC,WAAW,CAAC,GACrD,mCAAmC,CAUrC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadManifestFunctionCode = loadManifestFunctionCode;
|
|
4
|
-
exports.defineManifestFunctionFromFile = defineManifestFunctionFromFile;
|
|
5
|
-
exports.defineSduiPageFromFunctionFile = defineSduiPageFromFunctionFile;
|
|
6
|
-
exports.defineTypedWorkflowFromFunctionFile = defineTypedWorkflowFromFunctionFile;
|
|
7
|
-
const tslib_1 = require("../../../../internal/tslib.js");
|
|
8
|
-
const fs = tslib_1.__importStar(require("node:fs"));
|
|
9
|
-
const path = tslib_1.__importStar(require("node:path"));
|
|
10
|
-
const manifest_1 = require("../../../../lib/manifest.js");
|
|
11
|
-
const workflow_1 = require("./workflow.js");
|
|
12
|
-
/**
|
|
13
|
-
* Loads one manifest function source file from disk.
|
|
14
|
-
*
|
|
15
|
-
* @param source - Directory + file-name pair describing the source file to read.
|
|
16
|
-
* @returns UTF-8 TypeScript handler source.
|
|
17
|
-
*/
|
|
18
|
-
function loadManifestFunctionCode(source) {
|
|
19
|
-
return fs.readFileSync(path.join(source.codeDirectory, source.codeFilename), 'utf-8');
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Defines one manifest function by loading its handler source code from disk.
|
|
23
|
-
*
|
|
24
|
-
* @param scope - Manifest scope that should own the function.
|
|
25
|
-
* @param props - Function properties plus the source-file location.
|
|
26
|
-
* @returns Manifest function registered in the provided scope.
|
|
27
|
-
*/
|
|
28
|
-
function defineManifestFunctionFromFile(scope, props) {
|
|
29
|
-
const { codeDirectory, codeFilename, ...rest } = props;
|
|
30
|
-
return new manifest_1.ManifestFunction(scope, {
|
|
31
|
-
...rest,
|
|
32
|
-
code: loadManifestFunctionCode({ codeDirectory, codeFilename }),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Defines one SDUI page and its backing manifest function from a source file.
|
|
37
|
-
*
|
|
38
|
-
* @param scope - Manifest scope that should own the function and page.
|
|
39
|
-
* @param props - Function properties, source-file location, and page wiring metadata.
|
|
40
|
-
* @returns Created manifest function plus the SDUI page wired to it.
|
|
41
|
-
*/
|
|
42
|
-
function defineSduiPageFromFunctionFile(scope, props) {
|
|
43
|
-
const { pageId, pageName, ...functionProps } = props;
|
|
44
|
-
const createdFunction = defineManifestFunctionFromFile(scope, functionProps);
|
|
45
|
-
return {
|
|
46
|
-
function: createdFunction,
|
|
47
|
-
page: new manifest_1.SduiPage(scope, {
|
|
48
|
-
sduiPageId: pageId,
|
|
49
|
-
name: pageName,
|
|
50
|
-
function: createdFunction,
|
|
51
|
-
}),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Defines one workflow and its backing manifest function from a source file.
|
|
56
|
-
*
|
|
57
|
-
* Prefer this helper when one workflow owns one colocated handler file and the
|
|
58
|
-
* caller wants the file loading plus workflow wiring in one step.
|
|
59
|
-
*
|
|
60
|
-
* @param scope - Manifest scope that should own the function and workflow.
|
|
61
|
-
* @param props - Workflow properties plus the function source-file location.
|
|
62
|
-
* @returns Created manifest function plus the workflow wired to it.
|
|
63
|
-
* @typeParam TDefinition - Typed custom-object definition carried by the workflow trigger.
|
|
64
|
-
*/
|
|
65
|
-
function defineTypedWorkflowFromFunctionFile(scope, props) {
|
|
66
|
-
const { function: functionProps, ...workflowProps } = props;
|
|
67
|
-
const createdFunction = defineManifestFunctionFromFile(scope, functionProps);
|
|
68
|
-
return {
|
|
69
|
-
function: createdFunction,
|
|
70
|
-
workflow: (0, workflow_1.defineTypedWorkflow)(scope, {
|
|
71
|
-
...workflowProps,
|
|
72
|
-
function: createdFunction,
|
|
73
|
-
}),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=function-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-file.js","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/function-file.ts"],"names":[],"mappings":";;AA6EA,4DAEC;AASD,wEASC;AASD,wEAcC;AAaD,kFAeC;;AApJD,oDAA8B;AAC9B,wDAAkC;AAClC,0DAMkC;AAGlC,4CAA0E;AA4D1E;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,MAAkC;IACzE,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AACxF,CAAC;AAED;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