@base44-preview/cli 0.0.47-pr.406.4b9c508 → 0.0.47-pr.422.2b2e7e7
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/dist/cli/index.js +914 -639
- package/dist/cli/index.js.map +17 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -9671,12 +9671,12 @@ var require_schema = __commonJS((exports, module) => {
|
|
|
9671
9671
|
var common = require_common3();
|
|
9672
9672
|
var YAMLException = require_exception();
|
|
9673
9673
|
var Type = require_type();
|
|
9674
|
-
function compileList(
|
|
9674
|
+
function compileList(schema6, name2, result) {
|
|
9675
9675
|
var exclude = [];
|
|
9676
|
-
|
|
9676
|
+
schema6.include.forEach(function(includedSchema) {
|
|
9677
9677
|
result = compileList(includedSchema, name2, result);
|
|
9678
9678
|
});
|
|
9679
|
-
|
|
9679
|
+
schema6[name2].forEach(function(currentType) {
|
|
9680
9680
|
result.forEach(function(previousType, previousIndex) {
|
|
9681
9681
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
|
9682
9682
|
exclude.push(previousIndex);
|
|
@@ -9733,8 +9733,8 @@ var require_schema = __commonJS((exports, module) => {
|
|
|
9733
9733
|
}
|
|
9734
9734
|
schemas3 = common.toArray(schemas3);
|
|
9735
9735
|
types = common.toArray(types);
|
|
9736
|
-
if (!schemas3.every(function(
|
|
9737
|
-
return
|
|
9736
|
+
if (!schemas3.every(function(schema6) {
|
|
9737
|
+
return schema6 instanceof Schema;
|
|
9738
9738
|
})) {
|
|
9739
9739
|
throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
9740
9740
|
}
|
|
@@ -11755,7 +11755,7 @@ var require_dumper = __commonJS((exports, module) => {
|
|
|
11755
11755
|
"Off",
|
|
11756
11756
|
"OFF"
|
|
11757
11757
|
];
|
|
11758
|
-
function compileStyleMap(
|
|
11758
|
+
function compileStyleMap(schema6, map2) {
|
|
11759
11759
|
var result, keys, index, length, tag, style, type;
|
|
11760
11760
|
if (map2 === null)
|
|
11761
11761
|
return {};
|
|
@@ -11767,7 +11767,7 @@ var require_dumper = __commonJS((exports, module) => {
|
|
|
11767
11767
|
if (tag.slice(0, 2) === "!!") {
|
|
11768
11768
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
11769
11769
|
}
|
|
11770
|
-
type =
|
|
11770
|
+
type = schema6.compiledTypeMap["fallback"][tag];
|
|
11771
11771
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
11772
11772
|
style = type.styleAliases[style];
|
|
11773
11773
|
}
|
|
@@ -16067,7 +16067,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
16067
16067
|
}
|
|
16068
16068
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
16069
16069
|
});
|
|
16070
|
-
function
|
|
16070
|
+
function join12(array2, separator) {
|
|
16071
16071
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
16072
16072
|
}
|
|
16073
16073
|
function last(array2) {
|
|
@@ -16089,7 +16089,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
16089
16089
|
function nth(array2, n2) {
|
|
16090
16090
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
16091
16091
|
}
|
|
16092
|
-
var
|
|
16092
|
+
var pull4 = baseRest(pullAll);
|
|
16093
16093
|
function pullAll(array2, values2) {
|
|
16094
16094
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
16095
16095
|
}
|
|
@@ -17854,7 +17854,7 @@ __p += '`;
|
|
|
17854
17854
|
lodash.pickBy = pickBy;
|
|
17855
17855
|
lodash.property = property;
|
|
17856
17856
|
lodash.propertyOf = propertyOf;
|
|
17857
|
-
lodash.pull =
|
|
17857
|
+
lodash.pull = pull4;
|
|
17858
17858
|
lodash.pullAll = pullAll;
|
|
17859
17859
|
lodash.pullAllBy = pullAllBy;
|
|
17860
17860
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -17999,7 +17999,7 @@ __p += '`;
|
|
|
17999
17999
|
lodash.isUndefined = isUndefined;
|
|
18000
18000
|
lodash.isWeakMap = isWeakMap;
|
|
18001
18001
|
lodash.isWeakSet = isWeakSet;
|
|
18002
|
-
lodash.join =
|
|
18002
|
+
lodash.join = join12;
|
|
18003
18003
|
lodash.kebabCase = kebabCase;
|
|
18004
18004
|
lodash.last = last;
|
|
18005
18005
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -18954,7 +18954,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
18954
18954
|
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
18955
18955
|
value = value.valueOf();
|
|
18956
18956
|
}
|
|
18957
|
-
const { aliasDuplicateObjects, onAnchor, onTagObj, schema:
|
|
18957
|
+
const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema9, sourceObjects } = ctx;
|
|
18958
18958
|
let ref = undefined;
|
|
18959
18959
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
18960
18960
|
ref = sourceObjects.get(value);
|
|
@@ -18968,7 +18968,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
18968
18968
|
}
|
|
18969
18969
|
if (tagName?.startsWith("!!"))
|
|
18970
18970
|
tagName = defaultTagPrefix + tagName.slice(2);
|
|
18971
|
-
let tagObj = findTagObject(value, tagName,
|
|
18971
|
+
let tagObj = findTagObject(value, tagName, schema9.tags);
|
|
18972
18972
|
if (!tagObj) {
|
|
18973
18973
|
if (value && typeof value.toJSON === "function") {
|
|
18974
18974
|
value = value.toJSON();
|
|
@@ -18979,7 +18979,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
18979
18979
|
ref.node = node2;
|
|
18980
18980
|
return node2;
|
|
18981
18981
|
}
|
|
18982
|
-
tagObj = value instanceof Map ?
|
|
18982
|
+
tagObj = value instanceof Map ? schema9[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema9[identity3.SEQ] : schema9[identity3.MAP];
|
|
18983
18983
|
}
|
|
18984
18984
|
if (onTagObj) {
|
|
18985
18985
|
onTagObj(tagObj);
|
|
@@ -19002,7 +19002,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
19002
19002
|
var createNode = require_createNode();
|
|
19003
19003
|
var identity3 = require_identity();
|
|
19004
19004
|
var Node2 = require_Node();
|
|
19005
|
-
function collectionFromPath(
|
|
19005
|
+
function collectionFromPath(schema9, path16, value) {
|
|
19006
19006
|
let v = value;
|
|
19007
19007
|
for (let i2 = path16.length - 1;i2 >= 0; --i2) {
|
|
19008
19008
|
const k2 = path16[i2];
|
|
@@ -19020,27 +19020,27 @@ var require_Collection = __commonJS((exports) => {
|
|
|
19020
19020
|
onAnchor: () => {
|
|
19021
19021
|
throw new Error("This should not happen, please report a bug.");
|
|
19022
19022
|
},
|
|
19023
|
-
schema:
|
|
19023
|
+
schema: schema9,
|
|
19024
19024
|
sourceObjects: new Map
|
|
19025
19025
|
});
|
|
19026
19026
|
}
|
|
19027
19027
|
var isEmptyPath = (path16) => path16 == null || typeof path16 === "object" && !!path16[Symbol.iterator]().next().done;
|
|
19028
19028
|
|
|
19029
19029
|
class Collection extends Node2.NodeBase {
|
|
19030
|
-
constructor(type,
|
|
19030
|
+
constructor(type, schema9) {
|
|
19031
19031
|
super(type);
|
|
19032
19032
|
Object.defineProperty(this, "schema", {
|
|
19033
|
-
value:
|
|
19033
|
+
value: schema9,
|
|
19034
19034
|
configurable: true,
|
|
19035
19035
|
enumerable: false,
|
|
19036
19036
|
writable: true
|
|
19037
19037
|
});
|
|
19038
19038
|
}
|
|
19039
|
-
clone(
|
|
19039
|
+
clone(schema9) {
|
|
19040
19040
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
19041
|
-
if (
|
|
19042
|
-
copy.schema =
|
|
19043
|
-
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(
|
|
19041
|
+
if (schema9)
|
|
19042
|
+
copy.schema = schema9;
|
|
19043
|
+
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema9) : it3);
|
|
19044
19044
|
if (this.range)
|
|
19045
19045
|
copy.range = this.range.slice();
|
|
19046
19046
|
return copy;
|
|
@@ -19972,12 +19972,12 @@ var require_Pair = __commonJS((exports) => {
|
|
|
19972
19972
|
this.key = key;
|
|
19973
19973
|
this.value = value;
|
|
19974
19974
|
}
|
|
19975
|
-
clone(
|
|
19975
|
+
clone(schema9) {
|
|
19976
19976
|
let { key, value } = this;
|
|
19977
19977
|
if (identity3.isNode(key))
|
|
19978
|
-
key = key.clone(
|
|
19978
|
+
key = key.clone(schema9);
|
|
19979
19979
|
if (identity3.isNode(value))
|
|
19980
|
-
value = value.clone(
|
|
19980
|
+
value = value.clone(schema9);
|
|
19981
19981
|
return new Pair(key, value);
|
|
19982
19982
|
}
|
|
19983
19983
|
toJSON(_2, ctx) {
|
|
@@ -20162,13 +20162,13 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
20162
20162
|
static get tagName() {
|
|
20163
20163
|
return "tag:yaml.org,2002:map";
|
|
20164
20164
|
}
|
|
20165
|
-
constructor(
|
|
20166
|
-
super(identity3.MAP,
|
|
20165
|
+
constructor(schema9) {
|
|
20166
|
+
super(identity3.MAP, schema9);
|
|
20167
20167
|
this.items = [];
|
|
20168
20168
|
}
|
|
20169
|
-
static from(
|
|
20169
|
+
static from(schema9, obj, ctx) {
|
|
20170
20170
|
const { keepUndefined, replacer } = ctx;
|
|
20171
|
-
const map2 = new this(
|
|
20171
|
+
const map2 = new this(schema9);
|
|
20172
20172
|
const add = (key, value) => {
|
|
20173
20173
|
if (typeof replacer === "function")
|
|
20174
20174
|
value = replacer.call(obj, key, value);
|
|
@@ -20184,8 +20184,8 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
20184
20184
|
for (const key of Object.keys(obj))
|
|
20185
20185
|
add(key, obj[key]);
|
|
20186
20186
|
}
|
|
20187
|
-
if (typeof
|
|
20188
|
-
map2.items.sort(
|
|
20187
|
+
if (typeof schema9.sortMapEntries === "function") {
|
|
20188
|
+
map2.items.sort(schema9.sortMapEntries);
|
|
20189
20189
|
}
|
|
20190
20190
|
return map2;
|
|
20191
20191
|
}
|
|
@@ -20278,7 +20278,7 @@ var require_map2 = __commonJS((exports) => {
|
|
|
20278
20278
|
onError("Expected a mapping for this tag");
|
|
20279
20279
|
return map3;
|
|
20280
20280
|
},
|
|
20281
|
-
createNode: (
|
|
20281
|
+
createNode: (schema9, obj, ctx) => YAMLMap.YAMLMap.from(schema9, obj, ctx)
|
|
20282
20282
|
};
|
|
20283
20283
|
exports.map = map2;
|
|
20284
20284
|
});
|
|
@@ -20296,8 +20296,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
20296
20296
|
static get tagName() {
|
|
20297
20297
|
return "tag:yaml.org,2002:seq";
|
|
20298
20298
|
}
|
|
20299
|
-
constructor(
|
|
20300
|
-
super(identity3.SEQ,
|
|
20299
|
+
constructor(schema9) {
|
|
20300
|
+
super(identity3.SEQ, schema9);
|
|
20301
20301
|
this.items = [];
|
|
20302
20302
|
}
|
|
20303
20303
|
add(value) {
|
|
@@ -20351,9 +20351,9 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
20351
20351
|
onComment
|
|
20352
20352
|
});
|
|
20353
20353
|
}
|
|
20354
|
-
static from(
|
|
20354
|
+
static from(schema9, obj, ctx) {
|
|
20355
20355
|
const { replacer } = ctx;
|
|
20356
|
-
const seq = new this(
|
|
20356
|
+
const seq = new this(schema9);
|
|
20357
20357
|
if (obj && Symbol.iterator in Object(obj)) {
|
|
20358
20358
|
let i2 = 0;
|
|
20359
20359
|
for (let it3 of obj) {
|
|
@@ -20390,7 +20390,7 @@ var require_seq2 = __commonJS((exports) => {
|
|
|
20390
20390
|
onError("Expected a sequence for this tag");
|
|
20391
20391
|
return seq2;
|
|
20392
20392
|
},
|
|
20393
|
-
createNode: (
|
|
20393
|
+
createNode: (schema9, obj, ctx) => YAMLSeq.YAMLSeq.from(schema9, obj, ctx)
|
|
20394
20394
|
};
|
|
20395
20395
|
exports.seq = seq;
|
|
20396
20396
|
});
|
|
@@ -20565,7 +20565,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
20565
20565
|
var bool = require_bool2();
|
|
20566
20566
|
var float = require_float2();
|
|
20567
20567
|
var int2 = require_int2();
|
|
20568
|
-
var
|
|
20568
|
+
var schema9 = [
|
|
20569
20569
|
map2.map,
|
|
20570
20570
|
seq.seq,
|
|
20571
20571
|
string4.string,
|
|
@@ -20578,7 +20578,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
20578
20578
|
float.floatExp,
|
|
20579
20579
|
float.float
|
|
20580
20580
|
];
|
|
20581
|
-
exports.schema =
|
|
20581
|
+
exports.schema = schema9;
|
|
20582
20582
|
});
|
|
20583
20583
|
|
|
20584
20584
|
// ../../node_modules/yaml/dist/schema/json/schema.js
|
|
@@ -20641,8 +20641,8 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
20641
20641
|
return str;
|
|
20642
20642
|
}
|
|
20643
20643
|
};
|
|
20644
|
-
var
|
|
20645
|
-
exports.schema =
|
|
20644
|
+
var schema9 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
|
|
20645
|
+
exports.schema = schema9;
|
|
20646
20646
|
});
|
|
20647
20647
|
|
|
20648
20648
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
@@ -20732,9 +20732,9 @@ ${cn.comment}` : item.comment;
|
|
|
20732
20732
|
onError("Expected a sequence for this tag");
|
|
20733
20733
|
return seq;
|
|
20734
20734
|
}
|
|
20735
|
-
function createPairs(
|
|
20735
|
+
function createPairs(schema9, iterable, ctx) {
|
|
20736
20736
|
const { replacer } = ctx;
|
|
20737
|
-
const pairs2 = new YAMLSeq.YAMLSeq(
|
|
20737
|
+
const pairs2 = new YAMLSeq.YAMLSeq(schema9);
|
|
20738
20738
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
20739
20739
|
let i2 = 0;
|
|
20740
20740
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
@@ -20813,8 +20813,8 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
20813
20813
|
}
|
|
20814
20814
|
return map2;
|
|
20815
20815
|
}
|
|
20816
|
-
static from(
|
|
20817
|
-
const pairs$1 = pairs.createPairs(
|
|
20816
|
+
static from(schema9, iterable, ctx) {
|
|
20817
|
+
const pairs$1 = pairs.createPairs(schema9, iterable, ctx);
|
|
20818
20818
|
const omap2 = new this;
|
|
20819
20819
|
omap2.items = pairs$1.items;
|
|
20820
20820
|
return omap2;
|
|
@@ -20841,7 +20841,7 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
20841
20841
|
}
|
|
20842
20842
|
return Object.assign(new YAMLOMap, pairs$1);
|
|
20843
20843
|
},
|
|
20844
|
-
createNode: (
|
|
20844
|
+
createNode: (schema9, iterable, ctx) => YAMLOMap.from(schema9, iterable, ctx)
|
|
20845
20845
|
};
|
|
20846
20846
|
exports.YAMLOMap = YAMLOMap;
|
|
20847
20847
|
exports.omap = omap;
|
|
@@ -21005,8 +21005,8 @@ var require_set2 = __commonJS((exports) => {
|
|
|
21005
21005
|
var YAMLMap = require_YAMLMap();
|
|
21006
21006
|
|
|
21007
21007
|
class YAMLSet extends YAMLMap.YAMLMap {
|
|
21008
|
-
constructor(
|
|
21009
|
-
super(
|
|
21008
|
+
constructor(schema9) {
|
|
21009
|
+
super(schema9);
|
|
21010
21010
|
this.tag = YAMLSet.tag;
|
|
21011
21011
|
}
|
|
21012
21012
|
add(key) {
|
|
@@ -21046,9 +21046,9 @@ var require_set2 = __commonJS((exports) => {
|
|
|
21046
21046
|
else
|
|
21047
21047
|
throw new Error("Set items must all have null values");
|
|
21048
21048
|
}
|
|
21049
|
-
static from(
|
|
21049
|
+
static from(schema9, iterable, ctx) {
|
|
21050
21050
|
const { replacer } = ctx;
|
|
21051
|
-
const set3 = new this(
|
|
21051
|
+
const set3 = new this(schema9);
|
|
21052
21052
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
21053
21053
|
for (let value of iterable) {
|
|
21054
21054
|
if (typeof replacer === "function")
|
|
@@ -21065,7 +21065,7 @@ var require_set2 = __commonJS((exports) => {
|
|
|
21065
21065
|
nodeClass: YAMLSet,
|
|
21066
21066
|
default: false,
|
|
21067
21067
|
tag: "tag:yaml.org,2002:set",
|
|
21068
|
-
createNode: (
|
|
21068
|
+
createNode: (schema9, iterable, ctx) => YAMLSet.from(schema9, iterable, ctx),
|
|
21069
21069
|
resolve(map2, onError) {
|
|
21070
21070
|
if (identity3.isMap(map2)) {
|
|
21071
21071
|
if (map2.hasAllNullValues(true))
|
|
@@ -21178,7 +21178,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
21178
21178
|
var pairs = require_pairs2();
|
|
21179
21179
|
var set2 = require_set2();
|
|
21180
21180
|
var timestamp = require_timestamp2();
|
|
21181
|
-
var
|
|
21181
|
+
var schema9 = [
|
|
21182
21182
|
map2.map,
|
|
21183
21183
|
seq.seq,
|
|
21184
21184
|
string4.string,
|
|
@@ -21201,7 +21201,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
21201
21201
|
timestamp.floatTime,
|
|
21202
21202
|
timestamp.timestamp
|
|
21203
21203
|
];
|
|
21204
|
-
exports.schema =
|
|
21204
|
+
exports.schema = schema9;
|
|
21205
21205
|
});
|
|
21206
21206
|
|
|
21207
21207
|
// ../../node_modules/yaml/dist/schema/tags.js
|
|
@@ -21213,7 +21213,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
21213
21213
|
var bool = require_bool2();
|
|
21214
21214
|
var float = require_float2();
|
|
21215
21215
|
var int2 = require_int2();
|
|
21216
|
-
var
|
|
21216
|
+
var schema9 = require_schema2();
|
|
21217
21217
|
var schema$1 = require_schema3();
|
|
21218
21218
|
var binary = require_binary2();
|
|
21219
21219
|
var merge3 = require_merge3();
|
|
@@ -21223,7 +21223,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
21223
21223
|
var set2 = require_set2();
|
|
21224
21224
|
var timestamp = require_timestamp2();
|
|
21225
21225
|
var schemas3 = new Map([
|
|
21226
|
-
["core",
|
|
21226
|
+
["core", schema9.schema],
|
|
21227
21227
|
["failsafe", [map2.map, seq.seq, string4.string]],
|
|
21228
21228
|
["json", schema$1.schema],
|
|
21229
21229
|
["yaml11", schema$2.schema],
|
|
@@ -21305,9 +21305,9 @@ var require_Schema = __commonJS((exports) => {
|
|
|
21305
21305
|
var sortMapEntriesByKey = (a2, b) => a2.key < b.key ? -1 : a2.key > b.key ? 1 : 0;
|
|
21306
21306
|
|
|
21307
21307
|
class Schema {
|
|
21308
|
-
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema:
|
|
21308
|
+
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema9, sortMapEntries, toStringDefaults }) {
|
|
21309
21309
|
this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
|
|
21310
|
-
this.name = typeof
|
|
21310
|
+
this.name = typeof schema9 === "string" && schema9 || "core";
|
|
21311
21311
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
21312
21312
|
this.tags = tags.getTags(customTags, this.name, merge3);
|
|
21313
21313
|
this.toStringOptions = toStringDefaults ?? null;
|
|
@@ -22799,11 +22799,11 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
22799
22799
|
scalar.comment = comment;
|
|
22800
22800
|
return scalar;
|
|
22801
22801
|
}
|
|
22802
|
-
function findScalarTagByName(
|
|
22802
|
+
function findScalarTagByName(schema9, value, tagName, tagToken, onError) {
|
|
22803
22803
|
if (tagName === "!")
|
|
22804
|
-
return
|
|
22804
|
+
return schema9[identity3.SCALAR];
|
|
22805
22805
|
const matchWithTest = [];
|
|
22806
|
-
for (const tag of
|
|
22806
|
+
for (const tag of schema9.tags) {
|
|
22807
22807
|
if (!tag.collection && tag.tag === tagName) {
|
|
22808
22808
|
if (tag.default && tag.test)
|
|
22809
22809
|
matchWithTest.push(tag);
|
|
@@ -22814,18 +22814,18 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
22814
22814
|
for (const tag of matchWithTest)
|
|
22815
22815
|
if (tag.test?.test(value))
|
|
22816
22816
|
return tag;
|
|
22817
|
-
const kt3 =
|
|
22817
|
+
const kt3 = schema9.knownTags[tagName];
|
|
22818
22818
|
if (kt3 && !kt3.collection) {
|
|
22819
|
-
|
|
22819
|
+
schema9.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
|
|
22820
22820
|
return kt3;
|
|
22821
22821
|
}
|
|
22822
22822
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
22823
|
-
return
|
|
22823
|
+
return schema9[identity3.SCALAR];
|
|
22824
22824
|
}
|
|
22825
|
-
function findScalarTagByTest({ atKey, directives, schema:
|
|
22826
|
-
const tag =
|
|
22827
|
-
if (
|
|
22828
|
-
const compat2 =
|
|
22825
|
+
function findScalarTagByTest({ atKey, directives, schema: schema9 }, value, token, onError) {
|
|
22826
|
+
const tag = schema9.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema9[identity3.SCALAR];
|
|
22827
|
+
if (schema9.compat) {
|
|
22828
|
+
const compat2 = schema9.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema9[identity3.SCALAR];
|
|
22829
22829
|
if (tag.tag !== compat2.tag) {
|
|
22830
22830
|
const ts = directives.tagString(tag.tag);
|
|
22831
22831
|
const cs = directives.tagString(compat2.tag);
|
|
@@ -25463,7 +25463,7 @@ var require_main = __commonJS((exports, module) => {
|
|
|
25463
25463
|
return { parsed: parsedAll };
|
|
25464
25464
|
}
|
|
25465
25465
|
}
|
|
25466
|
-
function
|
|
25466
|
+
function config10(options) {
|
|
25467
25467
|
if (_dotenvKey(options).length === 0) {
|
|
25468
25468
|
return DotenvModule.configDotenv(options);
|
|
25469
25469
|
}
|
|
@@ -25534,7 +25534,7 @@ var require_main = __commonJS((exports, module) => {
|
|
|
25534
25534
|
configDotenv,
|
|
25535
25535
|
_configVault,
|
|
25536
25536
|
_parseVault,
|
|
25537
|
-
config:
|
|
25537
|
+
config: config10,
|
|
25538
25538
|
decrypt,
|
|
25539
25539
|
parse: parse9,
|
|
25540
25540
|
populate
|
|
@@ -27503,7 +27503,7 @@ function cleanDoc(doc2) {
|
|
|
27503
27503
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
27504
27504
|
}
|
|
27505
27505
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
27506
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
27506
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join18(replacement, currentDoc.split(`
|
|
27507
27507
|
`)) : currentDoc);
|
|
27508
27508
|
}
|
|
27509
27509
|
function canBreakFn(doc2) {
|
|
@@ -27583,7 +27583,7 @@ function indentIfBreak(contents, options) {
|
|
|
27583
27583
|
negate: options.negate
|
|
27584
27584
|
};
|
|
27585
27585
|
}
|
|
27586
|
-
function
|
|
27586
|
+
function join18(separator, docs) {
|
|
27587
27587
|
assertDoc(separator);
|
|
27588
27588
|
assertDocArray(docs);
|
|
27589
27589
|
const parts = [];
|
|
@@ -28294,7 +28294,7 @@ var init_doc = __esm(() => {
|
|
|
28294
28294
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
28295
28295
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
28296
28296
|
builders = {
|
|
28297
|
-
join:
|
|
28297
|
+
join: join18,
|
|
28298
28298
|
line,
|
|
28299
28299
|
softline,
|
|
28300
28300
|
hardline,
|
|
@@ -115905,11 +115905,11 @@ function chooseDescription(descriptions, printWidth) {
|
|
|
115905
115905
|
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
|
|
115906
115906
|
}
|
|
115907
115907
|
function createSchema(SchemaConstructor, parameters) {
|
|
115908
|
-
const
|
|
115909
|
-
const subSchema = Object.create(
|
|
115908
|
+
const schema10 = new SchemaConstructor(parameters);
|
|
115909
|
+
const subSchema = Object.create(schema10);
|
|
115910
115910
|
for (const handlerKey of HANDLER_KEYS) {
|
|
115911
115911
|
if (handlerKey in parameters) {
|
|
115912
|
-
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey],
|
|
115912
|
+
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema10, Schema2.prototype[handlerKey].length);
|
|
115913
115913
|
}
|
|
115914
115914
|
}
|
|
115915
115915
|
return subSchema;
|
|
@@ -116166,8 +116166,8 @@ async function loadEditorconfigInternal(file2, { shouldCache }) {
|
|
|
116166
116166
|
const directory = path52.dirname(file2);
|
|
116167
116167
|
const root2 = await findProjectRoot2(directory, { shouldCache });
|
|
116168
116168
|
const editorConfig = await import_editorconfig.default.parse(file2, { root: root2 });
|
|
116169
|
-
const
|
|
116170
|
-
return
|
|
116169
|
+
const config11 = editorconfig_to_prettier_default(editorConfig);
|
|
116170
|
+
return config11;
|
|
116171
116171
|
}
|
|
116172
116172
|
function loadEditorconfig(file2, { shouldCache }) {
|
|
116173
116173
|
file2 = path52.resolve(file2);
|
|
@@ -116351,7 +116351,7 @@ function unicodeEscape() {
|
|
|
116351
116351
|
}
|
|
116352
116352
|
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
116353
116353
|
}
|
|
116354
|
-
function
|
|
116354
|
+
function push4() {
|
|
116355
116355
|
let value;
|
|
116356
116356
|
switch (token.type) {
|
|
116357
116357
|
case "punctuator":
|
|
@@ -118157,18 +118157,18 @@ async function loadConfig(configFile) {
|
|
|
118157
118157
|
if (!load2) {
|
|
118158
118158
|
throw new Error(`No loader specified for extension "${extension || "noExt"}"`);
|
|
118159
118159
|
}
|
|
118160
|
-
let
|
|
118161
|
-
if (!
|
|
118160
|
+
let config11 = await load2(configFile);
|
|
118161
|
+
if (!config11) {
|
|
118162
118162
|
return;
|
|
118163
118163
|
}
|
|
118164
|
-
if (typeof
|
|
118165
|
-
|
|
118164
|
+
if (typeof config11 === "string") {
|
|
118165
|
+
config11 = await load_external_config_default(config11, configFile);
|
|
118166
118166
|
}
|
|
118167
|
-
if (typeof
|
|
118168
|
-
throw new TypeError(`Config is only allowed to be an object, but received ${typeof
|
|
118167
|
+
if (typeof config11 !== "object") {
|
|
118168
|
+
throw new TypeError(`Config is only allowed to be an object, but received ${typeof config11} in "${configFile}"`);
|
|
118169
118169
|
}
|
|
118170
|
-
delete
|
|
118171
|
-
return
|
|
118170
|
+
delete config11.$schema;
|
|
118171
|
+
return config11;
|
|
118172
118172
|
}
|
|
118173
118173
|
function clearPrettierConfigCache() {
|
|
118174
118174
|
loadCache.clear();
|
|
@@ -118218,8 +118218,8 @@ async function loadPrettierConfig2(file2, options8) {
|
|
|
118218
118218
|
return;
|
|
118219
118219
|
}
|
|
118220
118220
|
configFile = toPath3(configFile);
|
|
118221
|
-
const
|
|
118222
|
-
return { config:
|
|
118221
|
+
const config11 = await loadPrettierConfig(configFile, { shouldCache });
|
|
118222
|
+
return { config: config11, configFile };
|
|
118223
118223
|
}
|
|
118224
118224
|
async function resolveConfig(fileUrlOrPath, options8) {
|
|
118225
118225
|
options8 = { useCache: true, ...options8 };
|
|
@@ -118246,8 +118246,8 @@ async function resolveConfigFile(fileUrlOrPath) {
|
|
|
118246
118246
|
return result ?? null;
|
|
118247
118247
|
}
|
|
118248
118248
|
function mergeOverrides(configResult, filePath) {
|
|
118249
|
-
const { config:
|
|
118250
|
-
const { overrides, ...options8 } =
|
|
118249
|
+
const { config: config11, configFile } = configResult || {};
|
|
118250
|
+
const { overrides, ...options8 } = config11 || {};
|
|
118251
118251
|
if (filePath && overrides) {
|
|
118252
118252
|
const relativeFilePath = path102.relative(path102.dirname(configFile), filePath);
|
|
118253
118253
|
for (const override of overrides) {
|
|
@@ -119249,9 +119249,9 @@ function optionInfoToSchema(optionInfo, {
|
|
|
119249
119249
|
throw new Error(`Unexpected type ${optionInfo.type}`);
|
|
119250
119250
|
}
|
|
119251
119251
|
if (optionInfo.exception) {
|
|
119252
|
-
parameters.validate = (value,
|
|
119252
|
+
parameters.validate = (value, schema10, utils3) => optionInfo.exception(value) || schema10.validate(value, utils3);
|
|
119253
119253
|
} else {
|
|
119254
|
-
parameters.validate = (value,
|
|
119254
|
+
parameters.validate = (value, schema10, utils3) => value === undefined || schema10.validate(value, utils3);
|
|
119255
119255
|
}
|
|
119256
119256
|
if (optionInfo.redirect) {
|
|
119257
119257
|
handlers.redirect = (value) => !value ? undefined : {
|
|
@@ -119266,7 +119266,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
119266
119266
|
}
|
|
119267
119267
|
if (isCLI && !optionInfo.array) {
|
|
119268
119268
|
const originalPreprocess = parameters.preprocess || ((x10) => x10);
|
|
119269
|
-
parameters.preprocess = (value,
|
|
119269
|
+
parameters.preprocess = (value, schema10, utils3) => schema10.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
|
|
119270
119270
|
}
|
|
119271
119271
|
return optionInfo.array ? ArraySchema.create({
|
|
119272
119272
|
...isCLI ? {
|
|
@@ -120356,16 +120356,16 @@ async function getFileInfo(file2, options8 = {}) {
|
|
|
120356
120356
|
};
|
|
120357
120357
|
}
|
|
120358
120358
|
async function getParser(file2, options8) {
|
|
120359
|
-
let
|
|
120359
|
+
let config11;
|
|
120360
120360
|
if (options8.resolveConfig !== false) {
|
|
120361
|
-
|
|
120361
|
+
config11 = await resolveConfig(file2, {
|
|
120362
120362
|
editorconfig: false
|
|
120363
120363
|
});
|
|
120364
120364
|
}
|
|
120365
|
-
if (
|
|
120366
|
-
return
|
|
120365
|
+
if (config11?.parser) {
|
|
120366
|
+
return config11.parser;
|
|
120367
120367
|
}
|
|
120368
|
-
let plugins = options8.plugins ??
|
|
120368
|
+
let plugins = options8.plugins ?? config11?.plugins ?? [];
|
|
120369
120369
|
plugins = (await Promise.all([load_builtin_plugins_default(), load_plugins_default(plugins)])).flat();
|
|
120370
120370
|
return infer_parser_default({ plugins }, { physicalFile: file2 });
|
|
120371
120371
|
}
|
|
@@ -120843,9 +120843,9 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
120843
120843
|
};
|
|
120844
120844
|
applyNormalization();
|
|
120845
120845
|
for (const key2 of Object.keys(this._utils.schemas)) {
|
|
120846
|
-
const
|
|
120846
|
+
const schema10 = this._utils.schemas[key2];
|
|
120847
120847
|
if (!(key2 in newOptions)) {
|
|
120848
|
-
const defaultResult = normalizeDefaultResult(
|
|
120848
|
+
const defaultResult = normalizeDefaultResult(schema10.default(this._utils));
|
|
120849
120849
|
if ("value" in defaultResult) {
|
|
120850
120850
|
restOptionsArray.push({ [key2]: defaultResult.value });
|
|
120851
120851
|
}
|
|
@@ -120856,13 +120856,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
120856
120856
|
if (!(key2 in newOptions)) {
|
|
120857
120857
|
continue;
|
|
120858
120858
|
}
|
|
120859
|
-
const
|
|
120859
|
+
const schema10 = this._utils.schemas[key2];
|
|
120860
120860
|
const value = newOptions[key2];
|
|
120861
|
-
const newValue =
|
|
120861
|
+
const newValue = schema10.postprocess(value, this._utils);
|
|
120862
120862
|
if (newValue === VALUE_UNCHANGED) {
|
|
120863
120863
|
continue;
|
|
120864
120864
|
}
|
|
120865
|
-
this._applyValidation(newValue, key2,
|
|
120865
|
+
this._applyValidation(newValue, key2, schema10);
|
|
120866
120866
|
newOptions[key2] = newValue;
|
|
120867
120867
|
}
|
|
120868
120868
|
this._applyPostprocess(newOptions);
|
|
@@ -120873,14 +120873,14 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
120873
120873
|
const transferredOptionsArray = [];
|
|
120874
120874
|
const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
|
|
120875
120875
|
for (const key2 of knownKeys) {
|
|
120876
|
-
const
|
|
120877
|
-
const value =
|
|
120878
|
-
this._applyValidation(value, key2,
|
|
120876
|
+
const schema10 = this._utils.schemas[key2];
|
|
120877
|
+
const value = schema10.preprocess(options8[key2], this._utils);
|
|
120878
|
+
this._applyValidation(value, key2, schema10);
|
|
120879
120879
|
const appendTransferredOptions = ({ from, to: to5 }) => {
|
|
120880
120880
|
transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
|
|
120881
120881
|
};
|
|
120882
120882
|
const warnDeprecated = ({ value: currentValue, redirectTo }) => {
|
|
120883
|
-
const deprecatedResult = normalizeDeprecatedResult(
|
|
120883
|
+
const deprecatedResult = normalizeDeprecatedResult(schema10.deprecated(currentValue, this._utils), value, true);
|
|
120884
120884
|
if (deprecatedResult === false) {
|
|
120885
120885
|
return;
|
|
120886
120886
|
}
|
|
@@ -120898,13 +120898,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
120898
120898
|
}
|
|
120899
120899
|
}
|
|
120900
120900
|
};
|
|
120901
|
-
const forwardResult = normalizeForwardResult(
|
|
120901
|
+
const forwardResult = normalizeForwardResult(schema10.forward(value, this._utils), value);
|
|
120902
120902
|
forwardResult.forEach(appendTransferredOptions);
|
|
120903
|
-
const redirectResult = normalizeRedirectResult(
|
|
120903
|
+
const redirectResult = normalizeRedirectResult(schema10.redirect(value, this._utils), value);
|
|
120904
120904
|
redirectResult.redirect.forEach(appendTransferredOptions);
|
|
120905
120905
|
if ("remain" in redirectResult) {
|
|
120906
120906
|
const remainingValue = redirectResult.remain;
|
|
120907
|
-
newOptions[key2] = key2 in newOptions ?
|
|
120907
|
+
newOptions[key2] = key2 in newOptions ? schema10.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
|
|
120908
120908
|
warnDeprecated({ value: remainingValue });
|
|
120909
120909
|
}
|
|
120910
120910
|
for (const { from, to: to5 } of redirectResult.redirect) {
|
|
@@ -120932,8 +120932,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
120932
120932
|
const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
|
|
120933
120933
|
return { knownKeys, unknownKeys };
|
|
120934
120934
|
}
|
|
120935
|
-
_applyValidation(value, key2,
|
|
120936
|
-
const validateResult = normalizeValidateResult(
|
|
120935
|
+
_applyValidation(value, key2, schema10) {
|
|
120936
|
+
const validateResult = normalizeValidateResult(schema10.validate(value, this._utils), value);
|
|
120937
120937
|
if (validateResult !== true) {
|
|
120938
120938
|
throw this._invalidHandler(key2, validateResult.value, this._utils);
|
|
120939
120939
|
}
|
|
@@ -120975,8 +120975,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
120975
120975
|
for (const key2 of unknownKeys) {
|
|
120976
120976
|
const value = postprocessed.override[key2];
|
|
120977
120977
|
this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
|
|
120978
|
-
const
|
|
120979
|
-
this._applyValidation(knownResultValue, knownResultKey,
|
|
120978
|
+
const schema10 = this._utils.schemas[knownResultKey];
|
|
120979
|
+
this._applyValidation(knownResultValue, knownResultKey, schema10);
|
|
120980
120980
|
options8[knownResultKey] = knownResultValue;
|
|
120981
120981
|
});
|
|
120982
120982
|
}
|
|
@@ -130673,7 +130673,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
130673
130673
|
if (token.type === "eof") {
|
|
130674
130674
|
throw invalidEOF();
|
|
130675
130675
|
}
|
|
130676
|
-
|
|
130676
|
+
push4();
|
|
130677
130677
|
},
|
|
130678
130678
|
beforePropertyName() {
|
|
130679
130679
|
switch (token.type) {
|
|
@@ -130699,7 +130699,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
130699
130699
|
if (token.type === "eof") {
|
|
130700
130700
|
throw invalidEOF();
|
|
130701
130701
|
}
|
|
130702
|
-
|
|
130702
|
+
push4();
|
|
130703
130703
|
},
|
|
130704
130704
|
beforeArrayValue() {
|
|
130705
130705
|
if (token.type === "eof") {
|
|
@@ -130709,7 +130709,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
130709
130709
|
pop();
|
|
130710
130710
|
return;
|
|
130711
130711
|
}
|
|
130712
|
-
|
|
130712
|
+
push4();
|
|
130713
130713
|
},
|
|
130714
130714
|
afterPropertyValue() {
|
|
130715
130715
|
if (token.type === "eof") {
|
|
@@ -133208,7 +133208,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133208
133208
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
133209
133209
|
}
|
|
133210
133210
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
133211
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
133211
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join20(replacement, currentDoc.split(`
|
|
133212
133212
|
`)) : currentDoc);
|
|
133213
133213
|
}
|
|
133214
133214
|
function canBreakFn2(doc2) {
|
|
@@ -133294,7 +133294,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133294
133294
|
negate: options8.negate
|
|
133295
133295
|
};
|
|
133296
133296
|
}
|
|
133297
|
-
function
|
|
133297
|
+
function join20(separator, docs) {
|
|
133298
133298
|
assertDoc2(separator);
|
|
133299
133299
|
assertDocArray2(docs);
|
|
133300
133300
|
const parts = [];
|
|
@@ -133959,7 +133959,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133959
133959
|
}
|
|
133960
133960
|
}
|
|
133961
133961
|
var builders2 = {
|
|
133962
|
-
join:
|
|
133962
|
+
join: join20,
|
|
133963
133963
|
line: line3,
|
|
133964
133964
|
softline: softline2,
|
|
133965
133965
|
hardline: hardline4,
|
|
@@ -134689,23 +134689,23 @@ var require_JSONSchema = __commonJS((exports) => {
|
|
|
134689
134689
|
exports.Parent = Symbol("Parent");
|
|
134690
134690
|
exports.Types = Symbol("Types");
|
|
134691
134691
|
exports.Intersection = Symbol("Intersection");
|
|
134692
|
-
exports.getRootSchema = (0, lodash_1.memoize)((
|
|
134693
|
-
const parent =
|
|
134692
|
+
exports.getRootSchema = (0, lodash_1.memoize)((schema10) => {
|
|
134693
|
+
const parent = schema10[exports.Parent];
|
|
134694
134694
|
if (!parent) {
|
|
134695
|
-
return
|
|
134695
|
+
return schema10;
|
|
134696
134696
|
}
|
|
134697
134697
|
return (0, exports.getRootSchema)(parent);
|
|
134698
134698
|
});
|
|
134699
|
-
function isBoolean(
|
|
134700
|
-
return
|
|
134699
|
+
function isBoolean(schema10) {
|
|
134700
|
+
return schema10 === true || schema10 === false;
|
|
134701
134701
|
}
|
|
134702
134702
|
exports.isBoolean = isBoolean;
|
|
134703
|
-
function isPrimitive(
|
|
134704
|
-
return !(0, lodash_1.isPlainObject)(
|
|
134703
|
+
function isPrimitive(schema10) {
|
|
134704
|
+
return !(0, lodash_1.isPlainObject)(schema10);
|
|
134705
134705
|
}
|
|
134706
134706
|
exports.isPrimitive = isPrimitive;
|
|
134707
|
-
function isCompound(
|
|
134708
|
-
return Array.isArray(
|
|
134707
|
+
function isCompound(schema10) {
|
|
134708
|
+
return Array.isArray(schema10.type) || "anyOf" in schema10 || "oneOf" in schema10;
|
|
134709
134709
|
}
|
|
134710
134710
|
exports.isCompound = isCompound;
|
|
134711
134711
|
});
|
|
@@ -134932,9 +134932,9 @@ var require_type2 = __commonJS((exports, module) => {
|
|
|
134932
134932
|
var require_schema5 = __commonJS((exports, module) => {
|
|
134933
134933
|
var YAMLException = require_exception2();
|
|
134934
134934
|
var Type = require_type2();
|
|
134935
|
-
function compileList(
|
|
134935
|
+
function compileList(schema10, name2) {
|
|
134936
134936
|
var result = [];
|
|
134937
|
-
|
|
134937
|
+
schema10[name2].forEach(function(currentType) {
|
|
134938
134938
|
var newIndex = result.length;
|
|
134939
134939
|
result.forEach(function(previousType, previousIndex) {
|
|
134940
134940
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -136879,7 +136879,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
136879
136879
|
"OFF"
|
|
136880
136880
|
];
|
|
136881
136881
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
136882
|
-
function compileStyleMap(
|
|
136882
|
+
function compileStyleMap(schema10, map2) {
|
|
136883
136883
|
var result, keys, index, length, tag, style, type;
|
|
136884
136884
|
if (map2 === null)
|
|
136885
136885
|
return {};
|
|
@@ -136891,7 +136891,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
136891
136891
|
if (tag.slice(0, 2) === "!!") {
|
|
136892
136892
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
136893
136893
|
}
|
|
136894
|
-
type =
|
|
136894
|
+
type = schema10.compiledTypeMap["fallback"][tag];
|
|
136895
136895
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
136896
136896
|
style = type.styleAliases[style];
|
|
136897
136897
|
}
|
|
@@ -137550,11 +137550,11 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
137550
137550
|
function traverseArray(arr, callback, processed) {
|
|
137551
137551
|
arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
|
|
137552
137552
|
}
|
|
137553
|
-
function traverseIntersection(
|
|
137554
|
-
if (typeof
|
|
137553
|
+
function traverseIntersection(schema10, callback, processed) {
|
|
137554
|
+
if (typeof schema10 !== "object" || !schema10) {
|
|
137555
137555
|
return;
|
|
137556
137556
|
}
|
|
137557
|
-
const r5 =
|
|
137557
|
+
const r5 = schema10;
|
|
137558
137558
|
const intersection2 = r5[JSONSchema_1.Intersection];
|
|
137559
137559
|
if (!intersection2) {
|
|
137560
137560
|
return;
|
|
@@ -137563,60 +137563,60 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
137563
137563
|
traverseArray(intersection2.allOf, callback, processed);
|
|
137564
137564
|
}
|
|
137565
137565
|
}
|
|
137566
|
-
function traverse(
|
|
137567
|
-
if (processed.has(
|
|
137566
|
+
function traverse(schema10, callback, processed = new Set, key2) {
|
|
137567
|
+
if (processed.has(schema10)) {
|
|
137568
137568
|
return;
|
|
137569
137569
|
}
|
|
137570
|
-
processed.add(
|
|
137571
|
-
callback(
|
|
137572
|
-
if (
|
|
137573
|
-
traverseArray(
|
|
137570
|
+
processed.add(schema10);
|
|
137571
|
+
callback(schema10, key2 !== null && key2 !== undefined ? key2 : null);
|
|
137572
|
+
if (schema10.anyOf) {
|
|
137573
|
+
traverseArray(schema10.anyOf, callback, processed);
|
|
137574
137574
|
}
|
|
137575
|
-
if (
|
|
137576
|
-
traverseArray(
|
|
137575
|
+
if (schema10.allOf) {
|
|
137576
|
+
traverseArray(schema10.allOf, callback, processed);
|
|
137577
137577
|
}
|
|
137578
|
-
if (
|
|
137579
|
-
traverseArray(
|
|
137578
|
+
if (schema10.oneOf) {
|
|
137579
|
+
traverseArray(schema10.oneOf, callback, processed);
|
|
137580
137580
|
}
|
|
137581
|
-
if (
|
|
137582
|
-
traverseObjectKeys(
|
|
137581
|
+
if (schema10.properties) {
|
|
137582
|
+
traverseObjectKeys(schema10.properties, callback, processed);
|
|
137583
137583
|
}
|
|
137584
|
-
if (
|
|
137585
|
-
traverseObjectKeys(
|
|
137584
|
+
if (schema10.patternProperties) {
|
|
137585
|
+
traverseObjectKeys(schema10.patternProperties, callback, processed);
|
|
137586
137586
|
}
|
|
137587
|
-
if (
|
|
137588
|
-
traverse(
|
|
137587
|
+
if (schema10.additionalProperties && typeof schema10.additionalProperties === "object") {
|
|
137588
|
+
traverse(schema10.additionalProperties, callback, processed);
|
|
137589
137589
|
}
|
|
137590
|
-
if (
|
|
137591
|
-
const { items } =
|
|
137590
|
+
if (schema10.items) {
|
|
137591
|
+
const { items } = schema10;
|
|
137592
137592
|
if (Array.isArray(items)) {
|
|
137593
137593
|
traverseArray(items, callback, processed);
|
|
137594
137594
|
} else {
|
|
137595
137595
|
traverse(items, callback, processed);
|
|
137596
137596
|
}
|
|
137597
137597
|
}
|
|
137598
|
-
if (
|
|
137599
|
-
traverse(
|
|
137598
|
+
if (schema10.additionalItems && typeof schema10.additionalItems === "object") {
|
|
137599
|
+
traverse(schema10.additionalItems, callback, processed);
|
|
137600
137600
|
}
|
|
137601
|
-
if (
|
|
137602
|
-
if (Array.isArray(
|
|
137603
|
-
traverseArray(
|
|
137601
|
+
if (schema10.dependencies) {
|
|
137602
|
+
if (Array.isArray(schema10.dependencies)) {
|
|
137603
|
+
traverseArray(schema10.dependencies, callback, processed);
|
|
137604
137604
|
} else {
|
|
137605
|
-
traverseObjectKeys(
|
|
137605
|
+
traverseObjectKeys(schema10.dependencies, callback, processed);
|
|
137606
137606
|
}
|
|
137607
137607
|
}
|
|
137608
|
-
if (
|
|
137609
|
-
traverseObjectKeys(
|
|
137608
|
+
if (schema10.definitions) {
|
|
137609
|
+
traverseObjectKeys(schema10.definitions, callback, processed);
|
|
137610
137610
|
}
|
|
137611
|
-
if (
|
|
137612
|
-
traverseObjectKeys(
|
|
137611
|
+
if (schema10.$defs) {
|
|
137612
|
+
traverseObjectKeys(schema10.$defs, callback, processed);
|
|
137613
137613
|
}
|
|
137614
|
-
if (
|
|
137615
|
-
traverse(
|
|
137614
|
+
if (schema10.not) {
|
|
137615
|
+
traverse(schema10.not, callback, processed);
|
|
137616
137616
|
}
|
|
137617
|
-
traverseIntersection(
|
|
137618
|
-
Object.keys(
|
|
137619
|
-
const child =
|
|
137617
|
+
traverseIntersection(schema10, callback, processed);
|
|
137618
|
+
Object.keys(schema10).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
|
|
137619
|
+
const child = schema10[key3];
|
|
137620
137620
|
if (child && typeof child === "object") {
|
|
137621
137621
|
traverseObjectKeys(child, callback, processed);
|
|
137622
137622
|
}
|
|
@@ -137698,14 +137698,14 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
137698
137698
|
return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
|
|
137699
137699
|
}
|
|
137700
137700
|
}
|
|
137701
|
-
function escapeBlockComment(
|
|
137701
|
+
function escapeBlockComment(schema10) {
|
|
137702
137702
|
const replacer = "* /";
|
|
137703
|
-
if (
|
|
137703
|
+
if (schema10 === null || typeof schema10 !== "object") {
|
|
137704
137704
|
return;
|
|
137705
137705
|
}
|
|
137706
|
-
for (const key2 of Object.keys(
|
|
137707
|
-
if (key2 === "description" && typeof
|
|
137708
|
-
|
|
137706
|
+
for (const key2 of Object.keys(schema10)) {
|
|
137707
|
+
if (key2 === "description" && typeof schema10[key2] === "string") {
|
|
137708
|
+
schema10[key2] = schema10[key2].replace(/\*\//g, replacer);
|
|
137709
137709
|
}
|
|
137710
137710
|
}
|
|
137711
137711
|
}
|
|
@@ -137717,45 +137717,45 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
137717
137717
|
return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
|
|
137718
137718
|
}
|
|
137719
137719
|
exports.pathTransform = pathTransform;
|
|
137720
|
-
function maybeStripDefault(
|
|
137721
|
-
if (!("default" in
|
|
137722
|
-
return
|
|
137720
|
+
function maybeStripDefault(schema10) {
|
|
137721
|
+
if (!("default" in schema10)) {
|
|
137722
|
+
return schema10;
|
|
137723
137723
|
}
|
|
137724
|
-
switch (
|
|
137724
|
+
switch (schema10.type) {
|
|
137725
137725
|
case "array":
|
|
137726
|
-
if (Array.isArray(
|
|
137727
|
-
return
|
|
137726
|
+
if (Array.isArray(schema10.default)) {
|
|
137727
|
+
return schema10;
|
|
137728
137728
|
}
|
|
137729
137729
|
break;
|
|
137730
137730
|
case "boolean":
|
|
137731
|
-
if (typeof
|
|
137732
|
-
return
|
|
137731
|
+
if (typeof schema10.default === "boolean") {
|
|
137732
|
+
return schema10;
|
|
137733
137733
|
}
|
|
137734
137734
|
break;
|
|
137735
137735
|
case "integer":
|
|
137736
137736
|
case "number":
|
|
137737
|
-
if (typeof
|
|
137738
|
-
return
|
|
137737
|
+
if (typeof schema10.default === "number") {
|
|
137738
|
+
return schema10;
|
|
137739
137739
|
}
|
|
137740
137740
|
break;
|
|
137741
137741
|
case "string":
|
|
137742
|
-
if (typeof
|
|
137743
|
-
return
|
|
137742
|
+
if (typeof schema10.default === "string") {
|
|
137743
|
+
return schema10;
|
|
137744
137744
|
}
|
|
137745
137745
|
break;
|
|
137746
137746
|
case "null":
|
|
137747
|
-
if (
|
|
137748
|
-
return
|
|
137747
|
+
if (schema10.default === null) {
|
|
137748
|
+
return schema10;
|
|
137749
137749
|
}
|
|
137750
137750
|
break;
|
|
137751
137751
|
case "object":
|
|
137752
|
-
if ((0, lodash_1.isPlainObject)(
|
|
137753
|
-
return
|
|
137752
|
+
if ((0, lodash_1.isPlainObject)(schema10.default)) {
|
|
137753
|
+
return schema10;
|
|
137754
137754
|
}
|
|
137755
137755
|
break;
|
|
137756
137756
|
}
|
|
137757
|
-
delete
|
|
137758
|
-
return
|
|
137757
|
+
delete schema10.default;
|
|
137758
|
+
return schema10;
|
|
137759
137759
|
}
|
|
137760
137760
|
exports.maybeStripDefault = maybeStripDefault;
|
|
137761
137761
|
function appendToDescription(existingDescription, ...values) {
|
|
@@ -137769,11 +137769,11 @@ ${values.join(`
|
|
|
137769
137769
|
`);
|
|
137770
137770
|
}
|
|
137771
137771
|
exports.appendToDescription = appendToDescription;
|
|
137772
|
-
function isSchemaLike(
|
|
137773
|
-
if (!(0, lodash_1.isPlainObject)(
|
|
137772
|
+
function isSchemaLike(schema10) {
|
|
137773
|
+
if (!(0, lodash_1.isPlainObject)(schema10)) {
|
|
137774
137774
|
return false;
|
|
137775
137775
|
}
|
|
137776
|
-
const parent =
|
|
137776
|
+
const parent = schema10[JSONSchema_1.Parent];
|
|
137777
137777
|
if (parent === null) {
|
|
137778
137778
|
return true;
|
|
137779
137779
|
}
|
|
@@ -137790,7 +137790,7 @@ ${values.join(`
|
|
|
137790
137790
|
"properties",
|
|
137791
137791
|
"required"
|
|
137792
137792
|
];
|
|
137793
|
-
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] ===
|
|
137793
|
+
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema10)) {
|
|
137794
137794
|
return false;
|
|
137795
137795
|
}
|
|
137796
137796
|
return true;
|
|
@@ -138088,13 +138088,13 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
138088
138088
|
exports.typesOfSchema = undefined;
|
|
138089
138089
|
var lodash_1 = require_lodash();
|
|
138090
138090
|
var JSONSchema_1 = require_JSONSchema();
|
|
138091
|
-
function typesOfSchema(
|
|
138092
|
-
if (
|
|
138091
|
+
function typesOfSchema(schema10) {
|
|
138092
|
+
if (schema10.tsType) {
|
|
138093
138093
|
return new Set(["CUSTOM_TYPE"]);
|
|
138094
138094
|
}
|
|
138095
138095
|
const matchedTypes = new Set;
|
|
138096
138096
|
for (const [schemaType, f7] of Object.entries(matchers)) {
|
|
138097
|
-
if (f7(
|
|
138097
|
+
if (f7(schema10)) {
|
|
138098
138098
|
matchedTypes.add(schemaType);
|
|
138099
138099
|
}
|
|
138100
138100
|
}
|
|
@@ -138105,26 +138105,26 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
138105
138105
|
}
|
|
138106
138106
|
exports.typesOfSchema = typesOfSchema;
|
|
138107
138107
|
var matchers = {
|
|
138108
|
-
ALL_OF(
|
|
138109
|
-
return "allOf" in
|
|
138108
|
+
ALL_OF(schema10) {
|
|
138109
|
+
return "allOf" in schema10;
|
|
138110
138110
|
},
|
|
138111
|
-
ANY(
|
|
138112
|
-
if (Object.keys(
|
|
138111
|
+
ANY(schema10) {
|
|
138112
|
+
if (Object.keys(schema10).length === 0) {
|
|
138113
138113
|
return true;
|
|
138114
138114
|
}
|
|
138115
|
-
return
|
|
138115
|
+
return schema10.type === "any";
|
|
138116
138116
|
},
|
|
138117
|
-
ANY_OF(
|
|
138118
|
-
return "anyOf" in
|
|
138117
|
+
ANY_OF(schema10) {
|
|
138118
|
+
return "anyOf" in schema10;
|
|
138119
138119
|
},
|
|
138120
|
-
BOOLEAN(
|
|
138121
|
-
if ("enum" in
|
|
138120
|
+
BOOLEAN(schema10) {
|
|
138121
|
+
if ("enum" in schema10) {
|
|
138122
138122
|
return false;
|
|
138123
138123
|
}
|
|
138124
|
-
if (
|
|
138124
|
+
if (schema10.type === "boolean") {
|
|
138125
138125
|
return true;
|
|
138126
138126
|
}
|
|
138127
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
138127
|
+
if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "boolean") {
|
|
138128
138128
|
return true;
|
|
138129
138129
|
}
|
|
138130
138130
|
return false;
|
|
@@ -138132,74 +138132,74 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
138132
138132
|
CUSTOM_TYPE() {
|
|
138133
138133
|
return false;
|
|
138134
138134
|
},
|
|
138135
|
-
NAMED_ENUM(
|
|
138136
|
-
return "enum" in
|
|
138135
|
+
NAMED_ENUM(schema10) {
|
|
138136
|
+
return "enum" in schema10 && "tsEnumNames" in schema10;
|
|
138137
138137
|
},
|
|
138138
|
-
NAMED_SCHEMA(
|
|
138139
|
-
return "$id" in
|
|
138138
|
+
NAMED_SCHEMA(schema10) {
|
|
138139
|
+
return "$id" in schema10 && (("patternProperties" in schema10) || ("properties" in schema10));
|
|
138140
138140
|
},
|
|
138141
|
-
NEVER(
|
|
138142
|
-
return
|
|
138141
|
+
NEVER(schema10) {
|
|
138142
|
+
return schema10 === false;
|
|
138143
138143
|
},
|
|
138144
|
-
NULL(
|
|
138145
|
-
return
|
|
138144
|
+
NULL(schema10) {
|
|
138145
|
+
return schema10.type === "null";
|
|
138146
138146
|
},
|
|
138147
|
-
NUMBER(
|
|
138148
|
-
if ("enum" in
|
|
138147
|
+
NUMBER(schema10) {
|
|
138148
|
+
if ("enum" in schema10) {
|
|
138149
138149
|
return false;
|
|
138150
138150
|
}
|
|
138151
|
-
if (
|
|
138151
|
+
if (schema10.type === "integer" || schema10.type === "number") {
|
|
138152
138152
|
return true;
|
|
138153
138153
|
}
|
|
138154
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
138154
|
+
if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "number") {
|
|
138155
138155
|
return true;
|
|
138156
138156
|
}
|
|
138157
138157
|
return false;
|
|
138158
138158
|
},
|
|
138159
|
-
OBJECT(
|
|
138160
|
-
return
|
|
138159
|
+
OBJECT(schema10) {
|
|
138160
|
+
return schema10.type === "object" && !(0, lodash_1.isPlainObject)(schema10.additionalProperties) && !schema10.allOf && !schema10.anyOf && !schema10.oneOf && !schema10.patternProperties && !schema10.properties && !schema10.required;
|
|
138161
138161
|
},
|
|
138162
|
-
ONE_OF(
|
|
138163
|
-
return "oneOf" in
|
|
138162
|
+
ONE_OF(schema10) {
|
|
138163
|
+
return "oneOf" in schema10;
|
|
138164
138164
|
},
|
|
138165
|
-
REFERENCE(
|
|
138166
|
-
return "$ref" in
|
|
138165
|
+
REFERENCE(schema10) {
|
|
138166
|
+
return "$ref" in schema10;
|
|
138167
138167
|
},
|
|
138168
|
-
STRING(
|
|
138169
|
-
if ("enum" in
|
|
138168
|
+
STRING(schema10) {
|
|
138169
|
+
if ("enum" in schema10) {
|
|
138170
138170
|
return false;
|
|
138171
138171
|
}
|
|
138172
|
-
if (
|
|
138172
|
+
if (schema10.type === "string") {
|
|
138173
138173
|
return true;
|
|
138174
138174
|
}
|
|
138175
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
138175
|
+
if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "string") {
|
|
138176
138176
|
return true;
|
|
138177
138177
|
}
|
|
138178
138178
|
return false;
|
|
138179
138179
|
},
|
|
138180
|
-
TYPED_ARRAY(
|
|
138181
|
-
if (
|
|
138180
|
+
TYPED_ARRAY(schema10) {
|
|
138181
|
+
if (schema10.type && schema10.type !== "array") {
|
|
138182
138182
|
return false;
|
|
138183
138183
|
}
|
|
138184
|
-
return "items" in
|
|
138184
|
+
return "items" in schema10;
|
|
138185
138185
|
},
|
|
138186
|
-
UNION(
|
|
138187
|
-
return Array.isArray(
|
|
138186
|
+
UNION(schema10) {
|
|
138187
|
+
return Array.isArray(schema10.type);
|
|
138188
138188
|
},
|
|
138189
|
-
UNNAMED_ENUM(
|
|
138190
|
-
if ("tsEnumNames" in
|
|
138189
|
+
UNNAMED_ENUM(schema10) {
|
|
138190
|
+
if ("tsEnumNames" in schema10) {
|
|
138191
138191
|
return false;
|
|
138192
138192
|
}
|
|
138193
|
-
if (
|
|
138193
|
+
if (schema10.type && schema10.type !== "boolean" && schema10.type !== "integer" && schema10.type !== "number" && schema10.type !== "string") {
|
|
138194
138194
|
return false;
|
|
138195
138195
|
}
|
|
138196
|
-
return "enum" in
|
|
138196
|
+
return "enum" in schema10;
|
|
138197
138197
|
},
|
|
138198
138198
|
UNNAMED_SCHEMA() {
|
|
138199
138199
|
return false;
|
|
138200
138200
|
},
|
|
138201
|
-
UNTYPED_ARRAY(
|
|
138202
|
-
return
|
|
138201
|
+
UNTYPED_ARRAY(schema10) {
|
|
138202
|
+
return schema10.type === "array" && !("items" in schema10);
|
|
138203
138203
|
}
|
|
138204
138204
|
};
|
|
138205
138205
|
});
|
|
@@ -138210,10 +138210,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
138210
138210
|
exports.applySchemaTyping = undefined;
|
|
138211
138211
|
var JSONSchema_1 = require_JSONSchema();
|
|
138212
138212
|
var typesOfSchema_1 = require_typesOfSchema();
|
|
138213
|
-
function applySchemaTyping(
|
|
138213
|
+
function applySchemaTyping(schema10) {
|
|
138214
138214
|
var _a7;
|
|
138215
|
-
const types = (0, typesOfSchema_1.typesOfSchema)(
|
|
138216
|
-
Object.defineProperty(
|
|
138215
|
+
const types = (0, typesOfSchema_1.typesOfSchema)(schema10);
|
|
138216
|
+
Object.defineProperty(schema10, JSONSchema_1.Types, {
|
|
138217
138217
|
enumerable: false,
|
|
138218
138218
|
value: types,
|
|
138219
138219
|
writable: false
|
|
@@ -138222,23 +138222,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
138222
138222
|
return;
|
|
138223
138223
|
}
|
|
138224
138224
|
const intersection2 = {
|
|
138225
|
-
[JSONSchema_1.Parent]:
|
|
138225
|
+
[JSONSchema_1.Parent]: schema10,
|
|
138226
138226
|
[JSONSchema_1.Types]: new Set(["ALL_OF"]),
|
|
138227
|
-
$id:
|
|
138228
|
-
description:
|
|
138229
|
-
name:
|
|
138230
|
-
title:
|
|
138231
|
-
allOf: (_a7 =
|
|
138227
|
+
$id: schema10.$id,
|
|
138228
|
+
description: schema10.description,
|
|
138229
|
+
name: schema10.name,
|
|
138230
|
+
title: schema10.title,
|
|
138231
|
+
allOf: (_a7 = schema10.allOf) !== null && _a7 !== undefined ? _a7 : [],
|
|
138232
138232
|
required: [],
|
|
138233
138233
|
additionalProperties: false
|
|
138234
138234
|
};
|
|
138235
138235
|
types.delete("ALL_OF");
|
|
138236
|
-
delete
|
|
138237
|
-
delete
|
|
138238
|
-
delete
|
|
138239
|
-
delete
|
|
138240
|
-
delete
|
|
138241
|
-
Object.defineProperty(
|
|
138236
|
+
delete schema10.allOf;
|
|
138237
|
+
delete schema10.$id;
|
|
138238
|
+
delete schema10.description;
|
|
138239
|
+
delete schema10.name;
|
|
138240
|
+
delete schema10.title;
|
|
138241
|
+
Object.defineProperty(schema10, JSONSchema_1.Intersection, {
|
|
138242
138242
|
enumerable: false,
|
|
138243
138243
|
value: intersection2,
|
|
138244
138244
|
writable: false
|
|
@@ -138256,186 +138256,186 @@ var require_normalizer = __commonJS((exports) => {
|
|
|
138256
138256
|
var applySchemaTyping_1 = require_applySchemaTyping();
|
|
138257
138257
|
var util_1 = __require("util");
|
|
138258
138258
|
var rules = new Map;
|
|
138259
|
-
function hasType(
|
|
138260
|
-
return
|
|
138259
|
+
function hasType(schema10, type) {
|
|
138260
|
+
return schema10.type === type || Array.isArray(schema10.type) && schema10.type.includes(type);
|
|
138261
138261
|
}
|
|
138262
|
-
function isObjectType(
|
|
138263
|
-
return
|
|
138262
|
+
function isObjectType(schema10) {
|
|
138263
|
+
return schema10.properties !== undefined || hasType(schema10, "object") || hasType(schema10, "any");
|
|
138264
138264
|
}
|
|
138265
|
-
function isArrayType(
|
|
138266
|
-
return
|
|
138265
|
+
function isArrayType(schema10) {
|
|
138266
|
+
return schema10.items !== undefined || hasType(schema10, "array") || hasType(schema10, "any");
|
|
138267
138267
|
}
|
|
138268
|
-
function isEnumTypeWithoutTsEnumNames(
|
|
138269
|
-
return
|
|
138268
|
+
function isEnumTypeWithoutTsEnumNames(schema10) {
|
|
138269
|
+
return schema10.type === "string" && schema10.enum !== undefined && schema10.tsEnumNames === undefined;
|
|
138270
138270
|
}
|
|
138271
|
-
rules.set('Remove `type=["null"]` if `enum=[null]`', (
|
|
138272
|
-
if (Array.isArray(
|
|
138273
|
-
|
|
138271
|
+
rules.set('Remove `type=["null"]` if `enum=[null]`', (schema10) => {
|
|
138272
|
+
if (Array.isArray(schema10.enum) && schema10.enum.some((e8) => e8 === null) && Array.isArray(schema10.type) && schema10.type.includes("null")) {
|
|
138273
|
+
schema10.type = schema10.type.filter((type) => type !== "null");
|
|
138274
138274
|
}
|
|
138275
138275
|
});
|
|
138276
|
-
rules.set("Destructure unary types", (
|
|
138277
|
-
if (
|
|
138278
|
-
|
|
138276
|
+
rules.set("Destructure unary types", (schema10) => {
|
|
138277
|
+
if (schema10.type && Array.isArray(schema10.type) && schema10.type.length === 1) {
|
|
138278
|
+
schema10.type = schema10.type[0];
|
|
138279
138279
|
}
|
|
138280
138280
|
});
|
|
138281
|
-
rules.set("Add empty `required` property if none is defined", (
|
|
138282
|
-
if (isObjectType(
|
|
138283
|
-
|
|
138281
|
+
rules.set("Add empty `required` property if none is defined", (schema10) => {
|
|
138282
|
+
if (isObjectType(schema10) && !("required" in schema10)) {
|
|
138283
|
+
schema10.required = [];
|
|
138284
138284
|
}
|
|
138285
138285
|
});
|
|
138286
|
-
rules.set("Transform `required`=false to `required`=[]", (
|
|
138287
|
-
if (
|
|
138288
|
-
|
|
138286
|
+
rules.set("Transform `required`=false to `required`=[]", (schema10) => {
|
|
138287
|
+
if (schema10.required === false) {
|
|
138288
|
+
schema10.required = [];
|
|
138289
138289
|
}
|
|
138290
138290
|
});
|
|
138291
|
-
rules.set("Default additionalProperties", (
|
|
138292
|
-
if (isObjectType(
|
|
138293
|
-
|
|
138291
|
+
rules.set("Default additionalProperties", (schema10, _10, options8) => {
|
|
138292
|
+
if (isObjectType(schema10) && !("additionalProperties" in schema10) && schema10.patternProperties === undefined) {
|
|
138293
|
+
schema10.additionalProperties = options8.additionalProperties;
|
|
138294
138294
|
}
|
|
138295
138295
|
});
|
|
138296
|
-
rules.set("Transform id to $id", (
|
|
138297
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
138296
|
+
rules.set("Transform id to $id", (schema10, fileName) => {
|
|
138297
|
+
if (!(0, utils_1.isSchemaLike)(schema10)) {
|
|
138298
138298
|
return;
|
|
138299
138299
|
}
|
|
138300
|
-
if (
|
|
138301
|
-
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${
|
|
138300
|
+
if (schema10.id && schema10.$id && schema10.id !== schema10.$id) {
|
|
138301
|
+
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema10.id}, $id=${schema10.$id} in ${fileName}`);
|
|
138302
138302
|
}
|
|
138303
|
-
if (
|
|
138304
|
-
|
|
138305
|
-
delete
|
|
138303
|
+
if (schema10.id) {
|
|
138304
|
+
schema10.$id = schema10.id;
|
|
138305
|
+
delete schema10.id;
|
|
138306
138306
|
}
|
|
138307
138307
|
});
|
|
138308
|
-
rules.set("Add an $id to anything that needs it", (
|
|
138309
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
138308
|
+
rules.set("Add an $id to anything that needs it", (schema10, fileName, _options, _key, dereferencedPaths) => {
|
|
138309
|
+
if (!(0, utils_1.isSchemaLike)(schema10)) {
|
|
138310
138310
|
return;
|
|
138311
138311
|
}
|
|
138312
|
-
if (!
|
|
138313
|
-
|
|
138312
|
+
if (!schema10.$id && !schema10[JSONSchema_1.Parent]) {
|
|
138313
|
+
schema10.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
|
|
138314
138314
|
return;
|
|
138315
138315
|
}
|
|
138316
|
-
if (!isArrayType(
|
|
138316
|
+
if (!isArrayType(schema10) && !isObjectType(schema10)) {
|
|
138317
138317
|
return;
|
|
138318
138318
|
}
|
|
138319
|
-
const dereferencedName = dereferencedPaths.get(
|
|
138320
|
-
if (!
|
|
138321
|
-
|
|
138319
|
+
const dereferencedName = dereferencedPaths.get(schema10);
|
|
138320
|
+
if (!schema10.$id && !schema10.title && dereferencedName) {
|
|
138321
|
+
schema10.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
|
|
138322
138322
|
}
|
|
138323
138323
|
if (dereferencedName) {
|
|
138324
|
-
dereferencedPaths.delete(
|
|
138324
|
+
dereferencedPaths.delete(schema10);
|
|
138325
138325
|
}
|
|
138326
138326
|
});
|
|
138327
|
-
rules.set("Escape closing JSDoc comment", (
|
|
138328
|
-
(0, utils_1.escapeBlockComment)(
|
|
138327
|
+
rules.set("Escape closing JSDoc comment", (schema10) => {
|
|
138328
|
+
(0, utils_1.escapeBlockComment)(schema10);
|
|
138329
138329
|
});
|
|
138330
|
-
rules.set("Add JSDoc comments for minItems and maxItems", (
|
|
138331
|
-
if (!isArrayType(
|
|
138330
|
+
rules.set("Add JSDoc comments for minItems and maxItems", (schema10) => {
|
|
138331
|
+
if (!isArrayType(schema10)) {
|
|
138332
138332
|
return;
|
|
138333
138333
|
}
|
|
138334
138334
|
const commentsToAppend = [
|
|
138335
|
-
"minItems" in
|
|
138336
|
-
"maxItems" in
|
|
138335
|
+
"minItems" in schema10 ? `@minItems ${schema10.minItems}` : "",
|
|
138336
|
+
"maxItems" in schema10 ? `@maxItems ${schema10.maxItems}` : ""
|
|
138337
138337
|
].filter(Boolean);
|
|
138338
138338
|
if (commentsToAppend.length) {
|
|
138339
|
-
|
|
138339
|
+
schema10.description = (0, utils_1.appendToDescription)(schema10.description, ...commentsToAppend);
|
|
138340
138340
|
}
|
|
138341
138341
|
});
|
|
138342
|
-
rules.set("Optionally remove maxItems and minItems", (
|
|
138343
|
-
if (!isArrayType(
|
|
138342
|
+
rules.set("Optionally remove maxItems and minItems", (schema10, _fileName, options8) => {
|
|
138343
|
+
if (!isArrayType(schema10)) {
|
|
138344
138344
|
return;
|
|
138345
138345
|
}
|
|
138346
|
-
if ("minItems" in
|
|
138347
|
-
delete
|
|
138346
|
+
if ("minItems" in schema10 && options8.ignoreMinAndMaxItems) {
|
|
138347
|
+
delete schema10.minItems;
|
|
138348
138348
|
}
|
|
138349
|
-
if ("maxItems" in
|
|
138350
|
-
delete
|
|
138349
|
+
if ("maxItems" in schema10 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
|
|
138350
|
+
delete schema10.maxItems;
|
|
138351
138351
|
}
|
|
138352
138352
|
});
|
|
138353
|
-
rules.set("Normalize schema.minItems", (
|
|
138353
|
+
rules.set("Normalize schema.minItems", (schema10, _fileName, options8) => {
|
|
138354
138354
|
if (options8.ignoreMinAndMaxItems) {
|
|
138355
138355
|
return;
|
|
138356
138356
|
}
|
|
138357
|
-
if (!isArrayType(
|
|
138357
|
+
if (!isArrayType(schema10)) {
|
|
138358
138358
|
return;
|
|
138359
138359
|
}
|
|
138360
|
-
const { minItems } =
|
|
138361
|
-
|
|
138360
|
+
const { minItems } = schema10;
|
|
138361
|
+
schema10.minItems = typeof minItems === "number" ? minItems : 0;
|
|
138362
138362
|
});
|
|
138363
|
-
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (
|
|
138363
|
+
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema10, _fileName, options8) => {
|
|
138364
138364
|
if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
|
|
138365
138365
|
return;
|
|
138366
138366
|
}
|
|
138367
|
-
if (!isArrayType(
|
|
138367
|
+
if (!isArrayType(schema10)) {
|
|
138368
138368
|
return;
|
|
138369
138369
|
}
|
|
138370
|
-
const { maxItems, minItems } =
|
|
138370
|
+
const { maxItems, minItems } = schema10;
|
|
138371
138371
|
if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
|
|
138372
|
-
delete
|
|
138372
|
+
delete schema10.maxItems;
|
|
138373
138373
|
}
|
|
138374
138374
|
});
|
|
138375
|
-
rules.set("Normalize schema.items", (
|
|
138375
|
+
rules.set("Normalize schema.items", (schema10, _fileName, options8) => {
|
|
138376
138376
|
if (options8.ignoreMinAndMaxItems) {
|
|
138377
138377
|
return;
|
|
138378
138378
|
}
|
|
138379
|
-
const { maxItems, minItems } =
|
|
138379
|
+
const { maxItems, minItems } = schema10;
|
|
138380
138380
|
const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
|
|
138381
138381
|
const hasMinItems = typeof minItems === "number" && minItems > 0;
|
|
138382
|
-
if (
|
|
138383
|
-
const items =
|
|
138382
|
+
if (schema10.items && !Array.isArray(schema10.items) && (hasMaxItems || hasMinItems)) {
|
|
138383
|
+
const items = schema10.items;
|
|
138384
138384
|
const newItems = Array(maxItems || minItems || 0).fill(items);
|
|
138385
138385
|
if (!hasMaxItems) {
|
|
138386
|
-
|
|
138386
|
+
schema10.additionalItems = items;
|
|
138387
138387
|
}
|
|
138388
|
-
|
|
138388
|
+
schema10.items = newItems;
|
|
138389
138389
|
}
|
|
138390
|
-
if (Array.isArray(
|
|
138391
|
-
|
|
138390
|
+
if (Array.isArray(schema10.items) && hasMaxItems && maxItems < schema10.items.length) {
|
|
138391
|
+
schema10.items = schema10.items.slice(0, maxItems);
|
|
138392
138392
|
}
|
|
138393
|
-
return
|
|
138393
|
+
return schema10;
|
|
138394
138394
|
});
|
|
138395
|
-
rules.set("Remove extends, if it is empty", (
|
|
138396
|
-
if (!
|
|
138395
|
+
rules.set("Remove extends, if it is empty", (schema10) => {
|
|
138396
|
+
if (!schema10.hasOwnProperty("extends")) {
|
|
138397
138397
|
return;
|
|
138398
138398
|
}
|
|
138399
|
-
if (
|
|
138400
|
-
delete
|
|
138399
|
+
if (schema10.extends == null || Array.isArray(schema10.extends) && schema10.extends.length === 0) {
|
|
138400
|
+
delete schema10.extends;
|
|
138401
138401
|
}
|
|
138402
138402
|
});
|
|
138403
|
-
rules.set("Make extends always an array, if it is defined", (
|
|
138404
|
-
if (
|
|
138403
|
+
rules.set("Make extends always an array, if it is defined", (schema10) => {
|
|
138404
|
+
if (schema10.extends == null) {
|
|
138405
138405
|
return;
|
|
138406
138406
|
}
|
|
138407
|
-
if (!Array.isArray(
|
|
138408
|
-
|
|
138407
|
+
if (!Array.isArray(schema10.extends)) {
|
|
138408
|
+
schema10.extends = [schema10.extends];
|
|
138409
138409
|
}
|
|
138410
138410
|
});
|
|
138411
|
-
rules.set("Transform definitions to $defs", (
|
|
138412
|
-
if (
|
|
138413
|
-
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${
|
|
138411
|
+
rules.set("Transform definitions to $defs", (schema10, fileName) => {
|
|
138412
|
+
if (schema10.definitions && schema10.$defs && !(0, util_1.isDeepStrictEqual)(schema10.definitions, schema10.$defs)) {
|
|
138413
|
+
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema10.id} in ${fileName}`);
|
|
138414
138414
|
}
|
|
138415
|
-
if (
|
|
138416
|
-
|
|
138417
|
-
delete
|
|
138415
|
+
if (schema10.definitions) {
|
|
138416
|
+
schema10.$defs = schema10.definitions;
|
|
138417
|
+
delete schema10.definitions;
|
|
138418
138418
|
}
|
|
138419
138419
|
});
|
|
138420
|
-
rules.set("Transform const to singleton enum", (
|
|
138421
|
-
if (
|
|
138422
|
-
|
|
138423
|
-
delete
|
|
138420
|
+
rules.set("Transform const to singleton enum", (schema10) => {
|
|
138421
|
+
if (schema10.const !== undefined) {
|
|
138422
|
+
schema10.enum = [schema10.const];
|
|
138423
|
+
delete schema10.const;
|
|
138424
138424
|
}
|
|
138425
138425
|
});
|
|
138426
|
-
rules.set("Add tsEnumNames to enum types", (
|
|
138426
|
+
rules.set("Add tsEnumNames to enum types", (schema10, _10, options8) => {
|
|
138427
138427
|
var _a7;
|
|
138428
|
-
if (isEnumTypeWithoutTsEnumNames(
|
|
138429
|
-
|
|
138428
|
+
if (isEnumTypeWithoutTsEnumNames(schema10) && options8.inferStringEnumKeysFromValues) {
|
|
138429
|
+
schema10.tsEnumNames = (_a7 = schema10.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
|
|
138430
138430
|
}
|
|
138431
138431
|
});
|
|
138432
|
-
rules.set("Pre-calculate schema types and intersections", (
|
|
138433
|
-
if (
|
|
138434
|
-
(0, applySchemaTyping_1.applySchemaTyping)(
|
|
138432
|
+
rules.set("Pre-calculate schema types and intersections", (schema10) => {
|
|
138433
|
+
if (schema10 !== null && typeof schema10 === "object") {
|
|
138434
|
+
(0, applySchemaTyping_1.applySchemaTyping)(schema10);
|
|
138435
138435
|
}
|
|
138436
138436
|
});
|
|
138437
138437
|
function normalize(rootSchema, dereferencedPaths, filename, options8) {
|
|
138438
|
-
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (
|
|
138438
|
+
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema10, key2) => rule(schema10, filename, options8, key2, dereferencedPaths)));
|
|
138439
138439
|
return rootSchema;
|
|
138440
138440
|
}
|
|
138441
138441
|
exports.normalize = normalize;
|
|
@@ -138517,37 +138517,37 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
138517
138517
|
var AST_1 = require_AST();
|
|
138518
138518
|
var JSONSchema_1 = require_JSONSchema();
|
|
138519
138519
|
var utils_1 = require_utils7();
|
|
138520
|
-
function parse11(
|
|
138521
|
-
if ((0, JSONSchema_1.isPrimitive)(
|
|
138522
|
-
if ((0, JSONSchema_1.isBoolean)(
|
|
138523
|
-
return parseBooleanSchema(
|
|
138520
|
+
function parse11(schema10, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
138521
|
+
if ((0, JSONSchema_1.isPrimitive)(schema10)) {
|
|
138522
|
+
if ((0, JSONSchema_1.isBoolean)(schema10)) {
|
|
138523
|
+
return parseBooleanSchema(schema10, keyName, options8);
|
|
138524
138524
|
}
|
|
138525
|
-
return parseLiteral(
|
|
138525
|
+
return parseLiteral(schema10, keyName);
|
|
138526
138526
|
}
|
|
138527
|
-
const intersection2 =
|
|
138528
|
-
const types =
|
|
138527
|
+
const intersection2 = schema10[JSONSchema_1.Intersection];
|
|
138528
|
+
const types = schema10[JSONSchema_1.Types];
|
|
138529
138529
|
if (intersection2) {
|
|
138530
138530
|
const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
|
|
138531
138531
|
types.forEach((type) => {
|
|
138532
|
-
ast.params.push(parseAsTypeWithCache(
|
|
138532
|
+
ast.params.push(parseAsTypeWithCache(schema10, type, options8, keyName, processed, usedNames));
|
|
138533
138533
|
});
|
|
138534
|
-
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:",
|
|
138534
|
+
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema10, "Output:", ast);
|
|
138535
138535
|
return ast;
|
|
138536
138536
|
}
|
|
138537
138537
|
if (types.size === 1) {
|
|
138538
138538
|
const type = [...types][0];
|
|
138539
|
-
const ast = parseAsTypeWithCache(
|
|
138540
|
-
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:",
|
|
138539
|
+
const ast = parseAsTypeWithCache(schema10, type, options8, keyName, processed, usedNames);
|
|
138540
|
+
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema10, "Output:", ast);
|
|
138541
138541
|
return ast;
|
|
138542
138542
|
}
|
|
138543
138543
|
throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
|
|
138544
138544
|
}
|
|
138545
138545
|
exports.parse = parse11;
|
|
138546
|
-
function parseAsTypeWithCache(
|
|
138547
|
-
let cachedTypeMap = processed.get(
|
|
138546
|
+
function parseAsTypeWithCache(schema10, type, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
138547
|
+
let cachedTypeMap = processed.get(schema10);
|
|
138548
138548
|
if (!cachedTypeMap) {
|
|
138549
138549
|
cachedTypeMap = new Map;
|
|
138550
|
-
processed.set(
|
|
138550
|
+
processed.set(schema10, cachedTypeMap);
|
|
138551
138551
|
}
|
|
138552
138552
|
const cachedAST = cachedTypeMap.get(type);
|
|
138553
138553
|
if (cachedAST) {
|
|
@@ -138555,10 +138555,10 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
138555
138555
|
}
|
|
138556
138556
|
const ast = {};
|
|
138557
138557
|
cachedTypeMap.set(type, ast);
|
|
138558
|
-
return Object.assign(ast, parseNonLiteral(
|
|
138558
|
+
return Object.assign(ast, parseNonLiteral(schema10, type, options8, keyName, processed, usedNames));
|
|
138559
138559
|
}
|
|
138560
|
-
function parseBooleanSchema(
|
|
138561
|
-
if (
|
|
138560
|
+
function parseBooleanSchema(schema10, keyName, options8) {
|
|
138561
|
+
if (schema10) {
|
|
138562
138562
|
return {
|
|
138563
138563
|
keyName,
|
|
138564
138564
|
type: options8.unknownAny ? "UNKNOWN" : "ANY"
|
|
@@ -138569,157 +138569,157 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
138569
138569
|
type: "NEVER"
|
|
138570
138570
|
};
|
|
138571
138571
|
}
|
|
138572
|
-
function parseLiteral(
|
|
138572
|
+
function parseLiteral(schema10, keyName) {
|
|
138573
138573
|
return {
|
|
138574
138574
|
keyName,
|
|
138575
|
-
params:
|
|
138575
|
+
params: schema10,
|
|
138576
138576
|
type: "LITERAL"
|
|
138577
138577
|
};
|
|
138578
138578
|
}
|
|
138579
|
-
function parseNonLiteral(
|
|
138580
|
-
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(
|
|
138581
|
-
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 ===
|
|
138579
|
+
function parseNonLiteral(schema10, type, options8, keyName, processed, usedNames) {
|
|
138580
|
+
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema10));
|
|
138581
|
+
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema10);
|
|
138582
138582
|
switch (type) {
|
|
138583
138583
|
case "ALL_OF":
|
|
138584
138584
|
return {
|
|
138585
|
-
comment:
|
|
138586
|
-
deprecated:
|
|
138585
|
+
comment: schema10.description,
|
|
138586
|
+
deprecated: schema10.deprecated,
|
|
138587
138587
|
keyName,
|
|
138588
|
-
standaloneName: standaloneName(
|
|
138589
|
-
params:
|
|
138588
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138589
|
+
params: schema10.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
138590
138590
|
type: "INTERSECTION"
|
|
138591
138591
|
};
|
|
138592
138592
|
case "ANY":
|
|
138593
|
-
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment:
|
|
138593
|
+
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema10.description, deprecated: schema10.deprecated, keyName, standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8) });
|
|
138594
138594
|
case "ANY_OF":
|
|
138595
138595
|
return {
|
|
138596
|
-
comment:
|
|
138597
|
-
deprecated:
|
|
138596
|
+
comment: schema10.description,
|
|
138597
|
+
deprecated: schema10.deprecated,
|
|
138598
138598
|
keyName,
|
|
138599
|
-
standaloneName: standaloneName(
|
|
138600
|
-
params:
|
|
138599
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138600
|
+
params: schema10.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
138601
138601
|
type: "UNION"
|
|
138602
138602
|
};
|
|
138603
138603
|
case "BOOLEAN":
|
|
138604
138604
|
return {
|
|
138605
|
-
comment:
|
|
138606
|
-
deprecated:
|
|
138605
|
+
comment: schema10.description,
|
|
138606
|
+
deprecated: schema10.deprecated,
|
|
138607
138607
|
keyName,
|
|
138608
|
-
standaloneName: standaloneName(
|
|
138608
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138609
138609
|
type: "BOOLEAN"
|
|
138610
138610
|
};
|
|
138611
138611
|
case "CUSTOM_TYPE":
|
|
138612
138612
|
return {
|
|
138613
|
-
comment:
|
|
138614
|
-
deprecated:
|
|
138613
|
+
comment: schema10.description,
|
|
138614
|
+
deprecated: schema10.deprecated,
|
|
138615
138615
|
keyName,
|
|
138616
|
-
params:
|
|
138617
|
-
standaloneName: standaloneName(
|
|
138616
|
+
params: schema10.tsType,
|
|
138617
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138618
138618
|
type: "CUSTOM_TYPE"
|
|
138619
138619
|
};
|
|
138620
138620
|
case "NAMED_ENUM":
|
|
138621
138621
|
return {
|
|
138622
|
-
comment:
|
|
138623
|
-
deprecated:
|
|
138622
|
+
comment: schema10.description,
|
|
138623
|
+
deprecated: schema10.deprecated,
|
|
138624
138624
|
keyName,
|
|
138625
|
-
standaloneName: standaloneName(
|
|
138626
|
-
params:
|
|
138625
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
|
|
138626
|
+
params: schema10.enum.map((_10, n5) => ({
|
|
138627
138627
|
ast: parseLiteral(_10, undefined),
|
|
138628
|
-
keyName:
|
|
138628
|
+
keyName: schema10.tsEnumNames[n5]
|
|
138629
138629
|
})),
|
|
138630
138630
|
type: "ENUM"
|
|
138631
138631
|
};
|
|
138632
138632
|
case "NAMED_SCHEMA":
|
|
138633
|
-
return newInterface(
|
|
138633
|
+
return newInterface(schema10, options8, processed, usedNames, keyName);
|
|
138634
138634
|
case "NEVER":
|
|
138635
138635
|
return {
|
|
138636
|
-
comment:
|
|
138637
|
-
deprecated:
|
|
138636
|
+
comment: schema10.description,
|
|
138637
|
+
deprecated: schema10.deprecated,
|
|
138638
138638
|
keyName,
|
|
138639
|
-
standaloneName: standaloneName(
|
|
138639
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138640
138640
|
type: "NEVER"
|
|
138641
138641
|
};
|
|
138642
138642
|
case "NULL":
|
|
138643
138643
|
return {
|
|
138644
|
-
comment:
|
|
138645
|
-
deprecated:
|
|
138644
|
+
comment: schema10.description,
|
|
138645
|
+
deprecated: schema10.deprecated,
|
|
138646
138646
|
keyName,
|
|
138647
|
-
standaloneName: standaloneName(
|
|
138647
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138648
138648
|
type: "NULL"
|
|
138649
138649
|
};
|
|
138650
138650
|
case "NUMBER":
|
|
138651
138651
|
return {
|
|
138652
|
-
comment:
|
|
138653
|
-
deprecated:
|
|
138652
|
+
comment: schema10.description,
|
|
138653
|
+
deprecated: schema10.deprecated,
|
|
138654
138654
|
keyName,
|
|
138655
|
-
standaloneName: standaloneName(
|
|
138655
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138656
138656
|
type: "NUMBER"
|
|
138657
138657
|
};
|
|
138658
138658
|
case "OBJECT":
|
|
138659
138659
|
return {
|
|
138660
|
-
comment:
|
|
138660
|
+
comment: schema10.description,
|
|
138661
138661
|
keyName,
|
|
138662
|
-
standaloneName: standaloneName(
|
|
138662
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138663
138663
|
type: "OBJECT",
|
|
138664
|
-
deprecated:
|
|
138664
|
+
deprecated: schema10.deprecated
|
|
138665
138665
|
};
|
|
138666
138666
|
case "ONE_OF":
|
|
138667
138667
|
return {
|
|
138668
|
-
comment:
|
|
138669
|
-
deprecated:
|
|
138668
|
+
comment: schema10.description,
|
|
138669
|
+
deprecated: schema10.deprecated,
|
|
138670
138670
|
keyName,
|
|
138671
|
-
standaloneName: standaloneName(
|
|
138672
|
-
params:
|
|
138671
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138672
|
+
params: schema10.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
138673
138673
|
type: "UNION"
|
|
138674
138674
|
};
|
|
138675
138675
|
case "REFERENCE":
|
|
138676
|
-
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!",
|
|
138676
|
+
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema10));
|
|
138677
138677
|
case "STRING":
|
|
138678
138678
|
return {
|
|
138679
|
-
comment:
|
|
138680
|
-
deprecated:
|
|
138679
|
+
comment: schema10.description,
|
|
138680
|
+
deprecated: schema10.deprecated,
|
|
138681
138681
|
keyName,
|
|
138682
|
-
standaloneName: standaloneName(
|
|
138682
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138683
138683
|
type: "STRING"
|
|
138684
138684
|
};
|
|
138685
138685
|
case "TYPED_ARRAY":
|
|
138686
|
-
if (Array.isArray(
|
|
138687
|
-
const minItems2 =
|
|
138688
|
-
const maxItems2 =
|
|
138686
|
+
if (Array.isArray(schema10.items)) {
|
|
138687
|
+
const minItems2 = schema10.minItems;
|
|
138688
|
+
const maxItems2 = schema10.maxItems;
|
|
138689
138689
|
const arrayType = {
|
|
138690
|
-
comment:
|
|
138691
|
-
deprecated:
|
|
138690
|
+
comment: schema10.description,
|
|
138691
|
+
deprecated: schema10.deprecated,
|
|
138692
138692
|
keyName,
|
|
138693
138693
|
maxItems: maxItems2,
|
|
138694
138694
|
minItems: minItems2,
|
|
138695
|
-
standaloneName: standaloneName(
|
|
138696
|
-
params:
|
|
138695
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138696
|
+
params: schema10.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
138697
138697
|
type: "TUPLE"
|
|
138698
138698
|
};
|
|
138699
|
-
if (
|
|
138699
|
+
if (schema10.additionalItems === true) {
|
|
138700
138700
|
arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
138701
|
-
} else if (
|
|
138702
|
-
arrayType.spreadParam = parse11(
|
|
138701
|
+
} else if (schema10.additionalItems) {
|
|
138702
|
+
arrayType.spreadParam = parse11(schema10.additionalItems, options8, undefined, processed, usedNames);
|
|
138703
138703
|
}
|
|
138704
138704
|
return arrayType;
|
|
138705
138705
|
} else {
|
|
138706
138706
|
return {
|
|
138707
|
-
comment:
|
|
138708
|
-
deprecated:
|
|
138707
|
+
comment: schema10.description,
|
|
138708
|
+
deprecated: schema10.deprecated,
|
|
138709
138709
|
keyName,
|
|
138710
|
-
standaloneName: standaloneName(
|
|
138711
|
-
params: parse11(
|
|
138710
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138711
|
+
params: parse11(schema10.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
|
|
138712
138712
|
type: "ARRAY"
|
|
138713
138713
|
};
|
|
138714
138714
|
}
|
|
138715
138715
|
case "UNION":
|
|
138716
138716
|
return {
|
|
138717
|
-
comment:
|
|
138718
|
-
deprecated:
|
|
138717
|
+
comment: schema10.description,
|
|
138718
|
+
deprecated: schema10.deprecated,
|
|
138719
138719
|
keyName,
|
|
138720
|
-
standaloneName: standaloneName(
|
|
138721
|
-
params:
|
|
138722
|
-
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(
|
|
138720
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138721
|
+
params: schema10.type.map((type2) => {
|
|
138722
|
+
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema10, "$id", "description", "title")), { type: type2 });
|
|
138723
138723
|
(0, utils_1.maybeStripDefault)(member);
|
|
138724
138724
|
(0, applySchemaTyping_1.applySchemaTyping)(member);
|
|
138725
138725
|
return parse11(member, options8, undefined, processed, usedNames);
|
|
@@ -138728,80 +138728,80 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
138728
138728
|
};
|
|
138729
138729
|
case "UNNAMED_ENUM":
|
|
138730
138730
|
return {
|
|
138731
|
-
comment:
|
|
138732
|
-
deprecated:
|
|
138731
|
+
comment: schema10.description,
|
|
138732
|
+
deprecated: schema10.deprecated,
|
|
138733
138733
|
keyName,
|
|
138734
|
-
standaloneName: standaloneName(
|
|
138735
|
-
params:
|
|
138734
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138735
|
+
params: schema10.enum.map((_10) => parseLiteral(_10, undefined)),
|
|
138736
138736
|
type: "UNION"
|
|
138737
138737
|
};
|
|
138738
138738
|
case "UNNAMED_SCHEMA":
|
|
138739
|
-
return newInterface(
|
|
138739
|
+
return newInterface(schema10, options8, processed, usedNames, keyName, keyNameFromDefinition);
|
|
138740
138740
|
case "UNTYPED_ARRAY":
|
|
138741
|
-
const minItems =
|
|
138742
|
-
const maxItems = typeof
|
|
138741
|
+
const minItems = schema10.minItems;
|
|
138742
|
+
const maxItems = typeof schema10.maxItems === "number" ? schema10.maxItems : -1;
|
|
138743
138743
|
const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
138744
138744
|
if (minItems > 0 || maxItems >= 0) {
|
|
138745
138745
|
return {
|
|
138746
|
-
comment:
|
|
138747
|
-
deprecated:
|
|
138746
|
+
comment: schema10.description,
|
|
138747
|
+
deprecated: schema10.deprecated,
|
|
138748
138748
|
keyName,
|
|
138749
|
-
maxItems:
|
|
138749
|
+
maxItems: schema10.maxItems,
|
|
138750
138750
|
minItems,
|
|
138751
138751
|
params: Array(Math.max(maxItems, minItems) || 0).fill(params),
|
|
138752
138752
|
spreadParam: maxItems >= 0 ? undefined : params,
|
|
138753
|
-
standaloneName: standaloneName(
|
|
138753
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138754
138754
|
type: "TUPLE"
|
|
138755
138755
|
};
|
|
138756
138756
|
}
|
|
138757
138757
|
return {
|
|
138758
|
-
comment:
|
|
138759
|
-
deprecated:
|
|
138758
|
+
comment: schema10.description,
|
|
138759
|
+
deprecated: schema10.deprecated,
|
|
138760
138760
|
keyName,
|
|
138761
138761
|
params,
|
|
138762
|
-
standaloneName: standaloneName(
|
|
138762
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
138763
138763
|
type: "ARRAY"
|
|
138764
138764
|
};
|
|
138765
138765
|
}
|
|
138766
138766
|
}
|
|
138767
|
-
function standaloneName(
|
|
138767
|
+
function standaloneName(schema10, keyNameFromDefinition, usedNames, options8) {
|
|
138768
138768
|
var _a7;
|
|
138769
|
-
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8,
|
|
138769
|
+
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema10, keyNameFromDefinition)) || schema10.title || schema10.$id || keyNameFromDefinition;
|
|
138770
138770
|
if (name2) {
|
|
138771
138771
|
return (0, utils_1.generateName)(name2, usedNames);
|
|
138772
138772
|
}
|
|
138773
138773
|
}
|
|
138774
|
-
function newInterface(
|
|
138775
|
-
const name2 = standaloneName(
|
|
138774
|
+
function newInterface(schema10, options8, processed, usedNames, keyName, keyNameFromDefinition) {
|
|
138775
|
+
const name2 = standaloneName(schema10, keyNameFromDefinition, usedNames, options8);
|
|
138776
138776
|
return {
|
|
138777
|
-
comment:
|
|
138778
|
-
deprecated:
|
|
138777
|
+
comment: schema10.description,
|
|
138778
|
+
deprecated: schema10.deprecated,
|
|
138779
138779
|
keyName,
|
|
138780
|
-
params: parseSchema(
|
|
138780
|
+
params: parseSchema(schema10, options8, processed, usedNames, name2),
|
|
138781
138781
|
standaloneName: name2,
|
|
138782
|
-
superTypes: parseSuperTypes(
|
|
138782
|
+
superTypes: parseSuperTypes(schema10, options8, processed, usedNames),
|
|
138783
138783
|
type: "INTERFACE"
|
|
138784
138784
|
};
|
|
138785
138785
|
}
|
|
138786
|
-
function parseSuperTypes(
|
|
138787
|
-
const superTypes =
|
|
138786
|
+
function parseSuperTypes(schema10, options8, processed, usedNames) {
|
|
138787
|
+
const superTypes = schema10.extends;
|
|
138788
138788
|
if (!superTypes) {
|
|
138789
138789
|
return [];
|
|
138790
138790
|
}
|
|
138791
138791
|
return superTypes.map((_10) => parse11(_10, options8, undefined, processed, usedNames));
|
|
138792
138792
|
}
|
|
138793
|
-
function parseSchema(
|
|
138794
|
-
let asts = (0, lodash_1.map)(
|
|
138793
|
+
function parseSchema(schema10, options8, processed, usedNames, parentSchemaName) {
|
|
138794
|
+
let asts = (0, lodash_1.map)(schema10.properties, (value, key2) => ({
|
|
138795
138795
|
ast: parse11(value, options8, key2, processed, usedNames),
|
|
138796
138796
|
isPatternProperty: false,
|
|
138797
|
-
isRequired: (0, lodash_1.includes)(
|
|
138797
|
+
isRequired: (0, lodash_1.includes)(schema10.required || [], key2),
|
|
138798
138798
|
isUnreachableDefinition: false,
|
|
138799
138799
|
keyName: key2
|
|
138800
138800
|
}));
|
|
138801
138801
|
let singlePatternProperty = false;
|
|
138802
|
-
if (
|
|
138803
|
-
singlePatternProperty = !
|
|
138804
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
138802
|
+
if (schema10.patternProperties) {
|
|
138803
|
+
singlePatternProperty = !schema10.additionalProperties && Object.keys(schema10.patternProperties).length === 1;
|
|
138804
|
+
asts = asts.concat((0, lodash_1.map)(schema10.patternProperties, (value, key2) => {
|
|
138805
138805
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
138806
138806
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
|
|
138807
138807
|
via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
|
|
@@ -138811,14 +138811,14 @@ ${comment}` : comment;
|
|
|
138811
138811
|
return {
|
|
138812
138812
|
ast,
|
|
138813
138813
|
isPatternProperty: !singlePatternProperty,
|
|
138814
|
-
isRequired: singlePatternProperty || (0, lodash_1.includes)(
|
|
138814
|
+
isRequired: singlePatternProperty || (0, lodash_1.includes)(schema10.required || [], key2),
|
|
138815
138815
|
isUnreachableDefinition: false,
|
|
138816
138816
|
keyName: singlePatternProperty ? "[k: string]" : key2
|
|
138817
138817
|
};
|
|
138818
138818
|
}));
|
|
138819
138819
|
}
|
|
138820
138820
|
if (options8.unreachableDefinitions) {
|
|
138821
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
138821
|
+
asts = asts.concat((0, lodash_1.map)(schema10.$defs, (value, key2) => {
|
|
138822
138822
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
138823
138823
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
|
|
138824
138824
|
via the \`definition\` "${key2}".`;
|
|
@@ -138828,13 +138828,13 @@ ${comment}` : comment;
|
|
|
138828
138828
|
return {
|
|
138829
138829
|
ast,
|
|
138830
138830
|
isPatternProperty: false,
|
|
138831
|
-
isRequired: (0, lodash_1.includes)(
|
|
138831
|
+
isRequired: (0, lodash_1.includes)(schema10.required || [], key2),
|
|
138832
138832
|
isUnreachableDefinition: true,
|
|
138833
138833
|
keyName: key2
|
|
138834
138834
|
};
|
|
138835
138835
|
}));
|
|
138836
138836
|
}
|
|
138837
|
-
switch (
|
|
138837
|
+
switch (schema10.additionalProperties) {
|
|
138838
138838
|
case undefined:
|
|
138839
138839
|
case true:
|
|
138840
138840
|
if (singlePatternProperty) {
|
|
@@ -138851,7 +138851,7 @@ ${comment}` : comment;
|
|
|
138851
138851
|
return asts;
|
|
138852
138852
|
default:
|
|
138853
138853
|
return asts.concat({
|
|
138854
|
-
ast: parse11(
|
|
138854
|
+
ast: parse11(schema10.additionalProperties, options8, "[k: string]", processed, usedNames),
|
|
138855
138855
|
isPatternProperty: false,
|
|
138856
138856
|
isRequired: true,
|
|
138857
138857
|
isUnreachableDefinition: false,
|
|
@@ -138859,22 +138859,22 @@ ${comment}` : comment;
|
|
|
138859
138859
|
});
|
|
138860
138860
|
}
|
|
138861
138861
|
}
|
|
138862
|
-
function getDefinitions(
|
|
138863
|
-
if (processed.has(
|
|
138862
|
+
function getDefinitions(schema10, isSchema = true, processed = new Set) {
|
|
138863
|
+
if (processed.has(schema10)) {
|
|
138864
138864
|
return {};
|
|
138865
138865
|
}
|
|
138866
|
-
processed.add(
|
|
138867
|
-
if (Array.isArray(
|
|
138868
|
-
return
|
|
138866
|
+
processed.add(schema10);
|
|
138867
|
+
if (Array.isArray(schema10)) {
|
|
138868
|
+
return schema10.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
|
|
138869
138869
|
}
|
|
138870
|
-
if ((0, lodash_1.isPlainObject)(
|
|
138871
|
-
return Object.assign(Object.assign({}, isSchema && hasDefinitions(
|
|
138870
|
+
if ((0, lodash_1.isPlainObject)(schema10)) {
|
|
138871
|
+
return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema10) ? schema10.$defs : {}), Object.keys(schema10).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema10[cur], false, processed)), {}));
|
|
138872
138872
|
}
|
|
138873
138873
|
return {};
|
|
138874
138874
|
}
|
|
138875
138875
|
var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
|
|
138876
|
-
function hasDefinitions(
|
|
138877
|
-
return "$defs" in
|
|
138876
|
+
function hasDefinitions(schema10) {
|
|
138877
|
+
return "$defs" in schema10;
|
|
138878
138878
|
}
|
|
138879
138879
|
});
|
|
138880
138880
|
|
|
@@ -140698,7 +140698,7 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
140698
140698
|
var options_js_1 = require_options();
|
|
140699
140699
|
function normalizeArgs(_args) {
|
|
140700
140700
|
let path18;
|
|
140701
|
-
let
|
|
140701
|
+
let schema10;
|
|
140702
140702
|
let options8;
|
|
140703
140703
|
let callback;
|
|
140704
140704
|
const args = Array.prototype.slice.call(_args);
|
|
@@ -140708,15 +140708,15 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
140708
140708
|
if (typeof args[0] === "string") {
|
|
140709
140709
|
path18 = args[0];
|
|
140710
140710
|
if (typeof args[2] === "object") {
|
|
140711
|
-
|
|
140711
|
+
schema10 = args[1];
|
|
140712
140712
|
options8 = args[2];
|
|
140713
140713
|
} else {
|
|
140714
|
-
|
|
140714
|
+
schema10 = undefined;
|
|
140715
140715
|
options8 = args[1];
|
|
140716
140716
|
}
|
|
140717
140717
|
} else {
|
|
140718
140718
|
path18 = "";
|
|
140719
|
-
|
|
140719
|
+
schema10 = args[0];
|
|
140720
140720
|
options8 = args[1];
|
|
140721
140721
|
}
|
|
140722
140722
|
try {
|
|
@@ -140724,12 +140724,12 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
140724
140724
|
} catch (e8) {
|
|
140725
140725
|
console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
|
|
140726
140726
|
}
|
|
140727
|
-
if (!options8.mutateInputSchema && typeof
|
|
140728
|
-
|
|
140727
|
+
if (!options8.mutateInputSchema && typeof schema10 === "object") {
|
|
140728
|
+
schema10 = JSON.parse(JSON.stringify(schema10));
|
|
140729
140729
|
}
|
|
140730
140730
|
return {
|
|
140731
140731
|
path: path18,
|
|
140732
|
-
schema:
|
|
140732
|
+
schema: schema10,
|
|
140733
140733
|
options: options8,
|
|
140734
140734
|
callback
|
|
140735
140735
|
};
|
|
@@ -141518,12 +141518,12 @@ var require_resolver = __commonJS((exports) => {
|
|
|
141518
141518
|
var json_schema_ref_parser_1 = require_lib3();
|
|
141519
141519
|
var utils_1 = require_utils7();
|
|
141520
141520
|
function dereference(schema_1, _a7) {
|
|
141521
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
141522
|
-
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd,
|
|
141521
|
+
return __awaiter(this, arguments, undefined, function* (schema10, { cwd, $refOptions }) {
|
|
141522
|
+
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema10);
|
|
141523
141523
|
const parser2 = new json_schema_ref_parser_1.$RefParser;
|
|
141524
141524
|
const dereferencedPaths = new WeakMap;
|
|
141525
|
-
const dereferencedSchema = yield parser2.dereference(cwd,
|
|
141526
|
-
dereferencedPaths.set(
|
|
141525
|
+
const dereferencedSchema = yield parser2.dereference(cwd, schema10, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema11) {
|
|
141526
|
+
dereferencedPaths.set(schema11, $ref);
|
|
141527
141527
|
} }) }));
|
|
141528
141528
|
return { dereferencedPaths, dereferencedSchema };
|
|
141529
141529
|
});
|
|
@@ -141537,46 +141537,46 @@ var require_validator = __commonJS((exports) => {
|
|
|
141537
141537
|
exports.validate = undefined;
|
|
141538
141538
|
var utils_1 = require_utils7();
|
|
141539
141539
|
var rules = new Map;
|
|
141540
|
-
rules.set("Enum members and tsEnumNames must be of the same length", (
|
|
141541
|
-
if (
|
|
141540
|
+
rules.set("Enum members and tsEnumNames must be of the same length", (schema10) => {
|
|
141541
|
+
if (schema10.enum && schema10.tsEnumNames && schema10.enum.length !== schema10.tsEnumNames.length) {
|
|
141542
141542
|
return false;
|
|
141543
141543
|
}
|
|
141544
141544
|
});
|
|
141545
|
-
rules.set("tsEnumNames must be an array of strings", (
|
|
141546
|
-
if (
|
|
141545
|
+
rules.set("tsEnumNames must be an array of strings", (schema10) => {
|
|
141546
|
+
if (schema10.tsEnumNames && schema10.tsEnumNames.some((_10) => typeof _10 !== "string")) {
|
|
141547
141547
|
return false;
|
|
141548
141548
|
}
|
|
141549
141549
|
});
|
|
141550
|
-
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (
|
|
141551
|
-
const { maxItems, minItems } =
|
|
141550
|
+
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema10) => {
|
|
141551
|
+
const { maxItems, minItems } = schema10;
|
|
141552
141552
|
if (typeof maxItems === "number" && typeof minItems === "number") {
|
|
141553
141553
|
return maxItems >= minItems;
|
|
141554
141554
|
}
|
|
141555
141555
|
});
|
|
141556
|
-
rules.set("When maxItems exists, maxItems >= 0", (
|
|
141557
|
-
const { maxItems } =
|
|
141556
|
+
rules.set("When maxItems exists, maxItems >= 0", (schema10) => {
|
|
141557
|
+
const { maxItems } = schema10;
|
|
141558
141558
|
if (typeof maxItems === "number") {
|
|
141559
141559
|
return maxItems >= 0;
|
|
141560
141560
|
}
|
|
141561
141561
|
});
|
|
141562
|
-
rules.set("When minItems exists, minItems >= 0", (
|
|
141563
|
-
const { minItems } =
|
|
141562
|
+
rules.set("When minItems exists, minItems >= 0", (schema10) => {
|
|
141563
|
+
const { minItems } = schema10;
|
|
141564
141564
|
if (typeof minItems === "number") {
|
|
141565
141565
|
return minItems >= 0;
|
|
141566
141566
|
}
|
|
141567
141567
|
});
|
|
141568
|
-
rules.set("deprecated must be a boolean", (
|
|
141569
|
-
const typeOfDeprecated = typeof
|
|
141568
|
+
rules.set("deprecated must be a boolean", (schema10) => {
|
|
141569
|
+
const typeOfDeprecated = typeof schema10.deprecated;
|
|
141570
141570
|
return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
|
|
141571
141571
|
});
|
|
141572
|
-
function validate2(
|
|
141572
|
+
function validate2(schema10, filename) {
|
|
141573
141573
|
const errors5 = [];
|
|
141574
141574
|
rules.forEach((rule, ruleName) => {
|
|
141575
|
-
(0, utils_1.traverse)(
|
|
141576
|
-
if (rule(
|
|
141575
|
+
(0, utils_1.traverse)(schema10, (schema11, key2) => {
|
|
141576
|
+
if (rule(schema11) === false) {
|
|
141577
141577
|
errors5.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
|
|
141578
141578
|
}
|
|
141579
|
-
return
|
|
141579
|
+
return schema11;
|
|
141580
141580
|
});
|
|
141581
141581
|
});
|
|
141582
141582
|
return errors5;
|
|
@@ -141590,25 +141590,25 @@ var require_linker = __commonJS((exports) => {
|
|
|
141590
141590
|
exports.link = undefined;
|
|
141591
141591
|
var JSONSchema_1 = require_JSONSchema();
|
|
141592
141592
|
var lodash_1 = require_lodash();
|
|
141593
|
-
function link2(
|
|
141594
|
-
if (!Array.isArray(
|
|
141595
|
-
return
|
|
141593
|
+
function link2(schema10, parent = null) {
|
|
141594
|
+
if (!Array.isArray(schema10) && !(0, lodash_1.isPlainObject)(schema10)) {
|
|
141595
|
+
return schema10;
|
|
141596
141596
|
}
|
|
141597
|
-
if (
|
|
141598
|
-
return
|
|
141597
|
+
if (schema10.hasOwnProperty(JSONSchema_1.Parent)) {
|
|
141598
|
+
return schema10;
|
|
141599
141599
|
}
|
|
141600
|
-
Object.defineProperty(
|
|
141600
|
+
Object.defineProperty(schema10, JSONSchema_1.Parent, {
|
|
141601
141601
|
enumerable: false,
|
|
141602
141602
|
value: parent,
|
|
141603
141603
|
writable: false
|
|
141604
141604
|
});
|
|
141605
|
-
if (Array.isArray(
|
|
141606
|
-
|
|
141605
|
+
if (Array.isArray(schema10)) {
|
|
141606
|
+
schema10.forEach((child) => link2(child, schema10));
|
|
141607
141607
|
}
|
|
141608
|
-
for (const key2 in
|
|
141609
|
-
link2(
|
|
141608
|
+
for (const key2 in schema10) {
|
|
141609
|
+
link2(schema10[key2], schema10);
|
|
141610
141610
|
}
|
|
141611
|
-
return
|
|
141611
|
+
return schema10;
|
|
141612
141612
|
}
|
|
141613
141613
|
exports.link = link2;
|
|
141614
141614
|
});
|
|
@@ -141700,8 +141700,8 @@ var require_src3 = __commonJS((exports) => {
|
|
|
141700
141700
|
unknownAny: true
|
|
141701
141701
|
};
|
|
141702
141702
|
function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
|
|
141703
|
-
const
|
|
141704
|
-
return compile(
|
|
141703
|
+
const schema10 = parseAsJSONSchema(filename);
|
|
141704
|
+
return compile(schema10, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
|
|
141705
141705
|
}
|
|
141706
141706
|
exports.compileFromFile = compileFromFile;
|
|
141707
141707
|
function parseAsJSONSchema(filename) {
|
|
@@ -141711,7 +141711,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
141711
141711
|
return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
|
|
141712
141712
|
}
|
|
141713
141713
|
function compile(schema_1, name_1) {
|
|
141714
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
141714
|
+
return __awaiter(this, arguments, undefined, function* (schema10, name2, options8 = {}) {
|
|
141715
141715
|
(0, optionValidator_1.validateOptions)(options8);
|
|
141716
141716
|
const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
|
|
141717
141717
|
const start = Date.now();
|
|
@@ -141721,7 +141721,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
141721
141721
|
if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
|
|
141722
141722
|
_options.cwd += "/";
|
|
141723
141723
|
}
|
|
141724
|
-
const _schema = (0, lodash_1.cloneDeep)(
|
|
141724
|
+
const _schema = (0, lodash_1.cloneDeep)(schema10);
|
|
141725
141725
|
const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
|
|
141726
141726
|
if (process.env.VERBOSE) {
|
|
141727
141727
|
if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
|
|
@@ -159447,9 +159447,9 @@ var require_stringify5 = __commonJS((exports, module) => {
|
|
|
159447
159447
|
}
|
|
159448
159448
|
};
|
|
159449
159449
|
var isArray = Array.isArray;
|
|
159450
|
-
var
|
|
159450
|
+
var push5 = Array.prototype.push;
|
|
159451
159451
|
var pushToArray = function(arr, valueOrArray) {
|
|
159452
|
-
|
|
159452
|
+
push5.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
159453
159453
|
};
|
|
159454
159454
|
var toISO = Date.prototype.toISOString;
|
|
159455
159455
|
var defaultFormat = formats["default"];
|
|
@@ -160399,10 +160399,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160399
160399
|
var debug = require_src4()("express:view");
|
|
160400
160400
|
var path18 = __require("node:path");
|
|
160401
160401
|
var fs28 = __require("node:fs");
|
|
160402
|
-
var
|
|
160402
|
+
var dirname14 = path18.dirname;
|
|
160403
160403
|
var basename4 = path18.basename;
|
|
160404
160404
|
var extname2 = path18.extname;
|
|
160405
|
-
var
|
|
160405
|
+
var join21 = path18.join;
|
|
160406
160406
|
var resolve6 = path18.resolve;
|
|
160407
160407
|
module.exports = View;
|
|
160408
160408
|
function View(name2, options8) {
|
|
@@ -160438,7 +160438,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160438
160438
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
160439
160439
|
var root2 = roots[i5];
|
|
160440
160440
|
var loc = resolve6(root2, name2);
|
|
160441
|
-
var dir =
|
|
160441
|
+
var dir = dirname14(loc);
|
|
160442
160442
|
var file2 = basename4(loc);
|
|
160443
160443
|
path19 = this.resolve(dir, file2);
|
|
160444
160444
|
}
|
|
@@ -160464,12 +160464,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160464
160464
|
};
|
|
160465
160465
|
View.prototype.resolve = function resolve7(dir, file2) {
|
|
160466
160466
|
var ext = this.ext;
|
|
160467
|
-
var path19 =
|
|
160467
|
+
var path19 = join21(dir, file2);
|
|
160468
160468
|
var stat2 = tryStat(path19);
|
|
160469
160469
|
if (stat2 && stat2.isFile()) {
|
|
160470
160470
|
return path19;
|
|
160471
160471
|
}
|
|
160472
|
-
path19 =
|
|
160472
|
+
path19 = join21(dir, basename4(file2, ext), "index" + ext);
|
|
160473
160473
|
stat2 = tryStat(path19);
|
|
160474
160474
|
if (stat2 && stat2.isFile()) {
|
|
160475
160475
|
return path19;
|
|
@@ -164164,7 +164164,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164164
164164
|
var Stream2 = __require("stream");
|
|
164165
164165
|
var util2 = __require("util");
|
|
164166
164166
|
var extname2 = path18.extname;
|
|
164167
|
-
var
|
|
164167
|
+
var join21 = path18.join;
|
|
164168
164168
|
var normalize = path18.normalize;
|
|
164169
164169
|
var resolve6 = path18.resolve;
|
|
164170
164170
|
var sep = path18.sep;
|
|
@@ -164336,7 +164336,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164336
164336
|
return res;
|
|
164337
164337
|
}
|
|
164338
164338
|
parts = path19.split(sep);
|
|
164339
|
-
path19 = normalize(
|
|
164339
|
+
path19 = normalize(join21(root2, path19));
|
|
164340
164340
|
} else {
|
|
164341
164341
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
164342
164342
|
debug('malicious path "%s"', path19);
|
|
@@ -164476,7 +164476,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164476
164476
|
return self2.onStatError(err);
|
|
164477
164477
|
return self2.error(404);
|
|
164478
164478
|
}
|
|
164479
|
-
var p4 =
|
|
164479
|
+
var p4 = join21(path19, self2._index[i5]);
|
|
164480
164480
|
debug('stat "%s"', p4);
|
|
164481
164481
|
fs28.stat(p4, function(err2, stat2) {
|
|
164482
164482
|
if (err2)
|
|
@@ -165574,18 +165574,18 @@ var require_common7 = __commonJS((exports) => {
|
|
|
165574
165574
|
retSegs.push.apply(retSegs, lastSegs);
|
|
165575
165575
|
return retSegs.join("?");
|
|
165576
165576
|
};
|
|
165577
|
-
common2.rewriteCookieProperty = function rewriteCookieProperty(header2,
|
|
165577
|
+
common2.rewriteCookieProperty = function rewriteCookieProperty(header2, config11, property) {
|
|
165578
165578
|
if (Array.isArray(header2)) {
|
|
165579
165579
|
return header2.map(function(headerElement) {
|
|
165580
|
-
return rewriteCookieProperty(headerElement,
|
|
165580
|
+
return rewriteCookieProperty(headerElement, config11, property);
|
|
165581
165581
|
});
|
|
165582
165582
|
}
|
|
165583
165583
|
return header2.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), function(match, prefix, previousValue) {
|
|
165584
165584
|
var newValue;
|
|
165585
|
-
if (previousValue in
|
|
165586
|
-
newValue =
|
|
165587
|
-
} else if ("*" in
|
|
165588
|
-
newValue =
|
|
165585
|
+
if (previousValue in config11) {
|
|
165586
|
+
newValue = config11[previousValue];
|
|
165587
|
+
} else if ("*" in config11) {
|
|
165588
|
+
newValue = config11["*"];
|
|
165589
165589
|
} else {
|
|
165590
165590
|
return match;
|
|
165591
165591
|
}
|
|
@@ -166950,9 +166950,9 @@ var require_router2 = __commonJS((exports) => {
|
|
|
166950
166950
|
var is_plain_object_1 = require_is_plain_object();
|
|
166951
166951
|
var debug_1 = require_debug3();
|
|
166952
166952
|
var debug = debug_1.Debug.extend("router");
|
|
166953
|
-
async function getTarget(req,
|
|
166953
|
+
async function getTarget(req, config11) {
|
|
166954
166954
|
let newTarget;
|
|
166955
|
-
const router =
|
|
166955
|
+
const router = config11.router;
|
|
166956
166956
|
if ((0, is_plain_object_1.isPlainObject)(router)) {
|
|
166957
166957
|
newTarget = getTargetFromProxyTable(req, router);
|
|
166958
166958
|
} else if (typeof router === "function") {
|
|
@@ -191776,7 +191776,7 @@ var require_event_target = __commonJS((exports, module) => {
|
|
|
191776
191776
|
// ../../node_modules/ws/lib/extension.js
|
|
191777
191777
|
var require_extension = __commonJS((exports, module) => {
|
|
191778
191778
|
var { tokenChars } = require_validation();
|
|
191779
|
-
function
|
|
191779
|
+
function push5(dest, name2, elem) {
|
|
191780
191780
|
if (dest[name2] === undefined)
|
|
191781
191781
|
dest[name2] = [elem];
|
|
191782
191782
|
else
|
|
@@ -191811,7 +191811,7 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
191811
191811
|
end = i5;
|
|
191812
191812
|
const name2 = header2.slice(start, end);
|
|
191813
191813
|
if (code2 === 44) {
|
|
191814
|
-
|
|
191814
|
+
push5(offers, name2, params);
|
|
191815
191815
|
params = Object.create(null);
|
|
191816
191816
|
} else {
|
|
191817
191817
|
extensionName = name2;
|
|
@@ -191833,9 +191833,9 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
191833
191833
|
}
|
|
191834
191834
|
if (end === -1)
|
|
191835
191835
|
end = i5;
|
|
191836
|
-
|
|
191836
|
+
push5(params, header2.slice(start, end), true);
|
|
191837
191837
|
if (code2 === 44) {
|
|
191838
|
-
|
|
191838
|
+
push5(offers, extensionName, params);
|
|
191839
191839
|
params = Object.create(null);
|
|
191840
191840
|
extensionName = undefined;
|
|
191841
191841
|
}
|
|
@@ -191887,9 +191887,9 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
191887
191887
|
value = value.replace(/\\/g, "");
|
|
191888
191888
|
mustUnescape = false;
|
|
191889
191889
|
}
|
|
191890
|
-
|
|
191890
|
+
push5(params, paramName, value);
|
|
191891
191891
|
if (code2 === 44) {
|
|
191892
|
-
|
|
191892
|
+
push5(offers, extensionName, params);
|
|
191893
191893
|
params = Object.create(null);
|
|
191894
191894
|
extensionName = undefined;
|
|
191895
191895
|
}
|
|
@@ -191907,16 +191907,16 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
191907
191907
|
end = i5;
|
|
191908
191908
|
const token2 = header2.slice(start, end);
|
|
191909
191909
|
if (extensionName === undefined) {
|
|
191910
|
-
|
|
191910
|
+
push5(offers, token2, params);
|
|
191911
191911
|
} else {
|
|
191912
191912
|
if (paramName === undefined) {
|
|
191913
|
-
|
|
191913
|
+
push5(params, token2, true);
|
|
191914
191914
|
} else if (mustUnescape) {
|
|
191915
|
-
|
|
191915
|
+
push5(params, paramName, token2.replace(/\\/g, ""));
|
|
191916
191916
|
} else {
|
|
191917
|
-
|
|
191917
|
+
push5(params, paramName, token2);
|
|
191918
191918
|
}
|
|
191919
|
-
|
|
191919
|
+
push5(offers, extensionName, params);
|
|
191920
191920
|
}
|
|
191921
191921
|
return offers;
|
|
191922
191922
|
}
|
|
@@ -201140,12 +201140,12 @@ var require_sign2 = __commonJS((exports, module) => {
|
|
|
201140
201140
|
exp: { isValid: isNumber, message: '"exp" should be a number of seconds' },
|
|
201141
201141
|
nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' }
|
|
201142
201142
|
};
|
|
201143
|
-
function validate2(
|
|
201143
|
+
function validate2(schema10, allowUnknown, object2, parameterName) {
|
|
201144
201144
|
if (!isPlainObject3(object2)) {
|
|
201145
201145
|
throw new Error('Expected "' + parameterName + '" to be a plain object.');
|
|
201146
201146
|
}
|
|
201147
201147
|
Object.keys(object2).forEach(function(key2) {
|
|
201148
|
-
const validator =
|
|
201148
|
+
const validator = schema10[key2];
|
|
201149
201149
|
if (!validator) {
|
|
201150
201150
|
if (!allowUnknown) {
|
|
201151
201151
|
throw new Error('"' + key2 + '" is not allowed in "' + parameterName + '"');
|
|
@@ -214571,7 +214571,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
214571
214571
|
}
|
|
214572
214572
|
_createClass(BufferList, [{
|
|
214573
214573
|
key: "push",
|
|
214574
|
-
value: function
|
|
214574
|
+
value: function push5(v10) {
|
|
214575
214575
|
var entry = {
|
|
214576
214576
|
data: v10,
|
|
214577
214577
|
next: null
|
|
@@ -214616,7 +214616,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
214616
214616
|
}
|
|
214617
214617
|
}, {
|
|
214618
214618
|
key: "join",
|
|
214619
|
-
value: function
|
|
214619
|
+
value: function join21(s5) {
|
|
214620
214620
|
if (this.length === 0)
|
|
214621
214621
|
return "";
|
|
214622
214622
|
var p4 = this.head;
|
|
@@ -218270,7 +218270,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
218270
218270
|
});
|
|
218271
218271
|
|
|
218272
218272
|
// src/cli/index.ts
|
|
218273
|
-
import { dirname as
|
|
218273
|
+
import { dirname as dirname18, join as join24 } from "node:path";
|
|
218274
218274
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
218275
218275
|
|
|
218276
218276
|
// ../../node_modules/commander/esm.mjs
|
|
@@ -218290,7 +218290,7 @@ var {
|
|
|
218290
218290
|
} = import__.default;
|
|
218291
218291
|
|
|
218292
218292
|
// src/cli/commands/agents/pull.ts
|
|
218293
|
-
import { dirname as dirname7, join as
|
|
218293
|
+
import { dirname as dirname7, join as join12 } from "node:path";
|
|
218294
218294
|
|
|
218295
218295
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
218296
218296
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -234527,7 +234527,8 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
234527
234527
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
234528
234528
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
234529
234529
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
234530
|
-
connectorsDir: exports_external.string().optional().default("connectors")
|
|
234530
|
+
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
234531
|
+
authDir: exports_external.string().optional().default("auth")
|
|
234531
234532
|
});
|
|
234532
234533
|
var AppConfigSchema = exports_external.object({
|
|
234533
234534
|
id: exports_external.string().min(1, "id cannot be empty")
|
|
@@ -241459,7 +241460,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
241459
241460
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
241460
241461
|
|
|
241461
241462
|
// src/core/project/config.ts
|
|
241462
|
-
import { dirname as dirname5, join as
|
|
241463
|
+
import { dirname as dirname5, join as join8 } from "node:path";
|
|
241463
241464
|
|
|
241464
241465
|
// src/core/resources/agent/schema.ts
|
|
241465
241466
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -241622,6 +241623,151 @@ var agentResource = {
|
|
|
241622
241623
|
readAll: readAllAgents,
|
|
241623
241624
|
push: pushAgents
|
|
241624
241625
|
};
|
|
241626
|
+
// src/core/resources/auth-config/schema.ts
|
|
241627
|
+
var GoogleOAuthMode = exports_external.enum(["default", "custom"]);
|
|
241628
|
+
var AuthConfigSchema = exports_external.object({
|
|
241629
|
+
enable_username_password: exports_external.boolean(),
|
|
241630
|
+
enable_google_login: exports_external.boolean(),
|
|
241631
|
+
enable_microsoft_login: exports_external.boolean(),
|
|
241632
|
+
enable_facebook_login: exports_external.boolean(),
|
|
241633
|
+
enable_apple_login: exports_external.boolean(),
|
|
241634
|
+
sso_provider_name: exports_external.string().nullable(),
|
|
241635
|
+
enable_sso_login: exports_external.boolean(),
|
|
241636
|
+
google_oauth_mode: GoogleOAuthMode,
|
|
241637
|
+
google_oauth_client_id: exports_external.string().nullable(),
|
|
241638
|
+
use_workspace_sso: exports_external.boolean()
|
|
241639
|
+
}).transform((data) => ({
|
|
241640
|
+
enableUsernamePassword: data.enable_username_password,
|
|
241641
|
+
enableGoogleLogin: data.enable_google_login,
|
|
241642
|
+
enableMicrosoftLogin: data.enable_microsoft_login,
|
|
241643
|
+
enableFacebookLogin: data.enable_facebook_login,
|
|
241644
|
+
enableAppleLogin: data.enable_apple_login,
|
|
241645
|
+
ssoProviderName: data.sso_provider_name,
|
|
241646
|
+
enableSSOLogin: data.enable_sso_login,
|
|
241647
|
+
googleOAuthMode: data.google_oauth_mode,
|
|
241648
|
+
googleOAuthClientId: data.google_oauth_client_id,
|
|
241649
|
+
useWorkspaceSSO: data.use_workspace_sso
|
|
241650
|
+
}));
|
|
241651
|
+
var AuthConfigFileSchema = exports_external.object({
|
|
241652
|
+
enableUsernamePassword: exports_external.boolean(),
|
|
241653
|
+
enableGoogleLogin: exports_external.boolean(),
|
|
241654
|
+
enableMicrosoftLogin: exports_external.boolean(),
|
|
241655
|
+
enableFacebookLogin: exports_external.boolean(),
|
|
241656
|
+
enableAppleLogin: exports_external.boolean(),
|
|
241657
|
+
ssoProviderName: exports_external.string().nullable(),
|
|
241658
|
+
enableSSOLogin: exports_external.boolean(),
|
|
241659
|
+
googleOAuthMode: GoogleOAuthMode,
|
|
241660
|
+
googleOAuthClientId: exports_external.string().nullable(),
|
|
241661
|
+
useWorkspaceSSO: exports_external.boolean()
|
|
241662
|
+
});
|
|
241663
|
+
var AppAuthConfigResponseSchema = exports_external.object({
|
|
241664
|
+
auth_config: AuthConfigSchema
|
|
241665
|
+
}).transform((data) => ({
|
|
241666
|
+
authConfig: data.auth_config
|
|
241667
|
+
}));
|
|
241668
|
+
function hasAnyLoginMethod(config3) {
|
|
241669
|
+
return config3.enableUsernamePassword || config3.enableGoogleLogin || config3.enableMicrosoftLogin || config3.enableFacebookLogin || config3.enableAppleLogin || config3.enableSSOLogin;
|
|
241670
|
+
}
|
|
241671
|
+
function toAuthConfigPayload(config3) {
|
|
241672
|
+
return {
|
|
241673
|
+
enable_username_password: config3.enableUsernamePassword,
|
|
241674
|
+
enable_google_login: config3.enableGoogleLogin,
|
|
241675
|
+
enable_microsoft_login: config3.enableMicrosoftLogin,
|
|
241676
|
+
enable_facebook_login: config3.enableFacebookLogin,
|
|
241677
|
+
enable_apple_login: config3.enableAppleLogin,
|
|
241678
|
+
sso_provider_name: config3.ssoProviderName,
|
|
241679
|
+
enable_sso_login: config3.enableSSOLogin,
|
|
241680
|
+
google_oauth_mode: config3.googleOAuthMode,
|
|
241681
|
+
google_oauth_client_id: config3.googleOAuthClientId,
|
|
241682
|
+
use_workspace_sso: config3.useWorkspaceSSO
|
|
241683
|
+
};
|
|
241684
|
+
}
|
|
241685
|
+
|
|
241686
|
+
// src/core/resources/auth-config/api.ts
|
|
241687
|
+
async function getAuthConfig() {
|
|
241688
|
+
const { id } = getAppConfig();
|
|
241689
|
+
let response;
|
|
241690
|
+
try {
|
|
241691
|
+
response = await base44Client.get(`api/apps/${id}`);
|
|
241692
|
+
} catch (error48) {
|
|
241693
|
+
throw await ApiError.fromHttpError(error48, "fetching auth config");
|
|
241694
|
+
}
|
|
241695
|
+
const result = AppAuthConfigResponseSchema.safeParse(await response.json());
|
|
241696
|
+
if (!result.success) {
|
|
241697
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
241698
|
+
}
|
|
241699
|
+
return result.data.authConfig;
|
|
241700
|
+
}
|
|
241701
|
+
async function pushAuthConfigToApi(config3) {
|
|
241702
|
+
const { id } = getAppConfig();
|
|
241703
|
+
let response;
|
|
241704
|
+
try {
|
|
241705
|
+
response = await base44Client.put(`api/apps/${id}`, {
|
|
241706
|
+
json: { auth_config: toAuthConfigPayload(config3) }
|
|
241707
|
+
});
|
|
241708
|
+
} catch (error48) {
|
|
241709
|
+
throw await ApiError.fromHttpError(error48, "updating auth config");
|
|
241710
|
+
}
|
|
241711
|
+
const result = AppAuthConfigResponseSchema.safeParse(await response.json());
|
|
241712
|
+
if (!result.success) {
|
|
241713
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
241714
|
+
}
|
|
241715
|
+
return result.data.authConfig;
|
|
241716
|
+
}
|
|
241717
|
+
// src/core/resources/auth-config/config.ts
|
|
241718
|
+
import { join as join4 } from "node:path";
|
|
241719
|
+
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
241720
|
+
var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
|
|
241721
|
+
var DEFAULT_AUTH_CONFIG = {
|
|
241722
|
+
enableUsernamePassword: false,
|
|
241723
|
+
enableGoogleLogin: false,
|
|
241724
|
+
enableMicrosoftLogin: false,
|
|
241725
|
+
enableFacebookLogin: false,
|
|
241726
|
+
enableAppleLogin: false,
|
|
241727
|
+
ssoProviderName: null,
|
|
241728
|
+
enableSSOLogin: false,
|
|
241729
|
+
googleOAuthMode: "default",
|
|
241730
|
+
googleOAuthClientId: null,
|
|
241731
|
+
useWorkspaceSSO: false
|
|
241732
|
+
};
|
|
241733
|
+
function getAuthConfigPath(authDir) {
|
|
241734
|
+
return join4(authDir, AUTH_CONFIG_FILENAME);
|
|
241735
|
+
}
|
|
241736
|
+
async function readAuthConfig(authDir) {
|
|
241737
|
+
const filePath = getAuthConfigPath(authDir);
|
|
241738
|
+
if (!await pathExists(filePath)) {
|
|
241739
|
+
return null;
|
|
241740
|
+
}
|
|
241741
|
+
const parsed = await readJsonFile(filePath);
|
|
241742
|
+
const result = AuthConfigFileSchema.safeParse(parsed);
|
|
241743
|
+
if (!result.success) {
|
|
241744
|
+
throw new SchemaValidationError("Invalid auth config file", result.error, filePath);
|
|
241745
|
+
}
|
|
241746
|
+
return result.data;
|
|
241747
|
+
}
|
|
241748
|
+
async function writeAuthConfig(authDir, config3) {
|
|
241749
|
+
const filePath = getAuthConfigPath(authDir);
|
|
241750
|
+
if (await pathExists(filePath)) {
|
|
241751
|
+
const existing = await readJsonFile(filePath);
|
|
241752
|
+
const existingResult = AuthConfigFileSchema.safeParse(existing);
|
|
241753
|
+
if (existingResult.success && isDeepStrictEqual2(existingResult.data, config3)) {
|
|
241754
|
+
return { written: false };
|
|
241755
|
+
}
|
|
241756
|
+
}
|
|
241757
|
+
await writeJsonFile(filePath, config3);
|
|
241758
|
+
return { written: true };
|
|
241759
|
+
}
|
|
241760
|
+
// src/core/resources/auth-config/pull.ts
|
|
241761
|
+
async function pullAuthConfig() {
|
|
241762
|
+
return await getAuthConfig();
|
|
241763
|
+
}
|
|
241764
|
+
// src/core/resources/auth-config/push.ts
|
|
241765
|
+
async function pushAuthConfig(config3) {
|
|
241766
|
+
if (!config3) {
|
|
241767
|
+
return;
|
|
241768
|
+
}
|
|
241769
|
+
await pushAuthConfigToApi(config3);
|
|
241770
|
+
}
|
|
241625
241771
|
// src/core/resources/connector/schema.ts
|
|
241626
241772
|
var GoogleCalendarConnectorSchema = exports_external.object({
|
|
241627
241773
|
type: exports_external.literal("googlecalendar"),
|
|
@@ -241949,8 +242095,8 @@ async function removeStripe() {
|
|
|
241949
242095
|
return result.data;
|
|
241950
242096
|
}
|
|
241951
242097
|
// src/core/resources/connector/config.ts
|
|
241952
|
-
import { join as
|
|
241953
|
-
import { isDeepStrictEqual as
|
|
242098
|
+
import { join as join5 } from "node:path";
|
|
242099
|
+
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
241954
242100
|
async function readConnectorFile(connectorPath) {
|
|
241955
242101
|
const parsed = await readJsonFile(connectorPath);
|
|
241956
242102
|
const result = ConnectorResourceSchema.safeParse(parsed);
|
|
@@ -242007,10 +242153,10 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
242007
242153
|
const written = [];
|
|
242008
242154
|
for (const connector of remoteConnectors) {
|
|
242009
242155
|
const existing = typeToEntry.get(connector.type);
|
|
242010
|
-
if (existing &&
|
|
242156
|
+
if (existing && isDeepStrictEqual3(existing.data, connector)) {
|
|
242011
242157
|
continue;
|
|
242012
242158
|
}
|
|
242013
|
-
const filePath = existing?.filePath ??
|
|
242159
|
+
const filePath = existing?.filePath ?? join5(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
242014
242160
|
await writeJsonFile(filePath, connector);
|
|
242015
242161
|
written.push(connector.type);
|
|
242016
242162
|
}
|
|
@@ -242494,7 +242640,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
242494
242640
|
return result.data;
|
|
242495
242641
|
}
|
|
242496
242642
|
// src/core/resources/function/config.ts
|
|
242497
|
-
import { basename as basename2, dirname as dirname3, join as
|
|
242643
|
+
import { basename as basename2, dirname as dirname3, join as join6, relative } from "node:path";
|
|
242498
242644
|
async function readFunctionConfig(configPath) {
|
|
242499
242645
|
const parsed = await readJsonFile(configPath);
|
|
242500
242646
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -242504,9 +242650,9 @@ async function readFunctionConfig(configPath) {
|
|
|
242504
242650
|
return result.data;
|
|
242505
242651
|
}
|
|
242506
242652
|
async function readFunction(configPath) {
|
|
242507
|
-
const
|
|
242653
|
+
const config6 = await readFunctionConfig(configPath);
|
|
242508
242654
|
const functionDir = dirname3(configPath);
|
|
242509
|
-
const entryPath =
|
|
242655
|
+
const entryPath = join6(functionDir, config6.entry);
|
|
242510
242656
|
if (!await pathExists(entryPath)) {
|
|
242511
242657
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
242512
242658
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -242516,7 +242662,7 @@ async function readFunction(configPath) {
|
|
|
242516
242662
|
cwd: functionDir,
|
|
242517
242663
|
absolute: true
|
|
242518
242664
|
});
|
|
242519
|
-
const functionData = { ...
|
|
242665
|
+
const functionData = { ...config6, entryPath, filePaths };
|
|
242520
242666
|
return functionData;
|
|
242521
242667
|
}
|
|
242522
242668
|
async function readAllFunctions(functionsDir) {
|
|
@@ -242640,28 +242786,28 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
242640
242786
|
return results;
|
|
242641
242787
|
}
|
|
242642
242788
|
// src/core/resources/function/pull.ts
|
|
242643
|
-
import { join as
|
|
242644
|
-
import { isDeepStrictEqual as
|
|
242789
|
+
import { join as join7 } from "node:path";
|
|
242790
|
+
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
242645
242791
|
async function writeFunctions(functionsDir, functions) {
|
|
242646
242792
|
const written = [];
|
|
242647
242793
|
const skipped = [];
|
|
242648
242794
|
for (const fn of functions) {
|
|
242649
|
-
const functionDir =
|
|
242650
|
-
const configPath =
|
|
242795
|
+
const functionDir = join7(functionsDir, fn.name);
|
|
242796
|
+
const configPath = join7(functionDir, "function.jsonc");
|
|
242651
242797
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
242652
242798
|
skipped.push(fn.name);
|
|
242653
242799
|
continue;
|
|
242654
242800
|
}
|
|
242655
|
-
const
|
|
242801
|
+
const config6 = {
|
|
242656
242802
|
name: fn.name,
|
|
242657
242803
|
entry: fn.entry
|
|
242658
242804
|
};
|
|
242659
242805
|
if (fn.automations.length > 0) {
|
|
242660
|
-
|
|
242806
|
+
config6.automations = fn.automations;
|
|
242661
242807
|
}
|
|
242662
|
-
await writeJsonFile(configPath,
|
|
242808
|
+
await writeJsonFile(configPath, config6);
|
|
242663
242809
|
for (const file2 of fn.files) {
|
|
242664
|
-
await writeFile(
|
|
242810
|
+
await writeFile(join7(functionDir, file2.path), file2.content);
|
|
242665
242811
|
}
|
|
242666
242812
|
written.push(fn.name);
|
|
242667
242813
|
}
|
|
@@ -242671,20 +242817,20 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
242671
242817
|
if (!await pathExists(functionDir)) {
|
|
242672
242818
|
return false;
|
|
242673
242819
|
}
|
|
242674
|
-
const configPath =
|
|
242820
|
+
const configPath = join7(functionDir, "function.jsonc");
|
|
242675
242821
|
try {
|
|
242676
242822
|
const localConfig = await readJsonFile(configPath);
|
|
242677
242823
|
if (localConfig.entry !== fn.entry) {
|
|
242678
242824
|
return false;
|
|
242679
242825
|
}
|
|
242680
|
-
if (!
|
|
242826
|
+
if (!isDeepStrictEqual4(localConfig.automations ?? [], fn.automations)) {
|
|
242681
242827
|
return false;
|
|
242682
242828
|
}
|
|
242683
242829
|
} catch {
|
|
242684
242830
|
return false;
|
|
242685
242831
|
}
|
|
242686
242832
|
for (const file2 of fn.files) {
|
|
242687
|
-
const filePath =
|
|
242833
|
+
const filePath = join7(functionDir, file2.path);
|
|
242688
242834
|
if (!await pathExists(filePath)) {
|
|
242689
242835
|
return false;
|
|
242690
242836
|
}
|
|
@@ -242742,18 +242888,20 @@ async function readProjectConfig(projectRoot) {
|
|
|
242742
242888
|
}
|
|
242743
242889
|
const project = result.data;
|
|
242744
242890
|
const configDir = dirname5(configPath);
|
|
242745
|
-
const [entities, functions, agents, connectors] = await Promise.all([
|
|
242746
|
-
entityResource.readAll(
|
|
242747
|
-
functionResource.readAll(
|
|
242748
|
-
agentResource.readAll(
|
|
242749
|
-
connectorResource.readAll(
|
|
242891
|
+
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
242892
|
+
entityResource.readAll(join8(configDir, project.entitiesDir)),
|
|
242893
|
+
functionResource.readAll(join8(configDir, project.functionsDir)),
|
|
242894
|
+
agentResource.readAll(join8(configDir, project.agentsDir)),
|
|
242895
|
+
connectorResource.readAll(join8(configDir, project.connectorsDir)),
|
|
242896
|
+
readAuthConfig(join8(configDir, project.authDir))
|
|
242750
242897
|
]);
|
|
242751
242898
|
return {
|
|
242752
242899
|
project: { ...project, root, configPath },
|
|
242753
242900
|
entities,
|
|
242754
242901
|
functions,
|
|
242755
242902
|
agents,
|
|
242756
|
-
connectors
|
|
242903
|
+
connectors,
|
|
242904
|
+
authConfig
|
|
242757
242905
|
};
|
|
242758
242906
|
}
|
|
242759
242907
|
|
|
@@ -242778,9 +242926,9 @@ async function initAppConfig() {
|
|
|
242778
242926
|
if (!projectRoot) {
|
|
242779
242927
|
throw new ConfigNotFoundError("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
|
|
242780
242928
|
}
|
|
242781
|
-
const
|
|
242929
|
+
const config7 = await readAppConfig(projectRoot.root);
|
|
242782
242930
|
const appConfigPath = await findAppConfigPath(projectRoot.root);
|
|
242783
|
-
if (!
|
|
242931
|
+
if (!config7?.id) {
|
|
242784
242932
|
throw new ConfigInvalidError("App not configured. Create a .app.jsonc file or run 'base44 link' to link this project.", appConfigPath, {
|
|
242785
242933
|
hints: [
|
|
242786
242934
|
{
|
|
@@ -242790,7 +242938,7 @@ async function initAppConfig() {
|
|
|
242790
242938
|
]
|
|
242791
242939
|
});
|
|
242792
242940
|
}
|
|
242793
|
-
cache2 = { projectRoot: projectRoot.root, id:
|
|
242941
|
+
cache2 = { projectRoot: projectRoot.root, id: config7.id };
|
|
242794
242942
|
return cache2;
|
|
242795
242943
|
}
|
|
242796
242944
|
function getAppConfig() {
|
|
@@ -242799,8 +242947,8 @@ function getAppConfig() {
|
|
|
242799
242947
|
}
|
|
242800
242948
|
return cache2;
|
|
242801
242949
|
}
|
|
242802
|
-
function setAppConfig(
|
|
242803
|
-
cache2 =
|
|
242950
|
+
function setAppConfig(config7) {
|
|
242951
|
+
cache2 = config7;
|
|
242804
242952
|
}
|
|
242805
242953
|
function generateAppConfigContent(id) {
|
|
242806
242954
|
return `// Base44 App Configuration
|
|
@@ -242931,12 +243079,12 @@ async function getSiteUrl(projectId) {
|
|
|
242931
243079
|
// src/core/project/template.ts
|
|
242932
243080
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
242933
243081
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
242934
|
-
import { dirname as dirname6, join as
|
|
243082
|
+
import { dirname as dirname6, join as join10 } from "node:path";
|
|
242935
243083
|
|
|
242936
243084
|
// src/core/assets.ts
|
|
242937
243085
|
import { cpSync, existsSync } from "node:fs";
|
|
242938
243086
|
import { homedir as homedir2 } from "node:os";
|
|
242939
|
-
import { join as
|
|
243087
|
+
import { join as join9 } from "node:path";
|
|
242940
243088
|
// package.json
|
|
242941
243089
|
var package_default = {
|
|
242942
243090
|
name: "base44",
|
|
@@ -243029,18 +243177,18 @@ var package_default = {
|
|
|
243029
243177
|
};
|
|
243030
243178
|
|
|
243031
243179
|
// src/core/assets.ts
|
|
243032
|
-
var ASSETS_DIR =
|
|
243180
|
+
var ASSETS_DIR = join9(homedir2(), ".base44", "assets", package_default.version);
|
|
243033
243181
|
function getTemplatesDir() {
|
|
243034
|
-
return
|
|
243182
|
+
return join9(ASSETS_DIR, "templates");
|
|
243035
243183
|
}
|
|
243036
243184
|
function getTemplatesIndexPath() {
|
|
243037
|
-
return
|
|
243185
|
+
return join9(ASSETS_DIR, "templates", "templates.json");
|
|
243038
243186
|
}
|
|
243039
243187
|
function getDenoWrapperPath() {
|
|
243040
|
-
return
|
|
243188
|
+
return join9(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
243041
243189
|
}
|
|
243042
243190
|
function getExecWrapperPath() {
|
|
243043
|
-
return
|
|
243191
|
+
return join9(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
243044
243192
|
}
|
|
243045
243193
|
function ensureNpmAssets(sourceDir) {
|
|
243046
243194
|
if (existsSync(ASSETS_DIR))
|
|
@@ -243061,23 +243209,23 @@ async function listTemplates() {
|
|
|
243061
243209
|
return result.data.templates;
|
|
243062
243210
|
}
|
|
243063
243211
|
async function renderTemplate(template, destPath, data) {
|
|
243064
|
-
const templateDir =
|
|
243212
|
+
const templateDir = join10(getTemplatesDir(), template.path);
|
|
243065
243213
|
const files = await globby("**/*", {
|
|
243066
243214
|
cwd: templateDir,
|
|
243067
243215
|
dot: true,
|
|
243068
243216
|
onlyFiles: true
|
|
243069
243217
|
});
|
|
243070
243218
|
for (const file2 of files) {
|
|
243071
|
-
const srcPath =
|
|
243219
|
+
const srcPath = join10(templateDir, file2);
|
|
243072
243220
|
try {
|
|
243073
243221
|
if (file2.endsWith(".ejs")) {
|
|
243074
243222
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
243075
243223
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243076
|
-
const destFile = attributes.outputFileName ?
|
|
243077
|
-
const destFilePath =
|
|
243224
|
+
const destFile = attributes.outputFileName ? join10(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
243225
|
+
const destFilePath = join10(destPath, destFile);
|
|
243078
243226
|
await writeFile(destFilePath, body);
|
|
243079
243227
|
} else {
|
|
243080
|
-
const destFilePath =
|
|
243228
|
+
const destFilePath = join10(destPath, file2);
|
|
243081
243229
|
await copyFile(srcPath, destFilePath);
|
|
243082
243230
|
}
|
|
243083
243231
|
} catch (error48) {
|
|
@@ -243152,7 +243300,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
243152
243300
|
// src/core/site/deploy.ts
|
|
243153
243301
|
import { randomUUID } from "node:crypto";
|
|
243154
243302
|
import { tmpdir } from "node:os";
|
|
243155
|
-
import { join as
|
|
243303
|
+
import { join as join11 } from "node:path";
|
|
243156
243304
|
async function deploySite(siteOutputDir) {
|
|
243157
243305
|
if (!await pathExists(siteOutputDir)) {
|
|
243158
243306
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -243169,7 +243317,7 @@ async function deploySite(siteOutputDir) {
|
|
|
243169
243317
|
]
|
|
243170
243318
|
});
|
|
243171
243319
|
}
|
|
243172
|
-
const archivePath =
|
|
243320
|
+
const archivePath = join11(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
243173
243321
|
try {
|
|
243174
243322
|
await createArchive(siteOutputDir, archivePath);
|
|
243175
243323
|
return await uploadSite(archivePath);
|
|
@@ -243186,22 +243334,26 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
243186
243334
|
}
|
|
243187
243335
|
// src/core/project/deploy.ts
|
|
243188
243336
|
function hasResourcesToDeploy(projectData) {
|
|
243189
|
-
const { project, entities, functions, agents, connectors } = projectData;
|
|
243337
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
243190
243338
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
243191
243339
|
const hasEntities = entities.length > 0;
|
|
243192
243340
|
const hasFunctions = functions.length > 0;
|
|
243193
243341
|
const hasAgents = agents.length > 0;
|
|
243194
243342
|
const hasConnectors = connectors.length > 0;
|
|
243195
|
-
|
|
243343
|
+
const hasAuthConfig = authConfig !== null;
|
|
243344
|
+
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
|
|
243196
243345
|
}
|
|
243197
243346
|
async function deployAll(projectData, options) {
|
|
243198
|
-
const { project, entities, functions, agents, connectors } = projectData;
|
|
243347
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
243199
243348
|
await entityResource.push(entities);
|
|
243200
243349
|
await deployFunctionsSequentially(functions, {
|
|
243201
243350
|
onStart: options?.onFunctionStart,
|
|
243202
243351
|
onResult: options?.onFunctionResult
|
|
243203
243352
|
});
|
|
243204
243353
|
await agentResource.push(agents);
|
|
243354
|
+
if (authConfig) {
|
|
243355
|
+
await pushAuthConfig(authConfig);
|
|
243356
|
+
}
|
|
243205
243357
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
243206
243358
|
if (project.site?.outputDirectory) {
|
|
243207
243359
|
const outputDir = resolve(project.root, project.site.outputDirectory);
|
|
@@ -250345,7 +250497,7 @@ async function parseEnvFile(filePath) {
|
|
|
250345
250497
|
async function pullAgentsAction() {
|
|
250346
250498
|
const { project: project2 } = await readProjectConfig();
|
|
250347
250499
|
const configDir = dirname7(project2.configPath);
|
|
250348
|
-
const agentsDir =
|
|
250500
|
+
const agentsDir = join12(configDir, project2.agentsDir);
|
|
250349
250501
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
250350
250502
|
return await fetchAgents();
|
|
250351
250503
|
}, {
|
|
@@ -250405,6 +250557,125 @@ function getAgentsCommand() {
|
|
|
250405
250557
|
return new Command("agents").description("Manage project agents").addCommand(getAgentsPushCommand()).addCommand(getAgentsPullCommand());
|
|
250406
250558
|
}
|
|
250407
250559
|
|
|
250560
|
+
// src/cli/commands/auth/password-login.ts
|
|
250561
|
+
import { dirname as dirname8, join as join13 } from "node:path";
|
|
250562
|
+
function validateAction(action) {
|
|
250563
|
+
if (action !== "enable" && action !== "disable") {
|
|
250564
|
+
throw new InvalidInputError(`Invalid action "${action}". Must be "enable" or "disable".`, {
|
|
250565
|
+
hints: [
|
|
250566
|
+
{
|
|
250567
|
+
message: "Enable password auth: base44 auth password-login enable",
|
|
250568
|
+
command: "base44 auth password-login enable"
|
|
250569
|
+
},
|
|
250570
|
+
{
|
|
250571
|
+
message: "Disable password auth: base44 auth password-login disable",
|
|
250572
|
+
command: "base44 auth password-login disable"
|
|
250573
|
+
}
|
|
250574
|
+
]
|
|
250575
|
+
});
|
|
250576
|
+
}
|
|
250577
|
+
}
|
|
250578
|
+
async function passwordLoginAction(action) {
|
|
250579
|
+
validateAction(action);
|
|
250580
|
+
const shouldEnable = action === "enable";
|
|
250581
|
+
const { project: project2 } = await readProjectConfig();
|
|
250582
|
+
const configDir = dirname8(project2.configPath);
|
|
250583
|
+
const authDir = join13(configDir, project2.authDir);
|
|
250584
|
+
const updated = await runTask("Updating local auth config", async () => {
|
|
250585
|
+
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
250586
|
+
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
250587
|
+
await writeAuthConfig(authDir, merged);
|
|
250588
|
+
return merged;
|
|
250589
|
+
});
|
|
250590
|
+
if (!shouldEnable && !hasAnyLoginMethod(updated)) {
|
|
250591
|
+
R2.warn("Disabling password auth will leave no login methods enabled. Users will be locked out.");
|
|
250592
|
+
}
|
|
250593
|
+
const newStatus = shouldEnable ? "enabled" : "disabled";
|
|
250594
|
+
return {
|
|
250595
|
+
outroMessage: `Username & password authentication ${newStatus} in local config. Run \`base44 auth push\` or \`base44 deploy\` to apply.`
|
|
250596
|
+
};
|
|
250597
|
+
}
|
|
250598
|
+
function getPasswordLoginCommand() {
|
|
250599
|
+
return new Base44Command("password-login").description("Enable or disable username & password authentication").argument("<enable|disable>", "enable or disable password authentication").action(async (action) => {
|
|
250600
|
+
return passwordLoginAction(action);
|
|
250601
|
+
});
|
|
250602
|
+
}
|
|
250603
|
+
|
|
250604
|
+
// src/cli/commands/auth/pull.ts
|
|
250605
|
+
import { dirname as dirname9, join as join14 } from "node:path";
|
|
250606
|
+
async function pullAuthAction() {
|
|
250607
|
+
const { project: project2 } = await readProjectConfig();
|
|
250608
|
+
const configDir = dirname9(project2.configPath);
|
|
250609
|
+
const authDir = join14(configDir, project2.authDir);
|
|
250610
|
+
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
250611
|
+
return await pullAuthConfig();
|
|
250612
|
+
}, {
|
|
250613
|
+
successMessage: "Auth config fetched successfully",
|
|
250614
|
+
errorMessage: "Failed to fetch auth config"
|
|
250615
|
+
});
|
|
250616
|
+
const { written } = await runTask("Syncing auth config file", async () => {
|
|
250617
|
+
return await writeAuthConfig(authDir, remoteConfig);
|
|
250618
|
+
}, {
|
|
250619
|
+
successMessage: "Auth config file synced successfully",
|
|
250620
|
+
errorMessage: "Failed to sync auth config file"
|
|
250621
|
+
});
|
|
250622
|
+
if (written) {
|
|
250623
|
+
R2.success("Auth config written to local file");
|
|
250624
|
+
} else {
|
|
250625
|
+
R2.info("Auth config is already up to date");
|
|
250626
|
+
}
|
|
250627
|
+
return {
|
|
250628
|
+
outroMessage: `Pulled auth config to ${authDir} (overwrites local file)`
|
|
250629
|
+
};
|
|
250630
|
+
}
|
|
250631
|
+
function getAuthPullCommand() {
|
|
250632
|
+
return new Base44Command("pull").description("Pull auth config from Base44 to local file").action(pullAuthAction);
|
|
250633
|
+
}
|
|
250634
|
+
|
|
250635
|
+
// src/cli/commands/auth/push.ts
|
|
250636
|
+
async function pushAuthAction(options, command2) {
|
|
250637
|
+
const { authConfig } = await readProjectConfig();
|
|
250638
|
+
if (!authConfig) {
|
|
250639
|
+
R2.info("No local auth config found");
|
|
250640
|
+
return {
|
|
250641
|
+
outroMessage: "No auth config to push. Run `base44 auth pull` to fetch the remote config first."
|
|
250642
|
+
};
|
|
250643
|
+
}
|
|
250644
|
+
if (!hasAnyLoginMethod(authConfig)) {
|
|
250645
|
+
R2.warn("This config has no login methods enabled. Pushing it will lock out all users.");
|
|
250646
|
+
}
|
|
250647
|
+
if (!options.yes) {
|
|
250648
|
+
if (command2.isNonInteractive) {
|
|
250649
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
250650
|
+
}
|
|
250651
|
+
const shouldPush = await Re({
|
|
250652
|
+
message: "Push auth config to Base44?"
|
|
250653
|
+
});
|
|
250654
|
+
if (Ct(shouldPush) || !shouldPush) {
|
|
250655
|
+
return { outroMessage: "Push cancelled" };
|
|
250656
|
+
}
|
|
250657
|
+
}
|
|
250658
|
+
await runTask("Pushing auth config to Base44", async () => {
|
|
250659
|
+
return await pushAuthConfig(authConfig);
|
|
250660
|
+
}, {
|
|
250661
|
+
successMessage: "Auth config pushed successfully",
|
|
250662
|
+
errorMessage: "Failed to push auth config"
|
|
250663
|
+
});
|
|
250664
|
+
return {
|
|
250665
|
+
outroMessage: "Auth config pushed to Base44"
|
|
250666
|
+
};
|
|
250667
|
+
}
|
|
250668
|
+
function getAuthPushCommand() {
|
|
250669
|
+
return new Base44Command("push").description("Push local auth config to Base44").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
|
|
250670
|
+
return await pushAuthAction(options, command2);
|
|
250671
|
+
});
|
|
250672
|
+
}
|
|
250673
|
+
|
|
250674
|
+
// src/cli/commands/auth/index.ts
|
|
250675
|
+
function getAuthCommand() {
|
|
250676
|
+
return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
|
|
250677
|
+
}
|
|
250678
|
+
|
|
250408
250679
|
// src/cli/commands/auth/login.ts
|
|
250409
250680
|
function getLoginCommand() {
|
|
250410
250681
|
return new Base44Command("login", {
|
|
@@ -250461,11 +250732,11 @@ function getConnectorsListAvailableCommand() {
|
|
|
250461
250732
|
}
|
|
250462
250733
|
|
|
250463
250734
|
// src/cli/commands/connectors/pull.ts
|
|
250464
|
-
import { dirname as
|
|
250735
|
+
import { dirname as dirname10, join as join15 } from "node:path";
|
|
250465
250736
|
async function pullConnectorsAction() {
|
|
250466
250737
|
const { project: project2 } = await readProjectConfig();
|
|
250467
|
-
const configDir =
|
|
250468
|
-
const connectorsDir =
|
|
250738
|
+
const configDir = dirname10(project2.configPath);
|
|
250739
|
+
const connectorsDir = join15(configDir, project2.connectorsDir);
|
|
250469
250740
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
250470
250741
|
return await pullAllConnectors();
|
|
250471
250742
|
}, {
|
|
@@ -251512,11 +251783,11 @@ function getListCommand() {
|
|
|
251512
251783
|
}
|
|
251513
251784
|
|
|
251514
251785
|
// src/cli/commands/functions/pull.ts
|
|
251515
|
-
import { dirname as
|
|
251786
|
+
import { dirname as dirname11, join as join16 } from "node:path";
|
|
251516
251787
|
async function pullFunctionsAction(name2) {
|
|
251517
251788
|
const { project: project2 } = await readProjectConfig();
|
|
251518
|
-
const configDir =
|
|
251519
|
-
const functionsDir =
|
|
251789
|
+
const configDir = dirname11(project2.configPath);
|
|
251790
|
+
const functionsDir = join16(configDir, project2.functionsDir);
|
|
251520
251791
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
251521
251792
|
const { functions } = await listDeployedFunctions();
|
|
251522
251793
|
return functions;
|
|
@@ -251559,7 +251830,7 @@ function getFunctionsCommand() {
|
|
|
251559
251830
|
}
|
|
251560
251831
|
|
|
251561
251832
|
// src/cli/commands/project/create.ts
|
|
251562
|
-
import { basename as basename3, join as
|
|
251833
|
+
import { basename as basename3, join as join17, resolve as resolve2 } from "node:path";
|
|
251563
251834
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
251564
251835
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
251565
251836
|
async function getTemplateById(templateId) {
|
|
@@ -251696,7 +251967,7 @@ async function executeCreate({
|
|
|
251696
251967
|
updateMessage("Building project...");
|
|
251697
251968
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
251698
251969
|
updateMessage("Deploying site...");
|
|
251699
|
-
return await deploySite(
|
|
251970
|
+
return await deploySite(join17(resolvedPath, outputDirectory));
|
|
251700
251971
|
}, {
|
|
251701
251972
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
251702
251973
|
errorMessage: "Failed to deploy site"
|
|
@@ -251765,7 +252036,7 @@ async function deployAction(options) {
|
|
|
251765
252036
|
outroMessage: "No resources found to deploy"
|
|
251766
252037
|
};
|
|
251767
252038
|
}
|
|
251768
|
-
const { project: project2, entities, functions, agents, connectors } = projectData;
|
|
252039
|
+
const { project: project2, entities, functions, agents, connectors, authConfig } = projectData;
|
|
251769
252040
|
const summaryLines = [];
|
|
251770
252041
|
if (entities.length > 0) {
|
|
251771
252042
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -251779,6 +252050,9 @@ async function deployAction(options) {
|
|
|
251779
252050
|
if (connectors.length > 0) {
|
|
251780
252051
|
summaryLines.push(` - ${connectors.length} ${connectors.length === 1 ? "connector" : "connectors"}`);
|
|
251781
252052
|
}
|
|
252053
|
+
if (authConfig) {
|
|
252054
|
+
summaryLines.push(" - Auth config");
|
|
252055
|
+
}
|
|
251782
252056
|
if (project2.site?.outputDirectory) {
|
|
251783
252057
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
251784
252058
|
}
|
|
@@ -252339,9 +252613,9 @@ async function generateContent(input) {
|
|
|
252339
252613
|
`);
|
|
252340
252614
|
}
|
|
252341
252615
|
async function compileEntity(entity2) {
|
|
252342
|
-
const { name: name2, ...
|
|
252616
|
+
const { name: name2, ...schema10 } = entity2;
|
|
252343
252617
|
const jsonSchema = {
|
|
252344
|
-
...
|
|
252618
|
+
...schema10,
|
|
252345
252619
|
title: name2,
|
|
252346
252620
|
additionalProperties: false
|
|
252347
252621
|
};
|
|
@@ -252368,10 +252642,10 @@ function toPascalCase(name2) {
|
|
|
252368
252642
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
252369
252643
|
}
|
|
252370
252644
|
// src/core/types/update-project.ts
|
|
252371
|
-
import { join as
|
|
252645
|
+
import { join as join20 } from "node:path";
|
|
252372
252646
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
252373
252647
|
async function updateProjectConfig(projectRoot) {
|
|
252374
|
-
const tsconfigPath =
|
|
252648
|
+
const tsconfigPath = join20(projectRoot, "tsconfig.json");
|
|
252375
252649
|
if (!await pathExists(tsconfigPath)) {
|
|
252376
252650
|
return false;
|
|
252377
252651
|
}
|
|
@@ -252412,7 +252686,7 @@ function getTypesCommand() {
|
|
|
252412
252686
|
}
|
|
252413
252687
|
|
|
252414
252688
|
// src/cli/dev/dev-server/main.ts
|
|
252415
|
-
import { dirname as
|
|
252689
|
+
import { dirname as dirname16, join as join23 } from "node:path";
|
|
252416
252690
|
var import_cors = __toESM(require_lib4(), 1);
|
|
252417
252691
|
var import_express5 = __toESM(require_express(), 1);
|
|
252418
252692
|
|
|
@@ -252435,8 +252709,8 @@ var getLocalHosts = () => {
|
|
|
252435
252709
|
const interfaces = os9.networkInterfaces();
|
|
252436
252710
|
const results = new Set([undefined, "0.0.0.0"]);
|
|
252437
252711
|
for (const _interface of Object.values(interfaces)) {
|
|
252438
|
-
for (const
|
|
252439
|
-
results.add(
|
|
252712
|
+
for (const config11 of _interface) {
|
|
252713
|
+
results.add(config11.address);
|
|
252440
252714
|
}
|
|
252441
252715
|
}
|
|
252442
252716
|
return results;
|
|
@@ -253030,22 +253304,22 @@ class Database {
|
|
|
253030
253304
|
this.schemas.clear();
|
|
253031
253305
|
}
|
|
253032
253306
|
validate(entityName, record2, partial2 = false) {
|
|
253033
|
-
const
|
|
253034
|
-
if (!
|
|
253307
|
+
const schema10 = this.schemas.get(this.normalizeName(entityName));
|
|
253308
|
+
if (!schema10) {
|
|
253035
253309
|
throw new Error(`Entity "${entityName}" not found`);
|
|
253036
253310
|
}
|
|
253037
|
-
return this.validator.validate(record2,
|
|
253311
|
+
return this.validator.validate(record2, schema10, partial2);
|
|
253038
253312
|
}
|
|
253039
253313
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
253040
|
-
const
|
|
253041
|
-
if (!
|
|
253314
|
+
const schema10 = this.schemas.get(this.normalizeName(entityName));
|
|
253315
|
+
if (!schema10) {
|
|
253042
253316
|
throw new Error(`Entity "${entityName}" not found`);
|
|
253043
253317
|
}
|
|
253044
|
-
const filteredRecord = this.validator.filterFields(record2,
|
|
253318
|
+
const filteredRecord = this.validator.filterFields(record2, schema10);
|
|
253045
253319
|
if (partial2) {
|
|
253046
253320
|
return filteredRecord;
|
|
253047
253321
|
}
|
|
253048
|
-
return this.validator.applyDefaults(filteredRecord,
|
|
253322
|
+
return this.validator.applyDefaults(filteredRecord, schema10);
|
|
253049
253323
|
}
|
|
253050
253324
|
normalizeName(entityName) {
|
|
253051
253325
|
return entityName.toLowerCase();
|
|
@@ -254227,9 +254501,9 @@ class NodeFsHandler {
|
|
|
254227
254501
|
if (this.fsw.closed) {
|
|
254228
254502
|
return;
|
|
254229
254503
|
}
|
|
254230
|
-
const
|
|
254504
|
+
const dirname15 = sp2.dirname(file2);
|
|
254231
254505
|
const basename5 = sp2.basename(file2);
|
|
254232
|
-
const parent = this.fsw._getWatchedDir(
|
|
254506
|
+
const parent = this.fsw._getWatchedDir(dirname15);
|
|
254233
254507
|
let prevStats = stats;
|
|
254234
254508
|
if (parent.has(basename5))
|
|
254235
254509
|
return;
|
|
@@ -254256,7 +254530,7 @@ class NodeFsHandler {
|
|
|
254256
254530
|
prevStats = newStats2;
|
|
254257
254531
|
}
|
|
254258
254532
|
} catch (error48) {
|
|
254259
|
-
this.fsw._remove(
|
|
254533
|
+
this.fsw._remove(dirname15, basename5);
|
|
254260
254534
|
}
|
|
254261
254535
|
} else if (parent.has(basename5)) {
|
|
254262
254536
|
const at13 = newStats.atimeMs;
|
|
@@ -255277,8 +255551,8 @@ async function createDevServer(options8) {
|
|
|
255277
255551
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
255278
255552
|
};
|
|
255279
255553
|
const base44ConfigWatcher = new WatchBase44({
|
|
255280
|
-
functions:
|
|
255281
|
-
entities:
|
|
255554
|
+
functions: join23(dirname16(project2.configPath), project2.functionsDir),
|
|
255555
|
+
entities: join23(dirname16(project2.configPath), project2.entitiesDir)
|
|
255282
255556
|
}, devLogger);
|
|
255283
255557
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
255284
255558
|
try {
|
|
@@ -255555,6 +255829,7 @@ function createProgram(context) {
|
|
|
255555
255829
|
program2.addCommand(getConnectorsCommand());
|
|
255556
255830
|
program2.addCommand(getFunctionsCommand());
|
|
255557
255831
|
program2.addCommand(getSecretsCommand());
|
|
255832
|
+
program2.addCommand(getAuthCommand());
|
|
255558
255833
|
program2.addCommand(getSiteCommand());
|
|
255559
255834
|
program2.addCommand(getTypesCommand());
|
|
255560
255835
|
program2.addCommand(getExecCommand());
|
|
@@ -255568,7 +255843,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
255568
255843
|
import { release, type } from "node:os";
|
|
255569
255844
|
|
|
255570
255845
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
255571
|
-
import { dirname as
|
|
255846
|
+
import { dirname as dirname17, posix, sep } from "path";
|
|
255572
255847
|
function createModulerModifier() {
|
|
255573
255848
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
255574
255849
|
return async (frames) => {
|
|
@@ -255577,7 +255852,7 @@ function createModulerModifier() {
|
|
|
255577
255852
|
return frames;
|
|
255578
255853
|
};
|
|
255579
255854
|
}
|
|
255580
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
255855
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
255581
255856
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
255582
255857
|
return (filename) => {
|
|
255583
255858
|
if (!filename)
|
|
@@ -259766,9 +260041,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
259766
260041
|
});
|
|
259767
260042
|
}
|
|
259768
260043
|
// src/cli/index.ts
|
|
259769
|
-
var __dirname4 =
|
|
260044
|
+
var __dirname4 = dirname18(fileURLToPath6(import.meta.url));
|
|
259770
260045
|
async function runCLI(options8) {
|
|
259771
|
-
ensureNpmAssets(
|
|
260046
|
+
ensureNpmAssets(join24(__dirname4, "../assets"));
|
|
259772
260047
|
const errorReporter = new ErrorReporter;
|
|
259773
260048
|
errorReporter.registerProcessErrorHandlers();
|
|
259774
260049
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -259801,4 +260076,4 @@ export {
|
|
|
259801
260076
|
CLIExitError
|
|
259802
260077
|
};
|
|
259803
260078
|
|
|
259804
|
-
//# debugId=
|
|
260079
|
+
//# debugId=4B13E7885715C10064756E2164756E21
|