@servicenow/sdk-build-core 3.0.2 → 4.0.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.
Files changed (252) hide show
  1. package/dist/app.d.ts +25 -0
  2. package/dist/app.js +8 -0
  3. package/dist/app.js.map +1 -0
  4. package/dist/compiler.d.ts +60 -0
  5. package/dist/compiler.js +320 -0
  6. package/dist/compiler.js.map +1 -0
  7. package/dist/compression.d.ts +7 -0
  8. package/dist/compression.js +79 -0
  9. package/dist/compression.js.map +1 -0
  10. package/dist/crypto.d.ts +1 -0
  11. package/dist/crypto.js +9 -0
  12. package/dist/crypto.js.map +1 -0
  13. package/dist/diagnostic.d.ts +41 -0
  14. package/dist/diagnostic.js +130 -0
  15. package/dist/diagnostic.js.map +1 -0
  16. package/dist/{plugins/Diagnostic.d.ts → fluent-diagnostic.d.ts} +3 -2
  17. package/dist/fluent-diagnostic.js +23 -0
  18. package/dist/fluent-diagnostic.js.map +1 -0
  19. package/dist/fluent-directive.d.ts +8 -0
  20. package/dist/fluent-directive.js +54 -0
  21. package/dist/fluent-directive.js.map +1 -0
  22. package/dist/fluent-file.d.ts +5 -0
  23. package/dist/fluent-file.js +15 -0
  24. package/dist/fluent-file.js.map +1 -0
  25. package/dist/formatter.d.ts +11 -0
  26. package/dist/formatter.js +77 -0
  27. package/dist/formatter.js.map +1 -0
  28. package/dist/fs.d.ts +174 -0
  29. package/dist/fs.js +313 -0
  30. package/dist/fs.js.map +1 -0
  31. package/dist/guid.d.ts +2 -0
  32. package/dist/{GUID.js → guid.js} +3 -6
  33. package/dist/guid.js.map +1 -0
  34. package/dist/index.d.ts +19 -5
  35. package/dist/index.js +19 -5
  36. package/dist/index.js.map +1 -1
  37. package/dist/json.d.ts +5 -0
  38. package/dist/json.js +43 -0
  39. package/dist/json.js.map +1 -0
  40. package/dist/keys-registry.d.ts +64 -0
  41. package/dist/keys-registry.js +339 -0
  42. package/dist/keys-registry.js.map +1 -0
  43. package/dist/logger.d.ts +8 -0
  44. package/dist/logger.js +17 -0
  45. package/dist/logger.js.map +1 -0
  46. package/dist/now-config.d.ts +348 -0
  47. package/dist/now-config.js +283 -0
  48. package/dist/now-config.js.map +1 -0
  49. package/dist/path.d.ts +3 -0
  50. package/dist/path.js +12 -0
  51. package/dist/path.js.map +1 -0
  52. package/dist/plugins/cache.d.ts +20 -0
  53. package/dist/plugins/cache.js +46 -0
  54. package/dist/plugins/cache.js.map +1 -0
  55. package/dist/plugins/context.d.ts +85 -0
  56. package/dist/plugins/{Context.js → context.js} +1 -1
  57. package/dist/plugins/context.js.map +1 -0
  58. package/dist/plugins/database.d.ts +27 -0
  59. package/dist/plugins/database.js +102 -0
  60. package/dist/plugins/database.js.map +1 -0
  61. package/dist/plugins/file.d.ts +10 -0
  62. package/dist/plugins/{behaviors/Arranger.js → file.js} +1 -1
  63. package/dist/plugins/file.js.map +1 -0
  64. package/dist/plugins/index.d.ts +9 -5
  65. package/dist/plugins/index.js +9 -6
  66. package/dist/plugins/index.js.map +1 -1
  67. package/dist/plugins/plugin.d.ts +478 -0
  68. package/dist/plugins/plugin.js +533 -0
  69. package/dist/plugins/plugin.js.map +1 -0
  70. package/dist/plugins/product.d.ts +15 -0
  71. package/dist/plugins/product.js +38 -0
  72. package/dist/plugins/product.js.map +1 -0
  73. package/dist/plugins/project.d.ts +25 -0
  74. package/dist/plugins/{behaviors/Generator.js → project.js} +1 -1
  75. package/dist/plugins/project.js.map +1 -0
  76. package/dist/plugins/shape.d.ts +424 -0
  77. package/dist/plugins/shape.js +1181 -0
  78. package/dist/plugins/shape.js.map +1 -0
  79. package/dist/plugins/time.d.ts +12 -0
  80. package/dist/plugins/time.js +84 -0
  81. package/dist/plugins/time.js.map +1 -0
  82. package/dist/plugins/usage.d.ts +11 -0
  83. package/dist/plugins/usage.js +26 -0
  84. package/dist/plugins/usage.js.map +1 -0
  85. package/dist/prettier/config-loader.d.ts +13 -0
  86. package/dist/prettier/config-loader.js +105 -0
  87. package/dist/prettier/config-loader.js.map +1 -0
  88. package/dist/telemetry/index.d.ts +25 -0
  89. package/dist/telemetry/index.js +18 -0
  90. package/dist/telemetry/index.js.map +1 -0
  91. package/dist/typescript.d.ts +293 -0
  92. package/dist/typescript.js +454 -0
  93. package/dist/typescript.js.map +1 -0
  94. package/dist/util/get-file-type.d.ts +2 -0
  95. package/dist/util/get-file-type.js +13 -0
  96. package/dist/util/get-file-type.js.map +1 -0
  97. package/dist/util/index.d.ts +2 -6
  98. package/dist/util/index.js +2 -6
  99. package/dist/util/index.js.map +1 -1
  100. package/dist/util/{Scope.js → is-sn-scope.js} +1 -1
  101. package/dist/util/is-sn-scope.js.map +1 -0
  102. package/dist/xml.d.ts +24 -0
  103. package/dist/xml.js +71 -0
  104. package/dist/xml.js.map +1 -0
  105. package/now.config.schema.json +336 -0
  106. package/package.json +22 -12
  107. package/src/app.ts +33 -0
  108. package/src/compiler.ts +384 -0
  109. package/src/compression.ts +93 -0
  110. package/src/crypto.ts +5 -0
  111. package/src/diagnostic.ts +108 -0
  112. package/src/{plugins/Diagnostic.ts → fluent-diagnostic.ts} +3 -10
  113. package/src/fluent-directive.ts +63 -0
  114. package/src/fluent-file.ts +13 -0
  115. package/src/formatter.ts +58 -0
  116. package/src/fs.ts +438 -0
  117. package/src/{GUID.ts → guid.ts} +2 -6
  118. package/src/index.ts +19 -5
  119. package/src/json.ts +20 -0
  120. package/src/keys-registry.ts +384 -0
  121. package/src/logger.ts +20 -0
  122. package/src/now-config.ts +337 -0
  123. package/src/path.ts +9 -0
  124. package/src/plugins/cache.ts +45 -0
  125. package/src/plugins/context.ts +93 -0
  126. package/src/plugins/database.ts +121 -0
  127. package/src/plugins/file.ts +19 -0
  128. package/src/plugins/index.ts +9 -5
  129. package/src/plugins/plugin.ts +995 -0
  130. package/src/plugins/product.ts +44 -0
  131. package/src/plugins/project.ts +39 -0
  132. package/src/plugins/shape.ts +1532 -0
  133. package/src/plugins/time.ts +108 -0
  134. package/src/plugins/usage.ts +26 -0
  135. package/src/prettier/config-loader.ts +130 -0
  136. package/src/telemetry/index.ts +27 -0
  137. package/src/typescript.ts +502 -0
  138. package/src/util/get-file-type.ts +11 -0
  139. package/src/util/index.ts +2 -6
  140. package/src/xml.ts +86 -0
  141. package/dist/GUID.d.ts +0 -2
  142. package/dist/GUID.js.map +0 -1
  143. package/dist/IncludePaths.d.ts +0 -25
  144. package/dist/IncludePaths.js +0 -97
  145. package/dist/IncludePaths.js.map +0 -1
  146. package/dist/Keys.d.ts +0 -32
  147. package/dist/Keys.js +0 -245
  148. package/dist/Keys.js.map +0 -1
  149. package/dist/TypeScript.d.ts +0 -5
  150. package/dist/TypeScript.js +0 -58
  151. package/dist/TypeScript.js.map +0 -1
  152. package/dist/XML.d.ts +0 -32
  153. package/dist/XML.js +0 -77
  154. package/dist/XML.js.map +0 -1
  155. package/dist/plugins/Context.d.ts +0 -190
  156. package/dist/plugins/Context.js.map +0 -1
  157. package/dist/plugins/Diagnostic.js +0 -28
  158. package/dist/plugins/Diagnostic.js.map +0 -1
  159. package/dist/plugins/Plugin.d.ts +0 -175
  160. package/dist/plugins/Plugin.js +0 -15
  161. package/dist/plugins/Plugin.js.map +0 -1
  162. package/dist/plugins/behaviors/Arranger.d.ts +0 -26
  163. package/dist/plugins/behaviors/Arranger.js.map +0 -1
  164. package/dist/plugins/behaviors/Composer.d.ts +0 -102
  165. package/dist/plugins/behaviors/Composer.js +0 -15
  166. package/dist/plugins/behaviors/Composer.js.map +0 -1
  167. package/dist/plugins/behaviors/Diagnostics.d.ts +0 -7
  168. package/dist/plugins/behaviors/Diagnostics.js +0 -3
  169. package/dist/plugins/behaviors/Diagnostics.js.map +0 -1
  170. package/dist/plugins/behaviors/Generator.d.ts +0 -21
  171. package/dist/plugins/behaviors/Generator.js.map +0 -1
  172. package/dist/plugins/behaviors/OwnedTables.d.ts +0 -6
  173. package/dist/plugins/behaviors/OwnedTables.js +0 -3
  174. package/dist/plugins/behaviors/OwnedTables.js.map +0 -1
  175. package/dist/plugins/behaviors/PostProcessor.d.ts +0 -5
  176. package/dist/plugins/behaviors/PostProcessor.js +0 -3
  177. package/dist/plugins/behaviors/PostProcessor.js.map +0 -1
  178. package/dist/plugins/behaviors/Serializer.d.ts +0 -30
  179. package/dist/plugins/behaviors/Serializer.js +0 -3
  180. package/dist/plugins/behaviors/Serializer.js.map +0 -1
  181. package/dist/plugins/behaviors/Transformer.d.ts +0 -23
  182. package/dist/plugins/behaviors/Transformer.js +0 -3
  183. package/dist/plugins/behaviors/Transformer.js.map +0 -1
  184. package/dist/plugins/behaviors/extractors/Data.d.ts +0 -119
  185. package/dist/plugins/behaviors/extractors/Data.js +0 -244
  186. package/dist/plugins/behaviors/extractors/Data.js.map +0 -1
  187. package/dist/plugins/behaviors/extractors/Extractors.d.ts +0 -63
  188. package/dist/plugins/behaviors/extractors/Extractors.js +0 -3
  189. package/dist/plugins/behaviors/extractors/Extractors.js.map +0 -1
  190. package/dist/plugins/behaviors/extractors/index.d.ts +0 -2
  191. package/dist/plugins/behaviors/extractors/index.js +0 -19
  192. package/dist/plugins/behaviors/extractors/index.js.map +0 -1
  193. package/dist/plugins/behaviors/index.d.ts +0 -9
  194. package/dist/plugins/behaviors/index.js +0 -26
  195. package/dist/plugins/behaviors/index.js.map +0 -1
  196. package/dist/plugins/util/CallExpression.d.ts +0 -5
  197. package/dist/plugins/util/CallExpression.js +0 -88
  198. package/dist/plugins/util/CallExpression.js.map +0 -1
  199. package/dist/plugins/util/CodeTransformation.d.ts +0 -95
  200. package/dist/plugins/util/CodeTransformation.js +0 -624
  201. package/dist/plugins/util/CodeTransformation.js.map +0 -1
  202. package/dist/plugins/util/ObjectLiteral.d.ts +0 -9
  203. package/dist/plugins/util/ObjectLiteral.js +0 -37
  204. package/dist/plugins/util/ObjectLiteral.js.map +0 -1
  205. package/dist/plugins/util/index.d.ts +0 -3
  206. package/dist/plugins/util/index.js +0 -20
  207. package/dist/plugins/util/index.js.map +0 -1
  208. package/dist/util/Debug.d.ts +0 -4
  209. package/dist/util/Debug.js +0 -20
  210. package/dist/util/Debug.js.map +0 -1
  211. package/dist/util/Directive.d.ts +0 -16
  212. package/dist/util/Directive.js +0 -107
  213. package/dist/util/Directive.js.map +0 -1
  214. package/dist/util/RuntimeTableSchema.d.ts +0 -5
  215. package/dist/util/RuntimeTableSchema.js +0 -58
  216. package/dist/util/RuntimeTableSchema.js.map +0 -1
  217. package/dist/util/Scope.js.map +0 -1
  218. package/dist/util/Util.d.ts +0 -1
  219. package/dist/util/Util.js +0 -12
  220. package/dist/util/Util.js.map +0 -1
  221. package/dist/util/XMLUploadParser.d.ts +0 -22
  222. package/dist/util/XMLUploadParser.js +0 -67
  223. package/dist/util/XMLUploadParser.js.map +0 -1
  224. package/src/IncludePaths.ts +0 -122
  225. package/src/Keys.ts +0 -274
  226. package/src/TypeScript.ts +0 -65
  227. package/src/XML.ts +0 -92
  228. package/src/plugins/Context.ts +0 -239
  229. package/src/plugins/Plugin.ts +0 -278
  230. package/src/plugins/behaviors/Arranger.ts +0 -42
  231. package/src/plugins/behaviors/Composer.ts +0 -125
  232. package/src/plugins/behaviors/Diagnostics.ts +0 -12
  233. package/src/plugins/behaviors/Generator.ts +0 -31
  234. package/src/plugins/behaviors/OwnedTables.ts +0 -5
  235. package/src/plugins/behaviors/PostProcessor.ts +0 -6
  236. package/src/plugins/behaviors/Serializer.ts +0 -40
  237. package/src/plugins/behaviors/Transformer.ts +0 -32
  238. package/src/plugins/behaviors/extractors/Data.ts +0 -332
  239. package/src/plugins/behaviors/extractors/Extractors.ts +0 -73
  240. package/src/plugins/behaviors/extractors/index.ts +0 -2
  241. package/src/plugins/behaviors/index.ts +0 -9
  242. package/src/plugins/util/CallExpression.ts +0 -110
  243. package/src/plugins/util/CodeTransformation.ts +0 -731
  244. package/src/plugins/util/ObjectLiteral.ts +0 -37
  245. package/src/plugins/util/index.ts +0 -3
  246. package/src/util/Debug.ts +0 -24
  247. package/src/util/Directive.ts +0 -123
  248. package/src/util/RuntimeTableSchema.ts +0 -44
  249. package/src/util/Util.ts +0 -7
  250. package/src/util/XMLUploadParser.ts +0 -90
  251. /package/dist/util/{Scope.d.ts → is-sn-scope.d.ts} +0 -0
  252. /package/src/util/{Scope.ts → is-sn-scope.ts} +0 -0
@@ -1,30 +0,0 @@
1
- import { Document } from './Composer';
2
- import { Arranged } from './Arranger';
3
- import { Context } from '../Context';
4
- /**
5
- * A file is a data structure with a name, a target directory, and content
6
- * as a string. The target directory must be the name of one of the magic
7
- * directories that exist within a ServiceNow installable app package.
8
- */
9
- export type File = {
10
- name: `${string}.xml`;
11
- directory: Directories;
12
- content: string;
13
- };
14
- export type Directories = 'dictionary' | 'unload' | 'unload.demo' | 'update' | 'apply_once' | 'scope' | '';
15
- /**
16
- * A serializer function is a function which accepts a document of a known
17
- * kind as input and returns one or more files derived from that document,
18
- * or returns undefined to indicate it did not handle the document. In practice,
19
- * this means generating the XML content that the build system will write to
20
- * the filesystem during the final stages of a build.
21
- *
22
- * @see {@linkcode Document}
23
- */
24
- export type SerializerFunction<DocumentKind extends string = string> = (document: Document<DocumentKind> & Arranged, context: Context) => File | File[] | undefined;
25
- /**
26
- * @see {@linkcode Plugin#serializers}
27
- */
28
- export type Serializers<DocumentKinds extends string = string> = {
29
- [K in DocumentKinds]: SerializerFunction<K>;
30
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Serializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Serializer.js","sourceRoot":"","sources":["../../../src/plugins/behaviors/Serializer.ts"],"names":[],"mappings":""}
@@ -1,23 +0,0 @@
1
- import { SupportedKindName, SupportedNode, SupportedNodeByKindName } from '@servicenow/sdk-project';
2
- import { LinkedDocument } from './Composer';
3
- import { Arranged } from './Arranger';
4
- import { Context } from '../Context';
5
- /**
6
- * A transformer function is a function which accepts a linked document of
7
- * a known kind as input and returns a boolean indicating whether or not it
8
- * handled the document. The implementation of a transformer function, if it
9
- * chooses to handle the document, should perform the necessary transformations
10
- * on the document's linked node to ensure the document's data is fully
11
- * represented in the source code.
12
- *
13
- * @see {@linkcode LinkedDocument}
14
- */
15
- export type TransformerFunction<DocumentKind extends string = string, Node extends SupportedNode = SupportedNode> = (document: LinkedDocument<DocumentKind, Node> & Arranged, context: Context) => boolean;
16
- /**
17
- * @see {@linkcode Plugin#transformers}
18
- */
19
- export type Transformers<DocumentKinds extends string = string> = {
20
- [DK in DocumentKinds]: {
21
- [NK in SupportedKindName]?: TransformerFunction<DK, SupportedNodeByKindName<NK>>;
22
- };
23
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Transformer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Transformer.js","sourceRoot":"","sources":["../../../src/plugins/behaviors/Transformer.ts"],"names":[],"mappings":""}
@@ -1,119 +0,0 @@
1
- import { SupportedNode } from '@servicenow/sdk-project';
2
- /**
3
- * Actions indicate what should take place in the database when the XML file
4
- * is loaded. The platform understands these three actions: insert/update,
5
- * delete, and delete multiple.
6
- */
7
- export type Action = 'INSERT_OR_UPDATE' | 'DELETE' | 'delete_multiple';
8
- /**
9
- * Utility type for data passed to XML extractors for processing.
10
- */
11
- export type Xml = {
12
- filePath: string;
13
- data: any;
14
- };
15
- /**
16
- * Utility type to represent a simple object structure with primitive values.
17
- */
18
- export type PrimitiveData = {
19
- [x: string]: PrimitiveData | PrimitiveData[] | string | number | boolean | undefined;
20
- };
21
- /**
22
- * XML data is data from XML files (such as the parsed content of a record_update)
23
- * which is not associated with any AST node.
24
- */
25
- export declare class XmlData<D extends PrimitiveData = PrimitiveData> {
26
- data: D;
27
- readonly filePath: string;
28
- readonly kind: string;
29
- readonly action: Action;
30
- constructor(data: D, filePath: string, kind: string, action?: Action);
31
- }
32
- export type WrappedData<D> = {
33
- [K in keyof D]: D[K] extends string ? StringData<D[K]> : D[K] extends number ? NumberData<D[K]> : D[K] extends boolean ? BooleanData<D[K]> : D[K] extends Array<unknown> ? ArrayData<D[K]> : D[K] extends Record<string, unknown> ? ObjectData<D[K]> : Data<D[K]>;
34
- };
35
- export type TypeName = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'entity';
36
- export type Type<T extends TypeName> = T extends 'string' ? StringData : T extends 'number' ? NumberData : T extends 'boolean' ? BooleanData : T extends 'array' ? ArrayData : T extends 'object' ? ObjectData : T extends 'entity' ? EntityData : never;
37
- export declare abstract class Data<D = unknown> {
38
- private readonly node;
39
- constructor(node: SupportedNode);
40
- /**
41
- * @deprecated Using this for an array or object is bad practice because all of the elements/properties
42
- * will be assigned the same node as the array/object itself. This makes it difficult to bidrectionally
43
- * sync data created this way because you don't have the granularity required to know where each of the
44
- * element/property values (and any nested values) came from.
45
- */
46
- static fromValue<const D>(value: D, node: SupportedNode): Data<D>;
47
- static isUndefined(data?: unknown): data is UndefinedData;
48
- static isString(data?: unknown): data is StringData;
49
- static isNumber(data?: unknown): data is NumberData;
50
- static isBoolean(data?: unknown): data is BooleanData;
51
- static isArray(data?: unknown): data is ArrayData;
52
- static isObject(data?: unknown): data is ObjectData;
53
- static isEntity(data?: unknown): data is EntityData;
54
- abstract getValue(resolveReferences?: boolean): D;
55
- getNode(): SupportedNode;
56
- needsCDATATag(): boolean;
57
- }
58
- export declare class UndefinedData extends Data<undefined> {
59
- constructor(node: SupportedNode);
60
- getValue(): undefined;
61
- }
62
- export declare class StringData<const D extends string = string> extends Data<D> {
63
- private readonly value;
64
- private options;
65
- constructor(value: D, node: SupportedNode, options?: {
66
- needsCDATA: boolean;
67
- });
68
- getValue(): D;
69
- needsCDATATag(): boolean;
70
- }
71
- export declare class NumberData<const D extends number = number> extends Data<D> {
72
- private readonly value;
73
- constructor(value: D, node: SupportedNode);
74
- getValue(): D;
75
- }
76
- export declare class BooleanData<const D extends boolean = boolean> extends Data<D> {
77
- private readonly value;
78
- constructor(value: D, node: SupportedNode);
79
- getValue(): D;
80
- }
81
- export declare class ArrayData<const D extends unknown[] = unknown[]> extends Data<D> {
82
- private readonly elements;
83
- constructor(elements: WrappedData<D>, node: SupportedNode);
84
- /**
85
- * @deprecated Using this for arrays is bad practice because all of the array elements will be
86
- * assigned the same node as the array itself. This makes it difficult to bidrectionally sync
87
- * data created this way because you don't have the granularity required to know where each of
88
- * the element values (and any nested values) came from.
89
- */
90
- static fromArrayValue<const D extends unknown[]>(value: D, node: SupportedNode): ArrayData<D>;
91
- getValue(resolveReferences?: boolean): D;
92
- getElements(): WrappedData<D>;
93
- }
94
- export declare class ObjectData<const D extends Record<string, unknown> = Record<string, unknown>> extends Data<D> {
95
- private readonly properties;
96
- constructor(properties: WrappedData<D>, node: SupportedNode);
97
- /**
98
- * @deprecated Using this for objects is bad practice because all of the object properties will
99
- * be assigned the same node as the object itself. This makes it difficult to bidrectionally sync
100
- * data created this way because you don't have the granularity required to know where each of
101
- * the property values (and any nested values) came from.
102
- */
103
- static fromObjectValue<const D extends Record<string, unknown>>(value: D, node: SupportedNode): ObjectData<D>;
104
- getValue(resolveReferences?: boolean): D;
105
- getProperty<const K extends keyof D, const T extends TypeName>(name: K, type?: T): TypeName extends T ? WrappedData<D>[K] : Type<T> | undefined;
106
- getPropertyOrThrow<const K extends keyof D, const T extends TypeName>(name: K, type?: T): TypeName extends T ? NonNullable<WrappedData<D>[K]> : Type<T>;
107
- getProperties(): WrappedData<D>;
108
- }
109
- export declare class EntityData<const D extends Record<string, unknown> = Record<string, unknown>> extends ObjectData<D> {
110
- private readonly kind;
111
- private readonly guid;
112
- private installMethod?;
113
- private explicitIds?;
114
- constructor(kind: string, guid: string, entity: ObjectData<D>, node: SupportedNode, installMethod?: string | undefined, explicitIds?: string[] | undefined);
115
- getInstallMethod(): string | undefined;
116
- getKind(): string;
117
- getGuid(): string;
118
- getExplicitIds(): string[];
119
- }
@@ -1,244 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EntityData = exports.ObjectData = exports.ArrayData = exports.BooleanData = exports.NumberData = exports.StringData = exports.UndefinedData = exports.Data = exports.XmlData = void 0;
4
- /**
5
- * XML data is data from XML files (such as the parsed content of a record_update)
6
- * which is not associated with any AST node.
7
- */
8
- class XmlData {
9
- data;
10
- filePath;
11
- kind;
12
- action;
13
- constructor(data, filePath, kind, action = 'INSERT_OR_UPDATE') {
14
- this.data = data;
15
- this.filePath = filePath;
16
- this.kind = kind;
17
- this.action = action;
18
- }
19
- }
20
- exports.XmlData = XmlData;
21
- function getClassFromTypeName(type) {
22
- switch (type) {
23
- case 'string':
24
- return StringData;
25
- case 'number':
26
- return NumberData;
27
- case 'boolean':
28
- return BooleanData;
29
- case 'array':
30
- return ArrayData;
31
- case 'object':
32
- return ObjectData;
33
- case 'entity':
34
- return EntityData;
35
- default:
36
- throw new Error(`Unrecognized type name: ${type}`);
37
- }
38
- }
39
- class Data {
40
- node;
41
- constructor(node) {
42
- this.node = node;
43
- }
44
- /**
45
- * @deprecated Using this for an array or object is bad practice because all of the elements/properties
46
- * will be assigned the same node as the array/object itself. This makes it difficult to bidrectionally
47
- * sync data created this way because you don't have the granularity required to know where each of the
48
- * element/property values (and any nested values) came from.
49
- */
50
- static fromValue(value, node) {
51
- if (value === undefined || value === null) {
52
- return new UndefinedData(node); // TODO: How can we avoid this silly cast?
53
- }
54
- else if (typeof value === 'string') {
55
- return new StringData(value, node);
56
- }
57
- else if (typeof value === 'number') {
58
- return new NumberData(value, node);
59
- }
60
- else if (typeof value === 'boolean') {
61
- return new BooleanData(value, node);
62
- }
63
- else if (Array.isArray(value)) {
64
- return ArrayData.fromArrayValue(value, node);
65
- }
66
- else if (!!value && typeof value === 'object') {
67
- const obj = Object.fromEntries(Object.entries(value).filter(([key]) => typeof key === 'string'));
68
- return ObjectData.fromObjectValue(obj, node);
69
- }
70
- else {
71
- throw new Error(`Unsupported data type: ${value} (Type: ${typeof value}, Class: ${value?.constructor?.name})`);
72
- }
73
- }
74
- static isUndefined(data) {
75
- return data instanceof UndefinedData;
76
- }
77
- static isString(data) {
78
- return data instanceof StringData;
79
- }
80
- static isNumber(data) {
81
- return data instanceof NumberData;
82
- }
83
- static isBoolean(data) {
84
- return data instanceof BooleanData;
85
- }
86
- static isArray(data) {
87
- return data instanceof ArrayData;
88
- }
89
- static isObject(data) {
90
- return data instanceof ObjectData;
91
- }
92
- static isEntity(data) {
93
- return data instanceof EntityData;
94
- }
95
- getNode() {
96
- return this.node;
97
- }
98
- needsCDATATag() {
99
- return false;
100
- }
101
- }
102
- exports.Data = Data;
103
- class UndefinedData extends Data {
104
- constructor(node) {
105
- super(node);
106
- }
107
- getValue() {
108
- return undefined;
109
- }
110
- }
111
- exports.UndefinedData = UndefinedData;
112
- class StringData extends Data {
113
- value;
114
- options;
115
- constructor(value, node, options = { needsCDATA: false }) {
116
- super(node);
117
- this.value = value;
118
- this.options = options;
119
- }
120
- getValue() {
121
- return this.value;
122
- }
123
- needsCDATATag() {
124
- return this.options.needsCDATA;
125
- }
126
- }
127
- exports.StringData = StringData;
128
- class NumberData extends Data {
129
- value;
130
- constructor(value, node) {
131
- super(node);
132
- this.value = value;
133
- }
134
- getValue() {
135
- return this.value;
136
- }
137
- }
138
- exports.NumberData = NumberData;
139
- class BooleanData extends Data {
140
- value;
141
- constructor(value, node) {
142
- super(node);
143
- this.value = value;
144
- }
145
- getValue() {
146
- return this.value;
147
- }
148
- }
149
- exports.BooleanData = BooleanData;
150
- class ArrayData extends Data {
151
- elements;
152
- constructor(elements, node) {
153
- super(node);
154
- this.elements = elements;
155
- }
156
- /**
157
- * @deprecated Using this for arrays is bad practice because all of the array elements will be
158
- * assigned the same node as the array itself. This makes it difficult to bidrectionally sync
159
- * data created this way because you don't have the granularity required to know where each of
160
- * the element values (and any nested values) came from.
161
- */
162
- static fromArrayValue(value, node) {
163
- const elements = value.map((value) => Data.fromValue(value, node));
164
- return new ArrayData(elements, node);
165
- }
166
- getValue(resolveReferences = false) {
167
- return this.elements.map((element) => !resolveReferences && Data.isEntity(element) ? element.getGuid() : element.getValue());
168
- }
169
- getElements() {
170
- return this.elements;
171
- }
172
- }
173
- exports.ArrayData = ArrayData;
174
- class ObjectData extends Data {
175
- properties;
176
- constructor(properties, node) {
177
- super(node);
178
- this.properties = properties;
179
- }
180
- /**
181
- * @deprecated Using this for objects is bad practice because all of the object properties will
182
- * be assigned the same node as the object itself. This makes it difficult to bidrectionally sync
183
- * data created this way because you don't have the granularity required to know where each of
184
- * the property values (and any nested values) came from.
185
- */
186
- static fromObjectValue(value, node) {
187
- const properties = Object.fromEntries(Object.entries(value).map(([key, value]) => [key, Data.fromValue(value, node)]));
188
- return new ObjectData(properties, node);
189
- }
190
- getValue(resolveReferences = false) {
191
- return Object.fromEntries(Object.entries(this.properties).map(([key, value]) => [
192
- key,
193
- !resolveReferences && Data.isEntity(value) ? value.getGuid() : value.getValue(),
194
- ]));
195
- }
196
- getProperty(name, type) {
197
- const property = this.properties[name];
198
- if (type) {
199
- const expectedClass = getClassFromTypeName(type);
200
- if (!(property instanceof expectedClass)) {
201
- return undefined;
202
- }
203
- }
204
- return property;
205
- }
206
- getPropertyOrThrow(name, type) {
207
- const property = this.getProperty(name, type);
208
- if (!property) {
209
- throw new Error(`Property "${name.toString()}" not found on object`);
210
- }
211
- return property;
212
- }
213
- getProperties() {
214
- return this.properties;
215
- }
216
- }
217
- exports.ObjectData = ObjectData;
218
- class EntityData extends ObjectData {
219
- kind;
220
- guid;
221
- installMethod;
222
- explicitIds;
223
- constructor(kind, guid, entity, node, installMethod, explicitIds) {
224
- super(entity.getProperties(), node);
225
- this.kind = kind;
226
- this.guid = guid;
227
- this.installMethod = installMethod;
228
- this.explicitIds = explicitIds;
229
- }
230
- getInstallMethod() {
231
- return this.installMethod;
232
- }
233
- getKind() {
234
- return this.kind;
235
- }
236
- getGuid() {
237
- return this.guid;
238
- }
239
- getExplicitIds() {
240
- return this.explicitIds ?? [];
241
- }
242
- }
243
- exports.EntityData = EntityData;
244
- //# sourceMappingURL=Data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ED,aAAa;QACT,OAAO,IAAI,CAAC,UAAU,CAAA;IAC1B,CAAC;CACJ;AA7DD,gCA6DC;AAED,MAAa,UAA8E,SAAQ,UAAa;IAEvF;IACA;IAGT;IACA;IANZ,YACqB,IAAY,EACZ,IAAY,EAC7B,MAAqB,EACrB,IAAmB,EACX,aAAsB,EACtB,WAAsB;QAE9B,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,CAAA;QAPlB,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QAGrB,kBAAa,GAAb,aAAa,CAAS;QACtB,gBAAW,GAAX,WAAW,CAAW;IAGlC,CAAC;IAED,gBAAgB;QACZ,OAAO,IAAI,CAAC,aAAa,CAAA;IAC7B,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAA;IACpB,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAA;IACpB,CAAC;IAED,cAAc;QACV,OAAO,IAAI,CAAC,WAAW,IAAI,EAAE,CAAA;IACjC,CAAC;CACJ;AA3BD,gCA2BC"}
@@ -1,63 +0,0 @@
1
- import { SupportedKindName, SupportedNodeByKindName } from '@servicenow/sdk-project';
2
- import { Data, EntityData, Xml, XmlData } from './Data';
3
- import { Context } from '../../Context';
4
- import { FluentDiagnostic } from '../../Diagnostic';
5
- export type ExtractionResult<D extends Data = Data> = {
6
- handled: false;
7
- } | {
8
- handled: true;
9
- data?: D | undefined;
10
- diagnostics: FluentDiagnostic[];
11
- };
12
- /**
13
- * An XML extractor function accepts an {@linkcode Xml} object and returns one or
14
- * more pieces of {@linkcode XmlData} extracted from that object. The function may
15
- * also return undefined to indicate that it did not handle the object.
16
- */
17
- export type XmlExtractorFunction = (xml: Xml, context: Context) => XmlData | XmlData[] | undefined;
18
- /**
19
- * A raw extractor function accepts an AST node and returns one or more pieces of
20
- * {@linkcode Data} extracted from that node which cannot be composed into documents
21
- * on their own but could be part of an entity.
22
- */
23
- export type RawExtractorFunction<N extends SupportedKindName | 'any' = SupportedKindName> = (node: N extends SupportedKindName ? SupportedNodeByKindName<N> : any, context: Context) => ExtractionResult<Data>;
24
- /**
25
- * An entity extractor function accepts an AST node and returns one or more pieces
26
- * of {@linkcode EntityData} extracted from that node which can then be composed
27
- * into documents.
28
- */
29
- export type EntityExtractorFunction<N extends SupportedKindName | 'any' = SupportedKindName> = (node: N extends SupportedKindName ? SupportedNodeByKindName<N> : any, context: Context) => ExtractionResult<EntityData>;
30
- /**
31
- * @see {@linkcode Plugin#extractors}
32
- */
33
- export type Extractors<FluentRawNodeKinds extends SupportedKindName | 'any', ModuleRawNodeKinds extends SupportedKindName | 'any', JsonRawNodeKinds extends SupportedKindName | 'any', AnyRawNodeKinds extends SupportedKindName | 'any', FluentEntityNodeKinds extends SupportedKindName | 'any', ModuleEntityNodeKinds extends SupportedKindName | 'any', JsonEntityNodeKinds extends SupportedKindName | 'any', AnyEntityNodeKinds extends SupportedKindName | 'any'> = {
34
- xml?: XmlExtractorFunction;
35
- raw?: {
36
- fluent?: {
37
- [K in FluentRawNodeKinds]: RawExtractorFunction<K>;
38
- };
39
- module?: {
40
- [K in ModuleRawNodeKinds]: RawExtractorFunction<K>;
41
- };
42
- json?: {
43
- [K in JsonRawNodeKinds]: RawExtractorFunction<K>;
44
- };
45
- any?: {
46
- [K in AnyRawNodeKinds]: RawExtractorFunction<K>;
47
- };
48
- };
49
- entity?: {
50
- fluent?: {
51
- [K in FluentEntityNodeKinds]: EntityExtractorFunction<K>;
52
- };
53
- module?: {
54
- [K in ModuleEntityNodeKinds]: EntityExtractorFunction<K>;
55
- };
56
- json?: {
57
- [K in JsonEntityNodeKinds]: EntityExtractorFunction<K>;
58
- };
59
- any?: {
60
- [K in AnyEntityNodeKinds]: EntityExtractorFunction<K>;
61
- };
62
- };
63
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Extractors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Extractors.js","sourceRoot":"","sources":["../../../../src/plugins/behaviors/extractors/Extractors.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './Extractors';
2
- export * from './Data';
@@ -1,19 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Extractors"), exports);
18
- __exportStar(require("./Data"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/behaviors/extractors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,yCAAsB"}
@@ -1,9 +0,0 @@
1
- export * from './extractors';
2
- export * from './Composer';
3
- export * from './Arranger';
4
- export * from './Serializer';
5
- export * from './Generator';
6
- export * from './Transformer';
7
- export * from './PostProcessor';
8
- export * from './Diagnostics';
9
- export * from './OwnedTables';
@@ -1,26 +0,0 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./extractors"), exports);
18
- __exportStar(require("./Composer"), exports);
19
- __exportStar(require("./Arranger"), exports);
20
- __exportStar(require("./Serializer"), exports);
21
- __exportStar(require("./Generator"), exports);
22
- __exportStar(require("./Transformer"), exports);
23
- __exportStar(require("./PostProcessor"), exports);
24
- __exportStar(require("./Diagnostics"), exports);
25
- __exportStar(require("./OwnedTables"), exports);
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/behaviors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,6CAA0B;AAC1B,6CAA0B;AAC1B,+CAA4B;AAC5B,8CAA2B;AAC3B,gDAA6B;AAC7B,kDAA+B;AAC/B,gDAA6B;AAC7B,gDAA6B"}
@@ -1,5 +0,0 @@
1
- import { ts } from '@servicenow/sdk-project';
2
- import { Context } from '../Context';
3
- import { EntityData, ExtractionResult } from '../behaviors';
4
- export declare function getCallExpressionName(node: ts.CallExpression): string;
5
- export declare function extractCallExpression<const A extends unknown[], const E extends A extends [infer T extends Record<string, unknown>] ? T : never, const K extends string>(fn: (...args: A) => E, kind: K, node: ts.CallExpression, context: Context, guid: (entity: E) => string, validate?: (entity: unknown) => entity is E): ExtractionResult<EntityData<E>>;