@servicenow/sdk-build-plugins 4.4.1 → 4.6.0
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/dist/acl-plugin.js +54 -4
- package/dist/acl-plugin.js.map +1 -1
- package/dist/applicability-plugin.js +2 -0
- package/dist/applicability-plugin.js.map +1 -1
- package/dist/application-menu-plugin.js +2 -0
- package/dist/application-menu-plugin.js.map +1 -1
- package/dist/arrow-function-plugin.d.ts +6 -1
- package/dist/arrow-function-plugin.js +105 -12
- package/dist/arrow-function-plugin.js.map +1 -1
- package/dist/atf/test-plugin.js +2 -0
- package/dist/atf/test-plugin.js.map +1 -1
- package/dist/basic-syntax-plugin.js +20 -0
- package/dist/basic-syntax-plugin.js.map +1 -1
- package/dist/call-expression-plugin.js +1 -0
- package/dist/call-expression-plugin.js.map +1 -1
- package/dist/claims-plugin.js +1 -0
- package/dist/claims-plugin.js.map +1 -1
- package/dist/client-script-plugin.js +1 -0
- package/dist/client-script-plugin.js.map +1 -1
- package/dist/column-plugin.js +4 -7
- package/dist/column-plugin.js.map +1 -1
- package/dist/cross-scope-privilege-plugin.js +1 -0
- package/dist/cross-scope-privilege-plugin.js.map +1 -1
- package/dist/dashboard/dashboard-plugin.js +2 -0
- package/dist/dashboard/dashboard-plugin.js.map +1 -1
- package/dist/data-plugin.js +1 -0
- package/dist/data-plugin.js.map +1 -1
- package/dist/email-notification-plugin.js +9 -13
- package/dist/email-notification-plugin.js.map +1 -1
- package/dist/flow/constants/flow-plugin-constants.d.ts +1 -1
- package/dist/flow/constants/flow-plugin-constants.js +1 -1
- package/dist/flow/constants/flow-plugin-constants.js.map +1 -1
- package/dist/flow/flow-logic/flow-logic-diagnostics.js +5 -5
- package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -1
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.d.ts +82 -2
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.js +48 -40
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.js.map +1 -1
- package/dist/flow/flow-logic/flow-logic-plugin.js +1 -0
- package/dist/flow/flow-logic/flow-logic-plugin.js.map +1 -1
- package/dist/flow/plugins/approval-rules-plugin.js +1 -0
- package/dist/flow/plugins/approval-rules-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-action-definition-plugin.js +1232 -55
- package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-data-pill-plugin.js +6 -2
- package/dist/flow/plugins/flow-data-pill-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-definition-plugin.js +23 -44
- package/dist/flow/plugins/flow-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-diagnostics-plugin.d.ts +2 -2
- package/dist/flow/plugins/flow-diagnostics-plugin.js +3 -2
- package/dist/flow/plugins/flow-diagnostics-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-instance-plugin.js +136 -34
- package/dist/flow/plugins/flow-instance-plugin.js.map +1 -1
- package/dist/flow/plugins/flow-trigger-instance-plugin.js +1 -0
- package/dist/flow/plugins/flow-trigger-instance-plugin.js.map +1 -1
- package/dist/flow/plugins/inline-script-plugin.js +1 -0
- package/dist/flow/plugins/inline-script-plugin.js.map +1 -1
- package/dist/flow/plugins/step-definition-plugin.js +4 -2
- package/dist/flow/plugins/step-definition-plugin.js.map +1 -1
- package/dist/flow/plugins/step-instance-plugin.d.ts +9 -1
- package/dist/flow/plugins/step-instance-plugin.js +649 -135
- package/dist/flow/plugins/step-instance-plugin.js.map +1 -1
- package/dist/flow/plugins/trigger-plugin.js +2 -0
- package/dist/flow/plugins/trigger-plugin.js.map +1 -1
- package/dist/flow/plugins/wfa-datapill-plugin.js +21 -5
- package/dist/flow/plugins/wfa-datapill-plugin.js.map +1 -1
- package/dist/flow/post-install.d.ts +2 -0
- package/dist/flow/post-install.js +59 -0
- package/dist/flow/post-install.js.map +1 -0
- package/dist/flow/utils/complex-object-resolver.js +4 -1
- package/dist/flow/utils/complex-object-resolver.js.map +1 -1
- package/dist/flow/utils/complex-objects.js +5 -3
- package/dist/flow/utils/complex-objects.js.map +1 -1
- package/dist/flow/utils/flow-constants.d.ts +90 -2
- package/dist/flow/utils/flow-constants.js +430 -7
- package/dist/flow/utils/flow-constants.js.map +1 -1
- package/dist/flow/utils/flow-io-to-record.d.ts +1 -1
- package/dist/flow/utils/flow-io-to-record.js +37 -16
- package/dist/flow/utils/flow-io-to-record.js.map +1 -1
- package/dist/flow/utils/flow-shapes.js +4 -0
- package/dist/flow/utils/flow-shapes.js.map +1 -1
- package/dist/flow/utils/flow-to-xml.d.ts +3 -2
- package/dist/flow/utils/flow-to-xml.js +3 -4
- package/dist/flow/utils/flow-to-xml.js.map +1 -1
- package/dist/flow/utils/label-cache-parser.d.ts +9 -2
- package/dist/flow/utils/label-cache-parser.js +32 -4
- package/dist/flow/utils/label-cache-parser.js.map +1 -1
- package/dist/flow/utils/label-cache-processor.d.ts +5 -0
- package/dist/flow/utils/label-cache-processor.js +14 -2
- package/dist/flow/utils/label-cache-processor.js.map +1 -1
- package/dist/flow/utils/pill-shape-helpers.d.ts +15 -0
- package/dist/flow/utils/pill-shape-helpers.js +35 -0
- package/dist/flow/utils/pill-shape-helpers.js.map +1 -0
- package/dist/flow/utils/pill-string-parser.js +1 -0
- package/dist/flow/utils/pill-string-parser.js.map +1 -1
- package/dist/flow/utils/schema-to-flow-object.d.ts +6 -1
- package/dist/flow/utils/schema-to-flow-object.js +131 -15
- package/dist/flow/utils/schema-to-flow-object.js.map +1 -1
- package/dist/flow/utils/service-catalog.js +5 -1
- package/dist/flow/utils/service-catalog.js.map +1 -1
- package/dist/flow/utils/utils.d.ts +1 -0
- package/dist/flow/utils/utils.js +6 -1
- package/dist/flow/utils/utils.js.map +1 -1
- package/dist/form-plugin.d.ts +2 -0
- package/dist/form-plugin.js +1132 -0
- package/dist/form-plugin.js.map +1 -0
- package/dist/html-import-plugin.js +1 -0
- package/dist/html-import-plugin.js.map +1 -1
- package/dist/import-sets-plugin.js +2 -0
- package/dist/import-sets-plugin.js.map +1 -1
- package/dist/inbound-email-action-plugin.d.ts +10 -0
- package/dist/inbound-email-action-plugin.js +128 -0
- package/dist/inbound-email-action-plugin.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/instance-scan-plugin.d.ts +2 -0
- package/dist/instance-scan-plugin.js +293 -0
- package/dist/instance-scan-plugin.js.map +1 -0
- package/dist/json-plugin.js +1 -0
- package/dist/json-plugin.js.map +1 -1
- package/dist/list-plugin.js +1 -0
- package/dist/list-plugin.js.map +1 -1
- package/dist/now-attach-plugin.js +1 -0
- package/dist/now-attach-plugin.js.map +1 -1
- package/dist/now-config-plugin.js +659 -51
- package/dist/now-config-plugin.js.map +1 -1
- package/dist/now-id-plugin.js +1 -0
- package/dist/now-id-plugin.js.map +1 -1
- package/dist/now-include-plugin.js +1 -0
- package/dist/now-include-plugin.js.map +1 -1
- package/dist/now-ref-plugin.js +1 -0
- package/dist/now-ref-plugin.js.map +1 -1
- package/dist/now-unresolved-plugin.js +1 -0
- package/dist/now-unresolved-plugin.js.map +1 -1
- package/dist/package-json-plugin.js +1 -0
- package/dist/package-json-plugin.js.map +1 -1
- package/dist/property-plugin.js +3 -1
- package/dist/property-plugin.js.map +1 -1
- package/dist/record-plugin.d.ts +37 -0
- package/dist/record-plugin.js +47 -3
- package/dist/record-plugin.js.map +1 -1
- package/dist/repack/lint/Rules.d.ts +11 -2
- package/dist/repack/lint/Rules.js +160 -16
- package/dist/repack/lint/Rules.js.map +1 -1
- package/dist/repack/lint/index.d.ts +10 -5
- package/dist/repack/lint/index.js +76 -50
- package/dist/repack/lint/index.js.map +1 -1
- package/dist/rest-api-plugin.js +22 -1
- package/dist/rest-api-plugin.js.map +1 -1
- package/dist/role-plugin.js +1 -0
- package/dist/role-plugin.js.map +1 -1
- package/dist/schedule-script/index.d.ts +1 -0
- package/dist/schedule-script/index.js +18 -0
- package/dist/schedule-script/index.js.map +1 -0
- package/dist/schedule-script/scheduled-script-plugin.d.ts +2 -0
- package/dist/schedule-script/scheduled-script-plugin.js +556 -0
- package/dist/schedule-script/scheduled-script-plugin.js.map +1 -0
- package/dist/schedule-script/timeZoneConverter.d.ts +61 -0
- package/dist/schedule-script/timeZoneConverter.js +170 -0
- package/dist/schedule-script/timeZoneConverter.js.map +1 -0
- package/dist/script-action-plugin.js +2 -0
- package/dist/script-action-plugin.js.map +1 -1
- package/dist/script-include-plugin.js +2 -0
- package/dist/script-include-plugin.js.map +1 -1
- package/dist/server-module-plugin/index.js +13 -2
- package/dist/server-module-plugin/index.js.map +1 -1
- package/dist/service-catalog/catalog-clientscript-plugin.js +2 -0
- package/dist/service-catalog/catalog-clientscript-plugin.js.map +1 -1
- package/dist/service-catalog/catalog-item-plugin.js +2 -0
- package/dist/service-catalog/catalog-item-plugin.js.map +1 -1
- package/dist/service-catalog/catalog-ui-policy-plugin.js +2 -0
- package/dist/service-catalog/catalog-ui-policy-plugin.js.map +1 -1
- package/dist/service-catalog/sc-record-producer-plugin.js +2 -0
- package/dist/service-catalog/sc-record-producer-plugin.js.map +1 -1
- package/dist/service-catalog/service-catalog-base.d.ts +18 -18
- package/dist/service-catalog/service-catalog-base.js +22 -22
- package/dist/service-catalog/service-catalog-base.js.map +1 -1
- package/dist/service-catalog/service-catalog-diagnostics.d.ts +6 -0
- package/dist/service-catalog/service-catalog-diagnostics.js +20 -0
- package/dist/service-catalog/service-catalog-diagnostics.js.map +1 -1
- package/dist/service-catalog/shape-to-record.js +7 -2
- package/dist/service-catalog/shape-to-record.js.map +1 -1
- package/dist/service-catalog/variable-set-plugin.js +2 -0
- package/dist/service-catalog/variable-set-plugin.js.map +1 -1
- package/dist/service-portal/angular-provider-plugin.js +2 -0
- package/dist/service-portal/angular-provider-plugin.js.map +1 -1
- package/dist/service-portal/dependency-plugin.js +5 -31
- package/dist/service-portal/dependency-plugin.js.map +1 -1
- package/dist/service-portal/header-footer-plugin.d.ts +2 -0
- package/dist/service-portal/header-footer-plugin.js +50 -0
- package/dist/service-portal/header-footer-plugin.js.map +1 -0
- package/dist/service-portal/menu-plugin.d.ts +2 -0
- package/dist/service-portal/menu-plugin.js +334 -0
- package/dist/service-portal/menu-plugin.js.map +1 -0
- package/dist/service-portal/page-plugin.d.ts +2 -0
- package/dist/service-portal/page-plugin.js +681 -0
- package/dist/service-portal/page-plugin.js.map +1 -0
- package/dist/service-portal/page-route-map-plugin.d.ts +2 -0
- package/dist/service-portal/page-route-map-plugin.js +114 -0
- package/dist/service-portal/page-route-map-plugin.js.map +1 -0
- package/dist/service-portal/portal-plugin.d.ts +2 -0
- package/dist/service-portal/portal-plugin.js +309 -0
- package/dist/service-portal/portal-plugin.js.map +1 -0
- package/dist/service-portal/theme-plugin.d.ts +2 -0
- package/dist/service-portal/theme-plugin.js +112 -0
- package/dist/service-portal/theme-plugin.js.map +1 -0
- package/dist/service-portal/utils.d.ts +46 -0
- package/dist/service-portal/utils.js +331 -0
- package/dist/service-portal/utils.js.map +1 -0
- package/dist/service-portal/widget-plugin.js +10 -182
- package/dist/service-portal/widget-plugin.js.map +1 -1
- package/dist/sla-plugin.js +2 -0
- package/dist/sla-plugin.js.map +1 -1
- package/dist/static-content-plugin.js +5 -0
- package/dist/static-content-plugin.js.map +1 -1
- package/dist/table-plugin.js +191 -26
- package/dist/table-plugin.js.map +1 -1
- package/dist/ui-action-plugin.js +3 -4
- package/dist/ui-action-plugin.js.map +1 -1
- package/dist/ui-page-plugin.js +101 -21
- package/dist/ui-page-plugin.js.map +1 -1
- package/dist/ui-policy-plugin.js +1 -0
- package/dist/ui-policy-plugin.js.map +1 -1
- package/dist/user-preference-plugin.js +2 -0
- package/dist/user-preference-plugin.js.map +1 -1
- package/dist/utils.d.ts +20 -2
- package/dist/utils.js +34 -3
- package/dist/utils.js.map +1 -1
- package/dist/ux-list-menu-config-plugin.js +2 -0
- package/dist/ux-list-menu-config-plugin.js.map +1 -1
- package/dist/view-plugin.js +9 -3
- package/dist/view-plugin.js.map +1 -1
- package/dist/workspace-plugin.js +41 -36
- package/dist/workspace-plugin.js.map +1 -1
- package/package.json +11 -11
- package/src/_types/eslint-community-eslint-utils.d.ts +15 -0
- package/src/acl-plugin.ts +97 -8
- package/src/applicability-plugin.ts +2 -0
- package/src/application-menu-plugin.ts +2 -0
- package/src/arrow-function-plugin.ts +128 -13
- package/src/atf/test-plugin.ts +2 -0
- package/src/basic-syntax-plugin.ts +21 -0
- package/src/call-expression-plugin.ts +1 -0
- package/src/claims-plugin.ts +1 -0
- package/src/client-script-plugin.ts +2 -1
- package/src/column-plugin.ts +4 -8
- package/src/cross-scope-privilege-plugin.ts +2 -1
- package/src/dashboard/dashboard-plugin.ts +2 -0
- package/src/data-plugin.ts +1 -0
- package/src/email-notification-plugin.ts +3 -23
- package/src/flow/constants/flow-plugin-constants.ts +1 -1
- package/src/flow/flow-logic/flow-logic-diagnostics.ts +5 -6
- package/src/flow/flow-logic/flow-logic-plugin-helpers.ts +47 -45
- package/src/flow/flow-logic/flow-logic-plugin.ts +1 -0
- package/src/flow/plugins/approval-rules-plugin.ts +1 -0
- package/src/flow/plugins/flow-action-definition-plugin.ts +1584 -62
- package/src/flow/plugins/flow-data-pill-plugin.ts +6 -2
- package/src/flow/plugins/flow-definition-plugin.ts +22 -51
- package/src/flow/plugins/flow-diagnostics-plugin.ts +3 -2
- package/src/flow/plugins/flow-instance-plugin.ts +201 -36
- package/src/flow/plugins/flow-trigger-instance-plugin.ts +1 -0
- package/src/flow/plugins/inline-script-plugin.ts +1 -0
- package/src/flow/plugins/step-definition-plugin.ts +4 -2
- package/src/flow/plugins/step-instance-plugin.ts +772 -155
- package/src/flow/plugins/trigger-plugin.ts +2 -0
- package/src/flow/plugins/wfa-datapill-plugin.ts +26 -5
- package/src/flow/post-install.ts +93 -0
- package/src/flow/utils/complex-object-resolver.ts +4 -1
- package/src/flow/utils/complex-objects.ts +11 -3
- package/src/flow/utils/flow-constants.ts +451 -6
- package/src/flow/utils/flow-io-to-record.ts +43 -17
- package/src/flow/utils/flow-shapes.ts +4 -0
- package/src/flow/utils/flow-to-xml.ts +4 -4
- package/src/flow/utils/label-cache-parser.ts +33 -4
- package/src/flow/utils/label-cache-processor.ts +14 -2
- package/src/flow/utils/pill-shape-helpers.ts +42 -0
- package/src/flow/utils/pill-string-parser.ts +1 -0
- package/src/flow/utils/schema-to-flow-object.ts +183 -15
- package/src/flow/utils/service-catalog.ts +5 -2
- package/src/flow/utils/utils.ts +12 -1
- package/src/form-plugin.ts +1409 -0
- package/src/html-import-plugin.ts +1 -0
- package/src/import-sets-plugin.ts +2 -0
- package/src/inbound-email-action-plugin.ts +145 -0
- package/src/index.ts +13 -0
- package/src/instance-scan-plugin.ts +313 -0
- package/src/json-plugin.ts +1 -0
- package/src/list-plugin.ts +2 -1
- package/src/now-attach-plugin.ts +1 -0
- package/src/now-config-plugin.ts +833 -53
- package/src/now-id-plugin.ts +1 -0
- package/src/now-include-plugin.ts +1 -0
- package/src/now-ref-plugin.ts +1 -0
- package/src/now-unresolved-plugin.ts +1 -0
- package/src/package-json-plugin.ts +1 -0
- package/src/property-plugin.ts +6 -1
- package/src/record-plugin.ts +56 -6
- package/src/repack/lint/Rules.ts +171 -22
- package/src/repack/lint/index.ts +80 -56
- package/src/rest-api-plugin.ts +28 -2
- package/src/role-plugin.ts +2 -1
- package/src/schedule-script/index.ts +1 -0
- package/src/schedule-script/scheduled-script-plugin.ts +690 -0
- package/src/schedule-script/timeZoneConverter.ts +188 -0
- package/src/script-action-plugin.ts +2 -0
- package/src/script-include-plugin.ts +2 -0
- package/src/server-module-plugin/index.ts +14 -2
- package/src/service-catalog/catalog-clientscript-plugin.ts +2 -0
- package/src/service-catalog/catalog-item-plugin.ts +2 -0
- package/src/service-catalog/catalog-ui-policy-plugin.ts +2 -0
- package/src/service-catalog/sc-record-producer-plugin.ts +2 -0
- package/src/service-catalog/service-catalog-base.ts +22 -22
- package/src/service-catalog/service-catalog-diagnostics.ts +30 -0
- package/src/service-catalog/shape-to-record.ts +8 -2
- package/src/service-catalog/variable-set-plugin.ts +2 -0
- package/src/service-portal/angular-provider-plugin.ts +2 -0
- package/src/service-portal/dependency-plugin.ts +6 -53
- package/src/service-portal/header-footer-plugin.ts +57 -0
- package/src/service-portal/menu-plugin.ts +413 -0
- package/src/service-portal/page-plugin.ts +805 -0
- package/src/service-portal/page-route-map-plugin.ts +124 -0
- package/src/service-portal/portal-plugin.ts +342 -0
- package/src/service-portal/theme-plugin.ts +135 -0
- package/src/service-portal/utils.ts +470 -0
- package/src/service-portal/widget-plugin.ts +18 -224
- package/src/sla-plugin.ts +2 -0
- package/src/static-content-plugin.ts +4 -0
- package/src/table-plugin.ts +228 -37
- package/src/ui-action-plugin.ts +3 -8
- package/src/ui-page-plugin.ts +110 -21
- package/src/ui-policy-plugin.ts +2 -1
- package/src/user-preference-plugin.ts +2 -0
- package/src/utils.ts +42 -2
- package/src/ux-list-menu-config-plugin.ts +2 -0
- package/src/view-plugin.ts +11 -4
- package/src/workspace-plugin.ts +45 -43
- package/src/_types/eslint-plugin-es-x.d.ts +0 -17
|
@@ -2,14 +2,148 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StepInstancePlugin = exports.StepInstanceShape = void 0;
|
|
4
4
|
const sdk_build_core_1 = require("@servicenow/sdk-build-core");
|
|
5
|
+
const now_id_plugin_1 = require("../../now-id-plugin");
|
|
5
6
|
const utils_1 = require("../utils/utils");
|
|
6
7
|
const column_helper_1 = require("../../column/column-helper");
|
|
7
8
|
const flow_constants_1 = require("../utils/flow-constants");
|
|
9
|
+
const flow_instance_plugin_1 = require("./flow-instance-plugin");
|
|
10
|
+
const flow_shapes_1 = require("../utils/flow-shapes");
|
|
11
|
+
const utils_2 = require("../../utils");
|
|
12
|
+
const complex_objects_1 = require("../utils/complex-objects");
|
|
13
|
+
const data_pill_shapes_1 = require("../utils/data-pill-shapes");
|
|
14
|
+
const utils_3 = require("../utils/utils");
|
|
8
15
|
// Error handling type mapping: string to number
|
|
9
16
|
const ERROR_HANDLING_TYPE_MAP = {
|
|
10
17
|
stop_the_action: 1,
|
|
11
18
|
dont_stop_the_action: 2,
|
|
12
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Resolves a TemplateValue field shape to a datapill string (e.g., "{{action.desc|string}}").
|
|
22
|
+
* Handles two cases:
|
|
23
|
+
* 1. Already resolved PillShape — call getValue() directly
|
|
24
|
+
* 2. Unresolved wfa.dataPill() CallExpressionShape — extract pill info from arguments
|
|
25
|
+
* @param cidMap - Optional map of step variable name → CID for direct lookup (avoids AST walking)
|
|
26
|
+
* Returns undefined if the field is not a datapill.
|
|
27
|
+
*/
|
|
28
|
+
function resolveFieldToPillString(fieldShape, cidMap) {
|
|
29
|
+
// Case 1: Already a PillShape (e.g., processed by the datapill plugin)
|
|
30
|
+
if (fieldShape instanceof data_pill_shapes_1.PillShape) {
|
|
31
|
+
return fieldShape.getValue();
|
|
32
|
+
}
|
|
33
|
+
// Case 2: Unresolved wfa.dataPill(expression, type) CallExpressionShape
|
|
34
|
+
if (fieldShape instanceof sdk_build_core_1.CallExpressionShape) {
|
|
35
|
+
const callee = fieldShape.getCallee();
|
|
36
|
+
if (callee !== 'wfa.dataPill') {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const typeArg = fieldShape.getArgument(1);
|
|
40
|
+
// Extract property path — try Shape API first, then AST node directly
|
|
41
|
+
const propertyNames = [];
|
|
42
|
+
const expressionArg = fieldShape.getArgument(0, false); // 0, false
|
|
43
|
+
if (expressionArg instanceof sdk_build_core_1.PropertyAccessShape) {
|
|
44
|
+
expressionArg.getElements().forEach((el) => {
|
|
45
|
+
if (el instanceof sdk_build_core_1.IdentifierShape) {
|
|
46
|
+
propertyNames.push(el.getName());
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (propertyNames.length < 2) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
let prefix = 'action';
|
|
54
|
+
let pathParts;
|
|
55
|
+
if (propertyNames[1] === 'inputs') {
|
|
56
|
+
// params.inputs.xxx → action pill
|
|
57
|
+
const originalNode = fieldShape.getOriginalNode?.();
|
|
58
|
+
if (originalNode) {
|
|
59
|
+
const actionAncestor = (0, utils_3.findAncestorByCalleeName)(originalNode, 'Action');
|
|
60
|
+
prefix = actionAncestor ? 'action' : 'subflow';
|
|
61
|
+
}
|
|
62
|
+
pathParts = propertyNames.slice(2);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
// Could be a step variable reference: create_record_step.record.short_description
|
|
66
|
+
// Resolve CID via cidMap lookup (O(1))
|
|
67
|
+
const varName = propertyNames[0];
|
|
68
|
+
const stepCid = varName ? cidMap?.get(varName) : undefined;
|
|
69
|
+
if (stepCid) {
|
|
70
|
+
prefix = `step[${stepCid}]`;
|
|
71
|
+
pathParts = propertyNames.slice(1);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// Cannot resolve step CID — return undefined so the caller can handle the failure
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const dataType = typeArg?.ifString()?.getValue();
|
|
79
|
+
const typeSuffix = dataType ? `|${dataType}` : '';
|
|
80
|
+
return `{{${prefix}.${pathParts.join('.')}${typeSuffix}}}`;
|
|
81
|
+
}
|
|
82
|
+
// Case 3: Already a resolved pill string
|
|
83
|
+
const val = fieldShape.getValue();
|
|
84
|
+
if (typeof val === 'string' && val.startsWith('{{') && val.endsWith('}}')) {
|
|
85
|
+
return val;
|
|
86
|
+
}
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Extracts pill type annotations from a pill string and stores them in the pillTypeMap.
|
|
91
|
+
* Captures types from both step pills ({{step[CID].path|type}}) and action pills
|
|
92
|
+
* ({{action.path|type}}). The "|type" portion is captured before it gets stripped
|
|
93
|
+
* for the element_mapping value. The collected types are used later when building the label_cache.
|
|
94
|
+
*/
|
|
95
|
+
const STEP_PILL_TYPE_REGEX = /\{\{step\[([^\]]+)\]\.([^|}]+)(?:\|([^}]+))?\}\}/g;
|
|
96
|
+
const ACTION_PILL_TYPE_REGEX = /\{\{action\.([^|}]+)(?:\|([^}]+))?\}\}/g;
|
|
97
|
+
function collectPillTypes(pillString, pillTypeMap) {
|
|
98
|
+
if (!pillTypeMap) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
for (const match of pillString.matchAll(STEP_PILL_TYPE_REGEX)) {
|
|
102
|
+
const [, cid, pillPath, dataType] = match;
|
|
103
|
+
if (cid && pillPath && dataType) {
|
|
104
|
+
pillTypeMap.set(`${cid}::${pillPath}`, dataType);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
for (const match of pillString.matchAll(ACTION_PILL_TYPE_REGEX)) {
|
|
108
|
+
const [, path, dataType] = match;
|
|
109
|
+
if (path && dataType) {
|
|
110
|
+
pillTypeMap.set(`action::${path}`, dataType);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Strips the |type suffix from a pill string.
|
|
116
|
+
* e.g., "{{action.desc|string}}" → "{{action.desc}}"
|
|
117
|
+
*
|
|
118
|
+
* Note: This is called on individual pill strings (from resolveFieldToPillString),
|
|
119
|
+
* never on concatenated multi-pill strings — so no `g` flag is needed.
|
|
120
|
+
*/
|
|
121
|
+
function stripPillType(pill) {
|
|
122
|
+
return pill.replace(/\|[^}]+/, '');
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Resolves a TemplateExpressionShape into a concatenated string, replacing
|
|
126
|
+
* datapill spans with their pill strings (type-stripped) and collecting pill types.
|
|
127
|
+
* Returns the resolved string and whether any pills were found.
|
|
128
|
+
*/
|
|
129
|
+
function resolveTemplateExpression(templateShape, cidMap, pillTypeMap) {
|
|
130
|
+
let result = templateShape.getLiteralText();
|
|
131
|
+
let hasPills = false;
|
|
132
|
+
for (const span of templateShape.getSpans()) {
|
|
133
|
+
const expr = span.getExpression();
|
|
134
|
+
const pillStr = resolveFieldToPillString(expr, cidMap);
|
|
135
|
+
if (pillStr) {
|
|
136
|
+
collectPillTypes(pillStr, pillTypeMap);
|
|
137
|
+
result += stripPillType(pillStr);
|
|
138
|
+
hasPills = true;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
result += String(expr.getValue?.() ?? '');
|
|
142
|
+
}
|
|
143
|
+
result += span.getLiteralText();
|
|
144
|
+
}
|
|
145
|
+
return { result, hasPills };
|
|
146
|
+
}
|
|
13
147
|
/**
|
|
14
148
|
* StepInstanceShape represents a step instance within a custom action's body
|
|
15
149
|
* This class handles the shape transformation for step instances
|
|
@@ -21,9 +155,13 @@ class StepInstanceShape extends sdk_build_core_1.CallExpressionShape {
|
|
|
21
155
|
stepLabel;
|
|
22
156
|
inputs;
|
|
23
157
|
inputDefinitions;
|
|
158
|
+
/** Map of step variable name → CID, set by ActionDefinitionPlugin for step pill resolution in Action() bodies */
|
|
159
|
+
_cidMap;
|
|
160
|
+
/** Map of "CID::pillPath" → dataType, populated during toRecord for label_cache type propagation */
|
|
161
|
+
_pillTypeMap;
|
|
24
162
|
constructor(args) {
|
|
25
163
|
const { source, sysId, config, stepDefinitionSysId, stepLabel, inputs, inputDefinitions } = args;
|
|
26
|
-
super({ source, callee: '
|
|
164
|
+
super({ source, callee: 'wfa.actionStep', args: [sysId, config, stepDefinitionSysId] });
|
|
27
165
|
this.config = config;
|
|
28
166
|
this.sysId = sysId;
|
|
29
167
|
this.stepDefinitionSysId = stepDefinitionSysId;
|
|
@@ -49,10 +187,23 @@ class StepInstanceShape extends sdk_build_core_1.CallExpressionShape {
|
|
|
49
187
|
getInputDefinitions() {
|
|
50
188
|
return this.inputDefinitions;
|
|
51
189
|
}
|
|
190
|
+
setCidMap(cidMap) {
|
|
191
|
+
this._cidMap = cidMap;
|
|
192
|
+
}
|
|
193
|
+
getCidMap() {
|
|
194
|
+
return this._cidMap;
|
|
195
|
+
}
|
|
196
|
+
setPillTypeMap(pillTypeMap) {
|
|
197
|
+
this._pillTypeMap = pillTypeMap;
|
|
198
|
+
}
|
|
199
|
+
getPillTypeMap() {
|
|
200
|
+
return this._pillTypeMap;
|
|
201
|
+
}
|
|
52
202
|
}
|
|
53
203
|
exports.StepInstanceShape = StepInstanceShape;
|
|
54
204
|
exports.StepInstancePlugin = sdk_build_core_1.Plugin.create({
|
|
55
205
|
name: 'StepInstancePlugin',
|
|
206
|
+
docs: [(0, utils_2.createSdkDocEntry)('wfa.actionStep', ['sys_hub_step_instance'])],
|
|
56
207
|
shapes: [
|
|
57
208
|
{
|
|
58
209
|
shape: sdk_build_core_1.CallExpressionShape,
|
|
@@ -68,10 +219,8 @@ exports.StepInstancePlugin = sdk_build_core_1.Plugin.create({
|
|
|
68
219
|
return { success: false };
|
|
69
220
|
}
|
|
70
221
|
const [stepDefinition, stepInstanceConfig, inputs] = args;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
stepDefinition.getCallee() !== 'ActionStepDefinition') {
|
|
74
|
-
diagnostics.error(callExpression, 'Expected first argument to be a ActionStepDefinition');
|
|
222
|
+
if (!stepDefinition) {
|
|
223
|
+
diagnostics.error(callExpression, 'Missing step definition argument');
|
|
75
224
|
return { success: false };
|
|
76
225
|
}
|
|
77
226
|
// Validate second argument is a valid ID
|
|
@@ -84,15 +233,55 @@ exports.StepInstancePlugin = sdk_build_core_1.Plugin.create({
|
|
|
84
233
|
diagnostics.error(callExpression, 'Expected third argument to be an object');
|
|
85
234
|
return { success: false };
|
|
86
235
|
}
|
|
87
|
-
|
|
236
|
+
let stepDefinitionSysId;
|
|
237
|
+
let stepLabel;
|
|
238
|
+
let inputDefinitions;
|
|
239
|
+
// First argument can be a string (built-in step name), IdentifierShape (actionStep.xxx),
|
|
240
|
+
// or ActionStepDefinition() call
|
|
241
|
+
const stepNameValue = stepDefinition.ifString()?.getValue();
|
|
242
|
+
if (stepNameValue) {
|
|
243
|
+
// Built-in step referenced by name string
|
|
244
|
+
stepDefinitionSysId = flow_constants_1.BUILT_IN_STEP_NAME_TO_SYSID[stepNameValue] ?? '';
|
|
245
|
+
stepLabel = stepNameValue;
|
|
246
|
+
if (!stepDefinitionSysId) {
|
|
247
|
+
diagnostics.error(callExpression, `Unknown built-in step type '${stepNameValue}'`);
|
|
248
|
+
return { success: false };
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else if (stepDefinition instanceof sdk_build_core_1.IdentifierShape) {
|
|
252
|
+
// Built-in step referenced via actionStep.xxx identifier
|
|
253
|
+
const identifierName = stepDefinition.getName();
|
|
254
|
+
const prefix = `${flow_constants_1.BUILT_IN_STEP_PREFIX}.`;
|
|
255
|
+
const resolvedName = identifierName.startsWith(prefix)
|
|
256
|
+
? identifierName.slice(prefix.length)
|
|
257
|
+
: identifierName;
|
|
258
|
+
stepDefinitionSysId = flow_constants_1.BUILT_IN_STEP_NAME_TO_SYSID[resolvedName] ?? '';
|
|
259
|
+
stepLabel = resolvedName;
|
|
260
|
+
if (!stepDefinitionSysId) {
|
|
261
|
+
diagnostics.error(callExpression, `Unknown built-in step type '${identifierName}'`);
|
|
262
|
+
return { success: false };
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
else if (stepDefinition instanceof sdk_build_core_1.CallExpressionShape &&
|
|
266
|
+
stepDefinition.getCallee() === 'ActionStepDefinition') {
|
|
267
|
+
// Custom step definition
|
|
268
|
+
const stepConfig = stepDefinition.getArgument(0).asObject();
|
|
269
|
+
stepDefinitionSysId = stepConfig.get('$id')?.getValue();
|
|
270
|
+
stepLabel = stepConfig.get('name')?.getValue();
|
|
271
|
+
inputDefinitions = stepConfig.get('inputs')?.ifObject()?.asObject();
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
diagnostics.error(callExpression, 'Expected first argument to be a step type name string, actionStep.xxx identifier, or ActionStepDefinition');
|
|
275
|
+
return { success: false };
|
|
276
|
+
}
|
|
88
277
|
const shapeArgs = {
|
|
89
278
|
source: callExpression,
|
|
90
279
|
sysId: stepInstanceConfig.get('$id')?.getValue(),
|
|
91
280
|
config: stepInstanceConfig,
|
|
92
|
-
stepDefinitionSysId
|
|
93
|
-
stepLabel
|
|
94
|
-
inputDefinitions: stepConfig.get('inputs')?.asObject(),
|
|
281
|
+
stepDefinitionSysId,
|
|
282
|
+
stepLabel,
|
|
95
283
|
inputs: inputs,
|
|
284
|
+
...(inputDefinitions ? { inputDefinitions } : {}),
|
|
96
285
|
};
|
|
97
286
|
return {
|
|
98
287
|
success: true,
|
|
@@ -103,10 +292,11 @@ exports.StepInstancePlugin = sdk_build_core_1.Plugin.create({
|
|
|
103
292
|
{
|
|
104
293
|
shape: StepInstanceShape,
|
|
105
294
|
fileTypes: ['fluent'],
|
|
106
|
-
async toRecord(callExpression, { factory }) {
|
|
295
|
+
async toRecord(callExpression, { factory, diagnostics }) {
|
|
107
296
|
const stepInstanceRecord = await buildStepInstanceRecord({
|
|
108
297
|
callExpression,
|
|
109
298
|
factory,
|
|
299
|
+
diagnostics,
|
|
110
300
|
values: callExpression.getInputs(),
|
|
111
301
|
sysId: callExpression.getSysId(),
|
|
112
302
|
stepDefinitionSysId: callExpression.getStepDefinitionSysId(),
|
|
@@ -124,6 +314,12 @@ exports.StepInstancePlugin = sdk_build_core_1.Plugin.create({
|
|
|
124
314
|
sys_hub_step_ext_output: {
|
|
125
315
|
coalesce: ['model', 'element'],
|
|
126
316
|
},
|
|
317
|
+
sys_complex_object: {
|
|
318
|
+
coalesce: ['name'],
|
|
319
|
+
},
|
|
320
|
+
sys_element_mapping: {
|
|
321
|
+
coalesce: ['field', 'id'],
|
|
322
|
+
},
|
|
127
323
|
sys_hub_step_instance: {
|
|
128
324
|
relationships: {
|
|
129
325
|
sys_variable_value: {
|
|
@@ -147,81 +343,128 @@ exports.StepInstancePlugin = sdk_build_core_1.Plugin.create({
|
|
|
147
343
|
descendant: true,
|
|
148
344
|
},
|
|
149
345
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
346
|
+
toShape(record, { descendants, logger }) {
|
|
347
|
+
// Skip step instances that belong to an action definition —
|
|
348
|
+
// those are handled by ActionDefinitionPlugin's toShape for Action() definitions
|
|
349
|
+
const actionRef = record.get('action')?.asString()?.getValue();
|
|
350
|
+
if (actionRef) {
|
|
351
|
+
return { success: false };
|
|
352
|
+
}
|
|
353
|
+
const stepDefinitionRecords = descendants.query('sys_flow_step_definition');
|
|
354
|
+
const variableValues = descendants.query('sys_variable_value');
|
|
355
|
+
const configObj = {};
|
|
356
|
+
let stepDefinitionShape;
|
|
357
|
+
let stepName;
|
|
358
|
+
if (stepDefinitionRecords.length > 0) {
|
|
359
|
+
// Custom step definition found in descendants
|
|
360
|
+
const stepDefinition = stepDefinitionRecords[0];
|
|
361
|
+
if (!stepDefinition) {
|
|
362
|
+
logger.warn('Step definition is undefined');
|
|
363
|
+
return { success: false };
|
|
364
|
+
}
|
|
365
|
+
stepName = stepDefinition.get('name')?.asString()?.getValue();
|
|
366
|
+
// Resolve variable values using input definition records from descendants
|
|
367
|
+
for (const varValue of variableValues) {
|
|
368
|
+
const variableSysId = varValue.get('variable')?.asString()?.getValue();
|
|
369
|
+
const value = varValue.get('value')?.asString()?.getValue();
|
|
370
|
+
const inputRecords = descendants.query('sys_flow_step_definition_input', {
|
|
371
|
+
sysId: variableSysId,
|
|
372
|
+
});
|
|
373
|
+
if (inputRecords.length > 0) {
|
|
374
|
+
const elementName = inputRecords[0]?.get('element')?.asString()?.getValue();
|
|
375
|
+
if (elementName) {
|
|
376
|
+
try {
|
|
377
|
+
configObj[elementName] = JSON.parse(value || '');
|
|
378
|
+
}
|
|
379
|
+
catch {
|
|
380
|
+
configObj[elementName] = value;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
stepDefinitionShape = new sdk_build_core_1.CallExpressionShape({
|
|
386
|
+
source: stepDefinition,
|
|
387
|
+
callee: 'ActionStepDefinition',
|
|
388
|
+
args: [
|
|
389
|
+
stepDefinition.transform(({ $ }) => ({
|
|
390
|
+
$id: $.val(now_id_plugin_1.NowIdShape.from(stepDefinition)),
|
|
391
|
+
name: $,
|
|
392
|
+
})),
|
|
393
|
+
],
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
// OOB/built-in step definition — not in XML export
|
|
398
|
+
const stepTypeSysId = record.get('step_type')?.asString()?.getValue();
|
|
399
|
+
if (!stepTypeSysId) {
|
|
400
|
+
logger.warn(`Step instance ${record.getId().getValue()} has no step_type reference`);
|
|
401
|
+
return { success: false };
|
|
402
|
+
}
|
|
403
|
+
const builtInDef = flow_constants_1.BUILT_IN_STEP_DEFINITIONS[stepTypeSysId];
|
|
404
|
+
if (!builtInDef) {
|
|
405
|
+
logger.warn(`Unknown OOB step definition ${stepTypeSysId} for step instance ${record.getId().getValue()}`);
|
|
406
|
+
return { success: false };
|
|
407
|
+
}
|
|
408
|
+
stepName = builtInDef.name;
|
|
409
|
+
// Resolve variable values using the built-in definition's input/output mappings
|
|
410
|
+
for (const varValue of variableValues) {
|
|
411
|
+
const variableSysId = varValue.get('variable')?.asString()?.getValue();
|
|
412
|
+
const value = varValue.get('value')?.asString()?.getValue();
|
|
413
|
+
if (variableSysId) {
|
|
414
|
+
const entry = builtInDef.inputs[variableSysId] ?? builtInDef.outputs[variableSysId];
|
|
415
|
+
const elementName = entry ? (0, flow_constants_1.getVarEntryName)(entry) : undefined;
|
|
416
|
+
const uiType = entry ? (0, flow_constants_1.getVarEntryType)(entry) : undefined;
|
|
417
|
+
if (elementName && value != null) {
|
|
418
|
+
configObj[elementName] = uiType ? (0, flow_instance_plugin_1.normalizeInputValue)(value, uiType, record) : value;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
// Built-in/OOB step: emit actionStep.xxx reference
|
|
423
|
+
const stepIdentifier = (0, utils_1.getBuiltInStepIdentifier)(stepTypeSysId);
|
|
424
|
+
stepDefinitionShape = stepIdentifier
|
|
425
|
+
? new sdk_build_core_1.IdentifierShape({ source: record, name: stepIdentifier })
|
|
426
|
+
: builtInDef.name;
|
|
427
|
+
}
|
|
428
|
+
// Build step instance config (2nd arg): $id, label, error_handling_type
|
|
429
|
+
const configProperties = {
|
|
430
|
+
$id: now_id_plugin_1.NowIdShape.from(record),
|
|
431
|
+
};
|
|
432
|
+
const errorHandlingRaw = record.get('error_handling_type');
|
|
433
|
+
const errorHandlingType = errorHandlingRaw?.ifNumber()?.getValue() ?? Number(errorHandlingRaw?.ifString()?.getValue());
|
|
434
|
+
if (errorHandlingType && errorHandlingType !== 1 && !Number.isNaN(errorHandlingType)) {
|
|
435
|
+
configProperties['error_handling_type'] = errorHandlingType;
|
|
436
|
+
}
|
|
437
|
+
const label = record.get('label')?.asString()?.getValue();
|
|
438
|
+
if (label && label !== stepName) {
|
|
439
|
+
configProperties['label'] = label;
|
|
440
|
+
}
|
|
441
|
+
const stepInstanceConfig = new sdk_build_core_1.ObjectShape({
|
|
442
|
+
source: record,
|
|
443
|
+
properties: configProperties,
|
|
444
|
+
});
|
|
445
|
+
// Build inputs (3rd arg): resolved variable values only
|
|
446
|
+
const inputsShape = new sdk_build_core_1.ObjectShape({
|
|
447
|
+
source: record,
|
|
448
|
+
properties: { ...configObj },
|
|
449
|
+
});
|
|
450
|
+
return {
|
|
451
|
+
success: true,
|
|
452
|
+
value: new sdk_build_core_1.CallExpressionShape({
|
|
453
|
+
source: record,
|
|
454
|
+
callee: 'wfa.actionStep',
|
|
455
|
+
args: [stepDefinitionShape, stepInstanceConfig, inputsShape],
|
|
456
|
+
}),
|
|
457
|
+
};
|
|
458
|
+
},
|
|
221
459
|
},
|
|
222
460
|
},
|
|
223
461
|
});
|
|
224
|
-
async function buildStepInstanceRecord({ callExpression, factory, values, sysId, stepDefinitionSysId, stepLabel, inputs, }) {
|
|
462
|
+
async function buildStepInstanceRecord({ callExpression, factory, diagnostics, values, sysId, stepDefinitionSysId, stepLabel, inputs, }) {
|
|
463
|
+
// resolve: false — keep PillShapes and other ResolvableShapes intact (same reason as createVariableRecords).
|
|
464
|
+
// Using .getValue() on the parent ObjectShape would deeply resolve nested PillShapes into symbols.
|
|
465
|
+
const valuesArray = values.properties({ resolve: false });
|
|
466
|
+
const cidMap = callExpression.getCidMap();
|
|
467
|
+
const pillTypeMap = callExpression.getPillTypeMap();
|
|
225
468
|
// Create step instance record
|
|
226
469
|
const stepInstanceRecord = await factory.createRecord({
|
|
227
470
|
source: callExpression,
|
|
@@ -231,7 +474,7 @@ async function buildStepInstanceRecord({ callExpression, factory, values, sysId,
|
|
|
231
474
|
step_type: stepDefinitionSysId,
|
|
232
475
|
order: 1,
|
|
233
476
|
active: true,
|
|
234
|
-
error_handling_type: ERROR_HANDLING_TYPE_MAP[
|
|
477
|
+
error_handling_type: ERROR_HANDLING_TYPE_MAP[valuesArray['errorHandlingType']?.ifString()?.getValue() ?? ''] ?? 1,
|
|
235
478
|
label: stepLabel,
|
|
236
479
|
},
|
|
237
480
|
});
|
|
@@ -240,19 +483,21 @@ async function buildStepInstanceRecord({ callExpression, factory, values, sysId,
|
|
|
240
483
|
});
|
|
241
484
|
const stepInstanceSysId = updatedStepInstanceRecord.getId().getValue();
|
|
242
485
|
// Create sys_variable_value records for each input value
|
|
243
|
-
const
|
|
486
|
+
const stepDataRecords = await createVariableRecords(valuesArray, inputs, factory, callExpression, stepInstanceSysId, stepDefinitionSysId, cidMap);
|
|
244
487
|
const extendedInputRecords = [];
|
|
245
488
|
const extendedOutputRecords = [];
|
|
246
489
|
const extendedVariableValueRecords = [];
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
490
|
+
const inputVariablesShape = valuesArray['inputVariables'];
|
|
491
|
+
if (inputVariablesShape) {
|
|
492
|
+
const inputVarObj = inputVariablesShape.asObject();
|
|
493
|
+
const inputVarProps = inputVarObj.properties({ resolve: false });
|
|
494
|
+
const extInputTableName = `var__m_sys_hub_step_ext_input_${stepInstanceSysId}`;
|
|
495
|
+
for (const [name, configShapeRaw] of Object.entries(inputVarProps)) {
|
|
496
|
+
const configObj = configShapeRaw.asObject();
|
|
497
|
+
const configProps = configObj.properties({ resolve: false });
|
|
498
|
+
const label = (configProps['label']?.ifString?.()?.getValue() ?? name);
|
|
499
|
+
const defaultValue = (configProps['defaultValue']?.ifString?.()?.getValue() ?? '');
|
|
500
|
+
const valueShape = configProps['value'];
|
|
256
501
|
const extInputRecord = await factory.createRecord({
|
|
257
502
|
source: callExpression,
|
|
258
503
|
table: 'sys_hub_step_ext_input',
|
|
@@ -261,69 +506,336 @@ async function buildStepInstanceRecord({ callExpression, factory, values, sysId,
|
|
|
261
506
|
model: stepInstanceSysId,
|
|
262
507
|
model_id: stepInstanceSysId,
|
|
263
508
|
model_table: 'sys_hub_step_instance',
|
|
264
|
-
name:
|
|
509
|
+
name: extInputTableName,
|
|
265
510
|
element: name,
|
|
266
511
|
label: label,
|
|
267
|
-
mandatory: mandatory,
|
|
268
512
|
default_value: defaultValue,
|
|
513
|
+
attributes: (0, flow_constants_1.buildExtVarAttributes)('string'),
|
|
514
|
+
internal_type: 'string',
|
|
269
515
|
},
|
|
270
516
|
});
|
|
271
517
|
extendedInputRecords.push(extInputRecord);
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
518
|
+
if (!valueShape) {
|
|
519
|
+
// No value provided — still create a sys_variable_value record with empty value
|
|
520
|
+
// so the platform recognizes the ext input variable exists
|
|
521
|
+
extendedVariableValueRecords.push(await factory.createRecord({
|
|
522
|
+
source: callExpression,
|
|
523
|
+
table: 'sys_variable_value',
|
|
524
|
+
properties: {
|
|
525
|
+
document: 'sys_hub_step_instance',
|
|
526
|
+
document_key: stepInstanceSysId,
|
|
527
|
+
order: 100,
|
|
528
|
+
value: '',
|
|
529
|
+
variable: extInputRecord.getId().getValue(),
|
|
530
|
+
},
|
|
531
|
+
}));
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
// Check if value is a datapill — if so, create sys_element_mapping instead of sys_variable_value
|
|
535
|
+
const pillString = resolveFieldToPillString(valueShape, cidMap);
|
|
536
|
+
if (pillString) {
|
|
537
|
+
collectPillTypes(pillString, pillTypeMap);
|
|
538
|
+
extendedVariableValueRecords.push(await factory.createRecord({
|
|
539
|
+
source: callExpression,
|
|
540
|
+
table: 'sys_element_mapping',
|
|
541
|
+
properties: {
|
|
542
|
+
field: name,
|
|
543
|
+
id: stepInstanceSysId,
|
|
544
|
+
table: extInputTableName,
|
|
545
|
+
value: stripPillType(pillString),
|
|
546
|
+
},
|
|
547
|
+
}));
|
|
548
|
+
}
|
|
549
|
+
else if (valueShape.is(sdk_build_core_1.TemplateExpressionShape)) {
|
|
550
|
+
const { result, hasPills } = resolveTemplateExpression(valueShape, cidMap, pillTypeMap);
|
|
551
|
+
if (hasPills) {
|
|
552
|
+
extendedVariableValueRecords.push(await factory.createRecord({
|
|
553
|
+
source: callExpression,
|
|
554
|
+
table: 'sys_element_mapping',
|
|
555
|
+
properties: {
|
|
556
|
+
field: name,
|
|
557
|
+
id: stepInstanceSysId,
|
|
558
|
+
table: extInputTableName,
|
|
559
|
+
value: result,
|
|
560
|
+
},
|
|
561
|
+
}));
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
extendedVariableValueRecords.push(await factory.createRecord({
|
|
565
|
+
source: callExpression,
|
|
566
|
+
table: 'sys_variable_value',
|
|
567
|
+
properties: {
|
|
568
|
+
document: 'sys_hub_step_instance',
|
|
569
|
+
document_key: stepInstanceSysId,
|
|
570
|
+
order: 100,
|
|
571
|
+
value: result,
|
|
572
|
+
variable: extInputRecord.getId().getValue(),
|
|
573
|
+
},
|
|
574
|
+
}));
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
// Simple value → store in sys_variable_value
|
|
579
|
+
const rawVal = valueShape.ifString()?.getValue() ?? valueShape.getValue?.();
|
|
580
|
+
const resolvedValue = typeof rawVal === 'symbol' ? '' : (rawVal ?? '');
|
|
581
|
+
extendedVariableValueRecords.push(await factory.createRecord({
|
|
582
|
+
source: callExpression,
|
|
583
|
+
table: 'sys_variable_value',
|
|
584
|
+
properties: {
|
|
585
|
+
document: 'sys_hub_step_instance',
|
|
586
|
+
document_key: stepInstanceSysId,
|
|
587
|
+
order: 100,
|
|
588
|
+
value: resolvedValue,
|
|
589
|
+
variable: extInputRecord.getId().getValue(),
|
|
590
|
+
},
|
|
591
|
+
}));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
283
594
|
}
|
|
284
595
|
}
|
|
285
596
|
const outputVariables = valuesArray['outputVariables'];
|
|
597
|
+
const complexObjectRecords = [];
|
|
286
598
|
if (outputVariables) {
|
|
287
599
|
const outputItemShape = outputVariables.asObject();
|
|
288
|
-
const outputProperties = outputItemShape.properties();
|
|
600
|
+
const outputProperties = outputItemShape.properties({ resolve: false });
|
|
289
601
|
for (const [columnName, columnCallExpr] of Object.entries(outputProperties)) {
|
|
290
602
|
const callExpr = columnCallExpr.as(sdk_build_core_1.CallExpressionShape);
|
|
291
|
-
const columnType = callExpr.getCallee(); // e.g., 'StringColumn', 'IntegerColumn'
|
|
603
|
+
const columnType = callExpr.getCallee(); // e.g., 'StringColumn', 'IntegerColumn', 'FlowObject', 'FlowArray'
|
|
292
604
|
const columnConfig = callExpr.getArgument(0)?.asObject();
|
|
293
605
|
const columnLabel = columnConfig?.get('label')?.getValue();
|
|
294
606
|
const mandatory = columnConfig?.get('mandatory')?.getValue();
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
607
|
+
// Handle FlowObject and FlowArray complex objects
|
|
608
|
+
if (columnType === flow_constants_1.FLOW_OBJECT_API_NAME || columnType === flow_constants_1.FLOW_ARRAY_API_NAME) {
|
|
609
|
+
const coTypeName = columnConfig?.get('co_type_name')?.ifString()?.getValue();
|
|
610
|
+
const varSysId = `${stepInstanceSysId}_${columnName}`;
|
|
611
|
+
const complexObjectId = coTypeName || `FD${varSysId}`;
|
|
612
|
+
const isArray = columnType === flow_constants_1.FLOW_ARRAY_API_NAME;
|
|
613
|
+
// Generate schema for complex object
|
|
614
|
+
const schemaObj = (0, complex_objects_1.generateSchemaFromObject)(columnConfig, complexObjectId, columnName, stepInstanceSysId, 0, isArray, diagnostics, false);
|
|
615
|
+
// Create sys_complex_object record
|
|
616
|
+
const explicitId = columnConfig?.get('$id')?.ifString()?.getValue();
|
|
617
|
+
const complexRecord = await factory.createRecord({
|
|
618
|
+
source: callExpression,
|
|
619
|
+
table: 'sys_complex_object',
|
|
620
|
+
properties: {
|
|
621
|
+
name: complexObjectId,
|
|
622
|
+
namespace: 'FlowDesigner',
|
|
623
|
+
type: isArray ? 'complex_object_collection' : 'complex_object_schema',
|
|
624
|
+
serialized_content: JSON.stringify(schemaObj),
|
|
625
|
+
...(explicitId ? { sys_id: explicitId } : {}),
|
|
626
|
+
},
|
|
627
|
+
});
|
|
628
|
+
complexObjectRecords.push(complexRecord);
|
|
629
|
+
// Get complex object attributes
|
|
630
|
+
const systemAttributes = (0, complex_objects_1.getComplexObjectAttributes)(schemaObj, complexObjectId, isArray);
|
|
631
|
+
const attributesStr = (0, complex_objects_1.formatComplexObjectAttributes)(systemAttributes);
|
|
632
|
+
// Create ext_output record with complex object type
|
|
633
|
+
const extOutputRecord = await factory.createRecord({
|
|
634
|
+
source: callExpression,
|
|
635
|
+
table: 'sys_hub_step_ext_output',
|
|
636
|
+
properties: {
|
|
637
|
+
active: true,
|
|
638
|
+
model: stepInstanceSysId,
|
|
639
|
+
model_id: stepInstanceSysId,
|
|
640
|
+
model_table: 'sys_hub_step_instance',
|
|
641
|
+
name: `var__m_sys_hub_step_ext_output_${stepInstanceSysId}`,
|
|
642
|
+
element: columnName,
|
|
643
|
+
label: columnLabel || columnName,
|
|
644
|
+
internal_type: 'string',
|
|
645
|
+
max_length: 65000,
|
|
646
|
+
mandatory: mandatory,
|
|
647
|
+
attributes: attributesStr,
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
extendedOutputRecords.push(extOutputRecord);
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
// Handle regular column types (StringColumn, IntegerColumn, etc.)
|
|
654
|
+
const internalType = column_helper_1.COLUMN_API_TO_TYPE[columnType] || 'string';
|
|
655
|
+
const maxLength = columnConfig?.get('maxLength')?.ifNumber()?.getValue();
|
|
656
|
+
const hint = columnConfig?.get('hint')?.ifString()?.getValue();
|
|
657
|
+
const defaultValue = columnConfig?.get('default')?.ifString()?.getValue();
|
|
658
|
+
const extOutputRecord = await factory.createRecord({
|
|
659
|
+
source: callExpression,
|
|
660
|
+
table: 'sys_hub_step_ext_output',
|
|
661
|
+
properties: {
|
|
662
|
+
active: true,
|
|
663
|
+
model: stepInstanceSysId,
|
|
664
|
+
model_id: stepInstanceSysId,
|
|
665
|
+
model_table: 'sys_hub_step_instance',
|
|
666
|
+
name: `var__m_sys_hub_step_ext_output_${stepInstanceSysId}`,
|
|
667
|
+
element: columnName,
|
|
668
|
+
label: columnLabel || columnName,
|
|
669
|
+
internal_type: internalType,
|
|
670
|
+
mandatory: mandatory,
|
|
671
|
+
...(maxLength != null ? { max_length: maxLength } : {}),
|
|
672
|
+
...(hint ? { hint } : {}),
|
|
673
|
+
...(defaultValue ? { default_value: defaultValue } : {}),
|
|
674
|
+
attributes: (0, flow_constants_1.buildExtVarAttributes)(internalType),
|
|
675
|
+
},
|
|
676
|
+
});
|
|
677
|
+
extendedOutputRecords.push(extOutputRecord);
|
|
678
|
+
}
|
|
312
679
|
}
|
|
313
680
|
}
|
|
314
|
-
return updatedStepInstanceRecord.with(...
|
|
681
|
+
return updatedStepInstanceRecord.with(...stepDataRecords, ...extendedInputRecords, ...extendedVariableValueRecords, ...extendedOutputRecords, ...complexObjectRecords);
|
|
315
682
|
}
|
|
316
|
-
async function createVariableRecords(
|
|
317
|
-
const properties = values.properties();
|
|
683
|
+
async function createVariableRecords(valuesProperties, inputs, factory, callExpression, stepInstanceSysId, stepDefinitionSysId, cidMap) {
|
|
318
684
|
// Filter out inputVariables, outputVariables and errorHandlingType as they are handled separately
|
|
319
|
-
const filteredEntries = Object.entries(
|
|
320
|
-
|
|
685
|
+
const filteredEntries = Object.entries(valuesProperties).filter(([key]) => key !== 'inputVariables' && key !== 'outputVariables' && key !== 'errorHandlingType');
|
|
686
|
+
// Build reverse lookup (elementName → varSysId) from BUILT_IN_STEP_DEFINITIONS
|
|
687
|
+
const builtInDef = flow_constants_1.BUILT_IN_STEP_DEFINITIONS[stepDefinitionSysId];
|
|
688
|
+
const elementToVarSysId = {};
|
|
689
|
+
if (builtInDef) {
|
|
690
|
+
for (const [varSysId, entry] of Object.entries(builtInDef.inputs)) {
|
|
691
|
+
elementToVarSysId[(0, flow_constants_1.getVarEntryName)(entry)] = varSysId;
|
|
692
|
+
}
|
|
693
|
+
for (const [varSysId, entry] of Object.entries(builtInDef.outputs)) {
|
|
694
|
+
elementToVarSysId[(0, flow_constants_1.getVarEntryName)(entry)] = varSysId;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
const pillTypeMap = callExpression.getPillTypeMap();
|
|
698
|
+
const allRecords = [];
|
|
699
|
+
await Promise.all(filteredEntries.map(async ([key, valueShape]) => {
|
|
700
|
+
// Try resolving from inputDefinitions shape first, then fall back to built-in map
|
|
701
|
+
let variableSysId = '';
|
|
321
702
|
const input = inputs?.get(key);
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
703
|
+
if (input instanceof sdk_build_core_1.CallExpressionShape) {
|
|
704
|
+
variableSysId = input.getArgument(0).asObject().get('sysId')?.getValue() ?? '';
|
|
705
|
+
}
|
|
706
|
+
if (!variableSysId) {
|
|
707
|
+
variableSysId = elementToVarSysId[key] ?? '';
|
|
708
|
+
}
|
|
709
|
+
// ApprovalDueDateShape: store JSON in sys_element_mapping.value (ServiceNow reads from there)
|
|
710
|
+
// and create sys_variable_value with empty value
|
|
711
|
+
if (valueShape.is(flow_shapes_1.ApprovalDueDateShape)) {
|
|
712
|
+
const jsonValue = valueShape.toString().getValue();
|
|
713
|
+
const [elementMappingRecord, variableValueRecord] = await Promise.all([
|
|
714
|
+
factory.createRecord({
|
|
715
|
+
source: callExpression,
|
|
716
|
+
table: 'sys_element_mapping',
|
|
717
|
+
properties: {
|
|
718
|
+
field: key,
|
|
719
|
+
id: stepInstanceSysId,
|
|
720
|
+
table: `var__m_sys_flow_step_definition_input_${stepDefinitionSysId}`,
|
|
721
|
+
value: jsonValue,
|
|
722
|
+
},
|
|
723
|
+
}),
|
|
724
|
+
factory.createRecord({
|
|
725
|
+
source: callExpression,
|
|
726
|
+
table: 'sys_variable_value',
|
|
727
|
+
properties: {
|
|
728
|
+
document: 'sys_hub_step_instance',
|
|
729
|
+
document_key: stepInstanceSysId,
|
|
730
|
+
order: 100,
|
|
731
|
+
// value intentionally empty: ServiceNow reads due_date JSON from sys_element_mapping, not here
|
|
732
|
+
value: '',
|
|
733
|
+
variable: variableSysId,
|
|
734
|
+
},
|
|
735
|
+
}),
|
|
736
|
+
]);
|
|
737
|
+
allRecords.push(elementMappingRecord, variableValueRecord);
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
// Handle TemplateValueShape specially - serialize to ServiceNow format.
|
|
741
|
+
// When TemplateValue contains datapills, the platform stores the entire encoded string
|
|
742
|
+
// (with pills inline) in a single sys_element_mapping record with field=<parent input name>.
|
|
743
|
+
let actualValue;
|
|
744
|
+
if (valueShape.is(sdk_build_core_1.TemplateValueShape)) {
|
|
745
|
+
const templateObj = valueShape.getTemplateValue();
|
|
746
|
+
const entries = [];
|
|
747
|
+
let hasPills = false;
|
|
748
|
+
for (const [field, fieldShape] of templateObj.entries({ resolve: false })) {
|
|
749
|
+
const pillString = resolveFieldToPillString(fieldShape, cidMap);
|
|
750
|
+
if (pillString) {
|
|
751
|
+
collectPillTypes(pillString, pillTypeMap);
|
|
752
|
+
entries.push(`${field}=${stripPillType(pillString)}`);
|
|
753
|
+
hasPills = true;
|
|
754
|
+
}
|
|
755
|
+
else if (fieldShape.is(sdk_build_core_1.TemplateExpressionShape)) {
|
|
756
|
+
const resolved = resolveTemplateExpression(fieldShape, cidMap, pillTypeMap);
|
|
757
|
+
if (resolved.hasPills) {
|
|
758
|
+
hasPills = true;
|
|
759
|
+
}
|
|
760
|
+
const escapedValue = resolved.result.replace(/\^/g, '^^');
|
|
761
|
+
entries.push(`${field}=${escapedValue}`);
|
|
762
|
+
}
|
|
763
|
+
else {
|
|
764
|
+
const resolved = fieldShape.getValue();
|
|
765
|
+
const escapedValue = String(resolved).replace(/\^/g, '^^');
|
|
766
|
+
entries.push(`${field}=${escapedValue}`);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
const encodedValue = entries.join('^');
|
|
770
|
+
if (hasPills) {
|
|
771
|
+
// TemplateValue with datapills → single sys_element_mapping record
|
|
772
|
+
// No sys_variable_value for this field — platform reads from element_mapping only
|
|
773
|
+
allRecords.push(await factory.createRecord({
|
|
774
|
+
source: callExpression,
|
|
775
|
+
table: 'sys_element_mapping',
|
|
776
|
+
properties: {
|
|
777
|
+
field: key,
|
|
778
|
+
id: stepInstanceSysId,
|
|
779
|
+
table: `var__m_sys_flow_step_definition_input_${stepDefinitionSysId}`,
|
|
780
|
+
value: encodedValue,
|
|
781
|
+
},
|
|
782
|
+
}));
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
// No datapills — standard encoded string in sys_variable_value
|
|
786
|
+
actualValue = encodedValue ? `${encodedValue}^EQ` : '';
|
|
787
|
+
}
|
|
788
|
+
else if (valueShape.is(sdk_build_core_1.DurationShape)) {
|
|
789
|
+
// DurationShape.getValue() returns a symbol, so use toString() instead
|
|
790
|
+
actualValue = valueShape.toString().getValue();
|
|
791
|
+
}
|
|
792
|
+
else if (valueShape.is(flow_shapes_1.ApprovalRulesShape)) {
|
|
793
|
+
// ApprovalRulesShape.getValue() returns a JSON object, not a string.
|
|
794
|
+
// Previously fell through to the generic getValue() path which stored a raw [object Object].
|
|
795
|
+
// toString() correctly serializes it to the JSON string ServiceNow expects.
|
|
796
|
+
actualValue = valueShape.toString().getValue();
|
|
797
|
+
}
|
|
798
|
+
else if (valueShape.is(sdk_build_core_1.TemplateExpressionShape)) {
|
|
799
|
+
const { result, hasPills } = resolveTemplateExpression(valueShape, cidMap, pillTypeMap);
|
|
800
|
+
if (hasPills) {
|
|
801
|
+
allRecords.push(await factory.createRecord({
|
|
802
|
+
source: callExpression,
|
|
803
|
+
table: 'sys_element_mapping',
|
|
804
|
+
properties: {
|
|
805
|
+
field: key,
|
|
806
|
+
id: stepInstanceSysId,
|
|
807
|
+
table: `var__m_sys_flow_step_definition_input_${stepDefinitionSysId}`,
|
|
808
|
+
value: result,
|
|
809
|
+
},
|
|
810
|
+
}));
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
actualValue = result;
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
// Check if it's a wfa.dataPill() CallExpressionShape (step output reference)
|
|
817
|
+
// that needs to be resolved to a pill string for sys_element_mapping
|
|
818
|
+
const pillString = resolveFieldToPillString(valueShape, cidMap);
|
|
819
|
+
if (pillString) {
|
|
820
|
+
collectPillTypes(pillString, pillTypeMap);
|
|
821
|
+
allRecords.push(await factory.createRecord({
|
|
822
|
+
source: callExpression,
|
|
823
|
+
table: 'sys_element_mapping',
|
|
824
|
+
properties: {
|
|
825
|
+
field: key,
|
|
826
|
+
id: stepInstanceSysId,
|
|
827
|
+
table: `var__m_sys_flow_step_definition_input_${stepDefinitionSysId}`,
|
|
828
|
+
value: stripPillType(pillString),
|
|
829
|
+
},
|
|
830
|
+
}));
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
const rawValue = valueShape.getValue?.();
|
|
834
|
+
// Guard against symbol values (e.g., DurationShape, unresolved shapes with { resolve: false })
|
|
835
|
+
// since factory.createRecord cannot serialize symbols. Fall back to empty string.
|
|
836
|
+
actualValue = typeof rawValue === 'symbol' ? '' : (rawValue ?? '');
|
|
837
|
+
}
|
|
838
|
+
const record = await factory.createRecord({
|
|
327
839
|
source: callExpression,
|
|
328
840
|
table: 'sys_variable_value',
|
|
329
841
|
properties: {
|
|
@@ -334,6 +846,8 @@ async function createVariableRecords(values, inputs, factory, callExpression, st
|
|
|
334
846
|
variable: variableSysId,
|
|
335
847
|
},
|
|
336
848
|
});
|
|
849
|
+
allRecords.push(record);
|
|
337
850
|
}));
|
|
851
|
+
return allRecords;
|
|
338
852
|
}
|
|
339
853
|
//# sourceMappingURL=step-instance-plugin.js.map
|