@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.
Files changed (166) hide show
  1. package/dist/AttachmentPlugin.d.ts +253 -0
  2. package/dist/AttachmentPlugin.js +216 -0
  3. package/dist/AttachmentPlugin.js.map +1 -0
  4. package/dist/BusinessRulePlugin.d.ts +56 -0
  5. package/dist/BusinessRulePlugin.js +171 -0
  6. package/dist/BusinessRulePlugin.js.map +1 -0
  7. package/dist/CrossScopePrivilegePlugin.d.ts +22 -0
  8. package/dist/CrossScopePrivilegePlugin.js +42 -0
  9. package/dist/CrossScopePrivilegePlugin.js.map +1 -0
  10. package/dist/DefaultPlugin.d.ts +71 -0
  11. package/dist/DefaultPlugin.js +238 -0
  12. package/dist/DefaultPlugin.js.map +1 -0
  13. package/dist/IdPlugin.d.ts +17 -0
  14. package/dist/IdPlugin.js +45 -0
  15. package/dist/IdPlugin.js.map +1 -0
  16. package/dist/ListPlugin.d.ts +91 -0
  17. package/dist/ListPlugin.js +398 -0
  18. package/dist/ListPlugin.js.map +1 -0
  19. package/dist/PropertyPlugin.d.ts +122 -0
  20. package/dist/PropertyPlugin.js +165 -0
  21. package/dist/PropertyPlugin.js.map +1 -0
  22. package/dist/ScriptTemplatePlugin.d.ts +31 -0
  23. package/dist/ScriptTemplatePlugin.js +208 -0
  24. package/dist/ScriptTemplatePlugin.js.map +1 -0
  25. package/dist/UserPreferencePlugin.d.ts +16 -0
  26. package/dist/UserPreferencePlugin.js +30 -0
  27. package/dist/UserPreferencePlugin.js.map +1 -0
  28. package/dist/aclAndRole/AclPlugin.d.ts +117 -0
  29. package/dist/aclAndRole/AclPlugin.js +285 -0
  30. package/dist/aclAndRole/AclPlugin.js.map +1 -0
  31. package/dist/aclAndRole/RolePlugin.d.ts +58 -0
  32. package/dist/aclAndRole/RolePlugin.js +152 -0
  33. package/dist/aclAndRole/RolePlugin.js.map +1 -0
  34. package/dist/aclAndRole/Util.d.ts +3 -0
  35. package/dist/aclAndRole/Util.js +106 -0
  36. package/dist/aclAndRole/Util.js.map +1 -0
  37. package/dist/app/ApplicationMenuPlugin.d.ts +32 -0
  38. package/dist/app/ApplicationMenuPlugin.js +106 -0
  39. package/dist/app/ApplicationMenuPlugin.js.map +1 -0
  40. package/dist/atf/ATFComposer.d.ts +492 -0
  41. package/dist/atf/ATFComposer.js +2717 -0
  42. package/dist/atf/ATFComposer.js.map +1 -0
  43. package/dist/atf/TestPlugin.d.ts +31 -0
  44. package/dist/atf/TestPlugin.js +95 -0
  45. package/dist/atf/TestPlugin.js.map +1 -0
  46. package/dist/atf/index.d.ts +1 -0
  47. package/dist/atf/index.js +9 -0
  48. package/dist/atf/index.js.map +1 -0
  49. package/dist/db/ColumnPlugins.d.ts +278 -0
  50. package/dist/db/ColumnPlugins.js +112 -0
  51. package/dist/db/ColumnPlugins.js.map +1 -0
  52. package/dist/db/RecordPlugin.d.ts +208 -0
  53. package/dist/db/RecordPlugin.js +287 -0
  54. package/dist/db/RecordPlugin.js.map +1 -0
  55. package/dist/db/TablePlugin.d.ts +742 -0
  56. package/dist/db/TablePlugin.js +1249 -0
  57. package/dist/db/TablePlugin.js.map +1 -0
  58. package/dist/db/index.d.ts +3 -0
  59. package/dist/db/index.js +27 -0
  60. package/dist/db/index.js.map +1 -0
  61. package/dist/index.d.ts +16 -0
  62. package/dist/index.js +51 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/scriptedRESTAPI/RESTDeserializationUtils.d.ts +12 -0
  65. package/dist/scriptedRESTAPI/RESTDeserializationUtils.js +371 -0
  66. package/dist/scriptedRESTAPI/RESTDeserializationUtils.js.map +1 -0
  67. package/dist/scriptedRESTAPI/RESTSerializationUtils.d.ts +15 -0
  68. package/dist/scriptedRESTAPI/RESTSerializationUtils.js +177 -0
  69. package/dist/scriptedRESTAPI/RESTSerializationUtils.js.map +1 -0
  70. package/dist/scriptedRESTAPI/RestApiPlugin.d.ts +144 -0
  71. package/dist/scriptedRESTAPI/RestApiPlugin.js +318 -0
  72. package/dist/scriptedRESTAPI/RestApiPlugin.js.map +1 -0
  73. package/dist/scriptedRESTAPI/RestSchemaUtils.d.ts +190 -0
  74. package/dist/scriptedRESTAPI/RestSchemaUtils.js +53 -0
  75. package/dist/scriptedRESTAPI/RestSchemaUtils.js.map +1 -0
  76. package/dist/scriptedRESTAPI/RestUtils.d.ts +75 -0
  77. package/dist/scriptedRESTAPI/RestUtils.js +469 -0
  78. package/dist/scriptedRESTAPI/RestUtils.js.map +1 -0
  79. package/dist/scripts/ClientScriptPlugin.d.ts +43 -0
  80. package/dist/scripts/ClientScriptPlugin.js +190 -0
  81. package/dist/scripts/ClientScriptPlugin.js.map +1 -0
  82. package/dist/scripts/scriptUtils.d.ts +15 -0
  83. package/dist/scripts/scriptUtils.js +83 -0
  84. package/dist/scripts/scriptUtils.js.map +1 -0
  85. package/dist/uxf/ExperiencePlugin.d.ts +22 -0
  86. package/dist/uxf/ExperiencePlugin.js +55 -0
  87. package/dist/uxf/ExperiencePlugin.js.map +1 -0
  88. package/dist/uxf/RoutesPlugin.d.ts +22 -0
  89. package/dist/uxf/RoutesPlugin.js +176 -0
  90. package/dist/uxf/RoutesPlugin.js.map +1 -0
  91. package/dist/uxf/UxfFormulaParser/cleanUxValue.d.ts +4 -0
  92. package/dist/uxf/UxfFormulaParser/cleanUxValue.js +65 -0
  93. package/dist/uxf/UxfFormulaParser/cleanUxValue.js.map +1 -0
  94. package/dist/uxf/UxfFormulaParser/grammerParser/api.d.ts +189 -0
  95. package/dist/uxf/UxfFormulaParser/grammerParser/api.js +158 -0
  96. package/dist/uxf/UxfFormulaParser/grammerParser/api.js.map +1 -0
  97. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.d.ts +13 -0
  98. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +604 -0
  99. package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js.map +1 -0
  100. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.d.ts +12 -0
  101. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
  102. package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js.map +1 -0
  103. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.d.ts +31 -0
  104. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +64 -0
  105. package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js.map +1 -0
  106. package/dist/uxf/UxfFormulaParser/index.d.ts +3 -0
  107. package/dist/uxf/UxfFormulaParser/index.js +11 -0
  108. package/dist/uxf/UxfFormulaParser/index.js.map +1 -0
  109. package/dist/uxf/UxfFormulaParser/parser.d.ts +8 -0
  110. package/dist/uxf/UxfFormulaParser/parser.js +87 -0
  111. package/dist/uxf/UxfFormulaParser/parser.js.map +1 -0
  112. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.d.ts +8 -0
  113. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js +17 -0
  114. package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js.map +1 -0
  115. package/dist/uxf/constants.d.ts +2 -0
  116. package/dist/uxf/constants.js +8 -0
  117. package/dist/uxf/constants.js.map +1 -0
  118. package/dist/uxf/index.d.ts +2 -0
  119. package/dist/uxf/index.js +11 -0
  120. package/dist/uxf/index.js.map +1 -0
  121. package/dist/uxf/tectonicIdGenerator.d.ts +12 -0
  122. package/dist/uxf/tectonicIdGenerator.js +102 -0
  123. package/dist/uxf/tectonicIdGenerator.js.map +1 -0
  124. package/license +9 -0
  125. package/package.json +42 -0
  126. package/src/AttachmentPlugin.ts +262 -0
  127. package/src/BusinessRulePlugin.ts +251 -0
  128. package/src/CrossScopePrivilegePlugin.ts +54 -0
  129. package/src/DefaultPlugin.ts +272 -0
  130. package/src/IdPlugin.ts +47 -0
  131. package/src/ListPlugin.ts +497 -0
  132. package/src/PropertyPlugin.ts +218 -0
  133. package/src/ScriptTemplatePlugin.ts +223 -0
  134. package/src/UserPreferencePlugin.ts +36 -0
  135. package/src/aclAndRole/AclPlugin.ts +410 -0
  136. package/src/aclAndRole/RolePlugin.ts +225 -0
  137. package/src/aclAndRole/Util.ts +104 -0
  138. package/src/app/ApplicationMenuPlugin.ts +158 -0
  139. package/src/atf/ATFComposer.ts +3356 -0
  140. package/src/atf/TestPlugin.ts +119 -0
  141. package/src/atf/index.ts +1 -0
  142. package/src/db/ColumnPlugins.ts +117 -0
  143. package/src/db/RecordPlugin.ts +391 -0
  144. package/src/db/TablePlugin.ts +1581 -0
  145. package/src/db/index.ts +3 -0
  146. package/src/index.ts +16 -0
  147. package/src/scriptedRESTAPI/RESTDeserializationUtils.ts +410 -0
  148. package/src/scriptedRESTAPI/RESTSerializationUtils.ts +227 -0
  149. package/src/scriptedRESTAPI/RestApiPlugin.ts +438 -0
  150. package/src/scriptedRESTAPI/RestSchemaUtils.ts +72 -0
  151. package/src/scriptedRESTAPI/RestUtils.ts +507 -0
  152. package/src/scripts/ClientScriptPlugin.ts +251 -0
  153. package/src/scripts/scriptUtils.ts +81 -0
  154. package/src/uxf/ExperiencePlugin.ts +64 -0
  155. package/src/uxf/RoutesPlugin.ts +215 -0
  156. package/src/uxf/UxfFormulaParser/cleanUxValue.ts +73 -0
  157. package/src/uxf/UxfFormulaParser/grammerParser/api.js +166 -0
  158. package/src/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +606 -0
  159. package/src/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
  160. package/src/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +65 -0
  161. package/src/uxf/UxfFormulaParser/index.ts +4 -0
  162. package/src/uxf/UxfFormulaParser/parser.ts +64 -0
  163. package/src/uxf/UxfFormulaParser/utils/getErrorMsg.ts +13 -0
  164. package/src/uxf/constants.ts +4 -0
  165. package/src/uxf/index.ts +2 -0
  166. package/src/uxf/tectonicIdGenerator.ts +81 -0
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ // Copied from sn-uxf-formula-parser-library - https://code.devsnc.com/dev/uxf-formula-parser
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.tokenSpan = tokenSpan;
5
+ exports.getBinarySpan = getBinarySpan;
6
+ exports.getUnarySpan = getUnarySpan;
7
+ exports.getBindingSpan = getBindingSpan;
8
+ /**
9
+ * https://code.devsnc.com/dev/uxf-formula-parser/blob/ci/master/src/uxf-formula-parser/grammar-parser/spanHelpers.js
10
+ */
11
+ // given a token, gets the line and col where it starts (helper function, no need to export)
12
+ function tokenStart(token) {
13
+ return {
14
+ line: token.line,
15
+ col: token.col,
16
+ };
17
+ }
18
+ // given a token, gets the line and col where it ends (helper function, no need to export)
19
+ function tokenEnd(token) {
20
+ const lastNewLine = token.text?.lastIndexOf('\n') ?? -1;
21
+ if (lastNewLine !== -1) {
22
+ throw new Error('Unsupported case: token with line breaks');
23
+ }
24
+ return {
25
+ line: token.line,
26
+ col: token.col + token.text.length,
27
+ };
28
+ }
29
+ // given two tokens, returns the span of the two tokens
30
+ function tokenSpan(token, endToken = null) {
31
+ const start = tokenStart(token);
32
+ const end = tokenEnd(endToken ?? token);
33
+ return { start, end };
34
+ }
35
+ // given two ux values (left and right operands in a binary expression), return the span of the entire expression
36
+ function getBinarySpan(left, right) {
37
+ const start = left._span.start;
38
+ const end = right._span.end;
39
+ return { start, end };
40
+ }
41
+ // given the token of the unary operator and the operand ux value, returns the span of a unary expression
42
+ function getUnarySpan(token, operand) {
43
+ const start = tokenStart(token);
44
+ const end = operand._span.end;
45
+ return { start, end };
46
+ }
47
+ // given the binding token and the address of a binding, returns the span of the binding
48
+ function getBindingSpan(token, address) {
49
+ const start = tokenStart(token);
50
+ const { line, col } = start;
51
+ var totalLength = 0;
52
+ if (address) {
53
+ for (let i = 0; i < address.length; i++) {
54
+ totalLength += address[i].length;
55
+ if (i !== 0) {
56
+ totalLength += 1;
57
+ }
58
+ }
59
+ }
60
+ const endCol = col + token.value.length + totalLength;
61
+ const end = { line, col: endCol };
62
+ return { start, end };
63
+ }
64
+ //# sourceMappingURL=spanHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanHelpers.js","sourceRoot":"","sources":["../../../../src/uxf/UxfFormulaParser/grammerParser/spanHelpers.js"],"names":[],"mappings":";AAAA,6FAA6F;;AA2B7F,8BAKC;AAGD,sCAIC;AAGD,oCAIC;AAGD,wCAeC;AA9DD;;GAEG;AAEH,4FAA4F;AAC5F,SAAS,UAAU,CAAC,KAAK;IACrB,OAAO;QACH,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,KAAK,CAAC,GAAG;KACjB,CAAA;AACL,CAAC;AAED,0FAA0F;AAC1F,SAAS,QAAQ,CAAC,KAAK;IACnB,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACvD,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;IAC/D,CAAC;IACD,OAAO;QACH,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM;KACrC,CAAA;AACL,CAAC;AAED,uDAAuD;AACvD,SAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAC5C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAC/B,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAA;IAEvC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;AACzB,CAAC;AAED,iHAAiH;AACjH,SAAgB,aAAa,CAAC,IAAI,EAAE,KAAK;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;IAC9B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAA;IAC3B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;AACzB,CAAC;AAED,yGAAyG;AACzG,SAAgB,YAAY,CAAC,KAAK,EAAE,OAAO;IACvC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAA;IAC7B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;AACzB,CAAC;AAED,wFAAwF;AACxF,SAAgB,cAAc,CAAC,KAAK,EAAE,OAAO;IACzC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAK,CAAA;IAC3B,IAAI,WAAW,GAAG,CAAC,CAAA;IACnB,IAAI,OAAO,EAAE,CAAC;QACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;YAChC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACV,WAAW,IAAI,CAAC,CAAA;YACpB,CAAC;QACL,CAAC;IACL,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAA;IACrD,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;IACjC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;AACzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import UxfFormulaParser from './parser';
2
+ import { cleanUxValue } from './cleanUxValue';
3
+ export { UxfFormulaParser as parser, cleanUxValue };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.cleanUxValue = exports.parser = void 0;
7
+ const parser_1 = __importDefault(require("./parser"));
8
+ exports.parser = parser_1.default;
9
+ const cleanUxValue_1 = require("./cleanUxValue");
10
+ Object.defineProperty(exports, "cleanUxValue", { enumerable: true, get: function () { return cleanUxValue_1.cleanUxValue; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/uxf/UxfFormulaParser/index.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAuC;AAGV,iBAHtB,gBAAgB,CAGY;AAFnC,iDAA6C;AAER,6FAF5B,2BAAY,OAE4B"}
@@ -0,0 +1,8 @@
1
+ declare class UxfFormulaParser {
2
+ constructor();
3
+ parse(expression: any): {
4
+ result: any;
5
+ errors: any[];
6
+ };
7
+ }
8
+ export default UxfFormulaParser;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ // Copied from sn-uxf-formula-parser-library - https://code.devsnc.com/dev/uxf-formula-parser
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ var __importDefault = (this && this.__importDefault) || function (mod) {
27
+ return (mod && mod.__esModule) ? mod : { "default": mod };
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ /**
31
+ * https://code.devsnc.com/dev/uxf-formula-parser/blob/ci/master/src/uxf-formula-parser/parser/expressionParser.js
32
+ */
33
+ const nearley_1 = __importDefault(require("nearley"));
34
+ const grammar = __importStar(require("./grammerParser/grammarParser.js"));
35
+ const getErrorMsg_1 = require("./utils/getErrorMsg");
36
+ class UxfFormulaParser {
37
+ constructor() { }
38
+ parse(expression) {
39
+ let ans;
40
+ const parser = new nearley_1.default.Parser(nearley_1.default.Grammar.fromCompiled(grammar));
41
+ parser.reportError = function (token) {
42
+ const message = token.value
43
+ ? `Invalid Syntax: did not expect the token "${token.value}" when parsing expression.`
44
+ : 'Invalid Syntax: unparsable expression entered';
45
+ throw (0, getErrorMsg_1.getErrorMsg)(message, {
46
+ start: { line: token.line, col: token.col },
47
+ end: { line: token.line, col: token.col + token.value.length },
48
+ });
49
+ };
50
+ try {
51
+ // Make a parser and feed the input
52
+ ans = parser.feed(expression);
53
+ // Check if there are any results
54
+ if (ans.results.length) {
55
+ return {
56
+ result: ans.results[0],
57
+ errors: [],
58
+ };
59
+ }
60
+ else {
61
+ // This means the input is incomplete.
62
+ const out = 'Error: incomplete input, parse failed. :(';
63
+ return {
64
+ result: out,
65
+ errors: [
66
+ {
67
+ message: 'Syntax error: Incomplete formula.',
68
+ severity: '8',
69
+ startLineNumber: ans.lexerState.line,
70
+ startColumn: ans.lexerState.col,
71
+ endLineNumber: ans.lexerState.line,
72
+ endColumn: ans.lexerState.col + 1,
73
+ },
74
+ ],
75
+ };
76
+ }
77
+ }
78
+ catch (e) {
79
+ return {
80
+ result: e.message,
81
+ errors: [e],
82
+ };
83
+ }
84
+ }
85
+ }
86
+ exports.default = UxfFormulaParser;
87
+ //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,GAAG,GAAG,2CAA2C,CAAA;gBACvD,OAAO;oBACH,MAAM,EAAE,GAAG;oBACX,MAAM,EAAE;wBACJ;4BACI,OAAO,EAAE,mCAAmC;4BAC5C,QAAQ,EAAE,GAAG;4BACb,eAAe,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI;4BACpC,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG;4BAC/B,aAAa,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI;4BAClC,SAAS,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC;yBACpC;qBACJ;iBACJ,CAAA;YACL,CAAC;QACL,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YACd,OAAO;gBACH,MAAM,EAAE,CAAC,CAAC,OAAO;gBACjB,MAAM,EAAE,CAAC,CAAC,CAAC;aACd,CAAA;QACL,CAAC;IACL,CAAC;CACJ;AAED,kBAAe,gBAAgB,CAAA"}
@@ -0,0 +1,8 @@
1
+ export declare const getErrorMsg: (message: any, span: any) => {
2
+ message: any;
3
+ severity: string;
4
+ startLineNumber: any;
5
+ startColumn: any;
6
+ endLineNumber: any;
7
+ endColumn: any;
8
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // Copied from https://code.devsnc.com/dev/uxf-formula-parser/blob/ci/master/src/utils/getErrorMsg.js
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.getErrorMsg = void 0;
5
+ // function that generates an object with error information
6
+ const getErrorMsg = (message, span) => {
7
+ return {
8
+ message,
9
+ severity: '8',
10
+ startLineNumber: span.start.line,
11
+ startColumn: span.start.col,
12
+ endLineNumber: span.end.line,
13
+ endColumn: span.end.col,
14
+ };
15
+ };
16
+ exports.getErrorMsg = getErrorMsg;
17
+ //# sourceMappingURL=getErrorMsg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getErrorMsg.js","sourceRoot":"","sources":["../../../../src/uxf/UxfFormulaParser/utils/getErrorMsg.ts"],"names":[],"mappings":";AAAA,qGAAqG;;;AAErG,2DAA2D;AACpD,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;IACzC,OAAO;QACH,OAAO;QACP,QAAQ,EAAE,GAAG;QACb,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;QAChC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;QAC3B,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI;QAC5B,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG;KAC1B,CAAA;AACL,CAAC,CAAA;AATY,QAAA,WAAW,eASvB"}
@@ -0,0 +1,2 @@
1
+ export declare const WORKSPACE_APP_SHELL_ID = "c276387cc331101080d6d3658940ddd2";
2
+ export declare const PARENT_APP_SHELL_ID = "c86a62e2c7022010099a308dc7c26022";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PARENT_APP_SHELL_ID = exports.WORKSPACE_APP_SHELL_ID = void 0;
4
+ // Workspace app shell ID
5
+ exports.WORKSPACE_APP_SHELL_ID = 'c276387cc331101080d6d3658940ddd2';
6
+ // Polaris app shell ID
7
+ exports.PARENT_APP_SHELL_ID = 'c86a62e2c7022010099a308dc7c26022';
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/uxf/constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACZ,QAAA,sBAAsB,GAAG,kCAAkC,CAAA;AACxE,uBAAuB;AACV,QAAA,mBAAmB,GAAG,kCAAkC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default as ExperiencePlugin } from './ExperiencePlugin';
2
+ export { default as RoutesPlugin } from './RoutesPlugin';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RoutesPlugin = exports.ExperiencePlugin = void 0;
7
+ var ExperiencePlugin_1 = require("./ExperiencePlugin");
8
+ Object.defineProperty(exports, "ExperiencePlugin", { enumerable: true, get: function () { return __importDefault(ExperiencePlugin_1).default; } });
9
+ var RoutesPlugin_1 = require("./RoutesPlugin");
10
+ Object.defineProperty(exports, "RoutesPlugin", { enumerable: true, get: function () { return __importDefault(RoutesPlugin_1).default; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/uxf/index.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAgE;AAAvD,qIAAA,OAAO,OAAoB;AACpC,+CAAwD;AAA/C,6HAAA,OAAO,OAAgB"}
@@ -0,0 +1,12 @@
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
+ export declare function idGenerator(componentTagName: string): string;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ /**
3
+ * TODO: This functionality is copied pretty directly from @tectonic/metadata-transform-core,
4
+ * which implements an id generator. Unfortunately, we can't use it due to some
5
+ * code in Tectonic doing weird stuff with Yargs, which breaks our `fluent --help`
6
+ * command.
7
+ *
8
+ * If this file is deleted in favor of leveraging a dependency on Tectonic instead
9
+ * (which is a good idea), we need to fix the above issue first. Test that `fluent --help` works.
10
+ *
11
+ * STRY56098244
12
+ */
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.idGenerator = idGenerator;
38
+ const crypto = __importStar(require("crypto"));
39
+ const lodash_1 = require("lodash");
40
+ const HASH_ALGORITHM = 'md5';
41
+ const HASH_DIGEST = 'hex';
42
+ const HASH_SEPARATOR = ':';
43
+ const ID_PREFIX = 'tectonic-mvp';
44
+ const hash = (parts) => {
45
+ const hash = crypto.createHash(HASH_ALGORITHM);
46
+ hash.update((0, lodash_1.join)(parts, HASH_SEPARATOR));
47
+ return hash.digest(HASH_DIGEST);
48
+ };
49
+ const componentAliasTable = {
50
+ 'now-alert': 'eds-alert',
51
+ 'now-alert-list': 'eds-alert-list',
52
+ 'now-avatar': 'eds-avatar',
53
+ 'now-badge': 'eds-badge',
54
+ 'now-button': 'eds-button',
55
+ 'now-button-bare': 'eds-button-bare',
56
+ 'now-button-iconic': 'eds-button-iconic',
57
+ 'now-checkbox': 'sn-checkbox',
58
+ 'now-collapse': 'eds-collapse',
59
+ 'now-collapse-trigger': 'eds-collapse-trigger',
60
+ 'now-content-tree': 'eds-content-tree',
61
+ 'now-date-picker': 'sn-date',
62
+ 'now-date-range-picker': 'now-date-range-picker',
63
+ 'now-dropdown': 'eds-dropdown',
64
+ 'now-dropdown-panel': 'eds-dropdown-panel',
65
+ 'now-glide-field-lookup': 'glide-field-lookup',
66
+ 'now-heading': 'eds-heading',
67
+ 'now-highlighted-value': 'eds-highlighted-value',
68
+ 'now-html-editor': 'sn-html-editor',
69
+ 'now-icon': 'eds-icon',
70
+ 'now-icon-presence': 'eds-icon-presence',
71
+ 'now-ip-address': 'sn-glide-ip-address',
72
+ 'now-label-value-inline': 'eds-label-value-inline',
73
+ 'now-label-value-stacked': 'eds-label-value-stacked',
74
+ 'now-label-value-tabbed': 'eds-label-value-tabbed',
75
+ 'now-legacy-icon': 'eds-legacy-icon',
76
+ 'now-loader': 'eds-loader',
77
+ 'now-mini-calendar': 'sn-calendar',
78
+ 'now-modal': 'eds-modal',
79
+ 'now-multi-record-associator': 'sn-declarative-edit-action',
80
+ 'now-number': 'glide-number',
81
+ 'now-pill': 'eds-pill',
82
+ 'now-radio': 'sn-radio',
83
+ 'now-reference': 'sn-reference',
84
+ 'now-split-button': 'eds-split-button',
85
+ 'now-text-link': 'eds-text-link',
86
+ 'now-toggle': 'eds-toggle',
87
+ 'now-tooltip': 'eds-tooltip',
88
+ 'now-list': 'sn-component-list',
89
+ 'sn-workspace-list-menu': 'sn-component-workspace-list-menu',
90
+ 'sn-workspace-list-module': 'sn-component-workspace-list-module',
91
+ 'sn-glide-currency': 'glide-currency',
92
+ 'sn-glide-email': 'glide-email',
93
+ 'sn-glide-input': 'glide-input',
94
+ 'sn-glide-phone': 'glide-phone',
95
+ 'sn-glide-reference': 'glide-reference',
96
+ 'sn-url': 'glide-url',
97
+ };
98
+ const resolveComponentName = (componentName) => componentAliasTable[componentName] || componentName;
99
+ function idGenerator(componentTagName) {
100
+ return hash([ID_PREFIX, resolveComponentName(componentTagName), 'macroponent']);
101
+ }
102
+ //# sourceMappingURL=tectonicIdGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectonicIdGenerator.js","sourceRoot":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B,EAAE,yBAAyB;IACpD,wBAAwB,EAAE,wBAAwB;IAClD,iBAAiB,EAAE,iBAAiB;IACpC,YAAY,EAAE,YAAY;IAC1B,mBAAmB,EAAE,aAAa;IAClC,WAAW,EAAE,WAAW;IACxB,6BAA6B,EAAE,4BAA4B;IAC3D,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,UAAU;IACtB,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,cAAc;IAC/B,kBAAkB,EAAE,kBAAkB;IACtC,eAAe,EAAE,eAAe;IAChC,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,UAAU,EAAE,mBAAmB;IAC/B,wBAAwB,EAAE,kCAAkC;IAC5D,0BAA0B,EAAE,oCAAoC;IAChE,mBAAmB,EAAE,gBAAgB;IACrC,gBAAgB,EAAE,aAAa;IAC/B,gBAAgB,EAAE,aAAa;IAC/B,gBAAgB,EAAE,aAAa;IAC/B,oBAAoB,EAAE,iBAAiB;IACvC,QAAQ,EAAE,WAAW;CACxB,CAAA;AAED,MAAM,oBAAoB,GAAG,CAAC,aAAa,EAAE,EAAE,CAAC,mBAAmB,CAAC,aAAa,CAAC,IAAI,aAAa,CAAA;AAEnG,SAAgB,WAAW,CAAC,gBAAwB;IAChD,OAAO,IAAI,CAAC,CAAC,SAAS,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;AACnF,CAAC"}
package/license ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 ServiceNow Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@servicenow/sdk-build-plugins",
3
+ "version": "2.0.1",
4
+ "description": "ServiceNow SDK Build System Plugins",
5
+ "license": "MIT",
6
+ "main": "./dist/index.js",
7
+ "files": [
8
+ "dist",
9
+ "src"
10
+ ],
11
+ "dependencies": {
12
+ "@ts-morph/common": "0.24.0",
13
+ "fast-xml-parser": "4.4.1",
14
+ "lodash": "4.17.21",
15
+ "moo": "0.5.2",
16
+ "nearley": "2.20.1",
17
+ "ts-morph": "23.0.0",
18
+ "zod": "3.22.4",
19
+ "@servicenow/sdk-build-core": "2.0.1",
20
+ "@servicenow/sdk-core": "2.0.1",
21
+ "@servicenow/sdk-metrics": "2.0.1",
22
+ "@servicenow/sdk-project": "2.0.1"
23
+ },
24
+ "overrides": {
25
+ "micromatch": "^4.0.7"
26
+ },
27
+ "devDependencies": {
28
+ "@types/lodash": "4.14.195"
29
+ },
30
+ "engines": {
31
+ "node": ">=18.16.1",
32
+ "pnpm": ">=9.4.0"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -b",
36
+ "clean": "tsc -b --clean",
37
+ "lint": "eslint . --ext .ts",
38
+ "prettier:check": "prettier --check --ignore-path=../../.prettierignore .",
39
+ "prettier:write": "prettier --write --ignore-path=../../.prettierignore .",
40
+ "watch": "tsc -b -w"
41
+ }
42
+ }