@base44-preview/cli 0.1.6-pr.575.e9a2dd0 → 0.1.6-pr.579.8e3e3da
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
CHANGED
|
@@ -13736,12 +13736,12 @@ var require_schema = __commonJS((exports, module) => {
|
|
|
13736
13736
|
var common = require_common3();
|
|
13737
13737
|
var YAMLException = require_exception();
|
|
13738
13738
|
var Type = require_type();
|
|
13739
|
-
function compileList(
|
|
13739
|
+
function compileList(schema7, name2, result) {
|
|
13740
13740
|
var exclude = [];
|
|
13741
|
-
|
|
13741
|
+
schema7.include.forEach(function(includedSchema) {
|
|
13742
13742
|
result = compileList(includedSchema, name2, result);
|
|
13743
13743
|
});
|
|
13744
|
-
|
|
13744
|
+
schema7[name2].forEach(function(currentType) {
|
|
13745
13745
|
result.forEach(function(previousType, previousIndex) {
|
|
13746
13746
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
|
13747
13747
|
exclude.push(previousIndex);
|
|
@@ -13798,8 +13798,8 @@ var require_schema = __commonJS((exports, module) => {
|
|
|
13798
13798
|
}
|
|
13799
13799
|
schemas3 = common.toArray(schemas3);
|
|
13800
13800
|
types = common.toArray(types);
|
|
13801
|
-
if (!schemas3.every(function(
|
|
13802
|
-
return
|
|
13801
|
+
if (!schemas3.every(function(schema7) {
|
|
13802
|
+
return schema7 instanceof Schema;
|
|
13803
13803
|
})) {
|
|
13804
13804
|
throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
13805
13805
|
}
|
|
@@ -15820,7 +15820,7 @@ var require_dumper = __commonJS((exports, module) => {
|
|
|
15820
15820
|
"Off",
|
|
15821
15821
|
"OFF"
|
|
15822
15822
|
];
|
|
15823
|
-
function compileStyleMap(
|
|
15823
|
+
function compileStyleMap(schema7, map2) {
|
|
15824
15824
|
var result, keys, index, length, tag, style, type;
|
|
15825
15825
|
if (map2 === null)
|
|
15826
15826
|
return {};
|
|
@@ -15832,7 +15832,7 @@ var require_dumper = __commonJS((exports, module) => {
|
|
|
15832
15832
|
if (tag.slice(0, 2) === "!!") {
|
|
15833
15833
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
15834
15834
|
}
|
|
15835
|
-
type =
|
|
15835
|
+
type = schema7.compiledTypeMap["fallback"][tag];
|
|
15836
15836
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
15837
15837
|
style = type.styleAliases[style];
|
|
15838
15838
|
}
|
|
@@ -20132,7 +20132,7 @@ var require_lodash8 = __commonJS((exports, module) => {
|
|
|
20132
20132
|
}
|
|
20133
20133
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
20134
20134
|
});
|
|
20135
|
-
function
|
|
20135
|
+
function join14(array2, separator) {
|
|
20136
20136
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
20137
20137
|
}
|
|
20138
20138
|
function last(array2) {
|
|
@@ -22064,7 +22064,7 @@ __p += '`;
|
|
|
22064
22064
|
lodash.isUndefined = isUndefined;
|
|
22065
22065
|
lodash.isWeakMap = isWeakMap;
|
|
22066
22066
|
lodash.isWeakSet = isWeakSet;
|
|
22067
|
-
lodash.join =
|
|
22067
|
+
lodash.join = join14;
|
|
22068
22068
|
lodash.kebabCase = kebabCase;
|
|
22069
22069
|
lodash.last = last;
|
|
22070
22070
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -23019,7 +23019,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
23019
23019
|
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
23020
23020
|
value = value.valueOf();
|
|
23021
23021
|
}
|
|
23022
|
-
const { aliasDuplicateObjects, onAnchor, onTagObj, schema:
|
|
23022
|
+
const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema10, sourceObjects } = ctx;
|
|
23023
23023
|
let ref = undefined;
|
|
23024
23024
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
23025
23025
|
ref = sourceObjects.get(value);
|
|
@@ -23033,7 +23033,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
23033
23033
|
}
|
|
23034
23034
|
if (tagName?.startsWith("!!"))
|
|
23035
23035
|
tagName = defaultTagPrefix + tagName.slice(2);
|
|
23036
|
-
let tagObj = findTagObject(value, tagName,
|
|
23036
|
+
let tagObj = findTagObject(value, tagName, schema10.tags);
|
|
23037
23037
|
if (!tagObj) {
|
|
23038
23038
|
if (value && typeof value.toJSON === "function") {
|
|
23039
23039
|
value = value.toJSON();
|
|
@@ -23044,7 +23044,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
23044
23044
|
ref.node = node2;
|
|
23045
23045
|
return node2;
|
|
23046
23046
|
}
|
|
23047
|
-
tagObj = value instanceof Map ?
|
|
23047
|
+
tagObj = value instanceof Map ? schema10[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema10[identity3.SEQ] : schema10[identity3.MAP];
|
|
23048
23048
|
}
|
|
23049
23049
|
if (onTagObj) {
|
|
23050
23050
|
onTagObj(tagObj);
|
|
@@ -23067,7 +23067,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
23067
23067
|
var createNode = require_createNode();
|
|
23068
23068
|
var identity3 = require_identity();
|
|
23069
23069
|
var Node2 = require_Node();
|
|
23070
|
-
function collectionFromPath(
|
|
23070
|
+
function collectionFromPath(schema10, path16, value) {
|
|
23071
23071
|
let v = value;
|
|
23072
23072
|
for (let i2 = path16.length - 1;i2 >= 0; --i2) {
|
|
23073
23073
|
const k2 = path16[i2];
|
|
@@ -23085,27 +23085,27 @@ var require_Collection = __commonJS((exports) => {
|
|
|
23085
23085
|
onAnchor: () => {
|
|
23086
23086
|
throw new Error("This should not happen, please report a bug.");
|
|
23087
23087
|
},
|
|
23088
|
-
schema:
|
|
23088
|
+
schema: schema10,
|
|
23089
23089
|
sourceObjects: new Map
|
|
23090
23090
|
});
|
|
23091
23091
|
}
|
|
23092
23092
|
var isEmptyPath = (path16) => path16 == null || typeof path16 === "object" && !!path16[Symbol.iterator]().next().done;
|
|
23093
23093
|
|
|
23094
23094
|
class Collection extends Node2.NodeBase {
|
|
23095
|
-
constructor(type,
|
|
23095
|
+
constructor(type, schema10) {
|
|
23096
23096
|
super(type);
|
|
23097
23097
|
Object.defineProperty(this, "schema", {
|
|
23098
|
-
value:
|
|
23098
|
+
value: schema10,
|
|
23099
23099
|
configurable: true,
|
|
23100
23100
|
enumerable: false,
|
|
23101
23101
|
writable: true
|
|
23102
23102
|
});
|
|
23103
23103
|
}
|
|
23104
|
-
clone(
|
|
23104
|
+
clone(schema10) {
|
|
23105
23105
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
23106
|
-
if (
|
|
23107
|
-
copy.schema =
|
|
23108
|
-
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(
|
|
23106
|
+
if (schema10)
|
|
23107
|
+
copy.schema = schema10;
|
|
23108
|
+
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema10) : it3);
|
|
23109
23109
|
if (this.range)
|
|
23110
23110
|
copy.range = this.range.slice();
|
|
23111
23111
|
return copy;
|
|
@@ -24037,12 +24037,12 @@ var require_Pair = __commonJS((exports) => {
|
|
|
24037
24037
|
this.key = key;
|
|
24038
24038
|
this.value = value;
|
|
24039
24039
|
}
|
|
24040
|
-
clone(
|
|
24040
|
+
clone(schema10) {
|
|
24041
24041
|
let { key, value } = this;
|
|
24042
24042
|
if (identity3.isNode(key))
|
|
24043
|
-
key = key.clone(
|
|
24043
|
+
key = key.clone(schema10);
|
|
24044
24044
|
if (identity3.isNode(value))
|
|
24045
|
-
value = value.clone(
|
|
24045
|
+
value = value.clone(schema10);
|
|
24046
24046
|
return new Pair(key, value);
|
|
24047
24047
|
}
|
|
24048
24048
|
toJSON(_2, ctx) {
|
|
@@ -24227,13 +24227,13 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
24227
24227
|
static get tagName() {
|
|
24228
24228
|
return "tag:yaml.org,2002:map";
|
|
24229
24229
|
}
|
|
24230
|
-
constructor(
|
|
24231
|
-
super(identity3.MAP,
|
|
24230
|
+
constructor(schema10) {
|
|
24231
|
+
super(identity3.MAP, schema10);
|
|
24232
24232
|
this.items = [];
|
|
24233
24233
|
}
|
|
24234
|
-
static from(
|
|
24234
|
+
static from(schema10, obj, ctx) {
|
|
24235
24235
|
const { keepUndefined, replacer } = ctx;
|
|
24236
|
-
const map2 = new this(
|
|
24236
|
+
const map2 = new this(schema10);
|
|
24237
24237
|
const add = (key, value) => {
|
|
24238
24238
|
if (typeof replacer === "function")
|
|
24239
24239
|
value = replacer.call(obj, key, value);
|
|
@@ -24249,8 +24249,8 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
24249
24249
|
for (const key of Object.keys(obj))
|
|
24250
24250
|
add(key, obj[key]);
|
|
24251
24251
|
}
|
|
24252
|
-
if (typeof
|
|
24253
|
-
map2.items.sort(
|
|
24252
|
+
if (typeof schema10.sortMapEntries === "function") {
|
|
24253
|
+
map2.items.sort(schema10.sortMapEntries);
|
|
24254
24254
|
}
|
|
24255
24255
|
return map2;
|
|
24256
24256
|
}
|
|
@@ -24343,7 +24343,7 @@ var require_map2 = __commonJS((exports) => {
|
|
|
24343
24343
|
onError("Expected a mapping for this tag");
|
|
24344
24344
|
return map3;
|
|
24345
24345
|
},
|
|
24346
|
-
createNode: (
|
|
24346
|
+
createNode: (schema10, obj, ctx) => YAMLMap.YAMLMap.from(schema10, obj, ctx)
|
|
24347
24347
|
};
|
|
24348
24348
|
exports.map = map2;
|
|
24349
24349
|
});
|
|
@@ -24361,8 +24361,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
24361
24361
|
static get tagName() {
|
|
24362
24362
|
return "tag:yaml.org,2002:seq";
|
|
24363
24363
|
}
|
|
24364
|
-
constructor(
|
|
24365
|
-
super(identity3.SEQ,
|
|
24364
|
+
constructor(schema10) {
|
|
24365
|
+
super(identity3.SEQ, schema10);
|
|
24366
24366
|
this.items = [];
|
|
24367
24367
|
}
|
|
24368
24368
|
add(value) {
|
|
@@ -24416,9 +24416,9 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
24416
24416
|
onComment
|
|
24417
24417
|
});
|
|
24418
24418
|
}
|
|
24419
|
-
static from(
|
|
24419
|
+
static from(schema10, obj, ctx) {
|
|
24420
24420
|
const { replacer } = ctx;
|
|
24421
|
-
const seq = new this(
|
|
24421
|
+
const seq = new this(schema10);
|
|
24422
24422
|
if (obj && Symbol.iterator in Object(obj)) {
|
|
24423
24423
|
let i2 = 0;
|
|
24424
24424
|
for (let it3 of obj) {
|
|
@@ -24455,7 +24455,7 @@ var require_seq2 = __commonJS((exports) => {
|
|
|
24455
24455
|
onError("Expected a sequence for this tag");
|
|
24456
24456
|
return seq2;
|
|
24457
24457
|
},
|
|
24458
|
-
createNode: (
|
|
24458
|
+
createNode: (schema10, obj, ctx) => YAMLSeq.YAMLSeq.from(schema10, obj, ctx)
|
|
24459
24459
|
};
|
|
24460
24460
|
exports.seq = seq;
|
|
24461
24461
|
});
|
|
@@ -24630,7 +24630,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
24630
24630
|
var bool = require_bool2();
|
|
24631
24631
|
var float = require_float2();
|
|
24632
24632
|
var int2 = require_int2();
|
|
24633
|
-
var
|
|
24633
|
+
var schema10 = [
|
|
24634
24634
|
map2.map,
|
|
24635
24635
|
seq.seq,
|
|
24636
24636
|
string4.string,
|
|
@@ -24643,7 +24643,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
24643
24643
|
float.floatExp,
|
|
24644
24644
|
float.float
|
|
24645
24645
|
];
|
|
24646
|
-
exports.schema =
|
|
24646
|
+
exports.schema = schema10;
|
|
24647
24647
|
});
|
|
24648
24648
|
|
|
24649
24649
|
// ../../node_modules/yaml/dist/schema/json/schema.js
|
|
@@ -24706,8 +24706,8 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
24706
24706
|
return str;
|
|
24707
24707
|
}
|
|
24708
24708
|
};
|
|
24709
|
-
var
|
|
24710
|
-
exports.schema =
|
|
24709
|
+
var schema10 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
|
|
24710
|
+
exports.schema = schema10;
|
|
24711
24711
|
});
|
|
24712
24712
|
|
|
24713
24713
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
@@ -24797,9 +24797,9 @@ ${cn.comment}` : item.comment;
|
|
|
24797
24797
|
onError("Expected a sequence for this tag");
|
|
24798
24798
|
return seq;
|
|
24799
24799
|
}
|
|
24800
|
-
function createPairs(
|
|
24800
|
+
function createPairs(schema10, iterable, ctx) {
|
|
24801
24801
|
const { replacer } = ctx;
|
|
24802
|
-
const pairs2 = new YAMLSeq.YAMLSeq(
|
|
24802
|
+
const pairs2 = new YAMLSeq.YAMLSeq(schema10);
|
|
24803
24803
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
24804
24804
|
let i2 = 0;
|
|
24805
24805
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
@@ -24878,8 +24878,8 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
24878
24878
|
}
|
|
24879
24879
|
return map2;
|
|
24880
24880
|
}
|
|
24881
|
-
static from(
|
|
24882
|
-
const pairs$1 = pairs.createPairs(
|
|
24881
|
+
static from(schema10, iterable, ctx) {
|
|
24882
|
+
const pairs$1 = pairs.createPairs(schema10, iterable, ctx);
|
|
24883
24883
|
const omap2 = new this;
|
|
24884
24884
|
omap2.items = pairs$1.items;
|
|
24885
24885
|
return omap2;
|
|
@@ -24906,7 +24906,7 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
24906
24906
|
}
|
|
24907
24907
|
return Object.assign(new YAMLOMap, pairs$1);
|
|
24908
24908
|
},
|
|
24909
|
-
createNode: (
|
|
24909
|
+
createNode: (schema10, iterable, ctx) => YAMLOMap.from(schema10, iterable, ctx)
|
|
24910
24910
|
};
|
|
24911
24911
|
exports.YAMLOMap = YAMLOMap;
|
|
24912
24912
|
exports.omap = omap;
|
|
@@ -25070,8 +25070,8 @@ var require_set2 = __commonJS((exports) => {
|
|
|
25070
25070
|
var YAMLMap = require_YAMLMap();
|
|
25071
25071
|
|
|
25072
25072
|
class YAMLSet extends YAMLMap.YAMLMap {
|
|
25073
|
-
constructor(
|
|
25074
|
-
super(
|
|
25073
|
+
constructor(schema10) {
|
|
25074
|
+
super(schema10);
|
|
25075
25075
|
this.tag = YAMLSet.tag;
|
|
25076
25076
|
}
|
|
25077
25077
|
add(key) {
|
|
@@ -25111,9 +25111,9 @@ var require_set2 = __commonJS((exports) => {
|
|
|
25111
25111
|
else
|
|
25112
25112
|
throw new Error("Set items must all have null values");
|
|
25113
25113
|
}
|
|
25114
|
-
static from(
|
|
25114
|
+
static from(schema10, iterable, ctx) {
|
|
25115
25115
|
const { replacer } = ctx;
|
|
25116
|
-
const set3 = new this(
|
|
25116
|
+
const set3 = new this(schema10);
|
|
25117
25117
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
25118
25118
|
for (let value of iterable) {
|
|
25119
25119
|
if (typeof replacer === "function")
|
|
@@ -25130,7 +25130,7 @@ var require_set2 = __commonJS((exports) => {
|
|
|
25130
25130
|
nodeClass: YAMLSet,
|
|
25131
25131
|
default: false,
|
|
25132
25132
|
tag: "tag:yaml.org,2002:set",
|
|
25133
|
-
createNode: (
|
|
25133
|
+
createNode: (schema10, iterable, ctx) => YAMLSet.from(schema10, iterable, ctx),
|
|
25134
25134
|
resolve(map2, onError) {
|
|
25135
25135
|
if (identity3.isMap(map2)) {
|
|
25136
25136
|
if (map2.hasAllNullValues(true))
|
|
@@ -25243,7 +25243,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
25243
25243
|
var pairs = require_pairs2();
|
|
25244
25244
|
var set2 = require_set2();
|
|
25245
25245
|
var timestamp = require_timestamp2();
|
|
25246
|
-
var
|
|
25246
|
+
var schema10 = [
|
|
25247
25247
|
map2.map,
|
|
25248
25248
|
seq.seq,
|
|
25249
25249
|
string4.string,
|
|
@@ -25266,7 +25266,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
25266
25266
|
timestamp.floatTime,
|
|
25267
25267
|
timestamp.timestamp
|
|
25268
25268
|
];
|
|
25269
|
-
exports.schema =
|
|
25269
|
+
exports.schema = schema10;
|
|
25270
25270
|
});
|
|
25271
25271
|
|
|
25272
25272
|
// ../../node_modules/yaml/dist/schema/tags.js
|
|
@@ -25278,7 +25278,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
25278
25278
|
var bool = require_bool2();
|
|
25279
25279
|
var float = require_float2();
|
|
25280
25280
|
var int2 = require_int2();
|
|
25281
|
-
var
|
|
25281
|
+
var schema10 = require_schema2();
|
|
25282
25282
|
var schema$1 = require_schema3();
|
|
25283
25283
|
var binary = require_binary2();
|
|
25284
25284
|
var merge3 = require_merge3();
|
|
@@ -25288,7 +25288,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
25288
25288
|
var set2 = require_set2();
|
|
25289
25289
|
var timestamp = require_timestamp2();
|
|
25290
25290
|
var schemas3 = new Map([
|
|
25291
|
-
["core",
|
|
25291
|
+
["core", schema10.schema],
|
|
25292
25292
|
["failsafe", [map2.map, seq.seq, string4.string]],
|
|
25293
25293
|
["json", schema$1.schema],
|
|
25294
25294
|
["yaml11", schema$2.schema],
|
|
@@ -25370,9 +25370,9 @@ var require_Schema = __commonJS((exports) => {
|
|
|
25370
25370
|
var sortMapEntriesByKey = (a2, b) => a2.key < b.key ? -1 : a2.key > b.key ? 1 : 0;
|
|
25371
25371
|
|
|
25372
25372
|
class Schema {
|
|
25373
|
-
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema:
|
|
25373
|
+
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema10, sortMapEntries, toStringDefaults }) {
|
|
25374
25374
|
this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
|
|
25375
|
-
this.name = typeof
|
|
25375
|
+
this.name = typeof schema10 === "string" && schema10 || "core";
|
|
25376
25376
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
25377
25377
|
this.tags = tags.getTags(customTags, this.name, merge3);
|
|
25378
25378
|
this.toStringOptions = toStringDefaults ?? null;
|
|
@@ -26864,11 +26864,11 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
26864
26864
|
scalar.comment = comment;
|
|
26865
26865
|
return scalar;
|
|
26866
26866
|
}
|
|
26867
|
-
function findScalarTagByName(
|
|
26867
|
+
function findScalarTagByName(schema10, value, tagName, tagToken, onError) {
|
|
26868
26868
|
if (tagName === "!")
|
|
26869
|
-
return
|
|
26869
|
+
return schema10[identity3.SCALAR];
|
|
26870
26870
|
const matchWithTest = [];
|
|
26871
|
-
for (const tag of
|
|
26871
|
+
for (const tag of schema10.tags) {
|
|
26872
26872
|
if (!tag.collection && tag.tag === tagName) {
|
|
26873
26873
|
if (tag.default && tag.test)
|
|
26874
26874
|
matchWithTest.push(tag);
|
|
@@ -26879,18 +26879,18 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
26879
26879
|
for (const tag of matchWithTest)
|
|
26880
26880
|
if (tag.test?.test(value))
|
|
26881
26881
|
return tag;
|
|
26882
|
-
const kt3 =
|
|
26882
|
+
const kt3 = schema10.knownTags[tagName];
|
|
26883
26883
|
if (kt3 && !kt3.collection) {
|
|
26884
|
-
|
|
26884
|
+
schema10.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
|
|
26885
26885
|
return kt3;
|
|
26886
26886
|
}
|
|
26887
26887
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
26888
|
-
return
|
|
26888
|
+
return schema10[identity3.SCALAR];
|
|
26889
26889
|
}
|
|
26890
|
-
function findScalarTagByTest({ atKey, directives, schema:
|
|
26891
|
-
const tag =
|
|
26892
|
-
if (
|
|
26893
|
-
const compat2 =
|
|
26890
|
+
function findScalarTagByTest({ atKey, directives, schema: schema10 }, value, token, onError) {
|
|
26891
|
+
const tag = schema10.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema10[identity3.SCALAR];
|
|
26892
|
+
if (schema10.compat) {
|
|
26893
|
+
const compat2 = schema10.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema10[identity3.SCALAR];
|
|
26894
26894
|
if (tag.tag !== compat2.tag) {
|
|
26895
26895
|
const ts = directives.tagString(tag.tag);
|
|
26896
26896
|
const cs = directives.tagString(compat2.tag);
|
|
@@ -31176,7 +31176,7 @@ function cleanDoc(doc2) {
|
|
|
31176
31176
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
31177
31177
|
}
|
|
31178
31178
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
31179
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
31179
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join22(replacement, currentDoc.split(`
|
|
31180
31180
|
`)) : currentDoc);
|
|
31181
31181
|
}
|
|
31182
31182
|
function canBreakFn(doc2) {
|
|
@@ -31256,7 +31256,7 @@ function indentIfBreak(contents, options) {
|
|
|
31256
31256
|
negate: options.negate
|
|
31257
31257
|
};
|
|
31258
31258
|
}
|
|
31259
|
-
function
|
|
31259
|
+
function join22(separator, docs) {
|
|
31260
31260
|
assertDoc(separator);
|
|
31261
31261
|
assertDocArray(docs);
|
|
31262
31262
|
const parts = [];
|
|
@@ -31967,7 +31967,7 @@ var init_doc = __esm(() => {
|
|
|
31967
31967
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
31968
31968
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
31969
31969
|
builders = {
|
|
31970
|
-
join:
|
|
31970
|
+
join: join22,
|
|
31971
31971
|
line,
|
|
31972
31972
|
softline,
|
|
31973
31973
|
hardline,
|
|
@@ -119578,11 +119578,11 @@ function chooseDescription(descriptions, printWidth) {
|
|
|
119578
119578
|
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
|
|
119579
119579
|
}
|
|
119580
119580
|
function createSchema(SchemaConstructor, parameters) {
|
|
119581
|
-
const
|
|
119582
|
-
const subSchema = Object.create(
|
|
119581
|
+
const schema11 = new SchemaConstructor(parameters);
|
|
119582
|
+
const subSchema = Object.create(schema11);
|
|
119583
119583
|
for (const handlerKey of HANDLER_KEYS) {
|
|
119584
119584
|
if (handlerKey in parameters) {
|
|
119585
|
-
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey],
|
|
119585
|
+
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema11, Schema2.prototype[handlerKey].length);
|
|
119586
119586
|
}
|
|
119587
119587
|
}
|
|
119588
119588
|
return subSchema;
|
|
@@ -119839,8 +119839,8 @@ async function loadEditorconfigInternal(file2, { shouldCache }) {
|
|
|
119839
119839
|
const directory = path52.dirname(file2);
|
|
119840
119840
|
const root2 = await findProjectRoot2(directory, { shouldCache });
|
|
119841
119841
|
const editorConfig = await import_editorconfig.default.parse(file2, { root: root2 });
|
|
119842
|
-
const
|
|
119843
|
-
return
|
|
119842
|
+
const config12 = editorconfig_to_prettier_default(editorConfig);
|
|
119843
|
+
return config12;
|
|
119844
119844
|
}
|
|
119845
119845
|
function loadEditorconfig(file2, { shouldCache }) {
|
|
119846
119846
|
file2 = path52.resolve(file2);
|
|
@@ -121830,18 +121830,18 @@ async function loadConfig(configFile) {
|
|
|
121830
121830
|
if (!load2) {
|
|
121831
121831
|
throw new Error(`No loader specified for extension "${extension || "noExt"}"`);
|
|
121832
121832
|
}
|
|
121833
|
-
let
|
|
121834
|
-
if (!
|
|
121833
|
+
let config12 = await load2(configFile);
|
|
121834
|
+
if (!config12) {
|
|
121835
121835
|
return;
|
|
121836
121836
|
}
|
|
121837
|
-
if (typeof
|
|
121838
|
-
|
|
121837
|
+
if (typeof config12 === "string") {
|
|
121838
|
+
config12 = await load_external_config_default(config12, configFile);
|
|
121839
121839
|
}
|
|
121840
|
-
if (typeof
|
|
121841
|
-
throw new TypeError(`Config is only allowed to be an object, but received ${typeof
|
|
121840
|
+
if (typeof config12 !== "object") {
|
|
121841
|
+
throw new TypeError(`Config is only allowed to be an object, but received ${typeof config12} in "${configFile}"`);
|
|
121842
121842
|
}
|
|
121843
|
-
delete
|
|
121844
|
-
return
|
|
121843
|
+
delete config12.$schema;
|
|
121844
|
+
return config12;
|
|
121845
121845
|
}
|
|
121846
121846
|
function clearPrettierConfigCache() {
|
|
121847
121847
|
loadCache.clear();
|
|
@@ -121891,8 +121891,8 @@ async function loadPrettierConfig2(file2, options8) {
|
|
|
121891
121891
|
return;
|
|
121892
121892
|
}
|
|
121893
121893
|
configFile = toPath3(configFile);
|
|
121894
|
-
const
|
|
121895
|
-
return { config:
|
|
121894
|
+
const config12 = await loadPrettierConfig(configFile, { shouldCache });
|
|
121895
|
+
return { config: config12, configFile };
|
|
121896
121896
|
}
|
|
121897
121897
|
async function resolveConfig(fileUrlOrPath, options8) {
|
|
121898
121898
|
options8 = { useCache: true, ...options8 };
|
|
@@ -121919,8 +121919,8 @@ async function resolveConfigFile(fileUrlOrPath) {
|
|
|
121919
121919
|
return result ?? null;
|
|
121920
121920
|
}
|
|
121921
121921
|
function mergeOverrides(configResult, filePath) {
|
|
121922
|
-
const { config:
|
|
121923
|
-
const { overrides, ...options8 } =
|
|
121922
|
+
const { config: config12, configFile } = configResult || {};
|
|
121923
|
+
const { overrides, ...options8 } = config12 || {};
|
|
121924
121924
|
if (filePath && overrides) {
|
|
121925
121925
|
const relativeFilePath = path102.relative(path102.dirname(configFile), filePath);
|
|
121926
121926
|
for (const override of overrides) {
|
|
@@ -122922,9 +122922,9 @@ function optionInfoToSchema(optionInfo, {
|
|
|
122922
122922
|
throw new Error(`Unexpected type ${optionInfo.type}`);
|
|
122923
122923
|
}
|
|
122924
122924
|
if (optionInfo.exception) {
|
|
122925
|
-
parameters.validate = (value,
|
|
122925
|
+
parameters.validate = (value, schema11, utils3) => optionInfo.exception(value) || schema11.validate(value, utils3);
|
|
122926
122926
|
} else {
|
|
122927
|
-
parameters.validate = (value,
|
|
122927
|
+
parameters.validate = (value, schema11, utils3) => value === undefined || schema11.validate(value, utils3);
|
|
122928
122928
|
}
|
|
122929
122929
|
if (optionInfo.redirect) {
|
|
122930
122930
|
handlers.redirect = (value) => !value ? undefined : {
|
|
@@ -122939,7 +122939,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
122939
122939
|
}
|
|
122940
122940
|
if (isCLI && !optionInfo.array) {
|
|
122941
122941
|
const originalPreprocess = parameters.preprocess || ((x10) => x10);
|
|
122942
|
-
parameters.preprocess = (value,
|
|
122942
|
+
parameters.preprocess = (value, schema11, utils3) => schema11.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
|
|
122943
122943
|
}
|
|
122944
122944
|
return optionInfo.array ? ArraySchema.create({
|
|
122945
122945
|
...isCLI ? {
|
|
@@ -124029,16 +124029,16 @@ async function getFileInfo(file2, options8 = {}) {
|
|
|
124029
124029
|
};
|
|
124030
124030
|
}
|
|
124031
124031
|
async function getParser(file2, options8) {
|
|
124032
|
-
let
|
|
124032
|
+
let config12;
|
|
124033
124033
|
if (options8.resolveConfig !== false) {
|
|
124034
|
-
|
|
124034
|
+
config12 = await resolveConfig(file2, {
|
|
124035
124035
|
editorconfig: false
|
|
124036
124036
|
});
|
|
124037
124037
|
}
|
|
124038
|
-
if (
|
|
124039
|
-
return
|
|
124038
|
+
if (config12?.parser) {
|
|
124039
|
+
return config12.parser;
|
|
124040
124040
|
}
|
|
124041
|
-
let plugins = options8.plugins ??
|
|
124041
|
+
let plugins = options8.plugins ?? config12?.plugins ?? [];
|
|
124042
124042
|
plugins = (await Promise.all([load_builtin_plugins_default(), load_plugins_default(plugins)])).flat();
|
|
124043
124043
|
return infer_parser_default({ plugins }, { physicalFile: file2 });
|
|
124044
124044
|
}
|
|
@@ -124516,9 +124516,9 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124516
124516
|
};
|
|
124517
124517
|
applyNormalization();
|
|
124518
124518
|
for (const key2 of Object.keys(this._utils.schemas)) {
|
|
124519
|
-
const
|
|
124519
|
+
const schema11 = this._utils.schemas[key2];
|
|
124520
124520
|
if (!(key2 in newOptions)) {
|
|
124521
|
-
const defaultResult = normalizeDefaultResult(
|
|
124521
|
+
const defaultResult = normalizeDefaultResult(schema11.default(this._utils));
|
|
124522
124522
|
if ("value" in defaultResult) {
|
|
124523
124523
|
restOptionsArray.push({ [key2]: defaultResult.value });
|
|
124524
124524
|
}
|
|
@@ -124529,13 +124529,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124529
124529
|
if (!(key2 in newOptions)) {
|
|
124530
124530
|
continue;
|
|
124531
124531
|
}
|
|
124532
|
-
const
|
|
124532
|
+
const schema11 = this._utils.schemas[key2];
|
|
124533
124533
|
const value = newOptions[key2];
|
|
124534
|
-
const newValue =
|
|
124534
|
+
const newValue = schema11.postprocess(value, this._utils);
|
|
124535
124535
|
if (newValue === VALUE_UNCHANGED) {
|
|
124536
124536
|
continue;
|
|
124537
124537
|
}
|
|
124538
|
-
this._applyValidation(newValue, key2,
|
|
124538
|
+
this._applyValidation(newValue, key2, schema11);
|
|
124539
124539
|
newOptions[key2] = newValue;
|
|
124540
124540
|
}
|
|
124541
124541
|
this._applyPostprocess(newOptions);
|
|
@@ -124546,14 +124546,14 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124546
124546
|
const transferredOptionsArray = [];
|
|
124547
124547
|
const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
|
|
124548
124548
|
for (const key2 of knownKeys) {
|
|
124549
|
-
const
|
|
124550
|
-
const value =
|
|
124551
|
-
this._applyValidation(value, key2,
|
|
124549
|
+
const schema11 = this._utils.schemas[key2];
|
|
124550
|
+
const value = schema11.preprocess(options8[key2], this._utils);
|
|
124551
|
+
this._applyValidation(value, key2, schema11);
|
|
124552
124552
|
const appendTransferredOptions = ({ from, to: to5 }) => {
|
|
124553
124553
|
transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
|
|
124554
124554
|
};
|
|
124555
124555
|
const warnDeprecated = ({ value: currentValue, redirectTo }) => {
|
|
124556
|
-
const deprecatedResult = normalizeDeprecatedResult(
|
|
124556
|
+
const deprecatedResult = normalizeDeprecatedResult(schema11.deprecated(currentValue, this._utils), value, true);
|
|
124557
124557
|
if (deprecatedResult === false) {
|
|
124558
124558
|
return;
|
|
124559
124559
|
}
|
|
@@ -124571,13 +124571,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124571
124571
|
}
|
|
124572
124572
|
}
|
|
124573
124573
|
};
|
|
124574
|
-
const forwardResult = normalizeForwardResult(
|
|
124574
|
+
const forwardResult = normalizeForwardResult(schema11.forward(value, this._utils), value);
|
|
124575
124575
|
forwardResult.forEach(appendTransferredOptions);
|
|
124576
|
-
const redirectResult = normalizeRedirectResult(
|
|
124576
|
+
const redirectResult = normalizeRedirectResult(schema11.redirect(value, this._utils), value);
|
|
124577
124577
|
redirectResult.redirect.forEach(appendTransferredOptions);
|
|
124578
124578
|
if ("remain" in redirectResult) {
|
|
124579
124579
|
const remainingValue = redirectResult.remain;
|
|
124580
|
-
newOptions[key2] = key2 in newOptions ?
|
|
124580
|
+
newOptions[key2] = key2 in newOptions ? schema11.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
|
|
124581
124581
|
warnDeprecated({ value: remainingValue });
|
|
124582
124582
|
}
|
|
124583
124583
|
for (const { from, to: to5 } of redirectResult.redirect) {
|
|
@@ -124605,8 +124605,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124605
124605
|
const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
|
|
124606
124606
|
return { knownKeys, unknownKeys };
|
|
124607
124607
|
}
|
|
124608
|
-
_applyValidation(value, key2,
|
|
124609
|
-
const validateResult = normalizeValidateResult(
|
|
124608
|
+
_applyValidation(value, key2, schema11) {
|
|
124609
|
+
const validateResult = normalizeValidateResult(schema11.validate(value, this._utils), value);
|
|
124610
124610
|
if (validateResult !== true) {
|
|
124611
124611
|
throw this._invalidHandler(key2, validateResult.value, this._utils);
|
|
124612
124612
|
}
|
|
@@ -124648,8 +124648,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124648
124648
|
for (const key2 of unknownKeys) {
|
|
124649
124649
|
const value = postprocessed.override[key2];
|
|
124650
124650
|
this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
|
|
124651
|
-
const
|
|
124652
|
-
this._applyValidation(knownResultValue, knownResultKey,
|
|
124651
|
+
const schema11 = this._utils.schemas[knownResultKey];
|
|
124652
|
+
this._applyValidation(knownResultValue, knownResultKey, schema11);
|
|
124653
124653
|
options8[knownResultKey] = knownResultValue;
|
|
124654
124654
|
});
|
|
124655
124655
|
}
|
|
@@ -136881,7 +136881,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
136881
136881
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
136882
136882
|
}
|
|
136883
136883
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
136884
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
136884
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join24(replacement, currentDoc.split(`
|
|
136885
136885
|
`)) : currentDoc);
|
|
136886
136886
|
}
|
|
136887
136887
|
function canBreakFn2(doc2) {
|
|
@@ -136967,7 +136967,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
136967
136967
|
negate: options8.negate
|
|
136968
136968
|
};
|
|
136969
136969
|
}
|
|
136970
|
-
function
|
|
136970
|
+
function join24(separator, docs) {
|
|
136971
136971
|
assertDoc2(separator);
|
|
136972
136972
|
assertDocArray2(docs);
|
|
136973
136973
|
const parts = [];
|
|
@@ -137632,7 +137632,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
137632
137632
|
}
|
|
137633
137633
|
}
|
|
137634
137634
|
var builders2 = {
|
|
137635
|
-
join:
|
|
137635
|
+
join: join24,
|
|
137636
137636
|
line: line3,
|
|
137637
137637
|
softline: softline2,
|
|
137638
137638
|
hardline: hardline4,
|
|
@@ -138362,23 +138362,23 @@ var require_JSONSchema = __commonJS((exports) => {
|
|
|
138362
138362
|
exports.Parent = Symbol("Parent");
|
|
138363
138363
|
exports.Types = Symbol("Types");
|
|
138364
138364
|
exports.Intersection = Symbol("Intersection");
|
|
138365
|
-
exports.getRootSchema = (0, lodash_1.memoize)((
|
|
138366
|
-
const parent =
|
|
138365
|
+
exports.getRootSchema = (0, lodash_1.memoize)((schema11) => {
|
|
138366
|
+
const parent = schema11[exports.Parent];
|
|
138367
138367
|
if (!parent) {
|
|
138368
|
-
return
|
|
138368
|
+
return schema11;
|
|
138369
138369
|
}
|
|
138370
138370
|
return (0, exports.getRootSchema)(parent);
|
|
138371
138371
|
});
|
|
138372
|
-
function isBoolean(
|
|
138373
|
-
return
|
|
138372
|
+
function isBoolean(schema11) {
|
|
138373
|
+
return schema11 === true || schema11 === false;
|
|
138374
138374
|
}
|
|
138375
138375
|
exports.isBoolean = isBoolean;
|
|
138376
|
-
function isPrimitive(
|
|
138377
|
-
return !(0, lodash_1.isPlainObject)(
|
|
138376
|
+
function isPrimitive(schema11) {
|
|
138377
|
+
return !(0, lodash_1.isPlainObject)(schema11);
|
|
138378
138378
|
}
|
|
138379
138379
|
exports.isPrimitive = isPrimitive;
|
|
138380
|
-
function isCompound(
|
|
138381
|
-
return Array.isArray(
|
|
138380
|
+
function isCompound(schema11) {
|
|
138381
|
+
return Array.isArray(schema11.type) || "anyOf" in schema11 || "oneOf" in schema11;
|
|
138382
138382
|
}
|
|
138383
138383
|
exports.isCompound = isCompound;
|
|
138384
138384
|
});
|
|
@@ -138605,9 +138605,9 @@ var require_type2 = __commonJS((exports, module) => {
|
|
|
138605
138605
|
var require_schema5 = __commonJS((exports, module) => {
|
|
138606
138606
|
var YAMLException = require_exception2();
|
|
138607
138607
|
var Type = require_type2();
|
|
138608
|
-
function compileList(
|
|
138608
|
+
function compileList(schema11, name2) {
|
|
138609
138609
|
var result = [];
|
|
138610
|
-
|
|
138610
|
+
schema11[name2].forEach(function(currentType) {
|
|
138611
138611
|
var newIndex = result.length;
|
|
138612
138612
|
result.forEach(function(previousType, previousIndex) {
|
|
138613
138613
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -140552,7 +140552,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
140552
140552
|
"OFF"
|
|
140553
140553
|
];
|
|
140554
140554
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
140555
|
-
function compileStyleMap(
|
|
140555
|
+
function compileStyleMap(schema11, map2) {
|
|
140556
140556
|
var result, keys, index, length, tag, style, type;
|
|
140557
140557
|
if (map2 === null)
|
|
140558
140558
|
return {};
|
|
@@ -140564,7 +140564,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
140564
140564
|
if (tag.slice(0, 2) === "!!") {
|
|
140565
140565
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
140566
140566
|
}
|
|
140567
|
-
type =
|
|
140567
|
+
type = schema11.compiledTypeMap["fallback"][tag];
|
|
140568
140568
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
140569
140569
|
style = type.styleAliases[style];
|
|
140570
140570
|
}
|
|
@@ -141223,11 +141223,11 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141223
141223
|
function traverseArray(arr, callback, processed) {
|
|
141224
141224
|
arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
|
|
141225
141225
|
}
|
|
141226
|
-
function traverseIntersection(
|
|
141227
|
-
if (typeof
|
|
141226
|
+
function traverseIntersection(schema11, callback, processed) {
|
|
141227
|
+
if (typeof schema11 !== "object" || !schema11) {
|
|
141228
141228
|
return;
|
|
141229
141229
|
}
|
|
141230
|
-
const r5 =
|
|
141230
|
+
const r5 = schema11;
|
|
141231
141231
|
const intersection2 = r5[JSONSchema_1.Intersection];
|
|
141232
141232
|
if (!intersection2) {
|
|
141233
141233
|
return;
|
|
@@ -141236,60 +141236,60 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141236
141236
|
traverseArray(intersection2.allOf, callback, processed);
|
|
141237
141237
|
}
|
|
141238
141238
|
}
|
|
141239
|
-
function traverse(
|
|
141240
|
-
if (processed.has(
|
|
141239
|
+
function traverse(schema11, callback, processed = new Set, key2) {
|
|
141240
|
+
if (processed.has(schema11)) {
|
|
141241
141241
|
return;
|
|
141242
141242
|
}
|
|
141243
|
-
processed.add(
|
|
141244
|
-
callback(
|
|
141245
|
-
if (
|
|
141246
|
-
traverseArray(
|
|
141243
|
+
processed.add(schema11);
|
|
141244
|
+
callback(schema11, key2 !== null && key2 !== undefined ? key2 : null);
|
|
141245
|
+
if (schema11.anyOf) {
|
|
141246
|
+
traverseArray(schema11.anyOf, callback, processed);
|
|
141247
141247
|
}
|
|
141248
|
-
if (
|
|
141249
|
-
traverseArray(
|
|
141248
|
+
if (schema11.allOf) {
|
|
141249
|
+
traverseArray(schema11.allOf, callback, processed);
|
|
141250
141250
|
}
|
|
141251
|
-
if (
|
|
141252
|
-
traverseArray(
|
|
141251
|
+
if (schema11.oneOf) {
|
|
141252
|
+
traverseArray(schema11.oneOf, callback, processed);
|
|
141253
141253
|
}
|
|
141254
|
-
if (
|
|
141255
|
-
traverseObjectKeys(
|
|
141254
|
+
if (schema11.properties) {
|
|
141255
|
+
traverseObjectKeys(schema11.properties, callback, processed);
|
|
141256
141256
|
}
|
|
141257
|
-
if (
|
|
141258
|
-
traverseObjectKeys(
|
|
141257
|
+
if (schema11.patternProperties) {
|
|
141258
|
+
traverseObjectKeys(schema11.patternProperties, callback, processed);
|
|
141259
141259
|
}
|
|
141260
|
-
if (
|
|
141261
|
-
traverse(
|
|
141260
|
+
if (schema11.additionalProperties && typeof schema11.additionalProperties === "object") {
|
|
141261
|
+
traverse(schema11.additionalProperties, callback, processed);
|
|
141262
141262
|
}
|
|
141263
|
-
if (
|
|
141264
|
-
const { items } =
|
|
141263
|
+
if (schema11.items) {
|
|
141264
|
+
const { items } = schema11;
|
|
141265
141265
|
if (Array.isArray(items)) {
|
|
141266
141266
|
traverseArray(items, callback, processed);
|
|
141267
141267
|
} else {
|
|
141268
141268
|
traverse(items, callback, processed);
|
|
141269
141269
|
}
|
|
141270
141270
|
}
|
|
141271
|
-
if (
|
|
141272
|
-
traverse(
|
|
141271
|
+
if (schema11.additionalItems && typeof schema11.additionalItems === "object") {
|
|
141272
|
+
traverse(schema11.additionalItems, callback, processed);
|
|
141273
141273
|
}
|
|
141274
|
-
if (
|
|
141275
|
-
if (Array.isArray(
|
|
141276
|
-
traverseArray(
|
|
141274
|
+
if (schema11.dependencies) {
|
|
141275
|
+
if (Array.isArray(schema11.dependencies)) {
|
|
141276
|
+
traverseArray(schema11.dependencies, callback, processed);
|
|
141277
141277
|
} else {
|
|
141278
|
-
traverseObjectKeys(
|
|
141278
|
+
traverseObjectKeys(schema11.dependencies, callback, processed);
|
|
141279
141279
|
}
|
|
141280
141280
|
}
|
|
141281
|
-
if (
|
|
141282
|
-
traverseObjectKeys(
|
|
141281
|
+
if (schema11.definitions) {
|
|
141282
|
+
traverseObjectKeys(schema11.definitions, callback, processed);
|
|
141283
141283
|
}
|
|
141284
|
-
if (
|
|
141285
|
-
traverseObjectKeys(
|
|
141284
|
+
if (schema11.$defs) {
|
|
141285
|
+
traverseObjectKeys(schema11.$defs, callback, processed);
|
|
141286
141286
|
}
|
|
141287
|
-
if (
|
|
141288
|
-
traverse(
|
|
141287
|
+
if (schema11.not) {
|
|
141288
|
+
traverse(schema11.not, callback, processed);
|
|
141289
141289
|
}
|
|
141290
|
-
traverseIntersection(
|
|
141291
|
-
Object.keys(
|
|
141292
|
-
const child =
|
|
141290
|
+
traverseIntersection(schema11, callback, processed);
|
|
141291
|
+
Object.keys(schema11).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
|
|
141292
|
+
const child = schema11[key3];
|
|
141293
141293
|
if (child && typeof child === "object") {
|
|
141294
141294
|
traverseObjectKeys(child, callback, processed);
|
|
141295
141295
|
}
|
|
@@ -141371,14 +141371,14 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141371
141371
|
return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
|
|
141372
141372
|
}
|
|
141373
141373
|
}
|
|
141374
|
-
function escapeBlockComment(
|
|
141374
|
+
function escapeBlockComment(schema11) {
|
|
141375
141375
|
const replacer = "* /";
|
|
141376
|
-
if (
|
|
141376
|
+
if (schema11 === null || typeof schema11 !== "object") {
|
|
141377
141377
|
return;
|
|
141378
141378
|
}
|
|
141379
|
-
for (const key2 of Object.keys(
|
|
141380
|
-
if (key2 === "description" && typeof
|
|
141381
|
-
|
|
141379
|
+
for (const key2 of Object.keys(schema11)) {
|
|
141380
|
+
if (key2 === "description" && typeof schema11[key2] === "string") {
|
|
141381
|
+
schema11[key2] = schema11[key2].replace(/\*\//g, replacer);
|
|
141382
141382
|
}
|
|
141383
141383
|
}
|
|
141384
141384
|
}
|
|
@@ -141390,45 +141390,45 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141390
141390
|
return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
|
|
141391
141391
|
}
|
|
141392
141392
|
exports.pathTransform = pathTransform;
|
|
141393
|
-
function maybeStripDefault(
|
|
141394
|
-
if (!("default" in
|
|
141395
|
-
return
|
|
141393
|
+
function maybeStripDefault(schema11) {
|
|
141394
|
+
if (!("default" in schema11)) {
|
|
141395
|
+
return schema11;
|
|
141396
141396
|
}
|
|
141397
|
-
switch (
|
|
141397
|
+
switch (schema11.type) {
|
|
141398
141398
|
case "array":
|
|
141399
|
-
if (Array.isArray(
|
|
141400
|
-
return
|
|
141399
|
+
if (Array.isArray(schema11.default)) {
|
|
141400
|
+
return schema11;
|
|
141401
141401
|
}
|
|
141402
141402
|
break;
|
|
141403
141403
|
case "boolean":
|
|
141404
|
-
if (typeof
|
|
141405
|
-
return
|
|
141404
|
+
if (typeof schema11.default === "boolean") {
|
|
141405
|
+
return schema11;
|
|
141406
141406
|
}
|
|
141407
141407
|
break;
|
|
141408
141408
|
case "integer":
|
|
141409
141409
|
case "number":
|
|
141410
|
-
if (typeof
|
|
141411
|
-
return
|
|
141410
|
+
if (typeof schema11.default === "number") {
|
|
141411
|
+
return schema11;
|
|
141412
141412
|
}
|
|
141413
141413
|
break;
|
|
141414
141414
|
case "string":
|
|
141415
|
-
if (typeof
|
|
141416
|
-
return
|
|
141415
|
+
if (typeof schema11.default === "string") {
|
|
141416
|
+
return schema11;
|
|
141417
141417
|
}
|
|
141418
141418
|
break;
|
|
141419
141419
|
case "null":
|
|
141420
|
-
if (
|
|
141421
|
-
return
|
|
141420
|
+
if (schema11.default === null) {
|
|
141421
|
+
return schema11;
|
|
141422
141422
|
}
|
|
141423
141423
|
break;
|
|
141424
141424
|
case "object":
|
|
141425
|
-
if ((0, lodash_1.isPlainObject)(
|
|
141426
|
-
return
|
|
141425
|
+
if ((0, lodash_1.isPlainObject)(schema11.default)) {
|
|
141426
|
+
return schema11;
|
|
141427
141427
|
}
|
|
141428
141428
|
break;
|
|
141429
141429
|
}
|
|
141430
|
-
delete
|
|
141431
|
-
return
|
|
141430
|
+
delete schema11.default;
|
|
141431
|
+
return schema11;
|
|
141432
141432
|
}
|
|
141433
141433
|
exports.maybeStripDefault = maybeStripDefault;
|
|
141434
141434
|
function appendToDescription(existingDescription, ...values) {
|
|
@@ -141442,11 +141442,11 @@ ${values.join(`
|
|
|
141442
141442
|
`);
|
|
141443
141443
|
}
|
|
141444
141444
|
exports.appendToDescription = appendToDescription;
|
|
141445
|
-
function isSchemaLike(
|
|
141446
|
-
if (!(0, lodash_1.isPlainObject)(
|
|
141445
|
+
function isSchemaLike(schema11) {
|
|
141446
|
+
if (!(0, lodash_1.isPlainObject)(schema11)) {
|
|
141447
141447
|
return false;
|
|
141448
141448
|
}
|
|
141449
|
-
const parent =
|
|
141449
|
+
const parent = schema11[JSONSchema_1.Parent];
|
|
141450
141450
|
if (parent === null) {
|
|
141451
141451
|
return true;
|
|
141452
141452
|
}
|
|
@@ -141463,7 +141463,7 @@ ${values.join(`
|
|
|
141463
141463
|
"properties",
|
|
141464
141464
|
"required"
|
|
141465
141465
|
];
|
|
141466
|
-
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] ===
|
|
141466
|
+
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema11)) {
|
|
141467
141467
|
return false;
|
|
141468
141468
|
}
|
|
141469
141469
|
return true;
|
|
@@ -141761,13 +141761,13 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141761
141761
|
exports.typesOfSchema = undefined;
|
|
141762
141762
|
var lodash_1 = require_lodash8();
|
|
141763
141763
|
var JSONSchema_1 = require_JSONSchema();
|
|
141764
|
-
function typesOfSchema(
|
|
141765
|
-
if (
|
|
141764
|
+
function typesOfSchema(schema11) {
|
|
141765
|
+
if (schema11.tsType) {
|
|
141766
141766
|
return new Set(["CUSTOM_TYPE"]);
|
|
141767
141767
|
}
|
|
141768
141768
|
const matchedTypes = new Set;
|
|
141769
141769
|
for (const [schemaType, f7] of Object.entries(matchers)) {
|
|
141770
|
-
if (f7(
|
|
141770
|
+
if (f7(schema11)) {
|
|
141771
141771
|
matchedTypes.add(schemaType);
|
|
141772
141772
|
}
|
|
141773
141773
|
}
|
|
@@ -141778,26 +141778,26 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141778
141778
|
}
|
|
141779
141779
|
exports.typesOfSchema = typesOfSchema;
|
|
141780
141780
|
var matchers = {
|
|
141781
|
-
ALL_OF(
|
|
141782
|
-
return "allOf" in
|
|
141781
|
+
ALL_OF(schema11) {
|
|
141782
|
+
return "allOf" in schema11;
|
|
141783
141783
|
},
|
|
141784
|
-
ANY(
|
|
141785
|
-
if (Object.keys(
|
|
141784
|
+
ANY(schema11) {
|
|
141785
|
+
if (Object.keys(schema11).length === 0) {
|
|
141786
141786
|
return true;
|
|
141787
141787
|
}
|
|
141788
|
-
return
|
|
141788
|
+
return schema11.type === "any";
|
|
141789
141789
|
},
|
|
141790
|
-
ANY_OF(
|
|
141791
|
-
return "anyOf" in
|
|
141790
|
+
ANY_OF(schema11) {
|
|
141791
|
+
return "anyOf" in schema11;
|
|
141792
141792
|
},
|
|
141793
|
-
BOOLEAN(
|
|
141794
|
-
if ("enum" in
|
|
141793
|
+
BOOLEAN(schema11) {
|
|
141794
|
+
if ("enum" in schema11) {
|
|
141795
141795
|
return false;
|
|
141796
141796
|
}
|
|
141797
|
-
if (
|
|
141797
|
+
if (schema11.type === "boolean") {
|
|
141798
141798
|
return true;
|
|
141799
141799
|
}
|
|
141800
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141800
|
+
if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "boolean") {
|
|
141801
141801
|
return true;
|
|
141802
141802
|
}
|
|
141803
141803
|
return false;
|
|
@@ -141805,74 +141805,74 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141805
141805
|
CUSTOM_TYPE() {
|
|
141806
141806
|
return false;
|
|
141807
141807
|
},
|
|
141808
|
-
NAMED_ENUM(
|
|
141809
|
-
return "enum" in
|
|
141808
|
+
NAMED_ENUM(schema11) {
|
|
141809
|
+
return "enum" in schema11 && "tsEnumNames" in schema11;
|
|
141810
141810
|
},
|
|
141811
|
-
NAMED_SCHEMA(
|
|
141812
|
-
return "$id" in
|
|
141811
|
+
NAMED_SCHEMA(schema11) {
|
|
141812
|
+
return "$id" in schema11 && (("patternProperties" in schema11) || ("properties" in schema11));
|
|
141813
141813
|
},
|
|
141814
|
-
NEVER(
|
|
141815
|
-
return
|
|
141814
|
+
NEVER(schema11) {
|
|
141815
|
+
return schema11 === false;
|
|
141816
141816
|
},
|
|
141817
|
-
NULL(
|
|
141818
|
-
return
|
|
141817
|
+
NULL(schema11) {
|
|
141818
|
+
return schema11.type === "null";
|
|
141819
141819
|
},
|
|
141820
|
-
NUMBER(
|
|
141821
|
-
if ("enum" in
|
|
141820
|
+
NUMBER(schema11) {
|
|
141821
|
+
if ("enum" in schema11) {
|
|
141822
141822
|
return false;
|
|
141823
141823
|
}
|
|
141824
|
-
if (
|
|
141824
|
+
if (schema11.type === "integer" || schema11.type === "number") {
|
|
141825
141825
|
return true;
|
|
141826
141826
|
}
|
|
141827
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141827
|
+
if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "number") {
|
|
141828
141828
|
return true;
|
|
141829
141829
|
}
|
|
141830
141830
|
return false;
|
|
141831
141831
|
},
|
|
141832
|
-
OBJECT(
|
|
141833
|
-
return
|
|
141832
|
+
OBJECT(schema11) {
|
|
141833
|
+
return schema11.type === "object" && !(0, lodash_1.isPlainObject)(schema11.additionalProperties) && !schema11.allOf && !schema11.anyOf && !schema11.oneOf && !schema11.patternProperties && !schema11.properties && !schema11.required;
|
|
141834
141834
|
},
|
|
141835
|
-
ONE_OF(
|
|
141836
|
-
return "oneOf" in
|
|
141835
|
+
ONE_OF(schema11) {
|
|
141836
|
+
return "oneOf" in schema11;
|
|
141837
141837
|
},
|
|
141838
|
-
REFERENCE(
|
|
141839
|
-
return "$ref" in
|
|
141838
|
+
REFERENCE(schema11) {
|
|
141839
|
+
return "$ref" in schema11;
|
|
141840
141840
|
},
|
|
141841
|
-
STRING(
|
|
141842
|
-
if ("enum" in
|
|
141841
|
+
STRING(schema11) {
|
|
141842
|
+
if ("enum" in schema11) {
|
|
141843
141843
|
return false;
|
|
141844
141844
|
}
|
|
141845
|
-
if (
|
|
141845
|
+
if (schema11.type === "string") {
|
|
141846
141846
|
return true;
|
|
141847
141847
|
}
|
|
141848
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141848
|
+
if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "string") {
|
|
141849
141849
|
return true;
|
|
141850
141850
|
}
|
|
141851
141851
|
return false;
|
|
141852
141852
|
},
|
|
141853
|
-
TYPED_ARRAY(
|
|
141854
|
-
if (
|
|
141853
|
+
TYPED_ARRAY(schema11) {
|
|
141854
|
+
if (schema11.type && schema11.type !== "array") {
|
|
141855
141855
|
return false;
|
|
141856
141856
|
}
|
|
141857
|
-
return "items" in
|
|
141857
|
+
return "items" in schema11;
|
|
141858
141858
|
},
|
|
141859
|
-
UNION(
|
|
141860
|
-
return Array.isArray(
|
|
141859
|
+
UNION(schema11) {
|
|
141860
|
+
return Array.isArray(schema11.type);
|
|
141861
141861
|
},
|
|
141862
|
-
UNNAMED_ENUM(
|
|
141863
|
-
if ("tsEnumNames" in
|
|
141862
|
+
UNNAMED_ENUM(schema11) {
|
|
141863
|
+
if ("tsEnumNames" in schema11) {
|
|
141864
141864
|
return false;
|
|
141865
141865
|
}
|
|
141866
|
-
if (
|
|
141866
|
+
if (schema11.type && schema11.type !== "boolean" && schema11.type !== "integer" && schema11.type !== "number" && schema11.type !== "string") {
|
|
141867
141867
|
return false;
|
|
141868
141868
|
}
|
|
141869
|
-
return "enum" in
|
|
141869
|
+
return "enum" in schema11;
|
|
141870
141870
|
},
|
|
141871
141871
|
UNNAMED_SCHEMA() {
|
|
141872
141872
|
return false;
|
|
141873
141873
|
},
|
|
141874
|
-
UNTYPED_ARRAY(
|
|
141875
|
-
return
|
|
141874
|
+
UNTYPED_ARRAY(schema11) {
|
|
141875
|
+
return schema11.type === "array" && !("items" in schema11);
|
|
141876
141876
|
}
|
|
141877
141877
|
};
|
|
141878
141878
|
});
|
|
@@ -141883,10 +141883,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
141883
141883
|
exports.applySchemaTyping = undefined;
|
|
141884
141884
|
var JSONSchema_1 = require_JSONSchema();
|
|
141885
141885
|
var typesOfSchema_1 = require_typesOfSchema();
|
|
141886
|
-
function applySchemaTyping(
|
|
141886
|
+
function applySchemaTyping(schema11) {
|
|
141887
141887
|
var _a7;
|
|
141888
|
-
const types = (0, typesOfSchema_1.typesOfSchema)(
|
|
141889
|
-
Object.defineProperty(
|
|
141888
|
+
const types = (0, typesOfSchema_1.typesOfSchema)(schema11);
|
|
141889
|
+
Object.defineProperty(schema11, JSONSchema_1.Types, {
|
|
141890
141890
|
enumerable: false,
|
|
141891
141891
|
value: types,
|
|
141892
141892
|
writable: false
|
|
@@ -141895,23 +141895,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
141895
141895
|
return;
|
|
141896
141896
|
}
|
|
141897
141897
|
const intersection2 = {
|
|
141898
|
-
[JSONSchema_1.Parent]:
|
|
141898
|
+
[JSONSchema_1.Parent]: schema11,
|
|
141899
141899
|
[JSONSchema_1.Types]: new Set(["ALL_OF"]),
|
|
141900
|
-
$id:
|
|
141901
|
-
description:
|
|
141902
|
-
name:
|
|
141903
|
-
title:
|
|
141904
|
-
allOf: (_a7 =
|
|
141900
|
+
$id: schema11.$id,
|
|
141901
|
+
description: schema11.description,
|
|
141902
|
+
name: schema11.name,
|
|
141903
|
+
title: schema11.title,
|
|
141904
|
+
allOf: (_a7 = schema11.allOf) !== null && _a7 !== undefined ? _a7 : [],
|
|
141905
141905
|
required: [],
|
|
141906
141906
|
additionalProperties: false
|
|
141907
141907
|
};
|
|
141908
141908
|
types.delete("ALL_OF");
|
|
141909
|
-
delete
|
|
141910
|
-
delete
|
|
141911
|
-
delete
|
|
141912
|
-
delete
|
|
141913
|
-
delete
|
|
141914
|
-
Object.defineProperty(
|
|
141909
|
+
delete schema11.allOf;
|
|
141910
|
+
delete schema11.$id;
|
|
141911
|
+
delete schema11.description;
|
|
141912
|
+
delete schema11.name;
|
|
141913
|
+
delete schema11.title;
|
|
141914
|
+
Object.defineProperty(schema11, JSONSchema_1.Intersection, {
|
|
141915
141915
|
enumerable: false,
|
|
141916
141916
|
value: intersection2,
|
|
141917
141917
|
writable: false
|
|
@@ -141929,186 +141929,186 @@ var require_normalizer = __commonJS((exports) => {
|
|
|
141929
141929
|
var applySchemaTyping_1 = require_applySchemaTyping();
|
|
141930
141930
|
var util_1 = __require("util");
|
|
141931
141931
|
var rules = new Map;
|
|
141932
|
-
function hasType(
|
|
141933
|
-
return
|
|
141932
|
+
function hasType(schema11, type) {
|
|
141933
|
+
return schema11.type === type || Array.isArray(schema11.type) && schema11.type.includes(type);
|
|
141934
141934
|
}
|
|
141935
|
-
function isObjectType(
|
|
141936
|
-
return
|
|
141935
|
+
function isObjectType(schema11) {
|
|
141936
|
+
return schema11.properties !== undefined || hasType(schema11, "object") || hasType(schema11, "any");
|
|
141937
141937
|
}
|
|
141938
|
-
function isArrayType(
|
|
141939
|
-
return
|
|
141938
|
+
function isArrayType(schema11) {
|
|
141939
|
+
return schema11.items !== undefined || hasType(schema11, "array") || hasType(schema11, "any");
|
|
141940
141940
|
}
|
|
141941
|
-
function isEnumTypeWithoutTsEnumNames(
|
|
141942
|
-
return
|
|
141941
|
+
function isEnumTypeWithoutTsEnumNames(schema11) {
|
|
141942
|
+
return schema11.type === "string" && schema11.enum !== undefined && schema11.tsEnumNames === undefined;
|
|
141943
141943
|
}
|
|
141944
|
-
rules.set('Remove `type=["null"]` if `enum=[null]`', (
|
|
141945
|
-
if (Array.isArray(
|
|
141946
|
-
|
|
141944
|
+
rules.set('Remove `type=["null"]` if `enum=[null]`', (schema11) => {
|
|
141945
|
+
if (Array.isArray(schema11.enum) && schema11.enum.some((e8) => e8 === null) && Array.isArray(schema11.type) && schema11.type.includes("null")) {
|
|
141946
|
+
schema11.type = schema11.type.filter((type) => type !== "null");
|
|
141947
141947
|
}
|
|
141948
141948
|
});
|
|
141949
|
-
rules.set("Destructure unary types", (
|
|
141950
|
-
if (
|
|
141951
|
-
|
|
141949
|
+
rules.set("Destructure unary types", (schema11) => {
|
|
141950
|
+
if (schema11.type && Array.isArray(schema11.type) && schema11.type.length === 1) {
|
|
141951
|
+
schema11.type = schema11.type[0];
|
|
141952
141952
|
}
|
|
141953
141953
|
});
|
|
141954
|
-
rules.set("Add empty `required` property if none is defined", (
|
|
141955
|
-
if (isObjectType(
|
|
141956
|
-
|
|
141954
|
+
rules.set("Add empty `required` property if none is defined", (schema11) => {
|
|
141955
|
+
if (isObjectType(schema11) && !("required" in schema11)) {
|
|
141956
|
+
schema11.required = [];
|
|
141957
141957
|
}
|
|
141958
141958
|
});
|
|
141959
|
-
rules.set("Transform `required`=false to `required`=[]", (
|
|
141960
|
-
if (
|
|
141961
|
-
|
|
141959
|
+
rules.set("Transform `required`=false to `required`=[]", (schema11) => {
|
|
141960
|
+
if (schema11.required === false) {
|
|
141961
|
+
schema11.required = [];
|
|
141962
141962
|
}
|
|
141963
141963
|
});
|
|
141964
|
-
rules.set("Default additionalProperties", (
|
|
141965
|
-
if (isObjectType(
|
|
141966
|
-
|
|
141964
|
+
rules.set("Default additionalProperties", (schema11, _10, options8) => {
|
|
141965
|
+
if (isObjectType(schema11) && !("additionalProperties" in schema11) && schema11.patternProperties === undefined) {
|
|
141966
|
+
schema11.additionalProperties = options8.additionalProperties;
|
|
141967
141967
|
}
|
|
141968
141968
|
});
|
|
141969
|
-
rules.set("Transform id to $id", (
|
|
141970
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
141969
|
+
rules.set("Transform id to $id", (schema11, fileName) => {
|
|
141970
|
+
if (!(0, utils_1.isSchemaLike)(schema11)) {
|
|
141971
141971
|
return;
|
|
141972
141972
|
}
|
|
141973
|
-
if (
|
|
141974
|
-
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${
|
|
141973
|
+
if (schema11.id && schema11.$id && schema11.id !== schema11.$id) {
|
|
141974
|
+
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema11.id}, $id=${schema11.$id} in ${fileName}`);
|
|
141975
141975
|
}
|
|
141976
|
-
if (
|
|
141977
|
-
|
|
141978
|
-
delete
|
|
141976
|
+
if (schema11.id) {
|
|
141977
|
+
schema11.$id = schema11.id;
|
|
141978
|
+
delete schema11.id;
|
|
141979
141979
|
}
|
|
141980
141980
|
});
|
|
141981
|
-
rules.set("Add an $id to anything that needs it", (
|
|
141982
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
141981
|
+
rules.set("Add an $id to anything that needs it", (schema11, fileName, _options, _key, dereferencedPaths) => {
|
|
141982
|
+
if (!(0, utils_1.isSchemaLike)(schema11)) {
|
|
141983
141983
|
return;
|
|
141984
141984
|
}
|
|
141985
|
-
if (!
|
|
141986
|
-
|
|
141985
|
+
if (!schema11.$id && !schema11[JSONSchema_1.Parent]) {
|
|
141986
|
+
schema11.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
|
|
141987
141987
|
return;
|
|
141988
141988
|
}
|
|
141989
|
-
if (!isArrayType(
|
|
141989
|
+
if (!isArrayType(schema11) && !isObjectType(schema11)) {
|
|
141990
141990
|
return;
|
|
141991
141991
|
}
|
|
141992
|
-
const dereferencedName = dereferencedPaths.get(
|
|
141993
|
-
if (!
|
|
141994
|
-
|
|
141992
|
+
const dereferencedName = dereferencedPaths.get(schema11);
|
|
141993
|
+
if (!schema11.$id && !schema11.title && dereferencedName) {
|
|
141994
|
+
schema11.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
|
|
141995
141995
|
}
|
|
141996
141996
|
if (dereferencedName) {
|
|
141997
|
-
dereferencedPaths.delete(
|
|
141997
|
+
dereferencedPaths.delete(schema11);
|
|
141998
141998
|
}
|
|
141999
141999
|
});
|
|
142000
|
-
rules.set("Escape closing JSDoc comment", (
|
|
142001
|
-
(0, utils_1.escapeBlockComment)(
|
|
142000
|
+
rules.set("Escape closing JSDoc comment", (schema11) => {
|
|
142001
|
+
(0, utils_1.escapeBlockComment)(schema11);
|
|
142002
142002
|
});
|
|
142003
|
-
rules.set("Add JSDoc comments for minItems and maxItems", (
|
|
142004
|
-
if (!isArrayType(
|
|
142003
|
+
rules.set("Add JSDoc comments for minItems and maxItems", (schema11) => {
|
|
142004
|
+
if (!isArrayType(schema11)) {
|
|
142005
142005
|
return;
|
|
142006
142006
|
}
|
|
142007
142007
|
const commentsToAppend = [
|
|
142008
|
-
"minItems" in
|
|
142009
|
-
"maxItems" in
|
|
142008
|
+
"minItems" in schema11 ? `@minItems ${schema11.minItems}` : "",
|
|
142009
|
+
"maxItems" in schema11 ? `@maxItems ${schema11.maxItems}` : ""
|
|
142010
142010
|
].filter(Boolean);
|
|
142011
142011
|
if (commentsToAppend.length) {
|
|
142012
|
-
|
|
142012
|
+
schema11.description = (0, utils_1.appendToDescription)(schema11.description, ...commentsToAppend);
|
|
142013
142013
|
}
|
|
142014
142014
|
});
|
|
142015
|
-
rules.set("Optionally remove maxItems and minItems", (
|
|
142016
|
-
if (!isArrayType(
|
|
142015
|
+
rules.set("Optionally remove maxItems and minItems", (schema11, _fileName, options8) => {
|
|
142016
|
+
if (!isArrayType(schema11)) {
|
|
142017
142017
|
return;
|
|
142018
142018
|
}
|
|
142019
|
-
if ("minItems" in
|
|
142020
|
-
delete
|
|
142019
|
+
if ("minItems" in schema11 && options8.ignoreMinAndMaxItems) {
|
|
142020
|
+
delete schema11.minItems;
|
|
142021
142021
|
}
|
|
142022
|
-
if ("maxItems" in
|
|
142023
|
-
delete
|
|
142022
|
+
if ("maxItems" in schema11 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
|
|
142023
|
+
delete schema11.maxItems;
|
|
142024
142024
|
}
|
|
142025
142025
|
});
|
|
142026
|
-
rules.set("Normalize schema.minItems", (
|
|
142026
|
+
rules.set("Normalize schema.minItems", (schema11, _fileName, options8) => {
|
|
142027
142027
|
if (options8.ignoreMinAndMaxItems) {
|
|
142028
142028
|
return;
|
|
142029
142029
|
}
|
|
142030
|
-
if (!isArrayType(
|
|
142030
|
+
if (!isArrayType(schema11)) {
|
|
142031
142031
|
return;
|
|
142032
142032
|
}
|
|
142033
|
-
const { minItems } =
|
|
142034
|
-
|
|
142033
|
+
const { minItems } = schema11;
|
|
142034
|
+
schema11.minItems = typeof minItems === "number" ? minItems : 0;
|
|
142035
142035
|
});
|
|
142036
|
-
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (
|
|
142036
|
+
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema11, _fileName, options8) => {
|
|
142037
142037
|
if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
|
|
142038
142038
|
return;
|
|
142039
142039
|
}
|
|
142040
|
-
if (!isArrayType(
|
|
142040
|
+
if (!isArrayType(schema11)) {
|
|
142041
142041
|
return;
|
|
142042
142042
|
}
|
|
142043
|
-
const { maxItems, minItems } =
|
|
142043
|
+
const { maxItems, minItems } = schema11;
|
|
142044
142044
|
if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
|
|
142045
|
-
delete
|
|
142045
|
+
delete schema11.maxItems;
|
|
142046
142046
|
}
|
|
142047
142047
|
});
|
|
142048
|
-
rules.set("Normalize schema.items", (
|
|
142048
|
+
rules.set("Normalize schema.items", (schema11, _fileName, options8) => {
|
|
142049
142049
|
if (options8.ignoreMinAndMaxItems) {
|
|
142050
142050
|
return;
|
|
142051
142051
|
}
|
|
142052
|
-
const { maxItems, minItems } =
|
|
142052
|
+
const { maxItems, minItems } = schema11;
|
|
142053
142053
|
const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
|
|
142054
142054
|
const hasMinItems = typeof minItems === "number" && minItems > 0;
|
|
142055
|
-
if (
|
|
142056
|
-
const items =
|
|
142055
|
+
if (schema11.items && !Array.isArray(schema11.items) && (hasMaxItems || hasMinItems)) {
|
|
142056
|
+
const items = schema11.items;
|
|
142057
142057
|
const newItems = Array(maxItems || minItems || 0).fill(items);
|
|
142058
142058
|
if (!hasMaxItems) {
|
|
142059
|
-
|
|
142059
|
+
schema11.additionalItems = items;
|
|
142060
142060
|
}
|
|
142061
|
-
|
|
142061
|
+
schema11.items = newItems;
|
|
142062
142062
|
}
|
|
142063
|
-
if (Array.isArray(
|
|
142064
|
-
|
|
142063
|
+
if (Array.isArray(schema11.items) && hasMaxItems && maxItems < schema11.items.length) {
|
|
142064
|
+
schema11.items = schema11.items.slice(0, maxItems);
|
|
142065
142065
|
}
|
|
142066
|
-
return
|
|
142066
|
+
return schema11;
|
|
142067
142067
|
});
|
|
142068
|
-
rules.set("Remove extends, if it is empty", (
|
|
142069
|
-
if (!
|
|
142068
|
+
rules.set("Remove extends, if it is empty", (schema11) => {
|
|
142069
|
+
if (!schema11.hasOwnProperty("extends")) {
|
|
142070
142070
|
return;
|
|
142071
142071
|
}
|
|
142072
|
-
if (
|
|
142073
|
-
delete
|
|
142072
|
+
if (schema11.extends == null || Array.isArray(schema11.extends) && schema11.extends.length === 0) {
|
|
142073
|
+
delete schema11.extends;
|
|
142074
142074
|
}
|
|
142075
142075
|
});
|
|
142076
|
-
rules.set("Make extends always an array, if it is defined", (
|
|
142077
|
-
if (
|
|
142076
|
+
rules.set("Make extends always an array, if it is defined", (schema11) => {
|
|
142077
|
+
if (schema11.extends == null) {
|
|
142078
142078
|
return;
|
|
142079
142079
|
}
|
|
142080
|
-
if (!Array.isArray(
|
|
142081
|
-
|
|
142080
|
+
if (!Array.isArray(schema11.extends)) {
|
|
142081
|
+
schema11.extends = [schema11.extends];
|
|
142082
142082
|
}
|
|
142083
142083
|
});
|
|
142084
|
-
rules.set("Transform definitions to $defs", (
|
|
142085
|
-
if (
|
|
142086
|
-
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${
|
|
142084
|
+
rules.set("Transform definitions to $defs", (schema11, fileName) => {
|
|
142085
|
+
if (schema11.definitions && schema11.$defs && !(0, util_1.isDeepStrictEqual)(schema11.definitions, schema11.$defs)) {
|
|
142086
|
+
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema11.id} in ${fileName}`);
|
|
142087
142087
|
}
|
|
142088
|
-
if (
|
|
142089
|
-
|
|
142090
|
-
delete
|
|
142088
|
+
if (schema11.definitions) {
|
|
142089
|
+
schema11.$defs = schema11.definitions;
|
|
142090
|
+
delete schema11.definitions;
|
|
142091
142091
|
}
|
|
142092
142092
|
});
|
|
142093
|
-
rules.set("Transform const to singleton enum", (
|
|
142094
|
-
if (
|
|
142095
|
-
|
|
142096
|
-
delete
|
|
142093
|
+
rules.set("Transform const to singleton enum", (schema11) => {
|
|
142094
|
+
if (schema11.const !== undefined) {
|
|
142095
|
+
schema11.enum = [schema11.const];
|
|
142096
|
+
delete schema11.const;
|
|
142097
142097
|
}
|
|
142098
142098
|
});
|
|
142099
|
-
rules.set("Add tsEnumNames to enum types", (
|
|
142099
|
+
rules.set("Add tsEnumNames to enum types", (schema11, _10, options8) => {
|
|
142100
142100
|
var _a7;
|
|
142101
|
-
if (isEnumTypeWithoutTsEnumNames(
|
|
142102
|
-
|
|
142101
|
+
if (isEnumTypeWithoutTsEnumNames(schema11) && options8.inferStringEnumKeysFromValues) {
|
|
142102
|
+
schema11.tsEnumNames = (_a7 = schema11.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
|
|
142103
142103
|
}
|
|
142104
142104
|
});
|
|
142105
|
-
rules.set("Pre-calculate schema types and intersections", (
|
|
142106
|
-
if (
|
|
142107
|
-
(0, applySchemaTyping_1.applySchemaTyping)(
|
|
142105
|
+
rules.set("Pre-calculate schema types and intersections", (schema11) => {
|
|
142106
|
+
if (schema11 !== null && typeof schema11 === "object") {
|
|
142107
|
+
(0, applySchemaTyping_1.applySchemaTyping)(schema11);
|
|
142108
142108
|
}
|
|
142109
142109
|
});
|
|
142110
142110
|
function normalize2(rootSchema, dereferencedPaths, filename, options8) {
|
|
142111
|
-
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (
|
|
142111
|
+
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema11, key2) => rule(schema11, filename, options8, key2, dereferencedPaths)));
|
|
142112
142112
|
return rootSchema;
|
|
142113
142113
|
}
|
|
142114
142114
|
exports.normalize = normalize2;
|
|
@@ -142190,37 +142190,37 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142190
142190
|
var AST_1 = require_AST();
|
|
142191
142191
|
var JSONSchema_1 = require_JSONSchema();
|
|
142192
142192
|
var utils_1 = require_utils7();
|
|
142193
|
-
function parse11(
|
|
142194
|
-
if ((0, JSONSchema_1.isPrimitive)(
|
|
142195
|
-
if ((0, JSONSchema_1.isBoolean)(
|
|
142196
|
-
return parseBooleanSchema(
|
|
142193
|
+
function parse11(schema11, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142194
|
+
if ((0, JSONSchema_1.isPrimitive)(schema11)) {
|
|
142195
|
+
if ((0, JSONSchema_1.isBoolean)(schema11)) {
|
|
142196
|
+
return parseBooleanSchema(schema11, keyName, options8);
|
|
142197
142197
|
}
|
|
142198
|
-
return parseLiteral(
|
|
142198
|
+
return parseLiteral(schema11, keyName);
|
|
142199
142199
|
}
|
|
142200
|
-
const intersection2 =
|
|
142201
|
-
const types =
|
|
142200
|
+
const intersection2 = schema11[JSONSchema_1.Intersection];
|
|
142201
|
+
const types = schema11[JSONSchema_1.Types];
|
|
142202
142202
|
if (intersection2) {
|
|
142203
142203
|
const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
|
|
142204
142204
|
types.forEach((type) => {
|
|
142205
|
-
ast.params.push(parseAsTypeWithCache(
|
|
142205
|
+
ast.params.push(parseAsTypeWithCache(schema11, type, options8, keyName, processed, usedNames));
|
|
142206
142206
|
});
|
|
142207
|
-
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:",
|
|
142207
|
+
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema11, "Output:", ast);
|
|
142208
142208
|
return ast;
|
|
142209
142209
|
}
|
|
142210
142210
|
if (types.size === 1) {
|
|
142211
142211
|
const type = [...types][0];
|
|
142212
|
-
const ast = parseAsTypeWithCache(
|
|
142213
|
-
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:",
|
|
142212
|
+
const ast = parseAsTypeWithCache(schema11, type, options8, keyName, processed, usedNames);
|
|
142213
|
+
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema11, "Output:", ast);
|
|
142214
142214
|
return ast;
|
|
142215
142215
|
}
|
|
142216
142216
|
throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
|
|
142217
142217
|
}
|
|
142218
142218
|
exports.parse = parse11;
|
|
142219
|
-
function parseAsTypeWithCache(
|
|
142220
|
-
let cachedTypeMap = processed.get(
|
|
142219
|
+
function parseAsTypeWithCache(schema11, type, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142220
|
+
let cachedTypeMap = processed.get(schema11);
|
|
142221
142221
|
if (!cachedTypeMap) {
|
|
142222
142222
|
cachedTypeMap = new Map;
|
|
142223
|
-
processed.set(
|
|
142223
|
+
processed.set(schema11, cachedTypeMap);
|
|
142224
142224
|
}
|
|
142225
142225
|
const cachedAST = cachedTypeMap.get(type);
|
|
142226
142226
|
if (cachedAST) {
|
|
@@ -142228,10 +142228,10 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142228
142228
|
}
|
|
142229
142229
|
const ast = {};
|
|
142230
142230
|
cachedTypeMap.set(type, ast);
|
|
142231
|
-
return Object.assign(ast, parseNonLiteral(
|
|
142231
|
+
return Object.assign(ast, parseNonLiteral(schema11, type, options8, keyName, processed, usedNames));
|
|
142232
142232
|
}
|
|
142233
|
-
function parseBooleanSchema(
|
|
142234
|
-
if (
|
|
142233
|
+
function parseBooleanSchema(schema11, keyName, options8) {
|
|
142234
|
+
if (schema11) {
|
|
142235
142235
|
return {
|
|
142236
142236
|
keyName,
|
|
142237
142237
|
type: options8.unknownAny ? "UNKNOWN" : "ANY"
|
|
@@ -142242,157 +142242,157 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142242
142242
|
type: "NEVER"
|
|
142243
142243
|
};
|
|
142244
142244
|
}
|
|
142245
|
-
function parseLiteral(
|
|
142245
|
+
function parseLiteral(schema11, keyName) {
|
|
142246
142246
|
return {
|
|
142247
142247
|
keyName,
|
|
142248
|
-
params:
|
|
142248
|
+
params: schema11,
|
|
142249
142249
|
type: "LITERAL"
|
|
142250
142250
|
};
|
|
142251
142251
|
}
|
|
142252
|
-
function parseNonLiteral(
|
|
142253
|
-
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(
|
|
142254
|
-
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 ===
|
|
142252
|
+
function parseNonLiteral(schema11, type, options8, keyName, processed, usedNames) {
|
|
142253
|
+
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema11));
|
|
142254
|
+
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema11);
|
|
142255
142255
|
switch (type) {
|
|
142256
142256
|
case "ALL_OF":
|
|
142257
142257
|
return {
|
|
142258
|
-
comment:
|
|
142259
|
-
deprecated:
|
|
142258
|
+
comment: schema11.description,
|
|
142259
|
+
deprecated: schema11.deprecated,
|
|
142260
142260
|
keyName,
|
|
142261
|
-
standaloneName: standaloneName(
|
|
142262
|
-
params:
|
|
142261
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142262
|
+
params: schema11.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142263
142263
|
type: "INTERSECTION"
|
|
142264
142264
|
};
|
|
142265
142265
|
case "ANY":
|
|
142266
|
-
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment:
|
|
142266
|
+
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema11.description, deprecated: schema11.deprecated, keyName, standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8) });
|
|
142267
142267
|
case "ANY_OF":
|
|
142268
142268
|
return {
|
|
142269
|
-
comment:
|
|
142270
|
-
deprecated:
|
|
142269
|
+
comment: schema11.description,
|
|
142270
|
+
deprecated: schema11.deprecated,
|
|
142271
142271
|
keyName,
|
|
142272
|
-
standaloneName: standaloneName(
|
|
142273
|
-
params:
|
|
142272
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142273
|
+
params: schema11.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142274
142274
|
type: "UNION"
|
|
142275
142275
|
};
|
|
142276
142276
|
case "BOOLEAN":
|
|
142277
142277
|
return {
|
|
142278
|
-
comment:
|
|
142279
|
-
deprecated:
|
|
142278
|
+
comment: schema11.description,
|
|
142279
|
+
deprecated: schema11.deprecated,
|
|
142280
142280
|
keyName,
|
|
142281
|
-
standaloneName: standaloneName(
|
|
142281
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142282
142282
|
type: "BOOLEAN"
|
|
142283
142283
|
};
|
|
142284
142284
|
case "CUSTOM_TYPE":
|
|
142285
142285
|
return {
|
|
142286
|
-
comment:
|
|
142287
|
-
deprecated:
|
|
142286
|
+
comment: schema11.description,
|
|
142287
|
+
deprecated: schema11.deprecated,
|
|
142288
142288
|
keyName,
|
|
142289
|
-
params:
|
|
142290
|
-
standaloneName: standaloneName(
|
|
142289
|
+
params: schema11.tsType,
|
|
142290
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142291
142291
|
type: "CUSTOM_TYPE"
|
|
142292
142292
|
};
|
|
142293
142293
|
case "NAMED_ENUM":
|
|
142294
142294
|
return {
|
|
142295
|
-
comment:
|
|
142296
|
-
deprecated:
|
|
142295
|
+
comment: schema11.description,
|
|
142296
|
+
deprecated: schema11.deprecated,
|
|
142297
142297
|
keyName,
|
|
142298
|
-
standaloneName: standaloneName(
|
|
142299
|
-
params:
|
|
142298
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
|
|
142299
|
+
params: schema11.enum.map((_10, n5) => ({
|
|
142300
142300
|
ast: parseLiteral(_10, undefined),
|
|
142301
|
-
keyName:
|
|
142301
|
+
keyName: schema11.tsEnumNames[n5]
|
|
142302
142302
|
})),
|
|
142303
142303
|
type: "ENUM"
|
|
142304
142304
|
};
|
|
142305
142305
|
case "NAMED_SCHEMA":
|
|
142306
|
-
return newInterface(
|
|
142306
|
+
return newInterface(schema11, options8, processed, usedNames, keyName);
|
|
142307
142307
|
case "NEVER":
|
|
142308
142308
|
return {
|
|
142309
|
-
comment:
|
|
142310
|
-
deprecated:
|
|
142309
|
+
comment: schema11.description,
|
|
142310
|
+
deprecated: schema11.deprecated,
|
|
142311
142311
|
keyName,
|
|
142312
|
-
standaloneName: standaloneName(
|
|
142312
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142313
142313
|
type: "NEVER"
|
|
142314
142314
|
};
|
|
142315
142315
|
case "NULL":
|
|
142316
142316
|
return {
|
|
142317
|
-
comment:
|
|
142318
|
-
deprecated:
|
|
142317
|
+
comment: schema11.description,
|
|
142318
|
+
deprecated: schema11.deprecated,
|
|
142319
142319
|
keyName,
|
|
142320
|
-
standaloneName: standaloneName(
|
|
142320
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142321
142321
|
type: "NULL"
|
|
142322
142322
|
};
|
|
142323
142323
|
case "NUMBER":
|
|
142324
142324
|
return {
|
|
142325
|
-
comment:
|
|
142326
|
-
deprecated:
|
|
142325
|
+
comment: schema11.description,
|
|
142326
|
+
deprecated: schema11.deprecated,
|
|
142327
142327
|
keyName,
|
|
142328
|
-
standaloneName: standaloneName(
|
|
142328
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142329
142329
|
type: "NUMBER"
|
|
142330
142330
|
};
|
|
142331
142331
|
case "OBJECT":
|
|
142332
142332
|
return {
|
|
142333
|
-
comment:
|
|
142333
|
+
comment: schema11.description,
|
|
142334
142334
|
keyName,
|
|
142335
|
-
standaloneName: standaloneName(
|
|
142335
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142336
142336
|
type: "OBJECT",
|
|
142337
|
-
deprecated:
|
|
142337
|
+
deprecated: schema11.deprecated
|
|
142338
142338
|
};
|
|
142339
142339
|
case "ONE_OF":
|
|
142340
142340
|
return {
|
|
142341
|
-
comment:
|
|
142342
|
-
deprecated:
|
|
142341
|
+
comment: schema11.description,
|
|
142342
|
+
deprecated: schema11.deprecated,
|
|
142343
142343
|
keyName,
|
|
142344
|
-
standaloneName: standaloneName(
|
|
142345
|
-
params:
|
|
142344
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142345
|
+
params: schema11.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142346
142346
|
type: "UNION"
|
|
142347
142347
|
};
|
|
142348
142348
|
case "REFERENCE":
|
|
142349
|
-
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!",
|
|
142349
|
+
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema11));
|
|
142350
142350
|
case "STRING":
|
|
142351
142351
|
return {
|
|
142352
|
-
comment:
|
|
142353
|
-
deprecated:
|
|
142352
|
+
comment: schema11.description,
|
|
142353
|
+
deprecated: schema11.deprecated,
|
|
142354
142354
|
keyName,
|
|
142355
|
-
standaloneName: standaloneName(
|
|
142355
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142356
142356
|
type: "STRING"
|
|
142357
142357
|
};
|
|
142358
142358
|
case "TYPED_ARRAY":
|
|
142359
|
-
if (Array.isArray(
|
|
142360
|
-
const minItems2 =
|
|
142361
|
-
const maxItems2 =
|
|
142359
|
+
if (Array.isArray(schema11.items)) {
|
|
142360
|
+
const minItems2 = schema11.minItems;
|
|
142361
|
+
const maxItems2 = schema11.maxItems;
|
|
142362
142362
|
const arrayType = {
|
|
142363
|
-
comment:
|
|
142364
|
-
deprecated:
|
|
142363
|
+
comment: schema11.description,
|
|
142364
|
+
deprecated: schema11.deprecated,
|
|
142365
142365
|
keyName,
|
|
142366
142366
|
maxItems: maxItems2,
|
|
142367
142367
|
minItems: minItems2,
|
|
142368
|
-
standaloneName: standaloneName(
|
|
142369
|
-
params:
|
|
142368
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142369
|
+
params: schema11.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142370
142370
|
type: "TUPLE"
|
|
142371
142371
|
};
|
|
142372
|
-
if (
|
|
142372
|
+
if (schema11.additionalItems === true) {
|
|
142373
142373
|
arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
142374
|
-
} else if (
|
|
142375
|
-
arrayType.spreadParam = parse11(
|
|
142374
|
+
} else if (schema11.additionalItems) {
|
|
142375
|
+
arrayType.spreadParam = parse11(schema11.additionalItems, options8, undefined, processed, usedNames);
|
|
142376
142376
|
}
|
|
142377
142377
|
return arrayType;
|
|
142378
142378
|
} else {
|
|
142379
142379
|
return {
|
|
142380
|
-
comment:
|
|
142381
|
-
deprecated:
|
|
142380
|
+
comment: schema11.description,
|
|
142381
|
+
deprecated: schema11.deprecated,
|
|
142382
142382
|
keyName,
|
|
142383
|
-
standaloneName: standaloneName(
|
|
142384
|
-
params: parse11(
|
|
142383
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142384
|
+
params: parse11(schema11.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
|
|
142385
142385
|
type: "ARRAY"
|
|
142386
142386
|
};
|
|
142387
142387
|
}
|
|
142388
142388
|
case "UNION":
|
|
142389
142389
|
return {
|
|
142390
|
-
comment:
|
|
142391
|
-
deprecated:
|
|
142390
|
+
comment: schema11.description,
|
|
142391
|
+
deprecated: schema11.deprecated,
|
|
142392
142392
|
keyName,
|
|
142393
|
-
standaloneName: standaloneName(
|
|
142394
|
-
params:
|
|
142395
|
-
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(
|
|
142393
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142394
|
+
params: schema11.type.map((type2) => {
|
|
142395
|
+
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema11, "$id", "description", "title")), { type: type2 });
|
|
142396
142396
|
(0, utils_1.maybeStripDefault)(member);
|
|
142397
142397
|
(0, applySchemaTyping_1.applySchemaTyping)(member);
|
|
142398
142398
|
return parse11(member, options8, undefined, processed, usedNames);
|
|
@@ -142401,80 +142401,80 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142401
142401
|
};
|
|
142402
142402
|
case "UNNAMED_ENUM":
|
|
142403
142403
|
return {
|
|
142404
|
-
comment:
|
|
142405
|
-
deprecated:
|
|
142404
|
+
comment: schema11.description,
|
|
142405
|
+
deprecated: schema11.deprecated,
|
|
142406
142406
|
keyName,
|
|
142407
|
-
standaloneName: standaloneName(
|
|
142408
|
-
params:
|
|
142407
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142408
|
+
params: schema11.enum.map((_10) => parseLiteral(_10, undefined)),
|
|
142409
142409
|
type: "UNION"
|
|
142410
142410
|
};
|
|
142411
142411
|
case "UNNAMED_SCHEMA":
|
|
142412
|
-
return newInterface(
|
|
142412
|
+
return newInterface(schema11, options8, processed, usedNames, keyName, keyNameFromDefinition);
|
|
142413
142413
|
case "UNTYPED_ARRAY":
|
|
142414
|
-
const minItems =
|
|
142415
|
-
const maxItems = typeof
|
|
142414
|
+
const minItems = schema11.minItems;
|
|
142415
|
+
const maxItems = typeof schema11.maxItems === "number" ? schema11.maxItems : -1;
|
|
142416
142416
|
const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
142417
142417
|
if (minItems > 0 || maxItems >= 0) {
|
|
142418
142418
|
return {
|
|
142419
|
-
comment:
|
|
142420
|
-
deprecated:
|
|
142419
|
+
comment: schema11.description,
|
|
142420
|
+
deprecated: schema11.deprecated,
|
|
142421
142421
|
keyName,
|
|
142422
|
-
maxItems:
|
|
142422
|
+
maxItems: schema11.maxItems,
|
|
142423
142423
|
minItems,
|
|
142424
142424
|
params: Array(Math.max(maxItems, minItems) || 0).fill(params),
|
|
142425
142425
|
spreadParam: maxItems >= 0 ? undefined : params,
|
|
142426
|
-
standaloneName: standaloneName(
|
|
142426
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142427
142427
|
type: "TUPLE"
|
|
142428
142428
|
};
|
|
142429
142429
|
}
|
|
142430
142430
|
return {
|
|
142431
|
-
comment:
|
|
142432
|
-
deprecated:
|
|
142431
|
+
comment: schema11.description,
|
|
142432
|
+
deprecated: schema11.deprecated,
|
|
142433
142433
|
keyName,
|
|
142434
142434
|
params,
|
|
142435
|
-
standaloneName: standaloneName(
|
|
142435
|
+
standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
|
|
142436
142436
|
type: "ARRAY"
|
|
142437
142437
|
};
|
|
142438
142438
|
}
|
|
142439
142439
|
}
|
|
142440
|
-
function standaloneName(
|
|
142440
|
+
function standaloneName(schema11, keyNameFromDefinition, usedNames, options8) {
|
|
142441
142441
|
var _a7;
|
|
142442
|
-
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8,
|
|
142442
|
+
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema11, keyNameFromDefinition)) || schema11.title || schema11.$id || keyNameFromDefinition;
|
|
142443
142443
|
if (name2) {
|
|
142444
142444
|
return (0, utils_1.generateName)(name2, usedNames);
|
|
142445
142445
|
}
|
|
142446
142446
|
}
|
|
142447
|
-
function newInterface(
|
|
142448
|
-
const name2 = standaloneName(
|
|
142447
|
+
function newInterface(schema11, options8, processed, usedNames, keyName, keyNameFromDefinition) {
|
|
142448
|
+
const name2 = standaloneName(schema11, keyNameFromDefinition, usedNames, options8);
|
|
142449
142449
|
return {
|
|
142450
|
-
comment:
|
|
142451
|
-
deprecated:
|
|
142450
|
+
comment: schema11.description,
|
|
142451
|
+
deprecated: schema11.deprecated,
|
|
142452
142452
|
keyName,
|
|
142453
|
-
params: parseSchema(
|
|
142453
|
+
params: parseSchema(schema11, options8, processed, usedNames, name2),
|
|
142454
142454
|
standaloneName: name2,
|
|
142455
|
-
superTypes: parseSuperTypes(
|
|
142455
|
+
superTypes: parseSuperTypes(schema11, options8, processed, usedNames),
|
|
142456
142456
|
type: "INTERFACE"
|
|
142457
142457
|
};
|
|
142458
142458
|
}
|
|
142459
|
-
function parseSuperTypes(
|
|
142460
|
-
const superTypes =
|
|
142459
|
+
function parseSuperTypes(schema11, options8, processed, usedNames) {
|
|
142460
|
+
const superTypes = schema11.extends;
|
|
142461
142461
|
if (!superTypes) {
|
|
142462
142462
|
return [];
|
|
142463
142463
|
}
|
|
142464
142464
|
return superTypes.map((_10) => parse11(_10, options8, undefined, processed, usedNames));
|
|
142465
142465
|
}
|
|
142466
|
-
function parseSchema(
|
|
142467
|
-
let asts = (0, lodash_1.map)(
|
|
142466
|
+
function parseSchema(schema11, options8, processed, usedNames, parentSchemaName) {
|
|
142467
|
+
let asts = (0, lodash_1.map)(schema11.properties, (value, key2) => ({
|
|
142468
142468
|
ast: parse11(value, options8, key2, processed, usedNames),
|
|
142469
142469
|
isPatternProperty: false,
|
|
142470
|
-
isRequired: (0, lodash_1.includes)(
|
|
142470
|
+
isRequired: (0, lodash_1.includes)(schema11.required || [], key2),
|
|
142471
142471
|
isUnreachableDefinition: false,
|
|
142472
142472
|
keyName: key2
|
|
142473
142473
|
}));
|
|
142474
142474
|
let singlePatternProperty = false;
|
|
142475
|
-
if (
|
|
142476
|
-
singlePatternProperty = !
|
|
142477
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
142475
|
+
if (schema11.patternProperties) {
|
|
142476
|
+
singlePatternProperty = !schema11.additionalProperties && Object.keys(schema11.patternProperties).length === 1;
|
|
142477
|
+
asts = asts.concat((0, lodash_1.map)(schema11.patternProperties, (value, key2) => {
|
|
142478
142478
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
142479
142479
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
|
|
142480
142480
|
via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
|
|
@@ -142484,14 +142484,14 @@ ${comment}` : comment;
|
|
|
142484
142484
|
return {
|
|
142485
142485
|
ast,
|
|
142486
142486
|
isPatternProperty: !singlePatternProperty,
|
|
142487
|
-
isRequired: singlePatternProperty || (0, lodash_1.includes)(
|
|
142487
|
+
isRequired: singlePatternProperty || (0, lodash_1.includes)(schema11.required || [], key2),
|
|
142488
142488
|
isUnreachableDefinition: false,
|
|
142489
142489
|
keyName: singlePatternProperty ? "[k: string]" : key2
|
|
142490
142490
|
};
|
|
142491
142491
|
}));
|
|
142492
142492
|
}
|
|
142493
142493
|
if (options8.unreachableDefinitions) {
|
|
142494
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
142494
|
+
asts = asts.concat((0, lodash_1.map)(schema11.$defs, (value, key2) => {
|
|
142495
142495
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
142496
142496
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
|
|
142497
142497
|
via the \`definition\` "${key2}".`;
|
|
@@ -142501,13 +142501,13 @@ ${comment}` : comment;
|
|
|
142501
142501
|
return {
|
|
142502
142502
|
ast,
|
|
142503
142503
|
isPatternProperty: false,
|
|
142504
|
-
isRequired: (0, lodash_1.includes)(
|
|
142504
|
+
isRequired: (0, lodash_1.includes)(schema11.required || [], key2),
|
|
142505
142505
|
isUnreachableDefinition: true,
|
|
142506
142506
|
keyName: key2
|
|
142507
142507
|
};
|
|
142508
142508
|
}));
|
|
142509
142509
|
}
|
|
142510
|
-
switch (
|
|
142510
|
+
switch (schema11.additionalProperties) {
|
|
142511
142511
|
case undefined:
|
|
142512
142512
|
case true:
|
|
142513
142513
|
if (singlePatternProperty) {
|
|
@@ -142524,7 +142524,7 @@ ${comment}` : comment;
|
|
|
142524
142524
|
return asts;
|
|
142525
142525
|
default:
|
|
142526
142526
|
return asts.concat({
|
|
142527
|
-
ast: parse11(
|
|
142527
|
+
ast: parse11(schema11.additionalProperties, options8, "[k: string]", processed, usedNames),
|
|
142528
142528
|
isPatternProperty: false,
|
|
142529
142529
|
isRequired: true,
|
|
142530
142530
|
isUnreachableDefinition: false,
|
|
@@ -142532,22 +142532,22 @@ ${comment}` : comment;
|
|
|
142532
142532
|
});
|
|
142533
142533
|
}
|
|
142534
142534
|
}
|
|
142535
|
-
function getDefinitions(
|
|
142536
|
-
if (processed.has(
|
|
142535
|
+
function getDefinitions(schema11, isSchema = true, processed = new Set) {
|
|
142536
|
+
if (processed.has(schema11)) {
|
|
142537
142537
|
return {};
|
|
142538
142538
|
}
|
|
142539
|
-
processed.add(
|
|
142540
|
-
if (Array.isArray(
|
|
142541
|
-
return
|
|
142539
|
+
processed.add(schema11);
|
|
142540
|
+
if (Array.isArray(schema11)) {
|
|
142541
|
+
return schema11.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
|
|
142542
142542
|
}
|
|
142543
|
-
if ((0, lodash_1.isPlainObject)(
|
|
142544
|
-
return Object.assign(Object.assign({}, isSchema && hasDefinitions(
|
|
142543
|
+
if ((0, lodash_1.isPlainObject)(schema11)) {
|
|
142544
|
+
return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema11) ? schema11.$defs : {}), Object.keys(schema11).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema11[cur], false, processed)), {}));
|
|
142545
142545
|
}
|
|
142546
142546
|
return {};
|
|
142547
142547
|
}
|
|
142548
142548
|
var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
|
|
142549
|
-
function hasDefinitions(
|
|
142550
|
-
return "$defs" in
|
|
142549
|
+
function hasDefinitions(schema11) {
|
|
142550
|
+
return "$defs" in schema11;
|
|
142551
142551
|
}
|
|
142552
142552
|
});
|
|
142553
142553
|
|
|
@@ -144371,7 +144371,7 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144371
144371
|
var options_js_1 = require_options();
|
|
144372
144372
|
function normalizeArgs(_args) {
|
|
144373
144373
|
let path18;
|
|
144374
|
-
let
|
|
144374
|
+
let schema11;
|
|
144375
144375
|
let options8;
|
|
144376
144376
|
let callback;
|
|
144377
144377
|
const args = Array.prototype.slice.call(_args);
|
|
@@ -144381,15 +144381,15 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144381
144381
|
if (typeof args[0] === "string") {
|
|
144382
144382
|
path18 = args[0];
|
|
144383
144383
|
if (typeof args[2] === "object") {
|
|
144384
|
-
|
|
144384
|
+
schema11 = args[1];
|
|
144385
144385
|
options8 = args[2];
|
|
144386
144386
|
} else {
|
|
144387
|
-
|
|
144387
|
+
schema11 = undefined;
|
|
144388
144388
|
options8 = args[1];
|
|
144389
144389
|
}
|
|
144390
144390
|
} else {
|
|
144391
144391
|
path18 = "";
|
|
144392
|
-
|
|
144392
|
+
schema11 = args[0];
|
|
144393
144393
|
options8 = args[1];
|
|
144394
144394
|
}
|
|
144395
144395
|
try {
|
|
@@ -144397,12 +144397,12 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144397
144397
|
} catch (e8) {
|
|
144398
144398
|
console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
|
|
144399
144399
|
}
|
|
144400
|
-
if (!options8.mutateInputSchema && typeof
|
|
144401
|
-
|
|
144400
|
+
if (!options8.mutateInputSchema && typeof schema11 === "object") {
|
|
144401
|
+
schema11 = JSON.parse(JSON.stringify(schema11));
|
|
144402
144402
|
}
|
|
144403
144403
|
return {
|
|
144404
144404
|
path: path18,
|
|
144405
|
-
schema:
|
|
144405
|
+
schema: schema11,
|
|
144406
144406
|
options: options8,
|
|
144407
144407
|
callback
|
|
144408
144408
|
};
|
|
@@ -145191,12 +145191,12 @@ var require_resolver = __commonJS((exports) => {
|
|
|
145191
145191
|
var json_schema_ref_parser_1 = require_lib3();
|
|
145192
145192
|
var utils_1 = require_utils7();
|
|
145193
145193
|
function dereference(schema_1, _a7) {
|
|
145194
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
145195
|
-
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd,
|
|
145194
|
+
return __awaiter(this, arguments, undefined, function* (schema11, { cwd, $refOptions }) {
|
|
145195
|
+
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema11);
|
|
145196
145196
|
const parser2 = new json_schema_ref_parser_1.$RefParser;
|
|
145197
145197
|
const dereferencedPaths = new WeakMap;
|
|
145198
|
-
const dereferencedSchema = yield parser2.dereference(cwd,
|
|
145199
|
-
dereferencedPaths.set(
|
|
145198
|
+
const dereferencedSchema = yield parser2.dereference(cwd, schema11, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema12) {
|
|
145199
|
+
dereferencedPaths.set(schema12, $ref);
|
|
145200
145200
|
} }) }));
|
|
145201
145201
|
return { dereferencedPaths, dereferencedSchema };
|
|
145202
145202
|
});
|
|
@@ -145210,46 +145210,46 @@ var require_validator = __commonJS((exports) => {
|
|
|
145210
145210
|
exports.validate = undefined;
|
|
145211
145211
|
var utils_1 = require_utils7();
|
|
145212
145212
|
var rules = new Map;
|
|
145213
|
-
rules.set("Enum members and tsEnumNames must be of the same length", (
|
|
145214
|
-
if (
|
|
145213
|
+
rules.set("Enum members and tsEnumNames must be of the same length", (schema11) => {
|
|
145214
|
+
if (schema11.enum && schema11.tsEnumNames && schema11.enum.length !== schema11.tsEnumNames.length) {
|
|
145215
145215
|
return false;
|
|
145216
145216
|
}
|
|
145217
145217
|
});
|
|
145218
|
-
rules.set("tsEnumNames must be an array of strings", (
|
|
145219
|
-
if (
|
|
145218
|
+
rules.set("tsEnumNames must be an array of strings", (schema11) => {
|
|
145219
|
+
if (schema11.tsEnumNames && schema11.tsEnumNames.some((_10) => typeof _10 !== "string")) {
|
|
145220
145220
|
return false;
|
|
145221
145221
|
}
|
|
145222
145222
|
});
|
|
145223
|
-
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (
|
|
145224
|
-
const { maxItems, minItems } =
|
|
145223
|
+
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema11) => {
|
|
145224
|
+
const { maxItems, minItems } = schema11;
|
|
145225
145225
|
if (typeof maxItems === "number" && typeof minItems === "number") {
|
|
145226
145226
|
return maxItems >= minItems;
|
|
145227
145227
|
}
|
|
145228
145228
|
});
|
|
145229
|
-
rules.set("When maxItems exists, maxItems >= 0", (
|
|
145230
|
-
const { maxItems } =
|
|
145229
|
+
rules.set("When maxItems exists, maxItems >= 0", (schema11) => {
|
|
145230
|
+
const { maxItems } = schema11;
|
|
145231
145231
|
if (typeof maxItems === "number") {
|
|
145232
145232
|
return maxItems >= 0;
|
|
145233
145233
|
}
|
|
145234
145234
|
});
|
|
145235
|
-
rules.set("When minItems exists, minItems >= 0", (
|
|
145236
|
-
const { minItems } =
|
|
145235
|
+
rules.set("When minItems exists, minItems >= 0", (schema11) => {
|
|
145236
|
+
const { minItems } = schema11;
|
|
145237
145237
|
if (typeof minItems === "number") {
|
|
145238
145238
|
return minItems >= 0;
|
|
145239
145239
|
}
|
|
145240
145240
|
});
|
|
145241
|
-
rules.set("deprecated must be a boolean", (
|
|
145242
|
-
const typeOfDeprecated = typeof
|
|
145241
|
+
rules.set("deprecated must be a boolean", (schema11) => {
|
|
145242
|
+
const typeOfDeprecated = typeof schema11.deprecated;
|
|
145243
145243
|
return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
|
|
145244
145244
|
});
|
|
145245
|
-
function validate2(
|
|
145245
|
+
function validate2(schema11, filename) {
|
|
145246
145246
|
const errors5 = [];
|
|
145247
145247
|
rules.forEach((rule, ruleName) => {
|
|
145248
|
-
(0, utils_1.traverse)(
|
|
145249
|
-
if (rule(
|
|
145248
|
+
(0, utils_1.traverse)(schema11, (schema12, key2) => {
|
|
145249
|
+
if (rule(schema12) === false) {
|
|
145250
145250
|
errors5.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
|
|
145251
145251
|
}
|
|
145252
|
-
return
|
|
145252
|
+
return schema12;
|
|
145253
145253
|
});
|
|
145254
145254
|
});
|
|
145255
145255
|
return errors5;
|
|
@@ -145263,25 +145263,25 @@ var require_linker = __commonJS((exports) => {
|
|
|
145263
145263
|
exports.link = undefined;
|
|
145264
145264
|
var JSONSchema_1 = require_JSONSchema();
|
|
145265
145265
|
var lodash_1 = require_lodash8();
|
|
145266
|
-
function link2(
|
|
145267
|
-
if (!Array.isArray(
|
|
145268
|
-
return
|
|
145266
|
+
function link2(schema11, parent = null) {
|
|
145267
|
+
if (!Array.isArray(schema11) && !(0, lodash_1.isPlainObject)(schema11)) {
|
|
145268
|
+
return schema11;
|
|
145269
145269
|
}
|
|
145270
|
-
if (
|
|
145271
|
-
return
|
|
145270
|
+
if (schema11.hasOwnProperty(JSONSchema_1.Parent)) {
|
|
145271
|
+
return schema11;
|
|
145272
145272
|
}
|
|
145273
|
-
Object.defineProperty(
|
|
145273
|
+
Object.defineProperty(schema11, JSONSchema_1.Parent, {
|
|
145274
145274
|
enumerable: false,
|
|
145275
145275
|
value: parent,
|
|
145276
145276
|
writable: false
|
|
145277
145277
|
});
|
|
145278
|
-
if (Array.isArray(
|
|
145279
|
-
|
|
145278
|
+
if (Array.isArray(schema11)) {
|
|
145279
|
+
schema11.forEach((child) => link2(child, schema11));
|
|
145280
145280
|
}
|
|
145281
|
-
for (const key2 in
|
|
145282
|
-
link2(
|
|
145281
|
+
for (const key2 in schema11) {
|
|
145282
|
+
link2(schema11[key2], schema11);
|
|
145283
145283
|
}
|
|
145284
|
-
return
|
|
145284
|
+
return schema11;
|
|
145285
145285
|
}
|
|
145286
145286
|
exports.link = link2;
|
|
145287
145287
|
});
|
|
@@ -145373,8 +145373,8 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145373
145373
|
unknownAny: true
|
|
145374
145374
|
};
|
|
145375
145375
|
function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
|
|
145376
|
-
const
|
|
145377
|
-
return compile(
|
|
145376
|
+
const schema11 = parseAsJSONSchema(filename);
|
|
145377
|
+
return compile(schema11, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
|
|
145378
145378
|
}
|
|
145379
145379
|
exports.compileFromFile = compileFromFile;
|
|
145380
145380
|
function parseAsJSONSchema(filename) {
|
|
@@ -145384,7 +145384,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145384
145384
|
return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
|
|
145385
145385
|
}
|
|
145386
145386
|
function compile(schema_1, name_1) {
|
|
145387
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
145387
|
+
return __awaiter(this, arguments, undefined, function* (schema11, name2, options8 = {}) {
|
|
145388
145388
|
(0, optionValidator_1.validateOptions)(options8);
|
|
145389
145389
|
const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
|
|
145390
145390
|
const start = Date.now();
|
|
@@ -145394,7 +145394,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145394
145394
|
if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
|
|
145395
145395
|
_options.cwd += "/";
|
|
145396
145396
|
}
|
|
145397
|
-
const _schema = (0, lodash_1.cloneDeep)(
|
|
145397
|
+
const _schema = (0, lodash_1.cloneDeep)(schema11);
|
|
145398
145398
|
const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
|
|
145399
145399
|
if (process.env.VERBOSE) {
|
|
145400
145400
|
if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
|
|
@@ -164109,10 +164109,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164109
164109
|
var debug = require_src4()("express:view");
|
|
164110
164110
|
var path18 = __require("node:path");
|
|
164111
164111
|
var fs28 = __require("node:fs");
|
|
164112
|
-
var
|
|
164112
|
+
var dirname19 = path18.dirname;
|
|
164113
164113
|
var basename6 = path18.basename;
|
|
164114
164114
|
var extname2 = path18.extname;
|
|
164115
|
-
var
|
|
164115
|
+
var join25 = path18.join;
|
|
164116
164116
|
var resolve13 = path18.resolve;
|
|
164117
164117
|
module.exports = View;
|
|
164118
164118
|
function View(name2, options8) {
|
|
@@ -164148,7 +164148,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164148
164148
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
164149
164149
|
var root2 = roots[i5];
|
|
164150
164150
|
var loc = resolve13(root2, name2);
|
|
164151
|
-
var dir =
|
|
164151
|
+
var dir = dirname19(loc);
|
|
164152
164152
|
var file2 = basename6(loc);
|
|
164153
164153
|
path19 = this.resolve(dir, file2);
|
|
164154
164154
|
}
|
|
@@ -164174,12 +164174,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164174
164174
|
};
|
|
164175
164175
|
View.prototype.resolve = function resolve14(dir, file2) {
|
|
164176
164176
|
var ext = this.ext;
|
|
164177
|
-
var path19 =
|
|
164177
|
+
var path19 = join25(dir, file2);
|
|
164178
164178
|
var stat2 = tryStat(path19);
|
|
164179
164179
|
if (stat2 && stat2.isFile()) {
|
|
164180
164180
|
return path19;
|
|
164181
164181
|
}
|
|
164182
|
-
path19 =
|
|
164182
|
+
path19 = join25(dir, basename6(file2, ext), "index" + ext);
|
|
164183
164183
|
stat2 = tryStat(path19);
|
|
164184
164184
|
if (stat2 && stat2.isFile()) {
|
|
164185
164185
|
return path19;
|
|
@@ -167874,7 +167874,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167874
167874
|
var Stream2 = __require("stream");
|
|
167875
167875
|
var util2 = __require("util");
|
|
167876
167876
|
var extname2 = path18.extname;
|
|
167877
|
-
var
|
|
167877
|
+
var join25 = path18.join;
|
|
167878
167878
|
var normalize2 = path18.normalize;
|
|
167879
167879
|
var resolve13 = path18.resolve;
|
|
167880
167880
|
var sep = path18.sep;
|
|
@@ -168046,7 +168046,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168046
168046
|
return res;
|
|
168047
168047
|
}
|
|
168048
168048
|
parts = path19.split(sep);
|
|
168049
|
-
path19 = normalize2(
|
|
168049
|
+
path19 = normalize2(join25(root2, path19));
|
|
168050
168050
|
} else {
|
|
168051
168051
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
168052
168052
|
debug('malicious path "%s"', path19);
|
|
@@ -168186,7 +168186,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168186
168186
|
return self2.onStatError(err);
|
|
168187
168187
|
return self2.error(404);
|
|
168188
168188
|
}
|
|
168189
|
-
var p4 =
|
|
168189
|
+
var p4 = join25(path19, self2._index[i5]);
|
|
168190
168190
|
debug('stat "%s"', p4);
|
|
168191
168191
|
fs28.stat(p4, function(err2, stat2) {
|
|
168192
168192
|
if (err2)
|
|
@@ -169284,18 +169284,18 @@ var require_common7 = __commonJS((exports) => {
|
|
|
169284
169284
|
retSegs.push.apply(retSegs, lastSegs);
|
|
169285
169285
|
return retSegs.join("?");
|
|
169286
169286
|
};
|
|
169287
|
-
common2.rewriteCookieProperty = function rewriteCookieProperty(header2,
|
|
169287
|
+
common2.rewriteCookieProperty = function rewriteCookieProperty(header2, config12, property) {
|
|
169288
169288
|
if (Array.isArray(header2)) {
|
|
169289
169289
|
return header2.map(function(headerElement) {
|
|
169290
|
-
return rewriteCookieProperty(headerElement,
|
|
169290
|
+
return rewriteCookieProperty(headerElement, config12, property);
|
|
169291
169291
|
});
|
|
169292
169292
|
}
|
|
169293
169293
|
return header2.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), function(match, prefix, previousValue) {
|
|
169294
169294
|
var newValue;
|
|
169295
|
-
if (previousValue in
|
|
169296
|
-
newValue =
|
|
169297
|
-
} else if ("*" in
|
|
169298
|
-
newValue =
|
|
169295
|
+
if (previousValue in config12) {
|
|
169296
|
+
newValue = config12[previousValue];
|
|
169297
|
+
} else if ("*" in config12) {
|
|
169298
|
+
newValue = config12["*"];
|
|
169299
169299
|
} else {
|
|
169300
169300
|
return match;
|
|
169301
169301
|
}
|
|
@@ -170660,9 +170660,9 @@ var require_router2 = __commonJS((exports) => {
|
|
|
170660
170660
|
var is_plain_object_1 = require_is_plain_object();
|
|
170661
170661
|
var debug_1 = require_debug4();
|
|
170662
170662
|
var debug = debug_1.Debug.extend("router");
|
|
170663
|
-
async function getTarget(req,
|
|
170663
|
+
async function getTarget(req, config12) {
|
|
170664
170664
|
let newTarget;
|
|
170665
|
-
const router =
|
|
170665
|
+
const router = config12.router;
|
|
170666
170666
|
if ((0, is_plain_object_1.isPlainObject)(router)) {
|
|
170667
170667
|
newTarget = getTargetFromProxyTable(req, router);
|
|
170668
170668
|
} else if (typeof router === "function") {
|
|
@@ -217632,7 +217632,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
217632
217632
|
}
|
|
217633
217633
|
}, {
|
|
217634
217634
|
key: "join",
|
|
217635
|
-
value: function
|
|
217635
|
+
value: function join27(s5) {
|
|
217636
217636
|
if (this.length === 0)
|
|
217637
217637
|
return "";
|
|
217638
217638
|
var p4 = this.head;
|
|
@@ -237049,7 +237049,7 @@ function normalizeBase44Env() {
|
|
|
237049
237049
|
loadProjectEnvFiles();
|
|
237050
237050
|
|
|
237051
237051
|
// src/cli/index.ts
|
|
237052
|
-
import { dirname as
|
|
237052
|
+
import { dirname as dirname24, join as join30 } from "node:path";
|
|
237053
237053
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
237054
237054
|
|
|
237055
237055
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -238256,8 +238256,8 @@ var {
|
|
|
238256
238256
|
Help
|
|
238257
238257
|
} = import__.default;
|
|
238258
238258
|
|
|
238259
|
-
// src/cli/commands/
|
|
238260
|
-
import { dirname as dirname10, join as
|
|
238259
|
+
// src/cli/commands/agents/pull.ts
|
|
238260
|
+
import { dirname as dirname10, join as join14 } from "node:path";
|
|
238261
238261
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
238262
238262
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
238263
238263
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -239072,7 +239072,6 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
239072
239072
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
239073
239073
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
239074
239074
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
239075
|
-
agentSkillsDir: exports_external.string().optional().default("agent-skills"),
|
|
239076
239075
|
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
239077
239076
|
authDir: exports_external.string().optional().default("auth"),
|
|
239078
239077
|
plugin: PluginMetadataSchema.optional(),
|
|
@@ -244982,7 +244981,7 @@ async function getSiteUrl() {
|
|
|
244982
244981
|
return result.data.url;
|
|
244983
244982
|
}
|
|
244984
244983
|
// src/core/project/config.ts
|
|
244985
|
-
import { dirname as dirname8, join as
|
|
244984
|
+
import { dirname as dirname8, join as join10 } from "node:path";
|
|
244986
244985
|
|
|
244987
244986
|
// src/core/project/plugins.ts
|
|
244988
244987
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -245045,7 +245044,6 @@ var AgentConfigSchema = exports_external.looseObject({
|
|
|
245045
245044
|
description: exports_external.string().trim().min(1, "Description is required"),
|
|
245046
245045
|
instructions: exports_external.string().trim().min(1, "Instructions are required"),
|
|
245047
245046
|
tool_configs: exports_external.array(ToolConfigSchema).optional().default([]),
|
|
245048
|
-
selected_skill_names: exports_external.array(exports_external.string()).optional().default([]),
|
|
245049
245047
|
memory_config: MemoryConfigSchema.optional(),
|
|
245050
245048
|
whatsapp_greeting: exports_external.string().nullable().optional()
|
|
245051
245049
|
});
|
|
@@ -245189,145 +245187,6 @@ var agentResource = {
|
|
|
245189
245187
|
readAll: readAllAgents,
|
|
245190
245188
|
push: pushAgents
|
|
245191
245189
|
};
|
|
245192
|
-
// src/core/resources/agent-skill/schema.ts
|
|
245193
|
-
var SKILL_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
245194
|
-
var AgentSkillSchema = exports_external.object({
|
|
245195
|
-
name: exports_external.string().trim().min(1).max(64).regex(SKILL_NAME_REGEX, "Skill name must be lowercase-hyphenated (a-z, 0-9, -)"),
|
|
245196
|
-
description: exports_external.string().trim().min(1, "Description is required").max(1024),
|
|
245197
|
-
body: exports_external.string().trim().min(1, "Body is required").max(15000)
|
|
245198
|
-
});
|
|
245199
|
-
var AgentSkillApiResponseSchema = exports_external.object({
|
|
245200
|
-
name: exports_external.string(),
|
|
245201
|
-
description: exports_external.string(),
|
|
245202
|
-
body: exports_external.string()
|
|
245203
|
-
});
|
|
245204
|
-
var ListAgentSkillsResponseSchema = exports_external.object({
|
|
245205
|
-
items: exports_external.array(AgentSkillApiResponseSchema),
|
|
245206
|
-
total: exports_external.number()
|
|
245207
|
-
});
|
|
245208
|
-
var SyncAgentSkillsResultSchema = exports_external.object({
|
|
245209
|
-
created: exports_external.array(exports_external.string()),
|
|
245210
|
-
updated: exports_external.array(exports_external.string()),
|
|
245211
|
-
deleted: exports_external.array(exports_external.string())
|
|
245212
|
-
});
|
|
245213
|
-
|
|
245214
|
-
// src/core/resources/agent-skill/api.ts
|
|
245215
|
-
async function fetchAgentSkills() {
|
|
245216
|
-
const appClient = getAppClient();
|
|
245217
|
-
let response;
|
|
245218
|
-
try {
|
|
245219
|
-
response = await appClient.get("agent-skills");
|
|
245220
|
-
} catch (error48) {
|
|
245221
|
-
throw await ApiError.fromHttpError(error48, "fetching agent skills");
|
|
245222
|
-
}
|
|
245223
|
-
const result = ListAgentSkillsResponseSchema.safeParse(await response.json());
|
|
245224
|
-
if (!result.success) {
|
|
245225
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
245226
|
-
}
|
|
245227
|
-
return result.data;
|
|
245228
|
-
}
|
|
245229
|
-
async function pushAgentSkills(skills) {
|
|
245230
|
-
if (skills.length === 0) {
|
|
245231
|
-
return { created: [], updated: [], deleted: [] };
|
|
245232
|
-
}
|
|
245233
|
-
const appClient = getAppClient();
|
|
245234
|
-
const remote = await fetchAgentSkills();
|
|
245235
|
-
const remoteByName = new Map(remote.items.map((s) => [s.name, s]));
|
|
245236
|
-
const localNames = new Set(skills.map((s) => s.name));
|
|
245237
|
-
const created = [];
|
|
245238
|
-
const updated = [];
|
|
245239
|
-
const deleted = [];
|
|
245240
|
-
try {
|
|
245241
|
-
for (const skill of skills) {
|
|
245242
|
-
const prev = remoteByName.get(skill.name);
|
|
245243
|
-
if (!prev) {
|
|
245244
|
-
await appClient.post("agent-skills", { json: skill });
|
|
245245
|
-
created.push(skill.name);
|
|
245246
|
-
} else if (prev.description !== skill.description || prev.body !== skill.body) {
|
|
245247
|
-
await appClient.put(`agent-skills/${skill.name}`, {
|
|
245248
|
-
json: { description: skill.description, body: skill.body }
|
|
245249
|
-
});
|
|
245250
|
-
updated.push(skill.name);
|
|
245251
|
-
}
|
|
245252
|
-
}
|
|
245253
|
-
for (const remoteSkill of remote.items) {
|
|
245254
|
-
if (!localNames.has(remoteSkill.name)) {
|
|
245255
|
-
await appClient.delete(`agent-skills/${remoteSkill.name}`);
|
|
245256
|
-
deleted.push(remoteSkill.name);
|
|
245257
|
-
}
|
|
245258
|
-
}
|
|
245259
|
-
} catch (error48) {
|
|
245260
|
-
throw await ApiError.fromHttpError(error48, "syncing agent skills");
|
|
245261
|
-
}
|
|
245262
|
-
return { created, updated, deleted };
|
|
245263
|
-
}
|
|
245264
|
-
// src/core/resources/agent-skill/config.ts
|
|
245265
|
-
import { join as join6 } from "node:path";
|
|
245266
|
-
function parseSkillFile(raw2) {
|
|
245267
|
-
const match = raw2.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
|
|
245268
|
-
if (!match) {
|
|
245269
|
-
return { description: "", body: raw2.trim() };
|
|
245270
|
-
}
|
|
245271
|
-
const [, frontmatter, body] = match;
|
|
245272
|
-
let description = "";
|
|
245273
|
-
for (const line of frontmatter.split(/\r?\n/)) {
|
|
245274
|
-
const kv = line.match(/^([A-Za-z0-9_-]+):\s*(.*)$/);
|
|
245275
|
-
if (kv && kv[1] === "description") {
|
|
245276
|
-
description = kv[2].trim().replace(/^["']|["']$/g, "");
|
|
245277
|
-
}
|
|
245278
|
-
}
|
|
245279
|
-
return { description, body: body.trim() };
|
|
245280
|
-
}
|
|
245281
|
-
function serializeSkillFile(skill) {
|
|
245282
|
-
return `---
|
|
245283
|
-
description: ${skill.description}
|
|
245284
|
-
---
|
|
245285
|
-
|
|
245286
|
-
${skill.body}
|
|
245287
|
-
`;
|
|
245288
|
-
}
|
|
245289
|
-
async function readAllAgentSkills(dir) {
|
|
245290
|
-
if (!await pathExists(dir)) {
|
|
245291
|
-
return [];
|
|
245292
|
-
}
|
|
245293
|
-
const files = await globby("*.md", { cwd: dir, absolute: true });
|
|
245294
|
-
return await Promise.all(files.map(async (filePath) => {
|
|
245295
|
-
const name2 = filePath.split(/[/\\]/).pop()?.replace(/\.md$/, "") ?? "";
|
|
245296
|
-
const { description, body } = parseSkillFile(await readTextFile(filePath));
|
|
245297
|
-
const result = AgentSkillSchema.safeParse({ name: name2, description, body });
|
|
245298
|
-
if (!result.success) {
|
|
245299
|
-
throw new SchemaValidationError("Invalid skill file", result.error, filePath);
|
|
245300
|
-
}
|
|
245301
|
-
return result.data;
|
|
245302
|
-
}));
|
|
245303
|
-
}
|
|
245304
|
-
async function writeAgentSkills(dir, remote) {
|
|
245305
|
-
const existing = await readAllAgentSkills(dir);
|
|
245306
|
-
const remoteNames = new Set(remote.map((s) => s.name));
|
|
245307
|
-
const deleted = [];
|
|
245308
|
-
for (const skill of existing) {
|
|
245309
|
-
if (!remoteNames.has(skill.name)) {
|
|
245310
|
-
await deleteFile(join6(dir, `${skill.name}.md`));
|
|
245311
|
-
deleted.push(skill.name);
|
|
245312
|
-
}
|
|
245313
|
-
}
|
|
245314
|
-
const existingByName = new Map(existing.map((s) => [s.name, s]));
|
|
245315
|
-
const written = [];
|
|
245316
|
-
for (const skill of remote) {
|
|
245317
|
-
const prev = existingByName.get(skill.name);
|
|
245318
|
-
if (prev && prev.description === skill.description && prev.body === skill.body) {
|
|
245319
|
-
continue;
|
|
245320
|
-
}
|
|
245321
|
-
await writeFile(join6(dir, `${skill.name}.md`), serializeSkillFile(skill));
|
|
245322
|
-
written.push(skill.name);
|
|
245323
|
-
}
|
|
245324
|
-
return { written, deleted };
|
|
245325
|
-
}
|
|
245326
|
-
// src/core/resources/agent-skill/resource.ts
|
|
245327
|
-
var agentSkillResource = {
|
|
245328
|
-
readAll: readAllAgentSkills,
|
|
245329
|
-
push: pushAgentSkills
|
|
245330
|
-
};
|
|
245331
245190
|
// src/core/resources/auth-config/schema.ts
|
|
245332
245191
|
var GoogleOAuthMode = exports_external.enum(["default", "custom"]);
|
|
245333
245192
|
var AuthConfigSchema = exports_external.object({
|
|
@@ -245370,8 +245229,8 @@ var AppAuthConfigResponseSchema = exports_external.object({
|
|
|
245370
245229
|
}).transform((data) => ({
|
|
245371
245230
|
authConfig: data.auth_config
|
|
245372
245231
|
}));
|
|
245373
|
-
function hasAnyLoginMethod(
|
|
245374
|
-
return
|
|
245232
|
+
function hasAnyLoginMethod(config4) {
|
|
245233
|
+
return config4.enableUsernamePassword || config4.enableGoogleLogin || config4.enableMicrosoftLogin || config4.enableFacebookLogin || config4.enableAppleLogin || config4.enableSSOLogin;
|
|
245375
245234
|
}
|
|
245376
245235
|
var SOCIAL_PROVIDERS = {
|
|
245377
245236
|
google: {
|
|
@@ -245386,18 +245245,18 @@ var SOCIAL_PROVIDERS = {
|
|
|
245386
245245
|
facebook: { field: "enableFacebookLogin" },
|
|
245387
245246
|
apple: { field: "enableAppleLogin" }
|
|
245388
245247
|
};
|
|
245389
|
-
function toAuthConfigPayload(
|
|
245248
|
+
function toAuthConfigPayload(config4) {
|
|
245390
245249
|
return {
|
|
245391
|
-
enable_username_password:
|
|
245392
|
-
enable_google_login:
|
|
245393
|
-
enable_microsoft_login:
|
|
245394
|
-
enable_facebook_login:
|
|
245395
|
-
enable_apple_login:
|
|
245396
|
-
sso_provider_name:
|
|
245397
|
-
enable_sso_login:
|
|
245398
|
-
google_oauth_mode:
|
|
245399
|
-
google_oauth_client_id:
|
|
245400
|
-
use_workspace_sso:
|
|
245250
|
+
enable_username_password: config4.enableUsernamePassword,
|
|
245251
|
+
enable_google_login: config4.enableGoogleLogin,
|
|
245252
|
+
enable_microsoft_login: config4.enableMicrosoftLogin,
|
|
245253
|
+
enable_facebook_login: config4.enableFacebookLogin,
|
|
245254
|
+
enable_apple_login: config4.enableAppleLogin,
|
|
245255
|
+
sso_provider_name: config4.ssoProviderName,
|
|
245256
|
+
enable_sso_login: config4.enableSSOLogin,
|
|
245257
|
+
google_oauth_mode: config4.googleOAuthMode,
|
|
245258
|
+
google_oauth_client_id: config4.googleOAuthClientId,
|
|
245259
|
+
use_workspace_sso: config4.useWorkspaceSSO
|
|
245401
245260
|
};
|
|
245402
245261
|
}
|
|
245403
245262
|
|
|
@@ -245416,9 +245275,9 @@ async function getAuthConfig() {
|
|
|
245416
245275
|
}
|
|
245417
245276
|
return result.data.authConfig;
|
|
245418
245277
|
}
|
|
245419
|
-
async function pushAuthConfigToApi(
|
|
245278
|
+
async function pushAuthConfigToApi(config4) {
|
|
245420
245279
|
const { id } = getAppContext();
|
|
245421
|
-
const payload = toAuthConfigPayload(
|
|
245280
|
+
const payload = toAuthConfigPayload(config4);
|
|
245422
245281
|
if (hasWorkspaceApiKeyAuth()) {
|
|
245423
245282
|
try {
|
|
245424
245283
|
await base44Client.put(`api/apps/${id}/deployment/auth-configuration`, {
|
|
@@ -245427,7 +245286,7 @@ async function pushAuthConfigToApi(config5) {
|
|
|
245427
245286
|
} catch (error48) {
|
|
245428
245287
|
throw await ApiError.fromHttpError(error48, "updating auth config");
|
|
245429
245288
|
}
|
|
245430
|
-
return
|
|
245289
|
+
return config4;
|
|
245431
245290
|
}
|
|
245432
245291
|
let response;
|
|
245433
245292
|
try {
|
|
@@ -245444,7 +245303,7 @@ async function pushAuthConfigToApi(config5) {
|
|
|
245444
245303
|
return result.data.authConfig;
|
|
245445
245304
|
}
|
|
245446
245305
|
// src/core/resources/auth-config/config.ts
|
|
245447
|
-
import { join as
|
|
245306
|
+
import { join as join6 } from "node:path";
|
|
245448
245307
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
245449
245308
|
var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
|
|
245450
245309
|
var DEFAULT_AUTH_CONFIG = {
|
|
@@ -245460,7 +245319,7 @@ var DEFAULT_AUTH_CONFIG = {
|
|
|
245460
245319
|
useWorkspaceSSO: false
|
|
245461
245320
|
};
|
|
245462
245321
|
function getAuthConfigPath(authDir) {
|
|
245463
|
-
return
|
|
245322
|
+
return join6(authDir, AUTH_CONFIG_FILENAME);
|
|
245464
245323
|
}
|
|
245465
245324
|
async function readAuthConfig(authDir) {
|
|
245466
245325
|
const filePath = getAuthConfigPath(authDir);
|
|
@@ -245474,16 +245333,16 @@ async function readAuthConfig(authDir) {
|
|
|
245474
245333
|
}
|
|
245475
245334
|
return result.data;
|
|
245476
245335
|
}
|
|
245477
|
-
async function writeAuthConfig(authDir,
|
|
245336
|
+
async function writeAuthConfig(authDir, config4) {
|
|
245478
245337
|
const filePath = getAuthConfigPath(authDir);
|
|
245479
245338
|
if (await pathExists(filePath)) {
|
|
245480
245339
|
const existing = await readJsonFile(filePath);
|
|
245481
245340
|
const existingResult = AuthConfigFileSchema.safeParse(existing);
|
|
245482
|
-
if (existingResult.success && isDeepStrictEqual2(existingResult.data,
|
|
245341
|
+
if (existingResult.success && isDeepStrictEqual2(existingResult.data, config4)) {
|
|
245483
245342
|
return { written: false };
|
|
245484
245343
|
}
|
|
245485
245344
|
}
|
|
245486
|
-
await writeJsonFile(filePath,
|
|
245345
|
+
await writeJsonFile(filePath, config4);
|
|
245487
245346
|
return { written: true };
|
|
245488
245347
|
}
|
|
245489
245348
|
// src/core/resources/auth-config/pull.ts
|
|
@@ -245491,17 +245350,17 @@ async function pullAuthConfig() {
|
|
|
245491
245350
|
return await getAuthConfig();
|
|
245492
245351
|
}
|
|
245493
245352
|
// src/core/resources/auth-config/push.ts
|
|
245494
|
-
async function pushAuthConfig(
|
|
245495
|
-
if (!
|
|
245353
|
+
async function pushAuthConfig(config4) {
|
|
245354
|
+
if (!config4) {
|
|
245496
245355
|
return;
|
|
245497
245356
|
}
|
|
245498
|
-
await pushAuthConfigToApi(
|
|
245357
|
+
await pushAuthConfigToApi(config4);
|
|
245499
245358
|
}
|
|
245500
245359
|
// src/core/resources/auth-config/resource.ts
|
|
245501
245360
|
var authConfigResource = {
|
|
245502
245361
|
readAll: async (dir) => {
|
|
245503
|
-
const
|
|
245504
|
-
return
|
|
245362
|
+
const config4 = await readAuthConfig(dir);
|
|
245363
|
+
return config4 ? [config4] : [];
|
|
245505
245364
|
},
|
|
245506
245365
|
push: async (items) => {
|
|
245507
245366
|
await pushAuthConfig(items[0] ?? null);
|
|
@@ -245741,7 +245600,7 @@ class MissingSSOFieldsError extends InvalidInputError {
|
|
|
245741
245600
|
}
|
|
245742
245601
|
}
|
|
245743
245602
|
function buildSSOSecrets(provider, options) {
|
|
245744
|
-
const
|
|
245603
|
+
const schema3 = SSO_PROVIDER_SCHEMAS[provider];
|
|
245745
245604
|
const secrets = {};
|
|
245746
245605
|
secrets["sso_name" /* Name */] = options.ssoName ?? provider;
|
|
245747
245606
|
secrets["sso_client_id" /* ClientId */] = options.clientId;
|
|
@@ -245752,21 +245611,21 @@ function buildSSOSecrets(provider, options) {
|
|
|
245752
245611
|
secrets[secretKey] = value;
|
|
245753
245612
|
}
|
|
245754
245613
|
}
|
|
245755
|
-
if (
|
|
245756
|
-
const derived =
|
|
245614
|
+
if (schema3.deriveDefaults) {
|
|
245615
|
+
const derived = schema3.deriveDefaults(secrets);
|
|
245757
245616
|
for (const [key, val] of Object.entries(derived)) {
|
|
245758
245617
|
if (!secrets[key]) {
|
|
245759
245618
|
secrets[key] = val;
|
|
245760
245619
|
}
|
|
245761
245620
|
}
|
|
245762
245621
|
}
|
|
245763
|
-
for (const [key, val] of Object.entries(
|
|
245622
|
+
for (const [key, val] of Object.entries(schema3.defaults)) {
|
|
245764
245623
|
if (!secrets[key]) {
|
|
245765
245624
|
secrets[key] = val;
|
|
245766
245625
|
}
|
|
245767
245626
|
}
|
|
245768
245627
|
const missing = [];
|
|
245769
|
-
for (const key of
|
|
245628
|
+
for (const key of schema3.requiredKeys) {
|
|
245770
245629
|
if (!secrets[key]) {
|
|
245771
245630
|
missing.push(key);
|
|
245772
245631
|
}
|
|
@@ -246112,7 +245971,7 @@ async function removeStripe() {
|
|
|
246112
245971
|
return result.data;
|
|
246113
245972
|
}
|
|
246114
245973
|
// src/core/resources/connector/config.ts
|
|
246115
|
-
import { join as
|
|
245974
|
+
import { join as join7 } from "node:path";
|
|
246116
245975
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
246117
245976
|
async function readConnectorFile(connectorPath) {
|
|
246118
245977
|
const parsed = await readJsonFile(connectorPath);
|
|
@@ -246173,7 +246032,7 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
246173
246032
|
if (existing && isDeepStrictEqual3(existing.data, connector)) {
|
|
246174
246033
|
continue;
|
|
246175
246034
|
}
|
|
246176
|
-
const filePath = existing?.filePath ??
|
|
246035
|
+
const filePath = existing?.filePath ?? join7(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
246177
246036
|
await writeJsonFile(filePath, connector);
|
|
246178
246037
|
written.push(connector.type);
|
|
246179
246038
|
}
|
|
@@ -246775,7 +246634,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
246775
246634
|
return result.data;
|
|
246776
246635
|
}
|
|
246777
246636
|
// src/core/resources/function/config.ts
|
|
246778
|
-
import { basename as basename3, dirname as dirname6, join as
|
|
246637
|
+
import { basename as basename3, dirname as dirname6, join as join8, relative, resolve as resolve2 } from "node:path";
|
|
246779
246638
|
async function readSharedFiles(functionsDir) {
|
|
246780
246639
|
const sharedDir = resolve2(functionsDir, "..", "shared");
|
|
246781
246640
|
if (!await pathExists(sharedDir)) {
|
|
@@ -246792,9 +246651,9 @@ async function readFunctionConfig(configPath) {
|
|
|
246792
246651
|
return result.data;
|
|
246793
246652
|
}
|
|
246794
246653
|
async function readFunction(configPath, sharedFiles) {
|
|
246795
|
-
const
|
|
246654
|
+
const config7 = await readFunctionConfig(configPath);
|
|
246796
246655
|
const functionDir = dirname6(configPath);
|
|
246797
|
-
const entryPath =
|
|
246656
|
+
const entryPath = join8(functionDir, config7.entry);
|
|
246798
246657
|
if (!await pathExists(entryPath)) {
|
|
246799
246658
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
246800
246659
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -246806,7 +246665,7 @@ async function readFunction(configPath, sharedFiles) {
|
|
|
246806
246665
|
});
|
|
246807
246666
|
const allFilePaths = [...new Set([...filePaths, ...sharedFiles])];
|
|
246808
246667
|
const functionData = {
|
|
246809
|
-
...
|
|
246668
|
+
...config7,
|
|
246810
246669
|
entryPath,
|
|
246811
246670
|
filePaths: allFilePaths,
|
|
246812
246671
|
source: { type: "project" }
|
|
@@ -246943,28 +246802,28 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
246943
246802
|
return results;
|
|
246944
246803
|
}
|
|
246945
246804
|
// src/core/resources/function/pull.ts
|
|
246946
|
-
import { join as
|
|
246805
|
+
import { join as join9 } from "node:path";
|
|
246947
246806
|
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
246948
246807
|
async function writeFunctions(functionsDir, functions) {
|
|
246949
246808
|
const written = [];
|
|
246950
246809
|
const skipped = [];
|
|
246951
246810
|
for (const fn of functions) {
|
|
246952
|
-
const functionDir =
|
|
246953
|
-
const configPath =
|
|
246811
|
+
const functionDir = join9(functionsDir, fn.name);
|
|
246812
|
+
const configPath = join9(functionDir, "function.jsonc");
|
|
246954
246813
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
246955
246814
|
skipped.push(fn.name);
|
|
246956
246815
|
continue;
|
|
246957
246816
|
}
|
|
246958
|
-
const
|
|
246817
|
+
const config7 = {
|
|
246959
246818
|
name: fn.name,
|
|
246960
246819
|
entry: fn.entry
|
|
246961
246820
|
};
|
|
246962
246821
|
if (fn.automations.length > 0) {
|
|
246963
|
-
|
|
246822
|
+
config7.automations = fn.automations;
|
|
246964
246823
|
}
|
|
246965
|
-
await writeJsonFile(configPath,
|
|
246824
|
+
await writeJsonFile(configPath, config7);
|
|
246966
246825
|
for (const file2 of fn.files) {
|
|
246967
|
-
await writeFile(
|
|
246826
|
+
await writeFile(join9(functionDir, file2.path), file2.content);
|
|
246968
246827
|
}
|
|
246969
246828
|
written.push(fn.name);
|
|
246970
246829
|
}
|
|
@@ -246974,7 +246833,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
246974
246833
|
if (!await pathExists(functionDir)) {
|
|
246975
246834
|
return false;
|
|
246976
246835
|
}
|
|
246977
|
-
const configPath =
|
|
246836
|
+
const configPath = join9(functionDir, "function.jsonc");
|
|
246978
246837
|
try {
|
|
246979
246838
|
const localConfig = await readJsonFile(configPath);
|
|
246980
246839
|
if (localConfig.entry !== fn.entry) {
|
|
@@ -246987,7 +246846,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
246987
246846
|
return false;
|
|
246988
246847
|
}
|
|
246989
246848
|
for (const file2 of fn.files) {
|
|
246990
|
-
const filePath =
|
|
246849
|
+
const filePath = join9(functionDir, file2.path);
|
|
246991
246850
|
if (!await pathExists(filePath)) {
|
|
246992
246851
|
return false;
|
|
246993
246852
|
}
|
|
@@ -247027,7 +246886,6 @@ class ProjectConfigReader {
|
|
|
247027
246886
|
entities,
|
|
247028
246887
|
functions,
|
|
247029
246888
|
agents: localResources.agents,
|
|
247030
|
-
agentSkills: localResources.agentSkills,
|
|
247031
246889
|
connectors: localResources.connectors,
|
|
247032
246890
|
authConfig: localResources.authConfig
|
|
247033
246891
|
};
|
|
@@ -247055,15 +246913,14 @@ class ProjectConfigReader {
|
|
|
247055
246913
|
}
|
|
247056
246914
|
async readProjectResources(configPath, project) {
|
|
247057
246915
|
const configDir = dirname8(configPath);
|
|
247058
|
-
const [entities, functions, agents,
|
|
247059
|
-
entityResource.readAll(
|
|
247060
|
-
functionResource.readAll(
|
|
247061
|
-
agentResource.readAll(
|
|
247062
|
-
|
|
247063
|
-
|
|
247064
|
-
authConfigResource.readAll(join11(configDir, project.authDir))
|
|
246916
|
+
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
246917
|
+
entityResource.readAll(join10(configDir, project.entitiesDir)),
|
|
246918
|
+
functionResource.readAll(join10(configDir, project.functionsDir)),
|
|
246919
|
+
agentResource.readAll(join10(configDir, project.agentsDir)),
|
|
246920
|
+
connectorResource.readAll(join10(configDir, project.connectorsDir)),
|
|
246921
|
+
authConfigResource.readAll(join10(configDir, project.authDir))
|
|
247065
246922
|
]);
|
|
247066
|
-
return { entities, functions, agents,
|
|
246923
|
+
return { entities, functions, agents, connectors, authConfig };
|
|
247067
246924
|
}
|
|
247068
246925
|
assertPluginProjectDoesNotLoadPlugins(project, configPath) {
|
|
247069
246926
|
if (project.plugin && project.plugins.length > 0) {
|
|
@@ -247097,7 +246954,6 @@ class ProjectConfigReader {
|
|
|
247097
246954
|
entities: markPluginEntities(resources.entities, namespace),
|
|
247098
246955
|
functions: namespacePluginFunctions(resources.functions, namespace),
|
|
247099
246956
|
agents: [],
|
|
247100
|
-
agentSkills: [],
|
|
247101
246957
|
connectors: [],
|
|
247102
246958
|
authConfig: []
|
|
247103
246959
|
};
|
|
@@ -247135,7 +246991,6 @@ class ProjectConfigReader {
|
|
|
247135
246991
|
entities,
|
|
247136
246992
|
functions,
|
|
247137
246993
|
agents: [],
|
|
247138
|
-
agentSkills: [],
|
|
247139
246994
|
connectors: [],
|
|
247140
246995
|
authConfig: []
|
|
247141
246996
|
};
|
|
@@ -247164,12 +247019,12 @@ async function readProjectConfig(projectRoot) {
|
|
|
247164
247019
|
// src/core/project/template.ts
|
|
247165
247020
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
247166
247021
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
247167
|
-
import { dirname as dirname9, join as
|
|
247022
|
+
import { dirname as dirname9, join as join12 } from "node:path";
|
|
247168
247023
|
|
|
247169
247024
|
// src/core/assets.ts
|
|
247170
247025
|
import { cpSync, existsSync } from "node:fs";
|
|
247171
247026
|
import { homedir as homedir2 } from "node:os";
|
|
247172
|
-
import { join as
|
|
247027
|
+
import { join as join11 } from "node:path";
|
|
247173
247028
|
// package.json
|
|
247174
247029
|
var package_default = {
|
|
247175
247030
|
name: "base44",
|
|
@@ -247275,21 +247130,21 @@ var package_default = {
|
|
|
247275
247130
|
};
|
|
247276
247131
|
|
|
247277
247132
|
// src/core/assets.ts
|
|
247278
|
-
var ASSETS_DIR =
|
|
247133
|
+
var ASSETS_DIR = join11(homedir2(), ".base44", "assets", package_default.version);
|
|
247279
247134
|
function getTemplatesDir() {
|
|
247280
|
-
return
|
|
247135
|
+
return join11(ASSETS_DIR, "templates");
|
|
247281
247136
|
}
|
|
247282
247137
|
function getTemplatesIndexPath() {
|
|
247283
|
-
return
|
|
247138
|
+
return join11(ASSETS_DIR, "templates", "templates.json");
|
|
247284
247139
|
}
|
|
247285
247140
|
function getBackendRuntimeDir() {
|
|
247286
|
-
return
|
|
247141
|
+
return join11(ASSETS_DIR, "backend-runtime");
|
|
247287
247142
|
}
|
|
247288
247143
|
function getDenoWrapperPath() {
|
|
247289
|
-
return
|
|
247144
|
+
return join11(getBackendRuntimeDir(), "main.ts");
|
|
247290
247145
|
}
|
|
247291
247146
|
function getExecWrapperPath() {
|
|
247292
|
-
return
|
|
247147
|
+
return join11(getBackendRuntimeDir(), "exec.ts");
|
|
247293
247148
|
}
|
|
247294
247149
|
function ensureNpmAssets(sourceDir) {
|
|
247295
247150
|
if (existsSync(ASSETS_DIR) && existsSync(getBackendRuntimeDir()))
|
|
@@ -247311,7 +247166,7 @@ async function listTemplates() {
|
|
|
247311
247166
|
}
|
|
247312
247167
|
async function renderTemplate(template, destPath, data, options = {}) {
|
|
247313
247168
|
const { skipExisting = false } = options;
|
|
247314
|
-
const templateDir =
|
|
247169
|
+
const templateDir = join12(getTemplatesDir(), template.path);
|
|
247315
247170
|
const files = await globby("**/*", {
|
|
247316
247171
|
cwd: templateDir,
|
|
247317
247172
|
dot: true,
|
|
@@ -247319,20 +247174,20 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
247319
247174
|
});
|
|
247320
247175
|
const skipped = [];
|
|
247321
247176
|
for (const file2 of files) {
|
|
247322
|
-
const srcPath =
|
|
247177
|
+
const srcPath = join12(templateDir, file2);
|
|
247323
247178
|
try {
|
|
247324
247179
|
if (file2.endsWith(".ejs")) {
|
|
247325
247180
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
247326
247181
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
247327
|
-
const destFile = attributes.outputFileName ?
|
|
247328
|
-
const destFilePath =
|
|
247182
|
+
const destFile = attributes.outputFileName ? join12(dirname9(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
247183
|
+
const destFilePath = join12(destPath, destFile);
|
|
247329
247184
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
247330
247185
|
skipped.push(destFile);
|
|
247331
247186
|
continue;
|
|
247332
247187
|
}
|
|
247333
247188
|
await writeFile(destFilePath, body);
|
|
247334
247189
|
} else {
|
|
247335
|
-
const destFilePath =
|
|
247190
|
+
const destFilePath = join12(destPath, file2);
|
|
247336
247191
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
247337
247192
|
skipped.push(file2);
|
|
247338
247193
|
continue;
|
|
@@ -247432,7 +247287,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
247432
247287
|
// src/core/site/deploy.ts
|
|
247433
247288
|
import { randomUUID } from "node:crypto";
|
|
247434
247289
|
import { tmpdir } from "node:os";
|
|
247435
|
-
import { join as
|
|
247290
|
+
import { join as join13 } from "node:path";
|
|
247436
247291
|
async function deploySite(siteOutputDir) {
|
|
247437
247292
|
if (!await pathExists(siteOutputDir)) {
|
|
247438
247293
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -247449,7 +247304,7 @@ async function deploySite(siteOutputDir) {
|
|
|
247449
247304
|
]
|
|
247450
247305
|
});
|
|
247451
247306
|
}
|
|
247452
|
-
const archivePath =
|
|
247307
|
+
const archivePath = join13(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
247453
247308
|
try {
|
|
247454
247309
|
await createArchive(siteOutputDir, archivePath);
|
|
247455
247310
|
return await uploadSite(archivePath);
|
|
@@ -247466,35 +247321,18 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
247466
247321
|
}
|
|
247467
247322
|
// src/core/project/deploy.ts
|
|
247468
247323
|
function hasResourcesToDeploy(projectData) {
|
|
247469
|
-
const {
|
|
247470
|
-
project,
|
|
247471
|
-
entities,
|
|
247472
|
-
functions,
|
|
247473
|
-
agents,
|
|
247474
|
-
agentSkills,
|
|
247475
|
-
connectors,
|
|
247476
|
-
authConfig
|
|
247477
|
-
} = projectData;
|
|
247324
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
247478
247325
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
247479
247326
|
const hasEntities = entities.length > 0;
|
|
247480
247327
|
const hasFunctions = functions.length > 0;
|
|
247481
247328
|
const hasAgents = agents.length > 0;
|
|
247482
|
-
const hasAgentSkills = agentSkills.length > 0;
|
|
247483
247329
|
const hasConnectors = connectors.length > 0;
|
|
247484
247330
|
const hasAuthConfig = authConfig.length > 0;
|
|
247485
247331
|
const hasVisibility = Boolean(project.visibility);
|
|
247486
|
-
return hasEntities || hasFunctions || hasAgents ||
|
|
247332
|
+
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasVisibility || hasSite;
|
|
247487
247333
|
}
|
|
247488
247334
|
async function deployAll(projectData, options) {
|
|
247489
|
-
const {
|
|
247490
|
-
project,
|
|
247491
|
-
entities,
|
|
247492
|
-
functions,
|
|
247493
|
-
agents,
|
|
247494
|
-
agentSkills,
|
|
247495
|
-
connectors,
|
|
247496
|
-
authConfig
|
|
247497
|
-
} = projectData;
|
|
247335
|
+
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
247498
247336
|
await setAppVisibility(project.visibility);
|
|
247499
247337
|
if (project.visibility) {
|
|
247500
247338
|
options?.onVisibilitySet?.(project.visibility);
|
|
@@ -247504,7 +247342,6 @@ async function deployAll(projectData, options) {
|
|
|
247504
247342
|
onStart: options?.onFunctionStart,
|
|
247505
247343
|
onResult: options?.onFunctionResult
|
|
247506
247344
|
});
|
|
247507
|
-
await agentSkillResource.push(agentSkills);
|
|
247508
247345
|
await agentResource.push(agents);
|
|
247509
247346
|
await authConfigResource.push(authConfig);
|
|
247510
247347
|
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
@@ -254802,76 +254639,14 @@ async function moveAppToWorkspace(appId, targetWorkspaceId, options = {}) {
|
|
|
254802
254639
|
}
|
|
254803
254640
|
return result.data;
|
|
254804
254641
|
}
|
|
254805
|
-
// src/cli/commands/agent-skills/pull.ts
|
|
254806
|
-
async function pullAction({
|
|
254807
|
-
log,
|
|
254808
|
-
runTask: runTask2
|
|
254809
|
-
}) {
|
|
254810
|
-
const { project: project2 } = await readProjectConfig();
|
|
254811
|
-
const dir = join15(dirname10(project2.configPath), project2.agentSkillsDir);
|
|
254812
|
-
const remote = await runTask2("Fetching agent skills from Base44", () => fetchAgentSkills(), {
|
|
254813
|
-
successMessage: "Agent skills fetched successfully",
|
|
254814
|
-
errorMessage: "Failed to fetch agent skills"
|
|
254815
|
-
});
|
|
254816
|
-
const { written, deleted } = await runTask2("Syncing skill files", () => writeAgentSkills(dir, remote.items), {
|
|
254817
|
-
successMessage: "Skill files synced successfully",
|
|
254818
|
-
errorMessage: "Failed to sync skill files"
|
|
254819
|
-
});
|
|
254820
|
-
if (written.length > 0)
|
|
254821
|
-
log.success(`Written: ${written.join(", ")}`);
|
|
254822
|
-
if (deleted.length > 0)
|
|
254823
|
-
log.warn(`Deleted: ${deleted.join(", ")}`);
|
|
254824
|
-
if (written.length === 0 && deleted.length === 0)
|
|
254825
|
-
log.info("All skills are already up to date");
|
|
254826
|
-
return { outroMessage: `Pulled ${remote.total} agent skills to ${dir}` };
|
|
254827
|
-
}
|
|
254828
|
-
function getAgentSkillsPullCommand() {
|
|
254829
|
-
return new Base44Command("pull").description("Pull agent skills from Base44 to local files (replaces all local agent skills)").action(pullAction);
|
|
254830
|
-
}
|
|
254831
|
-
|
|
254832
|
-
// src/cli/commands/agent-skills/push.ts
|
|
254833
|
-
async function pushAction({ isNonInteractive, log, runTask: runTask2 }, options) {
|
|
254834
|
-
const { agentSkills } = await readProjectConfig();
|
|
254835
|
-
log.info(agentSkills.length === 0 ? "No local agent skills found - this will delete all remote skills" : `Found ${agentSkills.length} agent skills to push`);
|
|
254836
|
-
const proceed = await confirmPush({
|
|
254837
|
-
isNonInteractive,
|
|
254838
|
-
yes: options.yes,
|
|
254839
|
-
log,
|
|
254840
|
-
warning: "This will replace all remote agent skills with your local skills and delete any not present locally."
|
|
254841
|
-
});
|
|
254842
|
-
if (!proceed) {
|
|
254843
|
-
return { outroMessage: "Push cancelled" };
|
|
254844
|
-
}
|
|
254845
|
-
const result = await runTask2("Pushing agent skills to Base44", () => pushAgentSkills(agentSkills), {
|
|
254846
|
-
successMessage: "Agent skills pushed successfully",
|
|
254847
|
-
errorMessage: "Failed to push agent skills"
|
|
254848
|
-
});
|
|
254849
|
-
if (result.created.length > 0)
|
|
254850
|
-
log.success(`Created: ${result.created.join(", ")}`);
|
|
254851
|
-
if (result.updated.length > 0)
|
|
254852
|
-
log.success(`Updated: ${result.updated.join(", ")}`);
|
|
254853
|
-
if (result.deleted.length > 0)
|
|
254854
|
-
log.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
254855
|
-
return { outroMessage: "Agent skills pushed to Base44" };
|
|
254856
|
-
}
|
|
254857
|
-
function getAgentSkillsPushCommand() {
|
|
254858
|
-
return new Base44Command("push").description("Push local agent skills to Base44 (replaces all remote agent skills)").option("-y, --yes", "Skip confirmation prompt").action(pushAction);
|
|
254859
|
-
}
|
|
254860
|
-
|
|
254861
|
-
// src/cli/commands/agent-skills/index.ts
|
|
254862
|
-
function getAgentSkillsCommand() {
|
|
254863
|
-
return new Command("agent-skills").description("Manage project agent skills").addCommand(getAgentSkillsPushCommand()).addCommand(getAgentSkillsPullCommand());
|
|
254864
|
-
}
|
|
254865
|
-
|
|
254866
254642
|
// src/cli/commands/agents/pull.ts
|
|
254867
|
-
import { dirname as dirname11, join as join16 } from "node:path";
|
|
254868
254643
|
async function pullAgentsAction({
|
|
254869
254644
|
log,
|
|
254870
254645
|
runTask: runTask2
|
|
254871
254646
|
}) {
|
|
254872
254647
|
const { project: project2 } = await readProjectConfig();
|
|
254873
|
-
const configDir =
|
|
254874
|
-
const agentsDir =
|
|
254648
|
+
const configDir = dirname10(project2.configPath);
|
|
254649
|
+
const agentsDir = join14(configDir, project2.agentsDir);
|
|
254875
254650
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
254876
254651
|
return await fetchAgents();
|
|
254877
254652
|
}, {
|
|
@@ -254941,12 +254716,12 @@ function getAgentsCommand() {
|
|
|
254941
254716
|
}
|
|
254942
254717
|
|
|
254943
254718
|
// src/cli/commands/auth/password-login.ts
|
|
254944
|
-
import { dirname as
|
|
254719
|
+
import { dirname as dirname11, join as join15 } from "node:path";
|
|
254945
254720
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
254946
254721
|
const shouldEnable = action === "enable";
|
|
254947
254722
|
const { project: project2 } = await readProjectConfig();
|
|
254948
|
-
const configDir =
|
|
254949
|
-
const authDir =
|
|
254723
|
+
const configDir = dirname11(project2.configPath);
|
|
254724
|
+
const authDir = join15(configDir, project2.authDir);
|
|
254950
254725
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
254951
254726
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
254952
254727
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -254966,14 +254741,14 @@ function getPasswordLoginCommand() {
|
|
|
254966
254741
|
}
|
|
254967
254742
|
|
|
254968
254743
|
// src/cli/commands/auth/pull.ts
|
|
254969
|
-
import { dirname as
|
|
254744
|
+
import { dirname as dirname12, join as join16 } from "node:path";
|
|
254970
254745
|
async function pullAuthAction({
|
|
254971
254746
|
log,
|
|
254972
254747
|
runTask: runTask2
|
|
254973
254748
|
}) {
|
|
254974
254749
|
const { project: project2 } = await readProjectConfig();
|
|
254975
|
-
const configDir =
|
|
254976
|
-
const authDir =
|
|
254750
|
+
const configDir = dirname12(project2.configPath);
|
|
254751
|
+
const authDir = join16(configDir, project2.authDir);
|
|
254977
254752
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
254978
254753
|
return await pullAuthConfig();
|
|
254979
254754
|
}, {
|
|
@@ -255037,7 +254812,7 @@ function getAuthPushCommand() {
|
|
|
255037
254812
|
}
|
|
255038
254813
|
|
|
255039
254814
|
// src/cli/commands/auth/social-login.ts
|
|
255040
|
-
import { dirname as
|
|
254815
|
+
import { dirname as dirname13, join as join17, resolve as resolve4 } from "node:path";
|
|
255041
254816
|
var PROVIDER_LABELS = {
|
|
255042
254817
|
google: "Google",
|
|
255043
254818
|
microsoft: "Microsoft",
|
|
@@ -255107,8 +254882,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
255107
254882
|
}
|
|
255108
254883
|
}
|
|
255109
254884
|
const { project: project2 } = await readProjectConfig();
|
|
255110
|
-
const configDir =
|
|
255111
|
-
const authDir =
|
|
254885
|
+
const configDir = dirname13(project2.configPath);
|
|
254886
|
+
const authDir = join17(configDir, project2.authDir);
|
|
255112
254887
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
255113
254888
|
if (clientSecret) {
|
|
255114
254889
|
await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -255133,7 +254908,7 @@ function getSocialLoginCommand() {
|
|
|
255133
254908
|
}
|
|
255134
254909
|
|
|
255135
254910
|
// src/cli/commands/auth/sso.ts
|
|
255136
|
-
import { dirname as
|
|
254911
|
+
import { dirname as dirname14, join as join18, resolve as resolve5 } from "node:path";
|
|
255137
254912
|
var SSOConfigFileSchema = exports_external.object({
|
|
255138
254913
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
255139
254914
|
clientId: exports_external.string(),
|
|
@@ -255296,8 +255071,8 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
255296
255071
|
throw error48;
|
|
255297
255072
|
}
|
|
255298
255073
|
const { project: project2 } = await readProjectConfig();
|
|
255299
|
-
const configDir =
|
|
255300
|
-
const authDir =
|
|
255074
|
+
const configDir = dirname14(project2.configPath);
|
|
255075
|
+
const authDir = join18(configDir, project2.authDir);
|
|
255301
255076
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
255302
255077
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
255303
255078
|
return {
|
|
@@ -255312,8 +255087,8 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
255312
255087
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
255313
255088
|
}
|
|
255314
255089
|
const { project: project2 } = await readProjectConfig();
|
|
255315
|
-
const configDir =
|
|
255316
|
-
const authDir =
|
|
255090
|
+
const configDir = dirname14(project2.configPath);
|
|
255091
|
+
const authDir = join18(configDir, project2.authDir);
|
|
255317
255092
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
255318
255093
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
255319
255094
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -256170,13 +255945,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
256170
255945
|
}
|
|
256171
255946
|
|
|
256172
255947
|
// src/cli/commands/connectors/pull.ts
|
|
256173
|
-
import { dirname as
|
|
255948
|
+
import { dirname as dirname15, join as join19, resolve as resolve6 } from "node:path";
|
|
256174
255949
|
async function resolveConnectorsDir(options) {
|
|
256175
255950
|
if (!getAppContext().projectRoot) {
|
|
256176
255951
|
return resolve6(options.dir ?? "connectors");
|
|
256177
255952
|
}
|
|
256178
255953
|
const { project: project2 } = await readProjectConfig();
|
|
256179
|
-
return
|
|
255954
|
+
return join19(dirname15(project2.configPath), project2.connectorsDir);
|
|
256180
255955
|
}
|
|
256181
255956
|
async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
|
|
256182
255957
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -256584,11 +256359,11 @@ function getListCommand() {
|
|
|
256584
256359
|
}
|
|
256585
256360
|
|
|
256586
256361
|
// src/cli/commands/functions/pull.ts
|
|
256587
|
-
import { dirname as
|
|
256362
|
+
import { dirname as dirname16, join as join20 } from "node:path";
|
|
256588
256363
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
256589
256364
|
const { project: project2, functions } = await readProjectConfig();
|
|
256590
|
-
const configDir =
|
|
256591
|
-
const functionsDir =
|
|
256365
|
+
const configDir = dirname16(project2.configPath);
|
|
256366
|
+
const functionsDir = join20(configDir, project2.functionsDir);
|
|
256592
256367
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
256593
256368
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
256594
256369
|
const { functions: functions2 } = await listDeployedFunctions();
|
|
@@ -256651,7 +256426,7 @@ import { basename as basename4, resolve as resolve8 } from "node:path";
|
|
|
256651
256426
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
256652
256427
|
|
|
256653
256428
|
// src/cli/commands/project/scaffold-shared.ts
|
|
256654
|
-
import { join as
|
|
256429
|
+
import { join as join21 } from "node:path";
|
|
256655
256430
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
256656
256431
|
async function getTemplateById(templateId) {
|
|
256657
256432
|
const templates = await listTemplates();
|
|
@@ -256710,7 +256485,7 @@ async function completeProjectSetup({
|
|
|
256710
256485
|
updateMessage("Building project...");
|
|
256711
256486
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
256712
256487
|
updateMessage("Deploying site...");
|
|
256713
|
-
return await deploySite(
|
|
256488
|
+
return await deploySite(join21(resolvedPath, outputDirectory));
|
|
256714
256489
|
}, {
|
|
256715
256490
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
256716
256491
|
errorMessage: "Failed to deploy site"
|
|
@@ -257564,7 +257339,7 @@ function withSandboxAuthHint(error48) {
|
|
|
257564
257339
|
cause: error48
|
|
257565
257340
|
});
|
|
257566
257341
|
}
|
|
257567
|
-
async function callTool(appId, tool, payload,
|
|
257342
|
+
async function callTool(appId, tool, payload, schema11, context, timeout2 = 60000) {
|
|
257568
257343
|
const client = getSandboxClient(appId);
|
|
257569
257344
|
let response;
|
|
257570
257345
|
try {
|
|
@@ -257572,7 +257347,7 @@ async function callTool(appId, tool, payload, schema12, context, timeout2 = 6000
|
|
|
257572
257347
|
} catch (error48) {
|
|
257573
257348
|
throw withSandboxAuthHint(await ApiError.fromHttpError(error48, context));
|
|
257574
257349
|
}
|
|
257575
|
-
const result =
|
|
257350
|
+
const result = schema11.safeParse(await response.json());
|
|
257576
257351
|
if (!result.success) {
|
|
257577
257352
|
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
257578
257353
|
}
|
|
@@ -257966,9 +257741,9 @@ async function generateContent(input) {
|
|
|
257966
257741
|
`);
|
|
257967
257742
|
}
|
|
257968
257743
|
async function compileEntity(entity2) {
|
|
257969
|
-
const { name: name2, source: _source, ...
|
|
257744
|
+
const { name: name2, source: _source, ...schema11 } = entity2;
|
|
257970
257745
|
const jsonSchema = {
|
|
257971
|
-
...
|
|
257746
|
+
...schema11,
|
|
257972
257747
|
title: name2,
|
|
257973
257748
|
additionalProperties: false
|
|
257974
257749
|
};
|
|
@@ -257995,10 +257770,10 @@ function toPascalCase(name2) {
|
|
|
257995
257770
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
257996
257771
|
}
|
|
257997
257772
|
// src/core/types/update-project.ts
|
|
257998
|
-
import { join as
|
|
257773
|
+
import { join as join24 } from "node:path";
|
|
257999
257774
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
258000
257775
|
async function updateProjectConfig(projectRoot) {
|
|
258001
|
-
const tsconfigPath =
|
|
257776
|
+
const tsconfigPath = join24(projectRoot, "tsconfig.json");
|
|
258002
257777
|
if (!await pathExists(tsconfigPath)) {
|
|
258003
257778
|
return false;
|
|
258004
257779
|
}
|
|
@@ -258196,7 +257971,7 @@ function getWorkspaceCommand() {
|
|
|
258196
257971
|
// src/cli/dev/dev-server/main.ts
|
|
258197
257972
|
var import_cors = __toESM(require_lib4(), 1);
|
|
258198
257973
|
var import_express6 = __toESM(require_express(), 1);
|
|
258199
|
-
import { dirname as
|
|
257974
|
+
import { dirname as dirname22, join as join29 } from "node:path";
|
|
258200
257975
|
|
|
258201
257976
|
// ../../node_modules/get-port/index.js
|
|
258202
257977
|
import net from "node:net";
|
|
@@ -258217,8 +257992,8 @@ var getLocalHosts = () => {
|
|
|
258217
257992
|
const interfaces = os10.networkInterfaces();
|
|
258218
257993
|
const results = new Set([undefined, "0.0.0.0"]);
|
|
258219
257994
|
for (const _interface of Object.values(interfaces)) {
|
|
258220
|
-
for (const
|
|
258221
|
-
results.add(
|
|
257995
|
+
for (const config12 of _interface) {
|
|
257996
|
+
results.add(config12.address);
|
|
258222
257997
|
}
|
|
258223
257998
|
}
|
|
258224
257999
|
return results;
|
|
@@ -258368,7 +258143,7 @@ function createDevLogger(label2, labelColor = theme.styles.dim) {
|
|
|
258368
258143
|
|
|
258369
258144
|
// src/cli/dev/dev-server/function-manager.ts
|
|
258370
258145
|
import { spawn as spawn2 } from "node:child_process";
|
|
258371
|
-
import { dirname as
|
|
258146
|
+
import { dirname as dirname19, join as join25 } from "node:path";
|
|
258372
258147
|
import { pathToFileURL } from "node:url";
|
|
258373
258148
|
|
|
258374
258149
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -258473,7 +258248,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
258473
258248
|
}
|
|
258474
258249
|
spawnFunction(func, port) {
|
|
258475
258250
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
258476
|
-
const importMapPath =
|
|
258251
|
+
const importMapPath = join25(dirname19(this.wrapperPath), "import-map.json");
|
|
258477
258252
|
const process23 = spawn2("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
258478
258253
|
env: {
|
|
258479
258254
|
...globalThis.process.env,
|
|
@@ -258547,7 +258322,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
258547
258322
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
258548
258323
|
import { isBuiltin } from "node:module";
|
|
258549
258324
|
import { homedir as homedir3 } from "node:os";
|
|
258550
|
-
import { join as
|
|
258325
|
+
import { join as join26 } from "node:path";
|
|
258551
258326
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
258552
258327
|
var depsPromise;
|
|
258553
258328
|
function loadDeps() {
|
|
@@ -258668,9 +258443,9 @@ export default {
|
|
|
258668
258443
|
};
|
|
258669
258444
|
`;
|
|
258670
258445
|
function ensureBundlerConfig() {
|
|
258671
|
-
const dir =
|
|
258446
|
+
const dir = join26(homedir3(), ".base44", "function-bundler");
|
|
258672
258447
|
mkdirSync2(dir, { recursive: true });
|
|
258673
|
-
const configPath =
|
|
258448
|
+
const configPath = join26(dir, "deno.json");
|
|
258674
258449
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
258675
258450
|
`);
|
|
258676
258451
|
return configPath;
|
|
@@ -259025,6 +258800,10 @@ function stripInternalFields(doc2) {
|
|
|
259025
258800
|
var getNowISOTimestamp = () => {
|
|
259026
258801
|
return new Date().toISOString().replace("Z", "000");
|
|
259027
258802
|
};
|
|
258803
|
+
var deriveFullNameFromEmail = (email3) => {
|
|
258804
|
+
const nameFromEmailMatch = /^([^@]+)/.exec(email3);
|
|
258805
|
+
return nameFromEmailMatch ? nameFromEmailMatch[1] : email3;
|
|
258806
|
+
};
|
|
259028
258807
|
|
|
259029
258808
|
// src/cli/dev/dev-server/db/validator.ts
|
|
259030
258809
|
class EntityValidationError extends Error {
|
|
@@ -259258,22 +259037,22 @@ class Database {
|
|
|
259258
259037
|
this.schemas.clear();
|
|
259259
259038
|
}
|
|
259260
259039
|
validate(entityName, record2, partial2 = false) {
|
|
259261
|
-
const
|
|
259262
|
-
if (!
|
|
259040
|
+
const schema11 = this.schemas.get(this.normalizeName(entityName));
|
|
259041
|
+
if (!schema11) {
|
|
259263
259042
|
throw new Error(`Entity "${entityName}" not found`);
|
|
259264
259043
|
}
|
|
259265
|
-
return this.validator.validate(record2,
|
|
259044
|
+
return this.validator.validate(record2, schema11, partial2);
|
|
259266
259045
|
}
|
|
259267
259046
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
259268
|
-
const
|
|
259269
|
-
if (!
|
|
259047
|
+
const schema11 = this.schemas.get(this.normalizeName(entityName));
|
|
259048
|
+
if (!schema11) {
|
|
259270
259049
|
throw new Error(`Entity "${entityName}" not found`);
|
|
259271
259050
|
}
|
|
259272
|
-
const filteredRecord = this.validator.filterFields(record2,
|
|
259051
|
+
const filteredRecord = this.validator.filterFields(record2, schema11);
|
|
259273
259052
|
if (partial2) {
|
|
259274
259053
|
return filteredRecord;
|
|
259275
259054
|
}
|
|
259276
|
-
return this.validator.applyDefaults(filteredRecord,
|
|
259055
|
+
return this.validator.applyDefaults(filteredRecord, schema11);
|
|
259277
259056
|
}
|
|
259278
259057
|
normalizeName(entityName) {
|
|
259279
259058
|
return entityName.toLowerCase();
|
|
@@ -259437,8 +259216,7 @@ In order to complete registration use this verification code: ${otpCode}
|
|
|
259437
259216
|
});
|
|
259438
259217
|
const collection = db2.getCollection(USER_COLLECTION);
|
|
259439
259218
|
const now = getNowISOTimestamp();
|
|
259440
|
-
const
|
|
259441
|
-
const fullName = nameFromEmailMatch ? nameFromEmailMatch[1] : email3;
|
|
259219
|
+
const fullName = deriveFullNameFromEmail(email3);
|
|
259442
259220
|
await collection?.insertAsync({
|
|
259443
259221
|
id: privateUserData.id,
|
|
259444
259222
|
email: email3,
|
|
@@ -259567,13 +259345,13 @@ function checkRLS(rule, record2, user) {
|
|
|
259567
259345
|
return false;
|
|
259568
259346
|
return evaluateCondition(rule, record2, user);
|
|
259569
259347
|
}
|
|
259570
|
-
function applyFLS(record2,
|
|
259348
|
+
function applyFLS(record2, schema11, user, operation) {
|
|
259571
259349
|
if (Array.isArray(record2)) {
|
|
259572
|
-
return record2.map((r5) => applyFLS(r5,
|
|
259350
|
+
return record2.map((r5) => applyFLS(r5, schema11, user, operation));
|
|
259573
259351
|
}
|
|
259574
259352
|
const result = {};
|
|
259575
259353
|
for (const [key2, value] of Object.entries(record2)) {
|
|
259576
|
-
const rule =
|
|
259354
|
+
const rule = schema11.properties[key2]?.rls?.[operation];
|
|
259577
259355
|
if (rule === undefined || checkRLS(rule, record2, user)) {
|
|
259578
259356
|
result[key2] = value;
|
|
259579
259357
|
}
|
|
@@ -259670,14 +259448,38 @@ async function resolveCurrentUser(db2, req) {
|
|
|
259670
259448
|
return { ok: true, user: SERVICE_USER };
|
|
259671
259449
|
}
|
|
259672
259450
|
const currentUser = await db2.getCollection(USER_COLLECTION)?.findOneAsync({ email: subject });
|
|
259673
|
-
if (
|
|
259451
|
+
if (currentUser) {
|
|
259452
|
+
return { ok: true, user: currentUser };
|
|
259453
|
+
}
|
|
259454
|
+
const externallyAuthenticatedUser = await createLocalUser(db2, subject);
|
|
259455
|
+
if (!externallyAuthenticatedUser) {
|
|
259674
259456
|
return { ok: false, reason: "not_found" };
|
|
259675
259457
|
}
|
|
259676
|
-
return { ok: true, user:
|
|
259458
|
+
return { ok: true, user: externallyAuthenticatedUser };
|
|
259677
259459
|
} catch {
|
|
259678
259460
|
return { ok: false, reason: "invalid" };
|
|
259679
259461
|
}
|
|
259680
259462
|
}
|
|
259463
|
+
async function createLocalUser(db2, email3) {
|
|
259464
|
+
const collection = db2.getCollection(USER_COLLECTION);
|
|
259465
|
+
if (!collection) {
|
|
259466
|
+
return;
|
|
259467
|
+
}
|
|
259468
|
+
const now = getNowISOTimestamp();
|
|
259469
|
+
const inserted = await collection.insertAsync({
|
|
259470
|
+
id: nanoid3(),
|
|
259471
|
+
email: email3,
|
|
259472
|
+
full_name: deriveFullNameFromEmail(email3),
|
|
259473
|
+
is_service: false,
|
|
259474
|
+
is_verified: true,
|
|
259475
|
+
disabled: null,
|
|
259476
|
+
role: "user",
|
|
259477
|
+
collaborator_role: "editor",
|
|
259478
|
+
created_date: now,
|
|
259479
|
+
updated_date: now
|
|
259480
|
+
});
|
|
259481
|
+
return inserted;
|
|
259482
|
+
}
|
|
259681
259483
|
|
|
259682
259484
|
// src/cli/dev/dev-server/routes/entities/entities-user-router.ts
|
|
259683
259485
|
var import_express3 = __toESM(require_express(), 1);
|
|
@@ -259801,14 +259603,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259801
259603
|
res.status(404).json({ error: `Entity "${entityName}" not found` });
|
|
259802
259604
|
return;
|
|
259803
259605
|
}
|
|
259804
|
-
const
|
|
259805
|
-
if (!
|
|
259606
|
+
const schema11 = db2.getSchema(entityName);
|
|
259607
|
+
if (!schema11) {
|
|
259806
259608
|
res.status(404).json({ error: `Schema for "${entityName}" not found` });
|
|
259807
259609
|
return;
|
|
259808
259610
|
}
|
|
259809
259611
|
const currentUserResult = await resolveCurrentUser(db2, req);
|
|
259810
259612
|
const currentUser = currentUserResult.ok ? currentUserResult.user : undefined;
|
|
259811
|
-
await handler(req, res, collection,
|
|
259613
|
+
await handler(req, res, collection, schema11, currentUser);
|
|
259812
259614
|
};
|
|
259813
259615
|
}
|
|
259814
259616
|
function emit(appId, entityName, type, data) {
|
|
@@ -259826,19 +259628,19 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259826
259628
|
}
|
|
259827
259629
|
broadcast(appId, entityName, createData(data));
|
|
259828
259630
|
}
|
|
259829
|
-
function prepareCreateRecord(entityName, body,
|
|
259631
|
+
function prepareCreateRecord(entityName, body, schema11, currentUser, now) {
|
|
259830
259632
|
const { _id, ...recordBody } = body;
|
|
259831
259633
|
const ownerFields = {
|
|
259832
259634
|
created_by: currentUser?.email,
|
|
259833
259635
|
created_by_id: currentUser?.id
|
|
259834
259636
|
};
|
|
259835
|
-
if (!checkRLS(
|
|
259637
|
+
if (!checkRLS(schema11.rls?.create, {
|
|
259836
259638
|
...recordBody,
|
|
259837
259639
|
...ownerFields
|
|
259838
259640
|
}, currentUser)) {
|
|
259839
259641
|
return;
|
|
259840
259642
|
}
|
|
259841
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody),
|
|
259643
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody), schema11, currentUser, "write");
|
|
259842
259644
|
db2.validate(entityName, filteredBody);
|
|
259843
259645
|
return {
|
|
259844
259646
|
...filteredBody,
|
|
@@ -259850,7 +259652,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259850
259652
|
}
|
|
259851
259653
|
const userRouter = createUserRouter(db2, logger2);
|
|
259852
259654
|
router.use("/User", userRouter);
|
|
259853
|
-
router.get("/:entityName/:id", withCollection(async (req, res, collection,
|
|
259655
|
+
router.get("/:entityName/:id", withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
259854
259656
|
const { entityName, id: id2 } = req.params;
|
|
259855
259657
|
try {
|
|
259856
259658
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -259858,27 +259660,27 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259858
259660
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259859
259661
|
return;
|
|
259860
259662
|
}
|
|
259861
|
-
if (!checkRLS(
|
|
259663
|
+
if (!checkRLS(schema11.rls?.read, doc2, currentUser)) {
|
|
259862
259664
|
res.status(404).json({
|
|
259863
259665
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
259864
259666
|
});
|
|
259865
259667
|
return;
|
|
259866
259668
|
}
|
|
259867
|
-
const result = applyFLS(stripInternalFields(doc2),
|
|
259669
|
+
const result = applyFLS(stripInternalFields(doc2), schema11, currentUser, "read");
|
|
259868
259670
|
res.json(result);
|
|
259869
259671
|
} catch (error48) {
|
|
259870
259672
|
logger2.error(`Error in GET /${entityName}/${id2}:`, error48);
|
|
259871
259673
|
res.status(500).json({ error: "Internal server error" });
|
|
259872
259674
|
}
|
|
259873
259675
|
}));
|
|
259874
|
-
router.get("/:entityName", withCollection(async (req, res, collection,
|
|
259676
|
+
router.get("/:entityName", withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
259875
259677
|
const { entityName } = req.params;
|
|
259876
259678
|
try {
|
|
259877
259679
|
let results = stripInternalFields(await queryEntity(collection, req.query));
|
|
259878
|
-
if (
|
|
259879
|
-
results = results.filter((doc2) => checkRLS(
|
|
259680
|
+
if (schema11.rls?.read !== undefined && schema11.rls.read !== true) {
|
|
259681
|
+
results = results.filter((doc2) => checkRLS(schema11.rls.read, doc2, currentUser));
|
|
259880
259682
|
}
|
|
259881
|
-
results = results.map((doc2) => applyFLS(doc2,
|
|
259683
|
+
results = results.map((doc2) => applyFLS(doc2, schema11, currentUser, "read"));
|
|
259882
259684
|
res.json(results);
|
|
259883
259685
|
} catch (error48) {
|
|
259884
259686
|
if (error48 instanceof InvalidInputError) {
|
|
@@ -259889,16 +259691,16 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259889
259691
|
}
|
|
259890
259692
|
}
|
|
259891
259693
|
}));
|
|
259892
|
-
router.post("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
259694
|
+
router.post("/:entityName", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
259893
259695
|
const { appId, entityName } = req.params;
|
|
259894
259696
|
try {
|
|
259895
259697
|
const now = new Date().toISOString();
|
|
259896
|
-
const record2 = prepareCreateRecord(entityName, req.body,
|
|
259698
|
+
const record2 = prepareCreateRecord(entityName, req.body, schema11, currentUser, now);
|
|
259897
259699
|
if (!record2) {
|
|
259898
259700
|
res.status(403).json({ error: "Permission denied" });
|
|
259899
259701
|
return;
|
|
259900
259702
|
}
|
|
259901
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)),
|
|
259703
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)), schema11, currentUser, "read");
|
|
259902
259704
|
emit(appId, entityName, "create", inserted);
|
|
259903
259705
|
res.status(201).json(inserted);
|
|
259904
259706
|
} catch (error48) {
|
|
@@ -259910,7 +259712,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259910
259712
|
res.status(500).json({ error: "Internal server error" });
|
|
259911
259713
|
}
|
|
259912
259714
|
}));
|
|
259913
|
-
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection,
|
|
259715
|
+
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
259914
259716
|
const { appId, entityName } = req.params;
|
|
259915
259717
|
if (!Array.isArray(req.body)) {
|
|
259916
259718
|
res.status(400).json({ error: "Request body must be an array" });
|
|
@@ -259920,14 +259722,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259920
259722
|
const now = new Date().toISOString();
|
|
259921
259723
|
const records = [];
|
|
259922
259724
|
for (const body of req.body) {
|
|
259923
|
-
const record2 = prepareCreateRecord(entityName, body,
|
|
259725
|
+
const record2 = prepareCreateRecord(entityName, body, schema11, currentUser, now);
|
|
259924
259726
|
if (!record2) {
|
|
259925
259727
|
res.status(403).json({ error: "Permission denied" });
|
|
259926
259728
|
return;
|
|
259927
259729
|
}
|
|
259928
259730
|
records.push(record2);
|
|
259929
259731
|
}
|
|
259930
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)),
|
|
259732
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)), schema11, currentUser, "read");
|
|
259931
259733
|
emit(appId, entityName, "create", inserted);
|
|
259932
259734
|
res.status(201).json(inserted);
|
|
259933
259735
|
} catch (error48) {
|
|
@@ -259939,24 +259741,24 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259939
259741
|
res.status(500).json({ error: "Internal server error" });
|
|
259940
259742
|
}
|
|
259941
259743
|
}));
|
|
259942
|
-
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection,
|
|
259744
|
+
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
259943
259745
|
const { appId, entityName, id: id2 } = req.params;
|
|
259944
259746
|
const { id: _id, created_date: _created_date, ...body } = req.body;
|
|
259945
259747
|
try {
|
|
259946
|
-
if (
|
|
259748
|
+
if (schema11.rls?.update !== undefined) {
|
|
259947
259749
|
const existing = await collection.findOneAsync({ id: id2 });
|
|
259948
259750
|
if (!existing) {
|
|
259949
259751
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259950
259752
|
return;
|
|
259951
259753
|
}
|
|
259952
|
-
if (!checkRLS(
|
|
259754
|
+
if (!checkRLS(schema11.rls.update, existing, currentUser)) {
|
|
259953
259755
|
res.status(404).json({
|
|
259954
259756
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
259955
259757
|
});
|
|
259956
259758
|
return;
|
|
259957
259759
|
}
|
|
259958
259760
|
}
|
|
259959
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true),
|
|
259761
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true), schema11, currentUser, "write");
|
|
259960
259762
|
db2.validate(entityName, filteredBody, true);
|
|
259961
259763
|
const updateData = {
|
|
259962
259764
|
...filteredBody,
|
|
@@ -259967,7 +259769,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259967
259769
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259968
259770
|
return;
|
|
259969
259771
|
}
|
|
259970
|
-
const updated = applyFLS(stripInternalFields(result.affectedDocuments),
|
|
259772
|
+
const updated = applyFLS(stripInternalFields(result.affectedDocuments), schema11, currentUser, "read");
|
|
259971
259773
|
emit(appId, entityName, "update", updated);
|
|
259972
259774
|
res.json(updated);
|
|
259973
259775
|
} catch (error48) {
|
|
@@ -259979,7 +259781,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259979
259781
|
res.status(500).json({ error: "Internal server error" });
|
|
259980
259782
|
}
|
|
259981
259783
|
}));
|
|
259982
|
-
router.delete("/:entityName/:id", withCollection(async (req, res, collection,
|
|
259784
|
+
router.delete("/:entityName/:id", withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
259983
259785
|
const { appId, entityName, id: id2 } = req.params;
|
|
259984
259786
|
try {
|
|
259985
259787
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -259987,7 +259789,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259987
259789
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259988
259790
|
return;
|
|
259989
259791
|
}
|
|
259990
|
-
if (!checkRLS(
|
|
259792
|
+
if (!checkRLS(schema11.rls?.delete, doc2, currentUser)) {
|
|
259991
259793
|
res.status(404).json({
|
|
259992
259794
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
259993
259795
|
});
|
|
@@ -260001,11 +259803,11 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
260001
259803
|
res.status(500).json({ error: "Internal server error" });
|
|
260002
259804
|
}
|
|
260003
259805
|
}));
|
|
260004
|
-
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
259806
|
+
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
|
|
260005
259807
|
const { entityName } = req.params;
|
|
260006
259808
|
try {
|
|
260007
259809
|
const query = req.body || {};
|
|
260008
|
-
const rlsDelete =
|
|
259810
|
+
const rlsDelete = schema11?.rls?.delete;
|
|
260009
259811
|
if (rlsDelete !== undefined && rlsDelete !== true) {
|
|
260010
259812
|
if (rlsDelete === false && currentUser?.is_service !== true) {
|
|
260011
259813
|
res.status(403).json({ error: "Permission denied" });
|
|
@@ -260954,9 +260756,9 @@ class NodeFsHandler {
|
|
|
260954
260756
|
if (this.fsw.closed) {
|
|
260955
260757
|
return;
|
|
260956
260758
|
}
|
|
260957
|
-
const
|
|
260759
|
+
const dirname21 = sp2.dirname(file2);
|
|
260958
260760
|
const basename7 = sp2.basename(file2);
|
|
260959
|
-
const parent = this.fsw._getWatchedDir(
|
|
260761
|
+
const parent = this.fsw._getWatchedDir(dirname21);
|
|
260960
260762
|
let prevStats = stats;
|
|
260961
260763
|
if (parent.has(basename7))
|
|
260962
260764
|
return;
|
|
@@ -260983,7 +260785,7 @@ class NodeFsHandler {
|
|
|
260983
260785
|
prevStats = newStats2;
|
|
260984
260786
|
}
|
|
260985
260787
|
} catch (error48) {
|
|
260986
|
-
this.fsw._remove(
|
|
260788
|
+
this.fsw._remove(dirname21, basename7);
|
|
260987
260789
|
}
|
|
260988
260790
|
} else if (parent.has(basename7)) {
|
|
260989
260791
|
const at13 = newStats.atimeMs;
|
|
@@ -261921,6 +261723,14 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
261921
261723
|
// src/cli/dev/dev-server/main.ts
|
|
261922
261724
|
var DEFAULT_PORT = 4400;
|
|
261923
261725
|
var BASE44_APP_URL = "https://base44.app";
|
|
261726
|
+
function isLocalRedirectTarget(value) {
|
|
261727
|
+
try {
|
|
261728
|
+
const { protocol, hostname: hostname3 } = new URL(value);
|
|
261729
|
+
return (protocol === "http:" || protocol === "https:") && (hostname3 === "localhost" || hostname3 === "127.0.0.1");
|
|
261730
|
+
} catch {
|
|
261731
|
+
return false;
|
|
261732
|
+
}
|
|
261733
|
+
}
|
|
261924
261734
|
async function createDevServer(options8) {
|
|
261925
261735
|
const { port: userPort } = options8;
|
|
261926
261736
|
const port = userPort ?? await getPorts({
|
|
@@ -261937,6 +261747,13 @@ async function createDevServer(options8) {
|
|
|
261937
261747
|
origin: /^http:\/\/localhost(:\d+)?$/,
|
|
261938
261748
|
credentials: true
|
|
261939
261749
|
}));
|
|
261750
|
+
app.get("/api/apps/auth/logout", (req, res) => {
|
|
261751
|
+
const fromUrl = req.query.from_url;
|
|
261752
|
+
if (typeof fromUrl === "string" && isLocalRedirectTarget(fromUrl)) {
|
|
261753
|
+
return res.redirect(fromUrl);
|
|
261754
|
+
}
|
|
261755
|
+
res.send("Logged out");
|
|
261756
|
+
});
|
|
261940
261757
|
const AUTH_ROUTE_PATTERN = /^\/api\/apps\/auth(\/|$)/;
|
|
261941
261758
|
app.use((req, res, next) => {
|
|
261942
261759
|
if (AUTH_ROUTE_PATTERN.test(req.path)) {
|
|
@@ -262016,8 +261833,8 @@ async function createDevServer(options8) {
|
|
|
262016
261833
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
262017
261834
|
};
|
|
262018
261835
|
const base44ConfigWatcher = new WatchBase44({
|
|
262019
|
-
functions:
|
|
262020
|
-
entities:
|
|
261836
|
+
functions: join29(dirname22(project2.configPath), project2.functionsDir),
|
|
261837
|
+
entities: join29(dirname22(project2.configPath), project2.entitiesDir)
|
|
262021
261838
|
}, devLogger);
|
|
262022
261839
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
262023
261840
|
try {
|
|
@@ -262394,7 +262211,6 @@ function createProgram(context) {
|
|
|
262394
262211
|
program2.addCommand(getWorkspaceCommand());
|
|
262395
262212
|
program2.addCommand(getEntitiesPushCommand());
|
|
262396
262213
|
program2.addCommand(getAgentsCommand());
|
|
262397
|
-
program2.addCommand(getAgentSkillsCommand());
|
|
262398
262214
|
program2.addCommand(getConnectorsCommand());
|
|
262399
262215
|
program2.addCommand(getFunctionsCommand());
|
|
262400
262216
|
program2.addCommand(getSecretsCommand());
|
|
@@ -262413,7 +262229,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
262413
262229
|
import { release, type } from "node:os";
|
|
262414
262230
|
|
|
262415
262231
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
262416
|
-
import { dirname as
|
|
262232
|
+
import { dirname as dirname23, posix, sep } from "path";
|
|
262417
262233
|
function createModulerModifier() {
|
|
262418
262234
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
262419
262235
|
return async (frames) => {
|
|
@@ -262422,7 +262238,7 @@ function createModulerModifier() {
|
|
|
262422
262238
|
return frames;
|
|
262423
262239
|
};
|
|
262424
262240
|
}
|
|
262425
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
262241
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname23(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
262426
262242
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
262427
262243
|
return (filename) => {
|
|
262428
262244
|
if (!filename)
|
|
@@ -266611,9 +266427,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
266611
266427
|
});
|
|
266612
266428
|
}
|
|
266613
266429
|
// src/cli/index.ts
|
|
266614
|
-
var __dirname4 =
|
|
266430
|
+
var __dirname4 = dirname24(fileURLToPath6(import.meta.url));
|
|
266615
266431
|
async function runCLI(options8) {
|
|
266616
|
-
ensureNpmAssets(
|
|
266432
|
+
ensureNpmAssets(join30(__dirname4, "../assets"));
|
|
266617
266433
|
const errorReporter = new ErrorReporter;
|
|
266618
266434
|
errorReporter.registerProcessErrorHandlers();
|
|
266619
266435
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -266652,4 +266468,4 @@ export {
|
|
|
266652
266468
|
CLIExitError
|
|
266653
266469
|
};
|
|
266654
266470
|
|
|
266655
|
-
//# debugId=
|
|
266471
|
+
//# debugId=A2E6A84191681AAC64756E2164756E21
|