@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/column-plugin.ts
CHANGED
|
@@ -88,7 +88,7 @@ export const ColumnPlugin = Plugin.create({
|
|
|
88
88
|
value: `sys_choice_${record.get('name').getValue()}_${record.get('element').getValue()}`,
|
|
89
89
|
}),
|
|
90
90
|
async toFile(choiceSet, { config, descendants, transform }) {
|
|
91
|
-
if (config.tableOutputFormat === 'bootstrap') {
|
|
91
|
+
if (config.tableOutputFormat === 'bootstrap' && config.type === 'package') {
|
|
92
92
|
// Defer to table plugin
|
|
93
93
|
return { success: false }
|
|
94
94
|
}
|
|
@@ -96,7 +96,7 @@ export const ColumnPlugin = Plugin.create({
|
|
|
96
96
|
const tableName = choiceSet.get('name').asString().getValue()
|
|
97
97
|
const elementName = choiceSet.get('element').asString().getValue()
|
|
98
98
|
const xml = create().ele('record_update')
|
|
99
|
-
const root = xml.ele('sys_choice_set', { table: tableName })
|
|
99
|
+
const root = xml.ele('sys_choice_set', { table: tableName, field: elementName })
|
|
100
100
|
descendants.query('sys_choice').forEach((choice) => {
|
|
101
101
|
const child = root.ele('sys_choice', { action: choice.getAction() })
|
|
102
102
|
child.ele('sys_id').txt(choice.getId().getValue())
|
|
@@ -186,18 +186,34 @@ export const ColumnPlugin = Plugin.create({
|
|
|
186
186
|
properties: column.transform(({ $ }) => ({
|
|
187
187
|
name: $.from('table'),
|
|
188
188
|
element: $.from('name'),
|
|
189
|
-
internal_type: $.
|
|
189
|
+
internal_type: $.from('isFullUTF8')
|
|
190
|
+
.map((isFullUTF8) =>
|
|
191
|
+
isFullUTF8?.isBoolean() &&
|
|
192
|
+
isFullUTF8.asBoolean().getValue() &&
|
|
193
|
+
columnType === 'string'
|
|
194
|
+
? 'string_full_utf8'
|
|
195
|
+
: columnType
|
|
196
|
+
)
|
|
197
|
+
.def(columnType),
|
|
190
198
|
active: $.toBoolean().def(true),
|
|
191
199
|
array: $.toBoolean().def(false),
|
|
192
|
-
attributes: $.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
attributes: $.from('attributes', 'scale', 'script')
|
|
201
|
+
.map((attributes, scale, script) => {
|
|
202
|
+
const attrs = attributes?.isObject() ? attributes.asObject().getValue() : {}
|
|
203
|
+
|
|
204
|
+
// Add special parameters to attributes
|
|
205
|
+
if (scale?.isNumber()) {
|
|
206
|
+
attrs['scale'] = scale.asNumber().getValue()
|
|
207
|
+
}
|
|
208
|
+
if (script?.isString()) {
|
|
209
|
+
attrs['script'] = script.asString().getValue()
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return Object.entries(attrs)
|
|
213
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
214
|
+
.join(',')
|
|
215
|
+
})
|
|
216
|
+
.def(''),
|
|
201
217
|
audit: $.toBoolean().def(false),
|
|
202
218
|
reference_cascade_rule: $.from('cascadeRule'),
|
|
203
219
|
default_value: $.from('default'),
|
|
@@ -267,19 +283,42 @@ export const ColumnPlugin = Plugin.create({
|
|
|
267
283
|
? dynamicValueDefinitions.asObject().get('field').ifString()
|
|
268
284
|
: undefined
|
|
269
285
|
),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
286
|
+
|
|
287
|
+
dependent: $.from('dependent', 'dynamicValueDefinitions').map(
|
|
288
|
+
(dependent, dynamicValueDefinitions) => {
|
|
289
|
+
// New direct approach (DocumentIdColumn, TemplateValueColumn, FieldListColumn)
|
|
290
|
+
if (dependent?.isString()) {
|
|
291
|
+
return dependent.asString().getValue()
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (dependent?.isObject()) {
|
|
295
|
+
diagnostics.warn(
|
|
296
|
+
dependent.getOriginalNode(),
|
|
297
|
+
`Passing a TableNameColumn object to 'dependent' is deprecated and will not work as expected. Pass the field name as a string instead.`
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Legacy approach via dynamicValueDefinitions
|
|
302
|
+
if (
|
|
303
|
+
dynamicValueDefinitions?.ifObject()?.get('type').ifString()?.getValue() ===
|
|
304
|
+
'dependent_field'
|
|
305
|
+
) {
|
|
306
|
+
const dynamicValueObject = dynamicValueDefinitions
|
|
307
|
+
.asObject()
|
|
308
|
+
.withAliasedKeys(calculationAliases)
|
|
309
|
+
generateDeprecatedDiagnostics(dynamicValueObject, diagnostics)
|
|
310
|
+
diagnostics.warn(
|
|
311
|
+
dynamicValueDefinitions.getOriginalNode(),
|
|
312
|
+
`Using 'dynamicValueDefinitions: { type: "dependent_field" }' is deprecated. ` +
|
|
313
|
+
`Use 'dependent: "field_name"' directly on the column instead.`
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
return dynamicValueObject.get('columnName').ifString()?.getValue()
|
|
317
|
+
}
|
|
318
|
+
|
|
275
319
|
return undefined
|
|
276
320
|
}
|
|
277
|
-
|
|
278
|
-
.asObject()
|
|
279
|
-
.withAliasedKeys(calculationAliases)
|
|
280
|
-
generateDeprecatedDiagnostics(dynamicValueObject, diagnostics)
|
|
281
|
-
return dynamicValueObject.get('columnName').ifString()
|
|
282
|
-
}),
|
|
321
|
+
),
|
|
283
322
|
dependent_on_field: $.from('dynamicValueDefinitions').map((dynamicValueDefinitions) => {
|
|
284
323
|
if (
|
|
285
324
|
dynamicValueDefinitions.ifObject()?.get('type').ifString()?.getValue() !==
|
|
@@ -316,7 +355,20 @@ export const ColumnPlugin = Plugin.create({
|
|
|
316
355
|
)
|
|
317
356
|
.def(getDefaultMaxLength(columnType)),
|
|
318
357
|
primary: $.toBoolean().def(false),
|
|
319
|
-
read_only: $.from('readOnly')
|
|
358
|
+
read_only: $.from('readOnly', 'readOnlyOption')
|
|
359
|
+
.map((readOnly, readOnlyOption) => {
|
|
360
|
+
const readOnlyValue = readOnly.ifBoolean()?.getValue()
|
|
361
|
+
const readOnlyOptionValue = readOnlyOption.ifString()?.getValue()
|
|
362
|
+
if (readOnlyValue === false && readOnlyOptionValue) {
|
|
363
|
+
diagnostics.error(
|
|
364
|
+
readOnly,
|
|
365
|
+
`readOnly cannot be false with readOnlyOption ${readOnlyOptionValue}.`
|
|
366
|
+
)
|
|
367
|
+
}
|
|
368
|
+
return readOnlyValue ?? !!readOnlyOptionValue
|
|
369
|
+
})
|
|
370
|
+
.def(false),
|
|
371
|
+
read_only_option: $.from('readOnlyOption'),
|
|
320
372
|
reference: $.from('referenceTable'),
|
|
321
373
|
spell_check: $.from('spellCheck').toBoolean().def(false),
|
|
322
374
|
table_reference: $.from('tableReference').toBoolean().def(false),
|
|
@@ -337,7 +389,10 @@ export function columnToCallExpression(
|
|
|
337
389
|
column: Record,
|
|
338
390
|
related: { choices: Record[]; documentation: Record[] }
|
|
339
391
|
): CallExpressionShape {
|
|
340
|
-
const
|
|
392
|
+
const internalType = column.get('internal_type').asString().getValue()
|
|
393
|
+
// Normalize string_full_utf8 to string for column type lookup
|
|
394
|
+
const normalizedType = internalType === 'string_full_utf8' ? 'string' : internalType
|
|
395
|
+
const callExpression = COLUMN_TYPE_TO_API[normalizedType] ?? GenericColumn.name
|
|
341
396
|
const { choices, documentation } = related
|
|
342
397
|
return new CallExpressionShape({
|
|
343
398
|
source: column,
|
|
@@ -351,7 +406,7 @@ export function columnToCallExpression(
|
|
|
351
406
|
if (!attributes.isString()) {
|
|
352
407
|
return undefined
|
|
353
408
|
}
|
|
354
|
-
const result = {}
|
|
409
|
+
const result: { [key: string]: string | boolean } = {}
|
|
355
410
|
attributes
|
|
356
411
|
.toString()
|
|
357
412
|
.getValue()
|
|
@@ -361,18 +416,61 @@ export function columnToCallExpression(
|
|
|
361
416
|
return
|
|
362
417
|
}
|
|
363
418
|
const [key, value] = attr.split('=').map((s) => s.trim())
|
|
419
|
+
// Filter out special parameters that have their own fields
|
|
420
|
+
if (key === 'scale' || key === 'script') {
|
|
421
|
+
return
|
|
422
|
+
}
|
|
423
|
+
if (!key || value === undefined) {
|
|
424
|
+
return
|
|
425
|
+
}
|
|
364
426
|
if (value === 'true') {
|
|
365
|
-
result[key
|
|
427
|
+
result[key] = true
|
|
366
428
|
} else if (value === 'false') {
|
|
367
|
-
result[key
|
|
429
|
+
result[key] = false
|
|
368
430
|
} else {
|
|
369
|
-
result[key
|
|
431
|
+
result[key] = value
|
|
370
432
|
}
|
|
371
433
|
})
|
|
372
434
|
return result
|
|
373
435
|
}).def({
|
|
374
436
|
edge_encryption_enabled: true,
|
|
375
437
|
}),
|
|
438
|
+
// Extract special parameters from attributes
|
|
439
|
+
scale: $.from('attributes').map((attributes) => {
|
|
440
|
+
if (!attributes.isString()) {
|
|
441
|
+
return undefined
|
|
442
|
+
}
|
|
443
|
+
const scaleMatch = attributes
|
|
444
|
+
.asString()
|
|
445
|
+
.getValue()
|
|
446
|
+
.match(/scale=([^,]+)/)
|
|
447
|
+
return scaleMatch ? Number(scaleMatch[1]) : undefined
|
|
448
|
+
}),
|
|
449
|
+
script: $.from('attributes').map((attributes) => {
|
|
450
|
+
if (!attributes.isString()) {
|
|
451
|
+
return undefined
|
|
452
|
+
}
|
|
453
|
+
const scriptMatch = attributes
|
|
454
|
+
.asString()
|
|
455
|
+
.getValue()
|
|
456
|
+
.match(/script=([^,]+)/)
|
|
457
|
+
return scriptMatch ? scriptMatch[1] : undefined
|
|
458
|
+
}),
|
|
459
|
+
source_table: $.from('attributes').map((attributes) => {
|
|
460
|
+
if (!attributes.isString()) {
|
|
461
|
+
return undefined
|
|
462
|
+
}
|
|
463
|
+
const sourceTableMatch = attributes
|
|
464
|
+
.asString()
|
|
465
|
+
.getValue()
|
|
466
|
+
.match(/source_table=([^,]+)/)
|
|
467
|
+
return sourceTableMatch ? sourceTableMatch[1] : undefined
|
|
468
|
+
}),
|
|
469
|
+
isFullUTF8: $.from('internal_type').map((internalType) =>
|
|
470
|
+
internalType?.isString() && internalType.asString().getValue() === 'string_full_utf8'
|
|
471
|
+
? true
|
|
472
|
+
: undefined
|
|
473
|
+
),
|
|
376
474
|
audit: $.toBoolean().def(false),
|
|
377
475
|
cascadeRule: $.from('reference_cascade_rule').def(''),
|
|
378
476
|
columnType: callExpression === GenericColumn.name ? $.from('internal_type') : $.val(undefined),
|
|
@@ -456,8 +554,8 @@ export function columnToCallExpression(
|
|
|
456
554
|
return dropdownIndex !== -1 ? choiceDropdown[dropdownIndex] : undefined
|
|
457
555
|
})
|
|
458
556
|
.def('none'),
|
|
459
|
-
dynamicValueDefinitions: $.from('calculation', 'choice_table', 'choice_field'
|
|
460
|
-
(calculation, choiceTable, choiceField
|
|
557
|
+
dynamicValueDefinitions: $.from('calculation', 'choice_table', 'choice_field').map(
|
|
558
|
+
(calculation, choiceTable, choiceField) => {
|
|
461
559
|
if (
|
|
462
560
|
calculation.ifString()?.getValue() &&
|
|
463
561
|
calculation.asString().getValue() !== DEFAULT_COLUMN_CALCULATION
|
|
@@ -477,18 +575,18 @@ export function columnToCallExpression(
|
|
|
477
575
|
field: choiceField.asString().getValue(),
|
|
478
576
|
}
|
|
479
577
|
}
|
|
480
|
-
|
|
481
|
-
return new ObjectShape({
|
|
482
|
-
source: dependent,
|
|
483
|
-
properties: {
|
|
484
|
-
type: 'dependent_field',
|
|
485
|
-
columnName: dependent.asString().getValue(),
|
|
486
|
-
},
|
|
487
|
-
}).withAliasedKeys(calculationAliases)
|
|
488
|
-
}
|
|
578
|
+
|
|
489
579
|
return undefined
|
|
490
580
|
}
|
|
491
581
|
),
|
|
582
|
+
// Direct dependent parameter for DocumentIdColumn, TemplateValueColumn, and FieldListColumn
|
|
583
|
+
dependent: $.from('dependent').map((dependent) => {
|
|
584
|
+
if (dependent?.isString()) {
|
|
585
|
+
const value = dependent.asString().getValue()
|
|
586
|
+
return value !== '' ? value : undefined
|
|
587
|
+
}
|
|
588
|
+
return undefined
|
|
589
|
+
}),
|
|
492
590
|
elementReference: $.from('element_reference').toBoolean().def(false),
|
|
493
591
|
functionDefinition: $.from('function_definition').def(''),
|
|
494
592
|
label:
|
|
@@ -525,6 +623,7 @@ export function columnToCallExpression(
|
|
|
525
623
|
.def(getDefaultMaxLength(column.get('internal_type').asString().getValue())),
|
|
526
624
|
primary: $.toBoolean().def(false),
|
|
527
625
|
readOnly: $.from('read_only').toBoolean().def(false),
|
|
626
|
+
readOnlyOption: $.from('read_only_option').def(''),
|
|
528
627
|
referenceTable: $.from('reference').def(''),
|
|
529
628
|
referenceFloats: $.from('reference_floats').toBoolean().def(false),
|
|
530
629
|
referenceKey: $.from('reference_key').def(''),
|
|
@@ -581,6 +680,9 @@ export function isDefaultDocumentation(columnName: string, documentation: Record
|
|
|
581
680
|
// TODO make default language configurable
|
|
582
681
|
language: 'en',
|
|
583
682
|
}
|
|
683
|
+
if ('sys_name' in doc) {
|
|
684
|
+
defaultRecord['sys_name'] = label
|
|
685
|
+
}
|
|
584
686
|
const optionalFields = ['hint', 'help', 'url', 'url_target', 'sys_policy'] as const
|
|
585
687
|
optionalFields.forEach((field) => {
|
|
586
688
|
if (field in doc) {
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import isEmpty from 'lodash/isEmpty'
|
|
2
|
+
import isEqual from 'lodash/isEqual'
|
|
3
|
+
|
|
4
|
+
export const DEFAULT_PROPERTY_VALUES = {
|
|
5
|
+
allowAdditionalGroupByPerMetric: false,
|
|
6
|
+
allowChangeDateRange: false,
|
|
7
|
+
scoreIcon: '',
|
|
8
|
+
applyDateRange: false,
|
|
9
|
+
autoAggregatePeriods: false,
|
|
10
|
+
bareBorder: false,
|
|
11
|
+
cacheExpirationTime: 0,
|
|
12
|
+
chartVariation: 'stacked',
|
|
13
|
+
dataLabelPosition: 'middle',
|
|
14
|
+
dataLabelsType: 'both',
|
|
15
|
+
dateFormat: 'default',
|
|
16
|
+
disableTooltip: false,
|
|
17
|
+
emptyStateAlignment: 'vertical-centered',
|
|
18
|
+
emptyStateContent: 'There are no scores available for the selected criteria. Contact your admin for more info.',
|
|
19
|
+
emptyStateHeading: 'No data available.',
|
|
20
|
+
emptyStateHeadingLevel: 3,
|
|
21
|
+
emptyStateIllustration: 'no-data',
|
|
22
|
+
enableAddZerosAtApi: true,
|
|
23
|
+
enableClickAndStay: false,
|
|
24
|
+
enableCustomEmptyState: false,
|
|
25
|
+
enableDrilldown: true,
|
|
26
|
+
enableRealTimeUpdate: false,
|
|
27
|
+
extensionType: 'step',
|
|
28
|
+
filterConfigurations: '@state.parFilters',
|
|
29
|
+
followFilters: true,
|
|
30
|
+
freezeFirstColumn: true,
|
|
31
|
+
freezeFooter: false,
|
|
32
|
+
freezeHeader: true,
|
|
33
|
+
gaugeArcAngle: '180',
|
|
34
|
+
headerTitleAlignment: 'start',
|
|
35
|
+
headingLevel: 2,
|
|
36
|
+
headingPosition: 'top',
|
|
37
|
+
hideDevSettings: false,
|
|
38
|
+
hideMatrixAggregate: false,
|
|
39
|
+
hideYAxis0: false,
|
|
40
|
+
hideYAxis1: false,
|
|
41
|
+
hideYAxis2: false,
|
|
42
|
+
hideYAxis3: false,
|
|
43
|
+
hideYAxis4: false,
|
|
44
|
+
iconStyle: 'background',
|
|
45
|
+
legendExpandToFit: false,
|
|
46
|
+
legendHorizontalAlignment: 'center',
|
|
47
|
+
legendPosition: 'bottom',
|
|
48
|
+
lineClamp: 1,
|
|
49
|
+
lineStrokeWidth: '2',
|
|
50
|
+
mapSysId: '93b8a3a2d7101200bd4a4ebfae61033a',
|
|
51
|
+
minValue: 0,
|
|
52
|
+
newReporting: false,
|
|
53
|
+
numberOfPeriods: 3,
|
|
54
|
+
period: 'M',
|
|
55
|
+
registerOrientation: 'horizontal',
|
|
56
|
+
registerPosition: 'bottom',
|
|
57
|
+
scoreAlignment: 'start',
|
|
58
|
+
scoreLabel: 'none',
|
|
59
|
+
scoreSize: 'auto',
|
|
60
|
+
scoreType: 'latest',
|
|
61
|
+
showAbsolutePeriod: false,
|
|
62
|
+
showAdditionalGroupBySelector: false,
|
|
63
|
+
showAlternateColumnColors: false,
|
|
64
|
+
showAlternateRowColors: true,
|
|
65
|
+
showBorder: true,
|
|
66
|
+
showCacheTime: true,
|
|
67
|
+
showChange: false,
|
|
68
|
+
showChangeFrom: 'previous',
|
|
69
|
+
showChangePercentage: false,
|
|
70
|
+
showClosestSeriesOnHover: true,
|
|
71
|
+
showColumnAggregate: true,
|
|
72
|
+
showColumnDividers: true,
|
|
73
|
+
showComment: false,
|
|
74
|
+
showConfidenceBand: false,
|
|
75
|
+
showContinuousLine: true,
|
|
76
|
+
showDataLabels: false,
|
|
77
|
+
showDataPassthrough: false,
|
|
78
|
+
showDataTable: false,
|
|
79
|
+
showDateRangeByDefault: false,
|
|
80
|
+
showExportOptions: true,
|
|
81
|
+
showFilterAsSeparateSeries: false,
|
|
82
|
+
showFilterIcon: true,
|
|
83
|
+
showFirstGroupAggregate: false,
|
|
84
|
+
showForecast: false,
|
|
85
|
+
showForecastRange: false,
|
|
86
|
+
showGapPercentage: false,
|
|
87
|
+
showHeader: true,
|
|
88
|
+
showHeaderSeparator: false,
|
|
89
|
+
showLabelFirst: false,
|
|
90
|
+
showLegend: true,
|
|
91
|
+
showLegendValue: false,
|
|
92
|
+
showLoadingIndicator: false,
|
|
93
|
+
showMarkers: false,
|
|
94
|
+
showMaximumRange: false,
|
|
95
|
+
showMetricLabel: false,
|
|
96
|
+
showOverlappingLabels: false,
|
|
97
|
+
showPercentageOfTotalInTooltip: true,
|
|
98
|
+
showPivotExpanded: true,
|
|
99
|
+
showRangeLabels: false,
|
|
100
|
+
showRangeLimit: true,
|
|
101
|
+
showRefresh: true,
|
|
102
|
+
showRegister: true,
|
|
103
|
+
showRegisterOnSameLine: false,
|
|
104
|
+
showRegisterPercentage: false,
|
|
105
|
+
showRegisterValue: false,
|
|
106
|
+
showRowAggregate: true,
|
|
107
|
+
showRowDividers: false,
|
|
108
|
+
showScoreDate: false,
|
|
109
|
+
showScoreUpdateTime: false,
|
|
110
|
+
showSecondGroupAggregate: false,
|
|
111
|
+
showSparkline: false,
|
|
112
|
+
showStackedValues: 'none',
|
|
113
|
+
showSubAggregate: true,
|
|
114
|
+
showTarget: false,
|
|
115
|
+
showThreshold: false,
|
|
116
|
+
showTotalAggregate: false,
|
|
117
|
+
showTrend: false,
|
|
118
|
+
showXGrid: false,
|
|
119
|
+
showYGrid: true,
|
|
120
|
+
showZero: false,
|
|
121
|
+
sortByOrder: 'desc',
|
|
122
|
+
sparklineStyle: 'area',
|
|
123
|
+
truncateColumnHeader: true,
|
|
124
|
+
truncateFirstColumn: true,
|
|
125
|
+
truncationType: 'end',
|
|
126
|
+
useCurrentDateForEnd: false,
|
|
127
|
+
useDataCache: false,
|
|
128
|
+
useRelativeScoreTime: false,
|
|
129
|
+
valueLabelSize: 'md',
|
|
130
|
+
wrapColumnHeader: false,
|
|
131
|
+
wrapElements: false,
|
|
132
|
+
wrapTitle: false,
|
|
133
|
+
xAxisHidden: false,
|
|
134
|
+
xAxisMaxLabelSize: 100,
|
|
135
|
+
xAxisTruncationType: 'end',
|
|
136
|
+
xAxisWrapLabels: false,
|
|
137
|
+
yAxis0Position: 'left',
|
|
138
|
+
yAxis1Position: 'right',
|
|
139
|
+
yAxis2Position: 'right',
|
|
140
|
+
yAxis3Position: 'right',
|
|
141
|
+
yAxis4Position: 'right',
|
|
142
|
+
yAxisHidden: false,
|
|
143
|
+
yAxisPosition: 'bottom',
|
|
144
|
+
yAxisShowGrid: true,
|
|
145
|
+
yAxisStyle: 'clean',
|
|
146
|
+
colorConfig: {
|
|
147
|
+
type: 'default',
|
|
148
|
+
},
|
|
149
|
+
userInfo: '@context.session.user',
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const RESTRICTED_PROPERTIES = ['componentId', 'dataPassThrough', 'sharedContext', 'configVersion']
|
|
153
|
+
|
|
154
|
+
const DEFAULT_NUMBER_FORMAT = {
|
|
155
|
+
customFormat: false,
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Properties to omit from nested structures.
|
|
160
|
+
* Key = array property name, Value = array of property names to omit from items
|
|
161
|
+
*/
|
|
162
|
+
type OmitConfig = string[] | Record<string, string[]>
|
|
163
|
+
|
|
164
|
+
const OMIT_DEEP_PATHS: Record<string, OmitConfig> = {
|
|
165
|
+
dataSources: ['allowRealTime', 'isDatabaseView', 'preferredVisualizations', 'dataCategories'],
|
|
166
|
+
metrics: ['numberFormat'],
|
|
167
|
+
groupBy: {
|
|
168
|
+
groupBy: ['isRange', 'isChoice', 'isPaBucket'],
|
|
169
|
+
},
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Omits deep properties from an object
|
|
174
|
+
*/
|
|
175
|
+
function omitDeepProperties(obj: unknown): unknown {
|
|
176
|
+
if (!obj || typeof obj !== 'object') {
|
|
177
|
+
return obj
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (Array.isArray(obj)) {
|
|
181
|
+
return obj.map(omitDeepProperties)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const result: Record<string, unknown> = {}
|
|
185
|
+
|
|
186
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
187
|
+
const omitConfig = OMIT_DEEP_PATHS[key]
|
|
188
|
+
|
|
189
|
+
if (Array.isArray(value) && omitConfig) {
|
|
190
|
+
if (Array.isArray(omitConfig)) {
|
|
191
|
+
// Omit specified properties from each array item
|
|
192
|
+
result[key] = value.map((item) => {
|
|
193
|
+
if (!item || typeof item !== 'object') {
|
|
194
|
+
return item
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const filtered: Record<string, unknown> = {}
|
|
198
|
+
for (const [itemKey, itemValue] of Object.entries(item)) {
|
|
199
|
+
if (omitConfig.includes(itemKey)) {
|
|
200
|
+
// Special case: keep numberFormat if it's not default
|
|
201
|
+
if (itemKey === 'numberFormat' && key === 'metrics') {
|
|
202
|
+
if (itemValue && !isEqual(itemValue, DEFAULT_NUMBER_FORMAT)) {
|
|
203
|
+
filtered[itemKey] = omitDeepProperties(itemValue)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
continue
|
|
207
|
+
}
|
|
208
|
+
filtered[itemKey] = omitDeepProperties(itemValue)
|
|
209
|
+
}
|
|
210
|
+
return filtered
|
|
211
|
+
})
|
|
212
|
+
} else if (typeof omitConfig === 'object') {
|
|
213
|
+
// Handle nested config (e.g., groupBy.groupBy)
|
|
214
|
+
result[key] = value.map((item) => {
|
|
215
|
+
if (!item || typeof item !== 'object') {
|
|
216
|
+
return item
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const filtered: Record<string, unknown> = {}
|
|
220
|
+
for (const [itemKey, itemValue] of Object.entries(item)) {
|
|
221
|
+
const nestedConfig = omitConfig[itemKey]
|
|
222
|
+
|
|
223
|
+
if (Array.isArray(itemValue) && Array.isArray(nestedConfig)) {
|
|
224
|
+
// Process nested array
|
|
225
|
+
filtered[itemKey] = itemValue.map((nestedItem) => {
|
|
226
|
+
if (!nestedItem || typeof nestedItem !== 'object') {
|
|
227
|
+
return nestedItem
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const nestedFiltered: Record<string, unknown> = {}
|
|
231
|
+
for (const [nestedKey, nestedValue] of Object.entries(nestedItem)) {
|
|
232
|
+
if (!nestedConfig.includes(nestedKey)) {
|
|
233
|
+
nestedFiltered[nestedKey] = omitDeepProperties(nestedValue)
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return nestedFiltered
|
|
237
|
+
})
|
|
238
|
+
} else {
|
|
239
|
+
filtered[itemKey] = omitDeepProperties(itemValue)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return filtered
|
|
243
|
+
})
|
|
244
|
+
}
|
|
245
|
+
} else if (value && typeof value === 'object') {
|
|
246
|
+
const filtered = omitDeepProperties(value)
|
|
247
|
+
if (!isEmpty(filtered)) {
|
|
248
|
+
result[key] = filtered
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
result[key] = value
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return result
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Removes properties from an object that match their default values
|
|
260
|
+
*/
|
|
261
|
+
export function removeRestrictedValues(props: object): unknown {
|
|
262
|
+
if (!props) {
|
|
263
|
+
return props
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const filtered: Record<string, unknown> = {}
|
|
267
|
+
|
|
268
|
+
for (const [key, value] of Object.entries(props)) {
|
|
269
|
+
if (RESTRICTED_PROPERTIES.find((prop) => prop === key)) {
|
|
270
|
+
continue
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
filtered[key] = value
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return omitDeepProperties(filtered)
|
|
277
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping of human-readable component names (kebab-case) to their sys_ids
|
|
3
|
+
*/
|
|
4
|
+
const COMPONENT_NAME_TO_SYSID: Record<string, string> = {
|
|
5
|
+
area: 'aba8630dc2ccc9b3c1774af1b6820696',
|
|
6
|
+
boxplot: 'c5d01636ff2602109bd2ffffffffff0a',
|
|
7
|
+
bubble: '50dbc52a13c8b4691f7c60e0246bf28c',
|
|
8
|
+
'calendar-report': '259e0221ff18a75c5f5f0fb28fa5d32f',
|
|
9
|
+
column: '2bd5dc19a7ad083941b7c992a966dd78',
|
|
10
|
+
'compatibility-mode-widget': '0805a7bf91a93efbdf0a975b38b01051',
|
|
11
|
+
dial: '63f050cf050137731a828878839e0b33',
|
|
12
|
+
donut: 'a2b0596cec6b9d49dd1ff9bf76b5084b',
|
|
13
|
+
gauge: '037bd8ea3013833fd049186779528b70',
|
|
14
|
+
geomap: '9c8c44bd78fe5918950e0db8e286211d',
|
|
15
|
+
heading: '1f6e0643eca7a637e36bd7833549ec9e',
|
|
16
|
+
heatmap: 'd1f6c60ce95607ea1ef236430d5fdec9',
|
|
17
|
+
'horizontal-bar': '85855283b7e03010097cb81cde11a91d',
|
|
18
|
+
image: '15fe506403f8a98575b6df59008ea8f1',
|
|
19
|
+
'indicator-scorecard': '9d31ba4d773ce32ef350d4A555b673f6e',
|
|
20
|
+
line: '18ac962264404bcc0039359d184b15f3',
|
|
21
|
+
list: '7ff373544303121093711347efb8f23c',
|
|
22
|
+
pareto: '53e0a2b49e3ff92ba54ea7ea6f0d0583',
|
|
23
|
+
pie: '96abe7e38d8790718022c5630a92176c',
|
|
24
|
+
'pivot-table': '06f6aacbd1818110f877d87436272684',
|
|
25
|
+
'rich-text': '2d56f06d55f46bbd4e79b5e624beb940',
|
|
26
|
+
scatter: 'e3aade757ef3da131076d005cada40d5',
|
|
27
|
+
'semi-donut': '3809c6583b8dd540a0bf735ed493bae2',
|
|
28
|
+
'single-score': 'd24d53f60350de7a652caf3188a46ed2',
|
|
29
|
+
spline: '0f1e76928c4814e1430774fb864003f0',
|
|
30
|
+
step: '7fa5f7264941fabfb1542985da30e0b8',
|
|
31
|
+
'vertical-bar': '23051643b7e03010097cb81cde11a910',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Mapping of sys_ids to human-readable component names (kebab-case)
|
|
36
|
+
*/
|
|
37
|
+
const COMPONENT_SYSID_TO_NAME: Record<string, string> = Object.fromEntries(
|
|
38
|
+
Object.entries(COMPONENT_NAME_TO_SYSID).map(([name, sysid]) => [sysid, name])
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Resolves a component value to its sys_id.
|
|
43
|
+
* If the value is already a sys_id (32-char hex), returns it as-is.
|
|
44
|
+
* If the value is a component name (case-insensitive), returns the corresponding sys_id.
|
|
45
|
+
* Otherwise, returns the value unchanged.
|
|
46
|
+
*/
|
|
47
|
+
export function resolveComponentToSysId(component: string): string {
|
|
48
|
+
// If it's already a sys_id (32 hex chars), return as-is
|
|
49
|
+
if (/^[0-9a-f]{32}$/i.test(component)) {
|
|
50
|
+
return component
|
|
51
|
+
}
|
|
52
|
+
// Normalize to lowercase for case-insensitive lookup
|
|
53
|
+
const normalized = component.toLowerCase()
|
|
54
|
+
// If it's a known component name, resolve to sys_id
|
|
55
|
+
if (COMPONENT_NAME_TO_SYSID[normalized]) {
|
|
56
|
+
return COMPONENT_NAME_TO_SYSID[normalized]
|
|
57
|
+
}
|
|
58
|
+
// Otherwise return as-is (could be a custom component reference)
|
|
59
|
+
return component
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Resolves a sys_id to its human-readable component name (kebab-case).
|
|
64
|
+
* If the sys_id has a known name, returns the name.
|
|
65
|
+
* Otherwise, returns the sys_id unchanged.
|
|
66
|
+
*/
|
|
67
|
+
export function resolveComponentToName(sysid: string): string {
|
|
68
|
+
return COMPONENT_SYSID_TO_NAME[sysid] || sysid
|
|
69
|
+
}
|