@base44-preview/cli 0.0.47-pr.441.3070a4f → 0.0.48-pr.444.5b76604
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 +965 -718
- package/dist/cli/index.js.map +39 -29
- package/package.json +1 -47
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/@clack/core/dist/index.mjs
|
|
@@ -219422,7 +219422,7 @@ var {
|
|
|
219422
219422
|
} = import__.default;
|
|
219423
219423
|
|
|
219424
219424
|
// src/cli/commands/agents/pull.ts
|
|
219425
|
-
import { dirname as dirname7, join as
|
|
219425
|
+
import { dirname as dirname7, join as join12 } from "node:path";
|
|
219426
219426
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
219427
219427
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
219428
219428
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -234574,7 +234574,8 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
234574
234574
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
234575
234575
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
234576
234576
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
234577
|
-
connectorsDir: exports_external.string().optional().default("connectors")
|
|
234577
|
+
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
234578
|
+
authDir: exports_external.string().optional().default("auth")
|
|
234578
234579
|
});
|
|
234579
234580
|
var AppConfigSchema = exports_external.object({
|
|
234580
234581
|
id: exports_external.string().min(1, "id cannot be empty")
|
|
@@ -241506,7 +241507,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
241506
241507
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
241507
241508
|
|
|
241508
241509
|
// src/core/project/config.ts
|
|
241509
|
-
import { dirname as dirname5, join as
|
|
241510
|
+
import { dirname as dirname5, join as join8 } from "node:path";
|
|
241510
241511
|
|
|
241511
241512
|
// src/core/resources/agent/schema.ts
|
|
241512
241513
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -241669,6 +241670,161 @@ var agentResource = {
|
|
|
241669
241670
|
readAll: readAllAgents,
|
|
241670
241671
|
push: pushAgents
|
|
241671
241672
|
};
|
|
241673
|
+
// src/core/resources/auth-config/schema.ts
|
|
241674
|
+
var GoogleOAuthMode = exports_external.enum(["default", "custom"]);
|
|
241675
|
+
var AuthConfigSchema = exports_external.object({
|
|
241676
|
+
enable_username_password: exports_external.boolean(),
|
|
241677
|
+
enable_google_login: exports_external.boolean(),
|
|
241678
|
+
enable_microsoft_login: exports_external.boolean(),
|
|
241679
|
+
enable_facebook_login: exports_external.boolean(),
|
|
241680
|
+
enable_apple_login: exports_external.boolean(),
|
|
241681
|
+
sso_provider_name: exports_external.string().nullable(),
|
|
241682
|
+
enable_sso_login: exports_external.boolean(),
|
|
241683
|
+
google_oauth_mode: GoogleOAuthMode,
|
|
241684
|
+
google_oauth_client_id: exports_external.string().nullable(),
|
|
241685
|
+
use_workspace_sso: exports_external.boolean()
|
|
241686
|
+
}).transform((data) => ({
|
|
241687
|
+
enableUsernamePassword: data.enable_username_password,
|
|
241688
|
+
enableGoogleLogin: data.enable_google_login,
|
|
241689
|
+
enableMicrosoftLogin: data.enable_microsoft_login,
|
|
241690
|
+
enableFacebookLogin: data.enable_facebook_login,
|
|
241691
|
+
enableAppleLogin: data.enable_apple_login,
|
|
241692
|
+
ssoProviderName: data.sso_provider_name,
|
|
241693
|
+
enableSSOLogin: data.enable_sso_login,
|
|
241694
|
+
googleOAuthMode: data.google_oauth_mode,
|
|
241695
|
+
googleOAuthClientId: data.google_oauth_client_id,
|
|
241696
|
+
useWorkspaceSSO: data.use_workspace_sso
|
|
241697
|
+
}));
|
|
241698
|
+
var AuthConfigFileSchema = exports_external.object({
|
|
241699
|
+
enableUsernamePassword: exports_external.boolean(),
|
|
241700
|
+
enableGoogleLogin: exports_external.boolean(),
|
|
241701
|
+
enableMicrosoftLogin: exports_external.boolean(),
|
|
241702
|
+
enableFacebookLogin: exports_external.boolean(),
|
|
241703
|
+
enableAppleLogin: exports_external.boolean(),
|
|
241704
|
+
ssoProviderName: exports_external.string().nullable(),
|
|
241705
|
+
enableSSOLogin: exports_external.boolean(),
|
|
241706
|
+
googleOAuthMode: GoogleOAuthMode,
|
|
241707
|
+
googleOAuthClientId: exports_external.string().nullable(),
|
|
241708
|
+
useWorkspaceSSO: exports_external.boolean()
|
|
241709
|
+
});
|
|
241710
|
+
var AppAuthConfigResponseSchema = exports_external.object({
|
|
241711
|
+
auth_config: AuthConfigSchema
|
|
241712
|
+
}).transform((data) => ({
|
|
241713
|
+
authConfig: data.auth_config
|
|
241714
|
+
}));
|
|
241715
|
+
function hasAnyLoginMethod(config3) {
|
|
241716
|
+
return config3.enableUsernamePassword || config3.enableGoogleLogin || config3.enableMicrosoftLogin || config3.enableFacebookLogin || config3.enableAppleLogin || config3.enableSSOLogin;
|
|
241717
|
+
}
|
|
241718
|
+
function toAuthConfigPayload(config3) {
|
|
241719
|
+
return {
|
|
241720
|
+
enable_username_password: config3.enableUsernamePassword,
|
|
241721
|
+
enable_google_login: config3.enableGoogleLogin,
|
|
241722
|
+
enable_microsoft_login: config3.enableMicrosoftLogin,
|
|
241723
|
+
enable_facebook_login: config3.enableFacebookLogin,
|
|
241724
|
+
enable_apple_login: config3.enableAppleLogin,
|
|
241725
|
+
sso_provider_name: config3.ssoProviderName,
|
|
241726
|
+
enable_sso_login: config3.enableSSOLogin,
|
|
241727
|
+
google_oauth_mode: config3.googleOAuthMode,
|
|
241728
|
+
google_oauth_client_id: config3.googleOAuthClientId,
|
|
241729
|
+
use_workspace_sso: config3.useWorkspaceSSO
|
|
241730
|
+
};
|
|
241731
|
+
}
|
|
241732
|
+
|
|
241733
|
+
// src/core/resources/auth-config/api.ts
|
|
241734
|
+
async function getAuthConfig() {
|
|
241735
|
+
const { id } = getAppConfig();
|
|
241736
|
+
let response;
|
|
241737
|
+
try {
|
|
241738
|
+
response = await base44Client.get(`api/apps/${id}`);
|
|
241739
|
+
} catch (error48) {
|
|
241740
|
+
throw await ApiError.fromHttpError(error48, "fetching auth config");
|
|
241741
|
+
}
|
|
241742
|
+
const result = AppAuthConfigResponseSchema.safeParse(await response.json());
|
|
241743
|
+
if (!result.success) {
|
|
241744
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
241745
|
+
}
|
|
241746
|
+
return result.data.authConfig;
|
|
241747
|
+
}
|
|
241748
|
+
async function pushAuthConfigToApi(config3) {
|
|
241749
|
+
const { id } = getAppConfig();
|
|
241750
|
+
let response;
|
|
241751
|
+
try {
|
|
241752
|
+
response = await base44Client.put(`api/apps/${id}`, {
|
|
241753
|
+
json: { auth_config: toAuthConfigPayload(config3) }
|
|
241754
|
+
});
|
|
241755
|
+
} catch (error48) {
|
|
241756
|
+
throw await ApiError.fromHttpError(error48, "updating auth config");
|
|
241757
|
+
}
|
|
241758
|
+
const result = AppAuthConfigResponseSchema.safeParse(await response.json());
|
|
241759
|
+
if (!result.success) {
|
|
241760
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
241761
|
+
}
|
|
241762
|
+
return result.data.authConfig;
|
|
241763
|
+
}
|
|
241764
|
+
// src/core/resources/auth-config/config.ts
|
|
241765
|
+
import { join as join4 } from "node:path";
|
|
241766
|
+
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
241767
|
+
var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
|
|
241768
|
+
var DEFAULT_AUTH_CONFIG = {
|
|
241769
|
+
enableUsernamePassword: false,
|
|
241770
|
+
enableGoogleLogin: false,
|
|
241771
|
+
enableMicrosoftLogin: false,
|
|
241772
|
+
enableFacebookLogin: false,
|
|
241773
|
+
enableAppleLogin: false,
|
|
241774
|
+
ssoProviderName: null,
|
|
241775
|
+
enableSSOLogin: false,
|
|
241776
|
+
googleOAuthMode: "default",
|
|
241777
|
+
googleOAuthClientId: null,
|
|
241778
|
+
useWorkspaceSSO: false
|
|
241779
|
+
};
|
|
241780
|
+
function getAuthConfigPath(authDir) {
|
|
241781
|
+
return join4(authDir, AUTH_CONFIG_FILENAME);
|
|
241782
|
+
}
|
|
241783
|
+
async function readAuthConfig(authDir) {
|
|
241784
|
+
const filePath = getAuthConfigPath(authDir);
|
|
241785
|
+
if (!await pathExists(filePath)) {
|
|
241786
|
+
return null;
|
|
241787
|
+
}
|
|
241788
|
+
const parsed = await readJsonFile(filePath);
|
|
241789
|
+
const result = AuthConfigFileSchema.safeParse(parsed);
|
|
241790
|
+
if (!result.success) {
|
|
241791
|
+
throw new SchemaValidationError("Invalid auth config file", result.error, filePath);
|
|
241792
|
+
}
|
|
241793
|
+
return result.data;
|
|
241794
|
+
}
|
|
241795
|
+
async function writeAuthConfig(authDir, config3) {
|
|
241796
|
+
const filePath = getAuthConfigPath(authDir);
|
|
241797
|
+
if (await pathExists(filePath)) {
|
|
241798
|
+
const existing = await readJsonFile(filePath);
|
|
241799
|
+
const existingResult = AuthConfigFileSchema.safeParse(existing);
|
|
241800
|
+
if (existingResult.success && isDeepStrictEqual2(existingResult.data, config3)) {
|
|
241801
|
+
return { written: false };
|
|
241802
|
+
}
|
|
241803
|
+
}
|
|
241804
|
+
await writeJsonFile(filePath, config3);
|
|
241805
|
+
return { written: true };
|
|
241806
|
+
}
|
|
241807
|
+
// src/core/resources/auth-config/pull.ts
|
|
241808
|
+
async function pullAuthConfig() {
|
|
241809
|
+
return await getAuthConfig();
|
|
241810
|
+
}
|
|
241811
|
+
// src/core/resources/auth-config/push.ts
|
|
241812
|
+
async function pushAuthConfig(config3) {
|
|
241813
|
+
if (!config3) {
|
|
241814
|
+
return;
|
|
241815
|
+
}
|
|
241816
|
+
await pushAuthConfigToApi(config3);
|
|
241817
|
+
}
|
|
241818
|
+
// src/core/resources/auth-config/resource.ts
|
|
241819
|
+
var authConfigResource = {
|
|
241820
|
+
readAll: async (dir) => {
|
|
241821
|
+
const config3 = await readAuthConfig(dir);
|
|
241822
|
+
return config3 ? [config3] : [];
|
|
241823
|
+
},
|
|
241824
|
+
push: async (items) => {
|
|
241825
|
+
await pushAuthConfig(items[0] ?? null);
|
|
241826
|
+
}
|
|
241827
|
+
};
|
|
241672
241828
|
// src/core/resources/connector/schema.ts
|
|
241673
241829
|
var GoogleCalendarConnectorSchema = exports_external.object({
|
|
241674
241830
|
type: exports_external.literal("googlecalendar"),
|
|
@@ -241996,8 +242152,8 @@ async function removeStripe() {
|
|
|
241996
242152
|
return result.data;
|
|
241997
242153
|
}
|
|
241998
242154
|
// src/core/resources/connector/config.ts
|
|
241999
|
-
import { join as
|
|
242000
|
-
import { isDeepStrictEqual as
|
|
242155
|
+
import { join as join5 } from "node:path";
|
|
242156
|
+
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
242001
242157
|
async function readConnectorFile(connectorPath) {
|
|
242002
242158
|
const parsed = await readJsonFile(connectorPath);
|
|
242003
242159
|
const result = ConnectorResourceSchema.safeParse(parsed);
|
|
@@ -242054,10 +242210,10 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
242054
242210
|
const written = [];
|
|
242055
242211
|
for (const connector of remoteConnectors) {
|
|
242056
242212
|
const existing = typeToEntry.get(connector.type);
|
|
242057
|
-
if (existing &&
|
|
242213
|
+
if (existing && isDeepStrictEqual3(existing.data, connector)) {
|
|
242058
242214
|
continue;
|
|
242059
242215
|
}
|
|
242060
|
-
const filePath = existing?.filePath ??
|
|
242216
|
+
const filePath = existing?.filePath ?? join5(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
242061
242217
|
await writeJsonFile(filePath, connector);
|
|
242062
242218
|
written.push(connector.type);
|
|
242063
242219
|
}
|
|
@@ -242541,7 +242697,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
242541
242697
|
return result.data;
|
|
242542
242698
|
}
|
|
242543
242699
|
// src/core/resources/function/config.ts
|
|
242544
|
-
import { basename as basename2, dirname as dirname3, join as
|
|
242700
|
+
import { basename as basename2, dirname as dirname3, join as join6, relative } from "node:path";
|
|
242545
242701
|
async function readFunctionConfig(configPath) {
|
|
242546
242702
|
const parsed = await readJsonFile(configPath);
|
|
242547
242703
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -242551,9 +242707,9 @@ async function readFunctionConfig(configPath) {
|
|
|
242551
242707
|
return result.data;
|
|
242552
242708
|
}
|
|
242553
242709
|
async function readFunction(configPath) {
|
|
242554
|
-
const
|
|
242710
|
+
const config6 = await readFunctionConfig(configPath);
|
|
242555
242711
|
const functionDir = dirname3(configPath);
|
|
242556
|
-
const entryPath =
|
|
242712
|
+
const entryPath = join6(functionDir, config6.entry);
|
|
242557
242713
|
if (!await pathExists(entryPath)) {
|
|
242558
242714
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
242559
242715
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -242563,7 +242719,7 @@ async function readFunction(configPath) {
|
|
|
242563
242719
|
cwd: functionDir,
|
|
242564
242720
|
absolute: true
|
|
242565
242721
|
});
|
|
242566
|
-
const functionData = { ...
|
|
242722
|
+
const functionData = { ...config6, entryPath, filePaths };
|
|
242567
242723
|
return functionData;
|
|
242568
242724
|
}
|
|
242569
242725
|
async function readAllFunctions(functionsDir) {
|
|
@@ -242687,28 +242843,28 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
242687
242843
|
return results;
|
|
242688
242844
|
}
|
|
242689
242845
|
// src/core/resources/function/pull.ts
|
|
242690
|
-
import { join as
|
|
242691
|
-
import { isDeepStrictEqual as
|
|
242846
|
+
import { join as join7 } from "node:path";
|
|
242847
|
+
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
242692
242848
|
async function writeFunctions(functionsDir, functions) {
|
|
242693
242849
|
const written = [];
|
|
242694
242850
|
const skipped = [];
|
|
242695
242851
|
for (const fn of functions) {
|
|
242696
|
-
const functionDir =
|
|
242697
|
-
const configPath =
|
|
242852
|
+
const functionDir = join7(functionsDir, fn.name);
|
|
242853
|
+
const configPath = join7(functionDir, "function.jsonc");
|
|
242698
242854
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
242699
242855
|
skipped.push(fn.name);
|
|
242700
242856
|
continue;
|
|
242701
242857
|
}
|
|
242702
|
-
const
|
|
242858
|
+
const config6 = {
|
|
242703
242859
|
name: fn.name,
|
|
242704
242860
|
entry: fn.entry
|
|
242705
242861
|
};
|
|
242706
242862
|
if (fn.automations.length > 0) {
|
|
242707
|
-
|
|
242863
|
+
config6.automations = fn.automations;
|
|
242708
242864
|
}
|
|
242709
|
-
await writeJsonFile(configPath,
|
|
242865
|
+
await writeJsonFile(configPath, config6);
|
|
242710
242866
|
for (const file2 of fn.files) {
|
|
242711
|
-
await writeFile(
|
|
242867
|
+
await writeFile(join7(functionDir, file2.path), file2.content);
|
|
242712
242868
|
}
|
|
242713
242869
|
written.push(fn.name);
|
|
242714
242870
|
}
|
|
@@ -242718,20 +242874,20 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
242718
242874
|
if (!await pathExists(functionDir)) {
|
|
242719
242875
|
return false;
|
|
242720
242876
|
}
|
|
242721
|
-
const configPath =
|
|
242877
|
+
const configPath = join7(functionDir, "function.jsonc");
|
|
242722
242878
|
try {
|
|
242723
242879
|
const localConfig = await readJsonFile(configPath);
|
|
242724
242880
|
if (localConfig.entry !== fn.entry) {
|
|
242725
242881
|
return false;
|
|
242726
242882
|
}
|
|
242727
|
-
if (!
|
|
242883
|
+
if (!isDeepStrictEqual4(localConfig.automations ?? [], fn.automations)) {
|
|
242728
242884
|
return false;
|
|
242729
242885
|
}
|
|
242730
242886
|
} catch {
|
|
242731
242887
|
return false;
|
|
242732
242888
|
}
|
|
242733
242889
|
for (const file2 of fn.files) {
|
|
242734
|
-
const filePath =
|
|
242890
|
+
const filePath = join7(functionDir, file2.path);
|
|
242735
242891
|
if (!await pathExists(filePath)) {
|
|
242736
242892
|
return false;
|
|
242737
242893
|
}
|
|
@@ -242789,18 +242945,20 @@ async function readProjectConfig(projectRoot) {
|
|
|
242789
242945
|
}
|
|
242790
242946
|
const project = result.data;
|
|
242791
242947
|
const configDir = dirname5(configPath);
|
|
242792
|
-
const [entities, functions, agents, connectors] = await Promise.all([
|
|
242793
|
-
entityResource.readAll(
|
|
242794
|
-
functionResource.readAll(
|
|
242795
|
-
agentResource.readAll(
|
|
242796
|
-
connectorResource.readAll(
|
|
242948
|
+
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
242949
|
+
entityResource.readAll(join8(configDir, project.entitiesDir)),
|
|
242950
|
+
functionResource.readAll(join8(configDir, project.functionsDir)),
|
|
242951
|
+
agentResource.readAll(join8(configDir, project.agentsDir)),
|
|
242952
|
+
connectorResource.readAll(join8(configDir, project.connectorsDir)),
|
|
242953
|
+
authConfigResource.readAll(join8(configDir, project.authDir))
|
|
242797
242954
|
]);
|
|
242798
242955
|
return {
|
|
242799
242956
|
project: { ...project, root, configPath },
|
|
242800
242957
|
entities,
|
|
242801
242958
|
functions,
|
|
242802
242959
|
agents,
|
|
242803
|
-
connectors
|
|
242960
|
+
connectors,
|
|
242961
|
+
authConfig
|
|
242804
242962
|
};
|
|
242805
242963
|
}
|
|
242806
242964
|
|
|
@@ -242825,9 +242983,9 @@ async function initAppConfig() {
|
|
|
242825
242983
|
if (!projectRoot) {
|
|
242826
242984
|
throw new ConfigNotFoundError("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
|
|
242827
242985
|
}
|
|
242828
|
-
const
|
|
242986
|
+
const config7 = await readAppConfig(projectRoot.root);
|
|
242829
242987
|
const appConfigPath = await findAppConfigPath(projectRoot.root);
|
|
242830
|
-
if (!
|
|
242988
|
+
if (!config7?.id) {
|
|
242831
242989
|
throw new ConfigInvalidError("App not configured. Create a .app.jsonc file or run 'base44 link' to link this project.", appConfigPath, {
|
|
242832
242990
|
hints: [
|
|
242833
242991
|
{
|
|
@@ -242837,7 +242995,7 @@ async function initAppConfig() {
|
|
|
242837
242995
|
]
|
|
242838
242996
|
});
|
|
242839
242997
|
}
|
|
242840
|
-
cache2 = { projectRoot: projectRoot.root, id:
|
|
242998
|
+
cache2 = { projectRoot: projectRoot.root, id: config7.id };
|
|
242841
242999
|
return cache2;
|
|
242842
243000
|
}
|
|
242843
243001
|
function getAppConfig() {
|
|
@@ -242846,8 +243004,8 @@ function getAppConfig() {
|
|
|
242846
243004
|
}
|
|
242847
243005
|
return cache2;
|
|
242848
243006
|
}
|
|
242849
|
-
function setAppConfig(
|
|
242850
|
-
cache2 =
|
|
243007
|
+
function setAppConfig(config7) {
|
|
243008
|
+
cache2 = config7;
|
|
242851
243009
|
}
|
|
242852
243010
|
function generateAppConfigContent(id) {
|
|
242853
243011
|
return `// Base44 App Configuration
|
|
@@ -242978,16 +243136,16 @@ async function getSiteUrl(projectId) {
|
|
|
242978
243136
|
// src/core/project/template.ts
|
|
242979
243137
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
242980
243138
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
242981
|
-
import { dirname as dirname6, join as
|
|
243139
|
+
import { dirname as dirname6, join as join10 } from "node:path";
|
|
242982
243140
|
|
|
242983
243141
|
// src/core/assets.ts
|
|
242984
243142
|
import { cpSync, existsSync } from "node:fs";
|
|
242985
243143
|
import { homedir as homedir2 } from "node:os";
|
|
242986
|
-
import { join as
|
|
243144
|
+
import { join as join9 } from "node:path";
|
|
242987
243145
|
// package.json
|
|
242988
243146
|
var package_default = {
|
|
242989
243147
|
name: "base44",
|
|
242990
|
-
version: "0.0.
|
|
243148
|
+
version: "0.0.48",
|
|
242991
243149
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
242992
243150
|
type: "module",
|
|
242993
243151
|
bin: {
|
|
@@ -243027,6 +243185,7 @@ var package_default = {
|
|
|
243027
243185
|
},
|
|
243028
243186
|
devDependencies: {
|
|
243029
243187
|
"@base44-cli/logger": "workspace:*",
|
|
243188
|
+
"@base44/sdk": "^0.8.23",
|
|
243030
243189
|
"@clack/prompts": "^1.0.1",
|
|
243031
243190
|
"@seald-io/nedb": "^4.1.2",
|
|
243032
243191
|
"@types/bun": "^1.2.15",
|
|
@@ -243077,18 +243236,18 @@ var package_default = {
|
|
|
243077
243236
|
};
|
|
243078
243237
|
|
|
243079
243238
|
// src/core/assets.ts
|
|
243080
|
-
var ASSETS_DIR =
|
|
243239
|
+
var ASSETS_DIR = join9(homedir2(), ".base44", "assets", package_default.version);
|
|
243081
243240
|
function getTemplatesDir() {
|
|
243082
|
-
return
|
|
243241
|
+
return join9(ASSETS_DIR, "templates");
|
|
243083
243242
|
}
|
|
243084
243243
|
function getTemplatesIndexPath() {
|
|
243085
|
-
return
|
|
243244
|
+
return join9(ASSETS_DIR, "templates", "templates.json");
|
|
243086
243245
|
}
|
|
243087
243246
|
function getDenoWrapperPath() {
|
|
243088
|
-
return
|
|
243247
|
+
return join9(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
243089
243248
|
}
|
|
243090
243249
|
function getExecWrapperPath() {
|
|
243091
|
-
return
|
|
243250
|
+
return join9(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
243092
243251
|
}
|
|
243093
243252
|
function ensureNpmAssets(sourceDir) {
|
|
243094
243253
|
if (existsSync(ASSETS_DIR))
|
|
@@ -243109,23 +243268,23 @@ async function listTemplates() {
|
|
|
243109
243268
|
return result.data.templates;
|
|
243110
243269
|
}
|
|
243111
243270
|
async function renderTemplate(template, destPath, data) {
|
|
243112
|
-
const templateDir =
|
|
243271
|
+
const templateDir = join10(getTemplatesDir(), template.path);
|
|
243113
243272
|
const files = await globby("**/*", {
|
|
243114
243273
|
cwd: templateDir,
|
|
243115
243274
|
dot: true,
|
|
243116
243275
|
onlyFiles: true
|
|
243117
243276
|
});
|
|
243118
243277
|
for (const file2 of files) {
|
|
243119
|
-
const srcPath =
|
|
243278
|
+
const srcPath = join10(templateDir, file2);
|
|
243120
243279
|
try {
|
|
243121
243280
|
if (file2.endsWith(".ejs")) {
|
|
243122
243281
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
243123
243282
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243124
|
-
const destFile = attributes.outputFileName ?
|
|
243125
|
-
const destFilePath =
|
|
243283
|
+
const destFile = attributes.outputFileName ? join10(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
243284
|
+
const destFilePath = join10(destPath, destFile);
|
|
243126
243285
|
await writeFile(destFilePath, body);
|
|
243127
243286
|
} else {
|
|
243128
|
-
const destFilePath =
|
|
243287
|
+
const destFilePath = join10(destPath, file2);
|
|
243129
243288
|
await copyFile(srcPath, destFilePath);
|
|
243130
243289
|
}
|
|
243131
243290
|
} catch (error48) {
|
|
@@ -243200,7 +243359,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
243200
243359
|
// src/core/site/deploy.ts
|
|
243201
243360
|
import { randomUUID } from "node:crypto";
|
|
243202
243361
|
import { tmpdir } from "node:os";
|
|
243203
|
-
import { join as
|
|
243362
|
+
import { join as join11 } from "node:path";
|
|
243204
243363
|
async function deploySite(siteOutputDir) {
|
|
243205
243364
|
if (!await pathExists(siteOutputDir)) {
|
|
243206
243365
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -243217,7 +243376,7 @@ async function deploySite(siteOutputDir) {
|
|
|
243217
243376
|
]
|
|
243218
243377
|
});
|
|
243219
243378
|
}
|
|
243220
|
-
const archivePath =
|
|
243379
|
+
const archivePath = join11(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
243221
243380
|
try {
|
|
243222
243381
|
await createArchive(siteOutputDir, archivePath);
|
|
243223
243382
|
return await uploadSite(archivePath);
|
|
@@ -243234,22 +243393,24 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
243234
243393
|
}
|
|
243235
243394
|
// src/core/project/deploy.ts
|
|
243236
243395
|
function hasResourcesToDeploy(projectData) {
|
|
243237
|
-
const { project, entities, functions, agents, connectors } = projectData;
|
|
243396
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
243238
243397
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
243239
243398
|
const hasEntities = entities.length > 0;
|
|
243240
243399
|
const hasFunctions = functions.length > 0;
|
|
243241
243400
|
const hasAgents = agents.length > 0;
|
|
243242
243401
|
const hasConnectors = connectors.length > 0;
|
|
243243
|
-
|
|
243402
|
+
const hasAuthConfig = authConfig.length > 0;
|
|
243403
|
+
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
|
|
243244
243404
|
}
|
|
243245
243405
|
async function deployAll(projectData, options) {
|
|
243246
|
-
const { project, entities, functions, agents, connectors } = projectData;
|
|
243406
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
243247
243407
|
await entityResource.push(entities);
|
|
243248
243408
|
await deployFunctionsSequentially(functions, {
|
|
243249
243409
|
onStart: options?.onFunctionStart,
|
|
243250
243410
|
onResult: options?.onFunctionResult
|
|
243251
243411
|
});
|
|
243252
243412
|
await agentResource.push(agents);
|
|
243413
|
+
await authConfigResource.push(authConfig);
|
|
243253
243414
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
243254
243415
|
if (project.site?.outputDirectory) {
|
|
243255
243416
|
const outputDir = resolve(project.root, project.site.outputDirectory);
|
|
@@ -243436,7 +243597,7 @@ async function getUserInfo(accessToken) {
|
|
|
243436
243597
|
return result.data;
|
|
243437
243598
|
}
|
|
243438
243599
|
// src/cli/commands/auth/login-flow.ts
|
|
243439
|
-
async function generateAndDisplayDeviceCode(log
|
|
243600
|
+
async function generateAndDisplayDeviceCode(log) {
|
|
243440
243601
|
const deviceCodeResponse = await runTask("Generating device code...", async () => {
|
|
243441
243602
|
return await generateDeviceCode();
|
|
243442
243603
|
}, {
|
|
@@ -243447,7 +243608,7 @@ async function generateAndDisplayDeviceCode(log, runTask) {
|
|
|
243447
243608
|
Please confirm this code at: ${deviceCodeResponse.verificationUri}`);
|
|
243448
243609
|
return deviceCodeResponse;
|
|
243449
243610
|
}
|
|
243450
|
-
async function waitForAuthentication(deviceCode, expiresIn, interval
|
|
243611
|
+
async function waitForAuthentication(deviceCode, expiresIn, interval) {
|
|
243451
243612
|
let tokenResponse;
|
|
243452
243613
|
try {
|
|
243453
243614
|
await runTask("Waiting for authentication...", async () => {
|
|
@@ -243487,12 +243648,9 @@ async function saveAuthData(response, userInfo) {
|
|
|
243487
243648
|
name: userInfo.name
|
|
243488
243649
|
});
|
|
243489
243650
|
}
|
|
243490
|
-
async function login({
|
|
243491
|
-
log
|
|
243492
|
-
|
|
243493
|
-
}) {
|
|
243494
|
-
const deviceCodeResponse = await generateAndDisplayDeviceCode(log, runTask);
|
|
243495
|
-
const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval, runTask);
|
|
243651
|
+
async function login({ log }) {
|
|
243652
|
+
const deviceCodeResponse = await generateAndDisplayDeviceCode(log);
|
|
243653
|
+
const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
|
|
243496
243654
|
const userInfo = await getUserInfo(token.accessToken);
|
|
243497
243655
|
await saveAuthData(token, userInfo);
|
|
243498
243656
|
return {
|
|
@@ -250225,6 +250383,20 @@ var onPromptCancel = () => {
|
|
|
250225
250383
|
Ne("Operation cancelled.");
|
|
250226
250384
|
throw new CLIExitError(0);
|
|
250227
250385
|
};
|
|
250386
|
+
// src/cli/utils/runTask.ts
|
|
250387
|
+
async function runTask(startMessage, operation, options) {
|
|
250388
|
+
const s = bt2();
|
|
250389
|
+
s.start(startMessage);
|
|
250390
|
+
const updateMessage = (message) => s.message(message);
|
|
250391
|
+
try {
|
|
250392
|
+
const result = await operation(updateMessage);
|
|
250393
|
+
s.stop(options?.successMessage || startMessage);
|
|
250394
|
+
return result;
|
|
250395
|
+
} catch (error48) {
|
|
250396
|
+
s.error(options?.errorMessage || "Failed");
|
|
250397
|
+
throw error48;
|
|
250398
|
+
}
|
|
250399
|
+
}
|
|
250228
250400
|
// src/cli/utils/urls.ts
|
|
250229
250401
|
function getDashboardUrl(projectId) {
|
|
250230
250402
|
const id = projectId ?? getAppConfig().id;
|
|
@@ -250377,12 +250549,11 @@ async function parseEnvFile(filePath) {
|
|
|
250377
250549
|
}
|
|
250378
250550
|
// src/cli/commands/agents/pull.ts
|
|
250379
250551
|
async function pullAgentsAction({
|
|
250380
|
-
log
|
|
250381
|
-
runTask
|
|
250552
|
+
log
|
|
250382
250553
|
}) {
|
|
250383
250554
|
const { project: project2 } = await readProjectConfig();
|
|
250384
250555
|
const configDir = dirname7(project2.configPath);
|
|
250385
|
-
const agentsDir =
|
|
250556
|
+
const agentsDir = join12(configDir, project2.agentsDir);
|
|
250386
250557
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
250387
250558
|
return await fetchAgents();
|
|
250388
250559
|
}, {
|
|
@@ -250414,8 +250585,7 @@ function getAgentsPullCommand() {
|
|
|
250414
250585
|
|
|
250415
250586
|
// src/cli/commands/agents/push.ts
|
|
250416
250587
|
async function pushAgentsAction({
|
|
250417
|
-
log
|
|
250418
|
-
runTask
|
|
250588
|
+
log
|
|
250419
250589
|
}) {
|
|
250420
250590
|
const { agents } = await readProjectConfig();
|
|
250421
250591
|
log.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
|
|
@@ -250445,6 +250615,121 @@ function getAgentsCommand() {
|
|
|
250445
250615
|
return new Command("agents").description("Manage project agents").addCommand(getAgentsPushCommand()).addCommand(getAgentsPullCommand());
|
|
250446
250616
|
}
|
|
250447
250617
|
|
|
250618
|
+
// src/cli/commands/auth/password-login.ts
|
|
250619
|
+
import { dirname as dirname8, join as join13 } from "node:path";
|
|
250620
|
+
function validateAction(action) {
|
|
250621
|
+
if (action !== "enable" && action !== "disable") {
|
|
250622
|
+
throw new InvalidInputError(`Invalid action "${action}". Must be "enable" or "disable".`, {
|
|
250623
|
+
hints: [
|
|
250624
|
+
{
|
|
250625
|
+
message: "Enable password auth: base44 auth password-login enable",
|
|
250626
|
+
command: "base44 auth password-login enable"
|
|
250627
|
+
},
|
|
250628
|
+
{
|
|
250629
|
+
message: "Disable password auth: base44 auth password-login disable",
|
|
250630
|
+
command: "base44 auth password-login disable"
|
|
250631
|
+
}
|
|
250632
|
+
]
|
|
250633
|
+
});
|
|
250634
|
+
}
|
|
250635
|
+
}
|
|
250636
|
+
async function passwordLoginAction({ log }, action) {
|
|
250637
|
+
validateAction(action);
|
|
250638
|
+
const shouldEnable = action === "enable";
|
|
250639
|
+
const { project: project2 } = await readProjectConfig();
|
|
250640
|
+
const configDir = dirname8(project2.configPath);
|
|
250641
|
+
const authDir = join13(configDir, project2.authDir);
|
|
250642
|
+
const updated = await runTask("Updating local auth config", async () => {
|
|
250643
|
+
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
250644
|
+
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
250645
|
+
await writeAuthConfig(authDir, merged);
|
|
250646
|
+
return merged;
|
|
250647
|
+
});
|
|
250648
|
+
if (!shouldEnable && !hasAnyLoginMethod(updated)) {
|
|
250649
|
+
log.warn("Disabling password auth will leave no login methods enabled. Users will be locked out.");
|
|
250650
|
+
}
|
|
250651
|
+
const newStatus = shouldEnable ? "enabled" : "disabled";
|
|
250652
|
+
return {
|
|
250653
|
+
outroMessage: `Username & password authentication ${newStatus} in local config. Run \`base44 auth push\` or \`base44 deploy\` to apply.`
|
|
250654
|
+
};
|
|
250655
|
+
}
|
|
250656
|
+
function getPasswordLoginCommand() {
|
|
250657
|
+
return new Base44Command("password-login").description("Enable or disable username & password authentication").argument("<enable|disable>", "enable or disable password authentication").action(passwordLoginAction);
|
|
250658
|
+
}
|
|
250659
|
+
|
|
250660
|
+
// src/cli/commands/auth/pull.ts
|
|
250661
|
+
import { dirname as dirname9, join as join14 } from "node:path";
|
|
250662
|
+
async function pullAuthAction({ log }) {
|
|
250663
|
+
const { project: project2 } = await readProjectConfig();
|
|
250664
|
+
const configDir = dirname9(project2.configPath);
|
|
250665
|
+
const authDir = join14(configDir, project2.authDir);
|
|
250666
|
+
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
250667
|
+
return await pullAuthConfig();
|
|
250668
|
+
}, {
|
|
250669
|
+
successMessage: "Auth config fetched successfully",
|
|
250670
|
+
errorMessage: "Failed to fetch auth config"
|
|
250671
|
+
});
|
|
250672
|
+
const { written } = await runTask("Syncing auth config file", async () => {
|
|
250673
|
+
return await writeAuthConfig(authDir, remoteConfig);
|
|
250674
|
+
}, {
|
|
250675
|
+
successMessage: "Auth config file synced successfully",
|
|
250676
|
+
errorMessage: "Failed to sync auth config file"
|
|
250677
|
+
});
|
|
250678
|
+
if (written) {
|
|
250679
|
+
log.success("Auth config written to local file");
|
|
250680
|
+
} else {
|
|
250681
|
+
log.info("Auth config is already up to date");
|
|
250682
|
+
}
|
|
250683
|
+
return {
|
|
250684
|
+
outroMessage: `Pulled auth config to ${authDir} (overwrites local file)`
|
|
250685
|
+
};
|
|
250686
|
+
}
|
|
250687
|
+
function getAuthPullCommand() {
|
|
250688
|
+
return new Base44Command("pull").description("Pull auth config from Base44 to local file").action(pullAuthAction);
|
|
250689
|
+
}
|
|
250690
|
+
|
|
250691
|
+
// src/cli/commands/auth/push.ts
|
|
250692
|
+
async function pushAuthAction({ isNonInteractive, log }, options) {
|
|
250693
|
+
const { authConfig } = await readProjectConfig();
|
|
250694
|
+
if (authConfig.length === 0) {
|
|
250695
|
+
log.info("No local auth config found");
|
|
250696
|
+
return {
|
|
250697
|
+
outroMessage: "No auth config to push. Run `base44 auth pull` to fetch the remote config first."
|
|
250698
|
+
};
|
|
250699
|
+
}
|
|
250700
|
+
if (!hasAnyLoginMethod(authConfig[0])) {
|
|
250701
|
+
log.warn("This config has no login methods enabled. Pushing it will lock out all users.");
|
|
250702
|
+
}
|
|
250703
|
+
if (!options.yes) {
|
|
250704
|
+
if (isNonInteractive) {
|
|
250705
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
250706
|
+
}
|
|
250707
|
+
const shouldPush = await Re({
|
|
250708
|
+
message: "Push auth config to Base44?"
|
|
250709
|
+
});
|
|
250710
|
+
if (Ct(shouldPush) || !shouldPush) {
|
|
250711
|
+
return { outroMessage: "Push cancelled" };
|
|
250712
|
+
}
|
|
250713
|
+
}
|
|
250714
|
+
await runTask("Pushing auth config to Base44", async () => {
|
|
250715
|
+
return await pushAuthConfig(authConfig[0] ?? null);
|
|
250716
|
+
}, {
|
|
250717
|
+
successMessage: "Auth config pushed successfully",
|
|
250718
|
+
errorMessage: "Failed to push auth config"
|
|
250719
|
+
});
|
|
250720
|
+
return {
|
|
250721
|
+
outroMessage: "Auth config pushed to Base44"
|
|
250722
|
+
};
|
|
250723
|
+
}
|
|
250724
|
+
function getAuthPushCommand() {
|
|
250725
|
+
return new Base44Command("push").description("Push local auth config to Base44").option("-y, --yes", "Skip confirmation prompt").action(pushAuthAction);
|
|
250726
|
+
}
|
|
250727
|
+
|
|
250728
|
+
// src/cli/commands/auth/index.ts
|
|
250729
|
+
function getAuthCommand() {
|
|
250730
|
+
return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
|
|
250731
|
+
}
|
|
250732
|
+
|
|
250448
250733
|
// src/cli/commands/auth/login.ts
|
|
250449
250734
|
function getLoginCommand() {
|
|
250450
250735
|
return new Base44Command("login", {
|
|
@@ -250476,8 +250761,7 @@ function getWhoamiCommand() {
|
|
|
250476
250761
|
|
|
250477
250762
|
// src/cli/commands/connectors/list-available.ts
|
|
250478
250763
|
async function listAvailableAction({
|
|
250479
|
-
log
|
|
250480
|
-
runTask
|
|
250764
|
+
log
|
|
250481
250765
|
}) {
|
|
250482
250766
|
const { integrations } = await runTask("Fetching available integrations from Base44", async () => {
|
|
250483
250767
|
return await listAvailableIntegrations();
|
|
@@ -250504,14 +250788,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
250504
250788
|
}
|
|
250505
250789
|
|
|
250506
250790
|
// src/cli/commands/connectors/pull.ts
|
|
250507
|
-
import { dirname as
|
|
250791
|
+
import { dirname as dirname10, join as join15 } from "node:path";
|
|
250508
250792
|
async function pullConnectorsAction({
|
|
250509
|
-
log
|
|
250510
|
-
runTask
|
|
250793
|
+
log
|
|
250511
250794
|
}) {
|
|
250512
250795
|
const { project: project2 } = await readProjectConfig();
|
|
250513
|
-
const configDir =
|
|
250514
|
-
const connectorsDir =
|
|
250796
|
+
const configDir = dirname10(project2.configPath);
|
|
250797
|
+
const connectorsDir = join15(configDir, project2.connectorsDir);
|
|
250515
250798
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
250516
250799
|
return await pullAllConnectors();
|
|
250517
250800
|
}, {
|
|
@@ -251296,8 +251579,7 @@ function printSummary(results, oauthOutcomes, log) {
|
|
|
251296
251579
|
}
|
|
251297
251580
|
async function pushConnectorsAction({
|
|
251298
251581
|
isNonInteractive,
|
|
251299
|
-
log
|
|
251300
|
-
runTask
|
|
251582
|
+
log
|
|
251301
251583
|
}) {
|
|
251302
251584
|
const { connectors } = await readProjectConfig();
|
|
251303
251585
|
if (connectors.length === 0) {
|
|
@@ -251351,8 +251633,7 @@ function getDashboardCommand() {
|
|
|
251351
251633
|
|
|
251352
251634
|
// src/cli/commands/entities/push.ts
|
|
251353
251635
|
async function pushEntitiesAction({
|
|
251354
|
-
log
|
|
251355
|
-
runTask
|
|
251636
|
+
log
|
|
251356
251637
|
}) {
|
|
251357
251638
|
const { entities } = await readProjectConfig();
|
|
251358
251639
|
if (entities.length === 0) {
|
|
@@ -251382,7 +251663,7 @@ function getEntitiesPushCommand() {
|
|
|
251382
251663
|
}
|
|
251383
251664
|
|
|
251384
251665
|
// src/cli/commands/functions/delete.ts
|
|
251385
|
-
async function deleteFunctionsAction(
|
|
251666
|
+
async function deleteFunctionsAction(_ctx, names) {
|
|
251386
251667
|
let deleted = 0;
|
|
251387
251668
|
let notFound = 0;
|
|
251388
251669
|
let errors5 = 0;
|
|
@@ -251545,8 +251826,7 @@ function getDeployCommand() {
|
|
|
251545
251826
|
|
|
251546
251827
|
// src/cli/commands/functions/list.ts
|
|
251547
251828
|
async function listFunctionsAction({
|
|
251548
|
-
log
|
|
251549
|
-
runTask
|
|
251829
|
+
log
|
|
251550
251830
|
}) {
|
|
251551
251831
|
const { functions } = await runTask("Fetching functions...", async () => listDeployedFunctions(), { errorMessage: "Failed to fetch functions" });
|
|
251552
251832
|
if (functions.length === 0) {
|
|
@@ -251566,11 +251846,11 @@ function getListCommand() {
|
|
|
251566
251846
|
}
|
|
251567
251847
|
|
|
251568
251848
|
// src/cli/commands/functions/pull.ts
|
|
251569
|
-
import { dirname as
|
|
251570
|
-
async function pullFunctionsAction({ log
|
|
251849
|
+
import { dirname as dirname11, join as join16 } from "node:path";
|
|
251850
|
+
async function pullFunctionsAction({ log }, name2) {
|
|
251571
251851
|
const { project: project2 } = await readProjectConfig();
|
|
251572
|
-
const configDir =
|
|
251573
|
-
const functionsDir =
|
|
251852
|
+
const configDir = dirname11(project2.configPath);
|
|
251853
|
+
const functionsDir = join16(configDir, project2.functionsDir);
|
|
251574
251854
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
251575
251855
|
const { functions } = await listDeployedFunctions();
|
|
251576
251856
|
return functions;
|
|
@@ -251613,7 +251893,7 @@ function getFunctionsCommand() {
|
|
|
251613
251893
|
}
|
|
251614
251894
|
|
|
251615
251895
|
// src/cli/commands/project/create.ts
|
|
251616
|
-
import { basename as basename3, join as
|
|
251896
|
+
import { basename as basename3, join as join17, resolve as resolve2 } from "node:path";
|
|
251617
251897
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
251618
251898
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
251619
251899
|
async function getTemplateById(templateId) {
|
|
@@ -251633,7 +251913,7 @@ function validateNonInteractiveFlags(command2) {
|
|
|
251633
251913
|
command2.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
|
|
251634
251914
|
}
|
|
251635
251915
|
}
|
|
251636
|
-
async function createInteractive(options,
|
|
251916
|
+
async function createInteractive(options, log) {
|
|
251637
251917
|
const templates = await listTemplates();
|
|
251638
251918
|
const templateOptions = templates.map((t) => ({
|
|
251639
251919
|
value: t,
|
|
@@ -251675,10 +251955,10 @@ async function createInteractive(options, ctx) {
|
|
|
251675
251955
|
deploy: options.deploy,
|
|
251676
251956
|
skills: options.skills,
|
|
251677
251957
|
isInteractive: true
|
|
251678
|
-
},
|
|
251958
|
+
}, log);
|
|
251679
251959
|
}
|
|
251680
|
-
async function createNonInteractive(options,
|
|
251681
|
-
|
|
251960
|
+
async function createNonInteractive(options, log) {
|
|
251961
|
+
log.info(`Creating a new project at ${resolve2(options.path)}`);
|
|
251682
251962
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
251683
251963
|
return await executeCreate({
|
|
251684
251964
|
template: template2,
|
|
@@ -251687,7 +251967,7 @@ async function createNonInteractive(options, ctx) {
|
|
|
251687
251967
|
deploy: options.deploy,
|
|
251688
251968
|
skills: options.skills,
|
|
251689
251969
|
isInteractive: false
|
|
251690
|
-
},
|
|
251970
|
+
}, log);
|
|
251691
251971
|
}
|
|
251692
251972
|
async function executeCreate({
|
|
251693
251973
|
template: template2,
|
|
@@ -251697,7 +251977,7 @@ async function executeCreate({
|
|
|
251697
251977
|
deploy: deploy5,
|
|
251698
251978
|
skills,
|
|
251699
251979
|
isInteractive
|
|
251700
|
-
},
|
|
251980
|
+
}, log) {
|
|
251701
251981
|
const name2 = rawName.trim();
|
|
251702
251982
|
const resolvedPath = resolve2(projectPath);
|
|
251703
251983
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -251750,7 +252030,7 @@ async function executeCreate({
|
|
|
251750
252030
|
updateMessage("Building project...");
|
|
251751
252031
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
251752
252032
|
updateMessage("Deploying site...");
|
|
251753
|
-
return await deploySite(
|
|
252033
|
+
return await deploySite(join17(resolvedPath, outputDirectory));
|
|
251754
252034
|
}, {
|
|
251755
252035
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
251756
252036
|
errorMessage: "Failed to deploy site"
|
|
@@ -251779,7 +252059,7 @@ async function executeCreate({
|
|
|
251779
252059
|
}
|
|
251780
252060
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
251781
252061
|
}
|
|
251782
|
-
async function createAction({ log,
|
|
252062
|
+
async function createAction({ log, isNonInteractive }, name2, options) {
|
|
251783
252063
|
if (name2 && !options.path) {
|
|
251784
252064
|
options.path = `./${import_kebabCase.default(name2)}`;
|
|
251785
252065
|
}
|
|
@@ -251793,11 +252073,10 @@ async function createAction({ log, runTask, isNonInteractive }, name2, options)
|
|
|
251793
252073
|
]
|
|
251794
252074
|
});
|
|
251795
252075
|
}
|
|
251796
|
-
const ctx = { log, runTask };
|
|
251797
252076
|
if (skipPrompts) {
|
|
251798
|
-
return await createNonInteractive({ name: options.name ?? name2, ...options },
|
|
252077
|
+
return await createNonInteractive({ name: options.name ?? name2, ...options }, log);
|
|
251799
252078
|
}
|
|
251800
|
-
return await createInteractive({ name: name2, ...options },
|
|
252079
|
+
return await createInteractive({ name: name2, ...options }, log);
|
|
251801
252080
|
}
|
|
251802
252081
|
function getCreateCommand() {
|
|
251803
252082
|
return new Base44Command("create", {
|
|
@@ -251821,7 +252100,7 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
251821
252100
|
outroMessage: "No resources found to deploy"
|
|
251822
252101
|
};
|
|
251823
252102
|
}
|
|
251824
|
-
const { project: project2, entities, functions, agents, connectors } = projectData;
|
|
252103
|
+
const { project: project2, entities, functions, agents, connectors, authConfig } = projectData;
|
|
251825
252104
|
const summaryLines = [];
|
|
251826
252105
|
if (entities.length > 0) {
|
|
251827
252106
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -251835,6 +252114,9 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
251835
252114
|
if (connectors.length > 0) {
|
|
251836
252115
|
summaryLines.push(` - ${connectors.length} ${connectors.length === 1 ? "connector" : "connectors"}`);
|
|
251837
252116
|
}
|
|
252117
|
+
if (authConfig.length > 0) {
|
|
252118
|
+
summaryLines.push(" - Auth config");
|
|
252119
|
+
}
|
|
251838
252120
|
if (project2.site?.outputDirectory) {
|
|
251839
252121
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
251840
252122
|
}
|
|
@@ -251974,7 +252256,7 @@ async function promptForExistingProject(linkableProjects) {
|
|
|
251974
252256
|
return selectedProject;
|
|
251975
252257
|
}
|
|
251976
252258
|
async function link(ctx, options) {
|
|
251977
|
-
const { log,
|
|
252259
|
+
const { log, isNonInteractive } = ctx;
|
|
251978
252260
|
const skipPrompts = !!options.create || !!options.projectId;
|
|
251979
252261
|
if (!skipPrompts && isNonInteractive) {
|
|
251980
252262
|
throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
|
|
@@ -252170,7 +252452,7 @@ function getLogsCommand() {
|
|
|
252170
252452
|
}
|
|
252171
252453
|
|
|
252172
252454
|
// src/cli/commands/secrets/delete.ts
|
|
252173
|
-
async function deleteSecretAction(
|
|
252455
|
+
async function deleteSecretAction(_ctx, key) {
|
|
252174
252456
|
await runTask(`Deleting secret "${key}"`, async () => {
|
|
252175
252457
|
return await deleteSecret(key);
|
|
252176
252458
|
}, {
|
|
@@ -252187,8 +252469,7 @@ function getSecretsDeleteCommand() {
|
|
|
252187
252469
|
|
|
252188
252470
|
// src/cli/commands/secrets/list.ts
|
|
252189
252471
|
async function listSecretsAction({
|
|
252190
|
-
log
|
|
252191
|
-
runTask
|
|
252472
|
+
log
|
|
252192
252473
|
}) {
|
|
252193
252474
|
const secrets = await runTask("Fetching secrets from Base44", async () => {
|
|
252194
252475
|
return await listSecrets();
|
|
@@ -252239,7 +252520,7 @@ function validateInput(entries, options) {
|
|
|
252239
252520
|
throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
|
|
252240
252521
|
}
|
|
252241
252522
|
}
|
|
252242
|
-
async function setSecretsAction({ log
|
|
252523
|
+
async function setSecretsAction({ log }, entries, options) {
|
|
252243
252524
|
validateInput(entries, options);
|
|
252244
252525
|
let secrets;
|
|
252245
252526
|
if (options.envFile) {
|
|
@@ -252273,7 +252554,7 @@ function getSecretsCommand() {
|
|
|
252273
252554
|
|
|
252274
252555
|
// src/cli/commands/site/deploy.ts
|
|
252275
252556
|
import { resolve as resolve4 } from "node:path";
|
|
252276
|
-
async function deployAction2({ isNonInteractive
|
|
252557
|
+
async function deployAction2({ isNonInteractive }, options) {
|
|
252277
252558
|
if (isNonInteractive && !options.yes) {
|
|
252278
252559
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
252279
252560
|
}
|
|
@@ -252384,9 +252665,9 @@ async function generateContent(input) {
|
|
|
252384
252665
|
`);
|
|
252385
252666
|
}
|
|
252386
252667
|
async function compileEntity(entity2) {
|
|
252387
|
-
const { name: name2, ...
|
|
252668
|
+
const { name: name2, ...schema10 } = entity2;
|
|
252388
252669
|
const jsonSchema = {
|
|
252389
|
-
...
|
|
252670
|
+
...schema10,
|
|
252390
252671
|
title: name2,
|
|
252391
252672
|
additionalProperties: false
|
|
252392
252673
|
};
|
|
@@ -252413,10 +252694,10 @@ function toPascalCase(name2) {
|
|
|
252413
252694
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
252414
252695
|
}
|
|
252415
252696
|
// src/core/types/update-project.ts
|
|
252416
|
-
import { join as
|
|
252697
|
+
import { join as join20 } from "node:path";
|
|
252417
252698
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
252418
252699
|
async function updateProjectConfig(projectRoot) {
|
|
252419
|
-
const tsconfigPath =
|
|
252700
|
+
const tsconfigPath = join20(projectRoot, "tsconfig.json");
|
|
252420
252701
|
if (!await pathExists(tsconfigPath)) {
|
|
252421
252702
|
return false;
|
|
252422
252703
|
}
|
|
@@ -252437,9 +252718,7 @@ async function updateProjectConfig(projectRoot) {
|
|
|
252437
252718
|
}
|
|
252438
252719
|
// src/cli/commands/types/generate.ts
|
|
252439
252720
|
var TYPES_FILE_PATH = "base44/.types/types.d.ts";
|
|
252440
|
-
async function generateTypesAction({
|
|
252441
|
-
runTask
|
|
252442
|
-
}) {
|
|
252721
|
+
async function generateTypesAction(_ctx) {
|
|
252443
252722
|
const { entities, functions, agents, connectors, project: project2 } = await readProjectConfig();
|
|
252444
252723
|
await runTask("Generating types", async () => {
|
|
252445
252724
|
await generateTypesFile({ entities, functions, agents, connectors });
|
|
@@ -252461,7 +252740,7 @@ function getTypesCommand() {
|
|
|
252461
252740
|
// src/cli/dev/dev-server/main.ts
|
|
252462
252741
|
var import_cors = __toESM(require_lib4(), 1);
|
|
252463
252742
|
var import_express5 = __toESM(require_express(), 1);
|
|
252464
|
-
import { dirname as
|
|
252743
|
+
import { dirname as dirname16, join as join23 } from "node:path";
|
|
252465
252744
|
|
|
252466
252745
|
// ../../node_modules/get-port/index.js
|
|
252467
252746
|
import net from "node:net";
|
|
@@ -252482,8 +252761,8 @@ var getLocalHosts = () => {
|
|
|
252482
252761
|
const interfaces = os9.networkInterfaces();
|
|
252483
252762
|
const results = new Set([undefined, "0.0.0.0"]);
|
|
252484
252763
|
for (const _interface of Object.values(interfaces)) {
|
|
252485
|
-
for (const
|
|
252486
|
-
results.add(
|
|
252764
|
+
for (const config11 of _interface) {
|
|
252765
|
+
results.add(config11.address);
|
|
252487
252766
|
}
|
|
252488
252767
|
}
|
|
252489
252768
|
return results;
|
|
@@ -253077,22 +253356,22 @@ class Database {
|
|
|
253077
253356
|
this.schemas.clear();
|
|
253078
253357
|
}
|
|
253079
253358
|
validate(entityName, record2, partial2 = false) {
|
|
253080
|
-
const
|
|
253081
|
-
if (!
|
|
253359
|
+
const schema10 = this.schemas.get(this.normalizeName(entityName));
|
|
253360
|
+
if (!schema10) {
|
|
253082
253361
|
throw new Error(`Entity "${entityName}" not found`);
|
|
253083
253362
|
}
|
|
253084
|
-
return this.validator.validate(record2,
|
|
253363
|
+
return this.validator.validate(record2, schema10, partial2);
|
|
253085
253364
|
}
|
|
253086
253365
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
253087
|
-
const
|
|
253088
|
-
if (!
|
|
253366
|
+
const schema10 = this.schemas.get(this.normalizeName(entityName));
|
|
253367
|
+
if (!schema10) {
|
|
253089
253368
|
throw new Error(`Entity "${entityName}" not found`);
|
|
253090
253369
|
}
|
|
253091
|
-
const filteredRecord = this.validator.filterFields(record2,
|
|
253370
|
+
const filteredRecord = this.validator.filterFields(record2, schema10);
|
|
253092
253371
|
if (partial2) {
|
|
253093
253372
|
return filteredRecord;
|
|
253094
253373
|
}
|
|
253095
|
-
return this.validator.applyDefaults(filteredRecord,
|
|
253374
|
+
return this.validator.applyDefaults(filteredRecord, schema10);
|
|
253096
253375
|
}
|
|
253097
253376
|
normalizeName(entityName) {
|
|
253098
253377
|
return entityName.toLowerCase();
|
|
@@ -254274,9 +254553,9 @@ class NodeFsHandler {
|
|
|
254274
254553
|
if (this.fsw.closed) {
|
|
254275
254554
|
return;
|
|
254276
254555
|
}
|
|
254277
|
-
const
|
|
254556
|
+
const dirname15 = sp2.dirname(file2);
|
|
254278
254557
|
const basename5 = sp2.basename(file2);
|
|
254279
|
-
const parent = this.fsw._getWatchedDir(
|
|
254558
|
+
const parent = this.fsw._getWatchedDir(dirname15);
|
|
254280
254559
|
let prevStats = stats;
|
|
254281
254560
|
if (parent.has(basename5))
|
|
254282
254561
|
return;
|
|
@@ -254303,7 +254582,7 @@ class NodeFsHandler {
|
|
|
254303
254582
|
prevStats = newStats2;
|
|
254304
254583
|
}
|
|
254305
254584
|
} catch (error48) {
|
|
254306
|
-
this.fsw._remove(
|
|
254585
|
+
this.fsw._remove(dirname15, basename5);
|
|
254307
254586
|
}
|
|
254308
254587
|
} else if (parent.has(basename5)) {
|
|
254309
254588
|
const at13 = newStats.atimeMs;
|
|
@@ -255324,8 +255603,8 @@ async function createDevServer(options8) {
|
|
|
255324
255603
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
255325
255604
|
};
|
|
255326
255605
|
const base44ConfigWatcher = new WatchBase44({
|
|
255327
|
-
functions:
|
|
255328
|
-
entities:
|
|
255606
|
+
functions: join23(dirname16(project2.configPath), project2.functionsDir),
|
|
255607
|
+
entities: join23(dirname16(project2.configPath), project2.entitiesDir)
|
|
255329
255608
|
}, devLogger);
|
|
255330
255609
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
255331
255610
|
try {
|
|
@@ -255479,7 +255758,7 @@ Examples:
|
|
|
255479
255758
|
import { resolve as resolve8 } from "node:path";
|
|
255480
255759
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
255481
255760
|
async function eject(ctx, options8) {
|
|
255482
|
-
const { log,
|
|
255761
|
+
const { log, isNonInteractive } = ctx;
|
|
255483
255762
|
if (isNonInteractive && !options8.projectId) {
|
|
255484
255763
|
throw new InvalidInputError("--project-id is required in non-interactive mode");
|
|
255485
255764
|
}
|
|
@@ -255599,6 +255878,7 @@ function createProgram(context) {
|
|
|
255599
255878
|
program2.addCommand(getConnectorsCommand());
|
|
255600
255879
|
program2.addCommand(getFunctionsCommand());
|
|
255601
255880
|
program2.addCommand(getSecretsCommand());
|
|
255881
|
+
program2.addCommand(getAuthCommand());
|
|
255602
255882
|
program2.addCommand(getSiteCommand());
|
|
255603
255883
|
program2.addCommand(getTypesCommand());
|
|
255604
255884
|
program2.addCommand(getExecCommand());
|
|
@@ -255612,7 +255892,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
255612
255892
|
import { release, type } from "node:os";
|
|
255613
255893
|
|
|
255614
255894
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
255615
|
-
import { dirname as
|
|
255895
|
+
import { dirname as dirname17, posix, sep } from "path";
|
|
255616
255896
|
function createModulerModifier() {
|
|
255617
255897
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
255618
255898
|
return async (frames) => {
|
|
@@ -255621,7 +255901,7 @@ function createModulerModifier() {
|
|
|
255621
255901
|
return frames;
|
|
255622
255902
|
};
|
|
255623
255903
|
}
|
|
255624
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
255904
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
255625
255905
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
255626
255906
|
return (filename) => {
|
|
255627
255907
|
if (!filename)
|
|
@@ -259809,52 +260089,19 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
259809
260089
|
});
|
|
259810
260090
|
});
|
|
259811
260091
|
}
|
|
259812
|
-
// src/cli/utils/runTask.ts
|
|
259813
|
-
function createInteractiveRunTask() {
|
|
259814
|
-
return async (startMessage, operation, options8) => {
|
|
259815
|
-
const s5 = bt2();
|
|
259816
|
-
s5.start(startMessage);
|
|
259817
|
-
const updateMessage = (message) => s5.message(message);
|
|
259818
|
-
try {
|
|
259819
|
-
const result = await operation(updateMessage);
|
|
259820
|
-
s5.stop(options8?.successMessage || startMessage);
|
|
259821
|
-
return result;
|
|
259822
|
-
} catch (error48) {
|
|
259823
|
-
s5.error(options8?.errorMessage || "Failed");
|
|
259824
|
-
throw error48;
|
|
259825
|
-
}
|
|
259826
|
-
};
|
|
259827
|
-
}
|
|
259828
|
-
function createSimpleRunTask(log) {
|
|
259829
|
-
return async (startMessage, operation, options8) => {
|
|
259830
|
-
log.info(startMessage);
|
|
259831
|
-
const updateMessage = (message) => log.info(message);
|
|
259832
|
-
try {
|
|
259833
|
-
const result = await operation(updateMessage);
|
|
259834
|
-
log.success(options8?.successMessage || startMessage);
|
|
259835
|
-
return result;
|
|
259836
|
-
} catch (error48) {
|
|
259837
|
-
log.error(options8?.errorMessage || "Failed");
|
|
259838
|
-
throw error48;
|
|
259839
|
-
}
|
|
259840
|
-
};
|
|
259841
|
-
}
|
|
259842
|
-
|
|
259843
260092
|
// src/cli/index.ts
|
|
259844
|
-
var __dirname4 =
|
|
260093
|
+
var __dirname4 = dirname18(fileURLToPath6(import.meta.url));
|
|
259845
260094
|
async function runCLI(options8) {
|
|
259846
|
-
ensureNpmAssets(
|
|
260095
|
+
ensureNpmAssets(join24(__dirname4, "../assets"));
|
|
259847
260096
|
const errorReporter = new ErrorReporter;
|
|
259848
260097
|
errorReporter.registerProcessErrorHandlers();
|
|
259849
260098
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
259850
260099
|
const log = isNonInteractive ? new SimpleLogger : new ClackLogger;
|
|
259851
|
-
const runTask = isNonInteractive ? createSimpleRunTask(log) : createInteractiveRunTask();
|
|
259852
260100
|
const context = {
|
|
259853
260101
|
errorReporter,
|
|
259854
260102
|
isNonInteractive,
|
|
259855
260103
|
distribution: options8?.distribution ?? "npm",
|
|
259856
|
-
log
|
|
259857
|
-
runTask
|
|
260104
|
+
log
|
|
259858
260105
|
};
|
|
259859
260106
|
const program2 = createProgram(context);
|
|
259860
260107
|
try {
|
|
@@ -259880,4 +260127,4 @@ export {
|
|
|
259880
260127
|
CLIExitError
|
|
259881
260128
|
};
|
|
259882
260129
|
|
|
259883
|
-
//# debugId=
|
|
260130
|
+
//# debugId=70340E16FE16439D64756E2164756E21
|