@webiny/handler-db 6.0.0-alpha.5 β 6.0.0-rc.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/README.md +8 -17
- package/index.d.ts +1 -1
- package/index.js +5 -12
- package/index.js.map +1 -1
- package/package.json +8 -11
- package/types.d.ts +1 -1
- package/types.js +1 -5
- package/types.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
# @webiny/handler-db
|
|
1
|
+
# @webiny/handler-db
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> Itβs **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
Add the plugin to the `plugins` section of your service:
|
|
7
|
+
π **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
inputs:
|
|
12
|
-
# ... other inputs ...
|
|
13
|
-
plugins:
|
|
14
|
-
# ... other plugins ...
|
|
15
|
-
- factory: "@webiny/handler-db-nedb"
|
|
16
|
-
options:
|
|
17
|
-
database:
|
|
18
|
-
server: NEDB_SERVER_URI
|
|
19
|
-
name: NEDB_DATABASE_NAME
|
|
20
|
-
```
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConstructorArgs } from "@webiny/db";
|
|
2
2
|
import { ContextPlugin } from "@webiny/api";
|
|
3
|
-
import type { DbContext } from "./types";
|
|
3
|
+
import type { DbContext } from "./types.js";
|
|
4
4
|
declare const _default: <T = unknown>(args: ConstructorArgs<T>) => ContextPlugin<DbContext>[];
|
|
5
5
|
export default _default;
|
package/index.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _db = require("@webiny/db");
|
|
8
|
-
var _api = require("@webiny/api");
|
|
9
|
-
var _default = args => {
|
|
10
|
-
const plugin = new _api.ContextPlugin(context => {
|
|
1
|
+
import { Db } from "@webiny/db";
|
|
2
|
+
import { ContextPlugin } from "@webiny/api";
|
|
3
|
+
export default args => {
|
|
4
|
+
const plugin = new ContextPlugin(context => {
|
|
11
5
|
if (context.db) {
|
|
12
6
|
return;
|
|
13
7
|
}
|
|
14
|
-
context.db = new
|
|
8
|
+
context.db = new Db(args);
|
|
15
9
|
});
|
|
16
10
|
plugin.name = "handler-db.context.db";
|
|
17
11
|
return [plugin];
|
|
18
12
|
};
|
|
19
|
-
exports.default = _default;
|
|
20
13
|
|
|
21
14
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Db","ContextPlugin","args","plugin","context","db","name"],"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.js\";\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,SAASA,EAAE,QAAQ,YAAY;AAC/B,SAASC,aAAa,QAAQ,aAAa;AAG3C,eAA6BC,IAAwB,IAAK;EACtD,MAAMC,MAAM,GAAG,IAAIF,aAAa,CAAYG,OAAO,IAAI;IACnD,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,uBAAuB;EACrC,OAAO,CAACH,MAAM,CAAC;AACnB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-db",
|
|
3
|
-
"version": "6.0.0-
|
|
3
|
+
"version": "6.0.0-rc.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "index.js",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"repository": {
|
|
@@ -10,21 +11,17 @@
|
|
|
10
11
|
"description": "Webiny API plugin that provides a db driver for DynamoDB.",
|
|
11
12
|
"author": "Webiny Ltd.",
|
|
12
13
|
"dependencies": {
|
|
13
|
-
"@webiny/api": "6.0.0-
|
|
14
|
-
"@webiny/db": "6.0.0-
|
|
14
|
+
"@webiny/api": "6.0.0-rc.0",
|
|
15
|
+
"@webiny/db": "6.0.0-rc.0"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
|
-
"@webiny/
|
|
18
|
-
"rimraf": "6.
|
|
19
|
-
"typescript": "5.
|
|
18
|
+
"@webiny/build-tools": "6.0.0-rc.0",
|
|
19
|
+
"rimraf": "6.1.3",
|
|
20
|
+
"typescript": "5.9.3"
|
|
20
21
|
},
|
|
21
22
|
"publishConfig": {
|
|
22
23
|
"access": "public",
|
|
23
24
|
"directory": "dist"
|
|
24
25
|
},
|
|
25
|
-
"
|
|
26
|
-
"build": "node ../cli/bin.js run build",
|
|
27
|
-
"watch": "node ../cli/bin.js run watch"
|
|
28
|
-
},
|
|
29
|
-
"gitHead": "b7e120541b093e91f214904a9f13e4c2c4640978"
|
|
26
|
+
"gitHead": "0f2aa699f4642e550ab62c96fcd050e8d02345c9"
|
|
30
27
|
}
|
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 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":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Db } from \"@webiny/db\";\nimport type { Context } from \"@webiny/api/types.js\";\n\nexport interface DbContext extends Context {\n db: Db<unknown>;\n}\n"],"mappings":"","ignoreList":[]}
|