@codenotch/codenotch.cli 1.0.33

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 (187) hide show
  1. package/.github/copilot-instructions.md +3 -0
  2. package/README.md +28 -0
  3. package/bin/cli.js +3 -0
  4. package/dist/bin/cli.d.ts +2 -0
  5. package/dist/bin/cli.js +6 -0
  6. package/dist/bin/cli.js.map +1 -0
  7. package/dist/commands/index.d.ts +2 -0
  8. package/dist/commands/index.js +15 -0
  9. package/dist/commands/index.js.map +1 -0
  10. package/dist/commands/project/compile.d.ts +2 -0
  11. package/dist/commands/project/compile.js +25 -0
  12. package/dist/commands/project/compile.js.map +1 -0
  13. package/dist/commands/project/deploy.d.ts +2 -0
  14. package/dist/commands/project/deploy.js +16 -0
  15. package/dist/commands/project/deploy.js.map +1 -0
  16. package/dist/commands/project/index.d.ts +2 -0
  17. package/dist/commands/project/index.js +29 -0
  18. package/dist/commands/project/index.js.map +1 -0
  19. package/dist/commands/project/inspect.d.ts +2 -0
  20. package/dist/commands/project/inspect.js +17 -0
  21. package/dist/commands/project/inspect.js.map +1 -0
  22. package/dist/commands/project/new.d.ts +2 -0
  23. package/dist/commands/project/new.js +13 -0
  24. package/dist/commands/project/new.js.map +1 -0
  25. package/dist/commands/project/open.d.ts +2 -0
  26. package/dist/commands/project/open.js +26 -0
  27. package/dist/commands/project/open.js.map +1 -0
  28. package/dist/commands/project/package.d.ts +2 -0
  29. package/dist/commands/project/package.js +25 -0
  30. package/dist/commands/project/package.js.map +1 -0
  31. package/dist/commands/project/refresh.d.ts +2 -0
  32. package/dist/commands/project/refresh.js +15 -0
  33. package/dist/commands/project/refresh.js.map +1 -0
  34. package/dist/commands/project/remove.d.ts +2 -0
  35. package/dist/commands/project/remove.js +17 -0
  36. package/dist/commands/project/remove.js.map +1 -0
  37. package/dist/commands/project/shared.d.ts +5 -0
  38. package/dist/commands/project/shared.js +6 -0
  39. package/dist/commands/project/shared.js.map +1 -0
  40. package/dist/commands/project/start.d.ts +2 -0
  41. package/dist/commands/project/start.js +28 -0
  42. package/dist/commands/project/start.js.map +1 -0
  43. package/dist/commands/project/test.d.ts +2 -0
  44. package/dist/commands/project/test.js +20 -0
  45. package/dist/commands/project/test.js.map +1 -0
  46. package/dist/commands/react/build.d.ts +2 -0
  47. package/dist/commands/react/build.js +17 -0
  48. package/dist/commands/react/build.js.map +1 -0
  49. package/dist/commands/react/index.d.ts +2 -0
  50. package/dist/commands/react/index.js +13 -0
  51. package/dist/commands/react/index.js.map +1 -0
  52. package/dist/commands/react/serve.d.ts +2 -0
  53. package/dist/commands/react/serve.js +18 -0
  54. package/dist/commands/react/serve.js.map +1 -0
  55. package/dist/commands/runtime/clear.d.ts +2 -0
  56. package/dist/commands/runtime/clear.js +16 -0
  57. package/dist/commands/runtime/clear.js.map +1 -0
  58. package/dist/commands/runtime/index.d.ts +2 -0
  59. package/dist/commands/runtime/index.js +24 -0
  60. package/dist/commands/runtime/index.js.map +1 -0
  61. package/dist/commands/runtime/info.d.ts +2 -0
  62. package/dist/commands/runtime/info.js +49 -0
  63. package/dist/commands/runtime/info.js.map +1 -0
  64. package/dist/commands/runtime/latest.d.ts +2 -0
  65. package/dist/commands/runtime/latest.js +24 -0
  66. package/dist/commands/runtime/latest.js.map +1 -0
  67. package/dist/commands/runtime/portal.d.ts +2 -0
  68. package/dist/commands/runtime/portal.js +24 -0
  69. package/dist/commands/runtime/portal.js.map +1 -0
  70. package/dist/commands/runtime/start.d.ts +2 -0
  71. package/dist/commands/runtime/start.js +21 -0
  72. package/dist/commands/runtime/start.js.map +1 -0
  73. package/dist/commands/runtime/stop.d.ts +2 -0
  74. package/dist/commands/runtime/stop.js +18 -0
  75. package/dist/commands/runtime/stop.js.map +1 -0
  76. package/dist/commands/runtime/update.d.ts +2 -0
  77. package/dist/commands/runtime/update.js +17 -0
  78. package/dist/commands/runtime/update.js.map +1 -0
  79. package/dist/commands/system/index.d.ts +2 -0
  80. package/dist/commands/system/index.js +11 -0
  81. package/dist/commands/system/index.js.map +1 -0
  82. package/dist/commands/system/info.d.ts +2 -0
  83. package/dist/commands/system/info.js +28 -0
  84. package/dist/commands/system/info.js.map +1 -0
  85. package/dist/commands/system/read.d.ts +2 -0
  86. package/dist/commands/system/read.js +28 -0
  87. package/dist/commands/system/read.js.map +1 -0
  88. package/dist/index.d.ts +2 -0
  89. package/dist/index.js +55 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/models/Codenotch.d.ts +237 -0
  92. package/dist/models/Codenotch.js +214 -0
  93. package/dist/models/Codenotch.js.map +1 -0
  94. package/dist/models/DbModels.d.ts +221 -0
  95. package/dist/models/DbModels.js +130 -0
  96. package/dist/models/DbModels.js.map +1 -0
  97. package/dist/models/OpenApiModels.d.ts +115 -0
  98. package/dist/models/OpenApiModels.js +103 -0
  99. package/dist/models/OpenApiModels.js.map +1 -0
  100. package/dist/utils/BuildUtils.d.ts +54 -0
  101. package/dist/utils/BuildUtils.js +631 -0
  102. package/dist/utils/BuildUtils.js.map +1 -0
  103. package/dist/utils/ConsoleUtils.d.ts +6 -0
  104. package/dist/utils/ConsoleUtils.js +24 -0
  105. package/dist/utils/ConsoleUtils.js.map +1 -0
  106. package/dist/utils/FileUtils.d.ts +14 -0
  107. package/dist/utils/FileUtils.js +218 -0
  108. package/dist/utils/FileUtils.js.map +1 -0
  109. package/dist/utils/GitHubAuthUtils.d.ts +11 -0
  110. package/dist/utils/GitHubAuthUtils.js +74 -0
  111. package/dist/utils/GitHubAuthUtils.js.map +1 -0
  112. package/dist/utils/I18nUtils.d.ts +9 -0
  113. package/dist/utils/I18nUtils.js +56 -0
  114. package/dist/utils/I18nUtils.js.map +1 -0
  115. package/dist/utils/OpenAPIUtils.d.ts +33 -0
  116. package/dist/utils/OpenAPIUtils.js +279 -0
  117. package/dist/utils/OpenAPIUtils.js.map +1 -0
  118. package/dist/utils/OsUtils.d.ts +8 -0
  119. package/dist/utils/OsUtils.js +33 -0
  120. package/dist/utils/OsUtils.js.map +1 -0
  121. package/dist/utils/ProjectCompilationUtils.d.ts +63 -0
  122. package/dist/utils/ProjectCompilationUtils.js +850 -0
  123. package/dist/utils/ProjectCompilationUtils.js.map +1 -0
  124. package/dist/utils/ProjectUtils.d.ts +15 -0
  125. package/dist/utils/ProjectUtils.js +115 -0
  126. package/dist/utils/ProjectUtils.js.map +1 -0
  127. package/dist/utils/RuntimeUtils.d.ts +45 -0
  128. package/dist/utils/RuntimeUtils.js +613 -0
  129. package/dist/utils/RuntimeUtils.js.map +1 -0
  130. package/dist/utils/ServeUtils.d.ts +10 -0
  131. package/dist/utils/ServeUtils.js +191 -0
  132. package/dist/utils/ServeUtils.js.map +1 -0
  133. package/dist/utils/ShellUtils.d.ts +3 -0
  134. package/dist/utils/ShellUtils.js +28 -0
  135. package/dist/utils/ShellUtils.js.map +1 -0
  136. package/dist/utils/StringUtils.d.ts +9 -0
  137. package/dist/utils/StringUtils.js +65 -0
  138. package/dist/utils/StringUtils.js.map +1 -0
  139. package/docs/ARCHITECTURE.md +179 -0
  140. package/docs/TODO.md +18 -0
  141. package/package.json +63 -0
  142. package/src/bin/cli.ts +4 -0
  143. package/src/commands/index.ts +13 -0
  144. package/src/commands/project/compile.ts +20 -0
  145. package/src/commands/project/deploy.ts +11 -0
  146. package/src/commands/project/index.ts +28 -0
  147. package/src/commands/project/inspect.ts +12 -0
  148. package/src/commands/project/new.ts +11 -0
  149. package/src/commands/project/open.ts +21 -0
  150. package/src/commands/project/package.ts +20 -0
  151. package/src/commands/project/refresh.ts +13 -0
  152. package/src/commands/project/remove.ts +12 -0
  153. package/src/commands/project/shared.ts +9 -0
  154. package/src/commands/project/start.ts +24 -0
  155. package/src/commands/project/test.ts +15 -0
  156. package/src/commands/react/build.ts +12 -0
  157. package/src/commands/react/index.ts +12 -0
  158. package/src/commands/react/serve.ts +13 -0
  159. package/src/commands/runtime/clear.ts +11 -0
  160. package/src/commands/runtime/index.ts +24 -0
  161. package/src/commands/runtime/info.ts +47 -0
  162. package/src/commands/runtime/latest.ts +18 -0
  163. package/src/commands/runtime/portal.ts +20 -0
  164. package/src/commands/runtime/start.ts +16 -0
  165. package/src/commands/runtime/stop.ts +13 -0
  166. package/src/commands/runtime/update.ts +12 -0
  167. package/src/commands/system/index.ts +9 -0
  168. package/src/commands/system/info.ts +23 -0
  169. package/src/commands/system/read.ts +25 -0
  170. package/src/index.ts +22 -0
  171. package/src/models/Codenotch.ts +361 -0
  172. package/src/models/DbModels.ts +428 -0
  173. package/src/models/OpenApiModels.ts +145 -0
  174. package/src/utils/BuildUtils.ts +739 -0
  175. package/src/utils/ConsoleUtils.ts +22 -0
  176. package/src/utils/FileUtils.ts +266 -0
  177. package/src/utils/GitHubAuthUtils.ts +83 -0
  178. package/src/utils/I18nUtils.ts +58 -0
  179. package/src/utils/OpenAPIUtils.ts +285 -0
  180. package/src/utils/OsUtils.ts +32 -0
  181. package/src/utils/ProjectCompilationUtils.ts +1002 -0
  182. package/src/utils/ProjectUtils.ts +151 -0
  183. package/src/utils/RuntimeUtils.ts +743 -0
  184. package/src/utils/ServeUtils.ts +175 -0
  185. package/src/utils/ShellUtils.ts +26 -0
  186. package/src/utils/StringUtils.ts +80 -0
  187. package/tsconfig.json +35 -0
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchemaType = exports.APIResponse = exports.APIParameter = exports.APIController = exports.APIInfo = void 0;
4
+ /**
5
+ * Open api version 3.0
6
+ */
7
+ class OpenAPISpec {
8
+ /**
9
+ * Describe open API version
10
+ */
11
+ openapi;
12
+ /**
13
+ * Api information
14
+ * version, title and license
15
+ */
16
+ info;
17
+ /**
18
+ * List of API paths
19
+ */
20
+ paths;
21
+ components;
22
+ /**
23
+ * constructor
24
+ */
25
+ constructor() {
26
+ this.openapi = "3.0.0";
27
+ this.info = new APIInfo();
28
+ this.paths = {};
29
+ }
30
+ }
31
+ exports.default = OpenAPISpec;
32
+ /**
33
+ * API information specification
34
+ */
35
+ class APIInfo {
36
+ /**
37
+ * API Version
38
+ */
39
+ version;
40
+ /**
41
+ * API Title
42
+ */
43
+ title;
44
+ constructor() {
45
+ this.version = "1.0.0";
46
+ this.title = "";
47
+ }
48
+ }
49
+ exports.APIInfo = APIInfo;
50
+ class APIController {
51
+ description;
52
+ requestBody;
53
+ parameters;
54
+ responses;
55
+ constructor() {
56
+ this.description = "";
57
+ this.requestBody = null;
58
+ this.parameters = null;
59
+ this.responses = {};
60
+ }
61
+ }
62
+ exports.APIController = APIController;
63
+ /**
64
+ * Api parameters use for path, inquery and headers
65
+ */
66
+ class APIParameter {
67
+ name;
68
+ in;
69
+ schema;
70
+ required;
71
+ constructor() {
72
+ this.name = "";
73
+ this.in = "query";
74
+ this.schema = null;
75
+ this.required = false;
76
+ }
77
+ }
78
+ exports.APIParameter = APIParameter;
79
+ /**
80
+ * Open API response definition
81
+ */
82
+ class APIResponse {
83
+ description;
84
+ content;
85
+ constructor() {
86
+ this.description = "";
87
+ }
88
+ }
89
+ exports.APIResponse = APIResponse;
90
+ /**
91
+ * Open API schema type definition
92
+ */
93
+ class SchemaType {
94
+ type;
95
+ items;
96
+ properties;
97
+ example;
98
+ constructor() {
99
+ this.type = "";
100
+ }
101
+ }
102
+ exports.SchemaType = SchemaType;
103
+ //# sourceMappingURL=OpenApiModels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenApiModels.js","sourceRoot":"","sources":["../../src/models/OpenApiModels.ts"],"names":[],"mappings":";;;AA2BA;;GAEG;AACH,MAAqB,WAAW;IAC5B;;OAEG;IACH,OAAO,CAAS;IAChB;;;OAGG;IACH,IAAI,CAAU;IAEd;;OAEG;IACH,KAAK,CAAM;IAEX,UAAU,CAER;IAEF;;OAEG;IACH;QACI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAC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/Codenotch";
2
+ interface IWorkspace {
3
+ manifest: ProjectManifest;
4
+ path: string;
5
+ }
6
+ export interface IBuildOptions {
7
+ cluster?: string;
8
+ }
9
+ export default abstract class BuildUtils {
10
+ static findWorkspaceFromFile(childPath: string): string | undefined;
11
+ /**
12
+ * cn react build <target_file>
13
+ */
14
+ static buildApp(appFilePath: string, clusterUrl?: string): Promise<void>;
15
+ static buildApp2(appFilePath: string): Promise<string>;
16
+ private static createIndexJsx;
17
+ /**
18
+ * When served from the runtime env variables are not available, the variables are injected into the html file instead
19
+ */
20
+ private static createIndexJsxDeployment;
21
+ private static fetchTenantName;
22
+ static getCodenotchEnvVariables(workpace: IWorkspace, options: {
23
+ baseUrl?: string;
24
+ accessToken?: string;
25
+ appName?: string;
26
+ app?: ApplicationManifest;
27
+ tenantName?: string;
28
+ clusterUrl?: string;
29
+ }): Promise<any>;
30
+ static getTenantName(cluster: string): Promise<string | undefined>;
31
+ private static createTsConfig;
32
+ private static createEmptyModule;
33
+ private static createViteConfig;
34
+ private static createIndexHtml;
35
+ private static createPkgJson;
36
+ private static getFullManifestAt;
37
+ private static getManifestAt;
38
+ private static getManifestCacheAt;
39
+ static getAumlVariables(workpace: IWorkspace, tenantName: string | undefined, clusterUrl: string | undefined): {
40
+ serviceName: string;
41
+ tenant: {
42
+ displayName: string | undefined;
43
+ name: string | undefined;
44
+ clusterUrl: string | undefined;
45
+ };
46
+ languages: string[];
47
+ appManifest: ProjectManifest;
48
+ packageVersions: {
49
+ [packageSource: string]: string;
50
+ };
51
+ };
52
+ static getGlobalAumlVariableDefinitions(workpace: IWorkspace, tenantName: string | undefined, clusterUrl: string | undefined): Promise<string>;
53
+ }
54
+ export {};