@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 CHANGED
@@ -1,20 +1,11 @@
1
- # @webiny/handler-db-nedb
1
+ # @webiny/handler-db
2
2
 
3
- This Webiny API plugin provides a db driver for Nedb. It sets an instance of the Nedb driver to `context.db.driver`.
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
- ## How to use
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
- ```yaml
9
- myService:
10
- component: "@webiny/serverless-apollo-service"
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
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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 _db.Db(args);
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":["_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":[]}
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-alpha.5",
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-alpha.5",
14
- "@webiny/db": "6.0.0-alpha.5"
14
+ "@webiny/api": "6.0.0-rc.0",
15
+ "@webiny/db": "6.0.0-rc.0"
15
16
  },
16
17
  "devDependencies": {
17
- "@webiny/project-utils": "6.0.0-alpha.5",
18
- "rimraf": "6.0.1",
19
- "typescript": "5.3.3"
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
- "scripts": {
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
@@ -1,5 +1,5 @@
1
1
  import type { Db } from "@webiny/db";
2
- import type { Context } from "@webiny/api/types";
2
+ import type { Context } from "@webiny/api/types.js";
3
3
  export interface DbContext extends Context {
4
4
  db: Db<unknown>;
5
5
  }
package/types.js CHANGED
@@ -1,7 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
6
2
 
7
3
  //# sourceMappingURL=types.js.map
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":[]}