@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,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ForEachItemShape = exports.PillTemplateShape = exports.PillShape = void 0;
|
|
4
|
+
const sdk_build_core_1 = require("@servicenow/sdk-build-core");
|
|
5
|
+
class PillShape extends sdk_build_core_1.PropertyAccessShape {
|
|
6
|
+
uiId;
|
|
7
|
+
path;
|
|
8
|
+
type = undefined;
|
|
9
|
+
parentTableName = undefined;
|
|
10
|
+
columnName = undefined;
|
|
11
|
+
reference = undefined;
|
|
12
|
+
constructor({ source, uiId, path, type }) {
|
|
13
|
+
super({ source, elements: [uiId, path] });
|
|
14
|
+
this.uiId = uiId;
|
|
15
|
+
this.path = path;
|
|
16
|
+
this.type = type;
|
|
17
|
+
}
|
|
18
|
+
setType(type) {
|
|
19
|
+
this.type = type;
|
|
20
|
+
}
|
|
21
|
+
getType() {
|
|
22
|
+
return this.type;
|
|
23
|
+
}
|
|
24
|
+
setParentTableName(parentTableName) {
|
|
25
|
+
this.parentTableName = parentTableName;
|
|
26
|
+
}
|
|
27
|
+
getParentTableName() {
|
|
28
|
+
return this.parentTableName;
|
|
29
|
+
}
|
|
30
|
+
setColumnName(columnName) {
|
|
31
|
+
this.columnName = columnName;
|
|
32
|
+
}
|
|
33
|
+
getColumnName() {
|
|
34
|
+
return this.columnName;
|
|
35
|
+
}
|
|
36
|
+
setReference(reference) {
|
|
37
|
+
this.reference = reference;
|
|
38
|
+
}
|
|
39
|
+
getReference() {
|
|
40
|
+
return this.reference;
|
|
41
|
+
}
|
|
42
|
+
setRootIdentifier(arg0) {
|
|
43
|
+
this.uiId = arg0;
|
|
44
|
+
}
|
|
45
|
+
getRootIdentifier() {
|
|
46
|
+
return this.uiId;
|
|
47
|
+
}
|
|
48
|
+
getValue() {
|
|
49
|
+
// For schema references (empty path), don't include the dot
|
|
50
|
+
// e.g., {{flowVariables}} or {{outputs}}
|
|
51
|
+
// For property access, include the dot
|
|
52
|
+
// e.g., {{flow_variable.someVar}} or {{trigger.current.sys_id}}
|
|
53
|
+
const typePart = this.type !== undefined ? `|${this.type}` : '';
|
|
54
|
+
const metaPart = this.parentTableName || this.columnName || this.reference
|
|
55
|
+
? `|meta:${this.parentTableName || ''}:${this.columnName || ''}:${this.reference || ''}`
|
|
56
|
+
: '';
|
|
57
|
+
return this.path ? `{{${this.uiId}.${this.path}${typePart}${metaPart}}}` : `{{${this.uiId}}}`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.PillShape = PillShape;
|
|
61
|
+
class PillTemplateShape extends sdk_build_core_1.TemplateExpressionShape {
|
|
62
|
+
parts;
|
|
63
|
+
constructor({ source, parts }) {
|
|
64
|
+
super({ source, literalText: '', spans: [] });
|
|
65
|
+
this.parts = new sdk_build_core_1.ArrayShape({ source, elements: parts });
|
|
66
|
+
}
|
|
67
|
+
getParts() {
|
|
68
|
+
return this.parts;
|
|
69
|
+
}
|
|
70
|
+
getValue() {
|
|
71
|
+
const parts = this.parts.getElements(false);
|
|
72
|
+
let result = '';
|
|
73
|
+
for (const part of parts) {
|
|
74
|
+
const value = part.getValue();
|
|
75
|
+
if (typeof value === 'string') {
|
|
76
|
+
// For string literals, add them directly
|
|
77
|
+
result += value;
|
|
78
|
+
}
|
|
79
|
+
else if (value instanceof PillShape) {
|
|
80
|
+
result += value.getValue();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.PillTemplateShape = PillTemplateShape;
|
|
87
|
+
class ForEachItemShape extends sdk_build_core_1.IdentifierShape {
|
|
88
|
+
uiId;
|
|
89
|
+
path;
|
|
90
|
+
type = undefined;
|
|
91
|
+
parentTableName = undefined;
|
|
92
|
+
columnName = undefined;
|
|
93
|
+
reference = undefined;
|
|
94
|
+
constructor({ source, uiId, path }) {
|
|
95
|
+
super({ source, name: uiId });
|
|
96
|
+
this.uiId = uiId;
|
|
97
|
+
this.path = path;
|
|
98
|
+
}
|
|
99
|
+
setType(type) {
|
|
100
|
+
this.type = type;
|
|
101
|
+
}
|
|
102
|
+
getType() {
|
|
103
|
+
return this.type;
|
|
104
|
+
}
|
|
105
|
+
setParentTableName(parentTableName) {
|
|
106
|
+
this.parentTableName = parentTableName;
|
|
107
|
+
}
|
|
108
|
+
getParentTableName() {
|
|
109
|
+
return this.parentTableName;
|
|
110
|
+
}
|
|
111
|
+
setColumnName(columnName) {
|
|
112
|
+
this.columnName = columnName;
|
|
113
|
+
}
|
|
114
|
+
getColumnName() {
|
|
115
|
+
return this.columnName;
|
|
116
|
+
}
|
|
117
|
+
setReference(reference) {
|
|
118
|
+
this.reference = reference;
|
|
119
|
+
}
|
|
120
|
+
getReference() {
|
|
121
|
+
return this.reference;
|
|
122
|
+
}
|
|
123
|
+
getRootIdentifier() {
|
|
124
|
+
return this.uiId;
|
|
125
|
+
}
|
|
126
|
+
getValue() {
|
|
127
|
+
const typePart = this.type !== undefined ? `|${this.type}` : '';
|
|
128
|
+
const metaPart = this.parentTableName || this.columnName || this.reference
|
|
129
|
+
? `|meta:${this.parentTableName || ''}:${this.columnName || ''}:${this.reference || ''}`
|
|
130
|
+
: '';
|
|
131
|
+
return `{{${this.uiId}.${this.path}${typePart}${metaPart}}}`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.ForEachItemShape = ForEachItemShape;
|
|
135
|
+
//# sourceMappingURL=data-pill-shapes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-pill-shapes.js","sourceRoot":"","sources":["../../../src/flow/utils/data-pill-shapes.ts"],"names":[],"mappings":";;;AAAA,+DAMmC;AAEnC,MAAa,SAAU,SAAQ,oCAAmB;IACtC,IAAI,CAAQ;IACH,IAAI,CAAQ;IACrB,IAAI,GAAuB,SAAS,CAAA;IACpC,eAAe,GAAuB,SAAS,CAAA;IAC/C,UAAU,GAAuB,SAAS,CAAA;IAC1C,SAAS,GAAuB,SAAS,CAAA;IAEjD,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAiE;QACnG,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;IAED,OAAO,CAAC,IAAY;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAA;IACpB,CAAC;IAED,kBAAkB,CAAC,eAAuB;QACtC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;IAC1C,CAAC;IAED,kBAAkB;QACd,OAAO,IAAI,CAAC,eAAe,CAAA;IAC/B,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G,IAAI,CAAA;IACpB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAA;IACpB,CAAC;IAED,kBAAkB,CAAC,eAAuB;QACtC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;IAC1C,CAAC;IAED,kBAAkB;QACd,OAAO,IAAI,CAAC,eAAe,CAAA;IAC/B,CAAC;IAED,aAAa,CAAC,UAAkB;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAChC,CAAC;IAED,aAAa;QACT,OAAO,IAAI,CAAC,UAAU,CAAA;IAC1B,CAAC;IAED,YAAY,CAAC,SAAiB;QAC1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC9B,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAA;IACzB,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,IAAI,CAAA;IACpB,CAAC;IAEQ,QAAQ;QACb,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAC/D,MAAM,QAAQ,GACV,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS;YACrD,CAAC,CAAC,SAAS,IAAI,CAAC,eAAe,IAAI,EAAE,IAAI,IAAI,CAAC,UAAU,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,IAAI,EAAE,EAAE;YACxF,CAAC,CAAC,EAAE,CAAA;QACZ,OAAO,KAAK,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,GAAG,QAAQ,GAAG,QAAQ,IAAI,CAAA;IAChE,CAAC;CACJ;AA1DD,4CA0DC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { CallExpressionShape, type IdentifierShape, type Record, Shape, VariableStatementShape, ObjectShape, type Diagnostics, type Logger } from '@servicenow/sdk-build-core';
|
|
2
|
+
import { ArrowFunctionShape } from '../../arrow-function-plugin';
|
|
3
|
+
/**
|
|
4
|
+
* Result of datapill transformation
|
|
5
|
+
*/
|
|
6
|
+
export interface DatapillTransformResult {
|
|
7
|
+
shape: Shape;
|
|
8
|
+
propsChanged: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Information about a flow instance shape for processing
|
|
12
|
+
*/
|
|
13
|
+
export interface FlowInstanceShapeInfo {
|
|
14
|
+
callExpression: CallExpressionShape;
|
|
15
|
+
variableStatement: VariableStatementShape | CallExpressionShape;
|
|
16
|
+
}
|
|
17
|
+
export declare const uuidToRecordMap: Map<string, Record>;
|
|
18
|
+
/**
|
|
19
|
+
* Build a map of UUID to variable identifiers from instance records and shapes
|
|
20
|
+
* This map is used to transform UUID-based datapills into property access expressions
|
|
21
|
+
* Uses ui_id from records (not $id from config) because datapills reference ui_id
|
|
22
|
+
*
|
|
23
|
+
* @param recordToShapeMap - Map of instance records to their corresponding shapes
|
|
24
|
+
* @returns Map of UUID strings (ui_id) to IdentifierShapes
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildUuidToIdentifierMap(recordToShapeMap: Map<Record, Shape>): Map<string, IdentifierShape>;
|
|
27
|
+
/**
|
|
28
|
+
* Extract CallExpression and VariableStatement from an instance shape
|
|
29
|
+
* Handles both VariableStatementShape (for Action/Subflow) and bare CallExpressionShape (for flow logic)
|
|
30
|
+
*
|
|
31
|
+
* @param instanceShape - The shape to extract from
|
|
32
|
+
* @returns Object containing callExpression and variableStatement
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractInstanceShapeInfo(instanceShape: Shape): FlowInstanceShapeInfo;
|
|
35
|
+
/**
|
|
36
|
+
* Rebuild a CallExpressionShape with transformed properties
|
|
37
|
+
* Creates a new CallExpression with the transformed props and cleaned config
|
|
38
|
+
*
|
|
39
|
+
* @param originalCallExpression - The original CallExpression
|
|
40
|
+
* @param transformedProps - The transformed properties object
|
|
41
|
+
* @param configShape - The config shape (possibly cleaned)
|
|
42
|
+
* @param record - The source record for shape creation
|
|
43
|
+
* @returns New CallExpressionShape with transformed properties
|
|
44
|
+
*/
|
|
45
|
+
export declare function rebuildCallExpressionWithDatapills(originalCallExpression: CallExpressionShape, transformedProps: {
|
|
46
|
+
[key: string]: Shape;
|
|
47
|
+
}, configShape: Shape, record: Record): CallExpressionShape;
|
|
48
|
+
/**
|
|
49
|
+
* Rebuild an instance shape (VariableStatement or CallExpression) with transformed datapills
|
|
50
|
+
*
|
|
51
|
+
* @param instanceShape - The original instance shape
|
|
52
|
+
* @param newCallExpression - The new CallExpression with transformed properties
|
|
53
|
+
* @param instanceShapeInfo - Information extracted from the instance shape
|
|
54
|
+
* @returns Rebuilt VariableStatementShape or the new CallExpression
|
|
55
|
+
*/
|
|
56
|
+
export declare function rebuildInstanceWithDatapills(instanceShape: Shape, newCallExpression: CallExpressionShape, instanceShapeInfo: FlowInstanceShapeInfo): Shape;
|
|
57
|
+
/**
|
|
58
|
+
* Check if a callee string represents a flow logic call
|
|
59
|
+
* @param callee - The callee string (e.g., 'wfa.flowLogic.if', 'wfa.action')
|
|
60
|
+
* @returns true if the callee is a flow logic call
|
|
61
|
+
*/
|
|
62
|
+
export declare function isFlowLogicCallee(callee: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Check if a flow logic type has a body (arrow function)
|
|
65
|
+
* @param callee - The flow logic callee (e.g., 'wfa.flowLogic.if')
|
|
66
|
+
* @returns true if the flow logic has a body
|
|
67
|
+
*/
|
|
68
|
+
export declare function flowLogicHasBody(callee: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Extract arrow function bodies from a flow logic call expression
|
|
71
|
+
* Different flow logic types have bodies in different positions:
|
|
72
|
+
* - If/ElseIf/Else: Single body at argument 1
|
|
73
|
+
* - ForEach: Body at argument 2 (arg 0 is items, arg 1 is config)
|
|
74
|
+
* - TryCatch: Object with 'try' and 'catch' properties containing arrow functions
|
|
75
|
+
* - DoInParallel: Variadic functions starting from argument 1
|
|
76
|
+
*
|
|
77
|
+
* @param callExpression - The flow logic call expression
|
|
78
|
+
* @param callee - The flow logic callee
|
|
79
|
+
* @returns Array of arrow function shapes
|
|
80
|
+
*/
|
|
81
|
+
export declare function extractFlowLogicBodies(callExpression: CallExpressionShape, callee: string): ArrowFunctionShape[];
|
|
82
|
+
/**
|
|
83
|
+
* Rebuild a flow logic call expression with transformed config and bodies
|
|
84
|
+
* @param callExpression - Original call expression
|
|
85
|
+
* @param transformedConfig - Transformed config object
|
|
86
|
+
* @param transformedBodies - Transformed arrow function bodies
|
|
87
|
+
* @param callee - The flow logic callee
|
|
88
|
+
* @param record - The source record
|
|
89
|
+
* @returns Rebuilt CallExpressionShape
|
|
90
|
+
*/
|
|
91
|
+
export declare function rebuildFlowLogicWithDatapills(callExpression: CallExpressionShape, transformedConfig: ObjectShape, transformedBodies: ArrowFunctionShape[], callee: string, record: Record, transformedItemsArg?: Shape): CallExpressionShape;
|
|
92
|
+
/**
|
|
93
|
+
* Type for config cleanup callback function
|
|
94
|
+
* Used to clean up Action/Subflow configs after transformation
|
|
95
|
+
*/
|
|
96
|
+
export type ConfigCleanupCallback = (configShape: Shape, instanceSource: Shape) => Shape;
|
|
97
|
+
/**
|
|
98
|
+
* Recursively process an instance shape (Action, Subflow, or Flow Logic) to transform datapills
|
|
99
|
+
* This is the main entry point for datapill transformation that handles all instance types
|
|
100
|
+
*
|
|
101
|
+
* @param instanceShape - The instance shape to process (VariableStatementShape or CallExpressionShape)
|
|
102
|
+
* @param uuidToIdentifierMap - Map of UUID to variable identifiers for UUID-based datapills
|
|
103
|
+
* @param record - The source record for shape creation
|
|
104
|
+
* @param diagnostics - Diagnostics for error reporting
|
|
105
|
+
* @param paramName - Parameter name for semantic datapills (e.g., 'params')
|
|
106
|
+
* @param processShapeForDatapills - Recursive helper to process nested structures (objects/arrays)
|
|
107
|
+
* @param cleanupConfig - Optional callback to clean up Action/Subflow configs
|
|
108
|
+
* @returns DatapillTransformResult with transformed shape and change tracking
|
|
109
|
+
*/
|
|
110
|
+
export declare function processInstanceForDatapills(instanceShape: Shape, uuidToIdentifierMap: Map<string, IdentifierShape>, record: Record, diagnostics: Diagnostics, paramName: string, logger: Logger, processShapeForDatapills: (value: Shape, uuidToIdentifierMap: Map<string, IdentifierShape>, source: Record, diagnostics: Diagnostics, logger: Logger, parameterName?: string) => DatapillTransformResult, cleanupConfig?: ConfigCleanupCallback): DatapillTransformResult;
|