@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,190 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.isRequire = isRequire;
27
+ const clientscript_1 = require("@servicenow/sdk-core/runtime/clientscript");
28
+ const sdk_build_core_1 = require("@servicenow/sdk-build-core");
29
+ const db_1 = require("@servicenow/sdk-core/runtime/db");
30
+ const clientscript_2 = require("@servicenow/sdk-core/runtime/clientscript");
31
+ const zod_1 = require("zod");
32
+ const ts = __importStar(require("ts-morph"));
33
+ const ScriptTemplatePlugin_1 = require("../ScriptTemplatePlugin");
34
+ const sdk_project_1 = require("@servicenow/sdk-project");
35
+ const scriptUtils_1 = require("./scriptUtils");
36
+ const UITypeMapping = {
37
+ desktop: 0,
38
+ mobile_or_service_portal: 1,
39
+ all: 10,
40
+ };
41
+ const ClientScriptXmlSchema = clientscript_2.ClientScriptSchema.extend({
42
+ table: zod_1.z.string(),
43
+ ui_type: zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1), zod_1.z.literal(10)]),
44
+ sys_class_name: zod_1.z.literal('sys_script_client'),
45
+ });
46
+ const PartialClientScriptXMLSchema = ClientScriptXmlSchema.partial();
47
+ exports.default = (0, sdk_build_core_1.Plugin)({
48
+ name: 'ClientScript',
49
+ ownedTables: {
50
+ sys_script_client: { diagnosticLevel: sdk_project_1.Diagnostic.Level.Warn },
51
+ },
52
+ extractors: {
53
+ entity: {
54
+ CallExpression: (node, context) => {
55
+ const result = (0, sdk_build_core_1.extractCallExpression)(clientscript_1.ClientScript, 'clientScript', node, context, (script) => context.registerExplicitId('sys_script_client', script.$id));
56
+ if (!result.handled || !(0 in result.data)) {
57
+ return result;
58
+ }
59
+ const clientScriptEntityData = result.data[0];
60
+ const args = node.getArguments()[0];
61
+ if (!args) {
62
+ result.diagnostics.push(new sdk_build_core_1.FluentDiagnostic(node, 'Client script arguments are missing'));
63
+ return result;
64
+ }
65
+ const diagnostics = result.diagnostics;
66
+ const data = clientscript_2.ClientScriptSchema.parse(clientScriptEntityData.getValue());
67
+ const { script, type, field } = data;
68
+ if (field && !type) {
69
+ diagnostics.push(new sdk_build_core_1.FluentDiagnostic(args.getProperty('field'), `Field values are allowed only when type is set to onChange or onCellEdit`));
70
+ }
71
+ if (script && !validateClientSideScripts(script, context)) {
72
+ diagnostics.push(new sdk_build_core_1.FluentDiagnostic(args.getProperty('script'), `Client side scripts cannot import or require modules.`));
73
+ }
74
+ /**
75
+ * Removing this diagnostic : Currently on instance if you empty script field and click update, it would show basic template set
76
+ * for the field but the xml is not updated. Only after saving it again the xml gets updated with basic template.
77
+ */
78
+ // if (type && !script) {
79
+ // diagnostics.push(
80
+ // new FluentDiagnostic(
81
+ // args.getProperty('type')!,
82
+ // `Cannot have empty script value for type: ${type}`
83
+ // )
84
+ // )
85
+ // }
86
+ const record = createClientScriptRecord(data, script);
87
+ return {
88
+ handled: true,
89
+ diagnostics,
90
+ data: [
91
+ new sdk_build_core_1.EntityData('record', clientScriptEntityData.getGuid(), sdk_build_core_1.ObjectData.fromObjectValue(record, node), node),
92
+ ],
93
+ };
94
+ },
95
+ },
96
+ },
97
+ generators: {
98
+ record(document, context) {
99
+ if (!ClientScriptXmlSchema.safeParse(document.data['data']).success) {
100
+ return undefined;
101
+ }
102
+ return (0, sdk_build_core_1.linkDocument)(document, (0, sdk_build_core_1.generateCallExpressionExportForDocument)(context, {
103
+ sourceFile: (0, sdk_build_core_1.getOrCreateEntitySourceFile)(context, (0, sdk_build_core_1.getSysUpdateName)(document, 'sys_script_client')),
104
+ moduleSpecifier: '@servicenow/sdk/core',
105
+ }, clientscript_1.ClientScript, {
106
+ $id: document.guid,
107
+ }).getExpressionIfKindOrThrow(ts.SyntaxKind.CallExpression));
108
+ },
109
+ },
110
+ transformers: {
111
+ record: {
112
+ CallExpression(document, context) {
113
+ if ((0, sdk_build_core_1.getCallExpressionName)(document.node) !== clientscript_1.ClientScript.name) {
114
+ return false;
115
+ }
116
+ if (document.action === 'DELETE') {
117
+ (0, sdk_build_core_1.removeNode)(document.node);
118
+ return true;
119
+ }
120
+ const modifiedClientScriptProps = ClientScriptXmlSchema.partial().safeParse(document.changedData.data);
121
+ if (!modifiedClientScriptProps.success) {
122
+ return false;
123
+ }
124
+ return transformClientScriptArguments(document.guid, document.node, context, (0, scriptUtils_1.except)(modifiedClientScriptProps.data, (key) => key === 'sys_class_name'));
125
+ },
126
+ },
127
+ },
128
+ });
129
+ function validateClientSideScripts(script, context) {
130
+ const source = context.compiler.createSourceFile('tmp-file.ts', script);
131
+ const importDeclarations = source.getDescendantsOfKind(ts.SyntaxKind.ImportDeclaration);
132
+ const requireCalls = source.getDescendantsOfKind(ts.SyntaxKind.CallExpression).filter((callExpression) => {
133
+ return isRequire(callExpression);
134
+ });
135
+ const isValid = !(importDeclarations.length > 0 || requireCalls.length > 0);
136
+ context.compiler.removeSourceFile(source);
137
+ return isValid;
138
+ }
139
+ function getUITypeFromId(id) {
140
+ const type = Object.keys(UITypeMapping).find((e) => UITypeMapping[e] === id);
141
+ if (!type) {
142
+ throw Error('Invalid UI Type encountered, check XML data before transforming again.');
143
+ }
144
+ return type;
145
+ }
146
+ function transformClientScriptArguments(documentId, node, context, data) {
147
+ const argNode = node.getArguments()[0].asKindOrThrow(ts.SyntaxKind.ObjectLiteralExpression);
148
+ const { script, table, ui_type, type, ...rest } = data;
149
+ if (type !== undefined) {
150
+ if (type) {
151
+ (0, sdk_build_core_1.writeCustomProperty)(argNode, 'type', '', (0, sdk_build_core_1.stringify)(type));
152
+ }
153
+ else {
154
+ argNode.getProperty('type')?.remove();
155
+ }
156
+ }
157
+ if (Object.values(UITypeMapping).some((value) => value === ui_type)) {
158
+ const uiType = getUITypeFromId(ui_type);
159
+ (0, sdk_build_core_1.writeCustomProperty)(argNode, 'ui_type', '', (0, sdk_build_core_1.stringify)(uiType));
160
+ }
161
+ if (table) {
162
+ (0, sdk_build_core_1.writeCustomProperty)(argNode, 'table', '{}', (0, sdk_build_core_1.stringify)(table));
163
+ }
164
+ if (script !== undefined) {
165
+ (0, ScriptTemplatePlugin_1.processScript)(argNode, 'script', script, documentId, 'sys_script_client', context);
166
+ }
167
+ (0, sdk_build_core_1.mergeDataIntoObjectLiteral)(argNode, rest);
168
+ return true;
169
+ }
170
+ function createClientScriptRecord(data, script) {
171
+ data.script = script;
172
+ const { $id, ...csData } = clientscript_2.ClientScriptSchema.parse(data);
173
+ csData.ui_type = getUITypeId(csData.ui_type);
174
+ return (0, db_1.Record)({
175
+ table: 'sys_script_client',
176
+ $id,
177
+ data: csData,
178
+ });
179
+ }
180
+ function getUITypeId(value) {
181
+ if (value in UITypeMapping) {
182
+ return UITypeMapping[value];
183
+ }
184
+ throw Error('Invalid ui_type found in xml');
185
+ }
186
+ function isRequire(callExpression) {
187
+ const expression = callExpression.getExpression();
188
+ return ts.Node.isIdentifier(expression) && expression.getText() === 'require';
189
+ }
190
+ //# sourceMappingURL=ClientScriptPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientScriptPlugin.js","sourceRoot":"","sources":["../../src/scripts/ClientScript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AQ,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAA;IACtF,CAAC;IAED,IAAA,2CAA0B,EAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAEzC,OAAO,IAAI,CAAA;AACf,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAwB,EAAE,MAAc;IACtE,IAAI,CAAC,MAAM,GAAG,MAAa,CAAA;IAC3B,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,iCAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACzD,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5C,OAAO,IAAA,WAAM,EAAC;QACV,KAAK,EAAE,mBAAmB;QAC1B,GAAG;QACH,IAAI,EAAE,MAAa;KACtB,CAAC,CAAA;AACN,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAC9B,IAAI,KAAK,IAAI,aAAa,EAAE,CAAC;QACzB,OAAO,aAAa,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;IACD,MAAM,KAAK,CAAC,8BAA8B,CAAC,CAAA;AAC/C,CAAC;AAED,SAAgB,SAAS,CAAC,cAAiC;IACvD,MAAM,UAAU,GAAG,cAAc,CAAC,aAAa,EAAE,CAAA;IACjD,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,SAAS,CAAA;AACjF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Context, ObjectData } from '@servicenow/sdk-build-core';
2
+ import { Node } from 'ts-morph';
3
+ export type ScriptInfo = {
4
+ filePath: string;
5
+ functionName: string;
6
+ isDefault: boolean;
7
+ event?: string;
8
+ };
9
+ export declare function scriptInfo(node: Node, context: Context, pluginName: string): ObjectData<{
10
+ readonly filePath: string;
11
+ readonly functionName: string | undefined;
12
+ readonly isDefault: boolean;
13
+ }> | undefined;
14
+ export declare function except(obj: object, excludePredicate: (string: any) => boolean): {};
15
+ export declare function buildScriptImport(scriptFileImport: string, importName: string, isDefault: boolean, context: Context, codeFunc: (funcName: string) => string): string;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.scriptInfo = scriptInfo;
27
+ exports.except = except;
28
+ exports.buildScriptImport = buildScriptImport;
29
+ const sdk_build_core_1 = require("@servicenow/sdk-build-core");
30
+ const path = __importStar(require("path"));
31
+ const ts_morph_1 = require("ts-morph");
32
+ function scriptInfo(node, context, pluginName) {
33
+ if (!context.store) {
34
+ return;
35
+ }
36
+ if (context.store[sdk_build_core_1.CURRENT_CALL_EXPRESSION] !== pluginName) {
37
+ if (pluginName !== 'Table' && context.store[sdk_build_core_1.CURRENT_CALL_EXPRESSION].includes('Column')) {
38
+ return;
39
+ }
40
+ }
41
+ if (node.isKind(ts_morph_1.SyntaxKind.FunctionDeclaration)) {
42
+ return sdk_build_core_1.ObjectData.fromObjectValue({
43
+ filePath: path.normalize(node.getSourceFile().getFilePath()),
44
+ functionName: node.getName(),
45
+ isDefault: node.isDefaultExport(),
46
+ }, node);
47
+ }
48
+ if (node.isKind(ts_morph_1.SyntaxKind.FunctionExpression)) {
49
+ const parent = node.getParentIfKind(ts_morph_1.SyntaxKind.VariableDeclaration);
50
+ if (!parent) {
51
+ return;
52
+ }
53
+ return sdk_build_core_1.ObjectData.fromObjectValue({
54
+ filePath: path.normalize(node.getSourceFile().getFilePath()),
55
+ functionName: parent.getName(),
56
+ isDefault: parent.isDefaultExport(),
57
+ }, node);
58
+ }
59
+ return;
60
+ }
61
+ function except(obj, excludePredicate) {
62
+ return Object.keys(obj)
63
+ .filter((k) => !excludePredicate(k))
64
+ .reduce((acc, k) => ({ ...acc, [k]: obj[k] }), {});
65
+ }
66
+ function buildScriptImport(scriptFileImport, importName, isDefault, context, codeFunc) {
67
+ scriptFileImport = scriptFileImport.replace(/\.ts$/, '.js');
68
+ const func_name = importName ?? path.basename(scriptFileImport, '.js');
69
+ let relativeImport = scriptFileImport.replace(context.app.rootDir, '');
70
+ relativeImport = relativeImport.replace(context.app.config.sourceDir, context.app.config.transpiledSourceDir);
71
+ relativeImport = relativeImport.replaceAll(path.sep, path.posix.sep);
72
+ if (relativeImport.startsWith(path.posix.sep)) {
73
+ relativeImport = relativeImport.substring(1);
74
+ }
75
+ if (isDefault) {
76
+ scriptFileImport = `const ${func_name} = require('./${relativeImport}').default\n` + codeFunc(func_name);
77
+ }
78
+ else {
79
+ scriptFileImport = `const { ${func_name} } = require('./${relativeImport}')\n` + codeFunc(func_name);
80
+ }
81
+ return scriptFileImport;
82
+ }
83
+ //# sourceMappingURL=scriptUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scriptUtils.js","sourceRoot":"","sources":["../../src/scripts/scriptUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,gCAuCC;AAED,wB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AAc,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC5G,CAAC;SAAM,CAAC;QACJ,gBAAgB,GAAG,WAAW,SAAS,mBAAmB,cAAc,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IACxG,CAAC;IACD,OAAO,gBAAgB,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { Experience } from '@servicenow/sdk-core/runtime/experience';
2
+ import { EntityData } from '@servicenow/sdk-build-core';
3
+ import { Diagnostic } from '@servicenow/sdk-project';
4
+ declare const _default: {
5
+ readonly name: "Experience";
6
+ readonly ownedTables: {
7
+ readonly sys_ux_app_config: {
8
+ readonly diagnosticLevel: Diagnostic.Level.Warn;
9
+ };
10
+ };
11
+ readonly extractors: {
12
+ readonly entity: {
13
+ readonly CallExpression: (node: import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").ExtractionResult<EntityData<Experience>>;
14
+ };
15
+ };
16
+ readonly composers: {
17
+ readonly entity: {
18
+ readonly experience: (entity: EntityData<globalThis.Record<string, unknown>>, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").LinkedDocument[];
19
+ };
20
+ };
21
+ };
22
+ export default _default;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const experience_1 = require("@servicenow/sdk-core/runtime/experience");
4
+ const db_1 = require("@servicenow/sdk-core/runtime/db");
5
+ const sdk_build_core_1 = require("@servicenow/sdk-build-core");
6
+ const constants_1 = require("./constants");
7
+ const RecordPlugin_1 = require("../db/RecordPlugin");
8
+ const sdk_project_1 = require("@servicenow/sdk-project");
9
+ exports.default = (0, sdk_build_core_1.Plugin)({
10
+ name: 'Experience',
11
+ ownedTables: {
12
+ sys_ux_app_config: { diagnosticLevel: sdk_project_1.Diagnostic.Level.Warn },
13
+ },
14
+ extractors: {
15
+ entity: {
16
+ CallExpression: (node, context) => (0, sdk_build_core_1.extractCallExpression)(experience_1.Experience, 'experience', node, context, (experience) => context.registerExplicitId('sys_ux_app_config', experience.$id)),
17
+ },
18
+ },
19
+ composers: {
20
+ entity: {
21
+ experience(entity, context) {
22
+ const node = entity.getNode();
23
+ const data = entity.getValue();
24
+ const guid = entity.getGuid();
25
+ const recordData = experience_1.ExperienceSchema.parse(data);
26
+ const appConfig = (0, db_1.Record)({
27
+ table: 'sys_ux_app_config',
28
+ $id: guid,
29
+ data: {
30
+ name: recordData.name,
31
+ active: recordData.active,
32
+ base_url_path: recordData.baseUrlPath,
33
+ landing_path: recordData.landingPath,
34
+ description: recordData.description,
35
+ },
36
+ });
37
+ const pageRegistry = (0, db_1.Record)({
38
+ table: 'sys_ux_page_registry',
39
+ $id: context.registerExplicitId('sys_ux_page_registry', `${guid}_registry`),
40
+ data: {
41
+ title: recordData.name,
42
+ active: recordData.active,
43
+ admin_panel: appConfig,
44
+ admin_panel_table: 'sys_ux_app_config',
45
+ parent_app: constants_1.PARENT_APP_SHELL_ID,
46
+ path: recordData.baseUrlPath,
47
+ root_macroponent: constants_1.WORKSPACE_APP_SHELL_ID,
48
+ },
49
+ });
50
+ return context.composeEntities([appConfig, pageRegistry].map((r) => new sdk_build_core_1.EntityData('record', r.$id, sdk_build_core_1.ObjectData.fromObjectValue(r, node), node)), [RecordPlugin_1.RecordPlugin]);
51
+ },
52
+ },
53
+ },
54
+ });
55
+ //# sourceMappingURL=ExperiencePlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExperiencePlugin.js","sourceRoot":"","sources":["../../src/uxf/ExperiencePlugin.ts"],"names":[],"mappings":";;AAAA,wEAAsF;AACtF,wDAAwD;AACxD,+DAAkG;AAClG,2CAAyE;AACzE,qDAAiD;AACjD,yDAAoD;AAEpD,kBAAe,IAAA,uBAAM,EAAC;IAClB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE;QACT,iBAAiB,EAAE,EAAE,eAAe,EAAE,wBAA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wBACtB,iBAAiB,EAAE,mBAAmB;wBACtC,UAAU,EAAE,+BAAmB;wBAC/B,IAAI,EAAE,UAAU,CAAC,WAAW;wBAC5B,gBAAgB,EAAE,kCAAsB;qBAC3C;iBACJ,CAAC,CAAA;gBAEF,OAAO,OAAO,CAAC,eAAe,CAC1B,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,GAAG,CACzB,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,2BAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAa,EAAE,2BAAU,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAC9F,EACD,CAAC,2BAAY,CAAC,CACjB,CAAA;YACL,CAAC;SACJ;KACJ;CACJ,CAAC,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { Routes } from '@servicenow/sdk-core/runtime/experience';
2
+ import { EntityData } from '@servicenow/sdk-build-core';
3
+ import { Diagnostic } from '@servicenow/sdk-project';
4
+ declare const _default: {
5
+ readonly name: "Routes";
6
+ readonly ownedTables: {
7
+ readonly sys_ux_app_route: {
8
+ readonly diagnosticLevel: Diagnostic.Level.Warn;
9
+ };
10
+ };
11
+ readonly extractors: {
12
+ readonly entity: {
13
+ readonly CallExpression: (node: import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").ExtractionResult<EntityData<Routes>>;
14
+ };
15
+ };
16
+ readonly composers: {
17
+ readonly entity: {
18
+ readonly routes: (entity: EntityData<globalThis.Record<string, unknown>>, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").LinkedDocument[];
19
+ };
20
+ };
21
+ };
22
+ export default _default;
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const experience_1 = require("@servicenow/sdk-core/runtime/experience");
4
+ const db_1 = require("@servicenow/sdk-core/runtime/db");
5
+ const sdk_metrics_1 = require("@servicenow/sdk-metrics");
6
+ const sdk_build_core_1 = require("@servicenow/sdk-build-core");
7
+ const UxfFormulaParser_1 = require("./UxfFormulaParser");
8
+ const tectonicIdGenerator_1 = require("./tectonicIdGenerator");
9
+ const constants_1 = require("./constants");
10
+ const RecordPlugin_1 = require("../db/RecordPlugin");
11
+ const sdk_project_1 = require("@servicenow/sdk-project");
12
+ const PAGE_TEMPLATE_SYS_ID = '19be392623033300f4b4c50947bf65ba';
13
+ function getRouteParts(route) {
14
+ const chunks = route.split('/').filter((chunk) => chunk && chunk.length > 0);
15
+ if (chunks.length === 0) {
16
+ throw new sdk_metrics_1.SdkError('Invalid route - routes may not be empty', { type: 'plugin_error' });
17
+ }
18
+ const parts = {
19
+ pathname: chunks[0] || '',
20
+ parameters: {
21
+ required: [],
22
+ optional: [],
23
+ },
24
+ };
25
+ chunks.forEach((part) => {
26
+ if (part.startsWith(':')) {
27
+ if (part.endsWith('?')) {
28
+ parts.parameters.optional.push(part.slice(1, -1));
29
+ }
30
+ else {
31
+ parts.parameters.required.push(part.slice(1));
32
+ }
33
+ }
34
+ });
35
+ return parts;
36
+ }
37
+ const HARDCODED_LAYOUT = {
38
+ default: {
39
+ children: null,
40
+ items: [{ element_id: 'x', styles: {} }],
41
+ root: null,
42
+ rules: null,
43
+ styles: { 'flex-direction': 'column' },
44
+ templateId: '5832fd4d53c31010e6bcddeeff7b12db',
45
+ type: 'flex',
46
+ },
47
+ version: '3.0.0',
48
+ };
49
+ const createComposition = (component) => {
50
+ const { tagName, properties = {} } = component;
51
+ const componentId = (0, tectonicIdGenerator_1.idGenerator)(tagName);
52
+ const UxfFormulaParser = new UxfFormulaParser_1.parser();
53
+ const propertyValues = Object.keys(properties).reduce((newObj, key) => {
54
+ const parseResult = UxfFormulaParser.parse(properties[key]);
55
+ if (parseResult.errors.length) {
56
+ throw new sdk_metrics_1.SdkError('Failed to parse formula.', { type: 'plugin_error' });
57
+ }
58
+ newObj[key] = (0, UxfFormulaParser_1.cleanUxValue)(parseResult.result.uxValue);
59
+ return newObj;
60
+ }, {});
61
+ return [
62
+ {
63
+ definition: { id: componentId, type: 'MACROPONENT' },
64
+ elementId: 'x',
65
+ elementLabel: tagName,
66
+ eventMappings: [],
67
+ isHidden: { type: 'JSON_LITERAL', value: null },
68
+ preset: null,
69
+ propertyValues,
70
+ slot: null,
71
+ styles: null,
72
+ },
73
+ ];
74
+ };
75
+ exports.default = (0, sdk_build_core_1.Plugin)({
76
+ name: 'Routes',
77
+ ownedTables: {
78
+ sys_ux_app_route: { diagnosticLevel: sdk_project_1.Diagnostic.Level.Warn },
79
+ },
80
+ extractors: {
81
+ entity: {
82
+ // TODO: This needs to extract separate entities for each route and the experience. Currently it is extracting an
83
+ // anonymous "container" entity which goes against the design of the plugin architecture.
84
+ CallExpression: (node, context) => (0, sdk_build_core_1.extractCallExpression)(experience_1.Routes, 'routes', node, context, () => 'NO_GUID_GENERATED'), // TODO: Generate GUID
85
+ },
86
+ },
87
+ composers: {
88
+ entity: {
89
+ routes(entity, context) {
90
+ const node = entity.getNode();
91
+ const data = entity.getValue();
92
+ const { experience, routes } = data;
93
+ const { $id: appConfigId } = experience_1.ExperienceSchema.parse(experience);
94
+ const appConfigSysId = context.registerExplicitId('sys_ux_app_config', appConfigId);
95
+ const records = [];
96
+ for (const [path, route] of Object.entries(routes)) {
97
+ const { $id: routeId, name, component, active, description } = experience_1.BaseUXRouteSchema.parse(route);
98
+ const routeParts = getRouteParts(path);
99
+ const screenType = (0, db_1.Record)({
100
+ table: 'sys_ux_screen_type',
101
+ $id: `${routeId}_screen_type`,
102
+ data: {
103
+ name,
104
+ },
105
+ });
106
+ const routeRecord = (0, db_1.Record)({
107
+ table: 'sys_ux_app_route',
108
+ $id: routeId,
109
+ data: {
110
+ name,
111
+ app_config: appConfigSysId,
112
+ route_type: routeParts.pathname,
113
+ fields: routeParts.parameters.required.join(','),
114
+ optional_parameters: routeParts.parameters.optional.join(','),
115
+ screen_type: screenType,
116
+ },
117
+ });
118
+ const routeParameters = [...routeParts.parameters.required, ...routeParts.parameters.optional];
119
+ const screenMcp = (0, db_1.Record)({
120
+ table: 'sys_ux_macroponent',
121
+ $id: `${routeId}_page`,
122
+ data: {
123
+ category: 'page',
124
+ composition: JSON.stringify(createComposition(component), null, 2),
125
+ extends: PAGE_TEMPLATE_SYS_ID,
126
+ internal_event_mappings: JSON.stringify({}),
127
+ layout: JSON.stringify(HARDCODED_LAYOUT, null, 2),
128
+ name: `${name} - Page`,
129
+ // Injecting Route parameters as props of the page, so that they can be passed into the
130
+ // component in the composition.
131
+ props: JSON.stringify(routeParameters.map((param) => {
132
+ return {
133
+ defaultValue: '',
134
+ description: null,
135
+ disabled: false,
136
+ fieldType: 'string',
137
+ label: param,
138
+ mandatory: false,
139
+ name: param,
140
+ readOnly: true,
141
+ selectable: false,
142
+ typeMetadata: null,
143
+ valueType: 'string',
144
+ };
145
+ }), null, 2),
146
+ schema_version: '1.0.0',
147
+ },
148
+ });
149
+ // TODO(patrick): Still a lot of hardcoded stuff in here - needs
150
+ // to be represented in the config, at least optionally.
151
+ const screen = (0, db_1.Record)({
152
+ table: 'sys_ux_screen',
153
+ $id: `${routeId}_screen`,
154
+ data: {
155
+ active: active,
156
+ app_config: appConfigSysId,
157
+ description: description,
158
+ disable_auto_reflow: false,
159
+ event_mappings: JSON.stringify([]),
160
+ macroponent: screenMcp,
161
+ macroponent_config: JSON.stringify({}),
162
+ name: `${name} - Default`,
163
+ order: 0,
164
+ parent_macroponent: constants_1.WORKSPACE_APP_SHELL_ID,
165
+ required_translations: JSON.stringify([]),
166
+ screen_type: screenType,
167
+ },
168
+ });
169
+ records.push(screenType, routeRecord, screenMcp, screen);
170
+ }
171
+ return context.composeEntities(records.map((r) => new sdk_build_core_1.EntityData('record', context.registerExplicitId(r.table, r.$id), sdk_build_core_1.ObjectData.fromObjectValue(r, node), node)), [RecordPlugin_1.RecordPlugin]);
172
+ },
173
+ },
174
+ },
175
+ });
176
+ //# sourceMappingURL=RoutesPlug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,CAAC;4BACzC,WAAW,EAAE,UAAU;yBAC1B;qBACJ,CAAC,CAAA;oBAEF,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;gBAC5D,CAAC;gBAED,OAAO,OAAO,CAAC,eAAe,CAC1B,OAAO,CAAC,GAAG,CACP,CAAC,CAAC,EAAE,EAAE,CACF,IAAI,2BAAU,CACV,QAAQ,EACR,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAa,CAAC,EACpD,2BAAU,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,EACnC,IAAI,CACP,CACR,EACD,CAAC,2BAAY,CAAC,CACjB,CAAA;YACL,CAAC;SACJ;KACJ;CACJ,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * https://code.devsnc.com/dev/uxf-formula-parser/blob/ci/master/src/uxf-formula-parser/clean/cleanUxValue.js
3
+ */
4
+ export declare const cleanUxValue: (uxValue: any) => any;