@webiny/handler 0.0.0-unstable.9e825fd5fb → 0.0.0-unstable.aa00eecd97
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 +19 -10
- package/Context.js +14 -2
- package/Context.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +0 -11
- package/index.js.map +1 -1
- package/package.json +16 -17
package/Context.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { Context as BaseContext, ContextParams as BaseContextParams } from "@webiny/api";
|
|
2
|
-
import { Context as
|
|
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:
|
|
5
|
-
routes:
|
|
4
|
+
server: ContextInterface["server"];
|
|
5
|
+
routes: ContextInterface["routes"];
|
|
6
6
|
}
|
|
7
|
-
export declare class Context extends BaseContext implements
|
|
8
|
-
readonly server:
|
|
9
|
-
readonly routes:
|
|
10
|
-
handlerClient:
|
|
11
|
-
request:
|
|
12
|
-
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
|
-
|
|
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 {
|
|
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
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 \"
|
|
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.
|
|
3
|
+
"version": "0.0.0-unstable.aa00eecd97",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,24 +15,23 @@
|
|
|
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.
|
|
19
|
-
"@webiny/error": "0.0.0-unstable.
|
|
20
|
-
"@webiny/handler-client": "0.0.0-unstable.
|
|
21
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
22
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
18
|
+
"@webiny/api": "0.0.0-unstable.aa00eecd97",
|
|
19
|
+
"@webiny/error": "0.0.0-unstable.aa00eecd97",
|
|
20
|
+
"@webiny/handler-client": "0.0.0-unstable.aa00eecd97",
|
|
21
|
+
"@webiny/plugins": "0.0.0-unstable.aa00eecd97",
|
|
22
|
+
"@webiny/utils": "0.0.0-unstable.aa00eecd97",
|
|
23
23
|
"fastify": "4.11.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@babel/cli": "
|
|
27
|
-
"@babel/core": "
|
|
28
|
-
"@babel/preset-env": "
|
|
29
|
-
"@babel/preset-typescript": "
|
|
30
|
-
"@webiny/cli": "
|
|
31
|
-
"@webiny/project-utils": "
|
|
32
|
-
"babel-plugin-lodash": "
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"ttypescript": "^1.5.13",
|
|
26
|
+
"@babel/cli": "7.20.7",
|
|
27
|
+
"@babel/core": "7.20.12",
|
|
28
|
+
"@babel/preset-env": "7.20.2",
|
|
29
|
+
"@babel/preset-typescript": "7.18.6",
|
|
30
|
+
"@webiny/cli": "0.0.0-unstable.aa00eecd97",
|
|
31
|
+
"@webiny/project-utils": "0.0.0-unstable.aa00eecd97",
|
|
32
|
+
"babel-plugin-lodash": "3.3.4",
|
|
33
|
+
"rimraf": "3.0.2",
|
|
34
|
+
"ttypescript": "1.5.15",
|
|
36
35
|
"typescript": "4.7.4"
|
|
37
36
|
},
|
|
38
37
|
"publishConfig": {
|
|
@@ -43,5 +42,5 @@
|
|
|
43
42
|
"build": "yarn webiny run build",
|
|
44
43
|
"watch": "yarn webiny run watch"
|
|
45
44
|
},
|
|
46
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "aa00eecd97d16da9bdb0581f33d491487ce43ce9"
|
|
47
46
|
}
|