@mxpicture/gcp-functions-backend 0.1.25 → 0.1.27
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.
|
@@ -10,7 +10,18 @@ export class BackendFunction {
|
|
|
10
10
|
this.httpMethods = API_ROUTES_METHODS;
|
|
11
11
|
}
|
|
12
12
|
createFunction() {
|
|
13
|
-
return onCall({
|
|
13
|
+
return onCall({
|
|
14
|
+
cors: [
|
|
15
|
+
/firebase\.com$/,
|
|
16
|
+
/web\.app$/,
|
|
17
|
+
"http://localhost:5000",
|
|
18
|
+
"http://127.0.0.1:5000",
|
|
19
|
+
"http://localhost:5001",
|
|
20
|
+
"http://127.0.0.1:5001",
|
|
21
|
+
"http://localhost:5002",
|
|
22
|
+
"http://127.0.0.1:5002",
|
|
23
|
+
],
|
|
24
|
+
}, async (req) => {
|
|
14
25
|
if (!this.httpMethods.find((m) => m === req.data.route))
|
|
15
26
|
throw new HttpsError("invalid-argument", `Route ${req.data.route} not available`);
|
|
16
27
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HttpsFunction } from "firebase-functions/https";
|
|
1
2
|
import { BackendFunction } from "./BackendFunction.js";
|
|
2
3
|
import type { DocumentData } from "@mxpicture/gcp-functions-common/types";
|
|
3
4
|
export declare class FunctionCollection {
|
|
@@ -6,7 +7,5 @@ export declare class FunctionCollection {
|
|
|
6
7
|
};
|
|
7
8
|
constructor();
|
|
8
9
|
add<DTO extends DocumentData>(func: BackendFunction<DTO>, name?: string): FunctionCollection;
|
|
9
|
-
build():
|
|
10
|
-
[key: string]: BackendFunction<any, import("@mxpicture/gcp-functions-common/types").HttpHandlers<import("@mxpicture/gcp-functions-common/types").ApiRoutes<any>>>;
|
|
11
|
-
};
|
|
10
|
+
build(): Record<string, HttpsFunction>;
|
|
12
11
|
}
|