@prisma/orm-mongo 0.16.0-dev.36

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 (184) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +54 -0
  3. package/dist/adapter.d.mts +1 -0
  4. package/dist/adapter.mjs +2 -0
  5. package/dist/adapter__codec-ids.d.mts +1 -0
  6. package/dist/adapter__codec-ids.mjs +2 -0
  7. package/dist/adapter__codec-types.d.mts +1 -0
  8. package/dist/adapter__codec-types.mjs +2 -0
  9. package/dist/adapter__codecs.d.mts +1 -0
  10. package/dist/adapter__codecs.mjs +2 -0
  11. package/dist/adapter__control.d.mts +3 -0
  12. package/dist/adapter__control.mjs +3 -0
  13. package/dist/adapter__runtime.d.mts +3 -0
  14. package/dist/adapter__runtime.mjs +3 -0
  15. package/dist/bin__prisma-next.mjs +3 -0
  16. package/dist/bson.d.mts +2 -0
  17. package/dist/bson.mjs +2 -0
  18. package/dist/components.d.mts +1 -0
  19. package/dist/components.mjs +2 -0
  20. package/dist/components__authoring.d.mts +1 -0
  21. package/dist/components__authoring.mjs +2 -0
  22. package/dist/components__codec.d.mts +1 -0
  23. package/dist/components__codec.mjs +2 -0
  24. package/dist/components__components.d.mts +1 -0
  25. package/dist/components__components.mjs +2 -0
  26. package/dist/components__control.d.mts +1 -0
  27. package/dist/components__control.mjs +2 -0
  28. package/dist/components__emission.d.mts +1 -0
  29. package/dist/components__emission.mjs +2 -0
  30. package/dist/components__execution.d.mts +1 -0
  31. package/dist/components__execution.mjs +2 -0
  32. package/dist/components__ir.d.mts +1 -0
  33. package/dist/components__ir.mjs +2 -0
  34. package/dist/components__psl-ast.d.mts +1 -0
  35. package/dist/components__psl-ast.mjs +2 -0
  36. package/dist/components__runtime.d.mts +1 -0
  37. package/dist/components__runtime.mjs +2 -0
  38. package/dist/components__utils.d.mts +1 -0
  39. package/dist/components__utils.mjs +2 -0
  40. package/dist/config.d.mts +19 -0
  41. package/dist/config.d.mts.map +1 -0
  42. package/dist/config.mjs +40 -0
  43. package/dist/config.mjs.map +1 -0
  44. package/dist/contract-builder.d.mts +122 -0
  45. package/dist/contract-builder.d.mts.map +1 -0
  46. package/dist/contract-builder.mjs +22 -0
  47. package/dist/contract-builder.mjs.map +1 -0
  48. package/dist/contract.d.mts +1 -0
  49. package/dist/contract.mjs +2 -0
  50. package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -0
  51. package/dist/contract__apply-specifier-default-control-policy.mjs +2 -0
  52. package/dist/contract__contract-validation-error.d.mts +1 -0
  53. package/dist/contract__contract-validation-error.mjs +2 -0
  54. package/dist/contract__default-namespace.d.mts +1 -0
  55. package/dist/contract__default-namespace.mjs +2 -0
  56. package/dist/contract__enum-accessor.d.mts +1 -0
  57. package/dist/contract__enum-accessor.mjs +2 -0
  58. package/dist/contract__hashing-utils.d.mts +1 -0
  59. package/dist/contract__hashing-utils.mjs +2 -0
  60. package/dist/contract__hashing.d.mts +1 -0
  61. package/dist/contract__hashing.mjs +2 -0
  62. package/dist/contract__is-plain-record.d.mts +1 -0
  63. package/dist/contract__is-plain-record.mjs +2 -0
  64. package/dist/contract__resolve-domain-model.d.mts +1 -0
  65. package/dist/contract__resolve-domain-model.mjs +2 -0
  66. package/dist/contract__types.d.mts +1 -0
  67. package/dist/contract__types.mjs +2 -0
  68. package/dist/contract__validate-domain.d.mts +1 -0
  69. package/dist/contract__validate-domain.mjs +2 -0
  70. package/dist/control.d.mts +11 -0
  71. package/dist/control.d.mts.map +1 -0
  72. package/dist/control.mjs +21 -0
  73. package/dist/control.mjs.map +1 -0
  74. package/dist/driver.d.mts +1 -0
  75. package/dist/driver.mjs +2 -0
  76. package/dist/driver__control.d.mts +3 -0
  77. package/dist/driver__control.mjs +3 -0
  78. package/dist/family-contract.d.mts +1 -0
  79. package/dist/family-contract.mjs +2 -0
  80. package/dist/family-contract__canonicalization-hooks.d.mts +1 -0
  81. package/dist/family-contract__canonicalization-hooks.mjs +2 -0
  82. package/dist/family-contract__entity-kinds.d.mts +1 -0
  83. package/dist/family-contract__entity-kinds.mjs +2 -0
  84. package/dist/family-runtime.d.mts +1 -0
  85. package/dist/family-runtime.mjs +2 -0
  86. package/dist/family.d.mts +2 -0
  87. package/dist/family.mjs +2 -0
  88. package/dist/family__control-adapter.d.mts +1 -0
  89. package/dist/family__control-adapter.mjs +2 -0
  90. package/dist/family__control.d.mts +1 -0
  91. package/dist/family__control.mjs +2 -0
  92. package/dist/family__ir.d.mts +1 -0
  93. package/dist/family__ir.mjs +2 -0
  94. package/dist/family__migration.d.mts +1 -0
  95. package/dist/family__migration.mjs +2 -0
  96. package/dist/family__pack.d.mts +3 -0
  97. package/dist/family__pack.mjs +3 -0
  98. package/dist/family__runtime.d.mts +1 -0
  99. package/dist/family__runtime.mjs +2 -0
  100. package/dist/family__schema-verify.d.mts +1 -0
  101. package/dist/family__schema-verify.mjs +2 -0
  102. package/dist/migration-tools__aggregate.d.mts +1 -0
  103. package/dist/migration-tools__aggregate.mjs +2 -0
  104. package/dist/migration-tools__contract-snapshot-store.d.mts +1 -0
  105. package/dist/migration-tools__contract-snapshot-store.mjs +2 -0
  106. package/dist/migration-tools__hash.d.mts +1 -0
  107. package/dist/migration-tools__hash.mjs +2 -0
  108. package/dist/migration-tools__io.d.mts +1 -0
  109. package/dist/migration-tools__io.mjs +2 -0
  110. package/dist/migration-tools__spaces.d.mts +1 -0
  111. package/dist/migration-tools__spaces.mjs +2 -0
  112. package/dist/mongo-static-BdSGXYgQ-DSA-2DiK.d.mts +22 -0
  113. package/dist/mongo-static-BdSGXYgQ-DSA-2DiK.d.mts.map +1 -0
  114. package/dist/mongo-static-_wy-fC4P-mXlhePy0.mjs +38 -0
  115. package/dist/mongo-static-_wy-fC4P-mXlhePy0.mjs.map +1 -0
  116. package/dist/orm.d.mts +1 -0
  117. package/dist/orm.mjs +2 -0
  118. package/dist/query-ast.d.mts +1 -0
  119. package/dist/query-ast.mjs +2 -0
  120. package/dist/query-ast__control.d.mts +1 -0
  121. package/dist/query-ast__control.mjs +2 -0
  122. package/dist/query-ast__execution.d.mts +1 -0
  123. package/dist/query-ast__execution.mjs +2 -0
  124. package/dist/query-builder.d.mts +1 -0
  125. package/dist/query-builder.mjs +2 -0
  126. package/dist/query-builder__contract-free.d.mts +1 -0
  127. package/dist/query-builder__contract-free.mjs +2 -0
  128. package/dist/runtime.d.mts +105 -0
  129. package/dist/runtime.d.mts.map +1 -0
  130. package/dist/runtime.mjs +173 -0
  131. package/dist/runtime.mjs.map +1 -0
  132. package/dist/static.d.mts +2 -0
  133. package/dist/static.mjs +2 -0
  134. package/dist/target.d.mts +2 -0
  135. package/dist/target.mjs +2 -0
  136. package/dist/target__codec-types.d.mts +1 -0
  137. package/dist/target__codec-types.mjs +2 -0
  138. package/dist/target__control.d.mts +1 -0
  139. package/dist/target__control.mjs +2 -0
  140. package/dist/target__migration.d.mts +1 -0
  141. package/dist/target__migration.mjs +2 -0
  142. package/dist/target__pack.d.mts +3 -0
  143. package/dist/target__pack.mjs +3 -0
  144. package/dist/target__runtime.d.mts +3 -0
  145. package/dist/target__runtime.mjs +3 -0
  146. package/dist/utils.d.mts +1 -0
  147. package/dist/utils.mjs +2 -0
  148. package/dist/utils__abortable.d.mts +1 -0
  149. package/dist/utils__abortable.mjs +2 -0
  150. package/dist/utils__array-equal.d.mts +1 -0
  151. package/dist/utils__array-equal.mjs +2 -0
  152. package/dist/utils__assertions.d.mts +1 -0
  153. package/dist/utils__assertions.mjs +2 -0
  154. package/dist/utils__canonical-stringify.d.mts +1 -0
  155. package/dist/utils__canonical-stringify.mjs +2 -0
  156. package/dist/utils__casts.d.mts +1 -0
  157. package/dist/utils__casts.mjs +2 -0
  158. package/dist/utils__defined.d.mts +1 -0
  159. package/dist/utils__defined.mjs +2 -0
  160. package/dist/utils__hash-content.d.mts +1 -0
  161. package/dist/utils__hash-content.mjs +2 -0
  162. package/dist/utils__internal-error.d.mts +1 -0
  163. package/dist/utils__internal-error.mjs +2 -0
  164. package/dist/utils__json.d.mts +1 -0
  165. package/dist/utils__json.mjs +2 -0
  166. package/dist/utils__promise.d.mts +1 -0
  167. package/dist/utils__promise.mjs +2 -0
  168. package/dist/utils__redact-db-url.d.mts +1 -0
  169. package/dist/utils__redact-db-url.mjs +2 -0
  170. package/dist/utils__result.d.mts +1 -0
  171. package/dist/utils__result.mjs +2 -0
  172. package/dist/utils__simplify-deep.d.mts +1 -0
  173. package/dist/utils__simplify-deep.mjs +2 -0
  174. package/dist/utils__structured-error.d.mts +1 -0
  175. package/dist/utils__structured-error.mjs +2 -0
  176. package/dist/utils__types.d.mts +1 -0
  177. package/dist/utils__types.mjs +2 -0
  178. package/dist/value.d.mts +1 -0
  179. package/dist/value.mjs +2 -0
  180. package/dist/value__mongodb-types.d.mts +1 -0
  181. package/dist/value__mongodb-types.mjs +2 -0
  182. package/dist/vite-plugin-contract-emit.d.mts +1 -0
  183. package/dist/vite-plugin-contract-emit.mjs +2 -0
  184. package/package.json +135 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [2026] [Prisma Data, Inc]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @prisma/orm-mongo
2
+
3
+ The one package a MongoDB application installs. It wires the framework, the Mongo family, and the Mongo target into a single lazy client, and brings the rest of the stack along as exact-pinned dependencies:
4
+
5
+ ```jsonc
6
+ // package.json
7
+ { "dependencies": { "@prisma/orm-mongo": "0.16.0", "mongodb": "^7.0.0" } }
8
+ ```
9
+
10
+ ```
11
+ @prisma/orm-mongo
12
+ ├── @prisma/orm-framework contracts, components, runtime core
13
+ ├── @prisma/orm-family-mongo Mongo contract, query builders, runtime
14
+ ├── @prisma/orm-target-mongo target descriptor + adapter + driver
15
+ └── @prisma/orm-toolchain CLI (installs the `prisma-next` command), emitter, config loader
16
+ ```
17
+
18
+ `mongodb` is a peer dependency: the driver is the application's, so a single connection pool and a single BSON implementation serve both Prisma Next and any direct `mongodb` use in the same process.
19
+
20
+ ## Entrypoints
21
+
22
+ | Namespace | Surface |
23
+ | --- | --- |
24
+ | `/runtime` | `mongo(url)` — the lazy query client |
25
+ | `/static` | statically composed runtime for pre-wired deployments |
26
+ | `/config` | `defineConfig` for `prisma-next.config.ts` |
27
+ | `/contract-builder` | `defineContract` and Mongo contract authoring |
28
+ | `/bson` | BSON value helpers (`ObjectId`, `Decimal128`, …) |
29
+ | `/target`, `/family` | the Mongo target pack and the Mongo family pack |
30
+ | `/control` | the control client |
31
+
32
+ Generated contract files import their types from the facade, so an application never has to depend on a package it did not install:
33
+
34
+ | Namespace | Forwards |
35
+ | --- | --- |
36
+ | `/contract`, `/contract/*` | `@prisma/orm-framework/contract` |
37
+ | `/components`, `/components/*` | `@prisma/orm-framework/components` |
38
+ | `/family-contract`, `/family-contract/*` | `@prisma/orm-family-mongo/contract` |
39
+ | `/target/*` | `@prisma/orm-target-mongo/target` |
40
+ | `/adapter`, `/adapter/*` | `@prisma/orm-target-mongo/adapter` |
41
+
42
+ These forward; they do not copy. `@prisma/orm-mongo/contract/types` and `@prisma/orm-framework/contract/types` are the same module, so shared registries and `instanceof` checks hold across the boundary.
43
+
44
+ ## The `prisma-next` command
45
+
46
+ Installing this package puts `prisma-next` on the project's `PATH`. It runs the toolchain's single published copy of the CLI — the facade carries a launcher, not a second copy of the program.
47
+
48
+ ## Responsibilities
49
+
50
+ Composition only. Every behavior it exposes lives in the platform packages; this package chooses the default combination of them and gives it one name.
51
+
52
+ ## Dependencies
53
+
54
+ `@prisma/orm-framework`, `@prisma/orm-family-mongo`, `@prisma/orm-target-mongo`, and `@prisma/orm-toolchain` at exact lockstep versions, plus `pathe`. `mongodb` is a peer dependency.
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-target-mongo/adapter";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-target-mongo/adapter";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-target-mongo/adapter/codec-ids";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-target-mongo/adapter/codec-ids";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-target-mongo/adapter/codec-types";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-target-mongo/adapter/codec-types";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-target-mongo/adapter/codecs";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-target-mongo/adapter/codecs";
2
+ export {};
@@ -0,0 +1,3 @@
1
+ import control_default from "@prisma/orm-target-mongo/adapter/control";
2
+ export * from "@prisma/orm-target-mongo/adapter/control";
3
+ export { control_default as default };
@@ -0,0 +1,3 @@
1
+ import control_default from "@prisma/orm-target-mongo/adapter/control";
2
+ export * from "@prisma/orm-target-mongo/adapter/control";
3
+ export { control_default as default };
@@ -0,0 +1,3 @@
1
+ import runtime_default from "@prisma/orm-target-mongo/adapter/runtime";
2
+ export * from "@prisma/orm-target-mongo/adapter/runtime";
3
+ export { runtime_default as default };
@@ -0,0 +1,3 @@
1
+ import runtime_default from "@prisma/orm-target-mongo/adapter/runtime";
2
+ export * from "@prisma/orm-target-mongo/adapter/runtime";
3
+ export { runtime_default as default };
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import "@prisma/orm-toolchain/bin/prisma-next";
3
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Binary, Decimal128, Long, MongoClient, ObjectId, Timestamp } from "mongodb";
2
+ export { Binary, Decimal128, Long, MongoClient, ObjectId, Timestamp };
package/dist/bson.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { Binary, Decimal128, Long, MongoClient, ObjectId, Timestamp } from "mongodb";
2
+ export { Binary, Decimal128, Long, MongoClient, ObjectId, Timestamp };
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/authoring";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/authoring";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/codec";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/codec";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/components";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/components";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/control";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/control";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/emission";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/emission";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/execution";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/execution";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/ir";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/ir";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/psl-ast";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/psl-ast";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/runtime";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/runtime";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@prisma/orm-framework/components/utils";
@@ -0,0 +1,2 @@
1
+ export * from "@prisma/orm-framework/components/utils";
2
+ export {};
@@ -0,0 +1,19 @@
1
+ import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
2
+ import { ControlExtensionDescriptor } from "@prisma/orm-framework/components/control";
3
+ //#region ../../../3-extensions/mongo/dist/config.d.mts
4
+ //#region src/config/define-config.d.ts
5
+ interface MongoConfigOptions {
6
+ readonly contract: string;
7
+ readonly output?: string;
8
+ readonly db?: {
9
+ readonly connection?: string;
10
+ };
11
+ readonly extensions?: readonly ControlExtensionDescriptor<'mongo', 'mongo'>[];
12
+ readonly migrations?: {
13
+ readonly dir?: string;
14
+ };
15
+ }
16
+ declare function defineConfig(options: MongoConfigOptions): PrismaNextConfig<'mongo', 'mongo'>;
17
+ //#endregion
18
+ export { type MongoConfigOptions, defineConfig };
19
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../../../../3-extensions/mongo/dist/config.d.mts"],"mappings":";;;;UAGU;WACC;WACA;WACA;aACE;;WAEF,sBAAsB;WACtB;aACE;;;iBAGI,aAAa,SAAS,qBAAqB"}
@@ -0,0 +1,40 @@
1
+ import { MONGO_INT32_CODEC_ID, MONGO_STRING_CODEC_ID } from "@prisma/orm-target-mongo/adapter/codec-ids";
2
+ import mongoAdapter from "@prisma/orm-target-mongo/adapter/control";
3
+ import { defineConfig as defineConfig$1 } from "@prisma/orm-framework/config/config-types";
4
+ import mongoDriver from "@prisma/orm-target-mongo/driver/control";
5
+ import { mongoFamilyDescriptor } from "@prisma/orm-family-mongo/family/control";
6
+ import { mongoContract } from "@prisma/orm-family-mongo/contract-psl/provider";
7
+ import { typescriptContractFromPath } from "@prisma/orm-family-mongo/contract-ts/config-types";
8
+ import { mongoTargetDescriptor } from "@prisma/orm-target-mongo/target/control";
9
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
10
+ import { extname, join } from "pathe";
11
+ //#region ../../../3-extensions/mongo/dist/config.mjs
12
+ function deriveOutputPath(contractPath) {
13
+ const ext = extname(contractPath);
14
+ if (ext.length === 0) return `${contractPath}.json`;
15
+ return `${contractPath.slice(0, -ext.length)}.json`;
16
+ }
17
+ function defineConfig(options) {
18
+ const extensions = options.extensions ?? [];
19
+ const output = options.output !== void 0 ? join(options.output, "contract.json") : deriveOutputPath(options.contract);
20
+ return defineConfig$1({
21
+ family: mongoFamilyDescriptor,
22
+ target: mongoTargetDescriptor,
23
+ adapter: mongoAdapter,
24
+ driver: mongoDriver,
25
+ extensions,
26
+ contract: extname(options.contract) === ".ts" ? typescriptContractFromPath(options.contract, output) : mongoContract(options.contract, {
27
+ output,
28
+ enumInferenceCodecs: {
29
+ text: MONGO_STRING_CODEC_ID,
30
+ int: MONGO_INT32_CODEC_ID
31
+ }
32
+ }),
33
+ ...ifDefined("db", options.db),
34
+ ...ifDefined("migrations", options.migrations)
35
+ });
36
+ }
37
+ //#endregion
38
+ export { defineConfig };
39
+
40
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../../../3-extensions/mongo/dist/config.mjs"],"sourcesContent":["import { MONGO_INT32_CODEC_ID, MONGO_STRING_CODEC_ID } from \"@internal/adapter-mongo/codec-ids\";\nimport mongoAdapter from \"@internal/adapter-mongo/control\";\nimport { defineConfig as defineConfig$1 } from \"@internal/config/config-types\";\nimport mongoDriver from \"@internal/driver-mongo/control\";\nimport { mongoFamilyDescriptor } from \"@internal/family-mongo/control\";\nimport { mongoContract } from \"@internal/mongo-contract-psl/provider\";\nimport { typescriptContractFromPath } from \"@internal/mongo-contract-ts/config-types\";\nimport { mongoTargetDescriptor } from \"@internal/target-mongo/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { extname, join } from \"pathe\";\n//#region src/config/define-config.ts\nfunction deriveOutputPath(contractPath) {\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction defineConfig(options) {\n\tconst extensions = options.extensions ?? [];\n\tconst output = options.output !== void 0 ? join(options.output, \"contract.json\") : deriveOutputPath(options.contract);\n\treturn defineConfig$1({\n\t\tfamily: mongoFamilyDescriptor,\n\t\ttarget: mongoTargetDescriptor,\n\t\tadapter: mongoAdapter,\n\t\tdriver: mongoDriver,\n\t\textensions,\n\t\tcontract: extname(options.contract) === \".ts\" ? typescriptContractFromPath(options.contract, output) : mongoContract(options.contract, {\n\t\t\toutput,\n\t\t\tenumInferenceCodecs: {\n\t\t\t\ttext: MONGO_STRING_CODEC_ID,\n\t\t\t\tint: MONGO_INT32_CODEC_ID\n\t\t\t}\n\t\t}),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"migrations\", options.migrations)\n\t});\n}\n//#endregion\nexport { defineConfig };\n\n//# sourceMappingURL=config.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,iBAAiB,cAAc;CACvC,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,aAAa;CAC7C,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,MAAM,EAAE;AAC9C;AACA,SAAS,aAAa,SAAS;CAC9B,MAAM,aAAa,QAAQ,cAAc,CAAC;CAC1C,MAAM,SAAS,QAAQ,WAAW,KAAK,IAAI,KAAK,QAAQ,QAAQ,eAAe,IAAI,iBAAiB,QAAQ,QAAQ;CACpH,OAAO,eAAe;EACrB,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR;EACA,UAAU,QAAQ,QAAQ,QAAQ,MAAM,QAAQ,2BAA2B,QAAQ,UAAU,MAAM,IAAI,cAAc,QAAQ,UAAU;GACtI;GACA,qBAAqB;IACpB,MAAM;IACN,KAAK;GACN;EACD,CAAC;EACD,GAAG,UAAU,MAAM,QAAQ,EAAE;EAC7B,GAAG,UAAU,cAAc,QAAQ,UAAU;CAC9C,CAAC;AACF"}
@@ -0,0 +1,122 @@
1
+ import { ContractDefinition, ContractDefinition as ContractDefinition$1, ContractFactory, ContractFactory as ContractFactory$1, ContractScaffold, ContractScaffold as ContractScaffold$1, EnumMember, EnumTypeHandle, FieldBuilder, FieldReference, ModelBuilder, MongoContractResult, MongoContractResult as MongoContractResult$1, RelationBuilder, ValueObjectBuilder, field, index, member, model, rel, valueObject } from "@prisma/orm-family-mongo/contract-ts/contract-builder";
2
+ import mongoFamilyPack from "@prisma/orm-family-mongo/family/pack";
3
+ import mongoTargetPack from "@prisma/orm-target-mongo/target/pack";
4
+ import "@prisma/orm-framework/components/authoring";
5
+ import { ColumnTypeDescriptor } from "@prisma/orm-framework/components/codec";
6
+ //#region ../../../3-extensions/mongo/dist/contract-builder.d.mts
7
+ //#region src/contract/define-contract.d.ts
8
+ type MongoFamilyPack = typeof mongoFamilyPack;
9
+ type MongoTargetPack = typeof mongoTargetPack;
10
+ type MongoHelpers = Parameters<ContractFactory$1<Record<never, never>, Record<never, never>, undefined, MongoFamilyPack, MongoTargetPack, undefined>>[0];
11
+ type MongoDefinitionInput = Omit<ContractDefinition$1<MongoFamilyPack, MongoTargetPack>, 'family' | 'target'> & {
12
+ readonly family?: never;
13
+ readonly target?: never;
14
+ };
15
+ type MongoScaffoldInput = Omit<ContractScaffold$1<MongoFamilyPack, MongoTargetPack>, 'family' | 'target'> & {
16
+ readonly family?: never;
17
+ readonly target?: never;
18
+ };
19
+ declare function defineContract<const Definition extends MongoDefinitionInput>(definition: Definition): MongoContractResult$1<Definition & {
20
+ readonly family: MongoFamilyPack;
21
+ readonly target: MongoTargetPack;
22
+ }>;
23
+ declare function defineContract<const Definition extends MongoScaffoldInput, const Built extends {
24
+ readonly models?: Record<string, unknown>;
25
+ readonly valueObjects?: Record<string, unknown>;
26
+ readonly roots?: Record<string, string>;
27
+ }>(scaffold: Definition, factory: (helpers: MongoHelpers) => Built): MongoContractResult$1<Definition & Built & {
28
+ readonly family: MongoFamilyPack;
29
+ readonly target: MongoTargetPack;
30
+ }>;
31
+ //#endregion
32
+ //#region ../../1-framework/2-authoring/contract/dist/index.d.mts
33
+ //#endregion
34
+ //#region src/enum-type.d.ts
35
+ /**
36
+ * A single enum member produced by `member()`. The `Name` and `Value` generics
37
+ * are preserved as literal types so `enumType()` can carry the ordered value
38
+ * tuple in its return type. `Value` is whatever the codec dictates — its type
39
+ * is constrained at `enumType` against the codec's input type, not here.
40
+ */
41
+ interface EnumMember$1<Name extends string, Value> {
42
+ readonly name: Name;
43
+ readonly value: Value;
44
+ }
45
+ type MembersToValues<Members extends readonly EnumMember$1<string, unknown>[]> = { readonly [K in keyof Members]: Members[K] extends EnumMember$1<string, infer V> ? V : never; };
46
+ type MembersToNames<Members extends readonly EnumMember$1<string, unknown>[]> = { readonly [K in keyof Members]: Members[K] extends EnumMember$1<infer N, unknown> ? N : never; };
47
+ type MembersAccessorMap<Members extends readonly EnumMember$1<string, unknown>[]> = { readonly [M in Members[number] as M['name']]: M['value']; };
48
+ declare const ENUM_TYPE_HANDLE_BRAND = "__prismaNextEnumTypeHandle__";
49
+ /** Authoring handle returned by `enumType()`. Generic over the ordered value tuple so `const Role = enumType(...)` retains literal types. */
50
+ interface EnumTypeHandle$1<Name extends string = string, Values extends readonly unknown[] = readonly unknown[], Names extends readonly string[] = readonly string[], MembersMap extends Record<string, unknown> = Record<string, unknown>> {
51
+ /** Internal brand for lowering-pipeline detection. */
52
+ readonly [ENUM_TYPE_HANDLE_BRAND]: true;
53
+ /** The enum's declared name (used as the key in domain `enum` / storage `valueSet`). */
54
+ readonly enumName: Name;
55
+ /** codecId from the codec passed to `enumType`. */
56
+ readonly codecId: string;
57
+ /** nativeType from the codec passed to `enumType`. */
58
+ readonly nativeType: string;
59
+ /** Ordered member list for lowering (name + value pairs). */
60
+ readonly enumMembers: readonly {
61
+ readonly name: string;
62
+ readonly value: Values[number];
63
+ }[];
64
+ /** Ordered literal value tuple. Declaration order is preserved. */
65
+ readonly values: Values;
66
+ /** Ordered literal name tuple. Declaration order is preserved. */
67
+ readonly names: Names;
68
+ /**
69
+ * Namespaced accessor map: `Role.members.User === 'user'`.
70
+ * Namespaced under `.members` to avoid collisions with `.values` / `.has`.
71
+ */
72
+ readonly members: MembersMap;
73
+ /** Returns `true` if `v` is a declared member value. */
74
+ has(v: Values[number]): boolean;
75
+ /** Returns the member name for a value, or `undefined` if not found. */
76
+ nameOf(v: Values[number]): string | undefined;
77
+ /** Returns the zero-based declaration index of a value, or `-1` if not found. */
78
+ ordinalOf(v: Values[number]): number;
79
+ }
80
+ /**
81
+ * A codec typemap: codecId → `{ input, output }`, the same shape the query
82
+ * lanes consume. The bound `enumType` wrappers supply the target pack's
83
+ * typemap; the core defaults to an empty map (no codec is known), so member
84
+ * values stay unconstrained.
85
+ */
86
+ type CodecTypeMap = Record<string, {
87
+ readonly input?: unknown;
88
+ }>;
89
+ /**
90
+ * The application input type the codec dictates for an enum's member values:
91
+ * looks `Codec['codecId']` up in the supplied codec typemap. When the codecId
92
+ * isn't in the map the input is unconstrained, so any member-value literal is
93
+ * accepted and inferred verbatim.
94
+ */
95
+ type CodecInput<CodecTypes extends CodecTypeMap, Codec extends {
96
+ readonly codecId: string;
97
+ }> = Codec['codecId'] extends keyof CodecTypes ? CodecTypes[Codec['codecId']] extends {
98
+ readonly input: infer In;
99
+ } ? In : unknown : unknown;
100
+ /**
101
+ * The signature of an `enumType` whose codec typemap is already bound — the
102
+ * shape a target-bound wrapper (e.g. `@internal/postgres/contract-builder`)
103
+ * exposes. The member values are constrained to the codec's input type drawn
104
+ * from `CodecTypes`, while `Name`, `Codec`, and the member tuple still infer
105
+ * from the call.
106
+ */
107
+ type BoundEnumType<CodecTypes extends CodecTypeMap> = <const Name extends string, const Codec extends Pick<ColumnTypeDescriptor, 'codecId' | 'nativeType'>, const Members extends readonly [EnumMember$1<string, CodecInput<CodecTypes, Codec>>, ...EnumMember$1<string, CodecInput<CodecTypes, Codec>>[]]>(name: Name, codec: Codec, ...members: Members) => EnumTypeHandle$1<Name, MembersToValues<[...Members]>, MembersToNames<[...Members]>, MembersAccessorMap<[...Members]>>;
108
+ //#endregion
109
+ //#region src/contract/enum-type.d.ts
110
+ /**
111
+ * The `enumType` authors call when building a Mongo contract (re-exported
112
+ * from `@internal/mongo/contract-builder`).
113
+ *
114
+ * `bindEnumType` is the core, codec-agnostic `enumType` factory; calling it
115
+ * with the Mongo target pack's codec typemap constrains member values to the
116
+ * codec's input type so `mongo/string@1` requires string values and a
117
+ * mismatch is a compile error.
118
+ */
119
+ declare const enumType: BoundEnumType<import("@prisma/orm-target-mongo/target/codec-types").CodecTypes>;
120
+ //#endregion
121
+ export { type ContractDefinition, type ContractFactory, type ContractScaffold, type EnumMember, type EnumTypeHandle, type FieldBuilder, type FieldReference, type ModelBuilder, type MongoContractResult, type RelationBuilder, type ValueObjectBuilder, defineContract, enumType, field, index, member, model, rel, valueObject };
122
+ //# sourceMappingURL=contract-builder.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-builder.d.mts","names":[],"sources":["../../../../3-extensions/mongo/dist/contract-builder.d.mts"],"mappings":";;;;;;;KAMK,yBAAyB;KACzB,yBAAyB;KACzB,eAAe,WAAW,kBAAkB,sBAAsB,iCAAiC,iBAAiB;KACpH,uBAAuB,KAAK,qBAAqB,iBAAiB;WAC5D;WACA;;KAEN,qBAAqB,KAAK,mBAAmB,iBAAiB;WACxD;WACA;;iBAEM,qBAAqB,mBAAmB,sBAAsB,YAAY,aAAa,sBAAsB;WACnH,QAAQ;WACR,QAAQ;;iBAEF,qBAAqB,mBAAmB,0BAA0B;WACxE,SAAS;WACT,eAAe;WACf,QAAQ;GAChB,UAAU,YAAY,UAAU,SAAS,iBAAiB,QAAQ,sBAAsB,aAAa;WAC7F,QAAQ;WACR,QAAQ;;;;;;;;;;;;UAYT,aAAa,qBAAqB;WACjC,MAAM;WACN,OAAO;;KAEb,gBAAgB,yBAAyB,+CAA+C,WAAW,UAAU,QAAQ,WAAW,2BAA2B,KAAK;KAChK,eAAe,yBAAyB,+CAA+C,WAAW,UAAU,QAAQ,WAAW,mBAAmB,cAAc;KAChK,mBAAmB,yBAAyB,+CAA+C,KAAK,mBAAmB,YAAY;cACtH;;UAEJ,iBAAiB,8BAA8B,wDAAwD,qDAAqD,mBAAmB,0BAA0B;;YAEvM;;WAED,UAAU;;WAEV;;WAEA;;WAEA;aACE;aACA,OAAO;;;WAGT,QAAQ;;WAER,OAAO;;;;;WAKP,SAAS;;EAElB,IAAI,GAAG;;EAEP,OAAO,GAAG;;EAEV,UAAU,GAAG;;;;;;;;KAQV,eAAe;WACT;;;;;;;;KAQN,WAAW,mBAAmB,cAAc;WACtC;KACN,+BAA+B,aAAa,WAAW;WACjD,aAAa;IACpB;;;;;;;;KAQC,cAAc,mBAAmB,uBAAuB,2BAA2B,cAAc,KAAK,uDAAuD,0BAA0B,qBAAqB,WAAW,YAAY,YAAY,qBAAqB,WAAW,YAAY,YAAY,MAAM,MAAM,OAAO,UAAU,SAAS,YAAY,iBAAiB,MAAM,oBAAoB,WAAW,mBAAmB,WAAW,uBAAuB;;;;;;;;;;;;cAY3b,UAAU,2DAA2D"}
@@ -0,0 +1,22 @@
1
+ import { bindEnumType, buildBoundContract, field, index, member, model, rel, valueObject } from "@prisma/orm-family-mongo/contract-ts/contract-builder";
2
+ import mongoFamilyPack from "@prisma/orm-family-mongo/family/pack";
3
+ import mongoTargetPack from "@prisma/orm-target-mongo/target/pack";
4
+ //#region ../../../3-extensions/mongo/dist/contract-builder.mjs
5
+ function defineContract(definition, factory) {
6
+ if (factory !== void 0) return buildBoundContract(mongoFamilyPack, mongoTargetPack, definition, factory);
7
+ return buildBoundContract(mongoFamilyPack, mongoTargetPack, definition);
8
+ }
9
+ /**
10
+ * The `enumType` authors call when building a Mongo contract (re-exported
11
+ * from `@internal/mongo/contract-builder`).
12
+ *
13
+ * `bindEnumType` is the core, codec-agnostic `enumType` factory; calling it
14
+ * with the Mongo target pack's codec typemap constrains member values to the
15
+ * codec's input type so `mongo/string@1` requires string values and a
16
+ * mismatch is a compile error.
17
+ */
18
+ const enumType = bindEnumType();
19
+ //#endregion
20
+ export { defineContract, enumType, field, index, member, model, rel, valueObject };
21
+
22
+ //# sourceMappingURL=contract-builder.mjs.map