mushroom-cli 1.1.0-alpha.5 → 1.1.0-alpha.6
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/gen/gen-ts-driver.js +11 -11
- package/package.json +1 -1
package/gen/gen-ts-driver.js
CHANGED
|
@@ -119,7 +119,7 @@ export type IdValue = ${source.idType == "AutoIncInt" || source.idType == "AutoI
|
|
|
119
119
|
|
|
120
120
|
const entity = entities[entityName];
|
|
121
121
|
const typescriptClassName = toTypeScriptClassName(entityName);
|
|
122
|
-
code += `interface ${typescriptClassName} ${generateTypescriptClass(entity.fields)};
|
|
122
|
+
code += `export interface ${typescriptClassName} ${generateTypescriptClass(entity.fields)};
|
|
123
123
|
`;
|
|
124
124
|
|
|
125
125
|
|
|
@@ -186,7 +186,7 @@ export type IdValue = ${source.idType == "AutoIncInt" || source.idType == "AutoI
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
if (customMethodCode) {
|
|
189
|
-
code += `interface ${typescriptClassName}$CustomMethodResource {
|
|
189
|
+
code += `export interface ${typescriptClassName}$CustomMethodResource {
|
|
190
190
|
${customMethodCode}}
|
|
191
191
|
`;
|
|
192
192
|
iApiClassBody += ` & ${typescriptClassName}$CustomMethodResource`;
|
|
@@ -204,7 +204,7 @@ ${customMethodCode}}
|
|
|
204
204
|
|
|
205
205
|
const viewParameterTypes = viewRoles.map(view => {
|
|
206
206
|
const type = `${typescriptClassName}$ViewsResource_${viewName}View_${view.grant === "*" ? "" : toTypeScriptClassName(view.grant)}Parameters`;
|
|
207
|
-
code += `interface ${type} ${generateTypescriptClassFromViewParameters(view.parameters)};
|
|
207
|
+
code += `export interface ${type} ${generateTypescriptClassFromViewParameters(view.parameters)};
|
|
208
208
|
`;
|
|
209
209
|
return `MushroomViewFunction<any, ${type}>`;
|
|
210
210
|
});
|
|
@@ -213,7 +213,7 @@ ${customMethodCode}}
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
if (viewCode) {
|
|
216
|
-
code += `interface ${typescriptClassName}$ViewsResource {
|
|
216
|
+
code += `export interface ${typescriptClassName}$ViewsResource {
|
|
217
217
|
views: {${viewCode}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -234,10 +234,10 @@ ${Array.isArray(aliasProject.features) && aliasProject.features.includes("auth")
|
|
|
234
234
|
${Array.isArray(aliasProject.features) && aliasProject.features.includes("auth") ? "useFile();" : ""}
|
|
235
235
|
mushroom.$using(${JSON.stringify(common.getRootUrl(source))});
|
|
236
236
|
|
|
237
|
-
interface IApi extends IMushroom {
|
|
237
|
+
export interface IApi extends IMushroom {
|
|
238
238
|
${iApiClassBody}};
|
|
239
239
|
|
|
240
|
-
type Api = ${Array.isArray(aliasProject.features) && aliasProject.features.includes("auth") ? "IMushroomAuth & " : ""}${Array.isArray(aliasProject.features) && aliasProject.features.includes("file") ? "IMushroomFile & " : ""}IApi;
|
|
240
|
+
export type Api = ${Array.isArray(aliasProject.features) && aliasProject.features.includes("auth") ? "IMushroomAuth & " : ""}${Array.isArray(aliasProject.features) && aliasProject.features.includes("file") ? "IMushroomFile & " : ""}IApi;
|
|
241
241
|
|
|
242
242
|
export default mushroom as Api;`;
|
|
243
243
|
|
|
@@ -266,7 +266,7 @@ export declare type IdValue = ${source.idType == "AutoIncInt" || source.idType =
|
|
|
266
266
|
|
|
267
267
|
const entity = entities[entityName];
|
|
268
268
|
const typescriptClassName = toTypeScriptClassName(entityName);
|
|
269
|
-
code += `interface ${typescriptClassName} ${generateTypescriptClass(entity.fields)};
|
|
269
|
+
code += `export interface ${typescriptClassName} ${generateTypescriptClass(entity.fields)};
|
|
270
270
|
`;
|
|
271
271
|
|
|
272
272
|
|
|
@@ -333,7 +333,7 @@ export declare type IdValue = ${source.idType == "AutoIncInt" || source.idType =
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
if (customMethodCode) {
|
|
336
|
-
code += `interface ${typescriptClassName}$CustomMethodResource {
|
|
336
|
+
code += `export interface ${typescriptClassName}$CustomMethodResource {
|
|
337
337
|
${customMethodCode}}
|
|
338
338
|
`;
|
|
339
339
|
iApiClassBody += ` & ${typescriptClassName}$CustomMethodResource`;
|
|
@@ -351,7 +351,7 @@ ${customMethodCode}}
|
|
|
351
351
|
|
|
352
352
|
const viewParameterTypes = viewRoles.map(view => {
|
|
353
353
|
const type = `${typescriptClassName}$ViewsResource_${viewName}View_${view.grant === "*" ? "" : toTypeScriptClassName(view.grant)}Parameters`;
|
|
354
|
-
code += `interface ${type} ${generateTypescriptClassFromViewParameters(view.parameters)};
|
|
354
|
+
code += `export interface ${type} ${generateTypescriptClassFromViewParameters(view.parameters)};
|
|
355
355
|
`;
|
|
356
356
|
return `MushroomViewFunction<any, ${type}>`;
|
|
357
357
|
});
|
|
@@ -360,7 +360,7 @@ ${customMethodCode}}
|
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
if (viewCode) {
|
|
363
|
-
code += `interface ${typescriptClassName}$ViewsResource {
|
|
363
|
+
code += `export interface ${typescriptClassName}$ViewsResource {
|
|
364
364
|
views: {${viewCode}
|
|
365
365
|
}
|
|
366
366
|
}
|
|
@@ -373,7 +373,7 @@ ${customMethodCode}}
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
code += `
|
|
376
|
-
interface IApi extends IMushroom {
|
|
376
|
+
export interface IApi extends IMushroom {
|
|
377
377
|
${iApiClassBody}};
|
|
378
378
|
|
|
379
379
|
declare type Api = ${Array.isArray(aliasProject.features) && aliasProject.features.includes("auth") ? "IMushroomAuth & " : ""}${Array.isArray(aliasProject.features) && aliasProject.features.includes("file") ? "IMushroomFile & " : ""}IApi;
|