@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,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.complexObjectMatchesIoRecord = void 0;
|
|
4
|
+
exports.buildVariableRecords = buildVariableRecords;
|
|
5
|
+
exports.buildVariableShapes = buildVariableShapes;
|
|
6
|
+
exports.getColumnRecords = getColumnRecords;
|
|
7
|
+
const sdk_build_core_1 = require("@servicenow/sdk-build-core");
|
|
8
|
+
const column_helper_1 = require("../../column/column-helper");
|
|
9
|
+
const db_1 = require("@servicenow/sdk-core/runtime/db");
|
|
10
|
+
const built_in_complex_objects_1 = require("./built-in-complex-objects");
|
|
11
|
+
const schema_to_flow_object_1 = require("./schema-to-flow-object");
|
|
12
|
+
const complex_objects_1 = require("./complex-objects");
|
|
13
|
+
const column_to_record_1 = require("../../column/column-to-record");
|
|
14
|
+
const flow_constants_1 = require("./flow-constants");
|
|
15
|
+
const now_id_plugin_1 = require("../../now-id-plugin");
|
|
16
|
+
/**
|
|
17
|
+
* Helper function to extract user-defined attributes from a column config's attributes object.
|
|
18
|
+
* Handles string, number, and boolean values.
|
|
19
|
+
*
|
|
20
|
+
* @param config - The ObjectShape containing the column configuration
|
|
21
|
+
* @returns A Record of attribute key-value pairs (all values converted to strings)
|
|
22
|
+
*/
|
|
23
|
+
function extractUserAttributes(config) {
|
|
24
|
+
const userAttributes = {};
|
|
25
|
+
const userAttributesObj = config.get('attributes')?.ifObject()?.asObject();
|
|
26
|
+
if (userAttributesObj) {
|
|
27
|
+
const entries = userAttributesObj.entries();
|
|
28
|
+
for (const [key, value] of entries) {
|
|
29
|
+
userAttributes[key] = value.getValue()?.toString() ?? '';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return userAttributes;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Generate the variable records and possibly complex object records for the inputs or outputs
|
|
36
|
+
* of an action/subflow. The main input here is the ObjectShape for a single set of inputs or outputs
|
|
37
|
+
* of an action/subflow definition.
|
|
38
|
+
*/
|
|
39
|
+
async function buildVariableRecords(options) {
|
|
40
|
+
const { variablesConfig, parentRecord, factory, diagnostics, parentTable, varTable, isOutput = false } = options;
|
|
41
|
+
const records = [];
|
|
42
|
+
const complexObjects = [];
|
|
43
|
+
const tableName = `var__m_${varTable}_${parentRecord.getId().getValue()}`;
|
|
44
|
+
const entries = variablesConfig.entries();
|
|
45
|
+
for (const [i, [k, v]] of entries.entries()) {
|
|
46
|
+
const callExpr = v.as(sdk_build_core_1.CallExpressionShape);
|
|
47
|
+
const config = callExpr.getArgument(0).asObject();
|
|
48
|
+
const props = config.transform(({ $ }) => ({
|
|
49
|
+
element: $.val(k),
|
|
50
|
+
label: $.def(k),
|
|
51
|
+
mandatory: $.toBoolean().def(false),
|
|
52
|
+
active: $.val(true),
|
|
53
|
+
order: $.val(i + 1),
|
|
54
|
+
hint: $.def(''),
|
|
55
|
+
model: $.val(parentRecord),
|
|
56
|
+
model_id: $.val(parentRecord),
|
|
57
|
+
model_table: $.val(parentTable),
|
|
58
|
+
name: $.val(tableName),
|
|
59
|
+
default_value: $.from('default').def(''),
|
|
60
|
+
}));
|
|
61
|
+
const partialVarRecord = await factory.createRecord({
|
|
62
|
+
source: callExpr,
|
|
63
|
+
table: varTable,
|
|
64
|
+
properties: props,
|
|
65
|
+
});
|
|
66
|
+
const additionalProperties = {};
|
|
67
|
+
const varSysId = partialVarRecord.getId().getValue();
|
|
68
|
+
if (callExpr.getCallee() === 'FlowObject' || callExpr.getCallee() === 'FlowArray') {
|
|
69
|
+
// Create a new complex-object schema row
|
|
70
|
+
const co_type_name = config.get('co_type_name')?.ifString()?.getValue();
|
|
71
|
+
const complexObjectId = co_type_name || `FD${varSysId}`;
|
|
72
|
+
const isArray = callExpr.getCallee() === 'FlowArray';
|
|
73
|
+
const isFlowVariable = varTable === 'sys_hub_flow_variable';
|
|
74
|
+
const schemaObj = (0, complex_objects_1.generateSchemaFromObject)(config, complexObjectId, k, parentRecord.getId().getValue(), i, isArray, diagnostics, isFlowVariable);
|
|
75
|
+
// Use explicit $id from config if provided (for non-deterministic complex objects from UI)
|
|
76
|
+
const explicitId = config.get('$id')?.ifString()?.getValue();
|
|
77
|
+
const complexRecord = await factory.createRecord({
|
|
78
|
+
source: callExpr,
|
|
79
|
+
table: 'sys_complex_object',
|
|
80
|
+
properties: {
|
|
81
|
+
name: complexObjectId,
|
|
82
|
+
namespace: 'FlowDesigner',
|
|
83
|
+
type: callExpr.getCallee() === 'FlowArray' ? 'complex_object_collection' : 'complex_object_schema',
|
|
84
|
+
serialized_content: JSON.stringify(schemaObj),
|
|
85
|
+
...(explicitId ? { sys_id: explicitId } : {}),
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
const systemAttributes = (0, complex_objects_1.getComplexObjectAttributes)(schemaObj, complexObjectId, isArray);
|
|
89
|
+
// Extract user-defined attributes from column config if present (e.g., visible: 'false')
|
|
90
|
+
const userAttributes = extractUserAttributes(config);
|
|
91
|
+
// Merge system attributes with user-defined attributes
|
|
92
|
+
const allAttributes = { ...systemAttributes, ...userAttributes };
|
|
93
|
+
additionalProperties['attributes'] = (0, complex_objects_1.formatComplexObjectAttributes)(allAttributes);
|
|
94
|
+
additionalProperties['internal_type'] = 'string';
|
|
95
|
+
additionalProperties['max_length'] = 65000;
|
|
96
|
+
complexObjects.push(complexRecord);
|
|
97
|
+
// Create additional sys_variable_value record for FlowObject and FlowArray types, but only for outputs
|
|
98
|
+
if (isOutput) {
|
|
99
|
+
const variableValue = (0, complex_objects_1.generateVariableSchemaObject)(schemaObj, complexObjectId, isArray);
|
|
100
|
+
const variableValueRecord = await createVariableValueRecord({
|
|
101
|
+
callExpr,
|
|
102
|
+
factory,
|
|
103
|
+
varSysId,
|
|
104
|
+
parentRecord,
|
|
105
|
+
parentTable,
|
|
106
|
+
name: k,
|
|
107
|
+
index: i,
|
|
108
|
+
variableValue,
|
|
109
|
+
});
|
|
110
|
+
records.push(variableValueRecord);
|
|
111
|
+
}
|
|
112
|
+
const updatedCallExpr = (0, column_helper_1.addFieldsToColumn)({ name: k, table: tableName, display: false }, callExpr);
|
|
113
|
+
const columnRecords = await (0, column_to_record_1.getDocumentationRecords)(updatedCallExpr, {}, factory, diagnostics, true);
|
|
114
|
+
records.push(...columnRecords);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
// Extract attributes from column config if present
|
|
118
|
+
const userAttributes = extractUserAttributes(config);
|
|
119
|
+
const attributesStr = Object.entries(userAttributes)
|
|
120
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
121
|
+
.join(',');
|
|
122
|
+
additionalProperties['attributes'] = attributesStr;
|
|
123
|
+
let internal_type;
|
|
124
|
+
if (callExpr.getCallee() === db_1.GenericColumn.name) {
|
|
125
|
+
internal_type = config.get('columnType')?.ifString()?.getValue() ?? 'string';
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
internal_type = column_helper_1.COLUMN_API_TO_TYPE[callExpr.getCallee()] ?? 'string';
|
|
129
|
+
}
|
|
130
|
+
// Handle reference columns - extract reference table
|
|
131
|
+
if (internal_type === 'reference') {
|
|
132
|
+
const referenceTable = config.get('referenceTable')?.ifString()?.getValue();
|
|
133
|
+
if (referenceTable) {
|
|
134
|
+
additionalProperties['reference'] = referenceTable;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
additionalProperties['internal_type'] = internal_type;
|
|
138
|
+
additionalProperties['max_length'] =
|
|
139
|
+
config.get('maxLength')?.ifNumber()?.getValue() ?? (0, column_helper_1.getDefaultMaxLength)(internal_type);
|
|
140
|
+
const updatedCallExpr = (0, column_helper_1.addFieldsToColumn)({ name: k, table: tableName, display: false }, callExpr);
|
|
141
|
+
const columnRecords = await getColumnRecords(updatedCallExpr, factory, diagnostics);
|
|
142
|
+
records.push(...columnRecords);
|
|
143
|
+
if (internal_type === 'choice') {
|
|
144
|
+
validateAndPopulateChoiceProperties(config, additionalProperties, diagnostics);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const varRecord = partialVarRecord.merge(additionalProperties);
|
|
148
|
+
records.push(varRecord);
|
|
149
|
+
}
|
|
150
|
+
if (isOutput) {
|
|
151
|
+
const additionalOutputs = await (0, flow_constants_1.createActionErrorAndStatusRecords)(parentRecord, tableName, varTable, factory, diagnostics);
|
|
152
|
+
records.push(...additionalOutputs);
|
|
153
|
+
}
|
|
154
|
+
return { variableRecords: records, complexObjectRecords: complexObjects };
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Generate an object corresponding to the variable records passed in.
|
|
158
|
+
*
|
|
159
|
+
* For each variable record passed in there will be a key/value in the return value where
|
|
160
|
+
* the key is the element name of the variable record and the value is a call expression corresponding
|
|
161
|
+
* to the details of that variable record. The call expressions match the FlowValueType and can be
|
|
162
|
+
* a Column or a FlowObject (FlowArrays are currently not yet handled)
|
|
163
|
+
*
|
|
164
|
+
* If the variable record has a co_object_name attribute we will lookup a corresponding sys_complex_object
|
|
165
|
+
* record where the name field matches the attributes value. That complex object record will hold the schema
|
|
166
|
+
* for this object input in the serialized_content column. We use that data to construct the related call expression
|
|
167
|
+
* data for the full flow object definition
|
|
168
|
+
*
|
|
169
|
+
* @param variableRecords Records representing inputs or outputs (sys_hub_*_input / output)
|
|
170
|
+
* @param ctx Plugin context object supplied by build-core plugin
|
|
171
|
+
*/
|
|
172
|
+
function buildVariableShapes(variableRecords, descendants, logger) {
|
|
173
|
+
const shapes = {};
|
|
174
|
+
for (const variable of variableRecords) {
|
|
175
|
+
const name = variable.get('element').asString().getValue();
|
|
176
|
+
if (name === '__action_status__' || name === '__dont_treat_as_error__') {
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
const callExpressionName = column_helper_1.COLUMN_TYPE_TO_API[variable.get('internal_type').asString().getValue()] ?? db_1.GenericColumn.name;
|
|
180
|
+
const additionalProps = {};
|
|
181
|
+
// Detect FlowObject variables by looking for a co_type_name attribute.
|
|
182
|
+
const attributesStr = variable.get('attributes')?.ifString()?.getValue() ?? '';
|
|
183
|
+
const attributes = (0, schema_to_flow_object_1.parseAttributesToObject)(attributesStr);
|
|
184
|
+
if (attributes.dynamic === 'true') {
|
|
185
|
+
logger?.warn(`Unsupported data type found for input = ${name}, falling back to Record() api`);
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
188
|
+
const maybeCoTypeName = attributes.co_type_name;
|
|
189
|
+
if (maybeCoTypeName !== undefined) {
|
|
190
|
+
const coRecord = descendants.query('sys_complex_object', { name: maybeCoTypeName });
|
|
191
|
+
// First try descendants, then fallback to built-in complex objects
|
|
192
|
+
let serializedContent = coRecord[0]?.get('serialized_content')?.ifString()?.getValue();
|
|
193
|
+
let complexObjectSysId = coRecord[0]?.getId().getValue();
|
|
194
|
+
if (!serializedContent) {
|
|
195
|
+
// Check built-in complex objects
|
|
196
|
+
const builtIn = built_in_complex_objects_1.builtInComplexObjects[maybeCoTypeName];
|
|
197
|
+
serializedContent = builtIn?.data.serialized_content;
|
|
198
|
+
complexObjectSysId = undefined; // Built-in objects don't have a sys_id
|
|
199
|
+
}
|
|
200
|
+
if (!serializedContent) {
|
|
201
|
+
throw new Error(`unable to find sys_complex_object with co_type_name: ${maybeCoTypeName}`);
|
|
202
|
+
}
|
|
203
|
+
// Check if co_type_name is deterministically generated (pattern: FD<variable_sys_id>)
|
|
204
|
+
const varSysId = variable.getId().getValue();
|
|
205
|
+
const isDeterministic = maybeCoTypeName === `FD${varSysId}`;
|
|
206
|
+
// Only include $id and co_type_name if NOT deterministically generated
|
|
207
|
+
const schema = JSON.parse(serializedContent);
|
|
208
|
+
shapes[name] = (0, schema_to_flow_object_1.buildComplexObjectFromSchema)(variable, schema, attributes, isDeterministic ? undefined : complexObjectSysId, isDeterministic ? undefined : maybeCoTypeName);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
const variableName = variable.get('name').ifString()?.getValue();
|
|
212
|
+
const documentation = variableName
|
|
213
|
+
? descendants.query('sys_documentation', { name: variableName, element: name })
|
|
214
|
+
: [];
|
|
215
|
+
shapes[name] = buildBasicVariableShape(callExpressionName, variable, additionalProps, descendants, documentation);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return shapes;
|
|
219
|
+
}
|
|
220
|
+
function buildBasicVariableShape(callExpressionName, variable, additionalProps, descendants, documentation) {
|
|
221
|
+
if (callExpressionName === db_1.ChoiceColumn.name) {
|
|
222
|
+
// choice column with choices from other table
|
|
223
|
+
const choiceTable = variable.get('choice_table').ifString()?.getValue();
|
|
224
|
+
if (choiceTable && choiceTable !== '') {
|
|
225
|
+
additionalProps = {
|
|
226
|
+
dynamicValueDefinitions: {
|
|
227
|
+
type: 'choices_from_other_table',
|
|
228
|
+
table: choiceTable,
|
|
229
|
+
field: variable.get('choice_field').asString().getValue(),
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
const name = variable.get('name').ifString()?.getValue();
|
|
235
|
+
const element = variable.get('element').ifString()?.getValue();
|
|
236
|
+
const choices = descendants.query('sys_choice', { name, element });
|
|
237
|
+
additionalProps = {
|
|
238
|
+
choices: choices.reduce((acc, choice) => {
|
|
239
|
+
const value = choice.get('value').ifString()?.getValue();
|
|
240
|
+
const sequence = Number(choice.get('sequence').ifString()?.getValue() ?? 0);
|
|
241
|
+
if (!value || value === '-- None --') {
|
|
242
|
+
return acc;
|
|
243
|
+
}
|
|
244
|
+
const entry = {
|
|
245
|
+
label: choice.get('label').ifString()?.getValue(),
|
|
246
|
+
};
|
|
247
|
+
if (sequence !== 0) {
|
|
248
|
+
entry.sequence = sequence;
|
|
249
|
+
}
|
|
250
|
+
acc[value] = entry;
|
|
251
|
+
return acc;
|
|
252
|
+
}, {}),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const fieldType = variable.get('internal_type').ifString()?.getValue() ?? 'string';
|
|
257
|
+
const defaultMaxLength = (0, column_helper_1.getDefaultMaxLength)(fieldType);
|
|
258
|
+
const maxLength = Number(variable.get('max_length').ifString()?.getValue() ?? defaultMaxLength);
|
|
259
|
+
const hint = documentation[0]?.get('hint')?.ifString()?.getValue() ?? '';
|
|
260
|
+
// Extract referenceTable for reference and records column types
|
|
261
|
+
const referenceTable = variable.get('reference')?.ifString()?.getValue();
|
|
262
|
+
if (referenceTable && (fieldType === 'reference' || fieldType === 'records')) {
|
|
263
|
+
additionalProps['referenceTable'] = referenceTable;
|
|
264
|
+
}
|
|
265
|
+
// Add dependent field for template_value and field_list column types
|
|
266
|
+
if (fieldType === 'template_value' || fieldType === 'field_list') {
|
|
267
|
+
const dependent = variable.get('dependent')?.ifString()?.getValue();
|
|
268
|
+
additionalProps['dependent'] = dependent ?? '';
|
|
269
|
+
}
|
|
270
|
+
return new sdk_build_core_1.CallExpressionShape({
|
|
271
|
+
source: variable,
|
|
272
|
+
callee: callExpressionName,
|
|
273
|
+
args: [
|
|
274
|
+
variable
|
|
275
|
+
.transform(({ $ }) => ({
|
|
276
|
+
label: $,
|
|
277
|
+
...(variable.getTable() === 'sys_flow_step_definition_output' ||
|
|
278
|
+
variable.getTable() === 'sys_flow_step_definition_input'
|
|
279
|
+
? { sysId: $.val(now_id_plugin_1.NowIdShape.from(variable)) }
|
|
280
|
+
: {}),
|
|
281
|
+
mandatory: $.toBoolean().def(false),
|
|
282
|
+
maxLength: $.val(maxLength).def(defaultMaxLength),
|
|
283
|
+
dropdown: $.from('choice')
|
|
284
|
+
.map((choice) => (choice.isNumber() ? db_1.choiceDropdown[choice.getValue()] : undefined))
|
|
285
|
+
.def(db_1.choiceDropdown[1]),
|
|
286
|
+
default: $.from('default_value')
|
|
287
|
+
.map((value) => {
|
|
288
|
+
if (!value.isDefined()) {
|
|
289
|
+
return undefined;
|
|
290
|
+
}
|
|
291
|
+
if (fieldType === 'string') {
|
|
292
|
+
return value.toString().getValue();
|
|
293
|
+
}
|
|
294
|
+
if (fieldType === 'boolean') {
|
|
295
|
+
return Boolean(value.getValue());
|
|
296
|
+
}
|
|
297
|
+
if (fieldType === 'integer') {
|
|
298
|
+
return Number(value.getValue());
|
|
299
|
+
}
|
|
300
|
+
return value.getValue();
|
|
301
|
+
})
|
|
302
|
+
.def(flow_constants_1.COLUMN_DEFAULTS[fieldType] ?? ''),
|
|
303
|
+
...(hint ? { hint: $.val(hint) } : {}),
|
|
304
|
+
columnType: $.from('internal_type')
|
|
305
|
+
.map((fieldType) => {
|
|
306
|
+
if (callExpressionName === db_1.GenericColumn.name) {
|
|
307
|
+
return fieldType;
|
|
308
|
+
}
|
|
309
|
+
return undefined;
|
|
310
|
+
})
|
|
311
|
+
.def(undefined),
|
|
312
|
+
}))
|
|
313
|
+
.merge(additionalProps),
|
|
314
|
+
],
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Creates a sys_variable_value record for FlowObject and FlowArray types
|
|
319
|
+
*/
|
|
320
|
+
async function createVariableValueRecord(options) {
|
|
321
|
+
const { callExpr, factory, varSysId, parentRecord, parentTable, name, index, variableValue } = options;
|
|
322
|
+
return await factory.createRecord({
|
|
323
|
+
source: callExpr,
|
|
324
|
+
table: 'sys_variable_value',
|
|
325
|
+
properties: {
|
|
326
|
+
document: parentTable,
|
|
327
|
+
document_key: parentRecord.getId().getValue(),
|
|
328
|
+
value: JSON.stringify(variableValue),
|
|
329
|
+
order: index + 1,
|
|
330
|
+
name,
|
|
331
|
+
variable: varSysId,
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
async function getColumnRecords(callExpression, factory, diagnostics) {
|
|
336
|
+
// Verify
|
|
337
|
+
const callee = callExpression.getCallee();
|
|
338
|
+
if (!(callee in column_helper_1.COLUMN_API_TO_TYPE) && !(callee === db_1.GenericColumn.name)) {
|
|
339
|
+
return [];
|
|
340
|
+
}
|
|
341
|
+
const column = callExpression.getArgument(0).asObject();
|
|
342
|
+
if (!column.has('table') || !column.has('name')) {
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
345
|
+
const choiceRecords = await (0, column_to_record_1.getChoiceRecords)(callExpression, {}, factory, diagnostics);
|
|
346
|
+
const documentationRecords = await (0, column_to_record_1.getDocumentationRecords)(callExpression, {}, factory, diagnostics, true);
|
|
347
|
+
return [...choiceRecords, ...documentationRecords];
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Validates and populates choice properties for dynamic value definitions
|
|
351
|
+
* that use choices from other tables
|
|
352
|
+
*/
|
|
353
|
+
function validateAndPopulateChoiceProperties(config, additionalProperties, diagnostics) {
|
|
354
|
+
// Check if dynamic value definitions exist
|
|
355
|
+
const dynamicValueDefs = config.has('dynamicValueDefinitions')
|
|
356
|
+
? config.get('dynamicValueDefinitions').asObject()
|
|
357
|
+
: undefined;
|
|
358
|
+
if (dynamicValueDefs) {
|
|
359
|
+
// Validate type is 'choices_from_other_table'
|
|
360
|
+
const type = dynamicValueDefs.get('type');
|
|
361
|
+
if (!type.isString() || type.getValue() !== 'choices_from_other_table') {
|
|
362
|
+
diagnostics.error(type, 'Invalid dynamicValueDefinitions type, expected "choices_from_other_table"');
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
// Populate required choice properties
|
|
366
|
+
additionalProperties['choice_table'] = dynamicValueDefs.get('table').getValue();
|
|
367
|
+
additionalProperties['choice_field'] = dynamicValueDefs.get('field').getValue();
|
|
368
|
+
}
|
|
369
|
+
// Default to dropdown_with_none
|
|
370
|
+
let choiceValue = flow_constants_1.ChoiceDropdown.DROPDOWN_WITHOUT_NONE;
|
|
371
|
+
// Handle dropdown type configuration
|
|
372
|
+
const defaultValue = config.get('default');
|
|
373
|
+
const choiceTypeNode = config.get('dropdown');
|
|
374
|
+
if (choiceTypeNode.isString()) {
|
|
375
|
+
const choiceTypeValue = choiceTypeNode.getValue();
|
|
376
|
+
const choiceDropdownValue = db_1.choiceDropdown.indexOf(choiceTypeValue);
|
|
377
|
+
if (choiceDropdownValue === flow_constants_1.ChoiceDropdown.DROPDOWN_WITHOUT_NONE) {
|
|
378
|
+
// Validate default value exists for dropdown_without_none
|
|
379
|
+
if (defaultValue.isUndefined()) {
|
|
380
|
+
diagnostics.error(config, 'Default value is required for dropdown type "dropdown_without_none"');
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
choiceValue = flow_constants_1.ChoiceDropdown.DROPDOWN_WITHOUT_NONE;
|
|
384
|
+
}
|
|
385
|
+
else if (choiceDropdownValue !== flow_constants_1.ChoiceDropdown.DROPDOWN_WITH_NONE) {
|
|
386
|
+
// Only dropdown_with_none and dropdown_without_none are valid
|
|
387
|
+
diagnostics.error(choiceTypeNode, 'Invalid dropdown type, expected "dropdown_with_none" or "dropdown_without_none"');
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
choiceValue = choiceDropdownValue;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// Set the choice value
|
|
395
|
+
additionalProperties['choice'] = choiceValue;
|
|
396
|
+
// Add default value if provided
|
|
397
|
+
if (!defaultValue.isUndefined()) {
|
|
398
|
+
additionalProperties['default_value'] = defaultValue.getValue();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Via regex matcher for sys_complex_object relationships that checks if the parent's
|
|
403
|
+
* co_type_name attribute matches the child's name field.
|
|
404
|
+
*/
|
|
405
|
+
exports.complexObjectMatchesIoRecord = {
|
|
406
|
+
parent: ['attributes', 'co_type_name=([^,]+)'],
|
|
407
|
+
child: ['name', '(.+)'],
|
|
408
|
+
};
|
|
409
|
+
//# sourceMappingURL=flow-io-to-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-io-to-record.js","sourceRoot":"","sources":["../../../src/flow/utils/flow-io-to-record.ts"],"names":[],"mappings":";;;AAuDA,oDAqJC;AAkBD,kDA2EC;AA6ID,4CAmBC;AAzcD,+DAQmC;AACnC,8DAKmC;AACnC,wDAAsH;AACtH,yEAAkE;AAClE,mEAA+F;AAC/F,uDAK0B;AAC1B,oEAAyF;AAEzF,qDAAqG;AACrG,uDAAgD;AAEhD;;;;;;GAMG;AACH,SAAS,qBAAqB,CAAC,MAAmB;IAC9C,MAAM,cAAc,GAAsC,EAAE,CAAA;IAC5D,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAA;IAE1E,IAAI,iBAAiB,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,CAAA;QAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;YACjC,cAAc,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;QAC5D,CAAC;IACL,CAAC;IAED,OAAO,cAAc,CAAA;AACzB,CAAC;AAED;;;;GA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mBAAc,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QAEnE,IAAI,mBAAmB,KAAK,+BAAc,CAAC,qBAAqB,EAAE,CAAC;YAC/D,0DAA0D;YAC1D,IAAI,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC7B,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,qEAAqE,CAAC,CAAA;gBAChG,OAAM;YACV,CAAC;YACD,WAAW,GAAG,+BAAc,CAAC,qBAAqB,CAAA;QACtD,CAAC;aAAM,IAAI,mBAAmB,KAAK,+BAAc,CAAC,kBAAkB,EAAE,CAAC;YACnE,8DAA8D;YAC9D,WAAW,CAAC,KAAK,CACb,cAAc,EACd,iFAAiF,CACpF,CAAA;YACD,OAAM;QACV,CAAC;aAAM,CAAC;YACJ,WAAW,GAAG,mBAAmB,CAAA;QACrC,CAAC;IACL,CAAC;IAED,uBAAuB;IACvB,oBAAoB,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAA;IAE5C,gCAAgC;IAChC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC;QAC9B,oBAAoB,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAA;IACnE,CAAC;AACL,CAAC;AAED;;;GAGG;AACU,QAAA,4BAA4B,GAA0D;IAC/F,MAAM,EAAE,CAAC,YAAY,EAAE,sBAAsB,CAAC;IAC9C,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;CAC1B,CAAA"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { CallExpressionShape, type Source, ObjectShape, Record, StringShape, TemplateExpressionShape } from '@servicenow/sdk-build-core';
|
|
2
|
+
import { NowIdShape } from '../../now-id-plugin';
|
|
3
|
+
import type { ApprovalRulesType, ApprovalDueDateType } from '@servicenow/sdk-core/runtime/flow';
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base class for all flow definition instances.
|
|
6
|
+
* Extends CallExpressionShape to provide common functionality for flow constructs.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class FDInstanceShape extends CallExpressionShape {
|
|
9
|
+
constructor(source: Source, callee: string, args: unknown[]);
|
|
10
|
+
getInstanceType(): string;
|
|
11
|
+
abstract getSysId(): NowIdShape | undefined;
|
|
12
|
+
abstract getAnnotation(): StringShape | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Shape class for Action and Subflow instances.
|
|
16
|
+
* Handles the pattern: Action(definition, config, props)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* Action(createIncident, { $id: Now.ID['incident_0'], annotation: 'Create incident' }, { shortDescription: 'Issue' })
|
|
20
|
+
* Subflow(mySubflow, { $id: Now.ID['subflow_0'], annotation: 'Process data' }, { input: 'value' })
|
|
21
|
+
*/
|
|
22
|
+
export declare class ActionSubflowInstanceShape extends FDInstanceShape {
|
|
23
|
+
constructor({ source, instanceDefinition, instanceProps, instanceType, configObject, }: {
|
|
24
|
+
source: Source;
|
|
25
|
+
instanceDefinition: Record | StringShape | undefined;
|
|
26
|
+
instanceProps: ObjectShape | undefined;
|
|
27
|
+
instanceType: string;
|
|
28
|
+
configObject: ObjectShape;
|
|
29
|
+
});
|
|
30
|
+
getInstanceDefinition(): Record | StringShape | undefined;
|
|
31
|
+
getInstanceProps(): ObjectShape | undefined;
|
|
32
|
+
getSysId(): NowIdShape | undefined;
|
|
33
|
+
getAnnotation(): StringShape | undefined;
|
|
34
|
+
getInstanceUUID(): StringShape | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Represents an inline script for ServiceNow Flow Designer actions and subflows.
|
|
38
|
+
*
|
|
39
|
+
* Inline scripts allow users to write JavaScript code directly in Flow action/subflow inputs
|
|
40
|
+
* without creating separate Script Includes or Business Rules. This shape wraps the script
|
|
41
|
+
* content and provides serialization to Flow Designer's JSON format.
|
|
42
|
+
*
|
|
43
|
+
* **Supported Formats:**
|
|
44
|
+
* - Template literals without substitutions: \`code\`
|
|
45
|
+
* - External files via Now.include: Now.include('./script.js')
|
|
46
|
+
*
|
|
47
|
+
* **Usage Example:**
|
|
48
|
+
* ```typescript
|
|
49
|
+
* Action(myAction, Now.ID['action_id'], {
|
|
50
|
+
* workNotes: `
|
|
51
|
+
* var number = fd_data.trigger.current.number;
|
|
52
|
+
* return 'Incident ' + number + ' created';
|
|
53
|
+
* `
|
|
54
|
+
* })
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* **Architecture:**
|
|
58
|
+
* This shape is NOT created via a global plugin. Instead, detection happens contextually
|
|
59
|
+
* in FlowInstancePlugin.checkAndResolveInlineScripts() to ensure only template literals
|
|
60
|
+
* used as Action/Subflow inputs are converted to inline scripts. This prevents incorrectly
|
|
61
|
+
* converting template literals used elsewhere (logging, formatting, etc.).
|
|
62
|
+
*
|
|
63
|
+
* @extends TemplateExpressionShape
|
|
64
|
+
*/
|
|
65
|
+
export declare class InlineScriptShape extends TemplateExpressionShape {
|
|
66
|
+
private readonly scriptContent;
|
|
67
|
+
/**
|
|
68
|
+
* Creates an InlineScriptShape instance.
|
|
69
|
+
*
|
|
70
|
+
* @param source - The original TemplateExpressionShape from the AST
|
|
71
|
+
* @param scriptContent - The JavaScript code to execute (without backticks)
|
|
72
|
+
*/
|
|
73
|
+
constructor({ source, scriptContent }: {
|
|
74
|
+
source: TemplateExpressionShape;
|
|
75
|
+
scriptContent: string;
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Returns the raw script content without template literal backticks.
|
|
79
|
+
*
|
|
80
|
+
* @returns The JavaScript code as a string
|
|
81
|
+
*/
|
|
82
|
+
getScriptContent(): string;
|
|
83
|
+
/**
|
|
84
|
+
* Serializes this inline script to ServiceNow Flow Designer JSON format.
|
|
85
|
+
*
|
|
86
|
+
* The output structure includes:
|
|
87
|
+
* - `scriptActive: true` - Indicates this field contains a script
|
|
88
|
+
* - `script` object - Contains the actual script content keyed by field name
|
|
89
|
+
* - Empty `value` and `displayValue` - Required by Flow Designer schema
|
|
90
|
+
*
|
|
91
|
+
* @param fieldName - The name of the action/subflow input field
|
|
92
|
+
* @returns Flow Designer JSON structure for inline scripts
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* inlineScript.toFlowDesignerJson('workNotes')
|
|
97
|
+
* // Returns:
|
|
98
|
+
* // {
|
|
99
|
+
* // name: 'workNotes',
|
|
100
|
+
* // scriptActive: true,
|
|
101
|
+
* // script: { workNotes: { scriptActive: true, script: '...' } },
|
|
102
|
+
* // value: '', displayValue: '', children: []
|
|
103
|
+
* // }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
toFlowDesignerJson(fieldName: string): {
|
|
107
|
+
name: string;
|
|
108
|
+
value: string;
|
|
109
|
+
displayValue: string;
|
|
110
|
+
children: never[];
|
|
111
|
+
scriptActive: boolean;
|
|
112
|
+
script: {
|
|
113
|
+
[x: string]: {
|
|
114
|
+
scriptActive: boolean;
|
|
115
|
+
script: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Shape representing ApprovalRules
|
|
122
|
+
* Used with ApprovalRules() helper - Stores approval rules for Flow Designer
|
|
123
|
+
*/
|
|
124
|
+
export declare class ApprovalRulesShape extends ObjectShape {
|
|
125
|
+
constructor({ source, value }: {
|
|
126
|
+
source: Source;
|
|
127
|
+
value: globalThis.Record<string, unknown>;
|
|
128
|
+
});
|
|
129
|
+
getApprovalRules(): ApprovalRulesType;
|
|
130
|
+
/**
|
|
131
|
+
* Returns code representation as ApprovalRules() helper call.
|
|
132
|
+
* @example 'wfa.approvalRules({"conditionType":"OR","ruleSets":[{"action":"Approves","conditionType":"AND","rules":[[{"rule_type":"Any","users":["_params.trigger.current.assigned_to"],"groups":[],"manual":false}]]},{"action":"Rejects","conditionType":"AND","rules":[[{"rule_type":"Any","users":[],"groups":[],"manual":true}]]}]})'
|
|
133
|
+
*/
|
|
134
|
+
getCode(): string;
|
|
135
|
+
/**
|
|
136
|
+
* Returns a StringShape of the Approval Rules JSON
|
|
137
|
+
*/
|
|
138
|
+
toString(): StringShape;
|
|
139
|
+
static from(source: Source, text: StringShape): ApprovalRulesShape;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Shape representing ApprovalDueDate
|
|
143
|
+
* Used with ApprovalDueDate() helper - Stores approval due date configuration for Flow Designer
|
|
144
|
+
*/
|
|
145
|
+
export declare class ApprovalDueDateShape extends ObjectShape {
|
|
146
|
+
constructor({ source, value }: {
|
|
147
|
+
source: Source;
|
|
148
|
+
value: globalThis.Record<string, unknown>;
|
|
149
|
+
});
|
|
150
|
+
getApprovalDueDate(): ApprovalDueDateType;
|
|
151
|
+
/**
|
|
152
|
+
* Returns code representation as ApprovalDueDate() helper call.
|
|
153
|
+
* @example 'wfa.approvalDueDate({"action":"none","date_type":"actual","date":"{}","duration":1,"duration_type":"days","schedule":""})'
|
|
154
|
+
*/
|
|
155
|
+
getCode(): string;
|
|
156
|
+
/**
|
|
157
|
+
* Returns a StringShape of the Approval Due Date string
|
|
158
|
+
*/
|
|
159
|
+
toString(): StringShape;
|
|
160
|
+
static from(source: Source, text: StringShape): ApprovalDueDateShape;
|
|
161
|
+
}
|