@webiny/handler-db 0.0.0-mt-3 → 0.0.0-unstable.06b2ede40f

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,4 +1,5 @@
1
- import { ContextPlugin } from "@webiny/handler/plugins/ContextPlugin";
2
- import { DbContext } from "./types";
3
- declare const _default: (args: any) => ContextPlugin<DbContext>[];
1
+ import type { ConstructorArgs } from "@webiny/db";
2
+ import { ContextPlugin } from "@webiny/api";
3
+ import type { DbContext } from "./types";
4
+ declare const _default: <T = unknown>(args: ConstructorArgs<T>) => ContextPlugin<DbContext>[];
4
5
  export default _default;
package/index.js CHANGED
@@ -4,19 +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
- var _ContextPlugin = require("@webiny/handler/plugins/ContextPlugin");
11
-
8
+ var _api = require("@webiny/api");
12
9
  var _default = args => {
13
- return [new _ContextPlugin.ContextPlugin(context => {
10
+ const plugin = new _api.ContextPlugin(context => {
14
11
  if (context.db) {
15
12
  return;
16
13
  }
17
-
18
14
  context.db = new _db.Db(args);
19
- })];
15
+ });
16
+ plugin.name = "handler-db.context.db";
17
+ return [plugin];
20
18
  };
19
+ exports.default = _default;
21
20
 
22
- exports.default = _default;
21
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/handler-db",
3
- "version": "0.0.0-mt-3",
3
+ "version": "0.0.0-unstable.06b2ede40f",
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.15.4",
14
- "@webiny/db": "0.0.0-mt-3",
15
- "@webiny/handler": "0.0.0-mt-3"
13
+ "@webiny/api": "0.0.0-unstable.06b2ede40f",
14
+ "@webiny/db": "0.0.0-unstable.06b2ede40f"
16
15
  },
17
16
  "devDependencies": {
18
- "@babel/cli": "^7.5.5",
19
- "@babel/core": "^7.5.5",
20
- "@babel/preset-env": "^7.5.5",
21
- "@webiny/cli": "^0.0.0-mt-3",
22
- "@webiny/project-utils": "^0.0.0-mt-3",
23
- "rimraf": "^3.0.2",
24
- "typescript": "^4.1.3"
17
+ "@webiny/project-utils": "0.0.0-unstable.06b2ede40f",
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": "ebea815be2be99404591cba465cc1fe88355bd48"
29
+ "gitHead": "06b2ede40fc2212a70eeafd74afd50b56fb0ce82"
35
30
  }
package/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Db } from "@webiny/db";
2
- export declare type DbContext = {
3
- db: Db;
4
- };
1
+ import type { Db } from "@webiny/db";
2
+ import type { Context } from "@webiny/api/types";
3
+ export interface DbContext extends Context {
4
+ db: Db<unknown>;
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 ADDED
@@ -0,0 +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":[]}