@webiny/handler-db 6.1.0-beta.3 → 6.2.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.d.ts +1 -2
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/package.json +5 -5
- package/types.d.ts +1 -1
- package/types.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ConstructorArgs } from "@webiny/db";
|
|
2
|
-
import { ContextPlugin } from "@webiny/api";
|
|
3
2
|
import type { DbContext } from "./types.js";
|
|
4
|
-
declare const _default: <T = unknown>(args: ConstructorArgs<T>) =>
|
|
3
|
+
declare const _default: <T = unknown>(args: ConstructorArgs<T>) => import("@webiny/handler").RegisterExtensionPlugin<DbContext>[];
|
|
5
4
|
export default _default;
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Db } from "@webiny/db";
|
|
2
|
-
import {
|
|
2
|
+
import { createRegisterExtensionPlugin } from "@webiny/handler";
|
|
3
3
|
export default args => {
|
|
4
|
-
const plugin =
|
|
4
|
+
const plugin = createRegisterExtensionPlugin(async context => {
|
|
5
5
|
if (context.db) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
context.db = new Db(args);
|
|
9
9
|
});
|
|
10
|
-
plugin.name = "handler-db
|
|
10
|
+
plugin.name = "handler-db/extension/db";
|
|
11
11
|
return [plugin];
|
|
12
12
|
};
|
|
13
13
|
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Db","
|
|
1
|
+
{"version":3,"names":["Db","createRegisterExtensionPlugin","args","plugin","context","db","name"],"sources":["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"],"mappings":"AACA,SAASA,EAAE,QAAQ,YAAY;AAC/B,SAASC,6BAA6B,QAAQ,iBAAiB;AAG/D,eAA6BC,IAAwB,IAAK;EACtD,MAAMC,MAAM,GAAGF,6BAA6B,CAAY,MAAMG,OAAO,IAAI;IACrE,IAAIA,OAAO,CAACC,EAAE,EAAE;MACZ;IACJ;IACAD,OAAO,CAACC,EAAE,GAAG,IAAIL,EAAE,CAAIE,IAAI,CAAC;EAChC,CAAC,CAAC;EACFC,MAAM,CAACG,IAAI,GAAG,yBAAyB;EACvC,OAAO,CAACH,MAAM,CAAC;AACnB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-db",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"description": "Webiny API plugin that provides a db driver for DynamoDB.",
|
|
12
12
|
"author": "Webiny Ltd.",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@webiny/
|
|
15
|
-
"@webiny/
|
|
14
|
+
"@webiny/db": "6.2.0-beta.0",
|
|
15
|
+
"@webiny/handler": "6.2.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@webiny/build-tools": "6.
|
|
18
|
+
"@webiny/build-tools": "6.2.0-beta.0",
|
|
19
19
|
"rimraf": "6.1.3",
|
|
20
20
|
"typescript": "5.9.3"
|
|
21
21
|
},
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"access": "public",
|
|
24
24
|
"directory": "dist"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "3d3148358b6febbc857371930871743bec3b3939"
|
|
27
27
|
}
|
package/types.d.ts
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Db } from \"@webiny/db\";\nimport type { Context } from \"@webiny/
|
|
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":[]}
|