@servicenow/sdk-build-plugins 4.2.0 → 4.4.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 +11 -0
- package/dist/acl-plugin.js.map +1 -1
- package/dist/applicability-plugin.d.ts +2 -0
- package/dist/applicability-plugin.js +72 -0
- package/dist/applicability-plugin.js.map +1 -0
- package/dist/atf/test-plugin.js +5 -2
- package/dist/atf/test-plugin.js.map +1 -1
- package/dist/basic-syntax-plugin.js +7 -1
- package/dist/basic-syntax-plugin.js.map +1 -1
- package/dist/business-rule-plugin.js +1 -0
- package/dist/business-rule-plugin.js.map +1 -1
- package/dist/call-expression-plugin.js +1 -107
- package/dist/call-expression-plugin.js.map +1 -1
- package/dist/column/column-to-record.d.ts +10 -3
- package/dist/column/column-to-record.js +44 -7
- package/dist/column/column-to-record.js.map +1 -1
- package/dist/column-plugin.d.ts +3 -1
- package/dist/column-plugin.js +12 -12
- package/dist/column-plugin.js.map +1 -1
- package/dist/dashboard/dashboard-component-property-defaults.d.ts +152 -0
- package/dist/dashboard/dashboard-component-property-defaults.js +264 -0
- package/dist/dashboard/dashboard-component-property-defaults.js.map +1 -0
- package/dist/dashboard/dashboard-component-resolver.d.ts +13 -0
- package/dist/dashboard/dashboard-component-resolver.js +69 -0
- package/dist/dashboard/dashboard-component-resolver.js.map +1 -0
- package/dist/dashboard/dashboard-plugin.d.ts +12 -0
- package/dist/dashboard/dashboard-plugin.js +397 -0
- package/dist/dashboard/dashboard-plugin.js.map +1 -0
- package/dist/data-plugin.d.ts +3 -0
- package/dist/data-plugin.js +61 -113
- package/dist/data-plugin.js.map +1 -1
- package/dist/email-notification-plugin.d.ts +2 -0
- package/dist/email-notification-plugin.js +541 -0
- package/dist/email-notification-plugin.js.map +1 -0
- package/dist/flow/constants/flow-plugin-constants.d.ts +58 -0
- package/dist/flow/constants/flow-plugin-constants.js +70 -0
- package/dist/flow/constants/flow-plugin-constants.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-constants.d.ts +38 -0
- package/dist/flow/flow-logic/flow-logic-constants.js +118 -0
- package/dist/flow/flow-logic/flow-logic-constants.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-diagnostics.d.ts +19 -0
- package/dist/flow/flow-logic/flow-logic-diagnostics.js +503 -0
- package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.d.ts +62 -0
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.js +2092 -0
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-plugin.d.ts +52 -0
- package/dist/flow/flow-logic/flow-logic-plugin.js +283 -0
- package/dist/flow/flow-logic/flow-logic-plugin.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-shapes.d.ts +104 -0
- package/dist/flow/flow-logic/flow-logic-shapes.js +201 -0
- package/dist/flow/flow-logic/flow-logic-shapes.js.map +1 -0
- package/dist/flow/plugins/approval-rules-plugin.d.ts +2 -0
- package/dist/flow/plugins/approval-rules-plugin.js +49 -0
- package/dist/flow/plugins/approval-rules-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-action-definition-plugin.d.ts +2 -0
- package/dist/flow/plugins/flow-action-definition-plugin.js +286 -0
- package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-data-pill-plugin.d.ts +9 -0
- package/dist/flow/plugins/flow-data-pill-plugin.js +212 -0
- package/dist/flow/plugins/flow-data-pill-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-definition-plugin.d.ts +2 -0
- package/dist/flow/plugins/flow-definition-plugin.js +1668 -0
- package/dist/flow/plugins/flow-definition-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-diagnostics-plugin.d.ts +26 -0
- package/dist/flow/plugins/flow-diagnostics-plugin.js +217 -0
- package/dist/flow/plugins/flow-diagnostics-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-instance-plugin.d.ts +12 -0
- package/dist/flow/plugins/flow-instance-plugin.js +1205 -0
- package/dist/flow/plugins/flow-instance-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-trigger-instance-plugin.d.ts +2 -0
- package/dist/flow/plugins/flow-trigger-instance-plugin.js +338 -0
- package/dist/flow/plugins/flow-trigger-instance-plugin.js.map +1 -0
- package/dist/flow/plugins/inline-script-plugin.d.ts +39 -0
- package/dist/flow/plugins/inline-script-plugin.js +80 -0
- package/dist/flow/plugins/inline-script-plugin.js.map +1 -0
- package/dist/flow/plugins/step-definition-plugin.d.ts +5 -0
- package/dist/flow/plugins/step-definition-plugin.js +71 -0
- package/dist/flow/plugins/step-definition-plugin.js.map +1 -0
- package/dist/flow/plugins/step-instance-plugin.d.ts +31 -0
- package/dist/flow/plugins/step-instance-plugin.js +339 -0
- package/dist/flow/plugins/step-instance-plugin.js.map +1 -0
- package/dist/flow/plugins/trigger-plugin.d.ts +2 -0
- package/dist/flow/plugins/trigger-plugin.js +96 -0
- package/dist/flow/plugins/trigger-plugin.js.map +1 -0
- package/dist/flow/plugins/wfa-datapill-plugin.d.ts +15 -0
- package/dist/flow/plugins/wfa-datapill-plugin.js +178 -0
- package/dist/flow/plugins/wfa-datapill-plugin.js.map +1 -0
- package/dist/flow/utils/approval-rules-processor.d.ts +13 -0
- package/dist/flow/utils/approval-rules-processor.js +267 -0
- package/dist/flow/utils/approval-rules-processor.js.map +1 -0
- package/dist/flow/utils/built-in-complex-objects.d.ts +19 -0
- package/dist/flow/utils/built-in-complex-objects.js +62 -0
- package/dist/flow/utils/built-in-complex-objects.js.map +1 -0
- package/dist/flow/utils/complex-object-resolver.d.ts +8 -0
- package/dist/flow/utils/complex-object-resolver.js +614 -0
- package/dist/flow/utils/complex-object-resolver.js.map +1 -0
- package/dist/flow/utils/complex-objects.d.ts +36 -0
- package/dist/flow/utils/complex-objects.js +481 -0
- package/dist/flow/utils/complex-objects.js.map +1 -0
- package/dist/flow/utils/data-pill-shapes.d.ts +58 -0
- package/dist/flow/utils/data-pill-shapes.js +135 -0
- package/dist/flow/utils/data-pill-shapes.js.map +1 -0
- package/dist/flow/utils/datapill-transformer.d.ts +110 -0
- package/dist/flow/utils/datapill-transformer.js +503 -0
- package/dist/flow/utils/datapill-transformer.js.map +1 -0
- package/dist/flow/utils/flow-constants.d.ts +72 -0
- package/dist/flow/utils/flow-constants.js +230 -0
- package/dist/flow/utils/flow-constants.js.map +1 -0
- package/dist/flow/utils/flow-io-to-record.d.ts +44 -0
- package/dist/flow/utils/flow-io-to-record.js +409 -0
- package/dist/flow/utils/flow-io-to-record.js.map +1 -0
- package/dist/flow/utils/flow-shapes.d.ts +161 -0
- package/dist/flow/utils/flow-shapes.js +255 -0
- package/dist/flow/utils/flow-shapes.js.map +1 -0
- package/dist/flow/utils/flow-to-xml.d.ts +16 -0
- package/dist/flow/utils/flow-to-xml.js +237 -0
- package/dist/flow/utils/flow-to-xml.js.map +1 -0
- package/dist/flow/utils/flow-variable-processor.d.ts +51 -0
- package/dist/flow/utils/flow-variable-processor.js +69 -0
- package/dist/flow/utils/flow-variable-processor.js.map +1 -0
- package/dist/flow/utils/label-cache-parser.d.ts +7 -0
- package/dist/flow/utils/label-cache-parser.js +24 -0
- package/dist/flow/utils/label-cache-parser.js.map +1 -0
- package/dist/flow/utils/label-cache-processor.d.ts +119 -0
- package/dist/flow/utils/label-cache-processor.js +719 -0
- package/dist/flow/utils/label-cache-processor.js.map +1 -0
- package/dist/flow/utils/pill-string-parser.d.ts +88 -0
- package/dist/flow/utils/pill-string-parser.js +306 -0
- package/dist/flow/utils/pill-string-parser.js.map +1 -0
- package/dist/flow/utils/schema-to-flow-object.d.ts +22 -0
- package/dist/flow/utils/schema-to-flow-object.js +318 -0
- package/dist/flow/utils/schema-to-flow-object.js.map +1 -0
- package/dist/flow/utils/service-catalog.d.ts +47 -0
- package/dist/flow/utils/service-catalog.js +137 -0
- package/dist/flow/utils/service-catalog.js.map +1 -0
- package/dist/flow/utils/utils.d.ts +117 -0
- package/dist/flow/utils/utils.js +345 -0
- package/dist/flow/utils/utils.js.map +1 -0
- package/dist/index.d.ts +20 -1
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/dist/list-plugin.js +1 -1
- package/dist/list-plugin.js.map +1 -1
- package/dist/now-attach-plugin.d.ts +1 -0
- package/dist/now-attach-plugin.js +10 -10
- package/dist/now-attach-plugin.js.map +1 -1
- package/dist/now-ref-plugin.js +1 -1
- package/dist/now-ref-plugin.js.map +1 -1
- package/dist/record-plugin.d.ts +29 -0
- package/dist/record-plugin.js +66 -7
- package/dist/record-plugin.js.map +1 -1
- package/dist/repack/index.d.ts +2 -0
- package/dist/repack/index.js +8 -0
- package/dist/repack/index.js.map +1 -1
- package/dist/rest-api-plugin.js +54 -44
- package/dist/rest-api-plugin.js.map +1 -1
- package/dist/server-module-plugin/index.d.ts +10 -0
- package/dist/server-module-plugin/index.js +83 -59
- package/dist/server-module-plugin/index.js.map +1 -1
- package/dist/service-catalog/catalog-clientscript-plugin.d.ts +2 -0
- package/dist/service-catalog/catalog-clientscript-plugin.js +117 -0
- package/dist/service-catalog/catalog-clientscript-plugin.js.map +1 -0
- package/dist/service-catalog/catalog-item-plugin.d.ts +2 -0
- package/dist/service-catalog/catalog-item-plugin.js +115 -0
- package/dist/service-catalog/catalog-item-plugin.js.map +1 -0
- package/dist/service-catalog/catalog-ui-policy-plugin.d.ts +2 -0
- package/dist/service-catalog/catalog-ui-policy-plugin.js +266 -0
- package/dist/service-catalog/catalog-ui-policy-plugin.js.map +1 -0
- package/dist/service-catalog/index.d.ts +5 -0
- package/dist/service-catalog/index.js +22 -0
- package/dist/service-catalog/index.js.map +1 -0
- package/dist/service-catalog/record-to-shape.d.ts +6 -0
- package/dist/service-catalog/record-to-shape.js +93 -0
- package/dist/service-catalog/record-to-shape.js.map +1 -0
- package/dist/service-catalog/sc-record-producer-plugin.d.ts +2 -0
- package/dist/service-catalog/sc-record-producer-plugin.js +140 -0
- package/dist/service-catalog/sc-record-producer-plugin.js.map +1 -0
- package/dist/service-catalog/service-catalog-base.d.ts +311 -0
- package/dist/service-catalog/service-catalog-base.js +542 -0
- package/dist/service-catalog/service-catalog-base.js.map +1 -0
- package/dist/service-catalog/service-catalog-diagnostics.d.ts +45 -0
- package/dist/service-catalog/service-catalog-diagnostics.js +172 -0
- package/dist/service-catalog/service-catalog-diagnostics.js.map +1 -0
- package/dist/service-catalog/shape-to-record.d.ts +8 -0
- package/dist/service-catalog/shape-to-record.js +235 -0
- package/dist/service-catalog/shape-to-record.js.map +1 -0
- package/dist/service-catalog/utils.d.ts +323 -0
- package/dist/service-catalog/utils.js +1216 -0
- package/dist/service-catalog/utils.js.map +1 -0
- package/dist/service-catalog/variable-helper.d.ts +43 -0
- package/dist/service-catalog/variable-helper.js +92 -0
- package/dist/service-catalog/variable-helper.js.map +1 -0
- package/dist/service-catalog/variable-set-plugin.d.ts +2 -0
- package/dist/service-catalog/variable-set-plugin.js +175 -0
- package/dist/service-catalog/variable-set-plugin.js.map +1 -0
- package/dist/service-catalog/variables-transform.d.ts +139 -0
- package/dist/service-catalog/variables-transform.js +403 -0
- package/dist/service-catalog/variables-transform.js.map +1 -0
- package/dist/sla/sla-validators.d.ts +61 -0
- package/dist/sla/sla-validators.js +224 -0
- package/dist/sla/sla-validators.js.map +1 -0
- package/dist/sla-plugin.d.ts +5 -0
- package/dist/sla-plugin.js +280 -0
- package/dist/sla-plugin.js.map +1 -0
- package/dist/static-content-plugin.js +25 -2
- package/dist/static-content-plugin.js.map +1 -1
- package/dist/table-plugin.js +32 -15
- package/dist/table-plugin.js.map +1 -1
- package/dist/ui-page-plugin.js +832 -19
- package/dist/ui-page-plugin.js.map +1 -1
- package/dist/ui-policy-plugin.js +5 -7
- package/dist/ui-policy-plugin.js.map +1 -1
- package/dist/utils.d.ts +10 -1
- package/dist/utils.js +16 -0
- package/dist/utils.js.map +1 -1
- package/dist/ux-list-menu-config-plugin.d.ts +2 -0
- package/dist/ux-list-menu-config-plugin.js +292 -0
- package/dist/ux-list-menu-config-plugin.js.map +1 -0
- package/dist/workspace-plugin/chrome-tab.d.ts +2 -0
- package/dist/workspace-plugin/chrome-tab.js +46 -0
- package/dist/workspace-plugin/chrome-tab.js.map +1 -0
- package/dist/workspace-plugin/constants.d.ts +52 -0
- package/dist/workspace-plugin/constants.js +56 -0
- package/dist/workspace-plugin/constants.js.map +1 -0
- package/dist/workspace-plugin/fluent-utils.d.ts +9 -0
- package/dist/workspace-plugin/fluent-utils.js +60 -0
- package/dist/workspace-plugin/fluent-utils.js.map +1 -0
- package/dist/workspace-plugin/page.d.ts +8 -0
- package/dist/workspace-plugin/page.js +108 -0
- package/dist/workspace-plugin/page.js.map +1 -0
- package/dist/workspace-plugin/screen.d.ts +1 -0
- package/dist/workspace-plugin/screen.js +38 -0
- package/dist/workspace-plugin/screen.js.map +1 -0
- package/dist/workspace-plugin/templates/index.d.ts +10 -0
- package/dist/workspace-plugin/templates/index.js +20 -0
- package/dist/workspace-plugin/templates/index.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-composition.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-composition.js +4043 -0
- package/dist/workspace-plugin/templates/record-page-composition.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-data.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-data.js +527 -0
- package/dist/workspace-plugin/templates/record-page-data.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-interalEventMappings.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-interalEventMappings.js +39 -0
- package/dist/workspace-plugin/templates/record-page-interalEventMappings.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-layoutModel.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-layoutModel.js +55 -0
- package/dist/workspace-plugin/templates/record-page-layoutModel.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-properties.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-properties.js +135 -0
- package/dist/workspace-plugin/templates/record-page-properties.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page.d.ts +3 -0
- package/dist/workspace-plugin/templates/record-page.js +8 -0
- package/dist/workspace-plugin/templates/record-page.js.map +1 -0
- package/dist/workspace-plugin.d.ts +2 -0
- package/dist/workspace-plugin.js +453 -0
- package/dist/workspace-plugin.js.map +1 -0
- package/package.json +10 -12
- package/src/acl-plugin.ts +16 -1
- package/src/applicability-plugin.ts +82 -0
- package/src/atf/test-plugin.ts +6 -3
- package/src/basic-syntax-plugin.ts +10 -1
- package/src/business-rule-plugin.ts +2 -1
- package/src/call-expression-plugin.ts +2 -130
- package/src/column/column-to-record.ts +54 -8
- package/src/column-plugin.ts +29 -13
- package/src/dashboard/dashboard-component-property-defaults.ts +277 -0
- package/src/dashboard/dashboard-component-resolver.ts +69 -0
- package/src/dashboard/dashboard-plugin.ts +450 -0
- package/src/data-plugin.ts +67 -139
- package/src/email-notification-plugin.ts +850 -0
- package/src/flow/constants/flow-plugin-constants.ts +79 -0
- package/src/flow/flow-logic/flow-logic-constants.ts +120 -0
- package/src/flow/flow-logic/flow-logic-diagnostics.ts +591 -0
- package/src/flow/flow-logic/flow-logic-plugin-helpers.ts +2550 -0
- package/src/flow/flow-logic/flow-logic-plugin.ts +337 -0
- package/src/flow/flow-logic/flow-logic-shapes.ts +215 -0
- package/src/flow/plugins/approval-rules-plugin.ts +48 -0
- package/src/flow/plugins/flow-action-definition-plugin.ts +295 -0
- package/src/flow/plugins/flow-data-pill-plugin.ts +258 -0
- package/src/flow/plugins/flow-definition-plugin.ts +2173 -0
- package/src/flow/plugins/flow-diagnostics-plugin.ts +280 -0
- package/src/flow/plugins/flow-instance-plugin.ts +1499 -0
- package/src/flow/plugins/flow-trigger-instance-plugin.ts +444 -0
- package/src/flow/plugins/inline-script-plugin.ts +83 -0
- package/src/flow/plugins/step-definition-plugin.ts +67 -0
- package/src/flow/plugins/step-instance-plugin.ts +431 -0
- package/src/flow/plugins/trigger-plugin.ts +95 -0
- package/src/flow/plugins/wfa-datapill-plugin.ts +213 -0
- package/src/flow/utils/approval-rules-processor.ts +298 -0
- package/src/flow/utils/built-in-complex-objects.ts +81 -0
- package/src/flow/utils/complex-object-resolver.ts +875 -0
- package/src/flow/utils/complex-objects.ts +656 -0
- package/src/flow/utils/data-pill-shapes.ts +165 -0
- package/src/flow/utils/datapill-transformer.ts +632 -0
- package/src/flow/utils/flow-constants.ts +285 -0
- package/src/flow/utils/flow-io-to-record.ts +533 -0
- package/src/flow/utils/flow-shapes.ts +296 -0
- package/src/flow/utils/flow-to-xml.ts +318 -0
- package/src/flow/utils/flow-variable-processor.ts +100 -0
- package/src/flow/utils/label-cache-parser.ts +37 -0
- package/src/flow/utils/label-cache-processor.ts +870 -0
- package/src/flow/utils/pill-string-parser.ts +375 -0
- package/src/flow/utils/schema-to-flow-object.ts +385 -0
- package/src/flow/utils/service-catalog.ts +174 -0
- package/src/flow/utils/utils.ts +395 -0
- package/src/index.ts +20 -1
- package/src/list-plugin.ts +1 -1
- package/src/now-attach-plugin.ts +14 -11
- package/src/now-ref-plugin.ts +1 -1
- package/src/record-plugin.ts +76 -11
- package/src/repack/index.ts +14 -0
- package/src/rest-api-plugin.ts +62 -50
- package/src/server-module-plugin/index.ts +112 -86
- package/src/service-catalog/catalog-clientscript-plugin.ts +140 -0
- package/src/service-catalog/catalog-item-plugin.ts +162 -0
- package/src/service-catalog/catalog-ui-policy-plugin.ts +324 -0
- package/src/service-catalog/index.ts +5 -0
- package/src/service-catalog/record-to-shape.ts +109 -0
- package/src/service-catalog/sc-record-producer-plugin.ts +201 -0
- package/src/service-catalog/service-catalog-base.ts +600 -0
- package/src/service-catalog/service-catalog-diagnostics.ts +254 -0
- package/src/service-catalog/shape-to-record.ts +279 -0
- package/src/service-catalog/utils.ts +1455 -0
- package/src/service-catalog/variable-helper.ts +135 -0
- package/src/service-catalog/variable-set-plugin.ts +197 -0
- package/src/service-catalog/variables-transform.ts +438 -0
- package/src/sla/sla-validators.ts +331 -0
- package/src/sla-plugin.ts +358 -0
- package/src/static-content-plugin.ts +25 -2
- package/src/table-plugin.ts +49 -16
- package/src/ui-page-plugin.ts +1063 -20
- package/src/ui-policy-plugin.ts +5 -9
- package/src/utils.ts +24 -1
- package/src/ux-list-menu-config-plugin.ts +312 -0
- package/src/workspace-plugin/chrome-tab.ts +44 -0
- package/src/workspace-plugin/constants.ts +53 -0
- package/src/workspace-plugin/fluent-utils.ts +60 -0
- package/src/workspace-plugin/page.ts +139 -0
- package/src/workspace-plugin/screen.ts +34 -0
- package/src/workspace-plugin/templates/index.ts +17 -0
- package/src/workspace-plugin/templates/record-page-composition.ts +4051 -0
- package/src/workspace-plugin/templates/record-page-data.ts +523 -0
- package/src/workspace-plugin/templates/record-page-interalEventMappings.ts +35 -0
- package/src/workspace-plugin/templates/record-page-layoutModel.ts +51 -0
- package/src/workspace-plugin/templates/record-page-properties.ts +131 -0
- package/src/workspace-plugin/templates/record-page.ts +6 -0
- package/src/workspace-plugin.ts +574 -0
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uuidToRecordMap = void 0;
|
|
4
|
+
exports.buildUuidToIdentifierMap = buildUuidToIdentifierMap;
|
|
5
|
+
exports.extractInstanceShapeInfo = extractInstanceShapeInfo;
|
|
6
|
+
exports.rebuildCallExpressionWithDatapills = rebuildCallExpressionWithDatapills;
|
|
7
|
+
exports.rebuildInstanceWithDatapills = rebuildInstanceWithDatapills;
|
|
8
|
+
exports.isFlowLogicCallee = isFlowLogicCallee;
|
|
9
|
+
exports.flowLogicHasBody = flowLogicHasBody;
|
|
10
|
+
exports.extractFlowLogicBodies = extractFlowLogicBodies;
|
|
11
|
+
exports.rebuildFlowLogicWithDatapills = rebuildFlowLogicWithDatapills;
|
|
12
|
+
exports.processInstanceForDatapills = processInstanceForDatapills;
|
|
13
|
+
const sdk_build_core_1 = require("@servicenow/sdk-build-core");
|
|
14
|
+
const arrow_function_plugin_1 = require("../../arrow-function-plugin");
|
|
15
|
+
const flow_logic_constants_1 = require("../flow-logic/flow-logic-constants");
|
|
16
|
+
/**
|
|
17
|
+
* Flow logic types that have outputs and can be assigned to a variable
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* TODO: Extend this list as more flow logics with outputs are added also try to create map to identify arguments dynamically
|
|
21
|
+
* e.g., flow logic like waitForADuration has config at arg 0 and outputs, while others may have different positions
|
|
22
|
+
*/
|
|
23
|
+
const FLOW_LOGIC_WITH_OUTPUTS = [flow_logic_constants_1.FLOW_LOGIC.WAIT_FOR_A_DURATION];
|
|
24
|
+
// Module-level map to store UUID-to-Record mapping for forEach detection
|
|
25
|
+
// This is populated by buildUuidToIdentifierMap and used by isForEachParameter
|
|
26
|
+
exports.uuidToRecordMap = new Map();
|
|
27
|
+
/**
|
|
28
|
+
* Build a map of UUID to variable identifiers from instance records and shapes
|
|
29
|
+
* This map is used to transform UUID-based datapills into property access expressions
|
|
30
|
+
* Uses ui_id from records (not $id from config) because datapills reference ui_id
|
|
31
|
+
*
|
|
32
|
+
* @param recordToShapeMap - Map of instance records to their corresponding shapes
|
|
33
|
+
* @returns Map of UUID strings (ui_id) to IdentifierShapes
|
|
34
|
+
*/
|
|
35
|
+
function buildUuidToIdentifierMap(recordToShapeMap) {
|
|
36
|
+
const uuidToIdentifierMap = new Map();
|
|
37
|
+
// Clear and rebuild the module-level UUID-to-Record map
|
|
38
|
+
exports.uuidToRecordMap.clear();
|
|
39
|
+
for (const [record, instanceShape] of recordToShapeMap.entries()) {
|
|
40
|
+
// Extract ui_id from the record (this is what datapills reference)
|
|
41
|
+
const uiId = record.get('ui_id')?.getValue();
|
|
42
|
+
if (!uiId) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
// Handle VariableStatementShape (actions/subflows with variable assignments)
|
|
46
|
+
if (instanceShape instanceof sdk_build_core_1.VariableStatementShape) {
|
|
47
|
+
const variableStatement = instanceShape.as(sdk_build_core_1.VariableStatementShape);
|
|
48
|
+
const variableName = variableStatement.getVariableName();
|
|
49
|
+
const callExpression = variableStatement.getInitializer().as(sdk_build_core_1.CallExpressionShape);
|
|
50
|
+
const callee = callExpression.getCallee();
|
|
51
|
+
// For flow logic with outputs (e.g., waitForADuration), config is at position 0
|
|
52
|
+
// For actions/subflows, config is at position 1
|
|
53
|
+
const isFlowLogicWithOutputs = FLOW_LOGIC_WITH_OUTPUTS.includes(callee);
|
|
54
|
+
const configArgIndex = isFlowLogicWithOutputs ? 0 : 1;
|
|
55
|
+
const configArg = callExpression.getArgument(configArgIndex)?.asObject();
|
|
56
|
+
if (configArg) {
|
|
57
|
+
const uuid = configArg.get('uuid')?.ifString()?.getValue();
|
|
58
|
+
if (uuid && variableName) {
|
|
59
|
+
uuidToIdentifierMap.set(uuid, variableName);
|
|
60
|
+
exports.uuidToRecordMap.set(uuid, record);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Handle CallExpressionShape (flow logic like forEach)
|
|
65
|
+
else if (instanceShape instanceof sdk_build_core_1.CallExpressionShape) {
|
|
66
|
+
const callExpression = instanceShape.as(sdk_build_core_1.CallExpressionShape);
|
|
67
|
+
const callee = callExpression.getCallee();
|
|
68
|
+
if (callee === 'wfa.flowLogic.forEach') {
|
|
69
|
+
// Get the arrow function body (3rd argument for forEach)
|
|
70
|
+
// NOTE: For nested forEach, parameter names are order-based (item_0, item_1, item_2, etc.)
|
|
71
|
+
// This allows distinguishing which parent forEach an 'item' reference belongs to
|
|
72
|
+
// Example:
|
|
73
|
+
// forEach at order 0: (item_0) => { ... }
|
|
74
|
+
// forEach at order 1: (item_1) => { ... }
|
|
75
|
+
// In XML, datapills are stored as {{forEachUUID.item.field}}
|
|
76
|
+
// which gets transformed to item_0.field, item_1.field, etc. based on the UUID mapping
|
|
77
|
+
const bodyArg = callExpression.getArgument(2);
|
|
78
|
+
if (bodyArg?.if(arrow_function_plugin_1.ArrowFunctionShape)) {
|
|
79
|
+
const arrowFunc = bodyArg.as(arrow_function_plugin_1.ArrowFunctionShape);
|
|
80
|
+
const params = arrowFunc.getParameters();
|
|
81
|
+
// getParameters() returns IdentifierShape[] - use directly
|
|
82
|
+
if (params && params.length > 0) {
|
|
83
|
+
const paramIdentifier = params[0];
|
|
84
|
+
if (paramIdentifier) {
|
|
85
|
+
uuidToIdentifierMap.set(uiId, paramIdentifier);
|
|
86
|
+
exports.uuidToRecordMap.set(uiId, record);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return uuidToIdentifierMap;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Extract CallExpression and VariableStatement from an instance shape
|
|
97
|
+
* Handles both VariableStatementShape (for Action/Subflow) and bare CallExpressionShape (for flow logic)
|
|
98
|
+
*
|
|
99
|
+
* @param instanceShape - The shape to extract from
|
|
100
|
+
* @returns Object containing callExpression and variableStatement
|
|
101
|
+
*/
|
|
102
|
+
function extractInstanceShapeInfo(instanceShape) {
|
|
103
|
+
let callExpression;
|
|
104
|
+
let variableStatement;
|
|
105
|
+
if (instanceShape instanceof sdk_build_core_1.VariableStatementShape) {
|
|
106
|
+
callExpression = instanceShape.getInitializer().as(sdk_build_core_1.CallExpressionShape);
|
|
107
|
+
variableStatement = instanceShape;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
callExpression = instanceShape.as(sdk_build_core_1.CallExpressionShape);
|
|
111
|
+
variableStatement = callExpression;
|
|
112
|
+
}
|
|
113
|
+
return { callExpression, variableStatement };
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Rebuild a CallExpressionShape with transformed properties
|
|
117
|
+
* Creates a new CallExpression with the transformed props and cleaned config
|
|
118
|
+
*
|
|
119
|
+
* @param originalCallExpression - The original CallExpression
|
|
120
|
+
* @param transformedProps - The transformed properties object
|
|
121
|
+
* @param configShape - The config shape (possibly cleaned)
|
|
122
|
+
* @param record - The source record for shape creation
|
|
123
|
+
* @returns New CallExpressionShape with transformed properties
|
|
124
|
+
*/
|
|
125
|
+
function rebuildCallExpressionWithDatapills(originalCallExpression, transformedProps, configShape, record) {
|
|
126
|
+
const originalActionDef = originalCallExpression.getArgument(0, false);
|
|
127
|
+
const newPropsArg = sdk_build_core_1.Shape.from(record, transformedProps);
|
|
128
|
+
return new sdk_build_core_1.CallExpressionShape({
|
|
129
|
+
source: originalCallExpression.getSource(),
|
|
130
|
+
callee: originalCallExpression.getCallee(),
|
|
131
|
+
args: [originalActionDef, configShape, newPropsArg],
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Rebuild an instance shape (VariableStatement or CallExpression) with transformed datapills
|
|
136
|
+
*
|
|
137
|
+
* @param instanceShape - The original instance shape
|
|
138
|
+
* @param newCallExpression - The new CallExpression with transformed properties
|
|
139
|
+
* @param instanceShapeInfo - Information extracted from the instance shape
|
|
140
|
+
* @returns Rebuilt VariableStatementShape or the new CallExpression
|
|
141
|
+
*/
|
|
142
|
+
function rebuildInstanceWithDatapills(instanceShape, newCallExpression, instanceShapeInfo) {
|
|
143
|
+
const { variableStatement } = instanceShapeInfo;
|
|
144
|
+
if (instanceShape instanceof sdk_build_core_1.VariableStatementShape) {
|
|
145
|
+
return new sdk_build_core_1.VariableStatementShape({
|
|
146
|
+
source: variableStatement.getSource(),
|
|
147
|
+
variableName: variableStatement instanceof sdk_build_core_1.VariableStatementShape
|
|
148
|
+
? variableStatement.getVariableName()
|
|
149
|
+
: 'dummyVariable_removeLater', // For flow logic that returns outputs
|
|
150
|
+
initializer: newCallExpression,
|
|
151
|
+
isExported: false,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// Return the CallExpression directly for non-variable statements (flow logic)
|
|
155
|
+
return newCallExpression;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Check if a callee string represents a flow logic call
|
|
159
|
+
* @param callee - The callee string (e.g., 'wfa.flowLogic.if', 'wfa.action')
|
|
160
|
+
* @returns true if the callee is a flow logic call
|
|
161
|
+
*/
|
|
162
|
+
function isFlowLogicCallee(callee) {
|
|
163
|
+
return callee.startsWith(flow_logic_constants_1.FLOW_LOGIC_PREFIX);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Check if a flow logic type has a body (arrow function)
|
|
167
|
+
* @param callee - The flow logic callee (e.g., 'wfa.flowLogic.if')
|
|
168
|
+
* @returns true if the flow logic has a body
|
|
169
|
+
*/
|
|
170
|
+
function flowLogicHasBody(callee) {
|
|
171
|
+
// Flow logic with bodies: if, elseIf, else, forEach, tryCatch, doInParallel
|
|
172
|
+
// Flow logic without bodies: goBackTo, waitForADuration, exitLoop, endFlow, skipIteration
|
|
173
|
+
return [
|
|
174
|
+
flow_logic_constants_1.FLOW_LOGIC.IF,
|
|
175
|
+
flow_logic_constants_1.FLOW_LOGIC.ELSEIF,
|
|
176
|
+
flow_logic_constants_1.FLOW_LOGIC.ELSE,
|
|
177
|
+
flow_logic_constants_1.FLOW_LOGIC.FOR_EACH,
|
|
178
|
+
flow_logic_constants_1.FLOW_LOGIC.TRY_CATCH,
|
|
179
|
+
flow_logic_constants_1.FLOW_LOGIC.DO_IN_PARALLEL,
|
|
180
|
+
].includes(callee);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Extract arrow function bodies from a flow logic call expression
|
|
184
|
+
* Different flow logic types have bodies in different positions:
|
|
185
|
+
* - If/ElseIf/Else: Single body at argument 1
|
|
186
|
+
* - ForEach: Body at argument 2 (arg 0 is items, arg 1 is config)
|
|
187
|
+
* - TryCatch: Object with 'try' and 'catch' properties containing arrow functions
|
|
188
|
+
* - DoInParallel: Variadic functions starting from argument 1
|
|
189
|
+
*
|
|
190
|
+
* @param callExpression - The flow logic call expression
|
|
191
|
+
* @param callee - The flow logic callee
|
|
192
|
+
* @returns Array of arrow function shapes
|
|
193
|
+
*/
|
|
194
|
+
function extractFlowLogicBodies(callExpression, callee) {
|
|
195
|
+
const bodies = [];
|
|
196
|
+
if (callee === flow_logic_constants_1.FLOW_LOGIC.TRY_CATCH) {
|
|
197
|
+
// TryCatch: { try: () => {...}, catch: () => {...} }
|
|
198
|
+
const handlers = callExpression.getArgument(1)?.asObject();
|
|
199
|
+
if (handlers) {
|
|
200
|
+
const tryHandler = handlers.get('try');
|
|
201
|
+
const catchHandler = handlers.get('catch');
|
|
202
|
+
if (tryHandler?.if(arrow_function_plugin_1.ArrowFunctionShape)) {
|
|
203
|
+
bodies.push(tryHandler.as(arrow_function_plugin_1.ArrowFunctionShape));
|
|
204
|
+
}
|
|
205
|
+
if (catchHandler?.if(arrow_function_plugin_1.ArrowFunctionShape)) {
|
|
206
|
+
bodies.push(catchHandler.as(arrow_function_plugin_1.ArrowFunctionShape));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else if (callee === flow_logic_constants_1.FLOW_LOGIC.DO_IN_PARALLEL) {
|
|
211
|
+
// DoInParallel: config, fn1, fn2, fn3, ...
|
|
212
|
+
const allArgs = callExpression.getArguments();
|
|
213
|
+
for (let i = 1; i < allArgs.length; i++) {
|
|
214
|
+
const arg = callExpression.getArgument(i);
|
|
215
|
+
if (arg?.if(arrow_function_plugin_1.ArrowFunctionShape)) {
|
|
216
|
+
bodies.push(arg.as(arrow_function_plugin_1.ArrowFunctionShape));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else if (callee === flow_logic_constants_1.FLOW_LOGIC.FOR_EACH) {
|
|
221
|
+
// ForEach: items, config, body
|
|
222
|
+
const bodyArg = callExpression.getArgument(2);
|
|
223
|
+
if (bodyArg?.if(arrow_function_plugin_1.ArrowFunctionShape)) {
|
|
224
|
+
bodies.push(bodyArg.as(arrow_function_plugin_1.ArrowFunctionShape));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
// If/ElseIf/Else: config, body
|
|
229
|
+
const bodyArg = callExpression.getArgument(1);
|
|
230
|
+
if (bodyArg?.if(arrow_function_plugin_1.ArrowFunctionShape)) {
|
|
231
|
+
bodies.push(bodyArg.as(arrow_function_plugin_1.ArrowFunctionShape));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return bodies;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Rebuild a flow logic call expression with transformed config and bodies
|
|
238
|
+
* @param callExpression - Original call expression
|
|
239
|
+
* @param transformedConfig - Transformed config object
|
|
240
|
+
* @param transformedBodies - Transformed arrow function bodies
|
|
241
|
+
* @param callee - The flow logic callee
|
|
242
|
+
* @param record - The source record
|
|
243
|
+
* @returns Rebuilt CallExpressionShape
|
|
244
|
+
*/
|
|
245
|
+
function rebuildFlowLogicWithDatapills(callExpression, transformedConfig, transformedBodies, callee, record, transformedItemsArg) {
|
|
246
|
+
if (callee === flow_logic_constants_1.FLOW_LOGIC.TRY_CATCH) {
|
|
247
|
+
// TryCatch: config, { try: fn1, catch: fn2 }
|
|
248
|
+
const handlersObj = sdk_build_core_1.Shape.from(record, {
|
|
249
|
+
try: transformedBodies[0],
|
|
250
|
+
catch: transformedBodies[1],
|
|
251
|
+
});
|
|
252
|
+
return new sdk_build_core_1.CallExpressionShape({
|
|
253
|
+
source: callExpression.getSource(),
|
|
254
|
+
callee: callExpression.getCallee(),
|
|
255
|
+
args: [transformedConfig, handlersObj],
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (callee === 'wfa.flowLogic.doInParallel') {
|
|
259
|
+
// DoInParallel: config, fn1, fn2, ...
|
|
260
|
+
return new sdk_build_core_1.CallExpressionShape({
|
|
261
|
+
source: callExpression.getSource(),
|
|
262
|
+
callee: callExpression.getCallee(),
|
|
263
|
+
args: [transformedConfig, ...transformedBodies],
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
if (callee === 'wfa.flowLogic.forEach') {
|
|
267
|
+
// ForEach: items, config, body
|
|
268
|
+
// Use transformed items if available, otherwise use original
|
|
269
|
+
const itemsArg = transformedItemsArg || callExpression.getArgument(0, false);
|
|
270
|
+
return new sdk_build_core_1.CallExpressionShape({
|
|
271
|
+
source: callExpression.getSource(),
|
|
272
|
+
callee: callExpression.getCallee(),
|
|
273
|
+
args: [itemsArg, transformedConfig, transformedBodies[0]],
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
// If/ElseIf/Else: config, body
|
|
277
|
+
return new sdk_build_core_1.CallExpressionShape({
|
|
278
|
+
source: callExpression.getSource(),
|
|
279
|
+
callee: callExpression.getCallee(),
|
|
280
|
+
args: [transformedConfig, transformedBodies[0]],
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Recursively process an instance shape (Action, Subflow, or Flow Logic) to transform datapills
|
|
285
|
+
* This is the main entry point for datapill transformation that handles all instance types
|
|
286
|
+
*
|
|
287
|
+
* @param instanceShape - The instance shape to process (VariableStatementShape or CallExpressionShape)
|
|
288
|
+
* @param uuidToIdentifierMap - Map of UUID to variable identifiers for UUID-based datapills
|
|
289
|
+
* @param record - The source record for shape creation
|
|
290
|
+
* @param diagnostics - Diagnostics for error reporting
|
|
291
|
+
* @param paramName - Parameter name for semantic datapills (e.g., 'params')
|
|
292
|
+
* @param processShapeForDatapills - Recursive helper to process nested structures (objects/arrays)
|
|
293
|
+
* @param cleanupConfig - Optional callback to clean up Action/Subflow configs
|
|
294
|
+
* @returns DatapillTransformResult with transformed shape and change tracking
|
|
295
|
+
*/
|
|
296
|
+
function processInstanceForDatapills(instanceShape, uuidToIdentifierMap, record, diagnostics, paramName, logger, processShapeForDatapills, cleanupConfig) {
|
|
297
|
+
// Step 1: Extract call expression and variable statement
|
|
298
|
+
const { callExpression, variableStatement } = extractInstanceShapeInfo(instanceShape);
|
|
299
|
+
const callee = callExpression.getCallee();
|
|
300
|
+
const isFlowLogic = isFlowLogicCallee(callee);
|
|
301
|
+
// Step 2: Determine which properties to transform based on instance type
|
|
302
|
+
let propsArg;
|
|
303
|
+
let configArgIndex;
|
|
304
|
+
if (isFlowLogic) {
|
|
305
|
+
// For SetFlowVariables and AssignSubflowOutputs, transform the values object (3rd argument)
|
|
306
|
+
// For ForEach, transform the config (2nd argument)
|
|
307
|
+
// For other flow logic, transform the config (1st argument)
|
|
308
|
+
if (callee === flow_logic_constants_1.FLOW_LOGIC.SET_FLOW_VARIABLES || callee === flow_logic_constants_1.FLOW_LOGIC.ASSIGN_SUBFLOW_OUTPUTS) {
|
|
309
|
+
configArgIndex = 2;
|
|
310
|
+
propsArg = callExpression.getArgument(2);
|
|
311
|
+
}
|
|
312
|
+
else if (callee === flow_logic_constants_1.FLOW_LOGIC.FOR_EACH) {
|
|
313
|
+
configArgIndex = 1;
|
|
314
|
+
propsArg = callExpression.getArgument(1);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
configArgIndex = 0;
|
|
318
|
+
propsArg = callExpression.getArgument(0);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
// For Action/Subflow, we transform the inputs (3rd argument)
|
|
323
|
+
configArgIndex = 2;
|
|
324
|
+
propsArg = callExpression.getArgument(configArgIndex);
|
|
325
|
+
}
|
|
326
|
+
let overallChanged = false;
|
|
327
|
+
if (!propsArg.isDefined()) {
|
|
328
|
+
return { shape: instanceShape, propsChanged: false };
|
|
329
|
+
}
|
|
330
|
+
// Step 3: Transform schema argument for SetFlowVariables and AssignSubflowOutputs
|
|
331
|
+
// The schema argument (arg 1) contains PropertyAccessShape with placeholder identifier (_params)
|
|
332
|
+
// that needs to be resolved to the actual parameter name
|
|
333
|
+
let transformedSchemaArg;
|
|
334
|
+
if (callee === flow_logic_constants_1.FLOW_LOGIC.SET_FLOW_VARIABLES || callee === flow_logic_constants_1.FLOW_LOGIC.ASSIGN_SUBFLOW_OUTPUTS) {
|
|
335
|
+
const schemaArg = callExpression.getArgument(1);
|
|
336
|
+
if (schemaArg) {
|
|
337
|
+
const schemaResult = processShapeForDatapills(schemaArg, uuidToIdentifierMap, record, diagnostics, logger, paramName);
|
|
338
|
+
transformedSchemaArg = schemaResult.shape;
|
|
339
|
+
if (schemaResult.propsChanged) {
|
|
340
|
+
overallChanged = true;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// Step 3.5: Transform items argument for ForEach
|
|
345
|
+
// The items argument (arg 0) contains data pill strings like "{{trigger.array_field}}"
|
|
346
|
+
// that need to be converted to PropertyAccessShape with the correct parameter name
|
|
347
|
+
let transformedItemsArg;
|
|
348
|
+
if (callee === flow_logic_constants_1.FLOW_LOGIC.FOR_EACH) {
|
|
349
|
+
const itemsArg = callExpression.getArgument(0);
|
|
350
|
+
if (itemsArg) {
|
|
351
|
+
const itemsResult = processShapeForDatapills(itemsArg, uuidToIdentifierMap, record, diagnostics, logger, paramName);
|
|
352
|
+
transformedItemsArg = itemsResult.shape;
|
|
353
|
+
if (itemsResult.propsChanged) {
|
|
354
|
+
overallChanged = true;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Note: goBackTo step ID should remain as UUID string for XML serialization
|
|
359
|
+
// It will be resolved to an identifier during the flow-logic-plugin-helpers.ts transformation
|
|
360
|
+
// Step 4: Transform properties in config/inputs/values
|
|
361
|
+
let transformedConfig;
|
|
362
|
+
if (propsArg.isObject()) {
|
|
363
|
+
const propsObj = propsArg.asObject();
|
|
364
|
+
const propsEntries = propsObj.entries();
|
|
365
|
+
const transformedProps = {};
|
|
366
|
+
let propsChanged = false;
|
|
367
|
+
for (const [key, value] of propsEntries) {
|
|
368
|
+
const result = processShapeForDatapills(value, uuidToIdentifierMap, record, diagnostics, logger, paramName);
|
|
369
|
+
transformedProps[key] = result.shape;
|
|
370
|
+
if (result.propsChanged) {
|
|
371
|
+
propsChanged = true;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (propsChanged) {
|
|
375
|
+
transformedConfig = new sdk_build_core_1.ObjectShape({
|
|
376
|
+
source: propsArg.getSource(),
|
|
377
|
+
properties: transformedProps,
|
|
378
|
+
});
|
|
379
|
+
overallChanged = true;
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
transformedConfig = propsObj;
|
|
383
|
+
}
|
|
384
|
+
// Check if config cleanup would make changes (before overallChanged check)
|
|
385
|
+
// This ensures we don't early-return when cleanup is needed
|
|
386
|
+
if (cleanupConfig) {
|
|
387
|
+
// For Action/Subflow instances, check config (argument 1)
|
|
388
|
+
if (!isFlowLogic) {
|
|
389
|
+
const originalConfig = callExpression.getArgument(1);
|
|
390
|
+
if (originalConfig) {
|
|
391
|
+
const cleanedConfig = cleanupConfig(originalConfig, instanceShape);
|
|
392
|
+
if (cleanedConfig !== originalConfig) {
|
|
393
|
+
overallChanged = true;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
// For flow logic with outputs (e.g., WaitForADuration), check config (argument 0)
|
|
398
|
+
const isFlowLogicWithOutputs = FLOW_LOGIC_WITH_OUTPUTS.includes(callee);
|
|
399
|
+
if (isFlowLogicWithOutputs && transformedConfig) {
|
|
400
|
+
const cleanedConfig = cleanupConfig(transformedConfig, callExpression);
|
|
401
|
+
if (cleanedConfig !== transformedConfig) {
|
|
402
|
+
overallChanged = true;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// Step 4: Handle flow logic with bodies (recursive processing of child instances)
|
|
408
|
+
const transformedBodies = [];
|
|
409
|
+
if (isFlowLogic && flowLogicHasBody(callee)) {
|
|
410
|
+
const bodies = extractFlowLogicBodies(callExpression, callee);
|
|
411
|
+
for (const body of bodies) {
|
|
412
|
+
const childInstances = body.getStatements();
|
|
413
|
+
const transformedChildren = [];
|
|
414
|
+
let anyChildChanged = false;
|
|
415
|
+
// Recursively process each child instance
|
|
416
|
+
for (const childInstance of childInstances) {
|
|
417
|
+
const childResult = processInstanceForDatapills(childInstance, uuidToIdentifierMap, record, diagnostics, paramName, logger, processShapeForDatapills, cleanupConfig);
|
|
418
|
+
transformedChildren.push(childResult.shape);
|
|
419
|
+
if (childResult.propsChanged) {
|
|
420
|
+
anyChildChanged = true;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
// Rebuild body if children changed
|
|
424
|
+
const transformedBody = anyChildChanged
|
|
425
|
+
? new arrow_function_plugin_1.ArrowFunctionShape({
|
|
426
|
+
source: body.getSource(),
|
|
427
|
+
parameters: body.getParameters(),
|
|
428
|
+
statements: transformedChildren,
|
|
429
|
+
})
|
|
430
|
+
: body;
|
|
431
|
+
transformedBodies.push(transformedBody);
|
|
432
|
+
if (anyChildChanged) {
|
|
433
|
+
overallChanged = true;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
// Step 5: Rebuild instance if anything changed
|
|
438
|
+
if (!overallChanged) {
|
|
439
|
+
return {
|
|
440
|
+
shape: instanceShape,
|
|
441
|
+
propsChanged: false,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
// Rebuild the call expression
|
|
445
|
+
let newCallExpression;
|
|
446
|
+
if (isFlowLogic && transformedBodies.length > 0 && transformedConfig) {
|
|
447
|
+
// Rebuild flow logic with transformed config and bodies
|
|
448
|
+
newCallExpression = rebuildFlowLogicWithDatapills(callExpression, transformedConfig, transformedBodies, callee, record, transformedItemsArg // Pass transformed items for ForEach
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
// Rebuild Action/Subflow or flow logic without body
|
|
453
|
+
const originalActionDef = callExpression.getArgument(0, false);
|
|
454
|
+
let originalConfig = callExpression.getArgument(1);
|
|
455
|
+
// Apply config cleanup for Action/Subflow instances
|
|
456
|
+
if (!isFlowLogic && cleanupConfig && originalConfig) {
|
|
457
|
+
originalConfig = cleanupConfig(originalConfig, instanceShape);
|
|
458
|
+
}
|
|
459
|
+
const isFlowLogicWithOutputs = FLOW_LOGIC_WITH_OUTPUTS.includes(callee);
|
|
460
|
+
if (isFlowLogicWithOutputs && cleanupConfig && transformedConfig) {
|
|
461
|
+
transformedConfig = cleanupConfig(transformedConfig, callExpression).asObject();
|
|
462
|
+
}
|
|
463
|
+
const newArgs = [];
|
|
464
|
+
if (configArgIndex === 2) {
|
|
465
|
+
// Action/Subflow OR SetFlowVariables/AssignSubflowOutputs: definition/config, schema/config, inputs/values
|
|
466
|
+
newArgs.push(originalActionDef);
|
|
467
|
+
// For SetFlowVariables/AssignSubflowOutputs, use transformed schema arg if available
|
|
468
|
+
if (transformedSchemaArg) {
|
|
469
|
+
newArgs.push(transformedSchemaArg);
|
|
470
|
+
}
|
|
471
|
+
else if (originalConfig) {
|
|
472
|
+
newArgs.push(originalConfig);
|
|
473
|
+
}
|
|
474
|
+
newArgs.push(sdk_build_core_1.Shape.from(record, transformedConfig));
|
|
475
|
+
}
|
|
476
|
+
else if (configArgIndex === 1 && transformedConfig) {
|
|
477
|
+
// ForEach: items, config
|
|
478
|
+
// Use transformed items if available, otherwise use original
|
|
479
|
+
const itemsArg = transformedItemsArg || callExpression.getArgument(0, false);
|
|
480
|
+
newArgs.push(itemsArg);
|
|
481
|
+
newArgs.push(transformedConfig);
|
|
482
|
+
}
|
|
483
|
+
else if (configArgIndex === 0 && transformedConfig) {
|
|
484
|
+
// Flow logic without body: just config
|
|
485
|
+
newArgs.push(transformedConfig);
|
|
486
|
+
}
|
|
487
|
+
newCallExpression = new sdk_build_core_1.CallExpressionShape({
|
|
488
|
+
source: callExpression.getSource(),
|
|
489
|
+
callee: callExpression.getCallee(),
|
|
490
|
+
args: newArgs,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
// Rebuild instance (VariableStatement or CallExpression)
|
|
494
|
+
const rebuiltInstance = rebuildInstanceWithDatapills(instanceShape, newCallExpression, {
|
|
495
|
+
callExpression,
|
|
496
|
+
variableStatement,
|
|
497
|
+
});
|
|
498
|
+
return {
|
|
499
|
+
shape: rebuiltInstance,
|
|
500
|
+
propsChanged: true,
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
//# sourceMappingURL=datapill-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datapill-transformer.js","sourceRoot":"","sources":["../../../src/flow/utils/datapill-transformer.ts"],"names":[],"mappings":";;;AAmDA,4DAoEC;AASD,4DAaC;AAYD,gFAcC;AAUD,oEAqBC;AAOD,8CAEC;AAOD,4CAWC;AAcD,wDAwCC;AAWD,sEA+CC;AAqBD,kEAiRC;AAvnBD,+DASmC;AACnC,uEAAgE;AAChE,6EAAkF;AAkBlF;;GAEG;AACH;;;GAGG;AAEH,MAAM,uBAAuB,GAAG,CAAC,iCAAU,CAAC,mBAAmB,CAAC,CAAA;AAEhE,yEAAyE;AACzE,+EAA+E;AAClE,QAAA,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAA;AAExD;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CAAC,gBAAoC;IACzE,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAA2B,CAAA;IAE9D,wDAAwD;IACxD,uBAAe,CAAC,KAAK,EAAE,CAAA;IAEvB,KAAK,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/D,mEAAmE;QACnE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAwB,CAAA;QAElE,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,SAAQ;QACZ,CAAC;QAED,6EAA6E;QAC7E,IAAI,aAAa,YAAY,uCAAsB,EAAE,CAAC;YAClD,MAAM,iBAAiB,GAAG,aAAa,CAAC,EAAE,CAAC,uCAAsB,CAAC,CAAA;YAClE,MAAM,YAAY,GAAG,iBAAiB,CAAC,eAAe,EAAE,CAAA;YACxD,MAAM,cAAc,GAAG,iBAAiB,CAAC,cAAc,EAAE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W,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;YAC5E,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACtB,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;QACnC,CAAC;aAAM,IAAI,cAAc,KAAK,CAAC,IAAI,iBAAiB,EAAE,CAAC;YACnD,uCAAuC;YACvC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;QACnC,CAAC;QAED,iBAAiB,GAAG,IAAI,oCAAmB,CAAC;YACxC,MAAM,EAAE,cAAc,CAAC,SAAS,EAAE;YAClC,MAAM,EAAE,cAAc,CAAC,SAAS,EAAE;YAClC,IAAI,EAAE,OAAO;SAChB,CAAC,CAAA;IACN,CAAC;IAED,yDAAyD;IACzD,MAAM,eAAe,GAAG,4BAA4B,CAAC,aAAa,EAAE,iBAAiB,EAAE;QACnF,cAAc;QACd,iBAAiB;KACpB,CAAC,CAAA;IAEF,OAAO;QACH,KAAK,EAAE,eAAe;QACtB,YAAY,EAAE,IAAI;KACrB,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type Diagnostics, type Factory, type Record } from '@servicenow/sdk-build-core';
|
|
2
|
+
export declare const TRIGGER_INSTANCE_TABLE = "sys_hub_trigger_instance";
|
|
3
|
+
export declare const ACTION_INSTANCE_TABLE = "sys_hub_action_instance";
|
|
4
|
+
export declare const SUBFLOW_INSTANCE_TABLE = "sys_hub_sub_flow_instance";
|
|
5
|
+
export declare const SUBFLOW_INSTANCE_TABLE_V2 = "sys_hub_sub_flow_instance_v2";
|
|
6
|
+
export declare const FLOW_LOGIC_INSTANCE_TABLE = "sys_hub_flow_logic";
|
|
7
|
+
export declare const FLOW_STAGE_TABLE = "sys_hub_flow_stage";
|
|
8
|
+
export declare const PILL_COMPOUND_TABLE = "sys_hub_pill_compound";
|
|
9
|
+
export declare const CATALOG_ITEM_TABLE = "sc_cat_item";
|
|
10
|
+
export declare const CATALOG_VARIABLE_TABLE = "item_option_new";
|
|
11
|
+
export declare const CATALOG_VARIABLE_SET_TABLE = "io_set_item";
|
|
12
|
+
export declare const UNSUPPORTED_FLOW_DESCENDANTS: string[];
|
|
13
|
+
export declare const FLOW_API_NAME = "Flow";
|
|
14
|
+
export declare const SUBFLOW_API_NAME = "Subflow";
|
|
15
|
+
export declare const ACTION_DEFINITION_API_NAME = "ActionDefinition";
|
|
16
|
+
export declare const TRIGGER_DEFINITION_API_NAME = "TriggerDefinition";
|
|
17
|
+
export declare const TRIGGER_INSTANCE_API_NAME = "wfa.trigger";
|
|
18
|
+
export declare const ACTION_INSTANCE_API_NAME = "wfa.action";
|
|
19
|
+
export declare const SUBFLOW_INSTANCE_API_NAME = "wfa.subflow";
|
|
20
|
+
export declare const ACTION_STEP_INSTANCE_API_NAME = "wfa.action_step";
|
|
21
|
+
export declare const APPROVAL_RULES_API_NAME = "wfa.approvalRules";
|
|
22
|
+
export declare const APPROVAL_DUE_DATE_API_NAME = "wfa.approvalDueDate";
|
|
23
|
+
export declare const ELEMENT_MAPPING_PROVIDER = "com.glide.flow_design.action.data.FlowDesignVariableMapper";
|
|
24
|
+
export declare const TRIGGER_TYPE_KEY_NAME = "trigger_type";
|
|
25
|
+
export declare const ACTION_TYPE_KEY_NAME = "action_type";
|
|
26
|
+
export declare const APPROVAL_RULES_INTERNAL_TYPE = "approval_rules";
|
|
27
|
+
export declare const APPROVAL_ACTION_TYPE_APPROVE_VALUE = "Approves";
|
|
28
|
+
export declare const APPROVAL_ACTION_TYPES: string[];
|
|
29
|
+
export declare const STRING_API_NAME = "StringColumn";
|
|
30
|
+
export declare const STRING_FULL_UTF8_ATTRIBUTE_NAME = "isFullUTF8";
|
|
31
|
+
export declare const STRING_FULL_UTF8_DATA_TYPE_VALUE = "string_full_utf8";
|
|
32
|
+
export declare const TIME_DATA_TYPE_VALUE = "glide_time";
|
|
33
|
+
export declare const DURATION_DATA_TYPE_VALUE = "glide_duration";
|
|
34
|
+
export declare const TEMPLATE_DATA_TYPE_VALUE = "template_value";
|
|
35
|
+
export declare const APPROVAL_RULES_DATA_TYPE_VALUE = "approval_rules";
|
|
36
|
+
export declare const APPROVAL_DUE_DATE_DATA_TYPE_VALUE = "schedule_date_time";
|
|
37
|
+
export declare const UTC_TIMEZONE_VALUE = "UTC";
|
|
38
|
+
export declare const UNSUPPORTED_DATA_TYPES: string[];
|
|
39
|
+
export declare const ACTION_DEF_COLUMN_NAME = "action_type";
|
|
40
|
+
export declare const CORE_ACTIONS_PREFIX = "action.core";
|
|
41
|
+
export declare const RUN_ON_EXTENDED = "run_on_extended";
|
|
42
|
+
export declare const APPROVAL_DUE_DATE_INPUT_FIELD_ACTIONS: string[];
|
|
43
|
+
export declare const CORE_ACTIONS_SYS_ID_NAME_MAP: {
|
|
44
|
+
[sysId: string]: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const COLUMN_DEFAULTS: {
|
|
47
|
+
string: string;
|
|
48
|
+
boolean: boolean;
|
|
49
|
+
integer: number;
|
|
50
|
+
};
|
|
51
|
+
export declare enum ChoiceDropdown {
|
|
52
|
+
DROPDOWN_WITH_NONE = 1,
|
|
53
|
+
DROPDOWN_WITHOUT_NONE = 3
|
|
54
|
+
}
|
|
55
|
+
export declare function createActionErrorAndStatusRecords(source: Record, tableName: string, varTable: string, factory: Factory, diagnostics: Diagnostics): Promise<Record[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Converts arbitrary strings to snake_case slugs suitable for internal_name, etc.
|
|
58
|
+
* Handles:
|
|
59
|
+
* • Unicode accents (café → cafe)
|
|
60
|
+
* • Multiple / leading / trailing separators
|
|
61
|
+
* • Leading digits (prefixes with underscore)
|
|
62
|
+
* • Empty results (returns `fallback`)
|
|
63
|
+
*/
|
|
64
|
+
export interface SlugifyOptions {
|
|
65
|
+
prefixIfDigit?: string;
|
|
66
|
+
fallback?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function slugifyString(value: unknown, opts?: SlugifyOptions): string;
|
|
69
|
+
/**
|
|
70
|
+
* Core actions that require special catalog variable handling
|
|
71
|
+
*/
|
|
72
|
+
export declare const CATALOG_VARIABLE_ACTIONS: string[];
|