@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,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectManifestParameter = exports.ProjectManifestApi = exports.ProjectManifestApplicationInsight = exports.ProjectManifestScript = exports.ProjectManifestExpressComponent = exports.ProjectManifestHtml = exports.ProjectManifestEmail = exports.ProjectManifestPdf = exports.ProjectManifestApplication = exports.ProjectManifestReactApplication = exports.ProjectManifestProcessStartEvent = exports.ProjectManigestSignal = exports.ProjectManifestProcess = exports.ProjectManifestDatastore = exports.ProjectManifestRole = exports.ProjectManifestDependency = exports.ProjectManifestPostInstallationProcess = exports.ProjectManifest = void 0;
|
|
4
|
+
class ProjectManifest {
|
|
5
|
+
projectName;
|
|
6
|
+
serviceName;
|
|
7
|
+
version;
|
|
8
|
+
index; // The app that is served for the project root (/Tenant/myProject), default to Index.auml
|
|
9
|
+
packages;
|
|
10
|
+
apis;
|
|
11
|
+
languages;
|
|
12
|
+
dependencies;
|
|
13
|
+
applications;
|
|
14
|
+
reactApplications; // React applications that can be served and embedded in express applications
|
|
15
|
+
expressComponents; // reusable AUML components that can be embedded in applications
|
|
16
|
+
scripts;
|
|
17
|
+
pdfs;
|
|
18
|
+
emails;
|
|
19
|
+
htmls;
|
|
20
|
+
processes;
|
|
21
|
+
tableDataSources;
|
|
22
|
+
documentDataSources;
|
|
23
|
+
roles;
|
|
24
|
+
postInstallationProcesses;
|
|
25
|
+
constructor() {
|
|
26
|
+
this.projectName = '';
|
|
27
|
+
this.serviceName = '';
|
|
28
|
+
this.version = '0.0.0';
|
|
29
|
+
this.packages = {};
|
|
30
|
+
this.apis = [];
|
|
31
|
+
this.applications = [];
|
|
32
|
+
this.expressComponents = [];
|
|
33
|
+
this.scripts = [];
|
|
34
|
+
this.pdfs = [];
|
|
35
|
+
this.emails = [];
|
|
36
|
+
this.htmls = [];
|
|
37
|
+
this.processes = [];
|
|
38
|
+
this.tableDataSources = [];
|
|
39
|
+
this.documentDataSources = [];
|
|
40
|
+
this.roles = [];
|
|
41
|
+
this.languages = [];
|
|
42
|
+
this.postInstallationProcesses = [];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ProjectManifest = ProjectManifest;
|
|
46
|
+
class ProjectManifestPostInstallationProcess {
|
|
47
|
+
processName = '';
|
|
48
|
+
;
|
|
49
|
+
startEvent = '';
|
|
50
|
+
;
|
|
51
|
+
}
|
|
52
|
+
exports.ProjectManifestPostInstallationProcess = ProjectManifestPostInstallationProcess;
|
|
53
|
+
class ProjectManifestDependency {
|
|
54
|
+
name = '';
|
|
55
|
+
version = '';
|
|
56
|
+
}
|
|
57
|
+
exports.ProjectManifestDependency = ProjectManifestDependency;
|
|
58
|
+
class ProjectManifestRole {
|
|
59
|
+
name = '';
|
|
60
|
+
description = '';
|
|
61
|
+
}
|
|
62
|
+
exports.ProjectManifestRole = ProjectManifestRole;
|
|
63
|
+
class ProjectManifestDatastore {
|
|
64
|
+
name;
|
|
65
|
+
file;
|
|
66
|
+
ttlMinutes;
|
|
67
|
+
constructor() {
|
|
68
|
+
this.name = '';
|
|
69
|
+
this.file = '';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ProjectManifestDatastore = ProjectManifestDatastore;
|
|
73
|
+
class ProjectManifestProcess {
|
|
74
|
+
processName;
|
|
75
|
+
file;
|
|
76
|
+
startEvents;
|
|
77
|
+
endEvent;
|
|
78
|
+
signals;
|
|
79
|
+
priority;
|
|
80
|
+
minThreads;
|
|
81
|
+
maxThreads;
|
|
82
|
+
constructor() {
|
|
83
|
+
this.processName = '';
|
|
84
|
+
this.file = '';
|
|
85
|
+
this.startEvents = [];
|
|
86
|
+
this.endEvent = {};
|
|
87
|
+
this.signals = [];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.ProjectManifestProcess = ProjectManifestProcess;
|
|
91
|
+
class ProjectManigestSignal {
|
|
92
|
+
signalId = '';
|
|
93
|
+
type = '';
|
|
94
|
+
}
|
|
95
|
+
exports.ProjectManigestSignal = ProjectManigestSignal;
|
|
96
|
+
class ProjectManifestProcessStartEvent {
|
|
97
|
+
nodeId;
|
|
98
|
+
kind;
|
|
99
|
+
scope;
|
|
100
|
+
roles;
|
|
101
|
+
input;
|
|
102
|
+
constructor() {
|
|
103
|
+
this.nodeId = '';
|
|
104
|
+
this.kind = '';
|
|
105
|
+
this.scope = '';
|
|
106
|
+
this.roles = [];
|
|
107
|
+
this.input = {};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.ProjectManifestProcessStartEvent = ProjectManifestProcessStartEvent;
|
|
111
|
+
class ProjectManifestReactApplication {
|
|
112
|
+
applicationName;
|
|
113
|
+
file;
|
|
114
|
+
scope;
|
|
115
|
+
roles;
|
|
116
|
+
constructor() {
|
|
117
|
+
this.applicationName = '';
|
|
118
|
+
this.file = '';
|
|
119
|
+
this.scope = '';
|
|
120
|
+
this.roles = [];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.ProjectManifestReactApplication = ProjectManifestReactApplication;
|
|
124
|
+
class ProjectManifestApplication {
|
|
125
|
+
applicationName;
|
|
126
|
+
file;
|
|
127
|
+
scope;
|
|
128
|
+
roles;
|
|
129
|
+
constructor() {
|
|
130
|
+
this.applicationName = '';
|
|
131
|
+
this.file = '';
|
|
132
|
+
this.scope = '';
|
|
133
|
+
this.roles = [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.ProjectManifestApplication = ProjectManifestApplication;
|
|
137
|
+
class ProjectManifestPdf {
|
|
138
|
+
name;
|
|
139
|
+
file;
|
|
140
|
+
constructor() {
|
|
141
|
+
this.name = '';
|
|
142
|
+
this.file = '';
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.ProjectManifestPdf = ProjectManifestPdf;
|
|
146
|
+
class ProjectManifestEmail {
|
|
147
|
+
name;
|
|
148
|
+
file;
|
|
149
|
+
constructor() {
|
|
150
|
+
this.name = '';
|
|
151
|
+
this.file = '';
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.ProjectManifestEmail = ProjectManifestEmail;
|
|
155
|
+
class ProjectManifestHtml {
|
|
156
|
+
name;
|
|
157
|
+
file;
|
|
158
|
+
constructor() {
|
|
159
|
+
this.name = '';
|
|
160
|
+
this.file = '';
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.ProjectManifestHtml = ProjectManifestHtml;
|
|
164
|
+
class ProjectManifestExpressComponent {
|
|
165
|
+
componentName;
|
|
166
|
+
file;
|
|
167
|
+
constructor() {
|
|
168
|
+
this.componentName = '';
|
|
169
|
+
this.file = '';
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.ProjectManifestExpressComponent = ProjectManifestExpressComponent;
|
|
173
|
+
class ProjectManifestScript {
|
|
174
|
+
file;
|
|
175
|
+
constructor() {
|
|
176
|
+
this.file = '';
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.ProjectManifestScript = ProjectManifestScript;
|
|
180
|
+
class ProjectManifestApplicationInsight {
|
|
181
|
+
key;
|
|
182
|
+
constructor() {
|
|
183
|
+
this.key = '';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
exports.ProjectManifestApplicationInsight = ProjectManifestApplicationInsight;
|
|
187
|
+
class ProjectManifestApi {
|
|
188
|
+
path;
|
|
189
|
+
method;
|
|
190
|
+
bpmn;
|
|
191
|
+
startNode;
|
|
192
|
+
accept;
|
|
193
|
+
priority;
|
|
194
|
+
minThreads;
|
|
195
|
+
maxThreads;
|
|
196
|
+
constructor() {
|
|
197
|
+
this.path = '';
|
|
198
|
+
this.method = '';
|
|
199
|
+
this.bpmn = '';
|
|
200
|
+
this.startNode = '';
|
|
201
|
+
this.accept = '';
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.ProjectManifestApi = ProjectManifestApi;
|
|
205
|
+
class ProjectManifestParameter {
|
|
206
|
+
key;
|
|
207
|
+
value;
|
|
208
|
+
constructor() {
|
|
209
|
+
this.key = '';
|
|
210
|
+
this.value = '';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.ProjectManifestParameter = ProjectManifestParameter;
|
|
214
|
+
//# sourceMappingURL=Codenotch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Codenotch.js","sourceRoot":"","sources":["../../src/models/Codenotch.ts"],"names":[],"mappings":";;;AAgBA,MAAa,eAAe;IACxB,WAAW,CAAS;IACpB,WAAW,CAAS;IACpB,OAAO,CAAS;IAChB,KAAK,CAAU,CAAC,yFAAyF;IACzG,QAAQ,CAAsC;IAC9C,IAAI,CAAuB;IAC3B,SAAS,CAAY;IAErB,YAAY,CAA0C;IAEtD,YAAY,CAA+B;IAC3C,iBAAiB,CAAgD,CAAC,6EAA6E;IAC/I,iBAAiB,CAAgD,CAAC,gEAAgE;IAClI,OAAO,CAAsC;IAC7C,IAAI,CAAmC;IACvC,MAAM,CAAqC;IAC3C,KAAK,CAAoC;IAEzC,SAAS,CAA2B;IAEpC,gBAAgB,CAA6B;IAC7C,mBAAmB,CAA6B;IAEhD,KAAK,CAAwB;IAE7B,yBAAyB,CAA4C;IAErE;QACI,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB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CAAC;QACf,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;CACJ;AAjBD,gDAiBC;AAED,MAAa,wBAAwB;IACjC,GAAG,CAAS;IACZ,KAAK,CAAS;IAEd;QACI,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACpB,CAAC;CACJ;AARD,4DAQC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
export declare enum FieldType {
|
|
3
|
+
STRING = 0,
|
|
4
|
+
NUMBER = 1,// Float
|
|
5
|
+
INTEGER = 2,
|
|
6
|
+
BOOL = 3,
|
|
7
|
+
LIST = 4,// aka array
|
|
8
|
+
MAP = 5
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Used only to save JSON .table file in scenar.io later
|
|
12
|
+
* given to DatabaseMigrationGenerator to compute XML migration
|
|
13
|
+
*/
|
|
14
|
+
export interface TableDefinition {
|
|
15
|
+
Name: string;
|
|
16
|
+
Description: string;
|
|
17
|
+
Id: IdField;
|
|
18
|
+
CreatedAt: CreatedAtField;
|
|
19
|
+
UpdatedAt: UpdatedAtField;
|
|
20
|
+
Fields?: BaseFieldType[];
|
|
21
|
+
AccessPolicy: ContainerAccessSettings;
|
|
22
|
+
RetentionPolicy: ContainerRetentionPolicy;
|
|
23
|
+
PatchSettings: ContainerPatchSettings;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* All SQL field types
|
|
27
|
+
*/
|
|
28
|
+
export declare enum FieldTypes {
|
|
29
|
+
Guid = "Guid",
|
|
30
|
+
Boolean = "Boolean",
|
|
31
|
+
String = "String",
|
|
32
|
+
Text = "Text",
|
|
33
|
+
Email = "Email",
|
|
34
|
+
Decimal = "Decimal",
|
|
35
|
+
Integer = "Integer",
|
|
36
|
+
Date = "Date",
|
|
37
|
+
DateTime = "DateTime",
|
|
38
|
+
Version = "Version",
|
|
39
|
+
Enum = "Enum",
|
|
40
|
+
AutoIncrement = "AutoIncrement",
|
|
41
|
+
HasMany = "HasMany",
|
|
42
|
+
HasOne = "HasOne",
|
|
43
|
+
BelongsTo = "BelongsTo"
|
|
44
|
+
}
|
|
45
|
+
export interface IdField {
|
|
46
|
+
Name: string;
|
|
47
|
+
}
|
|
48
|
+
export interface BaseFieldType {
|
|
49
|
+
Name: string;
|
|
50
|
+
Description: string;
|
|
51
|
+
Type: FieldTypes;
|
|
52
|
+
IsNullable: boolean;
|
|
53
|
+
IsUnique: boolean;
|
|
54
|
+
IsSecret: boolean;
|
|
55
|
+
IsIndexed: boolean;
|
|
56
|
+
IsValidated: boolean;
|
|
57
|
+
Validation: string;
|
|
58
|
+
}
|
|
59
|
+
export interface BaseRelation extends BaseFieldType {
|
|
60
|
+
Table: string;
|
|
61
|
+
}
|
|
62
|
+
export interface HasRelation extends BaseRelation {
|
|
63
|
+
BelongsTo: string;
|
|
64
|
+
LinkBehaviour: "Unlink" | "Delete" | string;
|
|
65
|
+
}
|
|
66
|
+
export interface HasOne extends HasRelation {
|
|
67
|
+
}
|
|
68
|
+
export interface HasMany extends HasRelation {
|
|
69
|
+
}
|
|
70
|
+
export interface BelongsTo extends BaseRelation {
|
|
71
|
+
Key: string;
|
|
72
|
+
}
|
|
73
|
+
export interface GuidField extends BaseFieldType {
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Contains email with autovalidation
|
|
77
|
+
*/
|
|
78
|
+
export interface EmailField extends BaseFieldType {
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Special SQL timestamp
|
|
82
|
+
*/
|
|
83
|
+
export interface VersionField extends BaseFieldType {
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Contains date + time
|
|
87
|
+
*/
|
|
88
|
+
export interface DateTimeField extends BaseFieldType {
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Contains date
|
|
92
|
+
*/
|
|
93
|
+
export interface DateField extends BaseFieldType {
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Array of string
|
|
97
|
+
*/
|
|
98
|
+
export interface EnumField extends BaseFieldType {
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
Value: string[];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Any number with Precision (How many floating numbers) and Scale (Max integer part)
|
|
106
|
+
*/
|
|
107
|
+
export interface DecimalField extends BaseFieldType {
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
*/
|
|
111
|
+
Precision: number;
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
*/
|
|
115
|
+
Scale: number;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* No floating number value
|
|
119
|
+
*/
|
|
120
|
+
export interface IntegerField extends BaseFieldType {
|
|
121
|
+
Size: string | undefined;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* String > of 16b
|
|
125
|
+
*/
|
|
126
|
+
export interface TextField extends BaseFieldType {
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Equivalent of VARCHAR(255)
|
|
130
|
+
*/
|
|
131
|
+
export interface StringField extends BaseFieldType {
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Contains true false as a bit
|
|
135
|
+
*/
|
|
136
|
+
export interface BooleanField extends BaseFieldType {
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* An integer column that is auto incremented
|
|
140
|
+
*/
|
|
141
|
+
export interface AutoIncrementField extends BaseFieldType {
|
|
142
|
+
/**
|
|
143
|
+
* Start value
|
|
144
|
+
*/
|
|
145
|
+
Seed: number;
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
Increment: number;
|
|
150
|
+
UseBigInt?: boolean;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
*/
|
|
155
|
+
export interface UpdatedAtField {
|
|
156
|
+
Name: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
export interface CreatedAtField {
|
|
162
|
+
Name: string;
|
|
163
|
+
}
|
|
164
|
+
export declare enum ContainerType {
|
|
165
|
+
Document = "0",
|
|
166
|
+
Sql = "1"
|
|
167
|
+
}
|
|
168
|
+
export default class AbstractRecordContainer {
|
|
169
|
+
name: string;
|
|
170
|
+
dataSourceKind: ContainerType;
|
|
171
|
+
schema: JSONSchema7;
|
|
172
|
+
accessPolicy: ContainerAccessSettings;
|
|
173
|
+
retentionPolicy: ContainerRetentionPolicy;
|
|
174
|
+
patchSettings: ContainerPatchSettings;
|
|
175
|
+
secretFields: string[];
|
|
176
|
+
constructor(name: string, type: ContainerType, schema: JSONSchema7, accessSettings?: ContainerAccessSettings, retentionPolicy?: ContainerRetentionPolicy, patchSettings?: ContainerPatchSettings, secretFields?: string[]);
|
|
177
|
+
getTag(): string;
|
|
178
|
+
}
|
|
179
|
+
export interface CrudAccessSetting {
|
|
180
|
+
read: 'all' | 'rls' | 'none';
|
|
181
|
+
update: 'all' | 'rls' | 'none';
|
|
182
|
+
delete: 'all' | 'rls' | 'none';
|
|
183
|
+
create: 'all' | 'none';
|
|
184
|
+
}
|
|
185
|
+
export interface ContainerAccessSettings {
|
|
186
|
+
internal: {
|
|
187
|
+
[scope: string]: CrudAccessSetting;
|
|
188
|
+
};
|
|
189
|
+
public: CrudAccessSetting;
|
|
190
|
+
external: CrudAccessSetting;
|
|
191
|
+
system: {
|
|
192
|
+
[serviceName: string]: CrudAccessSetting;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export interface ContainerRetentionPolicy {
|
|
196
|
+
/**
|
|
197
|
+
* The time after which the data is purged from the datasource
|
|
198
|
+
* If null, data never expires
|
|
199
|
+
* Default to null
|
|
200
|
+
*/
|
|
201
|
+
RetentionPeriod: string | null;
|
|
202
|
+
/**
|
|
203
|
+
* Describes the behaviour of the data upon reaching the retention period
|
|
204
|
+
*/
|
|
205
|
+
RetentionReachedBehaviour: "DELETE";
|
|
206
|
+
}
|
|
207
|
+
export interface ContainerPatchSettings {
|
|
208
|
+
/**
|
|
209
|
+
* Time (in minutes) after which a patch can no longer be compensated
|
|
210
|
+
*/
|
|
211
|
+
PatchExpirationMinutes: number;
|
|
212
|
+
/**
|
|
213
|
+
* Maximum amount of non-merged patches
|
|
214
|
+
* When this number is reached, the oldest patch is merged and can no longer be compensated
|
|
215
|
+
* 0 means no patch are kept for this datastore (the grain still keep a copy of the latest version of the record though)
|
|
216
|
+
*/
|
|
217
|
+
PatchRetentionAmount: number;
|
|
218
|
+
}
|
|
219
|
+
export interface DatabaseSchema {
|
|
220
|
+
Tables: TableDefinition[];
|
|
221
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContainerType = exports.FieldTypes = exports.FieldType = void 0;
|
|
4
|
+
var FieldType;
|
|
5
|
+
(function (FieldType) {
|
|
6
|
+
FieldType[FieldType["STRING"] = 0] = "STRING";
|
|
7
|
+
FieldType[FieldType["NUMBER"] = 1] = "NUMBER";
|
|
8
|
+
FieldType[FieldType["INTEGER"] = 2] = "INTEGER";
|
|
9
|
+
FieldType[FieldType["BOOL"] = 3] = "BOOL";
|
|
10
|
+
FieldType[FieldType["LIST"] = 4] = "LIST";
|
|
11
|
+
FieldType[FieldType["MAP"] = 5] = "MAP"; // aka object
|
|
12
|
+
})(FieldType || (exports.FieldType = FieldType = {}));
|
|
13
|
+
/**
|
|
14
|
+
* All SQL field types
|
|
15
|
+
*/
|
|
16
|
+
var FieldTypes;
|
|
17
|
+
(function (FieldTypes) {
|
|
18
|
+
FieldTypes["Guid"] = "Guid";
|
|
19
|
+
FieldTypes["Boolean"] = "Boolean";
|
|
20
|
+
FieldTypes["String"] = "String";
|
|
21
|
+
FieldTypes["Text"] = "Text";
|
|
22
|
+
FieldTypes["Email"] = "Email";
|
|
23
|
+
FieldTypes["Decimal"] = "Decimal";
|
|
24
|
+
FieldTypes["Integer"] = "Integer";
|
|
25
|
+
FieldTypes["Date"] = "Date";
|
|
26
|
+
FieldTypes["DateTime"] = "DateTime";
|
|
27
|
+
FieldTypes["Version"] = "Version";
|
|
28
|
+
FieldTypes["Enum"] = "Enum";
|
|
29
|
+
FieldTypes["AutoIncrement"] = "AutoIncrement";
|
|
30
|
+
FieldTypes["HasMany"] = "HasMany";
|
|
31
|
+
FieldTypes["HasOne"] = "HasOne";
|
|
32
|
+
FieldTypes["BelongsTo"] = "BelongsTo";
|
|
33
|
+
})(FieldTypes || (exports.FieldTypes = FieldTypes = {}));
|
|
34
|
+
var ContainerType;
|
|
35
|
+
(function (ContainerType) {
|
|
36
|
+
ContainerType["Document"] = "0";
|
|
37
|
+
ContainerType["Sql"] = "1";
|
|
38
|
+
})(ContainerType || (exports.ContainerType = ContainerType = {}));
|
|
39
|
+
// Abstraction of datastore container, provide a way to use any type of container, blob storage, sql, etc
|
|
40
|
+
class AbstractRecordContainer {
|
|
41
|
+
// Name and identifier
|
|
42
|
+
name;
|
|
43
|
+
dataSourceKind;
|
|
44
|
+
schema;
|
|
45
|
+
accessPolicy;
|
|
46
|
+
retentionPolicy;
|
|
47
|
+
patchSettings;
|
|
48
|
+
secretFields;
|
|
49
|
+
constructor(name, type, schema, accessSettings, retentionPolicy, patchSettings, secretFields) {
|
|
50
|
+
this.name = name;
|
|
51
|
+
this.dataSourceKind = type;
|
|
52
|
+
this.schema = schema;
|
|
53
|
+
if (accessSettings && accessSettings.public === undefined) {
|
|
54
|
+
accessSettings = undefined;
|
|
55
|
+
}
|
|
56
|
+
if (accessSettings) {
|
|
57
|
+
this.accessPolicy = accessSettings;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.accessPolicy = {
|
|
61
|
+
public: {
|
|
62
|
+
read: 'all',
|
|
63
|
+
update: 'all',
|
|
64
|
+
create: 'all',
|
|
65
|
+
delete: 'all'
|
|
66
|
+
},
|
|
67
|
+
external: {
|
|
68
|
+
read: 'all',
|
|
69
|
+
update: 'all',
|
|
70
|
+
create: 'all',
|
|
71
|
+
delete: 'all'
|
|
72
|
+
},
|
|
73
|
+
internal: {
|
|
74
|
+
_other: {
|
|
75
|
+
read: 'all',
|
|
76
|
+
update: 'all',
|
|
77
|
+
create: 'all',
|
|
78
|
+
delete: 'all'
|
|
79
|
+
},
|
|
80
|
+
admin: {
|
|
81
|
+
read: 'all',
|
|
82
|
+
update: 'all',
|
|
83
|
+
create: 'all',
|
|
84
|
+
delete: 'all'
|
|
85
|
+
},
|
|
86
|
+
dev: {
|
|
87
|
+
read: 'all',
|
|
88
|
+
update: 'all',
|
|
89
|
+
create: 'all',
|
|
90
|
+
delete: 'all'
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
system: {}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (retentionPolicy) {
|
|
97
|
+
this.retentionPolicy = retentionPolicy;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
this.retentionPolicy = {
|
|
101
|
+
RetentionPeriod: null, // default is to never expires
|
|
102
|
+
RetentionReachedBehaviour: "DELETE"
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (patchSettings) {
|
|
106
|
+
this.patchSettings = patchSettings;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.patchSettings = {
|
|
110
|
+
PatchExpirationMinutes: 1440,
|
|
111
|
+
PatchRetentionAmount: 10
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (secretFields) {
|
|
115
|
+
this.secretFields = secretFields;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this.secretFields = [];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Used to display a little tag in the UI
|
|
122
|
+
getTag() {
|
|
123
|
+
switch (this.dataSourceKind) {
|
|
124
|
+
case ContainerType.Document: return "json";
|
|
125
|
+
case ContainerType.Sql: return "sql";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.default = AbstractRecordContainer;
|
|
130
|
+
//# sourceMappingURL=DbModels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DbModels.js","sourceRoot":"","sources":["../../src/models/DbModels.ts"],"names":[],"mappings":";;;AAEA,IAAY,SAOX;AAPD,WAAY,SAAS;IACjB,6CAAM,CAAA;IACN,6CAAM,CAAA;IACN,+CAAO,CAAA;IACP,yCAAI,CAAA;IACJ,yCAAI,CAAA;IACJ,uCAAG,CAAA,CAAC,aAAa;AACrB,CAAC,EAPW,SAAS,yBAAT,SAAS,QAOpB;AAoBD;;GAEG;AACH,IAAY,UAgBX;AAhBD,WAAY,UAAU;IAClB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,6CAA+B,CAAA;IAC/B,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;AAC3B,CAAC,EAhBW,UAAU,0BAAV,UAAU,QAgBrB;AA6JD,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,+BAAc,CAAA;IACd,0BAAS,CAAA;AACb,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,yGAAyG;AACzG,MAAqB,uBAAuB;IAExC,sBAAsB;IACtB,IAAI,CAAS;IACb,cAAc,CAAgB;IAC9B,MAAM,CAAc;IAEpB,YA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EAAE,CAAC;YAClB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QAC3C,CAAC;aACI,CAAC;YACF,IAAI,CAAC,eAAe,GAAG;gBACnB,eAAe,EAAE,IAAI,EAAE,8BAA8B;gBACrD,yBAAyB,EAAE,QAAQ;aACtC,CAAA;QACL,CAAC;QAED,IAAI,aAAa,EAAE,CAAC;YAChB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACvC,CAAC;aACI,CAAC;YACF,IAAI,CAAC,aAAa,GAAG;gBACjB,sBAAsB,EAAE,IAAI;gBAC5B,oBAAoB,EAAE,EAAE;aAC3B,CAAA;QACL,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACf,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACrC,CAAC;aACI,CAAC;YACF,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QAC3B,CAAC;IACL,CAAC;IAED,yCAAyC;IAClC,MAAM;QACT,QAAQ,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1B,KAAK,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC;YAC3C,KAAK,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC;QACzC,CAAC;IACL,CAAC;CACJ;AAnGD,0CAmGC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
export interface IOpenApiSchemaRef {
|
|
3
|
+
schema: {
|
|
4
|
+
'$ref': string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface IOpenApiResponse {
|
|
8
|
+
description?: string;
|
|
9
|
+
content?: {
|
|
10
|
+
[type: string]: IOpenApiSchemaRef;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface IOpenApiEndpoint {
|
|
14
|
+
description?: string;
|
|
15
|
+
operationId?: string;
|
|
16
|
+
responses?: {
|
|
17
|
+
[code: string]: IOpenApiResponse;
|
|
18
|
+
};
|
|
19
|
+
parameters?: IOpenApiParameter[];
|
|
20
|
+
requestBody?: {
|
|
21
|
+
content: {
|
|
22
|
+
[type: string]: IOpenApiSchemaRef;
|
|
23
|
+
};
|
|
24
|
+
description?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface IOpenApiParameter {
|
|
28
|
+
description?: string;
|
|
29
|
+
in: string;
|
|
30
|
+
name: string;
|
|
31
|
+
required: boolean;
|
|
32
|
+
schema: JSONSchema7;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Open api version 3.0
|
|
36
|
+
*/
|
|
37
|
+
export default class OpenAPISpec {
|
|
38
|
+
/**
|
|
39
|
+
* Describe open API version
|
|
40
|
+
*/
|
|
41
|
+
openapi: string;
|
|
42
|
+
/**
|
|
43
|
+
* Api information
|
|
44
|
+
* version, title and license
|
|
45
|
+
*/
|
|
46
|
+
info: APIInfo;
|
|
47
|
+
/**
|
|
48
|
+
* List of API paths
|
|
49
|
+
*/
|
|
50
|
+
paths: any;
|
|
51
|
+
components?: {
|
|
52
|
+
schemas?: {
|
|
53
|
+
[name: string]: JSONSchema7;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* constructor
|
|
58
|
+
*/
|
|
59
|
+
constructor();
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* API information specification
|
|
63
|
+
*/
|
|
64
|
+
export declare class APIInfo {
|
|
65
|
+
/**
|
|
66
|
+
* API Version
|
|
67
|
+
*/
|
|
68
|
+
version: string;
|
|
69
|
+
/**
|
|
70
|
+
* API Title
|
|
71
|
+
*/
|
|
72
|
+
title: string;
|
|
73
|
+
constructor();
|
|
74
|
+
}
|
|
75
|
+
export declare class APIController {
|
|
76
|
+
description: string;
|
|
77
|
+
requestBody: any | null;
|
|
78
|
+
parameters: APIParameter[] | null;
|
|
79
|
+
responses: any;
|
|
80
|
+
constructor();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Api parameters use for path, inquery and headers
|
|
84
|
+
*/
|
|
85
|
+
export declare class APIParameter {
|
|
86
|
+
name: string;
|
|
87
|
+
in: string;
|
|
88
|
+
schema: SchemaType | null;
|
|
89
|
+
required: boolean;
|
|
90
|
+
constructor();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Open API response definition
|
|
94
|
+
*/
|
|
95
|
+
export declare class APIResponse {
|
|
96
|
+
description: string;
|
|
97
|
+
content?: {
|
|
98
|
+
"application/json": {
|
|
99
|
+
schema: SchemaType;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
constructor();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Open API schema type definition
|
|
106
|
+
*/
|
|
107
|
+
export declare class SchemaType {
|
|
108
|
+
type: string;
|
|
109
|
+
items?: object;
|
|
110
|
+
properties?: {
|
|
111
|
+
[key: string]: SchemaType;
|
|
112
|
+
};
|
|
113
|
+
example?: string;
|
|
114
|
+
constructor();
|
|
115
|
+
}
|