ph-cmd 6.0.0-dev.45 → 6.0.0-dev.48
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/build/cli.js +129 -67
- package/build/cli.old.js +125 -61
- package/build/generate-commands-docs.js +130 -68
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -375503,16 +375503,16 @@ var require_to_json_schema = __commonJS((exports) => {
|
|
|
375503
375503
|
}
|
|
375504
375504
|
return false;
|
|
375505
375505
|
}
|
|
375506
|
-
var createToJSONSchemaMethod = (schema3,
|
|
375507
|
-
const ctx = initializeContext({ ...params, processors:
|
|
375506
|
+
var createToJSONSchemaMethod = (schema3, processors2 = {}) => (params) => {
|
|
375507
|
+
const ctx = initializeContext({ ...params, processors: processors2 });
|
|
375508
375508
|
process5(schema3, ctx);
|
|
375509
375509
|
extractDefs(ctx, schema3);
|
|
375510
375510
|
return finalize(ctx, schema3);
|
|
375511
375511
|
};
|
|
375512
375512
|
exports.createToJSONSchemaMethod = createToJSONSchemaMethod;
|
|
375513
|
-
var createStandardJSONSchemaMethod = (schema3, io5,
|
|
375513
|
+
var createStandardJSONSchemaMethod = (schema3, io5, processors2 = {}) => (params) => {
|
|
375514
375514
|
const { libraryOptions, target } = params ?? {};
|
|
375515
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io5, processors:
|
|
375515
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io5, processors: processors2 });
|
|
375516
375516
|
process5(schema3, ctx);
|
|
375517
375517
|
extractDefs(ctx, schema3);
|
|
375518
375518
|
return finalize(ctx, schema3);
|
|
@@ -382918,7 +382918,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
382918
382918
|
exports.preprocess = preprocess;
|
|
382919
382919
|
var core = __importStar(require_core2());
|
|
382920
382920
|
var index_js_1 = require_core2();
|
|
382921
|
-
var
|
|
382921
|
+
var processors2 = __importStar(require_json_schema_processors());
|
|
382922
382922
|
var to_json_schema_js_1 = require_to_json_schema();
|
|
382923
382923
|
var checks = __importStar(require_checks2());
|
|
382924
382924
|
var iso = __importStar(require_iso());
|
|
@@ -383009,7 +383009,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383009
383009
|
exports._ZodString = core.$constructor("_ZodString", (inst, def) => {
|
|
383010
383010
|
core.$ZodString.init(inst, def);
|
|
383011
383011
|
exports.ZodType.init(inst, def);
|
|
383012
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383012
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.stringProcessor(inst, ctx, json3, params);
|
|
383013
383013
|
const bag = inst._zod.bag;
|
|
383014
383014
|
inst.format = bag.format ?? null;
|
|
383015
383015
|
inst.minLength = bag.minimum ?? null;
|
|
@@ -383248,7 +383248,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383248
383248
|
exports.ZodNumber = core.$constructor("ZodNumber", (inst, def) => {
|
|
383249
383249
|
core.$ZodNumber.init(inst, def);
|
|
383250
383250
|
exports.ZodType.init(inst, def);
|
|
383251
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383251
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.numberProcessor(inst, ctx, json3, params);
|
|
383252
383252
|
inst.gt = (value2, params) => inst.check(checks.gt(value2, params));
|
|
383253
383253
|
inst.gte = (value2, params) => inst.check(checks.gte(value2, params));
|
|
383254
383254
|
inst.min = (value2, params) => inst.check(checks.gte(value2, params));
|
|
@@ -383296,7 +383296,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383296
383296
|
exports.ZodBoolean = core.$constructor("ZodBoolean", (inst, def) => {
|
|
383297
383297
|
core.$ZodBoolean.init(inst, def);
|
|
383298
383298
|
exports.ZodType.init(inst, def);
|
|
383299
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383299
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.booleanProcessor(inst, ctx, json3, params);
|
|
383300
383300
|
});
|
|
383301
383301
|
function boolean6(params) {
|
|
383302
383302
|
return core._boolean(exports.ZodBoolean, params);
|
|
@@ -383304,7 +383304,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383304
383304
|
exports.ZodBigInt = core.$constructor("ZodBigInt", (inst, def) => {
|
|
383305
383305
|
core.$ZodBigInt.init(inst, def);
|
|
383306
383306
|
exports.ZodType.init(inst, def);
|
|
383307
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383307
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.bigintProcessor(inst, ctx, json3, params);
|
|
383308
383308
|
inst.gte = (value2, params) => inst.check(checks.gte(value2, params));
|
|
383309
383309
|
inst.min = (value2, params) => inst.check(checks.gte(value2, params));
|
|
383310
383310
|
inst.gt = (value2, params) => inst.check(checks.gt(value2, params));
|
|
@@ -383339,7 +383339,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383339
383339
|
exports.ZodSymbol = core.$constructor("ZodSymbol", (inst, def) => {
|
|
383340
383340
|
core.$ZodSymbol.init(inst, def);
|
|
383341
383341
|
exports.ZodType.init(inst, def);
|
|
383342
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383342
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.symbolProcessor(inst, ctx, json3, params);
|
|
383343
383343
|
});
|
|
383344
383344
|
function symbol(params) {
|
|
383345
383345
|
return core._symbol(exports.ZodSymbol, params);
|
|
@@ -383347,7 +383347,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383347
383347
|
exports.ZodUndefined = core.$constructor("ZodUndefined", (inst, def) => {
|
|
383348
383348
|
core.$ZodUndefined.init(inst, def);
|
|
383349
383349
|
exports.ZodType.init(inst, def);
|
|
383350
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383350
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.undefinedProcessor(inst, ctx, json3, params);
|
|
383351
383351
|
});
|
|
383352
383352
|
function _undefined(params) {
|
|
383353
383353
|
return core._undefined(exports.ZodUndefined, params);
|
|
@@ -383355,7 +383355,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383355
383355
|
exports.ZodNull = core.$constructor("ZodNull", (inst, def) => {
|
|
383356
383356
|
core.$ZodNull.init(inst, def);
|
|
383357
383357
|
exports.ZodType.init(inst, def);
|
|
383358
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383358
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nullProcessor(inst, ctx, json3, params);
|
|
383359
383359
|
});
|
|
383360
383360
|
function _null(params) {
|
|
383361
383361
|
return core._null(exports.ZodNull, params);
|
|
@@ -383363,7 +383363,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383363
383363
|
exports.ZodAny = core.$constructor("ZodAny", (inst, def) => {
|
|
383364
383364
|
core.$ZodAny.init(inst, def);
|
|
383365
383365
|
exports.ZodType.init(inst, def);
|
|
383366
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383366
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.anyProcessor(inst, ctx, json3, params);
|
|
383367
383367
|
});
|
|
383368
383368
|
function any() {
|
|
383369
383369
|
return core._any(exports.ZodAny);
|
|
@@ -383371,7 +383371,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383371
383371
|
exports.ZodUnknown = core.$constructor("ZodUnknown", (inst, def) => {
|
|
383372
383372
|
core.$ZodUnknown.init(inst, def);
|
|
383373
383373
|
exports.ZodType.init(inst, def);
|
|
383374
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383374
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.unknownProcessor(inst, ctx, json3, params);
|
|
383375
383375
|
});
|
|
383376
383376
|
function unknown() {
|
|
383377
383377
|
return core._unknown(exports.ZodUnknown);
|
|
@@ -383379,7 +383379,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383379
383379
|
exports.ZodNever = core.$constructor("ZodNever", (inst, def) => {
|
|
383380
383380
|
core.$ZodNever.init(inst, def);
|
|
383381
383381
|
exports.ZodType.init(inst, def);
|
|
383382
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383382
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.neverProcessor(inst, ctx, json3, params);
|
|
383383
383383
|
});
|
|
383384
383384
|
function never(params) {
|
|
383385
383385
|
return core._never(exports.ZodNever, params);
|
|
@@ -383387,7 +383387,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383387
383387
|
exports.ZodVoid = core.$constructor("ZodVoid", (inst, def) => {
|
|
383388
383388
|
core.$ZodVoid.init(inst, def);
|
|
383389
383389
|
exports.ZodType.init(inst, def);
|
|
383390
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383390
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.voidProcessor(inst, ctx, json3, params);
|
|
383391
383391
|
});
|
|
383392
383392
|
function _void(params) {
|
|
383393
383393
|
return core._void(exports.ZodVoid, params);
|
|
@@ -383395,7 +383395,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383395
383395
|
exports.ZodDate = core.$constructor("ZodDate", (inst, def) => {
|
|
383396
383396
|
core.$ZodDate.init(inst, def);
|
|
383397
383397
|
exports.ZodType.init(inst, def);
|
|
383398
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383398
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.dateProcessor(inst, ctx, json3, params);
|
|
383399
383399
|
inst.min = (value2, params) => inst.check(checks.gte(value2, params));
|
|
383400
383400
|
inst.max = (value2, params) => inst.check(checks.lte(value2, params));
|
|
383401
383401
|
const c8 = inst._zod.bag;
|
|
@@ -383408,7 +383408,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383408
383408
|
exports.ZodArray = core.$constructor("ZodArray", (inst, def) => {
|
|
383409
383409
|
core.$ZodArray.init(inst, def);
|
|
383410
383410
|
exports.ZodType.init(inst, def);
|
|
383411
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383411
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.arrayProcessor(inst, ctx, json3, params);
|
|
383412
383412
|
inst.element = def.element;
|
|
383413
383413
|
inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
|
|
383414
383414
|
inst.nonempty = (params) => inst.check(checks.minLength(1, params));
|
|
@@ -383426,7 +383426,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383426
383426
|
exports.ZodObject = core.$constructor("ZodObject", (inst, def) => {
|
|
383427
383427
|
core.$ZodObjectJIT.init(inst, def);
|
|
383428
383428
|
exports.ZodType.init(inst, def);
|
|
383429
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383429
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.objectProcessor(inst, ctx, json3, params);
|
|
383430
383430
|
index_js_1.util.defineLazy(inst, "shape", () => {
|
|
383431
383431
|
return def.shape;
|
|
383432
383432
|
});
|
|
@@ -383475,7 +383475,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383475
383475
|
exports.ZodUnion = core.$constructor("ZodUnion", (inst, def) => {
|
|
383476
383476
|
core.$ZodUnion.init(inst, def);
|
|
383477
383477
|
exports.ZodType.init(inst, def);
|
|
383478
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383478
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.unionProcessor(inst, ctx, json3, params);
|
|
383479
383479
|
inst.options = def.options;
|
|
383480
383480
|
});
|
|
383481
383481
|
function union(options8, params) {
|
|
@@ -383488,7 +383488,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383488
383488
|
exports.ZodXor = core.$constructor("ZodXor", (inst, def) => {
|
|
383489
383489
|
exports.ZodUnion.init(inst, def);
|
|
383490
383490
|
core.$ZodXor.init(inst, def);
|
|
383491
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383491
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.unionProcessor(inst, ctx, json3, params);
|
|
383492
383492
|
inst.options = def.options;
|
|
383493
383493
|
});
|
|
383494
383494
|
function xor(options8, params) {
|
|
@@ -383514,7 +383514,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383514
383514
|
exports.ZodIntersection = core.$constructor("ZodIntersection", (inst, def) => {
|
|
383515
383515
|
core.$ZodIntersection.init(inst, def);
|
|
383516
383516
|
exports.ZodType.init(inst, def);
|
|
383517
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383517
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.intersectionProcessor(inst, ctx, json3, params);
|
|
383518
383518
|
});
|
|
383519
383519
|
function intersection(left, right) {
|
|
383520
383520
|
return new exports.ZodIntersection({
|
|
@@ -383526,7 +383526,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383526
383526
|
exports.ZodTuple = core.$constructor("ZodTuple", (inst, def) => {
|
|
383527
383527
|
core.$ZodTuple.init(inst, def);
|
|
383528
383528
|
exports.ZodType.init(inst, def);
|
|
383529
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383529
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.tupleProcessor(inst, ctx, json3, params);
|
|
383530
383530
|
inst.rest = (rest) => inst.clone({
|
|
383531
383531
|
...inst._zod.def,
|
|
383532
383532
|
rest
|
|
@@ -383546,7 +383546,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383546
383546
|
exports.ZodRecord = core.$constructor("ZodRecord", (inst, def) => {
|
|
383547
383547
|
core.$ZodRecord.init(inst, def);
|
|
383548
383548
|
exports.ZodType.init(inst, def);
|
|
383549
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383549
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.recordProcessor(inst, ctx, json3, params);
|
|
383550
383550
|
inst.keyType = def.keyType;
|
|
383551
383551
|
inst.valueType = def.valueType;
|
|
383552
383552
|
});
|
|
@@ -383580,7 +383580,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383580
383580
|
exports.ZodMap = core.$constructor("ZodMap", (inst, def) => {
|
|
383581
383581
|
core.$ZodMap.init(inst, def);
|
|
383582
383582
|
exports.ZodType.init(inst, def);
|
|
383583
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383583
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.mapProcessor(inst, ctx, json3, params);
|
|
383584
383584
|
inst.keyType = def.keyType;
|
|
383585
383585
|
inst.valueType = def.valueType;
|
|
383586
383586
|
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
@@ -383599,7 +383599,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383599
383599
|
exports.ZodSet = core.$constructor("ZodSet", (inst, def) => {
|
|
383600
383600
|
core.$ZodSet.init(inst, def);
|
|
383601
383601
|
exports.ZodType.init(inst, def);
|
|
383602
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383602
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.setProcessor(inst, ctx, json3, params);
|
|
383603
383603
|
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
383604
383604
|
inst.nonempty = (params) => inst.check(core._minSize(1, params));
|
|
383605
383605
|
inst.max = (...args) => inst.check(core._maxSize(...args));
|
|
@@ -383615,7 +383615,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383615
383615
|
exports.ZodEnum = core.$constructor("ZodEnum", (inst, def) => {
|
|
383616
383616
|
core.$ZodEnum.init(inst, def);
|
|
383617
383617
|
exports.ZodType.init(inst, def);
|
|
383618
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383618
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.enumProcessor(inst, ctx, json3, params);
|
|
383619
383619
|
inst.enum = def.entries;
|
|
383620
383620
|
inst.options = Object.values(def.entries);
|
|
383621
383621
|
const keys = new Set(Object.keys(def.entries));
|
|
@@ -383668,7 +383668,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383668
383668
|
exports.ZodLiteral = core.$constructor("ZodLiteral", (inst, def) => {
|
|
383669
383669
|
core.$ZodLiteral.init(inst, def);
|
|
383670
383670
|
exports.ZodType.init(inst, def);
|
|
383671
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383671
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.literalProcessor(inst, ctx, json3, params);
|
|
383672
383672
|
inst.values = new Set(def.values);
|
|
383673
383673
|
Object.defineProperty(inst, "value", {
|
|
383674
383674
|
get() {
|
|
@@ -383689,7 +383689,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383689
383689
|
exports.ZodFile = core.$constructor("ZodFile", (inst, def) => {
|
|
383690
383690
|
core.$ZodFile.init(inst, def);
|
|
383691
383691
|
exports.ZodType.init(inst, def);
|
|
383692
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383692
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.fileProcessor(inst, ctx, json3, params);
|
|
383693
383693
|
inst.min = (size, params) => inst.check(core._minSize(size, params));
|
|
383694
383694
|
inst.max = (size, params) => inst.check(core._maxSize(size, params));
|
|
383695
383695
|
inst.mime = (types3, params) => inst.check(core._mime(Array.isArray(types3) ? types3 : [types3], params));
|
|
@@ -383700,7 +383700,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383700
383700
|
exports.ZodTransform = core.$constructor("ZodTransform", (inst, def) => {
|
|
383701
383701
|
core.$ZodTransform.init(inst, def);
|
|
383702
383702
|
exports.ZodType.init(inst, def);
|
|
383703
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383703
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.transformProcessor(inst, ctx, json3, params);
|
|
383704
383704
|
inst._zod.parse = (payload, _ctx) => {
|
|
383705
383705
|
if (_ctx.direction === "backward") {
|
|
383706
383706
|
throw new core.$ZodEncodeError(inst.constructor.name);
|
|
@@ -383738,7 +383738,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383738
383738
|
exports.ZodOptional = core.$constructor("ZodOptional", (inst, def) => {
|
|
383739
383739
|
core.$ZodOptional.init(inst, def);
|
|
383740
383740
|
exports.ZodType.init(inst, def);
|
|
383741
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383741
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.optionalProcessor(inst, ctx, json3, params);
|
|
383742
383742
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383743
383743
|
});
|
|
383744
383744
|
function optional8(innerType) {
|
|
@@ -383750,7 +383750,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383750
383750
|
exports.ZodExactOptional = core.$constructor("ZodExactOptional", (inst, def) => {
|
|
383751
383751
|
core.$ZodExactOptional.init(inst, def);
|
|
383752
383752
|
exports.ZodType.init(inst, def);
|
|
383753
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383753
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.optionalProcessor(inst, ctx, json3, params);
|
|
383754
383754
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383755
383755
|
});
|
|
383756
383756
|
function exactOptional(innerType) {
|
|
@@ -383762,7 +383762,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383762
383762
|
exports.ZodNullable = core.$constructor("ZodNullable", (inst, def) => {
|
|
383763
383763
|
core.$ZodNullable.init(inst, def);
|
|
383764
383764
|
exports.ZodType.init(inst, def);
|
|
383765
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383765
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nullableProcessor(inst, ctx, json3, params);
|
|
383766
383766
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383767
383767
|
});
|
|
383768
383768
|
function nullable(innerType) {
|
|
@@ -383777,7 +383777,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383777
383777
|
exports.ZodDefault = core.$constructor("ZodDefault", (inst, def) => {
|
|
383778
383778
|
core.$ZodDefault.init(inst, def);
|
|
383779
383779
|
exports.ZodType.init(inst, def);
|
|
383780
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383780
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.defaultProcessor(inst, ctx, json3, params);
|
|
383781
383781
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383782
383782
|
inst.removeDefault = inst.unwrap;
|
|
383783
383783
|
});
|
|
@@ -383793,7 +383793,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383793
383793
|
exports.ZodPrefault = core.$constructor("ZodPrefault", (inst, def) => {
|
|
383794
383794
|
core.$ZodPrefault.init(inst, def);
|
|
383795
383795
|
exports.ZodType.init(inst, def);
|
|
383796
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383796
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.prefaultProcessor(inst, ctx, json3, params);
|
|
383797
383797
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383798
383798
|
});
|
|
383799
383799
|
function prefault(innerType, defaultValue) {
|
|
@@ -383808,7 +383808,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383808
383808
|
exports.ZodNonOptional = core.$constructor("ZodNonOptional", (inst, def) => {
|
|
383809
383809
|
core.$ZodNonOptional.init(inst, def);
|
|
383810
383810
|
exports.ZodType.init(inst, def);
|
|
383811
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383811
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nonoptionalProcessor(inst, ctx, json3, params);
|
|
383812
383812
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383813
383813
|
});
|
|
383814
383814
|
function nonoptional(innerType, params) {
|
|
@@ -383821,7 +383821,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383821
383821
|
exports.ZodSuccess = core.$constructor("ZodSuccess", (inst, def) => {
|
|
383822
383822
|
core.$ZodSuccess.init(inst, def);
|
|
383823
383823
|
exports.ZodType.init(inst, def);
|
|
383824
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383824
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.successProcessor(inst, ctx, json3, params);
|
|
383825
383825
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383826
383826
|
});
|
|
383827
383827
|
function success(innerType) {
|
|
@@ -383833,7 +383833,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383833
383833
|
exports.ZodCatch = core.$constructor("ZodCatch", (inst, def) => {
|
|
383834
383834
|
core.$ZodCatch.init(inst, def);
|
|
383835
383835
|
exports.ZodType.init(inst, def);
|
|
383836
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383836
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.catchProcessor(inst, ctx, json3, params);
|
|
383837
383837
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383838
383838
|
inst.removeCatch = inst.unwrap;
|
|
383839
383839
|
});
|
|
@@ -383847,7 +383847,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383847
383847
|
exports.ZodNaN = core.$constructor("ZodNaN", (inst, def) => {
|
|
383848
383848
|
core.$ZodNaN.init(inst, def);
|
|
383849
383849
|
exports.ZodType.init(inst, def);
|
|
383850
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383850
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nanProcessor(inst, ctx, json3, params);
|
|
383851
383851
|
});
|
|
383852
383852
|
function nan(params) {
|
|
383853
383853
|
return core._nan(exports.ZodNaN, params);
|
|
@@ -383855,7 +383855,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383855
383855
|
exports.ZodPipe = core.$constructor("ZodPipe", (inst, def) => {
|
|
383856
383856
|
core.$ZodPipe.init(inst, def);
|
|
383857
383857
|
exports.ZodType.init(inst, def);
|
|
383858
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383858
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.pipeProcessor(inst, ctx, json3, params);
|
|
383859
383859
|
inst.in = def.in;
|
|
383860
383860
|
inst.out = def.out;
|
|
383861
383861
|
});
|
|
@@ -383882,7 +383882,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383882
383882
|
exports.ZodReadonly = core.$constructor("ZodReadonly", (inst, def) => {
|
|
383883
383883
|
core.$ZodReadonly.init(inst, def);
|
|
383884
383884
|
exports.ZodType.init(inst, def);
|
|
383885
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383885
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.readonlyProcessor(inst, ctx, json3, params);
|
|
383886
383886
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383887
383887
|
});
|
|
383888
383888
|
function readonly(innerType) {
|
|
@@ -383894,7 +383894,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383894
383894
|
exports.ZodTemplateLiteral = core.$constructor("ZodTemplateLiteral", (inst, def) => {
|
|
383895
383895
|
core.$ZodTemplateLiteral.init(inst, def);
|
|
383896
383896
|
exports.ZodType.init(inst, def);
|
|
383897
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383897
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.templateLiteralProcessor(inst, ctx, json3, params);
|
|
383898
383898
|
});
|
|
383899
383899
|
function templateLiteral(parts, params) {
|
|
383900
383900
|
return new exports.ZodTemplateLiteral({
|
|
@@ -383906,7 +383906,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383906
383906
|
exports.ZodLazy = core.$constructor("ZodLazy", (inst, def) => {
|
|
383907
383907
|
core.$ZodLazy.init(inst, def);
|
|
383908
383908
|
exports.ZodType.init(inst, def);
|
|
383909
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383909
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.lazyProcessor(inst, ctx, json3, params);
|
|
383910
383910
|
inst.unwrap = () => inst._zod.def.getter();
|
|
383911
383911
|
});
|
|
383912
383912
|
function lazy(getter) {
|
|
@@ -383918,7 +383918,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383918
383918
|
exports.ZodPromise = core.$constructor("ZodPromise", (inst, def) => {
|
|
383919
383919
|
core.$ZodPromise.init(inst, def);
|
|
383920
383920
|
exports.ZodType.init(inst, def);
|
|
383921
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383921
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.promiseProcessor(inst, ctx, json3, params);
|
|
383922
383922
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
383923
383923
|
});
|
|
383924
383924
|
function promise(innerType) {
|
|
@@ -383930,7 +383930,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383930
383930
|
exports.ZodFunction = core.$constructor("ZodFunction", (inst, def) => {
|
|
383931
383931
|
core.$ZodFunction.init(inst, def);
|
|
383932
383932
|
exports.ZodType.init(inst, def);
|
|
383933
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383933
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.functionProcessor(inst, ctx, json3, params);
|
|
383934
383934
|
});
|
|
383935
383935
|
function _function(params) {
|
|
383936
383936
|
return new exports.ZodFunction({
|
|
@@ -383942,7 +383942,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
383942
383942
|
exports.ZodCustom = core.$constructor("ZodCustom", (inst, def) => {
|
|
383943
383943
|
core.$ZodCustom.init(inst, def);
|
|
383944
383944
|
exports.ZodType.init(inst, def);
|
|
383945
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
383945
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.customProcessor(inst, ctx, json3, params);
|
|
383946
383946
|
});
|
|
383947
383947
|
function check2(fn9) {
|
|
383948
383948
|
const ch2 = new core.$ZodCheck({
|
|
@@ -672253,17 +672253,15 @@ var connectArgs = {
|
|
|
672253
672253
|
...previewArgs
|
|
672254
672254
|
};
|
|
672255
672255
|
|
|
672256
|
-
// ../../packages/
|
|
672257
|
-
var import_cmd_ts4 = __toESM(require_cjs(), 1);
|
|
672258
|
-
|
|
672259
|
-
// ../../shared/dist/processors/constants.js
|
|
672256
|
+
// ../../packages/shared/dist/processors/constants.js
|
|
672260
672257
|
var PROCESSOR_APPS = ["connect", "switchboard"];
|
|
672261
|
-
// ../../shared/dist/processors/relational/utils.js
|
|
672258
|
+
// ../../packages/shared/dist/processors/relational/utils.js
|
|
672262
672259
|
var LOG2_26 = Math.log2(26);
|
|
672263
672260
|
|
|
672264
|
-
// ../../shared/dist/processors/relational/types.js
|
|
672261
|
+
// ../../packages/shared/dist/processors/relational/types.js
|
|
672265
672262
|
var IS_RELATIONAL_DB_PROCESSOR = Symbol.for("ph.IS_RELATIONAL_DB_PROCESSOR");
|
|
672266
672263
|
// ../../packages/common/dist/clis/args/generate.js
|
|
672264
|
+
var import_cmd_ts4 = __toESM(require_cjs(), 1);
|
|
672267
672265
|
var ProcessorAppType = {
|
|
672268
672266
|
from(processorApps) {
|
|
672269
672267
|
if (processorApps.length === 0) {
|
|
@@ -677167,12 +677165,13 @@ var legacyIndexHtmlTemplate = html`
|
|
|
677167
677165
|
</html>
|
|
677168
677166
|
`.raw;
|
|
677169
677167
|
// ../../packages/codegen/dist/src/templates/boilerplate/index.js
|
|
677170
|
-
var indexTsTemplate = ts`
|
|
677168
|
+
var indexTsTemplate = ts`
|
|
677169
|
+
import type { Manifest } from "document-model";
|
|
677171
677170
|
import manifestJson from "./powerhouse.manifest.json" with { type: "json" };
|
|
677172
677171
|
export { documentModels } from "./document-models/document-models.js";
|
|
677173
677172
|
export { upgradeManifests } from "./document-models/upgrade-manifests.js";
|
|
677174
677173
|
export { editors } from "./editors/editors.js";
|
|
677175
|
-
export { processorFactory } from "./processors/
|
|
677174
|
+
export { processorFactory } from "./processors/factory.js";
|
|
677176
677175
|
export const manifest: Manifest = manifestJson;
|
|
677177
677176
|
`.raw;
|
|
677178
677177
|
// ../../packages/codegen/dist/src/templates/boilerplate/LICENSE.js
|
|
@@ -678037,8 +678036,6 @@ var powerhouseManifestTemplate = (projectName) => json`
|
|
|
678037
678036
|
}
|
|
678038
678037
|
|
|
678039
678038
|
`.raw;
|
|
678040
|
-
// ../../packages/codegen/dist/src/templates/boilerplate/processors/index.js
|
|
678041
|
-
var boilerplateProcessorsIndexTemplate = "";
|
|
678042
678039
|
// ../../packages/codegen/dist/src/templates/boilerplate/README.md.js
|
|
678043
678040
|
var readmeTemplate = md`
|
|
678044
678041
|
# Document Model Boilerplate
|
|
@@ -678653,6 +678650,65 @@ export function FolderTree() {
|
|
|
678653
678650
|
);
|
|
678654
678651
|
}
|
|
678655
678652
|
`.raw;
|
|
678653
|
+
// ../../packages/codegen/dist/src/templates/processors/factory.js
|
|
678654
|
+
var processorsFactoryTemplate = ts`
|
|
678655
|
+
/**
|
|
678656
|
+
* This file aggregates all processor factories
|
|
678657
|
+
* Auto-generated by codegen - DO NOT EDIT MANUALLY
|
|
678658
|
+
*/
|
|
678659
|
+
|
|
678660
|
+
import type {
|
|
678661
|
+
ProcessorRecord,
|
|
678662
|
+
IProcessorHostModule,
|
|
678663
|
+
ProcessorFactory,
|
|
678664
|
+
} from "@powerhousedao/reactor";
|
|
678665
|
+
import type { PHDocumentHeader } from "document-model";
|
|
678666
|
+
|
|
678667
|
+
export const processorFactory = async (module: IProcessorHostModule) => {
|
|
678668
|
+
const factories: ProcessorFactory[] = [];
|
|
678669
|
+
|
|
678670
|
+
if (module.processorApp === "connect") {
|
|
678671
|
+
// dynamically import connect processors and add them
|
|
678672
|
+
// to the factories array
|
|
678673
|
+
await addConnectProcessorFactories(factories, module);
|
|
678674
|
+
}
|
|
678675
|
+
|
|
678676
|
+
if (module.processorApp === "switchboard") {
|
|
678677
|
+
// dynamically import switchboard processors and add them
|
|
678678
|
+
// to the factories array
|
|
678679
|
+
await addSwitchboardProcessorFactories(factories, module);
|
|
678680
|
+
}
|
|
678681
|
+
|
|
678682
|
+
// Return the inner function that will be called for each drive
|
|
678683
|
+
return async (driveHeader: PHDocumentHeader): Promise<ProcessorRecord[]> => {
|
|
678684
|
+
const processors: ProcessorRecord[] = [];
|
|
678685
|
+
|
|
678686
|
+
// Call each cached factory with the driveHeader
|
|
678687
|
+
for (const factory of factories) {
|
|
678688
|
+
const factoryProcessors = await factory(driveHeader, module.processorApp);
|
|
678689
|
+
processors.push(...factoryProcessors);
|
|
678690
|
+
}
|
|
678691
|
+
|
|
678692
|
+
return processors;
|
|
678693
|
+
};
|
|
678694
|
+
}
|
|
678695
|
+
|
|
678696
|
+
async function addConnectProcessorFactories(factories: ProcessorFactory[], module: IProcessorHostModule) {
|
|
678697
|
+
const connectProcessorFactories: ProcessorFactory[] = [];
|
|
678698
|
+
|
|
678699
|
+
for (const factory of connectProcessorFactories) {
|
|
678700
|
+
factories.push(factory);
|
|
678701
|
+
}
|
|
678702
|
+
}
|
|
678703
|
+
|
|
678704
|
+
async function addSwitchboardProcessorFactories(factories: ProcessorFactory[], module: IProcessorHostModule) {
|
|
678705
|
+
const switchboardProcessorFactories: ProcessorFactory[] = [];
|
|
678706
|
+
|
|
678707
|
+
for (const factory of switchboardProcessorFactories) {
|
|
678708
|
+
factories.push(factory);
|
|
678709
|
+
}
|
|
678710
|
+
}
|
|
678711
|
+
`.raw;
|
|
678656
678712
|
// ../../packages/codegen/dist/src/templates/processors/index.js
|
|
678657
678713
|
var processorsIndexTemplate = ts`
|
|
678658
678714
|
/**
|
|
@@ -701163,15 +701219,15 @@ function isTransforming(_schema, _ctx) {
|
|
|
701163
701219
|
}
|
|
701164
701220
|
return false;
|
|
701165
701221
|
}
|
|
701166
|
-
var createToJSONSchemaMethod = (schema3,
|
|
701167
|
-
const ctx = initializeContext({ ...params, processors:
|
|
701222
|
+
var createToJSONSchemaMethod = (schema3, processors2 = {}) => (params) => {
|
|
701223
|
+
const ctx = initializeContext({ ...params, processors: processors2 });
|
|
701168
701224
|
process10(schema3, ctx);
|
|
701169
701225
|
extractDefs(ctx, schema3);
|
|
701170
701226
|
return finalize(ctx, schema3);
|
|
701171
701227
|
};
|
|
701172
|
-
var createStandardJSONSchemaMethod = (schema3, io6,
|
|
701228
|
+
var createStandardJSONSchemaMethod = (schema3, io6, processors2 = {}) => (params) => {
|
|
701173
701229
|
const { libraryOptions, target } = params ?? {};
|
|
701174
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io6, processors:
|
|
701230
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io6, processors: processors2 });
|
|
701175
701231
|
process10(schema3, ctx);
|
|
701176
701232
|
extractDefs(ctx, schema3);
|
|
701177
701233
|
return finalize(ctx, schema3);
|
|
@@ -704837,6 +704893,15 @@ function installDependencies(projectPath, packageManager) {
|
|
|
704837
704893
|
init_source();
|
|
704838
704894
|
import fs12 from "node:fs";
|
|
704839
704895
|
import path18 from "path";
|
|
704896
|
+
|
|
704897
|
+
// ../../packages/codegen/dist/src/templates/boilerplate/document-models/upgrade-manifests.js
|
|
704898
|
+
var upgradeManifestsTemplate = ts`
|
|
704899
|
+
import type { UpgradeManifest } from "document-model";
|
|
704900
|
+
|
|
704901
|
+
export const upgradeManifests: UpgradeManifest<readonly number[]>[] = [];
|
|
704902
|
+
`.raw;
|
|
704903
|
+
|
|
704904
|
+
// ../../packages/codegen/dist/src/create-lib/create-project.js
|
|
704840
704905
|
async function createProject({ name, packageManager, tag: tag2, version: version2, remoteDrive }) {
|
|
704841
704906
|
const appPath = path18.join(process.cwd(), name);
|
|
704842
704907
|
try {
|
|
@@ -704919,9 +704984,11 @@ async function writeProjectRootFiles(args) {
|
|
|
704919
704984
|
async function writeModuleFiles() {
|
|
704920
704985
|
await writeFileEnsuringDir("document-models/document-models.ts", documentModelsTemplate);
|
|
704921
704986
|
await writeFileEnsuringDir("document-models/index.ts", documentModelsIndexTemplate);
|
|
704987
|
+
await writeFileEnsuringDir("document-models/upgrade-manifests.ts", upgradeManifestsTemplate);
|
|
704922
704988
|
await writeFileEnsuringDir("editors/editors.ts", editorsTemplate);
|
|
704923
704989
|
await writeFileEnsuringDir("editors/index.ts", editorsIndexTemplate);
|
|
704924
|
-
await writeFileEnsuringDir("processors/
|
|
704990
|
+
await writeFileEnsuringDir("processors/factory.ts", processorsFactoryTemplate);
|
|
704991
|
+
await writeFileEnsuringDir("processors/index.ts", processorsIndexTemplate);
|
|
704925
704992
|
await writeFileEnsuringDir("subgraphs/index.ts", subgraphsIndexTemplate);
|
|
704926
704993
|
await writeFileEnsuringDir("processors/index.ts", processorsIndexTemplate);
|
|
704927
704994
|
}
|
|
@@ -705641,18 +705708,15 @@ var init4 = import_cmd_ts12.command({
|
|
|
705641
705708
|
if (!name) {
|
|
705642
705709
|
throw new Error("You must provide a name for your project.");
|
|
705643
705710
|
}
|
|
705644
|
-
console.log("step 1 done");
|
|
705645
705711
|
if (version2 !== undefined && !import_semver4.valid(import_semver4.clean(version2))) {
|
|
705646
705712
|
throw new Error(`Invalid version: ${version2}`);
|
|
705647
705713
|
}
|
|
705648
|
-
console.log("step w done");
|
|
705649
705714
|
handleMutuallyExclusiveOptions({
|
|
705650
705715
|
tag: tag2,
|
|
705651
705716
|
version: version2,
|
|
705652
705717
|
dev,
|
|
705653
705718
|
staging
|
|
705654
705719
|
}, "versioning strategy");
|
|
705655
|
-
console.log("step 3 done");
|
|
705656
705720
|
handleMutuallyExclusiveOptions({
|
|
705657
705721
|
npm: npm2,
|
|
705658
705722
|
pnpm: pnpm2,
|
|
@@ -705660,7 +705724,6 @@ var init4 = import_cmd_ts12.command({
|
|
|
705660
705724
|
bun: bun2,
|
|
705661
705725
|
packageManager
|
|
705662
705726
|
}, "package manager");
|
|
705663
|
-
console.log("step 4 done");
|
|
705664
705727
|
const parsedPackageManager = parsePackageManager({
|
|
705665
705728
|
npm: npm2,
|
|
705666
705729
|
pnpm: pnpm2,
|
|
@@ -705668,7 +705731,6 @@ var init4 = import_cmd_ts12.command({
|
|
|
705668
705731
|
bun: bun2,
|
|
705669
705732
|
packageManager
|
|
705670
705733
|
}) ?? "npm";
|
|
705671
|
-
console.log("step 5 done");
|
|
705672
705734
|
const parsedTag = parseTag({
|
|
705673
705735
|
tag: tag2,
|
|
705674
705736
|
dev,
|
|
@@ -706554,7 +706616,7 @@ var use = import_cmd_ts16.command({
|
|
|
706554
706616
|
});
|
|
706555
706617
|
|
|
706556
706618
|
// src/commands/ph.ts
|
|
706557
|
-
var phCmdVersionInfo = await getPhCmdVersionInfo("6.0.0-dev.
|
|
706619
|
+
var phCmdVersionInfo = await getPhCmdVersionInfo("6.0.0-dev.48");
|
|
706558
706620
|
var ph2 = import_cmd_ts17.subcommands({
|
|
706559
706621
|
name: "ph",
|
|
706560
706622
|
version: phCmdVersionInfo,
|