@prisma/cli-init 0.0.0-dev.202511271207 → 0.0.0-dev.202511271233
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.
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
// ../../node_modules/.pnpm/valibot@1.
|
|
4
|
-
var store
|
|
3
|
+
// ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.8.3/node_modules/valibot/dist/index.js
|
|
4
|
+
var store;
|
|
5
5
|
// @__NO_SIDE_EFFECTS__
|
|
6
|
-
function getGlobalConfig(
|
|
6
|
+
function getGlobalConfig(config2) {
|
|
7
7
|
return {
|
|
8
|
-
lang:
|
|
9
|
-
message:
|
|
10
|
-
abortEarly:
|
|
11
|
-
abortPipeEarly:
|
|
8
|
+
lang: config2?.lang ?? store?.lang,
|
|
9
|
+
message: config2?.message,
|
|
10
|
+
abortEarly: config2?.abortEarly ?? store?.abortEarly,
|
|
11
|
+
abortPipeEarly: config2?.abortPipeEarly ?? store?.abortPipeEarly
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
var
|
|
14
|
+
var store2;
|
|
15
15
|
// @__NO_SIDE_EFFECTS__
|
|
16
16
|
function getGlobalMessage(lang) {
|
|
17
|
-
return
|
|
17
|
+
return store2?.get(lang);
|
|
18
18
|
}
|
|
19
|
-
var
|
|
19
|
+
var store3;
|
|
20
20
|
// @__NO_SIDE_EFFECTS__
|
|
21
21
|
function getSchemaMessage(lang) {
|
|
22
|
-
return
|
|
22
|
+
return store3?.get(lang);
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var store4;
|
|
25
25
|
// @__NO_SIDE_EFFECTS__
|
|
26
26
|
function getSpecificMessage(reference, lang) {
|
|
27
|
-
return
|
|
27
|
+
return store4?.get(reference)?.get(lang);
|
|
28
28
|
}
|
|
29
29
|
// @__NO_SIDE_EFFECTS__
|
|
30
30
|
function _stringify(input) {
|
|
31
31
|
const type = typeof input;
|
|
32
|
-
if (type === "string")
|
|
32
|
+
if (type === "string") {
|
|
33
33
|
return `"${input}"`;
|
|
34
|
-
|
|
34
|
+
}
|
|
35
|
+
if (type === "number" || type === "bigint" || type === "boolean") {
|
|
35
36
|
return `${input}`;
|
|
36
|
-
|
|
37
|
+
}
|
|
38
|
+
if (type === "object" || type === "function") {
|
|
37
39
|
return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
40
|
+
}
|
|
38
41
|
return type;
|
|
39
42
|
}
|
|
40
|
-
function _addIssue(context, label, dataset,
|
|
43
|
+
function _addIssue(context, label, dataset, config2, other) {
|
|
41
44
|
const input = other && "input" in other ? other.input : dataset.value;
|
|
42
45
|
const expected = other?.expected ?? context.expects ?? null;
|
|
43
46
|
const received = other?.received ?? /* @__PURE__ */ _stringify(input);
|
|
@@ -51,44 +54,51 @@ function _addIssue(context, label, dataset, config$1, other) {
|
|
|
51
54
|
requirement: context.requirement,
|
|
52
55
|
path: other?.path,
|
|
53
56
|
issues: other?.issues,
|
|
54
|
-
lang:
|
|
55
|
-
abortEarly:
|
|
56
|
-
abortPipeEarly:
|
|
57
|
+
lang: config2.lang,
|
|
58
|
+
abortEarly: config2.abortEarly,
|
|
59
|
+
abortPipeEarly: config2.abortPipeEarly
|
|
57
60
|
};
|
|
58
61
|
const isSchema = context.kind === "schema";
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
issue.message = typeof
|
|
62
|
-
|
|
62
|
+
const message2 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config2.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
|
|
63
|
+
if (message2 !== void 0) {
|
|
64
|
+
issue.message = typeof message2 === "function" ? (
|
|
65
|
+
// @ts-expect-error
|
|
66
|
+
message2(issue)
|
|
67
|
+
) : message2;
|
|
68
|
+
}
|
|
69
|
+
if (isSchema) {
|
|
63
70
|
dataset.typed = false;
|
|
64
|
-
|
|
71
|
+
}
|
|
72
|
+
if (dataset.issues) {
|
|
65
73
|
dataset.issues.push(issue);
|
|
66
|
-
else
|
|
74
|
+
} else {
|
|
67
75
|
dataset.issues = [issue];
|
|
76
|
+
}
|
|
68
77
|
}
|
|
69
78
|
// @__NO_SIDE_EFFECTS__
|
|
70
79
|
function _getStandardProps(context) {
|
|
71
80
|
return {
|
|
72
81
|
version: 1,
|
|
73
82
|
vendor: "valibot",
|
|
74
|
-
validate(
|
|
75
|
-
return context["~run"]({ value:
|
|
83
|
+
validate(value2) {
|
|
84
|
+
return context["~run"]({ value: value2 }, /* @__PURE__ */ getGlobalConfig());
|
|
76
85
|
}
|
|
77
86
|
};
|
|
78
87
|
}
|
|
79
88
|
// @__NO_SIDE_EFFECTS__
|
|
80
|
-
function _isValidObjectKey(
|
|
81
|
-
return Object.hasOwn(
|
|
89
|
+
function _isValidObjectKey(object2, key) {
|
|
90
|
+
return Object.hasOwn(object2, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
82
91
|
}
|
|
83
92
|
// @__NO_SIDE_EFFECTS__
|
|
84
|
-
function _joinExpects(
|
|
85
|
-
const list = [...new Set(
|
|
86
|
-
if (list.length > 1)
|
|
93
|
+
function _joinExpects(values2, separator) {
|
|
94
|
+
const list = [...new Set(values2)];
|
|
95
|
+
if (list.length > 1) {
|
|
87
96
|
return `(${list.join(` ${separator} `)})`;
|
|
97
|
+
}
|
|
88
98
|
return list[0] ?? "never";
|
|
89
99
|
}
|
|
90
100
|
// @__NO_SIDE_EFFECTS__
|
|
91
|
-
function integer(
|
|
101
|
+
function integer(message2) {
|
|
92
102
|
return {
|
|
93
103
|
kind: "validation",
|
|
94
104
|
type: "integer",
|
|
@@ -96,16 +106,17 @@ function integer(message$1) {
|
|
|
96
106
|
async: false,
|
|
97
107
|
expects: null,
|
|
98
108
|
requirement: Number.isInteger,
|
|
99
|
-
message:
|
|
100
|
-
"~run"(dataset,
|
|
101
|
-
if (dataset.typed && !this.requirement(dataset.value))
|
|
102
|
-
_addIssue(this, "integer", dataset,
|
|
109
|
+
message: message2,
|
|
110
|
+
"~run"(dataset, config2) {
|
|
111
|
+
if (dataset.typed && !this.requirement(dataset.value)) {
|
|
112
|
+
_addIssue(this, "integer", dataset, config2);
|
|
113
|
+
}
|
|
103
114
|
return dataset;
|
|
104
115
|
}
|
|
105
116
|
};
|
|
106
117
|
}
|
|
107
118
|
// @__NO_SIDE_EFFECTS__
|
|
108
|
-
function minLength(requirement,
|
|
119
|
+
function minLength(requirement, message2) {
|
|
109
120
|
return {
|
|
110
121
|
kind: "validation",
|
|
111
122
|
type: "min_length",
|
|
@@ -113,16 +124,19 @@ function minLength(requirement, message$1) {
|
|
|
113
124
|
async: false,
|
|
114
125
|
expects: `>=${requirement}`,
|
|
115
126
|
requirement,
|
|
116
|
-
message:
|
|
117
|
-
"~run"(dataset,
|
|
118
|
-
if (dataset.typed && dataset.value.length < this.requirement)
|
|
119
|
-
_addIssue(this, "length", dataset,
|
|
127
|
+
message: message2,
|
|
128
|
+
"~run"(dataset, config2) {
|
|
129
|
+
if (dataset.typed && dataset.value.length < this.requirement) {
|
|
130
|
+
_addIssue(this, "length", dataset, config2, {
|
|
131
|
+
received: `${dataset.value.length}`
|
|
132
|
+
});
|
|
133
|
+
}
|
|
120
134
|
return dataset;
|
|
121
135
|
}
|
|
122
136
|
};
|
|
123
137
|
}
|
|
124
138
|
// @__NO_SIDE_EFFECTS__
|
|
125
|
-
function minValue(requirement,
|
|
139
|
+
function minValue(requirement, message2) {
|
|
126
140
|
return {
|
|
127
141
|
kind: "validation",
|
|
128
142
|
type: "min_value",
|
|
@@ -130,39 +144,45 @@ function minValue(requirement, message$1) {
|
|
|
130
144
|
async: false,
|
|
131
145
|
expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,
|
|
132
146
|
requirement,
|
|
133
|
-
message:
|
|
134
|
-
"~run"(dataset,
|
|
135
|
-
if (dataset.typed && !(dataset.value >= this.requirement))
|
|
136
|
-
_addIssue(this, "value", dataset,
|
|
147
|
+
message: message2,
|
|
148
|
+
"~run"(dataset, config2) {
|
|
149
|
+
if (dataset.typed && !(dataset.value >= this.requirement)) {
|
|
150
|
+
_addIssue(this, "value", dataset, config2, {
|
|
151
|
+
received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value)
|
|
152
|
+
});
|
|
153
|
+
}
|
|
137
154
|
return dataset;
|
|
138
155
|
}
|
|
139
156
|
};
|
|
140
157
|
}
|
|
141
158
|
// @__NO_SIDE_EFFECTS__
|
|
142
|
-
function parseJson(
|
|
159
|
+
function parseJson(config2, message2) {
|
|
143
160
|
return {
|
|
144
161
|
kind: "transformation",
|
|
145
162
|
type: "parse_json",
|
|
146
163
|
reference: parseJson,
|
|
147
|
-
config:
|
|
148
|
-
message:
|
|
164
|
+
config: config2,
|
|
165
|
+
message: message2,
|
|
149
166
|
async: false,
|
|
150
|
-
"~run"(dataset,
|
|
167
|
+
"~run"(dataset, config3) {
|
|
151
168
|
try {
|
|
152
169
|
dataset.value = JSON.parse(dataset.value, this.config?.reviver);
|
|
153
170
|
} catch (error) {
|
|
154
171
|
if (error instanceof Error) {
|
|
155
|
-
_addIssue(this, "JSON", dataset,
|
|
172
|
+
_addIssue(this, "JSON", dataset, config3, {
|
|
173
|
+
received: `"${error.message}"`
|
|
174
|
+
});
|
|
156
175
|
dataset.typed = false;
|
|
157
|
-
} else
|
|
176
|
+
} else {
|
|
158
177
|
throw error;
|
|
178
|
+
}
|
|
159
179
|
}
|
|
160
180
|
return dataset;
|
|
161
181
|
}
|
|
162
182
|
};
|
|
163
183
|
}
|
|
164
184
|
// @__NO_SIDE_EFFECTS__
|
|
165
|
-
function regex(requirement,
|
|
185
|
+
function regex(requirement, message2) {
|
|
166
186
|
return {
|
|
167
187
|
kind: "validation",
|
|
168
188
|
type: "regex",
|
|
@@ -170,16 +190,17 @@ function regex(requirement, message$1) {
|
|
|
170
190
|
async: false,
|
|
171
191
|
expects: `${requirement}`,
|
|
172
192
|
requirement,
|
|
173
|
-
message:
|
|
174
|
-
"~run"(dataset,
|
|
175
|
-
if (dataset.typed && !this.requirement.test(dataset.value))
|
|
176
|
-
_addIssue(this, "format", dataset,
|
|
193
|
+
message: message2,
|
|
194
|
+
"~run"(dataset, config2) {
|
|
195
|
+
if (dataset.typed && !this.requirement.test(dataset.value)) {
|
|
196
|
+
_addIssue(this, "format", dataset, config2);
|
|
197
|
+
}
|
|
177
198
|
return dataset;
|
|
178
199
|
}
|
|
179
200
|
};
|
|
180
201
|
}
|
|
181
202
|
// @__NO_SIDE_EFFECTS__
|
|
182
|
-
function url(
|
|
203
|
+
function url(message2) {
|
|
183
204
|
return {
|
|
184
205
|
kind: "validation",
|
|
185
206
|
type: "url",
|
|
@@ -194,24 +215,37 @@ function url(message$1) {
|
|
|
194
215
|
return false;
|
|
195
216
|
}
|
|
196
217
|
},
|
|
197
|
-
message:
|
|
198
|
-
"~run"(dataset,
|
|
199
|
-
if (dataset.typed && !this.requirement(dataset.value))
|
|
200
|
-
_addIssue(this, "URL", dataset,
|
|
218
|
+
message: message2,
|
|
219
|
+
"~run"(dataset, config2) {
|
|
220
|
+
if (dataset.typed && !this.requirement(dataset.value)) {
|
|
221
|
+
_addIssue(this, "URL", dataset, config2);
|
|
222
|
+
}
|
|
201
223
|
return dataset;
|
|
202
224
|
}
|
|
203
225
|
};
|
|
204
226
|
}
|
|
205
227
|
// @__NO_SIDE_EFFECTS__
|
|
206
|
-
function getFallback(schema, dataset,
|
|
207
|
-
return typeof schema.fallback === "function" ?
|
|
228
|
+
function getFallback(schema, dataset, config2) {
|
|
229
|
+
return typeof schema.fallback === "function" ? (
|
|
230
|
+
// @ts-expect-error
|
|
231
|
+
schema.fallback(dataset, config2)
|
|
232
|
+
) : (
|
|
233
|
+
// @ts-expect-error
|
|
234
|
+
schema.fallback
|
|
235
|
+
);
|
|
208
236
|
}
|
|
209
237
|
// @__NO_SIDE_EFFECTS__
|
|
210
|
-
function getDefault(schema, dataset,
|
|
211
|
-
return typeof schema.default === "function" ?
|
|
238
|
+
function getDefault(schema, dataset, config2) {
|
|
239
|
+
return typeof schema.default === "function" ? (
|
|
240
|
+
// @ts-expect-error
|
|
241
|
+
schema.default(dataset, config2)
|
|
242
|
+
) : (
|
|
243
|
+
// @ts-expect-error
|
|
244
|
+
schema.default
|
|
245
|
+
);
|
|
212
246
|
}
|
|
213
247
|
// @__NO_SIDE_EFFECTS__
|
|
214
|
-
function array(item,
|
|
248
|
+
function array(item, message2) {
|
|
215
249
|
return {
|
|
216
250
|
kind: "schema",
|
|
217
251
|
type: "array",
|
|
@@ -219,52 +253,56 @@ function array(item, message$1) {
|
|
|
219
253
|
expects: "Array",
|
|
220
254
|
async: false,
|
|
221
255
|
item,
|
|
222
|
-
message:
|
|
256
|
+
message: message2,
|
|
223
257
|
get "~standard"() {
|
|
224
258
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
225
259
|
},
|
|
226
|
-
"~run"(dataset,
|
|
260
|
+
"~run"(dataset, config2) {
|
|
227
261
|
const input = dataset.value;
|
|
228
262
|
if (Array.isArray(input)) {
|
|
229
263
|
dataset.typed = true;
|
|
230
264
|
dataset.value = [];
|
|
231
265
|
for (let key = 0; key < input.length; key++) {
|
|
232
|
-
const
|
|
233
|
-
const itemDataset = this.item["~run"]({ value:
|
|
266
|
+
const value2 = input[key];
|
|
267
|
+
const itemDataset = this.item["~run"]({ value: value2 }, config2);
|
|
234
268
|
if (itemDataset.issues) {
|
|
235
269
|
const pathItem = {
|
|
236
270
|
type: "array",
|
|
237
271
|
origin: "value",
|
|
238
272
|
input,
|
|
239
273
|
key,
|
|
240
|
-
value:
|
|
274
|
+
value: value2
|
|
241
275
|
};
|
|
242
276
|
for (const issue of itemDataset.issues) {
|
|
243
|
-
if (issue.path)
|
|
277
|
+
if (issue.path) {
|
|
244
278
|
issue.path.unshift(pathItem);
|
|
245
|
-
else
|
|
279
|
+
} else {
|
|
246
280
|
issue.path = [pathItem];
|
|
281
|
+
}
|
|
247
282
|
dataset.issues?.push(issue);
|
|
248
283
|
}
|
|
249
|
-
if (!dataset.issues)
|
|
284
|
+
if (!dataset.issues) {
|
|
250
285
|
dataset.issues = itemDataset.issues;
|
|
251
|
-
|
|
286
|
+
}
|
|
287
|
+
if (config2.abortEarly) {
|
|
252
288
|
dataset.typed = false;
|
|
253
289
|
break;
|
|
254
290
|
}
|
|
255
291
|
}
|
|
256
|
-
if (!itemDataset.typed)
|
|
292
|
+
if (!itemDataset.typed) {
|
|
257
293
|
dataset.typed = false;
|
|
294
|
+
}
|
|
258
295
|
dataset.value.push(itemDataset.value);
|
|
259
296
|
}
|
|
260
|
-
} else
|
|
261
|
-
_addIssue(this, "type", dataset,
|
|
297
|
+
} else {
|
|
298
|
+
_addIssue(this, "type", dataset, config2);
|
|
299
|
+
}
|
|
262
300
|
return dataset;
|
|
263
301
|
}
|
|
264
302
|
};
|
|
265
303
|
}
|
|
266
304
|
// @__NO_SIDE_EFFECTS__
|
|
267
|
-
function literal(literal_,
|
|
305
|
+
function literal(literal_, message2) {
|
|
268
306
|
return {
|
|
269
307
|
kind: "schema",
|
|
270
308
|
type: "literal",
|
|
@@ -272,185 +310,213 @@ function literal(literal_, message$1) {
|
|
|
272
310
|
expects: /* @__PURE__ */ _stringify(literal_),
|
|
273
311
|
async: false,
|
|
274
312
|
literal: literal_,
|
|
275
|
-
message:
|
|
313
|
+
message: message2,
|
|
276
314
|
get "~standard"() {
|
|
277
315
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
278
316
|
},
|
|
279
|
-
"~run"(dataset,
|
|
280
|
-
if (dataset.value === this.literal)
|
|
317
|
+
"~run"(dataset, config2) {
|
|
318
|
+
if (dataset.value === this.literal) {
|
|
281
319
|
dataset.typed = true;
|
|
282
|
-
else
|
|
283
|
-
_addIssue(this, "type", dataset,
|
|
320
|
+
} else {
|
|
321
|
+
_addIssue(this, "type", dataset, config2);
|
|
322
|
+
}
|
|
284
323
|
return dataset;
|
|
285
324
|
}
|
|
286
325
|
};
|
|
287
326
|
}
|
|
288
327
|
// @__NO_SIDE_EFFECTS__
|
|
289
|
-
function looseObject(
|
|
328
|
+
function looseObject(entries2, message2) {
|
|
290
329
|
return {
|
|
291
330
|
kind: "schema",
|
|
292
331
|
type: "loose_object",
|
|
293
332
|
reference: looseObject,
|
|
294
333
|
expects: "Object",
|
|
295
334
|
async: false,
|
|
296
|
-
entries:
|
|
297
|
-
message:
|
|
335
|
+
entries: entries2,
|
|
336
|
+
message: message2,
|
|
298
337
|
get "~standard"() {
|
|
299
338
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
300
339
|
},
|
|
301
|
-
"~run"(dataset,
|
|
340
|
+
"~run"(dataset, config2) {
|
|
302
341
|
const input = dataset.value;
|
|
303
342
|
if (input && typeof input === "object") {
|
|
304
343
|
dataset.typed = true;
|
|
305
344
|
dataset.value = {};
|
|
306
345
|
for (const key in this.entries) {
|
|
307
346
|
const valueSchema = this.entries[key];
|
|
308
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") &&
|
|
309
|
-
|
|
310
|
-
const
|
|
347
|
+
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && // @ts-expect-error
|
|
348
|
+
valueSchema.default !== void 0) {
|
|
349
|
+
const value2 = key in input ? (
|
|
350
|
+
// @ts-expect-error
|
|
351
|
+
input[key]
|
|
352
|
+
) : /* @__PURE__ */ getDefault(valueSchema);
|
|
353
|
+
const valueDataset = valueSchema["~run"]({ value: value2 }, config2);
|
|
311
354
|
if (valueDataset.issues) {
|
|
312
355
|
const pathItem = {
|
|
313
356
|
type: "object",
|
|
314
357
|
origin: "value",
|
|
315
358
|
input,
|
|
316
359
|
key,
|
|
317
|
-
value:
|
|
360
|
+
value: value2
|
|
318
361
|
};
|
|
319
362
|
for (const issue of valueDataset.issues) {
|
|
320
|
-
if (issue.path)
|
|
363
|
+
if (issue.path) {
|
|
321
364
|
issue.path.unshift(pathItem);
|
|
322
|
-
else
|
|
365
|
+
} else {
|
|
323
366
|
issue.path = [pathItem];
|
|
367
|
+
}
|
|
324
368
|
dataset.issues?.push(issue);
|
|
325
369
|
}
|
|
326
|
-
if (!dataset.issues)
|
|
370
|
+
if (!dataset.issues) {
|
|
327
371
|
dataset.issues = valueDataset.issues;
|
|
328
|
-
|
|
372
|
+
}
|
|
373
|
+
if (config2.abortEarly) {
|
|
329
374
|
dataset.typed = false;
|
|
330
375
|
break;
|
|
331
376
|
}
|
|
332
377
|
}
|
|
333
|
-
if (!valueDataset.typed)
|
|
378
|
+
if (!valueDataset.typed) {
|
|
334
379
|
dataset.typed = false;
|
|
380
|
+
}
|
|
335
381
|
dataset.value[key] = valueDataset.value;
|
|
336
|
-
} else if (valueSchema.fallback !== void 0)
|
|
382
|
+
} else if (valueSchema.fallback !== void 0) {
|
|
337
383
|
dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
338
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
339
|
-
_addIssue(this, "key", dataset,
|
|
384
|
+
} else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
385
|
+
_addIssue(this, "key", dataset, config2, {
|
|
340
386
|
input: void 0,
|
|
341
387
|
expected: `"${key}"`,
|
|
342
|
-
path: [
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
388
|
+
path: [
|
|
389
|
+
{
|
|
390
|
+
type: "object",
|
|
391
|
+
origin: "key",
|
|
392
|
+
input,
|
|
393
|
+
key,
|
|
394
|
+
// @ts-expect-error
|
|
395
|
+
value: input[key]
|
|
396
|
+
}
|
|
397
|
+
]
|
|
349
398
|
});
|
|
350
|
-
if (
|
|
399
|
+
if (config2.abortEarly) {
|
|
351
400
|
break;
|
|
401
|
+
}
|
|
352
402
|
}
|
|
353
403
|
}
|
|
354
|
-
if (!dataset.issues || !
|
|
355
|
-
for (const key in input)
|
|
356
|
-
if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries))
|
|
404
|
+
if (!dataset.issues || !config2.abortEarly) {
|
|
405
|
+
for (const key in input) {
|
|
406
|
+
if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) {
|
|
357
407
|
dataset.value[key] = input[key];
|
|
408
|
+
}
|
|
409
|
+
}
|
|
358
410
|
}
|
|
359
|
-
} else
|
|
360
|
-
_addIssue(this, "type", dataset,
|
|
411
|
+
} else {
|
|
412
|
+
_addIssue(this, "type", dataset, config2);
|
|
413
|
+
}
|
|
361
414
|
return dataset;
|
|
362
415
|
}
|
|
363
416
|
};
|
|
364
417
|
}
|
|
365
418
|
// @__NO_SIDE_EFFECTS__
|
|
366
|
-
function number(
|
|
419
|
+
function number(message2) {
|
|
367
420
|
return {
|
|
368
421
|
kind: "schema",
|
|
369
422
|
type: "number",
|
|
370
423
|
reference: number,
|
|
371
424
|
expects: "number",
|
|
372
425
|
async: false,
|
|
373
|
-
message:
|
|
426
|
+
message: message2,
|
|
374
427
|
get "~standard"() {
|
|
375
428
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
376
429
|
},
|
|
377
|
-
"~run"(dataset,
|
|
378
|
-
if (typeof dataset.value === "number" && !isNaN(dataset.value))
|
|
430
|
+
"~run"(dataset, config2) {
|
|
431
|
+
if (typeof dataset.value === "number" && !isNaN(dataset.value)) {
|
|
379
432
|
dataset.typed = true;
|
|
380
|
-
else
|
|
381
|
-
_addIssue(this, "type", dataset,
|
|
433
|
+
} else {
|
|
434
|
+
_addIssue(this, "type", dataset, config2);
|
|
435
|
+
}
|
|
382
436
|
return dataset;
|
|
383
437
|
}
|
|
384
438
|
};
|
|
385
439
|
}
|
|
386
440
|
// @__NO_SIDE_EFFECTS__
|
|
387
|
-
function object(
|
|
441
|
+
function object(entries2, message2) {
|
|
388
442
|
return {
|
|
389
443
|
kind: "schema",
|
|
390
444
|
type: "object",
|
|
391
445
|
reference: object,
|
|
392
446
|
expects: "Object",
|
|
393
447
|
async: false,
|
|
394
|
-
entries:
|
|
395
|
-
message:
|
|
448
|
+
entries: entries2,
|
|
449
|
+
message: message2,
|
|
396
450
|
get "~standard"() {
|
|
397
451
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
398
452
|
},
|
|
399
|
-
"~run"(dataset,
|
|
453
|
+
"~run"(dataset, config2) {
|
|
400
454
|
const input = dataset.value;
|
|
401
455
|
if (input && typeof input === "object") {
|
|
402
456
|
dataset.typed = true;
|
|
403
457
|
dataset.value = {};
|
|
404
458
|
for (const key in this.entries) {
|
|
405
459
|
const valueSchema = this.entries[key];
|
|
406
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") &&
|
|
407
|
-
|
|
408
|
-
const
|
|
460
|
+
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && // @ts-expect-error
|
|
461
|
+
valueSchema.default !== void 0) {
|
|
462
|
+
const value2 = key in input ? (
|
|
463
|
+
// @ts-expect-error
|
|
464
|
+
input[key]
|
|
465
|
+
) : /* @__PURE__ */ getDefault(valueSchema);
|
|
466
|
+
const valueDataset = valueSchema["~run"]({ value: value2 }, config2);
|
|
409
467
|
if (valueDataset.issues) {
|
|
410
468
|
const pathItem = {
|
|
411
469
|
type: "object",
|
|
412
470
|
origin: "value",
|
|
413
471
|
input,
|
|
414
472
|
key,
|
|
415
|
-
value:
|
|
473
|
+
value: value2
|
|
416
474
|
};
|
|
417
475
|
for (const issue of valueDataset.issues) {
|
|
418
|
-
if (issue.path)
|
|
476
|
+
if (issue.path) {
|
|
419
477
|
issue.path.unshift(pathItem);
|
|
420
|
-
else
|
|
478
|
+
} else {
|
|
421
479
|
issue.path = [pathItem];
|
|
480
|
+
}
|
|
422
481
|
dataset.issues?.push(issue);
|
|
423
482
|
}
|
|
424
|
-
if (!dataset.issues)
|
|
483
|
+
if (!dataset.issues) {
|
|
425
484
|
dataset.issues = valueDataset.issues;
|
|
426
|
-
|
|
485
|
+
}
|
|
486
|
+
if (config2.abortEarly) {
|
|
427
487
|
dataset.typed = false;
|
|
428
488
|
break;
|
|
429
489
|
}
|
|
430
490
|
}
|
|
431
|
-
if (!valueDataset.typed)
|
|
491
|
+
if (!valueDataset.typed) {
|
|
432
492
|
dataset.typed = false;
|
|
493
|
+
}
|
|
433
494
|
dataset.value[key] = valueDataset.value;
|
|
434
|
-
} else if (valueSchema.fallback !== void 0)
|
|
495
|
+
} else if (valueSchema.fallback !== void 0) {
|
|
435
496
|
dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
436
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
437
|
-
_addIssue(this, "key", dataset,
|
|
497
|
+
} else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
498
|
+
_addIssue(this, "key", dataset, config2, {
|
|
438
499
|
input: void 0,
|
|
439
500
|
expected: `"${key}"`,
|
|
440
|
-
path: [
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
501
|
+
path: [
|
|
502
|
+
{
|
|
503
|
+
type: "object",
|
|
504
|
+
origin: "key",
|
|
505
|
+
input,
|
|
506
|
+
key,
|
|
507
|
+
// @ts-expect-error
|
|
508
|
+
value: input[key]
|
|
509
|
+
}
|
|
510
|
+
]
|
|
447
511
|
});
|
|
448
|
-
if (
|
|
512
|
+
if (config2.abortEarly) {
|
|
449
513
|
break;
|
|
514
|
+
}
|
|
450
515
|
}
|
|
451
516
|
}
|
|
452
|
-
} else
|
|
453
|
-
_addIssue(this, "type", dataset,
|
|
517
|
+
} else {
|
|
518
|
+
_addIssue(this, "type", dataset, config2);
|
|
519
|
+
}
|
|
454
520
|
return dataset;
|
|
455
521
|
}
|
|
456
522
|
};
|
|
@@ -468,36 +534,38 @@ function optional(wrapped, default_) {
|
|
|
468
534
|
get "~standard"() {
|
|
469
535
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
470
536
|
},
|
|
471
|
-
"~run"(dataset,
|
|
537
|
+
"~run"(dataset, config2) {
|
|
472
538
|
if (dataset.value === void 0) {
|
|
473
|
-
if (this.default !== void 0)
|
|
474
|
-
dataset.value = /* @__PURE__ */ getDefault(this, dataset,
|
|
539
|
+
if (this.default !== void 0) {
|
|
540
|
+
dataset.value = /* @__PURE__ */ getDefault(this, dataset, config2);
|
|
541
|
+
}
|
|
475
542
|
if (dataset.value === void 0) {
|
|
476
543
|
dataset.typed = true;
|
|
477
544
|
return dataset;
|
|
478
545
|
}
|
|
479
546
|
}
|
|
480
|
-
return this.wrapped["~run"](dataset,
|
|
547
|
+
return this.wrapped["~run"](dataset, config2);
|
|
481
548
|
}
|
|
482
549
|
};
|
|
483
550
|
}
|
|
484
551
|
// @__NO_SIDE_EFFECTS__
|
|
485
|
-
function string(
|
|
552
|
+
function string(message2) {
|
|
486
553
|
return {
|
|
487
554
|
kind: "schema",
|
|
488
555
|
type: "string",
|
|
489
556
|
reference: string,
|
|
490
557
|
expects: "string",
|
|
491
558
|
async: false,
|
|
492
|
-
message:
|
|
559
|
+
message: message2,
|
|
493
560
|
get "~standard"() {
|
|
494
561
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
495
562
|
},
|
|
496
|
-
"~run"(dataset,
|
|
497
|
-
if (typeof dataset.value === "string")
|
|
563
|
+
"~run"(dataset, config2) {
|
|
564
|
+
if (typeof dataset.value === "string") {
|
|
498
565
|
dataset.typed = true;
|
|
499
|
-
else
|
|
500
|
-
_addIssue(this, "type", dataset,
|
|
566
|
+
} else {
|
|
567
|
+
_addIssue(this, "type", dataset, config2);
|
|
568
|
+
}
|
|
501
569
|
return dataset;
|
|
502
570
|
}
|
|
503
571
|
};
|
|
@@ -505,88 +573,107 @@ function string(message$1) {
|
|
|
505
573
|
// @__NO_SIDE_EFFECTS__
|
|
506
574
|
function _subIssues(datasets) {
|
|
507
575
|
let issues;
|
|
508
|
-
if (datasets)
|
|
509
|
-
for (const dataset of datasets)
|
|
510
|
-
if (issues)
|
|
576
|
+
if (datasets) {
|
|
577
|
+
for (const dataset of datasets) {
|
|
578
|
+
if (issues) {
|
|
511
579
|
issues.push(...dataset.issues);
|
|
512
|
-
else
|
|
580
|
+
} else {
|
|
513
581
|
issues = dataset.issues;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
514
585
|
return issues;
|
|
515
586
|
}
|
|
516
587
|
// @__NO_SIDE_EFFECTS__
|
|
517
|
-
function union(options,
|
|
588
|
+
function union(options, message2) {
|
|
518
589
|
return {
|
|
519
590
|
kind: "schema",
|
|
520
591
|
type: "union",
|
|
521
592
|
reference: union,
|
|
522
|
-
expects: /* @__PURE__ */ _joinExpects(
|
|
593
|
+
expects: /* @__PURE__ */ _joinExpects(
|
|
594
|
+
options.map((option) => option.expects),
|
|
595
|
+
"|"
|
|
596
|
+
),
|
|
523
597
|
async: false,
|
|
524
598
|
options,
|
|
525
|
-
message:
|
|
599
|
+
message: message2,
|
|
526
600
|
get "~standard"() {
|
|
527
601
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
528
602
|
},
|
|
529
|
-
"~run"(dataset,
|
|
603
|
+
"~run"(dataset, config2) {
|
|
530
604
|
let validDataset;
|
|
531
605
|
let typedDatasets;
|
|
532
606
|
let untypedDatasets;
|
|
533
607
|
for (const schema of this.options) {
|
|
534
|
-
const optionDataset = schema["~run"]({ value: dataset.value },
|
|
535
|
-
if (optionDataset.typed)
|
|
536
|
-
if (optionDataset.issues)
|
|
537
|
-
if (typedDatasets)
|
|
608
|
+
const optionDataset = schema["~run"]({ value: dataset.value }, config2);
|
|
609
|
+
if (optionDataset.typed) {
|
|
610
|
+
if (optionDataset.issues) {
|
|
611
|
+
if (typedDatasets) {
|
|
538
612
|
typedDatasets.push(optionDataset);
|
|
539
|
-
else
|
|
613
|
+
} else {
|
|
540
614
|
typedDatasets = [optionDataset];
|
|
541
|
-
|
|
615
|
+
}
|
|
616
|
+
} else {
|
|
542
617
|
validDataset = optionDataset;
|
|
543
618
|
break;
|
|
544
619
|
}
|
|
545
|
-
else
|
|
546
|
-
untypedDatasets
|
|
547
|
-
|
|
548
|
-
|
|
620
|
+
} else {
|
|
621
|
+
if (untypedDatasets) {
|
|
622
|
+
untypedDatasets.push(optionDataset);
|
|
623
|
+
} else {
|
|
624
|
+
untypedDatasets = [optionDataset];
|
|
625
|
+
}
|
|
626
|
+
}
|
|
549
627
|
}
|
|
550
|
-
if (validDataset)
|
|
628
|
+
if (validDataset) {
|
|
551
629
|
return validDataset;
|
|
630
|
+
}
|
|
552
631
|
if (typedDatasets) {
|
|
553
|
-
if (typedDatasets.length === 1)
|
|
632
|
+
if (typedDatasets.length === 1) {
|
|
554
633
|
return typedDatasets[0];
|
|
555
|
-
|
|
634
|
+
}
|
|
635
|
+
_addIssue(this, "type", dataset, config2, {
|
|
636
|
+
issues: /* @__PURE__ */ _subIssues(typedDatasets)
|
|
637
|
+
});
|
|
556
638
|
dataset.typed = true;
|
|
557
|
-
} else if (untypedDatasets?.length === 1)
|
|
639
|
+
} else if (untypedDatasets?.length === 1) {
|
|
558
640
|
return untypedDatasets[0];
|
|
559
|
-
else
|
|
560
|
-
_addIssue(this, "type", dataset,
|
|
641
|
+
} else {
|
|
642
|
+
_addIssue(this, "type", dataset, config2, {
|
|
643
|
+
issues: /* @__PURE__ */ _subIssues(untypedDatasets)
|
|
644
|
+
});
|
|
645
|
+
}
|
|
561
646
|
return dataset;
|
|
562
647
|
}
|
|
563
648
|
};
|
|
564
649
|
}
|
|
565
650
|
// @__NO_SIDE_EFFECTS__
|
|
566
|
-
function pipe(...
|
|
651
|
+
function pipe(...pipe2) {
|
|
567
652
|
return {
|
|
568
|
-
...
|
|
569
|
-
pipe:
|
|
653
|
+
...pipe2[0],
|
|
654
|
+
pipe: pipe2,
|
|
570
655
|
get "~standard"() {
|
|
571
656
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
572
657
|
},
|
|
573
|
-
"~run"(dataset,
|
|
574
|
-
for (const item of
|
|
658
|
+
"~run"(dataset, config2) {
|
|
659
|
+
for (const item of pipe2) {
|
|
575
660
|
if (item.kind !== "metadata") {
|
|
576
661
|
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
577
662
|
dataset.typed = false;
|
|
578
663
|
break;
|
|
579
664
|
}
|
|
580
|
-
if (!dataset.issues || !
|
|
581
|
-
dataset = item["~run"](dataset,
|
|
665
|
+
if (!dataset.issues || !config2.abortEarly && !config2.abortPipeEarly) {
|
|
666
|
+
dataset = item["~run"](dataset, config2);
|
|
667
|
+
}
|
|
582
668
|
}
|
|
669
|
+
}
|
|
583
670
|
return dataset;
|
|
584
671
|
}
|
|
585
672
|
};
|
|
586
673
|
}
|
|
587
674
|
// @__NO_SIDE_EFFECTS__
|
|
588
|
-
function safeParse(schema, input,
|
|
589
|
-
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(
|
|
675
|
+
function safeParse(schema, input, config2) {
|
|
676
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config2));
|
|
590
677
|
return {
|
|
591
678
|
typed: dataset.typed,
|
|
592
679
|
success: !dataset.issues,
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
url,
|
|
22
22
|
withResolvers,
|
|
23
23
|
y
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7C5I22R2.js";
|
|
25
25
|
import {
|
|
26
26
|
__commonJS,
|
|
27
27
|
__require,
|
|
@@ -2638,7 +2638,7 @@ async function getApp(port, dbServer, serverState) {
|
|
|
2638
2638
|
const { debug: debug3 } = serverState;
|
|
2639
2639
|
const [{ Hono }, { accelerateRoute }, { utilityRoute }] = await Promise.all([
|
|
2640
2640
|
import("hono/tiny"),
|
|
2641
|
-
import("./accelerate-
|
|
2641
|
+
import("./accelerate-SOBMYP3B.js"),
|
|
2642
2642
|
import("./utility-QJR3G2JJ.js")
|
|
2643
2643
|
]);
|
|
2644
2644
|
const app = new Hono();
|
|
@@ -3185,8 +3185,8 @@ var LoginState = class {
|
|
|
3185
3185
|
authUrl.searchParams.set("code_challenge", challenge);
|
|
3186
3186
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
|
3187
3187
|
authUrl.searchParams.set("utm_source", "orm");
|
|
3188
|
-
authUrl.searchParams.set("utm_medium", "
|
|
3189
|
-
authUrl.searchParams.set("utm_campaign", "
|
|
3188
|
+
authUrl.searchParams.set("utm_medium", "command-prisma-init-db");
|
|
3189
|
+
authUrl.searchParams.set("utm_campaign", "6.X.X");
|
|
3190
3190
|
await open(authUrl.href);
|
|
3191
3191
|
}
|
|
3192
3192
|
async handleCallback(url2) {
|