@webda/core 1.6.0-beta.3 → 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.
Files changed (210) hide show
  1. package/lib/application.d.ts +317 -195
  2. package/lib/application.js +171 -679
  3. package/lib/application.js.map +1 -1
  4. package/lib/application.spec.js +97 -289
  5. package/lib/application.spec.js.map +1 -1
  6. package/lib/core.d.ts +102 -214
  7. package/lib/core.js +145 -68
  8. package/lib/core.js.map +1 -1
  9. package/lib/core.spec.js +78 -15
  10. package/lib/core.spec.js.map +1 -1
  11. package/lib/index.d.ts +3 -0
  12. package/lib/index.js +8 -1
  13. package/lib/index.js.map +1 -1
  14. package/lib/models/aclmodel.d.ts +3 -1
  15. package/lib/models/aclmodel.js +3 -1
  16. package/lib/models/aclmodel.js.map +1 -1
  17. package/lib/models/aclmodel.spec.js +4 -1
  18. package/lib/models/aclmodel.spec.js.map +1 -1
  19. package/lib/models/coremodel.d.ts +9 -17
  20. package/lib/models/coremodel.js +36 -36
  21. package/lib/models/coremodel.js.map +1 -1
  22. package/lib/models/ident.d.ts +3 -3
  23. package/lib/models/ident.js +2 -1
  24. package/lib/models/ident.js.map +1 -1
  25. package/lib/models/ownermodel.d.ts +8 -4
  26. package/lib/models/ownermodel.js +9 -4
  27. package/lib/models/ownermodel.js.map +1 -1
  28. package/lib/models/rolemodel.js.map +1 -1
  29. package/lib/models/rolemodel.spec.js +4 -1
  30. package/lib/models/rolemodel.spec.js.map +1 -1
  31. package/lib/models/user.d.ts +4 -3
  32. package/lib/models/user.js +2 -1
  33. package/lib/models/user.js.map +1 -1
  34. package/lib/queues/filequeue.d.ts +2 -7
  35. package/lib/queues/filequeue.js +2 -11
  36. package/lib/queues/filequeue.js.map +1 -1
  37. package/lib/queues/filequeue.spec.js +0 -1
  38. package/lib/queues/filequeue.spec.js.map +1 -1
  39. package/lib/queues/memoryqueue.d.ts +2 -7
  40. package/lib/queues/memoryqueue.js +1 -11
  41. package/lib/queues/memoryqueue.js.map +1 -1
  42. package/lib/queues/queue.spec.d.ts +1 -1
  43. package/lib/queues/queue.spec.js +11 -9
  44. package/lib/queues/queue.spec.js.map +1 -1
  45. package/lib/queues/queueservice.js +1 -1
  46. package/lib/queues/queueservice.js.map +1 -1
  47. package/lib/router.d.ts +46 -1
  48. package/lib/router.js +89 -51
  49. package/lib/router.js.map +1 -1
  50. package/lib/router.spec.js +18 -1
  51. package/lib/router.spec.js.map +1 -1
  52. package/lib/services/asyncevents.d.ts +1 -0
  53. package/lib/services/asyncevents.js +4 -3
  54. package/lib/services/asyncevents.js.map +1 -1
  55. package/lib/services/authentication.d.ts +12 -4
  56. package/lib/services/authentication.js +47 -36
  57. package/lib/services/authentication.js.map +1 -1
  58. package/lib/services/authentication.spec.js +1 -0
  59. package/lib/services/authentication.spec.js.map +1 -1
  60. package/lib/services/binary.d.ts +126 -64
  61. package/lib/services/binary.js +243 -92
  62. package/lib/services/binary.js.map +1 -1
  63. package/lib/services/binary.spec.d.ts +1 -0
  64. package/lib/services/binary.spec.js +96 -25
  65. package/lib/services/binary.spec.js.map +1 -1
  66. package/lib/services/cloudbinary.d.ts +67 -0
  67. package/lib/services/cloudbinary.js +178 -0
  68. package/lib/services/cloudbinary.js.map +1 -0
  69. package/lib/services/cloudbinary.spec.d.ts +13 -0
  70. package/lib/services/cloudbinary.spec.js +205 -0
  71. package/lib/services/cloudbinary.spec.js.map +1 -0
  72. package/lib/services/configuration.d.ts +7 -2
  73. package/lib/services/configuration.js +4 -3
  74. package/lib/services/configuration.js.map +1 -1
  75. package/lib/services/configuration.spec.js +1 -0
  76. package/lib/services/configuration.spec.js.map +1 -1
  77. package/lib/services/cron.d.ts +5 -6
  78. package/lib/services/cron.js +4 -11
  79. package/lib/services/cron.js.map +1 -1
  80. package/lib/services/cron.spec.js +0 -1
  81. package/lib/services/cron.spec.js.map +1 -1
  82. package/lib/services/debugmailer.d.ts +3 -5
  83. package/lib/services/debugmailer.js +3 -11
  84. package/lib/services/debugmailer.js.map +1 -1
  85. package/lib/services/echo.d.ts +2 -6
  86. package/lib/services/echo.js +1 -11
  87. package/lib/services/echo.js.map +1 -1
  88. package/lib/services/echo.spec.js +1 -0
  89. package/lib/services/echo.spec.js.map +1 -1
  90. package/lib/services/filebinary.d.ts +36 -12
  91. package/lib/services/filebinary.js +123 -38
  92. package/lib/services/filebinary.js.map +1 -1
  93. package/lib/services/filebinary.spec.d.ts +4 -2
  94. package/lib/services/filebinary.spec.js +48 -7
  95. package/lib/services/filebinary.spec.js.map +1 -1
  96. package/lib/services/fileconfiguration.d.ts +1 -5
  97. package/lib/services/fileconfiguration.js +1 -10
  98. package/lib/services/fileconfiguration.js.map +1 -1
  99. package/lib/services/invitationservice.d.ts +2 -0
  100. package/lib/services/invitationservice.js +3 -1
  101. package/lib/services/invitationservice.js.map +1 -1
  102. package/lib/services/invitationservice.spec.js +1 -0
  103. package/lib/services/invitationservice.spec.js.map +1 -1
  104. package/lib/services/kubernetesconfiguration.d.ts +3 -5
  105. package/lib/services/kubernetesconfiguration.js +5 -12
  106. package/lib/services/kubernetesconfiguration.js.map +1 -1
  107. package/lib/services/kubernetesconfiguration.spec.js +1 -1
  108. package/lib/services/kubernetesconfiguration.spec.js.map +1 -1
  109. package/lib/services/mailer.d.ts +1 -5
  110. package/lib/services/mailer.js +1 -10
  111. package/lib/services/mailer.js.map +1 -1
  112. package/lib/services/notificationservice.d.ts +2 -0
  113. package/lib/services/notificationservice.js +2 -0
  114. package/lib/services/notificationservice.js.map +1 -1
  115. package/lib/services/oauth.d.ts +6 -4
  116. package/lib/services/oauth.js +28 -11
  117. package/lib/services/oauth.js.map +1 -1
  118. package/lib/services/oauth.spec.js.map +1 -1
  119. package/lib/services/resource.d.ts +1 -5
  120. package/lib/services/resource.js +22 -17
  121. package/lib/services/resource.js.map +1 -1
  122. package/lib/services/resource.spec.js +0 -1
  123. package/lib/services/resource.spec.js.map +1 -1
  124. package/lib/services/service.d.ts +19 -22
  125. package/lib/services/service.js +16 -22
  126. package/lib/services/service.js.map +1 -1
  127. package/lib/services/version.d.ts +2 -5
  128. package/lib/services/version.js +1 -10
  129. package/lib/services/version.js.map +1 -1
  130. package/lib/stores/aggregator.d.ts +3 -5
  131. package/lib/stores/aggregator.js +3 -10
  132. package/lib/stores/aggregator.js.map +1 -1
  133. package/lib/stores/file.d.ts +7 -8
  134. package/lib/stores/file.js +18 -18
  135. package/lib/stores/file.js.map +1 -1
  136. package/lib/stores/file.spec.js +3 -2
  137. package/lib/stores/file.spec.js.map +1 -1
  138. package/lib/stores/mapper.d.ts +1 -5
  139. package/lib/stores/mapper.js +4 -13
  140. package/lib/stores/mapper.js.map +1 -1
  141. package/lib/stores/mapper.spec.js +1 -1
  142. package/lib/stores/mapper.spec.js.map +1 -1
  143. package/lib/stores/memory.d.ts +5 -9
  144. package/lib/stores/memory.js +5 -17
  145. package/lib/stores/memory.js.map +1 -1
  146. package/lib/stores/memory.spec.d.ts +1 -0
  147. package/lib/stores/memory.spec.js +32 -0
  148. package/lib/stores/memory.spec.js.map +1 -1
  149. package/lib/stores/store.d.ts +131 -26
  150. package/lib/stores/store.js +387 -70
  151. package/lib/stores/store.js.map +1 -1
  152. package/lib/stores/store.spec.d.ts +29 -2
  153. package/lib/stores/store.spec.js +204 -31
  154. package/lib/stores/store.spec.js.map +1 -1
  155. package/lib/stores/webdaql/WebdaQLLexer.d.ts +53 -0
  156. package/lib/stores/webdaql/WebdaQLLexer.js +290 -0
  157. package/lib/stores/webdaql/WebdaQLLexer.js.map +1 -0
  158. package/lib/stores/webdaql/WebdaQLParserLexer.d.ts +53 -0
  159. package/lib/stores/webdaql/WebdaQLParserLexer.js +290 -0
  160. package/lib/stores/webdaql/WebdaQLParserLexer.js.map +1 -0
  161. package/lib/stores/webdaql/WebdaQLParserListener.d.ts +308 -0
  162. package/lib/stores/webdaql/WebdaQLParserListener.js +4 -0
  163. package/lib/stores/webdaql/WebdaQLParserListener.js.map +1 -0
  164. package/lib/stores/webdaql/WebdaQLParserParser.d.ts +301 -0
  165. package/lib/stores/webdaql/WebdaQLParserParser.js +1781 -0
  166. package/lib/stores/webdaql/WebdaQLParserParser.js.map +1 -0
  167. package/lib/stores/webdaql/WebdaQLParserVisitor.d.ts +198 -0
  168. package/lib/stores/webdaql/WebdaQLParserVisitor.js +4 -0
  169. package/lib/stores/webdaql/WebdaQLParserVisitor.js.map +1 -0
  170. package/lib/stores/webdaql/query.d.ts +300 -0
  171. package/lib/stores/webdaql/query.js +471 -0
  172. package/lib/stores/webdaql/query.js.map +1 -0
  173. package/lib/stores/webdaql/query.spec.d.ts +1 -0
  174. package/lib/stores/webdaql/query.spec.js +136 -0
  175. package/lib/stores/webdaql/query.spec.js.map +1 -0
  176. package/lib/test.d.ts +48 -1
  177. package/lib/test.js +141 -14
  178. package/lib/test.js.map +1 -1
  179. package/lib/unpackedapplication.d.ts +66 -0
  180. package/lib/unpackedapplication.js +202 -0
  181. package/lib/unpackedapplication.js.map +1 -0
  182. package/lib/utils/context.d.ts +13 -12
  183. package/lib/utils/context.js +7 -6
  184. package/lib/utils/context.js.map +1 -1
  185. package/lib/utils/cookie.d.ts +6 -3
  186. package/lib/utils/cookie.js +5 -1
  187. package/lib/utils/cookie.js.map +1 -1
  188. package/lib/utils/logger.d.ts +16 -3
  189. package/lib/utils/logger.js +16 -3
  190. package/lib/utils/logger.js.map +1 -1
  191. package/lib/utils/logger.spec.js.map +1 -1
  192. package/lib/utils/serializers.js +5 -1
  193. package/lib/utils/serializers.js.map +1 -1
  194. package/lib/utils/waiter.d.ts +1 -1
  195. package/lib/utils/waiter.js.map +1 -1
  196. package/package.json +25 -18
  197. package/test/config-file-no-reload.json +2 -1
  198. package/test/config-file-reload.json +2 -1
  199. package/test/config-kube-reload.json +2 -1
  200. package/test/config-reload.json +1 -1
  201. package/test/config.json +6 -10
  202. package/test/config.old.json +1 -1
  203. package/test/moddas/annotatedservice.js +1 -3
  204. package/test/moddas/debugmailer.js +2 -7
  205. package/test/moddas/fakeservice.js +1 -1
  206. package/test/moddas/voidstore.js +2 -4
  207. package/test/models/ident.js +1 -1
  208. package/test/models/task.js +1 -5
  209. package/webda.module.json +1124 -0
  210. package/test/config.old-default.json +0 -151
@@ -1,7 +1,199 @@
1
- import { CachedModule, Configuration, ConfigurationV1, Context, Core, CoreModelDefinition, Module, Service } from "./index";
2
- import { Deployment } from "./models/deployment";
1
+ import { Context, Core, CoreModelDefinition, Service } from "./index";
3
2
  import { WorkerLogLevel, WorkerOutput } from "@webda/workout";
4
- import { JSONSchema6 } from "json-schema";
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
- getModda(): any;
60
- getSchema(): JSONSchema6;
251
+ }
252
+ export declare enum SectionEnum {
253
+ Moddas = "moddas",
254
+ Deployers = "deployers",
255
+ Models = "models",
256
+ Beans = "beans"
61
257
  }
62
258
  /**
63
- * Retrieve a JSONSchema from a webda object
64
- *
259
+ * Webda specific metadata for the project
65
260
  */
66
- export interface SchemaResolver {
67
- fromPrototype(type: any): JSONSchema6;
68
- fromServiceType(type: string): JSONSchema6;
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
- * Implement the default way of retrieving schema
281
+ * Information on the whole project
72
282
  */
73
- export declare class DefaultSchemaResolver implements SchemaResolver {
283
+ export interface ProjectInformation {
284
+ /**
285
+ * package.json information
286
+ */
287
+ package: PackageDescriptor;
74
288
  /**
75
- * Application
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
- protected app: Application;
78
- constructor(app: Application);
79
- fromServiceType(type?: string): JSONSchema6;
80
- fromPrototype(type: any): JSONSchema6;
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
- protected appPath: string;
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
- * Services type registry
352
+ * Moddas registry
128
353
  */
129
- protected services: {
130
- [key: string]: ServiceConstructor<Service>;
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
- * Current Schema resolver
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 schemaResolver: SchemaResolver;
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, allowModule?: boolean);
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 proto Prototype to send
400
+ * @param file
401
+ * @returns
179
402
  */
180
- getFullNameFromPrototype(proto: any): string;
403
+ loadConfiguration(file: string): void;
181
404
  /**
182
- * Set the current schema resolver
183
405
  *
184
- * @param resolver
406
+ * @param proto Prototype to send
185
407
  */
186
- setSchemaResolver(resolver: SchemaResolver): void;
408
+ getFullNameFromPrototype(proto: any): string;
187
409
  /**
188
- * Get schema resolver
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
- getSchemaResolver(): SchemaResolver;
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(): any;
430
+ getPackageWebda(): WebdaPackageDescriptor;
209
431
  /**
210
432
  * Retrieve content of package.json
211
433
  */
212
- getPackageDescription(): any;
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: ServiceConstructor<Service>): void;
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
- getService(name: any): ServiceConstructor<Service<import("./index").ServiceParameters>>;
471
+ getModda(name: any): Modda;
263
472
  /**
264
473
  * Return all services of the application
265
474
  */
266
- getServices(): {
267
- [key: string]: ServiceConstructor<Service<import("./index").ServiceParameters>>;
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): any;
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]: ServiceConstructor<Service>;
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): void;
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): void;
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
- * Return the application Configuration for a deployment
370
- *
371
- * Given this inputs:
372
- *
373
- * webda.config.json
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
- * @param deploymentName to use for the Configuration
581
+ * Used when deployed
582
+ * @returns
583
+ */
584
+ getModules(): CachedModule;
585
+ /**
586
+ * Get application configuration
587
+ * @returns
428
588
  */
429
- getConfiguration(deploymentName?: string): Configuration;
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
- resolveRequire(info: string): any;
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(info: Module, parent?: string): void;
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
  }