@webiny/handler-db 0.0.0-unstable.40876133bb → 0.0.0-unstable.461c047ab7
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/index.d.ts +3 -5
- package/index.js +6 -10
- package/index.js.map +1 -1
- package/package.json +9 -14
- package/types.d.ts +3 -3
- package/types.js +3 -1
- package/types.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import type { ConstructorArgs } from "@webiny/db";
|
|
1
2
|
import { ContextPlugin } from "@webiny/api";
|
|
2
|
-
import { DbContext } from "./types";
|
|
3
|
-
|
|
4
|
-
* TODO: remove this package.
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: (args: any) => ContextPlugin<DbContext>[];
|
|
3
|
+
import type { DbContext } from "./types";
|
|
4
|
+
declare const _default: <T = unknown>(args: ConstructorArgs<T>) => ContextPlugin<DbContext>[];
|
|
7
5
|
export default _default;
|
package/index.js
CHANGED
|
@@ -4,22 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _db = require("@webiny/db");
|
|
9
|
-
|
|
10
8
|
var _api = require("@webiny/api");
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* TODO: remove this package.
|
|
14
|
-
*/
|
|
15
9
|
var _default = args => {
|
|
16
|
-
|
|
10
|
+
const plugin = new _api.ContextPlugin(context => {
|
|
17
11
|
if (context.db) {
|
|
18
12
|
return;
|
|
19
13
|
}
|
|
20
|
-
|
|
21
14
|
context.db = new _db.Db(args);
|
|
22
|
-
})
|
|
15
|
+
});
|
|
16
|
+
plugin.name = "handler-db.context.db";
|
|
17
|
+
return [plugin];
|
|
23
18
|
};
|
|
19
|
+
exports.default = _default;
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["args","ContextPlugin","context","db","Db"],"sources":["index.ts"],"sourcesContent":["import { Db } from \"@webiny/db\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { DbContext } from \"./types\";\n\
|
|
1
|
+
{"version":3,"names":["_db","require","_api","_default","args","plugin","ContextPlugin","context","db","Db","name","exports","default"],"sources":["index.ts"],"sourcesContent":["import type { ConstructorArgs } from \"@webiny/db\";\nimport { Db } from \"@webiny/db\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport type { DbContext } from \"./types\";\n\nexport default <T = unknown>(args: ConstructorArgs<T>) => {\n const plugin = new ContextPlugin<DbContext>(context => {\n if (context.db) {\n return;\n }\n context.db = new Db<T>(args);\n });\n plugin.name = \"handler-db.context.db\";\n return [plugin];\n};\n"],"mappings":";;;;;;AACA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAA4C,IAAAE,QAAA,GAGfC,IAAwB,IAAK;EACtD,MAAMC,MAAM,GAAG,IAAIC,kBAAa,CAAYC,OAAO,IAAI;IACnD,IAAIA,OAAO,CAACC,EAAE,EAAE;MACZ;IACJ;IACAD,OAAO,CAACC,EAAE,GAAG,IAAIC,MAAE,CAAIL,IAAI,CAAC;EAChC,CAAC,CAAC;EACFC,MAAM,CAACK,IAAI,GAAG,uBAAuB;EACrC,OAAO,CAACL,MAAM,CAAC;AACnB,CAAC;AAAAM,OAAA,CAAAC,OAAA,GAAAT,QAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-db",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.461c047ab7",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -10,26 +10,21 @@
|
|
|
10
10
|
"description": "Webiny API plugin that provides a db driver for DynamoDB.",
|
|
11
11
|
"author": "Webiny Ltd.",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@
|
|
14
|
-
"@webiny/
|
|
15
|
-
"@webiny/db": "0.0.0-unstable.40876133bb"
|
|
13
|
+
"@webiny/api": "0.0.0-unstable.461c047ab7",
|
|
14
|
+
"@webiny/db": "0.0.0-unstable.461c047ab7"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"@webiny/cli": "^0.0.0-unstable.40876133bb",
|
|
22
|
-
"@webiny/project-utils": "^0.0.0-unstable.40876133bb",
|
|
23
|
-
"rimraf": "^3.0.2",
|
|
24
|
-
"typescript": "4.7.4"
|
|
17
|
+
"@webiny/project-utils": "0.0.0-unstable.461c047ab7",
|
|
18
|
+
"rimraf": "6.0.1",
|
|
19
|
+
"typescript": "5.3.3"
|
|
25
20
|
},
|
|
26
21
|
"publishConfig": {
|
|
27
22
|
"access": "public",
|
|
28
23
|
"directory": "dist"
|
|
29
24
|
},
|
|
30
25
|
"scripts": {
|
|
31
|
-
"build": "
|
|
32
|
-
"watch": "
|
|
26
|
+
"build": "node ../cli/bin.js run build",
|
|
27
|
+
"watch": "node ../cli/bin.js run watch"
|
|
33
28
|
},
|
|
34
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "461c047ab7dd75a537e760dc6e917d21fedfaaae"
|
|
35
30
|
}
|
package/types.d.ts
CHANGED
package/types.js
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { Db } from \"@webiny/db\";\nimport { Context } from \"@webiny/api/types\";\n\nexport interface DbContext extends Context {\n db: Db
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Db } from \"@webiny/db\";\nimport type { Context } from \"@webiny/api/types\";\n\nexport interface DbContext extends Context {\n db: Db<unknown>;\n}\n"],"mappings":"","ignoreList":[]}
|