@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.
- package/.github/copilot-instructions.md +3 -0
- package/README.md +28 -0
- package/bin/cli.js +3 -0
- package/dist/bin/cli.d.ts +2 -0
- package/dist/bin/cli.js +6 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.js +15 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/project/compile.d.ts +2 -0
- package/dist/commands/project/compile.js +25 -0
- package/dist/commands/project/compile.js.map +1 -0
- package/dist/commands/project/deploy.d.ts +2 -0
- package/dist/commands/project/deploy.js +16 -0
- package/dist/commands/project/deploy.js.map +1 -0
- package/dist/commands/project/index.d.ts +2 -0
- package/dist/commands/project/index.js +29 -0
- package/dist/commands/project/index.js.map +1 -0
- package/dist/commands/project/inspect.d.ts +2 -0
- package/dist/commands/project/inspect.js +17 -0
- package/dist/commands/project/inspect.js.map +1 -0
- package/dist/commands/project/new.d.ts +2 -0
- package/dist/commands/project/new.js +13 -0
- package/dist/commands/project/new.js.map +1 -0
- package/dist/commands/project/open.d.ts +2 -0
- package/dist/commands/project/open.js +26 -0
- package/dist/commands/project/open.js.map +1 -0
- package/dist/commands/project/package.d.ts +2 -0
- package/dist/commands/project/package.js +25 -0
- package/dist/commands/project/package.js.map +1 -0
- package/dist/commands/project/refresh.d.ts +2 -0
- package/dist/commands/project/refresh.js +15 -0
- package/dist/commands/project/refresh.js.map +1 -0
- package/dist/commands/project/remove.d.ts +2 -0
- package/dist/commands/project/remove.js +17 -0
- package/dist/commands/project/remove.js.map +1 -0
- package/dist/commands/project/shared.d.ts +5 -0
- package/dist/commands/project/shared.js +6 -0
- package/dist/commands/project/shared.js.map +1 -0
- package/dist/commands/project/start.d.ts +2 -0
- package/dist/commands/project/start.js +28 -0
- package/dist/commands/project/start.js.map +1 -0
- package/dist/commands/project/test.d.ts +2 -0
- package/dist/commands/project/test.js +20 -0
- package/dist/commands/project/test.js.map +1 -0
- package/dist/commands/react/build.d.ts +2 -0
- package/dist/commands/react/build.js +17 -0
- package/dist/commands/react/build.js.map +1 -0
- package/dist/commands/react/index.d.ts +2 -0
- package/dist/commands/react/index.js +13 -0
- package/dist/commands/react/index.js.map +1 -0
- package/dist/commands/react/serve.d.ts +2 -0
- package/dist/commands/react/serve.js +18 -0
- package/dist/commands/react/serve.js.map +1 -0
- package/dist/commands/runtime/clear.d.ts +2 -0
- package/dist/commands/runtime/clear.js +16 -0
- package/dist/commands/runtime/clear.js.map +1 -0
- package/dist/commands/runtime/index.d.ts +2 -0
- package/dist/commands/runtime/index.js +24 -0
- package/dist/commands/runtime/index.js.map +1 -0
- package/dist/commands/runtime/info.d.ts +2 -0
- package/dist/commands/runtime/info.js +49 -0
- package/dist/commands/runtime/info.js.map +1 -0
- package/dist/commands/runtime/latest.d.ts +2 -0
- package/dist/commands/runtime/latest.js +24 -0
- package/dist/commands/runtime/latest.js.map +1 -0
- package/dist/commands/runtime/portal.d.ts +2 -0
- package/dist/commands/runtime/portal.js +24 -0
- package/dist/commands/runtime/portal.js.map +1 -0
- package/dist/commands/runtime/start.d.ts +2 -0
- package/dist/commands/runtime/start.js +21 -0
- package/dist/commands/runtime/start.js.map +1 -0
- package/dist/commands/runtime/stop.d.ts +2 -0
- package/dist/commands/runtime/stop.js +18 -0
- package/dist/commands/runtime/stop.js.map +1 -0
- package/dist/commands/runtime/update.d.ts +2 -0
- package/dist/commands/runtime/update.js +17 -0
- package/dist/commands/runtime/update.js.map +1 -0
- package/dist/commands/system/index.d.ts +2 -0
- package/dist/commands/system/index.js +11 -0
- package/dist/commands/system/index.js.map +1 -0
- package/dist/commands/system/info.d.ts +2 -0
- package/dist/commands/system/info.js +28 -0
- package/dist/commands/system/info.js.map +1 -0
- package/dist/commands/system/read.d.ts +2 -0
- package/dist/commands/system/read.js +28 -0
- package/dist/commands/system/read.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/models/Codenotch.d.ts +237 -0
- package/dist/models/Codenotch.js +214 -0
- package/dist/models/Codenotch.js.map +1 -0
- package/dist/models/DbModels.d.ts +221 -0
- package/dist/models/DbModels.js +130 -0
- package/dist/models/DbModels.js.map +1 -0
- package/dist/models/OpenApiModels.d.ts +115 -0
- package/dist/models/OpenApiModels.js +103 -0
- package/dist/models/OpenApiModels.js.map +1 -0
- package/dist/utils/BuildUtils.d.ts +54 -0
- package/dist/utils/BuildUtils.js +631 -0
- package/dist/utils/BuildUtils.js.map +1 -0
- package/dist/utils/ConsoleUtils.d.ts +6 -0
- package/dist/utils/ConsoleUtils.js +24 -0
- package/dist/utils/ConsoleUtils.js.map +1 -0
- package/dist/utils/FileUtils.d.ts +14 -0
- package/dist/utils/FileUtils.js +218 -0
- package/dist/utils/FileUtils.js.map +1 -0
- package/dist/utils/GitHubAuthUtils.d.ts +11 -0
- package/dist/utils/GitHubAuthUtils.js +74 -0
- package/dist/utils/GitHubAuthUtils.js.map +1 -0
- package/dist/utils/I18nUtils.d.ts +9 -0
- package/dist/utils/I18nUtils.js +56 -0
- package/dist/utils/I18nUtils.js.map +1 -0
- package/dist/utils/OpenAPIUtils.d.ts +33 -0
- package/dist/utils/OpenAPIUtils.js +279 -0
- package/dist/utils/OpenAPIUtils.js.map +1 -0
- package/dist/utils/OsUtils.d.ts +8 -0
- package/dist/utils/OsUtils.js +33 -0
- package/dist/utils/OsUtils.js.map +1 -0
- package/dist/utils/ProjectCompilationUtils.d.ts +63 -0
- package/dist/utils/ProjectCompilationUtils.js +850 -0
- package/dist/utils/ProjectCompilationUtils.js.map +1 -0
- package/dist/utils/ProjectUtils.d.ts +15 -0
- package/dist/utils/ProjectUtils.js +115 -0
- package/dist/utils/ProjectUtils.js.map +1 -0
- package/dist/utils/RuntimeUtils.d.ts +45 -0
- package/dist/utils/RuntimeUtils.js +613 -0
- package/dist/utils/RuntimeUtils.js.map +1 -0
- package/dist/utils/ServeUtils.d.ts +10 -0
- package/dist/utils/ServeUtils.js +191 -0
- package/dist/utils/ServeUtils.js.map +1 -0
- package/dist/utils/ShellUtils.d.ts +3 -0
- package/dist/utils/ShellUtils.js +28 -0
- package/dist/utils/ShellUtils.js.map +1 -0
- package/dist/utils/StringUtils.d.ts +9 -0
- package/dist/utils/StringUtils.js +65 -0
- package/dist/utils/StringUtils.js.map +1 -0
- package/docs/ARCHITECTURE.md +179 -0
- package/docs/TODO.md +18 -0
- package/package.json +63 -0
- package/src/bin/cli.ts +4 -0
- package/src/commands/index.ts +13 -0
- package/src/commands/project/compile.ts +20 -0
- package/src/commands/project/deploy.ts +11 -0
- package/src/commands/project/index.ts +28 -0
- package/src/commands/project/inspect.ts +12 -0
- package/src/commands/project/new.ts +11 -0
- package/src/commands/project/open.ts +21 -0
- package/src/commands/project/package.ts +20 -0
- package/src/commands/project/refresh.ts +13 -0
- package/src/commands/project/remove.ts +12 -0
- package/src/commands/project/shared.ts +9 -0
- package/src/commands/project/start.ts +24 -0
- package/src/commands/project/test.ts +15 -0
- package/src/commands/react/build.ts +12 -0
- package/src/commands/react/index.ts +12 -0
- package/src/commands/react/serve.ts +13 -0
- package/src/commands/runtime/clear.ts +11 -0
- package/src/commands/runtime/index.ts +24 -0
- package/src/commands/runtime/info.ts +47 -0
- package/src/commands/runtime/latest.ts +18 -0
- package/src/commands/runtime/portal.ts +20 -0
- package/src/commands/runtime/start.ts +16 -0
- package/src/commands/runtime/stop.ts +13 -0
- package/src/commands/runtime/update.ts +12 -0
- package/src/commands/system/index.ts +9 -0
- package/src/commands/system/info.ts +23 -0
- package/src/commands/system/read.ts +25 -0
- package/src/index.ts +22 -0
- package/src/models/Codenotch.ts +361 -0
- package/src/models/DbModels.ts +428 -0
- package/src/models/OpenApiModels.ts +145 -0
- package/src/utils/BuildUtils.ts +739 -0
- package/src/utils/ConsoleUtils.ts +22 -0
- package/src/utils/FileUtils.ts +266 -0
- package/src/utils/GitHubAuthUtils.ts +83 -0
- package/src/utils/I18nUtils.ts +58 -0
- package/src/utils/OpenAPIUtils.ts +285 -0
- package/src/utils/OsUtils.ts +32 -0
- package/src/utils/ProjectCompilationUtils.ts +1002 -0
- package/src/utils/ProjectUtils.ts +151 -0
- package/src/utils/RuntimeUtils.ts +743 -0
- package/src/utils/ServeUtils.ts +175 -0
- package/src/utils/ShellUtils.ts +26 -0
- package/src/utils/StringUtils.ts +80 -0
- 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":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QACI,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IAC1B,CAAC;CAEJ;AARD,kCAQC;AACD;;GAEG;AACH,MAAa,UAAU;IAEnB,IAAI,CAAS;IAEb,KAAK,CAAU;IAEf,UAAU,CAAiC;IAE3C,OAAO,CAAU;IAEjB;QACI,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACnB,CAAC;CAEJ;AAdD,gCAcC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ApplicationManifest, ProjectManifest } from "../models/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 {};
|