@servicenow/sdk-build-plugins 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acl-plugin.js +11 -0
- package/dist/acl-plugin.js.map +1 -1
- package/dist/applicability-plugin.d.ts +2 -0
- package/dist/applicability-plugin.js +72 -0
- package/dist/applicability-plugin.js.map +1 -0
- package/dist/atf/test-plugin.js +5 -2
- package/dist/atf/test-plugin.js.map +1 -1
- package/dist/basic-syntax-plugin.js +7 -1
- package/dist/basic-syntax-plugin.js.map +1 -1
- package/dist/business-rule-plugin.js +1 -0
- package/dist/business-rule-plugin.js.map +1 -1
- package/dist/call-expression-plugin.js +1 -107
- package/dist/call-expression-plugin.js.map +1 -1
- package/dist/column/column-to-record.d.ts +10 -3
- package/dist/column/column-to-record.js +44 -7
- package/dist/column/column-to-record.js.map +1 -1
- package/dist/column-plugin.d.ts +3 -1
- package/dist/column-plugin.js +12 -12
- package/dist/column-plugin.js.map +1 -1
- package/dist/dashboard/dashboard-component-property-defaults.d.ts +152 -0
- package/dist/dashboard/dashboard-component-property-defaults.js +264 -0
- package/dist/dashboard/dashboard-component-property-defaults.js.map +1 -0
- package/dist/dashboard/dashboard-component-resolver.d.ts +13 -0
- package/dist/dashboard/dashboard-component-resolver.js +69 -0
- package/dist/dashboard/dashboard-component-resolver.js.map +1 -0
- package/dist/dashboard/dashboard-plugin.d.ts +12 -0
- package/dist/dashboard/dashboard-plugin.js +397 -0
- package/dist/dashboard/dashboard-plugin.js.map +1 -0
- package/dist/data-plugin.d.ts +3 -0
- package/dist/data-plugin.js +61 -113
- package/dist/data-plugin.js.map +1 -1
- package/dist/email-notification-plugin.d.ts +2 -0
- package/dist/email-notification-plugin.js +541 -0
- package/dist/email-notification-plugin.js.map +1 -0
- package/dist/flow/constants/flow-plugin-constants.d.ts +58 -0
- package/dist/flow/constants/flow-plugin-constants.js +70 -0
- package/dist/flow/constants/flow-plugin-constants.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-constants.d.ts +38 -0
- package/dist/flow/flow-logic/flow-logic-constants.js +118 -0
- package/dist/flow/flow-logic/flow-logic-constants.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-diagnostics.d.ts +19 -0
- package/dist/flow/flow-logic/flow-logic-diagnostics.js +503 -0
- package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.d.ts +62 -0
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.js +2092 -0
- package/dist/flow/flow-logic/flow-logic-plugin-helpers.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-plugin.d.ts +52 -0
- package/dist/flow/flow-logic/flow-logic-plugin.js +283 -0
- package/dist/flow/flow-logic/flow-logic-plugin.js.map +1 -0
- package/dist/flow/flow-logic/flow-logic-shapes.d.ts +104 -0
- package/dist/flow/flow-logic/flow-logic-shapes.js +201 -0
- package/dist/flow/flow-logic/flow-logic-shapes.js.map +1 -0
- package/dist/flow/plugins/approval-rules-plugin.d.ts +2 -0
- package/dist/flow/plugins/approval-rules-plugin.js +49 -0
- package/dist/flow/plugins/approval-rules-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-action-definition-plugin.d.ts +2 -0
- package/dist/flow/plugins/flow-action-definition-plugin.js +286 -0
- package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-data-pill-plugin.d.ts +9 -0
- package/dist/flow/plugins/flow-data-pill-plugin.js +212 -0
- package/dist/flow/plugins/flow-data-pill-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-definition-plugin.d.ts +2 -0
- package/dist/flow/plugins/flow-definition-plugin.js +1668 -0
- package/dist/flow/plugins/flow-definition-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-diagnostics-plugin.d.ts +26 -0
- package/dist/flow/plugins/flow-diagnostics-plugin.js +217 -0
- package/dist/flow/plugins/flow-diagnostics-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-instance-plugin.d.ts +12 -0
- package/dist/flow/plugins/flow-instance-plugin.js +1205 -0
- package/dist/flow/plugins/flow-instance-plugin.js.map +1 -0
- package/dist/flow/plugins/flow-trigger-instance-plugin.d.ts +2 -0
- package/dist/flow/plugins/flow-trigger-instance-plugin.js +338 -0
- package/dist/flow/plugins/flow-trigger-instance-plugin.js.map +1 -0
- package/dist/flow/plugins/inline-script-plugin.d.ts +39 -0
- package/dist/flow/plugins/inline-script-plugin.js +80 -0
- package/dist/flow/plugins/inline-script-plugin.js.map +1 -0
- package/dist/flow/plugins/step-definition-plugin.d.ts +5 -0
- package/dist/flow/plugins/step-definition-plugin.js +71 -0
- package/dist/flow/plugins/step-definition-plugin.js.map +1 -0
- package/dist/flow/plugins/step-instance-plugin.d.ts +31 -0
- package/dist/flow/plugins/step-instance-plugin.js +339 -0
- package/dist/flow/plugins/step-instance-plugin.js.map +1 -0
- package/dist/flow/plugins/trigger-plugin.d.ts +2 -0
- package/dist/flow/plugins/trigger-plugin.js +96 -0
- package/dist/flow/plugins/trigger-plugin.js.map +1 -0
- package/dist/flow/plugins/wfa-datapill-plugin.d.ts +15 -0
- package/dist/flow/plugins/wfa-datapill-plugin.js +178 -0
- package/dist/flow/plugins/wfa-datapill-plugin.js.map +1 -0
- package/dist/flow/utils/approval-rules-processor.d.ts +13 -0
- package/dist/flow/utils/approval-rules-processor.js +267 -0
- package/dist/flow/utils/approval-rules-processor.js.map +1 -0
- package/dist/flow/utils/built-in-complex-objects.d.ts +19 -0
- package/dist/flow/utils/built-in-complex-objects.js +62 -0
- package/dist/flow/utils/built-in-complex-objects.js.map +1 -0
- package/dist/flow/utils/complex-object-resolver.d.ts +8 -0
- package/dist/flow/utils/complex-object-resolver.js +614 -0
- package/dist/flow/utils/complex-object-resolver.js.map +1 -0
- package/dist/flow/utils/complex-objects.d.ts +36 -0
- package/dist/flow/utils/complex-objects.js +481 -0
- package/dist/flow/utils/complex-objects.js.map +1 -0
- package/dist/flow/utils/data-pill-shapes.d.ts +58 -0
- package/dist/flow/utils/data-pill-shapes.js +135 -0
- package/dist/flow/utils/data-pill-shapes.js.map +1 -0
- package/dist/flow/utils/datapill-transformer.d.ts +110 -0
- package/dist/flow/utils/datapill-transformer.js +503 -0
- package/dist/flow/utils/datapill-transformer.js.map +1 -0
- package/dist/flow/utils/flow-constants.d.ts +72 -0
- package/dist/flow/utils/flow-constants.js +230 -0
- package/dist/flow/utils/flow-constants.js.map +1 -0
- package/dist/flow/utils/flow-io-to-record.d.ts +44 -0
- package/dist/flow/utils/flow-io-to-record.js +409 -0
- package/dist/flow/utils/flow-io-to-record.js.map +1 -0
- package/dist/flow/utils/flow-shapes.d.ts +161 -0
- package/dist/flow/utils/flow-shapes.js +255 -0
- package/dist/flow/utils/flow-shapes.js.map +1 -0
- package/dist/flow/utils/flow-to-xml.d.ts +16 -0
- package/dist/flow/utils/flow-to-xml.js +237 -0
- package/dist/flow/utils/flow-to-xml.js.map +1 -0
- package/dist/flow/utils/flow-variable-processor.d.ts +51 -0
- package/dist/flow/utils/flow-variable-processor.js +69 -0
- package/dist/flow/utils/flow-variable-processor.js.map +1 -0
- package/dist/flow/utils/label-cache-parser.d.ts +7 -0
- package/dist/flow/utils/label-cache-parser.js +24 -0
- package/dist/flow/utils/label-cache-parser.js.map +1 -0
- package/dist/flow/utils/label-cache-processor.d.ts +119 -0
- package/dist/flow/utils/label-cache-processor.js +719 -0
- package/dist/flow/utils/label-cache-processor.js.map +1 -0
- package/dist/flow/utils/pill-string-parser.d.ts +88 -0
- package/dist/flow/utils/pill-string-parser.js +306 -0
- package/dist/flow/utils/pill-string-parser.js.map +1 -0
- package/dist/flow/utils/schema-to-flow-object.d.ts +22 -0
- package/dist/flow/utils/schema-to-flow-object.js +318 -0
- package/dist/flow/utils/schema-to-flow-object.js.map +1 -0
- package/dist/flow/utils/service-catalog.d.ts +47 -0
- package/dist/flow/utils/service-catalog.js +137 -0
- package/dist/flow/utils/service-catalog.js.map +1 -0
- package/dist/flow/utils/utils.d.ts +117 -0
- package/dist/flow/utils/utils.js +345 -0
- package/dist/flow/utils/utils.js.map +1 -0
- package/dist/index.d.ts +20 -1
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/dist/list-plugin.js +1 -1
- package/dist/list-plugin.js.map +1 -1
- package/dist/now-attach-plugin.d.ts +1 -0
- package/dist/now-attach-plugin.js +10 -10
- package/dist/now-attach-plugin.js.map +1 -1
- package/dist/now-ref-plugin.js +1 -1
- package/dist/now-ref-plugin.js.map +1 -1
- package/dist/record-plugin.d.ts +29 -0
- package/dist/record-plugin.js +66 -7
- package/dist/record-plugin.js.map +1 -1
- package/dist/repack/index.d.ts +2 -0
- package/dist/repack/index.js +8 -0
- package/dist/repack/index.js.map +1 -1
- package/dist/rest-api-plugin.js +54 -44
- package/dist/rest-api-plugin.js.map +1 -1
- package/dist/server-module-plugin/index.d.ts +10 -0
- package/dist/server-module-plugin/index.js +83 -59
- package/dist/server-module-plugin/index.js.map +1 -1
- package/dist/service-catalog/catalog-clientscript-plugin.d.ts +2 -0
- package/dist/service-catalog/catalog-clientscript-plugin.js +117 -0
- package/dist/service-catalog/catalog-clientscript-plugin.js.map +1 -0
- package/dist/service-catalog/catalog-item-plugin.d.ts +2 -0
- package/dist/service-catalog/catalog-item-plugin.js +115 -0
- package/dist/service-catalog/catalog-item-plugin.js.map +1 -0
- package/dist/service-catalog/catalog-ui-policy-plugin.d.ts +2 -0
- package/dist/service-catalog/catalog-ui-policy-plugin.js +266 -0
- package/dist/service-catalog/catalog-ui-policy-plugin.js.map +1 -0
- package/dist/service-catalog/index.d.ts +5 -0
- package/dist/service-catalog/index.js +22 -0
- package/dist/service-catalog/index.js.map +1 -0
- package/dist/service-catalog/record-to-shape.d.ts +6 -0
- package/dist/service-catalog/record-to-shape.js +93 -0
- package/dist/service-catalog/record-to-shape.js.map +1 -0
- package/dist/service-catalog/sc-record-producer-plugin.d.ts +2 -0
- package/dist/service-catalog/sc-record-producer-plugin.js +140 -0
- package/dist/service-catalog/sc-record-producer-plugin.js.map +1 -0
- package/dist/service-catalog/service-catalog-base.d.ts +311 -0
- package/dist/service-catalog/service-catalog-base.js +542 -0
- package/dist/service-catalog/service-catalog-base.js.map +1 -0
- package/dist/service-catalog/service-catalog-diagnostics.d.ts +45 -0
- package/dist/service-catalog/service-catalog-diagnostics.js +172 -0
- package/dist/service-catalog/service-catalog-diagnostics.js.map +1 -0
- package/dist/service-catalog/shape-to-record.d.ts +8 -0
- package/dist/service-catalog/shape-to-record.js +235 -0
- package/dist/service-catalog/shape-to-record.js.map +1 -0
- package/dist/service-catalog/utils.d.ts +323 -0
- package/dist/service-catalog/utils.js +1216 -0
- package/dist/service-catalog/utils.js.map +1 -0
- package/dist/service-catalog/variable-helper.d.ts +43 -0
- package/dist/service-catalog/variable-helper.js +92 -0
- package/dist/service-catalog/variable-helper.js.map +1 -0
- package/dist/service-catalog/variable-set-plugin.d.ts +2 -0
- package/dist/service-catalog/variable-set-plugin.js +175 -0
- package/dist/service-catalog/variable-set-plugin.js.map +1 -0
- package/dist/service-catalog/variables-transform.d.ts +139 -0
- package/dist/service-catalog/variables-transform.js +403 -0
- package/dist/service-catalog/variables-transform.js.map +1 -0
- package/dist/sla/sla-validators.d.ts +61 -0
- package/dist/sla/sla-validators.js +224 -0
- package/dist/sla/sla-validators.js.map +1 -0
- package/dist/sla-plugin.d.ts +5 -0
- package/dist/sla-plugin.js +280 -0
- package/dist/sla-plugin.js.map +1 -0
- package/dist/static-content-plugin.js +25 -2
- package/dist/static-content-plugin.js.map +1 -1
- package/dist/table-plugin.js +32 -15
- package/dist/table-plugin.js.map +1 -1
- package/dist/ui-page-plugin.js +832 -19
- package/dist/ui-page-plugin.js.map +1 -1
- package/dist/ui-policy-plugin.js +5 -7
- package/dist/ui-policy-plugin.js.map +1 -1
- package/dist/utils.d.ts +10 -1
- package/dist/utils.js +16 -0
- package/dist/utils.js.map +1 -1
- package/dist/ux-list-menu-config-plugin.d.ts +2 -0
- package/dist/ux-list-menu-config-plugin.js +292 -0
- package/dist/ux-list-menu-config-plugin.js.map +1 -0
- package/dist/workspace-plugin/chrome-tab.d.ts +2 -0
- package/dist/workspace-plugin/chrome-tab.js +46 -0
- package/dist/workspace-plugin/chrome-tab.js.map +1 -0
- package/dist/workspace-plugin/constants.d.ts +52 -0
- package/dist/workspace-plugin/constants.js +56 -0
- package/dist/workspace-plugin/constants.js.map +1 -0
- package/dist/workspace-plugin/fluent-utils.d.ts +9 -0
- package/dist/workspace-plugin/fluent-utils.js +60 -0
- package/dist/workspace-plugin/fluent-utils.js.map +1 -0
- package/dist/workspace-plugin/page.d.ts +8 -0
- package/dist/workspace-plugin/page.js +108 -0
- package/dist/workspace-plugin/page.js.map +1 -0
- package/dist/workspace-plugin/screen.d.ts +1 -0
- package/dist/workspace-plugin/screen.js +38 -0
- package/dist/workspace-plugin/screen.js.map +1 -0
- package/dist/workspace-plugin/templates/index.d.ts +10 -0
- package/dist/workspace-plugin/templates/index.js +20 -0
- package/dist/workspace-plugin/templates/index.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-composition.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-composition.js +4043 -0
- package/dist/workspace-plugin/templates/record-page-composition.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-data.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-data.js +527 -0
- package/dist/workspace-plugin/templates/record-page-data.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-interalEventMappings.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-interalEventMappings.js +39 -0
- package/dist/workspace-plugin/templates/record-page-interalEventMappings.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-layoutModel.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-layoutModel.js +55 -0
- package/dist/workspace-plugin/templates/record-page-layoutModel.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page-properties.d.ts +1 -0
- package/dist/workspace-plugin/templates/record-page-properties.js +135 -0
- package/dist/workspace-plugin/templates/record-page-properties.js.map +1 -0
- package/dist/workspace-plugin/templates/record-page.d.ts +3 -0
- package/dist/workspace-plugin/templates/record-page.js +8 -0
- package/dist/workspace-plugin/templates/record-page.js.map +1 -0
- package/dist/workspace-plugin.d.ts +2 -0
- package/dist/workspace-plugin.js +453 -0
- package/dist/workspace-plugin.js.map +1 -0
- package/package.json +10 -12
- package/src/acl-plugin.ts +16 -1
- package/src/applicability-plugin.ts +82 -0
- package/src/atf/test-plugin.ts +6 -3
- package/src/basic-syntax-plugin.ts +10 -1
- package/src/business-rule-plugin.ts +2 -1
- package/src/call-expression-plugin.ts +2 -130
- package/src/column/column-to-record.ts +54 -8
- package/src/column-plugin.ts +29 -13
- package/src/dashboard/dashboard-component-property-defaults.ts +277 -0
- package/src/dashboard/dashboard-component-resolver.ts +69 -0
- package/src/dashboard/dashboard-plugin.ts +450 -0
- package/src/data-plugin.ts +67 -139
- package/src/email-notification-plugin.ts +850 -0
- package/src/flow/constants/flow-plugin-constants.ts +79 -0
- package/src/flow/flow-logic/flow-logic-constants.ts +120 -0
- package/src/flow/flow-logic/flow-logic-diagnostics.ts +591 -0
- package/src/flow/flow-logic/flow-logic-plugin-helpers.ts +2550 -0
- package/src/flow/flow-logic/flow-logic-plugin.ts +337 -0
- package/src/flow/flow-logic/flow-logic-shapes.ts +215 -0
- package/src/flow/plugins/approval-rules-plugin.ts +48 -0
- package/src/flow/plugins/flow-action-definition-plugin.ts +295 -0
- package/src/flow/plugins/flow-data-pill-plugin.ts +258 -0
- package/src/flow/plugins/flow-definition-plugin.ts +2173 -0
- package/src/flow/plugins/flow-diagnostics-plugin.ts +280 -0
- package/src/flow/plugins/flow-instance-plugin.ts +1499 -0
- package/src/flow/plugins/flow-trigger-instance-plugin.ts +444 -0
- package/src/flow/plugins/inline-script-plugin.ts +83 -0
- package/src/flow/plugins/step-definition-plugin.ts +67 -0
- package/src/flow/plugins/step-instance-plugin.ts +431 -0
- package/src/flow/plugins/trigger-plugin.ts +95 -0
- package/src/flow/plugins/wfa-datapill-plugin.ts +213 -0
- package/src/flow/utils/approval-rules-processor.ts +298 -0
- package/src/flow/utils/built-in-complex-objects.ts +81 -0
- package/src/flow/utils/complex-object-resolver.ts +875 -0
- package/src/flow/utils/complex-objects.ts +656 -0
- package/src/flow/utils/data-pill-shapes.ts +165 -0
- package/src/flow/utils/datapill-transformer.ts +632 -0
- package/src/flow/utils/flow-constants.ts +285 -0
- package/src/flow/utils/flow-io-to-record.ts +533 -0
- package/src/flow/utils/flow-shapes.ts +296 -0
- package/src/flow/utils/flow-to-xml.ts +318 -0
- package/src/flow/utils/flow-variable-processor.ts +100 -0
- package/src/flow/utils/label-cache-parser.ts +37 -0
- package/src/flow/utils/label-cache-processor.ts +870 -0
- package/src/flow/utils/pill-string-parser.ts +375 -0
- package/src/flow/utils/schema-to-flow-object.ts +385 -0
- package/src/flow/utils/service-catalog.ts +174 -0
- package/src/flow/utils/utils.ts +395 -0
- package/src/index.ts +20 -1
- package/src/list-plugin.ts +1 -1
- package/src/now-attach-plugin.ts +14 -11
- package/src/now-ref-plugin.ts +1 -1
- package/src/record-plugin.ts +76 -11
- package/src/repack/index.ts +14 -0
- package/src/rest-api-plugin.ts +62 -50
- package/src/server-module-plugin/index.ts +112 -86
- package/src/service-catalog/catalog-clientscript-plugin.ts +140 -0
- package/src/service-catalog/catalog-item-plugin.ts +162 -0
- package/src/service-catalog/catalog-ui-policy-plugin.ts +324 -0
- package/src/service-catalog/index.ts +5 -0
- package/src/service-catalog/record-to-shape.ts +109 -0
- package/src/service-catalog/sc-record-producer-plugin.ts +201 -0
- package/src/service-catalog/service-catalog-base.ts +600 -0
- package/src/service-catalog/service-catalog-diagnostics.ts +254 -0
- package/src/service-catalog/shape-to-record.ts +279 -0
- package/src/service-catalog/utils.ts +1455 -0
- package/src/service-catalog/variable-helper.ts +135 -0
- package/src/service-catalog/variable-set-plugin.ts +197 -0
- package/src/service-catalog/variables-transform.ts +438 -0
- package/src/sla/sla-validators.ts +331 -0
- package/src/sla-plugin.ts +358 -0
- package/src/static-content-plugin.ts +25 -2
- package/src/table-plugin.ts +49 -16
- package/src/ui-page-plugin.ts +1063 -20
- package/src/ui-policy-plugin.ts +5 -9
- package/src/utils.ts +24 -1
- package/src/ux-list-menu-config-plugin.ts +312 -0
- package/src/workspace-plugin/chrome-tab.ts +44 -0
- package/src/workspace-plugin/constants.ts +53 -0
- package/src/workspace-plugin/fluent-utils.ts +60 -0
- package/src/workspace-plugin/page.ts +139 -0
- package/src/workspace-plugin/screen.ts +34 -0
- package/src/workspace-plugin/templates/index.ts +17 -0
- package/src/workspace-plugin/templates/record-page-composition.ts +4051 -0
- package/src/workspace-plugin/templates/record-page-data.ts +523 -0
- package/src/workspace-plugin/templates/record-page-interalEventMappings.ts +35 -0
- package/src/workspace-plugin/templates/record-page-layoutModel.ts +51 -0
- package/src/workspace-plugin/templates/record-page-properties.ts +131 -0
- package/src/workspace-plugin/templates/record-page.ts +6 -0
- package/src/workspace-plugin.ts +574 -0
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Plugin,
|
|
3
|
+
CallExpressionShape,
|
|
4
|
+
type Factory,
|
|
5
|
+
type Record,
|
|
6
|
+
type Shape,
|
|
7
|
+
type ObjectShape,
|
|
8
|
+
} from '@servicenow/sdk-build-core'
|
|
9
|
+
import { NowIdShape } from './now-id-plugin'
|
|
10
|
+
import { parsePagePropChromeTabJson, createChromeTabJsonStringForPageProp } from './workspace-plugin/chrome-tab'
|
|
11
|
+
import { createPage } from './workspace-plugin/page'
|
|
12
|
+
import {
|
|
13
|
+
getExplicitIdGenerator,
|
|
14
|
+
buildRecordKey,
|
|
15
|
+
doesActualRecordMatchGeneratedRecord,
|
|
16
|
+
serializeActualRecordAsOverrideToTheDefault,
|
|
17
|
+
} from './workspace-plugin/fluent-utils'
|
|
18
|
+
|
|
19
|
+
const PAGE_PROP_NAME = {
|
|
20
|
+
CHROME_TAB: 'chrome_tab',
|
|
21
|
+
CHROME_TOOLBAR: 'chrome_toolbar',
|
|
22
|
+
LISTCONFIGID: 'listConfigId',
|
|
23
|
+
VIEW: 'view',
|
|
24
|
+
WAPPLICABILITYCONFIGID: 'wbApplicabilityConfigId',
|
|
25
|
+
CHROME_HEADER: 'chrome_header',
|
|
26
|
+
CHROME_FOOTER: 'chrome_footer',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const EXPERIENCE_CATEGORIES = {
|
|
30
|
+
WORKSPACE: 'afb4e3e173322010f0ca1e666bf6a726',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const DEFAULT_LANDING_PATH = 'home'
|
|
34
|
+
const DEFAULT_LISTCONFIGID = 'd305c0a873601010a0a79329faf6a7cb'
|
|
35
|
+
|
|
36
|
+
type RecordKeyToRecord = { [recordKey: string]: Record }
|
|
37
|
+
type DefaultRecordOverrides = { [recordKey: string]: { [fieldName: string]: string } }
|
|
38
|
+
|
|
39
|
+
// This "other" Transform class is not exported, need to grab it like this.
|
|
40
|
+
type InnerTransformFromObjectShape = Parameters<Parameters<ObjectShape['transform']>[0]>[0]['$']
|
|
41
|
+
|
|
42
|
+
export const WorkspacePlugin = Plugin.create({
|
|
43
|
+
name: 'WorkspacePlugin',
|
|
44
|
+
records: {
|
|
45
|
+
sys_ux_page_registry: {
|
|
46
|
+
relationships: {
|
|
47
|
+
sys_ux_registry_m2m_category: {
|
|
48
|
+
via: (parent, child) =>
|
|
49
|
+
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
50
|
+
parent.getId().getValue() ===
|
|
51
|
+
(child.get('page_registry').isRecord()
|
|
52
|
+
? child.get('page_registry').asRecord().getId().getValue()
|
|
53
|
+
: child.get('page_registry').asString().getValue()),
|
|
54
|
+
descendant: true,
|
|
55
|
+
},
|
|
56
|
+
sys_ux_page_property: {
|
|
57
|
+
via: (parent, child) =>
|
|
58
|
+
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
59
|
+
parent.getId().getValue() ===
|
|
60
|
+
(child.get('page').isRecord()
|
|
61
|
+
? child.get('page').asRecord().getId().getValue()
|
|
62
|
+
: child.get('page').asString().getValue()),
|
|
63
|
+
descendant: true,
|
|
64
|
+
},
|
|
65
|
+
sys_ux_app_config: {
|
|
66
|
+
via: (parent, child) =>
|
|
67
|
+
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
68
|
+
child.getId().getValue() ===
|
|
69
|
+
(parent.get('admin_panel').isRecord()
|
|
70
|
+
? parent.get('admin_panel').asRecord().getId().getValue()
|
|
71
|
+
: parent.get('admin_panel').asString().getValue()),
|
|
72
|
+
descendant: true,
|
|
73
|
+
relationships: {
|
|
74
|
+
sys_ux_screen: {
|
|
75
|
+
via: (parent, child) =>
|
|
76
|
+
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
77
|
+
parent.getId().getValue() ===
|
|
78
|
+
(child.get('app_config').isRecord()
|
|
79
|
+
? child.get('app_config').asRecord().getId().getValue()
|
|
80
|
+
: child.get('app_config').asString().getValue()),
|
|
81
|
+
descendant: true,
|
|
82
|
+
relationships: {
|
|
83
|
+
sys_ux_macroponent: {
|
|
84
|
+
via: (parent, child) =>
|
|
85
|
+
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
86
|
+
child.getId().getValue() ===
|
|
87
|
+
(parent.get('macroponent').isRecord()
|
|
88
|
+
? parent.get('macroponent').asRecord().getId().getValue()
|
|
89
|
+
: parent.get('macroponent').asString().getValue()),
|
|
90
|
+
descendant: true,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
sys_ux_app_route: {
|
|
95
|
+
via: (parent, child) =>
|
|
96
|
+
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
97
|
+
parent.getId().getValue() ===
|
|
98
|
+
(child.get('app_config').isRecord()
|
|
99
|
+
? child.get('app_config').asRecord().getId().getValue()
|
|
100
|
+
: child.get('app_config').asString().getValue()),
|
|
101
|
+
descendant: true,
|
|
102
|
+
relationships: {
|
|
103
|
+
sys_ux_screen_type: {
|
|
104
|
+
via: (parent, child) =>
|
|
105
|
+
child.getCreator()?.getName() === 'WorkspacePlugin' &&
|
|
106
|
+
child.getId().getValue() ===
|
|
107
|
+
(parent.get('screen_type').isRecord()
|
|
108
|
+
? parent.get('screen_type').asRecord().getId().getValue()
|
|
109
|
+
: parent.get('screen_type').asString().getValue()),
|
|
110
|
+
descendant: true,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
async toShape(pageRegRecord, { factory, descendants }) {
|
|
118
|
+
if (pageRegRecord.getCreator()?.getName() !== 'WorkspacePlugin') {
|
|
119
|
+
return { success: false }
|
|
120
|
+
}
|
|
121
|
+
// Get 'path' and 'title'
|
|
122
|
+
// TODO 'active'
|
|
123
|
+
const path: string = pageRegRecord.get('path').asString().getValue() ?? ''
|
|
124
|
+
const title: string = pageRegRecord.get('title').asString().getValue() ?? ''
|
|
125
|
+
const active: boolean = pageRegRecord.get('active').toBoolean().getValue() ?? false
|
|
126
|
+
|
|
127
|
+
// get 'landingPath'
|
|
128
|
+
const appConfigRecords = descendants.query('sys_ux_app_config')
|
|
129
|
+
const appConfigRecord = appConfigRecords[0]
|
|
130
|
+
if (!appConfigRecord || appConfigRecords.length !== 1) {
|
|
131
|
+
return { success: false }
|
|
132
|
+
}
|
|
133
|
+
const landingPath: string = appConfigRecord.get('landing_path').asString().getValue() ?? ''
|
|
134
|
+
|
|
135
|
+
// Get 'tables'
|
|
136
|
+
let tables: string[] = []
|
|
137
|
+
const pageProps = descendants.query('sys_ux_page_property')
|
|
138
|
+
const chromeTabPageProp = pageProps.find(
|
|
139
|
+
(prop) => prop.get('name').asString().getValue() === PAGE_PROP_NAME.CHROME_TAB
|
|
140
|
+
)
|
|
141
|
+
if (chromeTabPageProp) {
|
|
142
|
+
const chromeTab = chromeTabPageProp.get('value').asString().getValue()
|
|
143
|
+
tables = parsePagePropChromeTabJson(chromeTab)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Get 'listConfig' reference
|
|
147
|
+
let listConfigRef: string | Shape<unknown> = ''
|
|
148
|
+
const listConfigIdProp = pageProps.find(
|
|
149
|
+
(prop) => prop.get('name').asString().getValue() === PAGE_PROP_NAME.LISTCONFIGID
|
|
150
|
+
)
|
|
151
|
+
if (listConfigIdProp) {
|
|
152
|
+
const listConfig = listConfigIdProp.get('value')
|
|
153
|
+
listConfigRef = listConfig.isString()
|
|
154
|
+
? await factory.createReference({
|
|
155
|
+
source: pageRegRecord,
|
|
156
|
+
table: 'sys_ux_list_menu_config',
|
|
157
|
+
guid: listConfig,
|
|
158
|
+
})
|
|
159
|
+
: listConfig
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
let callExpressionShape = createWorkspaceCallExpression({
|
|
163
|
+
pageRegRecord,
|
|
164
|
+
title,
|
|
165
|
+
active,
|
|
166
|
+
landingPath,
|
|
167
|
+
path,
|
|
168
|
+
tables,
|
|
169
|
+
listConfigRef,
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
/*
|
|
173
|
+
* Collecting all the input props for the call expression is now complete (above).
|
|
174
|
+
*
|
|
175
|
+
* Now, we need to generate a snapshot of all the records it would have produced,
|
|
176
|
+
* so that we can start the reconcile process of determining if any of our workspace
|
|
177
|
+
* records have been tampered/edited by the user outside of the capabilities
|
|
178
|
+
* of the workspace plugin. generateAllImplicitRecordsFromCallExpression() is the same
|
|
179
|
+
* exact function that is used during toRecord().
|
|
180
|
+
*
|
|
181
|
+
* This snapshot will be used to compare against ACTUAL records
|
|
182
|
+
* in the database and determine which records we need to start data-dumping
|
|
183
|
+
* into the defaultRecordOverrides field of the workspace plugin.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
const generatedRecords = await generateAllImplicitRecordsFromCallExpression({
|
|
187
|
+
callExpressionShape,
|
|
188
|
+
factory,
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
const queried: { [table: string]: Record[] } = {}
|
|
192
|
+
const defaultRecordOverrides: DefaultRecordOverrides = {}
|
|
193
|
+
|
|
194
|
+
Object.entries(generatedRecords).forEach(([recordKey, generatedRecord]) => {
|
|
195
|
+
const gRecordTable = generatedRecord.getTable()
|
|
196
|
+
const gRecordSysId = generatedRecord.getId().getValue()
|
|
197
|
+
if (!queried[gRecordTable]) {
|
|
198
|
+
queried[gRecordTable] = descendants.query(gRecordTable)
|
|
199
|
+
}
|
|
200
|
+
const actualRecord = queried[gRecordTable].find((r) => r.getId().getValue() === gRecordSysId)
|
|
201
|
+
if (actualRecord) {
|
|
202
|
+
const isActualRecordTamperFree = doesActualRecordMatchGeneratedRecord(
|
|
203
|
+
actualRecord,
|
|
204
|
+
generatedRecord
|
|
205
|
+
)
|
|
206
|
+
if (!isActualRecordTamperFree) {
|
|
207
|
+
const serializedActualRecordValue = serializeActualRecordAsOverrideToTheDefault(
|
|
208
|
+
actualRecord,
|
|
209
|
+
generatedRecord
|
|
210
|
+
)
|
|
211
|
+
defaultRecordOverrides[recordKey] = serializedActualRecordValue
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
callExpressionShape = createWorkspaceCallExpression({
|
|
217
|
+
pageRegRecord,
|
|
218
|
+
title,
|
|
219
|
+
active,
|
|
220
|
+
path,
|
|
221
|
+
landingPath,
|
|
222
|
+
tables,
|
|
223
|
+
listConfigRef,
|
|
224
|
+
defaultRecordOverrides,
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
return {
|
|
228
|
+
success: true,
|
|
229
|
+
value: callExpressionShape,
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
shapes: [
|
|
235
|
+
{
|
|
236
|
+
shape: CallExpressionShape,
|
|
237
|
+
fileTypes: ['fluent'],
|
|
238
|
+
async toRecord(source, { factory }) {
|
|
239
|
+
if (source.getCallee() !== 'Workspace') {
|
|
240
|
+
return { success: false }
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const arg = source.getArgument(0).asObject()
|
|
244
|
+
|
|
245
|
+
// Generate all the implicit records for a workspace based on the call expression
|
|
246
|
+
const generatedRecords = await generateAllImplicitRecordsFromCallExpression({
|
|
247
|
+
callExpressionShape: source,
|
|
248
|
+
factory,
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
// Get the defaultRecordOverrides from the call expression arguments, to see if we need
|
|
252
|
+
// to override any of the generated records. This could happen if the user modified
|
|
253
|
+
// the records from the platform side in a way that is unsupported by this plugin.
|
|
254
|
+
const defaultRecordOverrides = (arg.get('defaultRecordOverrides').getValue() ??
|
|
255
|
+
{}) as DefaultRecordOverrides
|
|
256
|
+
|
|
257
|
+
// Loop through the records, patching in any overrides as needed
|
|
258
|
+
const patchedRecords = await Promise.all(
|
|
259
|
+
Object.entries(generatedRecords).map(async ([recordKey, generatedRecord]) => {
|
|
260
|
+
const overridingRecord = defaultRecordOverrides[recordKey]
|
|
261
|
+
if (!overridingRecord) {
|
|
262
|
+
return generatedRecord
|
|
263
|
+
}
|
|
264
|
+
return await factory.createRecord({
|
|
265
|
+
source: source,
|
|
266
|
+
table: generatedRecord.getTable(),
|
|
267
|
+
explicitId: generatedRecord.getId(),
|
|
268
|
+
properties: arg.transform(({ $ }) => {
|
|
269
|
+
return generatedRecord
|
|
270
|
+
.keys()
|
|
271
|
+
.reduce<{ [key: string]: InnerTransformFromObjectShape }>((acc, fieldName) => {
|
|
272
|
+
acc[fieldName] = $.val(overridingRecord[fieldName])
|
|
273
|
+
return acc
|
|
274
|
+
}, {})
|
|
275
|
+
}),
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
const records = patchedRecords
|
|
281
|
+
const pageRegRecord = records[0]
|
|
282
|
+
const restRecords = records.slice(1)
|
|
283
|
+
if (!pageRegRecord) {
|
|
284
|
+
return { success: false, error: 'No records generated, very unexpected' }
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
success: true,
|
|
288
|
+
// Silly thing we have to do because the plugin system expects a single record
|
|
289
|
+
value: pageRegRecord.with(...restRecords),
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
const generateAllImplicitRecordsFromCallExpression = async ({
|
|
297
|
+
callExpressionShape,
|
|
298
|
+
factory,
|
|
299
|
+
}: {
|
|
300
|
+
callExpressionShape: CallExpressionShape
|
|
301
|
+
factory: Factory
|
|
302
|
+
}): Promise<RecordKeyToRecord> => {
|
|
303
|
+
const arg = callExpressionShape.getArgument(0).asObject()
|
|
304
|
+
const explicitIdGenerator = getExplicitIdGenerator(callExpressionShape, arg.get('$id').getValue() as string)
|
|
305
|
+
|
|
306
|
+
const appConfig = await factory.createRecord({
|
|
307
|
+
source: callExpressionShape,
|
|
308
|
+
table: 'sys_ux_app_config',
|
|
309
|
+
explicitId: explicitIdGenerator('sys_ux_app_config', 'workspace'),
|
|
310
|
+
properties: arg.transform(({ $ }) => ({
|
|
311
|
+
name: $.from('title'),
|
|
312
|
+
landing_path: $.from('landingPath').def(DEFAULT_LANDING_PATH),
|
|
313
|
+
active: $.val(true),
|
|
314
|
+
description: $.val('Workspace created by Fluent'),
|
|
315
|
+
custom_icon: $.val(''),
|
|
316
|
+
icon: $.val(''),
|
|
317
|
+
disable_auto_reflow: $.val(false),
|
|
318
|
+
encode_query_string: $.val(false),
|
|
319
|
+
})),
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
const pageRegistry = await factory.createRecord({
|
|
323
|
+
source: callExpressionShape,
|
|
324
|
+
table: 'sys_ux_page_registry',
|
|
325
|
+
explicitId: arg.get('$id'),
|
|
326
|
+
properties: arg.transform(({ $ }) => ({
|
|
327
|
+
admin_panel: $.val(appConfig), // how to reference another record
|
|
328
|
+
admin_panel_table: $.val('sys_ux_app_config'),
|
|
329
|
+
root_macroponent: $.val('c276387cc331101080d6d3658940ddd2'),
|
|
330
|
+
parent_app: $.val('c86a62e2c7022010099a308dc7c26022'),
|
|
331
|
+
title: $,
|
|
332
|
+
path: $,
|
|
333
|
+
active: $.toBoolean().def(true),
|
|
334
|
+
page: $.val(''),
|
|
335
|
+
auth_routes: $.val(''),
|
|
336
|
+
})),
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
const unifiedNav = await factory.createRecord({
|
|
340
|
+
source: callExpressionShape,
|
|
341
|
+
table: 'sys_ux_registry_m2m_category',
|
|
342
|
+
explicitId: explicitIdGenerator('sys_ux_registry_m2m_category', 'unifiedNav'),
|
|
343
|
+
properties: arg.transform(({ $ }) => ({
|
|
344
|
+
experience_category: $.val(EXPERIENCE_CATEGORIES.WORKSPACE),
|
|
345
|
+
order: $.toNumber().def(1000),
|
|
346
|
+
page_registry: $.val(pageRegistry),
|
|
347
|
+
})),
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
const pagePropRecords = await generatePagePropRecordsFromCallExpression({
|
|
351
|
+
callExpressionShape,
|
|
352
|
+
factory,
|
|
353
|
+
appConfig,
|
|
354
|
+
pageRegistry,
|
|
355
|
+
})
|
|
356
|
+
|
|
357
|
+
const listPage = await createPage({
|
|
358
|
+
factory,
|
|
359
|
+
arg,
|
|
360
|
+
callExpressionShape,
|
|
361
|
+
appConfig,
|
|
362
|
+
type: 'list',
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
const defaultRecordPage = await createPage({
|
|
366
|
+
factory,
|
|
367
|
+
arg,
|
|
368
|
+
callExpressionShape,
|
|
369
|
+
appConfig,
|
|
370
|
+
type: 'record',
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
const dashboardPage = await createPage({
|
|
374
|
+
factory,
|
|
375
|
+
arg,
|
|
376
|
+
callExpressionShape,
|
|
377
|
+
appConfig,
|
|
378
|
+
type: 'home',
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
const simpleListPage = await createPage({
|
|
382
|
+
factory,
|
|
383
|
+
arg,
|
|
384
|
+
callExpressionShape,
|
|
385
|
+
appConfig,
|
|
386
|
+
type: 'simple-list',
|
|
387
|
+
})
|
|
388
|
+
|
|
389
|
+
const workspacePages = [...listPage, ...defaultRecordPage, ...dashboardPage, ...simpleListPage].reduce<{
|
|
390
|
+
[recordKey: string]: Record
|
|
391
|
+
}>((acc, record) => {
|
|
392
|
+
acc[buildRecordKey(record)] = record
|
|
393
|
+
return acc
|
|
394
|
+
}, {})
|
|
395
|
+
|
|
396
|
+
// Order matters. Since pageReg is first, it will represent the workspace plugin
|
|
397
|
+
// when we return from the toShape() function. The other records are treated like
|
|
398
|
+
// side effects of creating a page registry to represent the workspace.
|
|
399
|
+
return {
|
|
400
|
+
[buildRecordKey(pageRegistry)]: pageRegistry,
|
|
401
|
+
[buildRecordKey(appConfig)]: appConfig,
|
|
402
|
+
[buildRecordKey(unifiedNav)]: unifiedNav,
|
|
403
|
+
...pagePropRecords,
|
|
404
|
+
...workspacePages,
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const generatePagePropRecordsFromCallExpression = async ({
|
|
409
|
+
callExpressionShape,
|
|
410
|
+
factory,
|
|
411
|
+
appConfig,
|
|
412
|
+
pageRegistry,
|
|
413
|
+
}: {
|
|
414
|
+
callExpressionShape: CallExpressionShape
|
|
415
|
+
factory: Factory
|
|
416
|
+
appConfig: Record
|
|
417
|
+
pageRegistry: Record
|
|
418
|
+
}) => {
|
|
419
|
+
const arg = callExpressionShape.getArgument(0).asObject()
|
|
420
|
+
|
|
421
|
+
const explicitIdGenerator = getExplicitIdGenerator(callExpressionShape, arg.get('$id').getValue() as string)
|
|
422
|
+
|
|
423
|
+
const pagePropRecordDetails = [
|
|
424
|
+
{
|
|
425
|
+
name: PAGE_PROP_NAME.CHROME_TOOLBAR,
|
|
426
|
+
type: 'json',
|
|
427
|
+
value: ($: InnerTransformFromObjectShape) =>
|
|
428
|
+
$.val(
|
|
429
|
+
JSON.stringify([
|
|
430
|
+
{
|
|
431
|
+
id: 'home',
|
|
432
|
+
label: {
|
|
433
|
+
translatable: true,
|
|
434
|
+
message: 'Home',
|
|
435
|
+
},
|
|
436
|
+
icon: 'home-fill',
|
|
437
|
+
routeInfo: {
|
|
438
|
+
route: 'home',
|
|
439
|
+
},
|
|
440
|
+
group: 'top',
|
|
441
|
+
order: 100,
|
|
442
|
+
badge: {},
|
|
443
|
+
presence: {},
|
|
444
|
+
availability: {},
|
|
445
|
+
viewportInfo: {},
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: 'list',
|
|
449
|
+
label: {
|
|
450
|
+
translatable: true,
|
|
451
|
+
message: 'List',
|
|
452
|
+
},
|
|
453
|
+
icon: 'list-fill',
|
|
454
|
+
routeInfo: {
|
|
455
|
+
route: 'list',
|
|
456
|
+
},
|
|
457
|
+
group: 'top',
|
|
458
|
+
order: 200,
|
|
459
|
+
badge: {},
|
|
460
|
+
presence: {},
|
|
461
|
+
availability: {},
|
|
462
|
+
viewportInfo: {},
|
|
463
|
+
},
|
|
464
|
+
])
|
|
465
|
+
),
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: PAGE_PROP_NAME.VIEW,
|
|
469
|
+
type: 'string',
|
|
470
|
+
value: ($: InnerTransformFromObjectShape) => $.val(`workspace-${appConfig.getId().getValue()}`),
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
name: PAGE_PROP_NAME.WAPPLICABILITYCONFIGID,
|
|
474
|
+
type: 'string',
|
|
475
|
+
value: ($: InnerTransformFromObjectShape) => $.val(appConfig.getId().getValue()),
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: PAGE_PROP_NAME.CHROME_TAB,
|
|
479
|
+
type: 'json',
|
|
480
|
+
value: ($: InnerTransformFromObjectShape) =>
|
|
481
|
+
$.val(
|
|
482
|
+
createChromeTabJsonStringForPageProp(
|
|
483
|
+
arg
|
|
484
|
+
.get('tables')
|
|
485
|
+
.asArray()
|
|
486
|
+
.map((item) => item.asString().getValue())
|
|
487
|
+
)
|
|
488
|
+
),
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
name: PAGE_PROP_NAME.LISTCONFIGID,
|
|
492
|
+
type: 'string',
|
|
493
|
+
value: ($: InnerTransformFromObjectShape) => $.from('listConfig').def(DEFAULT_LISTCONFIGID), // Default UIB List Config
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: PAGE_PROP_NAME.CHROME_HEADER,
|
|
497
|
+
type: 'json',
|
|
498
|
+
value: ($: InnerTransformFromObjectShape) =>
|
|
499
|
+
$.val(
|
|
500
|
+
'{"privatePage":{"userPrefsEnabled":false,"searchEnabled":false,"currentScreenLinkConfiguration":{},"globalTools":{"collapsingMenuId":0,"primaryItems":[],"secondaryItems":[]}},"publicPage":{"menuEnabled":false,"searchEnabled":false,"logoRoute":{},"actionButtons":[]}}'
|
|
501
|
+
),
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: PAGE_PROP_NAME.CHROME_FOOTER,
|
|
505
|
+
type: 'json',
|
|
506
|
+
value: ($: InnerTransformFromObjectShape) =>
|
|
507
|
+
$.val(
|
|
508
|
+
'{"public_page":{"enable_footer_topbar":false,"footer_topbar_options":{},"enable_footer_bar":false,"footer_bar_options":{}}}'
|
|
509
|
+
),
|
|
510
|
+
},
|
|
511
|
+
]
|
|
512
|
+
|
|
513
|
+
const pagePropRecords = pagePropRecordDetails.map((d) =>
|
|
514
|
+
factory.createRecord({
|
|
515
|
+
source: callExpressionShape,
|
|
516
|
+
table: 'sys_ux_page_property',
|
|
517
|
+
explicitId: explicitIdGenerator('sys_ux_page_property', d.name),
|
|
518
|
+
properties: arg.transform(({ $ }) => ({
|
|
519
|
+
name: $.val(d.name),
|
|
520
|
+
suffix: $.val(d.name),
|
|
521
|
+
description: $.val(''),
|
|
522
|
+
route: $.val(''),
|
|
523
|
+
page: $.val(pageRegistry),
|
|
524
|
+
type: $.val(d.type),
|
|
525
|
+
value: d.value($),
|
|
526
|
+
})),
|
|
527
|
+
})
|
|
528
|
+
)
|
|
529
|
+
|
|
530
|
+
const resolvedRecords = await Promise.all(pagePropRecords)
|
|
531
|
+
return resolvedRecords.reduce<RecordKeyToRecord>((acc, record) => {
|
|
532
|
+
acc[buildRecordKey(record)] = record
|
|
533
|
+
return acc
|
|
534
|
+
}, {})
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
const createWorkspaceCallExpression = ({
|
|
538
|
+
pageRegRecord,
|
|
539
|
+
title,
|
|
540
|
+
path,
|
|
541
|
+
landingPath,
|
|
542
|
+
active,
|
|
543
|
+
tables,
|
|
544
|
+
listConfigRef,
|
|
545
|
+
defaultRecordOverrides,
|
|
546
|
+
}: {
|
|
547
|
+
pageRegRecord: Record
|
|
548
|
+
title: string
|
|
549
|
+
path: string
|
|
550
|
+
landingPath: string
|
|
551
|
+
active: boolean
|
|
552
|
+
tables: string[]
|
|
553
|
+
listConfigRef: string | Shape<unknown>
|
|
554
|
+
defaultRecordOverrides?: DefaultRecordOverrides
|
|
555
|
+
}) => {
|
|
556
|
+
return new CallExpressionShape({
|
|
557
|
+
source: pageRegRecord,
|
|
558
|
+
callee: 'Workspace',
|
|
559
|
+
args: [
|
|
560
|
+
pageRegRecord.transform(({ $ }) => {
|
|
561
|
+
return {
|
|
562
|
+
$id: $.val(NowIdShape.from(pageRegRecord)),
|
|
563
|
+
landingPath: $.val(landingPath).def(DEFAULT_LANDING_PATH),
|
|
564
|
+
active: $.val(active).def(true),
|
|
565
|
+
title: $.val(title).def(''),
|
|
566
|
+
path: $.val(path).def(''),
|
|
567
|
+
tables: $.val(tables).def([]),
|
|
568
|
+
listConfig: $.val(listConfigRef).def(DEFAULT_LISTCONFIGID),
|
|
569
|
+
defaultRecordOverrides: $.val(defaultRecordOverrides).def({}),
|
|
570
|
+
}
|
|
571
|
+
}),
|
|
572
|
+
],
|
|
573
|
+
})
|
|
574
|
+
}
|