@webiny/handler-db 6.3.0-beta.4 → 6.4.0-beta.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.
- package/index.js +10 -9
- package/index.js.map +1 -1
- package/package.json +5 -5
- package/types.js +0 -3
- package/types.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Db } from "@webiny/db";
|
|
2
2
|
import { createRegisterExtensionPlugin } from "@webiny/handler";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
const src = (args)=>{
|
|
4
|
+
const plugin = createRegisterExtensionPlugin(async (context)=>{
|
|
5
|
+
if (context.db) return;
|
|
6
|
+
context.db = new Db(args);
|
|
7
|
+
});
|
|
8
|
+
plugin.name = "handler-db/extension/db";
|
|
9
|
+
return [
|
|
10
|
+
plugin
|
|
11
|
+
];
|
|
12
12
|
};
|
|
13
|
+
export default src;
|
|
13
14
|
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { ConstructorArgs } from \"@webiny/db\";\nimport { Db } from \"@webiny/db\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\nimport type { DbContext } from \"./types.js\";\n\nexport default <T = unknown>(args: ConstructorArgs<T>) => {\n const plugin = createRegisterExtensionPlugin<DbContext>(async context => {\n if (context.db) {\n return;\n }\n context.db = new Db<T>(args);\n });\n plugin.name = \"handler-db/extension/db\";\n return [plugin];\n};\n"],"names":["args","plugin","createRegisterExtensionPlugin","context","Db"],"mappings":";;AAKA,YAAe,CAAcA;IACzB,MAAMC,SAASC,8BAAyC,OAAMC;QAC1D,IAAIA,QAAQ,EAAE,EACV;QAEJA,QAAQ,EAAE,GAAG,IAAIC,GAAMJ;IAC3B;IACAC,OAAO,IAAI,GAAG;IACd,OAAO;QAACA;KAAO;AACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-db",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"description": "Webiny API plugin that provides a db driver for DynamoDB.",
|
|
15
15
|
"author": "Webiny Ltd.",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@webiny/db": "6.
|
|
18
|
-
"@webiny/handler": "6.
|
|
17
|
+
"@webiny/db": "6.4.0-beta.0",
|
|
18
|
+
"@webiny/handler": "6.4.0-beta.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@webiny/build-tools": "6.
|
|
21
|
+
"@webiny/build-tools": "6.4.0-beta.0",
|
|
22
22
|
"rimraf": "6.1.3",
|
|
23
23
|
"typescript": "6.0.3"
|
|
24
24
|
},
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"access": "public",
|
|
27
27
|
"directory": "dist"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce"
|
|
30
30
|
}
|
package/types.js
CHANGED
package/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Db } from \"@webiny/db\";\nimport type { Context } from \"@webiny/handler/types.js\";\n\nexport interface DbContext extends Context {\n db: Db<unknown>;\n}\n"],"mappings":"","ignoreList":[]}
|