@mxpicture/gcp-functions 0.1.2 → 0.1.3

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.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FunctionCollection = void 0;
4
+ class FunctionCollection {
5
+ constructor() {
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ this.funcs = {};
8
+ }
9
+ add(name, func) {
10
+ this.funcs[name] = func;
11
+ return this;
12
+ }
13
+ build() {
14
+ return this.funcs;
15
+ }
16
+ }
17
+ exports.FunctionCollection = FunctionCollection;
@@ -4,8 +4,7 @@ exports.BaseFunction = void 0;
4
4
  const https_1 = require("firebase-functions/https");
5
5
  const ts_transformer_keys_1 = require("ts-transformer-keys");
6
6
  class BaseFunction {
7
- constructor(name, http) {
8
- this.name = name;
7
+ constructor(http) {
9
8
  this.http = http;
10
9
  this.httpMethods = (0, ts_transformer_keys_1.keys)();
11
10
  }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FunctionCollection = void 0;
4
+ class FunctionCollection {
5
+ constructor() {
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ this.funcs = {};
8
+ }
9
+ add(name, func) {
10
+ this.funcs[name] = func;
11
+ return this;
12
+ }
13
+ build() {
14
+ return this.funcs;
15
+ }
16
+ }
17
+ exports.FunctionCollection = FunctionCollection;
@@ -4,8 +4,7 @@ exports.BaseFunction = void 0;
4
4
  const https_1 = require("firebase-functions/https");
5
5
  const ts_transformer_keys_1 = require("ts-transformer-keys");
6
6
  class BaseFunction {
7
- constructor(name, http) {
8
- this.name = name;
7
+ constructor(http) {
9
8
  this.http = http;
10
9
  this.httpMethods = (0, ts_transformer_keys_1.keys)();
11
10
  }
@@ -0,0 +1,12 @@
1
+ import { BaseFunction } from "./base/BaseFunction";
2
+ import { DocumentData } from "./types/types.common";
3
+ export declare class FunctionCollection {
4
+ protected funcs: {
5
+ [key: string]: BaseFunction<any>;
6
+ };
7
+ constructor();
8
+ add<DTO extends DocumentData>(name: string, func: BaseFunction<DTO>): FunctionCollection;
9
+ build(): {
10
+ [key: string]: BaseFunction<any>;
11
+ };
12
+ }
@@ -3,9 +3,8 @@ import { HttpHandlers } from "../types/types.httpHandler";
3
3
  import { DocumentData } from "../types/types.common";
4
4
  import { ApiRoutes } from "../types/types.apiRoutes";
5
5
  export declare class BaseFunction<DTO extends DocumentData> {
6
- readonly name: string;
7
6
  protected http: HttpHandlers<ApiRoutes<DTO>>;
8
7
  protected readonly httpMethods: (keyof ApiRoutes<DTO>)[];
9
- constructor(name: string, http: HttpHandlers<ApiRoutes<DTO>>);
8
+ constructor(http: HttpHandlers<ApiRoutes<DTO>>);
10
9
  createFunction(): HttpsFunction;
11
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/gcp-functions",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Utils for google cloud functions, publishing both CommonJS and ESM builds",
5
5
  "author": "MXPicture",
6
6
  "license": "MIT",