@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
package/src/record-plugin.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
|
|
2
|
-
import { unloadBuilder } from '@servicenow/sdk-build-core'
|
|
1
|
+
import { CallExpressionShape, Database, Plugin, unloadBuilder, type Record } from '@servicenow/sdk-build-core'
|
|
3
2
|
import { NowIdShape } from './now-id-plugin'
|
|
4
3
|
import {
|
|
5
4
|
Acl,
|
|
@@ -10,6 +9,8 @@ import {
|
|
|
10
9
|
Role,
|
|
11
10
|
Test,
|
|
12
11
|
UserPreference,
|
|
12
|
+
ImportSet,
|
|
13
|
+
Sla,
|
|
13
14
|
} from '@servicenow/sdk-core/runtime/app'
|
|
14
15
|
import {
|
|
15
16
|
SPWidget,
|
|
@@ -18,12 +19,22 @@ import {
|
|
|
18
19
|
CssInclude,
|
|
19
20
|
JsInclude,
|
|
20
21
|
} from '@servicenow/sdk-core/runtime/service-portal'
|
|
22
|
+
import {
|
|
23
|
+
CatalogItem,
|
|
24
|
+
CatalogClientScript,
|
|
25
|
+
VariableSet,
|
|
26
|
+
CatalogUiPolicy,
|
|
27
|
+
CatalogItemRecordProducer,
|
|
28
|
+
} from '@servicenow/sdk-core/runtime/service-catalog'
|
|
21
29
|
import { ClientScript } from '@servicenow/sdk-core/runtime/clientscript'
|
|
22
30
|
import { ScriptAction, ScriptInclude } from '@servicenow/sdk-core/runtime/sys'
|
|
23
31
|
import { List } from '@servicenow/sdk-core/runtime/ui'
|
|
24
32
|
import { Table } from '@servicenow/sdk-core/runtime/db'
|
|
25
33
|
import { RestApi } from '@servicenow/sdk-core/runtime/rest'
|
|
26
|
-
import {
|
|
34
|
+
import { EmailNotification } from '@servicenow/sdk-core/runtime/notification'
|
|
35
|
+
import { UiAction, UiPage, UiPolicy } from '@servicenow/sdk-core/runtime/ui'
|
|
36
|
+
import { Applicability, UxListMenuConfig, Workspace } from '@servicenow/sdk-core/runtime/uxf'
|
|
37
|
+
import { Dashboard } from '@servicenow/sdk-core/runtime/dashboard'
|
|
27
38
|
|
|
28
39
|
export const RecordPlugin = Plugin.create({
|
|
29
40
|
name: 'RecordPlugin',
|
|
@@ -32,31 +43,71 @@ export const RecordPlugin = Plugin.create({
|
|
|
32
43
|
getUpdateName(record) {
|
|
33
44
|
return { success: true, value: `${record.getTable()}_${record.getId().getValue()}` }
|
|
34
45
|
},
|
|
35
|
-
|
|
46
|
+
async diff(existing, incoming) {
|
|
47
|
+
const changeDatabase = existing.compare(incoming)
|
|
36
48
|
return {
|
|
37
49
|
success: true,
|
|
38
|
-
value: new
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
value: changeDatabase.hasChanges() ? new Database(changeDatabase.query()) : new Database(),
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
async toShape(record, { compiler }) {
|
|
54
|
+
const tableName = record.getTable()
|
|
55
|
+
const columnTypes = compiler.getTableColumnTypes(tableName)
|
|
56
|
+
|
|
57
|
+
const dataProperties = record.transform(({ $ }) =>
|
|
58
|
+
Object.fromEntries(
|
|
59
|
+
record
|
|
60
|
+
.keys()
|
|
61
|
+
.filter((key) => key !== 'sys_name')
|
|
62
|
+
.map((key) => {
|
|
63
|
+
const shape = record.get(key)
|
|
64
|
+
if (columnTypes?.has(key) && shape?.isString()) {
|
|
65
|
+
const expectedType = columnTypes.get(key)
|
|
66
|
+
try {
|
|
67
|
+
if (expectedType === 'boolean') {
|
|
68
|
+
return [key, $.val(shape.toBoolean())]
|
|
69
|
+
} else if (expectedType === 'number') {
|
|
70
|
+
return [key, $.val(shape.toNumber())]
|
|
71
|
+
} else if (expectedType === 'array') {
|
|
72
|
+
return [key, $.val(shape.asString().split(',')).def([''])]
|
|
73
|
+
} else if (expectedType === 'array-optional') {
|
|
74
|
+
const arrayParts = shape.asString().includes(',')
|
|
75
|
+
return [key, arrayParts ? $.val(shape.asString().split(',')).def(['']) : $]
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
// Keep as string if conversion fails
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return [key, shape?.isString() ? $.def('') : $] //to avoid writing empty string values to the code
|
|
83
|
+
})
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
const value = new CallExpressionShape({
|
|
88
|
+
source: record,
|
|
89
|
+
callee: 'Record',
|
|
90
|
+
exportName: record.get('sys_name')?.ifDefined()?.asString().getValue(),
|
|
91
|
+
args: [
|
|
92
|
+
{
|
|
93
|
+
$id: NowIdShape.from(record),
|
|
94
|
+
table: tableName,
|
|
95
|
+
data: dataProperties,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
success: true,
|
|
102
|
+
value,
|
|
56
103
|
}
|
|
57
104
|
},
|
|
58
105
|
async toFile(record, { config, database, transform }) {
|
|
59
|
-
const recordBuilder = unloadBuilder(
|
|
106
|
+
const recordBuilder = unloadBuilder({
|
|
107
|
+
scope: config.scope,
|
|
108
|
+
scopeId: config.scopeId,
|
|
109
|
+
table: record.getTable(),
|
|
110
|
+
})
|
|
60
111
|
const updateName = await transform.getUpdateName(record)
|
|
61
112
|
const builder = recordBuilder.record(record, updateName)
|
|
62
113
|
|
|
@@ -101,13 +152,14 @@ export const RecordPlugin = Plugin.create({
|
|
|
101
152
|
|
|
102
153
|
const record = callExpression.getArgument(0).asObject()
|
|
103
154
|
const table = record.get('table').asString().getValue()
|
|
104
|
-
const tableOwningPlugin = TableOwnership[table]
|
|
155
|
+
const tableOwningPlugin = TableOwnership[table as keyof typeof TableOwnership]
|
|
105
156
|
if (tableOwningPlugin) {
|
|
106
157
|
diagnostics.hint(
|
|
107
158
|
callExpression,
|
|
108
159
|
`For a better experience, consider using the ${tableOwningPlugin} API`
|
|
109
160
|
)
|
|
110
161
|
}
|
|
162
|
+
|
|
111
163
|
return {
|
|
112
164
|
success: true,
|
|
113
165
|
value: await factory.createRecord({
|
|
@@ -125,16 +177,25 @@ export const RecordPlugin = Plugin.create({
|
|
|
125
177
|
matcher: /\.xml$/,
|
|
126
178
|
async toRecord(file, { parser, logger }) {
|
|
127
179
|
try {
|
|
128
|
-
const
|
|
180
|
+
const records = await parser.parsePayload(file)
|
|
181
|
+
const recordMap = new Map<string, Record>()
|
|
182
|
+
for (const record of records) {
|
|
183
|
+
const key = `${record.getTable()}::${record.getId().getValue()}`
|
|
184
|
+
const existing = recordMap.get(key)
|
|
129
185
|
|
|
130
|
-
|
|
131
|
-
|
|
186
|
+
const merged = existing
|
|
187
|
+
? existing.merge(record.properties()) // merge properties only to retain the action
|
|
188
|
+
: record
|
|
189
|
+
|
|
190
|
+
recordMap.set(key, merged)
|
|
132
191
|
}
|
|
133
192
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
193
|
+
const mergedRecords = Array.from(recordMap.values())
|
|
194
|
+
const [mergedFirst, ...mergedRest] = mergedRecords
|
|
195
|
+
if (!mergedFirst) {
|
|
196
|
+
return { success: false }
|
|
137
197
|
}
|
|
198
|
+
return { success: true, value: mergedFirst.with(...mergedRest) }
|
|
138
199
|
} catch (e) {
|
|
139
200
|
logger.debug(e)
|
|
140
201
|
return { success: false }
|
|
@@ -145,6 +206,7 @@ export const RecordPlugin = Plugin.create({
|
|
|
145
206
|
})
|
|
146
207
|
|
|
147
208
|
export const TableOwnership = {
|
|
209
|
+
contract_sla: Sla.name,
|
|
148
210
|
sys_security_acl: Acl.name,
|
|
149
211
|
sys_security_acl_role: Acl.name,
|
|
150
212
|
sys_app_application: ApplicationMenu.name,
|
|
@@ -181,7 +243,41 @@ export const TableOwnership = {
|
|
|
181
243
|
sys_ui_action: UiAction.name,
|
|
182
244
|
sys_ui_action_role: UiAction.name,
|
|
183
245
|
sys_ui_action_view: UiAction.name,
|
|
246
|
+
sys_ui_policy: UiPolicy.name,
|
|
247
|
+
sys_ui_policy_action: UiPolicy.name,
|
|
248
|
+
sys_ui_policy_rl_action: UiPolicy.name,
|
|
184
249
|
sysevent_script_action: ScriptAction.name,
|
|
250
|
+
sysevent_email_action: EmailNotification.name,
|
|
185
251
|
sys_db_object: Table.name,
|
|
186
252
|
sys_dictionary: Table.name,
|
|
253
|
+
sys_hub_flow: 'Flow',
|
|
254
|
+
sys_hub_trigger_instance_v2: 'wfa.trigger',
|
|
255
|
+
sys_hub_action_instance_v2: 'wfa.action',
|
|
256
|
+
sys_hub_sub_flow_instance_v2: 'wfa.subflow',
|
|
257
|
+
sys_hub_flow_logic_instance_v2: 'wfa.flowLogic',
|
|
258
|
+
sys_flow_step_definition: 'ActionStepDefinition',
|
|
259
|
+
sys_decision: 'DecisionTablePlugin',
|
|
260
|
+
sys_hub_action_type_definition: 'Action',
|
|
261
|
+
sys_hub_step_instance: 'wfa.action_step',
|
|
262
|
+
sys_transform_map: ImportSet.name,
|
|
263
|
+
sys_transform_entry: ImportSet.name,
|
|
264
|
+
sys_transform_script: ImportSet.name,
|
|
265
|
+
sys_ux_applicability: Applicability.name,
|
|
266
|
+
sys_ux_list_menu_config: UxListMenuConfig.name,
|
|
267
|
+
sys_ux_list_category: UxListMenuConfig.name,
|
|
268
|
+
sys_ux_list: UxListMenuConfig.name,
|
|
269
|
+
sys_ux_applicability_m2m_list: UxListMenuConfig.name,
|
|
270
|
+
sys_ux_page_registry: Workspace.name,
|
|
271
|
+
sys_ux_app_config: Workspace.name,
|
|
272
|
+
par_dashboard: Dashboard.name,
|
|
273
|
+
par_dashboard_canvas: Dashboard.name,
|
|
274
|
+
par_dashboard_tab: Dashboard.name,
|
|
275
|
+
par_dashboard_widget: Dashboard.name,
|
|
276
|
+
par_dashboard_permission: Dashboard.name,
|
|
277
|
+
par_dashboard_visibility: Dashboard.name,
|
|
278
|
+
item_option_new_set: VariableSet.name,
|
|
279
|
+
sc_cat_item: CatalogItem.name,
|
|
280
|
+
sc_cat_item_producer: CatalogItemRecordProducer.name,
|
|
281
|
+
catalog_script_client: CatalogClientScript.name,
|
|
282
|
+
catalog_ui_policy: CatalogUiPolicy.name,
|
|
187
283
|
}
|
package/src/repack/index.ts
CHANGED
|
@@ -11,6 +11,16 @@ export async function checkModuleExists(
|
|
|
11
11
|
return repackService.checkModuleExists(module)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export async function resolveModule(
|
|
15
|
+
module: string,
|
|
16
|
+
logger: RepackOptions['logger'],
|
|
17
|
+
fs: RepackOptions['fs'],
|
|
18
|
+
workingDir: RepackOptions['workingDir']
|
|
19
|
+
): Promise<string | undefined> {
|
|
20
|
+
const repackService = await RepackService.create(logger, fs, workingDir)
|
|
21
|
+
return repackService.resolveModule(module)
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
export const REPACK_OUTPUT_DIR = path.join('.now', '.output')
|
|
15
25
|
|
|
16
26
|
export class RepackService {
|
|
@@ -52,4 +62,8 @@ export class RepackService {
|
|
|
52
62
|
async checkModuleExists(module: string) {
|
|
53
63
|
return this.repack.checkModuleExists(module, this.fs, this.workingDir, this.logger!)
|
|
54
64
|
}
|
|
65
|
+
|
|
66
|
+
async resolveModule(module: string): Promise<string | undefined> {
|
|
67
|
+
return this.repack.resolveModule(module, this.fs, this.workingDir, this.logger)
|
|
68
|
+
}
|
|
55
69
|
}
|
package/src/repack/lint/Rules.ts
CHANGED
|
@@ -10,15 +10,6 @@ const NO_GLOBAL_THIS = 'ES2020 `globalThis` variable is not supported by the now
|
|
|
10
10
|
|
|
11
11
|
type LogLevel = 'warn' | 'error'
|
|
12
12
|
|
|
13
|
-
type ClassMethods = {
|
|
14
|
-
[className: string]: string[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
type GlideAPIMapping = {
|
|
18
|
-
defaults: ClassMethods
|
|
19
|
-
[namespace: string]: ClassMethods
|
|
20
|
-
}
|
|
21
|
-
|
|
22
13
|
type ESLintPropertyRule = {
|
|
23
14
|
message: string
|
|
24
15
|
object?: string
|
|
@@ -26,7 +17,7 @@ type ESLintPropertyRule = {
|
|
|
26
17
|
name?: string
|
|
27
18
|
}
|
|
28
19
|
|
|
29
|
-
const glideAPIs
|
|
20
|
+
const glideAPIs = GlideAPIs
|
|
30
21
|
|
|
31
22
|
const globalsAllowList: string[] = ['console', 'fetch']
|
|
32
23
|
|
package/src/rest-api-plugin.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from '@servicenow/sdk-build-core'
|
|
12
12
|
import { ModuleFunctionShape } from './server-module-plugin'
|
|
13
13
|
import { NowIdShape } from './now-id-plugin'
|
|
14
|
+
import { NowIncludeShape } from './now-include-plugin'
|
|
14
15
|
import { generateDeprecatedDiagnostics } from './utils'
|
|
15
16
|
|
|
16
17
|
const DEFAULT_MEDIA_TYPE = 'application/json,application/xml,text/xml'
|
|
@@ -162,13 +163,12 @@ async function generateRouteAttributeRecords(
|
|
|
162
163
|
attrType: string,
|
|
163
164
|
attrMap: Map<string, Record>,
|
|
164
165
|
factory: Factory,
|
|
165
|
-
diagnostics: Diagnostics
|
|
166
|
-
callExpression: CallExpressionShape
|
|
166
|
+
diagnostics: Diagnostics
|
|
167
167
|
): Promise<Record[]> {
|
|
168
168
|
const records: Record[] = []
|
|
169
169
|
for (const attr of attributes) {
|
|
170
170
|
const attrRecord = await factory.createRecord({
|
|
171
|
-
source:
|
|
171
|
+
source: attr,
|
|
172
172
|
table: `sys_ws_${attrType}`,
|
|
173
173
|
explicitId: attr.asObject().get('$id'),
|
|
174
174
|
properties: attr.asObject().transform(({ $ }) => ({
|
|
@@ -178,17 +178,19 @@ async function generateRouteAttributeRecords(
|
|
|
178
178
|
example_value: $.from('exampleValue').def(''),
|
|
179
179
|
web_service_definition: $.val(restDef.getId()),
|
|
180
180
|
})),
|
|
181
|
+
installCategory: restDef.getInstallCategory(),
|
|
181
182
|
})
|
|
182
183
|
|
|
183
184
|
checkForDuplicateRecords(attrMap, attrRecord, attr.asObject(), diagnostics)
|
|
184
185
|
|
|
185
186
|
const attributeMappingRecord = await factory.createRecord({
|
|
186
|
-
source:
|
|
187
|
+
source: attr,
|
|
187
188
|
table: `sys_ws_${attrType}_map`,
|
|
188
189
|
properties: attr.asObject().transform(({ $ }) => ({
|
|
189
190
|
web_service_operation: $.val(routeDef.getId()),
|
|
190
191
|
[`web_service_${attrType}`]: $.val(attrRecord.getId()),
|
|
191
192
|
})),
|
|
193
|
+
installCategory: restDef.getInstallCategory(),
|
|
192
194
|
})
|
|
193
195
|
|
|
194
196
|
records.push(attrRecord.with(attributeMappingRecord))
|
|
@@ -292,8 +294,7 @@ async function generateRouteAndRouteAttrRecords(
|
|
|
292
294
|
'header',
|
|
293
295
|
headersMap,
|
|
294
296
|
factory,
|
|
295
|
-
diagnostics
|
|
296
|
-
callExpression
|
|
297
|
+
diagnostics
|
|
297
298
|
)
|
|
298
299
|
|
|
299
300
|
const routeParameters = route.get('parameters')?.ifArray()?.getElements() ?? []
|
|
@@ -308,8 +309,7 @@ async function generateRouteAndRouteAttrRecords(
|
|
|
308
309
|
'query_parameter',
|
|
309
310
|
parametersMap,
|
|
310
311
|
factory,
|
|
311
|
-
diagnostics
|
|
312
|
-
callExpression
|
|
312
|
+
diagnostics
|
|
313
313
|
)
|
|
314
314
|
|
|
315
315
|
routeRecords.push(routeRecord.with(...headerRecords, ...parameterRecords))
|
|
@@ -318,11 +318,11 @@ async function generateRouteAndRouteAttrRecords(
|
|
|
318
318
|
return routeRecords
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
function
|
|
321
|
+
function findOrphanedAttributes(
|
|
322
322
|
attributes: Record[],
|
|
323
323
|
attributeRouteAssociations: Record[],
|
|
324
324
|
attributeType: string
|
|
325
|
-
) {
|
|
325
|
+
): Record[] {
|
|
326
326
|
const attributeIdToRecordMap = new Map<string, Record>()
|
|
327
327
|
attributes.forEach((attribute) => {
|
|
328
328
|
attributeIdToRecordMap.set(attribute.getId().getValue(), attribute)
|
|
@@ -336,20 +336,21 @@ function validateAttributesAndAssociations(
|
|
|
336
336
|
})
|
|
337
337
|
)
|
|
338
338
|
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return attribute?.get('name')?.getValue() || id
|
|
345
|
-
})
|
|
346
|
-
.join(', ')
|
|
339
|
+
const orphanedAttributeIds = Array.from(attributeIds).filter((id) => !referencedAttributeIds.has(id))
|
|
340
|
+
return orphanedAttributeIds
|
|
341
|
+
.map((id) => attributeIdToRecordMap.get(id))
|
|
342
|
+
.filter((record): record is Record => record !== undefined)
|
|
343
|
+
}
|
|
347
344
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
345
|
+
function validateAttributesAndAssociations(
|
|
346
|
+
attributes: Record[],
|
|
347
|
+
attributeRouteAssociations: Record[],
|
|
348
|
+
attributeType: string
|
|
349
|
+
) {
|
|
350
|
+
const attributeIdToRecordMap = new Map<string, Record>()
|
|
351
|
+
attributes.forEach((attribute) => {
|
|
352
|
+
attributeIdToRecordMap.set(attribute.getId().getValue(), attribute)
|
|
353
|
+
})
|
|
353
354
|
|
|
354
355
|
const invalidAttributeAssociations = attributeRouteAssociations.filter((association) => {
|
|
355
356
|
const attr = association.get(`web_service_${attributeType}`)
|
|
@@ -453,7 +454,7 @@ export const RestApiPlugin = Plugin.create({
|
|
|
453
454
|
descendant: true,
|
|
454
455
|
},
|
|
455
456
|
},
|
|
456
|
-
toShape(record, { descendants }) {
|
|
457
|
+
async toShape(record, { descendants, transform }) {
|
|
457
458
|
const versions = descendants.query('sys_ws_version')
|
|
458
459
|
const routes = descendants.query('sys_ws_operation')
|
|
459
460
|
const headers = descendants.query('sys_ws_header')
|
|
@@ -466,9 +467,7 @@ export const RestApiPlugin = Plugin.create({
|
|
|
466
467
|
* Case 1: No m2m records exists for a header or parameter record. Can happen in following scenarios:
|
|
467
468
|
* - User has created a header or parameter record but these records are not associated with any routes on instance.
|
|
468
469
|
* - User has removed all the m2m associations on instance but not the actual header or parameter record.
|
|
469
|
-
* Solution:
|
|
470
|
-
* - Associate the header or parameter record with a route
|
|
471
|
-
* - Delete the header or parameter record
|
|
470
|
+
* Solution: Return orphaned attributes as unhandled records for partial success
|
|
472
471
|
*
|
|
473
472
|
* Case 2: Deleting a header record on instance wouldn't delete the m2m records which map those headers to a route.
|
|
474
473
|
* Solution: Throw error and request the user to cleanup the m2m records on instance.
|
|
@@ -476,81 +475,88 @@ export const RestApiPlugin = Plugin.create({
|
|
|
476
475
|
validateAttributesAndAssociations(headers, headerRouteAssociations, 'header')
|
|
477
476
|
validateAttributesAndAssociations(parameters, paramRouteAssociations, 'query_parameter')
|
|
478
477
|
|
|
478
|
+
const orphanedHeaders = findOrphanedAttributes(headers, headerRouteAssociations, 'header')
|
|
479
|
+
const orphanedParameters = findOrphanedAttributes(parameters, paramRouteAssociations, 'query_parameter')
|
|
480
|
+
const unhandledRecords = [...orphanedHeaders, ...orphanedParameters]
|
|
481
|
+
|
|
482
|
+
const routesWithScript = await Promise.all(
|
|
483
|
+
routes.map(async (r) => {
|
|
484
|
+
const script = await NowIncludeShape.fromRecord(r, r.get('operation_script'), transform)
|
|
485
|
+
return r
|
|
486
|
+
.transform(({ $ }) => ({
|
|
487
|
+
$id: $.val(NowIdShape.from(r)),
|
|
488
|
+
name: $,
|
|
489
|
+
active: $.toBoolean().def(true),
|
|
490
|
+
consumes: $,
|
|
491
|
+
method: $.from('http_method').def('GET'),
|
|
492
|
+
script: $.val(script),
|
|
493
|
+
produces: $,
|
|
494
|
+
path: $.from('relative_path').def('/'),
|
|
495
|
+
enforceAcl: $.val(splitAcls(r.get('enforce_acl'))).def([DEFAULT_REST_ENFORCED_ACL]),
|
|
496
|
+
authorization: $.from('requires_acl_authorization').toBoolean().def(true),
|
|
497
|
+
authentication: $.from('requires_authentication').toBoolean().def(true),
|
|
498
|
+
internalRole: $.from('requires_snc_internal_role').toBoolean().def(true),
|
|
499
|
+
shortDescription: $.from('short_description').def(''),
|
|
500
|
+
requestExample: $.from('request_example').def(''),
|
|
501
|
+
policy: $.from('sys_policy').def(''),
|
|
502
|
+
parameters: $.val(
|
|
503
|
+
routeAttributeTransform(
|
|
504
|
+
paramRouteAssociations,
|
|
505
|
+
parameters,
|
|
506
|
+
r.getId().getValue(),
|
|
507
|
+
'query_parameter'
|
|
508
|
+
)
|
|
509
|
+
).def([]),
|
|
510
|
+
headers: $.val(
|
|
511
|
+
routeAttributeTransform(
|
|
512
|
+
headerRouteAssociations,
|
|
513
|
+
headers,
|
|
514
|
+
r.getId().getValue(),
|
|
515
|
+
'header'
|
|
516
|
+
)
|
|
517
|
+
).def([]),
|
|
518
|
+
version: $.from('web_service_version').map((v) => getVersionNumber(v, versions)),
|
|
519
|
+
}))
|
|
520
|
+
.withAliasedKeys(routeAliases)
|
|
521
|
+
})
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
const shape = new CallExpressionShape({
|
|
525
|
+
source: record,
|
|
526
|
+
callee: 'RestApi',
|
|
527
|
+
args: [
|
|
528
|
+
record
|
|
529
|
+
.transform(({ $ }) => ({
|
|
530
|
+
$id: $.val(NowIdShape.from(record)),
|
|
531
|
+
name: $,
|
|
532
|
+
active: $.toBoolean().def(true),
|
|
533
|
+
consumes: $.def(DEFAULT_MEDIA_TYPE),
|
|
534
|
+
produces: $.def(DEFAULT_MEDIA_TYPE),
|
|
535
|
+
enforceAcl: $.from('enforce_acl')
|
|
536
|
+
.map((v) => splitAcls(v))
|
|
537
|
+
.def([DEFAULT_REST_ENFORCED_ACL]),
|
|
538
|
+
serviceId: $.from('service_id'),
|
|
539
|
+
shortDescription: $.from('short_description').def(''),
|
|
540
|
+
policy: $.from('sys_policy').def(''),
|
|
541
|
+
docLink: $.from('doc_link').def(''),
|
|
542
|
+
routes: $.val(routesWithScript).def([]),
|
|
543
|
+
versions: $.val(versionsTransform(versions)).def([]),
|
|
544
|
+
}))
|
|
545
|
+
.withAliasedKeys(restDefAliases),
|
|
546
|
+
],
|
|
547
|
+
})
|
|
548
|
+
|
|
549
|
+
if (unhandledRecords.length > 0) {
|
|
550
|
+
return {
|
|
551
|
+
success: 'partial',
|
|
552
|
+
value: shape,
|
|
553
|
+
unhandledRecords,
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
479
557
|
return {
|
|
480
558
|
success: true,
|
|
481
|
-
value:
|
|
482
|
-
source: record,
|
|
483
|
-
callee: 'RestApi',
|
|
484
|
-
args: [
|
|
485
|
-
record
|
|
486
|
-
.transform(({ $ }) => ({
|
|
487
|
-
$id: $.val(NowIdShape.from(record)),
|
|
488
|
-
name: $,
|
|
489
|
-
active: $.toBoolean().def(true),
|
|
490
|
-
consumes: $.def(DEFAULT_MEDIA_TYPE),
|
|
491
|
-
produces: $.def(DEFAULT_MEDIA_TYPE),
|
|
492
|
-
enforceAcl: $.from('enforce_acl')
|
|
493
|
-
.map((v) => splitAcls(v))
|
|
494
|
-
.def([DEFAULT_REST_ENFORCED_ACL]),
|
|
495
|
-
serviceId: $.from('service_id'),
|
|
496
|
-
shortDescription: $.from('short_description').def(''),
|
|
497
|
-
policy: $.from('sys_policy').def(''),
|
|
498
|
-
docLink: $.from('doc_link').def(''),
|
|
499
|
-
routes: $.val(
|
|
500
|
-
routes.map((r) =>
|
|
501
|
-
r
|
|
502
|
-
.transform(({ $ }) => ({
|
|
503
|
-
$id: $.val(NowIdShape.from(r)),
|
|
504
|
-
name: $,
|
|
505
|
-
active: $.toBoolean().def(true),
|
|
506
|
-
consumes: $,
|
|
507
|
-
method: $.from('http_method').def('GET'),
|
|
508
|
-
script: $.from('operation_script'),
|
|
509
|
-
produces: $,
|
|
510
|
-
path: $.from('relative_path').def('/'),
|
|
511
|
-
enforceAcl: $.val(splitAcls(r.get('enforce_acl'))).def([
|
|
512
|
-
DEFAULT_REST_ENFORCED_ACL,
|
|
513
|
-
]),
|
|
514
|
-
authorization: $.from('requires_acl_authorization')
|
|
515
|
-
.toBoolean()
|
|
516
|
-
.def(true),
|
|
517
|
-
authentication: $.from('requires_authentication')
|
|
518
|
-
.toBoolean()
|
|
519
|
-
.def(true),
|
|
520
|
-
internalRole: $.from('requires_snc_internal_role')
|
|
521
|
-
.toBoolean()
|
|
522
|
-
.def(true),
|
|
523
|
-
shortDescription: $.from('short_description').def(''),
|
|
524
|
-
requestExample: $.from('request_example').def(''),
|
|
525
|
-
policy: $.from('sys_policy').def(''),
|
|
526
|
-
parameters: $.val(
|
|
527
|
-
routeAttributeTransform(
|
|
528
|
-
paramRouteAssociations,
|
|
529
|
-
parameters,
|
|
530
|
-
r.getId().getValue(),
|
|
531
|
-
'query_parameter'
|
|
532
|
-
)
|
|
533
|
-
).def([]),
|
|
534
|
-
headers: $.val(
|
|
535
|
-
routeAttributeTransform(
|
|
536
|
-
headerRouteAssociations,
|
|
537
|
-
headers,
|
|
538
|
-
r.getId().getValue(),
|
|
539
|
-
'header'
|
|
540
|
-
)
|
|
541
|
-
).def([]),
|
|
542
|
-
version: $.from('web_service_version').map((v) =>
|
|
543
|
-
getVersionNumber(v, versions)
|
|
544
|
-
),
|
|
545
|
-
}))
|
|
546
|
-
.withAliasedKeys(routeAliases)
|
|
547
|
-
)
|
|
548
|
-
).def([]),
|
|
549
|
-
versions: $.val(versionsTransform(versions)).def([]),
|
|
550
|
-
}))
|
|
551
|
-
.withAliasedKeys(restDefAliases),
|
|
552
|
-
],
|
|
553
|
-
}),
|
|
559
|
+
value: shape,
|
|
554
560
|
}
|
|
555
561
|
},
|
|
556
562
|
},
|