@servicenow/sdk-build-core 3.0.3 → 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 -83
  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 -98
  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,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCallExpressionName = getCallExpressionName;
4
- exports.extractCallExpression = extractCallExpression;
5
- const sdk_project_1 = require("@servicenow/sdk-project");
6
- const behaviors_1 = require("../behaviors");
7
- const Diagnostic_1 = require("../Diagnostic");
8
- function getCallExpressionName(node) {
9
- const expression = node.getExpression();
10
- if (sdk_project_1.ts.Node.isIdentifier(expression)) {
11
- return expression.getText();
12
- }
13
- else if (sdk_project_1.ts.Node.isPropertyAccessExpression(expression)) {
14
- return expression.getName();
15
- }
16
- else {
17
- throw `CallExpression does not have an identifier: ${expression.getText()}`;
18
- }
19
- }
20
- function extractCallExpression(fn, kind, node, context, guid, validate = (_) => true) {
21
- let name = '';
22
- try {
23
- name = getCallExpressionName(node);
24
- }
25
- catch (e) {
26
- return {
27
- handled: true,
28
- diagnostics: [new Diagnostic_1.FluentDiagnostic(node, 'Unsupported call expression')],
29
- };
30
- }
31
- if (name !== fn.name) {
32
- return { handled: false };
33
- }
34
- const diagnostics = [];
35
- const args = node
36
- .getArguments()
37
- .map((a) => {
38
- const result = context.extractAst(a);
39
- if (!result.handled) {
40
- diagnostics.push(new Diagnostic_1.FluentDiagnostic(a, `Unsupported argument in ${fn.name} call`));
41
- return undefined;
42
- }
43
- diagnostics.push(...result.diagnostics);
44
- if (!result.data) {
45
- diagnostics.push(new Diagnostic_1.FluentDiagnostic(a, `Unsupported argument in ${fn.name} call`));
46
- return undefined;
47
- }
48
- return result.data;
49
- })
50
- .filter((a) => a !== undefined);
51
- if (!(0 in args) || args.length !== 1) {
52
- return {
53
- handled: true,
54
- diagnostics: [
55
- ...diagnostics,
56
- new Diagnostic_1.FluentDiagnostic(node, `Expected ${fn.name} call to have exactly one argument`),
57
- ],
58
- };
59
- }
60
- const entity = args[0];
61
- const entityValue = entity.getValue();
62
- if (!validate(entityValue)) {
63
- return {
64
- handled: true,
65
- diagnostics: [...diagnostics, new Diagnostic_1.FluentDiagnostic(node, `Invalid ${fn.name} call argument`)],
66
- };
67
- }
68
- return {
69
- handled: true,
70
- diagnostics,
71
- data: new behaviors_1.EntityData(kind, guid(entityValue), entity, node, extractInstallMethod(entity), extractExplicitId(entity)),
72
- };
73
- }
74
- function extractInstallMethod(entity) {
75
- const $meta = entity.getProperty('$meta');
76
- if (!$meta) {
77
- return;
78
- }
79
- return $meta.getValue()['installMethod'];
80
- }
81
- function extractExplicitId(entity) {
82
- const $id = entity.getProperty('$id');
83
- if (!$id) {
84
- return [];
85
- }
86
- return [`${$id.getValue()}`];
87
- }
88
- //# sourceMappingURL=CallExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CallExpression.js","sourceRoot":"","sources":["../../../src/plugins/util/CallExpression.ts"],"names":[],"mappings":";;AAKA,sDASC;AAED,sDA6EC;AA7FD,yDAA4C;AAE5C,4CAAuE;AACvE,8CAAgD;AAEhD,SAAgB,qBAAqB,CAAC,IAAuB;IACzD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;IACvC,IAAI,gBAAE,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC,OAAO,EAAE,CAAA;IAC/B,CAAC;SAAM,IAAI,gBAAE,CAAC,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,EAAE,CAAC;QACxD,OAAO,UAAU,CAAC,OAAO,EAAE,CAAA;IAC/B,CAAC;SAAM,CAAC;QACJ,MAAM,+CAA+C,UAAU,CAAC,OAAO,EAAE,EAAE,CAAA;IAC/E,CAAC;AACL,CAAC;AAED,SAAgB,qBAAqB,CAKjC,EAAqB,EACrB,IAAO,EACP,IAAuB,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C;QACP,OAAO,EAAE,CAAA;IACb,CAAC;IACD,OAAO,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AAChC,CAAC"}
@@ -1,95 +0,0 @@
1
- import { Logger, SupportedNode, ts, tsc } from '@servicenow/sdk-project';
2
- import { Context } from '../Context';
3
- import * as z from 'zod';
4
- import { Action, Document } from '../behaviors';
5
- export declare function stringify(val: unknown): string;
6
- export type PartialElements<A extends unknown[]> = {
7
- [I in keyof A]: Partial<A[I]>;
8
- };
9
- /**
10
- * Formats a source file name with the .now.ts extension.
11
- */
12
- export declare function formatSourceFileName(name: string): string;
13
- export declare function getSysUpdateName(document: Document & {
14
- xml?: string;
15
- }, table: string): string;
16
- export declare function getOrCreateEntitySourceFile(context: Context, sysUpdateName: string): ts.SourceFile;
17
- export declare function addDefaultImportIfAbsent(sourceFile: ts.SourceFile, moduleSpecifier: string, module: string): void;
18
- export declare function addNamedImportIfAbsent(context: Context, sourceFile: ts.SourceFile, moduleSpecifier: string, module: {
19
- name: string;
20
- } | string): ts.ImportSpecifier;
21
- /**
22
- * Generate an exported variable assignment initialized by a function call with
23
- * the provided arguments.
24
- */
25
- export declare function generateCallExpressionDefaultExport<const A extends unknown[]>(context: Context, sourceFile: ts.SourceFile, moduleSpecifier: string, fn: (...args: A) => unknown, ...args: PartialElements<A>): ts.ExportAssignment;
26
- export declare function generateCallExpressionExport<const A extends unknown[]>(context: Context, sourceFile: ts.SourceFile, moduleSpecifier: string, exportName: string, fn: (...args: A) => unknown, ...args: PartialElements<A>): ts.VariableDeclaration;
27
- export declare function generateCallExpression<const A extends unknown[]>(context: Context, sourceFile: ts.SourceFile, moduleSpecifier: string, fn: (...args: A) => unknown, ...args: PartialElements<A>): ts.CallExpression<ts.ts.CallExpression>;
28
- /**
29
- * Generate an exported variable assignment initialized by a function call with the
30
- * provided arguments. The exported variable name will be automatically determined
31
- * based on the function's name and the document's ID.
32
- */
33
- export declare function generateCallExpressionExportForDocument<const A extends unknown[]>(context: Context, info: {
34
- sourceFile: ts.SourceFile;
35
- moduleSpecifier: string;
36
- }, fn: (...args: A) => unknown, ...args: PartialElements<A>): ts.ExportAssignment;
37
- export declare function getOrCreatePropertyAssignment(obj: ts.ObjectLiteralExpression, name: string, initializer?: string): ts.PropertyAssignment;
38
- export declare function isEscapedPropertyAssignment(args: ts.ObjectLiteralExpression, name: string): boolean;
39
- /** utility function to get the $id value in a object literal node */
40
- export declare const getNodeId: (node: ts.ObjectLiteralExpression) => string | undefined;
41
- /** utility iterator for iterating array structures in rest api*/
42
- export declare class ArrayIterator {
43
- private prop;
44
- arrayExpression: ts.ArrayLiteralExpression;
45
- elements: ts.Expression<tsc.Expression>[];
46
- idx: number;
47
- constructor(prop: ts.PropertyAssignment);
48
- hasNext(): boolean;
49
- next(): ts.Expression<ts.ts.Expression>;
50
- getExpression(): ts.ArrayLiteralExpression;
51
- }
52
- export declare function writeArrayPropertyAsReference(arg: ts.ObjectLiteralExpression, name: string, def: string, value: string[]): void;
53
- export declare const recordSchema: z.ZodObject<{
54
- $id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
55
- data: z.ZodRecord<z.ZodString, z.ZodAny>;
56
- table: z.ZodString;
57
- }, "strip", z.ZodTypeAny, {
58
- data: Record<string, any>;
59
- table: string;
60
- $id: string | number;
61
- }, {
62
- data: Record<string, any>;
63
- table: string;
64
- $id: string | number;
65
- }>;
66
- export declare function addCallExpressionToProperty(obj: ts.ObjectLiteralExpression, field: string, functionCall: any): void;
67
- export declare function writePropertyAsReference(logger: Logger, arg: ts.ObjectLiteralExpression, name: string, def: string, value: unknown): void;
68
- export declare function writeCustomProperty(arg: ts.ObjectLiteralExpression, name: string, def: string, value: string): void;
69
- export declare function mergeDataIntoObjectLiteral(node: ts.ObjectLiteralExpression, data: object): void;
70
- /**
71
- * Merges an array of object literal data in to an existing array of object literal values
72
- * @param arrayNode Node with array to transform
73
- * @param data Array of object literals
74
- * @param comparisonProperty a property to be treated as the primary key of each object literal for comparison
75
- * @param action Should this item be deleted if found?
76
- */
77
- export declare function mergeDataIntoObjectLiteralArray(arrayNode: ts.ArrayLiteralExpression, data: any[], comparisonProperty: string, action?: Action): void;
78
- export declare function filterEmpty(data: any): {};
79
- export declare function escapeStringLiteralValues(str: string): string;
80
- export declare function setPropertyAssignmentValue(property: ts.PropertyAssignment, value: string | ts.PropertyAssignmentStructure | ts.ImportSpecifierStructure | object): void;
81
- export declare function fixFunctionArgumentTypes(context: Context, node: ts.CallExpression): void;
82
- export declare function transformFunctionArguments<const A extends unknown[]>(node: ts.CallExpression, fn: (...args: A) => unknown, ...args: PartialElements<A>): boolean;
83
- export declare function removeNode(node: SupportedNode): void;
84
- /**
85
- * Re-extracts CallExpression property names for transform to check for customized properties on Plugin APIs.
86
- * If CallExpression properties don't match don't match schema expected by fluent this function will tranform updates
87
- * only to those properties (not new properties)
88
- * @param fn type of CallExpression to extract
89
- * @param node Node
90
- * @param dataForTransform Document Data passed to a transformer function
91
- * @param cleanedData Document data cleaned/parsed by a Zod step that has filtered out properties not handled by fluent
92
- */
93
- export declare function transformCustomizedProperties<const A extends unknown[], const E extends A extends [infer T extends Record<string, unknown>] ? T : never>(fn: (...args: A) => E, node: any, dataForTransform: any, cleanedData: any): void;
94
- export declare function isNowIncludeCall(callExpression?: ts.CallExpression): boolean;
95
- export declare function getObjectPropertyAssignmentName(objectProperty: ts.PropertyAssignment): string;