@remoteoss/json-schema-form 0.2.0-beta.0 → 0.4.0-beta.0
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/CHANGELOG.md +20 -2
- package/dist/index.cjs +28 -4
- package/dist/index.js +28 -4
- package/dist/standalone.js +811 -359
- package/package.json +3 -2
- package/src/tests/createHeadlessForm.test.js +48 -14
- package/src/tests/helpers.js +56 -20
package/dist/standalone.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2023 Remote Technology, Inc.
|
|
4
|
-
NPM Package: @remoteoss/json-schema-form@0.
|
|
5
|
-
Generated:
|
|
4
|
+
NPM Package: @remoteoss/json-schema-form@0.4.0-beta.0
|
|
5
|
+
Generated: Thu, 22 Jun 2023 10:03:23 GMT
|
|
6
6
|
|
|
7
7
|
MIT License
|
|
8
8
|
|
|
@@ -3496,6 +3496,440 @@ var require_set = __commonJS({
|
|
|
3496
3496
|
}
|
|
3497
3497
|
});
|
|
3498
3498
|
|
|
3499
|
+
// node_modules/synchronous-promise/index.js
|
|
3500
|
+
var require_synchronous_promise = __commonJS({
|
|
3501
|
+
"node_modules/synchronous-promise/index.js"(exports2, module2) {
|
|
3502
|
+
"use strict";
|
|
3503
|
+
function makeArrayFrom(obj) {
|
|
3504
|
+
return Array.prototype.slice.apply(obj);
|
|
3505
|
+
}
|
|
3506
|
+
var PENDING = "pending";
|
|
3507
|
+
var RESOLVED = "resolved";
|
|
3508
|
+
var REJECTED = "rejected";
|
|
3509
|
+
function SynchronousPromise4(handler) {
|
|
3510
|
+
this.status = PENDING;
|
|
3511
|
+
this._continuations = [];
|
|
3512
|
+
this._parent = null;
|
|
3513
|
+
this._paused = false;
|
|
3514
|
+
if (handler) {
|
|
3515
|
+
handler.call(
|
|
3516
|
+
this,
|
|
3517
|
+
this._continueWith.bind(this),
|
|
3518
|
+
this._failWith.bind(this)
|
|
3519
|
+
);
|
|
3520
|
+
}
|
|
3521
|
+
}
|
|
3522
|
+
function looksLikeAPromise(obj) {
|
|
3523
|
+
return obj && typeof obj.then === "function";
|
|
3524
|
+
}
|
|
3525
|
+
function passThrough(value) {
|
|
3526
|
+
return value;
|
|
3527
|
+
}
|
|
3528
|
+
SynchronousPromise4.prototype = {
|
|
3529
|
+
then: function(nextFn, catchFn) {
|
|
3530
|
+
var next = SynchronousPromise4.unresolved()._setParent(this);
|
|
3531
|
+
if (this._isRejected()) {
|
|
3532
|
+
if (this._paused) {
|
|
3533
|
+
this._continuations.push({
|
|
3534
|
+
promise: next,
|
|
3535
|
+
nextFn,
|
|
3536
|
+
catchFn
|
|
3537
|
+
});
|
|
3538
|
+
return next;
|
|
3539
|
+
}
|
|
3540
|
+
if (catchFn) {
|
|
3541
|
+
try {
|
|
3542
|
+
var catchResult = catchFn(this._error);
|
|
3543
|
+
if (looksLikeAPromise(catchResult)) {
|
|
3544
|
+
this._chainPromiseData(catchResult, next);
|
|
3545
|
+
return next;
|
|
3546
|
+
} else {
|
|
3547
|
+
return SynchronousPromise4.resolve(catchResult)._setParent(this);
|
|
3548
|
+
}
|
|
3549
|
+
} catch (e) {
|
|
3550
|
+
return SynchronousPromise4.reject(e)._setParent(this);
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
return SynchronousPromise4.reject(this._error)._setParent(this);
|
|
3554
|
+
}
|
|
3555
|
+
this._continuations.push({
|
|
3556
|
+
promise: next,
|
|
3557
|
+
nextFn,
|
|
3558
|
+
catchFn
|
|
3559
|
+
});
|
|
3560
|
+
this._runResolutions();
|
|
3561
|
+
return next;
|
|
3562
|
+
},
|
|
3563
|
+
catch: function(handler) {
|
|
3564
|
+
if (this._isResolved()) {
|
|
3565
|
+
return SynchronousPromise4.resolve(this._data)._setParent(this);
|
|
3566
|
+
}
|
|
3567
|
+
var next = SynchronousPromise4.unresolved()._setParent(this);
|
|
3568
|
+
this._continuations.push({
|
|
3569
|
+
promise: next,
|
|
3570
|
+
catchFn: handler
|
|
3571
|
+
});
|
|
3572
|
+
this._runRejections();
|
|
3573
|
+
return next;
|
|
3574
|
+
},
|
|
3575
|
+
finally: function(callback) {
|
|
3576
|
+
var ran = false;
|
|
3577
|
+
function runFinally(result, err) {
|
|
3578
|
+
if (!ran) {
|
|
3579
|
+
ran = true;
|
|
3580
|
+
if (!callback) {
|
|
3581
|
+
callback = passThrough;
|
|
3582
|
+
}
|
|
3583
|
+
var callbackResult = callback(result);
|
|
3584
|
+
if (looksLikeAPromise(callbackResult)) {
|
|
3585
|
+
return callbackResult.then(function() {
|
|
3586
|
+
if (err) {
|
|
3587
|
+
throw err;
|
|
3588
|
+
}
|
|
3589
|
+
return result;
|
|
3590
|
+
});
|
|
3591
|
+
} else {
|
|
3592
|
+
return result;
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
return this.then(function(result) {
|
|
3597
|
+
return runFinally(result);
|
|
3598
|
+
}).catch(function(err) {
|
|
3599
|
+
return runFinally(null, err);
|
|
3600
|
+
});
|
|
3601
|
+
},
|
|
3602
|
+
pause: function() {
|
|
3603
|
+
this._paused = true;
|
|
3604
|
+
return this;
|
|
3605
|
+
},
|
|
3606
|
+
resume: function() {
|
|
3607
|
+
var firstPaused = this._findFirstPaused();
|
|
3608
|
+
if (firstPaused) {
|
|
3609
|
+
firstPaused._paused = false;
|
|
3610
|
+
firstPaused._runResolutions();
|
|
3611
|
+
firstPaused._runRejections();
|
|
3612
|
+
}
|
|
3613
|
+
return this;
|
|
3614
|
+
},
|
|
3615
|
+
_findAncestry: function() {
|
|
3616
|
+
return this._continuations.reduce(function(acc, cur) {
|
|
3617
|
+
if (cur.promise) {
|
|
3618
|
+
var node = {
|
|
3619
|
+
promise: cur.promise,
|
|
3620
|
+
children: cur.promise._findAncestry()
|
|
3621
|
+
};
|
|
3622
|
+
acc.push(node);
|
|
3623
|
+
}
|
|
3624
|
+
return acc;
|
|
3625
|
+
}, []);
|
|
3626
|
+
},
|
|
3627
|
+
_setParent: function(parent) {
|
|
3628
|
+
if (this._parent) {
|
|
3629
|
+
throw new Error("parent already set");
|
|
3630
|
+
}
|
|
3631
|
+
this._parent = parent;
|
|
3632
|
+
return this;
|
|
3633
|
+
},
|
|
3634
|
+
_continueWith: function(data) {
|
|
3635
|
+
var firstPending = this._findFirstPending();
|
|
3636
|
+
if (firstPending) {
|
|
3637
|
+
firstPending._data = data;
|
|
3638
|
+
firstPending._setResolved();
|
|
3639
|
+
}
|
|
3640
|
+
},
|
|
3641
|
+
_findFirstPending: function() {
|
|
3642
|
+
return this._findFirstAncestor(function(test2) {
|
|
3643
|
+
return test2._isPending && test2._isPending();
|
|
3644
|
+
});
|
|
3645
|
+
},
|
|
3646
|
+
_findFirstPaused: function() {
|
|
3647
|
+
return this._findFirstAncestor(function(test2) {
|
|
3648
|
+
return test2._paused;
|
|
3649
|
+
});
|
|
3650
|
+
},
|
|
3651
|
+
_findFirstAncestor: function(matching) {
|
|
3652
|
+
var test2 = this;
|
|
3653
|
+
var result;
|
|
3654
|
+
while (test2) {
|
|
3655
|
+
if (matching(test2)) {
|
|
3656
|
+
result = test2;
|
|
3657
|
+
}
|
|
3658
|
+
test2 = test2._parent;
|
|
3659
|
+
}
|
|
3660
|
+
return result;
|
|
3661
|
+
},
|
|
3662
|
+
_failWith: function(error) {
|
|
3663
|
+
var firstRejected = this._findFirstPending();
|
|
3664
|
+
if (firstRejected) {
|
|
3665
|
+
firstRejected._error = error;
|
|
3666
|
+
firstRejected._setRejected();
|
|
3667
|
+
}
|
|
3668
|
+
},
|
|
3669
|
+
_takeContinuations: function() {
|
|
3670
|
+
return this._continuations.splice(0, this._continuations.length);
|
|
3671
|
+
},
|
|
3672
|
+
_runRejections: function() {
|
|
3673
|
+
if (this._paused || !this._isRejected()) {
|
|
3674
|
+
return;
|
|
3675
|
+
}
|
|
3676
|
+
var error = this._error, continuations = this._takeContinuations(), self2 = this;
|
|
3677
|
+
continuations.forEach(function(cont) {
|
|
3678
|
+
if (cont.catchFn) {
|
|
3679
|
+
try {
|
|
3680
|
+
var catchResult = cont.catchFn(error);
|
|
3681
|
+
self2._handleUserFunctionResult(catchResult, cont.promise);
|
|
3682
|
+
} catch (e) {
|
|
3683
|
+
cont.promise.reject(e);
|
|
3684
|
+
}
|
|
3685
|
+
} else {
|
|
3686
|
+
cont.promise.reject(error);
|
|
3687
|
+
}
|
|
3688
|
+
});
|
|
3689
|
+
},
|
|
3690
|
+
_runResolutions: function() {
|
|
3691
|
+
if (this._paused || !this._isResolved() || this._isPending()) {
|
|
3692
|
+
return;
|
|
3693
|
+
}
|
|
3694
|
+
var continuations = this._takeContinuations();
|
|
3695
|
+
if (looksLikeAPromise(this._data)) {
|
|
3696
|
+
return this._handleWhenResolvedDataIsPromise(this._data);
|
|
3697
|
+
}
|
|
3698
|
+
var data = this._data;
|
|
3699
|
+
var self2 = this;
|
|
3700
|
+
continuations.forEach(function(cont) {
|
|
3701
|
+
if (cont.nextFn) {
|
|
3702
|
+
try {
|
|
3703
|
+
var result = cont.nextFn(data);
|
|
3704
|
+
self2._handleUserFunctionResult(result, cont.promise);
|
|
3705
|
+
} catch (e) {
|
|
3706
|
+
self2._handleResolutionError(e, cont);
|
|
3707
|
+
}
|
|
3708
|
+
} else if (cont.promise) {
|
|
3709
|
+
cont.promise.resolve(data);
|
|
3710
|
+
}
|
|
3711
|
+
});
|
|
3712
|
+
},
|
|
3713
|
+
_handleResolutionError: function(e, continuation) {
|
|
3714
|
+
this._setRejected();
|
|
3715
|
+
if (continuation.catchFn) {
|
|
3716
|
+
try {
|
|
3717
|
+
continuation.catchFn(e);
|
|
3718
|
+
return;
|
|
3719
|
+
} catch (e2) {
|
|
3720
|
+
e = e2;
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
if (continuation.promise) {
|
|
3724
|
+
continuation.promise.reject(e);
|
|
3725
|
+
}
|
|
3726
|
+
},
|
|
3727
|
+
_handleWhenResolvedDataIsPromise: function(data) {
|
|
3728
|
+
var self2 = this;
|
|
3729
|
+
return data.then(function(result) {
|
|
3730
|
+
self2._data = result;
|
|
3731
|
+
self2._runResolutions();
|
|
3732
|
+
}).catch(function(error) {
|
|
3733
|
+
self2._error = error;
|
|
3734
|
+
self2._setRejected();
|
|
3735
|
+
self2._runRejections();
|
|
3736
|
+
});
|
|
3737
|
+
},
|
|
3738
|
+
_handleUserFunctionResult: function(data, nextSynchronousPromise) {
|
|
3739
|
+
if (looksLikeAPromise(data)) {
|
|
3740
|
+
this._chainPromiseData(data, nextSynchronousPromise);
|
|
3741
|
+
} else {
|
|
3742
|
+
nextSynchronousPromise.resolve(data);
|
|
3743
|
+
}
|
|
3744
|
+
},
|
|
3745
|
+
_chainPromiseData: function(promiseData, nextSynchronousPromise) {
|
|
3746
|
+
promiseData.then(function(newData) {
|
|
3747
|
+
nextSynchronousPromise.resolve(newData);
|
|
3748
|
+
}).catch(function(newError) {
|
|
3749
|
+
nextSynchronousPromise.reject(newError);
|
|
3750
|
+
});
|
|
3751
|
+
},
|
|
3752
|
+
_setResolved: function() {
|
|
3753
|
+
this.status = RESOLVED;
|
|
3754
|
+
if (!this._paused) {
|
|
3755
|
+
this._runResolutions();
|
|
3756
|
+
}
|
|
3757
|
+
},
|
|
3758
|
+
_setRejected: function() {
|
|
3759
|
+
this.status = REJECTED;
|
|
3760
|
+
if (!this._paused) {
|
|
3761
|
+
this._runRejections();
|
|
3762
|
+
}
|
|
3763
|
+
},
|
|
3764
|
+
_isPending: function() {
|
|
3765
|
+
return this.status === PENDING;
|
|
3766
|
+
},
|
|
3767
|
+
_isResolved: function() {
|
|
3768
|
+
return this.status === RESOLVED;
|
|
3769
|
+
},
|
|
3770
|
+
_isRejected: function() {
|
|
3771
|
+
return this.status === REJECTED;
|
|
3772
|
+
}
|
|
3773
|
+
};
|
|
3774
|
+
SynchronousPromise4.resolve = function(result) {
|
|
3775
|
+
return new SynchronousPromise4(function(resolve2, reject) {
|
|
3776
|
+
if (looksLikeAPromise(result)) {
|
|
3777
|
+
result.then(function(newResult) {
|
|
3778
|
+
resolve2(newResult);
|
|
3779
|
+
}).catch(function(error) {
|
|
3780
|
+
reject(error);
|
|
3781
|
+
});
|
|
3782
|
+
} else {
|
|
3783
|
+
resolve2(result);
|
|
3784
|
+
}
|
|
3785
|
+
});
|
|
3786
|
+
};
|
|
3787
|
+
SynchronousPromise4.reject = function(result) {
|
|
3788
|
+
return new SynchronousPromise4(function(resolve2, reject) {
|
|
3789
|
+
reject(result);
|
|
3790
|
+
});
|
|
3791
|
+
};
|
|
3792
|
+
SynchronousPromise4.unresolved = function() {
|
|
3793
|
+
return new SynchronousPromise4(function(resolve2, reject) {
|
|
3794
|
+
this.resolve = resolve2;
|
|
3795
|
+
this.reject = reject;
|
|
3796
|
+
});
|
|
3797
|
+
};
|
|
3798
|
+
SynchronousPromise4.all = function() {
|
|
3799
|
+
var args = makeArrayFrom(arguments);
|
|
3800
|
+
if (Array.isArray(args[0])) {
|
|
3801
|
+
args = args[0];
|
|
3802
|
+
}
|
|
3803
|
+
if (!args.length) {
|
|
3804
|
+
return SynchronousPromise4.resolve([]);
|
|
3805
|
+
}
|
|
3806
|
+
return new SynchronousPromise4(function(resolve2, reject) {
|
|
3807
|
+
var allData = [], numResolved = 0, doResolve = function() {
|
|
3808
|
+
if (numResolved === args.length) {
|
|
3809
|
+
resolve2(allData);
|
|
3810
|
+
}
|
|
3811
|
+
}, rejected = false, doReject = function(err) {
|
|
3812
|
+
if (rejected) {
|
|
3813
|
+
return;
|
|
3814
|
+
}
|
|
3815
|
+
rejected = true;
|
|
3816
|
+
reject(err);
|
|
3817
|
+
};
|
|
3818
|
+
args.forEach(function(arg, idx) {
|
|
3819
|
+
SynchronousPromise4.resolve(arg).then(function(thisResult) {
|
|
3820
|
+
allData[idx] = thisResult;
|
|
3821
|
+
numResolved += 1;
|
|
3822
|
+
doResolve();
|
|
3823
|
+
}).catch(function(err) {
|
|
3824
|
+
doReject(err);
|
|
3825
|
+
});
|
|
3826
|
+
});
|
|
3827
|
+
});
|
|
3828
|
+
};
|
|
3829
|
+
function createAggregateErrorFrom(errors) {
|
|
3830
|
+
if (typeof window !== "undefined" && "AggregateError" in window) {
|
|
3831
|
+
return new window.AggregateError(errors);
|
|
3832
|
+
}
|
|
3833
|
+
return { errors };
|
|
3834
|
+
}
|
|
3835
|
+
SynchronousPromise4.any = function() {
|
|
3836
|
+
var args = makeArrayFrom(arguments);
|
|
3837
|
+
if (Array.isArray(args[0])) {
|
|
3838
|
+
args = args[0];
|
|
3839
|
+
}
|
|
3840
|
+
if (!args.length) {
|
|
3841
|
+
return SynchronousPromise4.reject(createAggregateErrorFrom([]));
|
|
3842
|
+
}
|
|
3843
|
+
return new SynchronousPromise4(function(resolve2, reject) {
|
|
3844
|
+
var allErrors = [], numRejected = 0, doReject = function() {
|
|
3845
|
+
if (numRejected === args.length) {
|
|
3846
|
+
reject(createAggregateErrorFrom(allErrors));
|
|
3847
|
+
}
|
|
3848
|
+
}, resolved = false, doResolve = function(result) {
|
|
3849
|
+
if (resolved) {
|
|
3850
|
+
return;
|
|
3851
|
+
}
|
|
3852
|
+
resolved = true;
|
|
3853
|
+
resolve2(result);
|
|
3854
|
+
};
|
|
3855
|
+
args.forEach(function(arg, idx) {
|
|
3856
|
+
SynchronousPromise4.resolve(arg).then(function(thisResult) {
|
|
3857
|
+
doResolve(thisResult);
|
|
3858
|
+
}).catch(function(err) {
|
|
3859
|
+
allErrors[idx] = err;
|
|
3860
|
+
numRejected += 1;
|
|
3861
|
+
doReject();
|
|
3862
|
+
});
|
|
3863
|
+
});
|
|
3864
|
+
});
|
|
3865
|
+
};
|
|
3866
|
+
SynchronousPromise4.allSettled = function() {
|
|
3867
|
+
var args = makeArrayFrom(arguments);
|
|
3868
|
+
if (Array.isArray(args[0])) {
|
|
3869
|
+
args = args[0];
|
|
3870
|
+
}
|
|
3871
|
+
if (!args.length) {
|
|
3872
|
+
return SynchronousPromise4.resolve([]);
|
|
3873
|
+
}
|
|
3874
|
+
return new SynchronousPromise4(function(resolve2) {
|
|
3875
|
+
var allData = [], numSettled = 0, doSettled = function() {
|
|
3876
|
+
numSettled += 1;
|
|
3877
|
+
if (numSettled === args.length) {
|
|
3878
|
+
resolve2(allData);
|
|
3879
|
+
}
|
|
3880
|
+
};
|
|
3881
|
+
args.forEach(function(arg, idx) {
|
|
3882
|
+
SynchronousPromise4.resolve(arg).then(function(thisResult) {
|
|
3883
|
+
allData[idx] = {
|
|
3884
|
+
status: "fulfilled",
|
|
3885
|
+
value: thisResult
|
|
3886
|
+
};
|
|
3887
|
+
doSettled();
|
|
3888
|
+
}).catch(function(err) {
|
|
3889
|
+
allData[idx] = {
|
|
3890
|
+
status: "rejected",
|
|
3891
|
+
reason: err
|
|
3892
|
+
};
|
|
3893
|
+
doSettled();
|
|
3894
|
+
});
|
|
3895
|
+
});
|
|
3896
|
+
});
|
|
3897
|
+
};
|
|
3898
|
+
if (Promise === SynchronousPromise4) {
|
|
3899
|
+
throw new Error("Please use SynchronousPromise.installGlobally() to install globally");
|
|
3900
|
+
}
|
|
3901
|
+
var RealPromise = Promise;
|
|
3902
|
+
SynchronousPromise4.installGlobally = function(__awaiter) {
|
|
3903
|
+
if (Promise === SynchronousPromise4) {
|
|
3904
|
+
return __awaiter;
|
|
3905
|
+
}
|
|
3906
|
+
var result = patchAwaiterIfRequired(__awaiter);
|
|
3907
|
+
Promise = SynchronousPromise4;
|
|
3908
|
+
return result;
|
|
3909
|
+
};
|
|
3910
|
+
SynchronousPromise4.uninstallGlobally = function() {
|
|
3911
|
+
if (Promise === SynchronousPromise4) {
|
|
3912
|
+
Promise = RealPromise;
|
|
3913
|
+
}
|
|
3914
|
+
};
|
|
3915
|
+
function patchAwaiterIfRequired(__awaiter) {
|
|
3916
|
+
if (typeof __awaiter === "undefined" || __awaiter.__patched) {
|
|
3917
|
+
return __awaiter;
|
|
3918
|
+
}
|
|
3919
|
+
var originalAwaiter = __awaiter;
|
|
3920
|
+
__awaiter = function() {
|
|
3921
|
+
var Promise3 = RealPromise;
|
|
3922
|
+
originalAwaiter.apply(this, makeArrayFrom(arguments));
|
|
3923
|
+
};
|
|
3924
|
+
__awaiter.__patched = true;
|
|
3925
|
+
return __awaiter;
|
|
3926
|
+
}
|
|
3927
|
+
module2.exports = {
|
|
3928
|
+
SynchronousPromise: SynchronousPromise4
|
|
3929
|
+
};
|
|
3930
|
+
}
|
|
3931
|
+
});
|
|
3932
|
+
|
|
3499
3933
|
// node_modules/property-expr/index.js
|
|
3500
3934
|
var require_property_expr = __commonJS({
|
|
3501
3935
|
"node_modules/property-expr/index.js"(exports2, module2) {
|
|
@@ -8125,7 +8559,6 @@ var date = {
|
|
|
8125
8559
|
min: "${path} field must be later than ${min}",
|
|
8126
8560
|
max: "${path} field must be at earlier than ${max}"
|
|
8127
8561
|
};
|
|
8128
|
-
var boolean = {};
|
|
8129
8562
|
var object = {
|
|
8130
8563
|
noUnknown: "${path} field has unspecified keys: ${unknown}"
|
|
8131
8564
|
};
|
|
@@ -8133,15 +8566,6 @@ var array = {
|
|
|
8133
8566
|
min: "${path} field must have at least ${min} items",
|
|
8134
8567
|
max: "${path} field must have less than or equal to ${max} items"
|
|
8135
8568
|
};
|
|
8136
|
-
var locale_default = _extends(/* @__PURE__ */ Object.create(null), {
|
|
8137
|
-
mixed,
|
|
8138
|
-
string,
|
|
8139
|
-
number,
|
|
8140
|
-
date,
|
|
8141
|
-
object,
|
|
8142
|
-
array,
|
|
8143
|
-
boolean
|
|
8144
|
-
});
|
|
8145
8569
|
|
|
8146
8570
|
// node_modules/yup/es/util/isSchema.js
|
|
8147
8571
|
var isSchema_default = function(obj) {
|
|
@@ -8186,7 +8610,7 @@ var Condition = /* @__PURE__ */ function() {
|
|
|
8186
8610
|
var _proto = Condition2.prototype;
|
|
8187
8611
|
_proto.resolve = function resolve2(base, options) {
|
|
8188
8612
|
var values2 = this.refs.map(function(ref) {
|
|
8189
|
-
return ref.getValue(options
|
|
8613
|
+
return ref.getValue(options);
|
|
8190
8614
|
});
|
|
8191
8615
|
var schema = this.fn.apply(base, values2.concat(base, options));
|
|
8192
8616
|
if (schema === void 0 || schema === base)
|
|
@@ -8199,8 +8623,34 @@ var Condition = /* @__PURE__ */ function() {
|
|
|
8199
8623
|
}();
|
|
8200
8624
|
var Condition_default = Condition;
|
|
8201
8625
|
|
|
8626
|
+
// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
8627
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
8628
|
+
if (source == null)
|
|
8629
|
+
return {};
|
|
8630
|
+
var target = {};
|
|
8631
|
+
var sourceKeys = Object.keys(source);
|
|
8632
|
+
var key, i;
|
|
8633
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
8634
|
+
key = sourceKeys[i];
|
|
8635
|
+
if (excluded.indexOf(key) >= 0)
|
|
8636
|
+
continue;
|
|
8637
|
+
target[key] = source[key];
|
|
8638
|
+
}
|
|
8639
|
+
return target;
|
|
8640
|
+
}
|
|
8641
|
+
|
|
8642
|
+
// node_modules/yup/es/util/runValidations.js
|
|
8643
|
+
var import_synchronous_promise = __toESM(require_synchronous_promise());
|
|
8644
|
+
|
|
8202
8645
|
// node_modules/yup/es/ValidationError.js
|
|
8203
8646
|
var strReg = /\$\{\s*(\w+)\s*\}/g;
|
|
8647
|
+
var replace = function replace2(str) {
|
|
8648
|
+
return function(params) {
|
|
8649
|
+
return str.replace(strReg, function(_, key) {
|
|
8650
|
+
return printValue(params[key]);
|
|
8651
|
+
});
|
|
8652
|
+
};
|
|
8653
|
+
};
|
|
8204
8654
|
function ValidationError(errors, value, field, type) {
|
|
8205
8655
|
var _this = this;
|
|
8206
8656
|
this.name = "ValidationError";
|
|
@@ -8225,65 +8675,85 @@ ValidationError.isError = function(err) {
|
|
|
8225
8675
|
return err && err.name === "ValidationError";
|
|
8226
8676
|
};
|
|
8227
8677
|
ValidationError.formatError = function(message, params) {
|
|
8228
|
-
params.path = params.label || params.path || "this";
|
|
8229
8678
|
if (typeof message === "string")
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
return message(params);
|
|
8235
|
-
return message;
|
|
8236
|
-
};
|
|
8237
|
-
|
|
8238
|
-
// node_modules/yup/es/util/async.js
|
|
8239
|
-
var once = function once2(cb) {
|
|
8240
|
-
var fired = false;
|
|
8241
|
-
return function() {
|
|
8242
|
-
if (fired)
|
|
8243
|
-
return;
|
|
8244
|
-
fired = true;
|
|
8245
|
-
cb.apply(void 0, arguments);
|
|
8679
|
+
message = replace(message);
|
|
8680
|
+
var fn = function fn2(params2) {
|
|
8681
|
+
params2.path = params2.label || params2.path || "this";
|
|
8682
|
+
return typeof message === "function" ? message(params2) : message;
|
|
8246
8683
|
};
|
|
8684
|
+
return arguments.length === 1 ? fn : fn(params);
|
|
8247
8685
|
};
|
|
8248
8686
|
|
|
8249
|
-
// node_modules/yup/es/util/
|
|
8250
|
-
function
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
if (
|
|
8255
|
-
|
|
8256
|
-
var nestedErrors = [];
|
|
8257
|
-
errors = errors ? errors : [];
|
|
8258
|
-
for (var i = 0; i < tests.length; i++) {
|
|
8259
|
-
var test2 = tests[i];
|
|
8260
|
-
test2(args, function finishTestRun(err) {
|
|
8261
|
-
if (err) {
|
|
8262
|
-
if (!ValidationError.isError(err)) {
|
|
8263
|
-
return callback(err);
|
|
8264
|
-
}
|
|
8265
|
-
if (endEarly) {
|
|
8266
|
-
err.value = value;
|
|
8267
|
-
return callback(err);
|
|
8268
|
-
}
|
|
8269
|
-
nestedErrors.push(err);
|
|
8270
|
-
}
|
|
8271
|
-
if (--count <= 0) {
|
|
8272
|
-
if (nestedErrors.length) {
|
|
8273
|
-
if (sort)
|
|
8274
|
-
nestedErrors.sort(sort);
|
|
8275
|
-
if (errors.length)
|
|
8276
|
-
nestedErrors.push.apply(nestedErrors, errors);
|
|
8277
|
-
errors = nestedErrors;
|
|
8278
|
-
}
|
|
8279
|
-
if (errors.length) {
|
|
8280
|
-
callback(new ValidationError(errors, value, path));
|
|
8281
|
-
return;
|
|
8282
|
-
}
|
|
8283
|
-
callback(null, value);
|
|
8284
|
-
}
|
|
8285
|
-
});
|
|
8687
|
+
// node_modules/yup/es/util/runValidations.js
|
|
8688
|
+
var promise = function promise2(sync) {
|
|
8689
|
+
return sync ? import_synchronous_promise.SynchronousPromise : Promise;
|
|
8690
|
+
};
|
|
8691
|
+
var unwrapError = function unwrapError2(errors) {
|
|
8692
|
+
if (errors === void 0) {
|
|
8693
|
+
errors = [];
|
|
8286
8694
|
}
|
|
8695
|
+
return errors.inner && errors.inner.length ? errors.inner : [].concat(errors);
|
|
8696
|
+
};
|
|
8697
|
+
function scopeToValue(promises, value, sync) {
|
|
8698
|
+
var p = promise(sync).all(promises);
|
|
8699
|
+
var b = p.catch(function(err) {
|
|
8700
|
+
if (err.name === "ValidationError")
|
|
8701
|
+
err.value = value;
|
|
8702
|
+
throw err;
|
|
8703
|
+
});
|
|
8704
|
+
var c = b.then(function() {
|
|
8705
|
+
return value;
|
|
8706
|
+
});
|
|
8707
|
+
return c;
|
|
8708
|
+
}
|
|
8709
|
+
function propagateErrors(endEarly, errors) {
|
|
8710
|
+
return endEarly ? null : function(err) {
|
|
8711
|
+
errors.push(err);
|
|
8712
|
+
return err.value;
|
|
8713
|
+
};
|
|
8714
|
+
}
|
|
8715
|
+
function settled(promises, sync) {
|
|
8716
|
+
var Promise3 = promise(sync);
|
|
8717
|
+
return Promise3.all(promises.map(function(p) {
|
|
8718
|
+
return Promise3.resolve(p).then(function(value) {
|
|
8719
|
+
return {
|
|
8720
|
+
fulfilled: true,
|
|
8721
|
+
value
|
|
8722
|
+
};
|
|
8723
|
+
}, function(value) {
|
|
8724
|
+
return {
|
|
8725
|
+
fulfilled: false,
|
|
8726
|
+
value
|
|
8727
|
+
};
|
|
8728
|
+
});
|
|
8729
|
+
}));
|
|
8730
|
+
}
|
|
8731
|
+
function collectErrors(_ref) {
|
|
8732
|
+
var validations = _ref.validations, value = _ref.value, path = _ref.path, sync = _ref.sync, errors = _ref.errors, sort = _ref.sort;
|
|
8733
|
+
errors = unwrapError(errors);
|
|
8734
|
+
return settled(validations, sync).then(function(results) {
|
|
8735
|
+
var nestedErrors = results.filter(function(r) {
|
|
8736
|
+
return !r.fulfilled;
|
|
8737
|
+
}).reduce(function(arr, _ref2) {
|
|
8738
|
+
var error = _ref2.value;
|
|
8739
|
+
if (!ValidationError.isError(error)) {
|
|
8740
|
+
throw error;
|
|
8741
|
+
}
|
|
8742
|
+
return arr.concat(error);
|
|
8743
|
+
}, []);
|
|
8744
|
+
if (sort)
|
|
8745
|
+
nestedErrors.sort(sort);
|
|
8746
|
+
errors = nestedErrors.concat(errors);
|
|
8747
|
+
if (errors.length)
|
|
8748
|
+
throw new ValidationError(errors, value, path);
|
|
8749
|
+
return value;
|
|
8750
|
+
});
|
|
8751
|
+
}
|
|
8752
|
+
function runValidations(_ref3) {
|
|
8753
|
+
var endEarly = _ref3.endEarly, options = _objectWithoutPropertiesLoose(_ref3, ["endEarly"]);
|
|
8754
|
+
if (endEarly)
|
|
8755
|
+
return scopeToValue(options.validations, options.value, options.sync);
|
|
8756
|
+
return collectErrors(options);
|
|
8287
8757
|
}
|
|
8288
8758
|
|
|
8289
8759
|
// node_modules/yup/es/util/prependDeep.js
|
|
@@ -8313,22 +8783,6 @@ function prependDeep(target, source) {
|
|
|
8313
8783
|
return target;
|
|
8314
8784
|
}
|
|
8315
8785
|
|
|
8316
|
-
// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
8317
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
8318
|
-
if (source == null)
|
|
8319
|
-
return {};
|
|
8320
|
-
var target = {};
|
|
8321
|
-
var sourceKeys = Object.keys(source);
|
|
8322
|
-
var key, i;
|
|
8323
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
8324
|
-
key = sourceKeys[i];
|
|
8325
|
-
if (excluded.indexOf(key) >= 0)
|
|
8326
|
-
continue;
|
|
8327
|
-
target[key] = source[key];
|
|
8328
|
-
}
|
|
8329
|
-
return target;
|
|
8330
|
-
}
|
|
8331
|
-
|
|
8332
8786
|
// node_modules/lodash-es/_createBaseFor.js
|
|
8333
8787
|
function createBaseFor(fromRight) {
|
|
8334
8788
|
return function(object2, iteratee, keysFunc) {
|
|
@@ -8809,8 +9263,8 @@ var Reference = /* @__PURE__ */ function() {
|
|
|
8809
9263
|
this.map = options.map;
|
|
8810
9264
|
}
|
|
8811
9265
|
var _proto = Reference2.prototype;
|
|
8812
|
-
_proto.getValue = function getValue2(
|
|
8813
|
-
var result = this.isContext ? context : this.isValue ? value : parent;
|
|
9266
|
+
_proto.getValue = function getValue2(options) {
|
|
9267
|
+
var result = this.isContext ? options.context : this.isValue ? options.value : options.parent;
|
|
8814
9268
|
if (this.getter)
|
|
8815
9269
|
result = this.getter(result || {});
|
|
8816
9270
|
if (this.map)
|
|
@@ -8818,7 +9272,9 @@ var Reference = /* @__PURE__ */ function() {
|
|
|
8818
9272
|
return result;
|
|
8819
9273
|
};
|
|
8820
9274
|
_proto.cast = function cast2(value, options) {
|
|
8821
|
-
return this.getValue(
|
|
9275
|
+
return this.getValue(_extends({}, options, {
|
|
9276
|
+
value
|
|
9277
|
+
}));
|
|
8822
9278
|
};
|
|
8823
9279
|
_proto.resolve = function resolve2() {
|
|
8824
9280
|
return this;
|
|
@@ -8840,71 +9296,76 @@ var Reference = /* @__PURE__ */ function() {
|
|
|
8840
9296
|
Reference.prototype.__isYupRef = true;
|
|
8841
9297
|
|
|
8842
9298
|
// node_modules/yup/es/util/createValidation.js
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
9299
|
+
var import_synchronous_promise2 = __toESM(require_synchronous_promise());
|
|
9300
|
+
var formatError = ValidationError.formatError;
|
|
9301
|
+
var thenable = function thenable2(p) {
|
|
9302
|
+
return p && typeof p.then === "function" && typeof p.catch === "function";
|
|
9303
|
+
};
|
|
9304
|
+
function runTest(testFn, ctx, value, sync) {
|
|
9305
|
+
var result = testFn.call(ctx, value);
|
|
9306
|
+
if (!sync)
|
|
9307
|
+
return Promise.resolve(result);
|
|
9308
|
+
if (thenable(result)) {
|
|
9309
|
+
throw new Error('Validation test of type: "' + ctx.type + '" returned a Promise during a synchronous validate. This test will finish after the validate call has returned');
|
|
9310
|
+
}
|
|
9311
|
+
return import_synchronous_promise2.SynchronousPromise.resolve(result);
|
|
9312
|
+
}
|
|
9313
|
+
function resolveParams(oldParams, newParams, resolve2) {
|
|
9314
|
+
return mapValues_default(_extends({}, oldParams, newParams), resolve2);
|
|
9315
|
+
}
|
|
9316
|
+
function createErrorFactory(_ref) {
|
|
9317
|
+
var value = _ref.value, label2 = _ref.label, resolve2 = _ref.resolve, originalValue = _ref.originalValue, opts = _objectWithoutPropertiesLoose(_ref, ["value", "label", "resolve", "originalValue"]);
|
|
9318
|
+
return function createError(_temp) {
|
|
9319
|
+
var _ref2 = _temp === void 0 ? {} : _temp, _ref2$path = _ref2.path, path = _ref2$path === void 0 ? opts.path : _ref2$path, _ref2$message = _ref2.message, message = _ref2$message === void 0 ? opts.message : _ref2$message, _ref2$type = _ref2.type, type = _ref2$type === void 0 ? opts.name : _ref2$type, params = _ref2.params;
|
|
9320
|
+
params = _extends({
|
|
9321
|
+
path,
|
|
9322
|
+
value,
|
|
9323
|
+
originalValue,
|
|
9324
|
+
label: label2
|
|
9325
|
+
}, resolveParams(opts.params, params, resolve2));
|
|
9326
|
+
return _extends(new ValidationError(formatError(message, params), value, path, type), {
|
|
9327
|
+
params
|
|
9328
|
+
});
|
|
9329
|
+
};
|
|
9330
|
+
}
|
|
9331
|
+
function createValidation(options) {
|
|
9332
|
+
var name = options.name, message = options.message, test2 = options.test, params = options.params;
|
|
9333
|
+
function validate2(_ref3) {
|
|
9334
|
+
var value = _ref3.value, path = _ref3.path, label2 = _ref3.label, options2 = _ref3.options, originalValue = _ref3.originalValue, sync = _ref3.sync, rest = _objectWithoutPropertiesLoose(_ref3, ["value", "path", "label", "options", "originalValue", "sync"]);
|
|
9335
|
+
var parent = options2.parent;
|
|
9336
|
+
var resolve2 = function resolve3(item) {
|
|
9337
|
+
return Reference.isRef(item) ? item.getValue({
|
|
8856
9338
|
value,
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
9339
|
+
parent,
|
|
9340
|
+
context: options2.context
|
|
9341
|
+
}) : item;
|
|
9342
|
+
};
|
|
9343
|
+
var createError = createErrorFactory({
|
|
9344
|
+
message,
|
|
9345
|
+
path,
|
|
9346
|
+
value,
|
|
9347
|
+
originalValue,
|
|
9348
|
+
params,
|
|
9349
|
+
label: label2,
|
|
9350
|
+
resolve: resolve2,
|
|
9351
|
+
name
|
|
9352
|
+
});
|
|
8865
9353
|
var ctx = _extends({
|
|
8866
9354
|
path,
|
|
8867
9355
|
parent,
|
|
8868
9356
|
type: name,
|
|
8869
9357
|
createError,
|
|
8870
9358
|
resolve: resolve2,
|
|
8871
|
-
options
|
|
8872
|
-
originalValue
|
|
9359
|
+
options: options2
|
|
8873
9360
|
}, rest);
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
cb(createError());
|
|
8881
|
-
else
|
|
8882
|
-
cb(null, validOrError);
|
|
8883
|
-
});
|
|
8884
|
-
} catch (err) {
|
|
8885
|
-
cb(err);
|
|
8886
|
-
}
|
|
8887
|
-
return;
|
|
8888
|
-
}
|
|
8889
|
-
var result;
|
|
8890
|
-
try {
|
|
8891
|
-
var _result;
|
|
8892
|
-
result = test2.call(ctx, value, ctx);
|
|
8893
|
-
if (typeof ((_result = result) == null ? void 0 : _result.then) === "function") {
|
|
8894
|
-
throw new Error('Validation test of type: "' + ctx.type + '" returned a Promise during a synchronous validate. This test will finish after the validate call has returned');
|
|
8895
|
-
}
|
|
8896
|
-
} catch (err) {
|
|
8897
|
-
cb(err);
|
|
8898
|
-
return;
|
|
8899
|
-
}
|
|
8900
|
-
if (ValidationError.isError(result))
|
|
8901
|
-
cb(result);
|
|
8902
|
-
else if (!result)
|
|
8903
|
-
cb(createError());
|
|
8904
|
-
else
|
|
8905
|
-
cb(null, result);
|
|
9361
|
+
return runTest(test2, ctx, value, sync).then(function(validOrError) {
|
|
9362
|
+
if (ValidationError.isError(validOrError))
|
|
9363
|
+
throw validOrError;
|
|
9364
|
+
else if (!validOrError)
|
|
9365
|
+
throw createError();
|
|
9366
|
+
});
|
|
8906
9367
|
}
|
|
8907
|
-
validate2.OPTIONS =
|
|
9368
|
+
validate2.OPTIONS = options;
|
|
8908
9369
|
return validate2;
|
|
8909
9370
|
}
|
|
8910
9371
|
|
|
@@ -9097,12 +9558,9 @@ var proto = SchemaType.prototype = {
|
|
|
9097
9558
|
var _this2 = this;
|
|
9098
9559
|
if (this._mutate)
|
|
9099
9560
|
return this;
|
|
9100
|
-
return cloneDeepWith_default(this, function(value
|
|
9561
|
+
return cloneDeepWith_default(this, function(value) {
|
|
9101
9562
|
if (isSchema_default(value) && value !== _this2)
|
|
9102
9563
|
return value;
|
|
9103
|
-
if (key === "_whitelist" || key === "_blacklist") {
|
|
9104
|
-
return value.clone();
|
|
9105
|
-
}
|
|
9106
9564
|
});
|
|
9107
9565
|
},
|
|
9108
9566
|
label: function label(_label) {
|
|
@@ -9161,20 +9619,13 @@ var proto = SchemaType.prototype = {
|
|
|
9161
9619
|
}
|
|
9162
9620
|
return schema;
|
|
9163
9621
|
},
|
|
9164
|
-
/**
|
|
9165
|
-
*
|
|
9166
|
-
* @param {*} value
|
|
9167
|
-
* @param {Object} options
|
|
9168
|
-
* @param {*=} options.parent
|
|
9169
|
-
* @param {*=} options.context
|
|
9170
|
-
*/
|
|
9171
9622
|
cast: function cast(value, options) {
|
|
9172
9623
|
if (options === void 0) {
|
|
9173
9624
|
options = {};
|
|
9174
9625
|
}
|
|
9175
|
-
var resolvedSchema = this.resolve(_extends({
|
|
9626
|
+
var resolvedSchema = this.resolve(_extends({}, options, {
|
|
9176
9627
|
value
|
|
9177
|
-
}
|
|
9628
|
+
}));
|
|
9178
9629
|
var result = resolvedSchema._cast(value, options);
|
|
9179
9630
|
if (value !== void 0 && options.assert !== false && resolvedSchema.isType(result) !== true) {
|
|
9180
9631
|
var formattedValue = printValue(value);
|
|
@@ -9193,72 +9644,68 @@ var proto = SchemaType.prototype = {
|
|
|
9193
9644
|
}
|
|
9194
9645
|
return value;
|
|
9195
9646
|
},
|
|
9196
|
-
_validate: function _validate(_value, options
|
|
9647
|
+
_validate: function _validate(_value, options) {
|
|
9197
9648
|
var _this4 = this;
|
|
9198
9649
|
if (options === void 0) {
|
|
9199
9650
|
options = {};
|
|
9200
9651
|
}
|
|
9201
|
-
var _options = options, sync = _options.sync, path = _options.path, _options$from = _options.from, from2 = _options$from === void 0 ? [] : _options$from, _options$originalValu = _options.originalValue, originalValue = _options$originalValu === void 0 ? _value : _options$originalValu, _options$strict = _options.strict, strict2 = _options$strict === void 0 ? this._options.strict : _options$strict, _options$abortEarly = _options.abortEarly, abortEarly = _options$abortEarly === void 0 ? this._options.abortEarly : _options$abortEarly;
|
|
9202
9652
|
var value = _value;
|
|
9203
|
-
|
|
9204
|
-
|
|
9653
|
+
var originalValue = options.originalValue != null ? options.originalValue : _value;
|
|
9654
|
+
var isStrict = this._option("strict", options);
|
|
9655
|
+
var endEarly = this._option("abortEarly", options);
|
|
9656
|
+
var sync = options.sync;
|
|
9657
|
+
var path = options.path;
|
|
9658
|
+
var label2 = this._label;
|
|
9659
|
+
if (!isStrict) {
|
|
9205
9660
|
value = this._cast(value, _extends({
|
|
9206
9661
|
assert: false
|
|
9207
9662
|
}, options));
|
|
9208
|
-
this._validating = false;
|
|
9209
9663
|
}
|
|
9210
|
-
var
|
|
9664
|
+
var validationParams = {
|
|
9211
9665
|
value,
|
|
9212
9666
|
path,
|
|
9667
|
+
schema: this,
|
|
9213
9668
|
options,
|
|
9669
|
+
label: label2,
|
|
9214
9670
|
originalValue,
|
|
9215
|
-
|
|
9216
|
-
label: this._label,
|
|
9217
|
-
sync,
|
|
9218
|
-
from: from2
|
|
9671
|
+
sync
|
|
9219
9672
|
};
|
|
9673
|
+
if (options.from) {
|
|
9674
|
+
validationParams.from = options.from;
|
|
9675
|
+
}
|
|
9220
9676
|
var initialTests = [];
|
|
9221
9677
|
if (this._typeError)
|
|
9222
|
-
initialTests.push(this._typeError);
|
|
9678
|
+
initialTests.push(this._typeError(validationParams));
|
|
9223
9679
|
if (this._whitelistError)
|
|
9224
|
-
initialTests.push(this._whitelistError);
|
|
9680
|
+
initialTests.push(this._whitelistError(validationParams));
|
|
9225
9681
|
if (this._blacklistError)
|
|
9226
|
-
initialTests.push(this._blacklistError);
|
|
9227
|
-
return
|
|
9228
|
-
|
|
9682
|
+
initialTests.push(this._blacklistError(validationParams));
|
|
9683
|
+
return runValidations({
|
|
9684
|
+
validations: initialTests,
|
|
9685
|
+
endEarly,
|
|
9229
9686
|
value,
|
|
9230
9687
|
path,
|
|
9231
|
-
sync
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
}, function(err) {
|
|
9235
|
-
if (err)
|
|
9236
|
-
return void cb(err);
|
|
9237
|
-
runTests({
|
|
9238
|
-
tests: _this4.tests,
|
|
9239
|
-
args,
|
|
9688
|
+
sync
|
|
9689
|
+
}).then(function(value2) {
|
|
9690
|
+
return runValidations({
|
|
9240
9691
|
path,
|
|
9241
9692
|
sync,
|
|
9242
|
-
value,
|
|
9243
|
-
endEarly
|
|
9244
|
-
|
|
9693
|
+
value: value2,
|
|
9694
|
+
endEarly,
|
|
9695
|
+
validations: _this4.tests.map(function(fn) {
|
|
9696
|
+
return fn(validationParams);
|
|
9697
|
+
})
|
|
9698
|
+
});
|
|
9245
9699
|
});
|
|
9246
9700
|
},
|
|
9247
|
-
validate: function validate(value, options
|
|
9701
|
+
validate: function validate(value, options) {
|
|
9248
9702
|
if (options === void 0) {
|
|
9249
9703
|
options = {};
|
|
9250
9704
|
}
|
|
9251
9705
|
var schema = this.resolve(_extends({}, options, {
|
|
9252
9706
|
value
|
|
9253
9707
|
}));
|
|
9254
|
-
return
|
|
9255
|
-
return schema._validate(value, options, function(err, value2) {
|
|
9256
|
-
if (err)
|
|
9257
|
-
reject(err);
|
|
9258
|
-
else
|
|
9259
|
-
resolve2(value2);
|
|
9260
|
-
});
|
|
9261
|
-
});
|
|
9708
|
+
return schema._validate(value, options);
|
|
9262
9709
|
},
|
|
9263
9710
|
validateSync: function validateSync(value, options) {
|
|
9264
9711
|
if (options === void 0) {
|
|
@@ -9267,14 +9714,16 @@ var proto = SchemaType.prototype = {
|
|
|
9267
9714
|
var schema = this.resolve(_extends({}, options, {
|
|
9268
9715
|
value
|
|
9269
9716
|
}));
|
|
9270
|
-
var result;
|
|
9717
|
+
var result, err;
|
|
9271
9718
|
schema._validate(value, _extends({}, options, {
|
|
9272
9719
|
sync: true
|
|
9273
|
-
})
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9720
|
+
})).then(function(r) {
|
|
9721
|
+
return result = r;
|
|
9722
|
+
}).catch(function(e) {
|
|
9723
|
+
return err = e;
|
|
9277
9724
|
});
|
|
9725
|
+
if (err)
|
|
9726
|
+
throw err;
|
|
9278
9727
|
return result;
|
|
9279
9728
|
},
|
|
9280
9729
|
isValid: function isValid(value, options) {
|
|
@@ -9534,7 +9983,7 @@ var proto = SchemaType.prototype = {
|
|
|
9534
9983
|
if (message === void 0) {
|
|
9535
9984
|
message = mixed.defined;
|
|
9536
9985
|
}
|
|
9537
|
-
return this.test({
|
|
9986
|
+
return this.nullable().test({
|
|
9538
9987
|
message,
|
|
9539
9988
|
name: "defined",
|
|
9540
9989
|
exclusive: true,
|
|
@@ -9628,7 +10077,7 @@ var isAbsent_default = function(value) {
|
|
|
9628
10077
|
// node_modules/yup/es/string.js
|
|
9629
10078
|
var rEmail = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
|
|
9630
10079
|
var rUrl = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
|
|
9631
|
-
var rUUID = /^
|
|
10080
|
+
var rUUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
9632
10081
|
var isTrimmed = function isTrimmed2(value) {
|
|
9633
10082
|
return isAbsent_default(value) || value === value.trim();
|
|
9634
10083
|
};
|
|
@@ -10043,6 +10492,15 @@ inherits(DateSchema, SchemaType, {
|
|
|
10043
10492
|
}
|
|
10044
10493
|
});
|
|
10045
10494
|
|
|
10495
|
+
// node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js
|
|
10496
|
+
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
10497
|
+
if (!raw) {
|
|
10498
|
+
raw = strings.slice(0);
|
|
10499
|
+
}
|
|
10500
|
+
strings.raw = raw;
|
|
10501
|
+
return strings;
|
|
10502
|
+
}
|
|
10503
|
+
|
|
10046
10504
|
// node_modules/lodash-es/_arrayReduce.js
|
|
10047
10505
|
function arrayReduce(array2, iteratee, accumulator, initAccum) {
|
|
10048
10506
|
var index = -1, length2 = array2 == null ? 0 : array2.length;
|
|
@@ -10450,8 +10908,7 @@ function sortFields(fields, excludes) {
|
|
|
10450
10908
|
if (excludes === void 0) {
|
|
10451
10909
|
excludes = [];
|
|
10452
10910
|
}
|
|
10453
|
-
var edges = [];
|
|
10454
|
-
var nodes = [];
|
|
10911
|
+
var edges = [], nodes = [];
|
|
10455
10912
|
function addNode(depPath, key2) {
|
|
10456
10913
|
var node = (0, import_property_expr3.split)(depPath)[0];
|
|
10457
10914
|
if (!~nodes.indexOf(node))
|
|
@@ -10459,21 +10916,18 @@ function sortFields(fields, excludes) {
|
|
|
10459
10916
|
if (!~excludes.indexOf(key2 + "-" + node))
|
|
10460
10917
|
edges.push([key2, node]);
|
|
10461
10918
|
}
|
|
10462
|
-
var
|
|
10463
|
-
if (has_default(fields,
|
|
10464
|
-
var value = fields[
|
|
10465
|
-
if (!~nodes.indexOf(
|
|
10466
|
-
nodes.push(
|
|
10919
|
+
for (var key in fields) {
|
|
10920
|
+
if (has_default(fields, key)) {
|
|
10921
|
+
var value = fields[key];
|
|
10922
|
+
if (!~nodes.indexOf(key))
|
|
10923
|
+
nodes.push(key);
|
|
10467
10924
|
if (Reference.isRef(value) && value.isSibling)
|
|
10468
|
-
addNode(value.path,
|
|
10925
|
+
addNode(value.path, key);
|
|
10469
10926
|
else if (isSchema_default(value) && value._deps)
|
|
10470
10927
|
value._deps.forEach(function(path) {
|
|
10471
|
-
return addNode(path,
|
|
10928
|
+
return addNode(path, key);
|
|
10472
10929
|
});
|
|
10473
10930
|
}
|
|
10474
|
-
};
|
|
10475
|
-
for (var key in fields) {
|
|
10476
|
-
_loop3(key);
|
|
10477
10931
|
}
|
|
10478
10932
|
return import_toposort.default.array(nodes, edges).reverse();
|
|
10479
10933
|
}
|
|
@@ -10489,55 +10943,54 @@ function findIndex(arr, err) {
|
|
|
10489
10943
|
});
|
|
10490
10944
|
return idx;
|
|
10491
10945
|
}
|
|
10492
|
-
function sortByKeyOrder(
|
|
10946
|
+
function sortByKeyOrder(fields) {
|
|
10947
|
+
var keys2 = Object.keys(fields);
|
|
10493
10948
|
return function(a, b) {
|
|
10494
10949
|
return findIndex(keys2, a) - findIndex(keys2, b);
|
|
10495
10950
|
};
|
|
10496
10951
|
}
|
|
10497
10952
|
|
|
10498
|
-
// node_modules/yup/es/
|
|
10499
|
-
function
|
|
10500
|
-
var
|
|
10501
|
-
|
|
10502
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray2(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
10503
|
-
if (it)
|
|
10504
|
-
o = it;
|
|
10505
|
-
var i = 0;
|
|
10506
|
-
return function() {
|
|
10507
|
-
if (i >= o.length)
|
|
10508
|
-
return { done: true };
|
|
10509
|
-
return { done: false, value: o[i++] };
|
|
10510
|
-
};
|
|
10511
|
-
}
|
|
10512
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10953
|
+
// node_modules/yup/es/util/makePath.js
|
|
10954
|
+
function makePath(strings) {
|
|
10955
|
+
for (var _len = arguments.length, values2 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
10956
|
+
values2[_key - 1] = arguments[_key];
|
|
10513
10957
|
}
|
|
10514
|
-
|
|
10515
|
-
|
|
10958
|
+
var path = strings.reduce(function(str, next) {
|
|
10959
|
+
var value = values2.shift();
|
|
10960
|
+
return str + (value == null ? "" : value) + next;
|
|
10961
|
+
});
|
|
10962
|
+
return path.replace(/^\./, "");
|
|
10516
10963
|
}
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
return Array.from(o);
|
|
10527
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
10528
|
-
return _arrayLikeToArray2(o, minLen);
|
|
10964
|
+
|
|
10965
|
+
// node_modules/yup/es/object.js
|
|
10966
|
+
var import_synchronous_promise3 = __toESM(require_synchronous_promise());
|
|
10967
|
+
function _templateObject3() {
|
|
10968
|
+
var data = _taggedTemplateLiteralLoose(["", '["', '"]']);
|
|
10969
|
+
_templateObject3 = function _templateObject32() {
|
|
10970
|
+
return data;
|
|
10971
|
+
};
|
|
10972
|
+
return data;
|
|
10529
10973
|
}
|
|
10530
|
-
function
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10974
|
+
function _templateObject2() {
|
|
10975
|
+
var data = _taggedTemplateLiteralLoose(["", ".", ""]);
|
|
10976
|
+
_templateObject2 = function _templateObject23() {
|
|
10977
|
+
return data;
|
|
10978
|
+
};
|
|
10979
|
+
return data;
|
|
10980
|
+
}
|
|
10981
|
+
function _templateObject() {
|
|
10982
|
+
var data = _taggedTemplateLiteralLoose(["", ".", ""]);
|
|
10983
|
+
_templateObject = function _templateObject5() {
|
|
10984
|
+
return data;
|
|
10985
|
+
};
|
|
10986
|
+
return data;
|
|
10537
10987
|
}
|
|
10538
10988
|
var isObject4 = function isObject5(obj) {
|
|
10539
10989
|
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
10540
10990
|
};
|
|
10991
|
+
var promise3 = function promise4(sync) {
|
|
10992
|
+
return sync ? import_synchronous_promise3.SynchronousPromise : Promise;
|
|
10993
|
+
};
|
|
10541
10994
|
function unknown(ctx, value) {
|
|
10542
10995
|
var known = Object.keys(ctx.fields);
|
|
10543
10996
|
return Object.keys(value).filter(function(key) {
|
|
@@ -10562,7 +11015,6 @@ function ObjectSchema(spec) {
|
|
|
10562
11015
|
}
|
|
10563
11016
|
});
|
|
10564
11017
|
this.fields = /* @__PURE__ */ Object.create(null);
|
|
10565
|
-
this._sortErrors = sortByKeyOrder([]);
|
|
10566
11018
|
this._nodes = [];
|
|
10567
11019
|
this._excludedEdges = [];
|
|
10568
11020
|
this.withMutation(function() {
|
|
@@ -10592,7 +11044,7 @@ inherits(ObjectSchema, SchemaType, {
|
|
|
10592
11044
|
if (options === void 0) {
|
|
10593
11045
|
options = {};
|
|
10594
11046
|
}
|
|
10595
|
-
var value = SchemaType.prototype._cast.call(this, _value);
|
|
11047
|
+
var value = SchemaType.prototype._cast.call(this, _value, options);
|
|
10596
11048
|
if (value === void 0)
|
|
10597
11049
|
return this.default();
|
|
10598
11050
|
if (!this._typeCheck(value))
|
|
@@ -10608,111 +11060,84 @@ inherits(ObjectSchema, SchemaType, {
|
|
|
10608
11060
|
__validating: options.__validating || false
|
|
10609
11061
|
});
|
|
10610
11062
|
var isChanged = false;
|
|
10611
|
-
|
|
10612
|
-
var prop = _step.value;
|
|
11063
|
+
props.forEach(function(prop) {
|
|
10613
11064
|
var field = fields[prop];
|
|
10614
11065
|
var exists = has_default(value, prop);
|
|
10615
11066
|
if (field) {
|
|
10616
|
-
var fieldValue
|
|
11067
|
+
var fieldValue;
|
|
10617
11068
|
var strict2 = field._options && field._options.strict;
|
|
10618
|
-
innerOptions.path = (
|
|
11069
|
+
innerOptions.path = makePath(_templateObject(), options.path, prop);
|
|
10619
11070
|
innerOptions.value = value[prop];
|
|
10620
11071
|
field = field.resolve(innerOptions);
|
|
10621
11072
|
if (field._strip === true) {
|
|
10622
11073
|
isChanged = isChanged || prop in value;
|
|
10623
|
-
|
|
11074
|
+
return;
|
|
10624
11075
|
}
|
|
10625
11076
|
fieldValue = !options.__validating || !strict2 ? field.cast(value[prop], innerOptions) : value[prop];
|
|
10626
|
-
if (fieldValue !== void 0)
|
|
11077
|
+
if (fieldValue !== void 0)
|
|
10627
11078
|
intermediateValue[prop] = fieldValue;
|
|
10628
|
-
|
|
10629
|
-
} else if (exists && !strip2) {
|
|
11079
|
+
} else if (exists && !strip2)
|
|
10630
11080
|
intermediateValue[prop] = value[prop];
|
|
10631
|
-
|
|
10632
|
-
if (intermediateValue[prop] !== value[prop]) {
|
|
11081
|
+
if (intermediateValue[prop] !== value[prop])
|
|
10633
11082
|
isChanged = true;
|
|
10634
|
-
|
|
10635
|
-
}
|
|
11083
|
+
});
|
|
10636
11084
|
return isChanged ? intermediateValue : value;
|
|
10637
11085
|
},
|
|
10638
|
-
|
|
10639
|
-
* @typedef {Object} Ancestor
|
|
10640
|
-
* @property {Object} schema - a string property of SpecialType
|
|
10641
|
-
* @property {*} value - a number property of SpecialType
|
|
10642
|
-
*/
|
|
10643
|
-
/**
|
|
10644
|
-
*
|
|
10645
|
-
* @param {*} _value
|
|
10646
|
-
* @param {Object} opts
|
|
10647
|
-
* @param {string=} opts.path
|
|
10648
|
-
* @param {*=} opts.parent
|
|
10649
|
-
* @param {Object=} opts.context
|
|
10650
|
-
* @param {boolean=} opts.sync
|
|
10651
|
-
* @param {boolean=} opts.stripUnknown
|
|
10652
|
-
* @param {boolean=} opts.strict
|
|
10653
|
-
* @param {boolean=} opts.recursive
|
|
10654
|
-
* @param {boolean=} opts.abortEarly
|
|
10655
|
-
* @param {boolean=} opts.__validating
|
|
10656
|
-
* @param {Object=} opts.originalValue
|
|
10657
|
-
* @param {Ancestor[]=} opts.from
|
|
10658
|
-
* @param {Object} [opts.from]
|
|
10659
|
-
* @param {Function} callback
|
|
10660
|
-
*/
|
|
10661
|
-
_validate: function _validate2(_value, opts, callback) {
|
|
11086
|
+
_validate: function _validate2(_value, opts) {
|
|
10662
11087
|
var _this4 = this;
|
|
10663
11088
|
if (opts === void 0) {
|
|
10664
11089
|
opts = {};
|
|
10665
11090
|
}
|
|
11091
|
+
var endEarly, recursive;
|
|
11092
|
+
var sync = opts.sync;
|
|
10666
11093
|
var errors = [];
|
|
10667
|
-
var
|
|
10668
|
-
from2 = [{
|
|
11094
|
+
var originalValue = opts.originalValue != null ? opts.originalValue : _value;
|
|
11095
|
+
var from2 = [{
|
|
10669
11096
|
schema: this,
|
|
10670
11097
|
value: originalValue
|
|
10671
|
-
}].concat(
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
opts
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
value = err.value;
|
|
10681
|
-
}
|
|
11098
|
+
}].concat(opts.from || []);
|
|
11099
|
+
endEarly = this._option("abortEarly", opts);
|
|
11100
|
+
recursive = this._option("recursive", opts);
|
|
11101
|
+
opts = _extends({}, opts, {
|
|
11102
|
+
__validating: true,
|
|
11103
|
+
originalValue,
|
|
11104
|
+
from: from2
|
|
11105
|
+
});
|
|
11106
|
+
return SchemaType.prototype._validate.call(this, _value, opts).catch(propagateErrors(endEarly, errors)).then(function(value) {
|
|
10682
11107
|
if (!recursive || !isObject4(value)) {
|
|
10683
|
-
|
|
10684
|
-
|
|
11108
|
+
if (errors.length)
|
|
11109
|
+
throw errors[0];
|
|
11110
|
+
return value;
|
|
10685
11111
|
}
|
|
11112
|
+
from2 = originalValue ? [].concat(from2) : [{
|
|
11113
|
+
schema: _this4,
|
|
11114
|
+
value: originalValue || value
|
|
11115
|
+
}].concat(opts.from || []);
|
|
10686
11116
|
originalValue = originalValue || value;
|
|
10687
|
-
var
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
}), cb);
|
|
10702
|
-
return;
|
|
10703
|
-
}
|
|
10704
|
-
cb(null);
|
|
10705
|
-
};
|
|
11117
|
+
var validations = _this4._nodes.map(function(key) {
|
|
11118
|
+
var path = key.indexOf(".") === -1 ? makePath(_templateObject2(), opts.path, key) : makePath(_templateObject3(), opts.path, key);
|
|
11119
|
+
var field = _this4.fields[key];
|
|
11120
|
+
var innerOptions = _extends({}, opts, {
|
|
11121
|
+
path,
|
|
11122
|
+
from: from2,
|
|
11123
|
+
parent: value,
|
|
11124
|
+
originalValue: originalValue[key]
|
|
11125
|
+
});
|
|
11126
|
+
if (field && field.validate) {
|
|
11127
|
+
innerOptions.strict = true;
|
|
11128
|
+
return field.validate(value[key], innerOptions);
|
|
11129
|
+
}
|
|
11130
|
+
return promise3(sync).resolve(true);
|
|
10706
11131
|
});
|
|
10707
|
-
|
|
11132
|
+
return runValidations({
|
|
10708
11133
|
sync,
|
|
10709
|
-
|
|
11134
|
+
validations,
|
|
10710
11135
|
value,
|
|
10711
11136
|
errors,
|
|
10712
|
-
endEarly
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
}
|
|
11137
|
+
endEarly,
|
|
11138
|
+
path: opts.path,
|
|
11139
|
+
sort: sortByKeyOrder(_this4.fields)
|
|
11140
|
+
});
|
|
10716
11141
|
});
|
|
10717
11142
|
},
|
|
10718
11143
|
concat: function concat2(schema) {
|
|
@@ -10727,7 +11152,6 @@ inherits(ObjectSchema, SchemaType, {
|
|
|
10727
11152
|
var next = this.clone();
|
|
10728
11153
|
var fields = _extends(next.fields, schema);
|
|
10729
11154
|
next.fields = fields;
|
|
10730
|
-
next._sortErrors = sortByKeyOrder(Object.keys(fields));
|
|
10731
11155
|
if (excludes.length) {
|
|
10732
11156
|
if (!Array.isArray(excludes[0]))
|
|
10733
11157
|
excludes = [excludes];
|
|
@@ -10821,6 +11245,20 @@ inherits(ObjectSchema, SchemaType, {
|
|
|
10821
11245
|
});
|
|
10822
11246
|
|
|
10823
11247
|
// node_modules/yup/es/array.js
|
|
11248
|
+
function _templateObject22() {
|
|
11249
|
+
var data = _taggedTemplateLiteralLoose(["", "[", "]"]);
|
|
11250
|
+
_templateObject22 = function _templateObject23() {
|
|
11251
|
+
return data;
|
|
11252
|
+
};
|
|
11253
|
+
return data;
|
|
11254
|
+
}
|
|
11255
|
+
function _templateObject4() {
|
|
11256
|
+
var data = _taggedTemplateLiteralLoose(["", "[", "]"]);
|
|
11257
|
+
_templateObject4 = function _templateObject5() {
|
|
11258
|
+
return data;
|
|
11259
|
+
};
|
|
11260
|
+
return data;
|
|
11261
|
+
}
|
|
10824
11262
|
var array_default = ArraySchema;
|
|
10825
11263
|
function ArraySchema(type) {
|
|
10826
11264
|
var _this = this;
|
|
@@ -10857,7 +11295,7 @@ inherits(ArraySchema, SchemaType, {
|
|
|
10857
11295
|
var isChanged = false;
|
|
10858
11296
|
var castArray = value.map(function(v, idx) {
|
|
10859
11297
|
var castElement = _this2.innerType.cast(v, _extends({}, _opts, {
|
|
10860
|
-
path: (_opts.path
|
|
11298
|
+
path: makePath(_templateObject4(), _opts.path, idx)
|
|
10861
11299
|
}));
|
|
10862
11300
|
if (castElement !== v) {
|
|
10863
11301
|
isChanged = true;
|
|
@@ -10866,7 +11304,7 @@ inherits(ArraySchema, SchemaType, {
|
|
|
10866
11304
|
});
|
|
10867
11305
|
return isChanged ? castArray : value;
|
|
10868
11306
|
},
|
|
10869
|
-
_validate: function _validate3(_value, options
|
|
11307
|
+
_validate: function _validate3(_value, options) {
|
|
10870
11308
|
var _this3 = this;
|
|
10871
11309
|
if (options === void 0) {
|
|
10872
11310
|
options = {};
|
|
@@ -10878,44 +11316,34 @@ inherits(ArraySchema, SchemaType, {
|
|
|
10878
11316
|
var endEarly = this._option("abortEarly", options);
|
|
10879
11317
|
var recursive = this._option("recursive", options);
|
|
10880
11318
|
var originalValue = options.originalValue != null ? options.originalValue : _value;
|
|
10881
|
-
SchemaType.prototype._validate.call(this, _value, options, function(
|
|
10882
|
-
if (err) {
|
|
10883
|
-
if (endEarly)
|
|
10884
|
-
return void callback(err);
|
|
10885
|
-
errors.push(err);
|
|
10886
|
-
value = err.value;
|
|
10887
|
-
}
|
|
11319
|
+
return SchemaType.prototype._validate.call(this, _value, options).catch(propagateErrors(endEarly, errors)).then(function(value) {
|
|
10888
11320
|
if (!recursive || !innerType || !_this3._typeCheck(value)) {
|
|
10889
|
-
|
|
10890
|
-
|
|
11321
|
+
if (errors.length)
|
|
11322
|
+
throw errors[0];
|
|
11323
|
+
return value;
|
|
10891
11324
|
}
|
|
10892
11325
|
originalValue = originalValue || value;
|
|
10893
|
-
var
|
|
10894
|
-
var
|
|
10895
|
-
var item = value[
|
|
10896
|
-
var
|
|
11326
|
+
var validations = new Array(value.length);
|
|
11327
|
+
for (var idx = 0; idx < value.length; idx++) {
|
|
11328
|
+
var item = value[idx];
|
|
11329
|
+
var _path = makePath(_templateObject22(), options.path, idx);
|
|
10897
11330
|
var innerOptions = _extends({}, options, {
|
|
10898
|
-
path:
|
|
11331
|
+
path: _path,
|
|
10899
11332
|
strict: true,
|
|
10900
11333
|
parent: value,
|
|
10901
|
-
index:
|
|
10902
|
-
originalValue: originalValue[
|
|
11334
|
+
index: idx,
|
|
11335
|
+
originalValue: originalValue[idx]
|
|
10903
11336
|
});
|
|
10904
|
-
|
|
10905
|
-
return innerType.validate ? innerType.validate(item, innerOptions, cb) : cb(null);
|
|
10906
|
-
};
|
|
10907
|
-
};
|
|
10908
|
-
for (var idx = 0; idx < value.length; idx++) {
|
|
10909
|
-
_loop3(idx);
|
|
11337
|
+
validations[idx] = innerType.validate ? innerType.validate(item, innerOptions) : true;
|
|
10910
11338
|
}
|
|
10911
|
-
|
|
11339
|
+
return runValidations({
|
|
10912
11340
|
sync,
|
|
10913
11341
|
path,
|
|
10914
11342
|
value,
|
|
10915
11343
|
errors,
|
|
10916
11344
|
endEarly,
|
|
10917
|
-
|
|
10918
|
-
}
|
|
11345
|
+
validations
|
|
11346
|
+
});
|
|
10919
11347
|
});
|
|
10920
11348
|
},
|
|
10921
11349
|
_isPresent: function _isPresent3(value) {
|
|
@@ -11002,8 +11430,8 @@ var Lazy = /* @__PURE__ */ function() {
|
|
|
11002
11430
|
_proto.cast = function cast2(value, options) {
|
|
11003
11431
|
return this._resolve(value, options).cast(value, options);
|
|
11004
11432
|
};
|
|
11005
|
-
_proto.validate = function validate2(value, options
|
|
11006
|
-
return this._resolve(value, options).validate(value, options
|
|
11433
|
+
_proto.validate = function validate2(value, options) {
|
|
11434
|
+
return this._resolve(value, options).validate(value, options);
|
|
11007
11435
|
};
|
|
11008
11436
|
_proto.validateSync = function validateSync2(value, options) {
|
|
11009
11437
|
return this._resolve(value, options).validateSync(value, options);
|
|
@@ -11020,7 +11448,7 @@ Lazy.prototype.__isYupSchema__ = true;
|
|
|
11020
11448
|
var Lazy_default = Lazy;
|
|
11021
11449
|
|
|
11022
11450
|
// node_modules/yup/es/index.js
|
|
11023
|
-
var
|
|
11451
|
+
var boolean = boolean_default;
|
|
11024
11452
|
var lazy = function lazy2(fn) {
|
|
11025
11453
|
return new Lazy_default(fn);
|
|
11026
11454
|
};
|
|
@@ -11311,8 +11739,18 @@ var baseString = StringSchema().trim();
|
|
|
11311
11739
|
var todayDateHint = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
|
11312
11740
|
var convertBytesToKB = convertDiskSizeFromTo("Bytes", "KB");
|
|
11313
11741
|
var convertKbBytesToMB = convertDiskSizeFromTo("KB", "MB");
|
|
11742
|
+
var validateOnlyStrings = StringSchema().trim().nullable().test(
|
|
11743
|
+
"is-string",
|
|
11744
|
+
"${path} must be a `string` type, but the final value was: `${value}`.",
|
|
11745
|
+
(value, context) => {
|
|
11746
|
+
if (context.originalValue !== null && context.originalValue !== void 0) {
|
|
11747
|
+
return typeof context.originalValue === "string";
|
|
11748
|
+
}
|
|
11749
|
+
return true;
|
|
11750
|
+
}
|
|
11751
|
+
);
|
|
11314
11752
|
var yupSchemas = {
|
|
11315
|
-
text:
|
|
11753
|
+
text: validateOnlyStrings,
|
|
11316
11754
|
select: StringSchema().trim().nullable(),
|
|
11317
11755
|
radio: StringSchema().trim().nullable(),
|
|
11318
11756
|
date: StringSchema().nullable().trim().matches(
|
|
@@ -11324,7 +11762,7 @@ var yupSchemas = {
|
|
|
11324
11762
|
email: StringSchema().trim().email("Please enter a valid email address").nullable(),
|
|
11325
11763
|
fieldset: ObjectSchema().nullable(),
|
|
11326
11764
|
checkbox: StringSchema().trim().nullable(),
|
|
11327
|
-
checkboxBool:
|
|
11765
|
+
checkboxBool: boolean(),
|
|
11328
11766
|
multiple: {
|
|
11329
11767
|
select: array_default().nullable(),
|
|
11330
11768
|
"group-array": array_default().nullable()
|
|
@@ -11734,12 +12172,26 @@ function updateFieldsProperties(fields, formValues, jsonSchema) {
|
|
|
11734
12172
|
clearValuesIfNotVisible(fields, formValues);
|
|
11735
12173
|
}
|
|
11736
12174
|
var notNullOption = (opt) => opt.const !== null;
|
|
12175
|
+
function flatPresentation(item) {
|
|
12176
|
+
return Object.entries(item).reduce((newItem, [key, value]) => {
|
|
12177
|
+
if (key === "x-jsf-presentation") {
|
|
12178
|
+
return {
|
|
12179
|
+
...newItem,
|
|
12180
|
+
...value
|
|
12181
|
+
};
|
|
12182
|
+
}
|
|
12183
|
+
return {
|
|
12184
|
+
...newItem,
|
|
12185
|
+
[key]: value
|
|
12186
|
+
};
|
|
12187
|
+
}, {});
|
|
12188
|
+
}
|
|
11737
12189
|
function getFieldOptions(node, presentation) {
|
|
11738
12190
|
function convertToOptions(nodeOptions) {
|
|
11739
12191
|
return nodeOptions.filter(notNullOption).map(({ title, const: cons, ...item }) => ({
|
|
11740
12192
|
label: title,
|
|
11741
12193
|
value: cons,
|
|
11742
|
-
...item
|
|
12194
|
+
...flatPresentation(item)
|
|
11743
12195
|
}));
|
|
11744
12196
|
}
|
|
11745
12197
|
if (presentation.options) {
|