@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,323 @@
|
|
|
1
|
+
export declare const APPLIES_TO_CATALOG_ITEM = "item";
|
|
2
|
+
import { type Record, PropertyAccessShape, IdentifierShape, type Database, TemplateExpressionShape, Shape, type ObjectShape, type Diagnostics, type Transform } from '@servicenow/sdk-build-core';
|
|
3
|
+
import { NowIncludeShape } from '../now-include-plugin';
|
|
4
|
+
/**
|
|
5
|
+
* Validates that there's at most one RequestedForVariable in a variables configuration (used only for VariableSet)
|
|
6
|
+
* @param variablesShape - The ObjectShape containing the variables configuration
|
|
7
|
+
* @param diagnostics - Diagnostics instance for reporting errors
|
|
8
|
+
* @param context - Context where the validation is being performed ('VariableSet')
|
|
9
|
+
* @returns True if validation passes, false otherwise
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateRequestedForVariable(variablesShape: ObjectShape, diagnostics: Diagnostics, context?: 'VariableSet'): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Combined validation for variable sets that performs multiple checks in a single loop:
|
|
14
|
+
* - At most one RequestedForVariable
|
|
15
|
+
* - Variable types not supported in multiRow variable sets
|
|
16
|
+
* @param variablesShape - The ObjectShape containing the variables configuration
|
|
17
|
+
* @param variableSetType - The type of the variable set ('singleRow' or 'multiRow')
|
|
18
|
+
* @param diagnostics - Diagnostics instance for reporting errors
|
|
19
|
+
* @param context - Context where the validation is being performed ('VariableSet')
|
|
20
|
+
* @returns True if validation passes, false otherwise
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateVariableSetVariables(variablesShape: ObjectShape, variableSetType: string, diagnostics: Diagnostics, context?: 'VariableSet'): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use validateVariableSetVariables instead
|
|
25
|
+
* Validates that certain variable types are not used in multiRow variable sets.
|
|
26
|
+
* MultiRow variable sets don't support certain display/layout variables.
|
|
27
|
+
* @param variablesShape - The ObjectShape containing the variables configuration
|
|
28
|
+
* @param variableSetType - The type of the variable set ('singleRow' or 'multiRow')
|
|
29
|
+
* @param diagnostics - Diagnostics instance for reporting errors
|
|
30
|
+
* @returns True if validation passes, false otherwise
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateVariableTypesForMultiRow(variablesShape: ObjectShape, variableSetType: string, diagnostics: Diagnostics): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Optimized validation that checks all RequestedForVariable constraints in a single pass:
|
|
35
|
+
* - At most one RequestedForVariable in direct variables
|
|
36
|
+
* - Not used in both direct variables and attached variable sets
|
|
37
|
+
* - Only one RequestedForVariable across all attached variable sets
|
|
38
|
+
* @param arg - The ObjectShape containing the catalog item/record producer configuration
|
|
39
|
+
* @param diagnostics - Diagnostics instance for reporting errors
|
|
40
|
+
* @param context - Context where the validation is being performed ('CatalogItem' or 'RecordProducer')
|
|
41
|
+
* @returns True if validation passes, false otherwise
|
|
42
|
+
*/
|
|
43
|
+
export declare function validateRequestedForVariableConflict(arg: ObjectShape, diagnostics: Diagnostics, context: 'CatalogItem' | 'RecordProducer'): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Validates that variable names (keys) in attached variable sets don't conflict with direct variable names
|
|
46
|
+
* @param arg - The ObjectShape containing the catalog item/record producer configuration
|
|
47
|
+
* @param diagnostics - Diagnostics instance for reporting errors
|
|
48
|
+
* @param context - Context where the validation is being performed ('CatalogItem' or 'RecordProducer')
|
|
49
|
+
* @returns True if validation passes, false otherwise
|
|
50
|
+
*/
|
|
51
|
+
export declare function validateVariableNameConflicts(arg: ObjectShape, diagnostics: Diagnostics, context: 'CatalogItem' | 'RecordProducer'): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Safely converts a value to a number with a default fallback
|
|
54
|
+
* Handles empty strings and undefined values
|
|
55
|
+
* @param value - The value to convert
|
|
56
|
+
* @param defaultValue - The default value to use if conversion fails or value is empty/undefined
|
|
57
|
+
* @returns The converted number or default value
|
|
58
|
+
*/
|
|
59
|
+
export declare function convertToNumber(value: Shape, defaultValue?: number): number;
|
|
60
|
+
export declare function getUITypeFromId(id: number): 'desktop' | 'mobileOrServicePortal' | 'all';
|
|
61
|
+
export declare function getUITypeId(value: string): number;
|
|
62
|
+
/**
|
|
63
|
+
* Converts ServiceNow variable set type database value to camelCase enum value
|
|
64
|
+
* @param dbValue - Database value ('one_to_one' or 'one_to_many')
|
|
65
|
+
* @returns TypeScript enum value ('singleRow' or 'multiRow')
|
|
66
|
+
*/
|
|
67
|
+
export declare function getVariableSetTypeFromDb(dbValue: string): 'singleRow' | 'multiRow';
|
|
68
|
+
/**
|
|
69
|
+
* Converts TypeScript enum value to ServiceNow variable set type database value
|
|
70
|
+
* @param value - TypeScript enum value ('singleRow' or 'multiRow')
|
|
71
|
+
* @returns Database value ('one_to_one' or 'one_to_many')
|
|
72
|
+
*/
|
|
73
|
+
export declare function getVariableSetTypeToDb(value: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Converts ServiceNow redirect URL database value to camelCase enum value
|
|
76
|
+
* @param dbValue - Database value ('generated_record' or 'catalog_home')
|
|
77
|
+
* @returns TypeScript enum value ('generatedRecord' or 'catalogHomePage')
|
|
78
|
+
*/
|
|
79
|
+
export declare function getRedirectUrlFromDb(dbValue: string): 'generatedRecord' | 'catalogHomePage';
|
|
80
|
+
/**
|
|
81
|
+
* Converts TypeScript enum value to ServiceNow redirect URL database value
|
|
82
|
+
* @param value - TypeScript enum value ('generatedRecord' or 'catalogHomePage')
|
|
83
|
+
* @returns Database value ('generated_record' or 'catalog_home')
|
|
84
|
+
*/
|
|
85
|
+
export declare function getRedirectUrlToDb(value: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* Converts ServiceNow fulfillment automation level database value to camelCase enum value
|
|
88
|
+
* @param dbValue - Database value ('unspecified', 'manual', 'semi_automated', or 'fully_automated')
|
|
89
|
+
* @returns TypeScript enum value ('unspecified', 'manual', 'semiAutomated', or 'fullyAutomated')
|
|
90
|
+
*/
|
|
91
|
+
export declare function getFulfillmentAutomationLevelFromDb(dbValue: string): 'unspecified' | 'manual' | 'semiAutomated' | 'fullyAutomated';
|
|
92
|
+
/**
|
|
93
|
+
* Converts TypeScript enum value to ServiceNow fulfillment automation level database value
|
|
94
|
+
* @param value - TypeScript enum value ('unspecified', 'manual', 'semiAutomated', or 'fullyAutomated')
|
|
95
|
+
* @returns Database value ('unspecified', 'manual', 'semi_automated', or 'fully_automated')
|
|
96
|
+
*/
|
|
97
|
+
export declare function getFulfillmentAutomationLevelToDb(value: string): string;
|
|
98
|
+
/**
|
|
99
|
+
* Converts ServiceNow availability database value to camelCase enum value
|
|
100
|
+
* @param dbValue - Database value ('on_desktop', 'on_mobile', or 'on_both')
|
|
101
|
+
* @returns TypeScript enum value ('desktopOnly', 'mobileOnly', or 'both')
|
|
102
|
+
*/
|
|
103
|
+
export declare function getAvailabilityFromDb(dbValue: string): 'desktopOnly' | 'mobileOnly' | 'both';
|
|
104
|
+
/**
|
|
105
|
+
* Converts TypeScript enum value to ServiceNow availability database value
|
|
106
|
+
* @param value - TypeScript enum value ('desktopOnly', 'mobileOnly', or 'both')
|
|
107
|
+
* @returns Database value ('on_desktop', 'on_mobile', or 'on_both')
|
|
108
|
+
*/
|
|
109
|
+
export declare function getAvailabilityToDb(value: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* Converts ServiceNow mobile picture type database value to camelCase enum value
|
|
112
|
+
* @param dbValue - Database value ('use_desktop_picture', 'use_mobile_picture', or 'use_no_picture')
|
|
113
|
+
* @returns TypeScript enum value ('desktopPicture', 'mobilePicture', or 'noPicture')
|
|
114
|
+
*/
|
|
115
|
+
export declare function getMobilePictureTypeFromDb(dbValue: string): 'desktopPicture' | 'mobilePicture' | 'noPicture';
|
|
116
|
+
/**
|
|
117
|
+
* Converts TypeScript enum value to ServiceNow mobile picture type database value
|
|
118
|
+
* @param value - TypeScript enum value ('desktopPicture', 'mobilePicture', or 'noPicture')
|
|
119
|
+
* @returns Database value ('use_desktop_picture', 'use_mobile_picture', or 'use_no_picture')
|
|
120
|
+
*/
|
|
121
|
+
export declare function getMobilePictureTypeToDb(value: string): string;
|
|
122
|
+
/**
|
|
123
|
+
* Converts ServiceNow value action database value to camelCase enum value
|
|
124
|
+
* @param dbValue - Database value ('clear_value', 'set_value', or 'ignore')
|
|
125
|
+
* @returns TypeScript enum value ('clearValue', 'setValue'), or undefined if 'ignore'
|
|
126
|
+
*/
|
|
127
|
+
export declare function getValueActionFromDb(dbValue: string): 'clearValue' | 'setValue' | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Converts TypeScript enum value to ServiceNow value action database value
|
|
130
|
+
* @param value - TypeScript enum value ('clearValue', 'setValue', or 'ignore')
|
|
131
|
+
* @returns Database value ('clear_value', 'set_value', or 'ignore')
|
|
132
|
+
*/
|
|
133
|
+
export declare function getValueActionToDb(value: string): string;
|
|
134
|
+
export declare function getVisibilityFromId(id: number): 'Always' | 'Bundle' | 'Standalone';
|
|
135
|
+
export declare function getVisibilityId(value: string): number;
|
|
136
|
+
/**
|
|
137
|
+
* Finds a variable record from a catalog item's related records by variable name
|
|
138
|
+
* @param catalogItemRecord - The catalog item Record to search in
|
|
139
|
+
* @param variableName - The name of the variable to find
|
|
140
|
+
* @returns The variable record if found, undefined otherwise
|
|
141
|
+
*/
|
|
142
|
+
export declare function findNameInParent(catalogItemRecord: Record, variableName: string): Record | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Resolves a variable ID from a parent record and variable name with fallback logic
|
|
145
|
+
* @param parentRecord - The resolved parent record (may or may not be a Record instance)
|
|
146
|
+
* @param variableName - The name of the variable to resolve
|
|
147
|
+
* @returns The formatted variable ID with IO: prefix
|
|
148
|
+
*/
|
|
149
|
+
export declare function resolveVariableId(parentRecord: Record, variableName: string): string;
|
|
150
|
+
/**
|
|
151
|
+
* Resolves catalog item and variable set references based on the applies_to field
|
|
152
|
+
* @param record - The source record containing catalog_item/cat_item and variable_set fields
|
|
153
|
+
* @param database - The database instance for looking up records
|
|
154
|
+
* @returns Object with catalogItemReference and variableSetReference
|
|
155
|
+
*/
|
|
156
|
+
export declare function resolveCatalogReferences(record: Record, database: Database): {
|
|
157
|
+
catalogItemReference: IdentifierShape | string | undefined;
|
|
158
|
+
variableSetReference: IdentifierShape | string | undefined;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Resolves a record reference (catalog item or variable set) to an IdentifierShape
|
|
162
|
+
* @param recordId - The sys_id of the record to resolve
|
|
163
|
+
* @param tableName - The table name ('sc_cat_item' or 'item_option_new_set')
|
|
164
|
+
* @param database - The database instance for looking up records
|
|
165
|
+
* @returns IdentifierShape if the record exists and has a name, otherwise the original sys_id or undefined
|
|
166
|
+
*/
|
|
167
|
+
export declare function resolveRecordReference(recordId: string | undefined, tableName: 'sc_cat_item' | 'item_option_new_set', database: Database): IdentifierShape | string | undefined;
|
|
168
|
+
export declare function parentIdentifier(parentRecord: Record): IdentifierShape | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* Creates a PropertyAccessShape for a catalog variable from an item record
|
|
171
|
+
* @param itemId - The item_option_new record
|
|
172
|
+
* @param source - The source record for the PropertyAccessShape
|
|
173
|
+
* @param parent - The parent record from the record
|
|
174
|
+
* @returns PropertyAccessShape representing catalogItem.variables.variableName
|
|
175
|
+
*/
|
|
176
|
+
export declare function createVariablePropertyAccess(variableRecord: Record, source: Record, parent: Record): PropertyAccessShape | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* Resolves the appropriate record for catalog item or variable set operations
|
|
179
|
+
* @param record - The source record containing catalog_item/cat_item or variable_set references
|
|
180
|
+
* @param database - The database instance for looking up records by ID
|
|
181
|
+
* @returns The resolved record (sc_cat_item or item_option_new_set) or undefined if not found
|
|
182
|
+
*/
|
|
183
|
+
export declare function getTargetRecord(record: Record, database: Database): Record | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Resolves a variable name from a PropertyAccessShape
|
|
186
|
+
* @param variableNameShape - The shape containing the property access
|
|
187
|
+
* @returns An object containing the parent record and variable name
|
|
188
|
+
*/
|
|
189
|
+
export declare function resolveVariableAccess(variableNameShape: PropertyAccessShape): {
|
|
190
|
+
parentRecord: Record;
|
|
191
|
+
variableName: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Processes a catalog condition template expression
|
|
195
|
+
* @param conditionShape - The shape containing the catalog condition
|
|
196
|
+
* @param appliesTo - Optional appliesTo value for validation
|
|
197
|
+
* @param variableSetShape - Optional variable set shape for validation
|
|
198
|
+
* @param catalogItemShape - Optional catalog item shape for validation
|
|
199
|
+
* @param diagnostics - Optional diagnostics instance for reporting validation errors
|
|
200
|
+
* @returns The processed condition string with resolved variable references
|
|
201
|
+
*/
|
|
202
|
+
export declare function processCatalogCondition(conditionShape: Shape<unknown>, appliesTo?: 'set' | 'item', variableSetShape?: Shape<unknown>, catalogItemShape?: Shape<unknown>, diagnostics?: Diagnostics): string | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Represents the result of parsing a single catalog condition part
|
|
205
|
+
*/
|
|
206
|
+
interface ParsedConditionPart {
|
|
207
|
+
logicalOperator: string;
|
|
208
|
+
processedContent: string | PropertyAccessShape;
|
|
209
|
+
operatorSuffix: string;
|
|
210
|
+
hasPropertyAccess: boolean;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Parses a single catalog condition part and extracts logical operators and variable references
|
|
214
|
+
* @param part - The condition part to parse
|
|
215
|
+
* @param record - The source record
|
|
216
|
+
* @param database - The database instance for looking up records
|
|
217
|
+
* @returns Parsed condition part with extracted components
|
|
218
|
+
*/
|
|
219
|
+
export declare function parseConditionPart(part: string, record: Record, database: Database): ParsedConditionPart | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* Processes catalog conditions and converts them to either a TemplateExpressionShape or a string
|
|
222
|
+
* @param record - The record containing the catalog conditions
|
|
223
|
+
* @param database - The database instance for looking up records
|
|
224
|
+
* @returns The processed conditions as a TemplateExpressionShape or string, or undefined if no conditions
|
|
225
|
+
*/
|
|
226
|
+
export declare function processCatalogConditionsToShape(record: Record, database: Database): TemplateExpressionShape | string | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* Converts a title to a valid ServiceNow internal name (snake_case)
|
|
229
|
+
* @param title - The title to convert
|
|
230
|
+
* @returns Snake_case internal name
|
|
231
|
+
*/
|
|
232
|
+
export declare function convertTitleToInternalName(title: string): string;
|
|
233
|
+
/**
|
|
234
|
+
* Validation constants for internal names
|
|
235
|
+
*/
|
|
236
|
+
export declare const INTERNAL_NAME_REGEX: RegExp;
|
|
237
|
+
export declare const INTERNAL_NAME_MAX_LENGTH = 80;
|
|
238
|
+
/**
|
|
239
|
+
* Validates an internal name for ServiceNow compatibility
|
|
240
|
+
* @param internalName - The internal name to validate
|
|
241
|
+
* @returns Validation result with error message if invalid
|
|
242
|
+
*/
|
|
243
|
+
export declare function validateInternalName(internalName: string): {
|
|
244
|
+
valid: boolean;
|
|
245
|
+
error?: string;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Converts role values (arrays or Role records) to comma-separated string for ServiceNow storage
|
|
249
|
+
* Handles both string arrays and Role record references
|
|
250
|
+
* @param v - Shape value containing role data
|
|
251
|
+
* @returns Comma-separated role string or undefined
|
|
252
|
+
*/
|
|
253
|
+
export declare function convertRolesToString(v: Shape): string | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Parses comma-separated string into an array
|
|
256
|
+
* @param string - Comma-separated string (e.g., "admin,itil")
|
|
257
|
+
* @returns Array of trimmed strings
|
|
258
|
+
*/
|
|
259
|
+
export declare function parseString(commaSeparatedString: Shape): string[];
|
|
260
|
+
/**
|
|
261
|
+
* Checks if the record should be written as a call expression
|
|
262
|
+
* @param record - The record to check
|
|
263
|
+
* @returns True if the record should be written as a call expression, false otherwise
|
|
264
|
+
*/
|
|
265
|
+
export declare function shouldWriteAsCallExpression(record: Record): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Converts a name to a valid JavaScript identifier
|
|
268
|
+
* Examples:
|
|
269
|
+
* "Backend item" -> "backendItem"
|
|
270
|
+
* "Developer Workstation" -> "developerWorkstation"
|
|
271
|
+
* "My-Special_Item 123" -> "mySpecialItem123"
|
|
272
|
+
*/
|
|
273
|
+
export declare function toValidIdentifier(name: string): string;
|
|
274
|
+
/**
|
|
275
|
+
* Default delivery time value used when no delivery time is specified
|
|
276
|
+
*/
|
|
277
|
+
export declare const DEFAULT_DELIVERY_TIME = "1970-01-01 00:00:00";
|
|
278
|
+
/**
|
|
279
|
+
* Creates a NowIncludeShape with a custom file path suffix for script separation
|
|
280
|
+
*/
|
|
281
|
+
export declare function createScript(record: Record, scriptContent: string | Shape, transform: Transform, suffix: string): Promise<NowIncludeShape>;
|
|
282
|
+
/**
|
|
283
|
+
* Default script
|
|
284
|
+
*/
|
|
285
|
+
export declare const defaultScript = "/** This script is executed before the Record is generated\n* `current`- GlideRecord produced by Record Producer\n* Don't use `current.update()` or `current.insert()` as the record is generated by Record Producer\n* Don't use `current.setValue('sys_class_name', 'xxx')` as this will trigger reparent flow and can cause data loss\n* Avoid `current.setAbortAction()` and generate a separate record\n* Use `producer.var1` to access variables\n*/";
|
|
286
|
+
/**
|
|
287
|
+
* Default post insert script
|
|
288
|
+
*/
|
|
289
|
+
export declare const defaultpostInsertScript = "/**\n* This script is executed after the record is generated. \n* `current` Is the GlideRecord produced by Record Producer. Use `current.update()` to update the record\n* To access the variables, use `producer.var1` where var1 is the name of the variable\n* To access the Record Producer use `cat_item`\n*/";
|
|
290
|
+
/**
|
|
291
|
+
* Default save script
|
|
292
|
+
*/
|
|
293
|
+
export declare const defaultSaveScript = "/**\n* This script is executed at every step save in Catalog Builder. \n* This script is executed before `Script` is executed.\n* `current` Is the GlideRecord produced by Record Producer. \n* To access the variables, use `producer.var1` where var1 is the name of the variable\n* To access the Record Producer use `cat_item`\n*/";
|
|
294
|
+
/**
|
|
295
|
+
* Validates that a variable belongs to a target record (variable set or catalog item)
|
|
296
|
+
* Reports diagnostic error if validation fails
|
|
297
|
+
* @param targetShape - The IdentifierShape for the target reference (variable set or catalog item)
|
|
298
|
+
* @param parentRecord - The parent record where the variable is defined
|
|
299
|
+
* @param appliesTo - Whether the validation is for 'set' (variable set) or 'item' (catalog item)
|
|
300
|
+
* @param diagnostics - Optional diagnostics instance for reporting errors
|
|
301
|
+
* @returns true if the variable belongs to the target, false otherwise
|
|
302
|
+
*/
|
|
303
|
+
export declare function validateVariableBelongsToTarget(targetShape: IdentifierShape, parentRecord: Record, appliesTo: 'set' | 'item', diagnostics?: Diagnostics): boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Resolves a variable ID from variableNameShape and validates it belongs to the variable set if appliesTo is 'set'
|
|
306
|
+
* @param variableNameShape - The shape from get('variableName', false)
|
|
307
|
+
* @param appliesTo - The value from get('appliesTo')
|
|
308
|
+
* @param variableSetShape - The shape from get('variableSet', false)
|
|
309
|
+
* @param diagnostics - Diagnostics instance for reporting errors
|
|
310
|
+
* @returns The resolved variable ID with IO: prefix, or undefined if resolution fails
|
|
311
|
+
*/
|
|
312
|
+
export declare function resolveAndValidateVariableId(variableNameShape: Shape<unknown> | undefined, appliesTo: 'set' | 'item', variableSetShape: Shape<unknown> | undefined, catalogItemShape: Shape<unknown> | undefined, diagnostics: Diagnostics): string | undefined;
|
|
313
|
+
/**
|
|
314
|
+
* Validates that each variable's 'field' value (when 'mapToField' is true) belongs to the record producer's target table.
|
|
315
|
+
* Resolves the table record from arg.get('table'), collects field names from sys_documentation descendants via .flat(),
|
|
316
|
+
* and checks each variable's 'field' against those keys.
|
|
317
|
+
* @param arg - The ObjectShape containing the record producer configuration
|
|
318
|
+
* @param diagnostics - Diagnostics instance for reporting errors
|
|
319
|
+
* @param context - Context where the validation is being performed ('RecordProducer')
|
|
320
|
+
* @returns True if all mapped fields belong to the table, false otherwise
|
|
321
|
+
*/
|
|
322
|
+
export declare function validateFieldNameBelongsToTable(arg: ObjectShape, diagnostics: Diagnostics, context: string): boolean;
|
|
323
|
+
export {};
|