@h4ad/serverless-adapter 2.15.1 → 2.16.0

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,26 @@
1
+ import { https } from 'firebase-functions/v2';
2
+ import { FrameworkContract, HandlerContract } from '../../contracts';
3
+ import { RawRequest } from '../base';
4
+ /**
5
+ * The class that implements a handler for Firebase Https Events
6
+ *
7
+ * @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}
8
+ *
9
+ * @breadcrumb Handlers / HttpFirebaseHandler
10
+ * @public
11
+ */
12
+ export declare class HttpFirebaseV2Handler<TApp> extends RawRequest<TApp> implements HandlerContract<TApp, never, never, never, void, void | Promise<void>> {
13
+ protected readonly options?: https.HttpsOptions | undefined;
14
+ /**
15
+ * Construtor padrão
16
+ */
17
+ constructor(options?: https.HttpsOptions | undefined);
18
+ /**
19
+ * {@inheritDoc}
20
+ */
21
+ getHandler(app: TApp, framework: FrameworkContract<TApp>): ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>;
22
+ /**
23
+ * Wrapper method around onRequest for better testability
24
+ */
25
+ protected onRequestWithOptions(options: https.HttpsOptions, callback: ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>): ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>;
26
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpFirebaseV2Handler = void 0;
4
+ const { __ΩFrameworkContract } = require('../../contracts');
5
+ const __ΩReturnType = ['T', 'args', '', 'l>e"!R"RPde#!P"@2"h"!/#qk#\'QRb!Pde"!p)'];
6
+ //#region Imports
7
+ // eslint-disable-next-line import/no-unresolved
8
+ const v2_1 = require("firebase-functions/v2");
9
+ const base_1 = require("../base");
10
+ //#endregion
11
+ /**
12
+ * The class that implements a handler for Firebase Https Events
13
+ *
14
+ * @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}
15
+ *
16
+ * @breadcrumb Handlers / HttpFirebaseHandler
17
+ * @public
18
+ */
19
+ class HttpFirebaseV2Handler extends base_1.RawRequest {
20
+ //#region Constructor
21
+ /**
22
+ * Construtor padrão
23
+ */
24
+ constructor(options) {
25
+ super();
26
+ this.options = options;
27
+ }
28
+ //#endregion
29
+ //#region Public Methods
30
+ /**
31
+ * {@inheritDoc}
32
+ */
33
+ getHandler(app, framework) {
34
+ if (this.options) {
35
+ return this.onRequestWithOptions(this.options, this.onRequestCallback(app, framework));
36
+ }
37
+ return v2_1.https.onRequest(this.onRequestCallback(app, framework));
38
+ }
39
+ //#endregion
40
+ //#region Protected Method
41
+ /**
42
+ * Wrapper method around onRequest for better testability
43
+ */
44
+ onRequestWithOptions(options, callback) {
45
+ return v2_1.https.onRequest(options, callback);
46
+ }
47
+ }
48
+ exports.HttpFirebaseV2Handler = HttpFirebaseV2Handler;
49
+ HttpFirebaseV2Handler.__type = ['TApp', () => base_1.RawRequest, 'options', 'constructor', 'app', () => __ΩFrameworkContract, 'framework', () => __ΩReturnType, () => HttpFirebaseV2Handler, "onRequestCallback", 'getHandler', () => __ΩReturnType, () => HttpFirebaseV2Handler, "onRequestCallback", 'callback', () => __ΩReturnType, () => HttpFirebaseV2Handler, "onRequestCallback", 'onRequestWithOptions', 'b!Pe"!7"P!2#8<9"0$Pe"!2%e"!o&"2\'Pe#!7).*fo("0+P!2#Pe#!7-..fo,"2/Pe#!71.2fo0"03<5e!!6"'];
50
+ //# sourceMappingURL=http-firebase-v2.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-firebase-v2.handler.js","sourceRoot":"","sources":["../../../src/handlers/firebase/http-firebase-v2.handler.ts"],"names":[],"mappings":";;;yCAImD,iBAAiB;;AAJpE,iBAAiB;AAEjB,gDAAgD;AAChD,8CAA8C;AAE9C,kCAAqC;AAErC,YAAY;AAEZ;;;;;;;GAOG;AACH,MAAa,qBACX,SAAQ,iBAAgB;IAIxB,qBAAqB;IAErB;;OAEG;IACH,YAA+B,OAA4B;QACzD,KAAK,EAAE,CAAC;QADqB,YAAO,GAAP,OAAO,CAAqB;IAE3D,CAAC;IAED,YAAY;IAEZ,wBAAwB;IAExB;;OAEG;IACI,UAAU,CACf,GAAS,EACT,SAAkC;QAElC,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO,IAAI,CAAC,oBAAoB,CAC9B,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CACvC,CAAC;SACH;QAED,OAAO,UAAK,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,YAAY;IAEZ,0BAA0B;IAE1B;;OAEG;IACO,oBAAoB,CAC5B,OAA2B,EAC3B,QAAsE;QAEtE,OAAO,UAAK,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC5C,CAAC;;AA/CH,sDAkDC"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { IncomingMessage, ServerResponse } from 'http';
3
3
  import { FrameworkContract, HandlerContract } from '../../contracts';
4
- import { RawRequest } from '../base/index';
4
+ import { RawRequest } from '../base';
5
5
  /**
6
6
  * The class that implements a handler for Firebase Https Events
7
7
  *
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpFirebaseHandler = void 0;
4
4
  const { __ΩFrameworkContract } = require('../../contracts');
5
5
  const firebase_functions_1 = require("firebase-functions");
6
- const index_1 = require("../base/index");
6
+ const base_1 = require("../base");
7
7
  //#endregion
8
8
  /**
9
9
  * The class that implements a handler for Firebase Https Events
@@ -13,7 +13,7 @@ const index_1 = require("../base/index");
13
13
  * @breadcrumb Handlers / HttpFirebaseHandler
14
14
  * @public
15
15
  */
16
- class HttpFirebaseHandler extends index_1.RawRequest {
16
+ class HttpFirebaseHandler extends base_1.RawRequest {
17
17
  //#region Public Methods
18
18
  /**
19
19
  * {@inheritDoc}
@@ -23,5 +23,5 @@ class HttpFirebaseHandler extends index_1.RawRequest {
23
23
  }
24
24
  }
25
25
  exports.HttpFirebaseHandler = HttpFirebaseHandler;
26
- HttpFirebaseHandler.__type = ['TApp', () => index_1.RawRequest, 'app', () => __ΩFrameworkContract, 'framework', 'req', 'res', '', 'getHandler', 'b!Pe"!7"Pe"!2#e"!o$"2%P!2&!2\'P$$`J/(0)5e!!6"'];
26
+ HttpFirebaseHandler.__type = ['TApp', () => base_1.RawRequest, 'app', () => __ΩFrameworkContract, 'framework', 'req', 'res', '', 'getHandler', 'b!Pe"!7"Pe"!2#e"!o$"2%P!2&!2\'P$$`J/(0)5e!!6"'];
27
27
  //# sourceMappingURL=http-firebase.handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-firebase.handler.js","sourceRoot":"","sources":["../../../src/handlers/firebase/http-firebase.handler.ts"],"names":[],"mappings":";;;yCAImD,iBAAiB;AADpE,2DAA2C;AAE3C,yCAA2C;AAE3C,YAAY;AACZ;;;;;;;GAOG;AACH,MAAa,mBACX,SAAQ,kBAAgB;IAIxB,wBAAwB;IAExB;;OAEG;IACI,UAAU,CACf,GAAS,EACT,SAAkC;QAElC,OAAO,0BAAK,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;IACjE,CAAC;;AAfH,kDAkBC"}
1
+ {"version":3,"file":"http-firebase.handler.js","sourceRoot":"","sources":["../../../src/handlers/firebase/http-firebase.handler.ts"],"names":[],"mappings":";;;yCAImD,iBAAiB;AADpE,2DAA2C;AAE3C,kCAAqC;AAErC,YAAY;AACZ;;;;;;;GAOG;AACH,MAAa,mBACX,SAAQ,iBAAgB;IAIxB,wBAAwB;IAExB;;OAEG;IACI,UAAU,CACf,GAAS,EACT,SAAkC;QAElC,OAAO,0BAAK,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;IACjE,CAAC;;AAfH,kDAkBC"}
@@ -1 +1,2 @@
1
1
  export * from './http-firebase.handler';
2
+ export * from './http-firebase-v2.handler';
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./http-firebase.handler"), exports);
18
+ __exportStar(require("./http-firebase-v2.handler"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/handlers/firebase/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/handlers/firebase/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,6DAA2C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h4ad/serverless-adapter",
3
- "version": "2.15.1",
3
+ "version": "2.16.0",
4
4
  "description": "Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Express, Koa, Hapi, Fastify and many others), on top of AWS, Azure, Digital Ocean and many other clouds.",
5
5
  "main": "./lib/index.js",
6
6
  "files": [