@codenotch/codenotch.cli 1.0.33 → 1.0.35

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 (99) hide show
  1. package/dist/commands/index.js +2 -0
  2. package/dist/commands/index.js.map +1 -1
  3. package/dist/commands/project/new.js +227 -1
  4. package/dist/commands/project/new.js.map +1 -1
  5. package/dist/commands/validation/ValidationUtils.d.ts +28 -0
  6. package/dist/commands/validation/ValidationUtils.js +182 -0
  7. package/dist/commands/validation/ValidationUtils.js.map +1 -0
  8. package/dist/commands/validation/files/AppManifestValidator.d.ts +6 -0
  9. package/dist/commands/validation/files/AppManifestValidator.js +93 -0
  10. package/dist/commands/validation/files/AppManifestValidator.js.map +1 -0
  11. package/dist/commands/validation/files/BpmnValidator.d.ts +5 -0
  12. package/dist/commands/validation/files/BpmnValidator.js +32 -0
  13. package/dist/commands/validation/files/BpmnValidator.js.map +1 -0
  14. package/dist/commands/validation/files/DbSchemaValidator.d.ts +5 -0
  15. package/dist/commands/validation/files/DbSchemaValidator.js +16 -0
  16. package/dist/commands/validation/files/DbSchemaValidator.js.map +1 -0
  17. package/dist/commands/validation/files/DocumentValidator.d.ts +5 -0
  18. package/dist/commands/validation/files/DocumentValidator.js +12 -0
  19. package/dist/commands/validation/files/DocumentValidator.js.map +1 -0
  20. package/dist/commands/validation/files/I18nValidator.d.ts +5 -0
  21. package/dist/commands/validation/files/I18nValidator.js +13 -0
  22. package/dist/commands/validation/files/I18nValidator.js.map +1 -0
  23. package/dist/commands/validation/files/JsonValidator.d.ts +5 -0
  24. package/dist/commands/validation/files/JsonValidator.js +13 -0
  25. package/dist/commands/validation/files/JsonValidator.js.map +1 -0
  26. package/dist/commands/validation/files/ManifestCacheValidator.d.ts +5 -0
  27. package/dist/commands/validation/files/ManifestCacheValidator.js +121 -0
  28. package/dist/commands/validation/files/ManifestCacheValidator.js.map +1 -0
  29. package/dist/commands/validation/files/ManifestValidator.d.ts +5 -0
  30. package/dist/commands/validation/files/ManifestValidator.js +14 -0
  31. package/dist/commands/validation/files/ManifestValidator.js.map +1 -0
  32. package/dist/commands/validation/files/ScriptValidator.d.ts +12 -0
  33. package/dist/commands/validation/files/ScriptValidator.js +128 -0
  34. package/dist/commands/validation/files/ScriptValidator.js.map +1 -0
  35. package/dist/commands/validation/files/TableValidator.d.ts +5 -0
  36. package/dist/commands/validation/files/TableValidator.js +19 -0
  37. package/dist/commands/validation/files/TableValidator.js.map +1 -0
  38. package/dist/commands/validation/validate.d.ts +2 -0
  39. package/dist/commands/validation/validate.js +245 -0
  40. package/dist/commands/validation/validate.js.map +1 -0
  41. package/dist/utils/BuildUtils.d.ts +23 -4
  42. package/dist/utils/BuildUtils.js +46 -16
  43. package/dist/utils/BuildUtils.js.map +1 -1
  44. package/dist/utils/FileUtils.d.ts +13 -0
  45. package/dist/utils/FileUtils.js +30 -0
  46. package/dist/utils/FileUtils.js.map +1 -1
  47. package/dist/utils/I18nUtils.js +0 -2
  48. package/dist/utils/I18nUtils.js.map +1 -1
  49. package/package.json +14 -6
  50. package/.github/copilot-instructions.md +0 -3
  51. package/bin/cli.js +0 -3
  52. package/docs/ARCHITECTURE.md +0 -179
  53. package/docs/TODO.md +0 -18
  54. package/src/bin/cli.ts +0 -4
  55. package/src/commands/index.ts +0 -13
  56. package/src/commands/project/compile.ts +0 -20
  57. package/src/commands/project/deploy.ts +0 -11
  58. package/src/commands/project/index.ts +0 -28
  59. package/src/commands/project/inspect.ts +0 -12
  60. package/src/commands/project/new.ts +0 -11
  61. package/src/commands/project/open.ts +0 -21
  62. package/src/commands/project/package.ts +0 -20
  63. package/src/commands/project/refresh.ts +0 -13
  64. package/src/commands/project/remove.ts +0 -12
  65. package/src/commands/project/shared.ts +0 -9
  66. package/src/commands/project/start.ts +0 -24
  67. package/src/commands/project/test.ts +0 -15
  68. package/src/commands/react/build.ts +0 -12
  69. package/src/commands/react/index.ts +0 -12
  70. package/src/commands/react/serve.ts +0 -13
  71. package/src/commands/runtime/clear.ts +0 -11
  72. package/src/commands/runtime/index.ts +0 -24
  73. package/src/commands/runtime/info.ts +0 -47
  74. package/src/commands/runtime/latest.ts +0 -18
  75. package/src/commands/runtime/portal.ts +0 -20
  76. package/src/commands/runtime/start.ts +0 -16
  77. package/src/commands/runtime/stop.ts +0 -13
  78. package/src/commands/runtime/update.ts +0 -12
  79. package/src/commands/system/index.ts +0 -9
  80. package/src/commands/system/info.ts +0 -23
  81. package/src/commands/system/read.ts +0 -25
  82. package/src/index.ts +0 -22
  83. package/src/models/Codenotch.ts +0 -361
  84. package/src/models/DbModels.ts +0 -428
  85. package/src/models/OpenApiModels.ts +0 -145
  86. package/src/utils/BuildUtils.ts +0 -739
  87. package/src/utils/ConsoleUtils.ts +0 -22
  88. package/src/utils/FileUtils.ts +0 -266
  89. package/src/utils/GitHubAuthUtils.ts +0 -83
  90. package/src/utils/I18nUtils.ts +0 -58
  91. package/src/utils/OpenAPIUtils.ts +0 -285
  92. package/src/utils/OsUtils.ts +0 -32
  93. package/src/utils/ProjectCompilationUtils.ts +0 -1002
  94. package/src/utils/ProjectUtils.ts +0 -151
  95. package/src/utils/RuntimeUtils.ts +0 -743
  96. package/src/utils/ServeUtils.ts +0 -175
  97. package/src/utils/ShellUtils.ts +0 -26
  98. package/src/utils/StringUtils.ts +0 -80
  99. package/tsconfig.json +0 -35
@@ -1,18 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import RuntimeUtils from '../../utils/RuntimeUtils';
4
-
5
- export function registerLatest(runtime: Command) {
6
- runtime
7
- .command('latest')
8
- .description('Display the latest available Codenotch runtime release')
9
- .option('--json', 'output the result in JSON format')
10
- .action(async (options: { json: boolean }) => {
11
- const release = await RuntimeUtils.getLatestRuntimeRelease();
12
- if (options.json) {
13
- console.log(JSON.stringify(release));
14
- } else {
15
- console.log(chalk.green(`Latest Codenotch runtime release: ${chalk.yellow(release.version)} (released at ${release.createdAt})`));
16
- }
17
- });
18
- }
@@ -1,20 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import RuntimeUtils from '../../utils/RuntimeUtils';
4
- import { OsUtils } from '../../utils/OsUtils';
5
-
6
- // Root-level command, but it lives here because it targets the runtime portal
7
- export function registerPortal(program: Command) {
8
- program
9
- .command('portal')
10
- .description('Open the Codenotch portal in the default browser')
11
- .action(async () => {
12
-
13
- if ((await RuntimeUtils.isRuntimeRunning()) === false) {
14
- console.log(chalk.yellow(`Codenotch runtime is not running`));
15
- return;
16
- }
17
- const basePath = await RuntimeUtils.getRuntimeBaseUrl();
18
- OsUtils.openInBrowser(`${basePath}/portal`);
19
- });
20
- }
@@ -1,16 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import RuntimeUtils from '../../utils/RuntimeUtils';
4
-
5
- export function registerStart(runtime: Command) {
6
- runtime
7
- .command('start')
8
- .option('-p, --port <port>', 'port used by the runtime (default 5005)', (value: string) => parseInt(value, 10), 5005)
9
- .option('-a, --attach', 'attach to the runtime process (default false)', false)
10
- .option('-d, --data-path <path>', 'path to the runtime data directory')
11
- .description('Start the Codenotch runtime')
12
- .action(async (options: { port: number, attach: boolean, dataPath?: string }) => {
13
- await RuntimeUtils.startRuntime(options);
14
- console.log(chalk.green(`Codenotch runtime started successfully`));
15
- });
16
- }
@@ -1,13 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import RuntimeUtils from '../../utils/RuntimeUtils';
4
-
5
- export function registerStop(runtime: Command) {
6
- runtime
7
- .command('stop')
8
- .description('Stop the Codenotch runtime')
9
- .action(async () => {
10
- await RuntimeUtils.stopRuntime();
11
- console.log(chalk.green(`Codenotch runtime stopped successfully`));
12
- });
13
- }
@@ -1,12 +0,0 @@
1
- import { Command } from 'commander';
2
- import RuntimeUtils from '../../utils/RuntimeUtils';
3
-
4
- export function registerUpdate(runtime: Command) {
5
- runtime
6
- .command('update')
7
- .alias('install')
8
- .description('Check for Codenotch runtime updates and install if available')
9
- .action(async () => {
10
- await RuntimeUtils.installLatestRuntime();
11
- });
12
- }
@@ -1,9 +0,0 @@
1
- import { Command } from 'commander';
2
- import { registerInfo } from './info';
3
- import { registerRead } from './read';
4
-
5
- // Root-level commands that are not tied to a specific project or the runtime
6
- export function registerSystemCommands(program: Command) {
7
- registerInfo(program);
8
- registerRead(program);
9
- }
@@ -1,23 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import { platform } from 'os';
4
-
5
- export function registerInfo(program: Command) {
6
- program
7
- .command('info')
8
- .description('Display system information')
9
- .action(() => {
10
- console.log(chalk.green('System Information:'));
11
- console.log(`- Node.js version: ${chalk.yellow(process.version)}`);
12
- console.log(`- Platform: ${chalk.yellow(process.platform)}`);
13
- console.log(`- Architecture: ${chalk.yellow(process.arch)}`);
14
- console.log(`- Nvm version: ${chalk.yellow(process.env.NVM_BIN ? 'nvm detected' : 'nvm not detected')}`);
15
- console.log(`- Current directory: ${chalk.yellow(process.cwd())}`);
16
- if (platform() === 'win32') {
17
- console.log(`- Download Ide: https://codenotchide.blob.core.windows.net/release-win/Codenotch%20Latest.exe?sv=2023-01-03&ss=btqf&srt=sco&spr=https%2Chttp&st=2025-08-28T12%3A46%3A05Z&se=2039-06-23T15%3A46%3A00Z&sp=rlp&sig=7ivKIFM4nANK4VzdKp20bzaNZhaZZ51YIvzriUacxBw%3D`)
18
- }
19
- else if (platform() === 'linux') {
20
- console.log(`- Download Ide: https://codenotchide.blob.core.windows.net/release-linux/codenotch-ide_latest_amd64.deb?sv=2023-01-03&ss=btqf&srt=sco&spr=https%2Chttp&st=2025-08-28T12%3A46%3A05Z&se=2039-06-23T15%3A46%3A00Z&sp=rlp&sig=7ivKIFM4nANK4VzdKp20bzaNZhaZZ51YIvzriUacxBw%3D`);
21
- }
22
- });
23
- }
@@ -1,25 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import { createInterface } from 'readline';
4
- import { stdin as input, stdout as output } from 'process';
5
-
6
- export function registerRead(program: Command) {
7
- program
8
- .command('read')
9
- .description('Read test')
10
- .action(async () => {
11
- console.log(chalk.green('Read test:'));
12
-
13
- const rl = createInterface({ input, output });
14
-
15
- try {
16
- const answer = await new Promise<string>((resolve) => {
17
- rl.question('Entre quelque chose : ', resolve);
18
- });
19
- console.log(`Tu as saisi : ${chalk.yellow(answer)}`);
20
- }
21
- finally {
22
- rl.close();
23
- }
24
- });
25
- }
package/src/index.ts DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from 'commander';
4
- import { readFileSync } from 'fs';
5
- import path, { join } from 'path';
6
- import dotenv from 'dotenv';
7
- import { registerAllCommands } from './commands';
8
-
9
- // / Load environment variables from .env file in the CLI's own root directory, regardless of where the command is run from
10
- dotenv.config({ path: path.resolve(__dirname, "../.env"), quiet: true });
11
-
12
- const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
13
- const program = new Command();
14
-
15
- program
16
- .name('codenotch-cli')
17
- .description('CLI tool for Codenotch platform')
18
- .version(packageJson.version);
19
-
20
- registerAllCommands(program);
21
-
22
- program.parse();
@@ -1,361 +0,0 @@
1
- import { JSONSchema7 } from "json-schema";
2
-
3
- export interface IWorkspaceCache {
4
- apis: ProjectManifestApi[];
5
- applications: ProjectManifestApplication[];
6
- reactApplications: ProjectManifestReactApplication[];
7
- expressComponents: ProjectManifestExpressComponent[];
8
- scripts: ProjectManifestScript[];
9
- pdfs: ProjectManifestPdf[];
10
- emails: ProjectManifestEmail[];
11
- htmls: ProjectManifestHtml[];
12
- processes: ProjectManifestProcess[];
13
- tableDataSources: ProjectManifestDatastore[];
14
- documentDataSources: ProjectManifestDatastore[];
15
- }
16
-
17
- export class ProjectManifest {
18
- projectName: string;
19
- serviceName: string;
20
- version: string;
21
- index?: string; // The app that is served for the project root (/Tenant/myProject), default to Index.auml
22
- packages: { [packageSource: string]: string };
23
- apis: ProjectManifestApi[];
24
- languages?: string[];
25
-
26
- dependencies?: (ProjectManifestDependency | string)[];
27
-
28
- applications: ProjectManifestApplication[];
29
- reactApplications: ProjectManifestReactApplication[] | undefined; // React applications that can be served and embedded in express applications
30
- expressComponents: ProjectManifestExpressComponent[] | undefined; // reusable AUML components that can be embedded in applications
31
- scripts: ProjectManifestScript[] | undefined;
32
- pdfs: ProjectManifestPdf[] | undefined;
33
- emails: ProjectManifestEmail[] | undefined;
34
- htmls: ProjectManifestHtml[] | undefined;
35
-
36
- processes: ProjectManifestProcess[];
37
-
38
- tableDataSources: ProjectManifestDatastore[];
39
- documentDataSources: ProjectManifestDatastore[];
40
-
41
- roles: ProjectManifestRole[];
42
-
43
- postInstallationProcesses?: ProjectManifestPostInstallationProcess[];
44
-
45
- constructor() {
46
- this.projectName = '';
47
- this.serviceName = '';
48
- this.version = '0.0.0';
49
- this.packages = {};
50
- this.apis = [];
51
- this.applications = [];
52
- this.expressComponents = [];
53
- this.scripts = [];
54
- this.pdfs = [];
55
- this.emails = [];
56
- this.htmls = [];
57
- this.processes = [];
58
- this.tableDataSources = [];
59
- this.documentDataSources = [];
60
- this.roles = [];
61
- this.languages = [];
62
- this.postInstallationProcesses = [];
63
- }
64
- }
65
-
66
- export class ProjectManifestPostInstallationProcess {
67
- processName: string = '';;
68
- startEvent: string = '';;
69
- }
70
-
71
- export class ProjectManifestDependency {
72
- name: string = '';
73
- version?: string = '';
74
- //TODO more options ? optional dependency, auto install, ...
75
- }
76
-
77
- export class ProjectManifestRole {
78
- name: string = ''
79
- description: string = ''
80
- }
81
-
82
- export class ProjectManifestDatastore {
83
- name: string;
84
- file: string;
85
- ttlMinutes?: number;
86
-
87
- constructor() {
88
- this.name = '';
89
- this.file = '';
90
- }
91
- }
92
-
93
- export class ProjectManifestProcess {
94
- processName: string;
95
- file: string;
96
- startEvents: ProjectManifestProcessStartEvent[];
97
- endEvent: JSONSchema7;
98
- signals: ProjectManigestSignal[];
99
- priority?: "immediate" | "high" | "medium" | "low";
100
- minThreads?: number;
101
- maxThreads?: number;
102
-
103
- constructor() {
104
- this.processName = '';
105
- this.file = '';
106
- this.startEvents = [];
107
- this.endEvent = {};
108
- this.signals = [];
109
- }
110
- }
111
-
112
- export class ProjectManigestSignal {
113
- signalId: string = '';
114
- type: string = '';
115
- }
116
-
117
- export class ProjectManifestProcessStartEvent {
118
- nodeId: string;
119
- kind: string;
120
- scope: string;
121
- roles: string[];
122
- input: JSONSchema7;
123
-
124
- constructor() {
125
- this.nodeId = '';
126
- this.kind = '';
127
- this.scope = '';
128
- this.roles = [];
129
- this.input = {};
130
- }
131
- }
132
-
133
- export class ProjectManifestReactApplication {
134
- applicationName: string;
135
- file: string;
136
- scope: string;
137
- roles: string[];
138
-
139
- constructor() {
140
- this.applicationName = '';
141
- this.file = '';
142
- this.scope = '';
143
- this.roles = [];
144
- }
145
- }
146
- export class ProjectManifestApplication {
147
- applicationName: string;
148
- file: string;
149
- scope: string;
150
- roles: string[];
151
-
152
- constructor() {
153
- this.applicationName = '';
154
- this.file = '';
155
- this.scope = '';
156
- this.roles = [];
157
- }
158
- }
159
-
160
- export class ProjectManifestPdf {
161
- name: string;
162
- file: string;
163
-
164
- constructor() {
165
- this.name = '';
166
- this.file = '';
167
- }
168
- }
169
-
170
- export class ProjectManifestEmail {
171
- name: string;
172
- file: string;
173
-
174
- constructor() {
175
- this.name = '';
176
- this.file = '';
177
- }
178
- }
179
-
180
- export class ProjectManifestHtml {
181
- name: string;
182
- file: string;
183
-
184
- constructor() {
185
- this.name = '';
186
- this.file = '';
187
- }
188
- }
189
-
190
- export class ProjectManifestExpressComponent {
191
- componentName: string;
192
- file: string;
193
-
194
- constructor() {
195
- this.componentName = '';
196
- this.file = '';
197
- }
198
- }
199
-
200
- export class ProjectManifestScript {
201
- file: string;
202
-
203
- constructor() {
204
- this.file = '';
205
- }
206
- }
207
-
208
- export class ProjectManifestApplicationInsight {
209
- key: string;
210
- constructor() {
211
- this.key = '';
212
- }
213
- }
214
-
215
- export class ProjectManifestApi {
216
- path: string;
217
- method: string;
218
- bpmn: string;
219
- startNode: string;
220
- accept: string;
221
- priority?: "immediate" | "high" | "medium" | "low";
222
- minThreads?: number;
223
- maxThreads?: number;
224
-
225
- constructor() {
226
- this.path = '';
227
- this.method = '';
228
- this.bpmn = '';
229
- this.startNode = '';
230
- this.accept = '';
231
- }
232
- }
233
-
234
- export class ProjectManifestParameter {
235
- key: string;
236
- value: string;
237
-
238
- constructor() {
239
- this.key = '';
240
- this.value = '';
241
- }
242
- }
243
- export interface IScenarioProjectManifest {
244
- projectName: string;
245
- serviceName: string;
246
- version: string;
247
-
248
- /**
249
- * Expect an auml application name
250
- */
251
- index?: string;
252
- packages: {
253
- [packageSource: string]: string;
254
- };
255
- languages?: string[];
256
- dependencies?: (ProjectManifestDependency | string)[];
257
- roles: ProjectManifestRole[];
258
- postInstallationProcesses?: ProjectManifestPostInstallationProcess[];
259
- bpmnActivities?: { name: string, version: string }[];
260
- }
261
-
262
- export interface ApplicationManifest {
263
- pwa?: PWAManifest;
264
- html?: HTMLManifest;
265
- auml?: AUMLManifest;
266
- }
267
- export interface HTMLManifest {
268
- title?: string;
269
- description?: string;
270
- author?: string;
271
- keywords?: string;
272
- charset?: string;
273
- }
274
-
275
-
276
- export interface PWAManifest {
277
- background_color?: string;
278
- description?: string;
279
- dir?: string;
280
- display?: string;
281
- icons?: PWAManifestIcon[];
282
- lang?: string;
283
- name?: string;
284
- orientation?: string;
285
- prefer_related_applications?: boolean;
286
- related_applications?: PWAManifestRelatedApplications[];
287
- scope?: string;
288
- short_name?: string;
289
- start_url?: string;
290
- theme_color?: string;
291
- shortcuts?: string;
292
-
293
- display_override?: string[];
294
- }
295
-
296
-
297
-
298
- export interface PWAManifestIcon {
299
- src?: string;
300
- sizes?: string;
301
- type?: string;
302
- }
303
-
304
- export interface PWAManifestRelatedApplications {
305
- platform?: string;
306
- url?: string;
307
- id?: string;
308
- }
309
-
310
- export interface AUMLManifest {
311
- name?: string;
312
- description?: string;
313
- logoURL?: string;
314
- roles?: string[];
315
- scope?: 'Public' | 'Internal' | 'External';
316
- }
317
-
318
-
319
- export interface ProjectState {
320
- projectId: string;
321
- projectLocation: ProjectLocation;
322
- projectVersion: string;
323
- serviceName: string;
324
- time: string;
325
- status: ProjectDeploymentStatus;
326
- errors: string[] | null;
327
- warnings: string[] | null;
328
- }
329
-
330
- export type ProjectDeploymentStatus = 'READY' | 'IN_PROGRESS' | 'FAILURE' | 'REMOVING';
331
- export type ProjectLocation = 'marketplace' | 'git' | 'upload';
332
-
333
- export interface IProcessTestReport {
334
-
335
- ExecutionId: string; // Unique id for this execution of the test
336
-
337
- Project: string; // Name of the project, NOT the service
338
-
339
- ProjectVersion: string;
340
-
341
- Success: boolean; // Overall result of the test
342
-
343
- SuccessCount: number;
344
-
345
- FailureCount: number;
346
-
347
- Tests: IProcessTestExecutionResult[]; // Individual results for each test
348
- }
349
-
350
- export interface IProcessTestExecutionResult {
351
- Name: string;
352
- Success: boolean;
353
- Errors: string[];
354
- Asserts: IProcessTestAssertionResult[];
355
- }
356
-
357
- export interface IProcessTestAssertionResult {
358
- Name: string;
359
- Success: boolean;
360
- Errors: string[];
361
- }