@mxpicture/gcp-functions-generator 0.2.69 → 0.2.71
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/dist/4testing/templates/template.example.d.ts +3 -35
- package/dist/4testing/templates/template.example.d.ts.map +1 -1
- package/dist/4testing/templates/template.example.js +103 -181
- package/dist/4testing/templates/template.example.js.map +1 -1
- package/dist/4testing/templates/template.medication.d.ts +1 -27
- package/dist/4testing/templates/template.medication.d.ts.map +1 -1
- package/dist/4testing/templates/template.medication.js +76 -141
- package/dist/4testing/templates/template.medication.js.map +1 -1
- package/dist/4testing/templates/template.settings.d.ts +1 -23
- package/dist/4testing/templates/template.settings.d.ts.map +1 -1
- package/dist/4testing/templates/template.settings.js +38 -73
- package/dist/4testing/templates/template.settings.js.map +1 -1
- package/dist/common/Barrel.d.ts +4 -4
- package/dist/common/Barrel.d.ts.map +1 -1
- package/dist/common/Collector.d.ts +5 -6
- package/dist/common/Collector.d.ts.map +1 -1
- package/dist/common/Collector.js +2 -2
- package/dist/common/Collector.js.map +1 -1
- package/dist/common/Directories.d.ts +12 -12
- package/dist/common/Directories.d.ts.map +1 -1
- package/dist/common/Directories.js +4 -4
- package/dist/common/Directories.js.map +1 -1
- package/dist/common/Extractor.d.ts +4 -28
- package/dist/common/Extractor.d.ts.map +1 -1
- package/dist/common/Extractor.js +11 -185
- package/dist/common/Extractor.js.map +1 -1
- package/dist/common/file.common.d.ts +5 -5
- package/dist/common/file.common.d.ts.map +1 -1
- package/dist/common/file.common.js +6 -6
- package/dist/common/file.common.js.map +1 -1
- package/dist/common/generator.common.d.ts +3 -3
- package/dist/common/generator.common.d.ts.map +1 -1
- package/dist/common/generator.common.js +2 -2
- package/dist/common/generator.common.js.map +1 -1
- package/dist/common/index.d.ts +0 -1
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +0 -1
- package/dist/common/index.js.map +1 -1
- package/dist/common/types.common.d.ts +4 -4
- package/dist/common/types.common.d.ts.map +1 -1
- package/dist/{meta/meta.imports.d.ts → decorator/deco.imports.d.ts} +3 -3
- package/dist/decorator/deco.imports.d.ts.map +1 -0
- package/dist/{meta/meta.imports.js → decorator/deco.imports.js} +1 -1
- package/dist/decorator/deco.imports.js.map +1 -0
- package/dist/decorator/deco.names.d.ts +13 -0
- package/dist/decorator/deco.names.d.ts.map +1 -0
- package/dist/decorator/deco.names.js +93 -0
- package/dist/decorator/deco.names.js.map +1 -0
- package/dist/decorator/index.d.ts +3 -0
- package/dist/decorator/index.d.ts.map +1 -0
- package/dist/decorator/index.js +4 -0
- package/dist/decorator/index.js.map +1 -0
- package/dist/generator/Generator.d.ts +26 -21
- package/dist/generator/Generator.d.ts.map +1 -1
- package/dist/generator/Generator.js +24 -23
- package/dist/generator/Generator.js.map +1 -1
- package/dist/generator/GeneratorAnnotations.d.ts +2 -4
- package/dist/generator/GeneratorAnnotations.d.ts.map +1 -1
- package/dist/generator/GeneratorAnnotations.js +24 -23
- package/dist/generator/GeneratorAnnotations.js.map +1 -1
- package/dist/generator/GeneratorBackend.d.ts +8 -8
- package/dist/generator/GeneratorBackend.d.ts.map +1 -1
- package/dist/generator/GeneratorBackend.js +21 -18
- package/dist/generator/GeneratorBackend.js.map +1 -1
- package/dist/generator/GeneratorDoc.d.ts +2 -4
- package/dist/generator/GeneratorDoc.d.ts.map +1 -1
- package/dist/generator/GeneratorDoc.js +24 -8
- package/dist/generator/GeneratorDoc.js.map +1 -1
- package/dist/generator/GeneratorFrontend.d.ts +7 -7
- package/dist/generator/GeneratorFrontend.d.ts.map +1 -1
- package/dist/generator/GeneratorFrontend.js +19 -16
- package/dist/generator/GeneratorFrontend.js.map +1 -1
- package/dist/generator/GeneratorRoutes.d.ts +5 -6
- package/dist/generator/GeneratorRoutes.d.ts.map +1 -1
- package/dist/generator/GeneratorRoutes.js +15 -9
- package/dist/generator/GeneratorRoutes.js.map +1 -1
- package/dist/generator/GeneratorZod.d.ts +19 -19
- package/dist/generator/GeneratorZod.d.ts.map +1 -1
- package/dist/generator/GeneratorZod.js +19 -17
- package/dist/generator/GeneratorZod.js.map +1 -1
- package/package.json +10 -7
- package/dist/common/Evaluate.d.ts +0 -13
- package/dist/common/Evaluate.d.ts.map +0 -1
- package/dist/common/Evaluate.js +0 -121
- package/dist/common/Evaluate.js.map +0 -1
- package/dist/meta/index.d.ts +0 -4
- package/dist/meta/index.d.ts.map +0 -1
- package/dist/meta/index.js +0 -5
- package/dist/meta/index.js.map +0 -1
- package/dist/meta/meta.decorators.d.ts +0 -19
- package/dist/meta/meta.decorators.d.ts.map +0 -1
- package/dist/meta/meta.decorators.js +0 -23
- package/dist/meta/meta.decorators.js.map +0 -1
- package/dist/meta/meta.imports.d.ts.map +0 -1
- package/dist/meta/meta.imports.js.map +0 -1
- package/dist/meta/meta.names.d.ts +0 -14
- package/dist/meta/meta.names.d.ts.map +0 -1
- package/dist/meta/meta.names.js +0 -98
- package/dist/meta/meta.names.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorAnnotations.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeneratorAnnotations.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAgB5E,qBAAa,oBAAqB,SAAQ,SAAS;;cAUxB,SAAS,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;CAgHjC;;AAED,wBAA0C"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { MetaFileType, MetaFileExtension, MetaTargetType, mapAnnotationsHeader, } from "@mxpicture/gcp-functions-common/meta";
|
|
2
1
|
import { Generator } from "./Generator.js";
|
|
3
2
|
import { Collector } from "../common/Collector.js";
|
|
4
3
|
import { formatJsonStringify } from "@mxpicture/build-api/code";
|
|
4
|
+
import { DecoFileExtension, DecoFileType, DecoTargetType, } from "@mxpicture/gcp-functions-common/decorator";
|
|
5
5
|
const typeRegex = /\"type\": \"([a-zA-Z][a-zA-Z0-9]*)\"/;
|
|
6
|
-
const itemTypeRegex = /\"itemType\": \"(
|
|
6
|
+
const itemTypeRegex = /\"itemType\": \"(DecoPropertyType\.|)([a-zA-Z][a-zA-Z0-9]*)\"/;
|
|
7
7
|
const propertyRefRegex = /\"propertyRef\": \"([a-zA-Z][a-zA-Z0-9]*)\"/;
|
|
8
8
|
const subHeaderNameRegex = /\"subHeaderName\": \"([a-zA-Z][a-zA-Z0-9]*)\"/;
|
|
9
9
|
const dateFormatRegex = /\"dateFormat\": \"([a-zA-Z][a-zA-Z0-9]*)\"/;
|
|
10
10
|
export class GeneratorAnnotations extends Generator {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(
|
|
12
|
+
super(DecoFileType.annotations, DecoFileExtension.ts, DecoTargetType.common, Collector.instance());
|
|
13
13
|
}
|
|
14
|
-
async runHeader(
|
|
14
|
+
async runHeader(current) {
|
|
15
|
+
const names = current.names;
|
|
15
16
|
const res = {
|
|
16
17
|
code: [],
|
|
17
18
|
imports: [
|
|
@@ -26,16 +27,16 @@ export class GeneratorAnnotations extends Generator {
|
|
|
26
27
|
isType: false,
|
|
27
28
|
},
|
|
28
29
|
{
|
|
29
|
-
path: this.importCommon(
|
|
30
|
+
path: this.importCommon(DecoFileType.doc),
|
|
30
31
|
props: [names.doc],
|
|
31
32
|
isType: true,
|
|
32
33
|
},
|
|
33
34
|
],
|
|
34
|
-
name:
|
|
35
|
+
name: current.decorator.name,
|
|
35
36
|
};
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const header =
|
|
37
|
+
const importDecoProps = new Set();
|
|
38
|
+
const importDecoTypeProps = new Set();
|
|
39
|
+
const header = current.decorator.extractAnnotations();
|
|
39
40
|
const json = await formatJsonStringify(JSON.stringify(header));
|
|
40
41
|
const lines = json.split("\n");
|
|
41
42
|
res.code.push("", `export const ${names.initialFunc} = (): Partial<${names.doc}> => annoDocInitial(${names.annotations}.properties);`, "");
|
|
@@ -46,29 +47,29 @@ export class GeneratorAnnotations extends Generator {
|
|
|
46
47
|
let match = null;
|
|
47
48
|
match = line.match(typeRegex);
|
|
48
49
|
while (match && match.length > 1) {
|
|
49
|
-
|
|
50
|
-
line = line.replace(typeRegex, `type:
|
|
50
|
+
importDecoProps.add("DecoPropertyType");
|
|
51
|
+
line = line.replace(typeRegex, `type: DecoPropertyType.${match[1]}`);
|
|
51
52
|
match = line.match(typeRegex);
|
|
52
53
|
}
|
|
53
54
|
// itemType
|
|
54
55
|
match = line.match(itemTypeRegex);
|
|
55
56
|
while (match && match.length > 2) {
|
|
56
|
-
|
|
57
|
-
line = line.replace(itemTypeRegex, `itemType:
|
|
57
|
+
importDecoProps.add("DecoPropertyType");
|
|
58
|
+
line = line.replace(itemTypeRegex, `itemType: DecoPropertyType.${match[2]}`);
|
|
58
59
|
match = line.match(itemTypeRegex);
|
|
59
60
|
}
|
|
60
61
|
// propertyRef
|
|
61
62
|
match = line.match(propertyRefRegex);
|
|
62
63
|
while (match && match.length > 1) {
|
|
63
|
-
|
|
64
|
-
line = line.replace(propertyRefRegex, `propertyRef: "${match[1]}" as keyof
|
|
64
|
+
importDecoTypeProps.add("DecoPropertyDataWoType");
|
|
65
|
+
line = line.replace(propertyRefRegex, `propertyRef: "${match[1]}" as keyof DecoPropertyDataWoType`);
|
|
65
66
|
match = line.match(propertyRefRegex);
|
|
66
67
|
}
|
|
67
68
|
// dateFormat
|
|
68
69
|
match = line.match(dateFormatRegex);
|
|
69
70
|
while (match && match.length > 1) {
|
|
70
|
-
|
|
71
|
-
line = line.replace(dateFormatRegex, `dateFormat:
|
|
71
|
+
importDecoProps.add("DecoDateFormat");
|
|
72
|
+
line = line.replace(dateFormatRegex, `dateFormat: DecoDateFormat.${match[1]}`);
|
|
72
73
|
match = line.match(dateFormatRegex);
|
|
73
74
|
}
|
|
74
75
|
// subHeader(Name)
|
|
@@ -80,16 +81,16 @@ export class GeneratorAnnotations extends Generator {
|
|
|
80
81
|
res.code.push(line);
|
|
81
82
|
}
|
|
82
83
|
res.code.push(";");
|
|
83
|
-
if (
|
|
84
|
+
if (importDecoTypeProps.size > 0)
|
|
84
85
|
res.imports.push({
|
|
85
|
-
path: "@mxpicture/gcp-functions-common/
|
|
86
|
-
props: [...
|
|
86
|
+
path: "@mxpicture/gcp-functions-common/decorator",
|
|
87
|
+
props: [...importDecoTypeProps],
|
|
87
88
|
isType: true,
|
|
88
89
|
});
|
|
89
|
-
if (
|
|
90
|
+
if (importDecoProps.size > 0)
|
|
90
91
|
res.imports.push({
|
|
91
|
-
path: "@mxpicture/gcp-functions-common/
|
|
92
|
-
props: [...
|
|
92
|
+
path: "@mxpicture/gcp-functions-common/decorator",
|
|
93
|
+
props: [...importDecoProps],
|
|
93
94
|
isType: false,
|
|
94
95
|
});
|
|
95
96
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorAnnotations.js","sourceRoot":"","sources":["../../src/generator/GeneratorAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeneratorAnnotations.js","sourceRoot":"","sources":["../../src/generator/GeneratorAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmC,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,GACf,MAAM,2CAA2C,CAAC;AAEnD,MAAM,SAAS,GAAG,sCAAsC,CAAC;AACzD,MAAM,aAAa,GACjB,+DAA+D,CAAC;AAClE,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AACvE,MAAM,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C;YAC1B,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,2CAA2C;gBACjD,KAAK,EAAE,CAAC,GAAG,eAAe,CAAC;gBAC3B,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;QAEL,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED,eAAe,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { Generator, GeneratorCode } from "./Generator.js";
|
|
1
|
+
import { DecoNames } from "@mxpicture/gcp-functions-common/decorator";
|
|
2
|
+
import { Generator, GeneratorCode, GeneratorRunItem, GeneratorRunItems } from "./Generator.js";
|
|
4
3
|
import { GeneratorEnv } from "../common/types.common.js";
|
|
4
|
+
import { DecoRoutes } from "@mxpicture/gcp-functions-common/types";
|
|
5
5
|
export declare class GeneratorBackend extends Generator {
|
|
6
6
|
constructor();
|
|
7
|
-
protected runHeader(
|
|
8
|
-
protected buildApi(routes:
|
|
9
|
-
protected buildFunction(names:
|
|
10
|
-
protected buildStore(names:
|
|
11
|
-
protected buildCreate(names:
|
|
7
|
+
protected runHeader(current: GeneratorRunItem, all: GeneratorRunItems, env: GeneratorEnv): Promise<GeneratorCode | null>;
|
|
8
|
+
protected buildApi(routes: DecoRoutes, names: DecoNames): string[];
|
|
9
|
+
protected buildFunction(names: DecoNames, datePaths: string[]): string[];
|
|
10
|
+
protected buildStore(names: DecoNames, namespace: string): string[];
|
|
11
|
+
protected buildCreate(names: DecoNames, region: string, serviceAccount: string): string[];
|
|
12
12
|
}
|
|
13
13
|
declare const _default: GeneratorBackend;
|
|
14
14
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorBackend.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorBackend.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeneratorBackend.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,SAAS,EACV,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAGnE,qBAAa,gBAAiB,SAAQ,SAAS;;cAUpB,SAAS,CAChC,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,iBAAiB,EACtB,GAAG,EAAE,YAAY,GAChB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAwFhC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE;IA6BlE,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAexE,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE;IAQnE,SAAS,CAAC,WAAW,CACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GACrB,MAAM,EAAE;CAiBZ;;AAED,wBAAsC"}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Generator } from "./Generator.js";
|
|
1
|
+
import { hasCrudRoute, isCrudRoute, DecoFileExtension, DecoFileType, DecoPropertyType, DecoTargetType, } from "@mxpicture/gcp-functions-common/decorator";
|
|
2
|
+
import { Generator, } from "./Generator.js";
|
|
3
3
|
import { Collector } from "../common/Collector.js";
|
|
4
|
+
import { extractAnnotationsPaths } from "@mxpicture/gcp-functions-common/annotation";
|
|
4
5
|
export class GeneratorBackend extends Generator {
|
|
5
6
|
constructor() {
|
|
6
|
-
super(
|
|
7
|
+
super(DecoFileType.backend, DecoFileExtension.ts, DecoTargetType.backend, Collector.instance());
|
|
7
8
|
}
|
|
8
|
-
async runHeader(
|
|
9
|
-
|
|
9
|
+
async runHeader(current, all, env) {
|
|
10
|
+
const raw = current.decorator.extractRaw();
|
|
11
|
+
if (!raw.routes || Object.keys(raw.routes).length === 0)
|
|
10
12
|
return null;
|
|
11
|
-
const namespace =
|
|
12
|
-
const
|
|
13
|
-
const
|
|
13
|
+
const namespace = raw.namespace ?? "default";
|
|
14
|
+
const names = current.names;
|
|
15
|
+
const header = current.decorator.extractAnnotations();
|
|
16
|
+
const datePaths = extractAnnotationsPaths(header.properties, DecoPropertyType.date);
|
|
14
17
|
return {
|
|
15
18
|
code: [
|
|
16
19
|
...this.buildFunction(names, datePaths),
|
|
17
20
|
"",
|
|
18
|
-
...this.buildApi(
|
|
21
|
+
...this.buildApi(raw.routes, names),
|
|
19
22
|
"",
|
|
20
23
|
...this.buildStore(names, namespace),
|
|
21
24
|
"",
|
|
@@ -58,12 +61,12 @@ export class GeneratorBackend extends Generator {
|
|
|
58
61
|
isType: true,
|
|
59
62
|
},
|
|
60
63
|
{
|
|
61
|
-
path: this.importCommon(
|
|
64
|
+
path: this.importCommon(DecoFileType.routes),
|
|
62
65
|
props: [names.routes],
|
|
63
66
|
isType: true,
|
|
64
67
|
},
|
|
65
68
|
{
|
|
66
|
-
path: this.importCommon(
|
|
69
|
+
path: this.importCommon(DecoFileType.doc),
|
|
67
70
|
props: [names.doc],
|
|
68
71
|
isType: true,
|
|
69
72
|
},
|
|
@@ -73,17 +76,17 @@ export class GeneratorBackend extends Generator {
|
|
|
73
76
|
isType: false,
|
|
74
77
|
},
|
|
75
78
|
{
|
|
76
|
-
path: this.importCommon(
|
|
77
|
-
props: [
|
|
79
|
+
path: this.importCommon(DecoFileType.routes),
|
|
80
|
+
props: [names.routesName],
|
|
78
81
|
isType: false,
|
|
79
82
|
},
|
|
80
83
|
{
|
|
81
|
-
path: this.importBackend(
|
|
84
|
+
path: this.importBackend(DecoFileType.zod),
|
|
82
85
|
props: [names.shape],
|
|
83
86
|
isType: false,
|
|
84
87
|
},
|
|
85
88
|
],
|
|
86
|
-
name:
|
|
89
|
+
name: raw.name,
|
|
87
90
|
};
|
|
88
91
|
}
|
|
89
92
|
buildApi(routes, names) {
|
|
@@ -97,10 +100,10 @@ export class GeneratorBackend extends Generator {
|
|
|
97
100
|
continue; // ignore crud --> provided by super class
|
|
98
101
|
let definition = routeName;
|
|
99
102
|
if (params.requestType !== "never" && params.requestType !== "void")
|
|
100
|
-
definition += `(request: ${
|
|
103
|
+
definition += `(request: ${names.routes}["${routeName}"]["request"])`;
|
|
101
104
|
else
|
|
102
105
|
definition += `()`;
|
|
103
|
-
definition += `: Promise<${
|
|
106
|
+
definition += `: Promise<${names.routes}["${routeName}"]["response"]>`;
|
|
104
107
|
code.push(` public abstract ${definition};`);
|
|
105
108
|
}
|
|
106
109
|
code.push("}");
|
|
@@ -113,7 +116,7 @@ export class GeneratorBackend extends Generator {
|
|
|
113
116
|
"];",
|
|
114
117
|
"",
|
|
115
118
|
`export class ${names.func} extends IBackendFunction<${names.doc}, I${names.api}> {`,
|
|
116
|
-
` public constructor(region: string, serviceAccount: string, api?: I${names.api}) { super("${names.functionName}", region, serviceAccount, ${names.basenameLower}DatePaths); this.useRoutes(${names.
|
|
119
|
+
` public constructor(region: string, serviceAccount: string, api?: I${names.api}) { super("${names.functionName}", region, serviceAccount, ${names.basenameLower}DatePaths); this.useRoutes(${names.routesName}); if (api) this.useApi(api); }`,
|
|
117
120
|
"",
|
|
118
121
|
" // defined to be able to debug ingress",
|
|
119
122
|
" public override async ingress<REQ, RES extends DocumentData>(request: FunctionRequest<REQ>): Promise<FunctionResponse<RES>> { return super.ingress(request); }",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorBackend.js","sourceRoot":"","sources":["../../src/generator/GeneratorBackend.ts"],"names":[],"mappings":"
|
|
1
|
+
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,KAAK;YACvE,kBAAkB,KAAK,CAAC,KAAK,IAAI;YACjC,EAAE;YACF,sBAAsB,KAAK,CAAC,IAAI,KAAK,MAAM,OAAO,cAAc,UAAU;YAC1E,EAAE;YACF,wBAAwB;YACxB,2BAA2B;YAC3B,EAAE;YACF,gCAAgC;YAChC,IAAI;SACL,CAAC;IACJ,CAAC;CACF;AAED,eAAe,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MetaNames } from "@mxpicture/gcp-functions-common/types";
|
|
3
|
-
import { Generator, GeneratorCode } from "./Generator.js";
|
|
1
|
+
import { Generator, GeneratorCode, GeneratorRunItem } from "./Generator.js";
|
|
4
2
|
export declare class GeneratorDoc extends Generator {
|
|
5
3
|
constructor();
|
|
6
|
-
protected runHeader(
|
|
4
|
+
protected runHeader(current: GeneratorRunItem): Promise<GeneratorCode | null>;
|
|
7
5
|
}
|
|
8
6
|
declare const _default: GeneratorDoc;
|
|
9
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorDoc.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorDoc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GeneratorDoc.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorDoc.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAmB5E,qBAAa,YAAa,SAAQ,SAAS;;cAUhB,SAAS,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;CAoBjC;;AAED,wBAAkC"}
|
|
@@ -1,20 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DecoFileExtension, DecoFileType, DecoPropertyType, DecoTargetType, } from "@mxpicture/gcp-functions-common/decorator";
|
|
2
2
|
import { Generator } from "./Generator.js";
|
|
3
3
|
import { Collector } from "../common/Collector.js";
|
|
4
|
-
|
|
4
|
+
const decoTypeToTs = (data) => {
|
|
5
|
+
switch (data.type) {
|
|
6
|
+
case DecoPropertyType.date:
|
|
7
|
+
return "Date";
|
|
8
|
+
case DecoPropertyType.object: {
|
|
9
|
+
const deco = data["deco"];
|
|
10
|
+
if (typeof deco === "object" && deco !== null && "name" in deco)
|
|
11
|
+
return `${deco.name}Doc`;
|
|
12
|
+
return "object";
|
|
13
|
+
}
|
|
14
|
+
default:
|
|
15
|
+
return data.type;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
5
18
|
export class GeneratorDoc extends Generator {
|
|
6
19
|
constructor() {
|
|
7
|
-
super(
|
|
20
|
+
super(DecoFileType.doc, DecoFileExtension.ts, DecoTargetType.common, Collector.instance());
|
|
8
21
|
}
|
|
9
|
-
async runHeader(
|
|
22
|
+
async runHeader(current) {
|
|
10
23
|
const res = {
|
|
11
24
|
code: [],
|
|
12
25
|
imports: [],
|
|
13
|
-
name:
|
|
26
|
+
name: current.decorator.name,
|
|
14
27
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
const raw = current.decorator.extractRaw();
|
|
29
|
+
res.code.push(`export interface ${current.names.doc} {`);
|
|
30
|
+
for (const [key, prop] of Object.entries(raw.properties ?? {})) {
|
|
31
|
+
const extr = prop.extractRaw();
|
|
32
|
+
res.code.push(` ${key}${extr.common.optional ? "?" : ""}: ${decoTypeToTs(extr.data)}`);
|
|
33
|
+
}
|
|
18
34
|
res.code.push("}");
|
|
19
35
|
return res;
|
|
20
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorDoc.js","sourceRoot":"","sources":["../../src/generator/GeneratorDoc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,YAAY,
|
|
1
|
+
{"version":3,"file":"GeneratorDoc.js","sourceRoot":"","sources":["../../src/generator/GeneratorDoc.ts"],"names":[],"mappings":"A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AAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;YAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAC/B,GAAG,CAAC,IAAI,CAAC,IAAI,CACX,KAAK,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzE,CAAC;QACJ,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED,eAAe,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Generator, GeneratorCode, GeneratorRunItem } from "./Generator.js";
|
|
2
|
+
import { DecoNames } from "@mxpicture/gcp-functions-common/decorator";
|
|
3
|
+
import { DecoRoutes } from "@mxpicture/gcp-functions-common/types";
|
|
4
4
|
export declare class GeneratorFrontend extends Generator {
|
|
5
5
|
constructor();
|
|
6
|
-
protected runHeader(
|
|
7
|
-
protected buildApi(routes:
|
|
8
|
-
protected buildFunction(names:
|
|
9
|
-
protected buildCreate(names:
|
|
6
|
+
protected runHeader(current: GeneratorRunItem): Promise<GeneratorCode | null>;
|
|
7
|
+
protected buildApi(routes: DecoRoutes, names: DecoNames): string[];
|
|
8
|
+
protected buildFunction(names: DecoNames, datePaths: string[]): string[];
|
|
9
|
+
protected buildCreate(names: DecoNames): string[];
|
|
10
10
|
}
|
|
11
11
|
declare const _default: GeneratorFrontend;
|
|
12
12
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorFrontend.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorFrontend.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeneratorFrontend.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorFrontend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAGL,SAAS,EAKV,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE,qBAAa,iBAAkB,SAAQ,SAAS;;cAUrB,SAAS,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IA4DhC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE;IAqClE,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAexE,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE;CAWlD;;AAED,wBAAuC"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { extractAnnotationsPaths, hasCrudRoute, isCrudRoute, mapAnnotationsHeader, MetaFileExtension, MetaFileType, MetaPropertyType, MetaTargetType, } from "@mxpicture/gcp-functions-common/meta";
|
|
2
1
|
import { Generator } from "./Generator.js";
|
|
3
2
|
import { Collector } from "../common/Collector.js";
|
|
3
|
+
import { DecoFileExtension, DecoFileType, DecoPropertyType, DecoTargetType, hasCrudRoute, isCrudRoute, } from "@mxpicture/gcp-functions-common/decorator";
|
|
4
|
+
import { extractAnnotationsPaths } from "@mxpicture/gcp-functions-common/annotation";
|
|
4
5
|
export class GeneratorFrontend extends Generator {
|
|
5
6
|
constructor() {
|
|
6
|
-
super(
|
|
7
|
+
super(DecoFileType.frontend, DecoFileExtension.ts, DecoTargetType.frontend, Collector.instance());
|
|
7
8
|
}
|
|
8
|
-
async runHeader(
|
|
9
|
-
|
|
9
|
+
async runHeader(current) {
|
|
10
|
+
const raw = current.decorator.extractRaw();
|
|
11
|
+
if (!raw.routes || Object.keys(raw.routes).length === 0)
|
|
10
12
|
return null;
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
+
const names = current.names;
|
|
14
|
+
const header = current.decorator.extractAnnotations();
|
|
15
|
+
const datePaths = extractAnnotationsPaths(header.properties, DecoPropertyType.date);
|
|
13
16
|
return {
|
|
14
17
|
code: [
|
|
15
18
|
...this.buildFunction(names, datePaths),
|
|
16
19
|
"",
|
|
17
|
-
...this.buildApi(
|
|
20
|
+
...this.buildApi(raw.routes, names),
|
|
18
21
|
"",
|
|
19
22
|
...this.buildCreate(names),
|
|
20
23
|
],
|
|
@@ -25,8 +28,8 @@ export class GeneratorFrontend extends Generator {
|
|
|
25
28
|
isType: false,
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
|
-
path: this.importCommon(
|
|
29
|
-
props: [
|
|
31
|
+
path: this.importCommon(DecoFileType.routes),
|
|
32
|
+
props: [names.routesName],
|
|
30
33
|
isType: false,
|
|
31
34
|
},
|
|
32
35
|
{
|
|
@@ -45,17 +48,17 @@ export class GeneratorFrontend extends Generator {
|
|
|
45
48
|
isType: true,
|
|
46
49
|
},
|
|
47
50
|
{
|
|
48
|
-
path: this.importCommon(
|
|
51
|
+
path: this.importCommon(DecoFileType.routes),
|
|
49
52
|
props: [names.routes],
|
|
50
53
|
isType: true,
|
|
51
54
|
},
|
|
52
55
|
{
|
|
53
|
-
path: this.importCommon(
|
|
56
|
+
path: this.importCommon(DecoFileType.doc),
|
|
54
57
|
props: [names.doc],
|
|
55
58
|
isType: true,
|
|
56
59
|
},
|
|
57
60
|
],
|
|
58
|
-
name:
|
|
61
|
+
name: raw.name,
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
buildApi(routes, names) {
|
|
@@ -69,11 +72,11 @@ export class GeneratorFrontend extends Generator {
|
|
|
69
72
|
continue; // ignore crud --> provided by super class
|
|
70
73
|
let definition = routeName;
|
|
71
74
|
if (params.requestType !== "never" && params.requestType !== "void")
|
|
72
|
-
definition += `(request: ${
|
|
75
|
+
definition += `(request: ${names.routes}["${routeName}"]["request"])`;
|
|
73
76
|
else
|
|
74
77
|
definition += `()`;
|
|
75
|
-
definition += `: Promise<${
|
|
76
|
-
code.push(` public async ${definition} {`, ` return (await this.func().outgress({ route: "${routeName}", data: request })).data as ${
|
|
78
|
+
definition += `: Promise<${names.routes}["${routeName}"]["response"]>`;
|
|
79
|
+
code.push(` public async ${definition} {`, ` return (await this.func().outgress({ route: "${routeName}", data: request })).data as ${names.routes}["${routeName}"]["response"];`, " }", "");
|
|
77
80
|
}
|
|
78
81
|
code.push("}");
|
|
79
82
|
return code;
|
|
@@ -85,7 +88,7 @@ export class GeneratorFrontend extends Generator {
|
|
|
85
88
|
"];",
|
|
86
89
|
"",
|
|
87
90
|
`export class ${names.func} extends IFrontendFunction {`,
|
|
88
|
-
` public constructor() { super("${names.functionName}", ${names.basenameLower}DatePaths); this.useRoutes(${names.
|
|
91
|
+
` public constructor() { super("${names.functionName}", ${names.basenameLower}DatePaths); this.useRoutes(${names.routesName}); }`,
|
|
89
92
|
"",
|
|
90
93
|
" // defined to be able to debug outgress",
|
|
91
94
|
" public override async outgress<REQ, RES extends DocumentData>(request: FunctionRequest<REQ>): Promise<FunctionResponse<RES>> { return super.outgress(request); }",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorFrontend.js","sourceRoot":"","sources":["../../src/generator/GeneratorFrontend.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeneratorFrontend.js","sourceRoot":"","sources":["../../src/generator/GeneratorFrontend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmC,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;A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AAQ,eAAe;YACnD,sBAAsB,KAAK,CAAC,IAAI,KAAK;YACrC,qBAAqB,KAAK,CAAC,GAAG,SAAS;YACvC,eAAe;YACf,IAAI;YACJ,EAAE;YACF,gBAAgB,KAAK,CAAC,aAAa,eAAe,KAAK,CAAC,QAAQ,QAAQ;SACzE,CAAC;IACJ,CAAC;CACF;AAED,eAAe,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Generator, GeneratorCode } from "./Generator.js";
|
|
1
|
+
import { Generator, GeneratorCode, GeneratorRunItem } from "./Generator.js";
|
|
2
|
+
import { DecoNames, DecoratorData } from "@mxpicture/gcp-functions-common/decorator";
|
|
4
3
|
export declare class GeneratorRoutes extends Generator {
|
|
5
4
|
constructor();
|
|
6
|
-
protected runHeader(
|
|
7
|
-
protected buildType(res: GeneratorCode, names:
|
|
8
|
-
protected buildEnum(res: GeneratorCode, names:
|
|
5
|
+
protected runHeader(current: GeneratorRunItem): Promise<GeneratorCode | null>;
|
|
6
|
+
protected buildType(res: GeneratorCode, names: DecoNames, mainData: DecoratorData): void;
|
|
7
|
+
protected buildEnum(res: GeneratorCode, names: DecoNames, mainData: DecoratorData): void;
|
|
9
8
|
}
|
|
10
9
|
declare const _default: GeneratorRoutes;
|
|
11
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorRoutes.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeneratorRoutes.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAGL,SAAS,EACT,aAAa,EAEd,MAAM,2CAA2C,CAAC;AAEnD,qBAAa,eAAgB,SAAQ,SAAS;;cAWnB,SAAS,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAmChC,SAAS,CAAC,SAAS,CACjB,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,aAAa;IAYzB,SAAS,CAAC,SAAS,CACjB,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,aAAa;CAS1B;;AAED,wBAAqC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { MetaFileExtension, MetaFileType, MetaTargetType, } from "@mxpicture/gcp-functions-common/meta";
|
|
2
1
|
import { Generator } from "./Generator.js";
|
|
3
2
|
import { Collector } from "../common/Collector.js";
|
|
3
|
+
import { DecoFileExtension, DecoFileType, DecoTargetType, } from "@mxpicture/gcp-functions-common/decorator";
|
|
4
4
|
export class GeneratorRoutes extends Generator {
|
|
5
5
|
constructor() {
|
|
6
|
-
super(
|
|
6
|
+
super(DecoFileType.routes, DecoFileExtension.ts, DecoTargetType.common, Collector.instance(), true);
|
|
7
7
|
}
|
|
8
|
-
async runHeader(
|
|
9
|
-
|
|
8
|
+
async runHeader(current) {
|
|
9
|
+
const raw = current.decorator.extractRaw();
|
|
10
|
+
if (!raw.routes || Object.keys(raw.routes).length === 0)
|
|
10
11
|
return null;
|
|
12
|
+
const names = current.names;
|
|
11
13
|
const res = {
|
|
12
14
|
code: [],
|
|
13
15
|
imports: [
|
|
@@ -24,26 +26,30 @@ export class GeneratorRoutes extends Generator {
|
|
|
24
26
|
],
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
|
-
path: this.importCommon(
|
|
29
|
+
path: this.importCommon(DecoFileType.doc),
|
|
28
30
|
isType: true,
|
|
29
31
|
props: [names.doc],
|
|
30
32
|
},
|
|
31
33
|
],
|
|
32
|
-
name:
|
|
34
|
+
name: raw.name,
|
|
33
35
|
};
|
|
34
|
-
this.buildType(res, names,
|
|
36
|
+
this.buildType(res, names, raw);
|
|
35
37
|
res.code.push("");
|
|
36
|
-
this.buildEnum(res, names,
|
|
38
|
+
this.buildEnum(res, names, raw);
|
|
37
39
|
return res;
|
|
38
40
|
}
|
|
39
41
|
buildType(res, names, mainData) {
|
|
42
|
+
if (!mainData.routes)
|
|
43
|
+
return;
|
|
40
44
|
res.code.push(`export type ${names.routes} = WithRoutes<{`);
|
|
41
45
|
for (const [routeName, params] of Object.entries(mainData.routes))
|
|
42
46
|
res.code.push(` ${routeName}: RouteDef<${params.requestType}, ${params.responseType}>;`);
|
|
43
47
|
res.code.push("}>;");
|
|
44
48
|
}
|
|
45
49
|
buildEnum(res, names, mainData) {
|
|
46
|
-
|
|
50
|
+
if (!mainData.routes)
|
|
51
|
+
return;
|
|
52
|
+
res.code.push(`export enum ${names.routesName} {`);
|
|
47
53
|
for (const routeName of Object.keys(mainData.routes))
|
|
48
54
|
res.code.push(` ${routeName} = "${routeName}",`);
|
|
49
55
|
res.code.push("}");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratorRoutes.js","sourceRoot":"","sources":["../../src/generator/GeneratorRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeneratorRoutes.js","sourceRoot":"","sources":["../../src/generator/GeneratorRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmC,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,YAAY,EAGZ,cAAc,GACf,MAAM,2CAA2C,CAAC;AAEnD,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C;QACE,KAAK,CACH,YAAY,CAAC,MAAM,EACnB,iBAAiB,CAAC,EAAE,EACpB,cAAc,CAAC,MAAM,EACrB,SAAS,CAAC,QAAQ,EAAE,EACpB,IAAI,CACL,CAAC;IACJ,CAAC;IAEkB,K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