@base44-preview/cli 0.1.2-pr.555.3443d0b → 0.1.2-pr.560.cf66e4d
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 +841 -1215
- package/dist/cli/index.js.map +19 -27
- 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 dirname9 = 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 : dirname9(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 basename4 = path11.basename(filename, path11.extname(filename));
|
|
13365
13365
|
try {
|
|
13366
13366
|
Object.defineProperty(returnedFn, "name", {
|
|
13367
|
-
value:
|
|
13367
|
+
value: basename4,
|
|
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(schema7, name2, result) {
|
|
13722
13722
|
var exclude = [];
|
|
13723
|
-
|
|
13723
|
+
schema7.include.forEach(function(includedSchema) {
|
|
13724
13724
|
result = compileList(includedSchema, name2, result);
|
|
13725
13725
|
});
|
|
13726
|
-
|
|
13726
|
+
schema7[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(schema7) {
|
|
13784
|
+
return schema7 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(schema7, 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 = schema7.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 join14(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 = join14;
|
|
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: schema10, 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, schema10.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 ? schema10[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema10[identity3.SEQ] : schema10[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(schema10, 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: schema10,
|
|
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, schema10) {
|
|
23078
23078
|
super(type);
|
|
23079
23079
|
Object.defineProperty(this, "schema", {
|
|
23080
|
-
value:
|
|
23080
|
+
value: schema10,
|
|
23081
23081
|
configurable: true,
|
|
23082
23082
|
enumerable: false,
|
|
23083
23083
|
writable: true
|
|
23084
23084
|
});
|
|
23085
23085
|
}
|
|
23086
|
-
clone(
|
|
23086
|
+
clone(schema10) {
|
|
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 (schema10)
|
|
23089
|
+
copy.schema = schema10;
|
|
23090
|
+
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema10) : 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(schema10) {
|
|
24023
24023
|
let { key, value } = this;
|
|
24024
24024
|
if (identity3.isNode(key))
|
|
24025
|
-
key = key.clone(
|
|
24025
|
+
key = key.clone(schema10);
|
|
24026
24026
|
if (identity3.isNode(value))
|
|
24027
|
-
value = value.clone(
|
|
24027
|
+
value = value.clone(schema10);
|
|
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(schema10) {
|
|
24213
|
+
super(identity3.MAP, schema10);
|
|
24214
24214
|
this.items = [];
|
|
24215
24215
|
}
|
|
24216
|
-
static from(
|
|
24216
|
+
static from(schema10, obj, ctx) {
|
|
24217
24217
|
const { keepUndefined, replacer } = ctx;
|
|
24218
|
-
const map2 = new this(
|
|
24218
|
+
const map2 = new this(schema10);
|
|
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 schema10.sortMapEntries === "function") {
|
|
24235
|
+
map2.items.sort(schema10.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: (schema10, obj, ctx) => YAMLMap.YAMLMap.from(schema10, 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(schema10) {
|
|
24347
|
+
super(identity3.SEQ, schema10);
|
|
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(schema10, obj, ctx) {
|
|
24402
24402
|
const { replacer } = ctx;
|
|
24403
|
-
const seq = new this(
|
|
24403
|
+
const seq = new this(schema10);
|
|
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: (schema10, obj, ctx) => YAMLSeq.YAMLSeq.from(schema10, 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 schema10 = [
|
|
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 = schema10;
|
|
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 schema10 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
|
|
24692
|
+
exports.schema = schema10;
|
|
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(schema10, iterable, ctx) {
|
|
24783
24783
|
const { replacer } = ctx;
|
|
24784
|
-
const pairs2 = new YAMLSeq.YAMLSeq(
|
|
24784
|
+
const pairs2 = new YAMLSeq.YAMLSeq(schema10);
|
|
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(schema10, iterable, ctx) {
|
|
24864
|
+
const pairs$1 = pairs.createPairs(schema10, 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: (schema10, iterable, ctx) => YAMLOMap.from(schema10, 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(schema10) {
|
|
25056
|
+
super(schema10);
|
|
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(schema10, iterable, ctx) {
|
|
25097
25097
|
const { replacer } = ctx;
|
|
25098
|
-
const set3 = new this(
|
|
25098
|
+
const set3 = new this(schema10);
|
|
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: (schema10, iterable, ctx) => YAMLSet.from(schema10, 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 schema10 = [
|
|
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 = schema10;
|
|
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 schema10 = 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", schema10.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: schema10, 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 schema10 === "string" && schema10 || "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(schema10, value, tagName, tagToken, onError) {
|
|
26850
26850
|
if (tagName === "!")
|
|
26851
|
-
return
|
|
26851
|
+
return schema10[identity3.SCALAR];
|
|
26852
26852
|
const matchWithTest = [];
|
|
26853
|
-
for (const tag of
|
|
26853
|
+
for (const tag of schema10.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 = schema10.knownTags[tagName];
|
|
26865
26865
|
if (kt3 && !kt3.collection) {
|
|
26866
|
-
|
|
26866
|
+
schema10.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 schema10[identity3.SCALAR];
|
|
26871
26871
|
}
|
|
26872
|
-
function findScalarTagByTest({ atKey, directives, schema:
|
|
26873
|
-
const tag =
|
|
26874
|
-
if (
|
|
26875
|
-
const compat2 =
|
|
26872
|
+
function findScalarTagByTest({ atKey, directives, schema: schema10 }, value, token, onError) {
|
|
26873
|
+
const tag = schema10.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema10[identity3.SCALAR];
|
|
26874
|
+
if (schema10.compat) {
|
|
26875
|
+
const compat2 = schema10.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema10[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" ? join22(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 join22(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: join22,
|
|
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 schema10 = new SchemaConstructor(parameters);
|
|
119564
|
+
const subSchema = Object.create(schema10);
|
|
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], schema10, 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 config12 = editorconfig_to_prettier_default(editorConfig);
|
|
119825
|
+
return config12;
|
|
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 config12 = await load2(configFile);
|
|
121816
|
+
if (!config12) {
|
|
121817
121817
|
return;
|
|
121818
121818
|
}
|
|
121819
|
-
if (typeof
|
|
121820
|
-
|
|
121819
|
+
if (typeof config12 === "string") {
|
|
121820
|
+
config12 = await load_external_config_default(config12, configFile);
|
|
121821
121821
|
}
|
|
121822
|
-
if (typeof
|
|
121823
|
-
throw new TypeError(`Config is only allowed to be an object, but received ${typeof
|
|
121822
|
+
if (typeof config12 !== "object") {
|
|
121823
|
+
throw new TypeError(`Config is only allowed to be an object, but received ${typeof config12} in "${configFile}"`);
|
|
121824
121824
|
}
|
|
121825
|
-
delete
|
|
121826
|
-
return
|
|
121825
|
+
delete config12.$schema;
|
|
121826
|
+
return config12;
|
|
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 config12 = await loadPrettierConfig(configFile, { shouldCache });
|
|
121877
|
+
return { config: config12, 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: config12, configFile } = configResult || {};
|
|
121905
|
+
const { overrides, ...options8 } = config12 || {};
|
|
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 basename6 = getFileBasename(file2).toLowerCase();
|
|
122722
122722
|
return languages2.find(({
|
|
122723
122723
|
filenames
|
|
122724
|
-
}) => filenames?.some((name2) => name2.toLowerCase() ===
|
|
122724
|
+
}) => filenames?.some((name2) => name2.toLowerCase() === basename6)) ?? languages2.find(({
|
|
122725
122725
|
extensions
|
|
122726
|
-
}) => extensions?.some((extension) =>
|
|
122726
|
+
}) => extensions?.some((extension) => basename6.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, schema10, utils3) => optionInfo.exception(value) || schema10.validate(value, utils3);
|
|
122908
122908
|
} else {
|
|
122909
|
-
parameters.validate = (value,
|
|
122909
|
+
parameters.validate = (value, schema10, utils3) => value === undefined || schema10.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, schema10, utils3) => schema10.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 config12;
|
|
124015
124015
|
if (options8.resolveConfig !== false) {
|
|
124016
|
-
|
|
124016
|
+
config12 = await resolveConfig(file2, {
|
|
124017
124017
|
editorconfig: false
|
|
124018
124018
|
});
|
|
124019
124019
|
}
|
|
124020
|
-
if (
|
|
124021
|
-
return
|
|
124020
|
+
if (config12?.parser) {
|
|
124021
|
+
return config12.parser;
|
|
124022
124022
|
}
|
|
124023
|
-
let plugins = options8.plugins ??
|
|
124023
|
+
let plugins = options8.plugins ?? config12?.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 schema10 = this._utils.schemas[key2];
|
|
124502
124502
|
if (!(key2 in newOptions)) {
|
|
124503
|
-
const defaultResult = normalizeDefaultResult(
|
|
124503
|
+
const defaultResult = normalizeDefaultResult(schema10.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 schema10 = this._utils.schemas[key2];
|
|
124515
124515
|
const value = newOptions[key2];
|
|
124516
|
-
const newValue =
|
|
124516
|
+
const newValue = schema10.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, schema10);
|
|
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 schema10 = this._utils.schemas[key2];
|
|
124532
|
+
const value = schema10.preprocess(options8[key2], this._utils);
|
|
124533
|
+
this._applyValidation(value, key2, schema10);
|
|
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(schema10.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(schema10.forward(value, this._utils), value);
|
|
124557
124557
|
forwardResult.forEach(appendTransferredOptions);
|
|
124558
|
-
const redirectResult = normalizeRedirectResult(
|
|
124558
|
+
const redirectResult = normalizeRedirectResult(schema10.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 ? schema10.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, schema10) {
|
|
124591
|
+
const validateResult = normalizeValidateResult(schema10.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 schema10 = this._utils.schemas[knownResultKey];
|
|
124634
|
+
this._applyValidation(knownResultValue, knownResultKey, schema10);
|
|
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 basename6 = path152.basename(pattern);
|
|
127949
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename6);
|
|
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" ? join24(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 join24(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: join24,
|
|
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)((schema10) => {
|
|
138348
|
+
const parent = schema10[exports.Parent];
|
|
138349
138349
|
if (!parent) {
|
|
138350
|
-
return
|
|
138350
|
+
return schema10;
|
|
138351
138351
|
}
|
|
138352
138352
|
return (0, exports.getRootSchema)(parent);
|
|
138353
138353
|
});
|
|
138354
|
-
function isBoolean(
|
|
138355
|
-
return
|
|
138354
|
+
function isBoolean(schema10) {
|
|
138355
|
+
return schema10 === true || schema10 === false;
|
|
138356
138356
|
}
|
|
138357
138357
|
exports.isBoolean = isBoolean;
|
|
138358
|
-
function isPrimitive(
|
|
138359
|
-
return !(0, lodash_1.isPlainObject)(
|
|
138358
|
+
function isPrimitive(schema10) {
|
|
138359
|
+
return !(0, lodash_1.isPlainObject)(schema10);
|
|
138360
138360
|
}
|
|
138361
138361
|
exports.isPrimitive = isPrimitive;
|
|
138362
|
-
function isCompound(
|
|
138363
|
-
return Array.isArray(
|
|
138362
|
+
function isCompound(schema10) {
|
|
138363
|
+
return Array.isArray(schema10.type) || "anyOf" in schema10 || "oneOf" in schema10;
|
|
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(schema10, name2) {
|
|
138591
138591
|
var result = [];
|
|
138592
|
-
|
|
138592
|
+
schema10[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(schema10, 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 = schema10.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(schema10, callback, processed) {
|
|
141209
|
+
if (typeof schema10 !== "object" || !schema10) {
|
|
141210
141210
|
return;
|
|
141211
141211
|
}
|
|
141212
|
-
const r5 =
|
|
141212
|
+
const r5 = schema10;
|
|
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(schema10, callback, processed = new Set, key2) {
|
|
141222
|
+
if (processed.has(schema10)) {
|
|
141223
141223
|
return;
|
|
141224
141224
|
}
|
|
141225
|
-
processed.add(
|
|
141226
|
-
callback(
|
|
141227
|
-
if (
|
|
141228
|
-
traverseArray(
|
|
141225
|
+
processed.add(schema10);
|
|
141226
|
+
callback(schema10, key2 !== null && key2 !== undefined ? key2 : null);
|
|
141227
|
+
if (schema10.anyOf) {
|
|
141228
|
+
traverseArray(schema10.anyOf, callback, processed);
|
|
141229
141229
|
}
|
|
141230
|
-
if (
|
|
141231
|
-
traverseArray(
|
|
141230
|
+
if (schema10.allOf) {
|
|
141231
|
+
traverseArray(schema10.allOf, callback, processed);
|
|
141232
141232
|
}
|
|
141233
|
-
if (
|
|
141234
|
-
traverseArray(
|
|
141233
|
+
if (schema10.oneOf) {
|
|
141234
|
+
traverseArray(schema10.oneOf, callback, processed);
|
|
141235
141235
|
}
|
|
141236
|
-
if (
|
|
141237
|
-
traverseObjectKeys(
|
|
141236
|
+
if (schema10.properties) {
|
|
141237
|
+
traverseObjectKeys(schema10.properties, callback, processed);
|
|
141238
141238
|
}
|
|
141239
|
-
if (
|
|
141240
|
-
traverseObjectKeys(
|
|
141239
|
+
if (schema10.patternProperties) {
|
|
141240
|
+
traverseObjectKeys(schema10.patternProperties, callback, processed);
|
|
141241
141241
|
}
|
|
141242
|
-
if (
|
|
141243
|
-
traverse(
|
|
141242
|
+
if (schema10.additionalProperties && typeof schema10.additionalProperties === "object") {
|
|
141243
|
+
traverse(schema10.additionalProperties, callback, processed);
|
|
141244
141244
|
}
|
|
141245
|
-
if (
|
|
141246
|
-
const { items } =
|
|
141245
|
+
if (schema10.items) {
|
|
141246
|
+
const { items } = schema10;
|
|
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 (schema10.additionalItems && typeof schema10.additionalItems === "object") {
|
|
141254
|
+
traverse(schema10.additionalItems, callback, processed);
|
|
141255
141255
|
}
|
|
141256
|
-
if (
|
|
141257
|
-
if (Array.isArray(
|
|
141258
|
-
traverseArray(
|
|
141256
|
+
if (schema10.dependencies) {
|
|
141257
|
+
if (Array.isArray(schema10.dependencies)) {
|
|
141258
|
+
traverseArray(schema10.dependencies, callback, processed);
|
|
141259
141259
|
} else {
|
|
141260
|
-
traverseObjectKeys(
|
|
141260
|
+
traverseObjectKeys(schema10.dependencies, callback, processed);
|
|
141261
141261
|
}
|
|
141262
141262
|
}
|
|
141263
|
-
if (
|
|
141264
|
-
traverseObjectKeys(
|
|
141263
|
+
if (schema10.definitions) {
|
|
141264
|
+
traverseObjectKeys(schema10.definitions, callback, processed);
|
|
141265
141265
|
}
|
|
141266
|
-
if (
|
|
141267
|
-
traverseObjectKeys(
|
|
141266
|
+
if (schema10.$defs) {
|
|
141267
|
+
traverseObjectKeys(schema10.$defs, callback, processed);
|
|
141268
141268
|
}
|
|
141269
|
-
if (
|
|
141270
|
-
traverse(
|
|
141269
|
+
if (schema10.not) {
|
|
141270
|
+
traverse(schema10.not, callback, processed);
|
|
141271
141271
|
}
|
|
141272
|
-
traverseIntersection(
|
|
141273
|
-
Object.keys(
|
|
141274
|
-
const child =
|
|
141272
|
+
traverseIntersection(schema10, callback, processed);
|
|
141273
|
+
Object.keys(schema10).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
|
|
141274
|
+
const child = schema10[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(schema10) {
|
|
141357
141357
|
const replacer = "* /";
|
|
141358
|
-
if (
|
|
141358
|
+
if (schema10 === null || typeof schema10 !== "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(schema10)) {
|
|
141362
|
+
if (key2 === "description" && typeof schema10[key2] === "string") {
|
|
141363
|
+
schema10[key2] = schema10[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(schema10) {
|
|
141376
|
+
if (!("default" in schema10)) {
|
|
141377
|
+
return schema10;
|
|
141378
141378
|
}
|
|
141379
|
-
switch (
|
|
141379
|
+
switch (schema10.type) {
|
|
141380
141380
|
case "array":
|
|
141381
|
-
if (Array.isArray(
|
|
141382
|
-
return
|
|
141381
|
+
if (Array.isArray(schema10.default)) {
|
|
141382
|
+
return schema10;
|
|
141383
141383
|
}
|
|
141384
141384
|
break;
|
|
141385
141385
|
case "boolean":
|
|
141386
|
-
if (typeof
|
|
141387
|
-
return
|
|
141386
|
+
if (typeof schema10.default === "boolean") {
|
|
141387
|
+
return schema10;
|
|
141388
141388
|
}
|
|
141389
141389
|
break;
|
|
141390
141390
|
case "integer":
|
|
141391
141391
|
case "number":
|
|
141392
|
-
if (typeof
|
|
141393
|
-
return
|
|
141392
|
+
if (typeof schema10.default === "number") {
|
|
141393
|
+
return schema10;
|
|
141394
141394
|
}
|
|
141395
141395
|
break;
|
|
141396
141396
|
case "string":
|
|
141397
|
-
if (typeof
|
|
141398
|
-
return
|
|
141397
|
+
if (typeof schema10.default === "string") {
|
|
141398
|
+
return schema10;
|
|
141399
141399
|
}
|
|
141400
141400
|
break;
|
|
141401
141401
|
case "null":
|
|
141402
|
-
if (
|
|
141403
|
-
return
|
|
141402
|
+
if (schema10.default === null) {
|
|
141403
|
+
return schema10;
|
|
141404
141404
|
}
|
|
141405
141405
|
break;
|
|
141406
141406
|
case "object":
|
|
141407
|
-
if ((0, lodash_1.isPlainObject)(
|
|
141408
|
-
return
|
|
141407
|
+
if ((0, lodash_1.isPlainObject)(schema10.default)) {
|
|
141408
|
+
return schema10;
|
|
141409
141409
|
}
|
|
141410
141410
|
break;
|
|
141411
141411
|
}
|
|
141412
|
-
delete
|
|
141413
|
-
return
|
|
141412
|
+
delete schema10.default;
|
|
141413
|
+
return schema10;
|
|
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(schema10) {
|
|
141428
|
+
if (!(0, lodash_1.isPlainObject)(schema10)) {
|
|
141429
141429
|
return false;
|
|
141430
141430
|
}
|
|
141431
|
-
const parent =
|
|
141431
|
+
const parent = schema10[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] === schema10)) {
|
|
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(schema10) {
|
|
141747
|
+
if (schema10.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(schema10)) {
|
|
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(schema10) {
|
|
141764
|
+
return "allOf" in schema10;
|
|
141765
141765
|
},
|
|
141766
|
-
ANY(
|
|
141767
|
-
if (Object.keys(
|
|
141766
|
+
ANY(schema10) {
|
|
141767
|
+
if (Object.keys(schema10).length === 0) {
|
|
141768
141768
|
return true;
|
|
141769
141769
|
}
|
|
141770
|
-
return
|
|
141770
|
+
return schema10.type === "any";
|
|
141771
141771
|
},
|
|
141772
|
-
ANY_OF(
|
|
141773
|
-
return "anyOf" in
|
|
141772
|
+
ANY_OF(schema10) {
|
|
141773
|
+
return "anyOf" in schema10;
|
|
141774
141774
|
},
|
|
141775
|
-
BOOLEAN(
|
|
141776
|
-
if ("enum" in
|
|
141775
|
+
BOOLEAN(schema10) {
|
|
141776
|
+
if ("enum" in schema10) {
|
|
141777
141777
|
return false;
|
|
141778
141778
|
}
|
|
141779
|
-
if (
|
|
141779
|
+
if (schema10.type === "boolean") {
|
|
141780
141780
|
return true;
|
|
141781
141781
|
}
|
|
141782
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141782
|
+
if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.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(schema10) {
|
|
141791
|
+
return "enum" in schema10 && "tsEnumNames" in schema10;
|
|
141792
141792
|
},
|
|
141793
|
-
NAMED_SCHEMA(
|
|
141794
|
-
return "$id" in
|
|
141793
|
+
NAMED_SCHEMA(schema10) {
|
|
141794
|
+
return "$id" in schema10 && (("patternProperties" in schema10) || ("properties" in schema10));
|
|
141795
141795
|
},
|
|
141796
|
-
NEVER(
|
|
141797
|
-
return
|
|
141796
|
+
NEVER(schema10) {
|
|
141797
|
+
return schema10 === false;
|
|
141798
141798
|
},
|
|
141799
|
-
NULL(
|
|
141800
|
-
return
|
|
141799
|
+
NULL(schema10) {
|
|
141800
|
+
return schema10.type === "null";
|
|
141801
141801
|
},
|
|
141802
|
-
NUMBER(
|
|
141803
|
-
if ("enum" in
|
|
141802
|
+
NUMBER(schema10) {
|
|
141803
|
+
if ("enum" in schema10) {
|
|
141804
141804
|
return false;
|
|
141805
141805
|
}
|
|
141806
|
-
if (
|
|
141806
|
+
if (schema10.type === "integer" || schema10.type === "number") {
|
|
141807
141807
|
return true;
|
|
141808
141808
|
}
|
|
141809
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141809
|
+
if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "number") {
|
|
141810
141810
|
return true;
|
|
141811
141811
|
}
|
|
141812
141812
|
return false;
|
|
141813
141813
|
},
|
|
141814
|
-
OBJECT(
|
|
141815
|
-
return
|
|
141814
|
+
OBJECT(schema10) {
|
|
141815
|
+
return schema10.type === "object" && !(0, lodash_1.isPlainObject)(schema10.additionalProperties) && !schema10.allOf && !schema10.anyOf && !schema10.oneOf && !schema10.patternProperties && !schema10.properties && !schema10.required;
|
|
141816
141816
|
},
|
|
141817
|
-
ONE_OF(
|
|
141818
|
-
return "oneOf" in
|
|
141817
|
+
ONE_OF(schema10) {
|
|
141818
|
+
return "oneOf" in schema10;
|
|
141819
141819
|
},
|
|
141820
|
-
REFERENCE(
|
|
141821
|
-
return "$ref" in
|
|
141820
|
+
REFERENCE(schema10) {
|
|
141821
|
+
return "$ref" in schema10;
|
|
141822
141822
|
},
|
|
141823
|
-
STRING(
|
|
141824
|
-
if ("enum" in
|
|
141823
|
+
STRING(schema10) {
|
|
141824
|
+
if ("enum" in schema10) {
|
|
141825
141825
|
return false;
|
|
141826
141826
|
}
|
|
141827
|
-
if (
|
|
141827
|
+
if (schema10.type === "string") {
|
|
141828
141828
|
return true;
|
|
141829
141829
|
}
|
|
141830
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141830
|
+
if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "string") {
|
|
141831
141831
|
return true;
|
|
141832
141832
|
}
|
|
141833
141833
|
return false;
|
|
141834
141834
|
},
|
|
141835
|
-
TYPED_ARRAY(
|
|
141836
|
-
if (
|
|
141835
|
+
TYPED_ARRAY(schema10) {
|
|
141836
|
+
if (schema10.type && schema10.type !== "array") {
|
|
141837
141837
|
return false;
|
|
141838
141838
|
}
|
|
141839
|
-
return "items" in
|
|
141839
|
+
return "items" in schema10;
|
|
141840
141840
|
},
|
|
141841
|
-
UNION(
|
|
141842
|
-
return Array.isArray(
|
|
141841
|
+
UNION(schema10) {
|
|
141842
|
+
return Array.isArray(schema10.type);
|
|
141843
141843
|
},
|
|
141844
|
-
UNNAMED_ENUM(
|
|
141845
|
-
if ("tsEnumNames" in
|
|
141844
|
+
UNNAMED_ENUM(schema10) {
|
|
141845
|
+
if ("tsEnumNames" in schema10) {
|
|
141846
141846
|
return false;
|
|
141847
141847
|
}
|
|
141848
|
-
if (
|
|
141848
|
+
if (schema10.type && schema10.type !== "boolean" && schema10.type !== "integer" && schema10.type !== "number" && schema10.type !== "string") {
|
|
141849
141849
|
return false;
|
|
141850
141850
|
}
|
|
141851
|
-
return "enum" in
|
|
141851
|
+
return "enum" in schema10;
|
|
141852
141852
|
},
|
|
141853
141853
|
UNNAMED_SCHEMA() {
|
|
141854
141854
|
return false;
|
|
141855
141855
|
},
|
|
141856
|
-
UNTYPED_ARRAY(
|
|
141857
|
-
return
|
|
141856
|
+
UNTYPED_ARRAY(schema10) {
|
|
141857
|
+
return schema10.type === "array" && !("items" in schema10);
|
|
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(schema10) {
|
|
141869
141869
|
var _a7;
|
|
141870
|
-
const types = (0, typesOfSchema_1.typesOfSchema)(
|
|
141871
|
-
Object.defineProperty(
|
|
141870
|
+
const types = (0, typesOfSchema_1.typesOfSchema)(schema10);
|
|
141871
|
+
Object.defineProperty(schema10, 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]: schema10,
|
|
141881
141881
|
[JSONSchema_1.Types]: new Set(["ALL_OF"]),
|
|
141882
|
-
$id:
|
|
141883
|
-
description:
|
|
141884
|
-
name:
|
|
141885
|
-
title:
|
|
141886
|
-
allOf: (_a7 =
|
|
141882
|
+
$id: schema10.$id,
|
|
141883
|
+
description: schema10.description,
|
|
141884
|
+
name: schema10.name,
|
|
141885
|
+
title: schema10.title,
|
|
141886
|
+
allOf: (_a7 = schema10.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 schema10.allOf;
|
|
141892
|
+
delete schema10.$id;
|
|
141893
|
+
delete schema10.description;
|
|
141894
|
+
delete schema10.name;
|
|
141895
|
+
delete schema10.title;
|
|
141896
|
+
Object.defineProperty(schema10, 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(schema10, type) {
|
|
141915
|
+
return schema10.type === type || Array.isArray(schema10.type) && schema10.type.includes(type);
|
|
141916
141916
|
}
|
|
141917
|
-
function isObjectType(
|
|
141918
|
-
return
|
|
141917
|
+
function isObjectType(schema10) {
|
|
141918
|
+
return schema10.properties !== undefined || hasType(schema10, "object") || hasType(schema10, "any");
|
|
141919
141919
|
}
|
|
141920
|
-
function isArrayType(
|
|
141921
|
-
return
|
|
141920
|
+
function isArrayType(schema10) {
|
|
141921
|
+
return schema10.items !== undefined || hasType(schema10, "array") || hasType(schema10, "any");
|
|
141922
141922
|
}
|
|
141923
|
-
function isEnumTypeWithoutTsEnumNames(
|
|
141924
|
-
return
|
|
141923
|
+
function isEnumTypeWithoutTsEnumNames(schema10) {
|
|
141924
|
+
return schema10.type === "string" && schema10.enum !== undefined && schema10.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]`', (schema10) => {
|
|
141927
|
+
if (Array.isArray(schema10.enum) && schema10.enum.some((e8) => e8 === null) && Array.isArray(schema10.type) && schema10.type.includes("null")) {
|
|
141928
|
+
schema10.type = schema10.type.filter((type) => type !== "null");
|
|
141929
141929
|
}
|
|
141930
141930
|
});
|
|
141931
|
-
rules.set("Destructure unary types", (
|
|
141932
|
-
if (
|
|
141933
|
-
|
|
141931
|
+
rules.set("Destructure unary types", (schema10) => {
|
|
141932
|
+
if (schema10.type && Array.isArray(schema10.type) && schema10.type.length === 1) {
|
|
141933
|
+
schema10.type = schema10.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", (schema10) => {
|
|
141937
|
+
if (isObjectType(schema10) && !("required" in schema10)) {
|
|
141938
|
+
schema10.required = [];
|
|
141939
141939
|
}
|
|
141940
141940
|
});
|
|
141941
|
-
rules.set("Transform `required`=false to `required`=[]", (
|
|
141942
|
-
if (
|
|
141943
|
-
|
|
141941
|
+
rules.set("Transform `required`=false to `required`=[]", (schema10) => {
|
|
141942
|
+
if (schema10.required === false) {
|
|
141943
|
+
schema10.required = [];
|
|
141944
141944
|
}
|
|
141945
141945
|
});
|
|
141946
|
-
rules.set("Default additionalProperties", (
|
|
141947
|
-
if (isObjectType(
|
|
141948
|
-
|
|
141946
|
+
rules.set("Default additionalProperties", (schema10, _10, options8) => {
|
|
141947
|
+
if (isObjectType(schema10) && !("additionalProperties" in schema10) && schema10.patternProperties === undefined) {
|
|
141948
|
+
schema10.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", (schema10, fileName) => {
|
|
141952
|
+
if (!(0, utils_1.isSchemaLike)(schema10)) {
|
|
141953
141953
|
return;
|
|
141954
141954
|
}
|
|
141955
|
-
if (
|
|
141956
|
-
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${
|
|
141955
|
+
if (schema10.id && schema10.$id && schema10.id !== schema10.$id) {
|
|
141956
|
+
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema10.id}, $id=${schema10.$id} in ${fileName}`);
|
|
141957
141957
|
}
|
|
141958
|
-
if (
|
|
141959
|
-
|
|
141960
|
-
delete
|
|
141958
|
+
if (schema10.id) {
|
|
141959
|
+
schema10.$id = schema10.id;
|
|
141960
|
+
delete schema10.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", (schema10, fileName, _options, _key, dereferencedPaths) => {
|
|
141964
|
+
if (!(0, utils_1.isSchemaLike)(schema10)) {
|
|
141965
141965
|
return;
|
|
141966
141966
|
}
|
|
141967
|
-
if (!
|
|
141968
|
-
|
|
141967
|
+
if (!schema10.$id && !schema10[JSONSchema_1.Parent]) {
|
|
141968
|
+
schema10.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
|
|
141969
141969
|
return;
|
|
141970
141970
|
}
|
|
141971
|
-
if (!isArrayType(
|
|
141971
|
+
if (!isArrayType(schema10) && !isObjectType(schema10)) {
|
|
141972
141972
|
return;
|
|
141973
141973
|
}
|
|
141974
|
-
const dereferencedName = dereferencedPaths.get(
|
|
141975
|
-
if (!
|
|
141976
|
-
|
|
141974
|
+
const dereferencedName = dereferencedPaths.get(schema10);
|
|
141975
|
+
if (!schema10.$id && !schema10.title && dereferencedName) {
|
|
141976
|
+
schema10.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
|
|
141977
141977
|
}
|
|
141978
141978
|
if (dereferencedName) {
|
|
141979
|
-
dereferencedPaths.delete(
|
|
141979
|
+
dereferencedPaths.delete(schema10);
|
|
141980
141980
|
}
|
|
141981
141981
|
});
|
|
141982
|
-
rules.set("Escape closing JSDoc comment", (
|
|
141983
|
-
(0, utils_1.escapeBlockComment)(
|
|
141982
|
+
rules.set("Escape closing JSDoc comment", (schema10) => {
|
|
141983
|
+
(0, utils_1.escapeBlockComment)(schema10);
|
|
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", (schema10) => {
|
|
141986
|
+
if (!isArrayType(schema10)) {
|
|
141987
141987
|
return;
|
|
141988
141988
|
}
|
|
141989
141989
|
const commentsToAppend = [
|
|
141990
|
-
"minItems" in
|
|
141991
|
-
"maxItems" in
|
|
141990
|
+
"minItems" in schema10 ? `@minItems ${schema10.minItems}` : "",
|
|
141991
|
+
"maxItems" in schema10 ? `@maxItems ${schema10.maxItems}` : ""
|
|
141992
141992
|
].filter(Boolean);
|
|
141993
141993
|
if (commentsToAppend.length) {
|
|
141994
|
-
|
|
141994
|
+
schema10.description = (0, utils_1.appendToDescription)(schema10.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", (schema10, _fileName, options8) => {
|
|
141998
|
+
if (!isArrayType(schema10)) {
|
|
141999
141999
|
return;
|
|
142000
142000
|
}
|
|
142001
|
-
if ("minItems" in
|
|
142002
|
-
delete
|
|
142001
|
+
if ("minItems" in schema10 && options8.ignoreMinAndMaxItems) {
|
|
142002
|
+
delete schema10.minItems;
|
|
142003
142003
|
}
|
|
142004
|
-
if ("maxItems" in
|
|
142005
|
-
delete
|
|
142004
|
+
if ("maxItems" in schema10 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
|
|
142005
|
+
delete schema10.maxItems;
|
|
142006
142006
|
}
|
|
142007
142007
|
});
|
|
142008
|
-
rules.set("Normalize schema.minItems", (
|
|
142008
|
+
rules.set("Normalize schema.minItems", (schema10, _fileName, options8) => {
|
|
142009
142009
|
if (options8.ignoreMinAndMaxItems) {
|
|
142010
142010
|
return;
|
|
142011
142011
|
}
|
|
142012
|
-
if (!isArrayType(
|
|
142012
|
+
if (!isArrayType(schema10)) {
|
|
142013
142013
|
return;
|
|
142014
142014
|
}
|
|
142015
|
-
const { minItems } =
|
|
142016
|
-
|
|
142015
|
+
const { minItems } = schema10;
|
|
142016
|
+
schema10.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", (schema10, _fileName, options8) => {
|
|
142019
142019
|
if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
|
|
142020
142020
|
return;
|
|
142021
142021
|
}
|
|
142022
|
-
if (!isArrayType(
|
|
142022
|
+
if (!isArrayType(schema10)) {
|
|
142023
142023
|
return;
|
|
142024
142024
|
}
|
|
142025
|
-
const { maxItems, minItems } =
|
|
142025
|
+
const { maxItems, minItems } = schema10;
|
|
142026
142026
|
if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
|
|
142027
|
-
delete
|
|
142027
|
+
delete schema10.maxItems;
|
|
142028
142028
|
}
|
|
142029
142029
|
});
|
|
142030
|
-
rules.set("Normalize schema.items", (
|
|
142030
|
+
rules.set("Normalize schema.items", (schema10, _fileName, options8) => {
|
|
142031
142031
|
if (options8.ignoreMinAndMaxItems) {
|
|
142032
142032
|
return;
|
|
142033
142033
|
}
|
|
142034
|
-
const { maxItems, minItems } =
|
|
142034
|
+
const { maxItems, minItems } = schema10;
|
|
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 (schema10.items && !Array.isArray(schema10.items) && (hasMaxItems || hasMinItems)) {
|
|
142038
|
+
const items = schema10.items;
|
|
142039
142039
|
const newItems = Array(maxItems || minItems || 0).fill(items);
|
|
142040
142040
|
if (!hasMaxItems) {
|
|
142041
|
-
|
|
142041
|
+
schema10.additionalItems = items;
|
|
142042
142042
|
}
|
|
142043
|
-
|
|
142043
|
+
schema10.items = newItems;
|
|
142044
142044
|
}
|
|
142045
|
-
if (Array.isArray(
|
|
142046
|
-
|
|
142045
|
+
if (Array.isArray(schema10.items) && hasMaxItems && maxItems < schema10.items.length) {
|
|
142046
|
+
schema10.items = schema10.items.slice(0, maxItems);
|
|
142047
142047
|
}
|
|
142048
|
-
return
|
|
142048
|
+
return schema10;
|
|
142049
142049
|
});
|
|
142050
|
-
rules.set("Remove extends, if it is empty", (
|
|
142051
|
-
if (!
|
|
142050
|
+
rules.set("Remove extends, if it is empty", (schema10) => {
|
|
142051
|
+
if (!schema10.hasOwnProperty("extends")) {
|
|
142052
142052
|
return;
|
|
142053
142053
|
}
|
|
142054
|
-
if (
|
|
142055
|
-
delete
|
|
142054
|
+
if (schema10.extends == null || Array.isArray(schema10.extends) && schema10.extends.length === 0) {
|
|
142055
|
+
delete schema10.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", (schema10) => {
|
|
142059
|
+
if (schema10.extends == null) {
|
|
142060
142060
|
return;
|
|
142061
142061
|
}
|
|
142062
|
-
if (!Array.isArray(
|
|
142063
|
-
|
|
142062
|
+
if (!Array.isArray(schema10.extends)) {
|
|
142063
|
+
schema10.extends = [schema10.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", (schema10, fileName) => {
|
|
142067
|
+
if (schema10.definitions && schema10.$defs && !(0, util_1.isDeepStrictEqual)(schema10.definitions, schema10.$defs)) {
|
|
142068
|
+
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema10.id} in ${fileName}`);
|
|
142069
142069
|
}
|
|
142070
|
-
if (
|
|
142071
|
-
|
|
142072
|
-
delete
|
|
142070
|
+
if (schema10.definitions) {
|
|
142071
|
+
schema10.$defs = schema10.definitions;
|
|
142072
|
+
delete schema10.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", (schema10) => {
|
|
142076
|
+
if (schema10.const !== undefined) {
|
|
142077
|
+
schema10.enum = [schema10.const];
|
|
142078
|
+
delete schema10.const;
|
|
142079
142079
|
}
|
|
142080
142080
|
});
|
|
142081
|
-
rules.set("Add tsEnumNames to enum types", (
|
|
142081
|
+
rules.set("Add tsEnumNames to enum types", (schema10, _10, options8) => {
|
|
142082
142082
|
var _a7;
|
|
142083
|
-
if (isEnumTypeWithoutTsEnumNames(
|
|
142084
|
-
|
|
142083
|
+
if (isEnumTypeWithoutTsEnumNames(schema10) && options8.inferStringEnumKeysFromValues) {
|
|
142084
|
+
schema10.tsEnumNames = (_a7 = schema10.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", (schema10) => {
|
|
142088
|
+
if (schema10 !== null && typeof schema10 === "object") {
|
|
142089
|
+
(0, applySchemaTyping_1.applySchemaTyping)(schema10);
|
|
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, (schema10, key2) => rule(schema10, 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(schema10, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142176
|
+
if ((0, JSONSchema_1.isPrimitive)(schema10)) {
|
|
142177
|
+
if ((0, JSONSchema_1.isBoolean)(schema10)) {
|
|
142178
|
+
return parseBooleanSchema(schema10, keyName, options8);
|
|
142179
142179
|
}
|
|
142180
|
-
return parseLiteral(
|
|
142180
|
+
return parseLiteral(schema10, keyName);
|
|
142181
142181
|
}
|
|
142182
|
-
const intersection2 =
|
|
142183
|
-
const types =
|
|
142182
|
+
const intersection2 = schema10[JSONSchema_1.Intersection];
|
|
142183
|
+
const types = schema10[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(schema10, 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:", schema10, "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(schema10, type, options8, keyName, processed, usedNames);
|
|
142195
|
+
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema10, "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(schema10, type, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142202
|
+
let cachedTypeMap = processed.get(schema10);
|
|
142203
142203
|
if (!cachedTypeMap) {
|
|
142204
142204
|
cachedTypeMap = new Map;
|
|
142205
|
-
processed.set(
|
|
142205
|
+
processed.set(schema10, 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(schema10, type, options8, keyName, processed, usedNames));
|
|
142214
142214
|
}
|
|
142215
|
-
function parseBooleanSchema(
|
|
142216
|
-
if (
|
|
142215
|
+
function parseBooleanSchema(schema10, keyName, options8) {
|
|
142216
|
+
if (schema10) {
|
|
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(schema10, keyName) {
|
|
142228
142228
|
return {
|
|
142229
142229
|
keyName,
|
|
142230
|
-
params:
|
|
142230
|
+
params: schema10,
|
|
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(schema10, type, options8, keyName, processed, usedNames) {
|
|
142235
|
+
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema10));
|
|
142236
|
+
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema10);
|
|
142237
142237
|
switch (type) {
|
|
142238
142238
|
case "ALL_OF":
|
|
142239
142239
|
return {
|
|
142240
|
-
comment:
|
|
142241
|
-
deprecated:
|
|
142240
|
+
comment: schema10.description,
|
|
142241
|
+
deprecated: schema10.deprecated,
|
|
142242
142242
|
keyName,
|
|
142243
|
-
standaloneName: standaloneName(
|
|
142244
|
-
params:
|
|
142243
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142244
|
+
params: schema10.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: schema10.description, deprecated: schema10.deprecated, keyName, standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8) });
|
|
142249
142249
|
case "ANY_OF":
|
|
142250
142250
|
return {
|
|
142251
|
-
comment:
|
|
142252
|
-
deprecated:
|
|
142251
|
+
comment: schema10.description,
|
|
142252
|
+
deprecated: schema10.deprecated,
|
|
142253
142253
|
keyName,
|
|
142254
|
-
standaloneName: standaloneName(
|
|
142255
|
-
params:
|
|
142254
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142255
|
+
params: schema10.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: schema10.description,
|
|
142261
|
+
deprecated: schema10.deprecated,
|
|
142262
142262
|
keyName,
|
|
142263
|
-
standaloneName: standaloneName(
|
|
142263
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142264
142264
|
type: "BOOLEAN"
|
|
142265
142265
|
};
|
|
142266
142266
|
case "CUSTOM_TYPE":
|
|
142267
142267
|
return {
|
|
142268
|
-
comment:
|
|
142269
|
-
deprecated:
|
|
142268
|
+
comment: schema10.description,
|
|
142269
|
+
deprecated: schema10.deprecated,
|
|
142270
142270
|
keyName,
|
|
142271
|
-
params:
|
|
142272
|
-
standaloneName: standaloneName(
|
|
142271
|
+
params: schema10.tsType,
|
|
142272
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142273
142273
|
type: "CUSTOM_TYPE"
|
|
142274
142274
|
};
|
|
142275
142275
|
case "NAMED_ENUM":
|
|
142276
142276
|
return {
|
|
142277
|
-
comment:
|
|
142278
|
-
deprecated:
|
|
142277
|
+
comment: schema10.description,
|
|
142278
|
+
deprecated: schema10.deprecated,
|
|
142279
142279
|
keyName,
|
|
142280
|
-
standaloneName: standaloneName(
|
|
142281
|
-
params:
|
|
142280
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
|
|
142281
|
+
params: schema10.enum.map((_10, n5) => ({
|
|
142282
142282
|
ast: parseLiteral(_10, undefined),
|
|
142283
|
-
keyName:
|
|
142283
|
+
keyName: schema10.tsEnumNames[n5]
|
|
142284
142284
|
})),
|
|
142285
142285
|
type: "ENUM"
|
|
142286
142286
|
};
|
|
142287
142287
|
case "NAMED_SCHEMA":
|
|
142288
|
-
return newInterface(
|
|
142288
|
+
return newInterface(schema10, options8, processed, usedNames, keyName);
|
|
142289
142289
|
case "NEVER":
|
|
142290
142290
|
return {
|
|
142291
|
-
comment:
|
|
142292
|
-
deprecated:
|
|
142291
|
+
comment: schema10.description,
|
|
142292
|
+
deprecated: schema10.deprecated,
|
|
142293
142293
|
keyName,
|
|
142294
|
-
standaloneName: standaloneName(
|
|
142294
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142295
142295
|
type: "NEVER"
|
|
142296
142296
|
};
|
|
142297
142297
|
case "NULL":
|
|
142298
142298
|
return {
|
|
142299
|
-
comment:
|
|
142300
|
-
deprecated:
|
|
142299
|
+
comment: schema10.description,
|
|
142300
|
+
deprecated: schema10.deprecated,
|
|
142301
142301
|
keyName,
|
|
142302
|
-
standaloneName: standaloneName(
|
|
142302
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142303
142303
|
type: "NULL"
|
|
142304
142304
|
};
|
|
142305
142305
|
case "NUMBER":
|
|
142306
142306
|
return {
|
|
142307
|
-
comment:
|
|
142308
|
-
deprecated:
|
|
142307
|
+
comment: schema10.description,
|
|
142308
|
+
deprecated: schema10.deprecated,
|
|
142309
142309
|
keyName,
|
|
142310
|
-
standaloneName: standaloneName(
|
|
142310
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142311
142311
|
type: "NUMBER"
|
|
142312
142312
|
};
|
|
142313
142313
|
case "OBJECT":
|
|
142314
142314
|
return {
|
|
142315
|
-
comment:
|
|
142315
|
+
comment: schema10.description,
|
|
142316
142316
|
keyName,
|
|
142317
|
-
standaloneName: standaloneName(
|
|
142317
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142318
142318
|
type: "OBJECT",
|
|
142319
|
-
deprecated:
|
|
142319
|
+
deprecated: schema10.deprecated
|
|
142320
142320
|
};
|
|
142321
142321
|
case "ONE_OF":
|
|
142322
142322
|
return {
|
|
142323
|
-
comment:
|
|
142324
|
-
deprecated:
|
|
142323
|
+
comment: schema10.description,
|
|
142324
|
+
deprecated: schema10.deprecated,
|
|
142325
142325
|
keyName,
|
|
142326
|
-
standaloneName: standaloneName(
|
|
142327
|
-
params:
|
|
142326
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142327
|
+
params: schema10.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!", schema10));
|
|
142332
142332
|
case "STRING":
|
|
142333
142333
|
return {
|
|
142334
|
-
comment:
|
|
142335
|
-
deprecated:
|
|
142334
|
+
comment: schema10.description,
|
|
142335
|
+
deprecated: schema10.deprecated,
|
|
142336
142336
|
keyName,
|
|
142337
|
-
standaloneName: standaloneName(
|
|
142337
|
+
standaloneName: standaloneName(schema10, 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(schema10.items)) {
|
|
142342
|
+
const minItems2 = schema10.minItems;
|
|
142343
|
+
const maxItems2 = schema10.maxItems;
|
|
142344
142344
|
const arrayType = {
|
|
142345
|
-
comment:
|
|
142346
|
-
deprecated:
|
|
142345
|
+
comment: schema10.description,
|
|
142346
|
+
deprecated: schema10.deprecated,
|
|
142347
142347
|
keyName,
|
|
142348
142348
|
maxItems: maxItems2,
|
|
142349
142349
|
minItems: minItems2,
|
|
142350
|
-
standaloneName: standaloneName(
|
|
142351
|
-
params:
|
|
142350
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142351
|
+
params: schema10.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142352
142352
|
type: "TUPLE"
|
|
142353
142353
|
};
|
|
142354
|
-
if (
|
|
142354
|
+
if (schema10.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 (schema10.additionalItems) {
|
|
142357
|
+
arrayType.spreadParam = parse11(schema10.additionalItems, options8, undefined, processed, usedNames);
|
|
142358
142358
|
}
|
|
142359
142359
|
return arrayType;
|
|
142360
142360
|
} else {
|
|
142361
142361
|
return {
|
|
142362
|
-
comment:
|
|
142363
|
-
deprecated:
|
|
142362
|
+
comment: schema10.description,
|
|
142363
|
+
deprecated: schema10.deprecated,
|
|
142364
142364
|
keyName,
|
|
142365
|
-
standaloneName: standaloneName(
|
|
142366
|
-
params: parse11(
|
|
142365
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142366
|
+
params: parse11(schema10.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: schema10.description,
|
|
142373
|
+
deprecated: schema10.deprecated,
|
|
142374
142374
|
keyName,
|
|
142375
|
-
standaloneName: standaloneName(
|
|
142376
|
-
params:
|
|
142377
|
-
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(
|
|
142375
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142376
|
+
params: schema10.type.map((type2) => {
|
|
142377
|
+
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema10, "$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: schema10.description,
|
|
142387
|
+
deprecated: schema10.deprecated,
|
|
142388
142388
|
keyName,
|
|
142389
|
-
standaloneName: standaloneName(
|
|
142390
|
-
params:
|
|
142389
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142390
|
+
params: schema10.enum.map((_10) => parseLiteral(_10, undefined)),
|
|
142391
142391
|
type: "UNION"
|
|
142392
142392
|
};
|
|
142393
142393
|
case "UNNAMED_SCHEMA":
|
|
142394
|
-
return newInterface(
|
|
142394
|
+
return newInterface(schema10, options8, processed, usedNames, keyName, keyNameFromDefinition);
|
|
142395
142395
|
case "UNTYPED_ARRAY":
|
|
142396
|
-
const minItems =
|
|
142397
|
-
const maxItems = typeof
|
|
142396
|
+
const minItems = schema10.minItems;
|
|
142397
|
+
const maxItems = typeof schema10.maxItems === "number" ? schema10.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: schema10.description,
|
|
142402
|
+
deprecated: schema10.deprecated,
|
|
142403
142403
|
keyName,
|
|
142404
|
-
maxItems:
|
|
142404
|
+
maxItems: schema10.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(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142409
142409
|
type: "TUPLE"
|
|
142410
142410
|
};
|
|
142411
142411
|
}
|
|
142412
142412
|
return {
|
|
142413
|
-
comment:
|
|
142414
|
-
deprecated:
|
|
142413
|
+
comment: schema10.description,
|
|
142414
|
+
deprecated: schema10.deprecated,
|
|
142415
142415
|
keyName,
|
|
142416
142416
|
params,
|
|
142417
|
-
standaloneName: standaloneName(
|
|
142417
|
+
standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
|
|
142418
142418
|
type: "ARRAY"
|
|
142419
142419
|
};
|
|
142420
142420
|
}
|
|
142421
142421
|
}
|
|
142422
|
-
function standaloneName(
|
|
142422
|
+
function standaloneName(schema10, 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, schema10, keyNameFromDefinition)) || schema10.title || schema10.$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(schema10, options8, processed, usedNames, keyName, keyNameFromDefinition) {
|
|
142430
|
+
const name2 = standaloneName(schema10, keyNameFromDefinition, usedNames, options8);
|
|
142431
142431
|
return {
|
|
142432
|
-
comment:
|
|
142433
|
-
deprecated:
|
|
142432
|
+
comment: schema10.description,
|
|
142433
|
+
deprecated: schema10.deprecated,
|
|
142434
142434
|
keyName,
|
|
142435
|
-
params: parseSchema(
|
|
142435
|
+
params: parseSchema(schema10, options8, processed, usedNames, name2),
|
|
142436
142436
|
standaloneName: name2,
|
|
142437
|
-
superTypes: parseSuperTypes(
|
|
142437
|
+
superTypes: parseSuperTypes(schema10, options8, processed, usedNames),
|
|
142438
142438
|
type: "INTERFACE"
|
|
142439
142439
|
};
|
|
142440
142440
|
}
|
|
142441
|
-
function parseSuperTypes(
|
|
142442
|
-
const superTypes =
|
|
142441
|
+
function parseSuperTypes(schema10, options8, processed, usedNames) {
|
|
142442
|
+
const superTypes = schema10.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(schema10, options8, processed, usedNames, parentSchemaName) {
|
|
142449
|
+
let asts = (0, lodash_1.map)(schema10.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)(schema10.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 (schema10.patternProperties) {
|
|
142458
|
+
singlePatternProperty = !schema10.additionalProperties && Object.keys(schema10.patternProperties).length === 1;
|
|
142459
|
+
asts = asts.concat((0, lodash_1.map)(schema10.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)(schema10.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)(schema10.$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)(schema10.required || [], key2),
|
|
142487
142487
|
isUnreachableDefinition: true,
|
|
142488
142488
|
keyName: key2
|
|
142489
142489
|
};
|
|
142490
142490
|
}));
|
|
142491
142491
|
}
|
|
142492
|
-
switch (
|
|
142492
|
+
switch (schema10.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(schema10.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(schema10, isSchema = true, processed = new Set) {
|
|
142518
|
+
if (processed.has(schema10)) {
|
|
142519
142519
|
return {};
|
|
142520
142520
|
}
|
|
142521
|
-
processed.add(
|
|
142522
|
-
if (Array.isArray(
|
|
142523
|
-
return
|
|
142521
|
+
processed.add(schema10);
|
|
142522
|
+
if (Array.isArray(schema10)) {
|
|
142523
|
+
return schema10.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)(schema10)) {
|
|
142526
|
+
return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema10) ? schema10.$defs : {}), Object.keys(schema10).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema10[cur], false, processed)), {}));
|
|
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(schema10) {
|
|
142532
|
+
return "$defs" in schema10;
|
|
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 = relative4;
|
|
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 relative4(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 schema10;
|
|
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
|
+
schema10 = args[1];
|
|
144367
144367
|
options8 = args[2];
|
|
144368
144368
|
} else {
|
|
144369
|
-
|
|
144369
|
+
schema10 = undefined;
|
|
144370
144370
|
options8 = args[1];
|
|
144371
144371
|
}
|
|
144372
144372
|
} else {
|
|
144373
144373
|
path18 = "";
|
|
144374
|
-
|
|
144374
|
+
schema10 = 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 schema10 === "object") {
|
|
144383
|
+
schema10 = JSON.parse(JSON.stringify(schema10));
|
|
144384
144384
|
}
|
|
144385
144385
|
return {
|
|
144386
144386
|
path: path18,
|
|
144387
|
-
schema:
|
|
144387
|
+
schema: schema10,
|
|
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* (schema10, { cwd, $refOptions }) {
|
|
145177
|
+
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema10);
|
|
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, schema10, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema11) {
|
|
145181
|
+
dereferencedPaths.set(schema11, $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", (schema10) => {
|
|
145196
|
+
if (schema10.enum && schema10.tsEnumNames && schema10.enum.length !== schema10.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", (schema10) => {
|
|
145201
|
+
if (schema10.tsEnumNames && schema10.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", (schema10) => {
|
|
145206
|
+
const { maxItems, minItems } = schema10;
|
|
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", (schema10) => {
|
|
145212
|
+
const { maxItems } = schema10;
|
|
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", (schema10) => {
|
|
145218
|
+
const { minItems } = schema10;
|
|
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", (schema10) => {
|
|
145224
|
+
const typeOfDeprecated = typeof schema10.deprecated;
|
|
145225
145225
|
return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
|
|
145226
145226
|
});
|
|
145227
|
-
function validate2(
|
|
145227
|
+
function validate2(schema10, filename) {
|
|
145228
145228
|
const errors5 = [];
|
|
145229
145229
|
rules.forEach((rule, ruleName) => {
|
|
145230
|
-
(0, utils_1.traverse)(
|
|
145231
|
-
if (rule(
|
|
145230
|
+
(0, utils_1.traverse)(schema10, (schema11, key2) => {
|
|
145231
|
+
if (rule(schema11) === false) {
|
|
145232
145232
|
errors5.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
|
|
145233
145233
|
}
|
|
145234
|
-
return
|
|
145234
|
+
return schema11;
|
|
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(schema10, parent = null) {
|
|
145249
|
+
if (!Array.isArray(schema10) && !(0, lodash_1.isPlainObject)(schema10)) {
|
|
145250
|
+
return schema10;
|
|
145251
145251
|
}
|
|
145252
|
-
if (
|
|
145253
|
-
return
|
|
145252
|
+
if (schema10.hasOwnProperty(JSONSchema_1.Parent)) {
|
|
145253
|
+
return schema10;
|
|
145254
145254
|
}
|
|
145255
|
-
Object.defineProperty(
|
|
145255
|
+
Object.defineProperty(schema10, 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(schema10)) {
|
|
145261
|
+
schema10.forEach((child) => link2(child, schema10));
|
|
145262
145262
|
}
|
|
145263
|
-
for (const key2 in
|
|
145264
|
-
link2(
|
|
145263
|
+
for (const key2 in schema10) {
|
|
145264
|
+
link2(schema10[key2], schema10);
|
|
145265
145265
|
}
|
|
145266
|
-
return
|
|
145266
|
+
return schema10;
|
|
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 schema10 = parseAsJSONSchema(filename);
|
|
145359
|
+
return compile(schema10, (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* (schema10, 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)(schema10);
|
|
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 relative4 = __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 relative4(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 dirname19 = path18.dirname;
|
|
163948
|
+
var basename6 = path18.basename;
|
|
163949
163949
|
var extname2 = path18.extname;
|
|
163950
|
-
var
|
|
163950
|
+
var join25 = 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 = dirname19(loc);
|
|
163987
|
+
var file2 = basename6(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 = join25(dir, file2);
|
|
164013
164013
|
var stat2 = tryStat(path19);
|
|
164014
164014
|
if (stat2 && stat2.isFile()) {
|
|
164015
164015
|
return path19;
|
|
164016
164016
|
}
|
|
164017
|
-
path19 =
|
|
164017
|
+
path19 = join25(dir, basename6(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 basename6 = __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 = basename6(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) : basename6(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 join25 = 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(join25(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 = join25(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, config12, property) {
|
|
169123
169123
|
if (Array.isArray(header2)) {
|
|
169124
169124
|
return header2.map(function(headerElement) {
|
|
169125
|
-
return rewriteCookieProperty(headerElement,
|
|
169125
|
+
return rewriteCookieProperty(headerElement, config12, 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 config12) {
|
|
169131
|
+
newValue = config12[previousValue];
|
|
169132
|
+
} else if ("*" in config12) {
|
|
169133
|
+
newValue = config12["*"];
|
|
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(relative4, base) {
|
|
169634
|
+
return useNativeURL ? new URL2(relative4, base) : parseUrl(url3.resolve(base, relative4));
|
|
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, config12) {
|
|
170499
170499
|
let newTarget;
|
|
170500
|
-
const router =
|
|
170500
|
+
const router = config12.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 basename6 = path18.basename(name2);
|
|
171273
|
+
if (basename6 === ".." || basename6 === "." || basename6 !== 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 basename6(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: basename6,
|
|
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: basename6,
|
|
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 = basename6(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 join25(s5) {
|
|
214620
214620
|
if (this.length === 0)
|
|
214621
214621
|
return "";
|
|
214622
214622
|
var p4 = this.head;
|
|
@@ -233593,6 +233593,9 @@ var ApiErrorResponseSchema = exports_external.looseObject({
|
|
|
233593
233593
|
});
|
|
233594
233594
|
|
|
233595
233595
|
// src/core/errors.ts
|
|
233596
|
+
function usingWorkspaceApiKey() {
|
|
233597
|
+
return process.env.BASE44_API_KEY?.trim().startsWith("b44k_") ?? false;
|
|
233598
|
+
}
|
|
233596
233599
|
function formatApiError(errorBody, parsed) {
|
|
233597
233600
|
const data = parsed ?? ApiErrorResponseSchema.safeParse(errorBody).data;
|
|
233598
233601
|
if (data) {
|
|
@@ -233787,6 +233790,13 @@ class ApiError extends SystemError {
|
|
|
233787
233790
|
];
|
|
233788
233791
|
}
|
|
233789
233792
|
if (statusCode === 401) {
|
|
233793
|
+
if (usingWorkspaceApiKey()) {
|
|
233794
|
+
return [
|
|
233795
|
+
{
|
|
233796
|
+
message: "The workspace API key (BASE44_API_KEY) was rejected. Verify it is valid and authorized for this app."
|
|
233797
|
+
}
|
|
233798
|
+
];
|
|
233799
|
+
}
|
|
233790
233800
|
return [{ message: "Try logging in again", command: "base44 login" }];
|
|
233791
233801
|
}
|
|
233792
233802
|
if (statusCode === 403) {
|
|
@@ -234018,7 +234028,7 @@ function normalizeBase44Env() {
|
|
|
234018
234028
|
loadProjectEnvFiles();
|
|
234019
234029
|
|
|
234020
234030
|
// src/cli/index.ts
|
|
234021
|
-
import { dirname as
|
|
234031
|
+
import { dirname as dirname23, join as join28 } from "node:path";
|
|
234022
234032
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
234023
234033
|
|
|
234024
234034
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -235225,15 +235235,8 @@ var {
|
|
|
235225
235235
|
Help
|
|
235226
235236
|
} = import__.default;
|
|
235227
235237
|
|
|
235228
|
-
// src/cli/
|
|
235229
|
-
|
|
235230
|
-
code;
|
|
235231
|
-
constructor(code) {
|
|
235232
|
-
super(`CLI exited with code ${code}`);
|
|
235233
|
-
this.code = code;
|
|
235234
|
-
this.name = "CLIExitError";
|
|
235235
|
-
}
|
|
235236
|
-
}
|
|
235238
|
+
// src/cli/commands/agents/pull.ts
|
|
235239
|
+
import { dirname as dirname10, join as join14 } from "node:path";
|
|
235237
235240
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
235238
235241
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
235239
235242
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -236045,7 +236048,6 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
236045
236048
|
site: SiteConfigSchema.optional(),
|
|
236046
236049
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
236047
236050
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
236048
|
-
actorsDir: exports_external.string().optional().default("actors"),
|
|
236049
236051
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
236050
236052
|
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
236051
236053
|
authDir: exports_external.string().optional().default("auth"),
|
|
@@ -236110,7 +236112,19 @@ function getTestOverrides() {
|
|
|
236110
236112
|
|
|
236111
236113
|
// src/core/auth/config.ts
|
|
236112
236114
|
var TOKEN_REFRESH_BUFFER_MS = 60 * 1000;
|
|
236115
|
+
var WORKSPACE_API_KEY_PREFIX = "b44k_";
|
|
236113
236116
|
var refreshPromise = null;
|
|
236117
|
+
function getWorkspaceApiKeyFromEnv() {
|
|
236118
|
+
const key = process.env.BASE44_API_KEY?.trim();
|
|
236119
|
+
return key ? key : null;
|
|
236120
|
+
}
|
|
236121
|
+
function isWorkspaceApiKey(value) {
|
|
236122
|
+
return value.startsWith(WORKSPACE_API_KEY_PREFIX);
|
|
236123
|
+
}
|
|
236124
|
+
function hasWorkspaceApiKeyAuth() {
|
|
236125
|
+
const key = getWorkspaceApiKeyFromEnv();
|
|
236126
|
+
return key !== null && isWorkspaceApiKey(key);
|
|
236127
|
+
}
|
|
236114
236128
|
async function seedAuthFromEnv() {
|
|
236115
236129
|
const accessToken = process.env.BASE44_ACCESS_TOKEN;
|
|
236116
236130
|
if (!accessToken) {
|
|
@@ -241902,7 +241916,7 @@ async function getSiteUrl() {
|
|
|
241902
241916
|
return result.data.url;
|
|
241903
241917
|
}
|
|
241904
241918
|
// src/core/project/config.ts
|
|
241905
|
-
import { dirname as
|
|
241919
|
+
import { dirname as dirname8, join as join10 } from "node:path";
|
|
241906
241920
|
|
|
241907
241921
|
// src/core/project/plugins.ts
|
|
241908
241922
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -241940,165 +241954,6 @@ function markPluginEntities(entities, pluginNamespace) {
|
|
|
241940
241954
|
}));
|
|
241941
241955
|
}
|
|
241942
241956
|
|
|
241943
|
-
// src/core/resources/types.ts
|
|
241944
|
-
var ResourceSourceSchema = exports_external.discriminatedUnion("type", [
|
|
241945
|
-
exports_external.object({
|
|
241946
|
-
type: exports_external.literal("project")
|
|
241947
|
-
}),
|
|
241948
|
-
exports_external.object({
|
|
241949
|
-
type: exports_external.literal("plugin"),
|
|
241950
|
-
namespace: exports_external.string().min(1, "Plugin namespace cannot be empty")
|
|
241951
|
-
})
|
|
241952
|
-
]);
|
|
241953
|
-
|
|
241954
|
-
// src/core/resources/actor/schema.ts
|
|
241955
|
-
var ActorConfigSchema = exports_external.object({
|
|
241956
|
-
name: exports_external.string().min(1),
|
|
241957
|
-
entry: exports_external.string().min(1)
|
|
241958
|
-
});
|
|
241959
|
-
var ActorSchemaFileSchema = exports_external.object({
|
|
241960
|
-
types: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
241961
|
-
toClient: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
241962
|
-
toServer: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
241963
|
-
});
|
|
241964
|
-
var DeployActorResponseSchema = exports_external.object({
|
|
241965
|
-
status: exports_external.enum(["deployed", "unchanged"]),
|
|
241966
|
-
handler_name: exports_external.string().optional()
|
|
241967
|
-
});
|
|
241968
|
-
var ActorSchema = ActorConfigSchema.extend({
|
|
241969
|
-
entryPath: exports_external.string().min(1),
|
|
241970
|
-
filePaths: exports_external.array(exports_external.string()).min(1),
|
|
241971
|
-
source: ResourceSourceSchema,
|
|
241972
|
-
messageSchema: exports_external.unknown().optional()
|
|
241973
|
-
});
|
|
241974
|
-
|
|
241975
|
-
// src/core/resources/actor/api.ts
|
|
241976
|
-
async function deploySingleActor(name2, payload) {
|
|
241977
|
-
const appClient = getAppClient();
|
|
241978
|
-
let response;
|
|
241979
|
-
try {
|
|
241980
|
-
response = await appClient.put(`actors/${encodeURIComponent(name2)}`, {
|
|
241981
|
-
json: payload,
|
|
241982
|
-
timeout: false
|
|
241983
|
-
});
|
|
241984
|
-
} catch (error48) {
|
|
241985
|
-
throw await ApiError.fromHttpError(error48, `deploying actor "${name2}"`);
|
|
241986
|
-
}
|
|
241987
|
-
const result = DeployActorResponseSchema.safeParse(await response.json());
|
|
241988
|
-
if (!result.success) {
|
|
241989
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
241990
|
-
}
|
|
241991
|
-
return result.data;
|
|
241992
|
-
}
|
|
241993
|
-
// src/core/resources/actor/config.ts
|
|
241994
|
-
import { basename as basename3, dirname as dirname6, join as join5, relative } from "node:path";
|
|
241995
|
-
async function readActor(entryFile, actorsDir) {
|
|
241996
|
-
const actorDir = dirname6(entryFile);
|
|
241997
|
-
const filePaths = await globby("**/*.ts", {
|
|
241998
|
-
cwd: actorDir,
|
|
241999
|
-
absolute: true
|
|
242000
|
-
});
|
|
242001
|
-
const name2 = relative(actorsDir, actorDir).split(/[/\\]/).join("/");
|
|
242002
|
-
if (!name2) {
|
|
242003
|
-
throw new InvalidInputError("entry.ts found directly in the actors directory — it must be inside a named subfolder", {
|
|
242004
|
-
hints: [
|
|
242005
|
-
{
|
|
242006
|
-
message: `Move ${entryFile} into a subfolder (e.g. actors/MyActor/entry.ts)`
|
|
242007
|
-
}
|
|
242008
|
-
]
|
|
242009
|
-
});
|
|
242010
|
-
}
|
|
242011
|
-
const entry = basename3(entryFile);
|
|
242012
|
-
const schemaPath = join5(actorDir, "schema.jsonc");
|
|
242013
|
-
let messageSchema;
|
|
242014
|
-
if (await pathExists(schemaPath)) {
|
|
242015
|
-
const parsed = await readJsonFile(schemaPath);
|
|
242016
|
-
const result = ActorSchemaFileSchema.safeParse(parsed);
|
|
242017
|
-
if (result.success) {
|
|
242018
|
-
messageSchema = {
|
|
242019
|
-
types: result.data.types,
|
|
242020
|
-
toClient: result.data.toClient,
|
|
242021
|
-
toServer: result.data.toServer
|
|
242022
|
-
};
|
|
242023
|
-
}
|
|
242024
|
-
}
|
|
242025
|
-
return {
|
|
242026
|
-
name: name2,
|
|
242027
|
-
entry,
|
|
242028
|
-
entryPath: entryFile,
|
|
242029
|
-
filePaths,
|
|
242030
|
-
source: { type: "project" },
|
|
242031
|
-
messageSchema
|
|
242032
|
-
};
|
|
242033
|
-
}
|
|
242034
|
-
async function readAllActors(actorsDir) {
|
|
242035
|
-
if (!await pathExists(actorsDir)) {
|
|
242036
|
-
return [];
|
|
242037
|
-
}
|
|
242038
|
-
const entryFiles = await globby(ENTRY_FILE_GLOB, {
|
|
242039
|
-
cwd: actorsDir,
|
|
242040
|
-
absolute: true,
|
|
242041
|
-
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
242042
|
-
});
|
|
242043
|
-
const actors = await Promise.all(entryFiles.map((entryFile) => readActor(entryFile, actorsDir)));
|
|
242044
|
-
const names = new Set;
|
|
242045
|
-
for (const actor of actors) {
|
|
242046
|
-
if (names.has(actor.name)) {
|
|
242047
|
-
throw new InvalidInputError(`Duplicate actor name "${actor.name}" in ${actorsDir}`);
|
|
242048
|
-
}
|
|
242049
|
-
names.add(actor.name);
|
|
242050
|
-
}
|
|
242051
|
-
return actors;
|
|
242052
|
-
}
|
|
242053
|
-
// src/core/resources/actor/deploy.ts
|
|
242054
|
-
import { dirname as dirname7, relative as relative2 } from "node:path";
|
|
242055
|
-
async function loadActorCode(actor) {
|
|
242056
|
-
const actorDir = dirname7(actor.entryPath);
|
|
242057
|
-
const resolvedFiles = await Promise.all(actor.filePaths.map(async (filePath) => {
|
|
242058
|
-
const content = await readTextFile(filePath);
|
|
242059
|
-
const path11 = relative2(actorDir, filePath).split(/[/\\]/).join("/");
|
|
242060
|
-
return { path: path11, content };
|
|
242061
|
-
}));
|
|
242062
|
-
return { name: actor.name, entry: actor.entry, files: resolvedFiles };
|
|
242063
|
-
}
|
|
242064
|
-
async function deployOne(actor) {
|
|
242065
|
-
const start = Date.now();
|
|
242066
|
-
try {
|
|
242067
|
-
const loaded = await loadActorCode(actor);
|
|
242068
|
-
const response = await deploySingleActor(loaded.name, {
|
|
242069
|
-
entry: loaded.entry,
|
|
242070
|
-
files: loaded.files
|
|
242071
|
-
});
|
|
242072
|
-
return {
|
|
242073
|
-
name: loaded.name,
|
|
242074
|
-
status: response.status,
|
|
242075
|
-
durationMs: Date.now() - start
|
|
242076
|
-
};
|
|
242077
|
-
} catch (error48) {
|
|
242078
|
-
return {
|
|
242079
|
-
name: actor.name,
|
|
242080
|
-
status: "error",
|
|
242081
|
-
error: error48 instanceof Error ? error48.message : String(error48)
|
|
242082
|
-
};
|
|
242083
|
-
}
|
|
242084
|
-
}
|
|
242085
|
-
async function deployActorsSequentially(actors, options) {
|
|
242086
|
-
if (actors.length === 0)
|
|
242087
|
-
return [];
|
|
242088
|
-
const results = [];
|
|
242089
|
-
for (const actor of actors) {
|
|
242090
|
-
options?.onStart?.([actor.name]);
|
|
242091
|
-
const result = await deployOne(actor);
|
|
242092
|
-
results.push(result);
|
|
242093
|
-
options?.onResult?.(result);
|
|
242094
|
-
}
|
|
242095
|
-
return results;
|
|
242096
|
-
}
|
|
242097
|
-
// src/core/resources/actor/resource.ts
|
|
242098
|
-
var actorResource = {
|
|
242099
|
-
readAll: readAllActors,
|
|
242100
|
-
push: (actors) => deployActorsSequentially(actors)
|
|
242101
|
-
};
|
|
242102
241957
|
// src/core/resources/agent/schema.ts
|
|
242103
241958
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
242104
241959
|
var EntityToolConfigSchema = exports_external.object({
|
|
@@ -242176,7 +242031,7 @@ async function fetchAgents() {
|
|
|
242176
242031
|
return result.data;
|
|
242177
242032
|
}
|
|
242178
242033
|
// src/core/resources/agent/config.ts
|
|
242179
|
-
import { join as
|
|
242034
|
+
import { join as join5, normalize } from "node:path";
|
|
242180
242035
|
import { isDeepStrictEqual } from "node:util";
|
|
242181
242036
|
async function readAgentFile(agentPath) {
|
|
242182
242037
|
const raw2 = await readJsonFile(agentPath);
|
|
@@ -242221,12 +242076,12 @@ async function readAllAgents(agentsDir) {
|
|
|
242221
242076
|
return [...nameToEntry.values()].map((e2) => e2.data);
|
|
242222
242077
|
}
|
|
242223
242078
|
function findAvailablePath(agentsDir, name2, claimedPaths) {
|
|
242224
|
-
const base =
|
|
242079
|
+
const base = join5(agentsDir, `${name2}.${CONFIG_FILE_EXTENSION}`);
|
|
242225
242080
|
if (!claimedPaths.has(base)) {
|
|
242226
242081
|
return base;
|
|
242227
242082
|
}
|
|
242228
242083
|
for (let i = 1;; i++) {
|
|
242229
|
-
const candidate =
|
|
242084
|
+
const candidate = join5(agentsDir, `${name2}_${i}.${CONFIG_FILE_EXTENSION}`);
|
|
242230
242085
|
if (!claimedPaths.has(candidate)) {
|
|
242231
242086
|
return candidate;
|
|
242232
242087
|
}
|
|
@@ -242309,8 +242164,8 @@ var AppAuthConfigResponseSchema = exports_external.object({
|
|
|
242309
242164
|
}).transform((data) => ({
|
|
242310
242165
|
authConfig: data.auth_config
|
|
242311
242166
|
}));
|
|
242312
|
-
function hasAnyLoginMethod(
|
|
242313
|
-
return
|
|
242167
|
+
function hasAnyLoginMethod(config4) {
|
|
242168
|
+
return config4.enableUsernamePassword || config4.enableGoogleLogin || config4.enableMicrosoftLogin || config4.enableFacebookLogin || config4.enableAppleLogin || config4.enableSSOLogin;
|
|
242314
242169
|
}
|
|
242315
242170
|
var SOCIAL_PROVIDERS = {
|
|
242316
242171
|
google: {
|
|
@@ -242325,18 +242180,18 @@ var SOCIAL_PROVIDERS = {
|
|
|
242325
242180
|
facebook: { field: "enableFacebookLogin" },
|
|
242326
242181
|
apple: { field: "enableAppleLogin" }
|
|
242327
242182
|
};
|
|
242328
|
-
function toAuthConfigPayload(
|
|
242183
|
+
function toAuthConfigPayload(config4) {
|
|
242329
242184
|
return {
|
|
242330
|
-
enable_username_password:
|
|
242331
|
-
enable_google_login:
|
|
242332
|
-
enable_microsoft_login:
|
|
242333
|
-
enable_facebook_login:
|
|
242334
|
-
enable_apple_login:
|
|
242335
|
-
sso_provider_name:
|
|
242336
|
-
enable_sso_login:
|
|
242337
|
-
google_oauth_mode:
|
|
242338
|
-
google_oauth_client_id:
|
|
242339
|
-
use_workspace_sso:
|
|
242185
|
+
enable_username_password: config4.enableUsernamePassword,
|
|
242186
|
+
enable_google_login: config4.enableGoogleLogin,
|
|
242187
|
+
enable_microsoft_login: config4.enableMicrosoftLogin,
|
|
242188
|
+
enable_facebook_login: config4.enableFacebookLogin,
|
|
242189
|
+
enable_apple_login: config4.enableAppleLogin,
|
|
242190
|
+
sso_provider_name: config4.ssoProviderName,
|
|
242191
|
+
enable_sso_login: config4.enableSSOLogin,
|
|
242192
|
+
google_oauth_mode: config4.googleOAuthMode,
|
|
242193
|
+
google_oauth_client_id: config4.googleOAuthClientId,
|
|
242194
|
+
use_workspace_sso: config4.useWorkspaceSSO
|
|
242340
242195
|
};
|
|
242341
242196
|
}
|
|
242342
242197
|
|
|
@@ -242355,12 +242210,12 @@ async function getAuthConfig() {
|
|
|
242355
242210
|
}
|
|
242356
242211
|
return result.data.authConfig;
|
|
242357
242212
|
}
|
|
242358
|
-
async function pushAuthConfigToApi(
|
|
242213
|
+
async function pushAuthConfigToApi(config4) {
|
|
242359
242214
|
const { id } = getAppContext();
|
|
242360
242215
|
let response;
|
|
242361
242216
|
try {
|
|
242362
242217
|
response = await base44Client.put(`api/apps/${id}`, {
|
|
242363
|
-
json: { auth_config: toAuthConfigPayload(
|
|
242218
|
+
json: { auth_config: toAuthConfigPayload(config4) }
|
|
242364
242219
|
});
|
|
242365
242220
|
} catch (error48) {
|
|
242366
242221
|
throw await ApiError.fromHttpError(error48, "updating auth config");
|
|
@@ -242372,7 +242227,7 @@ async function pushAuthConfigToApi(config5) {
|
|
|
242372
242227
|
return result.data.authConfig;
|
|
242373
242228
|
}
|
|
242374
242229
|
// src/core/resources/auth-config/config.ts
|
|
242375
|
-
import { join as
|
|
242230
|
+
import { join as join6 } from "node:path";
|
|
242376
242231
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
242377
242232
|
var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
|
|
242378
242233
|
var DEFAULT_AUTH_CONFIG = {
|
|
@@ -242388,7 +242243,7 @@ var DEFAULT_AUTH_CONFIG = {
|
|
|
242388
242243
|
useWorkspaceSSO: false
|
|
242389
242244
|
};
|
|
242390
242245
|
function getAuthConfigPath(authDir) {
|
|
242391
|
-
return
|
|
242246
|
+
return join6(authDir, AUTH_CONFIG_FILENAME);
|
|
242392
242247
|
}
|
|
242393
242248
|
async function readAuthConfig(authDir) {
|
|
242394
242249
|
const filePath = getAuthConfigPath(authDir);
|
|
@@ -242402,16 +242257,16 @@ async function readAuthConfig(authDir) {
|
|
|
242402
242257
|
}
|
|
242403
242258
|
return result.data;
|
|
242404
242259
|
}
|
|
242405
|
-
async function writeAuthConfig(authDir,
|
|
242260
|
+
async function writeAuthConfig(authDir, config4) {
|
|
242406
242261
|
const filePath = getAuthConfigPath(authDir);
|
|
242407
242262
|
if (await pathExists(filePath)) {
|
|
242408
242263
|
const existing = await readJsonFile(filePath);
|
|
242409
242264
|
const existingResult = AuthConfigFileSchema.safeParse(existing);
|
|
242410
|
-
if (existingResult.success && isDeepStrictEqual2(existingResult.data,
|
|
242265
|
+
if (existingResult.success && isDeepStrictEqual2(existingResult.data, config4)) {
|
|
242411
242266
|
return { written: false };
|
|
242412
242267
|
}
|
|
242413
242268
|
}
|
|
242414
|
-
await writeJsonFile(filePath,
|
|
242269
|
+
await writeJsonFile(filePath, config4);
|
|
242415
242270
|
return { written: true };
|
|
242416
242271
|
}
|
|
242417
242272
|
// src/core/resources/auth-config/pull.ts
|
|
@@ -242419,17 +242274,17 @@ async function pullAuthConfig() {
|
|
|
242419
242274
|
return await getAuthConfig();
|
|
242420
242275
|
}
|
|
242421
242276
|
// src/core/resources/auth-config/push.ts
|
|
242422
|
-
async function pushAuthConfig(
|
|
242423
|
-
if (!
|
|
242277
|
+
async function pushAuthConfig(config4) {
|
|
242278
|
+
if (!config4) {
|
|
242424
242279
|
return;
|
|
242425
242280
|
}
|
|
242426
|
-
await pushAuthConfigToApi(
|
|
242281
|
+
await pushAuthConfigToApi(config4);
|
|
242427
242282
|
}
|
|
242428
242283
|
// src/core/resources/auth-config/resource.ts
|
|
242429
242284
|
var authConfigResource = {
|
|
242430
242285
|
readAll: async (dir) => {
|
|
242431
|
-
const
|
|
242432
|
-
return
|
|
242286
|
+
const config4 = await readAuthConfig(dir);
|
|
242287
|
+
return config4 ? [config4] : [];
|
|
242433
242288
|
},
|
|
242434
242289
|
push: async (items) => {
|
|
242435
242290
|
await pushAuthConfig(items[0] ?? null);
|
|
@@ -242669,7 +242524,7 @@ class MissingSSOFieldsError extends InvalidInputError {
|
|
|
242669
242524
|
}
|
|
242670
242525
|
}
|
|
242671
242526
|
function buildSSOSecrets(provider, options) {
|
|
242672
|
-
const
|
|
242527
|
+
const schema3 = SSO_PROVIDER_SCHEMAS[provider];
|
|
242673
242528
|
const secrets = {};
|
|
242674
242529
|
secrets["sso_name" /* Name */] = options.ssoName ?? provider;
|
|
242675
242530
|
secrets["sso_client_id" /* ClientId */] = options.clientId;
|
|
@@ -242680,21 +242535,21 @@ function buildSSOSecrets(provider, options) {
|
|
|
242680
242535
|
secrets[secretKey] = value;
|
|
242681
242536
|
}
|
|
242682
242537
|
}
|
|
242683
|
-
if (
|
|
242684
|
-
const derived =
|
|
242538
|
+
if (schema3.deriveDefaults) {
|
|
242539
|
+
const derived = schema3.deriveDefaults(secrets);
|
|
242685
242540
|
for (const [key, val] of Object.entries(derived)) {
|
|
242686
242541
|
if (!secrets[key]) {
|
|
242687
242542
|
secrets[key] = val;
|
|
242688
242543
|
}
|
|
242689
242544
|
}
|
|
242690
242545
|
}
|
|
242691
|
-
for (const [key, val] of Object.entries(
|
|
242546
|
+
for (const [key, val] of Object.entries(schema3.defaults)) {
|
|
242692
242547
|
if (!secrets[key]) {
|
|
242693
242548
|
secrets[key] = val;
|
|
242694
242549
|
}
|
|
242695
242550
|
}
|
|
242696
242551
|
const missing = [];
|
|
242697
|
-
for (const key of
|
|
242552
|
+
for (const key of schema3.requiredKeys) {
|
|
242698
242553
|
if (!secrets[key]) {
|
|
242699
242554
|
missing.push(key);
|
|
242700
242555
|
}
|
|
@@ -243040,7 +242895,7 @@ async function removeStripe() {
|
|
|
243040
242895
|
return result.data;
|
|
243041
242896
|
}
|
|
243042
242897
|
// src/core/resources/connector/config.ts
|
|
243043
|
-
import { join as
|
|
242898
|
+
import { join as join7 } from "node:path";
|
|
243044
242899
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
243045
242900
|
async function readConnectorFile(connectorPath) {
|
|
243046
242901
|
const parsed = await readJsonFile(connectorPath);
|
|
@@ -243101,7 +242956,7 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
243101
242956
|
if (existing && isDeepStrictEqual3(existing.data, connector)) {
|
|
243102
242957
|
continue;
|
|
243103
242958
|
}
|
|
243104
|
-
const filePath = existing?.filePath ??
|
|
242959
|
+
const filePath = existing?.filePath ?? join7(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
243105
242960
|
await writeJsonFile(filePath, connector);
|
|
243106
242961
|
written.push(connector.type);
|
|
243107
242962
|
}
|
|
@@ -243256,6 +243111,17 @@ var connectorResource = {
|
|
|
243256
243111
|
readAll: readAllConnectors,
|
|
243257
243112
|
push: pushConnectors
|
|
243258
243113
|
};
|
|
243114
|
+
// src/core/resources/types.ts
|
|
243115
|
+
var ResourceSourceSchema = exports_external.discriminatedUnion("type", [
|
|
243116
|
+
exports_external.object({
|
|
243117
|
+
type: exports_external.literal("project")
|
|
243118
|
+
}),
|
|
243119
|
+
exports_external.object({
|
|
243120
|
+
type: exports_external.literal("plugin"),
|
|
243121
|
+
namespace: exports_external.string().min(1, "Plugin namespace cannot be empty")
|
|
243122
|
+
})
|
|
243123
|
+
]);
|
|
243124
|
+
|
|
243259
243125
|
// src/core/resources/entity/schema.ts
|
|
243260
243126
|
var FieldConditionSchema = exports_external.union([
|
|
243261
243127
|
exports_external.string(),
|
|
@@ -243692,7 +243558,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
243692
243558
|
return result.data;
|
|
243693
243559
|
}
|
|
243694
243560
|
// src/core/resources/function/config.ts
|
|
243695
|
-
import { basename as
|
|
243561
|
+
import { basename as basename3, dirname as dirname6, join as join8, relative } from "node:path";
|
|
243696
243562
|
async function readFunctionConfig(configPath) {
|
|
243697
243563
|
const parsed = await readJsonFile(configPath);
|
|
243698
243564
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -243702,9 +243568,9 @@ async function readFunctionConfig(configPath) {
|
|
|
243702
243568
|
return result.data;
|
|
243703
243569
|
}
|
|
243704
243570
|
async function readFunction(configPath) {
|
|
243705
|
-
const
|
|
243706
|
-
const functionDir =
|
|
243707
|
-
const entryPath =
|
|
243571
|
+
const config7 = await readFunctionConfig(configPath);
|
|
243572
|
+
const functionDir = dirname6(configPath);
|
|
243573
|
+
const entryPath = join8(functionDir, config7.entry);
|
|
243708
243574
|
if (!await pathExists(entryPath)) {
|
|
243709
243575
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
243710
243576
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -243715,7 +243581,7 @@ async function readFunction(configPath) {
|
|
|
243715
243581
|
absolute: true
|
|
243716
243582
|
});
|
|
243717
243583
|
const functionData = {
|
|
243718
|
-
...
|
|
243584
|
+
...config7,
|
|
243719
243585
|
entryPath,
|
|
243720
243586
|
filePaths,
|
|
243721
243587
|
source: { type: "project" }
|
|
@@ -243735,16 +243601,16 @@ async function readAllFunctions(functionsDir) {
|
|
|
243735
243601
|
absolute: true,
|
|
243736
243602
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
243737
243603
|
});
|
|
243738
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
243739
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
243604
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname6(f)));
|
|
243605
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname6(entryFile)));
|
|
243740
243606
|
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
243741
243607
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
243742
|
-
const functionDir =
|
|
243608
|
+
const functionDir = dirname6(entryFile);
|
|
243743
243609
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
243744
243610
|
cwd: functionDir,
|
|
243745
243611
|
absolute: true
|
|
243746
243612
|
});
|
|
243747
|
-
const name2 =
|
|
243613
|
+
const name2 = relative(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
243748
243614
|
if (!name2) {
|
|
243749
243615
|
throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
|
|
243750
243616
|
hints: [
|
|
@@ -243754,7 +243620,7 @@ async function readAllFunctions(functionsDir) {
|
|
|
243754
243620
|
]
|
|
243755
243621
|
});
|
|
243756
243622
|
}
|
|
243757
|
-
const entry =
|
|
243623
|
+
const entry = basename3(entryFile);
|
|
243758
243624
|
const functionData = {
|
|
243759
243625
|
name: name2,
|
|
243760
243626
|
entry,
|
|
@@ -243781,17 +243647,17 @@ async function readAllFunctions(functionsDir) {
|
|
|
243781
243647
|
return functions;
|
|
243782
243648
|
}
|
|
243783
243649
|
// src/core/resources/function/deploy.ts
|
|
243784
|
-
import { dirname as
|
|
243650
|
+
import { dirname as dirname7, relative as relative2 } from "node:path";
|
|
243785
243651
|
async function loadFunctionCode(fn) {
|
|
243786
|
-
const functionDir =
|
|
243652
|
+
const functionDir = dirname7(fn.entryPath);
|
|
243787
243653
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
243788
243654
|
const content = await readTextFile(filePath);
|
|
243789
|
-
const path11 =
|
|
243655
|
+
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
243790
243656
|
return { path: path11, content };
|
|
243791
243657
|
}));
|
|
243792
243658
|
return { ...fn, files: resolvedFiles };
|
|
243793
243659
|
}
|
|
243794
|
-
async function
|
|
243660
|
+
async function deployOne(fn) {
|
|
243795
243661
|
const start = Date.now();
|
|
243796
243662
|
try {
|
|
243797
243663
|
const functionWithCode = await loadFunctionCode(fn);
|
|
@@ -243819,7 +243685,7 @@ async function deployFunctionsSequentially(functions, options) {
|
|
|
243819
243685
|
const results = [];
|
|
243820
243686
|
for (const fn of functions) {
|
|
243821
243687
|
options?.onStart?.([fn.name]);
|
|
243822
|
-
const result = await
|
|
243688
|
+
const result = await deployOne(fn);
|
|
243823
243689
|
results.push(result);
|
|
243824
243690
|
options?.onResult?.(result);
|
|
243825
243691
|
}
|
|
@@ -243850,28 +243716,28 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
243850
243716
|
return results;
|
|
243851
243717
|
}
|
|
243852
243718
|
// src/core/resources/function/pull.ts
|
|
243853
|
-
import { join as
|
|
243719
|
+
import { join as join9 } from "node:path";
|
|
243854
243720
|
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
243855
243721
|
async function writeFunctions(functionsDir, functions) {
|
|
243856
243722
|
const written = [];
|
|
243857
243723
|
const skipped = [];
|
|
243858
243724
|
for (const fn of functions) {
|
|
243859
|
-
const functionDir =
|
|
243860
|
-
const configPath =
|
|
243725
|
+
const functionDir = join9(functionsDir, fn.name);
|
|
243726
|
+
const configPath = join9(functionDir, "function.jsonc");
|
|
243861
243727
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
243862
243728
|
skipped.push(fn.name);
|
|
243863
243729
|
continue;
|
|
243864
243730
|
}
|
|
243865
|
-
const
|
|
243731
|
+
const config7 = {
|
|
243866
243732
|
name: fn.name,
|
|
243867
243733
|
entry: fn.entry
|
|
243868
243734
|
};
|
|
243869
243735
|
if (fn.automations.length > 0) {
|
|
243870
|
-
|
|
243736
|
+
config7.automations = fn.automations;
|
|
243871
243737
|
}
|
|
243872
|
-
await writeJsonFile(configPath,
|
|
243738
|
+
await writeJsonFile(configPath, config7);
|
|
243873
243739
|
for (const file2 of fn.files) {
|
|
243874
|
-
await writeFile(
|
|
243740
|
+
await writeFile(join9(functionDir, file2.path), file2.content);
|
|
243875
243741
|
}
|
|
243876
243742
|
written.push(fn.name);
|
|
243877
243743
|
}
|
|
@@ -243881,7 +243747,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243881
243747
|
if (!await pathExists(functionDir)) {
|
|
243882
243748
|
return false;
|
|
243883
243749
|
}
|
|
243884
|
-
const configPath =
|
|
243750
|
+
const configPath = join9(functionDir, "function.jsonc");
|
|
243885
243751
|
try {
|
|
243886
243752
|
const localConfig = await readJsonFile(configPath);
|
|
243887
243753
|
if (localConfig.entry !== fn.entry) {
|
|
@@ -243894,7 +243760,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243894
243760
|
return false;
|
|
243895
243761
|
}
|
|
243896
243762
|
for (const file2 of fn.files) {
|
|
243897
|
-
const filePath =
|
|
243763
|
+
const filePath = join9(functionDir, file2.path);
|
|
243898
243764
|
if (!await pathExists(filePath)) {
|
|
243899
243765
|
return false;
|
|
243900
243766
|
}
|
|
@@ -243933,7 +243799,6 @@ class ProjectConfigReader {
|
|
|
243933
243799
|
project: { ...project, root, configPath },
|
|
243934
243800
|
entities,
|
|
243935
243801
|
functions,
|
|
243936
|
-
actors: localResources.actors,
|
|
243937
243802
|
agents: localResources.agents,
|
|
243938
243803
|
connectors: localResources.connectors,
|
|
243939
243804
|
authConfig: localResources.authConfig
|
|
@@ -243961,23 +243826,15 @@ class ProjectConfigReader {
|
|
|
243961
243826
|
return result.data;
|
|
243962
243827
|
}
|
|
243963
243828
|
async readProjectResources(configPath, project) {
|
|
243964
|
-
const configDir =
|
|
243965
|
-
const [entities, functions,
|
|
243966
|
-
entityResource.readAll(
|
|
243967
|
-
functionResource.readAll(
|
|
243968
|
-
|
|
243969
|
-
|
|
243970
|
-
|
|
243971
|
-
authConfigResource.readAll(join11(configDir, project.authDir))
|
|
243829
|
+
const configDir = dirname8(configPath);
|
|
243830
|
+
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243831
|
+
entityResource.readAll(join10(configDir, project.entitiesDir)),
|
|
243832
|
+
functionResource.readAll(join10(configDir, project.functionsDir)),
|
|
243833
|
+
agentResource.readAll(join10(configDir, project.agentsDir)),
|
|
243834
|
+
connectorResource.readAll(join10(configDir, project.connectorsDir)),
|
|
243835
|
+
authConfigResource.readAll(join10(configDir, project.authDir))
|
|
243972
243836
|
]);
|
|
243973
|
-
return {
|
|
243974
|
-
entities,
|
|
243975
|
-
functions,
|
|
243976
|
-
actors,
|
|
243977
|
-
agents,
|
|
243978
|
-
connectors,
|
|
243979
|
-
authConfig
|
|
243980
|
-
};
|
|
243837
|
+
return { entities, functions, agents, connectors, authConfig };
|
|
243981
243838
|
}
|
|
243982
243839
|
assertPluginProjectDoesNotLoadPlugins(project, configPath) {
|
|
243983
243840
|
if (project.plugin && project.plugins.length > 0) {
|
|
@@ -243998,7 +243855,7 @@ class ProjectConfigReader {
|
|
|
243998
243855
|
this.pluginSourceByNamespace.set(namespace, source);
|
|
243999
243856
|
}
|
|
244000
243857
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
244001
|
-
const pluginRoot = resolvePluginRoot(plugin.source,
|
|
243858
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname8(hostConfigPath));
|
|
244002
243859
|
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
244003
243860
|
const project = await this.readConfigFile(configPath);
|
|
244004
243861
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
@@ -244010,7 +243867,6 @@ class ProjectConfigReader {
|
|
|
244010
243867
|
return {
|
|
244011
243868
|
entities: markPluginEntities(resources.entities, namespace),
|
|
244012
243869
|
functions: namespacePluginFunctions(resources.functions, namespace),
|
|
244013
|
-
actors: [],
|
|
244014
243870
|
agents: [],
|
|
244015
243871
|
connectors: [],
|
|
244016
243872
|
authConfig: []
|
|
@@ -244048,7 +243904,6 @@ class ProjectConfigReader {
|
|
|
244048
243904
|
return {
|
|
244049
243905
|
entities,
|
|
244050
243906
|
functions,
|
|
244051
|
-
actors: [],
|
|
244052
243907
|
agents: [],
|
|
244053
243908
|
connectors: [],
|
|
244054
243909
|
authConfig: []
|
|
@@ -244078,12 +243933,12 @@ async function readProjectConfig(projectRoot) {
|
|
|
244078
243933
|
// src/core/project/template.ts
|
|
244079
243934
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
244080
243935
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
244081
|
-
import { dirname as
|
|
243936
|
+
import { dirname as dirname9, join as join12 } from "node:path";
|
|
244082
243937
|
|
|
244083
243938
|
// src/core/assets.ts
|
|
244084
243939
|
import { cpSync, existsSync } from "node:fs";
|
|
244085
243940
|
import { homedir as homedir2 } from "node:os";
|
|
244086
|
-
import { join as
|
|
243941
|
+
import { join as join11 } from "node:path";
|
|
244087
243942
|
// package.json
|
|
244088
243943
|
var package_default = {
|
|
244089
243944
|
name: "base44",
|
|
@@ -244184,18 +244039,18 @@ var package_default = {
|
|
|
244184
244039
|
};
|
|
244185
244040
|
|
|
244186
244041
|
// src/core/assets.ts
|
|
244187
|
-
var ASSETS_DIR =
|
|
244042
|
+
var ASSETS_DIR = join11(homedir2(), ".base44", "assets", package_default.version);
|
|
244188
244043
|
function getTemplatesDir() {
|
|
244189
|
-
return
|
|
244044
|
+
return join11(ASSETS_DIR, "templates");
|
|
244190
244045
|
}
|
|
244191
244046
|
function getTemplatesIndexPath() {
|
|
244192
|
-
return
|
|
244047
|
+
return join11(ASSETS_DIR, "templates", "templates.json");
|
|
244193
244048
|
}
|
|
244194
244049
|
function getDenoWrapperPath() {
|
|
244195
|
-
return
|
|
244050
|
+
return join11(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
244196
244051
|
}
|
|
244197
244052
|
function getExecWrapperPath() {
|
|
244198
|
-
return
|
|
244053
|
+
return join11(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
244199
244054
|
}
|
|
244200
244055
|
function ensureNpmAssets(sourceDir) {
|
|
244201
244056
|
if (existsSync(ASSETS_DIR))
|
|
@@ -244217,7 +244072,7 @@ async function listTemplates() {
|
|
|
244217
244072
|
}
|
|
244218
244073
|
async function renderTemplate(template, destPath, data, options = {}) {
|
|
244219
244074
|
const { skipExisting = false } = options;
|
|
244220
|
-
const templateDir =
|
|
244075
|
+
const templateDir = join12(getTemplatesDir(), template.path);
|
|
244221
244076
|
const files = await globby("**/*", {
|
|
244222
244077
|
cwd: templateDir,
|
|
244223
244078
|
dot: true,
|
|
@@ -244225,20 +244080,20 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
244225
244080
|
});
|
|
244226
244081
|
const skipped = [];
|
|
244227
244082
|
for (const file2 of files) {
|
|
244228
|
-
const srcPath =
|
|
244083
|
+
const srcPath = join12(templateDir, file2);
|
|
244229
244084
|
try {
|
|
244230
244085
|
if (file2.endsWith(".ejs")) {
|
|
244231
244086
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
244232
244087
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
244233
|
-
const destFile = attributes.outputFileName ?
|
|
244234
|
-
const destFilePath =
|
|
244088
|
+
const destFile = attributes.outputFileName ? join12(dirname9(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
244089
|
+
const destFilePath = join12(destPath, destFile);
|
|
244235
244090
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
244236
244091
|
skipped.push(destFile);
|
|
244237
244092
|
continue;
|
|
244238
244093
|
}
|
|
244239
244094
|
await writeFile(destFilePath, body);
|
|
244240
244095
|
} else {
|
|
244241
|
-
const destFilePath =
|
|
244096
|
+
const destFilePath = join12(destPath, file2);
|
|
244242
244097
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
244243
244098
|
skipped.push(file2);
|
|
244244
244099
|
continue;
|
|
@@ -244332,7 +244187,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
244332
244187
|
// src/core/site/deploy.ts
|
|
244333
244188
|
import { randomUUID } from "node:crypto";
|
|
244334
244189
|
import { tmpdir } from "node:os";
|
|
244335
|
-
import { join as
|
|
244190
|
+
import { join as join13 } from "node:path";
|
|
244336
244191
|
async function deploySite(siteOutputDir) {
|
|
244337
244192
|
if (!await pathExists(siteOutputDir)) {
|
|
244338
244193
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -244349,7 +244204,7 @@ async function deploySite(siteOutputDir) {
|
|
|
244349
244204
|
]
|
|
244350
244205
|
});
|
|
244351
244206
|
}
|
|
244352
|
-
const archivePath =
|
|
244207
|
+
const archivePath = join13(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
244353
244208
|
try {
|
|
244354
244209
|
await createArchive(siteOutputDir, archivePath);
|
|
244355
244210
|
return await uploadSite(archivePath);
|
|
@@ -244366,43 +244221,26 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
244366
244221
|
}
|
|
244367
244222
|
// src/core/project/deploy.ts
|
|
244368
244223
|
function hasResourcesToDeploy(projectData) {
|
|
244369
|
-
const {
|
|
244370
|
-
project,
|
|
244371
|
-
entities,
|
|
244372
|
-
functions,
|
|
244373
|
-
actors,
|
|
244374
|
-
agents,
|
|
244375
|
-
connectors,
|
|
244376
|
-
authConfig
|
|
244377
|
-
} = projectData;
|
|
244224
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244378
244225
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
244379
244226
|
const hasEntities = entities.length > 0;
|
|
244380
244227
|
const hasFunctions = functions.length > 0;
|
|
244381
|
-
const hasActors = actors.length > 0;
|
|
244382
244228
|
const hasAgents = agents.length > 0;
|
|
244383
244229
|
const hasConnectors = connectors.length > 0;
|
|
244384
244230
|
const hasAuthConfig = authConfig.length > 0;
|
|
244385
|
-
return hasEntities || hasFunctions ||
|
|
244231
|
+
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
|
|
244386
244232
|
}
|
|
244387
244233
|
async function deployAll(projectData, options) {
|
|
244388
|
-
const {
|
|
244389
|
-
project,
|
|
244390
|
-
entities,
|
|
244391
|
-
functions,
|
|
244392
|
-
actors,
|
|
244393
|
-
agents,
|
|
244394
|
-
connectors,
|
|
244395
|
-
authConfig
|
|
244396
|
-
} = projectData;
|
|
244234
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244397
244235
|
await entityResource.push(entities);
|
|
244398
244236
|
await deployFunctionsSequentially(functions, {
|
|
244399
244237
|
onStart: options?.onFunctionStart,
|
|
244400
244238
|
onResult: options?.onFunctionResult
|
|
244401
244239
|
});
|
|
244402
|
-
await deployActorsSequentially(actors);
|
|
244403
244240
|
await agentResource.push(agents);
|
|
244404
244241
|
await authConfigResource.push(authConfig);
|
|
244405
|
-
const
|
|
244242
|
+
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
244243
|
+
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
244406
244244
|
if (project.site?.outputDirectory) {
|
|
244407
244245
|
const outputDir = resolve2(project.root, project.site.outputDirectory);
|
|
244408
244246
|
const { appUrl } = await deploySite(outputDir);
|
|
@@ -244426,6 +244264,9 @@ async function handleUnauthorized(request, _options, response) {
|
|
|
244426
244264
|
if (response.status !== 401) {
|
|
244427
244265
|
return;
|
|
244428
244266
|
}
|
|
244267
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
244268
|
+
return;
|
|
244269
|
+
}
|
|
244429
244270
|
if (retriedRequests.has(request)) {
|
|
244430
244271
|
return;
|
|
244431
244272
|
}
|
|
@@ -244454,6 +244295,11 @@ var base44Client = distribution_default.create({
|
|
|
244454
244295
|
},
|
|
244455
244296
|
captureRequestBody,
|
|
244456
244297
|
async (request) => {
|
|
244298
|
+
const workspaceApiKey = getWorkspaceApiKeyFromEnv();
|
|
244299
|
+
if (workspaceApiKey && isWorkspaceApiKey(workspaceApiKey)) {
|
|
244300
|
+
request.headers.set("api_key", workspaceApiKey);
|
|
244301
|
+
return;
|
|
244302
|
+
}
|
|
244457
244303
|
try {
|
|
244458
244304
|
const auth = await readAuth();
|
|
244459
244305
|
if (isTokenExpired(auth)) {
|
|
@@ -244659,6 +244505,12 @@ async function login({
|
|
|
244659
244505
|
|
|
244660
244506
|
// src/cli/utils/command/middleware.ts
|
|
244661
244507
|
async function ensureAuth(ctx) {
|
|
244508
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
244509
|
+
ctx.errorReporter.setContext({
|
|
244510
|
+
user: { email: "workspace-api-key", name: "Workspace API key" }
|
|
244511
|
+
});
|
|
244512
|
+
return;
|
|
244513
|
+
}
|
|
244662
244514
|
await seedAuthFromEnv();
|
|
244663
244515
|
const loggedIn = await isLoggedIn();
|
|
244664
244516
|
if (!loggedIn) {
|
|
@@ -251409,6 +251261,16 @@ class Base44Command extends Command {
|
|
|
251409
251261
|
});
|
|
251410
251262
|
}
|
|
251411
251263
|
}
|
|
251264
|
+
// src/cli/errors.ts
|
|
251265
|
+
class CLIExitError extends Error {
|
|
251266
|
+
code;
|
|
251267
|
+
constructor(code2) {
|
|
251268
|
+
super(`CLI exited with code ${code2}`);
|
|
251269
|
+
this.code = code2;
|
|
251270
|
+
this.name = "CLIExitError";
|
|
251271
|
+
}
|
|
251272
|
+
}
|
|
251273
|
+
|
|
251412
251274
|
// src/cli/utils/prompts.ts
|
|
251413
251275
|
var onPromptCancel = () => {
|
|
251414
251276
|
Ne("Operation cancelled.");
|
|
@@ -251580,136 +251442,14 @@ function verifyDenoInstalled(context) {
|
|
|
251580
251442
|
});
|
|
251581
251443
|
}
|
|
251582
251444
|
}
|
|
251583
|
-
// src/cli/commands/actor/deploy.ts
|
|
251584
|
-
function parseNames(args) {
|
|
251585
|
-
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
251586
|
-
}
|
|
251587
|
-
function resolveActorsToDeploy(names, allActors) {
|
|
251588
|
-
if (names.length === 0)
|
|
251589
|
-
return allActors;
|
|
251590
|
-
const notFound = names.filter((n2) => !allActors.some((a2) => a2.name === n2));
|
|
251591
|
-
if (notFound.length > 0) {
|
|
251592
|
-
throw new InvalidInputError(`Actor${notFound.length > 1 ? "s" : ""} not found in project: ${notFound.join(", ")}`);
|
|
251593
|
-
}
|
|
251594
|
-
return allActors.filter((a2) => names.includes(a2.name));
|
|
251595
|
-
}
|
|
251596
|
-
function formatDeployResult(result, log) {
|
|
251597
|
-
const label = result.name.padEnd(25);
|
|
251598
|
-
if (result.status === "deployed") {
|
|
251599
|
-
const timing = result.durationMs ? theme.styles.dim(` (${(result.durationMs / 1000).toFixed(1)}s)`) : "";
|
|
251600
|
-
log.success(`${label} deployed${timing}`);
|
|
251601
|
-
} else if (result.status === "unchanged") {
|
|
251602
|
-
log.success(`${label} unchanged`);
|
|
251603
|
-
} else {
|
|
251604
|
-
log.error(`${label} error: ${result.error}`);
|
|
251605
|
-
}
|
|
251606
|
-
}
|
|
251607
|
-
function buildDeploySummary(results) {
|
|
251608
|
-
const deployed = results.filter((r) => r.status === "deployed").length;
|
|
251609
|
-
const unchanged = results.filter((r) => r.status === "unchanged").length;
|
|
251610
|
-
const failed = results.filter((r) => r.status === "error").length;
|
|
251611
|
-
const parts = [];
|
|
251612
|
-
if (deployed > 0)
|
|
251613
|
-
parts.push(`${deployed} deployed`);
|
|
251614
|
-
if (unchanged > 0)
|
|
251615
|
-
parts.push(`${unchanged} unchanged`);
|
|
251616
|
-
if (failed > 0)
|
|
251617
|
-
parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
|
|
251618
|
-
return parts.join(", ") || "No actors deployed";
|
|
251619
|
-
}
|
|
251620
|
-
async function deployActorAction({ log }, names) {
|
|
251621
|
-
const { actors } = await readProjectConfig();
|
|
251622
|
-
const toDeploy = resolveActorsToDeploy(names, actors);
|
|
251623
|
-
if (toDeploy.length === 0) {
|
|
251624
|
-
return {
|
|
251625
|
-
outroMessage: "No actors found. Create actors in the 'actors' directory."
|
|
251626
|
-
};
|
|
251627
|
-
}
|
|
251628
|
-
log.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "actor" : "actors"} to deploy`);
|
|
251629
|
-
let completed = 0;
|
|
251630
|
-
const total = toDeploy.length;
|
|
251631
|
-
const results = await deployActorsSequentially(toDeploy, {
|
|
251632
|
-
onStart: (startNames) => {
|
|
251633
|
-
const label = startNames.length === 1 ? startNames[0] : `${startNames.length} actors`;
|
|
251634
|
-
log.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
|
|
251635
|
-
},
|
|
251636
|
-
onResult: (result) => {
|
|
251637
|
-
completed++;
|
|
251638
|
-
formatDeployResult(result, log);
|
|
251639
|
-
}
|
|
251640
|
-
});
|
|
251641
|
-
const hasFailures = results.some((r) => r.status === "error");
|
|
251642
|
-
if (hasFailures) {
|
|
251643
|
-
log.message(buildDeploySummary(results));
|
|
251644
|
-
throw new CLIExitError(1);
|
|
251645
|
-
}
|
|
251646
|
-
return { outroMessage: buildDeploySummary(results) };
|
|
251647
|
-
}
|
|
251648
|
-
function getDeployCommand() {
|
|
251649
|
-
return new Base44Command("deploy").description("Deploy actors to Base44").argument("[names...]", "Actor names to deploy (deploys all if omitted)").action(async (ctx, rawNames) => {
|
|
251650
|
-
const names = parseNames(rawNames);
|
|
251651
|
-
return deployActorAction(ctx, names);
|
|
251652
|
-
});
|
|
251653
|
-
}
|
|
251654
|
-
|
|
251655
|
-
// src/cli/commands/actor/new.ts
|
|
251656
|
-
import { dirname as dirname12, join as join15 } from "node:path";
|
|
251657
|
-
function buildActorScaffold(actorName) {
|
|
251658
|
-
return `import { Actor, type Conn } from "@base44/sdk";
|
|
251659
|
-
|
|
251660
|
-
interface State {
|
|
251661
|
-
// shared state broadcast to all clients
|
|
251662
|
-
}
|
|
251663
|
-
|
|
251664
|
-
interface Message {
|
|
251665
|
-
// messages sent from clients
|
|
251666
|
-
}
|
|
251667
|
-
|
|
251668
|
-
export class ${actorName} extends Actor<State, Message> {
|
|
251669
|
-
handleConnect(conn: Conn) {
|
|
251670
|
-
console.log("Connected:", conn.userId);
|
|
251671
|
-
}
|
|
251672
|
-
handleMessage(conn: Conn, msg: Message) {
|
|
251673
|
-
console.log("Message:", msg);
|
|
251674
|
-
}
|
|
251675
|
-
handleTick() {}
|
|
251676
|
-
handleClose(conn: Conn) {}
|
|
251677
|
-
}
|
|
251678
|
-
`;
|
|
251679
|
-
}
|
|
251680
|
-
async function newActorAction(_ctx, actorName) {
|
|
251681
|
-
const { project: project2 } = await readProjectConfig();
|
|
251682
|
-
const actorsDir = join15(dirname12(project2.configPath), project2.actorsDir);
|
|
251683
|
-
const actorDir = join15(actorsDir, actorName);
|
|
251684
|
-
if (await pathExists(actorDir)) {
|
|
251685
|
-
throw new InvalidInputError(`Actor "${actorName}" already exists at ${actorDir}`);
|
|
251686
|
-
}
|
|
251687
|
-
const entryPath = join15(actorDir, "entry.ts");
|
|
251688
|
-
await writeFile(entryPath, buildActorScaffold(actorName));
|
|
251689
|
-
return {
|
|
251690
|
-
outroMessage: `Created actor "${actorName}" at ${entryPath}`
|
|
251691
|
-
};
|
|
251692
|
-
}
|
|
251693
|
-
function getNewCommand() {
|
|
251694
|
-
return new Base44Command("new").description("Create a new actor scaffold").argument("<ActorName>", "Name of the actor class").action(async (ctx, actorName) => {
|
|
251695
|
-
return newActorAction(ctx, actorName);
|
|
251696
|
-
});
|
|
251697
|
-
}
|
|
251698
|
-
|
|
251699
|
-
// src/cli/commands/actor/index.ts
|
|
251700
|
-
function getActorCommand() {
|
|
251701
|
-
return new Command("actor").description("Manage actors").addCommand(getNewCommand()).addCommand(getDeployCommand());
|
|
251702
|
-
}
|
|
251703
|
-
|
|
251704
251445
|
// src/cli/commands/agents/pull.ts
|
|
251705
|
-
import { dirname as dirname13, join as join16 } from "node:path";
|
|
251706
251446
|
async function pullAgentsAction({
|
|
251707
251447
|
log,
|
|
251708
251448
|
runTask: runTask2
|
|
251709
251449
|
}) {
|
|
251710
251450
|
const { project: project2 } = await readProjectConfig();
|
|
251711
|
-
const configDir =
|
|
251712
|
-
const agentsDir =
|
|
251451
|
+
const configDir = dirname10(project2.configPath);
|
|
251452
|
+
const agentsDir = join14(configDir, project2.agentsDir);
|
|
251713
251453
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
251714
251454
|
return await fetchAgents();
|
|
251715
251455
|
}, {
|
|
@@ -251773,12 +251513,12 @@ function getAgentsCommand() {
|
|
|
251773
251513
|
}
|
|
251774
251514
|
|
|
251775
251515
|
// src/cli/commands/auth/password-login.ts
|
|
251776
|
-
import { dirname as
|
|
251516
|
+
import { dirname as dirname11, join as join15 } from "node:path";
|
|
251777
251517
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
251778
251518
|
const shouldEnable = action === "enable";
|
|
251779
251519
|
const { project: project2 } = await readProjectConfig();
|
|
251780
|
-
const configDir =
|
|
251781
|
-
const authDir =
|
|
251520
|
+
const configDir = dirname11(project2.configPath);
|
|
251521
|
+
const authDir = join15(configDir, project2.authDir);
|
|
251782
251522
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
251783
251523
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
251784
251524
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -251798,14 +251538,14 @@ function getPasswordLoginCommand() {
|
|
|
251798
251538
|
}
|
|
251799
251539
|
|
|
251800
251540
|
// src/cli/commands/auth/pull.ts
|
|
251801
|
-
import { dirname as
|
|
251541
|
+
import { dirname as dirname12, join as join16 } from "node:path";
|
|
251802
251542
|
async function pullAuthAction({
|
|
251803
251543
|
log,
|
|
251804
251544
|
runTask: runTask2
|
|
251805
251545
|
}) {
|
|
251806
251546
|
const { project: project2 } = await readProjectConfig();
|
|
251807
|
-
const configDir =
|
|
251808
|
-
const authDir =
|
|
251547
|
+
const configDir = dirname12(project2.configPath);
|
|
251548
|
+
const authDir = join16(configDir, project2.authDir);
|
|
251809
251549
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
251810
251550
|
return await pullAuthConfig();
|
|
251811
251551
|
}, {
|
|
@@ -251869,7 +251609,7 @@ function getAuthPushCommand() {
|
|
|
251869
251609
|
}
|
|
251870
251610
|
|
|
251871
251611
|
// src/cli/commands/auth/social-login.ts
|
|
251872
|
-
import { dirname as
|
|
251612
|
+
import { dirname as dirname13, join as join17, resolve as resolve3 } from "node:path";
|
|
251873
251613
|
var PROVIDER_LABELS = {
|
|
251874
251614
|
google: "Google",
|
|
251875
251615
|
microsoft: "Microsoft",
|
|
@@ -251939,8 +251679,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251939
251679
|
}
|
|
251940
251680
|
}
|
|
251941
251681
|
const { project: project2 } = await readProjectConfig();
|
|
251942
|
-
const configDir =
|
|
251943
|
-
const authDir =
|
|
251682
|
+
const configDir = dirname13(project2.configPath);
|
|
251683
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251944
251684
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251945
251685
|
if (clientSecret) {
|
|
251946
251686
|
await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -251965,7 +251705,7 @@ function getSocialLoginCommand() {
|
|
|
251965
251705
|
}
|
|
251966
251706
|
|
|
251967
251707
|
// src/cli/commands/auth/sso.ts
|
|
251968
|
-
import { dirname as
|
|
251708
|
+
import { dirname as dirname14, join as join18, resolve as resolve4 } from "node:path";
|
|
251969
251709
|
var SSOConfigFileSchema = exports_external.object({
|
|
251970
251710
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251971
251711
|
clientId: exports_external.string(),
|
|
@@ -252128,8 +251868,8 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
252128
251868
|
throw error48;
|
|
252129
251869
|
}
|
|
252130
251870
|
const { project: project2 } = await readProjectConfig();
|
|
252131
|
-
const configDir =
|
|
252132
|
-
const authDir =
|
|
251871
|
+
const configDir = dirname14(project2.configPath);
|
|
251872
|
+
const authDir = join18(configDir, project2.authDir);
|
|
252133
251873
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
252134
251874
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
252135
251875
|
return {
|
|
@@ -252144,8 +251884,8 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
252144
251884
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
252145
251885
|
}
|
|
252146
251886
|
const { project: project2 } = await readProjectConfig();
|
|
252147
|
-
const configDir =
|
|
252148
|
-
const authDir =
|
|
251887
|
+
const configDir = dirname14(project2.configPath);
|
|
251888
|
+
const authDir = join18(configDir, project2.authDir);
|
|
252149
251889
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
252150
251890
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
252151
251891
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -252195,6 +251935,12 @@ function getLogoutCommand() {
|
|
|
252195
251935
|
|
|
252196
251936
|
// src/cli/commands/auth/whoami.ts
|
|
252197
251937
|
async function whoami(_ctx) {
|
|
251938
|
+
const workspaceApiKey = getWorkspaceApiKeyFromEnv();
|
|
251939
|
+
if (workspaceApiKey && isWorkspaceApiKey(workspaceApiKey)) {
|
|
251940
|
+
return {
|
|
251941
|
+
outroMessage: `Using workspace API key: ${theme.styles.bold(workspaceApiKey.slice(0, 10))}`
|
|
251942
|
+
};
|
|
251943
|
+
}
|
|
252198
251944
|
const auth2 = await readAuth();
|
|
252199
251945
|
return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
|
|
252200
251946
|
}
|
|
@@ -252996,13 +252742,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
252996
252742
|
}
|
|
252997
252743
|
|
|
252998
252744
|
// src/cli/commands/connectors/pull.ts
|
|
252999
|
-
import { dirname as
|
|
252745
|
+
import { dirname as dirname15, join as join19, resolve as resolve5 } from "node:path";
|
|
253000
252746
|
async function resolveConnectorsDir(options) {
|
|
253001
252747
|
if (!getAppContext().projectRoot) {
|
|
253002
252748
|
return resolve5(options.dir ?? "connectors");
|
|
253003
252749
|
}
|
|
253004
252750
|
const { project: project2 } = await readProjectConfig();
|
|
253005
|
-
return
|
|
252751
|
+
return join19(dirname15(project2.configPath), project2.connectorsDir);
|
|
253006
252752
|
}
|
|
253007
252753
|
async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
|
|
253008
252754
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -253242,18 +252988,18 @@ async function deleteFunctionsAction({ runTask: runTask2 }, names) {
|
|
|
253242
252988
|
parts.push(`${errors5} error${errors5 !== 1 ? "s" : ""}`);
|
|
253243
252989
|
return { outroMessage: parts.join(", ") };
|
|
253244
252990
|
}
|
|
253245
|
-
function
|
|
252991
|
+
function parseNames(args) {
|
|
253246
252992
|
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
253247
252993
|
}
|
|
253248
252994
|
function validateNames(command2) {
|
|
253249
|
-
const names =
|
|
252995
|
+
const names = parseNames(command2.args);
|
|
253250
252996
|
if (names.length === 0) {
|
|
253251
252997
|
command2.error("At least one function name is required");
|
|
253252
252998
|
}
|
|
253253
252999
|
}
|
|
253254
253000
|
function getDeleteCommand() {
|
|
253255
253001
|
return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (ctx, rawNames) => {
|
|
253256
|
-
const names =
|
|
253002
|
+
const names = parseNames(rawNames);
|
|
253257
253003
|
return deleteFunctionsAction(ctx, names);
|
|
253258
253004
|
});
|
|
253259
253005
|
}
|
|
@@ -253262,7 +253008,7 @@ function getDeleteCommand() {
|
|
|
253262
253008
|
function formatDuration(ms) {
|
|
253263
253009
|
return `${(ms / 1000).toFixed(1)}s`;
|
|
253264
253010
|
}
|
|
253265
|
-
function
|
|
253011
|
+
function formatDeployResult(result, log) {
|
|
253266
253012
|
const label = result.name.padEnd(25);
|
|
253267
253013
|
if (result.status === "deployed") {
|
|
253268
253014
|
const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
|
|
@@ -253275,7 +253021,7 @@ function formatDeployResult2(result, log) {
|
|
|
253275
253021
|
}
|
|
253276
253022
|
|
|
253277
253023
|
// src/cli/commands/functions/parseNames.ts
|
|
253278
|
-
function
|
|
253024
|
+
function parseNames2(args) {
|
|
253279
253025
|
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
253280
253026
|
}
|
|
253281
253027
|
|
|
@@ -253302,7 +253048,7 @@ function formatPruneSummary(pruneResults, log) {
|
|
|
253302
253048
|
log.info(`${pruned} deleted`);
|
|
253303
253049
|
}
|
|
253304
253050
|
}
|
|
253305
|
-
function
|
|
253051
|
+
function buildDeploySummary(results) {
|
|
253306
253052
|
const deployed = results.filter((r) => r.status === "deployed").length;
|
|
253307
253053
|
const unchanged = results.filter((r) => r.status === "unchanged").length;
|
|
253308
253054
|
const failed = results.filter((r) => r.status === "error").length;
|
|
@@ -253336,12 +253082,12 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
253336
253082
|
},
|
|
253337
253083
|
onResult: (result) => {
|
|
253338
253084
|
completed++;
|
|
253339
|
-
|
|
253085
|
+
formatDeployResult(result, log);
|
|
253340
253086
|
}
|
|
253341
253087
|
});
|
|
253342
253088
|
const hasFailures = results.some((r) => r.status === "error");
|
|
253343
253089
|
if (hasFailures) {
|
|
253344
|
-
log.message(
|
|
253090
|
+
log.message(buildDeploySummary(results));
|
|
253345
253091
|
throw new CLIExitError(1);
|
|
253346
253092
|
}
|
|
253347
253093
|
if (options.force) {
|
|
@@ -253363,11 +253109,11 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
253363
253109
|
});
|
|
253364
253110
|
formatPruneSummary(pruneResults, log);
|
|
253365
253111
|
}
|
|
253366
|
-
return { outroMessage:
|
|
253112
|
+
return { outroMessage: buildDeploySummary(results) };
|
|
253367
253113
|
}
|
|
253368
|
-
function
|
|
253114
|
+
function getDeployCommand() {
|
|
253369
253115
|
return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (ctx, rawNames, options) => {
|
|
253370
|
-
const names =
|
|
253116
|
+
const names = parseNames2(rawNames);
|
|
253371
253117
|
return deployFunctionsAction(ctx, names, options);
|
|
253372
253118
|
});
|
|
253373
253119
|
}
|
|
@@ -253395,11 +253141,11 @@ function getListCommand() {
|
|
|
253395
253141
|
}
|
|
253396
253142
|
|
|
253397
253143
|
// src/cli/commands/functions/pull.ts
|
|
253398
|
-
import { dirname as
|
|
253144
|
+
import { dirname as dirname16, join as join20 } from "node:path";
|
|
253399
253145
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
253400
253146
|
const { project: project2, functions } = await readProjectConfig();
|
|
253401
|
-
const configDir =
|
|
253402
|
-
const functionsDir =
|
|
253147
|
+
const configDir = dirname16(project2.configPath);
|
|
253148
|
+
const functionsDir = join20(configDir, project2.functionsDir);
|
|
253403
253149
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
253404
253150
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
253405
253151
|
const { functions: functions2 } = await listDeployedFunctions();
|
|
@@ -253454,15 +253200,15 @@ function getPullCommand() {
|
|
|
253454
253200
|
|
|
253455
253201
|
// src/cli/commands/functions/index.ts
|
|
253456
253202
|
function getFunctionsCommand() {
|
|
253457
|
-
return new Command("functions").description("Manage backend functions").addCommand(
|
|
253203
|
+
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand()).addCommand(getDeleteCommand()).addCommand(getListCommand()).addCommand(getPullCommand());
|
|
253458
253204
|
}
|
|
253459
253205
|
|
|
253460
253206
|
// src/cli/commands/project/create.ts
|
|
253461
|
-
import { basename as
|
|
253207
|
+
import { basename as basename4, resolve as resolve7 } from "node:path";
|
|
253462
253208
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
253463
253209
|
|
|
253464
253210
|
// src/cli/commands/project/scaffold-shared.ts
|
|
253465
|
-
import { join as
|
|
253211
|
+
import { join as join21 } from "node:path";
|
|
253466
253212
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
253467
253213
|
async function getTemplateById(templateId) {
|
|
253468
253214
|
const templates = await listTemplates();
|
|
@@ -253479,7 +253225,7 @@ async function completeProjectSetup({
|
|
|
253479
253225
|
projectId,
|
|
253480
253226
|
name: name2,
|
|
253481
253227
|
resolvedPath,
|
|
253482
|
-
deploy:
|
|
253228
|
+
deploy: deploy5,
|
|
253483
253229
|
skills,
|
|
253484
253230
|
isInteractive
|
|
253485
253231
|
}, { runTask: runTask2 }) {
|
|
@@ -253493,7 +253239,7 @@ async function completeProjectSetup({
|
|
|
253493
253239
|
});
|
|
253494
253240
|
shouldPushEntities = !Ct(result) && result;
|
|
253495
253241
|
} else {
|
|
253496
|
-
shouldPushEntities = !!
|
|
253242
|
+
shouldPushEntities = !!deploy5;
|
|
253497
253243
|
}
|
|
253498
253244
|
if (shouldPushEntities) {
|
|
253499
253245
|
await runTask2(`Pushing ${entities.length} data models to Base44...`, async () => {
|
|
@@ -253513,7 +253259,7 @@ async function completeProjectSetup({
|
|
|
253513
253259
|
});
|
|
253514
253260
|
shouldDeploy = !Ct(result) && result;
|
|
253515
253261
|
} else {
|
|
253516
|
-
shouldDeploy = !!
|
|
253262
|
+
shouldDeploy = !!deploy5;
|
|
253517
253263
|
}
|
|
253518
253264
|
if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
|
|
253519
253265
|
const { appUrl } = await runTask2("Installing dependencies...", async (updateMessage) => {
|
|
@@ -253521,7 +253267,7 @@ async function completeProjectSetup({
|
|
|
253521
253267
|
updateMessage("Building project...");
|
|
253522
253268
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
253523
253269
|
updateMessage("Deploying site...");
|
|
253524
|
-
return await deploySite(
|
|
253270
|
+
return await deploySite(join21(resolvedPath, outputDirectory));
|
|
253525
253271
|
}, {
|
|
253526
253272
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
253527
253273
|
errorMessage: "Failed to deploy site"
|
|
@@ -253582,8 +253328,8 @@ async function createInteractive(options, ctx) {
|
|
|
253582
253328
|
name: () => {
|
|
253583
253329
|
return options.name ? Promise.resolve(options.name) : Ze({
|
|
253584
253330
|
message: "What is the name of your project?",
|
|
253585
|
-
placeholder:
|
|
253586
|
-
initialValue:
|
|
253331
|
+
placeholder: basename4(process.cwd()),
|
|
253332
|
+
initialValue: basename4(process.cwd()),
|
|
253587
253333
|
validate: (value) => {
|
|
253588
253334
|
if (!value || value.trim().length === 0) {
|
|
253589
253335
|
return "Every project deserves a name";
|
|
@@ -253628,7 +253374,7 @@ async function executeCreate({
|
|
|
253628
253374
|
name: rawName,
|
|
253629
253375
|
description,
|
|
253630
253376
|
projectPath,
|
|
253631
|
-
deploy:
|
|
253377
|
+
deploy: deploy5,
|
|
253632
253378
|
skills,
|
|
253633
253379
|
isInteractive
|
|
253634
253380
|
}, ctx) {
|
|
@@ -253647,7 +253393,7 @@ async function executeCreate({
|
|
|
253647
253393
|
errorMessage: "Failed to create project"
|
|
253648
253394
|
});
|
|
253649
253395
|
setAppContext({ id: projectId, projectRoot: resolvedPath });
|
|
253650
|
-
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy:
|
|
253396
|
+
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy5, skills, isInteractive }, ctx);
|
|
253651
253397
|
printProjectSummary(summary, log);
|
|
253652
253398
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
253653
253399
|
}
|
|
@@ -253692,15 +253438,7 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
253692
253438
|
outroMessage: "No resources found to deploy"
|
|
253693
253439
|
};
|
|
253694
253440
|
}
|
|
253695
|
-
const {
|
|
253696
|
-
project: project2,
|
|
253697
|
-
entities,
|
|
253698
|
-
functions,
|
|
253699
|
-
actors,
|
|
253700
|
-
agents,
|
|
253701
|
-
connectors,
|
|
253702
|
-
authConfig
|
|
253703
|
-
} = projectData;
|
|
253441
|
+
const { project: project2, entities, functions, agents, connectors, authConfig } = projectData;
|
|
253704
253442
|
const summaryLines = [];
|
|
253705
253443
|
if (entities.length > 0) {
|
|
253706
253444
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -253708,9 +253446,6 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
253708
253446
|
if (functions.length > 0) {
|
|
253709
253447
|
summaryLines.push(` - ${functions.length} ${functions.length === 1 ? "function" : "functions"}`);
|
|
253710
253448
|
}
|
|
253711
|
-
if (actors.length > 0) {
|
|
253712
|
-
summaryLines.push(` - ${actors.length} ${actors.length === 1 ? "actor" : "actors"}`);
|
|
253713
|
-
}
|
|
253714
253449
|
if (agents.length > 0) {
|
|
253715
253450
|
summaryLines.push(` - ${agents.length} ${agents.length === 1 ? "agent" : "agents"}`);
|
|
253716
253451
|
}
|
|
@@ -253747,7 +253482,7 @@ ${summaryLines.join(`
|
|
|
253747
253482
|
},
|
|
253748
253483
|
onFunctionResult: (r) => {
|
|
253749
253484
|
functionCompleted++;
|
|
253750
|
-
|
|
253485
|
+
formatDeployResult(r, log);
|
|
253751
253486
|
}
|
|
253752
253487
|
});
|
|
253753
253488
|
const connectorResults = result.connectorResults ?? [];
|
|
@@ -253762,7 +253497,7 @@ ${summaryLines.join(`
|
|
|
253762
253497
|
}
|
|
253763
253498
|
return { outroMessage: "App deployed successfully" };
|
|
253764
253499
|
}
|
|
253765
|
-
function
|
|
253500
|
+
function getDeployCommand2() {
|
|
253766
253501
|
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
|
|
253767
253502
|
}
|
|
253768
253503
|
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
|
|
@@ -254090,7 +253825,8 @@ async function fetchLogsForFunctions(functionNames, options, availableFunctionNa
|
|
|
254090
253825
|
}
|
|
254091
253826
|
throw error48;
|
|
254092
253827
|
}
|
|
254093
|
-
|
|
253828
|
+
const matchingLogs = filters.level ? logs.filter((entry) => entry.level === filters.level) : logs;
|
|
253829
|
+
allEntries.push(...matchingLogs.map((entry) => normalizeLogEntry(entry, functionName)));
|
|
254094
253830
|
}
|
|
254095
253831
|
if (functionNames.length > 1) {
|
|
254096
253832
|
const order = options.order?.toUpperCase() === "ASC" ? 1 : -1;
|
|
@@ -254154,7 +253890,7 @@ function getLogsCommand() {
|
|
|
254154
253890
|
}
|
|
254155
253891
|
|
|
254156
253892
|
// src/cli/commands/project/scaffold.ts
|
|
254157
|
-
import { basename as
|
|
253893
|
+
import { basename as basename5, resolve as resolve8 } from "node:path";
|
|
254158
253894
|
function resolveAppId(options) {
|
|
254159
253895
|
const appId = options.appId;
|
|
254160
253896
|
if (!appId) {
|
|
@@ -254171,7 +253907,7 @@ async function scaffoldAction(ctx, name2, options, command2) {
|
|
|
254171
253907
|
const { log, runTask: runTask2 } = ctx;
|
|
254172
253908
|
const appId = resolveAppId(command2.optsWithGlobals());
|
|
254173
253909
|
const resolvedPath = resolve8("./");
|
|
254174
|
-
const projectName = (name2 ??
|
|
253910
|
+
const projectName = (name2 ?? basename5(resolvedPath)).trim();
|
|
254175
253911
|
const template2 = await getTemplateById("backend-only");
|
|
254176
253912
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
254177
253913
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
@@ -254325,7 +254061,7 @@ function withSandboxAuthHint(error48) {
|
|
|
254325
254061
|
cause: error48
|
|
254326
254062
|
});
|
|
254327
254063
|
}
|
|
254328
|
-
async function callTool(appId, tool, payload,
|
|
254064
|
+
async function callTool(appId, tool, payload, schema10, context, timeout2 = 60000) {
|
|
254329
254065
|
const client = getSandboxClient(appId);
|
|
254330
254066
|
let response;
|
|
254331
254067
|
try {
|
|
@@ -254333,7 +254069,7 @@ async function callTool(appId, tool, payload, schema11, context, timeout2 = 6000
|
|
|
254333
254069
|
} catch (error48) {
|
|
254334
254070
|
throw withSandboxAuthHint(await ApiError.fromHttpError(error48, context));
|
|
254335
254071
|
}
|
|
254336
|
-
const result =
|
|
254072
|
+
const result = schema10.safeParse(await response.json());
|
|
254337
254073
|
if (!result.success) {
|
|
254338
254074
|
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
254339
254075
|
}
|
|
@@ -254678,7 +254414,6 @@ function getSiteCommand() {
|
|
|
254678
254414
|
// src/core/types/generator.ts
|
|
254679
254415
|
var import_common_tags = __toESM(require_lib2(), 1);
|
|
254680
254416
|
var import_json_schema_to_typescript = __toESM(require_src3(), 1);
|
|
254681
|
-
import { join as join26 } from "node:path";
|
|
254682
254417
|
var HEADER2 = import_common_tags.stripIndent`
|
|
254683
254418
|
// Auto-generated by Base44 CLI - DO NOT EDIT
|
|
254684
254419
|
// Regenerate with: base44 types generate
|
|
@@ -254687,43 +254422,24 @@ var EMPTY_TEMPLATE = import_common_tags.stripIndent`
|
|
|
254687
254422
|
// Auto-generated by Base44 CLI - DO NOT EDIT
|
|
254688
254423
|
// Regenerate with: base44 types
|
|
254689
254424
|
//
|
|
254690
|
-
// No entities, functions, agents,
|
|
254691
|
-
// Add resources to base44/entities/, base44/functions/, base44/agents/,
|
|
254425
|
+
// No entities, functions, agents, or connectors found in project.
|
|
254426
|
+
// Add resources to base44/entities/, base44/functions/, base44/agents/, or base44/connectors/
|
|
254692
254427
|
// and run \`base44 types generate\` again.
|
|
254693
254428
|
|
|
254694
254429
|
declare module '@base44/sdk' {
|
|
254695
254430
|
// No types to augment - add resources and regenerate
|
|
254696
254431
|
}
|
|
254697
254432
|
`;
|
|
254698
|
-
var SDK_PACKAGE_NAMES = ["@base44/sdk", "@base44-preview/sdk"];
|
|
254699
|
-
async function detectSdkPackageName(projectRoot) {
|
|
254700
|
-
try {
|
|
254701
|
-
const pkg = await readJsonFile(join26(projectRoot, "package.json"));
|
|
254702
|
-
const deps = {
|
|
254703
|
-
...pkg.dependencies,
|
|
254704
|
-
...pkg.devDependencies
|
|
254705
|
-
};
|
|
254706
|
-
for (const name2 of SDK_PACKAGE_NAMES) {
|
|
254707
|
-
if (name2 in deps)
|
|
254708
|
-
return name2;
|
|
254709
|
-
}
|
|
254710
|
-
} catch {}
|
|
254711
|
-
return "@base44/sdk";
|
|
254712
|
-
}
|
|
254713
254433
|
async function generateTypesFile(input) {
|
|
254714
254434
|
const content = await generateContent(input);
|
|
254715
254435
|
await writeFile(getTypesOutputPath(input.projectRoot), content);
|
|
254716
254436
|
}
|
|
254717
254437
|
async function generateContent(input) {
|
|
254718
|
-
const { entities, functions, agents, connectors
|
|
254719
|
-
|
|
254720
|
-
if (!entities.length && !functions.length && !agents.length && !connectors.length && !actors.length) {
|
|
254438
|
+
const { entities, functions, agents, connectors } = input;
|
|
254439
|
+
if (!entities.length && !functions.length && !agents.length && !connectors.length) {
|
|
254721
254440
|
return EMPTY_TEMPLATE;
|
|
254722
254441
|
}
|
|
254723
|
-
const
|
|
254724
|
-
Promise.all(entities.map((e8) => compileEntity(e8))),
|
|
254725
|
-
Promise.all(actors.map((a5) => compileActor(a5)))
|
|
254726
|
-
]);
|
|
254442
|
+
const entityInterfaces = await Promise.all(entities.map((e8) => compileEntity(e8)));
|
|
254727
254443
|
const registryEntries = [
|
|
254728
254444
|
[
|
|
254729
254445
|
"EntityTypeRegistry",
|
|
@@ -254731,29 +254447,16 @@ async function generateContent(input) {
|
|
|
254731
254447
|
],
|
|
254732
254448
|
["FunctionNameRegistry", functions.map((f7) => `"${f7.name}": true;`)],
|
|
254733
254449
|
["AgentNameRegistry", agents.map((a5) => `"${a5.name}": true;`)],
|
|
254734
|
-
["ConnectorTypeRegistry", connectors.map((c8) => `"${c8.type}": true;`)]
|
|
254735
|
-
["ActorNameRegistry", actors.map((a5) => `"${a5.name}": true;`)],
|
|
254736
|
-
[
|
|
254737
|
-
"ActorRegistry",
|
|
254738
|
-
actors.filter((a5) => a5.messageSchema).map((a5) => {
|
|
254739
|
-
const idx = actors.indexOf(a5);
|
|
254740
|
-
return `"${a5.name}": ${actorResults[idx].entry};`;
|
|
254741
|
-
})
|
|
254742
|
-
]
|
|
254450
|
+
["ConnectorTypeRegistry", connectors.map((c8) => `"${c8.type}": true;`)]
|
|
254743
254451
|
];
|
|
254744
254452
|
const registries2 = registryEntries.filter(([, entries]) => entries.length > 0).map(([name2, entries]) => registry2(name2, entries));
|
|
254745
|
-
const actorInterfaces = actorResults.map((r5) => r5.decls).filter(Boolean);
|
|
254746
254453
|
return [
|
|
254747
254454
|
HEADER2,
|
|
254748
|
-
"export {};",
|
|
254749
254455
|
entityInterfaces.join(`
|
|
254750
254456
|
|
|
254751
|
-
`),
|
|
254752
|
-
actorInterfaces.join(`
|
|
254753
|
-
|
|
254754
254457
|
`),
|
|
254755
254458
|
import_common_tags.source`
|
|
254756
|
-
declare module '
|
|
254459
|
+
declare module '@base44/sdk' {
|
|
254757
254460
|
${registries2.join(`
|
|
254758
254461
|
|
|
254759
254462
|
`)}
|
|
@@ -254764,9 +254467,9 @@ async function generateContent(input) {
|
|
|
254764
254467
|
`);
|
|
254765
254468
|
}
|
|
254766
254469
|
async function compileEntity(entity2) {
|
|
254767
|
-
const { name: name2, source: _source, ...
|
|
254470
|
+
const { name: name2, source: _source, ...schema10 } = entity2;
|
|
254768
254471
|
const jsonSchema = {
|
|
254769
|
-
...
|
|
254472
|
+
...schema10,
|
|
254770
254473
|
title: name2,
|
|
254771
254474
|
additionalProperties: false
|
|
254772
254475
|
};
|
|
@@ -254781,81 +254484,6 @@ async function compileEntity(entity2) {
|
|
|
254781
254484
|
throw new TypeGenerationError(`Failed to generate types for entity "${name2}"`, name2, error48);
|
|
254782
254485
|
}
|
|
254783
254486
|
}
|
|
254784
|
-
async function compileActor(actor) {
|
|
254785
|
-
const { messageSchema } = actor;
|
|
254786
|
-
if (!messageSchema) {
|
|
254787
|
-
return { decls: "", entry: "{ toClient: unknown; toServer: unknown }" };
|
|
254788
|
-
}
|
|
254789
|
-
const prefix = toPascalCase(actor.name);
|
|
254790
|
-
const types = messageSchema.types ?? {};
|
|
254791
|
-
const toClient = messageSchema.toClient ?? {};
|
|
254792
|
-
const toServer = messageSchema.toServer ?? {};
|
|
254793
|
-
const typeName = (key2) => `${prefix}${toPascalCase(key2)}`;
|
|
254794
|
-
const msgName = (dir, key2) => `${prefix}${dir}${toPascalCase(key2)}`;
|
|
254795
|
-
const defs = {};
|
|
254796
|
-
const add = (name2, schema11) => {
|
|
254797
|
-
if (name2 in defs) {
|
|
254798
|
-
throw new TypeGenerationError(`Duplicate generated type "${name2}" in actor "${actor.name}" — a shared type and a message resolve to the same name.`, actor.name);
|
|
254799
|
-
}
|
|
254800
|
-
defs[name2] = { ...schema11, title: name2 };
|
|
254801
|
-
};
|
|
254802
|
-
for (const [key2, schema11] of Object.entries(types)) {
|
|
254803
|
-
add(typeName(key2), rewriteTypeRefs(schema11, typeName));
|
|
254804
|
-
}
|
|
254805
|
-
const compileMessages = (msgs, dir) => Object.entries(msgs).map(([key2, schema11]) => {
|
|
254806
|
-
const name2 = msgName(dir, key2);
|
|
254807
|
-
const rewritten = rewriteTypeRefs(schema11, typeName);
|
|
254808
|
-
add(name2, {
|
|
254809
|
-
type: "object",
|
|
254810
|
-
...rewritten,
|
|
254811
|
-
properties: { type: { const: key2 }, ...rewritten.properties ?? {} },
|
|
254812
|
-
required: [
|
|
254813
|
-
"type",
|
|
254814
|
-
...rewritten.required ?? []
|
|
254815
|
-
],
|
|
254816
|
-
additionalProperties: false
|
|
254817
|
-
});
|
|
254818
|
-
return name2;
|
|
254819
|
-
});
|
|
254820
|
-
const toClientNames = compileMessages(toClient, "ToClient");
|
|
254821
|
-
const toServerNames = compileMessages(toServer, "ToServer");
|
|
254822
|
-
const allNames = [...toClientNames, ...toServerNames];
|
|
254823
|
-
const rootName = `${prefix}Message`;
|
|
254824
|
-
const rootSchema = {
|
|
254825
|
-
title: rootName,
|
|
254826
|
-
$defs: defs,
|
|
254827
|
-
oneOf: allNames.map((n5) => ({ $ref: `#/$defs/${n5}` }))
|
|
254828
|
-
};
|
|
254829
|
-
let decls = "";
|
|
254830
|
-
try {
|
|
254831
|
-
decls = (await import_json_schema_to_typescript.compile(rootSchema, rootName, {
|
|
254832
|
-
bannerComment: "",
|
|
254833
|
-
additionalProperties: false,
|
|
254834
|
-
strictIndexSignatures: true
|
|
254835
|
-
})).trim();
|
|
254836
|
-
} catch (error48) {
|
|
254837
|
-
throw new TypeGenerationError(`Failed to generate types for actor "${actor.name}"`, actor.name, error48);
|
|
254838
|
-
}
|
|
254839
|
-
const union2 = (names) => names.length ? names.join(" | ") : "never";
|
|
254840
|
-
return {
|
|
254841
|
-
decls,
|
|
254842
|
-
entry: `{ toClient: ${union2(toClientNames)}; toServer: ${union2(toServerNames)} }`
|
|
254843
|
-
};
|
|
254844
|
-
}
|
|
254845
|
-
function rewriteTypeRefs(node, defName) {
|
|
254846
|
-
if (Array.isArray(node)) {
|
|
254847
|
-
return node.map((n5) => rewriteTypeRefs(n5, defName));
|
|
254848
|
-
}
|
|
254849
|
-
if (node && typeof node === "object") {
|
|
254850
|
-
const out = {};
|
|
254851
|
-
for (const [key2, value] of Object.entries(node)) {
|
|
254852
|
-
const match = key2 === "$ref" && typeof value === "string" ? value.match(/^#\/types\/(.+)$/) : null;
|
|
254853
|
-
out[key2] = match ? `#/$defs/${defName(match[1])}` : rewriteTypeRefs(value, defName);
|
|
254854
|
-
}
|
|
254855
|
-
return out;
|
|
254856
|
-
}
|
|
254857
|
-
return node;
|
|
254858
|
-
}
|
|
254859
254487
|
function registry2(name2, entries) {
|
|
254860
254488
|
return import_common_tags.source`
|
|
254861
254489
|
interface ${name2} {
|
|
@@ -254868,10 +254496,10 @@ function toPascalCase(name2) {
|
|
|
254868
254496
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
254869
254497
|
}
|
|
254870
254498
|
// src/core/types/update-project.ts
|
|
254871
|
-
import { join as
|
|
254499
|
+
import { join as join24 } from "node:path";
|
|
254872
254500
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
254873
254501
|
async function updateProjectConfig(projectRoot) {
|
|
254874
|
-
const tsconfigPath =
|
|
254502
|
+
const tsconfigPath = join24(projectRoot, "tsconfig.json");
|
|
254875
254503
|
if (!await pathExists(tsconfigPath)) {
|
|
254876
254504
|
return false;
|
|
254877
254505
|
}
|
|
@@ -254895,15 +254523,14 @@ var TYPES_FILE_PATH = "base44/.types/types.d.ts";
|
|
|
254895
254523
|
async function generateTypesAction({
|
|
254896
254524
|
runTask: runTask2
|
|
254897
254525
|
}) {
|
|
254898
|
-
const { entities, functions, agents, connectors,
|
|
254526
|
+
const { entities, functions, agents, connectors, project: project2 } = await readProjectConfig();
|
|
254899
254527
|
await runTask2("Generating types", async () => {
|
|
254900
254528
|
await generateTypesFile({
|
|
254901
254529
|
projectRoot: project2.root,
|
|
254902
254530
|
entities,
|
|
254903
254531
|
functions,
|
|
254904
254532
|
agents,
|
|
254905
|
-
connectors
|
|
254906
|
-
actors
|
|
254533
|
+
connectors
|
|
254907
254534
|
});
|
|
254908
254535
|
});
|
|
254909
254536
|
const tsconfigUpdated = await updateProjectConfig(project2.root);
|
|
@@ -254923,7 +254550,7 @@ function getTypesCommand() {
|
|
|
254923
254550
|
// src/cli/dev/dev-server/main.ts
|
|
254924
254551
|
var import_cors = __toESM(require_lib4(), 1);
|
|
254925
254552
|
var import_express6 = __toESM(require_express(), 1);
|
|
254926
|
-
import { dirname as
|
|
254553
|
+
import { dirname as dirname21, join as join27 } from "node:path";
|
|
254927
254554
|
|
|
254928
254555
|
// ../../node_modules/get-port/index.js
|
|
254929
254556
|
import net from "node:net";
|
|
@@ -254944,8 +254571,8 @@ var getLocalHosts = () => {
|
|
|
254944
254571
|
const interfaces = os9.networkInterfaces();
|
|
254945
254572
|
const results = new Set([undefined, "0.0.0.0"]);
|
|
254946
254573
|
for (const _interface of Object.values(interfaces)) {
|
|
254947
|
-
for (const
|
|
254948
|
-
results.add(
|
|
254574
|
+
for (const config12 of _interface) {
|
|
254575
|
+
results.add(config12.address);
|
|
254949
254576
|
}
|
|
254950
254577
|
}
|
|
254951
254578
|
return results;
|
|
@@ -255585,22 +255212,22 @@ class Database {
|
|
|
255585
255212
|
this.schemas.clear();
|
|
255586
255213
|
}
|
|
255587
255214
|
validate(entityName, record2, partial2 = false) {
|
|
255588
|
-
const
|
|
255589
|
-
if (!
|
|
255215
|
+
const schema10 = this.schemas.get(this.normalizeName(entityName));
|
|
255216
|
+
if (!schema10) {
|
|
255590
255217
|
throw new Error(`Entity "${entityName}" not found`);
|
|
255591
255218
|
}
|
|
255592
|
-
return this.validator.validate(record2,
|
|
255219
|
+
return this.validator.validate(record2, schema10, partial2);
|
|
255593
255220
|
}
|
|
255594
255221
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
255595
|
-
const
|
|
255596
|
-
if (!
|
|
255222
|
+
const schema10 = this.schemas.get(this.normalizeName(entityName));
|
|
255223
|
+
if (!schema10) {
|
|
255597
255224
|
throw new Error(`Entity "${entityName}" not found`);
|
|
255598
255225
|
}
|
|
255599
|
-
const filteredRecord = this.validator.filterFields(record2,
|
|
255226
|
+
const filteredRecord = this.validator.filterFields(record2, schema10);
|
|
255600
255227
|
if (partial2) {
|
|
255601
255228
|
return filteredRecord;
|
|
255602
255229
|
}
|
|
255603
|
-
return this.validator.applyDefaults(filteredRecord,
|
|
255230
|
+
return this.validator.applyDefaults(filteredRecord, schema10);
|
|
255604
255231
|
}
|
|
255605
255232
|
normalizeName(entityName) {
|
|
255606
255233
|
return entityName.toLowerCase();
|
|
@@ -255894,13 +255521,13 @@ function checkRLS(rule, record2, user) {
|
|
|
255894
255521
|
return false;
|
|
255895
255522
|
return evaluateCondition(rule, record2, user);
|
|
255896
255523
|
}
|
|
255897
|
-
function applyFLS(record2,
|
|
255524
|
+
function applyFLS(record2, schema10, user, operation) {
|
|
255898
255525
|
if (Array.isArray(record2)) {
|
|
255899
|
-
return record2.map((r5) => applyFLS(r5,
|
|
255526
|
+
return record2.map((r5) => applyFLS(r5, schema10, user, operation));
|
|
255900
255527
|
}
|
|
255901
255528
|
const result = {};
|
|
255902
255529
|
for (const [key2, value] of Object.entries(record2)) {
|
|
255903
|
-
const rule =
|
|
255530
|
+
const rule = schema10.properties[key2]?.rls?.[operation];
|
|
255904
255531
|
if (rule === undefined || checkRLS(rule, record2, user)) {
|
|
255905
255532
|
result[key2] = value;
|
|
255906
255533
|
}
|
|
@@ -256128,14 +255755,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256128
255755
|
res.status(404).json({ error: `Entity "${entityName}" not found` });
|
|
256129
255756
|
return;
|
|
256130
255757
|
}
|
|
256131
|
-
const
|
|
256132
|
-
if (!
|
|
255758
|
+
const schema10 = db2.getSchema(entityName);
|
|
255759
|
+
if (!schema10) {
|
|
256133
255760
|
res.status(404).json({ error: `Schema for "${entityName}" not found` });
|
|
256134
255761
|
return;
|
|
256135
255762
|
}
|
|
256136
255763
|
const currentUserResult = await resolveCurrentUser(db2, req);
|
|
256137
255764
|
const currentUser = currentUserResult.ok ? currentUserResult.user : undefined;
|
|
256138
|
-
await handler(req, res, collection,
|
|
255765
|
+
await handler(req, res, collection, schema10, currentUser);
|
|
256139
255766
|
};
|
|
256140
255767
|
}
|
|
256141
255768
|
function emit(appId, entityName, type, data) {
|
|
@@ -256153,19 +255780,19 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256153
255780
|
}
|
|
256154
255781
|
broadcast(appId, entityName, createData(data));
|
|
256155
255782
|
}
|
|
256156
|
-
function prepareCreateRecord(entityName, body,
|
|
255783
|
+
function prepareCreateRecord(entityName, body, schema10, currentUser, now) {
|
|
256157
255784
|
const { _id, ...recordBody } = body;
|
|
256158
255785
|
const ownerFields = {
|
|
256159
255786
|
created_by: currentUser?.email,
|
|
256160
255787
|
created_by_id: currentUser?.id
|
|
256161
255788
|
};
|
|
256162
|
-
if (!checkRLS(
|
|
255789
|
+
if (!checkRLS(schema10.rls?.create, {
|
|
256163
255790
|
...recordBody,
|
|
256164
255791
|
...ownerFields
|
|
256165
255792
|
}, currentUser)) {
|
|
256166
255793
|
return;
|
|
256167
255794
|
}
|
|
256168
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody),
|
|
255795
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody), schema10, currentUser, "write");
|
|
256169
255796
|
db2.validate(entityName, filteredBody);
|
|
256170
255797
|
return {
|
|
256171
255798
|
...filteredBody,
|
|
@@ -256177,7 +255804,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256177
255804
|
}
|
|
256178
255805
|
const userRouter = createUserRouter(db2, logger2);
|
|
256179
255806
|
router.use("/User", userRouter);
|
|
256180
|
-
router.get("/:entityName/:id", withCollection(async (req, res, collection,
|
|
255807
|
+
router.get("/:entityName/:id", withCollection(async (req, res, collection, schema10, currentUser) => {
|
|
256181
255808
|
const { entityName, id: id2 } = req.params;
|
|
256182
255809
|
try {
|
|
256183
255810
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -256185,27 +255812,27 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256185
255812
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
256186
255813
|
return;
|
|
256187
255814
|
}
|
|
256188
|
-
if (!checkRLS(
|
|
255815
|
+
if (!checkRLS(schema10.rls?.read, doc2, currentUser)) {
|
|
256189
255816
|
res.status(404).json({
|
|
256190
255817
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
256191
255818
|
});
|
|
256192
255819
|
return;
|
|
256193
255820
|
}
|
|
256194
|
-
const result = applyFLS(stripInternalFields(doc2),
|
|
255821
|
+
const result = applyFLS(stripInternalFields(doc2), schema10, currentUser, "read");
|
|
256195
255822
|
res.json(result);
|
|
256196
255823
|
} catch (error48) {
|
|
256197
255824
|
logger2.error(`Error in GET /${entityName}/${id2}:`, error48);
|
|
256198
255825
|
res.status(500).json({ error: "Internal server error" });
|
|
256199
255826
|
}
|
|
256200
255827
|
}));
|
|
256201
|
-
router.get("/:entityName", withCollection(async (req, res, collection,
|
|
255828
|
+
router.get("/:entityName", withCollection(async (req, res, collection, schema10, currentUser) => {
|
|
256202
255829
|
const { entityName } = req.params;
|
|
256203
255830
|
try {
|
|
256204
255831
|
let results = stripInternalFields(await queryEntity(collection, req.query));
|
|
256205
|
-
if (
|
|
256206
|
-
results = results.filter((doc2) => checkRLS(
|
|
255832
|
+
if (schema10.rls?.read !== undefined && schema10.rls.read !== true) {
|
|
255833
|
+
results = results.filter((doc2) => checkRLS(schema10.rls.read, doc2, currentUser));
|
|
256207
255834
|
}
|
|
256208
|
-
results = results.map((doc2) => applyFLS(doc2,
|
|
255835
|
+
results = results.map((doc2) => applyFLS(doc2, schema10, currentUser, "read"));
|
|
256209
255836
|
res.json(results);
|
|
256210
255837
|
} catch (error48) {
|
|
256211
255838
|
if (error48 instanceof InvalidInputError) {
|
|
@@ -256216,16 +255843,16 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256216
255843
|
}
|
|
256217
255844
|
}
|
|
256218
255845
|
}));
|
|
256219
|
-
router.post("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
255846
|
+
router.post("/:entityName", parseBody, withCollection(async (req, res, collection, schema10, currentUser) => {
|
|
256220
255847
|
const { appId, entityName } = req.params;
|
|
256221
255848
|
try {
|
|
256222
255849
|
const now = new Date().toISOString();
|
|
256223
|
-
const record2 = prepareCreateRecord(entityName, req.body,
|
|
255850
|
+
const record2 = prepareCreateRecord(entityName, req.body, schema10, currentUser, now);
|
|
256224
255851
|
if (!record2) {
|
|
256225
255852
|
res.status(403).json({ error: "Permission denied" });
|
|
256226
255853
|
return;
|
|
256227
255854
|
}
|
|
256228
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)),
|
|
255855
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)), schema10, currentUser, "read");
|
|
256229
255856
|
emit(appId, entityName, "create", inserted);
|
|
256230
255857
|
res.status(201).json(inserted);
|
|
256231
255858
|
} catch (error48) {
|
|
@@ -256237,7 +255864,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256237
255864
|
res.status(500).json({ error: "Internal server error" });
|
|
256238
255865
|
}
|
|
256239
255866
|
}));
|
|
256240
|
-
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection,
|
|
255867
|
+
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection, schema10, currentUser) => {
|
|
256241
255868
|
const { appId, entityName } = req.params;
|
|
256242
255869
|
if (!Array.isArray(req.body)) {
|
|
256243
255870
|
res.status(400).json({ error: "Request body must be an array" });
|
|
@@ -256247,14 +255874,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256247
255874
|
const now = new Date().toISOString();
|
|
256248
255875
|
const records = [];
|
|
256249
255876
|
for (const body of req.body) {
|
|
256250
|
-
const record2 = prepareCreateRecord(entityName, body,
|
|
255877
|
+
const record2 = prepareCreateRecord(entityName, body, schema10, currentUser, now);
|
|
256251
255878
|
if (!record2) {
|
|
256252
255879
|
res.status(403).json({ error: "Permission denied" });
|
|
256253
255880
|
return;
|
|
256254
255881
|
}
|
|
256255
255882
|
records.push(record2);
|
|
256256
255883
|
}
|
|
256257
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)),
|
|
255884
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)), schema10, currentUser, "read");
|
|
256258
255885
|
emit(appId, entityName, "create", inserted);
|
|
256259
255886
|
res.status(201).json(inserted);
|
|
256260
255887
|
} catch (error48) {
|
|
@@ -256266,24 +255893,24 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256266
255893
|
res.status(500).json({ error: "Internal server error" });
|
|
256267
255894
|
}
|
|
256268
255895
|
}));
|
|
256269
|
-
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection,
|
|
255896
|
+
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection, schema10, currentUser) => {
|
|
256270
255897
|
const { appId, entityName, id: id2 } = req.params;
|
|
256271
255898
|
const { id: _id, created_date: _created_date, ...body } = req.body;
|
|
256272
255899
|
try {
|
|
256273
|
-
if (
|
|
255900
|
+
if (schema10.rls?.update !== undefined) {
|
|
256274
255901
|
const existing = await collection.findOneAsync({ id: id2 });
|
|
256275
255902
|
if (!existing) {
|
|
256276
255903
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
256277
255904
|
return;
|
|
256278
255905
|
}
|
|
256279
|
-
if (!checkRLS(
|
|
255906
|
+
if (!checkRLS(schema10.rls.update, existing, currentUser)) {
|
|
256280
255907
|
res.status(404).json({
|
|
256281
255908
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
256282
255909
|
});
|
|
256283
255910
|
return;
|
|
256284
255911
|
}
|
|
256285
255912
|
}
|
|
256286
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true),
|
|
255913
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true), schema10, currentUser, "write");
|
|
256287
255914
|
db2.validate(entityName, filteredBody, true);
|
|
256288
255915
|
const updateData = {
|
|
256289
255916
|
...filteredBody,
|
|
@@ -256294,7 +255921,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256294
255921
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
256295
255922
|
return;
|
|
256296
255923
|
}
|
|
256297
|
-
const updated = applyFLS(stripInternalFields(result.affectedDocuments),
|
|
255924
|
+
const updated = applyFLS(stripInternalFields(result.affectedDocuments), schema10, currentUser, "read");
|
|
256298
255925
|
emit(appId, entityName, "update", updated);
|
|
256299
255926
|
res.json(updated);
|
|
256300
255927
|
} catch (error48) {
|
|
@@ -256306,7 +255933,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256306
255933
|
res.status(500).json({ error: "Internal server error" });
|
|
256307
255934
|
}
|
|
256308
255935
|
}));
|
|
256309
|
-
router.delete("/:entityName/:id", withCollection(async (req, res, collection,
|
|
255936
|
+
router.delete("/:entityName/:id", withCollection(async (req, res, collection, schema10, currentUser) => {
|
|
256310
255937
|
const { appId, entityName, id: id2 } = req.params;
|
|
256311
255938
|
try {
|
|
256312
255939
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -256314,7 +255941,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256314
255941
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
256315
255942
|
return;
|
|
256316
255943
|
}
|
|
256317
|
-
if (!checkRLS(
|
|
255944
|
+
if (!checkRLS(schema10.rls?.delete, doc2, currentUser)) {
|
|
256318
255945
|
res.status(404).json({
|
|
256319
255946
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
256320
255947
|
});
|
|
@@ -256328,11 +255955,11 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
256328
255955
|
res.status(500).json({ error: "Internal server error" });
|
|
256329
255956
|
}
|
|
256330
255957
|
}));
|
|
256331
|
-
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
255958
|
+
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection, schema10, currentUser) => {
|
|
256332
255959
|
const { entityName } = req.params;
|
|
256333
255960
|
try {
|
|
256334
255961
|
const query = req.body || {};
|
|
256335
|
-
const rlsDelete =
|
|
255962
|
+
const rlsDelete = schema10?.rls?.delete;
|
|
256336
255963
|
if (rlsDelete !== undefined && rlsDelete !== true) {
|
|
256337
255964
|
if (rlsDelete === false && currentUser?.is_service !== true) {
|
|
256338
255965
|
res.status(403).json({ error: "Permission denied" });
|
|
@@ -256551,7 +256178,7 @@ class ServeRunner {
|
|
|
256551
256178
|
|
|
256552
256179
|
// src/cli/dev/dev-server/watcher.ts
|
|
256553
256180
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
256554
|
-
import { relative as
|
|
256181
|
+
import { relative as relative6 } from "node:path";
|
|
256555
256182
|
|
|
256556
256183
|
// ../../node_modules/chokidar/index.js
|
|
256557
256184
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
@@ -256721,10 +256348,10 @@ class ReaddirpStream extends Readable6 {
|
|
|
256721
256348
|
}
|
|
256722
256349
|
async _formatEntry(dirent, path19) {
|
|
256723
256350
|
let entry;
|
|
256724
|
-
const
|
|
256351
|
+
const basename6 = this._isDirent ? dirent.name : dirent;
|
|
256725
256352
|
try {
|
|
256726
|
-
const fullPath = presolve(pjoin(path19,
|
|
256727
|
-
entry = { path: prelative(this._root, fullPath), fullPath, basename:
|
|
256353
|
+
const fullPath = presolve(pjoin(path19, basename6));
|
|
256354
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename6 };
|
|
256728
256355
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
256729
256356
|
} catch (err) {
|
|
256730
256357
|
this._onError(err);
|
|
@@ -257251,9 +256878,9 @@ class NodeFsHandler {
|
|
|
257251
256878
|
_watchWithNodeFs(path19, listener) {
|
|
257252
256879
|
const opts = this.fsw.options;
|
|
257253
256880
|
const directory = sp2.dirname(path19);
|
|
257254
|
-
const
|
|
256881
|
+
const basename7 = sp2.basename(path19);
|
|
257255
256882
|
const parent = this.fsw._getWatchedDir(directory);
|
|
257256
|
-
parent.add(
|
|
256883
|
+
parent.add(basename7);
|
|
257257
256884
|
const absolutePath = sp2.resolve(path19);
|
|
257258
256885
|
const options8 = {
|
|
257259
256886
|
persistent: opts.persistent
|
|
@@ -257263,7 +256890,7 @@ class NodeFsHandler {
|
|
|
257263
256890
|
let closer;
|
|
257264
256891
|
if (opts.usePolling) {
|
|
257265
256892
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
257266
|
-
options8.interval = enableBin && isBinaryPath(
|
|
256893
|
+
options8.interval = enableBin && isBinaryPath(basename7) ? opts.binaryInterval : opts.interval;
|
|
257267
256894
|
closer = setFsWatchFileListener(path19, absolutePath, options8, {
|
|
257268
256895
|
listener,
|
|
257269
256896
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -257281,11 +256908,11 @@ class NodeFsHandler {
|
|
|
257281
256908
|
if (this.fsw.closed) {
|
|
257282
256909
|
return;
|
|
257283
256910
|
}
|
|
257284
|
-
const
|
|
257285
|
-
const
|
|
257286
|
-
const parent = this.fsw._getWatchedDir(
|
|
256911
|
+
const dirname20 = sp2.dirname(file2);
|
|
256912
|
+
const basename7 = sp2.basename(file2);
|
|
256913
|
+
const parent = this.fsw._getWatchedDir(dirname20);
|
|
257287
256914
|
let prevStats = stats;
|
|
257288
|
-
if (parent.has(
|
|
256915
|
+
if (parent.has(basename7))
|
|
257289
256916
|
return;
|
|
257290
256917
|
const listener = async (path19, newStats) => {
|
|
257291
256918
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
@@ -257310,9 +256937,9 @@ class NodeFsHandler {
|
|
|
257310
256937
|
prevStats = newStats2;
|
|
257311
256938
|
}
|
|
257312
256939
|
} catch (error48) {
|
|
257313
|
-
this.fsw._remove(
|
|
256940
|
+
this.fsw._remove(dirname20, basename7);
|
|
257314
256941
|
}
|
|
257315
|
-
} else if (parent.has(
|
|
256942
|
+
} else if (parent.has(basename7)) {
|
|
257316
256943
|
const at13 = newStats.atimeMs;
|
|
257317
256944
|
const mt12 = newStats.mtimeMs;
|
|
257318
256945
|
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
@@ -257533,11 +257160,11 @@ function createPattern(matcher) {
|
|
|
257533
257160
|
if (matcher.path === string4)
|
|
257534
257161
|
return true;
|
|
257535
257162
|
if (matcher.recursive) {
|
|
257536
|
-
const
|
|
257537
|
-
if (!
|
|
257163
|
+
const relative6 = sp3.relative(matcher.path, string4);
|
|
257164
|
+
if (!relative6) {
|
|
257538
257165
|
return false;
|
|
257539
257166
|
}
|
|
257540
|
-
return !
|
|
257167
|
+
return !relative6.startsWith("..") && !sp3.isAbsolute(relative6);
|
|
257541
257168
|
}
|
|
257542
257169
|
return false;
|
|
257543
257170
|
};
|
|
@@ -258236,7 +257863,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
258236
257863
|
ignoreInitial: true
|
|
258237
257864
|
});
|
|
258238
257865
|
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
258239
|
-
this.emit("change", name2,
|
|
257866
|
+
this.emit("change", name2, relative6(targetPath, path19));
|
|
258240
257867
|
}, WATCH_DEBOUNCE_MS));
|
|
258241
257868
|
watcher.on("error", (err) => {
|
|
258242
257869
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -258343,8 +257970,8 @@ async function createDevServer(options8) {
|
|
|
258343
257970
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
258344
257971
|
};
|
|
258345
257972
|
const base44ConfigWatcher = new WatchBase44({
|
|
258346
|
-
functions:
|
|
258347
|
-
entities:
|
|
257973
|
+
functions: join27(dirname21(project2.configPath), project2.functionsDir),
|
|
257974
|
+
entities: join27(dirname21(project2.configPath), project2.entitiesDir)
|
|
258348
257975
|
}, devLogger);
|
|
258349
257976
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
258350
257977
|
try {
|
|
@@ -258686,14 +258313,13 @@ function createProgram(context) {
|
|
|
258686
258313
|
program2.addCommand(getCreateCommand());
|
|
258687
258314
|
program2.addCommand(getScaffoldCommand());
|
|
258688
258315
|
program2.addCommand(getDashboardCommand());
|
|
258689
|
-
program2.addCommand(
|
|
258316
|
+
program2.addCommand(getDeployCommand2());
|
|
258690
258317
|
program2.addCommand(getLinkCommand());
|
|
258691
258318
|
program2.addCommand(getEjectCommand());
|
|
258692
258319
|
program2.addCommand(getEntitiesPushCommand());
|
|
258693
258320
|
program2.addCommand(getAgentsCommand());
|
|
258694
258321
|
program2.addCommand(getConnectorsCommand());
|
|
258695
258322
|
program2.addCommand(getFunctionsCommand());
|
|
258696
|
-
program2.addCommand(getActorCommand());
|
|
258697
258323
|
program2.addCommand(getSecretsCommand());
|
|
258698
258324
|
program2.addCommand(getSandboxCommand());
|
|
258699
258325
|
program2.addCommand(getAuthCommand());
|
|
@@ -258710,7 +258336,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
258710
258336
|
import { release, type } from "node:os";
|
|
258711
258337
|
|
|
258712
258338
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
258713
|
-
import { dirname as
|
|
258339
|
+
import { dirname as dirname22, posix, sep } from "path";
|
|
258714
258340
|
function createModulerModifier() {
|
|
258715
258341
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
258716
258342
|
return async (frames) => {
|
|
@@ -258719,7 +258345,7 @@ function createModulerModifier() {
|
|
|
258719
258345
|
return frames;
|
|
258720
258346
|
};
|
|
258721
258347
|
}
|
|
258722
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
258348
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname22(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
258723
258349
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
258724
258350
|
return (filename) => {
|
|
258725
258351
|
if (!filename)
|
|
@@ -262908,9 +262534,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
262908
262534
|
});
|
|
262909
262535
|
}
|
|
262910
262536
|
// src/cli/index.ts
|
|
262911
|
-
var __dirname4 =
|
|
262537
|
+
var __dirname4 = dirname23(fileURLToPath6(import.meta.url));
|
|
262912
262538
|
async function runCLI(options8) {
|
|
262913
|
-
ensureNpmAssets(
|
|
262539
|
+
ensureNpmAssets(join28(__dirname4, "../assets"));
|
|
262914
262540
|
const errorReporter = new ErrorReporter;
|
|
262915
262541
|
errorReporter.registerProcessErrorHandlers();
|
|
262916
262542
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -262949,4 +262575,4 @@ export {
|
|
|
262949
262575
|
CLIExitError
|
|
262950
262576
|
};
|
|
262951
262577
|
|
|
262952
|
-
//# debugId=
|
|
262578
|
+
//# debugId=E15997208358C91664756E2164756E21
|