@mxpicture/gcp-functions 0.1.12 → 0.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.
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseFunction = void 0;
|
|
4
4
|
const https_1 = require("firebase-functions/https");
|
|
5
|
-
const
|
|
5
|
+
const types_apiRoutes_1 = require("../types/types.apiRoutes");
|
|
6
6
|
class BaseFunction {
|
|
7
7
|
constructor(name, http) {
|
|
8
8
|
this.name = name;
|
|
9
9
|
this.http = http;
|
|
10
|
-
this.httpMethods =
|
|
10
|
+
this.httpMethods = types_apiRoutes_1.API_ROUTES_METHODS;
|
|
11
11
|
}
|
|
12
12
|
createFunction() {
|
|
13
13
|
return (0, https_1.onCall)({ cors: [/firebase\.com$/, /web\.app$/] }, async (req) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiFilterOp = void 0;
|
|
3
|
+
exports.API_ROUTES_METHODS = exports.ApiFilterOp = void 0;
|
|
4
|
+
const ts_transformer_keys_1 = require("ts-transformer-keys");
|
|
4
5
|
var ApiFilterOp;
|
|
5
6
|
(function (ApiFilterOp) {
|
|
6
7
|
ApiFilterOp["lessThan"] = "<";
|
|
@@ -14,3 +15,4 @@ var ApiFilterOp;
|
|
|
14
15
|
ApiFilterOp["notIn"] = "not-in";
|
|
15
16
|
ApiFilterOp["arrayContainsAny"] = "array-contains-any";
|
|
16
17
|
})(ApiFilterOp || (exports.ApiFilterOp = ApiFilterOp = {}));
|
|
18
|
+
exports.API_ROUTES_METHODS = (0, ts_transformer_keys_1.keys)();
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseFunction = void 0;
|
|
4
4
|
const https_1 = require("firebase-functions/https");
|
|
5
|
-
const
|
|
5
|
+
const types_apiRoutes_1 = require("../types/types.apiRoutes");
|
|
6
6
|
class BaseFunction {
|
|
7
7
|
constructor(name, http) {
|
|
8
8
|
this.name = name;
|
|
9
9
|
this.http = http;
|
|
10
|
-
this.httpMethods =
|
|
10
|
+
this.httpMethods = types_apiRoutes_1.API_ROUTES_METHODS;
|
|
11
11
|
}
|
|
12
12
|
createFunction() {
|
|
13
13
|
return (0, https_1.onCall)({ cors: [/firebase\.com$/, /web\.app$/] }, async (req) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiFilterOp = void 0;
|
|
3
|
+
exports.API_ROUTES_METHODS = exports.ApiFilterOp = void 0;
|
|
4
|
+
const ts_transformer_keys_1 = require("ts-transformer-keys");
|
|
4
5
|
var ApiFilterOp;
|
|
5
6
|
(function (ApiFilterOp) {
|
|
6
7
|
ApiFilterOp["lessThan"] = "<";
|
|
@@ -14,3 +15,4 @@ var ApiFilterOp;
|
|
|
14
15
|
ApiFilterOp["notIn"] = "not-in";
|
|
15
16
|
ApiFilterOp["arrayContainsAny"] = "array-contains-any";
|
|
16
17
|
})(ApiFilterOp || (exports.ApiFilterOp = ApiFilterOp = {}));
|
|
18
|
+
exports.API_ROUTES_METHODS = (0, ts_transformer_keys_1.keys)();
|
|
@@ -48,6 +48,7 @@ export type ApiRoutes<DTO extends DocumentData> = WithApiRoutes<{
|
|
|
48
48
|
}>;
|
|
49
49
|
meta: ApiRouteDef<never, never, MetaItem[]>;
|
|
50
50
|
}>;
|
|
51
|
+
export declare const API_ROUTES_METHODS: ("create" | "update" | "delete" | "get" | "query" | "count" | "exists" | "meta")[];
|
|
51
52
|
export type ApiFromRoutes<R extends ApiRoutesMap> = {
|
|
52
53
|
[K in keyof R]: (...args: R[K]["keys"] extends never ? [payload: R[K]["payload"]] : [keys: R[K]["keys"], payload: R[K]["payload"]]) => Promise<R[K]["result"]>;
|
|
53
54
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxpicture/gcp-functions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Utils for google cloud functions, publishing both CommonJS and ESM builds",
|
|
5
5
|
"author": "MXPicture",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/MXPicture/
|
|
9
|
+
"url": "git+https://github.com/MXPicture/npm-gcp-functions"
|
|
10
10
|
},
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
12
12
|
"module": "dist/esm/index.js",
|