rads-db 0.1.72 → 0.1.73

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.
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ module.exports = void 0;
7
+ var _default = {
8
+ name: "softDelete",
9
+ beforeGet(args, ctx, context) {
10
+ if (!context.schema[context.typeName]?.fields?.isDeleted) return;
11
+ if (args.where.isDeleted || args.where.isDeleted_in) return;
12
+ args.where._and = [...(args.where._and || []), {
13
+ _not: {
14
+ isDeleted: true
15
+ }
16
+ }];
17
+ }
18
+ };
19
+ module.exports = _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: RadsFeature;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export default {
2
+ name: "softDelete",
3
+ beforeGet(args, ctx, context) {
4
+ if (!context.schema[context.typeName]?.fields?.isDeleted)
5
+ return;
6
+ if (args.where.isDeleted || args.where.isDeleted_in)
7
+ return;
8
+ args.where._and = [...args.where._and || [], { _not: { isDeleted: true } }];
9
+ }
10
+ };
package/package.json CHANGED
@@ -4,7 +4,8 @@
4
4
  "dist",
5
5
  "drivers",
6
6
  "fileUploadDrivers",
7
- "integrations"
7
+ "integrations",
8
+ "features"
8
9
  ],
9
10
  "bin": {
10
11
  "rads-db": "integrations/cli.cjs"
@@ -32,9 +33,14 @@
32
33
  "types": "./integrations/*.d.ts",
33
34
  "import": "./integrations/*.mjs",
34
35
  "require": "./integrations/*.cjs"
36
+ },
37
+ "./features/*": {
38
+ "types": "./features/*.d.ts",
39
+ "import": "./features/*.mjs",
40
+ "require": "./features/*.cjs"
35
41
  }
36
42
  },
37
- "version": "0.1.72",
43
+ "version": "0.1.73",
38
44
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
39
45
  "keywords": [],
40
46
  "author": "",