@webda/core 1.6.0-beta.1 → 2.0.0-beta.0
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/lib/application.d.ts +317 -195
- package/lib/application.js +171 -674
- package/lib/application.js.map +1 -1
- package/lib/application.spec.js +97 -289
- package/lib/application.spec.js.map +1 -1
- package/lib/core.d.ts +102 -214
- package/lib/core.js +146 -70
- package/lib/core.js.map +1 -1
- package/lib/core.spec.js +80 -17
- package/lib/core.spec.js.map +1 -1
- package/lib/index.d.ts +14 -9
- package/lib/index.js +19 -10
- package/lib/index.js.map +1 -1
- package/lib/models/aclmodel.d.ts +29 -8
- package/lib/models/aclmodel.js +68 -18
- package/lib/models/aclmodel.js.map +1 -1
- package/lib/models/aclmodel.spec.js +56 -19
- package/lib/models/aclmodel.spec.js.map +1 -1
- package/lib/models/coremodel.d.ts +9 -17
- package/lib/models/coremodel.js +36 -36
- package/lib/models/coremodel.js.map +1 -1
- package/lib/models/ident.d.ts +8 -3
- package/lib/models/ident.js +8 -1
- package/lib/models/ident.js.map +1 -1
- package/lib/models/ident.spec.js +3 -0
- package/lib/models/ident.spec.js.map +1 -1
- package/lib/models/ownermodel.d.ts +8 -4
- package/lib/models/ownermodel.js +10 -6
- package/lib/models/ownermodel.js.map +1 -1
- package/lib/models/rolemodel.js.map +1 -1
- package/lib/models/rolemodel.spec.js +4 -1
- package/lib/models/rolemodel.spec.js.map +1 -1
- package/lib/models/user.d.ts +32 -3
- package/lib/models/user.js +31 -0
- package/lib/models/user.js.map +1 -1
- package/lib/models/user.spec.js +11 -0
- package/lib/models/user.spec.js.map +1 -1
- package/lib/queues/filequeue.d.ts +2 -7
- package/lib/queues/filequeue.js +2 -11
- package/lib/queues/filequeue.js.map +1 -1
- package/lib/queues/filequeue.spec.js +0 -1
- package/lib/queues/filequeue.spec.js.map +1 -1
- package/lib/queues/memoryqueue.d.ts +2 -7
- package/lib/queues/memoryqueue.js +1 -11
- package/lib/queues/memoryqueue.js.map +1 -1
- package/lib/queues/memoryqueue.spec.js +0 -1
- package/lib/queues/memoryqueue.spec.js.map +1 -1
- package/lib/queues/queue.spec.d.ts +1 -1
- package/lib/queues/queue.spec.js +11 -9
- package/lib/queues/queue.spec.js.map +1 -1
- package/lib/queues/queueservice.js +1 -1
- package/lib/queues/queueservice.js.map +1 -1
- package/lib/router.d.ts +46 -1
- package/lib/router.js +89 -51
- package/lib/router.js.map +1 -1
- package/lib/router.spec.js +19 -2
- package/lib/router.spec.js.map +1 -1
- package/lib/services/asyncevents.d.ts +1 -0
- package/lib/services/asyncevents.js +4 -3
- package/lib/services/asyncevents.js.map +1 -1
- package/lib/services/authentication.d.ts +47 -5
- package/lib/services/authentication.js +99 -40
- package/lib/services/authentication.js.map +1 -1
- package/lib/services/authentication.spec.js +10 -0
- package/lib/services/authentication.spec.js.map +1 -1
- package/lib/services/binary.d.ts +126 -64
- package/lib/services/binary.js +247 -96
- package/lib/services/binary.js.map +1 -1
- package/lib/services/binary.spec.d.ts +1 -0
- package/lib/services/binary.spec.js +96 -25
- package/lib/services/binary.spec.js.map +1 -1
- package/lib/services/cloudbinary.d.ts +67 -0
- package/lib/services/cloudbinary.js +178 -0
- package/lib/services/cloudbinary.js.map +1 -0
- package/lib/services/cloudbinary.spec.d.ts +13 -0
- package/lib/services/cloudbinary.spec.js +205 -0
- package/lib/services/cloudbinary.spec.js.map +1 -0
- package/lib/services/configuration.d.ts +7 -2
- package/lib/services/configuration.js +4 -3
- package/lib/services/configuration.js.map +1 -1
- package/lib/services/configuration.spec.js +1 -0
- package/lib/services/configuration.spec.js.map +1 -1
- package/lib/services/cron.d.ts +5 -6
- package/lib/services/cron.js +4 -11
- package/lib/services/cron.js.map +1 -1
- package/lib/services/cron.spec.js +2 -3
- package/lib/services/cron.spec.js.map +1 -1
- package/lib/services/debugmailer.d.ts +11 -6
- package/lib/services/debugmailer.js +20 -14
- package/lib/services/debugmailer.js.map +1 -1
- package/lib/services/debugmailer.spec.js +1 -0
- package/lib/services/debugmailer.spec.js.map +1 -1
- package/lib/services/echo.d.ts +2 -6
- package/lib/services/echo.js +1 -11
- package/lib/services/echo.js.map +1 -1
- package/lib/services/echo.spec.js +1 -0
- package/lib/services/echo.spec.js.map +1 -1
- package/lib/services/filebinary.d.ts +36 -12
- package/lib/services/filebinary.js +123 -38
- package/lib/services/filebinary.js.map +1 -1
- package/lib/services/filebinary.spec.d.ts +4 -2
- package/lib/services/filebinary.spec.js +48 -8
- package/lib/services/filebinary.spec.js.map +1 -1
- package/lib/services/fileconfiguration.d.ts +1 -5
- package/lib/services/fileconfiguration.js +1 -10
- package/lib/services/fileconfiguration.js.map +1 -1
- package/lib/services/invitationservice.d.ts +198 -0
- package/lib/services/invitationservice.js +443 -0
- package/lib/services/invitationservice.js.map +1 -0
- package/lib/services/invitationservice.spec.d.ts +1 -0
- package/lib/services/invitationservice.spec.js +517 -0
- package/lib/services/invitationservice.spec.js.map +1 -0
- package/lib/services/kubernetesconfiguration.d.ts +3 -5
- package/lib/services/kubernetesconfiguration.js +5 -12
- package/lib/services/kubernetesconfiguration.js.map +1 -1
- package/lib/services/kubernetesconfiguration.spec.js +1 -1
- package/lib/services/kubernetesconfiguration.spec.js.map +1 -1
- package/lib/services/mailer.d.ts +44 -7
- package/lib/services/mailer.js +34 -14
- package/lib/services/mailer.js.map +1 -1
- package/lib/services/mailer.spec.js +29 -0
- package/lib/services/mailer.spec.js.map +1 -1
- package/lib/services/notificationservice.d.ts +76 -0
- package/lib/services/notificationservice.js +91 -0
- package/lib/services/notificationservice.js.map +1 -0
- package/lib/services/notificationservice.spec.d.ts +1 -0
- package/lib/services/notificationservice.spec.js +104 -0
- package/lib/services/notificationservice.spec.js.map +1 -0
- package/lib/services/oauth.d.ts +6 -4
- package/lib/services/oauth.js +28 -11
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/oauth.spec.js +7 -10
- package/lib/services/oauth.spec.js.map +1 -1
- package/lib/services/resource.d.ts +1 -5
- package/lib/services/resource.js +22 -17
- package/lib/services/resource.js.map +1 -1
- package/lib/services/resource.spec.js +0 -1
- package/lib/services/resource.spec.js.map +1 -1
- package/lib/services/service.d.ts +29 -26
- package/lib/services/service.js +16 -22
- package/lib/services/service.js.map +1 -1
- package/lib/services/service.spec.js +3 -0
- package/lib/services/service.spec.js.map +1 -1
- package/lib/services/version.d.ts +2 -5
- package/lib/services/version.js +1 -10
- package/lib/services/version.js.map +1 -1
- package/lib/stores/aggregator.d.ts +3 -5
- package/lib/stores/aggregator.js +3 -10
- package/lib/stores/aggregator.js.map +1 -1
- package/lib/stores/file.d.ts +7 -8
- package/lib/stores/file.js +18 -18
- package/lib/stores/file.js.map +1 -1
- package/lib/stores/file.spec.js +8 -6
- package/lib/stores/file.spec.js.map +1 -1
- package/lib/stores/mapper.d.ts +1 -5
- package/lib/stores/mapper.js +56 -39
- package/lib/stores/mapper.js.map +1 -1
- package/lib/stores/mapper.spec.js +120 -1
- package/lib/stores/mapper.spec.js.map +1 -1
- package/lib/stores/memory.d.ts +5 -9
- package/lib/stores/memory.js +5 -17
- package/lib/stores/memory.js.map +1 -1
- package/lib/stores/memory.spec.d.ts +1 -0
- package/lib/stores/memory.spec.js +32 -0
- package/lib/stores/memory.spec.js.map +1 -1
- package/lib/stores/store.d.ts +131 -26
- package/lib/stores/store.js +399 -80
- package/lib/stores/store.js.map +1 -1
- package/lib/stores/store.spec.d.ts +29 -2
- package/lib/stores/store.spec.js +204 -31
- package/lib/stores/store.spec.js.map +1 -1
- package/lib/stores/webdaql/WebdaQLLexer.d.ts +53 -0
- package/lib/stores/webdaql/WebdaQLLexer.js +290 -0
- package/lib/stores/webdaql/WebdaQLLexer.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserLexer.d.ts +53 -0
- package/lib/stores/webdaql/WebdaQLParserLexer.js +290 -0
- package/lib/stores/webdaql/WebdaQLParserLexer.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserListener.d.ts +308 -0
- package/lib/stores/webdaql/WebdaQLParserListener.js +4 -0
- package/lib/stores/webdaql/WebdaQLParserListener.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserParser.d.ts +301 -0
- package/lib/stores/webdaql/WebdaQLParserParser.js +1781 -0
- package/lib/stores/webdaql/WebdaQLParserParser.js.map +1 -0
- package/lib/stores/webdaql/WebdaQLParserVisitor.d.ts +198 -0
- package/lib/stores/webdaql/WebdaQLParserVisitor.js +4 -0
- package/lib/stores/webdaql/WebdaQLParserVisitor.js.map +1 -0
- package/lib/stores/webdaql/query.d.ts +300 -0
- package/lib/stores/webdaql/query.js +471 -0
- package/lib/stores/webdaql/query.js.map +1 -0
- package/lib/stores/webdaql/query.spec.d.ts +1 -0
- package/lib/stores/webdaql/query.spec.js +136 -0
- package/lib/stores/webdaql/query.spec.js.map +1 -0
- package/lib/test.d.ts +50 -2
- package/lib/test.js +161 -16
- package/lib/test.js.map +1 -1
- package/lib/unpackedapplication.d.ts +66 -0
- package/lib/unpackedapplication.js +202 -0
- package/lib/unpackedapplication.js.map +1 -0
- package/lib/utils/context.d.ts +14 -12
- package/lib/utils/context.js +14 -9
- package/lib/utils/context.js.map +1 -1
- package/lib/utils/context.spec.js +1 -1
- package/lib/utils/context.spec.js.map +1 -1
- package/lib/utils/cookie.d.ts +6 -3
- package/lib/utils/cookie.js +22 -20
- package/lib/utils/cookie.js.map +1 -1
- package/lib/utils/cookie.spec.js +0 -1
- package/lib/utils/cookie.spec.js.map +1 -1
- package/lib/utils/logger.d.ts +16 -3
- package/lib/utils/logger.js +16 -3
- package/lib/utils/logger.js.map +1 -1
- package/lib/utils/logger.spec.js.map +1 -1
- package/lib/utils/serializers.js +5 -1
- package/lib/utils/serializers.js.map +1 -1
- package/lib/utils/waiter.d.ts +1 -1
- package/lib/utils/waiter.js.map +1 -1
- package/package.json +25 -18
- package/test/config-file-no-reload.json +2 -1
- package/test/config-file-reload.json +2 -1
- package/test/config-invitation.json +63 -0
- package/test/config-kube-reload.json +2 -1
- package/test/config-reload.json +1 -1
- package/test/config.json +6 -10
- package/test/config.old.json +1 -1
- package/test/moddas/annotatedservice.js +1 -3
- package/test/moddas/debugmailer.js +2 -7
- package/test/moddas/fakeservice.js +1 -1
- package/test/moddas/voidstore.js +2 -4
- package/test/models/ident.js +1 -1
- package/test/models/task.js +1 -5
- package/webda.module.json +1124 -0
- package/test/config.old-default.json +0 -151
package/lib/application.d.ts
CHANGED
|
@@ -1,7 +1,199 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Deployment } from "./models/deployment";
|
|
1
|
+
import { Context, Core, CoreModelDefinition, Service } from "./index";
|
|
3
2
|
import { WorkerLogLevel, WorkerOutput } from "@webda/workout";
|
|
4
|
-
import {
|
|
3
|
+
import { JSONSchema7 } from "json-schema";
|
|
4
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
5
|
+
export declare type PackageDescriptorAuthor = string | {
|
|
6
|
+
name?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare type Modda = ServiceConstructor<Service>;
|
|
11
|
+
/**
|
|
12
|
+
* Some package exists but seems pretty big for this
|
|
13
|
+
* https://classic.yarnpkg.com/en/docs/package-json
|
|
14
|
+
*/
|
|
15
|
+
export interface PackageDescriptor {
|
|
16
|
+
name?: string;
|
|
17
|
+
version?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
keywords?: string[];
|
|
20
|
+
license?: string | {
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
homepage?: string;
|
|
24
|
+
bugs?: string;
|
|
25
|
+
repository?: string;
|
|
26
|
+
author?: PackageDescriptorAuthor;
|
|
27
|
+
contributors?: string[] | PackageDescriptorAuthor[];
|
|
28
|
+
files?: string[];
|
|
29
|
+
main?: string;
|
|
30
|
+
bin?: string | {
|
|
31
|
+
[key: string]: string;
|
|
32
|
+
};
|
|
33
|
+
man?: string | string[];
|
|
34
|
+
directories?: {
|
|
35
|
+
[key: string]: string;
|
|
36
|
+
};
|
|
37
|
+
scripts?: {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
};
|
|
40
|
+
config?: any;
|
|
41
|
+
dependencies?: {
|
|
42
|
+
[key: string]: string;
|
|
43
|
+
};
|
|
44
|
+
devDependencies?: {
|
|
45
|
+
[key: string]: string;
|
|
46
|
+
};
|
|
47
|
+
peerDependencies?: {
|
|
48
|
+
[key: string]: string;
|
|
49
|
+
};
|
|
50
|
+
peerDependenciesMeta?: {
|
|
51
|
+
[key: string]: {
|
|
52
|
+
optional: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
optionalDependencies?: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
};
|
|
58
|
+
bundledDependencies?: string[];
|
|
59
|
+
flat?: boolean;
|
|
60
|
+
resolutions?: {
|
|
61
|
+
[key: string]: string;
|
|
62
|
+
};
|
|
63
|
+
engines?: {
|
|
64
|
+
[key: string]: string;
|
|
65
|
+
};
|
|
66
|
+
os?: string[];
|
|
67
|
+
cpu?: string[];
|
|
68
|
+
private?: boolean;
|
|
69
|
+
publishConfig?: any;
|
|
70
|
+
webda?: Partial<WebdaPackageDescriptor>;
|
|
71
|
+
termsOfService?: string;
|
|
72
|
+
title?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A Webda module is a NPM package
|
|
76
|
+
*
|
|
77
|
+
* It contains one or more Modda to provide features
|
|
78
|
+
*/
|
|
79
|
+
export interface Module {
|
|
80
|
+
/**
|
|
81
|
+
* Services provided by the module
|
|
82
|
+
*/
|
|
83
|
+
moddas?: {
|
|
84
|
+
[key: string]: string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Models provided by the module
|
|
88
|
+
*/
|
|
89
|
+
models?: {
|
|
90
|
+
[key: string]: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Deployers provided by the module
|
|
94
|
+
*
|
|
95
|
+
* @link Deployer
|
|
96
|
+
*/
|
|
97
|
+
deployers?: {
|
|
98
|
+
[key: string]: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Schemas for services, deployers and coremodel
|
|
102
|
+
*/
|
|
103
|
+
schemas?: {
|
|
104
|
+
[key: string]: JSONSchema7;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Application beans
|
|
108
|
+
*/
|
|
109
|
+
beans?: {
|
|
110
|
+
[key: string]: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Cached module is all modules discover plus local package including the sources list
|
|
115
|
+
*/
|
|
116
|
+
export interface CachedModule extends Module {
|
|
117
|
+
/**
|
|
118
|
+
* Contained dynamic information on the project
|
|
119
|
+
* Statically capture on deployment
|
|
120
|
+
*/
|
|
121
|
+
project: ProjectInformation;
|
|
122
|
+
}
|
|
123
|
+
export declare type UnpackedConfiguration = {
|
|
124
|
+
version: 3;
|
|
125
|
+
/**
|
|
126
|
+
* Services configuration
|
|
127
|
+
*/
|
|
128
|
+
services?: any;
|
|
129
|
+
/**
|
|
130
|
+
* Global parameters
|
|
131
|
+
*/
|
|
132
|
+
parameters?: {
|
|
133
|
+
/**
|
|
134
|
+
* Allowed origin for referer that match
|
|
135
|
+
* any of this regexp
|
|
136
|
+
*
|
|
137
|
+
* {@link OriginFilter}
|
|
138
|
+
*/
|
|
139
|
+
csrfOrigins?: string[];
|
|
140
|
+
/**
|
|
141
|
+
* Allow you to authorize one or several websites
|
|
142
|
+
* If you use "*" then the API is open to direct call and any origins
|
|
143
|
+
*
|
|
144
|
+
* {@link WebsiteOriginFilter}
|
|
145
|
+
*/
|
|
146
|
+
website?: string | string[] | {
|
|
147
|
+
url: string;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Cookie configuration for session
|
|
151
|
+
*/
|
|
152
|
+
cookie?: {
|
|
153
|
+
sameSite: "None" | "Strict" | "Lax";
|
|
154
|
+
domain: string;
|
|
155
|
+
/**
|
|
156
|
+
* @minimum 1
|
|
157
|
+
*/
|
|
158
|
+
maxAge: number;
|
|
159
|
+
path: string;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Read from the configuration service before init
|
|
163
|
+
*/
|
|
164
|
+
configurationService?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Application salt
|
|
167
|
+
*/
|
|
168
|
+
salt?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Define the api url
|
|
171
|
+
*/
|
|
172
|
+
apiUrl?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Define the model to use for Context
|
|
175
|
+
*
|
|
176
|
+
* @default Context
|
|
177
|
+
*/
|
|
178
|
+
contextModel?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Allow any other type of parameters
|
|
181
|
+
*/
|
|
182
|
+
[key: string]: any;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* OpenAPI override
|
|
186
|
+
*/
|
|
187
|
+
openapi?: Partial<OpenAPIV3.Document>;
|
|
188
|
+
};
|
|
189
|
+
export declare type Configuration = UnpackedConfiguration & {
|
|
190
|
+
/**
|
|
191
|
+
* Cached modules to avoid scanning node_modules
|
|
192
|
+
* This is used by packagers
|
|
193
|
+
*/
|
|
194
|
+
cachedModules?: CachedModule;
|
|
195
|
+
};
|
|
196
|
+
export declare type StoredConfiguration = Configuration;
|
|
5
197
|
/**
|
|
6
198
|
* Return the gather information from the repository
|
|
7
199
|
* @mermaid Make TypeDoc easy to use with mermaid.js
|
|
@@ -56,29 +248,66 @@ export interface GitInformation {
|
|
|
56
248
|
*/
|
|
57
249
|
export interface ServiceConstructor<T extends Service> {
|
|
58
250
|
new (webda: Core, name: string, params: any): T;
|
|
59
|
-
|
|
60
|
-
|
|
251
|
+
}
|
|
252
|
+
export declare enum SectionEnum {
|
|
253
|
+
Moddas = "moddas",
|
|
254
|
+
Deployers = "deployers",
|
|
255
|
+
Models = "models",
|
|
256
|
+
Beans = "beans"
|
|
61
257
|
}
|
|
62
258
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
259
|
+
* Webda specific metadata for the project
|
|
65
260
|
*/
|
|
66
|
-
export interface
|
|
67
|
-
|
|
68
|
-
|
|
261
|
+
export interface WebdaPackageDescriptor {
|
|
262
|
+
/**
|
|
263
|
+
* Webda namespace
|
|
264
|
+
*/
|
|
265
|
+
namespace?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Logo to display within the shell tty
|
|
268
|
+
*/
|
|
269
|
+
logo?: string;
|
|
270
|
+
/**
|
|
271
|
+
* Information on the workspace
|
|
272
|
+
*/
|
|
273
|
+
workspaces?: {
|
|
274
|
+
packages: string[];
|
|
275
|
+
parent: PackageDescriptor;
|
|
276
|
+
path: string;
|
|
277
|
+
};
|
|
278
|
+
[key: string]: any;
|
|
69
279
|
}
|
|
70
280
|
/**
|
|
71
|
-
*
|
|
281
|
+
* Information on the whole project
|
|
72
282
|
*/
|
|
73
|
-
export
|
|
283
|
+
export interface ProjectInformation {
|
|
284
|
+
/**
|
|
285
|
+
* package.json information
|
|
286
|
+
*/
|
|
287
|
+
package: PackageDescriptor;
|
|
74
288
|
/**
|
|
75
|
-
*
|
|
289
|
+
* Webda project information
|
|
290
|
+
*
|
|
291
|
+
* It is the aggregation of webda information contained in package
|
|
292
|
+
* and its workspace meta
|
|
293
|
+
*/
|
|
294
|
+
webda: WebdaPackageDescriptor;
|
|
295
|
+
/**
|
|
296
|
+
* Git information gathered
|
|
297
|
+
*/
|
|
298
|
+
git: GitInformation;
|
|
299
|
+
/**
|
|
300
|
+
* Deployment information
|
|
76
301
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
302
|
+
deployment: {
|
|
303
|
+
name: string;
|
|
304
|
+
[key: string]: any;
|
|
305
|
+
};
|
|
81
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Type of Section
|
|
309
|
+
*/
|
|
310
|
+
export declare type Section = "moddas" | "deployers" | "models" | "beans";
|
|
82
311
|
/**
|
|
83
312
|
* Map a Webda Application
|
|
84
313
|
*
|
|
@@ -96,7 +325,7 @@ export declare class Application {
|
|
|
96
325
|
/**
|
|
97
326
|
* Get Application root path
|
|
98
327
|
*/
|
|
99
|
-
|
|
328
|
+
readonly appPath: string;
|
|
100
329
|
/**
|
|
101
330
|
* Base configuration loaded from webda.config.json
|
|
102
331
|
*/
|
|
@@ -105,10 +334,6 @@ export declare class Application {
|
|
|
105
334
|
* Current deployment
|
|
106
335
|
*/
|
|
107
336
|
protected currentDeployment: string;
|
|
108
|
-
/**
|
|
109
|
-
* Contains all definitions from imported modules and current code
|
|
110
|
-
*/
|
|
111
|
-
protected cachedModules: CachedModule;
|
|
112
337
|
/**
|
|
113
338
|
* Contains definitions of current application
|
|
114
339
|
*/
|
|
@@ -124,10 +349,10 @@ export declare class Application {
|
|
|
124
349
|
[key: string]: any;
|
|
125
350
|
};
|
|
126
351
|
/**
|
|
127
|
-
*
|
|
352
|
+
* Moddas registry
|
|
128
353
|
*/
|
|
129
|
-
protected
|
|
130
|
-
[key: string]:
|
|
354
|
+
protected moddas: {
|
|
355
|
+
[key: string]: Modda;
|
|
131
356
|
};
|
|
132
357
|
/**
|
|
133
358
|
* Models type registry
|
|
@@ -135,26 +360,10 @@ export declare class Application {
|
|
|
135
360
|
protected models: {
|
|
136
361
|
[key: string]: any;
|
|
137
362
|
};
|
|
138
|
-
/**
|
|
139
|
-
* Flag if application has been compiled already
|
|
140
|
-
*/
|
|
141
|
-
protected compiled: boolean;
|
|
142
363
|
/**
|
|
143
364
|
* Class Logger
|
|
144
365
|
*/
|
|
145
366
|
protected logger: WorkerOutput;
|
|
146
|
-
/**
|
|
147
|
-
* Contains package.json of application
|
|
148
|
-
*/
|
|
149
|
-
protected packageDescription: any;
|
|
150
|
-
/**
|
|
151
|
-
* Contains webda section of package.json and workspaces if exist
|
|
152
|
-
*/
|
|
153
|
-
protected packageWebda: any;
|
|
154
|
-
/**
|
|
155
|
-
* Webda namespace
|
|
156
|
-
*/
|
|
157
|
-
protected namespace: string;
|
|
158
367
|
/**
|
|
159
368
|
* Detect if running as workspace
|
|
160
369
|
*/
|
|
@@ -164,30 +373,47 @@ export declare class Application {
|
|
|
164
373
|
*/
|
|
165
374
|
protected initTime: number;
|
|
166
375
|
/**
|
|
167
|
-
*
|
|
376
|
+
* Configuration file
|
|
377
|
+
*/
|
|
378
|
+
readonly configurationFile: string;
|
|
379
|
+
/**
|
|
380
|
+
* Current deployment file
|
|
381
|
+
*/
|
|
382
|
+
deploymentFile: string;
|
|
383
|
+
/**
|
|
384
|
+
* Current application
|
|
168
385
|
*/
|
|
169
|
-
protected
|
|
386
|
+
protected static active: Application;
|
|
170
387
|
/**
|
|
171
388
|
*
|
|
172
389
|
* @param {string} fileOrFolder to load Webda Application from
|
|
173
390
|
* @param {Logger} logger
|
|
174
391
|
*/
|
|
175
|
-
constructor(file: string, logger?: WorkerOutput
|
|
392
|
+
constructor(file: string, logger?: WorkerOutput);
|
|
176
393
|
/**
|
|
394
|
+
* Import all required modules
|
|
395
|
+
*/
|
|
396
|
+
load(): Promise<this>;
|
|
397
|
+
/**
|
|
398
|
+
* Allow subclass to implement migration
|
|
177
399
|
*
|
|
178
|
-
* @param
|
|
400
|
+
* @param file
|
|
401
|
+
* @returns
|
|
179
402
|
*/
|
|
180
|
-
|
|
403
|
+
loadConfiguration(file: string): void;
|
|
181
404
|
/**
|
|
182
|
-
* Set the current schema resolver
|
|
183
405
|
*
|
|
184
|
-
* @param
|
|
406
|
+
* @param proto Prototype to send
|
|
185
407
|
*/
|
|
186
|
-
|
|
408
|
+
getFullNameFromPrototype(proto: any): string;
|
|
187
409
|
/**
|
|
188
|
-
* Get schema
|
|
410
|
+
* Get a schema from a type
|
|
411
|
+
*
|
|
412
|
+
* Schema should be precomputed in the default app
|
|
413
|
+
* @param type
|
|
414
|
+
* @returns
|
|
189
415
|
*/
|
|
190
|
-
|
|
416
|
+
getSchema(type: string): JSONSchema7;
|
|
191
417
|
/**
|
|
192
418
|
* Check if application has cached modules
|
|
193
419
|
*
|
|
@@ -196,40 +422,16 @@ export declare class Application {
|
|
|
196
422
|
* take the schema from the cached modules also
|
|
197
423
|
*/
|
|
198
424
|
isCached(): boolean;
|
|
199
|
-
/**
|
|
200
|
-
* Check package.json
|
|
201
|
-
*/
|
|
202
|
-
loadPackageInfos(): void;
|
|
203
425
|
/**
|
|
204
426
|
* Retrieve specific webda conf from package.json
|
|
205
427
|
*
|
|
206
428
|
* In case of workspaces the object is combined
|
|
207
429
|
*/
|
|
208
|
-
getPackageWebda():
|
|
430
|
+
getPackageWebda(): WebdaPackageDescriptor;
|
|
209
431
|
/**
|
|
210
432
|
* Retrieve content of package.json
|
|
211
433
|
*/
|
|
212
|
-
getPackageDescription():
|
|
213
|
-
/**
|
|
214
|
-
* Set the status of the compilation
|
|
215
|
-
*
|
|
216
|
-
* @param compile true will avoid trigger new compilation
|
|
217
|
-
*/
|
|
218
|
-
preventCompilation(compile: boolean): void;
|
|
219
|
-
/**
|
|
220
|
-
* Migrate from v0 to v1 configuration
|
|
221
|
-
*
|
|
222
|
-
* A V0 is a webda.config.json that does not contain any version tag
|
|
223
|
-
*
|
|
224
|
-
* @param config
|
|
225
|
-
*/
|
|
226
|
-
migrateV0Config(config: any): Configuration;
|
|
227
|
-
/**
|
|
228
|
-
* Migrate from v1 to v2 configuration format
|
|
229
|
-
*
|
|
230
|
-
* @param config
|
|
231
|
-
*/
|
|
232
|
-
migrateV1Config(config: ConfigurationV1): Configuration;
|
|
434
|
+
getPackageDescription(): PackageDescriptor;
|
|
233
435
|
/**
|
|
234
436
|
* Log information
|
|
235
437
|
*
|
|
@@ -253,25 +455,38 @@ export declare class Application {
|
|
|
253
455
|
* @param name
|
|
254
456
|
* @param service
|
|
255
457
|
*/
|
|
256
|
-
addService(name: string, service:
|
|
458
|
+
addService(name: string, service: Modda): this;
|
|
459
|
+
/**
|
|
460
|
+
*
|
|
461
|
+
* @param section
|
|
462
|
+
* @param name
|
|
463
|
+
* @returns
|
|
464
|
+
*/
|
|
465
|
+
getWebdaObject(section: Section, name: any): any;
|
|
257
466
|
/**
|
|
258
467
|
* Get a service based on name
|
|
259
468
|
*
|
|
260
469
|
* @param name
|
|
261
470
|
*/
|
|
262
|
-
|
|
471
|
+
getModda(name: any): Modda;
|
|
263
472
|
/**
|
|
264
473
|
* Return all services of the application
|
|
265
474
|
*/
|
|
266
|
-
|
|
267
|
-
[key: string]:
|
|
475
|
+
getModdas(): {
|
|
476
|
+
[key: string]: Modda;
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* Return all beans of the application
|
|
480
|
+
*/
|
|
481
|
+
getBeans(): {
|
|
482
|
+
[key: string]: string;
|
|
268
483
|
};
|
|
269
484
|
/**
|
|
270
485
|
* Retrieve the model implementation
|
|
271
486
|
*
|
|
272
487
|
* @param name model to retrieve
|
|
273
488
|
*/
|
|
274
|
-
getModel(name: string):
|
|
489
|
+
getModel(name: string): Context | CoreModelDefinition;
|
|
275
490
|
/**
|
|
276
491
|
* Get all models definitions
|
|
277
492
|
*/
|
|
@@ -282,7 +497,7 @@ export declare class Application {
|
|
|
282
497
|
* Return all deployers
|
|
283
498
|
*/
|
|
284
499
|
getDeployers(): {
|
|
285
|
-
[key: string]:
|
|
500
|
+
[key: string]: Modda;
|
|
286
501
|
};
|
|
287
502
|
/**
|
|
288
503
|
* Add a new model
|
|
@@ -290,22 +505,14 @@ export declare class Application {
|
|
|
290
505
|
* @param name
|
|
291
506
|
* @param model
|
|
292
507
|
*/
|
|
293
|
-
addModel(name: string, model: any):
|
|
508
|
+
addModel(name: string, model: any): this;
|
|
294
509
|
/**
|
|
295
510
|
* Add a new deployer
|
|
296
511
|
*
|
|
297
512
|
* @param name
|
|
298
513
|
* @param model
|
|
299
514
|
*/
|
|
300
|
-
addDeployer(name: string, model: any):
|
|
301
|
-
/**
|
|
302
|
-
* Check if a deployment exists for this application
|
|
303
|
-
* This method cannot be called for a packaged application
|
|
304
|
-
* as we do not keep deployments files when deployed
|
|
305
|
-
*
|
|
306
|
-
* @param deploymentName
|
|
307
|
-
*/
|
|
308
|
-
hasDeployment(deploymentName: string): boolean;
|
|
515
|
+
addDeployer(name: string, model: any): this;
|
|
309
516
|
/**
|
|
310
517
|
* Return webda current version
|
|
311
518
|
*
|
|
@@ -313,14 +520,13 @@ export declare class Application {
|
|
|
313
520
|
* @since 0.4.0
|
|
314
521
|
*/
|
|
315
522
|
getWebdaVersion(): string;
|
|
316
|
-
getDeployment(deploymentName?: string): Deployment;
|
|
317
523
|
/**
|
|
318
524
|
* Retrieve Git Repository information
|
|
319
525
|
*
|
|
320
526
|
* {@link GitInformation} for more details on how the information is gathered
|
|
321
527
|
* @return the git information
|
|
322
528
|
*/
|
|
323
|
-
getGitInformation(): GitInformation;
|
|
529
|
+
getGitInformation(_packageName?: string, _version?: string): GitInformation;
|
|
324
530
|
/**
|
|
325
531
|
* Allow variable inside of string
|
|
326
532
|
*
|
|
@@ -366,67 +572,21 @@ export declare class Application {
|
|
|
366
572
|
*/
|
|
367
573
|
replaceVariables(object: any, replacements?: any): any;
|
|
368
574
|
/**
|
|
369
|
-
*
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
*
|
|
374
|
-
* ```json
|
|
375
|
-
* {
|
|
376
|
-
* "parameters": {
|
|
377
|
-
* "param3": "test"
|
|
378
|
-
* },
|
|
379
|
-
* "services": {
|
|
380
|
-
* "MyService": {
|
|
381
|
-
* "param1": {
|
|
382
|
-
* "sub": "test"
|
|
383
|
-
* },
|
|
384
|
-
* "param2": "value"
|
|
385
|
-
* }
|
|
386
|
-
* }
|
|
387
|
-
* }
|
|
388
|
-
* ```
|
|
389
|
-
*
|
|
390
|
-
* deployment.json
|
|
391
|
-
* ```json
|
|
392
|
-
* {
|
|
393
|
-
* "parameters": {
|
|
394
|
-
* "param4": "deployment"
|
|
395
|
-
* }
|
|
396
|
-
* "services": {
|
|
397
|
-
* "MyService": {
|
|
398
|
-
* "param1": {
|
|
399
|
-
* "sub2": "deploymentSub"
|
|
400
|
-
* },
|
|
401
|
-
* "param2": "${package.version}"
|
|
402
|
-
* }
|
|
403
|
-
* }
|
|
404
|
-
* }
|
|
405
|
-
* ```
|
|
406
|
-
*
|
|
407
|
-
* The result would be:
|
|
408
|
-
* ```json
|
|
409
|
-
* {
|
|
410
|
-
* "parameters": {
|
|
411
|
-
* "param3": "test",
|
|
412
|
-
* "param4": "deployment"
|
|
413
|
-
* },
|
|
414
|
-
* "services": {
|
|
415
|
-
* "MyService": {
|
|
416
|
-
* "param1": {
|
|
417
|
-
* "sub": "test",
|
|
418
|
-
* "sub2": "deploymentSub"
|
|
419
|
-
* },
|
|
420
|
-
* "param2": "1.1.0"
|
|
421
|
-
* }
|
|
422
|
-
* }
|
|
423
|
-
* }
|
|
424
|
-
* ```
|
|
425
|
-
* This map can also use parameters {@link replaceVariables}
|
|
575
|
+
* Get current deployment name
|
|
576
|
+
*/
|
|
577
|
+
getCurrentDeployment(): string;
|
|
578
|
+
/**
|
|
579
|
+
* Return all application modules merged as one
|
|
426
580
|
*
|
|
427
|
-
*
|
|
581
|
+
* Used when deployed
|
|
582
|
+
* @returns
|
|
583
|
+
*/
|
|
584
|
+
getModules(): CachedModule;
|
|
585
|
+
/**
|
|
586
|
+
* Get application configuration
|
|
587
|
+
* @returns
|
|
428
588
|
*/
|
|
429
|
-
getConfiguration(
|
|
589
|
+
getConfiguration(_deployment?: string): Configuration;
|
|
430
590
|
/**
|
|
431
591
|
* Return current Configuration of the Application
|
|
432
592
|
*
|
|
@@ -437,35 +597,6 @@ export declare class Application {
|
|
|
437
597
|
* ```
|
|
438
598
|
*/
|
|
439
599
|
getCurrentConfiguration(): Configuration;
|
|
440
|
-
/**
|
|
441
|
-
* Set the current deployment for the application
|
|
442
|
-
* Call to getCurrentConfiguration will resolve to the computed configuration for the deployment
|
|
443
|
-
* If needed, you can call the method with undefined to reset to default configuration
|
|
444
|
-
*
|
|
445
|
-
* @param deployment to set
|
|
446
|
-
*/
|
|
447
|
-
setCurrentDeployment(deployment: string): void;
|
|
448
|
-
/**
|
|
449
|
-
* Get current deployment name
|
|
450
|
-
*/
|
|
451
|
-
getCurrentDeployment(): string;
|
|
452
|
-
/**
|
|
453
|
-
* Compile the application if it is a Typescript application
|
|
454
|
-
* Do nothing otherwise
|
|
455
|
-
*/
|
|
456
|
-
compile(): void;
|
|
457
|
-
/**
|
|
458
|
-
* Load all imported modules and current module
|
|
459
|
-
* It will compile module
|
|
460
|
-
* Generate the current module file
|
|
461
|
-
* Load any imported webda.module.json
|
|
462
|
-
*/
|
|
463
|
-
loadModules(): void;
|
|
464
|
-
getModules(): CachedModule;
|
|
465
|
-
/**
|
|
466
|
-
* Generate the module for current application
|
|
467
|
-
*/
|
|
468
|
-
generateModule(): void;
|
|
469
600
|
/**
|
|
470
601
|
* Import a file
|
|
471
602
|
*
|
|
@@ -473,18 +604,18 @@ export declare class Application {
|
|
|
473
604
|
*
|
|
474
605
|
* @param info
|
|
475
606
|
*/
|
|
476
|
-
|
|
607
|
+
importFile(info: string): Promise<any>;
|
|
477
608
|
/**
|
|
478
609
|
* Load local module
|
|
479
610
|
*/
|
|
480
|
-
loadLocalModule(): void
|
|
611
|
+
loadLocalModule(): Promise<void>;
|
|
481
612
|
/**
|
|
482
613
|
* Load the module,
|
|
483
614
|
*
|
|
484
615
|
* @protected
|
|
485
616
|
* @ignore Useless for documentation
|
|
486
617
|
*/
|
|
487
|
-
loadModule(
|
|
618
|
+
loadModule(module: Module, parent?: string): Promise<void>;
|
|
488
619
|
/**
|
|
489
620
|
* Return the full name including namespace
|
|
490
621
|
*
|
|
@@ -502,13 +633,4 @@ export declare class Application {
|
|
|
502
633
|
* @param className
|
|
503
634
|
*/
|
|
504
635
|
extends(obj: any, className: any): boolean;
|
|
505
|
-
/**
|
|
506
|
-
* Load a javascript file and check for Modda
|
|
507
|
-
* @param path to load
|
|
508
|
-
*/
|
|
509
|
-
protected loadJavascriptFile(absolutePath: string): void;
|
|
510
|
-
/**
|
|
511
|
-
* Get the application files
|
|
512
|
-
*/
|
|
513
|
-
getPackagesLocations(): string[];
|
|
514
636
|
}
|