@base44-preview/cli 0.1.1-pr.559.316796 → 0.1.1-pr.559.3bdd0a9

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
@@ -119560,11 +119560,11 @@ function chooseDescription(descriptions, printWidth) {
119560
119560
  return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
119561
119561
  }
119562
119562
  function createSchema(SchemaConstructor, parameters) {
119563
- const schema11 = new SchemaConstructor(parameters);
119564
- const subSchema = Object.create(schema11);
119563
+ const schema12 = new SchemaConstructor(parameters);
119564
+ const subSchema = Object.create(schema12);
119565
119565
  for (const handlerKey of HANDLER_KEYS) {
119566
119566
  if (handlerKey in parameters) {
119567
- subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema11, Schema2.prototype[handlerKey].length);
119567
+ subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema12, Schema2.prototype[handlerKey].length);
119568
119568
  }
119569
119569
  }
119570
119570
  return subSchema;
@@ -122904,9 +122904,9 @@ function optionInfoToSchema(optionInfo, {
122904
122904
  throw new Error(`Unexpected type ${optionInfo.type}`);
122905
122905
  }
122906
122906
  if (optionInfo.exception) {
122907
- parameters.validate = (value, schema11, utils3) => optionInfo.exception(value) || schema11.validate(value, utils3);
122907
+ parameters.validate = (value, schema12, utils3) => optionInfo.exception(value) || schema12.validate(value, utils3);
122908
122908
  } else {
122909
- parameters.validate = (value, schema11, utils3) => value === undefined || schema11.validate(value, utils3);
122909
+ parameters.validate = (value, schema12, utils3) => value === undefined || schema12.validate(value, utils3);
122910
122910
  }
122911
122911
  if (optionInfo.redirect) {
122912
122912
  handlers.redirect = (value) => !value ? undefined : {
@@ -122921,7 +122921,7 @@ function optionInfoToSchema(optionInfo, {
122921
122921
  }
122922
122922
  if (isCLI && !optionInfo.array) {
122923
122923
  const originalPreprocess = parameters.preprocess || ((x10) => x10);
122924
- parameters.preprocess = (value, schema11, utils3) => schema11.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
122924
+ parameters.preprocess = (value, schema12, utils3) => schema12.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
122925
122925
  }
122926
122926
  return optionInfo.array ? ArraySchema.create({
122927
122927
  ...isCLI ? {
@@ -124498,9 +124498,9 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
124498
124498
  };
124499
124499
  applyNormalization();
124500
124500
  for (const key2 of Object.keys(this._utils.schemas)) {
124501
- const schema11 = this._utils.schemas[key2];
124501
+ const schema12 = this._utils.schemas[key2];
124502
124502
  if (!(key2 in newOptions)) {
124503
- const defaultResult = normalizeDefaultResult(schema11.default(this._utils));
124503
+ const defaultResult = normalizeDefaultResult(schema12.default(this._utils));
124504
124504
  if ("value" in defaultResult) {
124505
124505
  restOptionsArray.push({ [key2]: defaultResult.value });
124506
124506
  }
@@ -124511,13 +124511,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
124511
124511
  if (!(key2 in newOptions)) {
124512
124512
  continue;
124513
124513
  }
124514
- const schema11 = this._utils.schemas[key2];
124514
+ const schema12 = this._utils.schemas[key2];
124515
124515
  const value = newOptions[key2];
124516
- const newValue = schema11.postprocess(value, this._utils);
124516
+ const newValue = schema12.postprocess(value, this._utils);
124517
124517
  if (newValue === VALUE_UNCHANGED) {
124518
124518
  continue;
124519
124519
  }
124520
- this._applyValidation(newValue, key2, schema11);
124520
+ this._applyValidation(newValue, key2, schema12);
124521
124521
  newOptions[key2] = newValue;
124522
124522
  }
124523
124523
  this._applyPostprocess(newOptions);
@@ -124528,14 +124528,14 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
124528
124528
  const transferredOptionsArray = [];
124529
124529
  const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
124530
124530
  for (const key2 of knownKeys) {
124531
- const schema11 = this._utils.schemas[key2];
124532
- const value = schema11.preprocess(options8[key2], this._utils);
124533
- this._applyValidation(value, key2, schema11);
124531
+ const schema12 = this._utils.schemas[key2];
124532
+ const value = schema12.preprocess(options8[key2], this._utils);
124533
+ this._applyValidation(value, key2, schema12);
124534
124534
  const appendTransferredOptions = ({ from, to: to5 }) => {
124535
124535
  transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
124536
124536
  };
124537
124537
  const warnDeprecated = ({ value: currentValue, redirectTo }) => {
124538
- const deprecatedResult = normalizeDeprecatedResult(schema11.deprecated(currentValue, this._utils), value, true);
124538
+ const deprecatedResult = normalizeDeprecatedResult(schema12.deprecated(currentValue, this._utils), value, true);
124539
124539
  if (deprecatedResult === false) {
124540
124540
  return;
124541
124541
  }
@@ -124553,13 +124553,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
124553
124553
  }
124554
124554
  }
124555
124555
  };
124556
- const forwardResult = normalizeForwardResult(schema11.forward(value, this._utils), value);
124556
+ const forwardResult = normalizeForwardResult(schema12.forward(value, this._utils), value);
124557
124557
  forwardResult.forEach(appendTransferredOptions);
124558
- const redirectResult = normalizeRedirectResult(schema11.redirect(value, this._utils), value);
124558
+ const redirectResult = normalizeRedirectResult(schema12.redirect(value, this._utils), value);
124559
124559
  redirectResult.redirect.forEach(appendTransferredOptions);
124560
124560
  if ("remain" in redirectResult) {
124561
124561
  const remainingValue = redirectResult.remain;
124562
- newOptions[key2] = key2 in newOptions ? schema11.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
124562
+ newOptions[key2] = key2 in newOptions ? schema12.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
124563
124563
  warnDeprecated({ value: remainingValue });
124564
124564
  }
124565
124565
  for (const { from, to: to5 } of redirectResult.redirect) {
@@ -124587,8 +124587,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
124587
124587
  const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
124588
124588
  return { knownKeys, unknownKeys };
124589
124589
  }
124590
- _applyValidation(value, key2, schema11) {
124591
- const validateResult = normalizeValidateResult(schema11.validate(value, this._utils), value);
124590
+ _applyValidation(value, key2, schema12) {
124591
+ const validateResult = normalizeValidateResult(schema12.validate(value, this._utils), value);
124592
124592
  if (validateResult !== true) {
124593
124593
  throw this._invalidHandler(key2, validateResult.value, this._utils);
124594
124594
  }
@@ -124630,8 +124630,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
124630
124630
  for (const key2 of unknownKeys) {
124631
124631
  const value = postprocessed.override[key2];
124632
124632
  this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
124633
- const schema11 = this._utils.schemas[knownResultKey];
124634
- this._applyValidation(knownResultValue, knownResultKey, schema11);
124633
+ const schema12 = this._utils.schemas[knownResultKey];
124634
+ this._applyValidation(knownResultValue, knownResultKey, schema12);
124635
124635
  options8[knownResultKey] = knownResultValue;
124636
124636
  });
124637
124637
  }
@@ -138344,23 +138344,23 @@ var require_JSONSchema = __commonJS((exports) => {
138344
138344
  exports.Parent = Symbol("Parent");
138345
138345
  exports.Types = Symbol("Types");
138346
138346
  exports.Intersection = Symbol("Intersection");
138347
- exports.getRootSchema = (0, lodash_1.memoize)((schema11) => {
138348
- const parent = schema11[exports.Parent];
138347
+ exports.getRootSchema = (0, lodash_1.memoize)((schema12) => {
138348
+ const parent = schema12[exports.Parent];
138349
138349
  if (!parent) {
138350
- return schema11;
138350
+ return schema12;
138351
138351
  }
138352
138352
  return (0, exports.getRootSchema)(parent);
138353
138353
  });
138354
- function isBoolean(schema11) {
138355
- return schema11 === true || schema11 === false;
138354
+ function isBoolean(schema12) {
138355
+ return schema12 === true || schema12 === false;
138356
138356
  }
138357
138357
  exports.isBoolean = isBoolean;
138358
- function isPrimitive(schema11) {
138359
- return !(0, lodash_1.isPlainObject)(schema11);
138358
+ function isPrimitive(schema12) {
138359
+ return !(0, lodash_1.isPlainObject)(schema12);
138360
138360
  }
138361
138361
  exports.isPrimitive = isPrimitive;
138362
- function isCompound(schema11) {
138363
- return Array.isArray(schema11.type) || "anyOf" in schema11 || "oneOf" in schema11;
138362
+ function isCompound(schema12) {
138363
+ return Array.isArray(schema12.type) || "anyOf" in schema12 || "oneOf" in schema12;
138364
138364
  }
138365
138365
  exports.isCompound = isCompound;
138366
138366
  });
@@ -138587,9 +138587,9 @@ var require_type2 = __commonJS((exports, module) => {
138587
138587
  var require_schema5 = __commonJS((exports, module) => {
138588
138588
  var YAMLException = require_exception2();
138589
138589
  var Type = require_type2();
138590
- function compileList(schema11, name2) {
138590
+ function compileList(schema12, name2) {
138591
138591
  var result = [];
138592
- schema11[name2].forEach(function(currentType) {
138592
+ schema12[name2].forEach(function(currentType) {
138593
138593
  var newIndex = result.length;
138594
138594
  result.forEach(function(previousType, previousIndex) {
138595
138595
  if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
@@ -140534,7 +140534,7 @@ var require_dumper2 = __commonJS((exports, module) => {
140534
140534
  "OFF"
140535
140535
  ];
140536
140536
  var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
140537
- function compileStyleMap(schema11, map2) {
140537
+ function compileStyleMap(schema12, map2) {
140538
140538
  var result, keys, index, length, tag, style, type;
140539
140539
  if (map2 === null)
140540
140540
  return {};
@@ -140546,7 +140546,7 @@ var require_dumper2 = __commonJS((exports, module) => {
140546
140546
  if (tag.slice(0, 2) === "!!") {
140547
140547
  tag = "tag:yaml.org,2002:" + tag.slice(2);
140548
140548
  }
140549
- type = schema11.compiledTypeMap["fallback"][tag];
140549
+ type = schema12.compiledTypeMap["fallback"][tag];
140550
140550
  if (type && _hasOwnProperty.call(type.styleAliases, style)) {
140551
140551
  style = type.styleAliases[style];
140552
140552
  }
@@ -141205,11 +141205,11 @@ var require_utils7 = __commonJS((exports) => {
141205
141205
  function traverseArray(arr, callback, processed) {
141206
141206
  arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
141207
141207
  }
141208
- function traverseIntersection(schema11, callback, processed) {
141209
- if (typeof schema11 !== "object" || !schema11) {
141208
+ function traverseIntersection(schema12, callback, processed) {
141209
+ if (typeof schema12 !== "object" || !schema12) {
141210
141210
  return;
141211
141211
  }
141212
- const r5 = schema11;
141212
+ const r5 = schema12;
141213
141213
  const intersection2 = r5[JSONSchema_1.Intersection];
141214
141214
  if (!intersection2) {
141215
141215
  return;
@@ -141218,60 +141218,60 @@ var require_utils7 = __commonJS((exports) => {
141218
141218
  traverseArray(intersection2.allOf, callback, processed);
141219
141219
  }
141220
141220
  }
141221
- function traverse(schema11, callback, processed = new Set, key2) {
141222
- if (processed.has(schema11)) {
141221
+ function traverse(schema12, callback, processed = new Set, key2) {
141222
+ if (processed.has(schema12)) {
141223
141223
  return;
141224
141224
  }
141225
- processed.add(schema11);
141226
- callback(schema11, key2 !== null && key2 !== undefined ? key2 : null);
141227
- if (schema11.anyOf) {
141228
- traverseArray(schema11.anyOf, callback, processed);
141225
+ processed.add(schema12);
141226
+ callback(schema12, key2 !== null && key2 !== undefined ? key2 : null);
141227
+ if (schema12.anyOf) {
141228
+ traverseArray(schema12.anyOf, callback, processed);
141229
141229
  }
141230
- if (schema11.allOf) {
141231
- traverseArray(schema11.allOf, callback, processed);
141230
+ if (schema12.allOf) {
141231
+ traverseArray(schema12.allOf, callback, processed);
141232
141232
  }
141233
- if (schema11.oneOf) {
141234
- traverseArray(schema11.oneOf, callback, processed);
141233
+ if (schema12.oneOf) {
141234
+ traverseArray(schema12.oneOf, callback, processed);
141235
141235
  }
141236
- if (schema11.properties) {
141237
- traverseObjectKeys(schema11.properties, callback, processed);
141236
+ if (schema12.properties) {
141237
+ traverseObjectKeys(schema12.properties, callback, processed);
141238
141238
  }
141239
- if (schema11.patternProperties) {
141240
- traverseObjectKeys(schema11.patternProperties, callback, processed);
141239
+ if (schema12.patternProperties) {
141240
+ traverseObjectKeys(schema12.patternProperties, callback, processed);
141241
141241
  }
141242
- if (schema11.additionalProperties && typeof schema11.additionalProperties === "object") {
141243
- traverse(schema11.additionalProperties, callback, processed);
141242
+ if (schema12.additionalProperties && typeof schema12.additionalProperties === "object") {
141243
+ traverse(schema12.additionalProperties, callback, processed);
141244
141244
  }
141245
- if (schema11.items) {
141246
- const { items } = schema11;
141245
+ if (schema12.items) {
141246
+ const { items } = schema12;
141247
141247
  if (Array.isArray(items)) {
141248
141248
  traverseArray(items, callback, processed);
141249
141249
  } else {
141250
141250
  traverse(items, callback, processed);
141251
141251
  }
141252
141252
  }
141253
- if (schema11.additionalItems && typeof schema11.additionalItems === "object") {
141254
- traverse(schema11.additionalItems, callback, processed);
141253
+ if (schema12.additionalItems && typeof schema12.additionalItems === "object") {
141254
+ traverse(schema12.additionalItems, callback, processed);
141255
141255
  }
141256
- if (schema11.dependencies) {
141257
- if (Array.isArray(schema11.dependencies)) {
141258
- traverseArray(schema11.dependencies, callback, processed);
141256
+ if (schema12.dependencies) {
141257
+ if (Array.isArray(schema12.dependencies)) {
141258
+ traverseArray(schema12.dependencies, callback, processed);
141259
141259
  } else {
141260
- traverseObjectKeys(schema11.dependencies, callback, processed);
141260
+ traverseObjectKeys(schema12.dependencies, callback, processed);
141261
141261
  }
141262
141262
  }
141263
- if (schema11.definitions) {
141264
- traverseObjectKeys(schema11.definitions, callback, processed);
141263
+ if (schema12.definitions) {
141264
+ traverseObjectKeys(schema12.definitions, callback, processed);
141265
141265
  }
141266
- if (schema11.$defs) {
141267
- traverseObjectKeys(schema11.$defs, callback, processed);
141266
+ if (schema12.$defs) {
141267
+ traverseObjectKeys(schema12.$defs, callback, processed);
141268
141268
  }
141269
- if (schema11.not) {
141270
- traverse(schema11.not, callback, processed);
141269
+ if (schema12.not) {
141270
+ traverse(schema12.not, callback, processed);
141271
141271
  }
141272
- traverseIntersection(schema11, callback, processed);
141273
- Object.keys(schema11).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
141274
- const child = schema11[key3];
141272
+ traverseIntersection(schema12, callback, processed);
141273
+ Object.keys(schema12).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
141274
+ const child = schema12[key3];
141275
141275
  if (child && typeof child === "object") {
141276
141276
  traverseObjectKeys(child, callback, processed);
141277
141277
  }
@@ -141353,14 +141353,14 @@ var require_utils7 = __commonJS((exports) => {
141353
141353
  return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
141354
141354
  }
141355
141355
  }
141356
- function escapeBlockComment(schema11) {
141356
+ function escapeBlockComment(schema12) {
141357
141357
  const replacer = "* /";
141358
- if (schema11 === null || typeof schema11 !== "object") {
141358
+ if (schema12 === null || typeof schema12 !== "object") {
141359
141359
  return;
141360
141360
  }
141361
- for (const key2 of Object.keys(schema11)) {
141362
- if (key2 === "description" && typeof schema11[key2] === "string") {
141363
- schema11[key2] = schema11[key2].replace(/\*\//g, replacer);
141361
+ for (const key2 of Object.keys(schema12)) {
141362
+ if (key2 === "description" && typeof schema12[key2] === "string") {
141363
+ schema12[key2] = schema12[key2].replace(/\*\//g, replacer);
141364
141364
  }
141365
141365
  }
141366
141366
  }
@@ -141372,45 +141372,45 @@ var require_utils7 = __commonJS((exports) => {
141372
141372
  return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
141373
141373
  }
141374
141374
  exports.pathTransform = pathTransform;
141375
- function maybeStripDefault(schema11) {
141376
- if (!("default" in schema11)) {
141377
- return schema11;
141375
+ function maybeStripDefault(schema12) {
141376
+ if (!("default" in schema12)) {
141377
+ return schema12;
141378
141378
  }
141379
- switch (schema11.type) {
141379
+ switch (schema12.type) {
141380
141380
  case "array":
141381
- if (Array.isArray(schema11.default)) {
141382
- return schema11;
141381
+ if (Array.isArray(schema12.default)) {
141382
+ return schema12;
141383
141383
  }
141384
141384
  break;
141385
141385
  case "boolean":
141386
- if (typeof schema11.default === "boolean") {
141387
- return schema11;
141386
+ if (typeof schema12.default === "boolean") {
141387
+ return schema12;
141388
141388
  }
141389
141389
  break;
141390
141390
  case "integer":
141391
141391
  case "number":
141392
- if (typeof schema11.default === "number") {
141393
- return schema11;
141392
+ if (typeof schema12.default === "number") {
141393
+ return schema12;
141394
141394
  }
141395
141395
  break;
141396
141396
  case "string":
141397
- if (typeof schema11.default === "string") {
141398
- return schema11;
141397
+ if (typeof schema12.default === "string") {
141398
+ return schema12;
141399
141399
  }
141400
141400
  break;
141401
141401
  case "null":
141402
- if (schema11.default === null) {
141403
- return schema11;
141402
+ if (schema12.default === null) {
141403
+ return schema12;
141404
141404
  }
141405
141405
  break;
141406
141406
  case "object":
141407
- if ((0, lodash_1.isPlainObject)(schema11.default)) {
141408
- return schema11;
141407
+ if ((0, lodash_1.isPlainObject)(schema12.default)) {
141408
+ return schema12;
141409
141409
  }
141410
141410
  break;
141411
141411
  }
141412
- delete schema11.default;
141413
- return schema11;
141412
+ delete schema12.default;
141413
+ return schema12;
141414
141414
  }
141415
141415
  exports.maybeStripDefault = maybeStripDefault;
141416
141416
  function appendToDescription(existingDescription, ...values) {
@@ -141424,11 +141424,11 @@ ${values.join(`
141424
141424
  `);
141425
141425
  }
141426
141426
  exports.appendToDescription = appendToDescription;
141427
- function isSchemaLike(schema11) {
141428
- if (!(0, lodash_1.isPlainObject)(schema11)) {
141427
+ function isSchemaLike(schema12) {
141428
+ if (!(0, lodash_1.isPlainObject)(schema12)) {
141429
141429
  return false;
141430
141430
  }
141431
- const parent = schema11[JSONSchema_1.Parent];
141431
+ const parent = schema12[JSONSchema_1.Parent];
141432
141432
  if (parent === null) {
141433
141433
  return true;
141434
141434
  }
@@ -141445,7 +141445,7 @@ ${values.join(`
141445
141445
  "properties",
141446
141446
  "required"
141447
141447
  ];
141448
- if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema11)) {
141448
+ if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema12)) {
141449
141449
  return false;
141450
141450
  }
141451
141451
  return true;
@@ -141743,13 +141743,13 @@ var require_typesOfSchema = __commonJS((exports) => {
141743
141743
  exports.typesOfSchema = undefined;
141744
141744
  var lodash_1 = require_lodash8();
141745
141745
  var JSONSchema_1 = require_JSONSchema();
141746
- function typesOfSchema(schema11) {
141747
- if (schema11.tsType) {
141746
+ function typesOfSchema(schema12) {
141747
+ if (schema12.tsType) {
141748
141748
  return new Set(["CUSTOM_TYPE"]);
141749
141749
  }
141750
141750
  const matchedTypes = new Set;
141751
141751
  for (const [schemaType, f7] of Object.entries(matchers)) {
141752
- if (f7(schema11)) {
141752
+ if (f7(schema12)) {
141753
141753
  matchedTypes.add(schemaType);
141754
141754
  }
141755
141755
  }
@@ -141760,26 +141760,26 @@ var require_typesOfSchema = __commonJS((exports) => {
141760
141760
  }
141761
141761
  exports.typesOfSchema = typesOfSchema;
141762
141762
  var matchers = {
141763
- ALL_OF(schema11) {
141764
- return "allOf" in schema11;
141763
+ ALL_OF(schema12) {
141764
+ return "allOf" in schema12;
141765
141765
  },
141766
- ANY(schema11) {
141767
- if (Object.keys(schema11).length === 0) {
141766
+ ANY(schema12) {
141767
+ if (Object.keys(schema12).length === 0) {
141768
141768
  return true;
141769
141769
  }
141770
- return schema11.type === "any";
141770
+ return schema12.type === "any";
141771
141771
  },
141772
- ANY_OF(schema11) {
141773
- return "anyOf" in schema11;
141772
+ ANY_OF(schema12) {
141773
+ return "anyOf" in schema12;
141774
141774
  },
141775
- BOOLEAN(schema11) {
141776
- if ("enum" in schema11) {
141775
+ BOOLEAN(schema12) {
141776
+ if ("enum" in schema12) {
141777
141777
  return false;
141778
141778
  }
141779
- if (schema11.type === "boolean") {
141779
+ if (schema12.type === "boolean") {
141780
141780
  return true;
141781
141781
  }
141782
- if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "boolean") {
141782
+ if (!(0, JSONSchema_1.isCompound)(schema12) && typeof schema12.default === "boolean") {
141783
141783
  return true;
141784
141784
  }
141785
141785
  return false;
@@ -141787,74 +141787,74 @@ var require_typesOfSchema = __commonJS((exports) => {
141787
141787
  CUSTOM_TYPE() {
141788
141788
  return false;
141789
141789
  },
141790
- NAMED_ENUM(schema11) {
141791
- return "enum" in schema11 && "tsEnumNames" in schema11;
141790
+ NAMED_ENUM(schema12) {
141791
+ return "enum" in schema12 && "tsEnumNames" in schema12;
141792
141792
  },
141793
- NAMED_SCHEMA(schema11) {
141794
- return "$id" in schema11 && (("patternProperties" in schema11) || ("properties" in schema11));
141793
+ NAMED_SCHEMA(schema12) {
141794
+ return "$id" in schema12 && (("patternProperties" in schema12) || ("properties" in schema12));
141795
141795
  },
141796
- NEVER(schema11) {
141797
- return schema11 === false;
141796
+ NEVER(schema12) {
141797
+ return schema12 === false;
141798
141798
  },
141799
- NULL(schema11) {
141800
- return schema11.type === "null";
141799
+ NULL(schema12) {
141800
+ return schema12.type === "null";
141801
141801
  },
141802
- NUMBER(schema11) {
141803
- if ("enum" in schema11) {
141802
+ NUMBER(schema12) {
141803
+ if ("enum" in schema12) {
141804
141804
  return false;
141805
141805
  }
141806
- if (schema11.type === "integer" || schema11.type === "number") {
141806
+ if (schema12.type === "integer" || schema12.type === "number") {
141807
141807
  return true;
141808
141808
  }
141809
- if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "number") {
141809
+ if (!(0, JSONSchema_1.isCompound)(schema12) && typeof schema12.default === "number") {
141810
141810
  return true;
141811
141811
  }
141812
141812
  return false;
141813
141813
  },
141814
- OBJECT(schema11) {
141815
- return schema11.type === "object" && !(0, lodash_1.isPlainObject)(schema11.additionalProperties) && !schema11.allOf && !schema11.anyOf && !schema11.oneOf && !schema11.patternProperties && !schema11.properties && !schema11.required;
141814
+ OBJECT(schema12) {
141815
+ return schema12.type === "object" && !(0, lodash_1.isPlainObject)(schema12.additionalProperties) && !schema12.allOf && !schema12.anyOf && !schema12.oneOf && !schema12.patternProperties && !schema12.properties && !schema12.required;
141816
141816
  },
141817
- ONE_OF(schema11) {
141818
- return "oneOf" in schema11;
141817
+ ONE_OF(schema12) {
141818
+ return "oneOf" in schema12;
141819
141819
  },
141820
- REFERENCE(schema11) {
141821
- return "$ref" in schema11;
141820
+ REFERENCE(schema12) {
141821
+ return "$ref" in schema12;
141822
141822
  },
141823
- STRING(schema11) {
141824
- if ("enum" in schema11) {
141823
+ STRING(schema12) {
141824
+ if ("enum" in schema12) {
141825
141825
  return false;
141826
141826
  }
141827
- if (schema11.type === "string") {
141827
+ if (schema12.type === "string") {
141828
141828
  return true;
141829
141829
  }
141830
- if (!(0, JSONSchema_1.isCompound)(schema11) && typeof schema11.default === "string") {
141830
+ if (!(0, JSONSchema_1.isCompound)(schema12) && typeof schema12.default === "string") {
141831
141831
  return true;
141832
141832
  }
141833
141833
  return false;
141834
141834
  },
141835
- TYPED_ARRAY(schema11) {
141836
- if (schema11.type && schema11.type !== "array") {
141835
+ TYPED_ARRAY(schema12) {
141836
+ if (schema12.type && schema12.type !== "array") {
141837
141837
  return false;
141838
141838
  }
141839
- return "items" in schema11;
141839
+ return "items" in schema12;
141840
141840
  },
141841
- UNION(schema11) {
141842
- return Array.isArray(schema11.type);
141841
+ UNION(schema12) {
141842
+ return Array.isArray(schema12.type);
141843
141843
  },
141844
- UNNAMED_ENUM(schema11) {
141845
- if ("tsEnumNames" in schema11) {
141844
+ UNNAMED_ENUM(schema12) {
141845
+ if ("tsEnumNames" in schema12) {
141846
141846
  return false;
141847
141847
  }
141848
- if (schema11.type && schema11.type !== "boolean" && schema11.type !== "integer" && schema11.type !== "number" && schema11.type !== "string") {
141848
+ if (schema12.type && schema12.type !== "boolean" && schema12.type !== "integer" && schema12.type !== "number" && schema12.type !== "string") {
141849
141849
  return false;
141850
141850
  }
141851
- return "enum" in schema11;
141851
+ return "enum" in schema12;
141852
141852
  },
141853
141853
  UNNAMED_SCHEMA() {
141854
141854
  return false;
141855
141855
  },
141856
- UNTYPED_ARRAY(schema11) {
141857
- return schema11.type === "array" && !("items" in schema11);
141856
+ UNTYPED_ARRAY(schema12) {
141857
+ return schema12.type === "array" && !("items" in schema12);
141858
141858
  }
141859
141859
  };
141860
141860
  });
@@ -141865,10 +141865,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
141865
141865
  exports.applySchemaTyping = undefined;
141866
141866
  var JSONSchema_1 = require_JSONSchema();
141867
141867
  var typesOfSchema_1 = require_typesOfSchema();
141868
- function applySchemaTyping(schema11) {
141868
+ function applySchemaTyping(schema12) {
141869
141869
  var _a7;
141870
- const types = (0, typesOfSchema_1.typesOfSchema)(schema11);
141871
- Object.defineProperty(schema11, JSONSchema_1.Types, {
141870
+ const types = (0, typesOfSchema_1.typesOfSchema)(schema12);
141871
+ Object.defineProperty(schema12, JSONSchema_1.Types, {
141872
141872
  enumerable: false,
141873
141873
  value: types,
141874
141874
  writable: false
@@ -141877,23 +141877,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
141877
141877
  return;
141878
141878
  }
141879
141879
  const intersection2 = {
141880
- [JSONSchema_1.Parent]: schema11,
141880
+ [JSONSchema_1.Parent]: schema12,
141881
141881
  [JSONSchema_1.Types]: new Set(["ALL_OF"]),
141882
- $id: schema11.$id,
141883
- description: schema11.description,
141884
- name: schema11.name,
141885
- title: schema11.title,
141886
- allOf: (_a7 = schema11.allOf) !== null && _a7 !== undefined ? _a7 : [],
141882
+ $id: schema12.$id,
141883
+ description: schema12.description,
141884
+ name: schema12.name,
141885
+ title: schema12.title,
141886
+ allOf: (_a7 = schema12.allOf) !== null && _a7 !== undefined ? _a7 : [],
141887
141887
  required: [],
141888
141888
  additionalProperties: false
141889
141889
  };
141890
141890
  types.delete("ALL_OF");
141891
- delete schema11.allOf;
141892
- delete schema11.$id;
141893
- delete schema11.description;
141894
- delete schema11.name;
141895
- delete schema11.title;
141896
- Object.defineProperty(schema11, JSONSchema_1.Intersection, {
141891
+ delete schema12.allOf;
141892
+ delete schema12.$id;
141893
+ delete schema12.description;
141894
+ delete schema12.name;
141895
+ delete schema12.title;
141896
+ Object.defineProperty(schema12, JSONSchema_1.Intersection, {
141897
141897
  enumerable: false,
141898
141898
  value: intersection2,
141899
141899
  writable: false
@@ -141911,186 +141911,186 @@ var require_normalizer = __commonJS((exports) => {
141911
141911
  var applySchemaTyping_1 = require_applySchemaTyping();
141912
141912
  var util_1 = __require("util");
141913
141913
  var rules = new Map;
141914
- function hasType(schema11, type) {
141915
- return schema11.type === type || Array.isArray(schema11.type) && schema11.type.includes(type);
141914
+ function hasType(schema12, type) {
141915
+ return schema12.type === type || Array.isArray(schema12.type) && schema12.type.includes(type);
141916
141916
  }
141917
- function isObjectType(schema11) {
141918
- return schema11.properties !== undefined || hasType(schema11, "object") || hasType(schema11, "any");
141917
+ function isObjectType(schema12) {
141918
+ return schema12.properties !== undefined || hasType(schema12, "object") || hasType(schema12, "any");
141919
141919
  }
141920
- function isArrayType(schema11) {
141921
- return schema11.items !== undefined || hasType(schema11, "array") || hasType(schema11, "any");
141920
+ function isArrayType(schema12) {
141921
+ return schema12.items !== undefined || hasType(schema12, "array") || hasType(schema12, "any");
141922
141922
  }
141923
- function isEnumTypeWithoutTsEnumNames(schema11) {
141924
- return schema11.type === "string" && schema11.enum !== undefined && schema11.tsEnumNames === undefined;
141923
+ function isEnumTypeWithoutTsEnumNames(schema12) {
141924
+ return schema12.type === "string" && schema12.enum !== undefined && schema12.tsEnumNames === undefined;
141925
141925
  }
141926
- rules.set('Remove `type=["null"]` if `enum=[null]`', (schema11) => {
141927
- if (Array.isArray(schema11.enum) && schema11.enum.some((e8) => e8 === null) && Array.isArray(schema11.type) && schema11.type.includes("null")) {
141928
- schema11.type = schema11.type.filter((type) => type !== "null");
141926
+ rules.set('Remove `type=["null"]` if `enum=[null]`', (schema12) => {
141927
+ if (Array.isArray(schema12.enum) && schema12.enum.some((e8) => e8 === null) && Array.isArray(schema12.type) && schema12.type.includes("null")) {
141928
+ schema12.type = schema12.type.filter((type) => type !== "null");
141929
141929
  }
141930
141930
  });
141931
- rules.set("Destructure unary types", (schema11) => {
141932
- if (schema11.type && Array.isArray(schema11.type) && schema11.type.length === 1) {
141933
- schema11.type = schema11.type[0];
141931
+ rules.set("Destructure unary types", (schema12) => {
141932
+ if (schema12.type && Array.isArray(schema12.type) && schema12.type.length === 1) {
141933
+ schema12.type = schema12.type[0];
141934
141934
  }
141935
141935
  });
141936
- rules.set("Add empty `required` property if none is defined", (schema11) => {
141937
- if (isObjectType(schema11) && !("required" in schema11)) {
141938
- schema11.required = [];
141936
+ rules.set("Add empty `required` property if none is defined", (schema12) => {
141937
+ if (isObjectType(schema12) && !("required" in schema12)) {
141938
+ schema12.required = [];
141939
141939
  }
141940
141940
  });
141941
- rules.set("Transform `required`=false to `required`=[]", (schema11) => {
141942
- if (schema11.required === false) {
141943
- schema11.required = [];
141941
+ rules.set("Transform `required`=false to `required`=[]", (schema12) => {
141942
+ if (schema12.required === false) {
141943
+ schema12.required = [];
141944
141944
  }
141945
141945
  });
141946
- rules.set("Default additionalProperties", (schema11, _10, options8) => {
141947
- if (isObjectType(schema11) && !("additionalProperties" in schema11) && schema11.patternProperties === undefined) {
141948
- schema11.additionalProperties = options8.additionalProperties;
141946
+ rules.set("Default additionalProperties", (schema12, _10, options8) => {
141947
+ if (isObjectType(schema12) && !("additionalProperties" in schema12) && schema12.patternProperties === undefined) {
141948
+ schema12.additionalProperties = options8.additionalProperties;
141949
141949
  }
141950
141950
  });
141951
- rules.set("Transform id to $id", (schema11, fileName) => {
141952
- if (!(0, utils_1.isSchemaLike)(schema11)) {
141951
+ rules.set("Transform id to $id", (schema12, fileName) => {
141952
+ if (!(0, utils_1.isSchemaLike)(schema12)) {
141953
141953
  return;
141954
141954
  }
141955
- if (schema11.id && schema11.$id && schema11.id !== schema11.$id) {
141956
- throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema11.id}, $id=${schema11.$id} in ${fileName}`);
141955
+ if (schema12.id && schema12.$id && schema12.id !== schema12.$id) {
141956
+ throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema12.id}, $id=${schema12.$id} in ${fileName}`);
141957
141957
  }
141958
- if (schema11.id) {
141959
- schema11.$id = schema11.id;
141960
- delete schema11.id;
141958
+ if (schema12.id) {
141959
+ schema12.$id = schema12.id;
141960
+ delete schema12.id;
141961
141961
  }
141962
141962
  });
141963
- rules.set("Add an $id to anything that needs it", (schema11, fileName, _options, _key, dereferencedPaths) => {
141964
- if (!(0, utils_1.isSchemaLike)(schema11)) {
141963
+ rules.set("Add an $id to anything that needs it", (schema12, fileName, _options, _key, dereferencedPaths) => {
141964
+ if (!(0, utils_1.isSchemaLike)(schema12)) {
141965
141965
  return;
141966
141966
  }
141967
- if (!schema11.$id && !schema11[JSONSchema_1.Parent]) {
141968
- schema11.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
141967
+ if (!schema12.$id && !schema12[JSONSchema_1.Parent]) {
141968
+ schema12.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
141969
141969
  return;
141970
141970
  }
141971
- if (!isArrayType(schema11) && !isObjectType(schema11)) {
141971
+ if (!isArrayType(schema12) && !isObjectType(schema12)) {
141972
141972
  return;
141973
141973
  }
141974
- const dereferencedName = dereferencedPaths.get(schema11);
141975
- if (!schema11.$id && !schema11.title && dereferencedName) {
141976
- schema11.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
141974
+ const dereferencedName = dereferencedPaths.get(schema12);
141975
+ if (!schema12.$id && !schema12.title && dereferencedName) {
141976
+ schema12.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
141977
141977
  }
141978
141978
  if (dereferencedName) {
141979
- dereferencedPaths.delete(schema11);
141979
+ dereferencedPaths.delete(schema12);
141980
141980
  }
141981
141981
  });
141982
- rules.set("Escape closing JSDoc comment", (schema11) => {
141983
- (0, utils_1.escapeBlockComment)(schema11);
141982
+ rules.set("Escape closing JSDoc comment", (schema12) => {
141983
+ (0, utils_1.escapeBlockComment)(schema12);
141984
141984
  });
141985
- rules.set("Add JSDoc comments for minItems and maxItems", (schema11) => {
141986
- if (!isArrayType(schema11)) {
141985
+ rules.set("Add JSDoc comments for minItems and maxItems", (schema12) => {
141986
+ if (!isArrayType(schema12)) {
141987
141987
  return;
141988
141988
  }
141989
141989
  const commentsToAppend = [
141990
- "minItems" in schema11 ? `@minItems ${schema11.minItems}` : "",
141991
- "maxItems" in schema11 ? `@maxItems ${schema11.maxItems}` : ""
141990
+ "minItems" in schema12 ? `@minItems ${schema12.minItems}` : "",
141991
+ "maxItems" in schema12 ? `@maxItems ${schema12.maxItems}` : ""
141992
141992
  ].filter(Boolean);
141993
141993
  if (commentsToAppend.length) {
141994
- schema11.description = (0, utils_1.appendToDescription)(schema11.description, ...commentsToAppend);
141994
+ schema12.description = (0, utils_1.appendToDescription)(schema12.description, ...commentsToAppend);
141995
141995
  }
141996
141996
  });
141997
- rules.set("Optionally remove maxItems and minItems", (schema11, _fileName, options8) => {
141998
- if (!isArrayType(schema11)) {
141997
+ rules.set("Optionally remove maxItems and minItems", (schema12, _fileName, options8) => {
141998
+ if (!isArrayType(schema12)) {
141999
141999
  return;
142000
142000
  }
142001
- if ("minItems" in schema11 && options8.ignoreMinAndMaxItems) {
142002
- delete schema11.minItems;
142001
+ if ("minItems" in schema12 && options8.ignoreMinAndMaxItems) {
142002
+ delete schema12.minItems;
142003
142003
  }
142004
- if ("maxItems" in schema11 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
142005
- delete schema11.maxItems;
142004
+ if ("maxItems" in schema12 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
142005
+ delete schema12.maxItems;
142006
142006
  }
142007
142007
  });
142008
- rules.set("Normalize schema.minItems", (schema11, _fileName, options8) => {
142008
+ rules.set("Normalize schema.minItems", (schema12, _fileName, options8) => {
142009
142009
  if (options8.ignoreMinAndMaxItems) {
142010
142010
  return;
142011
142011
  }
142012
- if (!isArrayType(schema11)) {
142012
+ if (!isArrayType(schema12)) {
142013
142013
  return;
142014
142014
  }
142015
- const { minItems } = schema11;
142016
- schema11.minItems = typeof minItems === "number" ? minItems : 0;
142015
+ const { minItems } = schema12;
142016
+ schema12.minItems = typeof minItems === "number" ? minItems : 0;
142017
142017
  });
142018
- rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema11, _fileName, options8) => {
142018
+ rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema12, _fileName, options8) => {
142019
142019
  if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
142020
142020
  return;
142021
142021
  }
142022
- if (!isArrayType(schema11)) {
142022
+ if (!isArrayType(schema12)) {
142023
142023
  return;
142024
142024
  }
142025
- const { maxItems, minItems } = schema11;
142025
+ const { maxItems, minItems } = schema12;
142026
142026
  if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
142027
- delete schema11.maxItems;
142027
+ delete schema12.maxItems;
142028
142028
  }
142029
142029
  });
142030
- rules.set("Normalize schema.items", (schema11, _fileName, options8) => {
142030
+ rules.set("Normalize schema.items", (schema12, _fileName, options8) => {
142031
142031
  if (options8.ignoreMinAndMaxItems) {
142032
142032
  return;
142033
142033
  }
142034
- const { maxItems, minItems } = schema11;
142034
+ const { maxItems, minItems } = schema12;
142035
142035
  const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
142036
142036
  const hasMinItems = typeof minItems === "number" && minItems > 0;
142037
- if (schema11.items && !Array.isArray(schema11.items) && (hasMaxItems || hasMinItems)) {
142038
- const items = schema11.items;
142037
+ if (schema12.items && !Array.isArray(schema12.items) && (hasMaxItems || hasMinItems)) {
142038
+ const items = schema12.items;
142039
142039
  const newItems = Array(maxItems || minItems || 0).fill(items);
142040
142040
  if (!hasMaxItems) {
142041
- schema11.additionalItems = items;
142041
+ schema12.additionalItems = items;
142042
142042
  }
142043
- schema11.items = newItems;
142043
+ schema12.items = newItems;
142044
142044
  }
142045
- if (Array.isArray(schema11.items) && hasMaxItems && maxItems < schema11.items.length) {
142046
- schema11.items = schema11.items.slice(0, maxItems);
142045
+ if (Array.isArray(schema12.items) && hasMaxItems && maxItems < schema12.items.length) {
142046
+ schema12.items = schema12.items.slice(0, maxItems);
142047
142047
  }
142048
- return schema11;
142048
+ return schema12;
142049
142049
  });
142050
- rules.set("Remove extends, if it is empty", (schema11) => {
142051
- if (!schema11.hasOwnProperty("extends")) {
142050
+ rules.set("Remove extends, if it is empty", (schema12) => {
142051
+ if (!schema12.hasOwnProperty("extends")) {
142052
142052
  return;
142053
142053
  }
142054
- if (schema11.extends == null || Array.isArray(schema11.extends) && schema11.extends.length === 0) {
142055
- delete schema11.extends;
142054
+ if (schema12.extends == null || Array.isArray(schema12.extends) && schema12.extends.length === 0) {
142055
+ delete schema12.extends;
142056
142056
  }
142057
142057
  });
142058
- rules.set("Make extends always an array, if it is defined", (schema11) => {
142059
- if (schema11.extends == null) {
142058
+ rules.set("Make extends always an array, if it is defined", (schema12) => {
142059
+ if (schema12.extends == null) {
142060
142060
  return;
142061
142061
  }
142062
- if (!Array.isArray(schema11.extends)) {
142063
- schema11.extends = [schema11.extends];
142062
+ if (!Array.isArray(schema12.extends)) {
142063
+ schema12.extends = [schema12.extends];
142064
142064
  }
142065
142065
  });
142066
- rules.set("Transform definitions to $defs", (schema11, fileName) => {
142067
- if (schema11.definitions && schema11.$defs && !(0, util_1.isDeepStrictEqual)(schema11.definitions, schema11.$defs)) {
142068
- throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema11.id} in ${fileName}`);
142066
+ rules.set("Transform definitions to $defs", (schema12, fileName) => {
142067
+ if (schema12.definitions && schema12.$defs && !(0, util_1.isDeepStrictEqual)(schema12.definitions, schema12.$defs)) {
142068
+ throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema12.id} in ${fileName}`);
142069
142069
  }
142070
- if (schema11.definitions) {
142071
- schema11.$defs = schema11.definitions;
142072
- delete schema11.definitions;
142070
+ if (schema12.definitions) {
142071
+ schema12.$defs = schema12.definitions;
142072
+ delete schema12.definitions;
142073
142073
  }
142074
142074
  });
142075
- rules.set("Transform const to singleton enum", (schema11) => {
142076
- if (schema11.const !== undefined) {
142077
- schema11.enum = [schema11.const];
142078
- delete schema11.const;
142075
+ rules.set("Transform const to singleton enum", (schema12) => {
142076
+ if (schema12.const !== undefined) {
142077
+ schema12.enum = [schema12.const];
142078
+ delete schema12.const;
142079
142079
  }
142080
142080
  });
142081
- rules.set("Add tsEnumNames to enum types", (schema11, _10, options8) => {
142081
+ rules.set("Add tsEnumNames to enum types", (schema12, _10, options8) => {
142082
142082
  var _a7;
142083
- if (isEnumTypeWithoutTsEnumNames(schema11) && options8.inferStringEnumKeysFromValues) {
142084
- schema11.tsEnumNames = (_a7 = schema11.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
142083
+ if (isEnumTypeWithoutTsEnumNames(schema12) && options8.inferStringEnumKeysFromValues) {
142084
+ schema12.tsEnumNames = (_a7 = schema12.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
142085
142085
  }
142086
142086
  });
142087
- rules.set("Pre-calculate schema types and intersections", (schema11) => {
142088
- if (schema11 !== null && typeof schema11 === "object") {
142089
- (0, applySchemaTyping_1.applySchemaTyping)(schema11);
142087
+ rules.set("Pre-calculate schema types and intersections", (schema12) => {
142088
+ if (schema12 !== null && typeof schema12 === "object") {
142089
+ (0, applySchemaTyping_1.applySchemaTyping)(schema12);
142090
142090
  }
142091
142091
  });
142092
142092
  function normalize2(rootSchema, dereferencedPaths, filename, options8) {
142093
- rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema11, key2) => rule(schema11, filename, options8, key2, dereferencedPaths)));
142093
+ rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema12, key2) => rule(schema12, filename, options8, key2, dereferencedPaths)));
142094
142094
  return rootSchema;
142095
142095
  }
142096
142096
  exports.normalize = normalize2;
@@ -142172,37 +142172,37 @@ var require_parser2 = __commonJS((exports) => {
142172
142172
  var AST_1 = require_AST();
142173
142173
  var JSONSchema_1 = require_JSONSchema();
142174
142174
  var utils_1 = require_utils7();
142175
- function parse11(schema11, options8, keyName, processed = new Map, usedNames = new Set) {
142176
- if ((0, JSONSchema_1.isPrimitive)(schema11)) {
142177
- if ((0, JSONSchema_1.isBoolean)(schema11)) {
142178
- return parseBooleanSchema(schema11, keyName, options8);
142175
+ function parse11(schema12, options8, keyName, processed = new Map, usedNames = new Set) {
142176
+ if ((0, JSONSchema_1.isPrimitive)(schema12)) {
142177
+ if ((0, JSONSchema_1.isBoolean)(schema12)) {
142178
+ return parseBooleanSchema(schema12, keyName, options8);
142179
142179
  }
142180
- return parseLiteral(schema11, keyName);
142180
+ return parseLiteral(schema12, keyName);
142181
142181
  }
142182
- const intersection2 = schema11[JSONSchema_1.Intersection];
142183
- const types = schema11[JSONSchema_1.Types];
142182
+ const intersection2 = schema12[JSONSchema_1.Intersection];
142183
+ const types = schema12[JSONSchema_1.Types];
142184
142184
  if (intersection2) {
142185
142185
  const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
142186
142186
  types.forEach((type) => {
142187
- ast.params.push(parseAsTypeWithCache(schema11, type, options8, keyName, processed, usedNames));
142187
+ ast.params.push(parseAsTypeWithCache(schema12, type, options8, keyName, processed, usedNames));
142188
142188
  });
142189
- (0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema11, "Output:", ast);
142189
+ (0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema12, "Output:", ast);
142190
142190
  return ast;
142191
142191
  }
142192
142192
  if (types.size === 1) {
142193
142193
  const type = [...types][0];
142194
- const ast = parseAsTypeWithCache(schema11, type, options8, keyName, processed, usedNames);
142195
- (0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema11, "Output:", ast);
142194
+ const ast = parseAsTypeWithCache(schema12, type, options8, keyName, processed, usedNames);
142195
+ (0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema12, "Output:", ast);
142196
142196
  return ast;
142197
142197
  }
142198
142198
  throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
142199
142199
  }
142200
142200
  exports.parse = parse11;
142201
- function parseAsTypeWithCache(schema11, type, options8, keyName, processed = new Map, usedNames = new Set) {
142202
- let cachedTypeMap = processed.get(schema11);
142201
+ function parseAsTypeWithCache(schema12, type, options8, keyName, processed = new Map, usedNames = new Set) {
142202
+ let cachedTypeMap = processed.get(schema12);
142203
142203
  if (!cachedTypeMap) {
142204
142204
  cachedTypeMap = new Map;
142205
- processed.set(schema11, cachedTypeMap);
142205
+ processed.set(schema12, cachedTypeMap);
142206
142206
  }
142207
142207
  const cachedAST = cachedTypeMap.get(type);
142208
142208
  if (cachedAST) {
@@ -142210,10 +142210,10 @@ var require_parser2 = __commonJS((exports) => {
142210
142210
  }
142211
142211
  const ast = {};
142212
142212
  cachedTypeMap.set(type, ast);
142213
- return Object.assign(ast, parseNonLiteral(schema11, type, options8, keyName, processed, usedNames));
142213
+ return Object.assign(ast, parseNonLiteral(schema12, type, options8, keyName, processed, usedNames));
142214
142214
  }
142215
- function parseBooleanSchema(schema11, keyName, options8) {
142216
- if (schema11) {
142215
+ function parseBooleanSchema(schema12, keyName, options8) {
142216
+ if (schema12) {
142217
142217
  return {
142218
142218
  keyName,
142219
142219
  type: options8.unknownAny ? "UNKNOWN" : "ANY"
@@ -142224,157 +142224,157 @@ var require_parser2 = __commonJS((exports) => {
142224
142224
  type: "NEVER"
142225
142225
  };
142226
142226
  }
142227
- function parseLiteral(schema11, keyName) {
142227
+ function parseLiteral(schema12, keyName) {
142228
142228
  return {
142229
142229
  keyName,
142230
- params: schema11,
142230
+ params: schema12,
142231
142231
  type: "LITERAL"
142232
142232
  };
142233
142233
  }
142234
- function parseNonLiteral(schema11, type, options8, keyName, processed, usedNames) {
142235
- const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema11));
142236
- const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema11);
142234
+ function parseNonLiteral(schema12, type, options8, keyName, processed, usedNames) {
142235
+ const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema12));
142236
+ const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema12);
142237
142237
  switch (type) {
142238
142238
  case "ALL_OF":
142239
142239
  return {
142240
- comment: schema11.description,
142241
- deprecated: schema11.deprecated,
142240
+ comment: schema12.description,
142241
+ deprecated: schema12.deprecated,
142242
142242
  keyName,
142243
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142244
- params: schema11.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142243
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142244
+ params: schema12.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142245
142245
  type: "INTERSECTION"
142246
142246
  };
142247
142247
  case "ANY":
142248
- return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema11.description, deprecated: schema11.deprecated, keyName, standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8) });
142248
+ return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema12.description, deprecated: schema12.deprecated, keyName, standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8) });
142249
142249
  case "ANY_OF":
142250
142250
  return {
142251
- comment: schema11.description,
142252
- deprecated: schema11.deprecated,
142251
+ comment: schema12.description,
142252
+ deprecated: schema12.deprecated,
142253
142253
  keyName,
142254
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142255
- params: schema11.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142254
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142255
+ params: schema12.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142256
142256
  type: "UNION"
142257
142257
  };
142258
142258
  case "BOOLEAN":
142259
142259
  return {
142260
- comment: schema11.description,
142261
- deprecated: schema11.deprecated,
142260
+ comment: schema12.description,
142261
+ deprecated: schema12.deprecated,
142262
142262
  keyName,
142263
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142263
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142264
142264
  type: "BOOLEAN"
142265
142265
  };
142266
142266
  case "CUSTOM_TYPE":
142267
142267
  return {
142268
- comment: schema11.description,
142269
- deprecated: schema11.deprecated,
142268
+ comment: schema12.description,
142269
+ deprecated: schema12.deprecated,
142270
142270
  keyName,
142271
- params: schema11.tsType,
142272
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142271
+ params: schema12.tsType,
142272
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142273
142273
  type: "CUSTOM_TYPE"
142274
142274
  };
142275
142275
  case "NAMED_ENUM":
142276
142276
  return {
142277
- comment: schema11.description,
142278
- deprecated: schema11.deprecated,
142277
+ comment: schema12.description,
142278
+ deprecated: schema12.deprecated,
142279
142279
  keyName,
142280
- standaloneName: standaloneName(schema11, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
142281
- params: schema11.enum.map((_10, n5) => ({
142280
+ standaloneName: standaloneName(schema12, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
142281
+ params: schema12.enum.map((_10, n5) => ({
142282
142282
  ast: parseLiteral(_10, undefined),
142283
- keyName: schema11.tsEnumNames[n5]
142283
+ keyName: schema12.tsEnumNames[n5]
142284
142284
  })),
142285
142285
  type: "ENUM"
142286
142286
  };
142287
142287
  case "NAMED_SCHEMA":
142288
- return newInterface(schema11, options8, processed, usedNames, keyName);
142288
+ return newInterface(schema12, options8, processed, usedNames, keyName);
142289
142289
  case "NEVER":
142290
142290
  return {
142291
- comment: schema11.description,
142292
- deprecated: schema11.deprecated,
142291
+ comment: schema12.description,
142292
+ deprecated: schema12.deprecated,
142293
142293
  keyName,
142294
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142294
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142295
142295
  type: "NEVER"
142296
142296
  };
142297
142297
  case "NULL":
142298
142298
  return {
142299
- comment: schema11.description,
142300
- deprecated: schema11.deprecated,
142299
+ comment: schema12.description,
142300
+ deprecated: schema12.deprecated,
142301
142301
  keyName,
142302
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142302
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142303
142303
  type: "NULL"
142304
142304
  };
142305
142305
  case "NUMBER":
142306
142306
  return {
142307
- comment: schema11.description,
142308
- deprecated: schema11.deprecated,
142307
+ comment: schema12.description,
142308
+ deprecated: schema12.deprecated,
142309
142309
  keyName,
142310
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142310
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142311
142311
  type: "NUMBER"
142312
142312
  };
142313
142313
  case "OBJECT":
142314
142314
  return {
142315
- comment: schema11.description,
142315
+ comment: schema12.description,
142316
142316
  keyName,
142317
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142317
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142318
142318
  type: "OBJECT",
142319
- deprecated: schema11.deprecated
142319
+ deprecated: schema12.deprecated
142320
142320
  };
142321
142321
  case "ONE_OF":
142322
142322
  return {
142323
- comment: schema11.description,
142324
- deprecated: schema11.deprecated,
142323
+ comment: schema12.description,
142324
+ deprecated: schema12.deprecated,
142325
142325
  keyName,
142326
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142327
- params: schema11.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142326
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142327
+ params: schema12.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142328
142328
  type: "UNION"
142329
142329
  };
142330
142330
  case "REFERENCE":
142331
- throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema11));
142331
+ throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema12));
142332
142332
  case "STRING":
142333
142333
  return {
142334
- comment: schema11.description,
142335
- deprecated: schema11.deprecated,
142334
+ comment: schema12.description,
142335
+ deprecated: schema12.deprecated,
142336
142336
  keyName,
142337
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142337
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142338
142338
  type: "STRING"
142339
142339
  };
142340
142340
  case "TYPED_ARRAY":
142341
- if (Array.isArray(schema11.items)) {
142342
- const minItems2 = schema11.minItems;
142343
- const maxItems2 = schema11.maxItems;
142341
+ if (Array.isArray(schema12.items)) {
142342
+ const minItems2 = schema12.minItems;
142343
+ const maxItems2 = schema12.maxItems;
142344
142344
  const arrayType = {
142345
- comment: schema11.description,
142346
- deprecated: schema11.deprecated,
142345
+ comment: schema12.description,
142346
+ deprecated: schema12.deprecated,
142347
142347
  keyName,
142348
142348
  maxItems: maxItems2,
142349
142349
  minItems: minItems2,
142350
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142351
- params: schema11.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142350
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142351
+ params: schema12.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
142352
142352
  type: "TUPLE"
142353
142353
  };
142354
- if (schema11.additionalItems === true) {
142354
+ if (schema12.additionalItems === true) {
142355
142355
  arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
142356
- } else if (schema11.additionalItems) {
142357
- arrayType.spreadParam = parse11(schema11.additionalItems, options8, undefined, processed, usedNames);
142356
+ } else if (schema12.additionalItems) {
142357
+ arrayType.spreadParam = parse11(schema12.additionalItems, options8, undefined, processed, usedNames);
142358
142358
  }
142359
142359
  return arrayType;
142360
142360
  } else {
142361
142361
  return {
142362
- comment: schema11.description,
142363
- deprecated: schema11.deprecated,
142362
+ comment: schema12.description,
142363
+ deprecated: schema12.deprecated,
142364
142364
  keyName,
142365
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142366
- params: parse11(schema11.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
142365
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142366
+ params: parse11(schema12.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
142367
142367
  type: "ARRAY"
142368
142368
  };
142369
142369
  }
142370
142370
  case "UNION":
142371
142371
  return {
142372
- comment: schema11.description,
142373
- deprecated: schema11.deprecated,
142372
+ comment: schema12.description,
142373
+ deprecated: schema12.deprecated,
142374
142374
  keyName,
142375
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142376
- params: schema11.type.map((type2) => {
142377
- const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema11, "$id", "description", "title")), { type: type2 });
142375
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142376
+ params: schema12.type.map((type2) => {
142377
+ const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema12, "$id", "description", "title")), { type: type2 });
142378
142378
  (0, utils_1.maybeStripDefault)(member);
142379
142379
  (0, applySchemaTyping_1.applySchemaTyping)(member);
142380
142380
  return parse11(member, options8, undefined, processed, usedNames);
@@ -142383,80 +142383,80 @@ var require_parser2 = __commonJS((exports) => {
142383
142383
  };
142384
142384
  case "UNNAMED_ENUM":
142385
142385
  return {
142386
- comment: schema11.description,
142387
- deprecated: schema11.deprecated,
142386
+ comment: schema12.description,
142387
+ deprecated: schema12.deprecated,
142388
142388
  keyName,
142389
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142390
- params: schema11.enum.map((_10) => parseLiteral(_10, undefined)),
142389
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142390
+ params: schema12.enum.map((_10) => parseLiteral(_10, undefined)),
142391
142391
  type: "UNION"
142392
142392
  };
142393
142393
  case "UNNAMED_SCHEMA":
142394
- return newInterface(schema11, options8, processed, usedNames, keyName, keyNameFromDefinition);
142394
+ return newInterface(schema12, options8, processed, usedNames, keyName, keyNameFromDefinition);
142395
142395
  case "UNTYPED_ARRAY":
142396
- const minItems = schema11.minItems;
142397
- const maxItems = typeof schema11.maxItems === "number" ? schema11.maxItems : -1;
142396
+ const minItems = schema12.minItems;
142397
+ const maxItems = typeof schema12.maxItems === "number" ? schema12.maxItems : -1;
142398
142398
  const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
142399
142399
  if (minItems > 0 || maxItems >= 0) {
142400
142400
  return {
142401
- comment: schema11.description,
142402
- deprecated: schema11.deprecated,
142401
+ comment: schema12.description,
142402
+ deprecated: schema12.deprecated,
142403
142403
  keyName,
142404
- maxItems: schema11.maxItems,
142404
+ maxItems: schema12.maxItems,
142405
142405
  minItems,
142406
142406
  params: Array(Math.max(maxItems, minItems) || 0).fill(params),
142407
142407
  spreadParam: maxItems >= 0 ? undefined : params,
142408
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142408
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142409
142409
  type: "TUPLE"
142410
142410
  };
142411
142411
  }
142412
142412
  return {
142413
- comment: schema11.description,
142414
- deprecated: schema11.deprecated,
142413
+ comment: schema12.description,
142414
+ deprecated: schema12.deprecated,
142415
142415
  keyName,
142416
142416
  params,
142417
- standaloneName: standaloneName(schema11, keyNameFromDefinition, usedNames, options8),
142417
+ standaloneName: standaloneName(schema12, keyNameFromDefinition, usedNames, options8),
142418
142418
  type: "ARRAY"
142419
142419
  };
142420
142420
  }
142421
142421
  }
142422
- function standaloneName(schema11, keyNameFromDefinition, usedNames, options8) {
142422
+ function standaloneName(schema12, keyNameFromDefinition, usedNames, options8) {
142423
142423
  var _a7;
142424
- const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema11, keyNameFromDefinition)) || schema11.title || schema11.$id || keyNameFromDefinition;
142424
+ const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema12, keyNameFromDefinition)) || schema12.title || schema12.$id || keyNameFromDefinition;
142425
142425
  if (name2) {
142426
142426
  return (0, utils_1.generateName)(name2, usedNames);
142427
142427
  }
142428
142428
  }
142429
- function newInterface(schema11, options8, processed, usedNames, keyName, keyNameFromDefinition) {
142430
- const name2 = standaloneName(schema11, keyNameFromDefinition, usedNames, options8);
142429
+ function newInterface(schema12, options8, processed, usedNames, keyName, keyNameFromDefinition) {
142430
+ const name2 = standaloneName(schema12, keyNameFromDefinition, usedNames, options8);
142431
142431
  return {
142432
- comment: schema11.description,
142433
- deprecated: schema11.deprecated,
142432
+ comment: schema12.description,
142433
+ deprecated: schema12.deprecated,
142434
142434
  keyName,
142435
- params: parseSchema(schema11, options8, processed, usedNames, name2),
142435
+ params: parseSchema(schema12, options8, processed, usedNames, name2),
142436
142436
  standaloneName: name2,
142437
- superTypes: parseSuperTypes(schema11, options8, processed, usedNames),
142437
+ superTypes: parseSuperTypes(schema12, options8, processed, usedNames),
142438
142438
  type: "INTERFACE"
142439
142439
  };
142440
142440
  }
142441
- function parseSuperTypes(schema11, options8, processed, usedNames) {
142442
- const superTypes = schema11.extends;
142441
+ function parseSuperTypes(schema12, options8, processed, usedNames) {
142442
+ const superTypes = schema12.extends;
142443
142443
  if (!superTypes) {
142444
142444
  return [];
142445
142445
  }
142446
142446
  return superTypes.map((_10) => parse11(_10, options8, undefined, processed, usedNames));
142447
142447
  }
142448
- function parseSchema(schema11, options8, processed, usedNames, parentSchemaName) {
142449
- let asts = (0, lodash_1.map)(schema11.properties, (value, key2) => ({
142448
+ function parseSchema(schema12, options8, processed, usedNames, parentSchemaName) {
142449
+ let asts = (0, lodash_1.map)(schema12.properties, (value, key2) => ({
142450
142450
  ast: parse11(value, options8, key2, processed, usedNames),
142451
142451
  isPatternProperty: false,
142452
- isRequired: (0, lodash_1.includes)(schema11.required || [], key2),
142452
+ isRequired: (0, lodash_1.includes)(schema12.required || [], key2),
142453
142453
  isUnreachableDefinition: false,
142454
142454
  keyName: key2
142455
142455
  }));
142456
142456
  let singlePatternProperty = false;
142457
- if (schema11.patternProperties) {
142458
- singlePatternProperty = !schema11.additionalProperties && Object.keys(schema11.patternProperties).length === 1;
142459
- asts = asts.concat((0, lodash_1.map)(schema11.patternProperties, (value, key2) => {
142457
+ if (schema12.patternProperties) {
142458
+ singlePatternProperty = !schema12.additionalProperties && Object.keys(schema12.patternProperties).length === 1;
142459
+ asts = asts.concat((0, lodash_1.map)(schema12.patternProperties, (value, key2) => {
142460
142460
  const ast = parse11(value, options8, key2, processed, usedNames);
142461
142461
  const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
142462
142462
  via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
@@ -142466,14 +142466,14 @@ ${comment}` : comment;
142466
142466
  return {
142467
142467
  ast,
142468
142468
  isPatternProperty: !singlePatternProperty,
142469
- isRequired: singlePatternProperty || (0, lodash_1.includes)(schema11.required || [], key2),
142469
+ isRequired: singlePatternProperty || (0, lodash_1.includes)(schema12.required || [], key2),
142470
142470
  isUnreachableDefinition: false,
142471
142471
  keyName: singlePatternProperty ? "[k: string]" : key2
142472
142472
  };
142473
142473
  }));
142474
142474
  }
142475
142475
  if (options8.unreachableDefinitions) {
142476
- asts = asts.concat((0, lodash_1.map)(schema11.$defs, (value, key2) => {
142476
+ asts = asts.concat((0, lodash_1.map)(schema12.$defs, (value, key2) => {
142477
142477
  const ast = parse11(value, options8, key2, processed, usedNames);
142478
142478
  const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
142479
142479
  via the \`definition\` "${key2}".`;
@@ -142483,13 +142483,13 @@ ${comment}` : comment;
142483
142483
  return {
142484
142484
  ast,
142485
142485
  isPatternProperty: false,
142486
- isRequired: (0, lodash_1.includes)(schema11.required || [], key2),
142486
+ isRequired: (0, lodash_1.includes)(schema12.required || [], key2),
142487
142487
  isUnreachableDefinition: true,
142488
142488
  keyName: key2
142489
142489
  };
142490
142490
  }));
142491
142491
  }
142492
- switch (schema11.additionalProperties) {
142492
+ switch (schema12.additionalProperties) {
142493
142493
  case undefined:
142494
142494
  case true:
142495
142495
  if (singlePatternProperty) {
@@ -142506,7 +142506,7 @@ ${comment}` : comment;
142506
142506
  return asts;
142507
142507
  default:
142508
142508
  return asts.concat({
142509
- ast: parse11(schema11.additionalProperties, options8, "[k: string]", processed, usedNames),
142509
+ ast: parse11(schema12.additionalProperties, options8, "[k: string]", processed, usedNames),
142510
142510
  isPatternProperty: false,
142511
142511
  isRequired: true,
142512
142512
  isUnreachableDefinition: false,
@@ -142514,22 +142514,22 @@ ${comment}` : comment;
142514
142514
  });
142515
142515
  }
142516
142516
  }
142517
- function getDefinitions(schema11, isSchema = true, processed = new Set) {
142518
- if (processed.has(schema11)) {
142517
+ function getDefinitions(schema12, isSchema = true, processed = new Set) {
142518
+ if (processed.has(schema12)) {
142519
142519
  return {};
142520
142520
  }
142521
- processed.add(schema11);
142522
- if (Array.isArray(schema11)) {
142523
- return schema11.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
142521
+ processed.add(schema12);
142522
+ if (Array.isArray(schema12)) {
142523
+ return schema12.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
142524
142524
  }
142525
- if ((0, lodash_1.isPlainObject)(schema11)) {
142526
- return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema11) ? schema11.$defs : {}), Object.keys(schema11).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema11[cur], false, processed)), {}));
142525
+ if ((0, lodash_1.isPlainObject)(schema12)) {
142526
+ return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema12) ? schema12.$defs : {}), Object.keys(schema12).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema12[cur], false, processed)), {}));
142527
142527
  }
142528
142528
  return {};
142529
142529
  }
142530
142530
  var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
142531
- function hasDefinitions(schema11) {
142532
- return "$defs" in schema11;
142531
+ function hasDefinitions(schema12) {
142532
+ return "$defs" in schema12;
142533
142533
  }
142534
142534
  });
142535
142535
 
@@ -143215,14 +143215,14 @@ var require_errors2 = __commonJS((exports) => {
143215
143215
  }
143216
143216
  exports.MissingPointerError = MissingPointerError;
143217
143217
 
143218
- class TimeoutError3 extends JSONParserError {
143218
+ class TimeoutError4 extends JSONParserError {
143219
143219
  constructor(timeout2) {
143220
143220
  super(`Dereferencing timeout reached: ${timeout2}ms`);
143221
143221
  this.code = "ETIMEOUT";
143222
143222
  this.name = "TimeoutError";
143223
143223
  }
143224
143224
  }
143225
- exports.TimeoutError = TimeoutError3;
143225
+ exports.TimeoutError = TimeoutError4;
143226
143226
 
143227
143227
  class InvalidPointerError extends JSONParserError {
143228
143228
  constructor(pointer, path18) {
@@ -144353,7 +144353,7 @@ var require_normalize_args = __commonJS((exports) => {
144353
144353
  var options_js_1 = require_options();
144354
144354
  function normalizeArgs(_args) {
144355
144355
  let path18;
144356
- let schema11;
144356
+ let schema12;
144357
144357
  let options8;
144358
144358
  let callback;
144359
144359
  const args = Array.prototype.slice.call(_args);
@@ -144363,15 +144363,15 @@ var require_normalize_args = __commonJS((exports) => {
144363
144363
  if (typeof args[0] === "string") {
144364
144364
  path18 = args[0];
144365
144365
  if (typeof args[2] === "object") {
144366
- schema11 = args[1];
144366
+ schema12 = args[1];
144367
144367
  options8 = args[2];
144368
144368
  } else {
144369
- schema11 = undefined;
144369
+ schema12 = undefined;
144370
144370
  options8 = args[1];
144371
144371
  }
144372
144372
  } else {
144373
144373
  path18 = "";
144374
- schema11 = args[0];
144374
+ schema12 = args[0];
144375
144375
  options8 = args[1];
144376
144376
  }
144377
144377
  try {
@@ -144379,12 +144379,12 @@ var require_normalize_args = __commonJS((exports) => {
144379
144379
  } catch (e8) {
144380
144380
  console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
144381
144381
  }
144382
- if (!options8.mutateInputSchema && typeof schema11 === "object") {
144383
- schema11 = JSON.parse(JSON.stringify(schema11));
144382
+ if (!options8.mutateInputSchema && typeof schema12 === "object") {
144383
+ schema12 = JSON.parse(JSON.stringify(schema12));
144384
144384
  }
144385
144385
  return {
144386
144386
  path: path18,
144387
- schema: schema11,
144387
+ schema: schema12,
144388
144388
  options: options8,
144389
144389
  callback
144390
144390
  };
@@ -145173,12 +145173,12 @@ var require_resolver = __commonJS((exports) => {
145173
145173
  var json_schema_ref_parser_1 = require_lib3();
145174
145174
  var utils_1 = require_utils7();
145175
145175
  function dereference(schema_1, _a7) {
145176
- return __awaiter(this, arguments, undefined, function* (schema11, { cwd, $refOptions }) {
145177
- (0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema11);
145176
+ return __awaiter(this, arguments, undefined, function* (schema12, { cwd, $refOptions }) {
145177
+ (0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema12);
145178
145178
  const parser2 = new json_schema_ref_parser_1.$RefParser;
145179
145179
  const dereferencedPaths = new WeakMap;
145180
- const dereferencedSchema = yield parser2.dereference(cwd, schema11, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema12) {
145181
- dereferencedPaths.set(schema12, $ref);
145180
+ const dereferencedSchema = yield parser2.dereference(cwd, schema12, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema13) {
145181
+ dereferencedPaths.set(schema13, $ref);
145182
145182
  } }) }));
145183
145183
  return { dereferencedPaths, dereferencedSchema };
145184
145184
  });
@@ -145192,46 +145192,46 @@ var require_validator = __commonJS((exports) => {
145192
145192
  exports.validate = undefined;
145193
145193
  var utils_1 = require_utils7();
145194
145194
  var rules = new Map;
145195
- rules.set("Enum members and tsEnumNames must be of the same length", (schema11) => {
145196
- if (schema11.enum && schema11.tsEnumNames && schema11.enum.length !== schema11.tsEnumNames.length) {
145195
+ rules.set("Enum members and tsEnumNames must be of the same length", (schema12) => {
145196
+ if (schema12.enum && schema12.tsEnumNames && schema12.enum.length !== schema12.tsEnumNames.length) {
145197
145197
  return false;
145198
145198
  }
145199
145199
  });
145200
- rules.set("tsEnumNames must be an array of strings", (schema11) => {
145201
- if (schema11.tsEnumNames && schema11.tsEnumNames.some((_10) => typeof _10 !== "string")) {
145200
+ rules.set("tsEnumNames must be an array of strings", (schema12) => {
145201
+ if (schema12.tsEnumNames && schema12.tsEnumNames.some((_10) => typeof _10 !== "string")) {
145202
145202
  return false;
145203
145203
  }
145204
145204
  });
145205
- rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema11) => {
145206
- const { maxItems, minItems } = schema11;
145205
+ rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema12) => {
145206
+ const { maxItems, minItems } = schema12;
145207
145207
  if (typeof maxItems === "number" && typeof minItems === "number") {
145208
145208
  return maxItems >= minItems;
145209
145209
  }
145210
145210
  });
145211
- rules.set("When maxItems exists, maxItems >= 0", (schema11) => {
145212
- const { maxItems } = schema11;
145211
+ rules.set("When maxItems exists, maxItems >= 0", (schema12) => {
145212
+ const { maxItems } = schema12;
145213
145213
  if (typeof maxItems === "number") {
145214
145214
  return maxItems >= 0;
145215
145215
  }
145216
145216
  });
145217
- rules.set("When minItems exists, minItems >= 0", (schema11) => {
145218
- const { minItems } = schema11;
145217
+ rules.set("When minItems exists, minItems >= 0", (schema12) => {
145218
+ const { minItems } = schema12;
145219
145219
  if (typeof minItems === "number") {
145220
145220
  return minItems >= 0;
145221
145221
  }
145222
145222
  });
145223
- rules.set("deprecated must be a boolean", (schema11) => {
145224
- const typeOfDeprecated = typeof schema11.deprecated;
145223
+ rules.set("deprecated must be a boolean", (schema12) => {
145224
+ const typeOfDeprecated = typeof schema12.deprecated;
145225
145225
  return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
145226
145226
  });
145227
- function validate2(schema11, filename) {
145227
+ function validate2(schema12, filename) {
145228
145228
  const errors5 = [];
145229
145229
  rules.forEach((rule, ruleName) => {
145230
- (0, utils_1.traverse)(schema11, (schema12, key2) => {
145231
- if (rule(schema12) === false) {
145230
+ (0, utils_1.traverse)(schema12, (schema13, key2) => {
145231
+ if (rule(schema13) === false) {
145232
145232
  errors5.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
145233
145233
  }
145234
- return schema12;
145234
+ return schema13;
145235
145235
  });
145236
145236
  });
145237
145237
  return errors5;
@@ -145245,25 +145245,25 @@ var require_linker = __commonJS((exports) => {
145245
145245
  exports.link = undefined;
145246
145246
  var JSONSchema_1 = require_JSONSchema();
145247
145247
  var lodash_1 = require_lodash8();
145248
- function link2(schema11, parent = null) {
145249
- if (!Array.isArray(schema11) && !(0, lodash_1.isPlainObject)(schema11)) {
145250
- return schema11;
145248
+ function link2(schema12, parent = null) {
145249
+ if (!Array.isArray(schema12) && !(0, lodash_1.isPlainObject)(schema12)) {
145250
+ return schema12;
145251
145251
  }
145252
- if (schema11.hasOwnProperty(JSONSchema_1.Parent)) {
145253
- return schema11;
145252
+ if (schema12.hasOwnProperty(JSONSchema_1.Parent)) {
145253
+ return schema12;
145254
145254
  }
145255
- Object.defineProperty(schema11, JSONSchema_1.Parent, {
145255
+ Object.defineProperty(schema12, JSONSchema_1.Parent, {
145256
145256
  enumerable: false,
145257
145257
  value: parent,
145258
145258
  writable: false
145259
145259
  });
145260
- if (Array.isArray(schema11)) {
145261
- schema11.forEach((child) => link2(child, schema11));
145260
+ if (Array.isArray(schema12)) {
145261
+ schema12.forEach((child) => link2(child, schema12));
145262
145262
  }
145263
- for (const key2 in schema11) {
145264
- link2(schema11[key2], schema11);
145263
+ for (const key2 in schema12) {
145264
+ link2(schema12[key2], schema12);
145265
145265
  }
145266
- return schema11;
145266
+ return schema12;
145267
145267
  }
145268
145268
  exports.link = link2;
145269
145269
  });
@@ -145355,8 +145355,8 @@ var require_src3 = __commonJS((exports) => {
145355
145355
  unknownAny: true
145356
145356
  };
145357
145357
  function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
145358
- const schema11 = parseAsJSONSchema(filename);
145359
- return compile(schema11, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
145358
+ const schema12 = parseAsJSONSchema(filename);
145359
+ return compile(schema12, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
145360
145360
  }
145361
145361
  exports.compileFromFile = compileFromFile;
145362
145362
  function parseAsJSONSchema(filename) {
@@ -145366,7 +145366,7 @@ var require_src3 = __commonJS((exports) => {
145366
145366
  return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
145367
145367
  }
145368
145368
  function compile(schema_1, name_1) {
145369
- return __awaiter(this, arguments, undefined, function* (schema11, name2, options8 = {}) {
145369
+ return __awaiter(this, arguments, undefined, function* (schema12, name2, options8 = {}) {
145370
145370
  (0, optionValidator_1.validateOptions)(options8);
145371
145371
  const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
145372
145372
  const start = Date.now();
@@ -145376,7 +145376,7 @@ var require_src3 = __commonJS((exports) => {
145376
145376
  if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
145377
145377
  _options.cwd += "/";
145378
145378
  }
145379
- const _schema = (0, lodash_1.cloneDeep)(schema11);
145379
+ const _schema = (0, lodash_1.cloneDeep)(schema12);
145380
145380
  const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
145381
145381
  if (process.env.VERBOSE) {
145382
145382
  if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
@@ -233708,6 +233708,10 @@ class InvalidInputError extends UserError {
233708
233708
  code = "INVALID_INPUT";
233709
233709
  }
233710
233710
 
233711
+ class TimeoutError2 extends UserError {
233712
+ code = "TIMEOUT";
233713
+ }
233714
+
233711
233715
  class DependencyNotFoundError extends UserError {
233712
233716
  code = "DEPENDENCY_NOT_FOUND";
233713
233717
  constructor(message, options) {
@@ -235890,7 +235894,7 @@ var createTimeoutError = (timeout2) => {
235890
235894
  return timeout2.message;
235891
235895
  }
235892
235896
  const message = timeout2.message ?? `Promise timed out after ${timeout2.milliseconds} milliseconds`;
235893
- return new TimeoutError2(message);
235897
+ return new TimeoutError3(message);
235894
235898
  };
235895
235899
  var handleFallback = (timeout2) => {
235896
235900
  if (timeout2.fallback) {
@@ -235903,7 +235907,7 @@ var handleAbortError = (timeoutSignal, timeout2, signal) => {
235903
235907
  if (typeof timeout2 === "object") {
235904
235908
  return handleFallback(timeout2);
235905
235909
  }
235906
- throw new TimeoutError2;
235910
+ throw new TimeoutError3;
235907
235911
  }
235908
235912
  throw signal.reason;
235909
235913
  };
@@ -235948,7 +235952,7 @@ async function pWaitFor(condition, options = {}) {
235948
235952
  }
235949
235953
  pWaitFor.resolveWith = (value) => ({ [resolveValue]: value });
235950
235954
 
235951
- class TimeoutError2 extends Error {
235955
+ class TimeoutError3 extends Error {
235952
235956
  constructor(message = "Promise timed out") {
235953
235957
  super(message);
235954
235958
  this.name = "TimeoutError";
@@ -253290,7 +253294,7 @@ async function runOAuthFlowWithSkip(connector2) {
253290
253294
  timeout: POLL_TIMEOUT_MS
253291
253295
  });
253292
253296
  } catch (err) {
253293
- if (err instanceof TimeoutError2) {
253297
+ if (err instanceof TimeoutError3) {
253294
253298
  finalStatus = "PENDING";
253295
253299
  } else {
253296
253300
  throw err;
@@ -253726,6 +253730,214 @@ function getRollbackCommand() {
253726
253730
  return new Base44Command("rollback").description("Roll back production to the previous full-stack deployment").option("-y, --yes", "Skip confirmation prompt").action(rollbackAction);
253727
253731
  }
253728
253732
 
253733
+ // src/core/domains/schema.ts
253734
+ var DomainVerificationSchema = exports_external.object({
253735
+ ownership_verification: exports_external.unknown().nullable().optional(),
253736
+ ownership_verification_http: exports_external.unknown().nullable().optional(),
253737
+ ssl_validation_records: exports_external.array(exports_external.unknown()).nullable().optional(),
253738
+ ssl_validation_errors: exports_external.array(exports_external.unknown()).nullable().optional()
253739
+ }).transform((data) => ({
253740
+ ownershipVerification: data.ownership_verification ?? null,
253741
+ ownershipVerificationHttp: data.ownership_verification_http ?? null,
253742
+ sslValidationRecords: data.ssl_validation_records ?? null,
253743
+ sslValidationErrors: data.ssl_validation_errors ?? null
253744
+ }));
253745
+ var DomainSchema = exports_external.object({
253746
+ hostname: exports_external.string(),
253747
+ cname_target: exports_external.string(),
253748
+ status: exports_external.string().nullable(),
253749
+ ssl_status: exports_external.string().nullable(),
253750
+ active: exports_external.boolean(),
253751
+ pending_deployment: exports_external.boolean().optional(),
253752
+ verification: DomainVerificationSchema
253753
+ }).transform((data) => ({
253754
+ hostname: data.hostname,
253755
+ cnameTarget: data.cname_target,
253756
+ status: data.status,
253757
+ sslStatus: data.ssl_status,
253758
+ active: data.active,
253759
+ pendingDeployment: data.pending_deployment ?? false,
253760
+ verification: data.verification
253761
+ }));
253762
+ var AddDomainResponseSchema = DomainSchema;
253763
+ var DomainsListResponseSchema = exports_external.object({ domains: exports_external.array(DomainSchema) }).transform((data) => data.domains);
253764
+ var RemoveDomainResponseSchema = exports_external.object({ hostname: exports_external.string(), deleted: exports_external.boolean() }).transform((data) => ({ hostname: data.hostname, deleted: data.deleted }));
253765
+
253766
+ // src/core/domains/api.ts
253767
+ async function addDomain(hostname3) {
253768
+ const appClient = getAppClient();
253769
+ const request = { hostname: hostname3 };
253770
+ let response;
253771
+ try {
253772
+ response = await appClient.post("domains", {
253773
+ json: request,
253774
+ timeout: 120000
253775
+ });
253776
+ } catch (error48) {
253777
+ throw await ApiError.fromHttpError(error48, "connecting domain");
253778
+ }
253779
+ const result = AddDomainResponseSchema.safeParse(await response.json());
253780
+ if (!result.success) {
253781
+ throw new SchemaValidationError("Invalid response from server", result.error);
253782
+ }
253783
+ return result.data;
253784
+ }
253785
+ async function listDomains() {
253786
+ const appClient = getAppClient();
253787
+ let response;
253788
+ try {
253789
+ response = await appClient.get("domains");
253790
+ } catch (error48) {
253791
+ throw await ApiError.fromHttpError(error48, "listing domains");
253792
+ }
253793
+ const result = DomainsListResponseSchema.safeParse(await response.json());
253794
+ if (!result.success) {
253795
+ throw new SchemaValidationError("Invalid response from server", result.error);
253796
+ }
253797
+ return result.data;
253798
+ }
253799
+ async function removeDomain(hostname3) {
253800
+ const appClient = getAppClient();
253801
+ let response;
253802
+ try {
253803
+ response = await appClient.delete(`domains/${encodeURIComponent(hostname3)}`);
253804
+ } catch (error48) {
253805
+ throw await ApiError.fromHttpError(error48, "removing domain");
253806
+ }
253807
+ const result = RemoveDomainResponseSchema.safeParse(await response.json());
253808
+ if (!result.success) {
253809
+ throw new SchemaValidationError("Invalid response from server", result.error);
253810
+ }
253811
+ return result.data;
253812
+ }
253813
+ var delay2 = (ms) => new Promise((resolve9) => setTimeout(resolve9, ms));
253814
+ async function waitForDomainActive(hostname3, options = {}) {
253815
+ const intervalMs = options.intervalMs ?? 2000;
253816
+ const timeoutMs = options.timeoutMs ?? 10 * 60000;
253817
+ const deadline = Date.now() + timeoutMs;
253818
+ for (;; ) {
253819
+ const domain2 = (await listDomains()).find((d2) => d2.hostname === hostname3);
253820
+ options.onTick?.(domain2);
253821
+ if (domain2?.active) {
253822
+ return domain2;
253823
+ }
253824
+ if (Date.now() >= deadline) {
253825
+ throw new TimeoutError2(`Timed out waiting for ${hostname3} to become active`);
253826
+ }
253827
+ await delay2(intervalMs);
253828
+ }
253829
+ }
253830
+ // src/cli/commands/domains/shared.ts
253831
+ function toJsonStdout2(result) {
253832
+ return `${JSON.stringify(result, null, 2)}
253833
+ `;
253834
+ }
253835
+ function domainStatusText(domain2) {
253836
+ const status = domain2.status ?? "unknown";
253837
+ const ssl = domain2.sslStatus ?? "unknown";
253838
+ return domain2.active ? "active" : `${status} (SSL: ${ssl})`;
253839
+ }
253840
+ function formatDomainLine(domain2) {
253841
+ const status = (domain2.active ? "active" : domain2.status ?? "unknown").padEnd(12);
253842
+ const ssl = `ssl:${domain2.sslStatus ?? "unknown"}`.padEnd(22);
253843
+ return `${domain2.hostname.padEnd(32)} ${status} ${ssl} → ${theme.colors.links(domain2.cnameTarget)}`;
253844
+ }
253845
+ function logDomainSetup(domain2, log) {
253846
+ log.message(`${theme.styles.header("Add this DNS record")}:`);
253847
+ log.message(` CNAME ${domain2.hostname} ${theme.styles.dim("→")} ${theme.colors.links(domain2.cnameTarget)}`);
253848
+ log.message(`${theme.styles.header("Status")}: ${domainStatusText(domain2)}`);
253849
+ if (domain2.pendingDeployment) {
253850
+ log.warn("This app has no production deployment yet — the domain will start serving once you deploy and promote to production.");
253851
+ }
253852
+ log.message(theme.styles.dim("TLS certificate is issued automatically once the CNAME resolves."));
253853
+ }
253854
+
253855
+ // src/cli/commands/domains/add.ts
253856
+ function waitMessage(domain2) {
253857
+ if (!domain2)
253858
+ return "Waiting for domain to appear...";
253859
+ return `Waiting for domain to become active (${domainStatusText(domain2)})...`;
253860
+ }
253861
+ async function addDomainAction({ log, runTask: runTask2, jsonMode }, hostname3, options) {
253862
+ let domain2 = await runTask2(`Connecting ${hostname3}...`, async () => await addDomain(hostname3), { errorMessage: "Failed to connect domain" });
253863
+ if (options.wait && !domain2.active) {
253864
+ domain2 = await runTask2(waitMessage(domain2), async (updateMessage) => await waitForDomainActive(hostname3, {
253865
+ onTick: (d2) => updateMessage(waitMessage(d2))
253866
+ }), {
253867
+ successMessage: `${hostname3} is active`,
253868
+ errorMessage: "Domain did not become active"
253869
+ });
253870
+ }
253871
+ if (jsonMode) {
253872
+ return {
253873
+ outroMessage: `Domain ${hostname3} is ${domainStatusText(domain2)}`,
253874
+ stdout: toJsonStdout2(domain2)
253875
+ };
253876
+ }
253877
+ logDomainSetup(domain2, log);
253878
+ return {
253879
+ outroMessage: domain2.active ? `${hostname3} is active` : `${hostname3} connected — add the CNAME record above to finish`
253880
+ };
253881
+ }
253882
+ function getDomainsAddCommand() {
253883
+ return new Base44Command("add").description("Connect a custom domain to this app").argument("<hostname>", "Domain to connect, e.g. app.example.com").option("--wait", "Poll until the domain and its TLS certificate are active").action(addDomainAction);
253884
+ }
253885
+
253886
+ // src/cli/commands/domains/list.ts
253887
+ async function listDomainsAction({
253888
+ log,
253889
+ runTask: runTask2,
253890
+ jsonMode
253891
+ }) {
253892
+ const domains = await runTask2("Fetching domains...", async () => await listDomains(), { errorMessage: "Failed to fetch domains" });
253893
+ if (jsonMode) {
253894
+ return {
253895
+ outroMessage: `${domains.length} domains`,
253896
+ stdout: toJsonStdout2({ domains })
253897
+ };
253898
+ }
253899
+ if (domains.length === 0) {
253900
+ return { outroMessage: "No custom domains found" };
253901
+ }
253902
+ for (const domain2 of domains) {
253903
+ log.message(formatDomainLine(domain2));
253904
+ }
253905
+ return {
253906
+ outroMessage: `${domains.length} domain${domains.length !== 1 ? "s" : ""}`
253907
+ };
253908
+ }
253909
+ function getDomainsListCommand() {
253910
+ return new Base44Command("list").description("List custom domains connected to this app").action(listDomainsAction);
253911
+ }
253912
+
253913
+ // src/cli/commands/domains/remove.ts
253914
+ async function removeDomainAction({ runTask: runTask2, jsonMode, isNonInteractive }, hostname3, options) {
253915
+ if (isNonInteractive && !options.yes) {
253916
+ throw new InvalidInputError("--yes is required in non-interactive mode");
253917
+ }
253918
+ if (!options.yes) {
253919
+ const shouldRemove = await Re({
253920
+ message: `Disconnect ${hostname3} from this app?`
253921
+ });
253922
+ if (Ct(shouldRemove) || !shouldRemove) {
253923
+ return { outroMessage: "Removal cancelled" };
253924
+ }
253925
+ }
253926
+ const result = await runTask2(`Removing ${hostname3}...`, async () => await removeDomain(hostname3), { errorMessage: "Failed to remove domain" });
253927
+ return {
253928
+ outroMessage: `Disconnected ${hostname3}`,
253929
+ stdout: jsonMode ? toJsonStdout2(result) : undefined
253930
+ };
253931
+ }
253932
+ function getDomainsRemoveCommand() {
253933
+ return new Base44Command("remove").description("Disconnect a custom domain from this app").argument("<hostname>", "Domain to disconnect").option("-y, --yes", "Skip confirmation prompt").action(removeDomainAction);
253934
+ }
253935
+
253936
+ // src/cli/commands/domains/index.ts
253937
+ function getDomainsCommand() {
253938
+ return new Command("domains").description("Manage custom domains for full-stack apps").addCommand(getDomainsAddCommand()).addCommand(getDomainsListCommand()).addCommand(getDomainsRemoveCommand());
253939
+ }
253940
+
253729
253941
  // src/cli/commands/entities/push.ts
253730
253942
  async function pushEntitiesAction({
253731
253943
  log,
@@ -255034,7 +255246,7 @@ function withSandboxAuthHint(error48) {
255034
255246
  cause: error48
255035
255247
  });
255036
255248
  }
255037
- async function callTool(appId, tool, payload, schema11, context, timeout2 = 60000) {
255249
+ async function callTool(appId, tool, payload, schema12, context, timeout2 = 60000) {
255038
255250
  const client = getSandboxClient(appId);
255039
255251
  let response;
255040
255252
  try {
@@ -255042,7 +255254,7 @@ async function callTool(appId, tool, payload, schema11, context, timeout2 = 6000
255042
255254
  } catch (error48) {
255043
255255
  throw withSandboxAuthHint(await ApiError.fromHttpError(error48, context));
255044
255256
  }
255045
- const result = schema11.safeParse(await response.json());
255257
+ const result = schema12.safeParse(await response.json());
255046
255258
  if (!result.success) {
255047
255259
  throw new SchemaValidationError("Invalid response from server", result.error);
255048
255260
  }
@@ -255080,7 +255292,7 @@ async function resolveFlagOrStdin(flagValue, flagName) {
255080
255292
  }
255081
255293
  return readStdin(flagName, { trim: false });
255082
255294
  }
255083
- function toJsonStdout2(result) {
255295
+ function toJsonStdout3(result) {
255084
255296
  return `${JSON.stringify(result, null, 2)}
255085
255297
  `;
255086
255298
  }
@@ -255099,7 +255311,7 @@ function parsePositiveInt(value, flagName) {
255099
255311
  async function checkpointAction({ runTask: runTask2 }, options) {
255100
255312
  const { id: appId } = getAppContext();
255101
255313
  const result = await runTask2("Creating checkpoint", () => createCheckpoint(appId, { name: options.name }));
255102
- return { outroMessage: "Created checkpoint", stdout: toJsonStdout2(result) };
255314
+ return { outroMessage: "Created checkpoint", stdout: toJsonStdout3(result) };
255103
255315
  }
255104
255316
  function getSandboxCheckpointCommand() {
255105
255317
  return new Base44Command("checkpoint").description("Create a restore-point checkpoint of an app's remote sandbox").option("--name <name>", "Optional message/title for the checkpoint (defaults to an auto-generated title)").addHelpText("after", `
@@ -255134,7 +255346,7 @@ async function editFileAction({ runTask: runTask2 }, path17, options) {
255134
255346
  const result = await runTask2(options.dryRun ? "Previewing edit" : "Editing file", () => editFile(appId, { path: path17, edits, dry_run: options.dryRun }));
255135
255347
  return {
255136
255348
  outroMessage: options.dryRun ? "Previewed edit" : "Edited file",
255137
- stdout: toJsonStdout2(result)
255349
+ stdout: toJsonStdout3(result)
255138
255350
  };
255139
255351
  }
255140
255352
  function getSandboxEditFileCommand() {
@@ -255158,7 +255370,7 @@ async function grepAction({ runTask: runTask2 }, pattern, options) {
255158
255370
  glob: options.glob,
255159
255371
  max_results: maxResults
255160
255372
  }));
255161
- return { outroMessage: "Searched files", stdout: toJsonStdout2(result) };
255373
+ return { outroMessage: "Searched files", stdout: toJsonStdout3(result) };
255162
255374
  }
255163
255375
  function getSandboxGrepCommand() {
255164
255376
  return new Base44Command("grep").description("Search files for a pattern in an app's remote sandbox").argument("<pattern>", "Search pattern").option("--path <path>", "Subtree to search, relative to the app root").option("--no-regex", "Treat the pattern as a literal string, not a regex").option("--case-sensitive", "Case-sensitive match").option("--glob <glob>", 'File glob filter, e.g. "*.tsx"').option("--max-results <n>", "Maximum number of match lines to return").action(grepAction);
@@ -255174,7 +255386,7 @@ async function listDirectoryAction({ runTask: runTask2 }, path17, options) {
255174
255386
  max_depth: maxDepth,
255175
255387
  include_hidden: options.includeHidden
255176
255388
  }));
255177
- return { outroMessage: "Listed directory", stdout: toJsonStdout2(result) };
255389
+ return { outroMessage: "Listed directory", stdout: toJsonStdout3(result) };
255178
255390
  }
255179
255391
  function getSandboxListDirectoryCommand() {
255180
255392
  return new Base44Command("ls").description("List directory entries in an app's remote sandbox").argument("[path]", "Directory relative to the app root (default: app root)").option("--recursive", "List nested entries").option("--max-depth <n>", "Max depth when recursive (1-10, default 3)").option("--include-hidden", "Include dotfiles").action(listDirectoryAction);
@@ -255186,7 +255398,7 @@ async function readFileAction({ runTask: runTask2 }, paths, options) {
255186
255398
  const offset = parsePositiveInt(options.offset, "--offset");
255187
255399
  const limit = parsePositiveInt(options.limit, "--limit");
255188
255400
  const result = await runTask2("Reading file", () => readFile5(appId, { paths, offset, limit }));
255189
- return { outroMessage: "Read file", stdout: toJsonStdout2(result) };
255401
+ return { outroMessage: "Read file", stdout: toJsonStdout3(result) };
255190
255402
  }
255191
255403
  function getSandboxReadFileCommand() {
255192
255404
  return new Base44Command("read").description("Read file contents from an app's remote sandbox").argument("<paths...>", "One or more file paths relative to the app root").option("--offset <n>", "1-based start line").option("--limit <n>", "Max lines to return from offset").action(readFileAction);
@@ -255198,7 +255410,7 @@ async function runCommandAction({ runTask: runTask2 }, commandParts, options) {
255198
255410
  const timeoutMs = parsePositiveInt(options.timeoutMs, "--timeout-ms");
255199
255411
  const command2 = commandParts.join(" ");
255200
255412
  const result = await runTask2("Running command", () => runCommand(appId, { command: command2, cwd: options.cwd, timeout_ms: timeoutMs }));
255201
- return { outroMessage: "Ran command", stdout: toJsonStdout2(result) };
255413
+ return { outroMessage: "Ran command", stdout: toJsonStdout3(result) };
255202
255414
  }
255203
255415
  function getSandboxRunCommandCommand() {
255204
255416
  return new Base44Command("run").description("Run a shell command in an app's remote sandbox").argument("<command...>", "Shell command to execute (quote to keep as one)").option("--cwd <path>", "Working directory relative to the app root").option("--timeout-ms <n>", "Timeout in milliseconds (default 120000, max 600000)").addHelpText("after", `
@@ -255212,7 +255424,7 @@ async function writeFileAction({ runTask: runTask2 }, path17, options) {
255212
255424
  const { id: appId } = getAppContext();
255213
255425
  const content = await resolveFlagOrStdin(options.content, "--content");
255214
255426
  const result = await runTask2("Writing file", () => writeFile2(appId, { path: path17, content, overwrite: options.overwrite }));
255215
- return { outroMessage: "Wrote file", stdout: toJsonStdout2(result) };
255427
+ return { outroMessage: "Wrote file", stdout: toJsonStdout3(result) };
255216
255428
  }
255217
255429
  function getSandboxWriteFileCommand() {
255218
255430
  return new Base44Command("write").description("Create or overwrite a file in an app's remote sandbox").argument("<path>", "File path relative to the app root").option("--content <content>", "File content (if omitted, read from stdin)").option("--overwrite", "Overwrite the file if it already exists").addHelpText("after", `
@@ -255440,9 +255652,9 @@ async function generateContent(input) {
255440
255652
  `);
255441
255653
  }
255442
255654
  async function compileEntity(entity2) {
255443
- const { name: name2, source: _source, ...schema11 } = entity2;
255655
+ const { name: name2, source: _source, ...schema12 } = entity2;
255444
255656
  const jsonSchema = {
255445
- ...schema11,
255657
+ ...schema12,
255446
255658
  title: name2,
255447
255659
  additionalProperties: false
255448
255660
  };
@@ -256185,22 +256397,22 @@ class Database {
256185
256397
  this.schemas.clear();
256186
256398
  }
256187
256399
  validate(entityName, record2, partial2 = false) {
256188
- const schema11 = this.schemas.get(this.normalizeName(entityName));
256189
- if (!schema11) {
256400
+ const schema12 = this.schemas.get(this.normalizeName(entityName));
256401
+ if (!schema12) {
256190
256402
  throw new Error(`Entity "${entityName}" not found`);
256191
256403
  }
256192
- return this.validator.validate(record2, schema11, partial2);
256404
+ return this.validator.validate(record2, schema12, partial2);
256193
256405
  }
256194
256406
  prepareRecord(entityName, record2, partial2 = false) {
256195
- const schema11 = this.schemas.get(this.normalizeName(entityName));
256196
- if (!schema11) {
256407
+ const schema12 = this.schemas.get(this.normalizeName(entityName));
256408
+ if (!schema12) {
256197
256409
  throw new Error(`Entity "${entityName}" not found`);
256198
256410
  }
256199
- const filteredRecord = this.validator.filterFields(record2, schema11);
256411
+ const filteredRecord = this.validator.filterFields(record2, schema12);
256200
256412
  if (partial2) {
256201
256413
  return filteredRecord;
256202
256414
  }
256203
- return this.validator.applyDefaults(filteredRecord, schema11);
256415
+ return this.validator.applyDefaults(filteredRecord, schema12);
256204
256416
  }
256205
256417
  normalizeName(entityName) {
256206
256418
  return entityName.toLowerCase();
@@ -256494,13 +256706,13 @@ function checkRLS(rule, record2, user) {
256494
256706
  return false;
256495
256707
  return evaluateCondition(rule, record2, user);
256496
256708
  }
256497
- function applyFLS(record2, schema11, user, operation) {
256709
+ function applyFLS(record2, schema12, user, operation) {
256498
256710
  if (Array.isArray(record2)) {
256499
- return record2.map((r5) => applyFLS(r5, schema11, user, operation));
256711
+ return record2.map((r5) => applyFLS(r5, schema12, user, operation));
256500
256712
  }
256501
256713
  const result = {};
256502
256714
  for (const [key2, value] of Object.entries(record2)) {
256503
- const rule = schema11.properties[key2]?.rls?.[operation];
256715
+ const rule = schema12.properties[key2]?.rls?.[operation];
256504
256716
  if (rule === undefined || checkRLS(rule, record2, user)) {
256505
256717
  result[key2] = value;
256506
256718
  }
@@ -256728,14 +256940,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256728
256940
  res.status(404).json({ error: `Entity "${entityName}" not found` });
256729
256941
  return;
256730
256942
  }
256731
- const schema11 = db2.getSchema(entityName);
256732
- if (!schema11) {
256943
+ const schema12 = db2.getSchema(entityName);
256944
+ if (!schema12) {
256733
256945
  res.status(404).json({ error: `Schema for "${entityName}" not found` });
256734
256946
  return;
256735
256947
  }
256736
256948
  const currentUserResult = await resolveCurrentUser(db2, req);
256737
256949
  const currentUser = currentUserResult.ok ? currentUserResult.user : undefined;
256738
- await handler(req, res, collection, schema11, currentUser);
256950
+ await handler(req, res, collection, schema12, currentUser);
256739
256951
  };
256740
256952
  }
256741
256953
  function emit(appId, entityName, type, data) {
@@ -256753,19 +256965,19 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256753
256965
  }
256754
256966
  broadcast(appId, entityName, createData(data));
256755
256967
  }
256756
- function prepareCreateRecord(entityName, body, schema11, currentUser, now) {
256968
+ function prepareCreateRecord(entityName, body, schema12, currentUser, now) {
256757
256969
  const { _id, ...recordBody } = body;
256758
256970
  const ownerFields = {
256759
256971
  created_by: currentUser?.email,
256760
256972
  created_by_id: currentUser?.id
256761
256973
  };
256762
- if (!checkRLS(schema11.rls?.create, {
256974
+ if (!checkRLS(schema12.rls?.create, {
256763
256975
  ...recordBody,
256764
256976
  ...ownerFields
256765
256977
  }, currentUser)) {
256766
256978
  return;
256767
256979
  }
256768
- const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody), schema11, currentUser, "write");
256980
+ const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody), schema12, currentUser, "write");
256769
256981
  db2.validate(entityName, filteredBody);
256770
256982
  return {
256771
256983
  ...filteredBody,
@@ -256777,7 +256989,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256777
256989
  }
256778
256990
  const userRouter = createUserRouter(db2, logger2);
256779
256991
  router.use("/User", userRouter);
256780
- router.get("/:entityName/:id", withCollection(async (req, res, collection, schema11, currentUser) => {
256992
+ router.get("/:entityName/:id", withCollection(async (req, res, collection, schema12, currentUser) => {
256781
256993
  const { entityName, id: id2 } = req.params;
256782
256994
  try {
256783
256995
  const doc2 = await collection.findOneAsync({ id: id2 });
@@ -256785,27 +256997,27 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256785
256997
  res.status(404).json({ error: `Record with id "${id2}" not found` });
256786
256998
  return;
256787
256999
  }
256788
- if (!checkRLS(schema11.rls?.read, doc2, currentUser)) {
257000
+ if (!checkRLS(schema12.rls?.read, doc2, currentUser)) {
256789
257001
  res.status(404).json({
256790
257002
  message: `Entity ${entityName} with ID ${id2} not found`
256791
257003
  });
256792
257004
  return;
256793
257005
  }
256794
- const result = applyFLS(stripInternalFields(doc2), schema11, currentUser, "read");
257006
+ const result = applyFLS(stripInternalFields(doc2), schema12, currentUser, "read");
256795
257007
  res.json(result);
256796
257008
  } catch (error48) {
256797
257009
  logger2.error(`Error in GET /${entityName}/${id2}:`, error48);
256798
257010
  res.status(500).json({ error: "Internal server error" });
256799
257011
  }
256800
257012
  }));
256801
- router.get("/:entityName", withCollection(async (req, res, collection, schema11, currentUser) => {
257013
+ router.get("/:entityName", withCollection(async (req, res, collection, schema12, currentUser) => {
256802
257014
  const { entityName } = req.params;
256803
257015
  try {
256804
257016
  let results = stripInternalFields(await queryEntity(collection, req.query));
256805
- if (schema11.rls?.read !== undefined && schema11.rls.read !== true) {
256806
- results = results.filter((doc2) => checkRLS(schema11.rls.read, doc2, currentUser));
257017
+ if (schema12.rls?.read !== undefined && schema12.rls.read !== true) {
257018
+ results = results.filter((doc2) => checkRLS(schema12.rls.read, doc2, currentUser));
256807
257019
  }
256808
- results = results.map((doc2) => applyFLS(doc2, schema11, currentUser, "read"));
257020
+ results = results.map((doc2) => applyFLS(doc2, schema12, currentUser, "read"));
256809
257021
  res.json(results);
256810
257022
  } catch (error48) {
256811
257023
  if (error48 instanceof InvalidInputError) {
@@ -256816,16 +257028,16 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256816
257028
  }
256817
257029
  }
256818
257030
  }));
256819
- router.post("/:entityName", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
257031
+ router.post("/:entityName", parseBody, withCollection(async (req, res, collection, schema12, currentUser) => {
256820
257032
  const { appId, entityName } = req.params;
256821
257033
  try {
256822
257034
  const now = new Date().toISOString();
256823
- const record2 = prepareCreateRecord(entityName, req.body, schema11, currentUser, now);
257035
+ const record2 = prepareCreateRecord(entityName, req.body, schema12, currentUser, now);
256824
257036
  if (!record2) {
256825
257037
  res.status(403).json({ error: "Permission denied" });
256826
257038
  return;
256827
257039
  }
256828
- const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)), schema11, currentUser, "read");
257040
+ const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)), schema12, currentUser, "read");
256829
257041
  emit(appId, entityName, "create", inserted);
256830
257042
  res.status(201).json(inserted);
256831
257043
  } catch (error48) {
@@ -256837,7 +257049,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256837
257049
  res.status(500).json({ error: "Internal server error" });
256838
257050
  }
256839
257051
  }));
256840
- router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
257052
+ router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection, schema12, currentUser) => {
256841
257053
  const { appId, entityName } = req.params;
256842
257054
  if (!Array.isArray(req.body)) {
256843
257055
  res.status(400).json({ error: "Request body must be an array" });
@@ -256847,14 +257059,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256847
257059
  const now = new Date().toISOString();
256848
257060
  const records = [];
256849
257061
  for (const body of req.body) {
256850
- const record2 = prepareCreateRecord(entityName, body, schema11, currentUser, now);
257062
+ const record2 = prepareCreateRecord(entityName, body, schema12, currentUser, now);
256851
257063
  if (!record2) {
256852
257064
  res.status(403).json({ error: "Permission denied" });
256853
257065
  return;
256854
257066
  }
256855
257067
  records.push(record2);
256856
257068
  }
256857
- const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)), schema11, currentUser, "read");
257069
+ const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)), schema12, currentUser, "read");
256858
257070
  emit(appId, entityName, "create", inserted);
256859
257071
  res.status(201).json(inserted);
256860
257072
  } catch (error48) {
@@ -256866,24 +257078,24 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256866
257078
  res.status(500).json({ error: "Internal server error" });
256867
257079
  }
256868
257080
  }));
256869
- router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
257081
+ router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection, schema12, currentUser) => {
256870
257082
  const { appId, entityName, id: id2 } = req.params;
256871
257083
  const { id: _id, created_date: _created_date, ...body } = req.body;
256872
257084
  try {
256873
- if (schema11.rls?.update !== undefined) {
257085
+ if (schema12.rls?.update !== undefined) {
256874
257086
  const existing = await collection.findOneAsync({ id: id2 });
256875
257087
  if (!existing) {
256876
257088
  res.status(404).json({ error: `Record with id "${id2}" not found` });
256877
257089
  return;
256878
257090
  }
256879
- if (!checkRLS(schema11.rls.update, existing, currentUser)) {
257091
+ if (!checkRLS(schema12.rls.update, existing, currentUser)) {
256880
257092
  res.status(404).json({
256881
257093
  message: `Entity ${entityName} with ID ${id2} not found`
256882
257094
  });
256883
257095
  return;
256884
257096
  }
256885
257097
  }
256886
- const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true), schema11, currentUser, "write");
257098
+ const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true), schema12, currentUser, "write");
256887
257099
  db2.validate(entityName, filteredBody, true);
256888
257100
  const updateData = {
256889
257101
  ...filteredBody,
@@ -256894,7 +257106,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256894
257106
  res.status(404).json({ error: `Record with id "${id2}" not found` });
256895
257107
  return;
256896
257108
  }
256897
- const updated = applyFLS(stripInternalFields(result.affectedDocuments), schema11, currentUser, "read");
257109
+ const updated = applyFLS(stripInternalFields(result.affectedDocuments), schema12, currentUser, "read");
256898
257110
  emit(appId, entityName, "update", updated);
256899
257111
  res.json(updated);
256900
257112
  } catch (error48) {
@@ -256906,7 +257118,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256906
257118
  res.status(500).json({ error: "Internal server error" });
256907
257119
  }
256908
257120
  }));
256909
- router.delete("/:entityName/:id", withCollection(async (req, res, collection, schema11, currentUser) => {
257121
+ router.delete("/:entityName/:id", withCollection(async (req, res, collection, schema12, currentUser) => {
256910
257122
  const { appId, entityName, id: id2 } = req.params;
256911
257123
  try {
256912
257124
  const doc2 = await collection.findOneAsync({ id: id2 });
@@ -256914,7 +257126,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256914
257126
  res.status(404).json({ error: `Record with id "${id2}" not found` });
256915
257127
  return;
256916
257128
  }
256917
- if (!checkRLS(schema11.rls?.delete, doc2, currentUser)) {
257129
+ if (!checkRLS(schema12.rls?.delete, doc2, currentUser)) {
256918
257130
  res.status(404).json({
256919
257131
  message: `Entity ${entityName} with ID ${id2} not found`
256920
257132
  });
@@ -256928,11 +257140,11 @@ async function createEntityRoutes(db2, logger2, broadcast) {
256928
257140
  res.status(500).json({ error: "Internal server error" });
256929
257141
  }
256930
257142
  }));
256931
- router.delete("/:entityName", parseBody, withCollection(async (req, res, collection, schema11, currentUser) => {
257143
+ router.delete("/:entityName", parseBody, withCollection(async (req, res, collection, schema12, currentUser) => {
256932
257144
  const { entityName } = req.params;
256933
257145
  try {
256934
257146
  const query = req.body || {};
256935
- const rlsDelete = schema11?.rls?.delete;
257147
+ const rlsDelete = schema12?.rls?.delete;
256936
257148
  if (rlsDelete !== undefined && rlsDelete !== true) {
256937
257149
  if (rlsDelete === false && currentUser?.is_service !== true) {
256938
257150
  res.status(403).json({ error: "Permission denied" });
@@ -259296,6 +259508,7 @@ function createProgram(context) {
259296
259508
  program2.addCommand(getDeploymentsCommand());
259297
259509
  program2.addCommand(getPromoteCommand());
259298
259510
  program2.addCommand(getRollbackCommand());
259511
+ program2.addCommand(getDomainsCommand());
259299
259512
  program2.addCommand(getSecretsCommand());
259300
259513
  program2.addCommand(getSandboxCommand());
259301
259514
  program2.addCommand(getAuthCommand());
@@ -263551,4 +263764,4 @@ export {
263551
263764
  CLIExitError
263552
263765
  };
263553
263766
 
263554
- //# debugId=0284004D662B4BCB64756E2164756E21
263767
+ //# debugId=A616C9B81A14DDB164756E2164756E21