@servicenow/sdk-build-plugins 4.1.1 → 4.3.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 +22 -4
- 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/application-menu-plugin.js +1 -0
- package/dist/application-menu-plugin.js.map +1 -1
- package/dist/atf/step-configs.d.ts +13 -12
- package/dist/atf/step-configs.js.map +1 -1
- package/dist/atf/test-plugin.d.ts +1 -1
- package/dist/atf/test-plugin.js +13 -7
- package/dist/atf/test-plugin.js.map +1 -1
- package/dist/basic-syntax-plugin.js +58 -14
- 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/claims-plugin.js +1 -1
- package/dist/claims-plugin.js.map +1 -1
- package/dist/client-script-plugin.js +5 -17
- package/dist/client-script-plugin.js.map +1 -1
- package/dist/column/column-helper.d.ts +1 -1
- package/dist/column/column-helper.js +46 -2
- package/dist/column/column-helper.js.map +1 -1
- package/dist/column/column-to-record.js +6 -4
- package/dist/column/column-to-record.js.map +1 -1
- package/dist/column-plugin.js +107 -28
- 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 +6 -0
- package/dist/data-plugin.js +156 -0
- package/dist/data-plugin.js.map +1 -0
- 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 +930 -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 +324 -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 +65 -0
- package/dist/flow/utils/flow-constants.js +223 -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/utils.d.ts +117 -0
- package/dist/flow/utils/utils.js +345 -0
- package/dist/flow/utils/utils.js.map +1 -0
- package/dist/import-sets-plugin.d.ts +2 -0
- package/dist/import-sets-plugin.js +412 -0
- package/dist/import-sets-plugin.js.map +1 -0
- package/dist/index.d.ts +24 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/json-plugin.d.ts +4 -4
- package/dist/json-plugin.js +21 -7
- package/dist/json-plugin.js.map +1 -1
- package/dist/list-plugin.js +83 -1
- package/dist/list-plugin.js.map +1 -1
- package/dist/now-attach-plugin.d.ts +36 -0
- package/dist/now-attach-plugin.js +320 -0
- package/dist/now-attach-plugin.js.map +1 -0
- package/dist/now-config-plugin.js +3 -0
- package/dist/now-config-plugin.js.map +1 -1
- package/dist/now-include-plugin.js +7 -1
- package/dist/now-include-plugin.js.map +1 -1
- package/dist/package-json-plugin.js +2 -2
- package/dist/package-json-plugin.js.map +1 -1
- package/dist/record-plugin.d.ts +35 -0
- package/dist/record-plugin.js +109 -23
- 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/repack/lint/Rules.js.map +1 -1
- package/dist/rest-api-plugin.js +81 -74
- package/dist/rest-api-plugin.js.map +1 -1
- package/dist/role-plugin.js +1 -0
- package/dist/role-plugin.js.map +1 -1
- package/dist/server-module-plugin/index.js +53 -6
- 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 +139 -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 +169 -0
- package/dist/service-catalog/service-catalog-diagnostics.js.map +1 -0
- package/dist/service-catalog/shape-to-record.d.ts +7 -0
- package/dist/service-catalog/shape-to-record.js +232 -0
- package/dist/service-catalog/shape-to-record.js.map +1 -0
- package/dist/service-catalog/utils.d.ts +313 -0
- package/dist/service-catalog/utils.js +1144 -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/service-portal/widget-plugin.js +4 -1
- package/dist/service-portal/widget-plugin.js.map +1 -1
- 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.d.ts +1 -0
- package/dist/static-content-plugin.js +4 -3
- package/dist/static-content-plugin.js.map +1 -1
- package/dist/table-plugin.js +49 -4
- package/dist/table-plugin.js.map +1 -1
- package/dist/ui-page-plugin.js +2 -1
- package/dist/ui-page-plugin.js.map +1 -1
- package/dist/ui-policy-plugin.d.ts +2 -0
- package/dist/ui-policy-plugin.js +405 -0
- package/dist/ui-policy-plugin.js.map +1 -0
- package/dist/utils.d.ts +19 -1
- package/dist/utils.js +40 -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/view-plugin.js +1 -1
- package/dist/view-plugin.js.map +1 -1
- 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/_types/eslint-plugin-es-x.d.ts +17 -0
- package/src/_types/md5.js.d.ts +8 -0
- package/src/acl-plugin.ts +33 -10
- package/src/applicability-plugin.ts +82 -0
- package/src/application-menu-plugin.ts +1 -0
- package/src/atf/step-configs.ts +14 -12
- package/src/atf/test-plugin.ts +46 -24
- package/src/basic-syntax-plugin.ts +71 -14
- package/src/business-rule-plugin.ts +9 -5
- package/src/call-expression-plugin.ts +2 -130
- package/src/claims-plugin.ts +1 -1
- package/src/client-script-plugin.ts +8 -22
- package/src/column/column-helper.ts +65 -3
- package/src/column/column-to-record.ts +6 -4
- package/src/column-plugin.ts +142 -40
- 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 +194 -0
- 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 +1148 -0
- package/src/flow/plugins/flow-trigger-instance-plugin.ts +426 -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 +276 -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/utils.ts +395 -0
- package/src/import-sets-plugin.ts +542 -0
- package/src/index.ts +25 -1
- package/src/json-plugin.ts +31 -12
- package/src/list-plugin.ts +91 -1
- package/src/now-attach-plugin.ts +403 -0
- package/src/now-config-plugin.ts +6 -2
- package/src/now-include-plugin.ts +8 -1
- package/src/package-json-plugin.ts +3 -3
- package/src/record-plugin.ts +126 -30
- package/src/repack/index.ts +14 -0
- package/src/repack/lint/Rules.ts +1 -10
- package/src/rest-api-plugin.ts +106 -100
- package/src/role-plugin.ts +1 -0
- package/src/server-module-plugin/index.ts +74 -22
- 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 +251 -0
- package/src/service-catalog/shape-to-record.ts +275 -0
- package/src/service-catalog/utils.ts +1362 -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/service-portal/widget-plugin.ts +4 -1
- package/src/sla/sla-validators.ts +331 -0
- package/src/sla-plugin.ts +358 -0
- package/src/static-content-plugin.ts +2 -2
- package/src/table-plugin.ts +66 -9
- package/src/ui-page-plugin.ts +2 -1
- package/src/ui-policy-plugin.ts +505 -0
- package/src/utils.ts +50 -1
- package/src/ux-list-menu-config-plugin.ts +312 -0
- package/src/view-plugin.ts +1 -1
- 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,385 @@
|
|
|
1
|
+
// biome-ignore-all lint/suspicious/noExplicitAny: This file processes dynamic JSON schemas
|
|
2
|
+
import {
|
|
3
|
+
CallExpressionShape,
|
|
4
|
+
ObjectShape,
|
|
5
|
+
UndefinedShape,
|
|
6
|
+
type Record as FluentRecord,
|
|
7
|
+
} from '@servicenow/sdk-build-core'
|
|
8
|
+
import {
|
|
9
|
+
StringColumn,
|
|
10
|
+
IntegerColumn,
|
|
11
|
+
DecimalColumn,
|
|
12
|
+
BooleanColumn,
|
|
13
|
+
DateTimeColumn,
|
|
14
|
+
ChoiceColumn,
|
|
15
|
+
choiceDropdown,
|
|
16
|
+
ReferenceColumn,
|
|
17
|
+
} from '@servicenow/sdk-core/runtime/db'
|
|
18
|
+
import { ChoiceDropdown } from './flow-constants'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Reverse of `generateSchemaFromObject`.
|
|
22
|
+
* Takes the `serialized_content` field from a `sys_complex_object` record and
|
|
23
|
+
* rebuilds a `FlowObject(...)` call-expression shape that can be placed back in
|
|
24
|
+
* the Fluent source.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
// ------------------------------------------------------------
|
|
28
|
+
// Schema <-> Column API mappings (inverse of COLUMN_TYPE_TO_SCHEMA_TYPE)
|
|
29
|
+
// ------------------------------------------------------------
|
|
30
|
+
const SCHEMA_TYPE_TO_COLUMN_API: Record<string, string> = {
|
|
31
|
+
string: StringColumn.name,
|
|
32
|
+
integer: IntegerColumn.name,
|
|
33
|
+
number: DecimalColumn.name,
|
|
34
|
+
boolean: BooleanColumn.name,
|
|
35
|
+
date: DateTimeColumn.name,
|
|
36
|
+
glide_date_time: DateTimeColumn.name,
|
|
37
|
+
choice: ChoiceColumn.name,
|
|
38
|
+
reference: ReferenceColumn.name,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Build a `CallExpressionShape` for a simple (non-object) field given its
|
|
43
|
+
* schema primitive type and associated facets.
|
|
44
|
+
*/
|
|
45
|
+
function buildPrimitiveFieldCallExpr(fieldFacet: ObjectShape, source: FluentRecord): CallExpressionShape {
|
|
46
|
+
const childType = fieldFacet.get('childType').ifDefined()?.asString()?.getValue()
|
|
47
|
+
const schemaType = childType ?? fieldFacet.get('type')?.asString()?.getValue()
|
|
48
|
+
const callee = SCHEMA_TYPE_TO_COLUMN_API[schemaType] ?? StringColumn.name
|
|
49
|
+
|
|
50
|
+
const additionalProps: globalThis.Record<string, unknown> = {}
|
|
51
|
+
|
|
52
|
+
// Extract referenceTable for ReferenceColumn type
|
|
53
|
+
const referenceTable = fieldFacet.get('reference')?.ifString()?.getValue()
|
|
54
|
+
if (referenceTable && schemaType === 'reference') {
|
|
55
|
+
additionalProps['referenceTable'] = referenceTable
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const isChoiceColumn = callee === ChoiceColumn.name
|
|
59
|
+
const isStringColumn = callee === StringColumn.name
|
|
60
|
+
|
|
61
|
+
return new CallExpressionShape({
|
|
62
|
+
source,
|
|
63
|
+
callee,
|
|
64
|
+
args: [
|
|
65
|
+
fieldFacet
|
|
66
|
+
.transform(({ $ }) => ({
|
|
67
|
+
label: $.from('label', 'childLabel').map((label, child) => (child.isDefined() ? child : label)),
|
|
68
|
+
mandatory: $.toBoolean().def(false),
|
|
69
|
+
...(isStringColumn && {
|
|
70
|
+
maxLength: $.from('maxLength', 'childMaxLength')
|
|
71
|
+
.map((maxLength, child) => {
|
|
72
|
+
const value = child.isDefined() ? child : maxLength
|
|
73
|
+
if (value.isString() && value.getValue() !== '') {
|
|
74
|
+
return value.toNumber().getValue()
|
|
75
|
+
}
|
|
76
|
+
return 0
|
|
77
|
+
})
|
|
78
|
+
.def(0),
|
|
79
|
+
}),
|
|
80
|
+
default: $.from('defaultValue', 'childDefaultValue')
|
|
81
|
+
.map((defaultValue, childDefault) => (childDefault.isDefined() ? childDefault : defaultValue))
|
|
82
|
+
.def(''),
|
|
83
|
+
hint: $.from('hint', 'childHint')
|
|
84
|
+
.map((hint, childHint) => (childHint.isDefined() ? childHint : hint))
|
|
85
|
+
.def(''),
|
|
86
|
+
...(isChoiceColumn && {
|
|
87
|
+
choices: $.def({}),
|
|
88
|
+
dropdown: $.from('choiceOption')
|
|
89
|
+
.map((value) => {
|
|
90
|
+
const val = value.getValue()
|
|
91
|
+
if (
|
|
92
|
+
value.if(UndefinedShape) ||
|
|
93
|
+
val === '' ||
|
|
94
|
+
value.toNumber().getValue() === ChoiceDropdown.DROPDOWN_WITH_NONE
|
|
95
|
+
) {
|
|
96
|
+
return undefined
|
|
97
|
+
}
|
|
98
|
+
return choiceDropdown[ChoiceDropdown.DROPDOWN_WITHOUT_NONE]
|
|
99
|
+
})
|
|
100
|
+
.def(choiceDropdown[ChoiceDropdown.DROPDOWN_WITH_NONE]),
|
|
101
|
+
}),
|
|
102
|
+
}))
|
|
103
|
+
.merge(additionalProps),
|
|
104
|
+
],
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Recursively converts the schema representation for a FlowArray into an
|
|
110
|
+
* `ObjectShape` that will be supplied as the first argument to a
|
|
111
|
+
* `FlowArray(...)` call-expression.
|
|
112
|
+
*/
|
|
113
|
+
function buildFlowArrayFromSchema(
|
|
114
|
+
schemaContent: Record<string, any>,
|
|
115
|
+
source: FluentRecord,
|
|
116
|
+
parentTypeFacet: ObjectShape,
|
|
117
|
+
complexObjectSysId?: string,
|
|
118
|
+
co_type_name?: string
|
|
119
|
+
): CallExpressionShape {
|
|
120
|
+
const rootContent = schemaContent['$COCollectionField']
|
|
121
|
+
if (!rootContent) {
|
|
122
|
+
throw new Error('Invalid complex object schema: $COCollectionField not found')
|
|
123
|
+
}
|
|
124
|
+
let rootTypeFacet = parseTypeFacet(source, schemaContent, '$COCollectionField')
|
|
125
|
+
if (!rootTypeFacet) {
|
|
126
|
+
rootTypeFacet = parentTypeFacet
|
|
127
|
+
}
|
|
128
|
+
const type = rootTypeFacet.get('type')?.asString()?.getValue()
|
|
129
|
+
let elementType: CallExpressionShape
|
|
130
|
+
if (type === 'array.object') {
|
|
131
|
+
const childKey = parentTypeFacet.get('childName')?.asString()?.getValue()
|
|
132
|
+
elementType = buildFlowObjectFromSchema(rootContent[0][childKey], source, rootTypeFacet)
|
|
133
|
+
} else {
|
|
134
|
+
elementType = buildPrimitiveFieldCallExpr(parentTypeFacet, source)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return new CallExpressionShape({
|
|
138
|
+
source,
|
|
139
|
+
callee: 'FlowArray',
|
|
140
|
+
args: [
|
|
141
|
+
parentTypeFacet.transform(({ $ }) => ({
|
|
142
|
+
...(complexObjectSysId ? { $id: $.val(complexObjectSysId) } : {}),
|
|
143
|
+
...(co_type_name ? { co_type_name: $.val(co_type_name) } : {}),
|
|
144
|
+
elementType: $.val(elementType),
|
|
145
|
+
label: $.def(''),
|
|
146
|
+
mandatory: $.toBoolean().def(false),
|
|
147
|
+
hint: $.def(''),
|
|
148
|
+
maxRows: $.from('maxRows', 'max_rows')
|
|
149
|
+
.map((maxRows, max_rows) => {
|
|
150
|
+
const value = max_rows.isDefined() ? max_rows : maxRows
|
|
151
|
+
if (value.isString() && value.getValue() !== '') {
|
|
152
|
+
return value.toNumber().getValue()
|
|
153
|
+
}
|
|
154
|
+
return undefined
|
|
155
|
+
})
|
|
156
|
+
.def(undefined),
|
|
157
|
+
childName: $,
|
|
158
|
+
})),
|
|
159
|
+
],
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function buildNestedFlowArrayFromSchema(
|
|
164
|
+
schemaContent: Record<string, any>,
|
|
165
|
+
source: FluentRecord,
|
|
166
|
+
parentTypeFacet: ObjectShape
|
|
167
|
+
): CallExpressionShape {
|
|
168
|
+
const type = parentTypeFacet.get('type')?.asString()?.getValue()
|
|
169
|
+
let elementType: CallExpressionShape
|
|
170
|
+
if (type === 'array.object') {
|
|
171
|
+
// Unwrap the wrapper if present (used for nested array.object)
|
|
172
|
+
// ServiceNow stores nested array.object elements in two ways:
|
|
173
|
+
// 1. With $<num>_<fieldName> wrapper (e.g., $0_task)
|
|
174
|
+
// 2. With the field name itself as wrapper (e.g., tasks inside tasks array)
|
|
175
|
+
const keys = Object.keys(schemaContent)
|
|
176
|
+
const wrapperKey = keys.find((k) => /^\$\d+_/.test(k)) ?? keys.find((k) => !k.endsWith('.$field_facets'))
|
|
177
|
+
const innerContent = wrapperKey ? schemaContent[wrapperKey] : schemaContent
|
|
178
|
+
elementType = buildFlowObjectFromSchema(innerContent, source, parentTypeFacet)
|
|
179
|
+
} else {
|
|
180
|
+
elementType = buildPrimitiveFieldCallExpr(parentTypeFacet, source)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return new CallExpressionShape({
|
|
184
|
+
source,
|
|
185
|
+
callee: 'FlowArray',
|
|
186
|
+
args: [
|
|
187
|
+
parentTypeFacet.transform(({ $ }) => ({
|
|
188
|
+
elementType: $.val(elementType),
|
|
189
|
+
label: $.def(''),
|
|
190
|
+
mandatory: $.toBoolean().def(false),
|
|
191
|
+
hint: $.def(''),
|
|
192
|
+
maxRows: $.from('maxRows', 'max_rows')
|
|
193
|
+
.map((maxRows, max_rows) => {
|
|
194
|
+
const value = max_rows.isDefined() ? max_rows : maxRows
|
|
195
|
+
if (value.isString() && value.getValue() !== '') {
|
|
196
|
+
return value.toNumber().getValue()
|
|
197
|
+
}
|
|
198
|
+
return undefined
|
|
199
|
+
})
|
|
200
|
+
.def(undefined),
|
|
201
|
+
childName: $,
|
|
202
|
+
})),
|
|
203
|
+
],
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Recursively converts the schema representation for a FlowObject into an
|
|
209
|
+
* `ObjectShape` that will be supplied as the first argument to a
|
|
210
|
+
* `FlowObject(...)` call-expression.
|
|
211
|
+
*/
|
|
212
|
+
function buildFlowObjectFromSchema(
|
|
213
|
+
schemaContent: Record<string, any>,
|
|
214
|
+
source: FluentRecord,
|
|
215
|
+
parentTypeFacet: ObjectShape,
|
|
216
|
+
complexObjectSysId?: string,
|
|
217
|
+
co_type_name?: string
|
|
218
|
+
): CallExpressionShape {
|
|
219
|
+
const properties: Record<string, unknown> = {}
|
|
220
|
+
|
|
221
|
+
if (typeof schemaContent === 'object') {
|
|
222
|
+
for (const [key, value] of Object.entries(schemaContent)) {
|
|
223
|
+
// Skip facet keys – they belong to the previous field name.
|
|
224
|
+
if (key.endsWith('.$field_facets')) {
|
|
225
|
+
continue
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const fieldFacet = parseFieldFacet(source, schemaContent, key)
|
|
229
|
+
if (!fieldFacet) {
|
|
230
|
+
throw new Error(`Invalid complex object schema: ${key} facet not found`)
|
|
231
|
+
}
|
|
232
|
+
if (typeof value === 'string') {
|
|
233
|
+
// Primitive field
|
|
234
|
+
properties[key] = buildPrimitiveFieldCallExpr(fieldFacet, source)
|
|
235
|
+
} else if (typeof value === 'object' && value !== null) {
|
|
236
|
+
if (Array.isArray(value)) {
|
|
237
|
+
// Nested FlowArray
|
|
238
|
+
properties[key] = buildNestedFlowArrayFromSchema(value[0], source, fieldFacet)
|
|
239
|
+
} else {
|
|
240
|
+
// Nested FlowObject
|
|
241
|
+
properties[key] = buildFlowObjectFromSchema(value, source, fieldFacet)
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return new CallExpressionShape({
|
|
248
|
+
source,
|
|
249
|
+
callee: 'FlowObject',
|
|
250
|
+
args: [
|
|
251
|
+
parentTypeFacet.transform(({ $ }) => ({
|
|
252
|
+
...(complexObjectSysId ? { $id: $.val(complexObjectSysId) } : {}),
|
|
253
|
+
...(co_type_name ? { co_type_name: $.val(co_type_name) } : {}),
|
|
254
|
+
fields: $.val(properties),
|
|
255
|
+
label: $.from('label', 'childLabel')
|
|
256
|
+
.map((label, child) => (child.isDefined() ? child : label))
|
|
257
|
+
.def(''),
|
|
258
|
+
mandatory: $.toBoolean().def(false),
|
|
259
|
+
})),
|
|
260
|
+
],
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Main entry ‑ convert `serialized_content` JSON → FlowObject or FlowArray call expression.
|
|
266
|
+
*
|
|
267
|
+
* @param schema Parsed `serialized_content`.
|
|
268
|
+
* @param source Optional source node to attach to created shapes.
|
|
269
|
+
* @param complexObjectSysId The sys_id of the sys_complex_object record (if available)
|
|
270
|
+
* @param co_type_name The name field from sys_complex_object
|
|
271
|
+
*/
|
|
272
|
+
export function buildComplexObjectFromSchema(
|
|
273
|
+
source: FluentRecord,
|
|
274
|
+
schema: Record<string, any>,
|
|
275
|
+
attributes: COAttributes,
|
|
276
|
+
complexObjectSysId?: string,
|
|
277
|
+
co_type_name?: string
|
|
278
|
+
): CallExpressionShape {
|
|
279
|
+
const { co_type_name: attrCoTypeName, uiType, ...rest } = attributes
|
|
280
|
+
const rootKey = `FlowDesigner:${attrCoTypeName}`
|
|
281
|
+
if (!rootKey) {
|
|
282
|
+
throw new Error(`Invalid complex object schema: ${attrCoTypeName} not found`)
|
|
283
|
+
}
|
|
284
|
+
const rootContent = schema[rootKey]
|
|
285
|
+
let rootTypeFacet = parseTypeFacet(source, schema, rootKey)
|
|
286
|
+
|
|
287
|
+
if (!rootTypeFacet) {
|
|
288
|
+
throw new Error('Invalid complex object schema: root type facet not found')
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
rootTypeFacet = rootTypeFacet.merge({
|
|
292
|
+
type: uiType,
|
|
293
|
+
...rest,
|
|
294
|
+
})
|
|
295
|
+
// Pass the explicit co_type_name parameter (undefined for deterministic, value for non-deterministic)
|
|
296
|
+
if (uiType.startsWith('array.')) {
|
|
297
|
+
return buildFlowArrayFromSchema(rootContent, source, rootTypeFacet, complexObjectSysId, co_type_name)
|
|
298
|
+
}
|
|
299
|
+
return buildFlowObjectFromSchema(rootContent, source, rootTypeFacet, complexObjectSysId, co_type_name)
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function parseTypeFacet(source: FluentRecord, schema: Record<string, any>, key: string): ObjectShape | undefined {
|
|
303
|
+
const facetKey = `${key}.$type_facets`
|
|
304
|
+
return parseFacet(source, schema, facetKey)
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function parseFieldFacet(source: FluentRecord, schema: Record<string, any>, key: string): ObjectShape | undefined {
|
|
308
|
+
const facetKey = `${key}.$field_facets`
|
|
309
|
+
return parseFacet(source, schema, facetKey)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function parseFacet(source: FluentRecord, schema: Record<string, any>, facetKey: string) {
|
|
313
|
+
const facet = schema[facetKey]?.SimpleMapFacet
|
|
314
|
+
|
|
315
|
+
if (!facet) {
|
|
316
|
+
return undefined
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const choices = schema[facetKey]?.SimpleChoiceFacet
|
|
320
|
+
|
|
321
|
+
try {
|
|
322
|
+
const parsed = JSON.parse(facet)
|
|
323
|
+
const parsedChoices = choices ? JSON.parse(choices)['choice_map_key$'] : {}
|
|
324
|
+
return new ObjectShape({
|
|
325
|
+
source,
|
|
326
|
+
properties: {
|
|
327
|
+
type: parsed['uiType'],
|
|
328
|
+
label: parsed['label'],
|
|
329
|
+
mandatory: parsed['mandatory'],
|
|
330
|
+
reference: parsed['reference'],
|
|
331
|
+
childName: parsed['child_name'],
|
|
332
|
+
childMaxLength: parsed['child_maxsize'],
|
|
333
|
+
childHint: parsed['child_hint'],
|
|
334
|
+
maxLength: parsed['max_length'],
|
|
335
|
+
maxRows: parsed['max_rows'],
|
|
336
|
+
childType: parsed['child_type'],
|
|
337
|
+
childLabel: parsed['child_label'],
|
|
338
|
+
choiceOption: parsed['choiceOption'],
|
|
339
|
+
defaultValue: parsed['default_value'],
|
|
340
|
+
childDefaultValue: parsed['child_defaultValue'],
|
|
341
|
+
hint: parsed['hint'],
|
|
342
|
+
choices: Object.keys(parsedChoices).reduce(
|
|
343
|
+
(acc, key) => {
|
|
344
|
+
const { label, value, order } = JSON.parse(parsedChoices[key])
|
|
345
|
+
acc[value] = { label, sequence: order }
|
|
346
|
+
return acc
|
|
347
|
+
},
|
|
348
|
+
{} as globalThis.Record<string, { label: string; sequence: number }>
|
|
349
|
+
),
|
|
350
|
+
},
|
|
351
|
+
})
|
|
352
|
+
} catch {
|
|
353
|
+
// Failed to parse facet - returning undefined
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return undefined
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export function getAttributeValue(attributesStr: string, key: string): string | undefined {
|
|
360
|
+
const attributes = parseAttributesToObject(attributesStr)
|
|
361
|
+
return attributes[key]
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
type COAttributes = {
|
|
365
|
+
dynamic: string
|
|
366
|
+
co_type_name: string
|
|
367
|
+
uiType: string
|
|
368
|
+
child_label?: string
|
|
369
|
+
child_name?: string
|
|
370
|
+
child_type?: string
|
|
371
|
+
[key: string]: string | undefined
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export function parseAttributesToObject(attributesStr: string): COAttributes {
|
|
375
|
+
return attributesStr
|
|
376
|
+
.split(',')
|
|
377
|
+
.map((p) => p.trim())
|
|
378
|
+
.reduce((acc, pair) => {
|
|
379
|
+
const [key, value] = pair.split('=')
|
|
380
|
+
if (key && value !== undefined) {
|
|
381
|
+
acc[key as keyof COAttributes] = value
|
|
382
|
+
}
|
|
383
|
+
return acc
|
|
384
|
+
}, {} as COAttributes)
|
|
385
|
+
}
|