prisma-guard 1.21.1 → 1.22.1

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.
@@ -824,7 +824,7 @@ function createSchemaBuilder(typeMap, zodChains, enumMap, scalarBase, zodDefault
824
824
  var import_zod7 = require("zod");
825
825
 
826
826
  // src/shared/constants.ts
827
- var SHAPE_CONFIG_KEYS = /* @__PURE__ */ new Set([
827
+ var SHAPE_CONFIG_KEY_LIST = [
828
828
  "where",
829
829
  "include",
830
830
  "select",
@@ -840,13 +840,15 @@ var SHAPE_CONFIG_KEYS = /* @__PURE__ */ new Set([
840
840
  "_min",
841
841
  "_max",
842
842
  "by"
843
- ]);
844
- var GUARD_SHAPE_KEYS = /* @__PURE__ */ new Set([
843
+ ];
844
+ var SHAPE_CONFIG_KEYS = new Set(SHAPE_CONFIG_KEY_LIST);
845
+ var GUARD_SHAPE_KEY_LIST = [
845
846
  "data",
846
847
  "create",
847
848
  "update",
848
- ...SHAPE_CONFIG_KEYS
849
- ]);
849
+ ...SHAPE_CONFIG_KEY_LIST
850
+ ];
851
+ var GUARD_SHAPE_KEYS = new Set(GUARD_SHAPE_KEY_LIST);
850
852
  var COMBINATOR_KEYS = /* @__PURE__ */ new Set(["AND", "OR", "NOT"]);
851
853
  var TO_MANY_RELATION_OPS = /* @__PURE__ */ new Set(["some", "every", "none"]);
852
854
  var TO_ONE_RELATION_OPS = /* @__PURE__ */ new Set(["is", "isNot"]);
@@ -2484,67 +2486,51 @@ function createProjectionBuilder(typeMap, enumMap, deps) {
2484
2486
  return { buildIncludeSchema, buildSelectSchema, buildIncludeCountSchema };
2485
2487
  }
2486
2488
 
2487
- // src/runtime/query-builder.ts
2488
- var METHOD_ALLOWED_ARGS = {
2489
- findMany: /* @__PURE__ */ new Set([
2490
- "where",
2491
- "include",
2492
- "select",
2493
- "orderBy",
2494
- "cursor",
2495
- "take",
2496
- "skip",
2497
- "distinct"
2498
- ]),
2499
- findFirst: /* @__PURE__ */ new Set([
2500
- "where",
2501
- "include",
2502
- "select",
2503
- "orderBy",
2504
- "cursor",
2505
- "take",
2506
- "skip",
2507
- "distinct"
2508
- ]),
2509
- findFirstOrThrow: /* @__PURE__ */ new Set([
2510
- "where",
2511
- "include",
2512
- "select",
2513
- "orderBy",
2514
- "cursor",
2515
- "take",
2516
- "skip",
2517
- "distinct"
2518
- ]),
2519
- findUnique: /* @__PURE__ */ new Set(["where", "include", "select"]),
2520
- findUniqueOrThrow: /* @__PURE__ */ new Set(["where", "include", "select"]),
2521
- count: /* @__PURE__ */ new Set(["where", "select", "cursor", "orderBy", "skip", "take"]),
2522
- aggregate: /* @__PURE__ */ new Set([
2523
- "where",
2524
- "orderBy",
2525
- "cursor",
2526
- "take",
2527
- "skip",
2528
- "_count",
2529
- "_avg",
2530
- "_sum",
2531
- "_min",
2532
- "_max"
2533
- ]),
2534
- groupBy: /* @__PURE__ */ new Set([
2535
- "where",
2536
- "by",
2537
- "having",
2538
- "_count",
2539
- "_avg",
2540
- "_sum",
2541
- "_min",
2542
- "_max",
2543
- "orderBy",
2544
- "take",
2545
- "skip"
2546
- ])
2489
+ // src/shared/operation-shape-keys.ts
2490
+ var OPERATION_SHAPE_KEYS = {
2491
+ findMany: ["where", "include", "select", "orderBy", "cursor", "take", "skip", "distinct"],
2492
+ findFirst: ["where", "include", "select", "orderBy", "cursor", "take", "skip", "distinct"],
2493
+ findFirstOrThrow: ["where", "include", "select", "orderBy", "cursor", "take", "skip", "distinct"],
2494
+ findUnique: ["where", "include", "select"],
2495
+ findUniqueOrThrow: ["where", "include", "select"],
2496
+ findManyPaginated: ["where", "include", "select", "orderBy", "cursor", "take", "skip", "distinct"],
2497
+ count: ["where", "select", "cursor", "orderBy", "skip", "take"],
2498
+ aggregate: ["where", "orderBy", "cursor", "take", "skip", "_count", "_avg", "_sum", "_min", "_max"],
2499
+ groupBy: ["where", "by", "having", "_count", "_avg", "_sum", "_min", "_max", "orderBy", "take", "skip"],
2500
+ create: ["data", "select", "include"],
2501
+ createMany: ["data"],
2502
+ createManyAndReturn: ["data", "select", "include"],
2503
+ update: ["data", "where", "select", "include"],
2504
+ updateMany: ["data", "where"],
2505
+ updateManyAndReturn: ["data", "where", "select", "include"],
2506
+ upsert: ["where", "create", "update", "select", "include"],
2507
+ delete: ["where", "select", "include"],
2508
+ deleteMany: ["where"]
2509
+ };
2510
+ var READ_METHOD_ALLOWED_ARGS = {
2511
+ findMany: new Set(OPERATION_SHAPE_KEYS.findMany),
2512
+ findFirst: new Set(OPERATION_SHAPE_KEYS.findFirst),
2513
+ findFirstOrThrow: new Set(OPERATION_SHAPE_KEYS.findFirstOrThrow),
2514
+ findUnique: new Set(OPERATION_SHAPE_KEYS.findUnique),
2515
+ findUniqueOrThrow: new Set(OPERATION_SHAPE_KEYS.findUniqueOrThrow),
2516
+ count: new Set(OPERATION_SHAPE_KEYS.count),
2517
+ aggregate: new Set(OPERATION_SHAPE_KEYS.aggregate),
2518
+ groupBy: new Set(OPERATION_SHAPE_KEYS.groupBy)
2547
2519
  };
2520
+ var MUTATION_SHAPE_KEYS = {
2521
+ create: new Set(OPERATION_SHAPE_KEYS.create),
2522
+ createMany: new Set(OPERATION_SHAPE_KEYS.createMany),
2523
+ createManyAndReturn: new Set(OPERATION_SHAPE_KEYS.createManyAndReturn),
2524
+ update: new Set(OPERATION_SHAPE_KEYS.update),
2525
+ updateMany: new Set(OPERATION_SHAPE_KEYS.updateMany),
2526
+ updateManyAndReturn: new Set(OPERATION_SHAPE_KEYS.updateManyAndReturn),
2527
+ upsert: new Set(OPERATION_SHAPE_KEYS.upsert),
2528
+ delete: new Set(OPERATION_SHAPE_KEYS.delete),
2529
+ deleteMany: new Set(OPERATION_SHAPE_KEYS.deleteMany)
2530
+ };
2531
+
2532
+ // src/runtime/query-builder.ts
2533
+ var METHOD_ALLOWED_ARGS = READ_METHOD_ALLOWED_ARGS;
2548
2534
  var UNIQUE_WHERE_METHODS = /* @__PURE__ */ new Set([
2549
2535
  "findUnique",
2550
2536
  "findUniqueOrThrow"