@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 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>) => ContextPlugin<DbContext>[];
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 { ContextPlugin } from "@webiny/api";
2
+ import { createRegisterExtensionPlugin } from "@webiny/handler";
3
3
  export default args => {
4
- const plugin = new ContextPlugin(context => {
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.context.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","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":[]}
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.1.0-beta.3",
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/api": "6.1.0-beta.3",
15
- "@webiny/db": "6.1.0-beta.3"
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.1.0-beta.3",
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": "65e0ac1889b3392c99b8cac6cde508e1e831c715"
26
+ "gitHead": "3d3148358b6febbc857371930871743bec3b3939"
27
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.js";
2
+ import type { Context } from "@webiny/handler/types.js";
3
3
  export interface DbContext extends Context {
4
4
  db: Db<unknown>;
5
5
  }
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.js\";\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/handler/types.js\";\n\nexport interface DbContext extends Context {\n db: Db<unknown>;\n}\n"],"mappings":"","ignoreList":[]}