@webiny/handler 0.0.0-unstable.9e825fd5fb → 0.0.0-unstable.ad3a7a4920

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.
package/Context.d.ts CHANGED
@@ -1,14 +1,23 @@
1
- import { Context as BaseContext, ContextParams as BaseContextParams } from "@webiny/api";
2
- import { Context as BaseContextType } from "./types";
1
+ import { Context as BaseContext, ContextParams as BaseContextParams, ContextPlugin as BaseContextPlugin, ContextPluginCallable as BaseContextPluginCallable } from "@webiny/api";
2
+ import { Context as ContextInterface } from "./types";
3
3
  export interface ContextParams extends BaseContextParams {
4
- server: BaseContextType["server"];
5
- routes: BaseContextType["routes"];
4
+ server: ContextInterface["server"];
5
+ routes: ContextInterface["routes"];
6
6
  }
7
- export declare class Context extends BaseContext implements BaseContextType {
8
- readonly server: BaseContextType["server"];
9
- readonly routes: BaseContextType["routes"];
10
- handlerClient: BaseContextType["handlerClient"];
11
- request: BaseContextType["request"];
12
- reply: BaseContextType["reply"];
7
+ export declare class Context extends BaseContext implements ContextInterface {
8
+ readonly server: ContextInterface["server"];
9
+ readonly routes: ContextInterface["routes"];
10
+ handlerClient: ContextInterface["handlerClient"];
11
+ request: ContextInterface["request"];
12
+ reply: ContextInterface["reply"];
13
13
  constructor(params: ContextParams);
14
14
  }
15
+ /**
16
+ * We need to extend and reexport the ContextPlugin, ContextPluginCallable and createContextPlugin to support extended context.
17
+ *
18
+ * This can be removed when we introduce the type augmentation.
19
+ */
20
+ export declare type ContextPluginCallable<T extends ContextInterface = ContextInterface> = BaseContextPluginCallable<T>;
21
+ export declare class ContextPlugin<T extends ContextInterface = ContextInterface> extends BaseContextPlugin<T> {
22
+ }
23
+ export declare const createContextPlugin: <T extends ContextInterface = ContextInterface>(callable: ContextPluginCallable<T>) => BaseContextPlugin<T>;
package/Context.js CHANGED
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.Context = void 0;
7
+ exports.createContextPlugin = exports.ContextPlugin = exports.Context = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _api = require("@webiny/api");
10
10
  class Context extends _api.Context {
@@ -25,4 +25,16 @@ class Context extends _api.Context {
25
25
  this.routes = params.routes;
26
26
  }
27
27
  }
28
- exports.Context = Context;
28
+
29
+ /**
30
+ * We need to extend and reexport the ContextPlugin, ContextPluginCallable and createContextPlugin to support extended context.
31
+ *
32
+ * This can be removed when we introduce the type augmentation.
33
+ */
34
+ exports.Context = Context;
35
+ class ContextPlugin extends _api.ContextPlugin {}
36
+ exports.ContextPlugin = ContextPlugin;
37
+ const createContextPlugin = callable => {
38
+ return (0, _api.createContextPlugin)(callable);
39
+ };
40
+ exports.createContextPlugin = createContextPlugin;
package/Context.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["Context","BaseContext","constructor","params","server","routes"],"sources":["Context.ts"],"sourcesContent":["import { Context as BaseContext, ContextParams as BaseContextParams } from \"@webiny/api\";\nimport { Context as BaseContextType } from \"~/types\";\n\nexport interface ContextParams extends BaseContextParams {\n server: BaseContextType[\"server\"];\n routes: BaseContextType[\"routes\"];\n}\n\nexport class Context extends BaseContext implements BaseContextType {\n public readonly server: BaseContextType[\"server\"];\n public readonly routes: BaseContextType[\"routes\"];\n // @ts-ignore\n public handlerClient: BaseContextType[\"handlerClient\"];\n // @ts-ignore\n public request: BaseContextType[\"request\"];\n // @ts-ignore\n public reply: BaseContextType[\"reply\"];\n\n public constructor(params: ContextParams) {\n super(params);\n this.server = params.server;\n this.routes = params.routes;\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAQO,MAAMA,OAAO,SAASC,YAAW,CAA4B;EAGhE;;EAEA;;EAEA;;EAGOC,WAAW,CAACC,MAAqB,EAAE;IACtC,KAAK,CAACA,MAAM,CAAC;IAAC;IAAA;IAAA;IAAA;IAAA;IACd,IAAI,CAACC,MAAM,GAAGD,MAAM,CAACC,MAAM;IAC3B,IAAI,CAACC,MAAM,GAAGF,MAAM,CAACE,MAAM;EAC/B;AACJ;AAAC"}
1
+ {"version":3,"names":["Context","BaseContext","constructor","params","server","routes","ContextPlugin","BaseContextPlugin","createContextPlugin","callable","baseCreateContextPlugin"],"sources":["Context.ts"],"sourcesContent":["import {\n Context as BaseContext,\n ContextParams as BaseContextParams,\n ContextPlugin as BaseContextPlugin,\n ContextPluginCallable as BaseContextPluginCallable,\n createContextPlugin as baseCreateContextPlugin\n} from \"@webiny/api\";\nimport { Context as ContextInterface } from \"~/types\";\n\nexport interface ContextParams extends BaseContextParams {\n server: ContextInterface[\"server\"];\n routes: ContextInterface[\"routes\"];\n}\n\nexport class Context extends BaseContext implements ContextInterface {\n public readonly server: ContextInterface[\"server\"];\n public readonly routes: ContextInterface[\"routes\"];\n // @ts-ignore\n public handlerClient: ContextInterface[\"handlerClient\"];\n // @ts-ignore\n public request: ContextInterface[\"request\"];\n // @ts-ignore\n public reply: ContextInterface[\"reply\"];\n\n public constructor(params: ContextParams) {\n super(params);\n this.server = params.server;\n this.routes = params.routes;\n }\n}\n\n/**\n * We need to extend and reexport the ContextPlugin, ContextPluginCallable and createContextPlugin to support extended context.\n *\n * This can be removed when we introduce the type augmentation.\n */\nexport type ContextPluginCallable<T extends ContextInterface = ContextInterface> =\n BaseContextPluginCallable<T>;\n\nexport class ContextPlugin<\n T extends ContextInterface = ContextInterface\n> extends BaseContextPlugin<T> {}\n\nexport const createContextPlugin = <T extends ContextInterface = ContextInterface>(\n callable: ContextPluginCallable<T>\n) => {\n return baseCreateContextPlugin<T>(callable);\n};\n"],"mappings":";;;;;;;;AAAA;AAcO,MAAMA,OAAO,SAASC,YAAW,CAA6B;EAGjE;;EAEA;;EAEA;;EAGOC,WAAW,CAACC,MAAqB,EAAE;IACtC,KAAK,CAACA,MAAM,CAAC;IAAC;IAAA;IAAA;IAAA;IAAA;IACd,IAAI,CAACC,MAAM,GAAGD,MAAM,CAACC,MAAM;IAC3B,IAAI,CAACC,MAAM,GAAGF,MAAM,CAACE,MAAM;EAC/B;AACJ;;AAEA;AACA;AACA;AACA;AACA;AAJA;AAQO,MAAMC,aAAa,SAEhBC,kBAAiB,CAAI;AAAE;AAE1B,MAAMC,mBAAmB,GAC5BC,QAAkC,IACjC;EACD,OAAO,IAAAC,wBAAuB,EAAID,QAAQ,CAAC;AAC/C,CAAC;AAAC"}
package/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from "@webiny/api/plugins/ContextPlugin";
2
1
  export * from "./fastify";
3
2
  export * from "./Context";
4
3
  export * from "./plugins/EventPlugin";
package/index.js CHANGED
@@ -3,17 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _ContextPlugin = require("@webiny/api/plugins/ContextPlugin");
7
- Object.keys(_ContextPlugin).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _ContextPlugin[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _ContextPlugin[key];
14
- }
15
- });
16
- });
17
6
  var _fastify = require("./fastify");
18
7
  Object.keys(_fastify).forEach(function (key) {
19
8
  if (key === "default" || key === "__esModule") return;
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"@webiny/api/plugins/ContextPlugin\";\nexport * from \"~/fastify\";\nexport * from \"~/Context\";\nexport * from \"~/plugins/EventPlugin\";\nexport * from \"~/plugins/RoutePlugin\";\nexport * from \"~/plugins/BeforeHandlerPlugin\";\nexport * from \"~/plugins/HandlerErrorPlugin\";\nexport * from \"~/plugins/HandlerResultPlugin\";\nexport * from \"~/plugins/HandlerOnRequestPlugin\";\nexport * from \"~/plugins/ModifyFastifyPlugin\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"~/fastify\";\nexport * from \"~/Context\";\nexport * from \"~/plugins/EventPlugin\";\nexport * from \"~/plugins/RoutePlugin\";\nexport * from \"~/plugins/BeforeHandlerPlugin\";\nexport * from \"~/plugins/HandlerErrorPlugin\";\nexport * from \"~/plugins/HandlerResultPlugin\";\nexport * from \"~/plugins/HandlerOnRequestPlugin\";\nexport * from \"~/plugins/ModifyFastifyPlugin\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/handler",
3
- "version": "0.0.0-unstable.9e825fd5fb",
3
+ "version": "0.0.0-unstable.ad3a7a4920",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,11 +15,11 @@
15
15
  "@babel/runtime": "7.20.13",
16
16
  "@fastify/compress": "6.2.0",
17
17
  "@fastify/cookie": "8.3.0",
18
- "@webiny/api": "0.0.0-unstable.9e825fd5fb",
19
- "@webiny/error": "0.0.0-unstable.9e825fd5fb",
20
- "@webiny/handler-client": "0.0.0-unstable.9e825fd5fb",
21
- "@webiny/plugins": "0.0.0-unstable.9e825fd5fb",
22
- "@webiny/utils": "0.0.0-unstable.9e825fd5fb",
18
+ "@webiny/api": "0.0.0-unstable.ad3a7a4920",
19
+ "@webiny/error": "0.0.0-unstable.ad3a7a4920",
20
+ "@webiny/handler-client": "0.0.0-unstable.ad3a7a4920",
21
+ "@webiny/plugins": "0.0.0-unstable.ad3a7a4920",
22
+ "@webiny/utils": "0.0.0-unstable.ad3a7a4920",
23
23
  "fastify": "4.11.0"
24
24
  },
25
25
  "devDependencies": {
@@ -27,8 +27,8 @@
27
27
  "@babel/core": "^7.19.3",
28
28
  "@babel/preset-env": "^7.19.4",
29
29
  "@babel/preset-typescript": "^7.18.6",
30
- "@webiny/cli": "^0.0.0-unstable.9e825fd5fb",
31
- "@webiny/project-utils": "^0.0.0-unstable.9e825fd5fb",
30
+ "@webiny/cli": "^0.0.0-unstable.ad3a7a4920",
31
+ "@webiny/project-utils": "^0.0.0-unstable.ad3a7a4920",
32
32
  "babel-plugin-lodash": "^3.3.4",
33
33
  "merge": "^1.2.1",
34
34
  "rimraf": "^3.0.2",
@@ -43,5 +43,5 @@
43
43
  "build": "yarn webiny run build",
44
44
  "watch": "yarn webiny run watch"
45
45
  },
46
- "gitHead": "9e825fd5fb3c021691acbaee6c5fd925f5f5de4d"
46
+ "gitHead": "ad3a7a492009155a589fde9ef4dc7c94af43c86e"
47
47
  }