@mxpicture/gcp-functions-generator 1.1.14 → 1.1.15

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.
@@ -1,7 +1,7 @@
1
- import { DecoNames } from "@mxpicture/gcp-functions-common/decorator";
1
+ import { DecoNames, DecoratorData } from "@mxpicture/gcp-functions-common/decorator";
2
2
  import { Generator, GeneratorCode, GeneratorRunItem, GeneratorRunItems } from "./Generator.js";
3
3
  import { GeneratorEnv } from "../common/types.common.js";
4
- import { DecoRoutes } from "@mxpicture/gcp-functions-common/types";
4
+ import { AnnotationsHeader, DecoImport } from "@mxpicture/gcp-functions-common/types";
5
5
  /**
6
6
  * Generator that produces backend-specific code including API classes, stores, functions, and factory helpers.
7
7
  *
@@ -12,10 +12,22 @@ import { DecoRoutes } from "@mxpicture/gcp-functions-common/types";
12
12
  export declare class GeneratorBackend extends Generator {
13
13
  constructor();
14
14
  protected runHeader(current: GeneratorRunItem, all: GeneratorRunItems, env: GeneratorEnv): Promise<GeneratorCode | null>;
15
- protected buildApi(routes: DecoRoutes, names: DecoNames): string[];
16
- protected buildFunction(names: DecoNames, datePaths: string[]): string[];
17
- protected buildStore(names: DecoNames, namespace: string): string[];
18
- protected buildCreate(names: DecoNames, region: string, serviceAccount: string): string[];
15
+ protected buildApi(header: AnnotationsHeader, raw: DecoratorData, names: DecoNames): {
16
+ code: string[];
17
+ imports: DecoImport[];
18
+ };
19
+ protected buildFunction(names: DecoNames, datePaths: string[]): {
20
+ code: string[];
21
+ imports: DecoImport[];
22
+ };
23
+ protected buildStore(names: DecoNames, namespace: string): {
24
+ code: string[];
25
+ imports: DecoImport[];
26
+ };
27
+ protected buildCreate(names: DecoNames, region: string, serviceAccount: string): {
28
+ code: string[];
29
+ imports: DecoImport[];
30
+ };
19
31
  }
20
32
  declare const _default: GeneratorBackend;
21
33
  export default _default;
@@ -1 +1 @@
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;;;;;;GAMG;AACH,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
+ {"version":3,"file":"GeneratorBackend.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,SAAS,EACT,aAAa,EACd,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,EACL,iBAAiB,EACjB,UAAU,EACX,MAAM,uCAAuC,CAAC;AAG/C;;;;;;GAMG;AACH,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;IAmHhC,SAAS,CAAC,QAAQ,CAChB,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,SAAS,GACf;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE;IAqD5C,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EAAE,GAClB;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE;IAkB5C,SAAS,CAAC,UAAU,CAClB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,GAChB;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE;IAW5C,SAAS,CAAC,WAAW,CACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GACrB;QAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE;CAoB7C;;AAED,wBAAsC"}
@@ -21,88 +21,120 @@ export class GeneratorBackend extends Generator {
21
21
  const names = current.names;
22
22
  const header = current.decorator.extractAnnotations();
23
23
  const datePaths = extractAnnotationsPaths(header.properties, DecoPropertyType.date);
24
+ const imports = [
25
+ {
26
+ path: "@mxpicture/gcp-functions-common/types",
27
+ props: [
28
+ "ApiFromRoutes",
29
+ "FunctionRequest",
30
+ "FunctionResponse",
31
+ "DocumentData",
32
+ ],
33
+ isType: true,
34
+ },
35
+ {
36
+ path: "@mxpicture/gcp-functions-backend/store",
37
+ props: ["Store"],
38
+ isType: false,
39
+ },
40
+ {
41
+ path: "@mxpicture/gcp-functions-backend/validation",
42
+ props: ["Validation"],
43
+ isType: false,
44
+ },
45
+ {
46
+ path: "@mxpicture/gcp-functions-backend/api",
47
+ props: ["BackendApi"],
48
+ isType: false,
49
+ },
50
+ {
51
+ path: "firebase-admin/firestore",
52
+ props: ["FirestoreDataConverter"],
53
+ isType: true,
54
+ },
55
+ {
56
+ path: "firebase-functions/v2/https",
57
+ props: ["CallableFunction"],
58
+ isType: true,
59
+ },
60
+ {
61
+ path: this.importCommon(DecoFileType.routes),
62
+ props: [names.routes],
63
+ isType: true,
64
+ },
65
+ {
66
+ path: this.importCommon(DecoFileType.doc),
67
+ props: [names.doc, names.docStore],
68
+ isType: true,
69
+ },
70
+ {
71
+ path: "@mxpicture/gcp-functions-backend/function",
72
+ props: ["IBackendFunction"],
73
+ isType: false,
74
+ },
75
+ {
76
+ path: this.importCommon(DecoFileType.routes),
77
+ props: [names.routesName],
78
+ isType: false,
79
+ },
80
+ {
81
+ path: this.importBackend(DecoFileType.zod),
82
+ props: [names.shape],
83
+ isType: false,
84
+ },
85
+ ];
86
+ const builtFunction = this.buildFunction(names, datePaths);
87
+ const builtApi = this.buildApi(header, raw, names);
88
+ const builtStore = this.buildStore(names, namespace);
89
+ const builtCreate = this.buildCreate(names, env.region, env.serviceAccount);
90
+ const code = [
91
+ ...builtFunction.code,
92
+ "",
93
+ ...builtApi.code,
94
+ "",
95
+ ...builtStore.code,
96
+ "",
97
+ ...builtCreate.code,
98
+ ];
99
+ for (const imp of [
100
+ ...builtFunction.imports,
101
+ ...builtApi.imports,
102
+ ...builtStore.imports,
103
+ ...builtCreate.imports,
104
+ ]) {
105
+ let found = imports.find((i) => i.path === imp.path && i.isType === imp.isType);
106
+ if (!found) {
107
+ found = { path: imp.path, isType: imp.isType, props: [] };
108
+ imports.push(found);
109
+ }
110
+ for (const prop of imp.props)
111
+ if (!found.props.includes(prop))
112
+ found.props.push(prop);
113
+ }
24
114
  return {
25
- code: [
26
- ...this.buildFunction(names, datePaths),
27
- "",
28
- ...this.buildApi(raw.routes, names),
29
- "",
30
- ...this.buildStore(names, namespace),
31
- "",
32
- ...this.buildCreate(names, env.region, env.serviceAccount),
33
- ],
34
- imports: [
35
- {
36
- path: "@mxpicture/gcp-functions-common/types",
37
- props: [
38
- "ApiFromRoutes",
39
- "FunctionRequest",
40
- "FunctionResponse",
41
- "DocumentData",
42
- ],
43
- isType: true,
44
- },
45
- {
46
- path: "@mxpicture/gcp-functions-backend/store",
47
- props: ["Store"],
48
- isType: false,
49
- },
50
- {
51
- path: "@mxpicture/gcp-functions-backend/validation",
52
- props: ["Validation"],
53
- isType: false,
54
- },
55
- {
56
- path: "@mxpicture/gcp-functions-backend/api",
57
- props: ["BackendApi"],
58
- isType: false,
59
- },
60
- {
61
- path: "firebase-admin/firestore",
62
- props: ["FirestoreDataConverter"],
63
- isType: true,
64
- },
65
- {
66
- path: "firebase-functions/v2/https",
67
- props: ["CallableFunction"],
68
- isType: true,
69
- },
70
- {
71
- path: this.importCommon(DecoFileType.routes),
72
- props: [names.routes],
73
- isType: true,
74
- },
75
- {
76
- path: this.importCommon(DecoFileType.doc),
77
- props: [names.doc],
78
- isType: true,
79
- },
80
- {
81
- path: "@mxpicture/gcp-functions-backend/function",
82
- props: ["IBackendFunction"],
83
- isType: false,
84
- },
85
- {
86
- path: this.importCommon(DecoFileType.routes),
87
- props: [names.routesName],
88
- isType: false,
89
- },
90
- {
91
- path: this.importBackend(DecoFileType.zod),
92
- props: [names.shape],
93
- isType: false,
94
- },
95
- ],
115
+ code,
116
+ imports,
96
117
  name: raw.name,
97
118
  };
98
119
  }
99
- buildApi(routes, names) {
120
+ buildApi(header, raw, names) {
100
121
  const code = [];
101
- const superClassName = hasCrudRoute(Object.keys(routes))
122
+ const superClassName = hasCrudRoute(Object.keys(raw.routes ?? {}))
102
123
  ? "BackendApi"
103
124
  : "IBackendApi";
104
- code.push(`export abstract class I${names.api} extends ${superClassName}<${names.doc}, ${names.store}, Validation<${names.doc}>>`, `implements ApiFromRoutes<${names.routes}>`, "{", ` public constructor() { super("${names.basenameLower}", ${names.basenameLower}DatePaths); }`, "");
105
- for (const [routeName, params] of Object.entries(routes)) {
125
+ code.push(`export abstract class I${names.api} extends ${superClassName}<${names.docStore}, ${names.doc}, ${names.store}, Validation<${names.doc}>>`, `implements ApiFromRoutes<${names.routes}>`, "{", ` public constructor() { super("${names.basenameLower}", ${names.basenameLower}DatePaths); }`, "");
126
+ let additionalImport = false;
127
+ const virtuals = header.properties.filter((prop) => prop.common.virtual);
128
+ if (virtuals.length > 0) {
129
+ const hasVirtualNonOpt = !!header.properties.find((prop) => prop.common.virtual);
130
+ if (!hasVirtualNonOpt) {
131
+ // create dummy method with 1:1 mapping
132
+ code.push("", `// 1:1 mapping`, `. protected async loadVirtualFields(doc: WithKey<${names.docStore}>): Promise<WithKey<${names.doc}>> {return doc as WithKey<${names.doc}>;}`, "");
133
+ additionalImport = true;
134
+ }
135
+ // else: leave method as abstract
136
+ }
137
+ for (const [routeName, params] of Object.entries(raw.routes ?? {})) {
106
138
  if (isCrudRoute(routeName))
107
139
  continue; // ignore crud --> provided by super class
108
140
  let definition = routeName;
@@ -114,45 +146,57 @@ export class GeneratorBackend extends Generator {
114
146
  code.push(` public abstract ${definition};`);
115
147
  }
116
148
  code.push("}");
117
- return code;
149
+ return {
150
+ code,
151
+ imports: additionalImport ? [{ path: "", props: ["WithKey"] }] : [],
152
+ };
118
153
  }
119
154
  buildFunction(names, datePaths) {
120
- return [
121
- `const ${names.basenameLower}DatePaths: string[] = [`,
122
- ...datePaths.map((datePath) => `"${datePath}",`),
123
- "];",
124
- "",
125
- `export class ${names.func} extends IBackendFunction<${names.doc}, I${names.api}> {`,
126
- ` 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); }`,
127
- "",
128
- " // defined to be able to debug ingress",
129
- " public override async ingress<REQ, RES extends DocumentData>(request: FunctionRequest<REQ>): Promise<FunctionResponse<RES>> { return super.ingress(request); }",
130
- "}",
131
- ];
155
+ return {
156
+ imports: [],
157
+ code: [
158
+ `const ${names.basenameLower}DatePaths: string[] = [`,
159
+ ...datePaths.map((datePath) => `"${datePath}",`),
160
+ "];",
161
+ "",
162
+ `export class ${names.func} extends IBackendFunction<${names.docStore}, ${names.doc}, I${names.api}> {`,
163
+ ` 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); }`,
164
+ "",
165
+ " // defined to be able to debug ingress",
166
+ " public override async ingress<REQ, RES extends DocumentData>(request: FunctionRequest<REQ>): Promise<FunctionResponse<RES>> { return super.ingress(request); }",
167
+ "}",
168
+ ],
169
+ };
132
170
  }
133
171
  buildStore(names, namespace) {
134
- return [
135
- `export class ${names.store} extends Store<${names.doc}> {`,
136
- ` public constructor(converter?: FirestoreDataConverter<${names.doc}>) { super("${names.basenameLower}", "${namespace}", converter); }`,
137
- "}",
138
- ];
172
+ return {
173
+ imports: [],
174
+ code: [
175
+ `export class ${names.store} extends Store<${names.doc}> {`,
176
+ ` public constructor(converter?: FirestoreDataConverter<${names.doc}>) { super("${names.basenameLower}", "${namespace}", converter); }`,
177
+ "}",
178
+ ],
179
+ };
139
180
  }
140
181
  buildCreate(names, region, serviceAccount) {
141
- return [
142
- `export const create${names.basename}Function = (api: I${names.api}): CallableFunction<FunctionRequest<unknown>,Promise<FunctionResponse<unknown>>,unknown> => {`,
143
- ` const store = new ${names.store}();`,
144
- "",
145
- ` const val = new Validation<${names.doc}>("${names.basenameLower}");`,
146
- ` val.useShape(${names.shape});`,
147
- "",
148
- ` const func = new ${names.func}("${region}", "${serviceAccount}", api);`,
149
- "",
150
- " api.useStore(store);",
151
- " api.useValidation(val);",
152
- "",
153
- " return func.buildFunction();",
154
- "};",
155
- ];
182
+ return {
183
+ imports: [],
184
+ code: [
185
+ `export const create${names.basename}Function = (api: I${names.api}): CallableFunction<FunctionRequest<unknown>,Promise<FunctionResponse<unknown>>,unknown> => {`,
186
+ ` const store = new ${names.store}();`,
187
+ "",
188
+ ` const val = new Validation<${names.doc}>("${names.basenameLower}");`,
189
+ ` val.useShape(${names.shape});`,
190
+ "",
191
+ ` const func = new ${names.func}("${region}", "${serviceAccount}", api);`,
192
+ "",
193
+ " api.useStore(store);",
194
+ " api.useValidation(val);",
195
+ "",
196
+ " return func.buildFunction();",
197
+ "};",
198
+ ],
199
+ };
156
200
  }
157
201
  }
158
202
  export default new GeneratorBackend();
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratorBackend.js","sourceRoot":"","sources":["../../src/generator/GeneratorBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,cAAc,GAEf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,SAAS,GAIV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAErF;;;;;;GAMG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAC7C;QACE,KAAK,CACH,YAAY,CAAC,OAAO,EACpB,iBAAiB,CAAC,EAAE,EACpB,cAAc,CAAC,OAAO,EACtB,SAAS,CAAC,QAAQ,EAAE,CACrB,CAAC;IACJ,CAAC;IAEkB,KAAK,CAAC,SAAS,CAChC,OAAyB,EACzB,GAAsB,EACtB,GAAiB;QAEjB,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAC3C,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC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AAC;IACJ,CAAC;IAES,UAAU,CAAC,KAAgB,EAAE,SAAiB;QACtD,OAAO;YACL,gBAAgB,KAAK,CAAC,KAAK,kBAAkB,KAAK,CAAC,GAAG,KAAK;YAC3D,2DAA2D,KAAK,CAAC,GAAG,eAAe,KAAK,CAAC,aAAa,OAAO,SAAS,kBAAkB;YACxI,GAAG;SACJ,CAAC;IACJ,CAAC;IAES,WAAW,CACnB,KAAgB,EAChB,MAAc,EACd,cAAsB;QAEtB,OAAO;YACL,sBAAsB,KAAK,CAAC,QAAQ,qBAAqB,KAAK,CAAC,GAAG,+FAA+F;YACjK,uBAAuB,KAAK,CAAC,KAAK,KAAK;YACvC,EAAE;YACF,gCAAgC,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC,aAAa,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
+ {"version":3,"file":"GeneratorBackend.js","sourceRoot":"","sources":["../../src/generator/GeneratorBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,cAAc,GAGf,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,SAAS,GAIV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAErF;;;;;;GAMG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAC7C;QACE,KAAK,CACH,YAAY,CAAC,OAAO,EACpB,iBAAiB,CAAC,EAAE,EACpB,cAAc,CA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AK,CAAC,GAAG,KAAK;gBAC3D,2DAA2D,KAAK,CAAC,GAAG,eAAe,KAAK,CAAC,aAAa,OAAO,SAAS,kBAAkB;gBACxI,GAAG;aACJ;SACF,CAAC;IACJ,CAAC;IAES,WAAW,CACnB,KAAgB,EAChB,MAAc,EACd,cAAsB;QAEtB,OAAO;YACL,OAAO,EAAE,EAAE;YACX,IAAI,EAAE;gBACJ,sBAAsB,KAAK,CAAC,QAAQ,qBAAqB,KAAK,CAAC,GAAG,+FAA+F;gBACjK,uBAAuB,KAAK,CAAC,KAAK,KAAK;gBACvC,EAAE;gBACF,gCAAgC,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC,aAAa,KAAK;gBACvE,kBAAkB,KAAK,CAAC,KAAK,IAAI;gBACjC,EAAE;gBACF,sBAAsB,KAAK,CAAC,IAAI,KAAK,MAAM,OAAO,cAAc,UAAU;gBAC1E,EAAE;gBACF,wBAAwB;gBACxB,2BAA2B;gBAC3B,EAAE;gBACF,gCAAgC;gBAChC,IAAI;aACL;SACF,CAAC;IACJ,CAAC;CACF;AAED,eAAe,IAAI,gBAAgB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/gcp-functions-generator",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "Tools for google cloud functions",
5
5
  "type": "module",
6
6
  "author": "MXPicture",
@@ -34,9 +34,9 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@mxpicture/build-api": "^0.2.58",
37
- "@mxpicture/gcp-functions-backend": "^1.1.14",
38
- "@mxpicture/gcp-functions-common": "^1.1.14",
39
- "@mxpicture/gcp-functions-frontend": "^1.1.14"
37
+ "@mxpicture/gcp-functions-backend": "^1.1.15",
38
+ "@mxpicture/gcp-functions-common": "^1.1.15",
39
+ "@mxpicture/gcp-functions-frontend": "^1.1.15"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^25.2.3",