@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 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
- return [new _api.ContextPlugin(context => {
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
- exports.default = _default;
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\n/**\n * TODO: remove this package.\n */\nexport default (args: any) => {\n return [\n new ContextPlugin<DbContext>(context => {\n if (context.db) {\n return;\n }\n context.db = new Db(args);\n })\n ];\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;AACA;AACA;eACgBA,IAAD,IAAe;EAC1B,OAAO,CACH,IAAIC,kBAAJ,CAA6BC,OAAO,IAAI;IACpC,IAAIA,OAAO,CAACC,EAAZ,EAAgB;MACZ;IACH;;IACDD,OAAO,CAACC,EAAR,GAAa,IAAIC,MAAJ,CAAOJ,IAAP,CAAb;EACH,CALD,CADG,CAAP;AAQH,C"}
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.40876133bb",
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
- "@babel/runtime": "7.19.0",
14
- "@webiny/api": "0.0.0-unstable.40876133bb",
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
- "@babel/cli": "^7.19.3",
19
- "@babel/core": "^7.19.3",
20
- "@babel/preset-env": "^7.19.4",
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": "yarn webiny run build",
32
- "watch": "yarn webiny run watch"
26
+ "build": "node ../cli/bin.js run build",
27
+ "watch": "node ../cli/bin.js run watch"
33
28
  },
34
- "gitHead": "f33811072795d25c5787ae39808e75e3312fb247"
29
+ "gitHead": "461c047ab7dd75a537e760dc6e917d21fedfaaae"
35
30
  }
package/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Db } from "@webiny/db";
2
- import { Context } from "@webiny/api/types";
1
+ import type { Db } from "@webiny/db";
2
+ import type { Context } from "@webiny/api/types";
3
3
  export interface DbContext extends Context {
4
- db: Db;
4
+ db: Db<unknown>;
5
5
  }
package/types.js CHANGED
@@ -2,4 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
5
+ });
6
+
7
+ //# sourceMappingURL=types.js.map
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;\n}\n"],"mappings":""}
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":[]}