@lambdaorm/cli 1.4.9

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 (240) hide show
  1. package/LICENSE/home/runner/work/core/core/LICENSE +9 -0
  2. package/README.md +337 -0
  3. package/application/cli.d.ts +17 -0
  4. package/application/cli.d.ts.map +1 -0
  5. package/application/cli.js +22 -0
  6. package/application/cli.js.map +1 -0
  7. package/application/helper.d.ts +16 -0
  8. package/application/helper.d.ts.map +1 -0
  9. package/application/helper.js +51 -0
  10. package/application/helper.js.map +1 -0
  11. package/application/index.d.ts +28 -0
  12. package/application/index.d.ts.map +1 -0
  13. package/application/index.js +44 -0
  14. package/application/index.js.map +1 -0
  15. package/application/ports/language.d.ts +7 -0
  16. package/application/ports/language.d.ts.map +1 -0
  17. package/application/ports/language.js +3 -0
  18. package/application/ports/language.js.map +1 -0
  19. package/application/ports/orm.d.ts +97 -0
  20. package/application/ports/orm.d.ts.map +1 -0
  21. package/application/ports/orm.js +3 -0
  22. package/application/ports/orm.js.map +1 -0
  23. package/application/ports/workspace.d.ts +8 -0
  24. package/application/ports/workspace.d.ts.map +1 -0
  25. package/application/ports/workspace.js +3 -0
  26. package/application/ports/workspace.js.map +1 -0
  27. package/application/services/languages.d.ts +8 -0
  28. package/application/services/languages.d.ts.map +1 -0
  29. package/application/services/languages.js +21 -0
  30. package/application/services/languages.js.map +1 -0
  31. package/application/services/outputService.d.ts +6 -0
  32. package/application/services/outputService.d.ts.map +1 -0
  33. package/application/services/outputService.js +48 -0
  34. package/application/services/outputService.js.map +1 -0
  35. package/application/useCases/build.d.ts +8 -0
  36. package/application/useCases/build.d.ts.map +1 -0
  37. package/application/useCases/build.js +20 -0
  38. package/application/useCases/build.js.map +1 -0
  39. package/application/useCases/constraints.d.ts +7 -0
  40. package/application/useCases/constraints.d.ts.map +1 -0
  41. package/application/useCases/constraints.js +29 -0
  42. package/application/useCases/constraints.js.map +1 -0
  43. package/application/useCases/drop.d.ts +7 -0
  44. package/application/useCases/drop.d.ts.map +1 -0
  45. package/application/useCases/drop.js +27 -0
  46. package/application/useCases/drop.js.map +1 -0
  47. package/application/useCases/execute.d.ts +7 -0
  48. package/application/useCases/execute.d.ts.map +1 -0
  49. package/application/useCases/execute.js +31 -0
  50. package/application/useCases/execute.js.map +1 -0
  51. package/application/useCases/export.d.ts +7 -0
  52. package/application/useCases/export.d.ts.map +1 -0
  53. package/application/useCases/export.js +31 -0
  54. package/application/useCases/export.js.map +1 -0
  55. package/application/useCases/fetch.d.ts +7 -0
  56. package/application/useCases/fetch.d.ts.map +1 -0
  57. package/application/useCases/fetch.js +26 -0
  58. package/application/useCases/fetch.js.map +1 -0
  59. package/application/useCases/import.d.ts +7 -0
  60. package/application/useCases/import.d.ts.map +1 -0
  61. package/application/useCases/import.js +30 -0
  62. package/application/useCases/import.js.map +1 -0
  63. package/application/useCases/incorporate.d.ts +7 -0
  64. package/application/useCases/incorporate.d.ts.map +1 -0
  65. package/application/useCases/incorporate.js +31 -0
  66. package/application/useCases/incorporate.js.map +1 -0
  67. package/application/useCases/init.d.ts +8 -0
  68. package/application/useCases/init.d.ts.map +1 -0
  69. package/application/useCases/init.js +15 -0
  70. package/application/useCases/init.js.map +1 -0
  71. package/application/useCases/introspect.d.ts +7 -0
  72. package/application/useCases/introspect.d.ts.map +1 -0
  73. package/application/useCases/introspect.js +31 -0
  74. package/application/useCases/introspect.js.map +1 -0
  75. package/application/useCases/metadata.d.ts +7 -0
  76. package/application/useCases/metadata.d.ts.map +1 -0
  77. package/application/useCases/metadata.js +29 -0
  78. package/application/useCases/metadata.js.map +1 -0
  79. package/application/useCases/model.d.ts +7 -0
  80. package/application/useCases/model.d.ts.map +1 -0
  81. package/application/useCases/model.js +29 -0
  82. package/application/useCases/model.js.map +1 -0
  83. package/application/useCases/parameters.d.ts +7 -0
  84. package/application/useCases/parameters.d.ts.map +1 -0
  85. package/application/useCases/parameters.js +29 -0
  86. package/application/useCases/parameters.js.map +1 -0
  87. package/application/useCases/plan.d.ts +7 -0
  88. package/application/useCases/plan.d.ts.map +1 -0
  89. package/application/useCases/plan.js +30 -0
  90. package/application/useCases/plan.js.map +1 -0
  91. package/application/useCases/pull.d.ts +7 -0
  92. package/application/useCases/pull.d.ts.map +1 -0
  93. package/application/useCases/pull.js +26 -0
  94. package/application/useCases/pull.js.map +1 -0
  95. package/application/useCases/push.d.ts +7 -0
  96. package/application/useCases/push.d.ts.map +1 -0
  97. package/application/useCases/push.js +27 -0
  98. package/application/useCases/push.js.map +1 -0
  99. package/application/useCases/schema.d.ts +7 -0
  100. package/application/useCases/schema.d.ts.map +1 -0
  101. package/application/useCases/schema.js +83 -0
  102. package/application/useCases/schema.js.map +1 -0
  103. package/application/useCases/version.d.ts +7 -0
  104. package/application/useCases/version.d.ts.map +1 -0
  105. package/application/useCases/version.js +15 -0
  106. package/application/useCases/version.js.map +1 -0
  107. package/application/useCases/versionGlobal.d.ts +7 -0
  108. package/application/useCases/versionGlobal.d.ts.map +1 -0
  109. package/application/useCases/versionGlobal.js +14 -0
  110. package/application/useCases/versionGlobal.js.map +1 -0
  111. package/doc.index.d.ts +2 -0
  112. package/doc.index.d.ts.map +1 -0
  113. package/doc.index.js +18 -0
  114. package/doc.index.js.map +1 -0
  115. package/index.d.ts +3 -0
  116. package/index.d.ts.map +1 -0
  117. package/index.js +39 -0
  118. package/index.js.map +1 -0
  119. package/infrastructure/builders/facade.d.ts +6 -0
  120. package/infrastructure/builders/facade.d.ts.map +1 -0
  121. package/infrastructure/builders/facade.js +31 -0
  122. package/infrastructure/builders/facade.js.map +1 -0
  123. package/infrastructure/builders/usesCases.d.ts +21 -0
  124. package/infrastructure/builders/usesCases.d.ts.map +1 -0
  125. package/infrastructure/builders/usesCases.js +26 -0
  126. package/infrastructure/builders/usesCases.js.map +1 -0
  127. package/infrastructure/command/build.d.ts +26 -0
  128. package/infrastructure/command/build.d.ts.map +1 -0
  129. package/infrastructure/command/build.js +82 -0
  130. package/infrastructure/command/build.js.map +1 -0
  131. package/infrastructure/command/constraints.d.ts +18 -0
  132. package/infrastructure/command/constraints.d.ts.map +1 -0
  133. package/infrastructure/command/constraints.js +57 -0
  134. package/infrastructure/command/constraints.js.map +1 -0
  135. package/infrastructure/command/drop.d.ts +20 -0
  136. package/infrastructure/command/drop.d.ts.map +1 -0
  137. package/infrastructure/command/drop.js +66 -0
  138. package/infrastructure/command/drop.js.map +1 -0
  139. package/infrastructure/command/execute.d.ts +22 -0
  140. package/infrastructure/command/execute.d.ts.map +1 -0
  141. package/infrastructure/command/execute.js +67 -0
  142. package/infrastructure/command/execute.js.map +1 -0
  143. package/infrastructure/command/export.d.ts +20 -0
  144. package/infrastructure/command/export.d.ts.map +1 -0
  145. package/infrastructure/command/export.js +56 -0
  146. package/infrastructure/command/export.js.map +1 -0
  147. package/infrastructure/command/fetch.d.ts +18 -0
  148. package/infrastructure/command/fetch.d.ts.map +1 -0
  149. package/infrastructure/command/fetch.js +51 -0
  150. package/infrastructure/command/fetch.js.map +1 -0
  151. package/infrastructure/command/import.d.ts +18 -0
  152. package/infrastructure/command/import.d.ts.map +1 -0
  153. package/infrastructure/command/import.js +52 -0
  154. package/infrastructure/command/import.js.map +1 -0
  155. package/infrastructure/command/incorporate.d.ts +20 -0
  156. package/infrastructure/command/incorporate.d.ts.map +1 -0
  157. package/infrastructure/command/incorporate.js +56 -0
  158. package/infrastructure/command/incorporate.js.map +1 -0
  159. package/infrastructure/command/init.d.ts +20 -0
  160. package/infrastructure/command/init.d.ts.map +1 -0
  161. package/infrastructure/command/init.js +58 -0
  162. package/infrastructure/command/init.js.map +1 -0
  163. package/infrastructure/command/introspect.d.ts +20 -0
  164. package/infrastructure/command/introspect.d.ts.map +1 -0
  165. package/infrastructure/command/introspect.js +56 -0
  166. package/infrastructure/command/introspect.js.map +1 -0
  167. package/infrastructure/command/metadata.d.ts +18 -0
  168. package/infrastructure/command/metadata.d.ts.map +1 -0
  169. package/infrastructure/command/metadata.js +57 -0
  170. package/infrastructure/command/metadata.js.map +1 -0
  171. package/infrastructure/command/model.d.ts +18 -0
  172. package/infrastructure/command/model.d.ts.map +1 -0
  173. package/infrastructure/command/model.js +57 -0
  174. package/infrastructure/command/model.js.map +1 -0
  175. package/infrastructure/command/parameters.d.ts +18 -0
  176. package/infrastructure/command/parameters.d.ts.map +1 -0
  177. package/infrastructure/command/parameters.js +57 -0
  178. package/infrastructure/command/parameters.js.map +1 -0
  179. package/infrastructure/command/plan.d.ts +20 -0
  180. package/infrastructure/command/plan.d.ts.map +1 -0
  181. package/infrastructure/command/plan.js +62 -0
  182. package/infrastructure/command/plan.js.map +1 -0
  183. package/infrastructure/command/pull.d.ts +16 -0
  184. package/infrastructure/command/pull.d.ts.map +1 -0
  185. package/infrastructure/command/pull.js +46 -0
  186. package/infrastructure/command/pull.js.map +1 -0
  187. package/infrastructure/command/push.d.ts +18 -0
  188. package/infrastructure/command/push.d.ts.map +1 -0
  189. package/infrastructure/command/push.js +51 -0
  190. package/infrastructure/command/push.js.map +1 -0
  191. package/infrastructure/command/schema.d.ts +18 -0
  192. package/infrastructure/command/schema.d.ts.map +1 -0
  193. package/infrastructure/command/schema.js +51 -0
  194. package/infrastructure/command/schema.js.map +1 -0
  195. package/infrastructure/command/version.d.ts +12 -0
  196. package/infrastructure/command/version.d.ts.map +1 -0
  197. package/infrastructure/command/version.js +42 -0
  198. package/infrastructure/command/version.js.map +1 -0
  199. package/infrastructure/index.d.ts +18 -0
  200. package/infrastructure/index.d.ts.map +1 -0
  201. package/infrastructure/index.js +34 -0
  202. package/infrastructure/index.js.map +1 -0
  203. package/infrastructure/languages/clientNode.d.ts +10 -0
  204. package/infrastructure/languages/clientNode.d.ts.map +1 -0
  205. package/infrastructure/languages/clientNode.js +95 -0
  206. package/infrastructure/languages/clientNode.js.map +1 -0
  207. package/infrastructure/languages/index.d.ts +3 -0
  208. package/infrastructure/languages/index.d.ts.map +1 -0
  209. package/infrastructure/languages/index.js +19 -0
  210. package/infrastructure/languages/index.js.map +1 -0
  211. package/infrastructure/languages/node.d.ts +55 -0
  212. package/infrastructure/languages/node.d.ts.map +1 -0
  213. package/infrastructure/languages/node.js +313 -0
  214. package/infrastructure/languages/node.js.map +1 -0
  215. package/infrastructure/orm/adapters/lib.d.ts +64 -0
  216. package/infrastructure/orm/adapters/lib.d.ts.map +1 -0
  217. package/infrastructure/orm/adapters/lib.js +166 -0
  218. package/infrastructure/orm/adapters/lib.js.map +1 -0
  219. package/infrastructure/orm/adapters/rest.d.ts +64 -0
  220. package/infrastructure/orm/adapters/rest.d.ts.map +1 -0
  221. package/infrastructure/orm/adapters/rest.js +191 -0
  222. package/infrastructure/orm/adapters/rest.js.map +1 -0
  223. package/infrastructure/orm/factory.d.ts +6 -0
  224. package/infrastructure/orm/factory.d.ts.map +1 -0
  225. package/infrastructure/orm/factory.js +18 -0
  226. package/infrastructure/orm/factory.js.map +1 -0
  227. package/infrastructure/workspace/adapters/client.d.ts +11 -0
  228. package/infrastructure/workspace/adapters/client.d.ts.map +1 -0
  229. package/infrastructure/workspace/adapters/client.js +38 -0
  230. package/infrastructure/workspace/adapters/client.js.map +1 -0
  231. package/infrastructure/workspace/adapters/local.d.ts +10 -0
  232. package/infrastructure/workspace/adapters/local.d.ts.map +1 -0
  233. package/infrastructure/workspace/adapters/local.js +26 -0
  234. package/infrastructure/workspace/adapters/local.js.map +1 -0
  235. package/infrastructure/workspace/factory.d.ts +9 -0
  236. package/infrastructure/workspace/factory.d.ts.map +1 -0
  237. package/infrastructure/workspace/factory.js +20 -0
  238. package/infrastructure/workspace/factory.js.map +1 -0
  239. package/jest-config.json +24 -0
  240. package/package.json +48 -0
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PullCommand = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const usesCases_1 = require("../builders/usesCases");
9
+ class PullCommand {
10
+ constructor() {
11
+ this.command = 'pull';
12
+ this.describe = 'Pull the stage with the sources';
13
+ }
14
+ builder(args) {
15
+ return args
16
+ .option('w', {
17
+ alias: 'workspace',
18
+ describe: 'project path'
19
+ })
20
+ .option('u', {
21
+ alias: 'url',
22
+ describe: 'Url of service.'
23
+ })
24
+ .option('e', {
25
+ alias: 'envfile',
26
+ describe: 'Read in a file of environment variables'
27
+ })
28
+ .option('s', {
29
+ alias: 'stage',
30
+ describe: 'Name of stage'
31
+ });
32
+ }
33
+ async handler(args) {
34
+ const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
35
+ const stage = args.stage;
36
+ const url = args.url;
37
+ try {
38
+ await usesCases_1.pull.execute(workspace, stage, url);
39
+ }
40
+ catch (error) {
41
+ console.error(`error: ${error}`);
42
+ }
43
+ }
44
+ }
45
+ exports.PullCommand = PullCommand;
46
+ //# sourceMappingURL=pull.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/pull.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAuB;AACvB,qDAA4C;AAE5C,MAAa,WAAW;IAAxB;QACC,YAAO,GAAG,MAAM,CAAA;QAChB,aAAQ,GAAG,iCAAiC,CAAA;IAgC7C,CAAC;IA9BA,OAAO,CAAE,IAAU;QAClB,OAAO,IAAI;aACT,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,cAAc;SACxB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,iBAAiB;SAC3B,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,yCAAyC;SACnD,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,eAAe;SACzB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,IAAe;QAC7B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAmB,IAAI,GAAG,CAAC,CAAA;QAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAe,CAAA;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAuB,CAAA;QACxC,IAAI,CAAC;YACJ,MAAM,gBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAC1C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;QACjC,CAAC;IACF,CAAC;CACD;AAlCD,kCAkCC"}
@@ -0,0 +1,18 @@
1
+ import { CommandModule, Argv, Arguments } from 'yargs';
2
+ export declare class PushCommand implements CommandModule {
3
+ command: string;
4
+ describe: string;
5
+ builder(args: Argv): Argv<{
6
+ w: unknown;
7
+ } & {
8
+ s: unknown;
9
+ } & {
10
+ e: unknown;
11
+ } & {
12
+ o: unknown;
13
+ } & {
14
+ f: unknown;
15
+ }>;
16
+ handler(args: Arguments): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/push.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,qBAAa,WAAY,YAAW,aAAa;IAChD,OAAO,SAAS;IAChB,QAAQ,SAA4B;IAEpC,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;IAuBb,OAAO,CAAE,IAAI,EAAE,SAAS;CAY9B"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PushCommand = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const dotenv_1 = __importDefault(require("dotenv"));
9
+ const usesCases_1 = require("../builders/usesCases");
10
+ class PushCommand {
11
+ constructor() {
12
+ this.command = 'push';
13
+ this.describe = 'Synchronize database/s.';
14
+ }
15
+ builder(args) {
16
+ return args
17
+ .option('w', {
18
+ alias: 'workspace',
19
+ describe: 'project path.'
20
+ })
21
+ .option('s', {
22
+ alias: 'stage',
23
+ describe: 'Name of stage'
24
+ })
25
+ .option('e', {
26
+ alias: 'envfile',
27
+ describe: 'Read in a file of environment variables'
28
+ })
29
+ .option('o', {
30
+ alias: 'output',
31
+ describe: 'Generates the queries but does not apply'
32
+ }).option('f', {
33
+ alias: 'force',
34
+ describe: 'If there is an error in a statement, continue executing the next statements'
35
+ });
36
+ }
37
+ async handler(args) {
38
+ const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
39
+ const stage = args.stage;
40
+ const output = args.output;
41
+ const envfile = args.envfile;
42
+ const force = args.force !== undefined;
43
+ if (envfile) {
44
+ const fullPath = path_1.default.resolve(process.cwd(), envfile);
45
+ dotenv_1.default.config({ path: fullPath, override: true });
46
+ }
47
+ await usesCases_1.push.execute(workspace, stage, output, force);
48
+ }
49
+ }
50
+ exports.PushCommand = PushCommand;
51
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/push.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAuB;AACvB,oDAA2B;AAC3B,qDAA4C;AAE5C,MAAa,WAAW;IAAxB;QACC,YAAO,GAAG,MAAM,CAAA;QAChB,aAAQ,GAAG,yBAAyB,CAAA;IAqCrC,CAAC;IAnCA,OAAO,CAAE,IAAU;QAClB,OAAO,IAAI;aACT,MAAM,CAAC,GAAG,EAAE;YACZ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class SchemaCommand implements CommandModule {
3
+ command: string;
4
+ describe: string;
5
+ builder(args: Argv): Argv<{
6
+ w: unknown;
7
+ } & {
8
+ u: unknown;
9
+ } & {
10
+ p: unknown;
11
+ } & {
12
+ e: unknown;
13
+ } & {
14
+ o: unknown;
15
+ }>;
16
+ handler(args: Arguments): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,qBAAa,aAAc,YAAW,aAAa;IAClD,OAAO,SAAW;IAClB,QAAQ,SAA8B;IAEtC,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;;;;;;;IAwBb,OAAO,CAAE,IAAI,EAAE,SAAS;CAW9B"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SchemaCommand = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const usesCases_1 = require("../builders/usesCases");
9
+ class SchemaCommand {
10
+ constructor() {
11
+ this.command = 'schema';
12
+ this.describe = 'Return schema information';
13
+ }
14
+ builder(args) {
15
+ return args
16
+ .option('w', {
17
+ alias: 'workspace',
18
+ describe: 'project path'
19
+ })
20
+ .option('u', {
21
+ alias: 'url',
22
+ describe: 'Url of service.'
23
+ })
24
+ .option('p', {
25
+ alias: 'path',
26
+ describe: 'data path'
27
+ })
28
+ .option('e', {
29
+ alias: 'envfile',
30
+ describe: 'Read in a file of environment variables'
31
+ })
32
+ .option('o', {
33
+ alias: 'output',
34
+ describe: 'Generates an output according to the following possible values [json|beautiful|light|yaml]'
35
+ });
36
+ }
37
+ async handler(args) {
38
+ const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
39
+ const dataPath = args.path;
40
+ const output = args.output;
41
+ const url = args.url;
42
+ try {
43
+ await usesCases_1.schema.execute(workspace, dataPath, output, url);
44
+ }
45
+ catch (error) {
46
+ console.error(`error: ${error}`);
47
+ }
48
+ }
49
+ }
50
+ exports.SchemaCommand = SchemaCommand;
51
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/schema.ts"],"names":[],"mappings":";;;;;;AAEA,gDAAuB;AACvB,qDAA8C;AAE9C,MAAa,aAAa;IAA1B;QACC,YAAO,GAAG,QAAQ,CAAA;QAClB,aAAQ,GAAG,2BAA2B,CAAA;IAqCvC,CAAC;IAnCA,OAAO,CAAE,IAAU;QAClB,OAAO,IAAI;aACT,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,cAAc;SACxB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,iBAAiB;SAC3B,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,WAAW;SACrB,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,yCAAyC;SACnD,CAAC;aACD,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,4FAA4F;SACtG,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,IAAe;QAC7B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAmB,IAAI,GAAG,CAAC,CAAA;QAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAc,CAAA;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAgB,CAAA;QACpC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAuB,CAAA;QACxC,IAAI,CAAC;YACJ,MAAM,kBAAM,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACvD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;QACjC,CAAC;IACF,CAAC;CACD;AAvCD,sCAuCC"}
@@ -0,0 +1,12 @@
1
+ import { CommandModule, Argv, Arguments } from 'yargs';
2
+ export declare class VersionCommand implements CommandModule {
3
+ command: string;
4
+ describe: string;
5
+ builder(args: Argv): Argv<{
6
+ w: string | undefined;
7
+ } & {
8
+ l: unknown;
9
+ }>;
10
+ handler(args: Arguments): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/version.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,qBAAa,cAAe,YAAW,aAAa;IACnD,OAAO,SAAY;IACnB,QAAQ,SAAgD;IACxD,OAAO,CAAE,IAAI,EAAE,IAAI;;;;;IAYb,OAAO,CAAE,IAAI,EAAE,SAAS;CAe9B"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.VersionCommand = void 0;
7
+ const usesCases_1 = require("../builders/usesCases");
8
+ const path_1 = __importDefault(require("path"));
9
+ class VersionCommand {
10
+ constructor() {
11
+ this.command = 'version';
12
+ this.describe = 'Prints lambdaorm version this project uses.';
13
+ }
14
+ builder(args) {
15
+ return args
16
+ .option('w', {
17
+ alias: 'workspace',
18
+ type: 'string',
19
+ describe: 'project path.'
20
+ }).option('l', {
21
+ alias: 'language',
22
+ describe: 'develop language'
23
+ });
24
+ }
25
+ async handler(args) {
26
+ const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.');
27
+ const language = args.language || 'node';
28
+ const lambdaormCliVersion = await usesCases_1.versionGlobal.execute();
29
+ const lambdaormVersion = await usesCases_1.version.execute(workspace, language);
30
+ if (lambdaormCliVersion) {
31
+ console.log(`Global lambdaorm cli version: ${lambdaormCliVersion}`);
32
+ }
33
+ if (lambdaormVersion) {
34
+ console.log('Local lambdaorm version:', lambdaormVersion);
35
+ }
36
+ else {
37
+ console.log('Local lambdaorm not found.');
38
+ }
39
+ }
40
+ }
41
+ exports.VersionCommand = VersionCommand;
42
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/command/version.ts"],"names":[],"mappings":";;;;;;AAEA,qDAA8D;AAC9D,gDAAuB;AAEvB,MAAa,cAAc;IAA3B;QACC,YAAO,GAAG,SAAS,CAAA;QACnB,aAAQ,GAAG,6CAA6C,CAAA;IA4BzD,CAAC;IA3BA,OAAO,CAAE,IAAU;QAClB,OAAO,IAAI;aACT,MAAM,CAAC,GAAG,EAAE;YACZ,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,eAAe;SACzB,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;YACd,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,kBAAkB;SAC5B,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,IAAe;QAC7B,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAmB,IAAI,GAAG,CAAC,CAAA;QAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAkB,IAAI,MAAM,CAAA;QAClD,MAAM,mBAAmB,GAAG,MAAM,yBAAa,CAAC,OAAO,EAAE,CAAA;QACzD,MAAM,gBAAgB,GAAG,MAAM,mBAAO,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;QAEnE,IAAI,mBAAmB,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,iCAAiC,mBAAmB,EAAE,CAAC,CAAA;QACpE,CAAC;QACD,IAAI,gBAAgB,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAA;QAC1D,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;QAC1C,CAAC;IACF,CAAC;CACD;AA9BD,wCA8BC"}
@@ -0,0 +1,18 @@
1
+ export * from './command/build';
2
+ export * from './command/init';
3
+ export * from './command/drop';
4
+ export * from './command/execute';
5
+ export * from './command/export';
6
+ export * from './command/import';
7
+ export * from './command/push';
8
+ export * from './command/plan';
9
+ export * from './command/metadata';
10
+ export * from './command/parameters';
11
+ export * from './command/constraints';
12
+ export * from './command/model';
13
+ export * from './command/version';
14
+ export * from './command/schema';
15
+ export * from './command/introspect';
16
+ export * from './command/incorporate';
17
+ export * from './command/pull';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/infrastructure/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,34 @@
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("./command/build"), exports);
18
+ __exportStar(require("./command/init"), exports);
19
+ __exportStar(require("./command/drop"), exports);
20
+ __exportStar(require("./command/execute"), exports);
21
+ __exportStar(require("./command/export"), exports);
22
+ __exportStar(require("./command/import"), exports);
23
+ __exportStar(require("./command/push"), exports);
24
+ __exportStar(require("./command/plan"), exports);
25
+ __exportStar(require("./command/metadata"), exports);
26
+ __exportStar(require("./command/parameters"), exports);
27
+ __exportStar(require("./command/constraints"), exports);
28
+ __exportStar(require("./command/model"), exports);
29
+ __exportStar(require("./command/version"), exports);
30
+ __exportStar(require("./command/schema"), exports);
31
+ __exportStar(require("./command/introspect"), exports);
32
+ __exportStar(require("./command/incorporate"), exports);
33
+ __exportStar(require("./command/pull"), exports);
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/infrastructure/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,iDAA8B;AAC9B,iDAA8B;AAC9B,oDAAiC;AACjC,mDAAgC;AAChC,mDAAgC;AAChC,iDAA8B;AAC9B,iDAA8B;AAC9B,qDAAkC;AAClC,uDAAoC;AACpC,wDAAqC;AACrC,kDAA+B;AAC/B,oDAAiC;AACjC,mDAAgC;AAChC,uDAAoC;AACpC,wDAAqC;AACrC,iDAA8B"}
@@ -0,0 +1,10 @@
1
+ import { SchemaState, SchemaFacade } from '@lambdaorm/lib';
2
+ import { OrmCliH3lp, BuildArgs } from '../../application';
3
+ import { NodeLanguageService } from './node';
4
+ export declare class ClientNodeLanguageService extends NodeLanguageService {
5
+ private readonly schemaFacade;
6
+ constructor(schemaFacade: SchemaFacade, schemaState: SchemaState, helper: OrmCliH3lp);
7
+ get name(): string;
8
+ build(args: BuildArgs): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=clientNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientNode.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/languages/clientNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAK5C,qBAAa,yBAA0B,SAAQ,mBAAmB;IAC7C,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAC,YAAY,EAAE,WAAW,EAAC,WAAW,EAAE,MAAM,EAAC,UAAU;IAK1G,IAAW,IAAI,IAAK,MAAM,CAEzB;IAEY,KAAK,CAAE,IAAI,EAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAyClD"}
@@ -0,0 +1,95 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ClientNodeLanguageService = void 0;
40
+ const node_1 = require("./node");
41
+ const client = __importStar(require("@lambdaorm/client"));
42
+ const path_1 = __importDefault(require("path"));
43
+ class ClientNodeLanguageService extends node_1.NodeLanguageService {
44
+ constructor(schemaFacade, schemaState, helper) {
45
+ super(schemaState, helper);
46
+ this.schemaFacade = schemaFacade;
47
+ this.library = '@lambdaorm/client';
48
+ }
49
+ get name() {
50
+ return 'client-node';
51
+ }
52
+ async build(args) {
53
+ const schema = await this.schemaState.load(args.workspace);
54
+ if (schema === null) {
55
+ throw new Error(`Can't found schema in ${args.workspace}`);
56
+ }
57
+ if (schema.infrastructure === undefined) {
58
+ throw new Error(`Can't found schema.infrastructure in ${args.workspace}`);
59
+ }
60
+ if (schema.infrastructure?.service?.url === undefined) {
61
+ throw new Error(`Can't found schema.infrastructure.service.url in ${args.workspace}`);
62
+ }
63
+ const orm = new client.Orm();
64
+ try {
65
+ await orm.init(schema.infrastructure.service.url);
66
+ const serviceDomainSchema = await orm.schema.domain();
67
+ if (serviceDomainSchema.version !== schema.domain.version) {
68
+ schema.domain = serviceDomainSchema;
69
+ }
70
+ if (schema.infrastructure.paths === undefined) {
71
+ schema.infrastructure.paths = {};
72
+ }
73
+ schema.infrastructure.paths.src = args.srcPath || schema.infrastructure.paths.src || 'src';
74
+ schema.infrastructure.paths.domain = args.domainPath || schema.infrastructure.paths.domain || 'domain';
75
+ // save schema
76
+ await this.schemaFacade.write(schema, path_1.default.join(args.workspace, 'lambdaORM.yaml'));
77
+ await this.updateStructure(args.workspace, schema.infrastructure.paths.src);
78
+ if (schema.infrastructure.paths.domain) {
79
+ const __domainPath = path_1.default.join(args.workspace, schema.infrastructure.paths.src, schema.infrastructure.paths.domain);
80
+ if (args.options.includes('model')) {
81
+ await this.buildModel(__domainPath, schema.domain);
82
+ }
83
+ if (args.options.includes('repositories')) {
84
+ await this.buildRepositories(__domainPath, schema.domain);
85
+ }
86
+ }
87
+ }
88
+ catch (error) {
89
+ await orm.end();
90
+ throw error;
91
+ }
92
+ }
93
+ }
94
+ exports.ClientNodeLanguageService = ClientNodeLanguageService;
95
+ //# sourceMappingURL=clientNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientNode.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/languages/clientNode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iCAA4C;AAC5C,0DAA2C;AAC3C,gDAAuB;AAGvB,MAAa,yBAA0B,SAAQ,0BAAmB;IACjE,YAAqC,YA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AAE,CAAC;YAChB,MAAM,GAAG,CAAC,GAAG,EAAE,CAAA;YACf,MAAM,KAAK,CAAA;QACZ,CAAC;IACF,CAAC;CACD;AAnDD,8DAmDC"}
@@ -0,0 +1,3 @@
1
+ export * from './node';
2
+ export * from './clientNode';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/languages/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
@@ -0,0 +1,19 @@
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("./node"), exports);
18
+ __exportStar(require("./clientNode"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/languages/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,+CAA4B"}
@@ -0,0 +1,55 @@
1
+ import { Entity, DomainSchema, InfrastructureSchema, SchemaState } from '@lambdaorm/lib';
2
+ import { BuildArgs, OrmCliH3lp, LanguageService } from '../../application';
3
+ export declare class NodeLanguageService implements LanguageService {
4
+ protected readonly schemaState: SchemaState;
5
+ protected readonly helper: OrmCliH3lp;
6
+ protected library: string;
7
+ constructor(schemaState: SchemaState, helper: OrmCliH3lp);
8
+ get name(): string;
9
+ build(args: BuildArgs): Promise<void>;
10
+ localVersion(workspace: string): Promise<string>;
11
+ /**
12
+ * if the package.json does not exist create it
13
+ */
14
+ protected createPackage(workspace: string): Promise<void>;
15
+ /**
16
+ * if the tsconfig.json does not exist create it
17
+ */
18
+ protected createTsconfig(workspace: string): Promise<void>;
19
+ /**
20
+ * if the typescript is not installed locally it will be installed
21
+ */
22
+ protected installTypescript(workspace: string): Promise<void>;
23
+ /**
24
+ * if the lambdaorm is not installed locally it will be installed
25
+ */
26
+ protected installLibrary(workspace: string): Promise<void>;
27
+ protected updateStructure(workspace: string, srcPath: string, dataPath?: string): Promise<void>;
28
+ protected addDialects(path: string, infrastructure: InfrastructureSchema): Promise<void>;
29
+ protected buildModel(domainPath: string, domain: DomainSchema): Promise<void>;
30
+ protected buildRepositories(domainPath: string, domain: DomainSchema): Promise<void>;
31
+ protected getLibs(dialect: string): string[];
32
+ protected getTypescriptContent(): {
33
+ compilerOptions: {
34
+ experimentalDecorators: boolean;
35
+ emitDecoratorMetadata: boolean;
36
+ resolveJsonModule: boolean;
37
+ esModuleInterop: boolean;
38
+ strict: boolean;
39
+ declaration: boolean;
40
+ moduleResolution: string;
41
+ sourceMap: boolean;
42
+ target: string;
43
+ module: string;
44
+ outDir: string;
45
+ baseUrl: string;
46
+ typeRoots: string[];
47
+ };
48
+ include: string[];
49
+ exclude: string[];
50
+ };
51
+ protected getRepositoryContent(entity: Entity): string;
52
+ protected getModelContent(source: DomainSchema): string;
53
+ protected getType(type: string): string;
54
+ }
55
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/languages/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,WA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