@scalar/cli 1.9.2 → 1.9.6

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.
Files changed (3) hide show
  1. package/docs.html +166 -111
  2. package/index.js +1057 -1014
  3. package/package.json +12 -12
package/index.js CHANGED
@@ -114,17 +114,17 @@ var require_visit = __commonJS({
114
114
  visit.BREAK = BREAK;
115
115
  visit.SKIP = SKIP;
116
116
  visit.REMOVE = REMOVE;
117
- function visit_(key, node, visitor, path12) {
118
- const ctrl = callVisitor(key, node, visitor, path12);
117
+ function visit_(key, node, visitor, path13) {
118
+ const ctrl = callVisitor(key, node, visitor, path13);
119
119
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
120
- replaceNode(key, path12, ctrl);
121
- return visit_(key, ctrl, visitor, path12);
120
+ replaceNode(key, path13, ctrl);
121
+ return visit_(key, ctrl, visitor, path13);
122
122
  }
123
123
  if (typeof ctrl !== "symbol") {
124
124
  if (identity.isCollection(node)) {
125
- path12 = Object.freeze(path12.concat(node));
125
+ path13 = Object.freeze(path13.concat(node));
126
126
  for (let i = 0; i < node.items.length; ++i) {
127
- const ci = visit_(i, node.items[i], visitor, path12);
127
+ const ci = visit_(i, node.items[i], visitor, path13);
128
128
  if (typeof ci === "number")
129
129
  i = ci - 1;
130
130
  else if (ci === BREAK)
@@ -135,13 +135,13 @@ var require_visit = __commonJS({
135
135
  }
136
136
  }
137
137
  } else if (identity.isPair(node)) {
138
- path12 = Object.freeze(path12.concat(node));
139
- const ck = visit_("key", node.key, visitor, path12);
138
+ path13 = Object.freeze(path13.concat(node));
139
+ const ck = visit_("key", node.key, visitor, path13);
140
140
  if (ck === BREAK)
141
141
  return BREAK;
142
142
  else if (ck === REMOVE)
143
143
  node.key = null;
144
- const cv = visit_("value", node.value, visitor, path12);
144
+ const cv = visit_("value", node.value, visitor, path13);
145
145
  if (cv === BREAK)
146
146
  return BREAK;
147
147
  else if (cv === REMOVE)
@@ -162,17 +162,17 @@ var require_visit = __commonJS({
162
162
  visitAsync.BREAK = BREAK;
163
163
  visitAsync.SKIP = SKIP;
164
164
  visitAsync.REMOVE = REMOVE;
165
- async function visitAsync_(key, node, visitor, path12) {
166
- const ctrl = await callVisitor(key, node, visitor, path12);
165
+ async function visitAsync_(key, node, visitor, path13) {
166
+ const ctrl = await callVisitor(key, node, visitor, path13);
167
167
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
168
- replaceNode(key, path12, ctrl);
169
- return visitAsync_(key, ctrl, visitor, path12);
168
+ replaceNode(key, path13, ctrl);
169
+ return visitAsync_(key, ctrl, visitor, path13);
170
170
  }
171
171
  if (typeof ctrl !== "symbol") {
172
172
  if (identity.isCollection(node)) {
173
- path12 = Object.freeze(path12.concat(node));
173
+ path13 = Object.freeze(path13.concat(node));
174
174
  for (let i = 0; i < node.items.length; ++i) {
175
- const ci = await visitAsync_(i, node.items[i], visitor, path12);
175
+ const ci = await visitAsync_(i, node.items[i], visitor, path13);
176
176
  if (typeof ci === "number")
177
177
  i = ci - 1;
178
178
  else if (ci === BREAK)
@@ -183,13 +183,13 @@ var require_visit = __commonJS({
183
183
  }
184
184
  }
185
185
  } else if (identity.isPair(node)) {
186
- path12 = Object.freeze(path12.concat(node));
187
- const ck = await visitAsync_("key", node.key, visitor, path12);
186
+ path13 = Object.freeze(path13.concat(node));
187
+ const ck = await visitAsync_("key", node.key, visitor, path13);
188
188
  if (ck === BREAK)
189
189
  return BREAK;
190
190
  else if (ck === REMOVE)
191
191
  node.key = null;
192
- const cv = await visitAsync_("value", node.value, visitor, path12);
192
+ const cv = await visitAsync_("value", node.value, visitor, path13);
193
193
  if (cv === BREAK)
194
194
  return BREAK;
195
195
  else if (cv === REMOVE)
@@ -216,23 +216,23 @@ var require_visit = __commonJS({
216
216
  }
217
217
  return visitor;
218
218
  }
219
- function callVisitor(key, node, visitor, path12) {
219
+ function callVisitor(key, node, visitor, path13) {
220
220
  if (typeof visitor === "function")
221
- return visitor(key, node, path12);
221
+ return visitor(key, node, path13);
222
222
  if (identity.isMap(node))
223
- return visitor.Map?.(key, node, path12);
223
+ return visitor.Map?.(key, node, path13);
224
224
  if (identity.isSeq(node))
225
- return visitor.Seq?.(key, node, path12);
225
+ return visitor.Seq?.(key, node, path13);
226
226
  if (identity.isPair(node))
227
- return visitor.Pair?.(key, node, path12);
227
+ return visitor.Pair?.(key, node, path13);
228
228
  if (identity.isScalar(node))
229
- return visitor.Scalar?.(key, node, path12);
229
+ return visitor.Scalar?.(key, node, path13);
230
230
  if (identity.isAlias(node))
231
- return visitor.Alias?.(key, node, path12);
231
+ return visitor.Alias?.(key, node, path13);
232
232
  return void 0;
233
233
  }
234
- function replaceNode(key, path12, node) {
235
- const parent = path12[path12.length - 1];
234
+ function replaceNode(key, path13, node) {
235
+ const parent = path13[path13.length - 1];
236
236
  if (identity.isCollection(parent)) {
237
237
  parent.items[key] = node;
238
238
  } else if (identity.isPair(parent)) {
@@ -840,10 +840,10 @@ var require_Collection = __commonJS({
840
840
  var createNode = require_createNode();
841
841
  var identity = require_identity();
842
842
  var Node = require_Node();
843
- function collectionFromPath(schema, path12, value) {
843
+ function collectionFromPath(schema, path13, value) {
844
844
  let v = value;
845
- for (let i = path12.length - 1; i >= 0; --i) {
846
- const k = path12[i];
845
+ for (let i = path13.length - 1; i >= 0; --i) {
846
+ const k = path13[i];
847
847
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
848
848
  const a = [];
849
849
  a[k] = v;
@@ -862,7 +862,7 @@ var require_Collection = __commonJS({
862
862
  sourceObjects: /* @__PURE__ */ new Map()
863
863
  });
864
864
  }
865
- var isEmptyPath = (path12) => path12 == null || typeof path12 === "object" && !!path12[Symbol.iterator]().next().done;
865
+ var isEmptyPath = (path13) => path13 == null || typeof path13 === "object" && !!path13[Symbol.iterator]().next().done;
866
866
  var Collection = class extends Node.NodeBase {
867
867
  constructor(type, schema) {
868
868
  super(type);
@@ -892,11 +892,11 @@ var require_Collection = __commonJS({
892
892
  * be a Pair instance or a `{ key, value }` object, which may not have a key
893
893
  * that already exists in the map.
894
894
  */
895
- addIn(path12, value) {
896
- if (isEmptyPath(path12))
895
+ addIn(path13, value) {
896
+ if (isEmptyPath(path13))
897
897
  this.add(value);
898
898
  else {
899
- const [key, ...rest] = path12;
899
+ const [key, ...rest] = path13;
900
900
  const node = this.get(key, true);
901
901
  if (identity.isCollection(node))
902
902
  node.addIn(rest, value);
@@ -910,8 +910,8 @@ var require_Collection = __commonJS({
910
910
  * Removes a value from the collection.
911
911
  * @returns `true` if the item was found and removed.
912
912
  */
913
- deleteIn(path12) {
914
- const [key, ...rest] = path12;
913
+ deleteIn(path13) {
914
+ const [key, ...rest] = path13;
915
915
  if (rest.length === 0)
916
916
  return this.delete(key);
917
917
  const node = this.get(key, true);
@@ -925,8 +925,8 @@ var require_Collection = __commonJS({
925
925
  * scalar values from their surrounding node; to disable set `keepScalar` to
926
926
  * `true` (collections are always returned intact).
927
927
  */
928
- getIn(path12, keepScalar) {
929
- const [key, ...rest] = path12;
928
+ getIn(path13, keepScalar) {
929
+ const [key, ...rest] = path13;
930
930
  const node = this.get(key, true);
931
931
  if (rest.length === 0)
932
932
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -944,8 +944,8 @@ var require_Collection = __commonJS({
944
944
  /**
945
945
  * Checks if the collection includes a value with the key `key`.
946
946
  */
947
- hasIn(path12) {
948
- const [key, ...rest] = path12;
947
+ hasIn(path13) {
948
+ const [key, ...rest] = path13;
949
949
  if (rest.length === 0)
950
950
  return this.has(key);
951
951
  const node = this.get(key, true);
@@ -955,8 +955,8 @@ var require_Collection = __commonJS({
955
955
  * Sets a value in this collection. For `!!set`, `value` needs to be a
956
956
  * boolean to add/remove the item from the set.
957
957
  */
958
- setIn(path12, value) {
959
- const [key, ...rest] = path12;
958
+ setIn(path13, value) {
959
+ const [key, ...rest] = path13;
960
960
  if (rest.length === 0) {
961
961
  this.set(key, value);
962
962
  } else {
@@ -3468,9 +3468,9 @@ var require_Document = __commonJS({
3468
3468
  this.contents.add(value);
3469
3469
  }
3470
3470
  /** Adds a value to the document. */
3471
- addIn(path12, value) {
3471
+ addIn(path13, value) {
3472
3472
  if (assertCollection(this.contents))
3473
- this.contents.addIn(path12, value);
3473
+ this.contents.addIn(path13, value);
3474
3474
  }
3475
3475
  /**
3476
3476
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -3545,14 +3545,14 @@ var require_Document = __commonJS({
3545
3545
  * Removes a value from the document.
3546
3546
  * @returns `true` if the item was found and removed.
3547
3547
  */
3548
- deleteIn(path12) {
3549
- if (Collection.isEmptyPath(path12)) {
3548
+ deleteIn(path13) {
3549
+ if (Collection.isEmptyPath(path13)) {
3550
3550
  if (this.contents == null)
3551
3551
  return false;
3552
3552
  this.contents = null;
3553
3553
  return true;
3554
3554
  }
3555
- return assertCollection(this.contents) ? this.contents.deleteIn(path12) : false;
3555
+ return assertCollection(this.contents) ? this.contents.deleteIn(path13) : false;
3556
3556
  }
3557
3557
  /**
3558
3558
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -3567,10 +3567,10 @@ var require_Document = __commonJS({
3567
3567
  * scalar values from their surrounding node; to disable set `keepScalar` to
3568
3568
  * `true` (collections are always returned intact).
3569
3569
  */
3570
- getIn(path12, keepScalar) {
3571
- if (Collection.isEmptyPath(path12))
3570
+ getIn(path13, keepScalar) {
3571
+ if (Collection.isEmptyPath(path13))
3572
3572
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
3573
- return identity.isCollection(this.contents) ? this.contents.getIn(path12, keepScalar) : void 0;
3573
+ return identity.isCollection(this.contents) ? this.contents.getIn(path13, keepScalar) : void 0;
3574
3574
  }
3575
3575
  /**
3576
3576
  * Checks if the document includes a value with the key `key`.
@@ -3581,10 +3581,10 @@ var require_Document = __commonJS({
3581
3581
  /**
3582
3582
  * Checks if the document includes a value at `path`.
3583
3583
  */
3584
- hasIn(path12) {
3585
- if (Collection.isEmptyPath(path12))
3584
+ hasIn(path13) {
3585
+ if (Collection.isEmptyPath(path13))
3586
3586
  return this.contents !== void 0;
3587
- return identity.isCollection(this.contents) ? this.contents.hasIn(path12) : false;
3587
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path13) : false;
3588
3588
  }
3589
3589
  /**
3590
3590
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -3601,13 +3601,13 @@ var require_Document = __commonJS({
3601
3601
  * Sets a value in this document. For `!!set`, `value` needs to be a
3602
3602
  * boolean to add/remove the item from the set.
3603
3603
  */
3604
- setIn(path12, value) {
3605
- if (Collection.isEmptyPath(path12)) {
3604
+ setIn(path13, value) {
3605
+ if (Collection.isEmptyPath(path13)) {
3606
3606
  this.contents = value;
3607
3607
  } else if (this.contents == null) {
3608
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path12), value);
3608
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path13), value);
3609
3609
  } else if (assertCollection(this.contents)) {
3610
- this.contents.setIn(path12, value);
3610
+ this.contents.setIn(path13, value);
3611
3611
  }
3612
3612
  }
3613
3613
  /**
@@ -5564,9 +5564,9 @@ var require_cst_visit = __commonJS({
5564
5564
  visit.BREAK = BREAK;
5565
5565
  visit.SKIP = SKIP;
5566
5566
  visit.REMOVE = REMOVE;
5567
- visit.itemAtPath = (cst, path12) => {
5567
+ visit.itemAtPath = (cst, path13) => {
5568
5568
  let item = cst;
5569
- for (const [field, index] of path12) {
5569
+ for (const [field, index] of path13) {
5570
5570
  const tok = item?.[field];
5571
5571
  if (tok && "items" in tok) {
5572
5572
  item = tok.items[index];
@@ -5575,23 +5575,23 @@ var require_cst_visit = __commonJS({
5575
5575
  }
5576
5576
  return item;
5577
5577
  };
5578
- visit.parentCollection = (cst, path12) => {
5579
- const parent = visit.itemAtPath(cst, path12.slice(0, -1));
5580
- const field = path12[path12.length - 1][0];
5578
+ visit.parentCollection = (cst, path13) => {
5579
+ const parent = visit.itemAtPath(cst, path13.slice(0, -1));
5580
+ const field = path13[path13.length - 1][0];
5581
5581
  const coll = parent?.[field];
5582
5582
  if (coll && "items" in coll)
5583
5583
  return coll;
5584
5584
  throw new Error("Parent collection not found");
5585
5585
  };
5586
- function _visit(path12, item, visitor) {
5587
- let ctrl = visitor(item, path12);
5586
+ function _visit(path13, item, visitor) {
5587
+ let ctrl = visitor(item, path13);
5588
5588
  if (typeof ctrl === "symbol")
5589
5589
  return ctrl;
5590
5590
  for (const field of ["key", "value"]) {
5591
5591
  const token = item[field];
5592
5592
  if (token && "items" in token) {
5593
5593
  for (let i = 0; i < token.items.length; ++i) {
5594
- const ci = _visit(Object.freeze(path12.concat([[field, i]])), token.items[i], visitor);
5594
+ const ci = _visit(Object.freeze(path13.concat([[field, i]])), token.items[i], visitor);
5595
5595
  if (typeof ci === "number")
5596
5596
  i = ci - 1;
5597
5597
  else if (ci === BREAK)
@@ -5602,10 +5602,10 @@ var require_cst_visit = __commonJS({
5602
5602
  }
5603
5603
  }
5604
5604
  if (typeof ctrl === "function" && field === "key")
5605
- ctrl = ctrl(item, path12);
5605
+ ctrl = ctrl(item, path13);
5606
5606
  }
5607
5607
  }
5608
- return typeof ctrl === "function" ? ctrl(item, path12) : ctrl;
5608
+ return typeof ctrl === "function" ? ctrl(item, path13) : ctrl;
5609
5609
  }
5610
5610
  exports2.visit = visit;
5611
5611
  }
@@ -28667,27 +28667,27 @@ var require_util2 = __commonJS({
28667
28667
  };
28668
28668
  }
28669
28669
  var normalize6 = lruMemoize(function normalize7(aPath) {
28670
- var path12 = aPath;
28670
+ var path13 = aPath;
28671
28671
  var url2 = urlParse(aPath);
28672
28672
  if (url2) {
28673
28673
  if (!url2.path) {
28674
28674
  return aPath;
28675
28675
  }
28676
- path12 = url2.path;
28676
+ path13 = url2.path;
28677
28677
  }
28678
- var isAbsolute = exports2.isAbsolute(path12);
28678
+ var isAbsolute = exports2.isAbsolute(path13);
28679
28679
  var parts = [];
28680
28680
  var start = 0;
28681
28681
  var i = 0;
28682
28682
  while (true) {
28683
28683
  start = i;
28684
- i = path12.indexOf("/", start);
28684
+ i = path13.indexOf("/", start);
28685
28685
  if (i === -1) {
28686
- parts.push(path12.slice(start));
28686
+ parts.push(path13.slice(start));
28687
28687
  break;
28688
28688
  } else {
28689
- parts.push(path12.slice(start, i));
28690
- while (i < path12.length && path12[i] === "/") {
28689
+ parts.push(path13.slice(start, i));
28690
+ while (i < path13.length && path13[i] === "/") {
28691
28691
  i++;
28692
28692
  }
28693
28693
  }
@@ -28708,15 +28708,15 @@ var require_util2 = __commonJS({
28708
28708
  }
28709
28709
  }
28710
28710
  }
28711
- path12 = parts.join("/");
28712
- if (path12 === "") {
28713
- path12 = isAbsolute ? "/" : ".";
28711
+ path13 = parts.join("/");
28712
+ if (path13 === "") {
28713
+ path13 = isAbsolute ? "/" : ".";
28714
28714
  }
28715
28715
  if (url2) {
28716
- url2.path = path12;
28716
+ url2.path = path13;
28717
28717
  return urlGenerate(url2);
28718
28718
  }
28719
- return path12;
28719
+ return path13;
28720
28720
  });
28721
28721
  exports2.normalize = normalize6;
28722
28722
  function join2(aRoot, aPath) {
@@ -32355,14 +32355,14 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
32355
32355
  var whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
32356
32356
  var getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
32357
32357
  var isMemberExpressionBrowser = (exp) => {
32358
- const path12 = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
32358
+ const path13 = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
32359
32359
  let state = 0;
32360
32360
  let stateStack = [];
32361
32361
  let currentOpenBracketCount = 0;
32362
32362
  let currentOpenParensCount = 0;
32363
32363
  let currentStringType = null;
32364
- for (let i = 0; i < path12.length; i++) {
32365
- const char = path12.charAt(i);
32364
+ for (let i = 0; i < path13.length; i++) {
32365
+ const char = path13.charAt(i);
32366
32366
  switch (state) {
32367
32367
  case 0:
32368
32368
  if (char === "[") {
@@ -32398,7 +32398,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
32398
32398
  } else if (char === `(`) {
32399
32399
  currentOpenParensCount++;
32400
32400
  } else if (char === `)`) {
32401
- if (i === path12.length - 1) {
32401
+ if (i === path13.length - 1) {
32402
32402
  return false;
32403
32403
  }
32404
32404
  if (!--currentOpenParensCount) {
@@ -39126,14 +39126,14 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
39126
39126
  var whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
39127
39127
  var getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
39128
39128
  var isMemberExpressionBrowser = (exp) => {
39129
- const path12 = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
39129
+ const path13 = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
39130
39130
  let state = 0;
39131
39131
  let stateStack = [];
39132
39132
  let currentOpenBracketCount = 0;
39133
39133
  let currentOpenParensCount = 0;
39134
39134
  let currentStringType = null;
39135
- for (let i = 0; i < path12.length; i++) {
39136
- const char = path12.charAt(i);
39135
+ for (let i = 0; i < path13.length; i++) {
39136
+ const char = path13.charAt(i);
39137
39137
  switch (state) {
39138
39138
  case 0:
39139
39139
  if (char === "[") {
@@ -39169,7 +39169,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
39169
39169
  } else if (char === `(`) {
39170
39170
  currentOpenParensCount++;
39171
39171
  } else if (char === `)`) {
39172
- if (i === path12.length - 1) {
39172
+ if (i === path13.length - 1) {
39173
39173
  return false;
39174
39174
  }
39175
39175
  if (!--currentOpenParensCount) {
@@ -49946,8 +49946,8 @@ var require_runtime_core_cjs_prod = __commonJS({
49946
49946
  reset();
49947
49947
  return res;
49948
49948
  }
49949
- function createPathGetter(ctx, path12) {
49950
- const segments = path12.split(".");
49949
+ function createPathGetter(ctx, path13) {
49950
+ const segments = path13.split(".");
49951
49951
  return () => {
49952
49952
  let cur = ctx;
49953
49953
  for (let i = 0; i < segments.length && cur; i++) {
@@ -57250,8 +57250,8 @@ var require_runtime_core_cjs = __commonJS({
57250
57250
  reset();
57251
57251
  return res;
57252
57252
  }
57253
- function createPathGetter(ctx, path12) {
57254
- const segments = path12.split(".");
57253
+ function createPathGetter(ctx, path13) {
57254
+ const segments = path13.split(".");
57255
57255
  return () => {
57256
57256
  let cur = ctx;
57257
57257
  for (let i = 0; i < segments.length && cur; i++) {
@@ -68957,12 +68957,15 @@ function ansiRegex({ onlyFirst = false } = {}) {
68957
68957
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
68958
68958
  }
68959
68959
 
68960
- // ../../node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
68960
+ // ../../node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js
68961
68961
  var regex = ansiRegex();
68962
68962
  function stripAnsi(string4) {
68963
68963
  if (typeof string4 !== "string") {
68964
68964
  throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
68965
68965
  }
68966
+ if (!string4.includes("\x1B") && !string4.includes("\x9B")) {
68967
+ return string4;
68968
+ }
68966
68969
  return string4.replace(regex, "");
68967
68970
  }
68968
68971
 
@@ -69160,11 +69163,11 @@ Visit https://nodejs.org to download the latest version.`
69160
69163
  }
69161
69164
 
69162
69165
  // src/program.ts
69163
- import { Command as Command49 } from "commander";
69166
+ import { Command as Command50 } from "commander";
69164
69167
 
69165
69168
  // package.json
69166
69169
  var name = "@scalar/cli";
69167
- var version = "1.9.2";
69170
+ var version = "1.9.6";
69168
69171
  var bin = {
69169
69172
  scalar: "./dist/index.js",
69170
69173
  "scalar-cli": "./dist/index.js"
@@ -69944,10 +69947,10 @@ function mergeDefs(...defs) {
69944
69947
  function cloneDef(schema) {
69945
69948
  return mergeDefs(schema._zod.def);
69946
69949
  }
69947
- function getElementAtPath(obj, path12) {
69948
- if (!path12)
69950
+ function getElementAtPath(obj, path13) {
69951
+ if (!path13)
69949
69952
  return obj;
69950
- return path12.reduce((acc, key) => acc?.[key], obj);
69953
+ return path13.reduce((acc, key) => acc?.[key], obj);
69951
69954
  }
69952
69955
  function promiseAllObject(promisesObj) {
69953
69956
  const keys = Object.keys(promisesObj);
@@ -70330,11 +70333,11 @@ function aborted(x, startIndex = 0) {
70330
70333
  }
70331
70334
  return false;
70332
70335
  }
70333
- function prefixIssues(path12, issues) {
70336
+ function prefixIssues(path13, issues) {
70334
70337
  return issues.map((iss) => {
70335
70338
  var _a2;
70336
70339
  (_a2 = iss).path ?? (_a2.path = []);
70337
- iss.path.unshift(path12);
70340
+ iss.path.unshift(path13);
70338
70341
  return iss;
70339
70342
  });
70340
70343
  }
@@ -70517,7 +70520,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
70517
70520
  }
70518
70521
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
70519
70522
  const result = { errors: [] };
70520
- const processError = (error49, path12 = []) => {
70523
+ const processError = (error49, path13 = []) => {
70521
70524
  var _a2, _b;
70522
70525
  for (const issue2 of error49.issues) {
70523
70526
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -70527,7 +70530,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
70527
70530
  } else if (issue2.code === "invalid_element") {
70528
70531
  processError({ issues: issue2.issues }, issue2.path);
70529
70532
  } else {
70530
- const fullpath = [...path12, ...issue2.path];
70533
+ const fullpath = [...path13, ...issue2.path];
70531
70534
  if (fullpath.length === 0) {
70532
70535
  result.errors.push(mapper(issue2));
70533
70536
  continue;
@@ -70559,8 +70562,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
70559
70562
  }
70560
70563
  function toDotPath(_path) {
70561
70564
  const segs = [];
70562
- const path12 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
70563
- for (const seg of path12) {
70565
+ const path13 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
70566
+ for (const seg of path13) {
70564
70567
  if (typeof seg === "number")
70565
70568
  segs.push(`[${seg}]`);
70566
70569
  else if (typeof seg === "symbol")
@@ -82537,13 +82540,13 @@ function resolveRef(ref, ctx) {
82537
82540
  if (!ref.startsWith("#")) {
82538
82541
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
82539
82542
  }
82540
- const path12 = ref.slice(1).split("/").filter(Boolean);
82541
- if (path12.length === 0) {
82543
+ const path13 = ref.slice(1).split("/").filter(Boolean);
82544
+ if (path13.length === 0) {
82542
82545
  return ctx.rootSchema;
82543
82546
  }
82544
82547
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
82545
- if (path12[0] === defsKey) {
82546
- const key = path12[1];
82548
+ if (path13[0] === defsKey) {
82549
+ const key = path13[1];
82547
82550
  if (!key || !ctx.defs[key]) {
82548
82551
  throw new Error(`Reference not found: ${ref}`);
82549
82552
  }
@@ -86455,9 +86458,13 @@ function compareVersionsDesc(a, b) {
86455
86458
  return b.localeCompare(a);
86456
86459
  }
86457
86460
  var regexSlug = /^[a-z](?:[a-z0-9-]*[a-z0-9])?$/;
86458
- var slugSchema = external_exports.string().min(1, "Slug is required").min(3, "Slug must be at least 3 characters").max(60, "Slug must be less than 60 characters").regex(regexSlug, {
86461
+ var slugSchema = external_exports.string().min(1, "Slug is required").max(60, "Slug must be less than 60 characters").regex(regexSlug, {
86459
86462
  message: "Slug can have lowercase letters, digits, or hyphens. It must start with a lowercase letter and end with a letter or number."
86460
86463
  }).meta({ id: "slug" });
86464
+ var toRegistrySlug = (title) => {
86465
+ const candidate = title.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/[\s-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60).replace(/-+$/, "").replace(/^[^a-z]+/, "");
86466
+ return slugSchema.safeParse(candidate).success ? candidate : randomManagedDocSlug();
86467
+ };
86461
86468
  var setPreprocess = (input) => input instanceof Set ? input : Array.isArray(input) ? new Set(input) : input;
86462
86469
  var setTransform = (set2) => Array.from(set2);
86463
86470
  var scalarSet = (zodSetType) => external_exports.preprocess(setPreprocess, zodSetType).transform(setTransform);
@@ -86635,7 +86642,7 @@ var samlStateSchema = external_exports.object({
86635
86642
  // Expiry
86636
86643
  expiresAt: external_exports.number()
86637
86644
  }).meta({ id: "saml-state" });
86638
- var ssoResourceSchema = external_exports.enum([...RegistryResourceTypes, "sync-project", "project", "publish"]).meta({ id: "sso-resource" });
86645
+ var ssoResourceSchema = external_exports.enum([...RegistryResourceTypes, "sync-project", "project", "publish", "mcp"]).meta({ id: "sso-resource" });
86639
86646
  var relayStateSchema = external_exports.object({
86640
86647
  /** Uniquely identifies a relay state */
86641
86648
  uid: nanoidSchema.default(nanoid3).meta({ default: "nanoid()" }),
@@ -86692,14 +86699,16 @@ var siteDeploySchema = entitySchema.extend({
86692
86699
 
86693
86700
  // ../../packages/entities/dist/login-portals/customization.js
86694
86701
  var loginPortalEmailSchema = external_exports.object({
86702
+ /** @deprecated No longer rendered in the email template */
86695
86703
  logo: external_exports.string().default(""),
86704
+ /** @deprecated No longer rendered in the email template */
86696
86705
  logoSize: external_exports.string().default("100"),
86697
86706
  buttonText: external_exports.string().max(50).default("Login"),
86698
86707
  message: external_exports.string().max(1e3).default("Click to access private documentation hosted by scalar.com"),
86699
86708
  title: external_exports.string().max(100).default("Private Docs"),
86700
86709
  mainColor: external_exports.string().max(100).default("#2a2f45"),
86701
86710
  mainBackground: external_exports.string().max(100).default("#f6f6f6"),
86702
- cardColor: external_exports.string().max(100).default("2a2f45"),
86711
+ cardColor: external_exports.string().max(100).default("#2a2f45"),
86703
86712
  cardBackground: external_exports.string().max(100).default("#fff"),
86704
86713
  buttonColor: external_exports.string().max(100).default("#fff"),
86705
86714
  buttonBackground: external_exports.string().max(100).default("#0f0f0f")
@@ -86747,7 +86756,16 @@ var scalarRuleset = `extends: spectral:oas
86747
86756
  rules: {}`;
86748
86757
 
86749
86758
  // ../../packages/entities/dist/rule/schema.js
86750
- var ruleSchema = baseRegistrySchema.extend({}).meta({ id: "rule" });
86759
+ var blockPublishOnSchema = external_exports.enum([
86760
+ "error",
86761
+ "warning",
86762
+ "info",
86763
+ "hint",
86764
+ "none"
86765
+ ]);
86766
+ var ruleSchema = baseRegistrySchema.extend({
86767
+ blockPublishOn: blockPublishOnSchema.default("none")
86768
+ }).meta({ id: "rule" });
86751
86769
 
86752
86770
  // ../../packages/entities/dist/managed-doc/helpers.js
86753
86771
  function getLegacyWysiwygVersion(versions) {
@@ -86762,8 +86780,8 @@ function getLegacyWysiwygVersion(versions) {
86762
86780
  var embedStatuses = ["pending", "success", "failed"];
86763
86781
 
86764
86782
  // ../../packages/entities/dist/agent/docs.js
86765
- var docsProjectTypes = ["sync", "wysiwyg"];
86766
- var docsProjectSchema = zod_default.object({
86783
+ var docsProjectTypes = ["sync", "wysiwyg", "docs"];
86784
+ var agentDocsProjectSchema = zod_default.object({
86767
86785
  id: zod_default.string(),
86768
86786
  uid: zod_default.string(),
86769
86787
  name: zod_default.string(),
@@ -86776,7 +86794,7 @@ var docsProjectSchema = zod_default.object({
86776
86794
  agentEnabled: zod_default.boolean(),
86777
86795
  createdAt: zod_default.string(),
86778
86796
  updatedAt: zod_default.string()
86779
- }).meta({ id: "docs-project" });
86797
+ }).meta({ id: "agent-docs-project" });
86780
86798
  var docsPublishSchema = zod_default.object({
86781
86799
  id: zod_default.string(),
86782
86800
  uid: zod_default.string(),
@@ -86851,19 +86869,58 @@ var keyDocumentSchema = zod_default.object({
86851
86869
  }).meta({ id: "key-documents" });
86852
86870
 
86853
86871
  // ../../packages/entities/dist/agent/mcp.js
86872
+ var mcpServerVersionChangeSources = [
86873
+ "created",
86874
+ "migration",
86875
+ "user",
86876
+ "docs-publish",
86877
+ "track-latest",
86878
+ "track-current",
86879
+ "linked-resource-change"
86880
+ ];
86881
+ var mcpServerVersionStatuses = ["draft", "approved"];
86882
+ var mcpDocumentTrackModes = [
86883
+ "pinned",
86884
+ "track-latest",
86885
+ "track-current"
86886
+ ];
86887
+ var mcpDocsProjectTrackModes = [
86888
+ "pinned",
86889
+ "track-active-publish"
86890
+ ];
86891
+ var mcpServerToolModes = ["generic", "curated", "both"];
86854
86892
  var mcpServerSchema = external_exports.object({
86855
86893
  id: external_exports.string(),
86856
86894
  teamUid: external_exports.string(),
86857
86895
  name: external_exports.string(),
86896
+ slug: slugSchema,
86858
86897
  createdAt: external_exports.string(),
86859
86898
  updatedAt: external_exports.string()
86860
86899
  }).meta({ id: "mcp-server" });
86900
+ var mcpServerVersionSchema = external_exports.object({
86901
+ id: external_exports.string(),
86902
+ mcpServerId: external_exports.string(),
86903
+ semver: external_exports.string(),
86904
+ parentVersionId: external_exports.string().nullable(),
86905
+ changeSource: external_exports.enum(mcpServerVersionChangeSources),
86906
+ changeNote: external_exports.string().nullable(),
86907
+ newToolsSuggestionDismissed: external_exports.boolean(),
86908
+ createdByUserId: external_exports.string().nullable(),
86909
+ status: external_exports.enum(mcpServerVersionStatuses),
86910
+ approvedByUserId: external_exports.string().nullable(),
86911
+ approvedAt: external_exports.string().nullable(),
86912
+ createdAt: external_exports.string()
86913
+ }).meta({ id: "mcp-server-version" });
86861
86914
  var mcpServerOperationToolSchema = external_exports.object({
86862
86915
  id: external_exports.string(),
86863
86916
  mcpServerId: external_exports.string(),
86917
+ mcpServerVersionId: external_exports.string(),
86864
86918
  operationId: external_exports.string(),
86865
86919
  searchToolEnabled: external_exports.boolean(),
86866
86920
  executeRequestToolEnabled: external_exports.boolean(),
86921
+ curatedToolEnabled: external_exports.boolean(),
86922
+ name: external_exports.string().nullable(),
86923
+ description: external_exports.string().nullable(),
86867
86924
  createdAt: external_exports.string(),
86868
86925
  updatedAt: external_exports.string()
86869
86926
  }).meta({
@@ -86872,6 +86929,7 @@ var mcpServerOperationToolSchema = external_exports.object({
86872
86929
  var mcpServerDocsPageToolSchema = external_exports.object({
86873
86930
  id: external_exports.string(),
86874
86931
  mcpServerId: external_exports.string(),
86932
+ mcpServerVersionId: external_exports.string(),
86875
86933
  docsPageId: external_exports.string(),
86876
86934
  searchToolEnabled: external_exports.boolean(),
86877
86935
  executeRequestToolEnabled: external_exports.boolean(),
@@ -86883,7 +86941,10 @@ var mcpServerDocsPageToolSchema = external_exports.object({
86883
86941
  var mcpServerDocumentVersionSchema = external_exports.object({
86884
86942
  id: external_exports.string(),
86885
86943
  mcpServerId: external_exports.string(),
86944
+ mcpServerVersionId: external_exports.string(),
86886
86945
  versionId: external_exports.string(),
86946
+ trackMode: external_exports.enum(mcpDocumentTrackModes),
86947
+ toolMode: external_exports.enum(mcpServerToolModes),
86887
86948
  createdAt: external_exports.string()
86888
86949
  }).meta({
86889
86950
  id: "mcp-server-document-version"
@@ -86891,7 +86952,9 @@ var mcpServerDocumentVersionSchema = external_exports.object({
86891
86952
  var mcpServerDocsPublishSchema = external_exports.object({
86892
86953
  id: external_exports.string(),
86893
86954
  mcpServerId: external_exports.string(),
86955
+ mcpServerVersionId: external_exports.string(),
86894
86956
  docsPublishId: external_exports.string(),
86957
+ trackMode: external_exports.enum(mcpDocsProjectTrackModes),
86895
86958
  createdAt: external_exports.string()
86896
86959
  }).meta({
86897
86960
  id: "mcp-server-docs-publish"
@@ -86900,8 +86963,11 @@ var mcpInstallationSchema = external_exports.object({
86900
86963
  id: external_exports.string(),
86901
86964
  mcpServerId: external_exports.string(),
86902
86965
  name: external_exports.string(),
86966
+ slug: slugSchema,
86903
86967
  documentAuth: external_exports.record(external_exports.string(), external_exports.unknown()),
86904
- isPrivate: external_exports.boolean()
86968
+ isPrivate: external_exports.boolean(),
86969
+ accessGroups: external_exports.array(external_exports.string()).default([]),
86970
+ loginPortalUid: external_exports.string().nullable().default(null)
86905
86971
  }).meta({ id: "mcp-installation" });
86906
86972
 
86907
86973
  // ../../packages/entities/dist/agent/monthly-usage.js
@@ -86915,7 +86981,7 @@ var monthlyUsageSchema = zod_default.object({
86915
86981
  messages: zod_default.number()
86916
86982
  }).meta({ id: "monthly-usage" });
86917
86983
 
86918
- // ../../node_modules/.pnpm/@scalar+helpers@0.5.5/node_modules/@scalar/helpers/dist/http/http-methods.js
86984
+ // ../../node_modules/.pnpm/@scalar+helpers@0.8.0/node_modules/@scalar/helpers/dist/http/http-methods.js
86919
86985
  var HTTP_METHODS = ["delete", "get", "head", "options", "patch", "post", "put", "trace"];
86920
86986
  var httpMethods = Object.freeze(new Set(HTTP_METHODS));
86921
86987
 
@@ -86928,7 +86994,10 @@ var operationSchema = zod_default.object({
86928
86994
  versionId: zod_default.uuid(),
86929
86995
  embedding: zod_default.number().array(),
86930
86996
  searchToolEnabled: zod_default.boolean(),
86931
- executeRequestToolEnabled: zod_default.boolean()
86997
+ executeRequestToolEnabled: zod_default.boolean(),
86998
+ operationId: zod_default.string().nullable(),
86999
+ summary: zod_default.string().nullable(),
87000
+ description: zod_default.string().nullable()
86932
87001
  }).meta({ id: "operation" });
86933
87002
 
86934
87003
  // ../../packages/entities/dist/agent/version.js
@@ -87549,6 +87618,8 @@ var sharedProjectSchema = entitySchema.extend({
87549
87618
  isPrivate: external_exports.boolean().default(false),
87550
87619
  /** Toggle AI agent features for the docs project */
87551
87620
  agentEnabled: external_exports.boolean().default(false),
87621
+ /** Toggle analytics tracking for the docs project */
87622
+ analyticsEnabled: external_exports.boolean().default(true),
87552
87623
  /** Set of allowed access groups */
87553
87624
  accessGroups: scalarSet(external_exports.set(nanoidSchema).max(50)).default([])
87554
87625
  }).meta({ id: "shared-project" });
@@ -87609,6 +87680,58 @@ var githubProjectSchema = sharedProjectSchema.extend({
87609
87680
  */
87610
87681
  repository: githubProjectRepositorySchema.nullable().optional()
87611
87682
  }).meta({ id: "github-project" });
87683
+ var forgejoRepositorySchema = external_exports.object({
87684
+ provider: external_exports.literal("forgejo"),
87685
+ forgejoOwner: external_exports.string(),
87686
+ forgejoRepo: external_exports.string(),
87687
+ branch: external_exports.string().default("main"),
87688
+ configPath: external_exports.string().default("scalar.config.json")
87689
+ }).meta({ id: "docs-project-repository-forgejo" });
87690
+ var githubRepositorySchema = external_exports.object({
87691
+ provider: external_exports.literal("github"),
87692
+ linkedBy: external_exports.string(),
87693
+ installationId: external_exports.number().int(),
87694
+ id: external_exports.number().int(),
87695
+ name: external_exports.string().min(2),
87696
+ branch: external_exports.string().default("main"),
87697
+ configPath: external_exports.string().default("scalar.config.json"),
87698
+ publishOnMerge: external_exports.boolean().default(true),
87699
+ publishPreviews: external_exports.boolean().default(false),
87700
+ prComments: external_exports.boolean().default(false),
87701
+ expired: external_exports.boolean().default(false)
87702
+ }).meta({ id: "docs-project-repository-github" });
87703
+ var bitbucketRepositorySchema = external_exports.object({
87704
+ provider: external_exports.literal("bitbucket"),
87705
+ linkedBy: external_exports.string(),
87706
+ workspaceUuid: external_exports.string(),
87707
+ workspaceSlug: external_exports.string(),
87708
+ repoUuid: external_exports.string(),
87709
+ repoSlug: external_exports.string(),
87710
+ /** `workspaceSlug/repoSlug` for display, mirrored from GitHub for symmetry */
87711
+ name: external_exports.string().min(2),
87712
+ branch: external_exports.string().default("main"),
87713
+ configPath: external_exports.string().default("scalar.config.json"),
87714
+ publishOnMerge: external_exports.boolean().default(true),
87715
+ publishPreviews: external_exports.boolean().default(false),
87716
+ prComments: external_exports.boolean().default(false),
87717
+ expired: external_exports.boolean().default(false),
87718
+ /** UUID returned by Bitbucket on hook create. Stored so we can delete the webhook on unlink. */
87719
+ webhookUuid: external_exports.string().default("")
87720
+ }).meta({ id: "docs-project-repository-bitbucket" });
87721
+ var docsProjectRepositorySchema = external_exports.discriminatedUnion("provider", [
87722
+ forgejoRepositorySchema,
87723
+ githubRepositorySchema,
87724
+ bitbucketRepositorySchema
87725
+ ]);
87726
+ var docsProjectSchema = sharedProjectSchema.extend({
87727
+ slug: slugSchema,
87728
+ publishStatus: external_exports.string().default(""),
87729
+ publishMessage: external_exports.string().default(""),
87730
+ repository: docsProjectRepositorySchema
87731
+ }).meta({ id: "docs-project" });
87732
+ function isGithubBackedDocsProject(project) {
87733
+ return project.repository.provider === "github";
87734
+ }
87612
87735
 
87613
87736
  // ../../packages/entities/dist/project/publish.js
87614
87737
  var ConfigVersion;
@@ -87624,7 +87747,8 @@ var publishRecordSchema = entitySchema.extend({
87624
87747
  external_exports.literal("deployed"),
87625
87748
  external_exports.literal("inactive"),
87626
87749
  external_exports.literal("error"),
87627
- external_exports.literal("deleted")
87750
+ external_exports.literal("deleted"),
87751
+ external_exports.literal("cancelled")
87628
87752
  ]),
87629
87753
  deployedAt: external_exports.number().nullable().default(null),
87630
87754
  message: external_exports.string().default(""),
@@ -88241,6 +88365,9 @@ var FeatureFlag;
88241
88365
  FeatureFlag2["Export"] = "export";
88242
88366
  FeatureFlag2["DocsMCP"] = "docsMcp";
88243
88367
  FeatureFlag2["DisableApiSSR"] = "disableApiSSR";
88368
+ FeatureFlag2["UnifiedDocs"] = "unifiedDocs";
88369
+ FeatureFlag2["DocsAnalytics"] = "docsAnalytics";
88370
+ FeatureFlag2["McpAnalytics"] = "mcpAnalytics";
88244
88371
  })(FeatureFlag || (FeatureFlag = {}));
88245
88372
  var featureSchema = external_exports.boolean().optional().meta({ id: "feature" });
88246
88373
  var featureFlagSchema = external_exports.object({
@@ -88254,7 +88381,10 @@ var featureFlagSchema = external_exports.object({
88254
88381
  [FeatureFlag.MCP]: featureSchema,
88255
88382
  [FeatureFlag.Export]: featureSchema,
88256
88383
  [FeatureFlag.DocsMCP]: featureSchema,
88257
- [FeatureFlag.DisableApiSSR]: featureSchema
88384
+ [FeatureFlag.DisableApiSSR]: featureSchema,
88385
+ [FeatureFlag.UnifiedDocs]: featureSchema,
88386
+ [FeatureFlag.DocsAnalytics]: featureSchema,
88387
+ [FeatureFlag.McpAnalytics]: featureSchema
88258
88388
  }).meta({ id: "feature-flag" });
88259
88389
 
88260
88390
  // ../../packages/entities/dist/team/schema.js
@@ -88556,6 +88686,14 @@ var docsAgentTokenSchema = external_exports.object({
88556
88686
  exp: external_exports.number()
88557
88687
  }).meta({ id: "docs-agent-token" });
88558
88688
 
88689
+ // ../../packages/entities/dist/user/bitbucket.js
88690
+ var userBitbucketSchema = entitySchema.extend({
88691
+ token: zod_default.string(),
88692
+ refreshToken: zod_default.string(),
88693
+ expiry: timestampSchema,
88694
+ refreshExpiry: timestampSchema
88695
+ }).meta({ id: "user-bitbucket" });
88696
+
88559
88697
  // ../../packages/entities/dist/user/github.js
88560
88698
  var userGithubSchema = entitySchema.extend({
88561
88699
  token: zod_default.string(),
@@ -88609,7 +88747,10 @@ var userSchema = entitySchema.extend({
88609
88747
  email: emailSchema,
88610
88748
  teams: teamRefSchema.array(),
88611
88749
  activeTeamId: zod_default.string().nullable(),
88612
- hasGithub: zod_default.boolean().optional().default(false)
88750
+ hasGithub: zod_default.boolean().optional().default(false),
88751
+ hasBitbucket: zod_default.boolean().optional().default(false),
88752
+ /** Forgejo personal access token for git operations */
88753
+ forgejoToken: zod_default.string().optional()
88613
88754
  }).meta({ id: "user" });
88614
88755
 
88615
88756
  // ../../packages/entities/dist/user/ban.js
@@ -88811,6 +88952,7 @@ var BaseCollections = {
88811
88952
  Passwords: "passwords",
88812
88953
  SignupOtp: "signup-otp",
88813
88954
  GithubUsers: "github-users",
88955
+ BitbucketUsers: "bitbucket-users",
88814
88956
  RefreshTokens: "refresh-tokens",
88815
88957
  Teams: "team",
88816
88958
  Deploys: "deploys",
@@ -88818,6 +88960,7 @@ var BaseCollections = {
88818
88960
  SignupData: "signup-data",
88819
88961
  Projects: (teamUid) => `team/${teamUid}/projects`,
88820
88962
  GithubProjects: (teamUid) => `team/${teamUid}/projects-github`,
88963
+ DocsProjects: (teamUid) => `team/${teamUid}/docs`,
88821
88964
  Themes: (teamUid) => `team/${teamUid}/themes`,
88822
88965
  PublishRecords: (teamUid) => `team/${teamUid}/publish`,
88823
88966
  ManagedDocs: (teamUid) => `team/${teamUid}/managed-docs`,
@@ -88917,6 +89060,214 @@ function accessGroupsApiFactory(requestService) {
88917
89060
  };
88918
89061
  }
88919
89062
 
89063
+ // ../../packages/bigquery/dist/schemas.js
89064
+ var analyticsRangeSchema = external_exports.enum(["24h", "7d", "30d", "90d"]);
89065
+ var analyticsGranularitySchema = external_exports.enum(["hour", "day"]);
89066
+ var consumerTypeSchema = external_exports.enum(["human", "bot", "llm", "mcp"]);
89067
+ var timeseriesPointSchema = external_exports.object({
89068
+ bucket: external_exports.string(),
89069
+ human: external_exports.number().int().nonnegative(),
89070
+ bot: external_exports.number().int().nonnegative(),
89071
+ llm: external_exports.number().int().nonnegative(),
89072
+ mcp: external_exports.number().int().nonnegative(),
89073
+ unique: external_exports.number().int().nonnegative()
89074
+ });
89075
+ var overviewResultSchema = external_exports.object({
89076
+ totals: external_exports.object({
89077
+ views: external_exports.number().int().nonnegative(),
89078
+ unique: external_exports.number().int().nonnegative(),
89079
+ human: external_exports.number().int().nonnegative(),
89080
+ bot: external_exports.number().int().nonnegative(),
89081
+ llm: external_exports.number().int().nonnegative(),
89082
+ mcp: external_exports.number().int().nonnegative()
89083
+ }),
89084
+ timeseries: external_exports.array(timeseriesPointSchema)
89085
+ });
89086
+ var topPageSchema = external_exports.object({
89087
+ path: external_exports.string(),
89088
+ views: external_exports.number().int().nonnegative(),
89089
+ unique: external_exports.number().int().nonnegative()
89090
+ });
89091
+ var topPagesResultSchema = external_exports.object({
89092
+ pages: external_exports.array(topPageSchema)
89093
+ });
89094
+ var topReferrerSchema = external_exports.object({
89095
+ referrer: external_exports.string(),
89096
+ views: external_exports.number().int().nonnegative()
89097
+ });
89098
+ var topReferrersResultSchema = external_exports.object({
89099
+ referrers: external_exports.array(topReferrerSchema)
89100
+ });
89101
+ var consumersResultSchema = external_exports.object({
89102
+ totals: external_exports.object({
89103
+ human: external_exports.number().int().nonnegative(),
89104
+ bot: external_exports.number().int().nonnegative(),
89105
+ llm: external_exports.number().int().nonnegative(),
89106
+ mcp: external_exports.number().int().nonnegative()
89107
+ }),
89108
+ timeseries: external_exports.array(timeseriesPointSchema)
89109
+ });
89110
+ var mcpEventKindSchema = external_exports.enum([
89111
+ "session-start",
89112
+ "tool-called",
89113
+ "tools-list"
89114
+ ]);
89115
+ var mcpConsumerKindSchema = external_exports.enum([
89116
+ "oauth",
89117
+ "personal_token",
89118
+ "docs_agent_token",
89119
+ "anonymous"
89120
+ ]);
89121
+ var mcpToolKindSchema = external_exports.enum(["generic", "curated"]);
89122
+ var mcpToolCategorySchema = external_exports.enum(["openapi", "docs"]);
89123
+ var mcpExportDatasetSchema = external_exports.enum([
89124
+ "tools",
89125
+ "consumers",
89126
+ "timeseries"
89127
+ ]);
89128
+ var mcpAnalyticsParamsSchema = external_exports.object({
89129
+ range: analyticsRangeSchema.default("7d"),
89130
+ granularity: analyticsGranularitySchema.optional(),
89131
+ installationId: external_exports.string().optional(),
89132
+ clientName: external_exports.string().optional(),
89133
+ subjectId: external_exports.string().optional()
89134
+ });
89135
+ var mcpTimeseriesPointSchema = external_exports.object({
89136
+ bucket: external_exports.string(),
89137
+ calls: external_exports.number().int().nonnegative(),
89138
+ errors: external_exports.number().int().nonnegative(),
89139
+ p50_ms: external_exports.number().nonnegative(),
89140
+ p95_ms: external_exports.number().nonnegative(),
89141
+ unique_consumers: external_exports.number().int().nonnegative()
89142
+ });
89143
+ var mcpCategoryTotalsSchema = external_exports.object({
89144
+ openapi: external_exports.number().int().nonnegative(),
89145
+ docs: external_exports.number().int().nonnegative()
89146
+ });
89147
+ var mcpOverviewTotalsSchema = external_exports.object({
89148
+ calls: external_exports.number().int().nonnegative(),
89149
+ errors: external_exports.number().int().nonnegative(),
89150
+ unique_consumers: external_exports.number().int().nonnegative(),
89151
+ p50_ms: external_exports.number().nonnegative(),
89152
+ p95_ms: external_exports.number().nonnegative(),
89153
+ error_rate: external_exports.number().min(0).max(1)
89154
+ });
89155
+ var mcpOverviewResultSchema = external_exports.object({
89156
+ totals: mcpOverviewTotalsSchema,
89157
+ timeseries: external_exports.array(mcpTimeseriesPointSchema),
89158
+ byCategory: mcpCategoryTotalsSchema
89159
+ });
89160
+ var mcpToolStatSchema = external_exports.object({
89161
+ tool_name: external_exports.string(),
89162
+ tool_kind: mcpToolKindSchema,
89163
+ tool_category: mcpToolCategorySchema.nullable(),
89164
+ operation_id: external_exports.string().nullable(),
89165
+ calls: external_exports.number().int().nonnegative(),
89166
+ errors: external_exports.number().int().nonnegative(),
89167
+ p50_ms: external_exports.number().nonnegative(),
89168
+ p95_ms: external_exports.number().nonnegative(),
89169
+ error_rate: external_exports.number().min(0).max(1),
89170
+ unique_consumers: external_exports.number().int().nonnegative()
89171
+ });
89172
+ var mcpToolsResultSchema = external_exports.object({
89173
+ tools: external_exports.array(mcpToolStatSchema)
89174
+ });
89175
+ var mcpConsumerStatSchema = external_exports.object({
89176
+ subject_id: external_exports.string(),
89177
+ subject_label: external_exports.string(),
89178
+ client_name: external_exports.string(),
89179
+ consumer_kind: mcpConsumerKindSchema,
89180
+ calls: external_exports.number().int().nonnegative(),
89181
+ errors: external_exports.number().int().nonnegative(),
89182
+ first_seen: external_exports.string(),
89183
+ last_seen: external_exports.string(),
89184
+ top_tool: external_exports.string().nullable()
89185
+ });
89186
+ var mcpConsumersResultSchema = external_exports.object({
89187
+ consumers: external_exports.array(mcpConsumerStatSchema)
89188
+ });
89189
+ var mcpLatencyByToolEntrySchema = external_exports.object({
89190
+ tool_name: external_exports.string(),
89191
+ calls: external_exports.number().int().nonnegative(),
89192
+ p50_ms: external_exports.number().nonnegative(),
89193
+ p95_ms: external_exports.number().nonnegative()
89194
+ });
89195
+ var mcpLatencyResultSchema = external_exports.object({
89196
+ tools: external_exports.array(mcpLatencyByToolEntrySchema)
89197
+ });
89198
+ var mcpErrorEntrySchema = external_exports.object({
89199
+ error_code: external_exports.string(),
89200
+ count: external_exports.number().int().nonnegative()
89201
+ });
89202
+ var mcpErrorsResultSchema = external_exports.object({
89203
+ totals: external_exports.object({
89204
+ calls: external_exports.number().int().nonnegative(),
89205
+ errors: external_exports.number().int().nonnegative(),
89206
+ error_rate: external_exports.number().min(0).max(1)
89207
+ }),
89208
+ byCode: external_exports.array(mcpErrorEntrySchema)
89209
+ });
89210
+
89211
+ // ../../packages/service-api/dist/apis/analytics.js
89212
+ function buildQuery(params) {
89213
+ const search = new URLSearchParams();
89214
+ for (const [k, v] of Object.entries(params)) {
89215
+ if (v === void 0)
89216
+ continue;
89217
+ search.set(k, String(v));
89218
+ }
89219
+ const qs = search.toString();
89220
+ return qs ? `?${qs}` : "";
89221
+ }
89222
+ function analyticsApiFactory(requestService) {
89223
+ async function getOverview(projectUid, args = {}) {
89224
+ return requestService.request({
89225
+ url: `core/analytics/projects/${projectUid}/overview${buildQuery({
89226
+ range: args.range,
89227
+ granularity: args.granularity
89228
+ })}`,
89229
+ method: "get",
89230
+ schema: overviewResultSchema
89231
+ });
89232
+ }
89233
+ async function getPages(projectUid, args = {}) {
89234
+ return requestService.request({
89235
+ url: `core/analytics/projects/${projectUid}/pages${buildQuery({
89236
+ range: args.range,
89237
+ limit: args.limit
89238
+ })}`,
89239
+ method: "get",
89240
+ schema: topPagesResultSchema
89241
+ });
89242
+ }
89243
+ async function getReferrers(projectUid, args = {}) {
89244
+ return requestService.request({
89245
+ url: `core/analytics/projects/${projectUid}/referrers${buildQuery({
89246
+ range: args.range,
89247
+ limit: args.limit
89248
+ })}`,
89249
+ method: "get",
89250
+ schema: topReferrersResultSchema
89251
+ });
89252
+ }
89253
+ async function getConsumers(projectUid, args = {}) {
89254
+ return requestService.request({
89255
+ url: `core/analytics/projects/${projectUid}/consumers${buildQuery({
89256
+ range: args.range,
89257
+ granularity: args.granularity
89258
+ })}`,
89259
+ method: "get",
89260
+ schema: consumersResultSchema
89261
+ });
89262
+ }
89263
+ return {
89264
+ getOverview,
89265
+ getPages,
89266
+ getReferrers,
89267
+ getConsumers
89268
+ };
89269
+ }
89270
+
88920
89271
  // ../../packages/service-api/dist/apis/login-portals.js
88921
89272
  function loginPortalsApiFactory(requestService) {
88922
89273
  async function get(slug) {
@@ -89313,7 +89664,8 @@ function rulesApiFactory(requestService) {
89313
89664
  description: true,
89314
89665
  slug: true,
89315
89666
  namespace: true,
89316
- isPrivate: true
89667
+ isPrivate: true,
89668
+ blockPublishOn: true
89317
89669
  }).array()
89318
89670
  });
89319
89671
  }
@@ -89916,6 +90268,190 @@ function authApiFactory(requestService) {
89916
90268
  };
89917
90269
  }
89918
90270
 
90271
+ // ../../packages/service-api/dist/apis/bitbucket.js
90272
+ var bitbucketRepoSummarySchema = external_exports.object({
90273
+ uuid: external_exports.string(),
90274
+ slug: external_exports.string(),
90275
+ fullName: external_exports.string(),
90276
+ defaultBranch: external_exports.string(),
90277
+ isPrivate: external_exports.boolean(),
90278
+ workspaceUuid: external_exports.string(),
90279
+ workspaceSlug: external_exports.string()
90280
+ });
90281
+ var bitbucketWorkspaceSchema = external_exports.object({
90282
+ uuid: external_exports.string(),
90283
+ slug: external_exports.string(),
90284
+ name: external_exports.string(),
90285
+ iconUrl: external_exports.string().optional(),
90286
+ repos: bitbucketRepoSummarySchema.array()
90287
+ });
90288
+ function bitbucketApiFactory(requestService) {
90289
+ async function initiateLink(opts = {}) {
90290
+ const params = new URLSearchParams();
90291
+ if (opts.redirect)
90292
+ params.set("redirect", opts.redirect);
90293
+ const qs = params.toString() ? `?${params.toString()}` : "";
90294
+ return await requestService.request({
90295
+ url: `core/vcs/bitbucket/link/initiate${qs}`,
90296
+ method: "get",
90297
+ schema: external_exports.object({ url: external_exports.string() })
90298
+ });
90299
+ }
90300
+ async function getWorkspaces() {
90301
+ return await requestService.request({
90302
+ url: "core/vcs/bitbucket/workspaces",
90303
+ method: "get",
90304
+ schema: bitbucketWorkspaceSchema.array()
90305
+ });
90306
+ }
90307
+ async function listDocsProjectBitbucketBranches(uid, opts = {}) {
90308
+ const params = new URLSearchParams();
90309
+ if (opts.query)
90310
+ params.set("query", opts.query);
90311
+ if (opts.page !== void 0)
90312
+ params.set("page", String(opts.page));
90313
+ if (opts.perPage !== void 0)
90314
+ params.set("perPage", String(opts.perPage));
90315
+ const qs = params.toString() ? `?${params.toString()}` : "";
90316
+ return await requestService.request({
90317
+ url: `core/vcs/bitbucket/docs-project/${uid}/branches${qs}`,
90318
+ method: "get",
90319
+ schema: external_exports.object({
90320
+ branches: external_exports.object({
90321
+ name: external_exports.string(),
90322
+ isDefault: external_exports.boolean()
90323
+ }).array(),
90324
+ hasMore: external_exports.boolean()
90325
+ })
90326
+ });
90327
+ }
90328
+ async function disconnectAccount() {
90329
+ return await requestService.request({
90330
+ url: "core/vcs/bitbucket/disconnect-account",
90331
+ method: "post",
90332
+ schema: external_exports.object({ success: external_exports.literal(true) })
90333
+ });
90334
+ }
90335
+ return {
90336
+ initiateLink,
90337
+ getWorkspaces,
90338
+ listDocsProjectBitbucketBranches,
90339
+ disconnectAccount
90340
+ };
90341
+ }
90342
+
90343
+ // ../../packages/service-api/dist/apis/docs-project.js
90344
+ function docsProjectApiFactory(requestService) {
90345
+ async function createProject(data) {
90346
+ return await requestService.request({
90347
+ url: "core/docs-projects/create",
90348
+ method: "post",
90349
+ data,
90350
+ schema: docsProjectSchema
90351
+ });
90352
+ }
90353
+ async function deleteProject(projectUid) {
90354
+ return await requestService.request({
90355
+ url: "core/docs-projects/delete",
90356
+ method: "delete",
90357
+ data: { projectUid },
90358
+ schema: external_exports.null()
90359
+ });
90360
+ }
90361
+ async function getProject(slug) {
90362
+ return await requestService.request({
90363
+ url: `core/docs-projects/${slug}`,
90364
+ method: "get",
90365
+ schema: docsProjectSchema
90366
+ });
90367
+ }
90368
+ async function getGitCredentials() {
90369
+ return await requestService.request({
90370
+ url: "core/forgejo/git-credentials",
90371
+ method: "get",
90372
+ schema: external_exports.object({
90373
+ forgejoBaseUrl: external_exports.string(),
90374
+ forgejoToken: external_exports.string(),
90375
+ forgejoUsername: external_exports.string()
90376
+ })
90377
+ });
90378
+ }
90379
+ async function updateRepoSettings(projectUid, patch) {
90380
+ return await requestService.request({
90381
+ url: "core/docs-projects/update-repo-settings",
90382
+ method: "post",
90383
+ data: { projectUid, ...patch },
90384
+ schema: external_exports.null()
90385
+ });
90386
+ }
90387
+ async function linkGithub(data) {
90388
+ return await requestService.request({
90389
+ url: `core/docs-projects/${data.projectUid}/link-github`,
90390
+ method: "post",
90391
+ data: { installationId: data.installationId, repoId: data.repoId },
90392
+ schema: external_exports.object({
90393
+ pullRequest: external_exports.object({
90394
+ url: external_exports.string(),
90395
+ number: external_exports.number().int(),
90396
+ branch: external_exports.string()
90397
+ }),
90398
+ project: docsProjectSchema
90399
+ })
90400
+ });
90401
+ }
90402
+ async function unlinkGithub(projectUid) {
90403
+ return await requestService.request({
90404
+ url: `core/docs-projects/${projectUid}/unlink-github`,
90405
+ method: "post",
90406
+ schema: external_exports.object({ project: docsProjectSchema })
90407
+ });
90408
+ }
90409
+ async function linkBitbucket(data) {
90410
+ return await requestService.request({
90411
+ url: `core/docs-projects/${data.projectUid}/link-bitbucket`,
90412
+ method: "post",
90413
+ data: {
90414
+ workspaceUuid: data.workspaceUuid,
90415
+ repoUuid: data.repoUuid
90416
+ },
90417
+ schema: external_exports.object({
90418
+ pullRequest: external_exports.object({
90419
+ url: external_exports.string(),
90420
+ number: external_exports.number().int(),
90421
+ branch: external_exports.string()
90422
+ }),
90423
+ project: docsProjectSchema
90424
+ })
90425
+ });
90426
+ }
90427
+ async function unlinkBitbucket(projectUid) {
90428
+ return await requestService.request({
90429
+ url: `core/docs-projects/${projectUid}/unlink-bitbucket`,
90430
+ method: "post",
90431
+ schema: external_exports.object({ project: docsProjectSchema })
90432
+ });
90433
+ }
90434
+ async function refreshBitbucketWebhook(projectUid) {
90435
+ return await requestService.request({
90436
+ url: `core/docs-projects/${projectUid}/bitbucket/refresh-webhook`,
90437
+ method: "post",
90438
+ schema: external_exports.object({ project: docsProjectSchema })
90439
+ });
90440
+ }
90441
+ return {
90442
+ createProject,
90443
+ deleteProject,
90444
+ getProject,
90445
+ getGitCredentials,
90446
+ updateRepoSettings,
90447
+ linkGithub,
90448
+ unlinkGithub,
90449
+ linkBitbucket,
90450
+ unlinkBitbucket,
90451
+ refreshBitbucketWebhook
90452
+ };
90453
+ }
90454
+
89919
90455
  // ../../packages/service-api/dist/apis/feedback.js
89920
90456
  function feedbackApiFactory(requestService) {
89921
90457
  async function submit(email3, feedback) {
@@ -89936,9 +90472,13 @@ function feedbackApiFactory(requestService) {
89936
90472
 
89937
90473
  // ../../packages/service-api/dist/apis/github.js
89938
90474
  function githubApiFactory(requestService) {
89939
- async function initiateLink() {
90475
+ async function initiateLink(opts = {}) {
90476
+ const params = new URLSearchParams();
90477
+ if (opts.redirect)
90478
+ params.set("redirect", opts.redirect);
90479
+ const qs = params.toString() ? `?${params.toString()}` : "";
89940
90480
  return await requestService.request({
89941
- url: "core/github/link/initiate",
90481
+ url: `core/github/link/initiate${qs}`,
89942
90482
  method: "get",
89943
90483
  schema: external_exports.object({
89944
90484
  url: external_exports.string()
@@ -89981,6 +90521,60 @@ function githubApiFactory(requestService) {
89981
90521
  schema: external_exports.null()
89982
90522
  });
89983
90523
  }
90524
+ async function getDocsProjectGithubCommits(uid, opts = {}) {
90525
+ const params = new URLSearchParams();
90526
+ if (opts.branch)
90527
+ params.set("branch", opts.branch);
90528
+ if (opts.page !== void 0)
90529
+ params.set("page", String(opts.page));
90530
+ if (opts.perPage !== void 0)
90531
+ params.set("perPage", String(opts.perPage));
90532
+ const qs = params.toString() ? `?${params.toString()}` : "";
90533
+ return await requestService.request({
90534
+ url: `core/github/docs-project/${uid}/commits${qs}`,
90535
+ method: "get",
90536
+ schema: external_exports.object({
90537
+ sha: external_exports.string(),
90538
+ message: external_exports.string(),
90539
+ authorName: external_exports.string(),
90540
+ authorEmail: external_exports.string(),
90541
+ timestamp: external_exports.number()
90542
+ }).array()
90543
+ });
90544
+ }
90545
+ async function listDocsProjectGithubBranches(uid, opts = {}) {
90546
+ const params = new URLSearchParams();
90547
+ if (opts.query)
90548
+ params.set("query", opts.query);
90549
+ if (opts.page !== void 0)
90550
+ params.set("page", String(opts.page));
90551
+ if (opts.perPage !== void 0)
90552
+ params.set("perPage", String(opts.perPage));
90553
+ const qs = params.toString() ? `?${params.toString()}` : "";
90554
+ return await requestService.request({
90555
+ url: `core/github/docs-project/${uid}/branches${qs}`,
90556
+ method: "get",
90557
+ schema: external_exports.object({
90558
+ branches: external_exports.object({
90559
+ name: external_exports.string(),
90560
+ isDefault: external_exports.boolean()
90561
+ }).array(),
90562
+ hasMore: external_exports.boolean()
90563
+ })
90564
+ });
90565
+ }
90566
+ async function createDocsProjectGithubPullRequest(uid, data) {
90567
+ return await requestService.request({
90568
+ url: `core/github/docs-project/${uid}/pull-request`,
90569
+ method: "post",
90570
+ data,
90571
+ schema: external_exports.object({
90572
+ url: external_exports.string(),
90573
+ number: external_exports.number(),
90574
+ alreadyExists: external_exports.boolean()
90575
+ })
90576
+ });
90577
+ }
89984
90578
  async function publishRepo(githubProjectId) {
89985
90579
  return await requestService.request({
89986
90580
  url: "core/publish/github",
@@ -90050,6 +90644,13 @@ function githubApiFactory(requestService) {
90050
90644
  })
90051
90645
  });
90052
90646
  }
90647
+ async function disconnectAccount() {
90648
+ return await requestService.request({
90649
+ url: "core/vcs/github/disconnect-account",
90650
+ method: "post",
90651
+ schema: external_exports.object({ success: external_exports.literal(true) })
90652
+ });
90653
+ }
90053
90654
  async function validateConfigFile(uid, configPath) {
90054
90655
  return await requestService.request({
90055
90656
  url: "core/github/config/validate",
@@ -90077,6 +90678,9 @@ function githubApiFactory(requestService) {
90077
90678
  getRepos,
90078
90679
  linkRepo,
90079
90680
  unlinkRepo,
90681
+ getDocsProjectGithubCommits,
90682
+ listDocsProjectGithubBranches,
90683
+ createDocsProjectGithubPullRequest,
90080
90684
  publishRepo,
90081
90685
  getRepoInfo,
90082
90686
  checkSlug,
@@ -90085,7 +90689,8 @@ function githubApiFactory(requestService) {
90085
90689
  deleteProject,
90086
90690
  validateConfigFile,
90087
90691
  getProject,
90088
- getProjects
90692
+ getProjects,
90693
+ disconnectAccount
90089
90694
  };
90090
90695
  }
90091
90696
 
@@ -90265,6 +90870,19 @@ function publishApiFactory(requestService) {
90265
90870
  schema: external_exports.object({ publishUid: nanoidSchema })
90266
90871
  });
90267
90872
  }
90873
+ async function publishDocsProject({ slug, configPath, preview, commitSha }) {
90874
+ return await requestService.request({
90875
+ url: "publish-deploy/publish/docs-project",
90876
+ method: "post",
90877
+ data: {
90878
+ slug,
90879
+ configPath,
90880
+ preview,
90881
+ commitSha
90882
+ },
90883
+ schema: external_exports.object({ publishUid: nanoidSchema })
90884
+ });
90885
+ }
90268
90886
  async function publishWysiwyg(uid) {
90269
90887
  return await requestService.request({
90270
90888
  url: "publish-deploy/publish/wysiwyg",
@@ -90290,6 +90908,45 @@ function publishApiFactory(requestService) {
90290
90908
  schema: external_exports.object({ publishUid: nanoidSchema })
90291
90909
  });
90292
90910
  }
90911
+ async function createPreviewSandbox() {
90912
+ return await requestService.request({
90913
+ url: "publish-deploy/preview-sandbox",
90914
+ method: "post",
90915
+ schema: external_exports.object({
90916
+ sandboxId: external_exports.string(),
90917
+ gitUrl: external_exports.string()
90918
+ })
90919
+ });
90920
+ }
90921
+ async function startPreviewSandboxServer({ sandboxId, configPath }) {
90922
+ return await requestService.request({
90923
+ url: "publish-deploy/preview-sandbox/start-server",
90924
+ method: "post",
90925
+ data: { sandboxId, configPath },
90926
+ schema: external_exports.object({
90927
+ previewUrl: external_exports.string()
90928
+ })
90929
+ });
90930
+ }
90931
+ async function stopPreviewSandbox({ sandboxId, keepalive }) {
90932
+ return await requestService.request({
90933
+ url: "publish-deploy/preview-sandbox/stop",
90934
+ method: "post",
90935
+ data: { sandboxId },
90936
+ schema: external_exports.null(),
90937
+ ...keepalive && { keepalive: true }
90938
+ });
90939
+ }
90940
+ async function getPreviewSandboxLog({ sandboxId }) {
90941
+ return await requestService.request({
90942
+ url: "publish-deploy/preview-sandbox/log",
90943
+ method: "post",
90944
+ data: { sandboxId },
90945
+ schema: external_exports.object({
90946
+ log: external_exports.string().nullable()
90947
+ })
90948
+ });
90949
+ }
90293
90950
  async function checkDNSRecords(domain2) {
90294
90951
  return await requestService.request({
90295
90952
  url: "core/publish/dns-check",
@@ -90323,6 +90980,16 @@ function publishApiFactory(requestService) {
90323
90980
  schema: external_exports.null()
90324
90981
  });
90325
90982
  }
90983
+ async function cancelPublish(publishUid) {
90984
+ return await requestService.request({
90985
+ url: "core/publish/cancel",
90986
+ method: "post",
90987
+ data: {
90988
+ publishUid
90989
+ },
90990
+ schema: external_exports.null()
90991
+ });
90992
+ }
90326
90993
  async function deleteRecord(publishUid) {
90327
90994
  return await requestService.request({
90328
90995
  url: "core/publish",
@@ -90404,14 +91071,20 @@ function publishApiFactory(requestService) {
90404
91071
  }
90405
91072
  return {
90406
91073
  publishCli,
91074
+ publishDocsProject,
90407
91075
  publishGithub: publishGithub2,
90408
91076
  publishTemplate,
90409
91077
  publishWysiwyg,
91078
+ createPreviewSandbox,
91079
+ startPreviewSandboxServer,
91080
+ stopPreviewSandbox,
91081
+ getPreviewSandboxLog,
90410
91082
  exportWysiwyg,
90411
91083
  checkDNSRecords,
90412
91084
  unpublish,
90413
91085
  deleteRecord,
90414
91086
  redeploy,
91087
+ cancelPublish,
90415
91088
  bulkDelete,
90416
91089
  getPublishLogs,
90417
91090
  getDomainAvailability,
@@ -90780,8 +91453,10 @@ var apiServiceFactory = (baseUrl, getAuthToken, getNewTokens) => {
90780
91453
  hocuspocus: hocuspocusApiFactory(requestService),
90781
91454
  publish: publishApiFactory(requestService),
90782
91455
  github: githubApiFactory(requestService),
91456
+ bitbucket: bitbucketApiFactory(requestService),
90783
91457
  signup: signupApiFactory(requestService),
90784
91458
  project: projectApiFactory(requestService),
91459
+ docsProject: docsProjectApiFactory(requestService),
90785
91460
  managedDocs: managedDocsApiFactory(requestService),
90786
91461
  managedSchemas: managedSchemasApiFactory(requestService),
90787
91462
  rules: rulesApiFactory(requestService),
@@ -90790,7 +91465,8 @@ var apiServiceFactory = (baseUrl, getAuthToken, getNewTokens) => {
90790
91465
  loginPortals: loginPortalsApiFactory(requestService),
90791
91466
  sdks: sdksApiFactory(requestService),
90792
91467
  waitlist: waitlistApiFactory(requestService),
90793
- workspace: workspaceApiFactory(requestService)
91468
+ workspace: workspaceApiFactory(requestService),
91469
+ analytics: analyticsApiFactory(requestService)
90794
91470
  };
90795
91471
  };
90796
91472
 
@@ -90811,7 +91487,7 @@ var config2 = {
90811
91487
  }
90812
91488
  },
90813
91489
  cdnUrl: process.env.CDN_URL ?? "https://cdn.scalar.com",
90814
- ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.4.0"
91490
+ ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.4.2"
90815
91491
  };
90816
91492
 
90817
91493
  // src/domains/auth/login/helpers/personal-token-generate-access.ts
@@ -90975,7 +91651,7 @@ var setMetadata = async (metadata) => {
90975
91651
  JSON.stringify({ ...currentMetadata, ...metadata })
90976
91652
  );
90977
91653
  };
90978
- var fileExists = async (path12) => !!await fs.stat(path12).catch(() => false);
91654
+ var fileExists = async (path13) => !!await fs.stat(path13).catch(() => false);
90979
91655
  var getMetadata = async () => {
90980
91656
  const metadata = await fileExists(METADATA_FILE_PATH) ? await fs.readFile(METADATA_FILE_PATH, { encoding: "utf-8" }) : "{}";
90981
91657
  try {
@@ -91615,7 +92291,7 @@ var printSpecificationBanner = (result) => {
91615
92291
  }
91616
92292
  const pathsCount = Object.keys(schema.paths ?? {}).length;
91617
92293
  const operationsCount = Object.values(schema.paths ?? {}).reduce(
91618
- (acc, path12) => acc + Object.keys(path12).length,
92294
+ (acc, path13) => acc + Object.keys(path13).length,
91619
92295
  0
91620
92296
  );
91621
92297
  output.info().title(
@@ -91754,8 +92430,8 @@ function BundleCommand() {
91754
92430
  }
91755
92431
 
91756
92432
  // src/domains/registry/helpers/links.ts
91757
- function registryUrl(path12) {
91758
- return `${config2.projects.registry}/${path12}`;
92433
+ function registryUrl(path13) {
92434
+ return `${config2.projects.registry}/${path13}`;
91759
92435
  }
91760
92436
 
91761
92437
  // src/domains/schema/helpers/links.ts
@@ -92605,16 +93281,16 @@ import { Command as Command17 } from "commander";
92605
93281
  import { join, normalize as normalize2 } from "@scalar/openapi-parser";
92606
93282
 
92607
93283
  // src/domains/document/join/helpers.ts
92608
- var getValueByPath = (input, path12) => {
92609
- return path12.reduce((acc, segment) => {
93284
+ var getValueByPath = (input, path13) => {
93285
+ return path13.reduce((acc, segment) => {
92610
93286
  if (acc && typeof acc === "object" && acc !== null && segment in acc) {
92611
93287
  return acc[segment];
92612
93288
  }
92613
93289
  return void 0;
92614
93290
  }, input);
92615
93291
  };
92616
- var getPrefixes = (documents, path12) => {
92617
- const segments = path12.split(".");
93292
+ var getPrefixes = (documents, path13) => {
93293
+ const segments = path13.split(".");
92618
93294
  return documents.map((doc) => {
92619
93295
  const value = getValueByPath(doc, segments);
92620
93296
  if (value === void 0) {
@@ -92925,16 +93601,16 @@ var printAvailablePaths = (specification) => {
92925
93601
  if (specification?.paths === void 0 || Object.keys(specification?.paths).length === 0) {
92926
93602
  output.warn().title(as17.grey("Could not find any paths in the OpenAPI file.")).print();
92927
93603
  }
92928
- for (const path12 in specification?.paths ?? []) {
92929
- if (specification?.paths?.[path12] === void 0) {
93604
+ for (const path13 in specification?.paths ?? []) {
93605
+ if (specification?.paths?.[path13] === void 0) {
92930
93606
  continue;
92931
93607
  }
92932
- for (const method in specification.paths[path12]) {
92933
- if (specification.paths[path12][method] === void 0) {
93608
+ for (const method in specification.paths[path13]) {
93609
+ if (specification.paths[path13][method] === void 0) {
92934
93610
  continue;
92935
93611
  }
92936
93612
  output.info().line(
92937
- `${as17[getMethodColor(method)].bold(method.toUpperCase().padEnd(6))} ${as17.grey(`${path12}`)}`
93613
+ `${as17[getMethodColor(method)].bold(method.toUpperCase().padEnd(6))} ${as17.grey(`${path13}`)}`
92938
93614
  ).print();
92939
93615
  }
92940
93616
  }
@@ -93425,12 +94101,12 @@ documentCommands.forEach((command) => documentDomain.addCommand(command()));
93425
94101
  var document_default = documentDomain;
93426
94102
 
93427
94103
  // src/domains/project/index.ts
93428
- import { Command as Command36 } from "commander";
94104
+ import { Command as Command37 } from "commander";
93429
94105
 
93430
94106
  // src/domains/project/preview/index.ts
93431
94107
  import { text as text4 } from "@clack/prompts";
93432
94108
  import as27 from "ansis";
93433
- import { Command as Command31 } from "commander";
94109
+ import { Command as Command32 } from "commander";
93434
94110
 
93435
94111
  // src/domains/project/check-config/index.ts
93436
94112
  import fs12 from "node:fs";
@@ -93794,768 +94470,47 @@ var internalLinkNavigationEntrySchema = linkNavigationEntrySchema.extend({
93794
94470
  uid: nanoidSchema
93795
94471
  });
93796
94472
 
93797
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/api-reference/api-client-plugin.js
93798
- var sectionViewSchema = external_exports.object({
93799
- title: external_exports.string().optional(),
93800
- // Since this is meant to be a Vue component, we'll use unknown
93801
- component: external_exports.unknown(),
93802
- props: external_exports.record(external_exports.string(), external_exports.any()).optional()
93803
- });
93804
- var viewsSchema = external_exports.object({
93805
- "request.section": external_exports.array(sectionViewSchema).optional(),
93806
- "response.section": external_exports.array(sectionViewSchema).optional()
93807
- });
93808
- var hooksSchema = external_exports.object({
93809
- onBeforeRequest: external_exports.function({
93810
- input: [external_exports.object({ request: external_exports.any() })]
93811
- // Why no output? https://github.com/scalar/scalar/pull/7047
93812
- // output: z.union([z.void(), z.promise(z.void())]),
93813
- }).optional(),
93814
- onResponseReceived: external_exports.function({
93815
- input: [external_exports.object({ response: external_exports.instanceof(Response), operation: external_exports.record(external_exports.string(), external_exports.any()) })]
93816
- // Why no output? https://github.com/scalar/scalar/pull/7047
93817
- // output: z.union([z.void(), z.promise(z.void())]),
93818
- }).optional()
93819
- });
93820
- var apiClientPluginSchema = external_exports.function({
93821
- input: [],
93822
- output: external_exports.object({
93823
- name: external_exports.string(),
93824
- views: viewsSchema.optional(),
93825
- hooks: hooksSchema.optional()
93826
- })
94473
+ // ../../packages/scalar-config/dist/schema/ruleset.js
94474
+ var blockPublishOnSchema2 = external_exports.enum(["error", "warning", "info", "hint", "none"]).describe("Severity threshold at or above which ruleset findings block publishing.");
94475
+ var rulesetConfigSchema = external_exports.object({
94476
+ filepath: external_exports.string().optional().describe("Relative path to the Spectral ruleset file with respect to the configuration root."),
94477
+ slug: external_exports.string().optional().describe("Slug of the ruleset in the team registry."),
94478
+ namespace: external_exports.string().optional().describe("Namespace of the ruleset in the team registry."),
94479
+ version: external_exports.string().optional().describe("Version of the ruleset in the team registry."),
94480
+ disableSync: external_exports.boolean().optional().describe("When `filepath` is set alongside registry coordinates, skip auto-publishing the ruleset to the team registry on docs publish."),
94481
+ blockPublishOn: blockPublishOnSchema2.optional().describe("Override the registry ruleset policy for this scope. Falls back to the registry ruleset record when omitted.")
93827
94482
  });
93828
94483
 
93829
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/api-reference/base-configuration.js
93830
- var externalUrlsSchema = zod_default.object({
93831
- dashboardUrl: zod_default.string().prefault("https://dashboard.scalar.com"),
93832
- registryUrl: zod_default.string().prefault("https://registry.scalar.com"),
93833
- proxyUrl: zod_default.string().prefault("https://proxy.scalar.com"),
93834
- apiBaseUrl: zod_default.string().prefault("https://api.scalar.com")
93835
- });
93836
- var OLD_PROXY_URL = "https://api.scalar.com/request-proxy";
93837
- var NEW_PROXY_URL = "https://proxy.scalar.com";
93838
- var baseConfigurationSchema = zod_default.object({
93839
- /**
93840
- * The title of the OpenAPI document.
93841
- *
93842
- * @example 'Scalar Galaxy'
93843
- */
93844
- title: zod_default.string().optional(),
93845
- /**
93846
- * The slug of the OpenAPI document used in the URL.
93847
- *
93848
- * If none is passed, the title will be used.
93849
- *
93850
- * If no title is used, it'll just use the index.
93851
- *
93852
- * @example 'scalar-galaxy'
93853
- */
93854
- slug: zod_default.string().optional(),
93855
- /** Prefill authentication */
93856
- authentication: zod_default.any().optional(),
93857
- // Temp until we bring in the new auth
93858
- /** Base URL for the API server */
93859
- baseServerURL: zod_default.string().optional(),
93860
- /**
93861
- * Whether to hide the client button
93862
- * @default false
93863
- */
93864
- hideClientButton: zod_default.boolean().optional().default(false).catch(false),
93865
- /** URL to a request proxy for the API client */
93866
- proxyUrl: zod_default.string().optional(),
93867
- /**
93868
- * Default OAuth 2.0 redirect URI used to prefill auth flows in the API client.
93869
- *
93870
- * This is especially useful in desktop wrappers (for example Electron),
93871
- * where `window.location` can be a `file://` URL that OAuth providers reject.
93872
- */
93873
- oauth2RedirectUri: zod_default.string().optional(),
93874
- /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
93875
- searchHotKey: zod_default.enum([
93876
- "a",
93877
- "b",
93878
- "c",
93879
- "d",
93880
- "e",
93881
- "f",
93882
- "g",
93883
- "h",
93884
- "i",
93885
- "j",
93886
- "k",
93887
- "l",
93888
- "m",
93889
- "n",
93890
- "o",
93891
- "p",
93892
- "q",
93893
- "r",
93894
- "s",
93895
- "t",
93896
- "u",
93897
- "v",
93898
- "w",
93899
- "x",
93900
- "y",
93901
- "z"
93902
- ]).optional(),
93903
- /** List of OpenAPI server objects */
93904
- servers: zod_default.array(zod_default.any()).optional(),
93905
- // Using any for OpenAPIV3_1.ServerObject
93906
- /**
93907
- * Whether to show the sidebar
93908
- * @default true
93909
- */
93910
- showSidebar: zod_default.boolean().optional().default(true).catch(true),
93911
- /**
93912
- * Whether and when to show the developer tools.
93913
- *
93914
- * @default 'localhost' to only show the toolbar on localhost or similar hosts
93915
- */
93916
- showDeveloperTools: zod_default.enum(["always", "localhost", "never"]).optional().default("localhost").catch("localhost"),
93917
- /**
93918
- * Sets the visibility of the developer tools
93919
- * @default 'localhost' to only show the toolbar on localhost or similar hosts
93920
- * @deprecated Use showDeveloperTools instead
93921
- */
93922
- showToolbar: zod_default.enum(["always", "localhost", "never"]).optional().default("localhost").catch("localhost"),
93923
- /**
93924
- * Whether to use the operation summary or the operation path for the sidebar and search
93925
- * @default 'summary'
93926
- */
93927
- operationTitleSource: zod_default.enum(["summary", "path"]).optional().default("summary").catch("summary"),
93928
- /** A string to use one of the color presets */
93929
- theme: zod_default.enum([
93930
- "alternate",
93931
- "default",
93932
- "moon",
93933
- "purple",
93934
- "solarized",
93935
- "bluePlanet",
93936
- "deepSpace",
93937
- "saturn",
93938
- "kepler",
93939
- "elysiajs",
93940
- "fastify",
93941
- "mars",
93942
- "laserwave",
93943
- "none"
93944
- ]).optional().default("default").catch("default"),
93945
- /** Integration type identifier */
93946
- _integration: zod_default.enum([
93947
- "adonisjs",
93948
- "astro",
93949
- "docusaurus",
93950
- "dotnet",
93951
- "elysiajs",
93952
- "express",
93953
- "fastapi",
93954
- "fastify",
93955
- "go",
93956
- "hono",
93957
- "html",
93958
- "laravel",
93959
- "litestar",
93960
- "nestjs",
93961
- "nextjs",
93962
- "nitro",
93963
- "nuxt",
93964
- "platformatic",
93965
- "react",
93966
- "rust",
93967
- "svelte",
93968
- "vue"
93969
- ]).nullable().optional(),
93970
- /** onRequestSent is fired when a request is sent */
93971
- onRequestSent: zod_default.function({
93972
- input: [zod_default.string()],
93973
- output: zod_default.void()
93974
- }).optional(),
93975
- /** Whether to persist auth to local storage */
93976
- persistAuth: zod_default.boolean().optional().default(false).catch(false),
93977
- /** Plugins for the API client */
93978
- plugins: zod_default.array(apiClientPluginSchema).optional(),
93979
- /** Enables / disables telemetry */
93980
- telemetry: zod_default.boolean().optional().default(true),
93981
- /** A bunch of external URLs to Scalar's services. */
93982
- externalUrls: externalUrlsSchema.prefault({})
93983
- });
93984
-
93985
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/api-reference/source-configuration.js
93986
- var sourceConfigurationSchema = zod_default.object({
93987
- default: zod_default.boolean().default(false).optional().catch(false),
93988
- /**
93989
- * URL to an OpenAPI/Swagger document
93990
- * @example
93991
- * ```ts
93992
- * const oldConfiguration = {
93993
- * spec: {
93994
- * url: 'https://example.com/openapi.json',
93995
- * },
93996
- * }
93997
- *
93998
- * const newConfiguration = {
93999
- * url: 'https://example.com/openapi.json',
94000
- * }
94001
- * ```
94002
- **/
94003
- url: zod_default.string().optional(),
94004
- /**
94005
- * Directly embed the OpenAPI document.
94006
- * Can be a string, object, function returning an object, or null.
94007
- *
94008
- * @remarks It's recommended to pass a URL instead of content.
94009
- * @example
94010
- * ```ts
94011
- * const oldConfiguration = {
94012
- * spec: {
94013
- * content: '…',
94014
- * },
94015
- * }
94016
- *
94017
- * const newConfiguration = {
94018
- * content: '…',
94019
- * }
94020
- * ```
94021
- **/
94022
- content: zod_default.union([
94023
- zod_default.string(),
94024
- zod_default.null(),
94025
- zod_default.record(zod_default.string(), zod_default.any()),
94026
- zod_default.function({
94027
- input: [],
94028
- output: zod_default.record(zod_default.string(), zod_default.any())
94029
- })
94030
- ]).optional(),
94031
- /**
94032
- * The title of the OpenAPI document.
94033
- *
94034
- * @example 'Scalar Galaxy'
94035
- *
94036
- * @deprecated Please move `title` to the top level and remove the `spec` prefix.
94037
- */
94038
- title: zod_default.string().optional(),
94039
- /**
94040
- * The slug of the OpenAPI document used in the URL.
94041
- *
94042
- * If none is passed, the title will be used.
94043
- *
94044
- * If no title is used, it'll just use the index.
94045
- *
94046
- * @example 'scalar-galaxy'
94047
- *
94048
- * @deprecated Please move `slug` to the top level and remove the `spec` prefix.
94049
- */
94050
- slug: zod_default.string().optional(),
94051
- /**
94052
- * The OpenAPI/Swagger document to render
94053
- *
94054
- * @deprecated Use `url` and `content` on the top level instead.
94055
- **/
94056
- spec: zod_default.object({
94057
- url: zod_default.string().optional(),
94058
- content: zod_default.union([
94059
- zod_default.string(),
94060
- zod_default.null(),
94061
- zod_default.record(zod_default.string(), zod_default.any()),
94062
- zod_default.function({
94063
- input: [],
94064
- output: zod_default.record(zod_default.string(), zod_default.any())
94065
- })
94066
- ]).optional()
94067
- }).optional(),
94068
- /**
94069
- * Agent Scalar configuration
94070
- **/
94071
- agent: zod_default.object({
94072
- key: zod_default.string().optional(),
94073
- disabled: zod_default.boolean().optional(),
94074
- /**
94075
- * When true, hide the control to add more APIs in the agent chat.
94076
- * Only preloaded/registry documents are shown; the public API list is not offered.
94077
- */
94078
- hideAddApi: zod_default.boolean().optional()
94079
- }).optional()
94080
- });
94081
-
94082
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/api-reference/api-client-configuration.js
94083
- var apiClientConfigurationSchema = baseConfigurationSchema.extend(sourceConfigurationSchema.shape);
94084
-
94085
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/api-reference/api-reference-plugin.js
94086
- var openApiExtensionSchema = external_exports.object({
94087
- /**
94088
- * Name of specification extension property. Has to start with `x-`.
94089
- *
94090
- * @example
94091
- * ```yaml
94092
- * x-custom-extension: foobar
94093
- * ```
94094
- */
94095
- name: external_exports.string().regex(/^x-/),
94096
- /**
94097
- * Vue component to render the specification extension
94098
- */
94099
- component: external_exports.unknown(),
94100
- /**
94101
- * Custom renderer to render the specification extension
94102
- */
94103
- renderer: external_exports.unknown().optional()
94104
- });
94105
- var viewComponentSchema = external_exports.object({
94106
- /**
94107
- * Vue component to render in the view
94108
- */
94109
- component: external_exports.unknown(),
94110
- /**
94111
- * Custom renderer to render the view component (e.g., ReactRenderer)
94112
- */
94113
- renderer: external_exports.unknown().optional(),
94114
- /**
94115
- * Additional props to pass to the component
94116
- */
94117
- props: external_exports.record(external_exports.string(), external_exports.any()).optional()
94118
- });
94119
- var viewsSchema2 = external_exports.object({
94120
- /**
94121
- * Renders after the Models section
94122
- */
94123
- "content.end": external_exports.array(viewComponentSchema).optional()
94124
- });
94125
- var lifecycleHooksSchema = external_exports.object({
94126
- /** Called when the API Reference is initialized */
94127
- onInit: external_exports.function({
94128
- input: [external_exports.object({ config: baseConfigurationSchema.partial() })]
94129
- }).optional(),
94130
- /** Called when the API Reference configuration changes */
94131
- onConfigChange: external_exports.function({
94132
- input: [external_exports.object({ config: baseConfigurationSchema.partial() })]
94133
- }).optional(),
94134
- /** Called when the API Reference is destroyed */
94135
- onDestroy: external_exports.function({ input: [] }).optional()
94136
- });
94137
- var apiReferencePluginSchema = external_exports.function({
94138
- input: [],
94139
- output: external_exports.object({
94140
- name: external_exports.string(),
94141
- extensions: external_exports.array(openApiExtensionSchema),
94142
- /**
94143
- * Components to render at specific views in the API Reference
94144
- */
94145
- views: viewsSchema2.optional(),
94146
- /**
94147
- * Lifecycle hooks for the plugin
94148
- */
94149
- hooks: lifecycleHooksSchema.optional(),
94150
- /**
94151
- * Client plugins to pass to the embedded API client.
94152
- * Use this to extend the API client from an API reference plugin.
94153
- */
94154
- apiClientPlugins: external_exports.array(external_exports.any()).optional()
94155
- })
94484
+ // ../../packages/scalar-config/dist/schema/navigation/openapi.js
94485
+ var httpClientSchema = external_exports.object({
94486
+ targetKey: external_exports.string(),
94487
+ clientKey: external_exports.string()
94156
94488
  });
94157
-
94158
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/api-reference/api-reference-configuration.js
94159
- var fetchLikeSchema = external_exports.custom();
94160
- var apiReferenceConfigurationSchema = baseConfigurationSchema.extend({
94161
- /**
94162
- * The layout to use for the references
94163
- * @default 'modern'
94164
- */
94165
- layout: external_exports.enum(["modern", "classic"]).optional().default("modern").catch("modern"),
94166
- /**
94167
- * URL to a request proxy for the API client
94168
- * @deprecated Use proxyUrl instead
94169
- */
94170
- proxy: external_exports.string().optional(),
94171
- /**
94172
- * Custom fetch function for custom logic
94173
- *
94174
- * Can be used to add custom headers, handle auth, etc.
94175
- */
94176
- fetch: fetchLikeSchema.optional(),
94177
- /**
94178
- * Plugins for the API reference
94179
- */
94180
- plugins: external_exports.array(apiReferencePluginSchema).optional(),
94181
- /**
94182
- * Allows the user to inject an editor for the spec
94183
- * @default false
94184
- */
94185
- isEditable: external_exports.boolean().optional().default(false).catch(false),
94186
- /**
94187
- * Controls whether the references show a loading state in the intro
94188
- * @default false
94189
- */
94190
- isLoading: external_exports.boolean().optional().default(false).catch(false),
94191
- /**
94192
- * Whether to show models in the sidebar, search, and content.
94193
- * @default false
94194
- */
94195
- hideModels: external_exports.boolean().optional().default(false).catch(false),
94196
- /**
94197
- * Sets the file type of the document to download, set to `none` to hide the download button
94198
- * @default 'both'
94199
- */
94200
- documentDownloadType: external_exports.enum(["yaml", "json", "both", "direct", "none"]).optional().default("both").catch("both"),
94201
- /**
94202
- * Whether to show the "Download OpenAPI Document" button
94203
- * @default false
94204
- * @deprecated Use `documentDownloadType: 'none'` instead
94205
- */
94489
+ var hiddenClientsSchema = external_exports.union([
94490
+ external_exports.record(external_exports.string(), external_exports.union([external_exports.boolean(), external_exports.string().array()])),
94491
+ external_exports.string().array(),
94492
+ external_exports.literal(true)
94493
+ ]);
94494
+ var scopedApiConfigSchema = external_exports.object({
94495
+ authentication: external_exports.custom().optional(),
94496
+ expandAllResponses: external_exports.boolean().default(false),
94497
+ expandAllModelSections: external_exports.boolean().default(false),
94498
+ defaultOpenAllTags: external_exports.boolean().default(false),
94499
+ defaultHttpClient: httpClientSchema.optional(),
94500
+ hiddenClients: hiddenClientsSchema.optional(),
94501
+ showOperationId: external_exports.boolean().default(false),
94502
+ hideTestRequestButton: external_exports.boolean().default(false),
94206
94503
  hideDownloadButton: external_exports.boolean().optional(),
94207
- /**
94208
- * Whether to show the "Test Request" button
94209
- * @default false
94210
- */
94211
- hideTestRequestButton: external_exports.boolean().optional().default(false).catch(false),
94212
- /**
94213
- * Whether to show the sidebar search bar
94214
- * @default false
94215
- */
94216
- hideSearch: external_exports.boolean().optional().default(false).catch(false),
94217
- /**
94218
- * Whether to show the operationId
94219
- *
94220
- * @default false
94221
- */
94222
- showOperationId: external_exports.boolean().optional().default(false).catch(false),
94223
- /** Whether dark mode is on or off initially (light mode) */
94224
- darkMode: external_exports.boolean().optional(),
94225
- /** forceDarkModeState makes it always this state no matter what */
94226
- forceDarkModeState: external_exports.enum(["dark", "light"]).optional(),
94227
- /**
94228
- * Whether to show the dark mode toggle
94229
- * @default false
94230
- */
94231
- hideDarkModeToggle: external_exports.boolean().optional().default(false).catch(false),
94232
- /**
94233
- * If used, passed data will be added to the HTML header
94234
- * @see https://unhead.unjs.io/usage/composables/use-seo-meta
94235
- */
94236
- metaData: external_exports.any().optional(),
94237
- // Using any for UseSeoMetaInput since it's an external type
94238
- /**
94239
- * Path to a favicon image
94240
- * @default undefined
94241
- * @example '/favicon.svg'
94242
- */
94243
- favicon: external_exports.string().optional(),
94244
- /**
94245
- * List of httpsnippet clients to hide from the clients menu
94246
- * By default hides Unirest, pass `[]` to show all clients
94247
- */
94248
- hiddenClients: external_exports.union([external_exports.record(external_exports.string(), external_exports.union([external_exports.boolean(), external_exports.array(external_exports.string())])), external_exports.array(external_exports.string()), external_exports.literal(true)]).optional(),
94249
- /** Determine the HTTP client that's selected by default */
94250
- defaultHttpClient: external_exports.object({
94251
- targetKey: external_exports.custom(),
94252
- clientKey: external_exports.string()
94253
- }).optional(),
94254
- /** Custom CSS to be added to the page */
94255
- customCss: external_exports.string().optional(),
94256
- /** onSpecUpdate is fired on spec/swagger content change */
94257
- onSpecUpdate: external_exports.function({
94258
- input: [external_exports.string()],
94259
- output: external_exports.void()
94260
- }).optional(),
94261
- /** onServerChange is fired on selected server change */
94262
- onServerChange: external_exports.function({
94263
- input: [external_exports.string()],
94264
- output: external_exports.void()
94265
- }).optional(),
94266
- /** onDocumentSelect is fired when the config is selected */
94267
- onDocumentSelect: external_exports.function({
94268
- input: []
94269
- // Why no output? https://github.com/scalar/scalar/pull/7047
94270
- // output: z.union([z.void(), z.promise(z.void())]),
94271
- }).optional(),
94272
- /** Callback fired when the reference is fully loaded */
94273
- onLoaded: external_exports.function().optional(),
94274
- /** Fired before the outbound request is built; callback receives a mutable request builder (RequestFactory). Experimental API. */
94275
- onBeforeRequest: external_exports.function({
94276
- input: [
94277
- external_exports.object({
94278
- request: external_exports.instanceof(Request),
94279
- requestBuilder: external_exports.unknown(),
94280
- envVariables: external_exports.record(external_exports.string(), external_exports.string())
94281
- })
94282
- ]
94283
- // Why no output? https://github.com/scalar/scalar/pull/7047
94284
- // output: z.union([z.void(), z.promise(z.void())]),
94285
- }).optional(),
94286
- /**
94287
- * onShowMore is fired when the user clicks the "Show more" button on the references
94288
- * @param tagId - The ID of the tag that was clicked
94289
- */
94290
- onShowMore: external_exports.function({
94291
- input: [external_exports.string()]
94292
- // Why no output? https://github.com/scalar/scalar/pull/7047
94293
- // output: z.union([z.void(), z.promise(z.void())]),
94294
- }).optional(),
94295
- /**
94296
- * onSidebarClick is fired when the user clicks on a sidebar item
94297
- * @param href - The href of the sidebar item that was clicked
94298
- */
94299
- onSidebarClick: external_exports.function({
94300
- input: [external_exports.string()]
94301
- // Why no output? https://github.com/scalar/scalar/pull/7047
94302
- // output: z.union([z.void(), z.promise(z.void())]),
94303
- }).optional(),
94304
- /**
94305
- * Route using paths instead of hashes, your server MUST support this
94306
- * @example '/standalone-api-reference/:custom(.*)?'
94307
- * @experimental
94308
- * @default undefined
94309
- */
94310
- pathRouting: external_exports.object({
94311
- basePath: external_exports.string()
94312
- }).optional(),
94313
- /**
94314
- * MCP (Model Context Protocol) configuration
94315
- * Optional. When provided, enables MCP integration with the given name and url.
94316
- */
94317
- mcp: external_exports.object({
94318
- /** Display name for the MCP server */
94319
- name: external_exports.string().optional(),
94320
- /** URL of the MCP server */
94321
- url: external_exports.string().optional(),
94322
- /** When true, disables the MCP integration */
94323
- disabled: external_exports.boolean().optional()
94324
- }).optional(),
94325
- /**
94326
- * Customize the heading portion of the hash
94327
- * @param heading - The heading object
94328
- * @returns A string ID used to generate the URL hash
94329
- * @default (heading) => `#description/${heading.slug}`
94330
- */
94331
- generateHeadingSlug: external_exports.function({
94332
- input: [external_exports.object({ slug: external_exports.string().default("headingSlug") })],
94333
- output: external_exports.string()
94334
- }).optional(),
94335
- /**
94336
- * Customize the model portion of the hash
94337
- * @param model - The model object with a name property
94338
- * @returns A string ID used to generate the URL hash
94339
- * @default (model) => slug(model.name)
94340
- */
94341
- generateModelSlug: external_exports.function({
94342
- input: [external_exports.object({ name: external_exports.string().default("modelName") })],
94343
- output: external_exports.string()
94344
- }).optional(),
94345
- /**
94346
- * Customize the tag portion of the hash
94347
- * @param tag - The tag object
94348
- * @returns A string ID used to generate the URL hash
94349
- * @default (tag) => slug(tag.name)
94350
- */
94351
- generateTagSlug: external_exports.function({
94352
- input: [external_exports.object({ name: external_exports.string().default("tagName") })],
94353
- output: external_exports.string()
94354
- }).optional(),
94355
- /**
94356
- * Customize the operation portion of the hash
94357
- * @param operation - The operation object
94358
- * @returns A string ID used to generate the URL hash
94359
- * @default (operation) => `${operation.method}${operation.path}`
94360
- */
94361
- generateOperationSlug: external_exports.function({
94362
- input: [
94363
- external_exports.object({
94364
- path: external_exports.string(),
94365
- operationId: external_exports.string().optional(),
94366
- method: external_exports.string(),
94367
- summary: external_exports.string().optional()
94368
- })
94369
- ],
94370
- output: external_exports.string()
94371
- }).optional(),
94372
- /**
94373
- * Customize the webhook portion of the hash
94374
- * @param webhook - The webhook object
94375
- * @returns A string ID used to generate the URL hash
94376
- * @default (webhook) => slug(webhook.name)
94377
- */
94378
- generateWebhookSlug: external_exports.function({
94379
- input: [
94380
- external_exports.object({
94381
- name: external_exports.string(),
94382
- method: external_exports.string().optional()
94383
- })
94384
- ],
94385
- output: external_exports.string()
94386
- }).optional(),
94387
- /**
94388
- * To handle redirects, pass a function that will receive:
94389
- * - The current path with hash if pathRouting is enabled
94390
- * - The current hash if hashRouting (default)
94391
- * And then passes that to history.replaceState
94392
- *
94393
- * @example hashRouting (default)
94394
- * ```ts
94395
- * redirect: (hash: string) => hash.replace('#v1/old-path', '#v2/new-path')
94396
- * ```
94397
- * @example pathRouting
94398
- * ```ts
94399
- * redirect: (pathWithHash: string) => {
94400
- * if (pathWithHash.includes('#')) {
94401
- * return pathWithHash.replace('/v1/tags/user#operation/get-user', '/v1/tags/user/operation/get-user')
94402
- * }
94403
- * return null
94404
- * }
94405
- * ```
94406
- */
94407
- redirect: external_exports.function({
94408
- input: [external_exports.string()],
94409
- output: external_exports.string().nullable().optional()
94410
- }).optional(),
94411
- /**
94412
- * Whether to include default fonts
94413
- * @default true
94414
- */
94415
- withDefaultFonts: external_exports.boolean().optional().default(true).catch(true),
94416
- /**
94417
- * Whether to expand the first tag in the sidebar when no specific URL target is present
94418
- * @default true
94419
- */
94420
- defaultOpenFirstTag: external_exports.boolean().optional().default(true).catch(true),
94421
- /**
94422
- * Whether to expand all tags by default
94423
- *
94424
- * Warning this can cause performance issues on big documents
94425
- * @default false
94426
- */
94427
- defaultOpenAllTags: external_exports.boolean().optional().default(false).catch(false),
94428
- /**
94429
- * Whether to expand all models by default
94430
- *
94431
- * Warning this can cause performance issues on big documents
94432
- * @default false
94433
- */
94434
- expandAllModelSections: external_exports.boolean().optional().default(false).catch(false),
94435
- /**
94436
- * Whether to expand all responses by default
94437
- *
94438
- * Warning this can cause performance issues on big documents
94439
- * @default false
94440
- */
94441
- expandAllResponses: external_exports.boolean().optional().default(false).catch(false),
94442
- /**
94443
- * Function to sort tags
94444
- * @default 'alpha' for alphabetical sorting
94445
- */
94446
- tagsSorter: external_exports.union([
94447
- external_exports.literal("alpha"),
94448
- external_exports.function({
94449
- input: [external_exports.any(), external_exports.any()],
94450
- output: external_exports.number()
94451
- })
94452
- ]).optional(),
94453
- /**
94454
- * Function to sort operations
94455
- * @default 'alpha' for alphabetical sorting
94456
- */
94457
- operationsSorter: external_exports.union([
94458
- external_exports.literal("alpha"),
94459
- external_exports.literal("method"),
94460
- external_exports.function({
94461
- input: [external_exports.any(), external_exports.any()],
94462
- output: external_exports.number()
94463
- })
94464
- ]).optional(),
94465
- /**
94466
- * Order the schema properties by
94467
- * @default 'alpha' for alphabetical sorting
94468
- */
94469
- orderSchemaPropertiesBy: external_exports.union([external_exports.literal("alpha"), external_exports.literal("preserve")]).optional().default("alpha").catch("alpha"),
94470
- /**
94471
- * Sort the schema properties by required ones first
94472
- * @default true
94473
- */
94474
- orderRequiredPropertiesFirst: external_exports.boolean().optional().default(true).catch(true)
94475
- });
94476
- var apiReferenceConfigurationWithSourceSchema = apiReferenceConfigurationSchema.extend(sourceConfigurationSchema.shape).transform((configuration) => {
94477
- if (configuration.hideDownloadButton) {
94478
- console.warn(`[DEPRECATED] You're using the deprecated 'hideDownloadButton' attribute. Use 'documentDownloadType: 'none'' instead.`);
94479
- configuration.documentDownloadType = "none";
94480
- }
94481
- if (configuration.spec?.url) {
94482
- console.warn(`[DEPRECATED] You're using the deprecated 'spec.url' attribute. Remove the spec prefix and move the 'url' attribute to the top level.`);
94483
- configuration.url = configuration.spec.url;
94484
- delete configuration.spec;
94485
- }
94486
- if (configuration.spec?.content) {
94487
- console.warn(`[DEPRECATED] You're using the deprecated 'spec.content' attribute. Remove the spec prefix and move the 'content' attribute to the top level.`);
94488
- configuration.content = configuration.spec.content;
94489
- delete configuration.spec;
94490
- }
94491
- if (configuration.proxy) {
94492
- console.warn(`[DEPRECATED] You're using the deprecated 'proxy' attribute, rename it to 'proxyUrl' or update the package.`);
94493
- if (!configuration.proxyUrl) {
94494
- configuration.proxyUrl = configuration.proxy;
94495
- }
94496
- delete configuration.proxy;
94497
- }
94498
- if (configuration.proxyUrl === OLD_PROXY_URL) {
94499
- console.warn(`[DEPRECATED] Warning: configuration.proxyUrl points to our old proxy (${OLD_PROXY_URL}).`);
94500
- console.warn(`[DEPRECATED] We are overwriting the value and use the new proxy URL (${NEW_PROXY_URL}) instead.`);
94501
- console.warn(`[DEPRECATED] Action Required: You should manually update your configuration to use the new URL (${NEW_PROXY_URL}). Read more: https://github.com/scalar/scalar`);
94502
- configuration.proxyUrl = NEW_PROXY_URL;
94503
- }
94504
- if (configuration.showToolbar && configuration.showToolbar !== "localhost") {
94505
- console.warn(`[DEPRECATED] You're using the deprecated 'showToolbar' attribute. Use 'showDeveloperTools' instead.`);
94506
- configuration.showDeveloperTools = configuration.showToolbar;
94507
- delete configuration.showToolbar;
94508
- }
94509
- return configuration;
94510
- });
94511
-
94512
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/api-reference/html-rendering-configuration.js
94513
- var htmlRenderingConfigurationSchema = external_exports.object({
94514
- /**
94515
- * The URL to the Scalar API Reference JS CDN.
94516
- *
94517
- * Use this to pin a specific version of the Scalar API Reference.
94518
- *
94519
- * @default https://cdn.jsdelivr.net/npm/@scalar/api-reference
94520
- *
94521
- * @example https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.122
94522
- */
94523
- cdn: external_exports.string().optional().default("https://cdn.jsdelivr.net/npm/@scalar/api-reference"),
94524
- /**
94525
- * The title of the page.
94526
- */
94527
- pageTitle: external_exports.string().optional().default("Scalar API Reference")
94528
- });
94529
-
94530
- // ../../node_modules/.pnpm/@scalar+types@0.9.5/node_modules/@scalar/types/dist/legacy/reference-config.js
94531
- var XScalarStability;
94532
- (function(XScalarStability2) {
94533
- XScalarStability2["Deprecated"] = "deprecated";
94534
- XScalarStability2["Experimental"] = "experimental";
94535
- XScalarStability2["Stable"] = "stable";
94536
- })(XScalarStability || (XScalarStability = {}));
94537
-
94538
- // ../../packages/scalar-config/dist/schema/navigation/openapi.js
94539
- var scopedApiConfigSchema = apiReferenceConfigurationSchema.pick({
94540
- authentication: true,
94541
- expandAllResponses: true,
94542
- expandAllModelSections: true,
94543
- defaultOpenAllTags: true,
94544
- defaultHttpClient: true,
94545
- hiddenClients: true,
94546
- showOperationId: true,
94547
- hideTestRequestButton: true,
94548
- hideDownloadButton: true,
94549
- documentDownloadType: true,
94550
- hideModels: true,
94551
- plugins: true,
94552
- proxyUrl: true,
94553
- orderSchemaPropertiesBy: true,
94554
- orderRequiredPropertiesFirst: true,
94555
- operationTitleSource: true,
94556
- servers: true,
94557
- hideClientButton: true,
94558
- baseServerURL: true
94504
+ documentDownloadType: external_exports.enum(["both", "yaml", "json", "direct", "none"]).default("both"),
94505
+ hideModels: external_exports.boolean().default(false),
94506
+ plugins: external_exports.unknown().array().optional(),
94507
+ proxyUrl: external_exports.string().optional(),
94508
+ orderSchemaPropertiesBy: external_exports.enum(["alpha", "preserve"]).default("alpha"),
94509
+ orderRequiredPropertiesFirst: external_exports.boolean().default(true),
94510
+ operationTitleSource: external_exports.enum(["summary", "path"]).default("summary"),
94511
+ servers: external_exports.unknown().array().optional(),
94512
+ hideClientButton: external_exports.boolean().default(false),
94513
+ baseServerURL: external_exports.string().optional()
94559
94514
  });
94560
94515
  var openapiNavigationEntryBase = external_exports.object({
94561
94516
  title: titleSchema.optional(),
@@ -94567,26 +94522,27 @@ var openapiNavigationEntryBase = external_exports.object({
94567
94522
  /** Optional Scalar API reference configuration for the OpenAPI file. */
94568
94523
  config: scopedApiConfigSchema.optional().describe("Optional Scalar API reference configuration for the OpenAPI file."),
94569
94524
  singlePage: external_exports.boolean().default(false).describe("Render Scalar references in a single scrollable page. Navigation uses # fragments."),
94570
- showInSidebar: external_exports.boolean().default(true)
94525
+ showInSidebar: external_exports.boolean().default(true),
94526
+ /** Optional initial open state of the group in the sidebar. Note: This only applies if the mode is `folder`. */
94527
+ open: external_exports.boolean().optional().describe("Optional initial open state of the group in the sidebar. Note: This only applies if the mode is `folder`.")
94571
94528
  });
94572
- var openapiNavigationEntryPathSchema = openapiNavigationEntryBase.extend({
94573
- /** Relative path to the OpenAPI file with respect to the configuration root. */
94574
- filepath: external_exports.string().describe("Relative path to the OpenAPI file with respect to the configuration root.")
94575
- }).describe("Local OpenAPI file.");
94576
- var openapiNavigationEntryRegistrySchema = openapiNavigationEntryBase.extend({
94577
- /** The slug of the OpenAPI file in the registry. */
94578
- slug: external_exports.string(),
94579
- /** The namespace of the OpenAPI file in the registry. */
94580
- namespace: external_exports.string(),
94581
- /** The version of the OpenAPI file in the registry. */
94582
- version: external_exports.string()
94583
- }).describe("OpenAPI file from a registry.");
94529
+ var openapiNavigationEntryPathBase = openapiNavigationEntryBase.extend({
94530
+ filepath: external_exports.string().optional().describe("Relative path to the OpenAPI file with respect to the configuration root."),
94531
+ slug: external_exports.string().optional().describe("The slug of the OpenAPI file in the registry."),
94532
+ namespace: external_exports.string().optional().describe("The namespace of the OpenAPI file in the registry."),
94533
+ version: external_exports.string().optional().describe("The version of the OpenAPI file in the registry."),
94534
+ disableSync: external_exports.boolean().optional().describe("When `filepath` is set, skip auto-publishing the spec to the Registry on docs publish."),
94535
+ ruleset: rulesetConfigSchema.optional().describe("Spectral ruleset and publish policy for this route. Overrides the project-level ruleset on a per-key basis.")
94536
+ });
94537
+ var hasOpenapiSource = (data) => !!data.filepath || !!data.slug && !!data.namespace && !!data.version;
94538
+ var openapiNavigationEntryPathSchema = openapiNavigationEntryPathBase.refine(hasOpenapiSource, {
94539
+ message: "OpenAPI route must have either `filepath`, or all of `namespace`, `slug`, and `version`."
94540
+ }).describe("Local OpenAPI file with optional Registry coordinates for auto-publish.");
94584
94541
  var openapiNavigationEntryLiveLinkSchema = openapiNavigationEntryBase.extend({
94585
94542
  url: external_exports.string()
94586
94543
  }).describe("Live OpenAPI file from a URL. Fetched on each page load");
94587
94544
  var openapiNavigationEntrySchema = external_exports.union([
94588
94545
  openapiNavigationEntryPathSchema,
94589
- openapiNavigationEntryRegistrySchema,
94590
94546
  openapiNavigationEntryLiveLinkSchema
94591
94547
  ]);
94592
94548
  var baseInternalOpenapiSchema = external_exports.object({
@@ -94601,8 +94557,13 @@ var baseInternalOpenapiSchema = external_exports.object({
94601
94557
  title: external_exports.string(),
94602
94558
  description: external_exports.string()
94603
94559
  });
94604
- var internalOpenapiNavigationEntryPathSchema = openapiNavigationEntryPathSchema.extend(baseInternalOpenapiSchema.shape);
94605
- var internalOpenapiNavigationEntryRegistrySchema = openapiNavigationEntryRegistrySchema.extend({
94560
+ var internalOpenapiNavigationEntryPathSchema = openapiNavigationEntryPathBase.extend({
94561
+ filepath: external_exports.string()
94562
+ }).extend(baseInternalOpenapiSchema.shape);
94563
+ var internalOpenapiNavigationEntryRegistrySchema = openapiNavigationEntryBase.extend({
94564
+ slug: external_exports.string(),
94565
+ namespace: external_exports.string(),
94566
+ version: external_exports.string(),
94606
94567
  apiVersion: external_exports.string()
94607
94568
  }).extend(baseInternalOpenapiSchema.shape);
94608
94569
  var internalOpenapiNavigationEntryLiveLinkSchema = openapiNavigationEntryLiveLinkSchema.extend(baseInternalOpenapiSchema.shape);
@@ -94636,7 +94597,9 @@ var pageFrontmatterSchema = external_exports.object({
94636
94597
  }).optional().describe("Search bar configuration")
94637
94598
  }).optional().describe("Optional layout options for the page. This will override the global layout options."),
94638
94599
  /** Optional head options (meta, scripts, etc-). */
94639
- head: headSchema.optional()
94600
+ head: headSchema.optional(),
94601
+ /** Cover photo URL rendered as a banner above the page content. */
94602
+ backgroundImage: external_exports.string().optional().describe("Cover photo URL rendered as a banner above the page content.")
94640
94603
  });
94641
94604
  var basePageNavigationEntrySchema = pageFrontmatterSchema.extend({
94642
94605
  type: external_exports.literal("page"),
@@ -94877,6 +94840,10 @@ var siteConfigSchema = external_exports.object({
94877
94840
  /** The subdomain prefix of the site. Will be used to publish to <subdomain>.apidocumentation.com. This must be unique on the Scalar platform. */
94878
94841
  subdomain: external_exports.string().optional().describe("The subdomain prefix of the site. Will be used to publish to <subdomain>.apidocumentation.com. This must be unique on the Scalar platform."),
94879
94842
  subpath: pathSchema.optional().describe("The subpath of the site, e.g. /docs. All routes will be resolved against the subpath"),
94843
+ /** Whether the published site is private. Access is controlled via accessGroups and loginPortal. */
94844
+ isPrivate: external_exports.boolean().optional().describe("Whether the published site is private. Access is controlled via accessGroups and loginPortal."),
94845
+ /** Slugs of access groups (defined in the dashboard) permitted to view the site when isPrivate is true. */
94846
+ accessGroups: slugSchema.array().max(50).optional().describe("Slugs of access groups permitted to view the site when isPrivate is true."),
94880
94847
  /** The login portal slug for the site. References a created login portal from dashboard.scalar.com */
94881
94848
  loginPortal: slugSchema.optional(),
94882
94849
  /** Global layout options to hide/show select elements */
@@ -94890,16 +94857,16 @@ var siteConfigSchema = external_exports.object({
94890
94857
  enabled: external_exports.boolean().optional().describe("Enable or disable search globally")
94891
94858
  }).optional().describe("Search bar configuration"),
94892
94859
  sidebar: external_exports.object({
94860
+ enabled: external_exports.boolean().optional().describe("Show or hide the sidebar globally"),
94893
94861
  navPosition: external_exports.enum(["top", "bottom"]).optional().describe("Top level sidebar nav item positioning")
94894
94862
  }).optional()
94895
94863
  }).optional().describe("Global layout options to hide/show select elements"),
94896
- /** Slug for a platform defined theme */
94897
- theme: external_exports.string().optional().describe("Slug for a platform defined theme"),
94864
+ /** Slug for a platform defined theme, or a relative path to a local .css file (must end with .css). */
94865
+ theme: external_exports.string().optional().describe("Slug for a platform-defined theme, or a relative path to a local .css file (must end with .css)."),
94898
94866
  /** Site logo shown in the header. Can be single URL or an object with a URL for dark and light mode */
94899
94867
  logo: logoSchema2.optional().describe("Site logo shown in the header. Can be single URL or an object with a URL for dark and light mode"),
94900
94868
  /** Footer content. Can be a filepath to an HTML file, or raw HTML and CSS. */
94901
94869
  footer: external_exports.object({
94902
- belowSidebar: external_exports.boolean().optional().describe("Layout option to control if the footer pushes under the sidebar"),
94903
94870
  filepath: external_exports.string().endsWith(".html", 'The footer filepath must point to a ".html" file.').describe("File path to the footer HTML file")
94904
94871
  }).optional(),
94905
94872
  /** Routing options for the site */
@@ -94913,9 +94880,18 @@ var siteConfigSchema = external_exports.object({
94913
94880
  }).optional().describe("Customize light/dark mode color scheme and toggle preferences."),
94914
94881
  /** Ask AI agent configuration */
94915
94882
  agent: external_exports.object({
94883
+ enabled: external_exports.boolean().optional().describe("Whether the Ask AI button is shown on the site."),
94916
94884
  buttonText: external_exports.string().optional().describe('Label shown on the Ask AI button. Defaults to "Ask AI".'),
94917
- sidebarPosition: external_exports.enum(["below-search", "default"]).optional().describe('Placement of the Ask AI button in the sidebar. "default" renders it next to the search bar; "below-search" renders it on its own row beneath the search bar.')
94918
- }).optional().describe("Ask AI agent configuration")
94885
+ sidebarPosition: external_exports.enum(["below-search", "default"]).optional().describe('Placement of the Ask AI button in the sidebar. "default" renders it next to the search bar; "below-search" renders it on its own row beneath the search bar.'),
94886
+ mcp: external_exports.object({
94887
+ serverSlug: slugSchema.optional().describe("Slug of the MCP server (scoped to the team)."),
94888
+ installationSlug: slugSchema.optional().describe("Slug of the MCP installation (scoped to the MCP server).")
94889
+ }).optional().describe("References an MCP server + installation by slug. Resolved on publish to bind the docs project to a configured MCP.")
94890
+ }).optional().describe("Ask AI agent configuration"),
94891
+ /** Analytics tracking preferences for the site */
94892
+ analytics: external_exports.object({
94893
+ cookieBanner: external_exports.boolean().optional().describe("Show an opt-in cookie consent banner before tracking. Required for GDPR-compliant deployments.")
94894
+ }).optional().describe("Analytics tracking preferences for the site")
94919
94895
  }).default({});
94920
94896
 
94921
94897
  // ../../packages/scalar-config/dist/schema/schema.js
@@ -94941,6 +94917,7 @@ var baseScalarConfigSchema = external_exports.object({
94941
94917
  /** Whether to insert an H1 with Title and Description at top of each guide page, or not. Deprecated. */
94942
94918
  insertPageTitles: external_exports.boolean().optional().describe("Whether to insert an H1 with Title and Description at top of each guide page, or not. Deprecated. Write the title and description in the markdown instead."),
94943
94919
  assetsDir: external_exports.string().optional().describe("Specify an assets folder to serve custom assets such as media files. These are served globally from the root path, e.g. /picture.png"),
94920
+ ruleset: rulesetConfigSchema.optional().describe("Default Spectral ruleset and publish policy applied to every OpenAPI route. Per-route ruleset config overrides individual keys."),
94944
94921
  siteConfig: siteConfigSchema
94945
94922
  });
94946
94923
  var externalScalarConfigSchema = baseScalarConfigSchema.extend({
@@ -95003,7 +94980,8 @@ function createError(code, detail) {
95003
94980
  }
95004
94981
 
95005
94982
  // ../../packages/scalar-config/dist/resolvers/resolve-config.js
95006
- import { nanoid as nanoid5 } from "nanoid";
94983
+ import { customAlphabet as customAlphabet2 } from "nanoid";
94984
+ var slugSafeNanoid = customAlphabet2("0123456789abcdefghijklmnopqrstuvwxyz", 40);
95007
94985
 
95008
94986
  // ../../node_modules/.pnpm/vue@3.5.33_typescript@6.0.2/node_modules/vue/index.mjs
95009
94987
  var vue_exports = {};
@@ -95011,11 +94989,11 @@ __reExport(vue_exports, __toESM(require_vue(), 1));
95011
94989
 
95012
94990
  // ../../packages/scalar-config/dist/transformers/helpers.js
95013
94991
  import { parse as parse4 } from "node:path";
95014
- function createUrlSlug({ name: name2, path: path12 }) {
94992
+ function createUrlSlug({ name: name2, path: path13 }) {
95015
94993
  if (name2)
95016
94994
  return `/${slugify3(name2)}`;
95017
- if (path12)
95018
- return `/${slugify3(parse4(path12).name)}`;
94995
+ if (path13)
94996
+ return `/${slugify3(parse4(path13).name)}`;
95019
94997
  return `/${slugify3(randomSlug({ words: 2 }))}`;
95020
94998
  }
95021
94999
 
@@ -95171,8 +95149,8 @@ var legacyTo2_0_0 = (config3) => {
95171
95149
  });
95172
95150
  }
95173
95151
  }
95174
- const cssStyles = config3.siteConfig.cssFiles?.map((path12) => ({
95175
- path: path12
95152
+ const cssStyles = config3.siteConfig.cssFiles?.map((path13) => ({
95153
+ path: path13
95176
95154
  })) ?? [];
95177
95155
  const legacyThemePath = "theme.css";
95178
95156
  if (config3.siteConfig.cssString) {
@@ -95225,11 +95203,12 @@ var legacyTo2_0_0 = (config3) => {
95225
95203
  siteConfig: {
95226
95204
  customDomain: config3.customDomain,
95227
95205
  subdomain: config3.subdomain,
95206
+ isPrivate: config3.isPrivate,
95207
+ accessGroups: config3.accessGroups,
95228
95208
  loginPortal: config3.loginPortal,
95229
95209
  ...config3.siteConfig.footer && {
95230
95210
  footer: {
95231
- filepath: legacyFooterPath,
95232
- belowSidebar: config3.siteConfig.footerBelowSidebar
95211
+ filepath: legacyFooterPath
95233
95212
  }
95234
95213
  },
95235
95214
  routing: config3.siteConfig.routing,
@@ -95352,7 +95331,8 @@ function generateGuideItems({ children, items }) {
95352
95331
  title: item.title,
95353
95332
  description: item.description,
95354
95333
  icon: item.icon?.src,
95355
- filepath: `${item.yjsReference}.yjs`
95334
+ filepath: `${item.yjsReference}.yjs`,
95335
+ ...item.backgroundImage && { backgroundImage: item.backgroundImage }
95356
95336
  };
95357
95337
  routes[slug] = item.children.length ? {
95358
95338
  type: "group",
@@ -95607,8 +95587,7 @@ var wysiwygProjectToV2 = n.safeFn(({ project, invalidRefs, theme }) => {
95607
95587
  subdomain: project.website.subdomainPrefix,
95608
95588
  subpath: project.website.subPath,
95609
95589
  footer: {
95610
- filepath: legacyFooterPath,
95611
- belowSidebar: activeVersion.footerBelowSidebar
95590
+ filepath: legacyFooterPath
95612
95591
  },
95613
95592
  ...(project.logo.darkMode || project.logo.lightMode) && {
95614
95593
  logo: {
@@ -95786,12 +95765,17 @@ function CheckConfigCommand() {
95786
95765
  }
95787
95766
 
95788
95767
  // src/domains/project/preview/v2.ts
95789
- import { execFile, spawn } from "node:child_process";
95768
+ import { spawn } from "node:child_process";
95769
+ import path7 from "node:path";
95770
+
95771
+ // src/domains/project/download-isolate/index.ts
95772
+ import { execFile } from "node:child_process";
95790
95773
  import fs13 from "node:fs/promises";
95791
95774
  import os2 from "node:os";
95792
95775
  import path6 from "node:path";
95793
95776
  import { Readable } from "node:stream";
95794
95777
  import zlib from "node:zlib";
95778
+ import { Command as Command31 } from "commander";
95795
95779
  import tar from "tar-fs";
95796
95780
 
95797
95781
  // src/helpers/run-command.ts
@@ -95810,7 +95794,7 @@ async function runCommand(command, cwd2) {
95810
95794
  });
95811
95795
  }
95812
95796
 
95813
- // src/domains/project/preview/v2.ts
95797
+ // src/domains/project/download-isolate/index.ts
95814
95798
  var ISOLATE_EXTRACTION_DIR = path6.join(os2.homedir(), ".scalar");
95815
95799
  var ISOLATE_DIR = path6.join(ISOLATE_EXTRACTION_DIR, "isolate");
95816
95800
  async function getExistingIsolateVersion() {
@@ -95886,6 +95870,16 @@ async function downloadIsolate() {
95886
95870
  logger.update("loader", 0, { content: "Download complete." });
95887
95871
  logger.finish();
95888
95872
  }
95873
+ var DownloadIsolateCommand = () => {
95874
+ const cmd2 = new Command31("download-isolate");
95875
+ cmd2.description("Download the docs isolate");
95876
+ cmd2.action(async () => {
95877
+ await downloadIsolate();
95878
+ });
95879
+ return cmd2;
95880
+ };
95881
+
95882
+ // src/domains/project/preview/v2.ts
95889
95883
  async function runIsolate(isolateOptions) {
95890
95884
  const child = spawn("node", ["dist/isolate-entry.js"], { cwd: ISOLATE_DIR });
95891
95885
  child.stdin.write(JSON.stringify(isolateOptions));
@@ -95914,8 +95908,8 @@ async function previewV2Project({
95914
95908
  config: config3,
95915
95909
  host
95916
95910
  }) {
95917
- const root = path6.resolve(path6.dirname(configPath), config3.root ?? "./");
95918
- const relativeConfigPath = path6.relative(root, configPath);
95911
+ const root = path7.resolve(path7.dirname(configPath), config3.root ?? "./");
95912
+ const relativeConfigPath = path7.relative(root, configPath);
95919
95913
  const accessToken = await getAccessToken();
95920
95914
  await downloadIsolate();
95921
95915
  output.info().message("Starting preview...").print();
@@ -95935,7 +95929,7 @@ async function previewV2Project({
95935
95929
 
95936
95930
  // src/domains/project/preview/index.ts
95937
95931
  var PreviewCommand = () => {
95938
- const cmd2 = new Command31("preview");
95932
+ const cmd2 = new Command32("preview");
95939
95933
  cmd2.description("Preview scalar guides");
95940
95934
  cmd2.argument(
95941
95935
  "[config]",
@@ -96028,9 +96022,9 @@ var PreviewCommand = () => {
96028
96022
  // src/domains/project/create/index.ts
96029
96023
  import { text as text5 } from "@clack/prompts";
96030
96024
  import as28 from "ansis";
96031
- import { Command as Command32 } from "commander";
96025
+ import { Command as Command33 } from "commander";
96032
96026
  var CreateCommand = () => {
96033
- const cmd2 = new Command32("create");
96027
+ const cmd2 = new Command33("create");
96034
96028
  cmd2.description(
96035
96029
  "Create a new project that is not linked to a github project."
96036
96030
  );
@@ -96076,10 +96070,10 @@ Project slug: ${as28.cyan(response.data.slug)}`
96076
96070
 
96077
96071
  // src/domains/project/init/index.ts
96078
96072
  import fs14 from "node:fs/promises";
96079
- import path7 from "node:path";
96073
+ import path8 from "node:path";
96080
96074
  import { cancel, confirm as confirm3, isCancel, text as text6 } from "@clack/prompts";
96081
96075
  import as29 from "ansis";
96082
- import { Command as Command33 } from "commander";
96076
+ import { Command as Command34 } from "commander";
96083
96077
 
96084
96078
  // ../../node_modules/.pnpm/@scalar+galaxy@0.6.4/node_modules/@scalar/galaxy/dist/3.1.json
96085
96079
  var __default = {
@@ -98034,16 +98028,16 @@ We're here to help:
98034
98028
  `;
98035
98029
 
98036
98030
  // src/domains/project/init/index.ts
98037
- async function fileExists2(path12) {
98031
+ async function fileExists2(path13) {
98038
98032
  try {
98039
- await fs14.access(path12, fs14.constants.F_OK);
98033
+ await fs14.access(path13, fs14.constants.F_OK);
98040
98034
  return true;
98041
98035
  } catch {
98042
98036
  return false;
98043
98037
  }
98044
98038
  }
98045
98039
  var InitCommand = () => {
98046
- const cmd2 = new Command33("init");
98040
+ const cmd2 = new Command34("init");
98047
98041
  cmd2.description("Create a new Scalar Docs project.");
98048
98042
  cmd2.option("-s, --subdomain [url]", "subdomain to publish on");
98049
98043
  cmd2.option("--force", "override existing configuration");
@@ -98086,7 +98080,7 @@ var InitCommand = () => {
98086
98080
  handleCancel();
98087
98081
  }
98088
98082
  }
98089
- const currentDir = path7.resolve(path7.dirname(configFile));
98083
+ const currentDir = path8.resolve(path8.dirname(configFile));
98090
98084
  const configuration = scalarConfigSchema.parse({
98091
98085
  info: {},
98092
98086
  navigation: {
@@ -98134,11 +98128,11 @@ var InitCommand = () => {
98134
98128
  const content = JSON.stringify(configuration, null, 2);
98135
98129
  await fs14.writeFile(configFile, content);
98136
98130
  await fs14.writeFile(
98137
- path7.join(currentDir, DEFAULT_MARKDOWN_FILE_NAME),
98131
+ path8.join(currentDir, DEFAULT_MARKDOWN_FILE_NAME),
98138
98132
  quickstartMarkdown
98139
98133
  );
98140
98134
  await fs14.writeFile(
98141
- path7.join(currentDir, DEFAULT_OPENAPI_FILE_NAME),
98135
+ path8.join(currentDir, DEFAULT_OPENAPI_FILE_NAME),
98142
98136
  JSON.stringify(__default, null, 2)
98143
98137
  );
98144
98138
  output.info().line(`${as29.green("\u2714")} Configuration stored.
@@ -98156,11 +98150,11 @@ var InitCommand = () => {
98156
98150
  // src/domains/project/publish/index.ts
98157
98151
  import fs16 from "node:fs";
98158
98152
  import { dirname } from "node:path";
98159
- import { Command as Command34 } from "commander";
98153
+ import { Command as Command35 } from "commander";
98160
98154
 
98161
98155
  // src/domains/project/publish/publish.ts
98162
98156
  import fs15 from "node:fs";
98163
- import path8 from "node:path";
98157
+ import path9 from "node:path";
98164
98158
  import { Readable as Readable2 } from "node:stream";
98165
98159
  import ignore from "ignore";
98166
98160
  import tar2 from "tar-fs";
@@ -98171,7 +98165,7 @@ function isErrnoException(error48) {
98171
98165
  async function readGitIgnore(configDir) {
98172
98166
  try {
98173
98167
  const gitignore = await fs15.promises.readFile(
98174
- path8.resolve(configDir, ".gitignore"),
98168
+ path9.resolve(configDir, ".gitignore"),
98175
98169
  "utf8"
98176
98170
  );
98177
98171
  return gitignore;
@@ -98216,17 +98210,17 @@ async function publishProject({
98216
98210
  configDir,
98217
98211
  configPath,
98218
98212
  config: config3,
98219
- gitProject,
98213
+ slug,
98220
98214
  mode
98221
98215
  }) {
98222
98216
  try {
98223
- const root = path8.join(configDir, config3.root ?? "./");
98224
- const relativeConfigPath = path8.relative(root, configPath);
98217
+ const root = path9.join(configDir, config3.root ?? "./");
98218
+ const relativeConfigPath = path9.relative(root, configPath);
98225
98219
  const apiClient = await apiService();
98226
98220
  const projectTar = await createProjectTar(root);
98227
98221
  const result = await apiClient.publish.publishCli({
98228
98222
  tarStream: Readable2.toWeb(projectTar),
98229
- slug: gitProject.slug,
98223
+ slug,
98230
98224
  configPath: relativeConfigPath,
98231
98225
  mode
98232
98226
  });
@@ -98240,6 +98234,26 @@ async function publishProject({
98240
98234
  return { success: false, error: e };
98241
98235
  }
98242
98236
  }
98237
+ async function publishUnifiedDocsProjectFromGithub({
98238
+ slug,
98239
+ preview,
98240
+ apiClient
98241
+ }) {
98242
+ const result = await apiClient.publish.publishDocsProject({
98243
+ slug,
98244
+ preview
98245
+ });
98246
+ if (result.error) {
98247
+ return {
98248
+ success: false,
98249
+ error: result.message
98250
+ };
98251
+ }
98252
+ return {
98253
+ success: true,
98254
+ publishUid: result.data.publishUid
98255
+ };
98256
+ }
98243
98257
 
98244
98258
  // src/domains/project/publish/url.ts
98245
98259
  function getPublishDeploymentUrl(publish) {
@@ -98262,7 +98276,7 @@ var sleep = (ms) => {
98262
98276
 
98263
98277
  // src/domains/project/publish/index.ts
98264
98278
  var PublishCommand = () => {
98265
- const cmd2 = new Command34("publish");
98279
+ const cmd2 = new Command35("publish");
98266
98280
  cmd2.description(
98267
98281
  "Publish new build for a github sync project that is not linked."
98268
98282
  );
@@ -98294,19 +98308,46 @@ var PublishCommand = () => {
98294
98308
  if (!slug) {
98295
98309
  return output.error().title("Invalid argument").message("Slug is required. Try passing --slug flag.").exit("error");
98296
98310
  }
98297
- const gitProject = await getGithubProject(slug, apiClient);
98298
98311
  if (github) {
98299
- if (!gitProject.repository) {
98312
+ const resolved = await resolveProject(slug, apiClient);
98313
+ if (resolved.kind === "not-found") {
98314
+ return output.error().title("Project not found").message(`No project with slug "${slug}" was found for your team.`).exit("error");
98315
+ }
98316
+ if (resolved.kind === "github") {
98317
+ if (!resolved.project.repository) {
98318
+ return output.error().title("Your project is not linked to a GitHub repository").message(
98319
+ "For a sync publish, please configure your GitHub connection through the dashboard."
98320
+ ).exit("error");
98321
+ }
98322
+ if (resolved.project.repository.expired) {
98323
+ return output.error().title("Your GitHub repository access is expired.").message(
98324
+ "Please reconnect your project through the Scalar Dashboard to publish via sync."
98325
+ ).exit("error");
98326
+ }
98327
+ const publishResult3 = await publishGithub({ apiClient, slug, preview });
98328
+ if (!publishResult3.success) {
98329
+ return output.error().title("Could not publish sync project.").message(publishResult3.error).exit("error");
98330
+ }
98331
+ return await waitForPublish({
98332
+ teamUid: auth.teamUid,
98333
+ publishUid: publishResult3.publishUid
98334
+ });
98335
+ }
98336
+ if (!isGithubBackedDocsProject(resolved.project)) {
98300
98337
  return output.error().title("Your project is not linked to a GitHub repository").message(
98301
98338
  "For a sync publish, please configure your GitHub connection through the dashboard."
98302
98339
  ).exit("error");
98303
98340
  }
98304
- if (gitProject.repository.expired) {
98341
+ if (resolved.project.repository.expired) {
98305
98342
  return output.error().title("Your GitHub repository access is expired.").message(
98306
98343
  "Please reconnect your project through the Scalar Dashboard to publish via sync."
98307
98344
  ).exit("error");
98308
98345
  }
98309
- const publishResult2 = await publishGithub({ apiClient, slug, preview });
98346
+ const publishResult2 = await publishUnifiedDocsProjectFromGithub({
98347
+ apiClient,
98348
+ slug,
98349
+ preview
98350
+ });
98310
98351
  if (!publishResult2.success) {
98311
98352
  return output.error().title("Could not publish sync project.").message(publishResult2.error).exit("error");
98312
98353
  }
@@ -98328,7 +98369,7 @@ var PublishCommand = () => {
98328
98369
  }
98329
98370
  const publishResult = await publishProject({
98330
98371
  config: configParseResult.config,
98331
- gitProject,
98372
+ slug,
98332
98373
  configDir: dirname(configPath),
98333
98374
  configPath,
98334
98375
  ...preview && { mode: "preview" }
@@ -98379,12 +98420,16 @@ async function waitForPublish({
98379
98420
  await sleep(3e3);
98380
98421
  }
98381
98422
  }
98382
- async function getGithubProject(slug, apiClient) {
98383
- const project = await apiClient.github.getProject(slug);
98384
- if (project.error) {
98385
- return output.error().title("Error fetching github project").message(project.message).exit("error");
98423
+ async function resolveProject(slug, apiClient) {
98424
+ const githubResult = await apiClient.github.getProject(slug);
98425
+ if (!githubResult.error) {
98426
+ return { kind: "github", project: githubResult.data };
98427
+ }
98428
+ const docsResult = await apiClient.docsProject.getProject(slug);
98429
+ if (!docsResult.error) {
98430
+ return { kind: "docs", project: docsResult.data };
98386
98431
  }
98387
- return project.data;
98432
+ return { kind: "not-found" };
98388
98433
  }
98389
98434
  async function getDeployStatus({
98390
98435
  client,
@@ -98400,10 +98445,10 @@ async function getDeployStatus({
98400
98445
 
98401
98446
  // src/domains/project/upgrade/index.ts
98402
98447
  import fs17 from "node:fs/promises";
98403
- import path9 from "node:path";
98448
+ import path10 from "node:path";
98404
98449
  import { text as text7 } from "@clack/prompts";
98405
98450
  import as30 from "ansis";
98406
- import { Command as Command35 } from "commander";
98451
+ import { Command as Command36 } from "commander";
98407
98452
  import { n as n2 } from "neverpanic";
98408
98453
 
98409
98454
  // src/errors.ts
@@ -98432,7 +98477,7 @@ function displayError(error48, fallback = "Unknown error occurred. Please contac
98432
98477
 
98433
98478
  // src/domains/project/upgrade/index.ts
98434
98479
  var UpgradeCommand2 = () => {
98435
- const cmd2 = new Command35("upgrade");
98480
+ const cmd2 = new Command36("upgrade");
98436
98481
  cmd2.description("Upgrade scalar project");
98437
98482
  cmd2.argument(
98438
98483
  "[config]",
@@ -98489,8 +98534,8 @@ var UpgradeCommand2 = () => {
98489
98534
  if (legacyTheme) {
98490
98535
  const writeUpgradedThemeResult = await n2.fromUnsafe(
98491
98536
  () => fs17.writeFile(
98492
- path9.resolve(
98493
- path9.dirname(parseConfigResult.filePath),
98537
+ path10.resolve(
98538
+ path10.dirname(parseConfigResult.filePath),
98494
98539
  config3.root ?? "./",
98495
98540
  legacyTheme.path
98496
98541
  ),
@@ -98505,8 +98550,8 @@ var UpgradeCommand2 = () => {
98505
98550
  if (legacyFooter) {
98506
98551
  const writeUpgradedFooterResult = await n2.fromUnsafe(
98507
98552
  () => fs17.writeFile(
98508
- path9.resolve(
98509
- path9.dirname(parseConfigResult.filePath),
98553
+ path10.resolve(
98554
+ path10.dirname(parseConfigResult.filePath),
98510
98555
  config3.root ?? "./",
98511
98556
  legacyFooter.path
98512
98557
  ),
@@ -98521,8 +98566,8 @@ var UpgradeCommand2 = () => {
98521
98566
  if (legacyScript) {
98522
98567
  const writeUpgradedScriptResult = await n2.fromUnsafe(
98523
98568
  () => fs17.writeFile(
98524
- path9.resolve(
98525
- path9.dirname(parseConfigResult.filePath),
98569
+ path10.resolve(
98570
+ path10.dirname(parseConfigResult.filePath),
98526
98571
  config3.root ?? "./",
98527
98572
  legacyScript.path
98528
98573
  ),
@@ -98558,23 +98603,25 @@ var projectCommands = [
98558
98603
  PublishCommand,
98559
98604
  UpgradeCommand2
98560
98605
  ];
98561
- var projectDomain = new Command36("project");
98606
+ var projectDomain = new Command37("project");
98562
98607
  projectDomain.description("Manage scalar project");
98563
98608
  projectCommands.forEach((command) => projectDomain.addCommand(command()));
98609
+ projectDomain.addCommand(DownloadIsolateCommand(), { hidden: true });
98564
98610
  var project_default = projectDomain;
98565
98611
 
98566
98612
  // src/domains/readme/index.ts
98567
- import { Command as Command38 } from "commander";
98613
+ import { Command as Command39 } from "commander";
98568
98614
 
98569
98615
  // src/domains/readme/generate.ts
98570
98616
  import { text as text8 } from "@clack/prompts";
98571
98617
  import as31 from "ansis";
98572
- import { Command as Command37 } from "commander";
98618
+ import { Command as Command38 } from "commander";
98573
98619
 
98574
98620
  // src/helpers/documentation/index.ts
98575
98621
  import fs18 from "node:fs/promises";
98576
- import path10 from "node:path";
98622
+ import path11 from "node:path";
98577
98623
  var generateDocs = (command, depth = 0) => {
98624
+ if (command._hidden) return [];
98578
98625
  const documentation = [];
98579
98626
  documentation.push({
98580
98627
  title: command.name(),
@@ -98602,7 +98649,7 @@ ${docs.content}${codeBlock}`);
98602
98649
  var generateDocumentationFile = async (outputPath) => {
98603
98650
  const commandDocumentation = generateCommandDocumentation(getProgram());
98604
98651
  const template = await fs18.readFile(
98605
- path10.join(import.meta.dirname, "template.md"),
98652
+ path11.join(import.meta.dirname, "template.md"),
98606
98653
  {
98607
98654
  encoding: "utf-8"
98608
98655
  }
@@ -98615,7 +98662,7 @@ var generateDocumentationFile = async (outputPath) => {
98615
98662
 
98616
98663
  // src/domains/readme/generate.ts
98617
98664
  function GenerateReadmeCommand() {
98618
- const cmd2 = new Command37("generate");
98665
+ const cmd2 = new Command38("generate");
98619
98666
  cmd2.description("Self generate documentation for the cli");
98620
98667
  cmd2.option(
98621
98668
  "-o, --output [file]",
@@ -98649,7 +98696,7 @@ function GenerateReadmeCommand() {
98649
98696
 
98650
98697
  // src/domains/readme/serve.ts
98651
98698
  import fs19 from "node:fs/promises";
98652
- import path11 from "node:path";
98699
+ import path12 from "node:path";
98653
98700
  import as32 from "ansis";
98654
98701
  var fileExists3 = async (filePath) => {
98655
98702
  try {
@@ -98662,13 +98709,13 @@ var fileExists3 = async (filePath) => {
98662
98709
  function ServeReadmeCommand(cmd2) {
98663
98710
  cmd2.description("Open documentation for the CLI");
98664
98711
  cmd2.action(async () => {
98665
- const docsPath = path11.join(import.meta.dirname, "docs.html");
98712
+ const docsPath = path12.join(import.meta.dirname, "docs.html");
98666
98713
  if (await fileExists3(docsPath) === false) {
98667
98714
  return output.error().title("Documentation not found").message(
98668
98715
  "You can access documentation only by running the bundled version of the CLI."
98669
98716
  ).exit("error");
98670
98717
  }
98671
- const docsUrl = `file://${path11.join(import.meta.dirname, "docs.html")}`;
98718
+ const docsUrl = `file://${path12.join(import.meta.dirname, "docs.html")}`;
98672
98719
  openBrowser(docsUrl);
98673
98720
  output.info().message(
98674
98721
  "Documentation is being opened in your default browser. If it does not open automatically, please visit the following URL:"
@@ -98678,22 +98725,21 @@ function ServeReadmeCommand(cmd2) {
98678
98725
  }
98679
98726
 
98680
98727
  // src/domains/readme/index.ts
98681
- var readmeDomain = new Command38("readme");
98728
+ var readmeDomain = new Command39("readme");
98682
98729
  readmeDomain.addCommand(GenerateReadmeCommand());
98683
98730
  ServeReadmeCommand(readmeDomain);
98684
98731
  var readme_default = readmeDomain;
98685
98732
 
98686
98733
  // src/domains/registry/index.ts
98687
- import { Command as Command44 } from "commander";
98734
+ import { Command as Command45 } from "commander";
98688
98735
 
98689
98736
  // src/domains/registry/publish/index.ts
98690
98737
  import { text as text9 } from "@clack/prompts";
98691
98738
  import as33 from "ansis";
98692
- import { Command as Command39 } from "commander";
98739
+ import { Command as Command40 } from "commander";
98693
98740
  import { bundle as bundle4 } from "@scalar/json-magic/bundle";
98694
98741
  import { fetchUrls as fetchUrls4, readFiles as readFiles4 } from "@scalar/json-magic/bundle/plugins/node";
98695
98742
  import { parseJsonOrYaml as parseJsonOrYaml2 } from "@scalar/oas-utils/helpers";
98696
- import { validate as validate3 } from "@scalar/openapi-parser";
98697
98743
 
98698
98744
  // src/domains/registry/publish/helpers/links.ts
98699
98745
  function apiDashboardUrl(uid) {
@@ -98702,7 +98748,7 @@ function apiDashboardUrl(uid) {
98702
98748
 
98703
98749
  // src/domains/registry/publish/index.ts
98704
98750
  var PublishCommand2 = () => {
98705
- const cmd2 = new Command39("publish");
98751
+ const cmd2 = new Command40("publish");
98706
98752
  cmd2.description("Publish an OpenAPI document to the Scalar registry");
98707
98753
  cmd2.argument("[file]", "OpenAPI file to upload");
98708
98754
  cmd2.option(
@@ -98798,13 +98844,10 @@ var PublishCommand2 = () => {
98798
98844
  treeShake: data.treeShake,
98799
98845
  urlMap: data.urlMap
98800
98846
  });
98801
- const result = await validate3(bundledDocument);
98802
- if (!result.valid || !result.specification) {
98803
- return output.error().title("Invalid API document").message("File does not match the OpenAPI specification.").table([result.errors?.map((err) => err.message) || []]).exit("error");
98804
- }
98805
- const apiSlug = data.slug || (result.specification.info?.title ? slugify3(result.specification.info.title) : randomSlug({ words: 3 }));
98847
+ const specification = bundledDocument;
98848
+ const apiSlug = data.slug || toRegistrySlug(specification.info?.title ?? "");
98806
98849
  const parsedVersion = docVersionSchema.safeParse(
98807
- data.version || result.specification.info?.version
98850
+ data.version || specification.info?.version
98808
98851
  );
98809
98852
  const version3 = parsedVersion.data || (await text9({
98810
98853
  message: "What is the version of your document (e.g. 0.1.0)?",
@@ -98825,8 +98868,8 @@ var PublishCommand2 = () => {
98825
98868
  force: data.force,
98826
98869
  isCurrent: data.current
98827
98870
  }) : await client.managedDocs.create(namespace, {
98828
- title: result.specification.info?.title || "My API",
98829
- description: result.specification.info?.description,
98871
+ title: specification.info?.title || "My API",
98872
+ description: specification.info?.description,
98830
98873
  version: version3,
98831
98874
  slug: apiSlug,
98832
98875
  isPrivate: data.private,
@@ -98847,9 +98890,9 @@ var PublishCommand2 = () => {
98847
98890
  };
98848
98891
 
98849
98892
  // src/domains/registry/delete/index.ts
98850
- import { Command as Command40 } from "commander";
98893
+ import { Command as Command41 } from "commander";
98851
98894
  var DeleteCommand = () => {
98852
- const cmd2 = new Command40("delete");
98895
+ const cmd2 = new Command41("delete");
98853
98896
  cmd2.description("Delete a document from scalar registry");
98854
98897
  cmd2.argument("[namespace]", "Team namespace");
98855
98898
  cmd2.argument("[slug]", "Managed doc slug");
@@ -98867,10 +98910,10 @@ var DeleteCommand = () => {
98867
98910
 
98868
98911
  // src/domains/registry/get/index.ts
98869
98912
  import fs20 from "node:fs";
98870
- import { Command as Command41 } from "commander";
98913
+ import { Command as Command42 } from "commander";
98871
98914
  var versionSchema3 = external_exports.union([docVersionSchema, external_exports.literal("latest")]);
98872
98915
  var GetCommand = () => {
98873
- const cmd2 = new Command41("get");
98916
+ const cmd2 = new Command42("get");
98874
98917
  cmd2.description("Get a document version from scalar registry");
98875
98918
  cmd2.argument("[namespace]", "Team namespace");
98876
98919
  cmd2.argument("[slug]", "Managed doc slug");
@@ -98945,9 +98988,9 @@ var GetCommand = () => {
98945
98988
 
98946
98989
  // src/domains/registry/list/index.ts
98947
98990
  import as34 from "ansis";
98948
- import { Command as Command42 } from "commander";
98991
+ import { Command as Command43 } from "commander";
98949
98992
  var ListCommand = () => {
98950
- const cmd2 = new Command42("list");
98993
+ const cmd2 = new Command43("list");
98951
98994
  cmd2.description("List all registry APIs for a team namespace");
98952
98995
  cmd2.option("--namespace <namespace>", "Team namespace");
98953
98996
  cmd2.action(async (args) => {
@@ -99006,9 +99049,9 @@ var ListCommand = () => {
99006
99049
  // src/domains/registry/update/index.ts
99007
99050
  import { text as text10 } from "@clack/prompts";
99008
99051
  import as35 from "ansis";
99009
- import { Command as Command43 } from "commander";
99052
+ import { Command as Command44 } from "commander";
99010
99053
  var UpdateCommand = () => {
99011
- const cmd2 = new Command43("update");
99054
+ const cmd2 = new Command44("update");
99012
99055
  cmd2.description("Update document metadata on scalar registry");
99013
99056
  cmd2.argument("[namespace]", "namespace of document you want to update");
99014
99057
  cmd2.argument("[slug]", "slug of document you want to update");
@@ -99062,17 +99105,17 @@ var registryCommands = [
99062
99105
  ListCommand,
99063
99106
  GetCommand
99064
99107
  ];
99065
- var registryDomain = new Command44("registry");
99108
+ var registryDomain = new Command45("registry");
99066
99109
  registryDomain.description("Manage your scalar registry");
99067
99110
  registryCommands.forEach((command) => registryDomain.addCommand(command()));
99068
99111
  var registry_default = registryDomain;
99069
99112
 
99070
99113
  // src/domains/team/index.ts
99071
- import { Command as Command47 } from "commander";
99114
+ import { Command as Command48 } from "commander";
99072
99115
 
99073
99116
  // src/domains/team/list/index.ts
99074
99117
  import as36 from "ansis";
99075
- import { Command as Command45 } from "commander";
99118
+ import { Command as Command46 } from "commander";
99076
99119
 
99077
99120
  // src/domains/team/helpers.ts
99078
99121
  var getUserTeams = async (client, email3) => {
@@ -99087,7 +99130,7 @@ var getUserTeams = async (client, email3) => {
99087
99130
 
99088
99131
  // src/domains/team/list/index.ts
99089
99132
  var ListCommand2 = () => {
99090
- const cmd2 = new Command45("list");
99133
+ const cmd2 = new Command46("list");
99091
99134
  cmd2.description("List all teams current user is part of");
99092
99135
  cmd2.action(async () => {
99093
99136
  const auth = await getAuthData();
@@ -99113,9 +99156,9 @@ var ListCommand2 = () => {
99113
99156
  // src/domains/team/set/index.ts
99114
99157
  import { select as select7 } from "@clack/prompts";
99115
99158
  import as37 from "ansis";
99116
- import { Command as Command46 } from "commander";
99159
+ import { Command as Command47 } from "commander";
99117
99160
  var SetCommand = () => {
99118
- const cmd2 = new Command46("set");
99161
+ const cmd2 = new Command47("set");
99119
99162
  cmd2.description("Set current active team for the user");
99120
99163
  cmd2.option("--team <team>", "Team uid");
99121
99164
  cmd2.action(async ({ team }) => {
@@ -99155,7 +99198,7 @@ var SetCommand = () => {
99155
99198
 
99156
99199
  // src/domains/team/index.ts
99157
99200
  var teamCommands = [ListCommand2, SetCommand];
99158
- var teamDomain = new Command47("team");
99201
+ var teamDomain = new Command48("team");
99159
99202
  teamDomain.description("Manage user teams");
99160
99203
  teamCommands.forEach((command) => teamDomain.addCommand(command()));
99161
99204
  var team_default = teamDomain;
@@ -99163,7 +99206,7 @@ var team_default = teamDomain;
99163
99206
  // src/domains/upgrade/index.ts
99164
99207
  import { execSync } from "node:child_process";
99165
99208
  import as39 from "ansis";
99166
- import { Command as Command48 } from "commander";
99209
+ import { Command as Command49 } from "commander";
99167
99210
 
99168
99211
  // src/helpers/upgrade.ts
99169
99212
  import as38 from "ansis";
@@ -99219,7 +99262,7 @@ async function checkUpgrade() {
99219
99262
  }
99220
99263
 
99221
99264
  // src/domains/upgrade/index.ts
99222
- var cmd = new Command48("upgrade");
99265
+ var cmd = new Command49("upgrade");
99223
99266
  cmd.description("Upgrade current version of your cli");
99224
99267
  cmd.action(async () => {
99225
99268
  const upgradeStatus = await getUpgradeInformation();
@@ -99257,7 +99300,7 @@ var domains_default = domains;
99257
99300
 
99258
99301
  // src/program.ts
99259
99302
  var getProgram = () => {
99260
- const program2 = new Command49();
99303
+ const program2 = new Command50();
99261
99304
  program2.enablePositionalOptions().name(Object.keys(bin)[0]).description("CLI to work with your OpenAPI files").version(version, "-v, --version");
99262
99305
  program2.showHelpAfterError();
99263
99306
  domains_default.forEach((domain2) => program2.addCommand(domain2));