@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
|
@@ -71,6 +71,20 @@ const attachmentRelationships = {
|
|
|
71
71
|
},
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
const sourceArtifactRelationships = {
|
|
75
|
+
sn_glider_source_artifact_m2m: {
|
|
76
|
+
via: 'application_file',
|
|
77
|
+
descendant: true,
|
|
78
|
+
relationships: {
|
|
79
|
+
sn_glider_source_artifact: {
|
|
80
|
+
via: 'source_artifact',
|
|
81
|
+
inverse: true,
|
|
82
|
+
descendant: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
|
|
74
88
|
const toNoOpShape = (record: Record) => {
|
|
75
89
|
return { success: true, value: Shape.noOp(record) }
|
|
76
90
|
}
|
|
@@ -87,9 +101,14 @@ export const StaticContentPlugin = Plugin.create({
|
|
|
87
101
|
toShape: toNoOpShape,
|
|
88
102
|
},
|
|
89
103
|
sys_ux_lib_asset: {
|
|
90
|
-
|
|
104
|
+
coalesce: ['name'],
|
|
105
|
+
relationships: { ...attachmentRelationships, ...sourceArtifactRelationships },
|
|
91
106
|
toShape: toNoOpShape,
|
|
92
|
-
toFile:
|
|
107
|
+
toFile: async (mainRecord, context) => {
|
|
108
|
+
const existingRelated = mainRecord.flat().slice(1)
|
|
109
|
+
const m2mRecords = context.descendants.query('sn_glider_source_artifact_m2m')
|
|
110
|
+
return multipleRecordsToFile(mainRecord.with(...existingRelated, ...m2mRecords), context)
|
|
111
|
+
},
|
|
93
112
|
},
|
|
94
113
|
db_image: {
|
|
95
114
|
relationships: attachmentRelationships,
|
|
@@ -142,6 +161,10 @@ export const StaticContentPlugin = Plugin.create({
|
|
|
142
161
|
})
|
|
143
162
|
if (mimeType === 'text/html') {
|
|
144
163
|
// This content will be handled by the UiPage referencing it
|
|
164
|
+
} else if (relativePath.endsWith('.ui-source-manifest.json')) {
|
|
165
|
+
// Build-time manifest produced by the uiPageSourceManifest rollup plugin.
|
|
166
|
+
// Consumed by UiPage during build to determine which source files to include
|
|
167
|
+
// in the source artifact record. Not a deployable asset.
|
|
145
168
|
} else if (mimeType === 'application/javascript') {
|
|
146
169
|
tableName = 'sys_ux_lib_asset'
|
|
147
170
|
assetName = pathModule.join(
|
package/src/table-plugin.ts
CHANGED
|
@@ -16,10 +16,16 @@ import {
|
|
|
16
16
|
} from '@servicenow/sdk-build-core'
|
|
17
17
|
import { XMLParser } from 'fast-xml-parser'
|
|
18
18
|
import { z } from 'zod'
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
BCP47_LANGUAGE_TAG_PATTERN,
|
|
21
|
+
columnToCallExpression,
|
|
22
|
+
generatePlural,
|
|
23
|
+
isDefaultDocumentation,
|
|
24
|
+
} from './column-plugin'
|
|
20
25
|
import { create } from 'xmlbuilder2'
|
|
21
26
|
import type { XMLBuilder } from 'xmlbuilder2/lib/interfaces'
|
|
22
27
|
import { addFieldsToColumn } from './column/column-helper'
|
|
28
|
+
import { getLabelForDefaultLanguage } from './column/column-to-record'
|
|
23
29
|
import { generateDeprecatedDiagnostics } from './utils'
|
|
24
30
|
import isEqual from 'lodash/isEqual'
|
|
25
31
|
|
|
@@ -367,7 +373,7 @@ export const TablePlugin = Plugin.create({
|
|
|
367
373
|
files: [
|
|
368
374
|
{
|
|
369
375
|
matcher: /\.xml$/,
|
|
370
|
-
async toRecord(file, { factory }) {
|
|
376
|
+
async toRecord(file, { factory, config }) {
|
|
371
377
|
const xml = new XMLParser({
|
|
372
378
|
ignoreAttributes: false,
|
|
373
379
|
alwaysCreateTextNode: true,
|
|
@@ -383,7 +389,7 @@ export const TablePlugin = Plugin.create({
|
|
|
383
389
|
return { success: false }
|
|
384
390
|
}
|
|
385
391
|
|
|
386
|
-
const recordDefs = tableDefToRecordProperties(tableDef)
|
|
392
|
+
const recordDefs = tableDefToRecordProperties(tableDef, config.tableDefaultLanguage)
|
|
387
393
|
const records: Record[] = []
|
|
388
394
|
for (const [key, table] of [
|
|
389
395
|
['sysDbObject', 'sys_db_object'],
|
|
@@ -463,7 +469,7 @@ export const TablePlugin = Plugin.create({
|
|
|
463
469
|
via: 'super_class',
|
|
464
470
|
},
|
|
465
471
|
},
|
|
466
|
-
toShape(record, { descendants }) {
|
|
472
|
+
toShape(record, { descendants, config }) {
|
|
467
473
|
const schema: { [key: string]: CallExpressionShape } = {}
|
|
468
474
|
let displayColumn: string | undefined
|
|
469
475
|
const columns = descendants.query('sys_dictionary')
|
|
@@ -482,6 +488,7 @@ export const TablePlugin = Plugin.create({
|
|
|
482
488
|
documentation: documentation.filter(
|
|
483
489
|
(d) => d.get('element').ifString()?.getValue() === columnName
|
|
484
490
|
),
|
|
491
|
+
tableDefaultLanguage: config.tableDefaultLanguage,
|
|
485
492
|
})
|
|
486
493
|
if (column.get('display').ifDefined()?.toBoolean().getValue()) {
|
|
487
494
|
displayColumn = columnName
|
|
@@ -578,7 +585,9 @@ export const TablePlugin = Plugin.create({
|
|
|
578
585
|
autoNumber[0]
|
|
579
586
|
?.transform(({ $ }) => ({
|
|
580
587
|
number: $.toNumber().def(1000),
|
|
581
|
-
numberOfDigits: $.from('maximum_digits')
|
|
588
|
+
numberOfDigits: $.from('maximum_digits')
|
|
589
|
+
.map((v) => v.ifString()?.ifNotEmpty()?.toNumber())
|
|
590
|
+
.def(7),
|
|
582
591
|
prefix: $.def('PRE'),
|
|
583
592
|
}))
|
|
584
593
|
.withAliasedKeys(autoNumberAliases)
|
|
@@ -618,14 +627,15 @@ export const TablePlugin = Plugin.create({
|
|
|
618
627
|
label: $.map(
|
|
619
628
|
(label) =>
|
|
620
629
|
label.ifString() ??
|
|
621
|
-
(tableDocumentation.length &&
|
|
630
|
+
(tableDocumentation.length &&
|
|
631
|
+
!isDefaultDocumentation('', tableDocumentation, config.tableDefaultLanguage)
|
|
622
632
|
? tableDocumentation.map((doc) =>
|
|
623
633
|
doc
|
|
624
634
|
.transform(({ $ }) => ({
|
|
625
635
|
label: $.def(''),
|
|
626
636
|
help: $.def(''),
|
|
627
637
|
hint: $.def(''),
|
|
628
|
-
language: $.def(
|
|
638
|
+
language: $.def(config.tableDefaultLanguage),
|
|
629
639
|
plural: $.def(''),
|
|
630
640
|
url: $.def(''),
|
|
631
641
|
urlTarget: $.from('url_target').def(''),
|
|
@@ -874,7 +884,12 @@ export const TablePlugin = Plugin.create({
|
|
|
874
884
|
|
|
875
885
|
const documentationFiles = await generateRecordXml(
|
|
876
886
|
documentation.filter(
|
|
877
|
-
(doc) =>
|
|
887
|
+
(doc) =>
|
|
888
|
+
!isDefaultDocumentation(
|
|
889
|
+
doc.get('element')?.toString().getValue(),
|
|
890
|
+
[doc],
|
|
891
|
+
config.tableDefaultLanguage
|
|
892
|
+
)
|
|
878
893
|
),
|
|
879
894
|
config,
|
|
880
895
|
transform
|
|
@@ -1007,6 +1022,7 @@ export const TablePlugin = Plugin.create({
|
|
|
1007
1022
|
|
|
1008
1023
|
// sys_dictionary
|
|
1009
1024
|
const schema = table.get('schema').asObject()
|
|
1025
|
+
const columnIdsMap = new Map<string, string>()
|
|
1010
1026
|
for (const [name, column] of schema.entries()) {
|
|
1011
1027
|
if (!name.match(columnNameRegex)) {
|
|
1012
1028
|
diagnostics.error(
|
|
@@ -1044,6 +1060,7 @@ export const TablePlugin = Plugin.create({
|
|
|
1044
1060
|
return { success: false }
|
|
1045
1061
|
}
|
|
1046
1062
|
relatedRecords.push(result.value)
|
|
1063
|
+
columnIdsMap.set(name, result.value.getId().getValue())
|
|
1047
1064
|
}
|
|
1048
1065
|
|
|
1049
1066
|
// sys_index
|
|
@@ -1062,7 +1079,20 @@ export const TablePlugin = Plugin.create({
|
|
|
1062
1079
|
index_name: indexObject['name'],
|
|
1063
1080
|
col_name_string: colNames,
|
|
1064
1081
|
unique_index: indexObject['unique'] === true,
|
|
1065
|
-
logical_table_name:
|
|
1082
|
+
logical_table_name: tableName.getValue(),
|
|
1083
|
+
index_col_name: colNames
|
|
1084
|
+
.split(',')
|
|
1085
|
+
.map((colName) => {
|
|
1086
|
+
if (!columnIdsMap.has(colName)) {
|
|
1087
|
+
diagnostics.error(
|
|
1088
|
+
index,
|
|
1089
|
+
`Column '${colName}' not found in table '${tableName.getValue()}'`
|
|
1090
|
+
)
|
|
1091
|
+
return ''
|
|
1092
|
+
}
|
|
1093
|
+
return columnIdsMap.get(colName)
|
|
1094
|
+
})
|
|
1095
|
+
.join(','),
|
|
1066
1096
|
},
|
|
1067
1097
|
})
|
|
1068
1098
|
)
|
|
@@ -1125,10 +1155,10 @@ export const TablePlugin = Plugin.create({
|
|
|
1125
1155
|
generateDeprecatedDiagnostics(docObject, diagnostics)
|
|
1126
1156
|
const language = docObject.get('language').ifString()?.getValue()
|
|
1127
1157
|
if (language) {
|
|
1128
|
-
if (language
|
|
1158
|
+
if (!BCP47_LANGUAGE_TAG_PATTERN.test(language)) {
|
|
1129
1159
|
diagnostics.error(
|
|
1130
1160
|
doc.getOriginalNode(),
|
|
1131
|
-
`'language' must be a
|
|
1161
|
+
`'language' must be a valid BCP 47 language tag (e.g., 'en', 'es', 'en-US', 'zh-Hans')`
|
|
1132
1162
|
)
|
|
1133
1163
|
}
|
|
1134
1164
|
if (languages.has(language)) {
|
|
@@ -1162,7 +1192,7 @@ export const TablePlugin = Plugin.create({
|
|
|
1162
1192
|
properties: {
|
|
1163
1193
|
name: tableName,
|
|
1164
1194
|
element: undefined,
|
|
1165
|
-
language:
|
|
1195
|
+
language: config.tableDefaultLanguage,
|
|
1166
1196
|
label: table.get('label').ifString() ?? tableName,
|
|
1167
1197
|
plural: generatePlural(
|
|
1168
1198
|
table.get('label')?.ifString()?.getValue() ?? tableName.getValue()
|
|
@@ -1261,7 +1291,7 @@ export const TablePlugin = Plugin.create({
|
|
|
1261
1291
|
.map((actions) => hasAction('create', actions))
|
|
1262
1292
|
.def(false),
|
|
1263
1293
|
is_extendable: $.from('extensible').toBoolean().def(false),
|
|
1264
|
-
label: $.map((label) => (label
|
|
1294
|
+
label: $.map((label) => getLabelForDefaultLanguage(label, config.tableDefaultLanguage)),
|
|
1265
1295
|
live_feed_enabled: $.from('liveFeed').toBoolean().def(false),
|
|
1266
1296
|
name: $,
|
|
1267
1297
|
scriptable_table: $.from('scriptableTable').toBoolean().def(false),
|
|
@@ -1429,7 +1459,10 @@ function parseTableBootstrapXml(xml: unknown): TableDefinition | null {
|
|
|
1429
1459
|
}
|
|
1430
1460
|
}
|
|
1431
1461
|
|
|
1432
|
-
function tableDefToRecordProperties(
|
|
1462
|
+
function tableDefToRecordProperties(
|
|
1463
|
+
tableDef: TableDefinition,
|
|
1464
|
+
tableDefaultLanguage: string = 'en'
|
|
1465
|
+
): {
|
|
1433
1466
|
sysDbObject: SysDbObjectProperties
|
|
1434
1467
|
sysDictionary: SysDictionaryProperties[]
|
|
1435
1468
|
sysChoice: SysChoiceProperties[]
|
|
@@ -1464,7 +1497,7 @@ function tableDefToRecordProperties(tableDef: TableDefinition): {
|
|
|
1464
1497
|
element: undefined,
|
|
1465
1498
|
label: tableDef.label,
|
|
1466
1499
|
plural: tableDef.plural,
|
|
1467
|
-
language:
|
|
1500
|
+
language: tableDefaultLanguage,
|
|
1468
1501
|
hint: undefined,
|
|
1469
1502
|
help: undefined,
|
|
1470
1503
|
})
|
|
@@ -1541,7 +1574,7 @@ function tableDefToRecordProperties(tableDef: TableDefinition): {
|
|
|
1541
1574
|
element: column.name,
|
|
1542
1575
|
label: column.columnLabel || column.name,
|
|
1543
1576
|
plural: column.plural || generatePlural(column.columnLabel || column.name),
|
|
1544
|
-
language:
|
|
1577
|
+
language: tableDefaultLanguage,
|
|
1545
1578
|
hint: column.hint,
|
|
1546
1579
|
help: column.help,
|
|
1547
1580
|
})
|