@cerbos/orm-prisma 3.3.0 → 4.0.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.
Files changed (44) hide show
  1. package/README.md +83 -6
  2. package/lib/index.d.ts +29 -2
  3. package/lib/index.d.ts.map +1 -1
  4. package/lib/index.js +1459 -114
  5. package/lib/index.js.map +1 -1
  6. package/package.json +19 -13
  7. package/src/adversarial.test.ts +586 -0
  8. package/src/generated/prisma/commonInputTypes.ts +26 -0
  9. package/src/generated/prisma/internal/class.ts +9 -9
  10. package/src/generated/prisma/internal/prismaNamespace.ts +89 -19
  11. package/src/generated/prisma/internal/prismaNamespaceBrowser.ts +2 -1
  12. package/src/generated/prisma/models/Category.ts +1 -1
  13. package/src/generated/prisma/models/Label.ts +1 -1
  14. package/src/generated/prisma/models/NestedResource.ts +1 -1
  15. package/src/generated/prisma/models/NextLevelNestedResource.ts +1 -1
  16. package/src/generated/prisma/models/Resource.ts +62 -2
  17. package/src/generated/prisma/models/SubCategory.ts +1 -1
  18. package/src/generated/prisma/models/Tag.ts +1 -1
  19. package/src/generated/prisma/models/User.ts +1 -1
  20. package/src/generated/prisma-adversarial/browser.ts +44 -0
  21. package/src/generated/prisma-adversarial/client.ts +66 -0
  22. package/src/generated/prisma-adversarial/commonInputTypes.ts +352 -0
  23. package/src/generated/prisma-adversarial/enums.ts +15 -0
  24. package/src/generated/prisma-adversarial/internal/class.ts +244 -0
  25. package/src/generated/prisma-adversarial/internal/prismaNamespace.ts +1156 -0
  26. package/src/generated/prisma-adversarial/internal/prismaNamespaceBrowser.ts +140 -0
  27. package/src/generated/prisma-adversarial/models/AdversarialCategory.ts +1401 -0
  28. package/src/generated/prisma-adversarial/models/AdversarialLabel.ts +1272 -0
  29. package/src/generated/prisma-adversarial/models/AdversarialResource.ts +1665 -0
  30. package/src/generated/prisma-adversarial/models/AdversarialSubCategory.ts +1401 -0
  31. package/src/generated/prisma-adversarial/models/AdversarialTag.ts +1307 -0
  32. package/src/generated/prisma-adversarial/models.ts +16 -0
  33. package/src/generated/prisma-adversarial-v6/client.d.ts +1 -0
  34. package/src/generated/prisma-adversarial-v6/default.d.ts +1 -0
  35. package/src/generated/prisma-adversarial-v6/edge.d.ts +1 -0
  36. package/src/generated/prisma-adversarial-v6/index.d.ts +8640 -0
  37. package/src/generated/prisma-adversarial-v6/runtime/index-browser.d.ts +370 -0
  38. package/src/generated/prisma-adversarial-v6/runtime/library.d.ts +3982 -0
  39. package/src/generated/prisma-adversarial-v6/wasm.d.ts +1 -0
  40. package/src/generated/prisma-v6/index.d.ts +90 -3
  41. package/src/index.test.ts +3199 -636
  42. package/src/index.ts +2055 -148
  43. package/src/test-setup.adversarial.v6.ts +5 -0
  44. package/src/test-setup.adversarial.v7.ts +12 -0
@@ -0,0 +1,140 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ // @ts-nocheck
6
+ /*
7
+ * WARNING: This is an internal file that is subject to change!
8
+ *
9
+ * 🛑 Under no circumstances should you import this file directly! 🛑
10
+ *
11
+ * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file.
12
+ * While this enables partial backward compatibility, it is not part of the stable public API.
13
+ *
14
+ * If you are looking for your Models, Enums, and Input Types, please import them from the respective
15
+ * model files in the `model` directory!
16
+ */
17
+
18
+ import * as runtime from "@prisma/client/runtime/index-browser"
19
+
20
+ export type * from '../models.js'
21
+ export type * from './prismaNamespace.js'
22
+
23
+ export const Decimal = runtime.Decimal
24
+
25
+
26
+ export const NullTypes = {
27
+ DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
28
+ JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
29
+ AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
30
+ }
31
+ /**
32
+ * Helper for filtering JSON entries that have `null` on the database (empty on the db)
33
+ *
34
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
35
+ */
36
+ export const DbNull = runtime.DbNull
37
+
38
+ /**
39
+ * Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
40
+ *
41
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
42
+ */
43
+ export const JsonNull = runtime.JsonNull
44
+
45
+ /**
46
+ * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
47
+ *
48
+ * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
49
+ */
50
+ export const AnyNull = runtime.AnyNull
51
+
52
+
53
+ export const ModelName = {
54
+ AdversarialResource: 'AdversarialResource',
55
+ AdversarialTag: 'AdversarialTag',
56
+ AdversarialCategory: 'AdversarialCategory',
57
+ AdversarialSubCategory: 'AdversarialSubCategory',
58
+ AdversarialLabel: 'AdversarialLabel'
59
+ } as const
60
+
61
+ export type ModelName = (typeof ModelName)[keyof typeof ModelName]
62
+
63
+ /*
64
+ * Enums
65
+ */
66
+
67
+ export const TransactionIsolationLevel = runtime.makeStrictEnum({
68
+ Serializable: 'Serializable'
69
+ } as const)
70
+
71
+ export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
72
+
73
+
74
+ export const AdversarialResourceScalarFieldEnum = {
75
+ id: 'id',
76
+ aBool: 'aBool',
77
+ aString: 'aString',
78
+ aNumber: 'aNumber',
79
+ aDouble: 'aDouble',
80
+ aOptionalString: 'aOptionalString',
81
+ createdBy: 'createdBy',
82
+ scope: 'scope',
83
+ createdAt: 'createdAt'
84
+ } as const
85
+
86
+ export type AdversarialResourceScalarFieldEnum = (typeof AdversarialResourceScalarFieldEnum)[keyof typeof AdversarialResourceScalarFieldEnum]
87
+
88
+
89
+ export const AdversarialTagScalarFieldEnum = {
90
+ id: 'id',
91
+ tagId: 'tagId',
92
+ name: 'name',
93
+ resourceId: 'resourceId'
94
+ } as const
95
+
96
+ export type AdversarialTagScalarFieldEnum = (typeof AdversarialTagScalarFieldEnum)[keyof typeof AdversarialTagScalarFieldEnum]
97
+
98
+
99
+ export const AdversarialCategoryScalarFieldEnum = {
100
+ id: 'id',
101
+ name: 'name',
102
+ resourceId: 'resourceId'
103
+ } as const
104
+
105
+ export type AdversarialCategoryScalarFieldEnum = (typeof AdversarialCategoryScalarFieldEnum)[keyof typeof AdversarialCategoryScalarFieldEnum]
106
+
107
+
108
+ export const AdversarialSubCategoryScalarFieldEnum = {
109
+ id: 'id',
110
+ name: 'name',
111
+ categoryId: 'categoryId'
112
+ } as const
113
+
114
+ export type AdversarialSubCategoryScalarFieldEnum = (typeof AdversarialSubCategoryScalarFieldEnum)[keyof typeof AdversarialSubCategoryScalarFieldEnum]
115
+
116
+
117
+ export const AdversarialLabelScalarFieldEnum = {
118
+ id: 'id',
119
+ name: 'name',
120
+ subCategoryId: 'subCategoryId'
121
+ } as const
122
+
123
+ export type AdversarialLabelScalarFieldEnum = (typeof AdversarialLabelScalarFieldEnum)[keyof typeof AdversarialLabelScalarFieldEnum]
124
+
125
+
126
+ export const SortOrder = {
127
+ asc: 'asc',
128
+ desc: 'desc'
129
+ } as const
130
+
131
+ export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
132
+
133
+
134
+ export const NullsOrder = {
135
+ first: 'first',
136
+ last: 'last'
137
+ } as const
138
+
139
+ export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
140
+