@base44-preview/cli 0.1.1-pr.554.873bfe3 → 0.1.1-pr.555.067c6ae
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 +942 -742
- package/dist/cli/index.js.map +17 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -12980,10 +12980,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
12980
12980
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
12981
12981
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
12982
12982
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
12983
|
-
var
|
|
12983
|
+
var dirname11 = path11.dirname;
|
|
12984
12984
|
var extname = path11.extname;
|
|
12985
12985
|
var resolve2 = path11.resolve;
|
|
12986
|
-
var includePath = resolve2(isDir ? filename :
|
|
12986
|
+
var includePath = resolve2(isDir ? filename : dirname11(filename), name2);
|
|
12987
12987
|
var ext = extname(name2);
|
|
12988
12988
|
if (!ext) {
|
|
12989
12989
|
includePath += ".ejs";
|
|
@@ -13361,10 +13361,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
13361
13361
|
};
|
|
13362
13362
|
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
13363
13363
|
var filename = opts.filename;
|
|
13364
|
-
var
|
|
13364
|
+
var basename5 = path11.basename(filename, path11.extname(filename));
|
|
13365
13365
|
try {
|
|
13366
13366
|
Object.defineProperty(returnedFn, "name", {
|
|
13367
|
-
value:
|
|
13367
|
+
value: basename5,
|
|
13368
13368
|
writable: false,
|
|
13369
13369
|
enumerable: false,
|
|
13370
13370
|
configurable: true
|
|
@@ -13718,12 +13718,12 @@ var require_schema = __commonJS((exports, module) => {
|
|
|
13718
13718
|
var common = require_common3();
|
|
13719
13719
|
var YAMLException = require_exception();
|
|
13720
13720
|
var Type = require_type();
|
|
13721
|
-
function compileList(
|
|
13721
|
+
function compileList(schema8, name2, result) {
|
|
13722
13722
|
var exclude = [];
|
|
13723
|
-
|
|
13723
|
+
schema8.include.forEach(function(includedSchema) {
|
|
13724
13724
|
result = compileList(includedSchema, name2, result);
|
|
13725
13725
|
});
|
|
13726
|
-
|
|
13726
|
+
schema8[name2].forEach(function(currentType) {
|
|
13727
13727
|
result.forEach(function(previousType, previousIndex) {
|
|
13728
13728
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
|
13729
13729
|
exclude.push(previousIndex);
|
|
@@ -13780,8 +13780,8 @@ var require_schema = __commonJS((exports, module) => {
|
|
|
13780
13780
|
}
|
|
13781
13781
|
schemas3 = common.toArray(schemas3);
|
|
13782
13782
|
types = common.toArray(types);
|
|
13783
|
-
if (!schemas3.every(function(
|
|
13784
|
-
return
|
|
13783
|
+
if (!schemas3.every(function(schema8) {
|
|
13784
|
+
return schema8 instanceof Schema;
|
|
13785
13785
|
})) {
|
|
13786
13786
|
throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
13787
13787
|
}
|
|
@@ -15802,7 +15802,7 @@ var require_dumper = __commonJS((exports, module) => {
|
|
|
15802
15802
|
"Off",
|
|
15803
15803
|
"OFF"
|
|
15804
15804
|
];
|
|
15805
|
-
function compileStyleMap(
|
|
15805
|
+
function compileStyleMap(schema8, map2) {
|
|
15806
15806
|
var result, keys, index, length, tag, style, type;
|
|
15807
15807
|
if (map2 === null)
|
|
15808
15808
|
return {};
|
|
@@ -15814,7 +15814,7 @@ var require_dumper = __commonJS((exports, module) => {
|
|
|
15814
15814
|
if (tag.slice(0, 2) === "!!") {
|
|
15815
15815
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
15816
15816
|
}
|
|
15817
|
-
type =
|
|
15817
|
+
type = schema8.compiledTypeMap["fallback"][tag];
|
|
15818
15818
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
15819
15819
|
style = type.styleAliases[style];
|
|
15820
15820
|
}
|
|
@@ -20114,7 +20114,7 @@ var require_lodash8 = __commonJS((exports, module) => {
|
|
|
20114
20114
|
}
|
|
20115
20115
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
20116
20116
|
});
|
|
20117
|
-
function
|
|
20117
|
+
function join15(array2, separator) {
|
|
20118
20118
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
20119
20119
|
}
|
|
20120
20120
|
function last(array2) {
|
|
@@ -22046,7 +22046,7 @@ __p += '`;
|
|
|
22046
22046
|
lodash.isUndefined = isUndefined;
|
|
22047
22047
|
lodash.isWeakMap = isWeakMap;
|
|
22048
22048
|
lodash.isWeakSet = isWeakSet;
|
|
22049
|
-
lodash.join =
|
|
22049
|
+
lodash.join = join15;
|
|
22050
22050
|
lodash.kebabCase = kebabCase;
|
|
22051
22051
|
lodash.last = last;
|
|
22052
22052
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -23001,7 +23001,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
23001
23001
|
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
23002
23002
|
value = value.valueOf();
|
|
23003
23003
|
}
|
|
23004
|
-
const { aliasDuplicateObjects, onAnchor, onTagObj, schema:
|
|
23004
|
+
const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema11, sourceObjects } = ctx;
|
|
23005
23005
|
let ref = undefined;
|
|
23006
23006
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
23007
23007
|
ref = sourceObjects.get(value);
|
|
@@ -23015,7 +23015,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
23015
23015
|
}
|
|
23016
23016
|
if (tagName?.startsWith("!!"))
|
|
23017
23017
|
tagName = defaultTagPrefix + tagName.slice(2);
|
|
23018
|
-
let tagObj = findTagObject(value, tagName,
|
|
23018
|
+
let tagObj = findTagObject(value, tagName, schema11.tags);
|
|
23019
23019
|
if (!tagObj) {
|
|
23020
23020
|
if (value && typeof value.toJSON === "function") {
|
|
23021
23021
|
value = value.toJSON();
|
|
@@ -23026,7 +23026,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
23026
23026
|
ref.node = node2;
|
|
23027
23027
|
return node2;
|
|
23028
23028
|
}
|
|
23029
|
-
tagObj = value instanceof Map ?
|
|
23029
|
+
tagObj = value instanceof Map ? schema11[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema11[identity3.SEQ] : schema11[identity3.MAP];
|
|
23030
23030
|
}
|
|
23031
23031
|
if (onTagObj) {
|
|
23032
23032
|
onTagObj(tagObj);
|
|
@@ -23049,7 +23049,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
23049
23049
|
var createNode = require_createNode();
|
|
23050
23050
|
var identity3 = require_identity();
|
|
23051
23051
|
var Node2 = require_Node();
|
|
23052
|
-
function collectionFromPath(
|
|
23052
|
+
function collectionFromPath(schema11, path16, value) {
|
|
23053
23053
|
let v = value;
|
|
23054
23054
|
for (let i2 = path16.length - 1;i2 >= 0; --i2) {
|
|
23055
23055
|
const k2 = path16[i2];
|
|
@@ -23067,27 +23067,27 @@ var require_Collection = __commonJS((exports) => {
|
|
|
23067
23067
|
onAnchor: () => {
|
|
23068
23068
|
throw new Error("This should not happen, please report a bug.");
|
|
23069
23069
|
},
|
|
23070
|
-
schema:
|
|
23070
|
+
schema: schema11,
|
|
23071
23071
|
sourceObjects: new Map
|
|
23072
23072
|
});
|
|
23073
23073
|
}
|
|
23074
23074
|
var isEmptyPath = (path16) => path16 == null || typeof path16 === "object" && !!path16[Symbol.iterator]().next().done;
|
|
23075
23075
|
|
|
23076
23076
|
class Collection extends Node2.NodeBase {
|
|
23077
|
-
constructor(type,
|
|
23077
|
+
constructor(type, schema11) {
|
|
23078
23078
|
super(type);
|
|
23079
23079
|
Object.defineProperty(this, "schema", {
|
|
23080
|
-
value:
|
|
23080
|
+
value: schema11,
|
|
23081
23081
|
configurable: true,
|
|
23082
23082
|
enumerable: false,
|
|
23083
23083
|
writable: true
|
|
23084
23084
|
});
|
|
23085
23085
|
}
|
|
23086
|
-
clone(
|
|
23086
|
+
clone(schema11) {
|
|
23087
23087
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
23088
|
-
if (
|
|
23089
|
-
copy.schema =
|
|
23090
|
-
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(
|
|
23088
|
+
if (schema11)
|
|
23089
|
+
copy.schema = schema11;
|
|
23090
|
+
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema11) : it3);
|
|
23091
23091
|
if (this.range)
|
|
23092
23092
|
copy.range = this.range.slice();
|
|
23093
23093
|
return copy;
|
|
@@ -24019,12 +24019,12 @@ var require_Pair = __commonJS((exports) => {
|
|
|
24019
24019
|
this.key = key;
|
|
24020
24020
|
this.value = value;
|
|
24021
24021
|
}
|
|
24022
|
-
clone(
|
|
24022
|
+
clone(schema11) {
|
|
24023
24023
|
let { key, value } = this;
|
|
24024
24024
|
if (identity3.isNode(key))
|
|
24025
|
-
key = key.clone(
|
|
24025
|
+
key = key.clone(schema11);
|
|
24026
24026
|
if (identity3.isNode(value))
|
|
24027
|
-
value = value.clone(
|
|
24027
|
+
value = value.clone(schema11);
|
|
24028
24028
|
return new Pair(key, value);
|
|
24029
24029
|
}
|
|
24030
24030
|
toJSON(_2, ctx) {
|
|
@@ -24209,13 +24209,13 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
24209
24209
|
static get tagName() {
|
|
24210
24210
|
return "tag:yaml.org,2002:map";
|
|
24211
24211
|
}
|
|
24212
|
-
constructor(
|
|
24213
|
-
super(identity3.MAP,
|
|
24212
|
+
constructor(schema11) {
|
|
24213
|
+
super(identity3.MAP, schema11);
|
|
24214
24214
|
this.items = [];
|
|
24215
24215
|
}
|
|
24216
|
-
static from(
|
|
24216
|
+
static from(schema11, obj, ctx) {
|
|
24217
24217
|
const { keepUndefined, replacer } = ctx;
|
|
24218
|
-
const map2 = new this(
|
|
24218
|
+
const map2 = new this(schema11);
|
|
24219
24219
|
const add = (key, value) => {
|
|
24220
24220
|
if (typeof replacer === "function")
|
|
24221
24221
|
value = replacer.call(obj, key, value);
|
|
@@ -24231,8 +24231,8 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
24231
24231
|
for (const key of Object.keys(obj))
|
|
24232
24232
|
add(key, obj[key]);
|
|
24233
24233
|
}
|
|
24234
|
-
if (typeof
|
|
24235
|
-
map2.items.sort(
|
|
24234
|
+
if (typeof schema11.sortMapEntries === "function") {
|
|
24235
|
+
map2.items.sort(schema11.sortMapEntries);
|
|
24236
24236
|
}
|
|
24237
24237
|
return map2;
|
|
24238
24238
|
}
|
|
@@ -24325,7 +24325,7 @@ var require_map2 = __commonJS((exports) => {
|
|
|
24325
24325
|
onError("Expected a mapping for this tag");
|
|
24326
24326
|
return map3;
|
|
24327
24327
|
},
|
|
24328
|
-
createNode: (
|
|
24328
|
+
createNode: (schema11, obj, ctx) => YAMLMap.YAMLMap.from(schema11, obj, ctx)
|
|
24329
24329
|
};
|
|
24330
24330
|
exports.map = map2;
|
|
24331
24331
|
});
|
|
@@ -24343,8 +24343,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
24343
24343
|
static get tagName() {
|
|
24344
24344
|
return "tag:yaml.org,2002:seq";
|
|
24345
24345
|
}
|
|
24346
|
-
constructor(
|
|
24347
|
-
super(identity3.SEQ,
|
|
24346
|
+
constructor(schema11) {
|
|
24347
|
+
super(identity3.SEQ, schema11);
|
|
24348
24348
|
this.items = [];
|
|
24349
24349
|
}
|
|
24350
24350
|
add(value) {
|
|
@@ -24398,9 +24398,9 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
24398
24398
|
onComment
|
|
24399
24399
|
});
|
|
24400
24400
|
}
|
|
24401
|
-
static from(
|
|
24401
|
+
static from(schema11, obj, ctx) {
|
|
24402
24402
|
const { replacer } = ctx;
|
|
24403
|
-
const seq = new this(
|
|
24403
|
+
const seq = new this(schema11);
|
|
24404
24404
|
if (obj && Symbol.iterator in Object(obj)) {
|
|
24405
24405
|
let i2 = 0;
|
|
24406
24406
|
for (let it3 of obj) {
|
|
@@ -24437,7 +24437,7 @@ var require_seq2 = __commonJS((exports) => {
|
|
|
24437
24437
|
onError("Expected a sequence for this tag");
|
|
24438
24438
|
return seq2;
|
|
24439
24439
|
},
|
|
24440
|
-
createNode: (
|
|
24440
|
+
createNode: (schema11, obj, ctx) => YAMLSeq.YAMLSeq.from(schema11, obj, ctx)
|
|
24441
24441
|
};
|
|
24442
24442
|
exports.seq = seq;
|
|
24443
24443
|
});
|
|
@@ -24612,7 +24612,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
24612
24612
|
var bool = require_bool2();
|
|
24613
24613
|
var float = require_float2();
|
|
24614
24614
|
var int2 = require_int2();
|
|
24615
|
-
var
|
|
24615
|
+
var schema11 = [
|
|
24616
24616
|
map2.map,
|
|
24617
24617
|
seq.seq,
|
|
24618
24618
|
string4.string,
|
|
@@ -24625,7 +24625,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
24625
24625
|
float.floatExp,
|
|
24626
24626
|
float.float
|
|
24627
24627
|
];
|
|
24628
|
-
exports.schema =
|
|
24628
|
+
exports.schema = schema11;
|
|
24629
24629
|
});
|
|
24630
24630
|
|
|
24631
24631
|
// ../../node_modules/yaml/dist/schema/json/schema.js
|
|
@@ -24688,8 +24688,8 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
24688
24688
|
return str;
|
|
24689
24689
|
}
|
|
24690
24690
|
};
|
|
24691
|
-
var
|
|
24692
|
-
exports.schema =
|
|
24691
|
+
var schema11 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
|
|
24692
|
+
exports.schema = schema11;
|
|
24693
24693
|
});
|
|
24694
24694
|
|
|
24695
24695
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
@@ -24779,9 +24779,9 @@ ${cn.comment}` : item.comment;
|
|
|
24779
24779
|
onError("Expected a sequence for this tag");
|
|
24780
24780
|
return seq;
|
|
24781
24781
|
}
|
|
24782
|
-
function createPairs(
|
|
24782
|
+
function createPairs(schema11, iterable, ctx) {
|
|
24783
24783
|
const { replacer } = ctx;
|
|
24784
|
-
const pairs2 = new YAMLSeq.YAMLSeq(
|
|
24784
|
+
const pairs2 = new YAMLSeq.YAMLSeq(schema11);
|
|
24785
24785
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
24786
24786
|
let i2 = 0;
|
|
24787
24787
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
@@ -24860,8 +24860,8 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
24860
24860
|
}
|
|
24861
24861
|
return map2;
|
|
24862
24862
|
}
|
|
24863
|
-
static from(
|
|
24864
|
-
const pairs$1 = pairs.createPairs(
|
|
24863
|
+
static from(schema11, iterable, ctx) {
|
|
24864
|
+
const pairs$1 = pairs.createPairs(schema11, iterable, ctx);
|
|
24865
24865
|
const omap2 = new this;
|
|
24866
24866
|
omap2.items = pairs$1.items;
|
|
24867
24867
|
return omap2;
|
|
@@ -24888,7 +24888,7 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
24888
24888
|
}
|
|
24889
24889
|
return Object.assign(new YAMLOMap, pairs$1);
|
|
24890
24890
|
},
|
|
24891
|
-
createNode: (
|
|
24891
|
+
createNode: (schema11, iterable, ctx) => YAMLOMap.from(schema11, iterable, ctx)
|
|
24892
24892
|
};
|
|
24893
24893
|
exports.YAMLOMap = YAMLOMap;
|
|
24894
24894
|
exports.omap = omap;
|
|
@@ -25052,8 +25052,8 @@ var require_set2 = __commonJS((exports) => {
|
|
|
25052
25052
|
var YAMLMap = require_YAMLMap();
|
|
25053
25053
|
|
|
25054
25054
|
class YAMLSet extends YAMLMap.YAMLMap {
|
|
25055
|
-
constructor(
|
|
25056
|
-
super(
|
|
25055
|
+
constructor(schema11) {
|
|
25056
|
+
super(schema11);
|
|
25057
25057
|
this.tag = YAMLSet.tag;
|
|
25058
25058
|
}
|
|
25059
25059
|
add(key) {
|
|
@@ -25093,9 +25093,9 @@ var require_set2 = __commonJS((exports) => {
|
|
|
25093
25093
|
else
|
|
25094
25094
|
throw new Error("Set items must all have null values");
|
|
25095
25095
|
}
|
|
25096
|
-
static from(
|
|
25096
|
+
static from(schema11, iterable, ctx) {
|
|
25097
25097
|
const { replacer } = ctx;
|
|
25098
|
-
const set3 = new this(
|
|
25098
|
+
const set3 = new this(schema11);
|
|
25099
25099
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
25100
25100
|
for (let value of iterable) {
|
|
25101
25101
|
if (typeof replacer === "function")
|
|
@@ -25112,7 +25112,7 @@ var require_set2 = __commonJS((exports) => {
|
|
|
25112
25112
|
nodeClass: YAMLSet,
|
|
25113
25113
|
default: false,
|
|
25114
25114
|
tag: "tag:yaml.org,2002:set",
|
|
25115
|
-
createNode: (
|
|
25115
|
+
createNode: (schema11, iterable, ctx) => YAMLSet.from(schema11, iterable, ctx),
|
|
25116
25116
|
resolve(map2, onError) {
|
|
25117
25117
|
if (identity3.isMap(map2)) {
|
|
25118
25118
|
if (map2.hasAllNullValues(true))
|
|
@@ -25225,7 +25225,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
25225
25225
|
var pairs = require_pairs2();
|
|
25226
25226
|
var set2 = require_set2();
|
|
25227
25227
|
var timestamp = require_timestamp2();
|
|
25228
|
-
var
|
|
25228
|
+
var schema11 = [
|
|
25229
25229
|
map2.map,
|
|
25230
25230
|
seq.seq,
|
|
25231
25231
|
string4.string,
|
|
@@ -25248,7 +25248,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
25248
25248
|
timestamp.floatTime,
|
|
25249
25249
|
timestamp.timestamp
|
|
25250
25250
|
];
|
|
25251
|
-
exports.schema =
|
|
25251
|
+
exports.schema = schema11;
|
|
25252
25252
|
});
|
|
25253
25253
|
|
|
25254
25254
|
// ../../node_modules/yaml/dist/schema/tags.js
|
|
@@ -25260,7 +25260,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
25260
25260
|
var bool = require_bool2();
|
|
25261
25261
|
var float = require_float2();
|
|
25262
25262
|
var int2 = require_int2();
|
|
25263
|
-
var
|
|
25263
|
+
var schema11 = require_schema2();
|
|
25264
25264
|
var schema$1 = require_schema3();
|
|
25265
25265
|
var binary = require_binary2();
|
|
25266
25266
|
var merge3 = require_merge3();
|
|
@@ -25270,7 +25270,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
25270
25270
|
var set2 = require_set2();
|
|
25271
25271
|
var timestamp = require_timestamp2();
|
|
25272
25272
|
var schemas3 = new Map([
|
|
25273
|
-
["core",
|
|
25273
|
+
["core", schema11.schema],
|
|
25274
25274
|
["failsafe", [map2.map, seq.seq, string4.string]],
|
|
25275
25275
|
["json", schema$1.schema],
|
|
25276
25276
|
["yaml11", schema$2.schema],
|
|
@@ -25352,9 +25352,9 @@ var require_Schema = __commonJS((exports) => {
|
|
|
25352
25352
|
var sortMapEntriesByKey = (a2, b) => a2.key < b.key ? -1 : a2.key > b.key ? 1 : 0;
|
|
25353
25353
|
|
|
25354
25354
|
class Schema {
|
|
25355
|
-
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema:
|
|
25355
|
+
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema11, sortMapEntries, toStringDefaults }) {
|
|
25356
25356
|
this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
|
|
25357
|
-
this.name = typeof
|
|
25357
|
+
this.name = typeof schema11 === "string" && schema11 || "core";
|
|
25358
25358
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
25359
25359
|
this.tags = tags.getTags(customTags, this.name, merge3);
|
|
25360
25360
|
this.toStringOptions = toStringDefaults ?? null;
|
|
@@ -26846,11 +26846,11 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
26846
26846
|
scalar.comment = comment;
|
|
26847
26847
|
return scalar;
|
|
26848
26848
|
}
|
|
26849
|
-
function findScalarTagByName(
|
|
26849
|
+
function findScalarTagByName(schema11, value, tagName, tagToken, onError) {
|
|
26850
26850
|
if (tagName === "!")
|
|
26851
|
-
return
|
|
26851
|
+
return schema11[identity3.SCALAR];
|
|
26852
26852
|
const matchWithTest = [];
|
|
26853
|
-
for (const tag of
|
|
26853
|
+
for (const tag of schema11.tags) {
|
|
26854
26854
|
if (!tag.collection && tag.tag === tagName) {
|
|
26855
26855
|
if (tag.default && tag.test)
|
|
26856
26856
|
matchWithTest.push(tag);
|
|
@@ -26861,18 +26861,18 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
26861
26861
|
for (const tag of matchWithTest)
|
|
26862
26862
|
if (tag.test?.test(value))
|
|
26863
26863
|
return tag;
|
|
26864
|
-
const kt3 =
|
|
26864
|
+
const kt3 = schema11.knownTags[tagName];
|
|
26865
26865
|
if (kt3 && !kt3.collection) {
|
|
26866
|
-
|
|
26866
|
+
schema11.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
|
|
26867
26867
|
return kt3;
|
|
26868
26868
|
}
|
|
26869
26869
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
26870
|
-
return
|
|
26870
|
+
return schema11[identity3.SCALAR];
|
|
26871
26871
|
}
|
|
26872
|
-
function findScalarTagByTest({ atKey, directives, schema:
|
|
26873
|
-
const tag =
|
|
26874
|
-
if (
|
|
26875
|
-
const compat2 =
|
|
26872
|
+
function findScalarTagByTest({ atKey, directives, schema: schema11 }, value, token, onError) {
|
|
26873
|
+
const tag = schema11.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema11[identity3.SCALAR];
|
|
26874
|
+
if (schema11.compat) {
|
|
26875
|
+
const compat2 = schema11.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema11[identity3.SCALAR];
|
|
26876
26876
|
if (tag.tag !== compat2.tag) {
|
|
26877
26877
|
const ts = directives.tagString(tag.tag);
|
|
26878
26878
|
const cs = directives.tagString(compat2.tag);
|
|
@@ -31158,7 +31158,7 @@ function cleanDoc(doc2) {
|
|
|
31158
31158
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
31159
31159
|
}
|
|
31160
31160
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
31161
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
31161
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join24(replacement, currentDoc.split(`
|
|
31162
31162
|
`)) : currentDoc);
|
|
31163
31163
|
}
|
|
31164
31164
|
function canBreakFn(doc2) {
|
|
@@ -31238,7 +31238,7 @@ function indentIfBreak(contents, options) {
|
|
|
31238
31238
|
negate: options.negate
|
|
31239
31239
|
};
|
|
31240
31240
|
}
|
|
31241
|
-
function
|
|
31241
|
+
function join24(separator, docs) {
|
|
31242
31242
|
assertDoc(separator);
|
|
31243
31243
|
assertDocArray(docs);
|
|
31244
31244
|
const parts = [];
|
|
@@ -31949,7 +31949,7 @@ var init_doc = __esm(() => {
|
|
|
31949
31949
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
31950
31950
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
31951
31951
|
builders = {
|
|
31952
|
-
join:
|
|
31952
|
+
join: join24,
|
|
31953
31953
|
line,
|
|
31954
31954
|
softline,
|
|
31955
31955
|
hardline,
|
|
@@ -119560,11 +119560,11 @@ function chooseDescription(descriptions, printWidth) {
|
|
|
119560
119560
|
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
|
|
119561
119561
|
}
|
|
119562
119562
|
function createSchema(SchemaConstructor, parameters) {
|
|
119563
|
-
const
|
|
119564
|
-
const subSchema = Object.create(
|
|
119563
|
+
const schema11 = new SchemaConstructor(parameters);
|
|
119564
|
+
const subSchema = Object.create(schema11);
|
|
119565
119565
|
for (const handlerKey of HANDLER_KEYS) {
|
|
119566
119566
|
if (handlerKey in parameters) {
|
|
119567
|
-
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey],
|
|
119567
|
+
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema11, Schema2.prototype[handlerKey].length);
|
|
119568
119568
|
}
|
|
119569
119569
|
}
|
|
119570
119570
|
return subSchema;
|
|
@@ -119821,8 +119821,8 @@ async function loadEditorconfigInternal(file2, { shouldCache }) {
|
|
|
119821
119821
|
const directory = path52.dirname(file2);
|
|
119822
119822
|
const root2 = await findProjectRoot2(directory, { shouldCache });
|
|
119823
119823
|
const editorConfig = await import_editorconfig.default.parse(file2, { root: root2 });
|
|
119824
|
-
const
|
|
119825
|
-
return
|
|
119824
|
+
const config13 = editorconfig_to_prettier_default(editorConfig);
|
|
119825
|
+
return config13;
|
|
119826
119826
|
}
|
|
119827
119827
|
function loadEditorconfig(file2, { shouldCache }) {
|
|
119828
119828
|
file2 = path52.resolve(file2);
|
|
@@ -121812,18 +121812,18 @@ async function loadConfig(configFile) {
|
|
|
121812
121812
|
if (!load2) {
|
|
121813
121813
|
throw new Error(`No loader specified for extension "${extension || "noExt"}"`);
|
|
121814
121814
|
}
|
|
121815
|
-
let
|
|
121816
|
-
if (!
|
|
121815
|
+
let config13 = await load2(configFile);
|
|
121816
|
+
if (!config13) {
|
|
121817
121817
|
return;
|
|
121818
121818
|
}
|
|
121819
|
-
if (typeof
|
|
121820
|
-
|
|
121819
|
+
if (typeof config13 === "string") {
|
|
121820
|
+
config13 = await load_external_config_default(config13, configFile);
|
|
121821
121821
|
}
|
|
121822
|
-
if (typeof
|
|
121823
|
-
throw new TypeError(`Config is only allowed to be an object, but received ${typeof
|
|
121822
|
+
if (typeof config13 !== "object") {
|
|
121823
|
+
throw new TypeError(`Config is only allowed to be an object, but received ${typeof config13} in "${configFile}"`);
|
|
121824
121824
|
}
|
|
121825
|
-
delete
|
|
121826
|
-
return
|
|
121825
|
+
delete config13.$schema;
|
|
121826
|
+
return config13;
|
|
121827
121827
|
}
|
|
121828
121828
|
function clearPrettierConfigCache() {
|
|
121829
121829
|
loadCache.clear();
|
|
@@ -121873,8 +121873,8 @@ async function loadPrettierConfig2(file2, options8) {
|
|
|
121873
121873
|
return;
|
|
121874
121874
|
}
|
|
121875
121875
|
configFile = toPath3(configFile);
|
|
121876
|
-
const
|
|
121877
|
-
return { config:
|
|
121876
|
+
const config13 = await loadPrettierConfig(configFile, { shouldCache });
|
|
121877
|
+
return { config: config13, configFile };
|
|
121878
121878
|
}
|
|
121879
121879
|
async function resolveConfig(fileUrlOrPath, options8) {
|
|
121880
121880
|
options8 = { useCache: true, ...options8 };
|
|
@@ -121901,8 +121901,8 @@ async function resolveConfigFile(fileUrlOrPath) {
|
|
|
121901
121901
|
return result ?? null;
|
|
121902
121902
|
}
|
|
121903
121903
|
function mergeOverrides(configResult, filePath) {
|
|
121904
|
-
const { config:
|
|
121905
|
-
const { overrides, ...options8 } =
|
|
121904
|
+
const { config: config13, configFile } = configResult || {};
|
|
121905
|
+
const { overrides, ...options8 } = config13 || {};
|
|
121906
121906
|
if (filePath && overrides) {
|
|
121907
121907
|
const relativeFilePath = path102.relative(path102.dirname(configFile), filePath);
|
|
121908
121908
|
for (const override of overrides) {
|
|
@@ -122718,12 +122718,12 @@ function getLanguageByFileName(languages2, file2) {
|
|
|
122718
122718
|
if (!file2) {
|
|
122719
122719
|
return;
|
|
122720
122720
|
}
|
|
122721
|
-
const
|
|
122721
|
+
const basename7 = getFileBasename(file2).toLowerCase();
|
|
122722
122722
|
return languages2.find(({
|
|
122723
122723
|
filenames
|
|
122724
|
-
}) => filenames?.some((name2) => name2.toLowerCase() ===
|
|
122724
|
+
}) => filenames?.some((name2) => name2.toLowerCase() === basename7)) ?? languages2.find(({
|
|
122725
122725
|
extensions
|
|
122726
|
-
}) => extensions?.some((extension) =>
|
|
122726
|
+
}) => extensions?.some((extension) => basename7.endsWith(extension)));
|
|
122727
122727
|
}
|
|
122728
122728
|
function getLanguageByLanguageName(languages2, languageName) {
|
|
122729
122729
|
if (!languageName) {
|
|
@@ -122904,9 +122904,9 @@ function optionInfoToSchema(optionInfo, {
|
|
|
122904
122904
|
throw new Error(`Unexpected type ${optionInfo.type}`);
|
|
122905
122905
|
}
|
|
122906
122906
|
if (optionInfo.exception) {
|
|
122907
|
-
parameters.validate = (value,
|
|
122907
|
+
parameters.validate = (value, schema11, utils3) => optionInfo.exception(value) || schema11.validate(value, utils3);
|
|
122908
122908
|
} else {
|
|
122909
|
-
parameters.validate = (value,
|
|
122909
|
+
parameters.validate = (value, schema11, utils3) => value === undefined || schema11.validate(value, utils3);
|
|
122910
122910
|
}
|
|
122911
122911
|
if (optionInfo.redirect) {
|
|
122912
122912
|
handlers.redirect = (value) => !value ? undefined : {
|
|
@@ -122921,7 +122921,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
122921
122921
|
}
|
|
122922
122922
|
if (isCLI && !optionInfo.array) {
|
|
122923
122923
|
const originalPreprocess = parameters.preprocess || ((x10) => x10);
|
|
122924
|
-
parameters.preprocess = (value,
|
|
122924
|
+
parameters.preprocess = (value, schema11, utils3) => schema11.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
|
|
122925
122925
|
}
|
|
122926
122926
|
return optionInfo.array ? ArraySchema.create({
|
|
122927
122927
|
...isCLI ? {
|
|
@@ -124011,16 +124011,16 @@ async function getFileInfo(file2, options8 = {}) {
|
|
|
124011
124011
|
};
|
|
124012
124012
|
}
|
|
124013
124013
|
async function getParser(file2, options8) {
|
|
124014
|
-
let
|
|
124014
|
+
let config13;
|
|
124015
124015
|
if (options8.resolveConfig !== false) {
|
|
124016
|
-
|
|
124016
|
+
config13 = await resolveConfig(file2, {
|
|
124017
124017
|
editorconfig: false
|
|
124018
124018
|
});
|
|
124019
124019
|
}
|
|
124020
|
-
if (
|
|
124021
|
-
return
|
|
124020
|
+
if (config13?.parser) {
|
|
124021
|
+
return config13.parser;
|
|
124022
124022
|
}
|
|
124023
|
-
let plugins = options8.plugins ??
|
|
124023
|
+
let plugins = options8.plugins ?? config13?.plugins ?? [];
|
|
124024
124024
|
plugins = (await Promise.all([load_builtin_plugins_default(), load_plugins_default(plugins)])).flat();
|
|
124025
124025
|
return infer_parser_default({ plugins }, { physicalFile: file2 });
|
|
124026
124026
|
}
|
|
@@ -124498,9 +124498,9 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
124498
124498
|
};
|
|
124499
124499
|
applyNormalization();
|
|
124500
124500
|
for (const key2 of Object.keys(this._utils.schemas)) {
|
|
124501
|
-
const
|
|
124501
|
+
const schema11 = this._utils.schemas[key2];
|
|
124502
124502
|
if (!(key2 in newOptions)) {
|
|
124503
|
-
const defaultResult = normalizeDefaultResult(
|
|
124503
|
+
const defaultResult = normalizeDefaultResult(schema11.default(this._utils));
|
|
124504
124504
|
if ("value" in defaultResult) {
|
|
124505
124505
|
restOptionsArray.push({ [key2]: defaultResult.value });
|
|
124506
124506
|
}
|
|
@@ -124511,13 +124511,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
124511
124511
|
if (!(key2 in newOptions)) {
|
|
124512
124512
|
continue;
|
|
124513
124513
|
}
|
|
124514
|
-
const
|
|
124514
|
+
const schema11 = this._utils.schemas[key2];
|
|
124515
124515
|
const value = newOptions[key2];
|
|
124516
|
-
const newValue =
|
|
124516
|
+
const newValue = schema11.postprocess(value, this._utils);
|
|
124517
124517
|
if (newValue === VALUE_UNCHANGED) {
|
|
124518
124518
|
continue;
|
|
124519
124519
|
}
|
|
124520
|
-
this._applyValidation(newValue, key2,
|
|
124520
|
+
this._applyValidation(newValue, key2, schema11);
|
|
124521
124521
|
newOptions[key2] = newValue;
|
|
124522
124522
|
}
|
|
124523
124523
|
this._applyPostprocess(newOptions);
|
|
@@ -124528,14 +124528,14 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
124528
124528
|
const transferredOptionsArray = [];
|
|
124529
124529
|
const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
|
|
124530
124530
|
for (const key2 of knownKeys) {
|
|
124531
|
-
const
|
|
124532
|
-
const value =
|
|
124533
|
-
this._applyValidation(value, key2,
|
|
124531
|
+
const schema11 = this._utils.schemas[key2];
|
|
124532
|
+
const value = schema11.preprocess(options8[key2], this._utils);
|
|
124533
|
+
this._applyValidation(value, key2, schema11);
|
|
124534
124534
|
const appendTransferredOptions = ({ from, to: to5 }) => {
|
|
124535
124535
|
transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
|
|
124536
124536
|
};
|
|
124537
124537
|
const warnDeprecated = ({ value: currentValue, redirectTo }) => {
|
|
124538
|
-
const deprecatedResult = normalizeDeprecatedResult(
|
|
124538
|
+
const deprecatedResult = normalizeDeprecatedResult(schema11.deprecated(currentValue, this._utils), value, true);
|
|
124539
124539
|
if (deprecatedResult === false) {
|
|
124540
124540
|
return;
|
|
124541
124541
|
}
|
|
@@ -124553,13 +124553,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
124553
124553
|
}
|
|
124554
124554
|
}
|
|
124555
124555
|
};
|
|
124556
|
-
const forwardResult = normalizeForwardResult(
|
|
124556
|
+
const forwardResult = normalizeForwardResult(schema11.forward(value, this._utils), value);
|
|
124557
124557
|
forwardResult.forEach(appendTransferredOptions);
|
|
124558
|
-
const redirectResult = normalizeRedirectResult(
|
|
124558
|
+
const redirectResult = normalizeRedirectResult(schema11.redirect(value, this._utils), value);
|
|
124559
124559
|
redirectResult.redirect.forEach(appendTransferredOptions);
|
|
124560
124560
|
if ("remain" in redirectResult) {
|
|
124561
124561
|
const remainingValue = redirectResult.remain;
|
|
124562
|
-
newOptions[key2] = key2 in newOptions ?
|
|
124562
|
+
newOptions[key2] = key2 in newOptions ? schema11.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
|
|
124563
124563
|
warnDeprecated({ value: remainingValue });
|
|
124564
124564
|
}
|
|
124565
124565
|
for (const { from, to: to5 } of redirectResult.redirect) {
|
|
@@ -124587,8 +124587,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
124587
124587
|
const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
|
|
124588
124588
|
return { knownKeys, unknownKeys };
|
|
124589
124589
|
}
|
|
124590
|
-
_applyValidation(value, key2,
|
|
124591
|
-
const validateResult = normalizeValidateResult(
|
|
124590
|
+
_applyValidation(value, key2, schema11) {
|
|
124591
|
+
const validateResult = normalizeValidateResult(schema11.validate(value, this._utils), value);
|
|
124592
124592
|
if (validateResult !== true) {
|
|
124593
124593
|
throw this._invalidHandler(key2, validateResult.value, this._utils);
|
|
124594
124594
|
}
|
|
@@ -124630,8 +124630,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
|
|
|
124630
124630
|
for (const key2 of unknownKeys) {
|
|
124631
124631
|
const value = postprocessed.override[key2];
|
|
124632
124632
|
this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
|
|
124633
|
-
const
|
|
124634
|
-
this._applyValidation(knownResultValue, knownResultKey,
|
|
124633
|
+
const schema11 = this._utils.schemas[knownResultKey];
|
|
124634
|
+
this._applyValidation(knownResultValue, knownResultKey, schema11);
|
|
124635
124635
|
options8[knownResultKey] = knownResultValue;
|
|
124636
124636
|
});
|
|
124637
124637
|
}
|
|
@@ -127945,8 +127945,8 @@ var init_prettier = __esm(() => {
|
|
|
127945
127945
|
}
|
|
127946
127946
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
127947
127947
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
127948
|
-
const
|
|
127949
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
127948
|
+
const basename7 = path152.basename(pattern);
|
|
127949
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename7);
|
|
127950
127950
|
}
|
|
127951
127951
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
127952
127952
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -136863,7 +136863,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
136863
136863
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
136864
136864
|
}
|
|
136865
136865
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
136866
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
136866
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join26(replacement, currentDoc.split(`
|
|
136867
136867
|
`)) : currentDoc);
|
|
136868
136868
|
}
|
|
136869
136869
|
function canBreakFn2(doc2) {
|
|
@@ -136949,7 +136949,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
136949
136949
|
negate: options8.negate
|
|
136950
136950
|
};
|
|
136951
136951
|
}
|
|
136952
|
-
function
|
|
136952
|
+
function join26(separator, docs) {
|
|
136953
136953
|
assertDoc2(separator);
|
|
136954
136954
|
assertDocArray2(docs);
|
|
136955
136955
|
const parts = [];
|
|
@@ -137614,7 +137614,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
137614
137614
|
}
|
|
137615
137615
|
}
|
|
137616
137616
|
var builders2 = {
|
|
137617
|
-
join:
|
|
137617
|
+
join: join26,
|
|
137618
137618
|
line: line3,
|
|
137619
137619
|
softline: softline2,
|
|
137620
137620
|
hardline: hardline4,
|
|
@@ -138344,23 +138344,23 @@ var require_JSONSchema = __commonJS((exports) => {
|
|
|
138344
138344
|
exports.Parent = Symbol("Parent");
|
|
138345
138345
|
exports.Types = Symbol("Types");
|
|
138346
138346
|
exports.Intersection = Symbol("Intersection");
|
|
138347
|
-
exports.getRootSchema = (0, lodash_1.memoize)((
|
|
138348
|
-
const parent =
|
|
138347
|
+
exports.getRootSchema = (0, lodash_1.memoize)((schema11) => {
|
|
138348
|
+
const parent = schema11[exports.Parent];
|
|
138349
138349
|
if (!parent) {
|
|
138350
|
-
return
|
|
138350
|
+
return schema11;
|
|
138351
138351
|
}
|
|
138352
138352
|
return (0, exports.getRootSchema)(parent);
|
|
138353
138353
|
});
|
|
138354
|
-
function isBoolean(
|
|
138355
|
-
return
|
|
138354
|
+
function isBoolean(schema11) {
|
|
138355
|
+
return schema11 === true || schema11 === false;
|
|
138356
138356
|
}
|
|
138357
138357
|
exports.isBoolean = isBoolean;
|
|
138358
|
-
function isPrimitive(
|
|
138359
|
-
return !(0, lodash_1.isPlainObject)(
|
|
138358
|
+
function isPrimitive(schema11) {
|
|
138359
|
+
return !(0, lodash_1.isPlainObject)(schema11);
|
|
138360
138360
|
}
|
|
138361
138361
|
exports.isPrimitive = isPrimitive;
|
|
138362
|
-
function isCompound(
|
|
138363
|
-
return Array.isArray(
|
|
138362
|
+
function isCompound(schema11) {
|
|
138363
|
+
return Array.isArray(schema11.type) || "anyOf" in schema11 || "oneOf" in schema11;
|
|
138364
138364
|
}
|
|
138365
138365
|
exports.isCompound = isCompound;
|
|
138366
138366
|
});
|
|
@@ -138587,9 +138587,9 @@ var require_type2 = __commonJS((exports, module) => {
|
|
|
138587
138587
|
var require_schema5 = __commonJS((exports, module) => {
|
|
138588
138588
|
var YAMLException = require_exception2();
|
|
138589
138589
|
var Type = require_type2();
|
|
138590
|
-
function compileList(
|
|
138590
|
+
function compileList(schema11, name2) {
|
|
138591
138591
|
var result = [];
|
|
138592
|
-
|
|
138592
|
+
schema11[name2].forEach(function(currentType) {
|
|
138593
138593
|
var newIndex = result.length;
|
|
138594
138594
|
result.forEach(function(previousType, previousIndex) {
|
|
138595
138595
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -140534,7 +140534,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
140534
140534
|
"OFF"
|
|
140535
140535
|
];
|
|
140536
140536
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
140537
|
-
function compileStyleMap(
|
|
140537
|
+
function compileStyleMap(schema11, map2) {
|
|
140538
140538
|
var result, keys, index, length, tag, style, type;
|
|
140539
140539
|
if (map2 === null)
|
|
140540
140540
|
return {};
|
|
@@ -140546,7 +140546,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
140546
140546
|
if (tag.slice(0, 2) === "!!") {
|
|
140547
140547
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
140548
140548
|
}
|
|
140549
|
-
type =
|
|
140549
|
+
type = schema11.compiledTypeMap["fallback"][tag];
|
|
140550
140550
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
140551
140551
|
style = type.styleAliases[style];
|
|
140552
140552
|
}
|
|
@@ -141205,11 +141205,11 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141205
141205
|
function traverseArray(arr, callback, processed) {
|
|
141206
141206
|
arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
|
|
141207
141207
|
}
|
|
141208
|
-
function traverseIntersection(
|
|
141209
|
-
if (typeof
|
|
141208
|
+
function traverseIntersection(schema11, callback, processed) {
|
|
141209
|
+
if (typeof schema11 !== "object" || !schema11) {
|
|
141210
141210
|
return;
|
|
141211
141211
|
}
|
|
141212
|
-
const r5 =
|
|
141212
|
+
const r5 = schema11;
|
|
141213
141213
|
const intersection2 = r5[JSONSchema_1.Intersection];
|
|
141214
141214
|
if (!intersection2) {
|
|
141215
141215
|
return;
|
|
@@ -141218,60 +141218,60 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141218
141218
|
traverseArray(intersection2.allOf, callback, processed);
|
|
141219
141219
|
}
|
|
141220
141220
|
}
|
|
141221
|
-
function traverse(
|
|
141222
|
-
if (processed.has(
|
|
141221
|
+
function traverse(schema11, callback, processed = new Set, key2) {
|
|
141222
|
+
if (processed.has(schema11)) {
|
|
141223
141223
|
return;
|
|
141224
141224
|
}
|
|
141225
|
-
processed.add(
|
|
141226
|
-
callback(
|
|
141227
|
-
if (
|
|
141228
|
-
traverseArray(
|
|
141225
|
+
processed.add(schema11);
|
|
141226
|
+
callback(schema11, key2 !== null && key2 !== undefined ? key2 : null);
|
|
141227
|
+
if (schema11.anyOf) {
|
|
141228
|
+
traverseArray(schema11.anyOf, callback, processed);
|
|
141229
141229
|
}
|
|
141230
|
-
if (
|
|
141231
|
-
traverseArray(
|
|
141230
|
+
if (schema11.allOf) {
|
|
141231
|
+
traverseArray(schema11.allOf, callback, processed);
|
|
141232
141232
|
}
|
|
141233
|
-
if (
|
|
141234
|
-
traverseArray(
|
|
141233
|
+
if (schema11.oneOf) {
|
|
141234
|
+
traverseArray(schema11.oneOf, callback, processed);
|
|
141235
141235
|
}
|
|
141236
|
-
if (
|
|
141237
|
-
traverseObjectKeys(
|
|
141236
|
+
if (schema11.properties) {
|
|
141237
|
+
traverseObjectKeys(schema11.properties, callback, processed);
|
|
141238
141238
|
}
|
|
141239
|
-
if (
|
|
141240
|
-
traverseObjectKeys(
|
|
141239
|
+
if (schema11.patternProperties) {
|
|
141240
|
+
traverseObjectKeys(schema11.patternProperties, callback, processed);
|
|
141241
141241
|
}
|
|
141242
|
-
if (
|
|
141243
|
-
traverse(
|
|
141242
|
+
if (schema11.additionalProperties && typeof schema11.additionalProperties === "object") {
|
|
141243
|
+
traverse(schema11.additionalProperties, callback, processed);
|
|
141244
141244
|
}
|
|
141245
|
-
if (
|
|
141246
|
-
const { items } =
|
|
141245
|
+
if (schema11.items) {
|
|
141246
|
+
const { items } = schema11;
|
|
141247
141247
|
if (Array.isArray(items)) {
|
|
141248
141248
|
traverseArray(items, callback, processed);
|
|
141249
141249
|
} else {
|
|
141250
141250
|
traverse(items, callback, processed);
|
|
141251
141251
|
}
|
|
141252
141252
|
}
|
|
141253
|
-
if (
|
|
141254
|
-
traverse(
|
|
141253
|
+
if (schema11.additionalItems && typeof schema11.additionalItems === "object") {
|
|
141254
|
+
traverse(schema11.additionalItems, callback, processed);
|
|
141255
141255
|
}
|
|
141256
|
-
if (
|
|
141257
|
-
if (Array.isArray(
|
|
141258
|
-
traverseArray(
|
|
141256
|
+
if (schema11.dependencies) {
|
|
141257
|
+
if (Array.isArray(schema11.dependencies)) {
|
|
141258
|
+
traverseArray(schema11.dependencies, callback, processed);
|
|
141259
141259
|
} else {
|
|
141260
|
-
traverseObjectKeys(
|
|
141260
|
+
traverseObjectKeys(schema11.dependencies, callback, processed);
|
|
141261
141261
|
}
|
|
141262
141262
|
}
|
|
141263
|
-
if (
|
|
141264
|
-
traverseObjectKeys(
|
|
141263
|
+
if (schema11.definitions) {
|
|
141264
|
+
traverseObjectKeys(schema11.definitions, callback, processed);
|
|
141265
141265
|
}
|
|
141266
|
-
if (
|
|
141267
|
-
traverseObjectKeys(
|
|
141266
|
+
if (schema11.$defs) {
|
|
141267
|
+
traverseObjectKeys(schema11.$defs, callback, processed);
|
|
141268
141268
|
}
|
|
141269
|
-
if (
|
|
141270
|
-
traverse(
|
|
141269
|
+
if (schema11.not) {
|
|
141270
|
+
traverse(schema11.not, callback, processed);
|
|
141271
141271
|
}
|
|
141272
|
-
traverseIntersection(
|
|
141273
|
-
Object.keys(
|
|
141274
|
-
const child =
|
|
141272
|
+
traverseIntersection(schema11, callback, processed);
|
|
141273
|
+
Object.keys(schema11).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
|
|
141274
|
+
const child = schema11[key3];
|
|
141275
141275
|
if (child && typeof child === "object") {
|
|
141276
141276
|
traverseObjectKeys(child, callback, processed);
|
|
141277
141277
|
}
|
|
@@ -141353,14 +141353,14 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141353
141353
|
return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
|
|
141354
141354
|
}
|
|
141355
141355
|
}
|
|
141356
|
-
function escapeBlockComment(
|
|
141356
|
+
function escapeBlockComment(schema11) {
|
|
141357
141357
|
const replacer = "* /";
|
|
141358
|
-
if (
|
|
141358
|
+
if (schema11 === null || typeof schema11 !== "object") {
|
|
141359
141359
|
return;
|
|
141360
141360
|
}
|
|
141361
|
-
for (const key2 of Object.keys(
|
|
141362
|
-
if (key2 === "description" && typeof
|
|
141363
|
-
|
|
141361
|
+
for (const key2 of Object.keys(schema11)) {
|
|
141362
|
+
if (key2 === "description" && typeof schema11[key2] === "string") {
|
|
141363
|
+
schema11[key2] = schema11[key2].replace(/\*\//g, replacer);
|
|
141364
141364
|
}
|
|
141365
141365
|
}
|
|
141366
141366
|
}
|
|
@@ -141372,45 +141372,45 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141372
141372
|
return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
|
|
141373
141373
|
}
|
|
141374
141374
|
exports.pathTransform = pathTransform;
|
|
141375
|
-
function maybeStripDefault(
|
|
141376
|
-
if (!("default" in
|
|
141377
|
-
return
|
|
141375
|
+
function maybeStripDefault(schema11) {
|
|
141376
|
+
if (!("default" in schema11)) {
|
|
141377
|
+
return schema11;
|
|
141378
141378
|
}
|
|
141379
|
-
switch (
|
|
141379
|
+
switch (schema11.type) {
|
|
141380
141380
|
case "array":
|
|
141381
|
-
if (Array.isArray(
|
|
141382
|
-
return
|
|
141381
|
+
if (Array.isArray(schema11.default)) {
|
|
141382
|
+
return schema11;
|
|
141383
141383
|
}
|
|
141384
141384
|
break;
|
|
141385
141385
|
case "boolean":
|
|
141386
|
-
if (typeof
|
|
141387
|
-
return
|
|
141386
|
+
if (typeof schema11.default === "boolean") {
|
|
141387
|
+
return schema11;
|
|
141388
141388
|
}
|
|
141389
141389
|
break;
|
|
141390
141390
|
case "integer":
|
|
141391
141391
|
case "number":
|
|
141392
|
-
if (typeof
|
|
141393
|
-
return
|
|
141392
|
+
if (typeof schema11.default === "number") {
|
|
141393
|
+
return schema11;
|
|
141394
141394
|
}
|
|
141395
141395
|
break;
|
|
141396
141396
|
case "string":
|
|
141397
|
-
if (typeof
|
|
141398
|
-
return
|
|
141397
|
+
if (typeof schema11.default === "string") {
|
|
141398
|
+
return schema11;
|
|
141399
141399
|
}
|
|
141400
141400
|
break;
|
|
141401
141401
|
case "null":
|
|
141402
|
-
if (
|
|
141403
|
-
return
|
|
141402
|
+
if (schema11.default === null) {
|
|
141403
|
+
return schema11;
|
|
141404
141404
|
}
|
|
141405
141405
|
break;
|
|
141406
141406
|
case "object":
|
|
141407
|
-
if ((0, lodash_1.isPlainObject)(
|
|
141408
|
-
return
|
|
141407
|
+
if ((0, lodash_1.isPlainObject)(schema11.default)) {
|
|
141408
|
+
return schema11;
|
|
141409
141409
|
}
|
|
141410
141410
|
break;
|
|
141411
141411
|
}
|
|
141412
|
-
delete
|
|
141413
|
-
return
|
|
141412
|
+
delete schema11.default;
|
|
141413
|
+
return schema11;
|
|
141414
141414
|
}
|
|
141415
141415
|
exports.maybeStripDefault = maybeStripDefault;
|
|
141416
141416
|
function appendToDescription(existingDescription, ...values) {
|
|
@@ -141424,11 +141424,11 @@ ${values.join(`
|
|
|
141424
141424
|
`);
|
|
141425
141425
|
}
|
|
141426
141426
|
exports.appendToDescription = appendToDescription;
|
|
141427
|
-
function isSchemaLike(
|
|
141428
|
-
if (!(0, lodash_1.isPlainObject)(
|
|
141427
|
+
function isSchemaLike(schema11) {
|
|
141428
|
+
if (!(0, lodash_1.isPlainObject)(schema11)) {
|
|
141429
141429
|
return false;
|
|
141430
141430
|
}
|
|
141431
|
-
const parent =
|
|
141431
|
+
const parent = schema11[JSONSchema_1.Parent];
|
|
141432
141432
|
if (parent === null) {
|
|
141433
141433
|
return true;
|
|
141434
141434
|
}
|
|
@@ -141445,7 +141445,7 @@ ${values.join(`
|
|
|
141445
141445
|
"properties",
|
|
141446
141446
|
"required"
|
|
141447
141447
|
];
|
|
141448
|
-
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] ===
|
|
141448
|
+
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema11)) {
|
|
141449
141449
|
return false;
|
|
141450
141450
|
}
|
|
141451
141451
|
return true;
|
|
@@ -141743,13 +141743,13 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141743
141743
|
exports.typesOfSchema = undefined;
|
|
141744
141744
|
var lodash_1 = require_lodash8();
|
|
141745
141745
|
var JSONSchema_1 = require_JSONSchema();
|
|
141746
|
-
function typesOfSchema(
|
|
141747
|
-
if (
|
|
141746
|
+
function typesOfSchema(schema11) {
|
|
141747
|
+
if (schema11.tsType) {
|
|
141748
141748
|
return new Set(["CUSTOM_TYPE"]);
|
|
141749
141749
|
}
|
|
141750
141750
|
const matchedTypes = new Set;
|
|
141751
141751
|
for (const [schemaType, f7] of Object.entries(matchers)) {
|
|
141752
|
-
if (f7(
|
|
141752
|
+
if (f7(schema11)) {
|
|
141753
141753
|
matchedTypes.add(schemaType);
|
|
141754
141754
|
}
|
|
141755
141755
|
}
|
|
@@ -141760,26 +141760,26 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141760
141760
|
}
|
|
141761
141761
|
exports.typesOfSchema = typesOfSchema;
|
|
141762
141762
|
var matchers = {
|
|
141763
|
-
ALL_OF(
|
|
141764
|
-
return "allOf" in
|
|
141763
|
+
ALL_OF(schema11) {
|
|
141764
|
+
return "allOf" in schema11;
|
|
141765
141765
|
},
|
|
141766
|
-
ANY(
|
|
141767
|
-
if (Object.keys(
|
|
141766
|
+
ANY(schema11) {
|
|
141767
|
+
if (Object.keys(schema11).length === 0) {
|
|
141768
141768
|
return true;
|
|
141769
141769
|
}
|
|
141770
|
-
return
|
|
141770
|
+
return schema11.type === "any";
|
|
141771
141771
|
},
|
|
141772
|
-
ANY_OF(
|
|
141773
|
-
return "anyOf" in
|
|
141772
|
+
ANY_OF(schema11) {
|
|
141773
|
+
return "anyOf" in schema11;
|
|
141774
141774
|
},
|
|
141775
|
-
BOOLEAN(
|
|
141776
|
-
if ("enum" in
|
|
141775
|
+
BOOLEAN(schema11) {
|
|
141776
|
+
if ("enum" in schema11) {
|
|
141777
141777
|
return false;
|
|
141778
141778
|
}
|
|
141779
|
-
if (
|
|
141779
|
+
if (schema11.type === "boolean") {
|
|
141780
141780
|
return true;
|
|
141781
141781
|
}
|
|
141782
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141782
|
+
if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "boolean") {
|
|
141783
141783
|
return true;
|
|
141784
141784
|
}
|
|
141785
141785
|
return false;
|
|
@@ -141787,74 +141787,74 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141787
141787
|
CUSTOM_TYPE() {
|
|
141788
141788
|
return false;
|
|
141789
141789
|
},
|
|
141790
|
-
NAMED_ENUM(
|
|
141791
|
-
return "enum" in
|
|
141790
|
+
NAMED_ENUM(schema11) {
|
|
141791
|
+
return "enum" in schema11 && "tsEnumNames" in schema11;
|
|
141792
141792
|
},
|
|
141793
|
-
NAMED_SCHEMA(
|
|
141794
|
-
return "$id" in
|
|
141793
|
+
NAMED_SCHEMA(schema11) {
|
|
141794
|
+
return "$id" in schema11 && (("patternProperties" in schema11) || ("properties" in schema11));
|
|
141795
141795
|
},
|
|
141796
|
-
NEVER(
|
|
141797
|
-
return
|
|
141796
|
+
NEVER(schema11) {
|
|
141797
|
+
return schema11 === false;
|
|
141798
141798
|
},
|
|
141799
|
-
NULL(
|
|
141800
|
-
return
|
|
141799
|
+
NULL(schema11) {
|
|
141800
|
+
return schema11.type === "null";
|
|
141801
141801
|
},
|
|
141802
|
-
NUMBER(
|
|
141803
|
-
if ("enum" in
|
|
141802
|
+
NUMBER(schema11) {
|
|
141803
|
+
if ("enum" in schema11) {
|
|
141804
141804
|
return false;
|
|
141805
141805
|
}
|
|
141806
|
-
if (
|
|
141806
|
+
if (schema11.type === "integer" || schema11.type === "number") {
|
|
141807
141807
|
return true;
|
|
141808
141808
|
}
|
|
141809
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141809
|
+
if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "number") {
|
|
141810
141810
|
return true;
|
|
141811
141811
|
}
|
|
141812
141812
|
return false;
|
|
141813
141813
|
},
|
|
141814
|
-
OBJECT(
|
|
141815
|
-
return
|
|
141814
|
+
OBJECT(schema11) {
|
|
141815
|
+
return schema11.type === "object" && !(0, lodash_1.isPlainObject)(schema11.additionalProperties) && !schema11.allOf && !schema11.anyOf && !schema11.oneOf && !schema11.patternProperties && !schema11.properties && !schema11.required;
|
|
141816
141816
|
},
|
|
141817
|
-
ONE_OF(
|
|
141818
|
-
return "oneOf" in
|
|
141817
|
+
ONE_OF(schema11) {
|
|
141818
|
+
return "oneOf" in schema11;
|
|
141819
141819
|
},
|
|
141820
|
-
REFERENCE(
|
|
141821
|
-
return "$ref" in
|
|
141820
|
+
REFERENCE(schema11) {
|
|
141821
|
+
return "$ref" in schema11;
|
|
141822
141822
|
},
|
|
141823
|
-
STRING(
|
|
141824
|
-
if ("enum" in
|
|
141823
|
+
STRING(schema11) {
|
|
141824
|
+
if ("enum" in schema11) {
|
|
141825
141825
|
return false;
|
|
141826
141826
|
}
|
|
141827
|
-
if (
|
|
141827
|
+
if (schema11.type === "string") {
|
|
141828
141828
|
return true;
|
|
141829
141829
|
}
|
|
141830
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141830
|
+
if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "string") {
|
|
141831
141831
|
return true;
|
|
141832
141832
|
}
|
|
141833
141833
|
return false;
|
|
141834
141834
|
},
|
|
141835
|
-
TYPED_ARRAY(
|
|
141836
|
-
if (
|
|
141835
|
+
TYPED_ARRAY(schema11) {
|
|
141836
|
+
if (schema11.type && schema11.type !== "array") {
|
|
141837
141837
|
return false;
|
|
141838
141838
|
}
|
|
141839
|
-
return "items" in
|
|
141839
|
+
return "items" in schema11;
|
|
141840
141840
|
},
|
|
141841
|
-
UNION(
|
|
141842
|
-
return Array.isArray(
|
|
141841
|
+
UNION(schema11) {
|
|
141842
|
+
return Array.isArray(schema11.type);
|
|
141843
141843
|
},
|
|
141844
|
-
UNNAMED_ENUM(
|
|
141845
|
-
if ("tsEnumNames" in
|
|
141844
|
+
UNNAMED_ENUM(schema11) {
|
|
141845
|
+
if ("tsEnumNames" in schema11) {
|
|
141846
141846
|
return false;
|
|
141847
141847
|
}
|
|
141848
|
-
if (
|
|
141848
|
+
if (schema11.type && schema11.type !== "boolean" && schema11.type !== "integer" && schema11.type !== "number" && schema11.type !== "string") {
|
|
141849
141849
|
return false;
|
|
141850
141850
|
}
|
|
141851
|
-
return "enum" in
|
|
141851
|
+
return "enum" in schema11;
|
|
141852
141852
|
},
|
|
141853
141853
|
UNNAMED_SCHEMA() {
|
|
141854
141854
|
return false;
|
|
141855
141855
|
},
|
|
141856
|
-
UNTYPED_ARRAY(
|
|
141857
|
-
return
|
|
141856
|
+
UNTYPED_ARRAY(schema11) {
|
|
141857
|
+
return schema11.type === "array" && !("items" in schema11);
|
|
141858
141858
|
}
|
|
141859
141859
|
};
|
|
141860
141860
|
});
|
|
@@ -141865,10 +141865,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
141865
141865
|
exports.applySchemaTyping = undefined;
|
|
141866
141866
|
var JSONSchema_1 = require_JSONSchema();
|
|
141867
141867
|
var typesOfSchema_1 = require_typesOfSchema();
|
|
141868
|
-
function applySchemaTyping(
|
|
141868
|
+
function applySchemaTyping(schema11) {
|
|
141869
141869
|
var _a7;
|
|
141870
|
-
const types = (0, typesOfSchema_1.typesOfSchema)(
|
|
141871
|
-
Object.defineProperty(
|
|
141870
|
+
const types = (0, typesOfSchema_1.typesOfSchema)(schema11);
|
|
141871
|
+
Object.defineProperty(schema11, JSONSchema_1.Types, {
|
|
141872
141872
|
enumerable: false,
|
|
141873
141873
|
value: types,
|
|
141874
141874
|
writable: false
|
|
@@ -141877,23 +141877,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
141877
141877
|
return;
|
|
141878
141878
|
}
|
|
141879
141879
|
const intersection2 = {
|
|
141880
|
-
[JSONSchema_1.Parent]:
|
|
141880
|
+
[JSONSchema_1.Parent]: schema11,
|
|
141881
141881
|
[JSONSchema_1.Types]: new Set(["ALL_OF"]),
|
|
141882
|
-
$id:
|
|
141883
|
-
description:
|
|
141884
|
-
name:
|
|
141885
|
-
title:
|
|
141886
|
-
allOf: (_a7 =
|
|
141882
|
+
$id: schema11.$id,
|
|
141883
|
+
description: schema11.description,
|
|
141884
|
+
name: schema11.name,
|
|
141885
|
+
title: schema11.title,
|
|
141886
|
+
allOf: (_a7 = schema11.allOf) !== null && _a7 !== undefined ? _a7 : [],
|
|
141887
141887
|
required: [],
|
|
141888
141888
|
additionalProperties: false
|
|
141889
141889
|
};
|
|
141890
141890
|
types.delete("ALL_OF");
|
|
141891
|
-
delete
|
|
141892
|
-
delete
|
|
141893
|
-
delete
|
|
141894
|
-
delete
|
|
141895
|
-
delete
|
|
141896
|
-
Object.defineProperty(
|
|
141891
|
+
delete schema11.allOf;
|
|
141892
|
+
delete schema11.$id;
|
|
141893
|
+
delete schema11.description;
|
|
141894
|
+
delete schema11.name;
|
|
141895
|
+
delete schema11.title;
|
|
141896
|
+
Object.defineProperty(schema11, JSONSchema_1.Intersection, {
|
|
141897
141897
|
enumerable: false,
|
|
141898
141898
|
value: intersection2,
|
|
141899
141899
|
writable: false
|
|
@@ -141911,186 +141911,186 @@ var require_normalizer = __commonJS((exports) => {
|
|
|
141911
141911
|
var applySchemaTyping_1 = require_applySchemaTyping();
|
|
141912
141912
|
var util_1 = __require("util");
|
|
141913
141913
|
var rules = new Map;
|
|
141914
|
-
function hasType(
|
|
141915
|
-
return
|
|
141914
|
+
function hasType(schema11, type) {
|
|
141915
|
+
return schema11.type === type || Array.isArray(schema11.type) && schema11.type.includes(type);
|
|
141916
141916
|
}
|
|
141917
|
-
function isObjectType(
|
|
141918
|
-
return
|
|
141917
|
+
function isObjectType(schema11) {
|
|
141918
|
+
return schema11.properties !== undefined || hasType(schema11, "object") || hasType(schema11, "any");
|
|
141919
141919
|
}
|
|
141920
|
-
function isArrayType(
|
|
141921
|
-
return
|
|
141920
|
+
function isArrayType(schema11) {
|
|
141921
|
+
return schema11.items !== undefined || hasType(schema11, "array") || hasType(schema11, "any");
|
|
141922
141922
|
}
|
|
141923
|
-
function isEnumTypeWithoutTsEnumNames(
|
|
141924
|
-
return
|
|
141923
|
+
function isEnumTypeWithoutTsEnumNames(schema11) {
|
|
141924
|
+
return schema11.type === "string" && schema11.enum !== undefined && schema11.tsEnumNames === undefined;
|
|
141925
141925
|
}
|
|
141926
|
-
rules.set('Remove `type=["null"]` if `enum=[null]`', (
|
|
141927
|
-
if (Array.isArray(
|
|
141928
|
-
|
|
141926
|
+
rules.set('Remove `type=["null"]` if `enum=[null]`', (schema11) => {
|
|
141927
|
+
if (Array.isArray(schema11.enum) && schema11.enum.some((e8) => e8 === null) && Array.isArray(schema11.type) && schema11.type.includes("null")) {
|
|
141928
|
+
schema11.type = schema11.type.filter((type) => type !== "null");
|
|
141929
141929
|
}
|
|
141930
141930
|
});
|
|
141931
|
-
rules.set("Destructure unary types", (
|
|
141932
|
-
if (
|
|
141933
|
-
|
|
141931
|
+
rules.set("Destructure unary types", (schema11) => {
|
|
141932
|
+
if (schema11.type && Array.isArray(schema11.type) && schema11.type.length === 1) {
|
|
141933
|
+
schema11.type = schema11.type[0];
|
|
141934
141934
|
}
|
|
141935
141935
|
});
|
|
141936
|
-
rules.set("Add empty `required` property if none is defined", (
|
|
141937
|
-
if (isObjectType(
|
|
141938
|
-
|
|
141936
|
+
rules.set("Add empty `required` property if none is defined", (schema11) => {
|
|
141937
|
+
if (isObjectType(schema11) && !("required" in schema11)) {
|
|
141938
|
+
schema11.required = [];
|
|
141939
141939
|
}
|
|
141940
141940
|
});
|
|
141941
|
-
rules.set("Transform `required`=false to `required`=[]", (
|
|
141942
|
-
if (
|
|
141943
|
-
|
|
141941
|
+
rules.set("Transform `required`=false to `required`=[]", (schema11) => {
|
|
141942
|
+
if (schema11.required === false) {
|
|
141943
|
+
schema11.required = [];
|
|
141944
141944
|
}
|
|
141945
141945
|
});
|
|
141946
|
-
rules.set("Default additionalProperties", (
|
|
141947
|
-
if (isObjectType(
|
|
141948
|
-
|
|
141946
|
+
rules.set("Default additionalProperties", (schema11, _10, options8) => {
|
|
141947
|
+
if (isObjectType(schema11) && !("additionalProperties" in schema11) && schema11.patternProperties === undefined) {
|
|
141948
|
+
schema11.additionalProperties = options8.additionalProperties;
|
|
141949
141949
|
}
|
|
141950
141950
|
});
|
|
141951
|
-
rules.set("Transform id to $id", (
|
|
141952
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
141951
|
+
rules.set("Transform id to $id", (schema11, fileName) => {
|
|
141952
|
+
if (!(0, utils_1.isSchemaLike)(schema11)) {
|
|
141953
141953
|
return;
|
|
141954
141954
|
}
|
|
141955
|
-
if (
|
|
141956
|
-
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${
|
|
141955
|
+
if (schema11.id && schema11.$id && schema11.id !== schema11.$id) {
|
|
141956
|
+
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema11.id}, $id=${schema11.$id} in ${fileName}`);
|
|
141957
141957
|
}
|
|
141958
|
-
if (
|
|
141959
|
-
|
|
141960
|
-
delete
|
|
141958
|
+
if (schema11.id) {
|
|
141959
|
+
schema11.$id = schema11.id;
|
|
141960
|
+
delete schema11.id;
|
|
141961
141961
|
}
|
|
141962
141962
|
});
|
|
141963
|
-
rules.set("Add an $id to anything that needs it", (
|
|
141964
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
141963
|
+
rules.set("Add an $id to anything that needs it", (schema11, fileName, _options, _key, dereferencedPaths) => {
|
|
141964
|
+
if (!(0, utils_1.isSchemaLike)(schema11)) {
|
|
141965
141965
|
return;
|
|
141966
141966
|
}
|
|
141967
|
-
if (!
|
|
141968
|
-
|
|
141967
|
+
if (!schema11.$id && !schema11[JSONSchema_1.Parent]) {
|
|
141968
|
+
schema11.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
|
|
141969
141969
|
return;
|
|
141970
141970
|
}
|
|
141971
|
-
if (!isArrayType(
|
|
141971
|
+
if (!isArrayType(schema11) && !isObjectType(schema11)) {
|
|
141972
141972
|
return;
|
|
141973
141973
|
}
|
|
141974
|
-
const dereferencedName = dereferencedPaths.get(
|
|
141975
|
-
if (!
|
|
141976
|
-
|
|
141974
|
+
const dereferencedName = dereferencedPaths.get(schema11);
|
|
141975
|
+
if (!schema11.$id && !schema11.title && dereferencedName) {
|
|
141976
|
+
schema11.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
|
|
141977
141977
|
}
|
|
141978
141978
|
if (dereferencedName) {
|
|
141979
|
-
dereferencedPaths.delete(
|
|
141979
|
+
dereferencedPaths.delete(schema11);
|
|
141980
141980
|
}
|
|
141981
141981
|
});
|
|
141982
|
-
rules.set("Escape closing JSDoc comment", (
|
|
141983
|
-
(0, utils_1.escapeBlockComment)(
|
|
141982
|
+
rules.set("Escape closing JSDoc comment", (schema11) => {
|
|
141983
|
+
(0, utils_1.escapeBlockComment)(schema11);
|
|
141984
141984
|
});
|
|
141985
|
-
rules.set("Add JSDoc comments for minItems and maxItems", (
|
|
141986
|
-
if (!isArrayType(
|
|
141985
|
+
rules.set("Add JSDoc comments for minItems and maxItems", (schema11) => {
|
|
141986
|
+
if (!isArrayType(schema11)) {
|
|
141987
141987
|
return;
|
|
141988
141988
|
}
|
|
141989
141989
|
const commentsToAppend = [
|
|
141990
|
-
"minItems" in
|
|
141991
|
-
"maxItems" in
|
|
141990
|
+
"minItems" in schema11 ? `@minItems ${schema11.minItems}` : "",
|
|
141991
|
+
"maxItems" in schema11 ? `@maxItems ${schema11.maxItems}` : ""
|
|
141992
141992
|
].filter(Boolean);
|
|
141993
141993
|
if (commentsToAppend.length) {
|
|
141994
|
-
|
|
141994
|
+
schema11.description = (0, utils_1.appendToDescription)(schema11.description, ...commentsToAppend);
|
|
141995
141995
|
}
|
|
141996
141996
|
});
|
|
141997
|
-
rules.set("Optionally remove maxItems and minItems", (
|
|
141998
|
-
if (!isArrayType(
|
|
141997
|
+
rules.set("Optionally remove maxItems and minItems", (schema11, _fileName, options8) => {
|
|
141998
|
+
if (!isArrayType(schema11)) {
|
|
141999
141999
|
return;
|
|
142000
142000
|
}
|
|
142001
|
-
if ("minItems" in
|
|
142002
|
-
delete
|
|
142001
|
+
if ("minItems" in schema11 && options8.ignoreMinAndMaxItems) {
|
|
142002
|
+
delete schema11.minItems;
|
|
142003
142003
|
}
|
|
142004
|
-
if ("maxItems" in
|
|
142005
|
-
delete
|
|
142004
|
+
if ("maxItems" in schema11 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
|
|
142005
|
+
delete schema11.maxItems;
|
|
142006
142006
|
}
|
|
142007
142007
|
});
|
|
142008
|
-
rules.set("Normalize schema.minItems", (
|
|
142008
|
+
rules.set("Normalize schema.minItems", (schema11, _fileName, options8) => {
|
|
142009
142009
|
if (options8.ignoreMinAndMaxItems) {
|
|
142010
142010
|
return;
|
|
142011
142011
|
}
|
|
142012
|
-
if (!isArrayType(
|
|
142012
|
+
if (!isArrayType(schema11)) {
|
|
142013
142013
|
return;
|
|
142014
142014
|
}
|
|
142015
|
-
const { minItems } =
|
|
142016
|
-
|
|
142015
|
+
const { minItems } = schema11;
|
|
142016
|
+
schema11.minItems = typeof minItems === "number" ? minItems : 0;
|
|
142017
142017
|
});
|
|
142018
|
-
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (
|
|
142018
|
+
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema11, _fileName, options8) => {
|
|
142019
142019
|
if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
|
|
142020
142020
|
return;
|
|
142021
142021
|
}
|
|
142022
|
-
if (!isArrayType(
|
|
142022
|
+
if (!isArrayType(schema11)) {
|
|
142023
142023
|
return;
|
|
142024
142024
|
}
|
|
142025
|
-
const { maxItems, minItems } =
|
|
142025
|
+
const { maxItems, minItems } = schema11;
|
|
142026
142026
|
if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
|
|
142027
|
-
delete
|
|
142027
|
+
delete schema11.maxItems;
|
|
142028
142028
|
}
|
|
142029
142029
|
});
|
|
142030
|
-
rules.set("Normalize schema.items", (
|
|
142030
|
+
rules.set("Normalize schema.items", (schema11, _fileName, options8) => {
|
|
142031
142031
|
if (options8.ignoreMinAndMaxItems) {
|
|
142032
142032
|
return;
|
|
142033
142033
|
}
|
|
142034
|
-
const { maxItems, minItems } =
|
|
142034
|
+
const { maxItems, minItems } = schema11;
|
|
142035
142035
|
const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
|
|
142036
142036
|
const hasMinItems = typeof minItems === "number" && minItems > 0;
|
|
142037
|
-
if (
|
|
142038
|
-
const items =
|
|
142037
|
+
if (schema11.items && !Array.isArray(schema11.items) && (hasMaxItems || hasMinItems)) {
|
|
142038
|
+
const items = schema11.items;
|
|
142039
142039
|
const newItems = Array(maxItems || minItems || 0).fill(items);
|
|
142040
142040
|
if (!hasMaxItems) {
|
|
142041
|
-
|
|
142041
|
+
schema11.additionalItems = items;
|
|
142042
142042
|
}
|
|
142043
|
-
|
|
142043
|
+
schema11.items = newItems;
|
|
142044
142044
|
}
|
|
142045
|
-
if (Array.isArray(
|
|
142046
|
-
|
|
142045
|
+
if (Array.isArray(schema11.items) && hasMaxItems && maxItems < schema11.items.length) {
|
|
142046
|
+
schema11.items = schema11.items.slice(0, maxItems);
|
|
142047
142047
|
}
|
|
142048
|
-
return
|
|
142048
|
+
return schema11;
|
|
142049
142049
|
});
|
|
142050
|
-
rules.set("Remove extends, if it is empty", (
|
|
142051
|
-
if (!
|
|
142050
|
+
rules.set("Remove extends, if it is empty", (schema11) => {
|
|
142051
|
+
if (!schema11.hasOwnProperty("extends")) {
|
|
142052
142052
|
return;
|
|
142053
142053
|
}
|
|
142054
|
-
if (
|
|
142055
|
-
delete
|
|
142054
|
+
if (schema11.extends == null || Array.isArray(schema11.extends) && schema11.extends.length === 0) {
|
|
142055
|
+
delete schema11.extends;
|
|
142056
142056
|
}
|
|
142057
142057
|
});
|
|
142058
|
-
rules.set("Make extends always an array, if it is defined", (
|
|
142059
|
-
if (
|
|
142058
|
+
rules.set("Make extends always an array, if it is defined", (schema11) => {
|
|
142059
|
+
if (schema11.extends == null) {
|
|
142060
142060
|
return;
|
|
142061
142061
|
}
|
|
142062
|
-
if (!Array.isArray(
|
|
142063
|
-
|
|
142062
|
+
if (!Array.isArray(schema11.extends)) {
|
|
142063
|
+
schema11.extends = [schema11.extends];
|
|
142064
142064
|
}
|
|
142065
142065
|
});
|
|
142066
|
-
rules.set("Transform definitions to $defs", (
|
|
142067
|
-
if (
|
|
142068
|
-
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${
|
|
142066
|
+
rules.set("Transform definitions to $defs", (schema11, fileName) => {
|
|
142067
|
+
if (schema11.definitions && schema11.$defs && !(0, util_1.isDeepStrictEqual)(schema11.definitions, schema11.$defs)) {
|
|
142068
|
+
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema11.id} in ${fileName}`);
|
|
142069
142069
|
}
|
|
142070
|
-
if (
|
|
142071
|
-
|
|
142072
|
-
delete
|
|
142070
|
+
if (schema11.definitions) {
|
|
142071
|
+
schema11.$defs = schema11.definitions;
|
|
142072
|
+
delete schema11.definitions;
|
|
142073
142073
|
}
|
|
142074
142074
|
});
|
|
142075
|
-
rules.set("Transform const to singleton enum", (
|
|
142076
|
-
if (
|
|
142077
|
-
|
|
142078
|
-
delete
|
|
142075
|
+
rules.set("Transform const to singleton enum", (schema11) => {
|
|
142076
|
+
if (schema11.const !== undefined) {
|
|
142077
|
+
schema11.enum = [schema11.const];
|
|
142078
|
+
delete schema11.const;
|
|
142079
142079
|
}
|
|
142080
142080
|
});
|
|
142081
|
-
rules.set("Add tsEnumNames to enum types", (
|
|
142081
|
+
rules.set("Add tsEnumNames to enum types", (schema11, _10, options8) => {
|
|
142082
142082
|
var _a7;
|
|
142083
|
-
if (isEnumTypeWithoutTsEnumNames(
|
|
142084
|
-
|
|
142083
|
+
if (isEnumTypeWithoutTsEnumNames(schema11) && options8.inferStringEnumKeysFromValues) {
|
|
142084
|
+
schema11.tsEnumNames = (_a7 = schema11.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
|
|
142085
142085
|
}
|
|
142086
142086
|
});
|
|
142087
|
-
rules.set("Pre-calculate schema types and intersections", (
|
|
142088
|
-
if (
|
|
142089
|
-
(0, applySchemaTyping_1.applySchemaTyping)(
|
|
142087
|
+
rules.set("Pre-calculate schema types and intersections", (schema11) => {
|
|
142088
|
+
if (schema11 !== null && typeof schema11 === "object") {
|
|
142089
|
+
(0, applySchemaTyping_1.applySchemaTyping)(schema11);
|
|
142090
142090
|
}
|
|
142091
142091
|
});
|
|
142092
142092
|
function normalize2(rootSchema, dereferencedPaths, filename, options8) {
|
|
142093
|
-
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (
|
|
142093
|
+
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema11, key2) => rule(schema11, filename, options8, key2, dereferencedPaths)));
|
|
142094
142094
|
return rootSchema;
|
|
142095
142095
|
}
|
|
142096
142096
|
exports.normalize = normalize2;
|
|
@@ -142172,37 +142172,37 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142172
142172
|
var AST_1 = require_AST();
|
|
142173
142173
|
var JSONSchema_1 = require_JSONSchema();
|
|
142174
142174
|
var utils_1 = require_utils7();
|
|
142175
|
-
function parse11(
|
|
142176
|
-
if ((0, JSONSchema_1.isPrimitive)(
|
|
142177
|
-
if ((0, JSONSchema_1.isBoolean)(
|
|
142178
|
-
return parseBooleanSchema(
|
|
142175
|
+
function parse11(schema11, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142176
|
+
if ((0, JSONSchema_1.isPrimitive)(schema11)) {
|
|
142177
|
+
if ((0, JSONSchema_1.isBoolean)(schema11)) {
|
|
142178
|
+
return parseBooleanSchema(schema11, keyName, options8);
|
|
142179
142179
|
}
|
|
142180
|
-
return parseLiteral(
|
|
142180
|
+
return parseLiteral(schema11, keyName);
|
|
142181
142181
|
}
|
|
142182
|
-
const intersection2 =
|
|
142183
|
-
const types =
|
|
142182
|
+
const intersection2 = schema11[JSONSchema_1.Intersection];
|
|
142183
|
+
const types = schema11[JSONSchema_1.Types];
|
|
142184
142184
|
if (intersection2) {
|
|
142185
142185
|
const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
|
|
142186
142186
|
types.forEach((type) => {
|
|
142187
|
-
ast.params.push(parseAsTypeWithCache(
|
|
142187
|
+
ast.params.push(parseAsTypeWithCache(schema11, type, options8, keyName, processed, usedNames));
|
|
142188
142188
|
});
|
|
142189
|
-
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:",
|
|
142189
|
+
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema11, "Output:", ast);
|
|
142190
142190
|
return ast;
|
|
142191
142191
|
}
|
|
142192
142192
|
if (types.size === 1) {
|
|
142193
142193
|
const type = [...types][0];
|
|
142194
|
-
const ast = parseAsTypeWithCache(
|
|
142195
|
-
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:",
|
|
142194
|
+
const ast = parseAsTypeWithCache(schema11, type, options8, keyName, processed, usedNames);
|
|
142195
|
+
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema11, "Output:", ast);
|
|
142196
142196
|
return ast;
|
|
142197
142197
|
}
|
|
142198
142198
|
throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
|
|
142199
142199
|
}
|
|
142200
142200
|
exports.parse = parse11;
|
|
142201
|
-
function parseAsTypeWithCache(
|
|
142202
|
-
let cachedTypeMap = processed.get(
|
|
142201
|
+
function parseAsTypeWithCache(schema11, type, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142202
|
+
let cachedTypeMap = processed.get(schema11);
|
|
142203
142203
|
if (!cachedTypeMap) {
|
|
142204
142204
|
cachedTypeMap = new Map;
|
|
142205
|
-
processed.set(
|
|
142205
|
+
processed.set(schema11, cachedTypeMap);
|
|
142206
142206
|
}
|
|
142207
142207
|
const cachedAST = cachedTypeMap.get(type);
|
|
142208
142208
|
if (cachedAST) {
|
|
@@ -142210,10 +142210,10 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142210
142210
|
}
|
|
142211
142211
|
const ast = {};
|
|
142212
142212
|
cachedTypeMap.set(type, ast);
|
|
142213
|
-
return Object.assign(ast, parseNonLiteral(
|
|
142213
|
+
return Object.assign(ast, parseNonLiteral(schema11, type, options8, keyName, processed, usedNames));
|
|
142214
142214
|
}
|
|
142215
|
-
function parseBooleanSchema(
|
|
142216
|
-
if (
|
|
142215
|
+
function parseBooleanSchema(schema11, keyName, options8) {
|
|
142216
|
+
if (schema11) {
|
|
142217
142217
|
return {
|
|
142218
142218
|
keyName,
|
|
142219
142219
|
type: options8.unknownAny ? "UNKNOWN" : "ANY"
|
|
@@ -142224,157 +142224,157 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142224
142224
|
type: "NEVER"
|
|
142225
142225
|
};
|
|
142226
142226
|
}
|
|
142227
|
-
function parseLiteral(
|
|
142227
|
+
function parseLiteral(schema11, keyName) {
|
|
142228
142228
|
return {
|
|
142229
142229
|
keyName,
|
|
142230
|
-
params:
|
|
142230
|
+
params: schema11,
|
|
142231
142231
|
type: "LITERAL"
|
|
142232
142232
|
};
|
|
142233
142233
|
}
|
|
142234
|
-
function parseNonLiteral(
|
|
142235
|
-
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(
|
|
142236
|
-
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 ===
|
|
142234
|
+
function parseNonLiteral(schema11, type, options8, keyName, processed, usedNames) {
|
|
142235
|
+
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema11));
|
|
142236
|
+
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema11);
|
|
142237
142237
|
switch (type) {
|
|
142238
142238
|
case "ALL_OF":
|
|
142239
142239
|
return {
|
|
142240
|
-
comment:
|
|
142241
|
-
deprecated:
|
|
142240
|
+
comment: schema11.description,
|
|
142241
|
+
deprecated: schema11.deprecated,
|
|
142242
142242
|
keyName,
|
|
142243
|
-
standaloneName: standaloneName(
|
|
142244
|
-
params:
|
|
142243
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142244
|
+
params: schema11.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142245
142245
|
type: "INTERSECTION"
|
|
142246
142246
|
};
|
|
142247
142247
|
case "ANY":
|
|
142248
|
-
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment:
|
|
142248
|
+
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema11.description, deprecated: schema11.deprecated, keyName, standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8) });
|
|
142249
142249
|
case "ANY_OF":
|
|
142250
142250
|
return {
|
|
142251
|
-
comment:
|
|
142252
|
-
deprecated:
|
|
142251
|
+
comment: schema11.description,
|
|
142252
|
+
deprecated: schema11.deprecated,
|
|
142253
142253
|
keyName,
|
|
142254
|
-
standaloneName: standaloneName(
|
|
142255
|
-
params:
|
|
142254
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142255
|
+
params: schema11.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142256
142256
|
type: "UNION"
|
|
142257
142257
|
};
|
|
142258
142258
|
case "BOOLEAN":
|
|
142259
142259
|
return {
|
|
142260
|
-
comment:
|
|
142261
|
-
deprecated:
|
|
142260
|
+
comment: schema11.description,
|
|
142261
|
+
deprecated: schema11.deprecated,
|
|
142262
142262
|
keyName,
|
|
142263
|
-
standaloneName: standaloneName(
|
|
142263
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142264
142264
|
type: "BOOLEAN"
|
|
142265
142265
|
};
|
|
142266
142266
|
case "CUSTOM_TYPE":
|
|
142267
142267
|
return {
|
|
142268
|
-
comment:
|
|
142269
|
-
deprecated:
|
|
142268
|
+
comment: schema11.description,
|
|
142269
|
+
deprecated: schema11.deprecated,
|
|
142270
142270
|
keyName,
|
|
142271
|
-
params:
|
|
142272
|
-
standaloneName: standaloneName(
|
|
142271
|
+
params: schema11.tsType,
|
|
142272
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142273
142273
|
type: "CUSTOM_TYPE"
|
|
142274
142274
|
};
|
|
142275
142275
|
case "NAMED_ENUM":
|
|
142276
142276
|
return {
|
|
142277
|
-
comment:
|
|
142278
|
-
deprecated:
|
|
142277
|
+
comment: schema11.description,
|
|
142278
|
+
deprecated: schema11.deprecated,
|
|
142279
142279
|
keyName,
|
|
142280
|
-
standaloneName: standaloneName(
|
|
142281
|
-
params:
|
|
142280
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
|
|
142281
|
+
params: schema11.enum.map((_10, n5) => ({
|
|
142282
142282
|
ast: parseLiteral(_10, undefined),
|
|
142283
|
-
keyName:
|
|
142283
|
+
keyName: schema11.tsEnumNames[n5]
|
|
142284
142284
|
})),
|
|
142285
142285
|
type: "ENUM"
|
|
142286
142286
|
};
|
|
142287
142287
|
case "NAMED_SCHEMA":
|
|
142288
|
-
return newInterface(
|
|
142288
|
+
return newInterface(schema11, options8, processed, usedNames, keyName);
|
|
142289
142289
|
case "NEVER":
|
|
142290
142290
|
return {
|
|
142291
|
-
comment:
|
|
142292
|
-
deprecated:
|
|
142291
|
+
comment: schema11.description,
|
|
142292
|
+
deprecated: schema11.deprecated,
|
|
142293
142293
|
keyName,
|
|
142294
|
-
standaloneName: standaloneName(
|
|
142294
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142295
142295
|
type: "NEVER"
|
|
142296
142296
|
};
|
|
142297
142297
|
case "NULL":
|
|
142298
142298
|
return {
|
|
142299
|
-
comment:
|
|
142300
|
-
deprecated:
|
|
142299
|
+
comment: schema11.description,
|
|
142300
|
+
deprecated: schema11.deprecated,
|
|
142301
142301
|
keyName,
|
|
142302
|
-
standaloneName: standaloneName(
|
|
142302
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142303
142303
|
type: "NULL"
|
|
142304
142304
|
};
|
|
142305
142305
|
case "NUMBER":
|
|
142306
142306
|
return {
|
|
142307
|
-
comment:
|
|
142308
|
-
deprecated:
|
|
142307
|
+
comment: schema11.description,
|
|
142308
|
+
deprecated: schema11.deprecated,
|
|
142309
142309
|
keyName,
|
|
142310
|
-
standaloneName: standaloneName(
|
|
142310
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142311
142311
|
type: "NUMBER"
|
|
142312
142312
|
};
|
|
142313
142313
|
case "OBJECT":
|
|
142314
142314
|
return {
|
|
142315
|
-
comment:
|
|
142315
|
+
comment: schema11.description,
|
|
142316
142316
|
keyName,
|
|
142317
|
-
standaloneName: standaloneName(
|
|
142317
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142318
142318
|
type: "OBJECT",
|
|
142319
|
-
deprecated:
|
|
142319
|
+
deprecated: schema11.deprecated
|
|
142320
142320
|
};
|
|
142321
142321
|
case "ONE_OF":
|
|
142322
142322
|
return {
|
|
142323
|
-
comment:
|
|
142324
|
-
deprecated:
|
|
142323
|
+
comment: schema11.description,
|
|
142324
|
+
deprecated: schema11.deprecated,
|
|
142325
142325
|
keyName,
|
|
142326
|
-
standaloneName: standaloneName(
|
|
142327
|
-
params:
|
|
142326
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142327
|
+
params: schema11.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142328
142328
|
type: "UNION"
|
|
142329
142329
|
};
|
|
142330
142330
|
case "REFERENCE":
|
|
142331
|
-
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!",
|
|
142331
|
+
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema11));
|
|
142332
142332
|
case "STRING":
|
|
142333
142333
|
return {
|
|
142334
|
-
comment:
|
|
142335
|
-
deprecated:
|
|
142334
|
+
comment: schema11.description,
|
|
142335
|
+
deprecated: schema11.deprecated,
|
|
142336
142336
|
keyName,
|
|
142337
|
-
standaloneName: standaloneName(
|
|
142337
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142338
142338
|
type: "STRING"
|
|
142339
142339
|
};
|
|
142340
142340
|
case "TYPED_ARRAY":
|
|
142341
|
-
if (Array.isArray(
|
|
142342
|
-
const minItems2 =
|
|
142343
|
-
const maxItems2 =
|
|
142341
|
+
if (Array.isArray(schema11.items)) {
|
|
142342
|
+
const minItems2 = schema11.minItems;
|
|
142343
|
+
const maxItems2 = schema11.maxItems;
|
|
142344
142344
|
const arrayType = {
|
|
142345
|
-
comment:
|
|
142346
|
-
deprecated:
|
|
142345
|
+
comment: schema11.description,
|
|
142346
|
+
deprecated: schema11.deprecated,
|
|
142347
142347
|
keyName,
|
|
142348
142348
|
maxItems: maxItems2,
|
|
142349
142349
|
minItems: minItems2,
|
|
142350
|
-
standaloneName: standaloneName(
|
|
142351
|
-
params:
|
|
142350
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142351
|
+
params: schema11.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142352
142352
|
type: "TUPLE"
|
|
142353
142353
|
};
|
|
142354
|
-
if (
|
|
142354
|
+
if (schema11.additionalItems === true) {
|
|
142355
142355
|
arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
142356
|
-
} else if (
|
|
142357
|
-
arrayType.spreadParam = parse11(
|
|
142356
|
+
} else if (schema11.additionalItems) {
|
|
142357
|
+
arrayType.spreadParam = parse11(schema11.additionalItems, options8, undefined, processed, usedNames);
|
|
142358
142358
|
}
|
|
142359
142359
|
return arrayType;
|
|
142360
142360
|
} else {
|
|
142361
142361
|
return {
|
|
142362
|
-
comment:
|
|
142363
|
-
deprecated:
|
|
142362
|
+
comment: schema11.description,
|
|
142363
|
+
deprecated: schema11.deprecated,
|
|
142364
142364
|
keyName,
|
|
142365
|
-
standaloneName: standaloneName(
|
|
142366
|
-
params: parse11(
|
|
142365
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142366
|
+
params: parse11(schema11.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
|
|
142367
142367
|
type: "ARRAY"
|
|
142368
142368
|
};
|
|
142369
142369
|
}
|
|
142370
142370
|
case "UNION":
|
|
142371
142371
|
return {
|
|
142372
|
-
comment:
|
|
142373
|
-
deprecated:
|
|
142372
|
+
comment: schema11.description,
|
|
142373
|
+
deprecated: schema11.deprecated,
|
|
142374
142374
|
keyName,
|
|
142375
|
-
standaloneName: standaloneName(
|
|
142376
|
-
params:
|
|
142377
|
-
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(
|
|
142375
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142376
|
+
params: schema11.type.map((type2) => {
|
|
142377
|
+
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema11, "$id", "description", "title")), { type: type2 });
|
|
142378
142378
|
(0, utils_1.maybeStripDefault)(member);
|
|
142379
142379
|
(0, applySchemaTyping_1.applySchemaTyping)(member);
|
|
142380
142380
|
return parse11(member, options8, undefined, processed, usedNames);
|
|
@@ -142383,80 +142383,80 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142383
142383
|
};
|
|
142384
142384
|
case "UNNAMED_ENUM":
|
|
142385
142385
|
return {
|
|
142386
|
-
comment:
|
|
142387
|
-
deprecated:
|
|
142386
|
+
comment: schema11.description,
|
|
142387
|
+
deprecated: schema11.deprecated,
|
|
142388
142388
|
keyName,
|
|
142389
|
-
standaloneName: standaloneName(
|
|
142390
|
-
params:
|
|
142389
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142390
|
+
params: schema11.enum.map((_10) => parseLiteral(_10, undefined)),
|
|
142391
142391
|
type: "UNION"
|
|
142392
142392
|
};
|
|
142393
142393
|
case "UNNAMED_SCHEMA":
|
|
142394
|
-
return newInterface(
|
|
142394
|
+
return newInterface(schema11, options8, processed, usedNames, keyName, keyNameFromDefinition);
|
|
142395
142395
|
case "UNTYPED_ARRAY":
|
|
142396
|
-
const minItems =
|
|
142397
|
-
const maxItems = typeof
|
|
142396
|
+
const minItems = schema11.minItems;
|
|
142397
|
+
const maxItems = typeof schema11.maxItems === "number" ? schema11.maxItems : -1;
|
|
142398
142398
|
const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
142399
142399
|
if (minItems > 0 || maxItems >= 0) {
|
|
142400
142400
|
return {
|
|
142401
|
-
comment:
|
|
142402
|
-
deprecated:
|
|
142401
|
+
comment: schema11.description,
|
|
142402
|
+
deprecated: schema11.deprecated,
|
|
142403
142403
|
keyName,
|
|
142404
|
-
maxItems:
|
|
142404
|
+
maxItems: schema11.maxItems,
|
|
142405
142405
|
minItems,
|
|
142406
142406
|
params: Array(Math.max(maxItems, minItems) || 0).fill(params),
|
|
142407
142407
|
spreadParam: maxItems >= 0 ? undefined : params,
|
|
142408
|
-
standaloneName: standaloneName(
|
|
142408
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142409
142409
|
type: "TUPLE"
|
|
142410
142410
|
};
|
|
142411
142411
|
}
|
|
142412
142412
|
return {
|
|
142413
|
-
comment:
|
|
142414
|
-
deprecated:
|
|
142413
|
+
comment: schema11.description,
|
|
142414
|
+
deprecated: schema11.deprecated,
|
|
142415
142415
|
keyName,
|
|
142416
142416
|
params,
|
|
142417
|
-
standaloneName: standaloneName(
|
|
142417
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142418
142418
|
type: "ARRAY"
|
|
142419
142419
|
};
|
|
142420
142420
|
}
|
|
142421
142421
|
}
|
|
142422
|
-
function standaloneName(
|
|
142422
|
+
function standaloneName(schema11, keyNameFromDefinition, usedNames, options8) {
|
|
142423
142423
|
var _a7;
|
|
142424
|
-
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8,
|
|
142424
|
+
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema11, keyNameFromDefinition)) || schema11.title || schema11.$id || keyNameFromDefinition;
|
|
142425
142425
|
if (name2) {
|
|
142426
142426
|
return (0, utils_1.generateName)(name2, usedNames);
|
|
142427
142427
|
}
|
|
142428
142428
|
}
|
|
142429
|
-
function newInterface(
|
|
142430
|
-
const name2 = standaloneName(
|
|
142429
|
+
function newInterface(schema11, options8, processed, usedNames, keyName, keyNameFromDefinition) {
|
|
142430
|
+
const name2 = standaloneName(schema11, keyNameFromDefinition, usedNames, options8);
|
|
142431
142431
|
return {
|
|
142432
|
-
comment:
|
|
142433
|
-
deprecated:
|
|
142432
|
+
comment: schema11.description,
|
|
142433
|
+
deprecated: schema11.deprecated,
|
|
142434
142434
|
keyName,
|
|
142435
|
-
params: parseSchema(
|
|
142435
|
+
params: parseSchema(schema11, options8, processed, usedNames, name2),
|
|
142436
142436
|
standaloneName: name2,
|
|
142437
|
-
superTypes: parseSuperTypes(
|
|
142437
|
+
superTypes: parseSuperTypes(schema11, options8, processed, usedNames),
|
|
142438
142438
|
type: "INTERFACE"
|
|
142439
142439
|
};
|
|
142440
142440
|
}
|
|
142441
|
-
function parseSuperTypes(
|
|
142442
|
-
const superTypes =
|
|
142441
|
+
function parseSuperTypes(schema11, options8, processed, usedNames) {
|
|
142442
|
+
const superTypes = schema11.extends;
|
|
142443
142443
|
if (!superTypes) {
|
|
142444
142444
|
return [];
|
|
142445
142445
|
}
|
|
142446
142446
|
return superTypes.map((_10) => parse11(_10, options8, undefined, processed, usedNames));
|
|
142447
142447
|
}
|
|
142448
|
-
function parseSchema(
|
|
142449
|
-
let asts = (0, lodash_1.map)(
|
|
142448
|
+
function parseSchema(schema11, options8, processed, usedNames, parentSchemaName) {
|
|
142449
|
+
let asts = (0, lodash_1.map)(schema11.properties, (value, key2) => ({
|
|
142450
142450
|
ast: parse11(value, options8, key2, processed, usedNames),
|
|
142451
142451
|
isPatternProperty: false,
|
|
142452
|
-
isRequired: (0, lodash_1.includes)(
|
|
142452
|
+
isRequired: (0, lodash_1.includes)(schema11.required || [], key2),
|
|
142453
142453
|
isUnreachableDefinition: false,
|
|
142454
142454
|
keyName: key2
|
|
142455
142455
|
}));
|
|
142456
142456
|
let singlePatternProperty = false;
|
|
142457
|
-
if (
|
|
142458
|
-
singlePatternProperty = !
|
|
142459
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
142457
|
+
if (schema11.patternProperties) {
|
|
142458
|
+
singlePatternProperty = !schema11.additionalProperties && Object.keys(schema11.patternProperties).length === 1;
|
|
142459
|
+
asts = asts.concat((0, lodash_1.map)(schema11.patternProperties, (value, key2) => {
|
|
142460
142460
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
142461
142461
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
|
|
142462
142462
|
via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
|
|
@@ -142466,14 +142466,14 @@ ${comment}` : comment;
|
|
|
142466
142466
|
return {
|
|
142467
142467
|
ast,
|
|
142468
142468
|
isPatternProperty: !singlePatternProperty,
|
|
142469
|
-
isRequired: singlePatternProperty || (0, lodash_1.includes)(
|
|
142469
|
+
isRequired: singlePatternProperty || (0, lodash_1.includes)(schema11.required || [], key2),
|
|
142470
142470
|
isUnreachableDefinition: false,
|
|
142471
142471
|
keyName: singlePatternProperty ? "[k: string]" : key2
|
|
142472
142472
|
};
|
|
142473
142473
|
}));
|
|
142474
142474
|
}
|
|
142475
142475
|
if (options8.unreachableDefinitions) {
|
|
142476
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
142476
|
+
asts = asts.concat((0, lodash_1.map)(schema11.$defs, (value, key2) => {
|
|
142477
142477
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
142478
142478
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
|
|
142479
142479
|
via the \`definition\` "${key2}".`;
|
|
@@ -142483,13 +142483,13 @@ ${comment}` : comment;
|
|
|
142483
142483
|
return {
|
|
142484
142484
|
ast,
|
|
142485
142485
|
isPatternProperty: false,
|
|
142486
|
-
isRequired: (0, lodash_1.includes)(
|
|
142486
|
+
isRequired: (0, lodash_1.includes)(schema11.required || [], key2),
|
|
142487
142487
|
isUnreachableDefinition: true,
|
|
142488
142488
|
keyName: key2
|
|
142489
142489
|
};
|
|
142490
142490
|
}));
|
|
142491
142491
|
}
|
|
142492
|
-
switch (
|
|
142492
|
+
switch (schema11.additionalProperties) {
|
|
142493
142493
|
case undefined:
|
|
142494
142494
|
case true:
|
|
142495
142495
|
if (singlePatternProperty) {
|
|
@@ -142506,7 +142506,7 @@ ${comment}` : comment;
|
|
|
142506
142506
|
return asts;
|
|
142507
142507
|
default:
|
|
142508
142508
|
return asts.concat({
|
|
142509
|
-
ast: parse11(
|
|
142509
|
+
ast: parse11(schema11.additionalProperties, options8, "[k: string]", processed, usedNames),
|
|
142510
142510
|
isPatternProperty: false,
|
|
142511
142511
|
isRequired: true,
|
|
142512
142512
|
isUnreachableDefinition: false,
|
|
@@ -142514,22 +142514,22 @@ ${comment}` : comment;
|
|
|
142514
142514
|
});
|
|
142515
142515
|
}
|
|
142516
142516
|
}
|
|
142517
|
-
function getDefinitions(
|
|
142518
|
-
if (processed.has(
|
|
142517
|
+
function getDefinitions(schema11, isSchema = true, processed = new Set) {
|
|
142518
|
+
if (processed.has(schema11)) {
|
|
142519
142519
|
return {};
|
|
142520
142520
|
}
|
|
142521
|
-
processed.add(
|
|
142522
|
-
if (Array.isArray(
|
|
142523
|
-
return
|
|
142521
|
+
processed.add(schema11);
|
|
142522
|
+
if (Array.isArray(schema11)) {
|
|
142523
|
+
return schema11.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
|
|
142524
142524
|
}
|
|
142525
|
-
if ((0, lodash_1.isPlainObject)(
|
|
142526
|
-
return Object.assign(Object.assign({}, isSchema && hasDefinitions(
|
|
142525
|
+
if ((0, lodash_1.isPlainObject)(schema11)) {
|
|
142526
|
+
return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema11) ? schema11.$defs : {}), Object.keys(schema11).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema11[cur], false, processed)), {}));
|
|
142527
142527
|
}
|
|
142528
142528
|
return {};
|
|
142529
142529
|
}
|
|
142530
142530
|
var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
|
|
142531
|
-
function hasDefinitions(
|
|
142532
|
-
return "$defs" in
|
|
142531
|
+
function hasDefinitions(schema11) {
|
|
142532
|
+
return "$defs" in schema11;
|
|
142533
142533
|
}
|
|
142534
142534
|
});
|
|
142535
142535
|
|
|
@@ -142954,7 +142954,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142954
142954
|
exports.fromFileSystemPath = fromFileSystemPath;
|
|
142955
142955
|
exports.toFileSystemPath = toFileSystemPath;
|
|
142956
142956
|
exports.safePointerToPath = safePointerToPath;
|
|
142957
|
-
exports.relative =
|
|
142957
|
+
exports.relative = relative6;
|
|
142958
142958
|
var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
|
|
142959
142959
|
var path_1 = __importStar(__require("path"));
|
|
142960
142960
|
var forwardSlashPattern = /\//g;
|
|
@@ -143104,7 +143104,7 @@ var require_url = __commonJS((exports) => {
|
|
|
143104
143104
|
return decodeURIComponent(value).replace(jsonPointerSlash, "/").replace(jsonPointerTilde, "~");
|
|
143105
143105
|
});
|
|
143106
143106
|
}
|
|
143107
|
-
function
|
|
143107
|
+
function relative6(from, to5) {
|
|
143108
143108
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
143109
143109
|
return resolve12(from, to5);
|
|
143110
143110
|
}
|
|
@@ -144353,7 +144353,7 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144353
144353
|
var options_js_1 = require_options();
|
|
144354
144354
|
function normalizeArgs(_args) {
|
|
144355
144355
|
let path18;
|
|
144356
|
-
let
|
|
144356
|
+
let schema11;
|
|
144357
144357
|
let options8;
|
|
144358
144358
|
let callback;
|
|
144359
144359
|
const args = Array.prototype.slice.call(_args);
|
|
@@ -144363,15 +144363,15 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144363
144363
|
if (typeof args[0] === "string") {
|
|
144364
144364
|
path18 = args[0];
|
|
144365
144365
|
if (typeof args[2] === "object") {
|
|
144366
|
-
|
|
144366
|
+
schema11 = args[1];
|
|
144367
144367
|
options8 = args[2];
|
|
144368
144368
|
} else {
|
|
144369
|
-
|
|
144369
|
+
schema11 = undefined;
|
|
144370
144370
|
options8 = args[1];
|
|
144371
144371
|
}
|
|
144372
144372
|
} else {
|
|
144373
144373
|
path18 = "";
|
|
144374
|
-
|
|
144374
|
+
schema11 = args[0];
|
|
144375
144375
|
options8 = args[1];
|
|
144376
144376
|
}
|
|
144377
144377
|
try {
|
|
@@ -144379,12 +144379,12 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144379
144379
|
} catch (e8) {
|
|
144380
144380
|
console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
|
|
144381
144381
|
}
|
|
144382
|
-
if (!options8.mutateInputSchema && typeof
|
|
144383
|
-
|
|
144382
|
+
if (!options8.mutateInputSchema && typeof schema11 === "object") {
|
|
144383
|
+
schema11 = JSON.parse(JSON.stringify(schema11));
|
|
144384
144384
|
}
|
|
144385
144385
|
return {
|
|
144386
144386
|
path: path18,
|
|
144387
|
-
schema:
|
|
144387
|
+
schema: schema11,
|
|
144388
144388
|
options: options8,
|
|
144389
144389
|
callback
|
|
144390
144390
|
};
|
|
@@ -145173,12 +145173,12 @@ var require_resolver = __commonJS((exports) => {
|
|
|
145173
145173
|
var json_schema_ref_parser_1 = require_lib3();
|
|
145174
145174
|
var utils_1 = require_utils7();
|
|
145175
145175
|
function dereference(schema_1, _a7) {
|
|
145176
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
145177
|
-
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd,
|
|
145176
|
+
return __awaiter(this, arguments, undefined, function* (schema11, { cwd, $refOptions }) {
|
|
145177
|
+
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema11);
|
|
145178
145178
|
const parser2 = new json_schema_ref_parser_1.$RefParser;
|
|
145179
145179
|
const dereferencedPaths = new WeakMap;
|
|
145180
|
-
const dereferencedSchema = yield parser2.dereference(cwd,
|
|
145181
|
-
dereferencedPaths.set(
|
|
145180
|
+
const dereferencedSchema = yield parser2.dereference(cwd, schema11, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema12) {
|
|
145181
|
+
dereferencedPaths.set(schema12, $ref);
|
|
145182
145182
|
} }) }));
|
|
145183
145183
|
return { dereferencedPaths, dereferencedSchema };
|
|
145184
145184
|
});
|
|
@@ -145192,46 +145192,46 @@ var require_validator = __commonJS((exports) => {
|
|
|
145192
145192
|
exports.validate = undefined;
|
|
145193
145193
|
var utils_1 = require_utils7();
|
|
145194
145194
|
var rules = new Map;
|
|
145195
|
-
rules.set("Enum members and tsEnumNames must be of the same length", (
|
|
145196
|
-
if (
|
|
145195
|
+
rules.set("Enum members and tsEnumNames must be of the same length", (schema11) => {
|
|
145196
|
+
if (schema11.enum && schema11.tsEnumNames && schema11.enum.length !== schema11.tsEnumNames.length) {
|
|
145197
145197
|
return false;
|
|
145198
145198
|
}
|
|
145199
145199
|
});
|
|
145200
|
-
rules.set("tsEnumNames must be an array of strings", (
|
|
145201
|
-
if (
|
|
145200
|
+
rules.set("tsEnumNames must be an array of strings", (schema11) => {
|
|
145201
|
+
if (schema11.tsEnumNames && schema11.tsEnumNames.some((_10) => typeof _10 !== "string")) {
|
|
145202
145202
|
return false;
|
|
145203
145203
|
}
|
|
145204
145204
|
});
|
|
145205
|
-
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (
|
|
145206
|
-
const { maxItems, minItems } =
|
|
145205
|
+
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema11) => {
|
|
145206
|
+
const { maxItems, minItems } = schema11;
|
|
145207
145207
|
if (typeof maxItems === "number" && typeof minItems === "number") {
|
|
145208
145208
|
return maxItems >= minItems;
|
|
145209
145209
|
}
|
|
145210
145210
|
});
|
|
145211
|
-
rules.set("When maxItems exists, maxItems >= 0", (
|
|
145212
|
-
const { maxItems } =
|
|
145211
|
+
rules.set("When maxItems exists, maxItems >= 0", (schema11) => {
|
|
145212
|
+
const { maxItems } = schema11;
|
|
145213
145213
|
if (typeof maxItems === "number") {
|
|
145214
145214
|
return maxItems >= 0;
|
|
145215
145215
|
}
|
|
145216
145216
|
});
|
|
145217
|
-
rules.set("When minItems exists, minItems >= 0", (
|
|
145218
|
-
const { minItems } =
|
|
145217
|
+
rules.set("When minItems exists, minItems >= 0", (schema11) => {
|
|
145218
|
+
const { minItems } = schema11;
|
|
145219
145219
|
if (typeof minItems === "number") {
|
|
145220
145220
|
return minItems >= 0;
|
|
145221
145221
|
}
|
|
145222
145222
|
});
|
|
145223
|
-
rules.set("deprecated must be a boolean", (
|
|
145224
|
-
const typeOfDeprecated = typeof
|
|
145223
|
+
rules.set("deprecated must be a boolean", (schema11) => {
|
|
145224
|
+
const typeOfDeprecated = typeof schema11.deprecated;
|
|
145225
145225
|
return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
|
|
145226
145226
|
});
|
|
145227
|
-
function validate2(
|
|
145227
|
+
function validate2(schema11, filename) {
|
|
145228
145228
|
const errors5 = [];
|
|
145229
145229
|
rules.forEach((rule, ruleName) => {
|
|
145230
|
-
(0, utils_1.traverse)(
|
|
145231
|
-
if (rule(
|
|
145230
|
+
(0, utils_1.traverse)(schema11, (schema12, key2) => {
|
|
145231
|
+
if (rule(schema12) === false) {
|
|
145232
145232
|
errors5.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
|
|
145233
145233
|
}
|
|
145234
|
-
return
|
|
145234
|
+
return schema12;
|
|
145235
145235
|
});
|
|
145236
145236
|
});
|
|
145237
145237
|
return errors5;
|
|
@@ -145245,25 +145245,25 @@ var require_linker = __commonJS((exports) => {
|
|
|
145245
145245
|
exports.link = undefined;
|
|
145246
145246
|
var JSONSchema_1 = require_JSONSchema();
|
|
145247
145247
|
var lodash_1 = require_lodash8();
|
|
145248
|
-
function link2(
|
|
145249
|
-
if (!Array.isArray(
|
|
145250
|
-
return
|
|
145248
|
+
function link2(schema11, parent = null) {
|
|
145249
|
+
if (!Array.isArray(schema11) && !(0, lodash_1.isPlainObject)(schema11)) {
|
|
145250
|
+
return schema11;
|
|
145251
145251
|
}
|
|
145252
|
-
if (
|
|
145253
|
-
return
|
|
145252
|
+
if (schema11.hasOwnProperty(JSONSchema_1.Parent)) {
|
|
145253
|
+
return schema11;
|
|
145254
145254
|
}
|
|
145255
|
-
Object.defineProperty(
|
|
145255
|
+
Object.defineProperty(schema11, JSONSchema_1.Parent, {
|
|
145256
145256
|
enumerable: false,
|
|
145257
145257
|
value: parent,
|
|
145258
145258
|
writable: false
|
|
145259
145259
|
});
|
|
145260
|
-
if (Array.isArray(
|
|
145261
|
-
|
|
145260
|
+
if (Array.isArray(schema11)) {
|
|
145261
|
+
schema11.forEach((child) => link2(child, schema11));
|
|
145262
145262
|
}
|
|
145263
|
-
for (const key2 in
|
|
145264
|
-
link2(
|
|
145263
|
+
for (const key2 in schema11) {
|
|
145264
|
+
link2(schema11[key2], schema11);
|
|
145265
145265
|
}
|
|
145266
|
-
return
|
|
145266
|
+
return schema11;
|
|
145267
145267
|
}
|
|
145268
145268
|
exports.link = link2;
|
|
145269
145269
|
});
|
|
@@ -145355,8 +145355,8 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145355
145355
|
unknownAny: true
|
|
145356
145356
|
};
|
|
145357
145357
|
function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
|
|
145358
|
-
const
|
|
145359
|
-
return compile(
|
|
145358
|
+
const schema11 = parseAsJSONSchema(filename);
|
|
145359
|
+
return compile(schema11, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
|
|
145360
145360
|
}
|
|
145361
145361
|
exports.compileFromFile = compileFromFile;
|
|
145362
145362
|
function parseAsJSONSchema(filename) {
|
|
@@ -145366,7 +145366,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145366
145366
|
return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
|
|
145367
145367
|
}
|
|
145368
145368
|
function compile(schema_1, name_1) {
|
|
145369
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
145369
|
+
return __awaiter(this, arguments, undefined, function* (schema11, name2, options8 = {}) {
|
|
145370
145370
|
(0, optionValidator_1.validateOptions)(options8);
|
|
145371
145371
|
const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
|
|
145372
145372
|
const start = Date.now();
|
|
@@ -145376,7 +145376,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145376
145376
|
if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
|
|
145377
145377
|
_options.cwd += "/";
|
|
145378
145378
|
}
|
|
145379
|
-
const _schema = (0, lodash_1.cloneDeep)(
|
|
145379
|
+
const _schema = (0, lodash_1.cloneDeep)(schema11);
|
|
145380
145380
|
const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
|
|
145381
145381
|
if (process.env.VERBOSE) {
|
|
145382
145382
|
if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
|
|
@@ -146286,7 +146286,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
146286
146286
|
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|
146287
146287
|
* MIT Licensed
|
|
146288
146288
|
*/
|
|
146289
|
-
var
|
|
146289
|
+
var relative6 = __require("path").relative;
|
|
146290
146290
|
module.exports = depd;
|
|
146291
146291
|
var basePath = process.cwd();
|
|
146292
146292
|
function containsNamespace(str, namespace) {
|
|
@@ -146482,7 +146482,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
146482
146482
|
return formatted;
|
|
146483
146483
|
}
|
|
146484
146484
|
function formatLocation(callSite) {
|
|
146485
|
-
return
|
|
146485
|
+
return relative6(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
146486
146486
|
}
|
|
146487
146487
|
function getStack() {
|
|
146488
146488
|
var limit = Error.stackTraceLimit;
|
|
@@ -163944,10 +163944,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
163944
163944
|
var debug = require_src4()("express:view");
|
|
163945
163945
|
var path18 = __require("node:path");
|
|
163946
163946
|
var fs28 = __require("node:fs");
|
|
163947
|
-
var
|
|
163948
|
-
var
|
|
163947
|
+
var dirname21 = path18.dirname;
|
|
163948
|
+
var basename7 = path18.basename;
|
|
163949
163949
|
var extname2 = path18.extname;
|
|
163950
|
-
var
|
|
163950
|
+
var join27 = path18.join;
|
|
163951
163951
|
var resolve12 = path18.resolve;
|
|
163952
163952
|
module.exports = View;
|
|
163953
163953
|
function View(name2, options8) {
|
|
@@ -163983,8 +163983,8 @@ var require_view = __commonJS((exports, module) => {
|
|
|
163983
163983
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
163984
163984
|
var root2 = roots[i5];
|
|
163985
163985
|
var loc = resolve12(root2, name2);
|
|
163986
|
-
var dir =
|
|
163987
|
-
var file2 =
|
|
163986
|
+
var dir = dirname21(loc);
|
|
163987
|
+
var file2 = basename7(loc);
|
|
163988
163988
|
path19 = this.resolve(dir, file2);
|
|
163989
163989
|
}
|
|
163990
163990
|
return path19;
|
|
@@ -164009,12 +164009,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164009
164009
|
};
|
|
164010
164010
|
View.prototype.resolve = function resolve13(dir, file2) {
|
|
164011
164011
|
var ext = this.ext;
|
|
164012
|
-
var path19 =
|
|
164012
|
+
var path19 = join27(dir, file2);
|
|
164013
164013
|
var stat2 = tryStat(path19);
|
|
164014
164014
|
if (stat2 && stat2.isFile()) {
|
|
164015
164015
|
return path19;
|
|
164016
164016
|
}
|
|
164017
|
-
path19 =
|
|
164017
|
+
path19 = join27(dir, basename7(file2, ext), "index" + ext);
|
|
164018
164018
|
stat2 = tryStat(path19);
|
|
164019
164019
|
if (stat2 && stat2.isFile()) {
|
|
164020
164020
|
return path19;
|
|
@@ -167335,7 +167335,7 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
167335
167335
|
*/
|
|
167336
167336
|
module.exports = contentDisposition;
|
|
167337
167337
|
module.exports.parse = parse11;
|
|
167338
|
-
var
|
|
167338
|
+
var basename7 = __require("path").basename;
|
|
167339
167339
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
167340
167340
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
167341
167341
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -167370,9 +167370,9 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
167370
167370
|
if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
|
|
167371
167371
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
167372
167372
|
}
|
|
167373
|
-
var name2 =
|
|
167373
|
+
var name2 = basename7(filename);
|
|
167374
167374
|
var isQuotedString = TEXT_REGEXP.test(name2);
|
|
167375
|
-
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) :
|
|
167375
|
+
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) : basename7(fallback);
|
|
167376
167376
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
|
|
167377
167377
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
|
|
167378
167378
|
params["filename*"] = name2;
|
|
@@ -167709,7 +167709,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167709
167709
|
var Stream2 = __require("stream");
|
|
167710
167710
|
var util2 = __require("util");
|
|
167711
167711
|
var extname2 = path18.extname;
|
|
167712
|
-
var
|
|
167712
|
+
var join27 = path18.join;
|
|
167713
167713
|
var normalize2 = path18.normalize;
|
|
167714
167714
|
var resolve12 = path18.resolve;
|
|
167715
167715
|
var sep = path18.sep;
|
|
@@ -167881,7 +167881,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167881
167881
|
return res;
|
|
167882
167882
|
}
|
|
167883
167883
|
parts = path19.split(sep);
|
|
167884
|
-
path19 = normalize2(
|
|
167884
|
+
path19 = normalize2(join27(root2, path19));
|
|
167885
167885
|
} else {
|
|
167886
167886
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
167887
167887
|
debug('malicious path "%s"', path19);
|
|
@@ -168021,7 +168021,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168021
168021
|
return self2.onStatError(err);
|
|
168022
168022
|
return self2.error(404);
|
|
168023
168023
|
}
|
|
168024
|
-
var p4 =
|
|
168024
|
+
var p4 = join27(path19, self2._index[i5]);
|
|
168025
168025
|
debug('stat "%s"', p4);
|
|
168026
168026
|
fs28.stat(p4, function(err2, stat2) {
|
|
168027
168027
|
if (err2)
|
|
@@ -169119,18 +169119,18 @@ var require_common7 = __commonJS((exports) => {
|
|
|
169119
169119
|
retSegs.push.apply(retSegs, lastSegs);
|
|
169120
169120
|
return retSegs.join("?");
|
|
169121
169121
|
};
|
|
169122
|
-
common2.rewriteCookieProperty = function rewriteCookieProperty(header2,
|
|
169122
|
+
common2.rewriteCookieProperty = function rewriteCookieProperty(header2, config13, property) {
|
|
169123
169123
|
if (Array.isArray(header2)) {
|
|
169124
169124
|
return header2.map(function(headerElement) {
|
|
169125
|
-
return rewriteCookieProperty(headerElement,
|
|
169125
|
+
return rewriteCookieProperty(headerElement, config13, property);
|
|
169126
169126
|
});
|
|
169127
169127
|
}
|
|
169128
169128
|
return header2.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), function(match, prefix, previousValue) {
|
|
169129
169129
|
var newValue;
|
|
169130
|
-
if (previousValue in
|
|
169131
|
-
newValue =
|
|
169132
|
-
} else if ("*" in
|
|
169133
|
-
newValue =
|
|
169130
|
+
if (previousValue in config13) {
|
|
169131
|
+
newValue = config13[previousValue];
|
|
169132
|
+
} else if ("*" in config13) {
|
|
169133
|
+
newValue = config13["*"];
|
|
169134
169134
|
} else {
|
|
169135
169135
|
return match;
|
|
169136
169136
|
}
|
|
@@ -169630,8 +169630,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
169630
169630
|
}
|
|
169631
169631
|
return parsed;
|
|
169632
169632
|
}
|
|
169633
|
-
function resolveUrl(
|
|
169634
|
-
return useNativeURL ? new URL2(
|
|
169633
|
+
function resolveUrl(relative6, base) {
|
|
169634
|
+
return useNativeURL ? new URL2(relative6, base) : parseUrl(url3.resolve(base, relative6));
|
|
169635
169635
|
}
|
|
169636
169636
|
function validateUrl(input) {
|
|
169637
169637
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -170495,9 +170495,9 @@ var require_router2 = __commonJS((exports) => {
|
|
|
170495
170495
|
var is_plain_object_1 = require_is_plain_object();
|
|
170496
170496
|
var debug_1 = require_debug4();
|
|
170497
170497
|
var debug = debug_1.Debug.extend("router");
|
|
170498
|
-
async function getTarget(req,
|
|
170498
|
+
async function getTarget(req, config13) {
|
|
170499
170499
|
let newTarget;
|
|
170500
|
-
const router =
|
|
170500
|
+
const router = config13.router;
|
|
170501
170501
|
if ((0, is_plain_object_1.isPlainObject)(router)) {
|
|
170502
170502
|
newTarget = getTargetFromProxyTable(req, router);
|
|
170503
170503
|
} else if (typeof router === "function") {
|
|
@@ -171269,8 +171269,8 @@ var require_tmp = __commonJS((exports, module) => {
|
|
|
171269
171269
|
const name2 = options8.name;
|
|
171270
171270
|
if (path18.isAbsolute(name2))
|
|
171271
171271
|
throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
171272
|
-
const
|
|
171273
|
-
if (
|
|
171272
|
+
const basename7 = path18.basename(name2);
|
|
171273
|
+
if (basename7 === ".." || basename7 === "." || basename7 !== name2)
|
|
171274
171274
|
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
171275
171275
|
}
|
|
171276
171276
|
if (!_isUndefined(options8.template) && !options8.template.match(TEMPLATE_PATTERN)) {
|
|
@@ -210550,7 +210550,7 @@ var require_utils12 = __commonJS((exports, module) => {
|
|
|
210550
210550
|
if (decode4)
|
|
210551
210551
|
return decode4(data, hint);
|
|
210552
210552
|
}
|
|
210553
|
-
function
|
|
210553
|
+
function basename7(path18) {
|
|
210554
210554
|
if (typeof path18 !== "string")
|
|
210555
210555
|
return "";
|
|
210556
210556
|
for (let i5 = path18.length - 1;i5 >= 0; --i5) {
|
|
@@ -211854,7 +211854,7 @@ var require_utils12 = __commonJS((exports, module) => {
|
|
|
211854
211854
|
-1
|
|
211855
211855
|
];
|
|
211856
211856
|
module.exports = {
|
|
211857
|
-
basename:
|
|
211857
|
+
basename: basename7,
|
|
211858
211858
|
convertToUTF8,
|
|
211859
211859
|
getDecoder,
|
|
211860
211860
|
parseContentType,
|
|
@@ -212262,7 +212262,7 @@ var require_multipart = __commonJS((exports, module) => {
|
|
|
212262
212262
|
var { Readable: Readable6, Writable: Writable4 } = __require("stream");
|
|
212263
212263
|
var StreamSearch = require_sbmh();
|
|
212264
212264
|
var {
|
|
212265
|
-
basename:
|
|
212265
|
+
basename: basename7,
|
|
212266
212266
|
convertToUTF8,
|
|
212267
212267
|
getDecoder,
|
|
212268
212268
|
parseContentType,
|
|
@@ -212524,7 +212524,7 @@ var require_multipart = __commonJS((exports, module) => {
|
|
|
212524
212524
|
else if (disp.params.filename)
|
|
212525
212525
|
filename = disp.params.filename;
|
|
212526
212526
|
if (filename !== undefined && !preservePath)
|
|
212527
|
-
filename =
|
|
212527
|
+
filename = basename7(filename);
|
|
212528
212528
|
}
|
|
212529
212529
|
if (header2["content-type"]) {
|
|
212530
212530
|
const conType = parseContentType(header2["content-type"][0]);
|
|
@@ -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 join27(s5) {
|
|
214620
214620
|
if (this.length === 0)
|
|
214621
214621
|
return "";
|
|
214622
214622
|
var p4 = this.head;
|
|
@@ -234018,7 +234018,7 @@ function normalizeBase44Env() {
|
|
|
234018
234018
|
loadProjectEnvFiles();
|
|
234019
234019
|
|
|
234020
234020
|
// src/cli/index.ts
|
|
234021
|
-
import { dirname as
|
|
234021
|
+
import { dirname as dirname25, join as join30 } from "node:path";
|
|
234022
234022
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
234023
234023
|
|
|
234024
234024
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -235226,7 +235226,7 @@ var {
|
|
|
235226
235226
|
} = import__.default;
|
|
235227
235227
|
|
|
235228
235228
|
// src/cli/commands/agents/pull.ts
|
|
235229
|
-
import { dirname as
|
|
235229
|
+
import { dirname as dirname12, join as join15 } from "node:path";
|
|
235230
235230
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
235231
235231
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
235232
235232
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -236038,6 +236038,7 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
236038
236038
|
site: SiteConfigSchema.optional(),
|
|
236039
236039
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
236040
236040
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
236041
|
+
realtimeDir: exports_external.string().optional().default("realtime"),
|
|
236041
236042
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
236042
236043
|
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
236043
236044
|
authDir: exports_external.string().optional().default("auth"),
|
|
@@ -241894,7 +241895,7 @@ async function getSiteUrl() {
|
|
|
241894
241895
|
return result.data.url;
|
|
241895
241896
|
}
|
|
241896
241897
|
// src/core/project/config.ts
|
|
241897
|
-
import { dirname as
|
|
241898
|
+
import { dirname as dirname10, join as join11 } from "node:path";
|
|
241898
241899
|
|
|
241899
241900
|
// src/core/project/plugins.ts
|
|
241900
241901
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -243751,6 +243752,131 @@ var functionResource = {
|
|
|
243751
243752
|
readAll: readAllFunctions,
|
|
243752
243753
|
push: (functions) => deployFunctionsSequentially(functions)
|
|
243753
243754
|
};
|
|
243755
|
+
// src/core/resources/realtime-handler/schema.ts
|
|
243756
|
+
var RealtimeHandlerConfigSchema = exports_external.object({
|
|
243757
|
+
name: exports_external.string().min(1),
|
|
243758
|
+
entry: exports_external.string().min(1)
|
|
243759
|
+
});
|
|
243760
|
+
var DeployRealtimeHandlerResponseSchema = exports_external.object({
|
|
243761
|
+
status: exports_external.enum(["deployed", "unchanged"]),
|
|
243762
|
+
handler_name: exports_external.string().optional()
|
|
243763
|
+
});
|
|
243764
|
+
var RealtimeHandlerSchema = RealtimeHandlerConfigSchema.extend({
|
|
243765
|
+
entryPath: exports_external.string().min(1),
|
|
243766
|
+
filePaths: exports_external.array(exports_external.string()).min(1),
|
|
243767
|
+
source: ResourceSourceSchema
|
|
243768
|
+
});
|
|
243769
|
+
|
|
243770
|
+
// src/core/resources/realtime-handler/api.ts
|
|
243771
|
+
async function deploySingleRealtimeHandler(name2, payload) {
|
|
243772
|
+
const appClient = getAppClient();
|
|
243773
|
+
let response;
|
|
243774
|
+
try {
|
|
243775
|
+
response = await appClient.put(`backend-functions/${encodeURIComponent(name2)}`, { json: payload, timeout: false });
|
|
243776
|
+
} catch (error48) {
|
|
243777
|
+
throw await ApiError.fromHttpError(error48, `deploying realtime handler "${name2}"`);
|
|
243778
|
+
}
|
|
243779
|
+
const result = DeployRealtimeHandlerResponseSchema.safeParse(await response.json());
|
|
243780
|
+
if (!result.success) {
|
|
243781
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
243782
|
+
}
|
|
243783
|
+
return result.data;
|
|
243784
|
+
}
|
|
243785
|
+
// src/core/resources/realtime-handler/config.ts
|
|
243786
|
+
import { basename as basename4, dirname as dirname8, relative as relative3 } from "node:path";
|
|
243787
|
+
async function readRealtimeHandler(entryFile, realtimeDir) {
|
|
243788
|
+
const handlerDir = dirname8(entryFile);
|
|
243789
|
+
const filePaths = await globby("**/*.ts", {
|
|
243790
|
+
cwd: handlerDir,
|
|
243791
|
+
absolute: true
|
|
243792
|
+
});
|
|
243793
|
+
const name2 = relative3(realtimeDir, handlerDir).split(/[/\\]/).join("/");
|
|
243794
|
+
if (!name2) {
|
|
243795
|
+
throw new InvalidInputError("entry.ts found directly in the realtime directory — it must be inside a named subfolder", {
|
|
243796
|
+
hints: [
|
|
243797
|
+
{
|
|
243798
|
+
message: `Move ${entryFile} into a subfolder (e.g. realtime/myHandler/entry.ts)`
|
|
243799
|
+
}
|
|
243800
|
+
]
|
|
243801
|
+
});
|
|
243802
|
+
}
|
|
243803
|
+
const entry = basename4(entryFile);
|
|
243804
|
+
return {
|
|
243805
|
+
name: name2,
|
|
243806
|
+
entry,
|
|
243807
|
+
entryPath: entryFile,
|
|
243808
|
+
filePaths,
|
|
243809
|
+
source: { type: "project" }
|
|
243810
|
+
};
|
|
243811
|
+
}
|
|
243812
|
+
async function readAllRealtimeHandlers(realtimeDir) {
|
|
243813
|
+
if (!await pathExists(realtimeDir)) {
|
|
243814
|
+
return [];
|
|
243815
|
+
}
|
|
243816
|
+
const entryFiles = await globby(ENTRY_FILE_GLOB, {
|
|
243817
|
+
cwd: realtimeDir,
|
|
243818
|
+
absolute: true,
|
|
243819
|
+
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
243820
|
+
});
|
|
243821
|
+
const handlers = await Promise.all(entryFiles.map((entryFile) => readRealtimeHandler(entryFile, realtimeDir)));
|
|
243822
|
+
const names = new Set;
|
|
243823
|
+
for (const handler of handlers) {
|
|
243824
|
+
if (names.has(handler.name)) {
|
|
243825
|
+
throw new InvalidInputError(`Duplicate realtime handler name "${handler.name}" in ${realtimeDir}`);
|
|
243826
|
+
}
|
|
243827
|
+
names.add(handler.name);
|
|
243828
|
+
}
|
|
243829
|
+
return handlers;
|
|
243830
|
+
}
|
|
243831
|
+
// src/core/resources/realtime-handler/deploy.ts
|
|
243832
|
+
import { dirname as dirname9, relative as relative4 } from "node:path";
|
|
243833
|
+
async function loadHandlerCode(handler) {
|
|
243834
|
+
const handlerDir = dirname9(handler.entryPath);
|
|
243835
|
+
const resolvedFiles = await Promise.all(handler.filePaths.map(async (filePath) => {
|
|
243836
|
+
const content = await readTextFile(filePath);
|
|
243837
|
+
const path11 = relative4(handlerDir, filePath).split(/[/\\]/).join("/");
|
|
243838
|
+
return { path: path11, content };
|
|
243839
|
+
}));
|
|
243840
|
+
return { name: handler.name, entry: handler.entry, files: resolvedFiles };
|
|
243841
|
+
}
|
|
243842
|
+
async function deployOne2(handler) {
|
|
243843
|
+
const start = Date.now();
|
|
243844
|
+
try {
|
|
243845
|
+
const loaded = await loadHandlerCode(handler);
|
|
243846
|
+
const response = await deploySingleRealtimeHandler(loaded.name, {
|
|
243847
|
+
entry: loaded.entry,
|
|
243848
|
+
files: loaded.files
|
|
243849
|
+
});
|
|
243850
|
+
return {
|
|
243851
|
+
name: loaded.name,
|
|
243852
|
+
status: response.status,
|
|
243853
|
+
durationMs: Date.now() - start
|
|
243854
|
+
};
|
|
243855
|
+
} catch (error48) {
|
|
243856
|
+
return {
|
|
243857
|
+
name: handler.name,
|
|
243858
|
+
status: "error",
|
|
243859
|
+
error: error48 instanceof Error ? error48.message : String(error48)
|
|
243860
|
+
};
|
|
243861
|
+
}
|
|
243862
|
+
}
|
|
243863
|
+
async function deployRealtimeHandlersSequentially(handlers, options) {
|
|
243864
|
+
if (handlers.length === 0)
|
|
243865
|
+
return [];
|
|
243866
|
+
const results = [];
|
|
243867
|
+
for (const handler of handlers) {
|
|
243868
|
+
options?.onStart?.([handler.name]);
|
|
243869
|
+
const result = await deployOne2(handler);
|
|
243870
|
+
results.push(result);
|
|
243871
|
+
options?.onResult?.(result);
|
|
243872
|
+
}
|
|
243873
|
+
return results;
|
|
243874
|
+
}
|
|
243875
|
+
// src/core/resources/realtime-handler/resource.ts
|
|
243876
|
+
var realtimeHandlerResource = {
|
|
243877
|
+
readAll: readAllRealtimeHandlers,
|
|
243878
|
+
push: (handlers) => deployRealtimeHandlersSequentially(handlers)
|
|
243879
|
+
};
|
|
243754
243880
|
// src/core/project/config.ts
|
|
243755
243881
|
class ProjectConfigReader {
|
|
243756
243882
|
pluginSourceByNamespace = new Map;
|
|
@@ -243770,6 +243896,7 @@ class ProjectConfigReader {
|
|
|
243770
243896
|
project: { ...project, root, configPath },
|
|
243771
243897
|
entities,
|
|
243772
243898
|
functions,
|
|
243899
|
+
realtimeHandlers: localResources.realtimeHandlers,
|
|
243773
243900
|
agents: localResources.agents,
|
|
243774
243901
|
connectors: localResources.connectors,
|
|
243775
243902
|
authConfig: localResources.authConfig
|
|
@@ -243797,15 +243924,16 @@ class ProjectConfigReader {
|
|
|
243797
243924
|
return result.data;
|
|
243798
243925
|
}
|
|
243799
243926
|
async readProjectResources(configPath, project) {
|
|
243800
|
-
const configDir =
|
|
243801
|
-
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243802
|
-
entityResource.readAll(
|
|
243803
|
-
functionResource.readAll(
|
|
243804
|
-
|
|
243805
|
-
|
|
243806
|
-
|
|
243927
|
+
const configDir = dirname10(configPath);
|
|
243928
|
+
const [entities, functions, realtimeHandlers, agents, connectors, authConfig] = await Promise.all([
|
|
243929
|
+
entityResource.readAll(join11(configDir, project.entitiesDir)),
|
|
243930
|
+
functionResource.readAll(join11(configDir, project.functionsDir)),
|
|
243931
|
+
realtimeHandlerResource.readAll(join11(configDir, project.realtimeDir)),
|
|
243932
|
+
agentResource.readAll(join11(configDir, project.agentsDir)),
|
|
243933
|
+
connectorResource.readAll(join11(configDir, project.connectorsDir)),
|
|
243934
|
+
authConfigResource.readAll(join11(configDir, project.authDir))
|
|
243807
243935
|
]);
|
|
243808
|
-
return { entities, functions, agents, connectors, authConfig };
|
|
243936
|
+
return { entities, functions, realtimeHandlers, agents, connectors, authConfig };
|
|
243809
243937
|
}
|
|
243810
243938
|
assertPluginProjectDoesNotLoadPlugins(project, configPath) {
|
|
243811
243939
|
if (project.plugin && project.plugins.length > 0) {
|
|
@@ -243826,7 +243954,7 @@ class ProjectConfigReader {
|
|
|
243826
243954
|
this.pluginSourceByNamespace.set(namespace, source);
|
|
243827
243955
|
}
|
|
243828
243956
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
243829
|
-
const pluginRoot = resolvePluginRoot(plugin.source,
|
|
243957
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname10(hostConfigPath));
|
|
243830
243958
|
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
243831
243959
|
const project = await this.readConfigFile(configPath);
|
|
243832
243960
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
@@ -243838,6 +243966,7 @@ class ProjectConfigReader {
|
|
|
243838
243966
|
return {
|
|
243839
243967
|
entities: markPluginEntities(resources.entities, namespace),
|
|
243840
243968
|
functions: namespacePluginFunctions(resources.functions, namespace),
|
|
243969
|
+
realtimeHandlers: [],
|
|
243841
243970
|
agents: [],
|
|
243842
243971
|
connectors: [],
|
|
243843
243972
|
authConfig: []
|
|
@@ -243875,6 +244004,7 @@ class ProjectConfigReader {
|
|
|
243875
244004
|
return {
|
|
243876
244005
|
entities,
|
|
243877
244006
|
functions,
|
|
244007
|
+
realtimeHandlers: [],
|
|
243878
244008
|
agents: [],
|
|
243879
244009
|
connectors: [],
|
|
243880
244010
|
authConfig: []
|
|
@@ -243904,12 +244034,12 @@ async function readProjectConfig(projectRoot) {
|
|
|
243904
244034
|
// src/core/project/template.ts
|
|
243905
244035
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
243906
244036
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
243907
|
-
import { dirname as
|
|
244037
|
+
import { dirname as dirname11, join as join13 } from "node:path";
|
|
243908
244038
|
|
|
243909
244039
|
// src/core/assets.ts
|
|
243910
244040
|
import { cpSync, existsSync } from "node:fs";
|
|
243911
244041
|
import { homedir as homedir2 } from "node:os";
|
|
243912
|
-
import { join as
|
|
244042
|
+
import { join as join12 } from "node:path";
|
|
243913
244043
|
// package.json
|
|
243914
244044
|
var package_default = {
|
|
243915
244045
|
name: "base44",
|
|
@@ -244010,18 +244140,18 @@ var package_default = {
|
|
|
244010
244140
|
};
|
|
244011
244141
|
|
|
244012
244142
|
// src/core/assets.ts
|
|
244013
|
-
var ASSETS_DIR =
|
|
244143
|
+
var ASSETS_DIR = join12(homedir2(), ".base44", "assets", package_default.version);
|
|
244014
244144
|
function getTemplatesDir() {
|
|
244015
|
-
return
|
|
244145
|
+
return join12(ASSETS_DIR, "templates");
|
|
244016
244146
|
}
|
|
244017
244147
|
function getTemplatesIndexPath() {
|
|
244018
|
-
return
|
|
244148
|
+
return join12(ASSETS_DIR, "templates", "templates.json");
|
|
244019
244149
|
}
|
|
244020
244150
|
function getDenoWrapperPath() {
|
|
244021
|
-
return
|
|
244151
|
+
return join12(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
244022
244152
|
}
|
|
244023
244153
|
function getExecWrapperPath() {
|
|
244024
|
-
return
|
|
244154
|
+
return join12(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
244025
244155
|
}
|
|
244026
244156
|
function ensureNpmAssets(sourceDir) {
|
|
244027
244157
|
if (existsSync(ASSETS_DIR))
|
|
@@ -244043,7 +244173,7 @@ async function listTemplates() {
|
|
|
244043
244173
|
}
|
|
244044
244174
|
async function renderTemplate(template, destPath, data, options = {}) {
|
|
244045
244175
|
const { skipExisting = false } = options;
|
|
244046
|
-
const templateDir =
|
|
244176
|
+
const templateDir = join13(getTemplatesDir(), template.path);
|
|
244047
244177
|
const files = await globby("**/*", {
|
|
244048
244178
|
cwd: templateDir,
|
|
244049
244179
|
dot: true,
|
|
@@ -244051,20 +244181,20 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
244051
244181
|
});
|
|
244052
244182
|
const skipped = [];
|
|
244053
244183
|
for (const file2 of files) {
|
|
244054
|
-
const srcPath =
|
|
244184
|
+
const srcPath = join13(templateDir, file2);
|
|
244055
244185
|
try {
|
|
244056
244186
|
if (file2.endsWith(".ejs")) {
|
|
244057
244187
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
244058
244188
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
244059
|
-
const destFile = attributes.outputFileName ?
|
|
244060
|
-
const destFilePath =
|
|
244189
|
+
const destFile = attributes.outputFileName ? join13(dirname11(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
244190
|
+
const destFilePath = join13(destPath, destFile);
|
|
244061
244191
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
244062
244192
|
skipped.push(destFile);
|
|
244063
244193
|
continue;
|
|
244064
244194
|
}
|
|
244065
244195
|
await writeFile(destFilePath, body);
|
|
244066
244196
|
} else {
|
|
244067
|
-
const destFilePath =
|
|
244197
|
+
const destFilePath = join13(destPath, file2);
|
|
244068
244198
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
244069
244199
|
skipped.push(file2);
|
|
244070
244200
|
continue;
|
|
@@ -244158,7 +244288,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
244158
244288
|
// src/core/site/deploy.ts
|
|
244159
244289
|
import { randomUUID } from "node:crypto";
|
|
244160
244290
|
import { tmpdir } from "node:os";
|
|
244161
|
-
import { join as
|
|
244291
|
+
import { join as join14 } from "node:path";
|
|
244162
244292
|
async function deploySite(siteOutputDir) {
|
|
244163
244293
|
if (!await pathExists(siteOutputDir)) {
|
|
244164
244294
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -244175,7 +244305,7 @@ async function deploySite(siteOutputDir) {
|
|
|
244175
244305
|
]
|
|
244176
244306
|
});
|
|
244177
244307
|
}
|
|
244178
|
-
const archivePath =
|
|
244308
|
+
const archivePath = join14(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
244179
244309
|
try {
|
|
244180
244310
|
await createArchive(siteOutputDir, archivePath);
|
|
244181
244311
|
return await uploadSite(archivePath);
|
|
@@ -244192,22 +244322,24 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
244192
244322
|
}
|
|
244193
244323
|
// src/core/project/deploy.ts
|
|
244194
244324
|
function hasResourcesToDeploy(projectData) {
|
|
244195
|
-
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244325
|
+
const { project, entities, functions, realtimeHandlers, agents, connectors, authConfig } = projectData;
|
|
244196
244326
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
244197
244327
|
const hasEntities = entities.length > 0;
|
|
244198
244328
|
const hasFunctions = functions.length > 0;
|
|
244329
|
+
const hasRealtimeHandlers = realtimeHandlers.length > 0;
|
|
244199
244330
|
const hasAgents = agents.length > 0;
|
|
244200
244331
|
const hasConnectors = connectors.length > 0;
|
|
244201
244332
|
const hasAuthConfig = authConfig.length > 0;
|
|
244202
|
-
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
|
|
244333
|
+
return hasEntities || hasFunctions || hasRealtimeHandlers || hasAgents || hasConnectors || hasAuthConfig || hasSite;
|
|
244203
244334
|
}
|
|
244204
244335
|
async function deployAll(projectData, options) {
|
|
244205
|
-
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244336
|
+
const { project, entities, functions, realtimeHandlers, agents, connectors, authConfig } = projectData;
|
|
244206
244337
|
await entityResource.push(entities);
|
|
244207
244338
|
await deployFunctionsSequentially(functions, {
|
|
244208
244339
|
onStart: options?.onFunctionStart,
|
|
244209
244340
|
onResult: options?.onFunctionResult
|
|
244210
244341
|
});
|
|
244342
|
+
await deployRealtimeHandlersSequentially(realtimeHandlers);
|
|
244211
244343
|
await agentResource.push(agents);
|
|
244212
244344
|
await authConfigResource.push(authConfig);
|
|
244213
244345
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
@@ -251404,8 +251536,8 @@ async function pullAgentsAction({
|
|
|
251404
251536
|
runTask: runTask2
|
|
251405
251537
|
}) {
|
|
251406
251538
|
const { project: project2 } = await readProjectConfig();
|
|
251407
|
-
const configDir =
|
|
251408
|
-
const agentsDir =
|
|
251539
|
+
const configDir = dirname12(project2.configPath);
|
|
251540
|
+
const agentsDir = join15(configDir, project2.agentsDir);
|
|
251409
251541
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
251410
251542
|
return await fetchAgents();
|
|
251411
251543
|
}, {
|
|
@@ -251469,12 +251601,12 @@ function getAgentsCommand() {
|
|
|
251469
251601
|
}
|
|
251470
251602
|
|
|
251471
251603
|
// src/cli/commands/auth/password-login.ts
|
|
251472
|
-
import { dirname as
|
|
251604
|
+
import { dirname as dirname13, join as join16 } from "node:path";
|
|
251473
251605
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
251474
251606
|
const shouldEnable = action === "enable";
|
|
251475
251607
|
const { project: project2 } = await readProjectConfig();
|
|
251476
|
-
const configDir =
|
|
251477
|
-
const authDir =
|
|
251608
|
+
const configDir = dirname13(project2.configPath);
|
|
251609
|
+
const authDir = join16(configDir, project2.authDir);
|
|
251478
251610
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
251479
251611
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
251480
251612
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -251494,14 +251626,14 @@ function getPasswordLoginCommand() {
|
|
|
251494
251626
|
}
|
|
251495
251627
|
|
|
251496
251628
|
// src/cli/commands/auth/pull.ts
|
|
251497
|
-
import { dirname as
|
|
251629
|
+
import { dirname as dirname14, join as join17 } from "node:path";
|
|
251498
251630
|
async function pullAuthAction({
|
|
251499
251631
|
log,
|
|
251500
251632
|
runTask: runTask2
|
|
251501
251633
|
}) {
|
|
251502
251634
|
const { project: project2 } = await readProjectConfig();
|
|
251503
|
-
const configDir =
|
|
251504
|
-
const authDir =
|
|
251635
|
+
const configDir = dirname14(project2.configPath);
|
|
251636
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251505
251637
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
251506
251638
|
return await pullAuthConfig();
|
|
251507
251639
|
}, {
|
|
@@ -251565,7 +251697,7 @@ function getAuthPushCommand() {
|
|
|
251565
251697
|
}
|
|
251566
251698
|
|
|
251567
251699
|
// src/cli/commands/auth/social-login.ts
|
|
251568
|
-
import { dirname as
|
|
251700
|
+
import { dirname as dirname15, join as join18, resolve as resolve3 } from "node:path";
|
|
251569
251701
|
var PROVIDER_LABELS = {
|
|
251570
251702
|
google: "Google",
|
|
251571
251703
|
microsoft: "Microsoft",
|
|
@@ -251635,8 +251767,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251635
251767
|
}
|
|
251636
251768
|
}
|
|
251637
251769
|
const { project: project2 } = await readProjectConfig();
|
|
251638
|
-
const configDir =
|
|
251639
|
-
const authDir =
|
|
251770
|
+
const configDir = dirname15(project2.configPath);
|
|
251771
|
+
const authDir = join18(configDir, project2.authDir);
|
|
251640
251772
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251641
251773
|
if (clientSecret) {
|
|
251642
251774
|
await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -251661,7 +251793,7 @@ function getSocialLoginCommand() {
|
|
|
251661
251793
|
}
|
|
251662
251794
|
|
|
251663
251795
|
// src/cli/commands/auth/sso.ts
|
|
251664
|
-
import { dirname as
|
|
251796
|
+
import { dirname as dirname16, join as join19, resolve as resolve4 } from "node:path";
|
|
251665
251797
|
var SSOConfigFileSchema = exports_external.object({
|
|
251666
251798
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251667
251799
|
clientId: exports_external.string(),
|
|
@@ -251824,8 +251956,8 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251824
251956
|
throw error48;
|
|
251825
251957
|
}
|
|
251826
251958
|
const { project: project2 } = await readProjectConfig();
|
|
251827
|
-
const configDir =
|
|
251828
|
-
const authDir =
|
|
251959
|
+
const configDir = dirname16(project2.configPath);
|
|
251960
|
+
const authDir = join19(configDir, project2.authDir);
|
|
251829
251961
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251830
251962
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
251831
251963
|
return {
|
|
@@ -251840,8 +251972,8 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
251840
251972
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251841
251973
|
}
|
|
251842
251974
|
const { project: project2 } = await readProjectConfig();
|
|
251843
|
-
const configDir =
|
|
251844
|
-
const authDir =
|
|
251975
|
+
const configDir = dirname16(project2.configPath);
|
|
251976
|
+
const authDir = join19(configDir, project2.authDir);
|
|
251845
251977
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251846
251978
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
251847
251979
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -252692,13 +252824,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
252692
252824
|
}
|
|
252693
252825
|
|
|
252694
252826
|
// src/cli/commands/connectors/pull.ts
|
|
252695
|
-
import { dirname as
|
|
252827
|
+
import { dirname as dirname17, join as join20, resolve as resolve5 } from "node:path";
|
|
252696
252828
|
async function resolveConnectorsDir(options) {
|
|
252697
252829
|
if (!getAppContext().projectRoot) {
|
|
252698
252830
|
return resolve5(options.dir ?? "connectors");
|
|
252699
252831
|
}
|
|
252700
252832
|
const { project: project2 } = await readProjectConfig();
|
|
252701
|
-
return
|
|
252833
|
+
return join20(dirname17(project2.configPath), project2.connectorsDir);
|
|
252702
252834
|
}
|
|
252703
252835
|
async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
|
|
252704
252836
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -253091,11 +253223,11 @@ function getListCommand() {
|
|
|
253091
253223
|
}
|
|
253092
253224
|
|
|
253093
253225
|
// src/cli/commands/functions/pull.ts
|
|
253094
|
-
import { dirname as
|
|
253226
|
+
import { dirname as dirname18, join as join21 } from "node:path";
|
|
253095
253227
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
253096
253228
|
const { project: project2, functions } = await readProjectConfig();
|
|
253097
|
-
const configDir =
|
|
253098
|
-
const functionsDir =
|
|
253229
|
+
const configDir = dirname18(project2.configPath);
|
|
253230
|
+
const functionsDir = join21(configDir, project2.functionsDir);
|
|
253099
253231
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
253100
253232
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
253101
253233
|
const { functions: functions2 } = await listDeployedFunctions();
|
|
@@ -253153,12 +253285,125 @@ function getFunctionsCommand() {
|
|
|
253153
253285
|
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand()).addCommand(getDeleteCommand()).addCommand(getListCommand()).addCommand(getPullCommand());
|
|
253154
253286
|
}
|
|
253155
253287
|
|
|
253288
|
+
// src/cli/commands/realtime/deploy.ts
|
|
253289
|
+
function parseNames3(args) {
|
|
253290
|
+
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
253291
|
+
}
|
|
253292
|
+
function resolveHandlersToDeploy(names, allHandlers) {
|
|
253293
|
+
if (names.length === 0)
|
|
253294
|
+
return allHandlers;
|
|
253295
|
+
const notFound = names.filter((n2) => !allHandlers.some((h2) => h2.name === n2));
|
|
253296
|
+
if (notFound.length > 0) {
|
|
253297
|
+
throw new InvalidInputError(`Realtime handler${notFound.length > 1 ? "s" : ""} not found in project: ${notFound.join(", ")}`);
|
|
253298
|
+
}
|
|
253299
|
+
return allHandlers.filter((h2) => names.includes(h2.name));
|
|
253300
|
+
}
|
|
253301
|
+
function formatDeployResult2(result, log) {
|
|
253302
|
+
const label = result.name.padEnd(25);
|
|
253303
|
+
if (result.status === "deployed") {
|
|
253304
|
+
const timing = result.durationMs ? theme.styles.dim(` (${(result.durationMs / 1000).toFixed(1)}s)`) : "";
|
|
253305
|
+
log.success(`${label} deployed${timing}`);
|
|
253306
|
+
} else if (result.status === "unchanged") {
|
|
253307
|
+
log.success(`${label} unchanged`);
|
|
253308
|
+
} else {
|
|
253309
|
+
log.error(`${label} error: ${result.error}`);
|
|
253310
|
+
}
|
|
253311
|
+
}
|
|
253312
|
+
function buildDeploySummary2(results) {
|
|
253313
|
+
const deployed = results.filter((r) => r.status === "deployed").length;
|
|
253314
|
+
const unchanged = results.filter((r) => r.status === "unchanged").length;
|
|
253315
|
+
const failed = results.filter((r) => r.status === "error").length;
|
|
253316
|
+
const parts = [];
|
|
253317
|
+
if (deployed > 0)
|
|
253318
|
+
parts.push(`${deployed} deployed`);
|
|
253319
|
+
if (unchanged > 0)
|
|
253320
|
+
parts.push(`${unchanged} unchanged`);
|
|
253321
|
+
if (failed > 0)
|
|
253322
|
+
parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
|
|
253323
|
+
return parts.join(", ") || "No realtime handlers deployed";
|
|
253324
|
+
}
|
|
253325
|
+
async function deployRealtimeAction({ log }, names) {
|
|
253326
|
+
const { realtimeHandlers } = await readProjectConfig();
|
|
253327
|
+
const toDeploy = resolveHandlersToDeploy(names, realtimeHandlers);
|
|
253328
|
+
if (toDeploy.length === 0) {
|
|
253329
|
+
return {
|
|
253330
|
+
outroMessage: "No realtime handlers found. Create handlers in the 'realtime' directory."
|
|
253331
|
+
};
|
|
253332
|
+
}
|
|
253333
|
+
log.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "realtime handler" : "realtime handlers"} to deploy`);
|
|
253334
|
+
let completed = 0;
|
|
253335
|
+
const total = toDeploy.length;
|
|
253336
|
+
const results = await deployRealtimeHandlersSequentially(toDeploy, {
|
|
253337
|
+
onStart: (startNames) => {
|
|
253338
|
+
const label = startNames.length === 1 ? startNames[0] : `${startNames.length} realtime handlers`;
|
|
253339
|
+
log.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
|
|
253340
|
+
},
|
|
253341
|
+
onResult: (result) => {
|
|
253342
|
+
completed++;
|
|
253343
|
+
formatDeployResult2(result, log);
|
|
253344
|
+
}
|
|
253345
|
+
});
|
|
253346
|
+
const hasFailures = results.some((r) => r.status === "error");
|
|
253347
|
+
if (hasFailures) {
|
|
253348
|
+
log.message(buildDeploySummary2(results));
|
|
253349
|
+
throw new CLIExitError(1);
|
|
253350
|
+
}
|
|
253351
|
+
return { outroMessage: buildDeploySummary2(results) };
|
|
253352
|
+
}
|
|
253353
|
+
function getDeployCommand2() {
|
|
253354
|
+
return new Base44Command("deploy").description("Deploy realtime handlers to Base44").argument("[names...]", "Handler names to deploy (deploys all if omitted)").action(async (ctx, rawNames) => {
|
|
253355
|
+
const names = parseNames3(rawNames);
|
|
253356
|
+
return deployRealtimeAction(ctx, names);
|
|
253357
|
+
});
|
|
253358
|
+
}
|
|
253359
|
+
|
|
253360
|
+
// src/cli/commands/realtime/new.ts
|
|
253361
|
+
import { join as join22 } from "node:path";
|
|
253362
|
+
function buildHandlerScaffold(handlerName) {
|
|
253363
|
+
return `import { RealtimeHandler, type Conn } from "base44";
|
|
253364
|
+
|
|
253365
|
+
export class ${handlerName} extends RealtimeHandler {
|
|
253366
|
+
handleConnect(conn: Conn) {
|
|
253367
|
+
console.log("Connected:", conn.userId);
|
|
253368
|
+
}
|
|
253369
|
+
handleMessage(conn: Conn, msg: unknown) {
|
|
253370
|
+
console.log("Message:", msg);
|
|
253371
|
+
}
|
|
253372
|
+
handleTick() {}
|
|
253373
|
+
handleClose(conn: Conn) {}
|
|
253374
|
+
}
|
|
253375
|
+
`;
|
|
253376
|
+
}
|
|
253377
|
+
async function newRealtimeHandlerAction(_ctx, handlerName) {
|
|
253378
|
+
const { project: project2 } = await readProjectConfig();
|
|
253379
|
+
const realtimeDir = join22(project2.root, project2.realtimeDir);
|
|
253380
|
+
const handlerDir = join22(realtimeDir, handlerName);
|
|
253381
|
+
if (await pathExists(handlerDir)) {
|
|
253382
|
+
throw new InvalidInputError(`Realtime handler "${handlerName}" already exists at ${handlerDir}`);
|
|
253383
|
+
}
|
|
253384
|
+
const entryPath = join22(handlerDir, "entry.ts");
|
|
253385
|
+
await writeFile(entryPath, buildHandlerScaffold(handlerName));
|
|
253386
|
+
return {
|
|
253387
|
+
outroMessage: `Created realtime handler "${handlerName}" at ${entryPath}`
|
|
253388
|
+
};
|
|
253389
|
+
}
|
|
253390
|
+
function getNewCommand() {
|
|
253391
|
+
return new Base44Command("new").description("Create a new realtime handler scaffold").argument("<HandlerName>", "Name of the realtime handler class").action(async (ctx, handlerName) => {
|
|
253392
|
+
return newRealtimeHandlerAction(ctx, handlerName);
|
|
253393
|
+
});
|
|
253394
|
+
}
|
|
253395
|
+
|
|
253396
|
+
// src/cli/commands/realtime/index.ts
|
|
253397
|
+
function getRealtimeCommand() {
|
|
253398
|
+
return new Command("realtime").description("Manage realtime handlers").addCommand(getNewCommand()).addCommand(getDeployCommand2());
|
|
253399
|
+
}
|
|
253400
|
+
|
|
253156
253401
|
// src/cli/commands/project/create.ts
|
|
253157
|
-
import { basename as
|
|
253402
|
+
import { basename as basename5, resolve as resolve7 } from "node:path";
|
|
253158
253403
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
253159
253404
|
|
|
253160
253405
|
// src/cli/commands/project/scaffold-shared.ts
|
|
253161
|
-
import { join as
|
|
253406
|
+
import { join as join23 } from "node:path";
|
|
253162
253407
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
253163
253408
|
async function getTemplateById(templateId) {
|
|
253164
253409
|
const templates = await listTemplates();
|
|
@@ -253175,7 +253420,7 @@ async function completeProjectSetup({
|
|
|
253175
253420
|
projectId,
|
|
253176
253421
|
name: name2,
|
|
253177
253422
|
resolvedPath,
|
|
253178
|
-
deploy:
|
|
253423
|
+
deploy: deploy6,
|
|
253179
253424
|
skills,
|
|
253180
253425
|
isInteractive
|
|
253181
253426
|
}, { runTask: runTask2 }) {
|
|
@@ -253189,7 +253434,7 @@ async function completeProjectSetup({
|
|
|
253189
253434
|
});
|
|
253190
253435
|
shouldPushEntities = !Ct(result) && result;
|
|
253191
253436
|
} else {
|
|
253192
|
-
shouldPushEntities = !!
|
|
253437
|
+
shouldPushEntities = !!deploy6;
|
|
253193
253438
|
}
|
|
253194
253439
|
if (shouldPushEntities) {
|
|
253195
253440
|
await runTask2(`Pushing ${entities.length} data models to Base44...`, async () => {
|
|
@@ -253209,7 +253454,7 @@ async function completeProjectSetup({
|
|
|
253209
253454
|
});
|
|
253210
253455
|
shouldDeploy = !Ct(result) && result;
|
|
253211
253456
|
} else {
|
|
253212
|
-
shouldDeploy = !!
|
|
253457
|
+
shouldDeploy = !!deploy6;
|
|
253213
253458
|
}
|
|
253214
253459
|
if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
|
|
253215
253460
|
const { appUrl } = await runTask2("Installing dependencies...", async (updateMessage) => {
|
|
@@ -253217,7 +253462,7 @@ async function completeProjectSetup({
|
|
|
253217
253462
|
updateMessage("Building project...");
|
|
253218
253463
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
253219
253464
|
updateMessage("Deploying site...");
|
|
253220
|
-
return await deploySite(
|
|
253465
|
+
return await deploySite(join23(resolvedPath, outputDirectory));
|
|
253221
253466
|
}, {
|
|
253222
253467
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
253223
253468
|
errorMessage: "Failed to deploy site"
|
|
@@ -253278,8 +253523,8 @@ async function createInteractive(options, ctx) {
|
|
|
253278
253523
|
name: () => {
|
|
253279
253524
|
return options.name ? Promise.resolve(options.name) : Ze({
|
|
253280
253525
|
message: "What is the name of your project?",
|
|
253281
|
-
placeholder:
|
|
253282
|
-
initialValue:
|
|
253526
|
+
placeholder: basename5(process.cwd()),
|
|
253527
|
+
initialValue: basename5(process.cwd()),
|
|
253283
253528
|
validate: (value) => {
|
|
253284
253529
|
if (!value || value.trim().length === 0) {
|
|
253285
253530
|
return "Every project deserves a name";
|
|
@@ -253324,7 +253569,7 @@ async function executeCreate({
|
|
|
253324
253569
|
name: rawName,
|
|
253325
253570
|
description,
|
|
253326
253571
|
projectPath,
|
|
253327
|
-
deploy:
|
|
253572
|
+
deploy: deploy6,
|
|
253328
253573
|
skills,
|
|
253329
253574
|
isInteractive
|
|
253330
253575
|
}, ctx) {
|
|
@@ -253343,7 +253588,7 @@ async function executeCreate({
|
|
|
253343
253588
|
errorMessage: "Failed to create project"
|
|
253344
253589
|
});
|
|
253345
253590
|
setAppContext({ id: projectId, projectRoot: resolvedPath });
|
|
253346
|
-
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy:
|
|
253591
|
+
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy6, skills, isInteractive }, ctx);
|
|
253347
253592
|
printProjectSummary(summary, log);
|
|
253348
253593
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
253349
253594
|
}
|
|
@@ -253388,7 +253633,7 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
253388
253633
|
outroMessage: "No resources found to deploy"
|
|
253389
253634
|
};
|
|
253390
253635
|
}
|
|
253391
|
-
const { project: project2, entities, functions, agents, connectors, authConfig } = projectData;
|
|
253636
|
+
const { project: project2, entities, functions, realtimeHandlers, agents, connectors, authConfig } = projectData;
|
|
253392
253637
|
const summaryLines = [];
|
|
253393
253638
|
if (entities.length > 0) {
|
|
253394
253639
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -253396,6 +253641,9 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
253396
253641
|
if (functions.length > 0) {
|
|
253397
253642
|
summaryLines.push(` - ${functions.length} ${functions.length === 1 ? "function" : "functions"}`);
|
|
253398
253643
|
}
|
|
253644
|
+
if (realtimeHandlers.length > 0) {
|
|
253645
|
+
summaryLines.push(` - ${realtimeHandlers.length} ${realtimeHandlers.length === 1 ? "realtime handler" : "realtime handlers"}`);
|
|
253646
|
+
}
|
|
253399
253647
|
if (agents.length > 0) {
|
|
253400
253648
|
summaryLines.push(` - ${agents.length} ${agents.length === 1 ? "agent" : "agents"}`);
|
|
253401
253649
|
}
|
|
@@ -253447,7 +253695,7 @@ ${summaryLines.join(`
|
|
|
253447
253695
|
}
|
|
253448
253696
|
return { outroMessage: "App deployed successfully" };
|
|
253449
253697
|
}
|
|
253450
|
-
function
|
|
253698
|
+
function getDeployCommand3() {
|
|
253451
253699
|
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
|
|
253452
253700
|
}
|
|
253453
253701
|
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
|
|
@@ -253687,48 +253935,6 @@ function formatEntry(entry) {
|
|
|
253687
253935
|
const message = entry.message.trim();
|
|
253688
253936
|
return `${time3} ${level} ${message}`;
|
|
253689
253937
|
}
|
|
253690
|
-
function entryKey(entry) {
|
|
253691
|
-
return `${entry.time} ${entry.message}`;
|
|
253692
|
-
}
|
|
253693
|
-
function selectNewEntries(entries, state) {
|
|
253694
|
-
const fresh = entries.filter((e2) => {
|
|
253695
|
-
if (e2.time < state.lastTime)
|
|
253696
|
-
return false;
|
|
253697
|
-
if (e2.time === state.lastTime && state.boundaryKeys.has(entryKey(e2))) {
|
|
253698
|
-
return false;
|
|
253699
|
-
}
|
|
253700
|
-
return true;
|
|
253701
|
-
});
|
|
253702
|
-
if (fresh.length === 0)
|
|
253703
|
-
return { fresh, nextState: state };
|
|
253704
|
-
const newMax = fresh.reduce((max, e2) => e2.time > max ? e2.time : max, state.lastTime);
|
|
253705
|
-
const boundaryKeys = newMax === state.lastTime ? new Set(state.boundaryKeys) : new Set;
|
|
253706
|
-
for (const e2 of fresh) {
|
|
253707
|
-
if (e2.time === newMax)
|
|
253708
|
-
boundaryKeys.add(entryKey(e2));
|
|
253709
|
-
}
|
|
253710
|
-
return { fresh, nextState: { lastTime: newMax, boundaryKeys } };
|
|
253711
|
-
}
|
|
253712
|
-
function writeFollowLine(entry, jsonMode) {
|
|
253713
|
-
const line = jsonMode ? JSON.stringify(entry) : formatEntry(entry);
|
|
253714
|
-
process.stdout.write(`${line}
|
|
253715
|
-
`);
|
|
253716
|
-
}
|
|
253717
|
-
async function followLogs(functionNames, options, availableFunctionNames, jsonMode) {
|
|
253718
|
-
let state = { lastTime: "", boundaryKeys: new Set };
|
|
253719
|
-
let first = true;
|
|
253720
|
-
while (true) {
|
|
253721
|
-
const pollOptions = first ? options : { ...options, since: state.lastTime };
|
|
253722
|
-
const entries = await fetchLogsForFunctions(functionNames, pollOptions, availableFunctionNames);
|
|
253723
|
-
const { fresh, nextState } = selectNewEntries(entries, state);
|
|
253724
|
-
state = nextState;
|
|
253725
|
-
fresh.sort((a2, b) => a2.time.localeCompare(b.time));
|
|
253726
|
-
for (const entry of fresh)
|
|
253727
|
-
writeFollowLine(entry, jsonMode);
|
|
253728
|
-
first = false;
|
|
253729
|
-
await new Promise((resolve8) => setTimeout(resolve8, 2000));
|
|
253730
|
-
}
|
|
253731
|
-
}
|
|
253732
253938
|
function formatLogs(entries, env3) {
|
|
253733
253939
|
if (entries.length === 0) {
|
|
253734
253940
|
if (env3 === "prod") {
|
|
@@ -253810,13 +254016,6 @@ async function logsAction(ctx, options) {
|
|
|
253810
254016
|
outroMessage: localProjectRoot ? "No functions found in this project." : "No functions found in this app."
|
|
253811
254017
|
};
|
|
253812
254018
|
}
|
|
253813
|
-
if (options.follow) {
|
|
253814
|
-
if (options.until) {
|
|
253815
|
-
throw new InvalidInputError("--until cannot be combined with --follow (a stream has no end).");
|
|
253816
|
-
}
|
|
253817
|
-
options.order = "asc";
|
|
253818
|
-
return followLogs(functionNames, options, availableFunctionNames, ctx.jsonMode);
|
|
253819
|
-
}
|
|
253820
254019
|
let entries = await fetchLogsForFunctions(functionNames, options, availableFunctionNames);
|
|
253821
254020
|
const limit = options.limit ? Number.parseInt(options.limit, 10) : undefined;
|
|
253822
254021
|
if (limit !== undefined && entries.length > limit) {
|
|
@@ -253832,11 +254031,11 @@ async function logsAction(ctx, options) {
|
|
|
253832
254031
|
};
|
|
253833
254032
|
}
|
|
253834
254033
|
function getLogsCommand() {
|
|
253835
|
-
return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").
|
|
254034
|
+
return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option("--env <env>", "Which deployment to read logs from: preview (current draft) or prod (published). Default: preview").choices([...LogEnvSchema.options])).action(logsAction);
|
|
253836
254035
|
}
|
|
253837
254036
|
|
|
253838
254037
|
// src/cli/commands/project/scaffold.ts
|
|
253839
|
-
import { basename as
|
|
254038
|
+
import { basename as basename6, resolve as resolve8 } from "node:path";
|
|
253840
254039
|
function resolveAppId(options) {
|
|
253841
254040
|
const appId = options.appId;
|
|
253842
254041
|
if (!appId) {
|
|
@@ -253853,7 +254052,7 @@ async function scaffoldAction(ctx, name2, options, command2) {
|
|
|
253853
254052
|
const { log, runTask: runTask2 } = ctx;
|
|
253854
254053
|
const appId = resolveAppId(command2.optsWithGlobals());
|
|
253855
254054
|
const resolvedPath = resolve8("./");
|
|
253856
|
-
const projectName = (name2 ??
|
|
254055
|
+
const projectName = (name2 ?? basename6(resolvedPath)).trim();
|
|
253857
254056
|
const template2 = await getTemplateById("backend-only");
|
|
253858
254057
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
253859
254058
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
@@ -254007,7 +254206,7 @@ function withSandboxAuthHint(error48) {
|
|
|
254007
254206
|
cause: error48
|
|
254008
254207
|
});
|
|
254009
254208
|
}
|
|
254010
|
-
async function callTool(appId, tool, payload,
|
|
254209
|
+
async function callTool(appId, tool, payload, schema11, context, timeout2 = 60000) {
|
|
254011
254210
|
const client = getSandboxClient(appId);
|
|
254012
254211
|
let response;
|
|
254013
254212
|
try {
|
|
@@ -254015,7 +254214,7 @@ async function callTool(appId, tool, payload, schema10, context, timeout2 = 6000
|
|
|
254015
254214
|
} catch (error48) {
|
|
254016
254215
|
throw withSandboxAuthHint(await ApiError.fromHttpError(error48, context));
|
|
254017
254216
|
}
|
|
254018
|
-
const result =
|
|
254217
|
+
const result = schema11.safeParse(await response.json());
|
|
254019
254218
|
if (!result.success) {
|
|
254020
254219
|
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
254021
254220
|
}
|
|
@@ -254413,9 +254612,9 @@ async function generateContent(input) {
|
|
|
254413
254612
|
`);
|
|
254414
254613
|
}
|
|
254415
254614
|
async function compileEntity(entity2) {
|
|
254416
|
-
const { name: name2, source: _source, ...
|
|
254615
|
+
const { name: name2, source: _source, ...schema11 } = entity2;
|
|
254417
254616
|
const jsonSchema = {
|
|
254418
|
-
...
|
|
254617
|
+
...schema11,
|
|
254419
254618
|
title: name2,
|
|
254420
254619
|
additionalProperties: false
|
|
254421
254620
|
};
|
|
@@ -254442,10 +254641,10 @@ function toPascalCase(name2) {
|
|
|
254442
254641
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
254443
254642
|
}
|
|
254444
254643
|
// src/core/types/update-project.ts
|
|
254445
|
-
import { join as
|
|
254644
|
+
import { join as join26 } from "node:path";
|
|
254446
254645
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
254447
254646
|
async function updateProjectConfig(projectRoot) {
|
|
254448
|
-
const tsconfigPath =
|
|
254647
|
+
const tsconfigPath = join26(projectRoot, "tsconfig.json");
|
|
254449
254648
|
if (!await pathExists(tsconfigPath)) {
|
|
254450
254649
|
return false;
|
|
254451
254650
|
}
|
|
@@ -254496,7 +254695,7 @@ function getTypesCommand() {
|
|
|
254496
254695
|
// src/cli/dev/dev-server/main.ts
|
|
254497
254696
|
var import_cors = __toESM(require_lib4(), 1);
|
|
254498
254697
|
var import_express6 = __toESM(require_express(), 1);
|
|
254499
|
-
import { dirname as
|
|
254698
|
+
import { dirname as dirname23, join as join29 } from "node:path";
|
|
254500
254699
|
|
|
254501
254700
|
// ../../node_modules/get-port/index.js
|
|
254502
254701
|
import net from "node:net";
|
|
@@ -254517,8 +254716,8 @@ var getLocalHosts = () => {
|
|
|
254517
254716
|
const interfaces = os9.networkInterfaces();
|
|
254518
254717
|
const results = new Set([undefined, "0.0.0.0"]);
|
|
254519
254718
|
for (const _interface of Object.values(interfaces)) {
|
|
254520
|
-
for (const
|
|
254521
|
-
results.add(
|
|
254719
|
+
for (const config13 of _interface) {
|
|
254720
|
+
results.add(config13.address);
|
|
254522
254721
|
}
|
|
254523
254722
|
}
|
|
254524
254723
|
return results;
|
|
@@ -255158,22 +255357,22 @@ class Database {
|
|
|
255158
255357
|
this.schemas.clear();
|
|
255159
255358
|
}
|
|
255160
255359
|
validate(entityName, record2, partial2 = false) {
|
|
255161
|
-
const
|
|
255162
|
-
if (!
|
|
255360
|
+
const schema11 = this.schemas.get(this.normalizeName(entityName));
|
|
255361
|
+
if (!schema11) {
|
|
255163
255362
|
throw new Error(`Entity "${entityName}" not found`);
|
|
255164
255363
|
}
|
|
255165
|
-
return this.validator.validate(record2,
|
|
255364
|
+
return this.validator.validate(record2, schema11, partial2);
|
|
255166
255365
|
}
|
|
255167
255366
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
255168
|
-
const
|
|
255169
|
-
if (!
|
|
255367
|
+
const schema11 = this.schemas.get(this.normalizeName(entityName));
|
|
255368
|
+
if (!schema11) {
|
|
255170
255369
|
throw new Error(`Entity "${entityName}" not found`);
|
|
255171
255370
|
}
|
|
255172
|
-
const filteredRecord = this.validator.filterFields(record2,
|
|
255371
|
+
const filteredRecord = this.validator.filterFields(record2, schema11);
|
|
255173
255372
|
if (partial2) {
|
|
255174
255373
|
return filteredRecord;
|
|
255175
255374
|
}
|
|
255176
|
-
return this.validator.applyDefaults(filteredRecord,
|
|
255375
|
+
return this.validator.applyDefaults(filteredRecord, schema11);
|
|
255177
255376
|
}
|
|
255178
255377
|
normalizeName(entityName) {
|
|
255179
255378
|
return entityName.toLowerCase();
|
|
@@ -255467,13 +255666,13 @@ function checkRLS(rule, record2, user) {
|
|
|
255467
255666
|
return false;
|
|
255468
255667
|
return evaluateCondition(rule, record2, user);
|
|
255469
255668
|
}
|
|
255470
|
-
function applyFLS(record2,
|
|
255669
|
+
function applyFLS(record2, schema11, user, operation) {
|
|
255471
255670
|
if (Array.isArray(record2)) {
|
|
255472
|
-
return record2.map((r5) => applyFLS(r5,
|
|
255671
|
+
return record2.map((r5) => applyFLS(r5, schema11, user, operation));
|
|
255473
255672
|
}
|
|
255474
255673
|
const result = {};
|
|
255475
255674
|
for (const [key2, value] of Object.entries(record2)) {
|
|
255476
|
-
const rule =
|
|
255675
|
+
const rule = schema11.properties[key2]?.rls?.[operation];
|
|
255477
255676
|
if (rule === undefined || checkRLS(rule, record2, user)) {
|
|
255478
255677
|
result[key2] = value;
|
|
255479
255678
|
}
|
|
@@ -255701,14 +255900,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255701
255900
|
res.status(404).json({ error: `Entity "${entityName}" not found` });
|
|
255702
255901
|
return;
|
|
255703
255902
|
}
|
|
255704
|
-
const
|
|
255705
|
-
if (!
|
|
255903
|
+
const schema11 = db2.getSchema(entityName);
|
|
255904
|
+
if (!schema11) {
|
|
255706
255905
|
res.status(404).json({ error: `Schema for "${entityName}" not found` });
|
|
255707
255906
|
return;
|
|
255708
255907
|
}
|
|
255709
255908
|
const currentUserResult = await resolveCurrentUser(db2, req);
|
|
255710
255909
|
const currentUser = currentUserResult.ok ? currentUserResult.user : undefined;
|
|
255711
|
-
await handler(req, res, collection,
|
|
255910
|
+
await handler(req, res, collection, schema11, currentUser);
|
|
255712
255911
|
};
|
|
255713
255912
|
}
|
|
255714
255913
|
function emit(appId, entityName, type, data) {
|
|
@@ -255726,19 +255925,19 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255726
255925
|
}
|
|
255727
255926
|
broadcast(appId, entityName, createData(data));
|
|
255728
255927
|
}
|
|
255729
|
-
function prepareCreateRecord(entityName, body,
|
|
255928
|
+
function prepareCreateRecord(entityName, body, schema11, currentUser, now) {
|
|
255730
255929
|
const { _id, ...recordBody } = body;
|
|
255731
255930
|
const ownerFields = {
|
|
255732
255931
|
created_by: currentUser?.email,
|
|
255733
255932
|
created_by_id: currentUser?.id
|
|
255734
255933
|
};
|
|
255735
|
-
if (!checkRLS(
|
|
255934
|
+
if (!checkRLS(schema11.rls?.create, {
|
|
255736
255935
|
...recordBody,
|
|
255737
255936
|
...ownerFields
|
|
255738
255937
|
}, currentUser)) {
|
|
255739
255938
|
return;
|
|
255740
255939
|
}
|
|
255741
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody),
|
|
255940
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody), schema11, currentUser, "write");
|
|
255742
255941
|
db2.validate(entityName, filteredBody);
|
|
255743
255942
|
return {
|
|
255744
255943
|
...filteredBody,
|
|
@@ -255750,7 +255949,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255750
255949
|
}
|
|
255751
255950
|
const userRouter = createUserRouter(db2, logger2);
|
|
255752
255951
|
router.use("/User", userRouter);
|
|
255753
|
-
router.get("/:entityName/:id", withCollection(async (req, res, collection,
|
|
255952
|
+
router.get("/:entityName/:id", withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
255754
255953
|
const { entityName, id: id2 } = req.params;
|
|
255755
255954
|
try {
|
|
255756
255955
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -255758,27 +255957,27 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255758
255957
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
255759
255958
|
return;
|
|
255760
255959
|
}
|
|
255761
|
-
if (!checkRLS(
|
|
255960
|
+
if (!checkRLS(schema11.rls?.read, doc2, currentUser)) {
|
|
255762
255961
|
res.status(404).json({
|
|
255763
255962
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
255764
255963
|
});
|
|
255765
255964
|
return;
|
|
255766
255965
|
}
|
|
255767
|
-
const result = applyFLS(stripInternalFields(doc2),
|
|
255966
|
+
const result = applyFLS(stripInternalFields(doc2), schema11, currentUser, "read");
|
|
255768
255967
|
res.json(result);
|
|
255769
255968
|
} catch (error48) {
|
|
255770
255969
|
logger2.error(`Error in GET /${entityName}/${id2}:`, error48);
|
|
255771
255970
|
res.status(500).json({ error: "Internal server error" });
|
|
255772
255971
|
}
|
|
255773
255972
|
}));
|
|
255774
|
-
router.get("/:entityName", withCollection(async (req, res, collection,
|
|
255973
|
+
router.get("/:entityName", withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
255775
255974
|
const { entityName } = req.params;
|
|
255776
255975
|
try {
|
|
255777
255976
|
let results = stripInternalFields(await queryEntity(collection, req.query));
|
|
255778
|
-
if (
|
|
255779
|
-
results = results.filter((doc2) => checkRLS(
|
|
255977
|
+
if (schema11.rls?.read !== undefined && schema11.rls.read !== true) {
|
|
255978
|
+
results = results.filter((doc2) => checkRLS(schema11.rls.read, doc2, currentUser));
|
|
255780
255979
|
}
|
|
255781
|
-
results = results.map((doc2) => applyFLS(doc2,
|
|
255980
|
+
results = results.map((doc2) => applyFLS(doc2, schema11, currentUser, "read"));
|
|
255782
255981
|
res.json(results);
|
|
255783
255982
|
} catch (error48) {
|
|
255784
255983
|
if (error48 instanceof InvalidInputError) {
|
|
@@ -255789,16 +255988,16 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255789
255988
|
}
|
|
255790
255989
|
}
|
|
255791
255990
|
}));
|
|
255792
|
-
router.post("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
255991
|
+
router.post("/:entityName", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
255793
255992
|
const { appId, entityName } = req.params;
|
|
255794
255993
|
try {
|
|
255795
255994
|
const now = new Date().toISOString();
|
|
255796
|
-
const record2 = prepareCreateRecord(entityName, req.body,
|
|
255995
|
+
const record2 = prepareCreateRecord(entityName, req.body, schema11, currentUser, now);
|
|
255797
255996
|
if (!record2) {
|
|
255798
255997
|
res.status(403).json({ error: "Permission denied" });
|
|
255799
255998
|
return;
|
|
255800
255999
|
}
|
|
255801
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)),
|
|
256000
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)), schema11, currentUser, "read");
|
|
255802
256001
|
emit(appId, entityName, "create", inserted);
|
|
255803
256002
|
res.status(201).json(inserted);
|
|
255804
256003
|
} catch (error48) {
|
|
@@ -255810,7 +256009,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255810
256009
|
res.status(500).json({ error: "Internal server error" });
|
|
255811
256010
|
}
|
|
255812
256011
|
}));
|
|
255813
|
-
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection,
|
|
256012
|
+
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
255814
256013
|
const { appId, entityName } = req.params;
|
|
255815
256014
|
if (!Array.isArray(req.body)) {
|
|
255816
256015
|
res.status(400).json({ error: "Request body must be an array" });
|
|
@@ -255820,14 +256019,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255820
256019
|
const now = new Date().toISOString();
|
|
255821
256020
|
const records = [];
|
|
255822
256021
|
for (const body of req.body) {
|
|
255823
|
-
const record2 = prepareCreateRecord(entityName, body,
|
|
256022
|
+
const record2 = prepareCreateRecord(entityName, body, schema11, currentUser, now);
|
|
255824
256023
|
if (!record2) {
|
|
255825
256024
|
res.status(403).json({ error: "Permission denied" });
|
|
255826
256025
|
return;
|
|
255827
256026
|
}
|
|
255828
256027
|
records.push(record2);
|
|
255829
256028
|
}
|
|
255830
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)),
|
|
256029
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)), schema11, currentUser, "read");
|
|
255831
256030
|
emit(appId, entityName, "create", inserted);
|
|
255832
256031
|
res.status(201).json(inserted);
|
|
255833
256032
|
} catch (error48) {
|
|
@@ -255839,24 +256038,24 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255839
256038
|
res.status(500).json({ error: "Internal server error" });
|
|
255840
256039
|
}
|
|
255841
256040
|
}));
|
|
255842
|
-
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection,
|
|
256041
|
+
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
255843
256042
|
const { appId, entityName, id: id2 } = req.params;
|
|
255844
256043
|
const { id: _id, created_date: _created_date, ...body } = req.body;
|
|
255845
256044
|
try {
|
|
255846
|
-
if (
|
|
256045
|
+
if (schema11.rls?.update !== undefined) {
|
|
255847
256046
|
const existing = await collection.findOneAsync({ id: id2 });
|
|
255848
256047
|
if (!existing) {
|
|
255849
256048
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
255850
256049
|
return;
|
|
255851
256050
|
}
|
|
255852
|
-
if (!checkRLS(
|
|
256051
|
+
if (!checkRLS(schema11.rls.update, existing, currentUser)) {
|
|
255853
256052
|
res.status(404).json({
|
|
255854
256053
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
255855
256054
|
});
|
|
255856
256055
|
return;
|
|
255857
256056
|
}
|
|
255858
256057
|
}
|
|
255859
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true),
|
|
256058
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true), schema11, currentUser, "write");
|
|
255860
256059
|
db2.validate(entityName, filteredBody, true);
|
|
255861
256060
|
const updateData = {
|
|
255862
256061
|
...filteredBody,
|
|
@@ -255867,7 +256066,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255867
256066
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
255868
256067
|
return;
|
|
255869
256068
|
}
|
|
255870
|
-
const updated = applyFLS(stripInternalFields(result.affectedDocuments),
|
|
256069
|
+
const updated = applyFLS(stripInternalFields(result.affectedDocuments), schema11, currentUser, "read");
|
|
255871
256070
|
emit(appId, entityName, "update", updated);
|
|
255872
256071
|
res.json(updated);
|
|
255873
256072
|
} catch (error48) {
|
|
@@ -255879,7 +256078,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255879
256078
|
res.status(500).json({ error: "Internal server error" });
|
|
255880
256079
|
}
|
|
255881
256080
|
}));
|
|
255882
|
-
router.delete("/:entityName/:id", withCollection(async (req, res, collection,
|
|
256081
|
+
router.delete("/:entityName/:id", withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
255883
256082
|
const { appId, entityName, id: id2 } = req.params;
|
|
255884
256083
|
try {
|
|
255885
256084
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -255887,7 +256086,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255887
256086
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
255888
256087
|
return;
|
|
255889
256088
|
}
|
|
255890
|
-
if (!checkRLS(
|
|
256089
|
+
if (!checkRLS(schema11.rls?.delete, doc2, currentUser)) {
|
|
255891
256090
|
res.status(404).json({
|
|
255892
256091
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
255893
256092
|
});
|
|
@@ -255901,11 +256100,11 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
255901
256100
|
res.status(500).json({ error: "Internal server error" });
|
|
255902
256101
|
}
|
|
255903
256102
|
}));
|
|
255904
|
-
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
256103
|
+
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
255905
256104
|
const { entityName } = req.params;
|
|
255906
256105
|
try {
|
|
255907
256106
|
const query = req.body || {};
|
|
255908
|
-
const rlsDelete =
|
|
256107
|
+
const rlsDelete = schema11?.rls?.delete;
|
|
255909
256108
|
if (rlsDelete !== undefined && rlsDelete !== true) {
|
|
255910
256109
|
if (rlsDelete === false && currentUser?.is_service !== true) {
|
|
255911
256110
|
res.status(403).json({ error: "Permission denied" });
|
|
@@ -256124,7 +256323,7 @@ class ServeRunner {
|
|
|
256124
256323
|
|
|
256125
256324
|
// src/cli/dev/dev-server/watcher.ts
|
|
256126
256325
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
256127
|
-
import { relative as
|
|
256326
|
+
import { relative as relative8 } from "node:path";
|
|
256128
256327
|
|
|
256129
256328
|
// ../../node_modules/chokidar/index.js
|
|
256130
256329
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
@@ -256294,10 +256493,10 @@ class ReaddirpStream extends Readable6 {
|
|
|
256294
256493
|
}
|
|
256295
256494
|
async _formatEntry(dirent, path19) {
|
|
256296
256495
|
let entry;
|
|
256297
|
-
const
|
|
256496
|
+
const basename7 = this._isDirent ? dirent.name : dirent;
|
|
256298
256497
|
try {
|
|
256299
|
-
const fullPath = presolve(pjoin(path19,
|
|
256300
|
-
entry = { path: prelative(this._root, fullPath), fullPath, basename:
|
|
256498
|
+
const fullPath = presolve(pjoin(path19, basename7));
|
|
256499
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename7 };
|
|
256301
256500
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
256302
256501
|
} catch (err) {
|
|
256303
256502
|
this._onError(err);
|
|
@@ -256824,9 +257023,9 @@ class NodeFsHandler {
|
|
|
256824
257023
|
_watchWithNodeFs(path19, listener) {
|
|
256825
257024
|
const opts = this.fsw.options;
|
|
256826
257025
|
const directory = sp2.dirname(path19);
|
|
256827
|
-
const
|
|
257026
|
+
const basename8 = sp2.basename(path19);
|
|
256828
257027
|
const parent = this.fsw._getWatchedDir(directory);
|
|
256829
|
-
parent.add(
|
|
257028
|
+
parent.add(basename8);
|
|
256830
257029
|
const absolutePath = sp2.resolve(path19);
|
|
256831
257030
|
const options8 = {
|
|
256832
257031
|
persistent: opts.persistent
|
|
@@ -256836,7 +257035,7 @@ class NodeFsHandler {
|
|
|
256836
257035
|
let closer;
|
|
256837
257036
|
if (opts.usePolling) {
|
|
256838
257037
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
256839
|
-
options8.interval = enableBin && isBinaryPath(
|
|
257038
|
+
options8.interval = enableBin && isBinaryPath(basename8) ? opts.binaryInterval : opts.interval;
|
|
256840
257039
|
closer = setFsWatchFileListener(path19, absolutePath, options8, {
|
|
256841
257040
|
listener,
|
|
256842
257041
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -256854,11 +257053,11 @@ class NodeFsHandler {
|
|
|
256854
257053
|
if (this.fsw.closed) {
|
|
256855
257054
|
return;
|
|
256856
257055
|
}
|
|
256857
|
-
const
|
|
256858
|
-
const
|
|
256859
|
-
const parent = this.fsw._getWatchedDir(
|
|
257056
|
+
const dirname22 = sp2.dirname(file2);
|
|
257057
|
+
const basename8 = sp2.basename(file2);
|
|
257058
|
+
const parent = this.fsw._getWatchedDir(dirname22);
|
|
256860
257059
|
let prevStats = stats;
|
|
256861
|
-
if (parent.has(
|
|
257060
|
+
if (parent.has(basename8))
|
|
256862
257061
|
return;
|
|
256863
257062
|
const listener = async (path19, newStats) => {
|
|
256864
257063
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
@@ -256883,9 +257082,9 @@ class NodeFsHandler {
|
|
|
256883
257082
|
prevStats = newStats2;
|
|
256884
257083
|
}
|
|
256885
257084
|
} catch (error48) {
|
|
256886
|
-
this.fsw._remove(
|
|
257085
|
+
this.fsw._remove(dirname22, basename8);
|
|
256887
257086
|
}
|
|
256888
|
-
} else if (parent.has(
|
|
257087
|
+
} else if (parent.has(basename8)) {
|
|
256889
257088
|
const at13 = newStats.atimeMs;
|
|
256890
257089
|
const mt12 = newStats.mtimeMs;
|
|
256891
257090
|
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
@@ -257106,11 +257305,11 @@ function createPattern(matcher) {
|
|
|
257106
257305
|
if (matcher.path === string4)
|
|
257107
257306
|
return true;
|
|
257108
257307
|
if (matcher.recursive) {
|
|
257109
|
-
const
|
|
257110
|
-
if (!
|
|
257308
|
+
const relative8 = sp3.relative(matcher.path, string4);
|
|
257309
|
+
if (!relative8) {
|
|
257111
257310
|
return false;
|
|
257112
257311
|
}
|
|
257113
|
-
return !
|
|
257312
|
+
return !relative8.startsWith("..") && !sp3.isAbsolute(relative8);
|
|
257114
257313
|
}
|
|
257115
257314
|
return false;
|
|
257116
257315
|
};
|
|
@@ -257809,7 +258008,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
257809
258008
|
ignoreInitial: true
|
|
257810
258009
|
});
|
|
257811
258010
|
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
257812
|
-
this.emit("change", name2,
|
|
258011
|
+
this.emit("change", name2, relative8(targetPath, path19));
|
|
257813
258012
|
}, WATCH_DEBOUNCE_MS));
|
|
257814
258013
|
watcher.on("error", (err) => {
|
|
257815
258014
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -257916,8 +258115,8 @@ async function createDevServer(options8) {
|
|
|
257916
258115
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
257917
258116
|
};
|
|
257918
258117
|
const base44ConfigWatcher = new WatchBase44({
|
|
257919
|
-
functions:
|
|
257920
|
-
entities:
|
|
258118
|
+
functions: join29(dirname23(project2.configPath), project2.functionsDir),
|
|
258119
|
+
entities: join29(dirname23(project2.configPath), project2.entitiesDir)
|
|
257921
258120
|
}, devLogger);
|
|
257922
258121
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
257923
258122
|
try {
|
|
@@ -258259,13 +258458,14 @@ function createProgram(context) {
|
|
|
258259
258458
|
program2.addCommand(getCreateCommand());
|
|
258260
258459
|
program2.addCommand(getScaffoldCommand());
|
|
258261
258460
|
program2.addCommand(getDashboardCommand());
|
|
258262
|
-
program2.addCommand(
|
|
258461
|
+
program2.addCommand(getDeployCommand3());
|
|
258263
258462
|
program2.addCommand(getLinkCommand());
|
|
258264
258463
|
program2.addCommand(getEjectCommand());
|
|
258265
258464
|
program2.addCommand(getEntitiesPushCommand());
|
|
258266
258465
|
program2.addCommand(getAgentsCommand());
|
|
258267
258466
|
program2.addCommand(getConnectorsCommand());
|
|
258268
258467
|
program2.addCommand(getFunctionsCommand());
|
|
258468
|
+
program2.addCommand(getRealtimeCommand());
|
|
258269
258469
|
program2.addCommand(getSecretsCommand());
|
|
258270
258470
|
program2.addCommand(getSandboxCommand());
|
|
258271
258471
|
program2.addCommand(getAuthCommand());
|
|
@@ -258282,7 +258482,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
258282
258482
|
import { release, type } from "node:os";
|
|
258283
258483
|
|
|
258284
258484
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
258285
|
-
import { dirname as
|
|
258485
|
+
import { dirname as dirname24, posix, sep } from "path";
|
|
258286
258486
|
function createModulerModifier() {
|
|
258287
258487
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
258288
258488
|
return async (frames) => {
|
|
@@ -258291,7 +258491,7 @@ function createModulerModifier() {
|
|
|
258291
258491
|
return frames;
|
|
258292
258492
|
};
|
|
258293
258493
|
}
|
|
258294
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
258494
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname24(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
258295
258495
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
258296
258496
|
return (filename) => {
|
|
258297
258497
|
if (!filename)
|
|
@@ -262480,9 +262680,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
262480
262680
|
});
|
|
262481
262681
|
}
|
|
262482
262682
|
// src/cli/index.ts
|
|
262483
|
-
var __dirname4 =
|
|
262683
|
+
var __dirname4 = dirname25(fileURLToPath6(import.meta.url));
|
|
262484
262684
|
async function runCLI(options8) {
|
|
262485
|
-
ensureNpmAssets(
|
|
262685
|
+
ensureNpmAssets(join30(__dirname4, "../assets"));
|
|
262486
262686
|
const errorReporter = new ErrorReporter;
|
|
262487
262687
|
errorReporter.registerProcessErrorHandlers();
|
|
262488
262688
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -262521,4 +262721,4 @@ export {
|
|
|
262521
262721
|
CLIExitError
|
|
262522
262722
|
};
|
|
262523
262723
|
|
|
262524
|
-
//# debugId=
|
|
262724
|
+
//# debugId=C07D776F1F23BE1C64756E2164756E21
|