@servicenow/sdk-build-plugins 2.0.1
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/AttachmentPlugin.d.ts +253 -0
- package/dist/AttachmentPlugin.js +216 -0
- package/dist/AttachmentPlugin.js.map +1 -0
- package/dist/BusinessRulePlugin.d.ts +56 -0
- package/dist/BusinessRulePlugin.js +171 -0
- package/dist/BusinessRulePlugin.js.map +1 -0
- package/dist/CrossScopePrivilegePlugin.d.ts +22 -0
- package/dist/CrossScopePrivilegePlugin.js +42 -0
- package/dist/CrossScopePrivilegePlugin.js.map +1 -0
- package/dist/DefaultPlugin.d.ts +71 -0
- package/dist/DefaultPlugin.js +238 -0
- package/dist/DefaultPlugin.js.map +1 -0
- package/dist/IdPlugin.d.ts +17 -0
- package/dist/IdPlugin.js +45 -0
- package/dist/IdPlugin.js.map +1 -0
- package/dist/ListPlugin.d.ts +91 -0
- package/dist/ListPlugin.js +398 -0
- package/dist/ListPlugin.js.map +1 -0
- package/dist/PropertyPlugin.d.ts +122 -0
- package/dist/PropertyPlugin.js +165 -0
- package/dist/PropertyPlugin.js.map +1 -0
- package/dist/ScriptTemplatePlugin.d.ts +31 -0
- package/dist/ScriptTemplatePlugin.js +208 -0
- package/dist/ScriptTemplatePlugin.js.map +1 -0
- package/dist/UserPreferencePlugin.d.ts +16 -0
- package/dist/UserPreferencePlugin.js +30 -0
- package/dist/UserPreferencePlugin.js.map +1 -0
- package/dist/aclAndRole/AclPlugin.d.ts +117 -0
- package/dist/aclAndRole/AclPlugin.js +285 -0
- package/dist/aclAndRole/AclPlugin.js.map +1 -0
- package/dist/aclAndRole/RolePlugin.d.ts +58 -0
- package/dist/aclAndRole/RolePlugin.js +152 -0
- package/dist/aclAndRole/RolePlugin.js.map +1 -0
- package/dist/aclAndRole/Util.d.ts +3 -0
- package/dist/aclAndRole/Util.js +106 -0
- package/dist/aclAndRole/Util.js.map +1 -0
- package/dist/app/ApplicationMenuPlugin.d.ts +32 -0
- package/dist/app/ApplicationMenuPlugin.js +106 -0
- package/dist/app/ApplicationMenuPlugin.js.map +1 -0
- package/dist/atf/ATFComposer.d.ts +492 -0
- package/dist/atf/ATFComposer.js +2717 -0
- package/dist/atf/ATFComposer.js.map +1 -0
- package/dist/atf/TestPlugin.d.ts +31 -0
- package/dist/atf/TestPlugin.js +95 -0
- package/dist/atf/TestPlugin.js.map +1 -0
- package/dist/atf/index.d.ts +1 -0
- package/dist/atf/index.js +9 -0
- package/dist/atf/index.js.map +1 -0
- package/dist/db/ColumnPlugins.d.ts +278 -0
- package/dist/db/ColumnPlugins.js +112 -0
- package/dist/db/ColumnPlugins.js.map +1 -0
- package/dist/db/RecordPlugin.d.ts +208 -0
- package/dist/db/RecordPlugin.js +287 -0
- package/dist/db/RecordPlugin.js.map +1 -0
- package/dist/db/TablePlugin.d.ts +742 -0
- package/dist/db/TablePlugin.js +1249 -0
- package/dist/db/TablePlugin.js.map +1 -0
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.js +27 -0
- package/dist/db/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.d.ts +12 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.js +371 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.d.ts +15 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.js +177 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.d.ts +144 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.js +318 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.js.map +1 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.d.ts +190 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.js +53 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RestUtils.d.ts +75 -0
- package/dist/scriptedRESTAPI/RestUtils.js +469 -0
- package/dist/scriptedRESTAPI/RestUtils.js.map +1 -0
- package/dist/scripts/ClientScriptPlugin.d.ts +43 -0
- package/dist/scripts/ClientScriptPlugin.js +190 -0
- package/dist/scripts/ClientScriptPlugin.js.map +1 -0
- package/dist/scripts/scriptUtils.d.ts +15 -0
- package/dist/scripts/scriptUtils.js +83 -0
- package/dist/scripts/scriptUtils.js.map +1 -0
- package/dist/uxf/ExperiencePlugin.d.ts +22 -0
- package/dist/uxf/ExperiencePlugin.js +55 -0
- package/dist/uxf/ExperiencePlugin.js.map +1 -0
- package/dist/uxf/RoutesPlugin.d.ts +22 -0
- package/dist/uxf/RoutesPlugin.js +176 -0
- package/dist/uxf/RoutesPlugin.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.d.ts +4 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.js +65 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.d.ts +189 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.js +158 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.d.ts +13 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +604 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.d.ts +12 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.d.ts +31 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +64 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/index.d.ts +3 -0
- package/dist/uxf/UxfFormulaParser/index.js +11 -0
- package/dist/uxf/UxfFormulaParser/index.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/parser.d.ts +8 -0
- package/dist/uxf/UxfFormulaParser/parser.js +87 -0
- package/dist/uxf/UxfFormulaParser/parser.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.d.ts +8 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js +17 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js.map +1 -0
- package/dist/uxf/constants.d.ts +2 -0
- package/dist/uxf/constants.js +8 -0
- package/dist/uxf/constants.js.map +1 -0
- package/dist/uxf/index.d.ts +2 -0
- package/dist/uxf/index.js +11 -0
- package/dist/uxf/index.js.map +1 -0
- package/dist/uxf/tectonicIdGenerator.d.ts +12 -0
- package/dist/uxf/tectonicIdGenerator.js +102 -0
- package/dist/uxf/tectonicIdGenerator.js.map +1 -0
- package/license +9 -0
- package/package.json +42 -0
- package/src/AttachmentPlugin.ts +262 -0
- package/src/BusinessRulePlugin.ts +251 -0
- package/src/CrossScopePrivilegePlugin.ts +54 -0
- package/src/DefaultPlugin.ts +272 -0
- package/src/IdPlugin.ts +47 -0
- package/src/ListPlugin.ts +497 -0
- package/src/PropertyPlugin.ts +218 -0
- package/src/ScriptTemplatePlugin.ts +223 -0
- package/src/UserPreferencePlugin.ts +36 -0
- package/src/aclAndRole/AclPlugin.ts +410 -0
- package/src/aclAndRole/RolePlugin.ts +225 -0
- package/src/aclAndRole/Util.ts +104 -0
- package/src/app/ApplicationMenuPlugin.ts +158 -0
- package/src/atf/ATFComposer.ts +3356 -0
- package/src/atf/TestPlugin.ts +119 -0
- package/src/atf/index.ts +1 -0
- package/src/db/ColumnPlugins.ts +117 -0
- package/src/db/RecordPlugin.ts +391 -0
- package/src/db/TablePlugin.ts +1581 -0
- package/src/db/index.ts +3 -0
- package/src/index.ts +16 -0
- package/src/scriptedRESTAPI/RESTDeserializationUtils.ts +410 -0
- package/src/scriptedRESTAPI/RESTSerializationUtils.ts +227 -0
- package/src/scriptedRESTAPI/RestApiPlugin.ts +438 -0
- package/src/scriptedRESTAPI/RestSchemaUtils.ts +72 -0
- package/src/scriptedRESTAPI/RestUtils.ts +507 -0
- package/src/scripts/ClientScriptPlugin.ts +251 -0
- package/src/scripts/scriptUtils.ts +81 -0
- package/src/uxf/ExperiencePlugin.ts +64 -0
- package/src/uxf/RoutesPlugin.ts +215 -0
- package/src/uxf/UxfFormulaParser/cleanUxValue.ts +73 -0
- package/src/uxf/UxfFormulaParser/grammerParser/api.js +166 -0
- package/src/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +606 -0
- package/src/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
- package/src/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +65 -0
- package/src/uxf/UxfFormulaParser/index.ts +4 -0
- package/src/uxf/UxfFormulaParser/parser.ts +64 -0
- package/src/uxf/UxfFormulaParser/utils/getErrorMsg.ts +13 -0
- package/src/uxf/constants.ts +4 -0
- package/src/uxf/index.ts +2 -0
- package/src/uxf/tectonicIdGenerator.ts +81 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copied from https://code.devsnc.com/dev/uxf-formula-parser/blob/ci/master/src/utils/getErrorMsg.js
|
|
2
|
+
|
|
3
|
+
// function that generates an object with error information
|
|
4
|
+
export const getErrorMsg = (message, span) => {
|
|
5
|
+
return {
|
|
6
|
+
message,
|
|
7
|
+
severity: '8',
|
|
8
|
+
startLineNumber: span.start.line,
|
|
9
|
+
startColumn: span.start.col,
|
|
10
|
+
endLineNumber: span.end.line,
|
|
11
|
+
endColumn: span.end.col,
|
|
12
|
+
}
|
|
13
|
+
}
|
package/src/uxf/index.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO: This functionality is copied pretty directly from @tectonic/metadata-transform-core,
|
|
3
|
+
* which implements an id generator. Unfortunately, we can't use it due to some
|
|
4
|
+
* code in Tectonic doing weird stuff with Yargs, which breaks our `fluent --help`
|
|
5
|
+
* command.
|
|
6
|
+
*
|
|
7
|
+
* If this file is deleted in favor of leveraging a dependency on Tectonic instead
|
|
8
|
+
* (which is a good idea), we need to fix the above issue first. Test that `fluent --help` works.
|
|
9
|
+
*
|
|
10
|
+
* STRY56098244
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import * as crypto from 'crypto'
|
|
14
|
+
import { join } from 'lodash'
|
|
15
|
+
|
|
16
|
+
const HASH_ALGORITHM = 'md5'
|
|
17
|
+
const HASH_DIGEST = 'hex'
|
|
18
|
+
const HASH_SEPARATOR = ':'
|
|
19
|
+
const ID_PREFIX = 'tectonic-mvp'
|
|
20
|
+
|
|
21
|
+
const hash = (parts: string[]) => {
|
|
22
|
+
const hash = crypto.createHash(HASH_ALGORITHM)
|
|
23
|
+
hash.update(join(parts, HASH_SEPARATOR))
|
|
24
|
+
return hash.digest(HASH_DIGEST)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const componentAliasTable = {
|
|
28
|
+
'now-alert': 'eds-alert',
|
|
29
|
+
'now-alert-list': 'eds-alert-list',
|
|
30
|
+
'now-avatar': 'eds-avatar',
|
|
31
|
+
'now-badge': 'eds-badge',
|
|
32
|
+
'now-button': 'eds-button',
|
|
33
|
+
'now-button-bare': 'eds-button-bare',
|
|
34
|
+
'now-button-iconic': 'eds-button-iconic',
|
|
35
|
+
'now-checkbox': 'sn-checkbox',
|
|
36
|
+
'now-collapse': 'eds-collapse',
|
|
37
|
+
'now-collapse-trigger': 'eds-collapse-trigger',
|
|
38
|
+
'now-content-tree': 'eds-content-tree',
|
|
39
|
+
'now-date-picker': 'sn-date',
|
|
40
|
+
'now-date-range-picker': 'now-date-range-picker',
|
|
41
|
+
'now-dropdown': 'eds-dropdown',
|
|
42
|
+
'now-dropdown-panel': 'eds-dropdown-panel',
|
|
43
|
+
'now-glide-field-lookup': 'glide-field-lookup',
|
|
44
|
+
'now-heading': 'eds-heading',
|
|
45
|
+
'now-highlighted-value': 'eds-highlighted-value',
|
|
46
|
+
'now-html-editor': 'sn-html-editor',
|
|
47
|
+
'now-icon': 'eds-icon',
|
|
48
|
+
'now-icon-presence': 'eds-icon-presence',
|
|
49
|
+
'now-ip-address': 'sn-glide-ip-address',
|
|
50
|
+
'now-label-value-inline': 'eds-label-value-inline',
|
|
51
|
+
'now-label-value-stacked': 'eds-label-value-stacked',
|
|
52
|
+
'now-label-value-tabbed': 'eds-label-value-tabbed',
|
|
53
|
+
'now-legacy-icon': 'eds-legacy-icon',
|
|
54
|
+
'now-loader': 'eds-loader',
|
|
55
|
+
'now-mini-calendar': 'sn-calendar',
|
|
56
|
+
'now-modal': 'eds-modal',
|
|
57
|
+
'now-multi-record-associator': 'sn-declarative-edit-action',
|
|
58
|
+
'now-number': 'glide-number',
|
|
59
|
+
'now-pill': 'eds-pill',
|
|
60
|
+
'now-radio': 'sn-radio',
|
|
61
|
+
'now-reference': 'sn-reference',
|
|
62
|
+
'now-split-button': 'eds-split-button',
|
|
63
|
+
'now-text-link': 'eds-text-link',
|
|
64
|
+
'now-toggle': 'eds-toggle',
|
|
65
|
+
'now-tooltip': 'eds-tooltip',
|
|
66
|
+
'now-list': 'sn-component-list',
|
|
67
|
+
'sn-workspace-list-menu': 'sn-component-workspace-list-menu',
|
|
68
|
+
'sn-workspace-list-module': 'sn-component-workspace-list-module',
|
|
69
|
+
'sn-glide-currency': 'glide-currency',
|
|
70
|
+
'sn-glide-email': 'glide-email',
|
|
71
|
+
'sn-glide-input': 'glide-input',
|
|
72
|
+
'sn-glide-phone': 'glide-phone',
|
|
73
|
+
'sn-glide-reference': 'glide-reference',
|
|
74
|
+
'sn-url': 'glide-url',
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const resolveComponentName = (componentName) => componentAliasTable[componentName] || componentName
|
|
78
|
+
|
|
79
|
+
export function idGenerator(componentTagName: string) {
|
|
80
|
+
return hash([ID_PREFIX, resolveComponentName(componentTagName), 'macroponent'])
|
|
81
|
+
}
|