@prisma/orm-extension-arktype-json 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.
- package/LICENSE +201 -0
- package/README.md +31 -0
- package/dist/arktype-json-codec-C9r2qvJy-CyWkAduB.mjs +158 -0
- package/dist/arktype-json-codec-C9r2qvJy-CyWkAduB.mjs.map +1 -0
- package/dist/arktype-json-codec-DOJVP1RC-OOrsE-hB.d.mts +62 -0
- package/dist/arktype-json-codec-DOJVP1RC-OOrsE-hB.d.mts.map +1 -0
- package/dist/codec-types-h4H0dxB8-uZRlhcjQ.d.mts +28 -0
- package/dist/codec-types-h4H0dxB8-uZRlhcjQ.d.mts.map +1 -0
- package/dist/codec-types.d.mts +2 -0
- package/dist/codec-types.mjs +1 -0
- package/dist/codecs.d.mts +13 -0
- package/dist/codecs.d.mts.map +1 -0
- package/dist/codecs.mjs +3 -0
- package/dist/column-types.d.mts +2 -0
- package/dist/column-types.mjs +2 -0
- package/dist/control.d.mts +7 -0
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +22 -0
- package/dist/control.mjs.map +1 -0
- package/dist/pack-meta-sCd-w62R-BJrOMFwR.mjs +34 -0
- package/dist/pack-meta-sCd-w62R-BJrOMFwR.mjs.map +1 -0
- package/dist/pack.d.mts +36 -0
- package/dist/pack.d.mts.map +1 -0
- package/dist/pack.mjs +2 -0
- package/dist/registry-Di7rBVdI-sgB_8xDd.mjs +13 -0
- package/dist/registry-Di7rBVdI-sgB_8xDd.mjs.map +1 -0
- package/dist/runtime.d.mts +7 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +22 -0
- package/dist/runtime.mjs.map +1 -0
- package/package.json +53 -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,31 @@
|
|
|
1
|
+
# @prisma/orm-extension-arktype-json
|
|
2
|
+
|
|
3
|
+
JSON columns with a validated, typed shape for Prisma Next, built on [arktype](https://arktype.io).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pnpm add @prisma/orm-extension-arktype-json
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Entrypoints
|
|
10
|
+
|
|
11
|
+
| Namespace | Surface |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `/pack` | the extension pack an application composes into `extensions: [...]` — pure, no runtime imports |
|
|
14
|
+
| `/column-types` | the `arktypeJson(schema)` column author |
|
|
15
|
+
| `/codecs`, `/codec-types` | the `arktype/json@1` codec descriptor and the types emitted contracts reference |
|
|
16
|
+
| `/runtime` | the runtime extension |
|
|
17
|
+
| `/control` | the control descriptor |
|
|
18
|
+
|
|
19
|
+
## Responsibilities
|
|
20
|
+
|
|
21
|
+
Given an arktype `Type`, `arktypeJson(schema)` produces a column that stores `jsonb`, carries the schema's serialized form in `typeParams`, and renders the schema's TypeScript expression as the column's type in `contract.d.ts`. At runtime the framework rehydrates the schema from that serialized form and validates wire payloads on decode; a validation failure raises `RUNTIME.JSON_SCHEMA_VALIDATION_FAILED`. Encoding only checks JSON representability.
|
|
22
|
+
|
|
23
|
+
JSON-with-schema is deliberately a per-library extension — this pack covers arktype; other validators get their own packs once each has a clean serialize-and-rehydrate story. Raw, untyped JSON columns stay in the Postgres target.
|
|
24
|
+
|
|
25
|
+
## Dependencies
|
|
26
|
+
|
|
27
|
+
`@prisma/orm-framework` and `@prisma/orm-family-sql` at exact lockstep versions, plus `arktype` and `@standard-schema/spec`.
|
|
28
|
+
|
|
29
|
+
`arktype` is an ordinary dependency, not a peer: a column carries its schema as a serialized form and the runtime rehydrates it from that, so this pack never compares schema objects with the copy an application authored against. The application's own `arktype` and this pack's may be separate instances.
|
|
30
|
+
|
|
31
|
+
`@prisma/orm-target-postgres` is an exact-pinned **peer** dependency: the application supplies it, directly or through a facade, and everyone shares that one copy. A hard dependency would let an application upgrade the facade without upgrading this pack and end up with two target copies whose codec and operation registries have quietly diverged; as a peer that combination fails to install instead.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { CodecImpl, column } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
import { isRuntimeError, runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
3
|
+
import { PostgresCodecDescriptor, definePostgresCodecs } from "@prisma/orm-target-postgres/target/codec-descriptor";
|
|
4
|
+
import { ArkErrors, ark, type } from "arktype";
|
|
5
|
+
//#region ../../../3-extensions/arktype-json/dist/arktype-json-codec-C9r2qvJy.mjs
|
|
6
|
+
/** Codec id for arktype-backed JSON columns. Library-bound, not target-bound. */
|
|
7
|
+
const ARKTYPE_JSON_CODEC_ID = "arktype/json@1";
|
|
8
|
+
/** Native storage type backing the codec. JSONB on Postgres; binary, indexable. */
|
|
9
|
+
const ARKTYPE_JSON_NATIVE_TYPE = "jsonb";
|
|
10
|
+
function isArktypeSchemaLike(value) {
|
|
11
|
+
if (typeof value !== "function") return false;
|
|
12
|
+
return typeof value.expression === "string";
|
|
13
|
+
}
|
|
14
|
+
function validateSchema(schema, value) {
|
|
15
|
+
const result = schema(value);
|
|
16
|
+
if (result instanceof ArkErrors) throw runtimeError("RUNTIME.JSON_SCHEMA_VALIDATION_FAILED", `arktype-json schema validation failed (decode): ${result.summary}`, {
|
|
17
|
+
codecId: ARKTYPE_JSON_CODEC_ID,
|
|
18
|
+
issues: result.summary
|
|
19
|
+
});
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
function serializeWire(value) {
|
|
23
|
+
let wire;
|
|
24
|
+
try {
|
|
25
|
+
wire = JSON.stringify(value);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
throw Object.assign(runtimeError("RUNTIME.ENCODE_FAILED", `arktype-json value could not be serialized to JSON (codecId: ${ARKTYPE_JSON_CODEC_ID})`, { codecId: ARKTYPE_JSON_CODEC_ID }), { cause: error });
|
|
28
|
+
}
|
|
29
|
+
if (typeof wire !== "string") throw runtimeError("RUNTIME.ENCODE_FAILED", `arktype-json value is not representable as JSON (codecId: ${ARKTYPE_JSON_CODEC_ID})`, { codecId: ARKTYPE_JSON_CODEC_ID });
|
|
30
|
+
return wire;
|
|
31
|
+
}
|
|
32
|
+
function serializeJson(value) {
|
|
33
|
+
return JSON.parse(serializeWire(value));
|
|
34
|
+
}
|
|
35
|
+
function parseJsonText(wire) {
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(wire);
|
|
38
|
+
} catch {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function decodeWireValue(schema, wire) {
|
|
43
|
+
if (typeof wire !== "string") return validateSchema(schema, wire);
|
|
44
|
+
try {
|
|
45
|
+
return validateSchema(schema, wire);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (!isRuntimeError(error) || error.code !== "RUNTIME.JSON_SCHEMA_VALIDATION_FAILED") throw error;
|
|
48
|
+
const parsed = parseJsonText(wire);
|
|
49
|
+
if (parsed === void 0) throw error;
|
|
50
|
+
return validateSchema(schema, parsed);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function rehydrateSchema(jsonIr) {
|
|
54
|
+
let rehydrated;
|
|
55
|
+
try {
|
|
56
|
+
rehydrated = ark.schema(jsonIr);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
throw runtimeError(
|
|
59
|
+
"RUNTIME.JSON_SCHEMA_VALIDATION_FAILED",
|
|
60
|
+
/* c8 ignore next — the `String(error)` fallback covers throws of non-Error values; arktype only throws Error subclasses, so this branch is defensive only. */
|
|
61
|
+
`Failed to rehydrate arktype schema from contract IR: ${error instanceof Error ? error.message : String(error)}`,
|
|
62
|
+
{
|
|
63
|
+
codecId: ARKTYPE_JSON_CODEC_ID,
|
|
64
|
+
jsonIr
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
/* c8 ignore start — defensive: ark.schema either throws (handled above) or returns a callable Type with `expression: string`. The structural guard is kept so a future ark internal change can't silently slip a non-callable past us. */
|
|
69
|
+
if (!isArktypeSchemaLike(rehydrated)) throw runtimeError("RUNTIME.JSON_SCHEMA_VALIDATION_FAILED", `Rehydrated arktype schema does not have the expected callable + 'expression: string' shape (codecId: ${ARKTYPE_JSON_CODEC_ID})`, {
|
|
70
|
+
codecId: ARKTYPE_JSON_CODEC_ID,
|
|
71
|
+
jsonIr
|
|
72
|
+
});
|
|
73
|
+
/* c8 ignore stop */
|
|
74
|
+
return rehydrated;
|
|
75
|
+
}
|
|
76
|
+
function renderArktypeJsonOutputType(params) {
|
|
77
|
+
const expression = params.expression.trim();
|
|
78
|
+
return expression.length > 0 ? expression : "unknown";
|
|
79
|
+
}
|
|
80
|
+
var ArktypeJsonCodecClass = class extends CodecImpl {
|
|
81
|
+
schema;
|
|
82
|
+
constructor(descriptor, schema) {
|
|
83
|
+
super(descriptor);
|
|
84
|
+
this.schema = schema;
|
|
85
|
+
}
|
|
86
|
+
async encode(value, _ctx) {
|
|
87
|
+
return serializeWire(value);
|
|
88
|
+
}
|
|
89
|
+
async decode(wire, _ctx) {
|
|
90
|
+
return decodeWireValue(this.schema, wire);
|
|
91
|
+
}
|
|
92
|
+
encodeJson(value) {
|
|
93
|
+
return serializeJson(value);
|
|
94
|
+
}
|
|
95
|
+
decodeJson(json) {
|
|
96
|
+
return validateSchema(this.schema, json);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const arktypeJsonParamsSchema = type({
|
|
100
|
+
expression: "string",
|
|
101
|
+
jsonIr: "object"
|
|
102
|
+
});
|
|
103
|
+
var ArktypeJsonDescriptor = class extends PostgresCodecDescriptor {
|
|
104
|
+
nativeType() {
|
|
105
|
+
return ARKTYPE_JSON_NATIVE_TYPE;
|
|
106
|
+
}
|
|
107
|
+
jsonProjection(expression) {
|
|
108
|
+
return expression;
|
|
109
|
+
}
|
|
110
|
+
codecId = ARKTYPE_JSON_CODEC_ID;
|
|
111
|
+
traits = ["equality"];
|
|
112
|
+
targetTypes = [ARKTYPE_JSON_NATIVE_TYPE];
|
|
113
|
+
paramsSchema = arktypeJsonParamsSchema;
|
|
114
|
+
renderOutputType(params) {
|
|
115
|
+
return renderArktypeJsonOutputType(params);
|
|
116
|
+
}
|
|
117
|
+
factory(params) {
|
|
118
|
+
const schema = rehydrateSchema(params.jsonIr);
|
|
119
|
+
const rehydratedExpression = schema.expression;
|
|
120
|
+
if (typeof rehydratedExpression === "string" && rehydratedExpression !== params.expression) throw runtimeError("RUNTIME.TYPE_PARAMS_INVALID", `arktype-json: typeParams.expression (${params.expression}) does not match the rehydrated schema's expression (${rehydratedExpression}). The contract was likely emitted against a different arktype version or hand-edited; re-run \`pnpm emit\` to regenerate.`, {
|
|
121
|
+
codecId: ARKTYPE_JSON_CODEC_ID,
|
|
122
|
+
serializedExpression: params.expression,
|
|
123
|
+
rehydratedExpression
|
|
124
|
+
});
|
|
125
|
+
return () => new ArktypeJsonCodecClass(this, schema);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const arktypeJsonDescriptor = new ArktypeJsonDescriptor();
|
|
129
|
+
/**
|
|
130
|
+
* Per-codec column helper for `arktype/json@1`. Method-level generic over `S extends Type<unknown>` so the column site preserves the schema's inferred TS type in the resolved codec (`ArktypeJsonCodecClass<S['infer']>`). Bypasses `descriptor.factory` because `S` is only available at the column-author site; constructs the typed codec directly with the closure-captured schema.
|
|
131
|
+
*
|
|
132
|
+
* Eager serialization at this call site captures `expression` (for the emit-path renderer) and `jsonIr` (for runtime rehydration via the descriptor's factory).
|
|
133
|
+
*
|
|
134
|
+
* @throws `CONTRACT.ARGUMENT_INVALID` if the schema doesn't expose `expression` and `json` fields (i.e. is not an arktype `Type`). Validates the schema shape at the call site so configuration errors surface during contract authoring, not at runtime.
|
|
135
|
+
*/
|
|
136
|
+
function arktypeJsonColumn(schema) {
|
|
137
|
+
if (!isArktypeSchemaLike(schema)) throw runtimeError("CONTRACT.ARGUMENT_INVALID", typeof schema !== "function" ? "arktypeJsonColumn(schema) expects a callable arktype Type." : "arktypeJsonColumn(schema) expects an arktype Type (missing `expression: string`).", {
|
|
138
|
+
helperPath: "arktypeJsonColumn",
|
|
139
|
+
expected: "arktype Type",
|
|
140
|
+
received: typeof schema
|
|
141
|
+
});
|
|
142
|
+
const jsonIr = schema.json;
|
|
143
|
+
if (jsonIr === null || typeof jsonIr !== "object") throw runtimeError("CONTRACT.ARGUMENT_INVALID", "arktypeJsonColumn(schema) expects an arktype Type (missing `json` IR).", {
|
|
144
|
+
helperPath: "arktypeJsonColumn",
|
|
145
|
+
expected: "arktype Type",
|
|
146
|
+
received: typeof jsonIr
|
|
147
|
+
});
|
|
148
|
+
const params = {
|
|
149
|
+
expression: schema.expression,
|
|
150
|
+
jsonIr
|
|
151
|
+
};
|
|
152
|
+
return column((_ctx) => new ArktypeJsonCodecClass(arktypeJsonDescriptor, schema), arktypeJsonDescriptor.codecId, params, ARKTYPE_JSON_NATIVE_TYPE);
|
|
153
|
+
}
|
|
154
|
+
const codecDescriptors = definePostgresCodecs([arktypeJsonDescriptor]);
|
|
155
|
+
//#endregion
|
|
156
|
+
export { codecDescriptors as i, ARKTYPE_JSON_NATIVE_TYPE as n, arktypeJsonColumn as r, ARKTYPE_JSON_CODEC_ID as t };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=arktype-json-codec-C9r2qvJy-CyWkAduB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arktype-json-codec-C9r2qvJy-CyWkAduB.mjs","names":[],"sources":["../../../../3-extensions/arktype-json/dist/arktype-json-codec-C9r2qvJy.mjs"],"sourcesContent":["import { CodecImpl, column } from \"@internal/framework-components/codec\";\nimport { isRuntimeError, runtimeError } from \"@internal/framework-components/runtime\";\nimport { PostgresCodecDescriptor, definePostgresCodecs } from \"@internal/target-postgres/codec-descriptor\";\nimport { ArkErrors, ark, type } from \"arktype\";\n//#region src/core/arktype-json-codec.ts\n/** Codec id for arktype-backed JSON columns. Library-bound, not target-bound. */\nconst ARKTYPE_JSON_CODEC_ID = \"arktype/json@1\";\n/** Native storage type backing the codec. JSONB on Postgres; binary, indexable. */\nconst ARKTYPE_JSON_NATIVE_TYPE = \"jsonb\";\nfunction isArktypeSchemaLike(value) {\n\tif (typeof value !== \"function\") return false;\n\treturn typeof value.expression === \"string\";\n}\nfunction validateSchema(schema, value) {\n\tconst result = schema(value);\n\tif (result instanceof ArkErrors) throw runtimeError(\"RUNTIME.JSON_SCHEMA_VALIDATION_FAILED\", `arktype-json schema validation failed (decode): ${result.summary}`, {\n\t\tcodecId: ARKTYPE_JSON_CODEC_ID,\n\t\tissues: result.summary\n\t});\n\treturn result;\n}\nfunction serializeWire(value) {\n\tlet wire;\n\ttry {\n\t\twire = JSON.stringify(value);\n\t} catch (error) {\n\t\tthrow Object.assign(runtimeError(\"RUNTIME.ENCODE_FAILED\", `arktype-json value could not be serialized to JSON (codecId: ${ARKTYPE_JSON_CODEC_ID})`, { codecId: ARKTYPE_JSON_CODEC_ID }), { cause: error });\n\t}\n\tif (typeof wire !== \"string\") throw runtimeError(\"RUNTIME.ENCODE_FAILED\", `arktype-json value is not representable as JSON (codecId: ${ARKTYPE_JSON_CODEC_ID})`, { codecId: ARKTYPE_JSON_CODEC_ID });\n\treturn wire;\n}\nfunction serializeJson(value) {\n\treturn JSON.parse(serializeWire(value));\n}\nfunction parseJsonText(wire) {\n\ttry {\n\t\treturn JSON.parse(wire);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction decodeWireValue(schema, wire) {\n\tif (typeof wire !== \"string\") return validateSchema(schema, wire);\n\ttry {\n\t\treturn validateSchema(schema, wire);\n\t} catch (error) {\n\t\tif (!isRuntimeError(error) || error.code !== \"RUNTIME.JSON_SCHEMA_VALIDATION_FAILED\") throw error;\n\t\tconst parsed = parseJsonText(wire);\n\t\tif (parsed === void 0) throw error;\n\t\treturn validateSchema(schema, parsed);\n\t}\n}\nfunction rehydrateSchema(jsonIr) {\n\tlet rehydrated;\n\ttry {\n\t\trehydrated = ark.schema(jsonIr);\n\t} catch (error) {\n\t\tthrow runtimeError(\n\t\t\t\"RUNTIME.JSON_SCHEMA_VALIDATION_FAILED\",\n\t\t\t/* c8 ignore next — the `String(error)` fallback covers throws of non-Error values; arktype only throws Error subclasses, so this branch is defensive only. */\n\t\t\t`Failed to rehydrate arktype schema from contract IR: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t{\n\t\t\t\tcodecId: ARKTYPE_JSON_CODEC_ID,\n\t\t\t\tjsonIr\n\t\t\t}\n\t\t);\n\t}\n\t/* c8 ignore start — defensive: ark.schema either throws (handled above) or returns a callable Type with `expression: string`. The structural guard is kept so a future ark internal change can't silently slip a non-callable past us. */\n\tif (!isArktypeSchemaLike(rehydrated)) throw runtimeError(\"RUNTIME.JSON_SCHEMA_VALIDATION_FAILED\", `Rehydrated arktype schema does not have the expected callable + 'expression: string' shape (codecId: ${ARKTYPE_JSON_CODEC_ID})`, {\n\t\tcodecId: ARKTYPE_JSON_CODEC_ID,\n\t\tjsonIr\n\t});\n\t/* c8 ignore stop */\n\treturn rehydrated;\n}\nfunction renderArktypeJsonOutputType(params) {\n\tconst expression = params.expression.trim();\n\treturn expression.length > 0 ? expression : \"unknown\";\n}\nvar ArktypeJsonCodecClass = class extends CodecImpl {\n\tschema;\n\tconstructor(descriptor, schema) {\n\t\tsuper(descriptor);\n\t\tthis.schema = schema;\n\t}\n\tasync encode(value, _ctx) {\n\t\treturn serializeWire(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn decodeWireValue(this.schema, wire);\n\t}\n\tencodeJson(value) {\n\t\treturn serializeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\treturn validateSchema(this.schema, json);\n\t}\n};\nconst arktypeJsonParamsSchema = type({\n\texpression: \"string\",\n\tjsonIr: \"object\"\n});\nvar ArktypeJsonDescriptor = class extends PostgresCodecDescriptor {\n\tnativeType() {\n\t\treturn ARKTYPE_JSON_NATIVE_TYPE;\n\t}\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tcodecId = ARKTYPE_JSON_CODEC_ID;\n\ttraits = [\"equality\"];\n\ttargetTypes = [ARKTYPE_JSON_NATIVE_TYPE];\n\tparamsSchema = arktypeJsonParamsSchema;\n\trenderOutputType(params) {\n\t\treturn renderArktypeJsonOutputType(params);\n\t}\n\tfactory(params) {\n\t\tconst schema = rehydrateSchema(params.jsonIr);\n\t\tconst rehydratedExpression = schema.expression;\n\t\tif (typeof rehydratedExpression === \"string\" && rehydratedExpression !== params.expression) throw runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `arktype-json: typeParams.expression (${params.expression}) does not match the rehydrated schema's expression (${rehydratedExpression}). The contract was likely emitted against a different arktype version or hand-edited; re-run \\`pnpm emit\\` to regenerate.`, {\n\t\t\tcodecId: ARKTYPE_JSON_CODEC_ID,\n\t\t\tserializedExpression: params.expression,\n\t\t\trehydratedExpression\n\t\t});\n\t\treturn () => new ArktypeJsonCodecClass(this, schema);\n\t}\n};\nconst arktypeJsonDescriptor = new ArktypeJsonDescriptor();\n/**\n* Per-codec column helper for `arktype/json@1`. Method-level generic over `S extends Type<unknown>` so the column site preserves the schema's inferred TS type in the resolved codec (`ArktypeJsonCodecClass<S['infer']>`). Bypasses `descriptor.factory` because `S` is only available at the column-author site; constructs the typed codec directly with the closure-captured schema.\n*\n* Eager serialization at this call site captures `expression` (for the emit-path renderer) and `jsonIr` (for runtime rehydration via the descriptor's factory).\n*\n* @throws `CONTRACT.ARGUMENT_INVALID` if the schema doesn't expose `expression` and `json` fields (i.e. is not an arktype `Type`). Validates the schema shape at the call site so configuration errors surface during contract authoring, not at runtime.\n*/\nfunction arktypeJsonColumn(schema) {\n\tif (!isArktypeSchemaLike(schema)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", typeof schema !== \"function\" ? \"arktypeJsonColumn(schema) expects a callable arktype Type.\" : \"arktypeJsonColumn(schema) expects an arktype Type (missing `expression: string`).\", {\n\t\thelperPath: \"arktypeJsonColumn\",\n\t\texpected: \"arktype Type\",\n\t\treceived: typeof schema\n\t});\n\tconst jsonIr = schema.json;\n\tif (jsonIr === null || typeof jsonIr !== \"object\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", \"arktypeJsonColumn(schema) expects an arktype Type (missing `json` IR).\", {\n\t\thelperPath: \"arktypeJsonColumn\",\n\t\texpected: \"arktype Type\",\n\t\treceived: typeof jsonIr\n\t});\n\tconst params = {\n\t\texpression: schema.expression,\n\t\tjsonIr\n\t};\n\treturn column((_ctx) => new ArktypeJsonCodecClass(arktypeJsonDescriptor, schema), arktypeJsonDescriptor.codecId, params, ARKTYPE_JSON_NATIVE_TYPE);\n}\nconst codecDescriptors = definePostgresCodecs([arktypeJsonDescriptor]);\n//#endregion\nexport { codecDescriptors as i, ARKTYPE_JSON_NATIVE_TYPE as n, arktypeJsonColumn as r, ARKTYPE_JSON_CODEC_ID as t };\n\n//# sourceMappingURL=arktype-json-codec-C9r2qvJy.mjs.map"],"mappings":"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"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CodecCallContext, CodecImpl, CodecInstanceContext, ColumnSpec } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
import { PostgresCodecDescriptor } from "@prisma/orm-target-postgres/target/codec-descriptor";
|
|
3
|
+
import { Type } from "arktype";
|
|
4
|
+
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
5
|
+
import { ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
|
+
//#region ../../../3-extensions/arktype-json/dist/arktype-json-codec-DOJVP1RC.d.mts
|
|
8
|
+
//#region src/core/arktype-json-codec.d.ts
|
|
9
|
+
/** Codec id for arktype-backed JSON columns. Library-bound, not target-bound. */
|
|
10
|
+
declare const ARKTYPE_JSON_CODEC_ID: "arktype/json@1";
|
|
11
|
+
/** Native storage type backing the codec. JSONB on Postgres; binary, indexable. */
|
|
12
|
+
declare const ARKTYPE_JSON_NATIVE_TYPE: "jsonb";
|
|
13
|
+
/**
|
|
14
|
+
* Eagerly serialized typeParams for the arktype-json column. Carried in the contract IR; the runtime descriptor's factory rehydrates `jsonIr` and the emitter consumes `expression`.
|
|
15
|
+
*/
|
|
16
|
+
type ArktypeJsonTypeParams = {
|
|
17
|
+
/**
|
|
18
|
+
* Arktype's TypeScript-source-like rendering of the schema. Read by `renderOutputType` to emit the column's TS type into `contract.d.ts`. Stable across the serialize/rehydrate cycle: the rehydrated schema's `expression` matches the source schema's.
|
|
19
|
+
*/
|
|
20
|
+
readonly expression: string;
|
|
21
|
+
/**
|
|
22
|
+
* Arktype's internal IR for the schema. Lossless; the rehydration source. Schema-shape — `ark.schema(jsonIr)` reconstructs a callable `Type`-like structurally identical to the original `type(definition)` output.
|
|
23
|
+
*/
|
|
24
|
+
readonly jsonIr: object;
|
|
25
|
+
};
|
|
26
|
+
type ArktypeSchemaLike = ((value: unknown) => unknown) & {
|
|
27
|
+
readonly expression: string;
|
|
28
|
+
readonly json?: unknown;
|
|
29
|
+
};
|
|
30
|
+
declare class ArktypeJsonCodecClass<TInferred> extends CodecImpl<typeof ARKTYPE_JSON_CODEC_ID, readonly ['equality'], string | JsonValue, TInferred> {
|
|
31
|
+
private readonly schema;
|
|
32
|
+
constructor(descriptor: ArktypeJsonDescriptor, schema: ArktypeSchemaLike);
|
|
33
|
+
encode(value: TInferred, _ctx: CodecCallContext): Promise<string>;
|
|
34
|
+
decode(wire: string | JsonValue, _ctx: CodecCallContext): Promise<TInferred>;
|
|
35
|
+
encodeJson(value: TInferred): JsonValue;
|
|
36
|
+
decodeJson(json: JsonValue): TInferred;
|
|
37
|
+
}
|
|
38
|
+
declare class ArktypeJsonDescriptor extends PostgresCodecDescriptor<ArktypeJsonTypeParams> {
|
|
39
|
+
protected nativeType(): string;
|
|
40
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
41
|
+
readonly codecId: "arktype/json@1";
|
|
42
|
+
readonly traits: readonly ["equality"];
|
|
43
|
+
readonly targetTypes: readonly ["jsonb"];
|
|
44
|
+
readonly paramsSchema: StandardSchemaV1<ArktypeJsonTypeParams>;
|
|
45
|
+
renderOutputType(params: ArktypeJsonTypeParams): string;
|
|
46
|
+
factory(params: ArktypeJsonTypeParams): (ctx: CodecInstanceContext) => ArktypeJsonCodecClass<unknown>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Per-codec column helper for `arktype/json@1`. Method-level generic over `S extends Type<unknown>` so the column site preserves the schema's inferred TS type in the resolved codec (`ArktypeJsonCodecClass<S['infer']>`). Bypasses `descriptor.factory` because `S` is only available at the column-author site; constructs the typed codec directly with the closure-captured schema.
|
|
50
|
+
*
|
|
51
|
+
* Eager serialization at this call site captures `expression` (for the emit-path renderer) and `jsonIr` (for runtime rehydration via the descriptor's factory).
|
|
52
|
+
*
|
|
53
|
+
* @throws `CONTRACT.ARGUMENT_INVALID` if the schema doesn't expose `expression` and `json` fields (i.e. is not an arktype `Type`). Validates the schema shape at the call site so configuration errors surface during contract authoring, not at runtime.
|
|
54
|
+
*/
|
|
55
|
+
declare function arktypeJsonColumn<S extends Type<unknown>>(schema: S): ColumnSpec<ArktypeJsonCodecClass<S['infer']>, ArktypeJsonTypeParams>;
|
|
56
|
+
/**
|
|
57
|
+
* Codec instance returned by `arktypeJsonColumn(schema).codecFactory(ctx)` and by `arktypeJsonDescriptor.factory(typeParams)(ctx)`. The `TInferred` slot carries the arktype schema's inferred output type at the column-author site; descriptor-side factories erase to `unknown`.
|
|
58
|
+
*/
|
|
59
|
+
type ArktypeJsonCodec<TInferred> = ArktypeJsonCodecClass<TInferred>;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ArktypeJsonTypeParams as a, ArktypeJsonDescriptor as i, ARKTYPE_JSON_NATIVE_TYPE as n, arktypeJsonColumn as o, ArktypeJsonCodec as r, ARKTYPE_JSON_CODEC_ID as t };
|
|
62
|
+
//# sourceMappingURL=arktype-json-codec-DOJVP1RC-OOrsE-hB.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arktype-json-codec-DOJVP1RC-OOrsE-hB.d.mts","names":[],"sources":["../../../../3-extensions/arktype-json/dist/arktype-json-codec-DOJVP1RC.d.mts"],"mappings":";;;;;;;;;cAQc;;cAEA;;;;KAIT;;;;WAIM;;;;WAIA;;KAEN,sBAAsB;WAChB;WACA;;cAEG,sBAAsB,mBAAmB,iBAAiB,uDAAuD,WAAW;mBACvH;EACjB,YAAY,YAAY,uBAAuB,QAAQ;EACvD,OAAO,OAAO,WAAW,MAAM,mBAAmB;EAClD,OAAO,eAAe,WAAW,MAAM,mBAAmB,QAAQ;EAClE,WAAW,OAAO,YAAY;EAC9B,WAAW,MAAM,YAAY;;cAEjB,8BAA8B,wBAAwB;YACxD;YACA,eAAe,YAAY,iBAAiB;WAC7C;WACA;WACA;WACA,cAAc,iBAAiB;EACxC,iBAAiB,QAAQ;EACzB,QAAQ,QAAQ,yBAAyB,KAAK,yBAAyB;;;;;;;;;iBASxD,kBAAkB,UAAU,eAAe,QAAQ,IAAI,WAAW,sBAAsB,aAAa;;;;KAIjH,iBAAiB,aAAa,sBAAsB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region ../../../3-extensions/arktype-json/dist/codec-types-h4H0dxB8.d.mts
|
|
2
|
+
//#region src/types/codec-types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Codec type definitions for the arktype-json extension.
|
|
5
|
+
*
|
|
6
|
+
* Type-only export consumed by emitted `contract.d.ts` to power
|
|
7
|
+
* `CodecTypes['arktype/json@1']['output']` lookups. The shape mirrors the
|
|
8
|
+
* codec the curried factory returns at runtime so the emit and no-emit
|
|
9
|
+
* paths stay structurally aligned.
|
|
10
|
+
*
|
|
11
|
+
* The output type is intentionally `unknown` — the precise inference is
|
|
12
|
+
* column-site-local (the no-emit `FieldOutputType` resolver reads the
|
|
13
|
+
* factory's return type from the column descriptor's `type` slot, which
|
|
14
|
+
* carries `(ctx) => Codec<…, S['infer']>`). The emit path renders the
|
|
15
|
+
* descriptor's `expression` as the column's TS type (per the descriptor's
|
|
16
|
+
* `renderOutputType`); the codec-id-keyed `CodecTypes` map is the
|
|
17
|
+
* fallback for sites without a column descriptor in scope.
|
|
18
|
+
*/
|
|
19
|
+
type CodecTypes = {
|
|
20
|
+
readonly 'arktype/json@1': {
|
|
21
|
+
readonly input: unknown;
|
|
22
|
+
readonly output: unknown;
|
|
23
|
+
readonly traits: 'equality';
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { CodecTypes as t };
|
|
28
|
+
//# sourceMappingURL=codec-types-h4H0dxB8-uZRlhcjQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-h4H0dxB8-uZRlhcjQ.d.mts","names":[],"sources":["../../../../3-extensions/arktype-json/dist/codec-types-h4H0dxB8.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;KAiBK;WACM;aACE;aACA;aACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { a as ArktypeJsonTypeParams, i as ArktypeJsonDescriptor, n as ARKTYPE_JSON_NATIVE_TYPE, o as arktypeJsonColumn, r as ArktypeJsonCodec, t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-DOJVP1RC-OOrsE-hB.mjs";
|
|
2
|
+
import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
|
|
3
|
+
//#region ../../../3-extensions/arktype-json/dist/codecs.d.mts
|
|
4
|
+
//#region src/core/registry.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Registry of every codec descriptor shipped by `@internal/extension-arktype-json`.
|
|
7
|
+
*
|
|
8
|
+
* Public consumer surface for the arktype-json codec set. Currently a single entry (`arktype/json@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.
|
|
9
|
+
*/
|
|
10
|
+
declare const arktypeJsonCodecRegistry: CodecDescriptorRegistry;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ARKTYPE_JSON_CODEC_ID, ARKTYPE_JSON_NATIVE_TYPE, type ArktypeJsonCodec, type ArktypeJsonDescriptor, type ArktypeJsonTypeParams, arktypeJsonCodecRegistry, arktypeJsonColumn };
|
|
13
|
+
//# sourceMappingURL=codecs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs.d.mts","names":[],"sources":["../../../../3-extensions/arktype-json/dist/codecs.d.mts"],"mappings":";;;;;;;;;cAQc,0BAA0B"}
|
package/dist/codecs.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as ARKTYPE_JSON_NATIVE_TYPE, r as arktypeJsonColumn, t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-C9r2qvJy-CyWkAduB.mjs";
|
|
2
|
+
import { t as arktypeJsonCodecRegistry } from "./registry-Di7rBVdI-sgB_8xDd.mjs";
|
|
3
|
+
export { ARKTYPE_JSON_CODEC_ID, ARKTYPE_JSON_NATIVE_TYPE, arktypeJsonCodecRegistry, arktypeJsonColumn };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SqlControlExtensionDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
2
|
+
//#region ../../../3-extensions/arktype-json/dist/control.d.mts
|
|
3
|
+
//#region src/exports/control.d.ts
|
|
4
|
+
declare const arktypeJsonExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { arktypeJsonExtensionDescriptor, arktypeJsonExtensionDescriptor as default };
|
|
7
|
+
//# sourceMappingURL=control.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../../../../3-extensions/arktype-json/dist/control.d.mts"],"mappings":";;;cAEc,gCAAgC"}
|
package/dist/control.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-C9r2qvJy-CyWkAduB.mjs";
|
|
2
|
+
import { t as arktypeJsonPackMeta } from "./pack-meta-sCd-w62R-BJrOMFwR.mjs";
|
|
3
|
+
//#region ../../../3-extensions/arktype-json/dist/control.mjs
|
|
4
|
+
const arktypeJsonControlPlaneHooks = { expandNativeType: ({ nativeType }) => nativeType };
|
|
5
|
+
const arktypeJsonExtensionDescriptor = {
|
|
6
|
+
...arktypeJsonPackMeta,
|
|
7
|
+
types: {
|
|
8
|
+
...arktypeJsonPackMeta.types,
|
|
9
|
+
codecTypes: {
|
|
10
|
+
...arktypeJsonPackMeta.types.codecTypes,
|
|
11
|
+
controlPlaneHooks: { [ARKTYPE_JSON_CODEC_ID]: arktypeJsonControlPlaneHooks }
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
create: () => ({
|
|
15
|
+
familyId: "sql",
|
|
16
|
+
targetId: "postgres"
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { arktypeJsonExtensionDescriptor, arktypeJsonExtensionDescriptor as default };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=control.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.mjs","names":[],"sources":["../../../../3-extensions/arktype-json/dist/control.mjs"],"sourcesContent":["import { t as ARKTYPE_JSON_CODEC_ID } from \"./arktype-json-codec-C9r2qvJy.mjs\";\nimport { t as arktypeJsonPackMeta } from \"./pack-meta-sCd-w62R.mjs\";\n//#region src/exports/control.ts\nconst arktypeJsonControlPlaneHooks = { expandNativeType: ({ nativeType }) => nativeType };\nconst arktypeJsonExtensionDescriptor = {\n\t...arktypeJsonPackMeta,\n\ttypes: {\n\t\t...arktypeJsonPackMeta.types,\n\t\tcodecTypes: {\n\t\t\t...arktypeJsonPackMeta.types.codecTypes,\n\t\t\tcontrolPlaneHooks: { [ARKTYPE_JSON_CODEC_ID]: arktypeJsonControlPlaneHooks }\n\t\t}\n\t},\n\tcreate: () => ({\n\t\tfamilyId: \"sql\",\n\t\ttargetId: \"postgres\"\n\t})\n};\n//#endregion\nexport { arktypeJsonExtensionDescriptor, arktypeJsonExtensionDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;AAGA,MAAM,+BAA+B,EAAE,mBAAmB,EAAE,iBAAiB,WAAW;AACxF,MAAM,iCAAiC;CACtC,GAAG;CACH,OAAO;EACN,GAAG,oBAAoB;EACvB,YAAY;GACX,GAAG,oBAAoB,MAAM;GAC7B,mBAAmB,GAAG,wBAAwB,6BAA6B;EAC5E;CACD;CACA,eAAe;EACd,UAAU;EACV,UAAU;CACX;AACD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-C9r2qvJy-CyWkAduB.mjs";
|
|
2
|
+
import { t as arktypeJsonCodecRegistry } from "./registry-Di7rBVdI-sgB_8xDd.mjs";
|
|
3
|
+
//#region ../../../3-extensions/arktype-json/dist/pack-meta-sCd-w62R.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Public pack metadata. The phantom `__codecTypes` field threads the codec-types map's literal type into the pack ref so contract-builder generics can pick it up; it is never accessed at runtime.
|
|
6
|
+
*/
|
|
7
|
+
const arktypeJsonPackMeta = {
|
|
8
|
+
kind: "extension",
|
|
9
|
+
id: "arktype-json",
|
|
10
|
+
familyId: "sql",
|
|
11
|
+
targetId: "postgres",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
capabilities: {},
|
|
14
|
+
types: {
|
|
15
|
+
codecTypes: {
|
|
16
|
+
codecDescriptors: Array.from(arktypeJsonCodecRegistry.values()),
|
|
17
|
+
import: {
|
|
18
|
+
package: "@internal/extension-arktype-json/codec-types",
|
|
19
|
+
named: "CodecTypes",
|
|
20
|
+
alias: "ArktypeJsonTypes"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
storage: [{
|
|
24
|
+
typeId: ARKTYPE_JSON_CODEC_ID,
|
|
25
|
+
familyId: "sql",
|
|
26
|
+
targetId: "postgres",
|
|
27
|
+
nativeType: "jsonb"
|
|
28
|
+
}]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { arktypeJsonPackMeta as t };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=pack-meta-sCd-w62R-BJrOMFwR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-meta-sCd-w62R-BJrOMFwR.mjs","names":[],"sources":["../../../../3-extensions/arktype-json/dist/pack-meta-sCd-w62R.mjs"],"sourcesContent":["import { t as ARKTYPE_JSON_CODEC_ID } from \"./arktype-json-codec-C9r2qvJy.mjs\";\nimport { t as arktypeJsonCodecRegistry } from \"./registry-Di7rBVdI.mjs\";\n/**\n* Public pack metadata. The phantom `__codecTypes` field threads the codec-types map's literal type into the pack ref so contract-builder generics can pick it up; it is never accessed at runtime.\n*/\nconst arktypeJsonPackMeta = {\n\tkind: \"extension\",\n\tid: \"arktype-json\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\ttypes: {\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(arktypeJsonCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/extension-arktype-json/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"ArktypeJsonTypes\"\n\t\t\t}\n\t\t},\n\t\tstorage: [{\n\t\t\ttypeId: ARKTYPE_JSON_CODEC_ID,\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}]\n\t}\n};\n//#endregion\nexport { arktypeJsonPackMeta as t };\n\n//# sourceMappingURL=pack-meta-sCd-w62R.mjs.map"],"mappings":";;;;;;AAKA,MAAM,sBAAsB;CAC3B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,CAAC;CACf,OAAO;EACN,YAAY;GACX,kBAAkB,MAAM,KAAK,yBAAyB,OAAO,CAAC;GAC9D,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;EACA,SAAS,CAAC;GACT,QAAQ;GACR,UAAU;GACV,UAAU;GACV,YAAY;EACb,CAAC;CACF;AACD"}
|
package/dist/pack.d.mts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as CodecTypes } from "./codec-types-h4H0dxB8-uZRlhcjQ.mjs";
|
|
2
|
+
//#region ../../../3-extensions/arktype-json/dist/pack.d.mts
|
|
3
|
+
//#region src/core/pack-meta.d.ts
|
|
4
|
+
declare const arktypeJsonPackMetaBase: {
|
|
5
|
+
readonly kind: "extension";
|
|
6
|
+
readonly id: "arktype-json";
|
|
7
|
+
readonly familyId: "sql";
|
|
8
|
+
readonly targetId: "postgres";
|
|
9
|
+
readonly version: "0.0.1";
|
|
10
|
+
readonly capabilities: {};
|
|
11
|
+
readonly types: {
|
|
12
|
+
readonly codecTypes: {
|
|
13
|
+
readonly codecDescriptors: import("@prisma/orm-framework/components/codec").CodecDescriptor<unknown>[];
|
|
14
|
+
readonly import: {
|
|
15
|
+
readonly package: "@internal/extension-arktype-json/codec-types";
|
|
16
|
+
readonly named: "CodecTypes";
|
|
17
|
+
readonly alias: "ArktypeJsonTypes";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly storage: readonly [{
|
|
21
|
+
readonly typeId: "arktype/json@1";
|
|
22
|
+
readonly familyId: "sql";
|
|
23
|
+
readonly targetId: "postgres";
|
|
24
|
+
readonly nativeType: "jsonb";
|
|
25
|
+
}];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Public pack metadata. The phantom `__codecTypes` field threads the codec-types map's literal type into the pack ref so contract-builder generics can pick it up; it is never accessed at runtime.
|
|
30
|
+
*/
|
|
31
|
+
declare const arktypeJsonPackMeta: typeof arktypeJsonPackMetaBase & {
|
|
32
|
+
readonly __codecTypes?: CodecTypes;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { arktypeJsonPackMeta, arktypeJsonPackMeta as default };
|
|
36
|
+
//# sourceMappingURL=pack.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.d.mts","names":[],"sources":["../../../../3-extensions/arktype-json/dist/pack.d.mts"],"mappings":";;;cAEc;WACH;WACA;WACA;WACA;WACA;WACA;WACA;aACE;eACE,iEAAiE;eACjE;iBACE;iBACA;iBACA;;;aAGJ;eACE;eACA;eACA;eACA;;;;;;;cAOD,4BAA4B;WAC/B,eAAe"}
|
package/dist/pack.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { i as codecDescriptors } from "./arktype-json-codec-C9r2qvJy-CyWkAduB.mjs";
|
|
2
|
+
import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
|
|
3
|
+
//#region ../../../3-extensions/arktype-json/dist/registry-Di7rBVdI.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Registry of every codec descriptor shipped by `@internal/extension-arktype-json`.
|
|
6
|
+
*
|
|
7
|
+
* Public consumer surface for the arktype-json codec set. Currently a single entry (`arktype/json@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.
|
|
8
|
+
*/
|
|
9
|
+
const arktypeJsonCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { arktypeJsonCodecRegistry as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=registry-Di7rBVdI-sgB_8xDd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-Di7rBVdI-sgB_8xDd.mjs","names":[],"sources":["../../../../3-extensions/arktype-json/dist/registry-Di7rBVdI.mjs"],"sourcesContent":["import { i as codecDescriptors } from \"./arktype-json-codec-C9r2qvJy.mjs\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/extension-arktype-json`.\n*\n* Public consumer surface for the arktype-json codec set. Currently a single entry (`arktype/json@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.\n*/\nconst arktypeJsonCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);\n//#endregion\nexport { arktypeJsonCodecRegistry as t };\n\n//# sourceMappingURL=registry-Di7rBVdI.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,2BAA2B,6BAA6B,gBAAgB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SqlRuntimeExtensionDescriptor } from "@prisma/orm-family-sql/runtime";
|
|
2
|
+
//#region ../../../3-extensions/arktype-json/dist/runtime.d.mts
|
|
3
|
+
//#region src/exports/runtime.d.ts
|
|
4
|
+
declare const arktypeJsonRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { arktypeJsonRuntimeDescriptor, arktypeJsonRuntimeDescriptor as default };
|
|
7
|
+
//# sourceMappingURL=runtime.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../../../3-extensions/arktype-json/dist/runtime.d.mts"],"mappings":";;;cAEc,8BAA8B"}
|
package/dist/runtime.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as arktypeJsonCodecRegistry } from "./registry-Di7rBVdI-sgB_8xDd.mjs";
|
|
2
|
+
import { t as arktypeJsonPackMeta } from "./pack-meta-sCd-w62R-BJrOMFwR.mjs";
|
|
3
|
+
//#region ../../../3-extensions/arktype-json/dist/runtime.mjs
|
|
4
|
+
const arktypeJsonRuntimeDescriptor = {
|
|
5
|
+
kind: "extension",
|
|
6
|
+
id: arktypeJsonPackMeta.id,
|
|
7
|
+
version: arktypeJsonPackMeta.version,
|
|
8
|
+
familyId: "sql",
|
|
9
|
+
targetId: "postgres",
|
|
10
|
+
types: { codecTypes: { codecDescriptors: Array.from(arktypeJsonCodecRegistry.values()) } },
|
|
11
|
+
codecs: () => Array.from(arktypeJsonCodecRegistry.values()),
|
|
12
|
+
create() {
|
|
13
|
+
return {
|
|
14
|
+
familyId: "sql",
|
|
15
|
+
targetId: "postgres"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { arktypeJsonRuntimeDescriptor, arktypeJsonRuntimeDescriptor as default };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/arktype-json/dist/runtime.mjs"],"sourcesContent":["import { t as arktypeJsonCodecRegistry } from \"./registry-Di7rBVdI.mjs\";\nimport { t as arktypeJsonPackMeta } from \"./pack-meta-sCd-w62R.mjs\";\n//#region src/exports/runtime.ts\nconst arktypeJsonRuntimeDescriptor = {\n\tkind: \"extension\",\n\tid: arktypeJsonPackMeta.id,\n\tversion: arktypeJsonPackMeta.version,\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\ttypes: { codecTypes: { codecDescriptors: Array.from(arktypeJsonCodecRegistry.values()) } },\n\tcodecs: () => Array.from(arktypeJsonCodecRegistry.values()),\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { arktypeJsonRuntimeDescriptor, arktypeJsonRuntimeDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;AAGA,MAAM,+BAA+B;CACpC,MAAM;CACN,IAAI,oBAAoB;CACxB,SAAS,oBAAoB;CAC7B,UAAU;CACV,UAAU;CACV,OAAO,EAAE,YAAY,EAAE,kBAAkB,MAAM,KAAK,yBAAyB,OAAO,CAAC,EAAE,EAAE;CACzF,cAAc,MAAM,KAAK,yBAAyB,OAAO,CAAC;CAC1D,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prisma/orm-extension-arktype-json",
|
|
3
|
+
"version": "0.16.0-dev.36",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"description": "Arktype-validated JSON columns for Prisma Next",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@prisma/orm-family-sql": "0.16.0-dev.36",
|
|
13
|
+
"@prisma/orm-framework": "0.16.0-dev.36",
|
|
14
|
+
"@standard-schema/spec": "^1.1.0",
|
|
15
|
+
"arktype": "~2.2.2"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@internal/extension-arktype-json": "0.16.0-dev.36",
|
|
19
|
+
"@repo/tsconfig": "0.16.0-dev.36",
|
|
20
|
+
"@repo/tsdown": "0.16.0-dev.36",
|
|
21
|
+
"@prisma/orm-target-postgres": "0.16.0-dev.36",
|
|
22
|
+
"tsdown": "0.22.14",
|
|
23
|
+
"typescript": "5.9.3"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@prisma/orm-target-postgres": "0.16.0-dev.36",
|
|
27
|
+
"typescript": ">=5.9"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"typescript": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
"./codec-types": "./dist/codec-types.mjs",
|
|
36
|
+
"./codecs": "./dist/codecs.mjs",
|
|
37
|
+
"./column-types": "./dist/column-types.mjs",
|
|
38
|
+
"./control": "./dist/control.mjs",
|
|
39
|
+
"./pack": "./dist/pack.mjs",
|
|
40
|
+
"./runtime": "./dist/runtime.mjs",
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/prisma/prisma.git",
|
|
46
|
+
"directory": "packages/9-public/@prisma/orm-extension-arktype-json"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsdown",
|
|
50
|
+
"lint": "biome check . --error-on-warnings",
|
|
51
|
+
"clean": "rm -rf dist src-gen"
|
|
52
|
+
}
|
|
53
|
+
}
|