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.old.js
CHANGED
|
@@ -376694,16 +376694,16 @@ var require_to_json_schema = __commonJS((exports) => {
|
|
|
376694
376694
|
}
|
|
376695
376695
|
return false;
|
|
376696
376696
|
}
|
|
376697
|
-
var createToJSONSchemaMethod = (schema3,
|
|
376698
|
-
const ctx = initializeContext({ ...params, processors:
|
|
376697
|
+
var createToJSONSchemaMethod = (schema3, processors2 = {}) => (params) => {
|
|
376698
|
+
const ctx = initializeContext({ ...params, processors: processors2 });
|
|
376699
376699
|
process5(schema3, ctx);
|
|
376700
376700
|
extractDefs(ctx, schema3);
|
|
376701
376701
|
return finalize(ctx, schema3);
|
|
376702
376702
|
};
|
|
376703
376703
|
exports.createToJSONSchemaMethod = createToJSONSchemaMethod;
|
|
376704
|
-
var createStandardJSONSchemaMethod = (schema3, io5,
|
|
376704
|
+
var createStandardJSONSchemaMethod = (schema3, io5, processors2 = {}) => (params) => {
|
|
376705
376705
|
const { libraryOptions, target } = params ?? {};
|
|
376706
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io5, processors:
|
|
376706
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io5, processors: processors2 });
|
|
376707
376707
|
process5(schema3, ctx);
|
|
376708
376708
|
extractDefs(ctx, schema3);
|
|
376709
376709
|
return finalize(ctx, schema3);
|
|
@@ -384109,7 +384109,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384109
384109
|
exports.preprocess = preprocess;
|
|
384110
384110
|
var core = __importStar(require_core2());
|
|
384111
384111
|
var index_js_1 = require_core2();
|
|
384112
|
-
var
|
|
384112
|
+
var processors2 = __importStar(require_json_schema_processors());
|
|
384113
384113
|
var to_json_schema_js_1 = require_to_json_schema();
|
|
384114
384114
|
var checks = __importStar(require_checks2());
|
|
384115
384115
|
var iso = __importStar(require_iso());
|
|
@@ -384200,7 +384200,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384200
384200
|
exports._ZodString = core.$constructor("_ZodString", (inst, def) => {
|
|
384201
384201
|
core.$ZodString.init(inst, def);
|
|
384202
384202
|
exports.ZodType.init(inst, def);
|
|
384203
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384203
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.stringProcessor(inst, ctx, json3, params);
|
|
384204
384204
|
const bag = inst._zod.bag;
|
|
384205
384205
|
inst.format = bag.format ?? null;
|
|
384206
384206
|
inst.minLength = bag.minimum ?? null;
|
|
@@ -384439,7 +384439,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384439
384439
|
exports.ZodNumber = core.$constructor("ZodNumber", (inst, def) => {
|
|
384440
384440
|
core.$ZodNumber.init(inst, def);
|
|
384441
384441
|
exports.ZodType.init(inst, def);
|
|
384442
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384442
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.numberProcessor(inst, ctx, json3, params);
|
|
384443
384443
|
inst.gt = (value2, params) => inst.check(checks.gt(value2, params));
|
|
384444
384444
|
inst.gte = (value2, params) => inst.check(checks.gte(value2, params));
|
|
384445
384445
|
inst.min = (value2, params) => inst.check(checks.gte(value2, params));
|
|
@@ -384487,7 +384487,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384487
384487
|
exports.ZodBoolean = core.$constructor("ZodBoolean", (inst, def) => {
|
|
384488
384488
|
core.$ZodBoolean.init(inst, def);
|
|
384489
384489
|
exports.ZodType.init(inst, def);
|
|
384490
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384490
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.booleanProcessor(inst, ctx, json3, params);
|
|
384491
384491
|
});
|
|
384492
384492
|
function boolean2(params) {
|
|
384493
384493
|
return core._boolean(exports.ZodBoolean, params);
|
|
@@ -384495,7 +384495,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384495
384495
|
exports.ZodBigInt = core.$constructor("ZodBigInt", (inst, def) => {
|
|
384496
384496
|
core.$ZodBigInt.init(inst, def);
|
|
384497
384497
|
exports.ZodType.init(inst, def);
|
|
384498
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384498
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.bigintProcessor(inst, ctx, json3, params);
|
|
384499
384499
|
inst.gte = (value2, params) => inst.check(checks.gte(value2, params));
|
|
384500
384500
|
inst.min = (value2, params) => inst.check(checks.gte(value2, params));
|
|
384501
384501
|
inst.gt = (value2, params) => inst.check(checks.gt(value2, params));
|
|
@@ -384530,7 +384530,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384530
384530
|
exports.ZodSymbol = core.$constructor("ZodSymbol", (inst, def) => {
|
|
384531
384531
|
core.$ZodSymbol.init(inst, def);
|
|
384532
384532
|
exports.ZodType.init(inst, def);
|
|
384533
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384533
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.symbolProcessor(inst, ctx, json3, params);
|
|
384534
384534
|
});
|
|
384535
384535
|
function symbol(params) {
|
|
384536
384536
|
return core._symbol(exports.ZodSymbol, params);
|
|
@@ -384538,7 +384538,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384538
384538
|
exports.ZodUndefined = core.$constructor("ZodUndefined", (inst, def) => {
|
|
384539
384539
|
core.$ZodUndefined.init(inst, def);
|
|
384540
384540
|
exports.ZodType.init(inst, def);
|
|
384541
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384541
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.undefinedProcessor(inst, ctx, json3, params);
|
|
384542
384542
|
});
|
|
384543
384543
|
function _undefined(params) {
|
|
384544
384544
|
return core._undefined(exports.ZodUndefined, params);
|
|
@@ -384546,7 +384546,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384546
384546
|
exports.ZodNull = core.$constructor("ZodNull", (inst, def) => {
|
|
384547
384547
|
core.$ZodNull.init(inst, def);
|
|
384548
384548
|
exports.ZodType.init(inst, def);
|
|
384549
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384549
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nullProcessor(inst, ctx, json3, params);
|
|
384550
384550
|
});
|
|
384551
384551
|
function _null(params) {
|
|
384552
384552
|
return core._null(exports.ZodNull, params);
|
|
@@ -384554,7 +384554,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384554
384554
|
exports.ZodAny = core.$constructor("ZodAny", (inst, def) => {
|
|
384555
384555
|
core.$ZodAny.init(inst, def);
|
|
384556
384556
|
exports.ZodType.init(inst, def);
|
|
384557
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384557
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.anyProcessor(inst, ctx, json3, params);
|
|
384558
384558
|
});
|
|
384559
384559
|
function any() {
|
|
384560
384560
|
return core._any(exports.ZodAny);
|
|
@@ -384562,7 +384562,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384562
384562
|
exports.ZodUnknown = core.$constructor("ZodUnknown", (inst, def) => {
|
|
384563
384563
|
core.$ZodUnknown.init(inst, def);
|
|
384564
384564
|
exports.ZodType.init(inst, def);
|
|
384565
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384565
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.unknownProcessor(inst, ctx, json3, params);
|
|
384566
384566
|
});
|
|
384567
384567
|
function unknown() {
|
|
384568
384568
|
return core._unknown(exports.ZodUnknown);
|
|
@@ -384570,7 +384570,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384570
384570
|
exports.ZodNever = core.$constructor("ZodNever", (inst, def) => {
|
|
384571
384571
|
core.$ZodNever.init(inst, def);
|
|
384572
384572
|
exports.ZodType.init(inst, def);
|
|
384573
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384573
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.neverProcessor(inst, ctx, json3, params);
|
|
384574
384574
|
});
|
|
384575
384575
|
function never(params) {
|
|
384576
384576
|
return core._never(exports.ZodNever, params);
|
|
@@ -384578,7 +384578,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384578
384578
|
exports.ZodVoid = core.$constructor("ZodVoid", (inst, def) => {
|
|
384579
384579
|
core.$ZodVoid.init(inst, def);
|
|
384580
384580
|
exports.ZodType.init(inst, def);
|
|
384581
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384581
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.voidProcessor(inst, ctx, json3, params);
|
|
384582
384582
|
});
|
|
384583
384583
|
function _void(params) {
|
|
384584
384584
|
return core._void(exports.ZodVoid, params);
|
|
@@ -384586,7 +384586,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384586
384586
|
exports.ZodDate = core.$constructor("ZodDate", (inst, def) => {
|
|
384587
384587
|
core.$ZodDate.init(inst, def);
|
|
384588
384588
|
exports.ZodType.init(inst, def);
|
|
384589
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384589
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.dateProcessor(inst, ctx, json3, params);
|
|
384590
384590
|
inst.min = (value2, params) => inst.check(checks.gte(value2, params));
|
|
384591
384591
|
inst.max = (value2, params) => inst.check(checks.lte(value2, params));
|
|
384592
384592
|
const c8 = inst._zod.bag;
|
|
@@ -384599,7 +384599,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384599
384599
|
exports.ZodArray = core.$constructor("ZodArray", (inst, def) => {
|
|
384600
384600
|
core.$ZodArray.init(inst, def);
|
|
384601
384601
|
exports.ZodType.init(inst, def);
|
|
384602
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384602
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.arrayProcessor(inst, ctx, json3, params);
|
|
384603
384603
|
inst.element = def.element;
|
|
384604
384604
|
inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
|
|
384605
384605
|
inst.nonempty = (params) => inst.check(checks.minLength(1, params));
|
|
@@ -384617,7 +384617,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384617
384617
|
exports.ZodObject = core.$constructor("ZodObject", (inst, def) => {
|
|
384618
384618
|
core.$ZodObjectJIT.init(inst, def);
|
|
384619
384619
|
exports.ZodType.init(inst, def);
|
|
384620
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384620
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.objectProcessor(inst, ctx, json3, params);
|
|
384621
384621
|
index_js_1.util.defineLazy(inst, "shape", () => {
|
|
384622
384622
|
return def.shape;
|
|
384623
384623
|
});
|
|
@@ -384666,7 +384666,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384666
384666
|
exports.ZodUnion = core.$constructor("ZodUnion", (inst, def) => {
|
|
384667
384667
|
core.$ZodUnion.init(inst, def);
|
|
384668
384668
|
exports.ZodType.init(inst, def);
|
|
384669
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384669
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.unionProcessor(inst, ctx, json3, params);
|
|
384670
384670
|
inst.options = def.options;
|
|
384671
384671
|
});
|
|
384672
384672
|
function union(options8, params) {
|
|
@@ -384679,7 +384679,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384679
384679
|
exports.ZodXor = core.$constructor("ZodXor", (inst, def) => {
|
|
384680
384680
|
exports.ZodUnion.init(inst, def);
|
|
384681
384681
|
core.$ZodXor.init(inst, def);
|
|
384682
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384682
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.unionProcessor(inst, ctx, json3, params);
|
|
384683
384683
|
inst.options = def.options;
|
|
384684
384684
|
});
|
|
384685
384685
|
function xor(options8, params) {
|
|
@@ -384705,7 +384705,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384705
384705
|
exports.ZodIntersection = core.$constructor("ZodIntersection", (inst, def) => {
|
|
384706
384706
|
core.$ZodIntersection.init(inst, def);
|
|
384707
384707
|
exports.ZodType.init(inst, def);
|
|
384708
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384708
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.intersectionProcessor(inst, ctx, json3, params);
|
|
384709
384709
|
});
|
|
384710
384710
|
function intersection(left, right) {
|
|
384711
384711
|
return new exports.ZodIntersection({
|
|
@@ -384717,7 +384717,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384717
384717
|
exports.ZodTuple = core.$constructor("ZodTuple", (inst, def) => {
|
|
384718
384718
|
core.$ZodTuple.init(inst, def);
|
|
384719
384719
|
exports.ZodType.init(inst, def);
|
|
384720
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384720
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.tupleProcessor(inst, ctx, json3, params);
|
|
384721
384721
|
inst.rest = (rest) => inst.clone({
|
|
384722
384722
|
...inst._zod.def,
|
|
384723
384723
|
rest
|
|
@@ -384737,7 +384737,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384737
384737
|
exports.ZodRecord = core.$constructor("ZodRecord", (inst, def) => {
|
|
384738
384738
|
core.$ZodRecord.init(inst, def);
|
|
384739
384739
|
exports.ZodType.init(inst, def);
|
|
384740
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384740
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.recordProcessor(inst, ctx, json3, params);
|
|
384741
384741
|
inst.keyType = def.keyType;
|
|
384742
384742
|
inst.valueType = def.valueType;
|
|
384743
384743
|
});
|
|
@@ -384771,7 +384771,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384771
384771
|
exports.ZodMap = core.$constructor("ZodMap", (inst, def) => {
|
|
384772
384772
|
core.$ZodMap.init(inst, def);
|
|
384773
384773
|
exports.ZodType.init(inst, def);
|
|
384774
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384774
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.mapProcessor(inst, ctx, json3, params);
|
|
384775
384775
|
inst.keyType = def.keyType;
|
|
384776
384776
|
inst.valueType = def.valueType;
|
|
384777
384777
|
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
@@ -384790,7 +384790,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384790
384790
|
exports.ZodSet = core.$constructor("ZodSet", (inst, def) => {
|
|
384791
384791
|
core.$ZodSet.init(inst, def);
|
|
384792
384792
|
exports.ZodType.init(inst, def);
|
|
384793
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384793
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.setProcessor(inst, ctx, json3, params);
|
|
384794
384794
|
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
384795
384795
|
inst.nonempty = (params) => inst.check(core._minSize(1, params));
|
|
384796
384796
|
inst.max = (...args) => inst.check(core._maxSize(...args));
|
|
@@ -384806,7 +384806,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384806
384806
|
exports.ZodEnum = core.$constructor("ZodEnum", (inst, def) => {
|
|
384807
384807
|
core.$ZodEnum.init(inst, def);
|
|
384808
384808
|
exports.ZodType.init(inst, def);
|
|
384809
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384809
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.enumProcessor(inst, ctx, json3, params);
|
|
384810
384810
|
inst.enum = def.entries;
|
|
384811
384811
|
inst.options = Object.values(def.entries);
|
|
384812
384812
|
const keys = new Set(Object.keys(def.entries));
|
|
@@ -384859,7 +384859,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384859
384859
|
exports.ZodLiteral = core.$constructor("ZodLiteral", (inst, def) => {
|
|
384860
384860
|
core.$ZodLiteral.init(inst, def);
|
|
384861
384861
|
exports.ZodType.init(inst, def);
|
|
384862
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384862
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.literalProcessor(inst, ctx, json3, params);
|
|
384863
384863
|
inst.values = new Set(def.values);
|
|
384864
384864
|
Object.defineProperty(inst, "value", {
|
|
384865
384865
|
get() {
|
|
@@ -384880,7 +384880,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384880
384880
|
exports.ZodFile = core.$constructor("ZodFile", (inst, def) => {
|
|
384881
384881
|
core.$ZodFile.init(inst, def);
|
|
384882
384882
|
exports.ZodType.init(inst, def);
|
|
384883
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384883
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.fileProcessor(inst, ctx, json3, params);
|
|
384884
384884
|
inst.min = (size, params) => inst.check(core._minSize(size, params));
|
|
384885
384885
|
inst.max = (size, params) => inst.check(core._maxSize(size, params));
|
|
384886
384886
|
inst.mime = (types2, params) => inst.check(core._mime(Array.isArray(types2) ? types2 : [types2], params));
|
|
@@ -384891,7 +384891,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384891
384891
|
exports.ZodTransform = core.$constructor("ZodTransform", (inst, def) => {
|
|
384892
384892
|
core.$ZodTransform.init(inst, def);
|
|
384893
384893
|
exports.ZodType.init(inst, def);
|
|
384894
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384894
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.transformProcessor(inst, ctx, json3, params);
|
|
384895
384895
|
inst._zod.parse = (payload, _ctx) => {
|
|
384896
384896
|
if (_ctx.direction === "backward") {
|
|
384897
384897
|
throw new core.$ZodEncodeError(inst.constructor.name);
|
|
@@ -384929,7 +384929,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384929
384929
|
exports.ZodOptional = core.$constructor("ZodOptional", (inst, def) => {
|
|
384930
384930
|
core.$ZodOptional.init(inst, def);
|
|
384931
384931
|
exports.ZodType.init(inst, def);
|
|
384932
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384932
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.optionalProcessor(inst, ctx, json3, params);
|
|
384933
384933
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
384934
384934
|
});
|
|
384935
384935
|
function optional2(innerType) {
|
|
@@ -384941,7 +384941,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384941
384941
|
exports.ZodExactOptional = core.$constructor("ZodExactOptional", (inst, def) => {
|
|
384942
384942
|
core.$ZodExactOptional.init(inst, def);
|
|
384943
384943
|
exports.ZodType.init(inst, def);
|
|
384944
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384944
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.optionalProcessor(inst, ctx, json3, params);
|
|
384945
384945
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
384946
384946
|
});
|
|
384947
384947
|
function exactOptional(innerType) {
|
|
@@ -384953,7 +384953,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384953
384953
|
exports.ZodNullable = core.$constructor("ZodNullable", (inst, def) => {
|
|
384954
384954
|
core.$ZodNullable.init(inst, def);
|
|
384955
384955
|
exports.ZodType.init(inst, def);
|
|
384956
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384956
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nullableProcessor(inst, ctx, json3, params);
|
|
384957
384957
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
384958
384958
|
});
|
|
384959
384959
|
function nullable(innerType) {
|
|
@@ -384968,7 +384968,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384968
384968
|
exports.ZodDefault = core.$constructor("ZodDefault", (inst, def) => {
|
|
384969
384969
|
core.$ZodDefault.init(inst, def);
|
|
384970
384970
|
exports.ZodType.init(inst, def);
|
|
384971
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384971
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.defaultProcessor(inst, ctx, json3, params);
|
|
384972
384972
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
384973
384973
|
inst.removeDefault = inst.unwrap;
|
|
384974
384974
|
});
|
|
@@ -384984,7 +384984,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384984
384984
|
exports.ZodPrefault = core.$constructor("ZodPrefault", (inst, def) => {
|
|
384985
384985
|
core.$ZodPrefault.init(inst, def);
|
|
384986
384986
|
exports.ZodType.init(inst, def);
|
|
384987
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
384987
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.prefaultProcessor(inst, ctx, json3, params);
|
|
384988
384988
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
384989
384989
|
});
|
|
384990
384990
|
function prefault(innerType, defaultValue) {
|
|
@@ -384999,7 +384999,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
384999
384999
|
exports.ZodNonOptional = core.$constructor("ZodNonOptional", (inst, def) => {
|
|
385000
385000
|
core.$ZodNonOptional.init(inst, def);
|
|
385001
385001
|
exports.ZodType.init(inst, def);
|
|
385002
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385002
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nonoptionalProcessor(inst, ctx, json3, params);
|
|
385003
385003
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
385004
385004
|
});
|
|
385005
385005
|
function nonoptional(innerType, params) {
|
|
@@ -385012,7 +385012,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385012
385012
|
exports.ZodSuccess = core.$constructor("ZodSuccess", (inst, def) => {
|
|
385013
385013
|
core.$ZodSuccess.init(inst, def);
|
|
385014
385014
|
exports.ZodType.init(inst, def);
|
|
385015
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385015
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.successProcessor(inst, ctx, json3, params);
|
|
385016
385016
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
385017
385017
|
});
|
|
385018
385018
|
function success(innerType) {
|
|
@@ -385024,7 +385024,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385024
385024
|
exports.ZodCatch = core.$constructor("ZodCatch", (inst, def) => {
|
|
385025
385025
|
core.$ZodCatch.init(inst, def);
|
|
385026
385026
|
exports.ZodType.init(inst, def);
|
|
385027
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385027
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.catchProcessor(inst, ctx, json3, params);
|
|
385028
385028
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
385029
385029
|
inst.removeCatch = inst.unwrap;
|
|
385030
385030
|
});
|
|
@@ -385038,7 +385038,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385038
385038
|
exports.ZodNaN = core.$constructor("ZodNaN", (inst, def) => {
|
|
385039
385039
|
core.$ZodNaN.init(inst, def);
|
|
385040
385040
|
exports.ZodType.init(inst, def);
|
|
385041
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385041
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.nanProcessor(inst, ctx, json3, params);
|
|
385042
385042
|
});
|
|
385043
385043
|
function nan(params) {
|
|
385044
385044
|
return core._nan(exports.ZodNaN, params);
|
|
@@ -385046,7 +385046,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385046
385046
|
exports.ZodPipe = core.$constructor("ZodPipe", (inst, def) => {
|
|
385047
385047
|
core.$ZodPipe.init(inst, def);
|
|
385048
385048
|
exports.ZodType.init(inst, def);
|
|
385049
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385049
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.pipeProcessor(inst, ctx, json3, params);
|
|
385050
385050
|
inst.in = def.in;
|
|
385051
385051
|
inst.out = def.out;
|
|
385052
385052
|
});
|
|
@@ -385073,7 +385073,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385073
385073
|
exports.ZodReadonly = core.$constructor("ZodReadonly", (inst, def) => {
|
|
385074
385074
|
core.$ZodReadonly.init(inst, def);
|
|
385075
385075
|
exports.ZodType.init(inst, def);
|
|
385076
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385076
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.readonlyProcessor(inst, ctx, json3, params);
|
|
385077
385077
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
385078
385078
|
});
|
|
385079
385079
|
function readonly(innerType) {
|
|
@@ -385085,7 +385085,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385085
385085
|
exports.ZodTemplateLiteral = core.$constructor("ZodTemplateLiteral", (inst, def) => {
|
|
385086
385086
|
core.$ZodTemplateLiteral.init(inst, def);
|
|
385087
385087
|
exports.ZodType.init(inst, def);
|
|
385088
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385088
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.templateLiteralProcessor(inst, ctx, json3, params);
|
|
385089
385089
|
});
|
|
385090
385090
|
function templateLiteral(parts, params) {
|
|
385091
385091
|
return new exports.ZodTemplateLiteral({
|
|
@@ -385097,7 +385097,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385097
385097
|
exports.ZodLazy = core.$constructor("ZodLazy", (inst, def) => {
|
|
385098
385098
|
core.$ZodLazy.init(inst, def);
|
|
385099
385099
|
exports.ZodType.init(inst, def);
|
|
385100
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385100
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.lazyProcessor(inst, ctx, json3, params);
|
|
385101
385101
|
inst.unwrap = () => inst._zod.def.getter();
|
|
385102
385102
|
});
|
|
385103
385103
|
function lazy(getter) {
|
|
@@ -385109,7 +385109,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385109
385109
|
exports.ZodPromise = core.$constructor("ZodPromise", (inst, def) => {
|
|
385110
385110
|
core.$ZodPromise.init(inst, def);
|
|
385111
385111
|
exports.ZodType.init(inst, def);
|
|
385112
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385112
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.promiseProcessor(inst, ctx, json3, params);
|
|
385113
385113
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
385114
385114
|
});
|
|
385115
385115
|
function promise(innerType) {
|
|
@@ -385121,7 +385121,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385121
385121
|
exports.ZodFunction = core.$constructor("ZodFunction", (inst, def) => {
|
|
385122
385122
|
core.$ZodFunction.init(inst, def);
|
|
385123
385123
|
exports.ZodType.init(inst, def);
|
|
385124
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385124
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.functionProcessor(inst, ctx, json3, params);
|
|
385125
385125
|
});
|
|
385126
385126
|
function _function(params) {
|
|
385127
385127
|
return new exports.ZodFunction({
|
|
@@ -385133,7 +385133,7 @@ var require_schemas2 = __commonJS((exports) => {
|
|
|
385133
385133
|
exports.ZodCustom = core.$constructor("ZodCustom", (inst, def) => {
|
|
385134
385134
|
core.$ZodCustom.init(inst, def);
|
|
385135
385135
|
exports.ZodType.init(inst, def);
|
|
385136
|
-
inst._zod.processJSONSchema = (ctx, json3, params) =>
|
|
385136
|
+
inst._zod.processJSONSchema = (ctx, json3, params) => processors2.customProcessor(inst, ctx, json3, params);
|
|
385137
385137
|
});
|
|
385138
385138
|
function check2(fn9) {
|
|
385139
385139
|
const ch2 = new core.$ZodCheck({
|
|
@@ -677789,12 +677789,13 @@ var legacyIndexHtmlTemplate = html`
|
|
|
677789
677789
|
</html>
|
|
677790
677790
|
`.raw;
|
|
677791
677791
|
// ../../packages/codegen/dist/src/templates/boilerplate/index.js
|
|
677792
|
-
var indexTsTemplate = ts`
|
|
677792
|
+
var indexTsTemplate = ts`
|
|
677793
|
+
import type { Manifest } from "document-model";
|
|
677793
677794
|
import manifestJson from "./powerhouse.manifest.json" with { type: "json" };
|
|
677794
677795
|
export { documentModels } from "./document-models/document-models.js";
|
|
677795
677796
|
export { upgradeManifests } from "./document-models/upgrade-manifests.js";
|
|
677796
677797
|
export { editors } from "./editors/editors.js";
|
|
677797
|
-
export { processorFactory } from "./processors/
|
|
677798
|
+
export { processorFactory } from "./processors/factory.js";
|
|
677798
677799
|
export const manifest: Manifest = manifestJson;
|
|
677799
677800
|
`.raw;
|
|
677800
677801
|
// ../../packages/codegen/dist/src/templates/boilerplate/LICENSE.js
|
|
@@ -678659,8 +678660,6 @@ var powerhouseManifestTemplate = (projectName) => json`
|
|
|
678659
678660
|
}
|
|
678660
678661
|
|
|
678661
678662
|
`.raw;
|
|
678662
|
-
// ../../packages/codegen/dist/src/templates/boilerplate/processors/index.js
|
|
678663
|
-
var boilerplateProcessorsIndexTemplate = "";
|
|
678664
678663
|
// ../../packages/codegen/dist/src/templates/boilerplate/README.md.js
|
|
678665
678664
|
var readmeTemplate = md`
|
|
678666
678665
|
# Document Model Boilerplate
|
|
@@ -679275,6 +679274,65 @@ export function FolderTree() {
|
|
|
679275
679274
|
);
|
|
679276
679275
|
}
|
|
679277
679276
|
`.raw;
|
|
679277
|
+
// ../../packages/codegen/dist/src/templates/processors/factory.js
|
|
679278
|
+
var processorsFactoryTemplate = ts`
|
|
679279
|
+
/**
|
|
679280
|
+
* This file aggregates all processor factories
|
|
679281
|
+
* Auto-generated by codegen - DO NOT EDIT MANUALLY
|
|
679282
|
+
*/
|
|
679283
|
+
|
|
679284
|
+
import type {
|
|
679285
|
+
ProcessorRecord,
|
|
679286
|
+
IProcessorHostModule,
|
|
679287
|
+
ProcessorFactory,
|
|
679288
|
+
} from "@powerhousedao/reactor";
|
|
679289
|
+
import type { PHDocumentHeader } from "document-model";
|
|
679290
|
+
|
|
679291
|
+
export const processorFactory = async (module: IProcessorHostModule) => {
|
|
679292
|
+
const factories: ProcessorFactory[] = [];
|
|
679293
|
+
|
|
679294
|
+
if (module.processorApp === "connect") {
|
|
679295
|
+
// dynamically import connect processors and add them
|
|
679296
|
+
// to the factories array
|
|
679297
|
+
await addConnectProcessorFactories(factories, module);
|
|
679298
|
+
}
|
|
679299
|
+
|
|
679300
|
+
if (module.processorApp === "switchboard") {
|
|
679301
|
+
// dynamically import switchboard processors and add them
|
|
679302
|
+
// to the factories array
|
|
679303
|
+
await addSwitchboardProcessorFactories(factories, module);
|
|
679304
|
+
}
|
|
679305
|
+
|
|
679306
|
+
// Return the inner function that will be called for each drive
|
|
679307
|
+
return async (driveHeader: PHDocumentHeader): Promise<ProcessorRecord[]> => {
|
|
679308
|
+
const processors: ProcessorRecord[] = [];
|
|
679309
|
+
|
|
679310
|
+
// Call each cached factory with the driveHeader
|
|
679311
|
+
for (const factory of factories) {
|
|
679312
|
+
const factoryProcessors = await factory(driveHeader, module.processorApp);
|
|
679313
|
+
processors.push(...factoryProcessors);
|
|
679314
|
+
}
|
|
679315
|
+
|
|
679316
|
+
return processors;
|
|
679317
|
+
};
|
|
679318
|
+
}
|
|
679319
|
+
|
|
679320
|
+
async function addConnectProcessorFactories(factories: ProcessorFactory[], module: IProcessorHostModule) {
|
|
679321
|
+
const connectProcessorFactories: ProcessorFactory[] = [];
|
|
679322
|
+
|
|
679323
|
+
for (const factory of connectProcessorFactories) {
|
|
679324
|
+
factories.push(factory);
|
|
679325
|
+
}
|
|
679326
|
+
}
|
|
679327
|
+
|
|
679328
|
+
async function addSwitchboardProcessorFactories(factories: ProcessorFactory[], module: IProcessorHostModule) {
|
|
679329
|
+
const switchboardProcessorFactories: ProcessorFactory[] = [];
|
|
679330
|
+
|
|
679331
|
+
for (const factory of switchboardProcessorFactories) {
|
|
679332
|
+
factories.push(factory);
|
|
679333
|
+
}
|
|
679334
|
+
}
|
|
679335
|
+
`.raw;
|
|
679278
679336
|
// ../../packages/codegen/dist/src/templates/processors/index.js
|
|
679279
679337
|
var processorsIndexTemplate = ts`
|
|
679280
679338
|
/**
|
|
@@ -701785,15 +701843,15 @@ function isTransforming(_schema, _ctx) {
|
|
|
701785
701843
|
}
|
|
701786
701844
|
return false;
|
|
701787
701845
|
}
|
|
701788
|
-
var createToJSONSchemaMethod = (schema3,
|
|
701789
|
-
const ctx = initializeContext({ ...params, processors:
|
|
701846
|
+
var createToJSONSchemaMethod = (schema3, processors2 = {}) => (params) => {
|
|
701847
|
+
const ctx = initializeContext({ ...params, processors: processors2 });
|
|
701790
701848
|
process11(schema3, ctx);
|
|
701791
701849
|
extractDefs(ctx, schema3);
|
|
701792
701850
|
return finalize(ctx, schema3);
|
|
701793
701851
|
};
|
|
701794
|
-
var createStandardJSONSchemaMethod = (schema3, io6,
|
|
701852
|
+
var createStandardJSONSchemaMethod = (schema3, io6, processors2 = {}) => (params) => {
|
|
701795
701853
|
const { libraryOptions, target } = params ?? {};
|
|
701796
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io6, processors:
|
|
701854
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io: io6, processors: processors2 });
|
|
701797
701855
|
process11(schema3, ctx);
|
|
701798
701856
|
extractDefs(ctx, schema3);
|
|
701799
701857
|
return finalize(ctx, schema3);
|
|
@@ -705459,6 +705517,15 @@ function installDependencies(projectPath, packageManager) {
|
|
|
705459
705517
|
init_source();
|
|
705460
705518
|
import fs12 from "node:fs";
|
|
705461
705519
|
import path18 from "path";
|
|
705520
|
+
|
|
705521
|
+
// ../../packages/codegen/dist/src/templates/boilerplate/document-models/upgrade-manifests.js
|
|
705522
|
+
var upgradeManifestsTemplate = ts`
|
|
705523
|
+
import type { UpgradeManifest } from "document-model";
|
|
705524
|
+
|
|
705525
|
+
export const upgradeManifests: UpgradeManifest<readonly number[]>[] = [];
|
|
705526
|
+
`.raw;
|
|
705527
|
+
|
|
705528
|
+
// ../../packages/codegen/dist/src/create-lib/create-project.js
|
|
705462
705529
|
async function createProject({ name, packageManager, tag: tag2, version: version2, remoteDrive }) {
|
|
705463
705530
|
const appPath = path18.join(process.cwd(), name);
|
|
705464
705531
|
try {
|
|
@@ -705541,9 +705608,11 @@ async function writeProjectRootFiles(args) {
|
|
|
705541
705608
|
async function writeModuleFiles() {
|
|
705542
705609
|
await writeFileEnsuringDir("document-models/document-models.ts", documentModelsTemplate);
|
|
705543
705610
|
await writeFileEnsuringDir("document-models/index.ts", documentModelsIndexTemplate);
|
|
705611
|
+
await writeFileEnsuringDir("document-models/upgrade-manifests.ts", upgradeManifestsTemplate);
|
|
705544
705612
|
await writeFileEnsuringDir("editors/editors.ts", editorsTemplate);
|
|
705545
705613
|
await writeFileEnsuringDir("editors/index.ts", editorsIndexTemplate);
|
|
705546
|
-
await writeFileEnsuringDir("processors/
|
|
705614
|
+
await writeFileEnsuringDir("processors/factory.ts", processorsFactoryTemplate);
|
|
705615
|
+
await writeFileEnsuringDir("processors/index.ts", processorsIndexTemplate);
|
|
705547
705616
|
await writeFileEnsuringDir("subgraphs/index.ts", subgraphsIndexTemplate);
|
|
705548
705617
|
await writeFileEnsuringDir("processors/index.ts", processorsIndexTemplate);
|
|
705549
705618
|
}
|
|
@@ -706662,7 +706731,7 @@ import fs13 from "node:fs";
|
|
|
706662
706731
|
import path21 from "node:path";
|
|
706663
706732
|
var customVersionHandler = async () => {
|
|
706664
706733
|
const projectInfo = await getProjectInfo(undefined, false);
|
|
706665
|
-
const version2 = "6.0.0-dev.
|
|
706734
|
+
const version2 = "6.0.0-dev.48";
|
|
706666
706735
|
console.log("PH CMD version: ", version2);
|
|
706667
706736
|
if (projectInfo.available) {
|
|
706668
706737
|
const packageManager = getPackageManagerFromLockfile(projectInfo.path);
|
|
@@ -706800,18 +706869,15 @@ var init4 = import_cmd_ts2.command({
|
|
|
706800
706869
|
if (!name) {
|
|
706801
706870
|
throw new Error("You must provide a name for your project.");
|
|
706802
706871
|
}
|
|
706803
|
-
console.log("step 1 done");
|
|
706804
706872
|
if (version2 !== undefined && !import_semver4.valid(import_semver4.clean(version2))) {
|
|
706805
706873
|
throw new Error(`Invalid version: ${version2}`);
|
|
706806
706874
|
}
|
|
706807
|
-
console.log("step w done");
|
|
706808
706875
|
handleMutuallyExclusiveOptions({
|
|
706809
706876
|
tag: tag2,
|
|
706810
706877
|
version: version2,
|
|
706811
706878
|
dev,
|
|
706812
706879
|
staging
|
|
706813
706880
|
}, "versioning strategy");
|
|
706814
|
-
console.log("step 3 done");
|
|
706815
706881
|
handleMutuallyExclusiveOptions({
|
|
706816
706882
|
npm: npm2,
|
|
706817
706883
|
pnpm: pnpm2,
|
|
@@ -706819,7 +706885,6 @@ var init4 = import_cmd_ts2.command({
|
|
|
706819
706885
|
bun: bun2,
|
|
706820
706886
|
packageManager
|
|
706821
706887
|
}, "package manager");
|
|
706822
|
-
console.log("step 4 done");
|
|
706823
706888
|
const parsedPackageManager = parsePackageManager({
|
|
706824
706889
|
npm: npm2,
|
|
706825
706890
|
pnpm: pnpm2,
|
|
@@ -706827,7 +706892,6 @@ var init4 = import_cmd_ts2.command({
|
|
|
706827
706892
|
bun: bun2,
|
|
706828
706893
|
packageManager
|
|
706829
706894
|
}) ?? "npm";
|
|
706830
|
-
console.log("step 5 done");
|
|
706831
706895
|
const parsedTag = parseTag({
|
|
706832
706896
|
tag: tag2,
|
|
706833
706897
|
dev,
|