@scalar/cli 1.9.1 → 1.9.4

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 +102 -74
  2. package/index.js +1009 -275
  3. package/package.json +11 -11
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++) {
@@ -69160,11 +69160,11 @@ Visit https://nodejs.org to download the latest version.`
69160
69160
  }
69161
69161
 
69162
69162
  // src/program.ts
69163
- import { Command as Command49 } from "commander";
69163
+ import { Command as Command50 } from "commander";
69164
69164
 
69165
69165
  // package.json
69166
69166
  var name = "@scalar/cli";
69167
- var version = "1.9.1";
69167
+ var version = "1.9.4";
69168
69168
  var bin = {
69169
69169
  scalar: "./dist/index.js",
69170
69170
  "scalar-cli": "./dist/index.js"
@@ -69944,10 +69944,10 @@ function mergeDefs(...defs) {
69944
69944
  function cloneDef(schema) {
69945
69945
  return mergeDefs(schema._zod.def);
69946
69946
  }
69947
- function getElementAtPath(obj, path12) {
69948
- if (!path12)
69947
+ function getElementAtPath(obj, path13) {
69948
+ if (!path13)
69949
69949
  return obj;
69950
- return path12.reduce((acc, key) => acc?.[key], obj);
69950
+ return path13.reduce((acc, key) => acc?.[key], obj);
69951
69951
  }
69952
69952
  function promiseAllObject(promisesObj) {
69953
69953
  const keys = Object.keys(promisesObj);
@@ -70330,11 +70330,11 @@ function aborted(x, startIndex = 0) {
70330
70330
  }
70331
70331
  return false;
70332
70332
  }
70333
- function prefixIssues(path12, issues) {
70333
+ function prefixIssues(path13, issues) {
70334
70334
  return issues.map((iss) => {
70335
70335
  var _a2;
70336
70336
  (_a2 = iss).path ?? (_a2.path = []);
70337
- iss.path.unshift(path12);
70337
+ iss.path.unshift(path13);
70338
70338
  return iss;
70339
70339
  });
70340
70340
  }
@@ -70517,7 +70517,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
70517
70517
  }
70518
70518
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
70519
70519
  const result = { errors: [] };
70520
- const processError = (error49, path12 = []) => {
70520
+ const processError = (error49, path13 = []) => {
70521
70521
  var _a2, _b;
70522
70522
  for (const issue2 of error49.issues) {
70523
70523
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -70527,7 +70527,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
70527
70527
  } else if (issue2.code === "invalid_element") {
70528
70528
  processError({ issues: issue2.issues }, issue2.path);
70529
70529
  } else {
70530
- const fullpath = [...path12, ...issue2.path];
70530
+ const fullpath = [...path13, ...issue2.path];
70531
70531
  if (fullpath.length === 0) {
70532
70532
  result.errors.push(mapper(issue2));
70533
70533
  continue;
@@ -70559,8 +70559,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
70559
70559
  }
70560
70560
  function toDotPath(_path) {
70561
70561
  const segs = [];
70562
- const path12 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
70563
- for (const seg of path12) {
70562
+ const path13 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
70563
+ for (const seg of path13) {
70564
70564
  if (typeof seg === "number")
70565
70565
  segs.push(`[${seg}]`);
70566
70566
  else if (typeof seg === "symbol")
@@ -82537,13 +82537,13 @@ function resolveRef(ref, ctx) {
82537
82537
  if (!ref.startsWith("#")) {
82538
82538
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
82539
82539
  }
82540
- const path12 = ref.slice(1).split("/").filter(Boolean);
82541
- if (path12.length === 0) {
82540
+ const path13 = ref.slice(1).split("/").filter(Boolean);
82541
+ if (path13.length === 0) {
82542
82542
  return ctx.rootSchema;
82543
82543
  }
82544
82544
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
82545
- if (path12[0] === defsKey) {
82546
- const key = path12[1];
82545
+ if (path13[0] === defsKey) {
82546
+ const key = path13[1];
82547
82547
  if (!key || !ctx.defs[key]) {
82548
82548
  throw new Error(`Reference not found: ${ref}`);
82549
82549
  }
@@ -86458,6 +86458,10 @@ var regexSlug = /^[a-z](?:[a-z0-9-]*[a-z0-9])?$/;
86458
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, {
86459
86459
  message: "Slug can have lowercase letters, digits, or hyphens. It must start with a lowercase letter and end with a letter or number."
86460
86460
  }).meta({ id: "slug" });
86461
+ var toRegistrySlug = (title) => {
86462
+ 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]+/, "");
86463
+ return slugSchema.safeParse(candidate).success ? candidate : randomManagedDocSlug();
86464
+ };
86461
86465
  var setPreprocess = (input) => input instanceof Set ? input : Array.isArray(input) ? new Set(input) : input;
86462
86466
  var setTransform = (set2) => Array.from(set2);
86463
86467
  var scalarSet = (zodSetType) => external_exports.preprocess(setPreprocess, zodSetType).transform(setTransform);
@@ -86635,7 +86639,7 @@ var samlStateSchema = external_exports.object({
86635
86639
  // Expiry
86636
86640
  expiresAt: external_exports.number()
86637
86641
  }).meta({ id: "saml-state" });
86638
- var ssoResourceSchema = external_exports.enum([...RegistryResourceTypes, "sync-project", "project", "publish"]).meta({ id: "sso-resource" });
86642
+ var ssoResourceSchema = external_exports.enum([...RegistryResourceTypes, "sync-project", "project", "publish", "mcp"]).meta({ id: "sso-resource" });
86639
86643
  var relayStateSchema = external_exports.object({
86640
86644
  /** Uniquely identifies a relay state */
86641
86645
  uid: nanoidSchema.default(nanoid3).meta({ default: "nanoid()" }),
@@ -86747,7 +86751,16 @@ var scalarRuleset = `extends: spectral:oas
86747
86751
  rules: {}`;
86748
86752
 
86749
86753
  // ../../packages/entities/dist/rule/schema.js
86750
- var ruleSchema = baseRegistrySchema.extend({}).meta({ id: "rule" });
86754
+ var blockPublishOnSchema = external_exports.enum([
86755
+ "error",
86756
+ "warning",
86757
+ "info",
86758
+ "hint",
86759
+ "none"
86760
+ ]);
86761
+ var ruleSchema = baseRegistrySchema.extend({
86762
+ blockPublishOn: blockPublishOnSchema.default("none")
86763
+ }).meta({ id: "rule" });
86751
86764
 
86752
86765
  // ../../packages/entities/dist/managed-doc/helpers.js
86753
86766
  function getLegacyWysiwygVersion(versions) {
@@ -86762,8 +86775,8 @@ function getLegacyWysiwygVersion(versions) {
86762
86775
  var embedStatuses = ["pending", "success", "failed"];
86763
86776
 
86764
86777
  // ../../packages/entities/dist/agent/docs.js
86765
- var docsProjectTypes = ["sync", "wysiwyg"];
86766
- var docsProjectSchema = zod_default.object({
86778
+ var docsProjectTypes = ["sync", "wysiwyg", "docs"];
86779
+ var agentDocsProjectSchema = zod_default.object({
86767
86780
  id: zod_default.string(),
86768
86781
  uid: zod_default.string(),
86769
86782
  name: zod_default.string(),
@@ -86776,7 +86789,7 @@ var docsProjectSchema = zod_default.object({
86776
86789
  agentEnabled: zod_default.boolean(),
86777
86790
  createdAt: zod_default.string(),
86778
86791
  updatedAt: zod_default.string()
86779
- }).meta({ id: "docs-project" });
86792
+ }).meta({ id: "agent-docs-project" });
86780
86793
  var docsPublishSchema = zod_default.object({
86781
86794
  id: zod_default.string(),
86782
86795
  uid: zod_default.string(),
@@ -86851,19 +86864,58 @@ var keyDocumentSchema = zod_default.object({
86851
86864
  }).meta({ id: "key-documents" });
86852
86865
 
86853
86866
  // ../../packages/entities/dist/agent/mcp.js
86867
+ var mcpServerVersionChangeSources = [
86868
+ "created",
86869
+ "migration",
86870
+ "user",
86871
+ "docs-publish",
86872
+ "track-latest",
86873
+ "track-current",
86874
+ "linked-resource-change"
86875
+ ];
86876
+ var mcpServerVersionStatuses = ["draft", "approved"];
86877
+ var mcpDocumentTrackModes = [
86878
+ "pinned",
86879
+ "track-latest",
86880
+ "track-current"
86881
+ ];
86882
+ var mcpDocsProjectTrackModes = [
86883
+ "pinned",
86884
+ "track-active-publish"
86885
+ ];
86886
+ var mcpServerToolModes = ["generic", "curated", "both"];
86854
86887
  var mcpServerSchema = external_exports.object({
86855
86888
  id: external_exports.string(),
86856
86889
  teamUid: external_exports.string(),
86857
86890
  name: external_exports.string(),
86891
+ slug: slugSchema,
86858
86892
  createdAt: external_exports.string(),
86859
86893
  updatedAt: external_exports.string()
86860
86894
  }).meta({ id: "mcp-server" });
86895
+ var mcpServerVersionSchema = external_exports.object({
86896
+ id: external_exports.string(),
86897
+ mcpServerId: external_exports.string(),
86898
+ semver: external_exports.string(),
86899
+ parentVersionId: external_exports.string().nullable(),
86900
+ changeSource: external_exports.enum(mcpServerVersionChangeSources),
86901
+ changeNote: external_exports.string().nullable(),
86902
+ newToolsSuggestionDismissed: external_exports.boolean(),
86903
+ createdByUserId: external_exports.string().nullable(),
86904
+ status: external_exports.enum(mcpServerVersionStatuses),
86905
+ approvedByUserId: external_exports.string().nullable(),
86906
+ approvedAt: external_exports.string().nullable(),
86907
+ createdAt: external_exports.string()
86908
+ }).meta({ id: "mcp-server-version" });
86861
86909
  var mcpServerOperationToolSchema = external_exports.object({
86862
86910
  id: external_exports.string(),
86863
86911
  mcpServerId: external_exports.string(),
86912
+ mcpServerVersionId: external_exports.string(),
86864
86913
  operationId: external_exports.string(),
86865
86914
  searchToolEnabled: external_exports.boolean(),
86866
86915
  executeRequestToolEnabled: external_exports.boolean(),
86916
+ curatedToolEnabled: external_exports.boolean(),
86917
+ name: external_exports.string().nullable(),
86918
+ description: external_exports.string().nullable(),
86867
86919
  createdAt: external_exports.string(),
86868
86920
  updatedAt: external_exports.string()
86869
86921
  }).meta({
@@ -86872,6 +86924,7 @@ var mcpServerOperationToolSchema = external_exports.object({
86872
86924
  var mcpServerDocsPageToolSchema = external_exports.object({
86873
86925
  id: external_exports.string(),
86874
86926
  mcpServerId: external_exports.string(),
86927
+ mcpServerVersionId: external_exports.string(),
86875
86928
  docsPageId: external_exports.string(),
86876
86929
  searchToolEnabled: external_exports.boolean(),
86877
86930
  executeRequestToolEnabled: external_exports.boolean(),
@@ -86883,7 +86936,10 @@ var mcpServerDocsPageToolSchema = external_exports.object({
86883
86936
  var mcpServerDocumentVersionSchema = external_exports.object({
86884
86937
  id: external_exports.string(),
86885
86938
  mcpServerId: external_exports.string(),
86939
+ mcpServerVersionId: external_exports.string(),
86886
86940
  versionId: external_exports.string(),
86941
+ trackMode: external_exports.enum(mcpDocumentTrackModes),
86942
+ toolMode: external_exports.enum(mcpServerToolModes),
86887
86943
  createdAt: external_exports.string()
86888
86944
  }).meta({
86889
86945
  id: "mcp-server-document-version"
@@ -86891,7 +86947,9 @@ var mcpServerDocumentVersionSchema = external_exports.object({
86891
86947
  var mcpServerDocsPublishSchema = external_exports.object({
86892
86948
  id: external_exports.string(),
86893
86949
  mcpServerId: external_exports.string(),
86950
+ mcpServerVersionId: external_exports.string(),
86894
86951
  docsPublishId: external_exports.string(),
86952
+ trackMode: external_exports.enum(mcpDocsProjectTrackModes),
86895
86953
  createdAt: external_exports.string()
86896
86954
  }).meta({
86897
86955
  id: "mcp-server-docs-publish"
@@ -86900,8 +86958,11 @@ var mcpInstallationSchema = external_exports.object({
86900
86958
  id: external_exports.string(),
86901
86959
  mcpServerId: external_exports.string(),
86902
86960
  name: external_exports.string(),
86961
+ slug: slugSchema,
86903
86962
  documentAuth: external_exports.record(external_exports.string(), external_exports.unknown()),
86904
- isPrivate: external_exports.boolean()
86963
+ isPrivate: external_exports.boolean(),
86964
+ accessGroups: external_exports.array(external_exports.string()).default([]),
86965
+ loginPortalUid: external_exports.string().nullable().default(null)
86905
86966
  }).meta({ id: "mcp-installation" });
86906
86967
 
86907
86968
  // ../../packages/entities/dist/agent/monthly-usage.js
@@ -86915,7 +86976,7 @@ var monthlyUsageSchema = zod_default.object({
86915
86976
  messages: zod_default.number()
86916
86977
  }).meta({ id: "monthly-usage" });
86917
86978
 
86918
- // ../../node_modules/.pnpm/@scalar+helpers@0.5.3/node_modules/@scalar/helpers/dist/http/http-methods.js
86979
+ // ../../node_modules/.pnpm/@scalar+helpers@0.6.0/node_modules/@scalar/helpers/dist/http/http-methods.js
86919
86980
  var HTTP_METHODS = ["delete", "get", "head", "options", "patch", "post", "put", "trace"];
86920
86981
  var httpMethods = Object.freeze(new Set(HTTP_METHODS));
86921
86982
 
@@ -86928,7 +86989,10 @@ var operationSchema = zod_default.object({
86928
86989
  versionId: zod_default.uuid(),
86929
86990
  embedding: zod_default.number().array(),
86930
86991
  searchToolEnabled: zod_default.boolean(),
86931
- executeRequestToolEnabled: zod_default.boolean()
86992
+ executeRequestToolEnabled: zod_default.boolean(),
86993
+ operationId: zod_default.string().nullable(),
86994
+ summary: zod_default.string().nullable(),
86995
+ description: zod_default.string().nullable()
86932
86996
  }).meta({ id: "operation" });
86933
86997
 
86934
86998
  // ../../packages/entities/dist/agent/version.js
@@ -87549,6 +87613,8 @@ var sharedProjectSchema = entitySchema.extend({
87549
87613
  isPrivate: external_exports.boolean().default(false),
87550
87614
  /** Toggle AI agent features for the docs project */
87551
87615
  agentEnabled: external_exports.boolean().default(false),
87616
+ /** Toggle analytics tracking for the docs project */
87617
+ analyticsEnabled: external_exports.boolean().default(true),
87552
87618
  /** Set of allowed access groups */
87553
87619
  accessGroups: scalarSet(external_exports.set(nanoidSchema).max(50)).default([])
87554
87620
  }).meta({ id: "shared-project" });
@@ -87609,6 +87675,59 @@ var githubProjectSchema = sharedProjectSchema.extend({
87609
87675
  */
87610
87676
  repository: githubProjectRepositorySchema.nullable().optional()
87611
87677
  }).meta({ id: "github-project" });
87678
+ var forgejoRepositorySchema = external_exports.object({
87679
+ provider: external_exports.literal("forgejo"),
87680
+ forgejoOwner: external_exports.string(),
87681
+ forgejoRepo: external_exports.string(),
87682
+ branch: external_exports.string().default("main"),
87683
+ configPath: external_exports.string().default("scalar.config.json")
87684
+ }).meta({ id: "docs-project-repository-forgejo" });
87685
+ var githubRepositorySchema = external_exports.object({
87686
+ provider: external_exports.literal("github"),
87687
+ linkedBy: external_exports.string(),
87688
+ installationId: external_exports.number().int(),
87689
+ id: external_exports.number().int(),
87690
+ /** `owner/repo` form from the GitHub API */
87691
+ name: external_exports.string().min(2),
87692
+ branch: external_exports.string().default("main"),
87693
+ configPath: external_exports.string().default(""),
87694
+ publishOnMerge: external_exports.boolean().default(true),
87695
+ publishPreviews: external_exports.boolean().default(false),
87696
+ prComments: external_exports.boolean().default(false),
87697
+ expired: external_exports.boolean().default(false)
87698
+ }).meta({ id: "docs-project-repository-github" });
87699
+ var bitbucketRepositorySchema = external_exports.object({
87700
+ provider: external_exports.literal("bitbucket"),
87701
+ linkedBy: external_exports.string(),
87702
+ workspaceUuid: external_exports.string(),
87703
+ workspaceSlug: external_exports.string(),
87704
+ repoUuid: external_exports.string(),
87705
+ repoSlug: external_exports.string(),
87706
+ /** `workspaceSlug/repoSlug` for display, mirrored from GitHub for symmetry */
87707
+ name: external_exports.string().min(2),
87708
+ branch: external_exports.string().default("main"),
87709
+ configPath: external_exports.string().default(""),
87710
+ publishOnMerge: external_exports.boolean().default(true),
87711
+ publishPreviews: external_exports.boolean().default(false),
87712
+ prComments: external_exports.boolean().default(false),
87713
+ expired: external_exports.boolean().default(false),
87714
+ /** UUID returned by Bitbucket on hook create. Stored so we can delete the webhook on unlink. */
87715
+ webhookUuid: external_exports.string().default("")
87716
+ }).meta({ id: "docs-project-repository-bitbucket" });
87717
+ var docsProjectRepositorySchema = external_exports.discriminatedUnion("provider", [
87718
+ forgejoRepositorySchema,
87719
+ githubRepositorySchema,
87720
+ bitbucketRepositorySchema
87721
+ ]);
87722
+ var docsProjectSchema = sharedProjectSchema.extend({
87723
+ slug: slugSchema,
87724
+ publishStatus: external_exports.string().default(""),
87725
+ publishMessage: external_exports.string().default(""),
87726
+ repository: docsProjectRepositorySchema
87727
+ }).meta({ id: "docs-project" });
87728
+ function isGithubBackedDocsProject(project) {
87729
+ return project.repository.provider === "github";
87730
+ }
87612
87731
 
87613
87732
  // ../../packages/entities/dist/project/publish.js
87614
87733
  var ConfigVersion;
@@ -87624,7 +87743,8 @@ var publishRecordSchema = entitySchema.extend({
87624
87743
  external_exports.literal("deployed"),
87625
87744
  external_exports.literal("inactive"),
87626
87745
  external_exports.literal("error"),
87627
- external_exports.literal("deleted")
87746
+ external_exports.literal("deleted"),
87747
+ external_exports.literal("cancelled")
87628
87748
  ]),
87629
87749
  deployedAt: external_exports.number().nullable().default(null),
87630
87750
  message: external_exports.string().default(""),
@@ -88241,6 +88361,9 @@ var FeatureFlag;
88241
88361
  FeatureFlag2["Export"] = "export";
88242
88362
  FeatureFlag2["DocsMCP"] = "docsMcp";
88243
88363
  FeatureFlag2["DisableApiSSR"] = "disableApiSSR";
88364
+ FeatureFlag2["UnifiedDocs"] = "unifiedDocs";
88365
+ FeatureFlag2["DocsAnalytics"] = "docsAnalytics";
88366
+ FeatureFlag2["McpAnalytics"] = "mcpAnalytics";
88244
88367
  })(FeatureFlag || (FeatureFlag = {}));
88245
88368
  var featureSchema = external_exports.boolean().optional().meta({ id: "feature" });
88246
88369
  var featureFlagSchema = external_exports.object({
@@ -88254,7 +88377,10 @@ var featureFlagSchema = external_exports.object({
88254
88377
  [FeatureFlag.MCP]: featureSchema,
88255
88378
  [FeatureFlag.Export]: featureSchema,
88256
88379
  [FeatureFlag.DocsMCP]: featureSchema,
88257
- [FeatureFlag.DisableApiSSR]: featureSchema
88380
+ [FeatureFlag.DisableApiSSR]: featureSchema,
88381
+ [FeatureFlag.UnifiedDocs]: featureSchema,
88382
+ [FeatureFlag.DocsAnalytics]: featureSchema,
88383
+ [FeatureFlag.McpAnalytics]: featureSchema
88258
88384
  }).meta({ id: "feature-flag" });
88259
88385
 
88260
88386
  // ../../packages/entities/dist/team/schema.js
@@ -88556,6 +88682,14 @@ var docsAgentTokenSchema = external_exports.object({
88556
88682
  exp: external_exports.number()
88557
88683
  }).meta({ id: "docs-agent-token" });
88558
88684
 
88685
+ // ../../packages/entities/dist/user/bitbucket.js
88686
+ var userBitbucketSchema = entitySchema.extend({
88687
+ token: zod_default.string(),
88688
+ refreshToken: zod_default.string(),
88689
+ expiry: timestampSchema,
88690
+ refreshExpiry: timestampSchema
88691
+ }).meta({ id: "user-bitbucket" });
88692
+
88559
88693
  // ../../packages/entities/dist/user/github.js
88560
88694
  var userGithubSchema = entitySchema.extend({
88561
88695
  token: zod_default.string(),
@@ -88609,7 +88743,10 @@ var userSchema = entitySchema.extend({
88609
88743
  email: emailSchema,
88610
88744
  teams: teamRefSchema.array(),
88611
88745
  activeTeamId: zod_default.string().nullable(),
88612
- hasGithub: zod_default.boolean().optional().default(false)
88746
+ hasGithub: zod_default.boolean().optional().default(false),
88747
+ hasBitbucket: zod_default.boolean().optional().default(false),
88748
+ /** Forgejo personal access token for git operations */
88749
+ forgejoToken: zod_default.string().optional()
88613
88750
  }).meta({ id: "user" });
88614
88751
 
88615
88752
  // ../../packages/entities/dist/user/ban.js
@@ -88811,6 +88948,7 @@ var BaseCollections = {
88811
88948
  Passwords: "passwords",
88812
88949
  SignupOtp: "signup-otp",
88813
88950
  GithubUsers: "github-users",
88951
+ BitbucketUsers: "bitbucket-users",
88814
88952
  RefreshTokens: "refresh-tokens",
88815
88953
  Teams: "team",
88816
88954
  Deploys: "deploys",
@@ -88818,6 +88956,7 @@ var BaseCollections = {
88818
88956
  SignupData: "signup-data",
88819
88957
  Projects: (teamUid) => `team/${teamUid}/projects`,
88820
88958
  GithubProjects: (teamUid) => `team/${teamUid}/projects-github`,
88959
+ DocsProjects: (teamUid) => `team/${teamUid}/docs`,
88821
88960
  Themes: (teamUid) => `team/${teamUid}/themes`,
88822
88961
  PublishRecords: (teamUid) => `team/${teamUid}/publish`,
88823
88962
  ManagedDocs: (teamUid) => `team/${teamUid}/managed-docs`,
@@ -88917,6 +89056,214 @@ function accessGroupsApiFactory(requestService) {
88917
89056
  };
88918
89057
  }
88919
89058
 
89059
+ // ../../packages/bigquery/dist/schemas.js
89060
+ var analyticsRangeSchema = external_exports.enum(["24h", "7d", "30d", "90d"]);
89061
+ var analyticsGranularitySchema = external_exports.enum(["hour", "day"]);
89062
+ var consumerTypeSchema = external_exports.enum(["human", "bot", "llm", "mcp"]);
89063
+ var timeseriesPointSchema = external_exports.object({
89064
+ bucket: external_exports.string(),
89065
+ human: external_exports.number().int().nonnegative(),
89066
+ bot: external_exports.number().int().nonnegative(),
89067
+ llm: external_exports.number().int().nonnegative(),
89068
+ mcp: external_exports.number().int().nonnegative(),
89069
+ unique: external_exports.number().int().nonnegative()
89070
+ });
89071
+ var overviewResultSchema = external_exports.object({
89072
+ totals: external_exports.object({
89073
+ views: external_exports.number().int().nonnegative(),
89074
+ unique: external_exports.number().int().nonnegative(),
89075
+ human: external_exports.number().int().nonnegative(),
89076
+ bot: external_exports.number().int().nonnegative(),
89077
+ llm: external_exports.number().int().nonnegative(),
89078
+ mcp: external_exports.number().int().nonnegative()
89079
+ }),
89080
+ timeseries: external_exports.array(timeseriesPointSchema)
89081
+ });
89082
+ var topPageSchema = external_exports.object({
89083
+ path: external_exports.string(),
89084
+ views: external_exports.number().int().nonnegative(),
89085
+ unique: external_exports.number().int().nonnegative()
89086
+ });
89087
+ var topPagesResultSchema = external_exports.object({
89088
+ pages: external_exports.array(topPageSchema)
89089
+ });
89090
+ var topReferrerSchema = external_exports.object({
89091
+ referrer: external_exports.string(),
89092
+ views: external_exports.number().int().nonnegative()
89093
+ });
89094
+ var topReferrersResultSchema = external_exports.object({
89095
+ referrers: external_exports.array(topReferrerSchema)
89096
+ });
89097
+ var consumersResultSchema = external_exports.object({
89098
+ totals: external_exports.object({
89099
+ human: external_exports.number().int().nonnegative(),
89100
+ bot: external_exports.number().int().nonnegative(),
89101
+ llm: external_exports.number().int().nonnegative(),
89102
+ mcp: external_exports.number().int().nonnegative()
89103
+ }),
89104
+ timeseries: external_exports.array(timeseriesPointSchema)
89105
+ });
89106
+ var mcpEventKindSchema = external_exports.enum([
89107
+ "session-start",
89108
+ "tool-called",
89109
+ "tools-list"
89110
+ ]);
89111
+ var mcpConsumerKindSchema = external_exports.enum([
89112
+ "oauth",
89113
+ "personal_token",
89114
+ "docs_agent_token",
89115
+ "anonymous"
89116
+ ]);
89117
+ var mcpToolKindSchema = external_exports.enum(["generic", "curated"]);
89118
+ var mcpToolCategorySchema = external_exports.enum(["openapi", "docs"]);
89119
+ var mcpExportDatasetSchema = external_exports.enum([
89120
+ "tools",
89121
+ "consumers",
89122
+ "timeseries"
89123
+ ]);
89124
+ var mcpAnalyticsParamsSchema = external_exports.object({
89125
+ range: analyticsRangeSchema.default("7d"),
89126
+ granularity: analyticsGranularitySchema.optional(),
89127
+ installationId: external_exports.string().optional(),
89128
+ clientName: external_exports.string().optional(),
89129
+ subjectId: external_exports.string().optional()
89130
+ });
89131
+ var mcpTimeseriesPointSchema = external_exports.object({
89132
+ bucket: external_exports.string(),
89133
+ calls: external_exports.number().int().nonnegative(),
89134
+ errors: external_exports.number().int().nonnegative(),
89135
+ p50_ms: external_exports.number().nonnegative(),
89136
+ p95_ms: external_exports.number().nonnegative(),
89137
+ unique_consumers: external_exports.number().int().nonnegative()
89138
+ });
89139
+ var mcpCategoryTotalsSchema = external_exports.object({
89140
+ openapi: external_exports.number().int().nonnegative(),
89141
+ docs: external_exports.number().int().nonnegative()
89142
+ });
89143
+ var mcpOverviewTotalsSchema = external_exports.object({
89144
+ calls: external_exports.number().int().nonnegative(),
89145
+ errors: external_exports.number().int().nonnegative(),
89146
+ unique_consumers: external_exports.number().int().nonnegative(),
89147
+ p50_ms: external_exports.number().nonnegative(),
89148
+ p95_ms: external_exports.number().nonnegative(),
89149
+ error_rate: external_exports.number().min(0).max(1)
89150
+ });
89151
+ var mcpOverviewResultSchema = external_exports.object({
89152
+ totals: mcpOverviewTotalsSchema,
89153
+ timeseries: external_exports.array(mcpTimeseriesPointSchema),
89154
+ byCategory: mcpCategoryTotalsSchema
89155
+ });
89156
+ var mcpToolStatSchema = external_exports.object({
89157
+ tool_name: external_exports.string(),
89158
+ tool_kind: mcpToolKindSchema,
89159
+ tool_category: mcpToolCategorySchema.nullable(),
89160
+ operation_id: external_exports.string().nullable(),
89161
+ calls: external_exports.number().int().nonnegative(),
89162
+ errors: external_exports.number().int().nonnegative(),
89163
+ p50_ms: external_exports.number().nonnegative(),
89164
+ p95_ms: external_exports.number().nonnegative(),
89165
+ error_rate: external_exports.number().min(0).max(1),
89166
+ unique_consumers: external_exports.number().int().nonnegative()
89167
+ });
89168
+ var mcpToolsResultSchema = external_exports.object({
89169
+ tools: external_exports.array(mcpToolStatSchema)
89170
+ });
89171
+ var mcpConsumerStatSchema = external_exports.object({
89172
+ subject_id: external_exports.string(),
89173
+ subject_label: external_exports.string(),
89174
+ client_name: external_exports.string(),
89175
+ consumer_kind: mcpConsumerKindSchema,
89176
+ calls: external_exports.number().int().nonnegative(),
89177
+ errors: external_exports.number().int().nonnegative(),
89178
+ first_seen: external_exports.string(),
89179
+ last_seen: external_exports.string(),
89180
+ top_tool: external_exports.string().nullable()
89181
+ });
89182
+ var mcpConsumersResultSchema = external_exports.object({
89183
+ consumers: external_exports.array(mcpConsumerStatSchema)
89184
+ });
89185
+ var mcpLatencyByToolEntrySchema = external_exports.object({
89186
+ tool_name: external_exports.string(),
89187
+ calls: external_exports.number().int().nonnegative(),
89188
+ p50_ms: external_exports.number().nonnegative(),
89189
+ p95_ms: external_exports.number().nonnegative()
89190
+ });
89191
+ var mcpLatencyResultSchema = external_exports.object({
89192
+ tools: external_exports.array(mcpLatencyByToolEntrySchema)
89193
+ });
89194
+ var mcpErrorEntrySchema = external_exports.object({
89195
+ error_code: external_exports.string(),
89196
+ count: external_exports.number().int().nonnegative()
89197
+ });
89198
+ var mcpErrorsResultSchema = external_exports.object({
89199
+ totals: external_exports.object({
89200
+ calls: external_exports.number().int().nonnegative(),
89201
+ errors: external_exports.number().int().nonnegative(),
89202
+ error_rate: external_exports.number().min(0).max(1)
89203
+ }),
89204
+ byCode: external_exports.array(mcpErrorEntrySchema)
89205
+ });
89206
+
89207
+ // ../../packages/service-api/dist/apis/analytics.js
89208
+ function buildQuery(params) {
89209
+ const search = new URLSearchParams();
89210
+ for (const [k, v] of Object.entries(params)) {
89211
+ if (v === void 0)
89212
+ continue;
89213
+ search.set(k, String(v));
89214
+ }
89215
+ const qs = search.toString();
89216
+ return qs ? `?${qs}` : "";
89217
+ }
89218
+ function analyticsApiFactory(requestService) {
89219
+ async function getOverview(projectUid, args = {}) {
89220
+ return requestService.request({
89221
+ url: `core/analytics/projects/${projectUid}/overview${buildQuery({
89222
+ range: args.range,
89223
+ granularity: args.granularity
89224
+ })}`,
89225
+ method: "get",
89226
+ schema: overviewResultSchema
89227
+ });
89228
+ }
89229
+ async function getPages(projectUid, args = {}) {
89230
+ return requestService.request({
89231
+ url: `core/analytics/projects/${projectUid}/pages${buildQuery({
89232
+ range: args.range,
89233
+ limit: args.limit
89234
+ })}`,
89235
+ method: "get",
89236
+ schema: topPagesResultSchema
89237
+ });
89238
+ }
89239
+ async function getReferrers(projectUid, args = {}) {
89240
+ return requestService.request({
89241
+ url: `core/analytics/projects/${projectUid}/referrers${buildQuery({
89242
+ range: args.range,
89243
+ limit: args.limit
89244
+ })}`,
89245
+ method: "get",
89246
+ schema: topReferrersResultSchema
89247
+ });
89248
+ }
89249
+ async function getConsumers(projectUid, args = {}) {
89250
+ return requestService.request({
89251
+ url: `core/analytics/projects/${projectUid}/consumers${buildQuery({
89252
+ range: args.range,
89253
+ granularity: args.granularity
89254
+ })}`,
89255
+ method: "get",
89256
+ schema: consumersResultSchema
89257
+ });
89258
+ }
89259
+ return {
89260
+ getOverview,
89261
+ getPages,
89262
+ getReferrers,
89263
+ getConsumers
89264
+ };
89265
+ }
89266
+
88920
89267
  // ../../packages/service-api/dist/apis/login-portals.js
88921
89268
  function loginPortalsApiFactory(requestService) {
88922
89269
  async function get(slug) {
@@ -89313,7 +89660,8 @@ function rulesApiFactory(requestService) {
89313
89660
  description: true,
89314
89661
  slug: true,
89315
89662
  namespace: true,
89316
- isPrivate: true
89663
+ isPrivate: true,
89664
+ blockPublishOn: true
89317
89665
  }).array()
89318
89666
  });
89319
89667
  }
@@ -89916,6 +90264,190 @@ function authApiFactory(requestService) {
89916
90264
  };
89917
90265
  }
89918
90266
 
90267
+ // ../../packages/service-api/dist/apis/bitbucket.js
90268
+ var bitbucketRepoSummarySchema = external_exports.object({
90269
+ uuid: external_exports.string(),
90270
+ slug: external_exports.string(),
90271
+ fullName: external_exports.string(),
90272
+ defaultBranch: external_exports.string(),
90273
+ isPrivate: external_exports.boolean(),
90274
+ workspaceUuid: external_exports.string(),
90275
+ workspaceSlug: external_exports.string()
90276
+ });
90277
+ var bitbucketWorkspaceSchema = external_exports.object({
90278
+ uuid: external_exports.string(),
90279
+ slug: external_exports.string(),
90280
+ name: external_exports.string(),
90281
+ iconUrl: external_exports.string().optional(),
90282
+ repos: bitbucketRepoSummarySchema.array()
90283
+ });
90284
+ function bitbucketApiFactory(requestService) {
90285
+ async function initiateLink(opts = {}) {
90286
+ const params = new URLSearchParams();
90287
+ if (opts.redirect)
90288
+ params.set("redirect", opts.redirect);
90289
+ const qs = params.toString() ? `?${params.toString()}` : "";
90290
+ return await requestService.request({
90291
+ url: `core/vcs/bitbucket/link/initiate${qs}`,
90292
+ method: "get",
90293
+ schema: external_exports.object({ url: external_exports.string() })
90294
+ });
90295
+ }
90296
+ async function getWorkspaces() {
90297
+ return await requestService.request({
90298
+ url: "core/vcs/bitbucket/workspaces",
90299
+ method: "get",
90300
+ schema: bitbucketWorkspaceSchema.array()
90301
+ });
90302
+ }
90303
+ async function listDocsProjectBitbucketBranches(uid, opts = {}) {
90304
+ const params = new URLSearchParams();
90305
+ if (opts.query)
90306
+ params.set("query", opts.query);
90307
+ if (opts.page !== void 0)
90308
+ params.set("page", String(opts.page));
90309
+ if (opts.perPage !== void 0)
90310
+ params.set("perPage", String(opts.perPage));
90311
+ const qs = params.toString() ? `?${params.toString()}` : "";
90312
+ return await requestService.request({
90313
+ url: `core/vcs/bitbucket/docs-project/${uid}/branches${qs}`,
90314
+ method: "get",
90315
+ schema: external_exports.object({
90316
+ branches: external_exports.object({
90317
+ name: external_exports.string(),
90318
+ isDefault: external_exports.boolean()
90319
+ }).array(),
90320
+ hasMore: external_exports.boolean()
90321
+ })
90322
+ });
90323
+ }
90324
+ async function disconnectAccount() {
90325
+ return await requestService.request({
90326
+ url: "core/vcs/bitbucket/disconnect-account",
90327
+ method: "post",
90328
+ schema: external_exports.object({ success: external_exports.literal(true) })
90329
+ });
90330
+ }
90331
+ return {
90332
+ initiateLink,
90333
+ getWorkspaces,
90334
+ listDocsProjectBitbucketBranches,
90335
+ disconnectAccount
90336
+ };
90337
+ }
90338
+
90339
+ // ../../packages/service-api/dist/apis/docs-project.js
90340
+ function docsProjectApiFactory(requestService) {
90341
+ async function createProject(data) {
90342
+ return await requestService.request({
90343
+ url: "core/docs-projects/create",
90344
+ method: "post",
90345
+ data,
90346
+ schema: docsProjectSchema
90347
+ });
90348
+ }
90349
+ async function deleteProject(projectUid) {
90350
+ return await requestService.request({
90351
+ url: "core/docs-projects/delete",
90352
+ method: "delete",
90353
+ data: { projectUid },
90354
+ schema: external_exports.null()
90355
+ });
90356
+ }
90357
+ async function getProject(slug) {
90358
+ return await requestService.request({
90359
+ url: `core/docs-projects/${slug}`,
90360
+ method: "get",
90361
+ schema: docsProjectSchema
90362
+ });
90363
+ }
90364
+ async function getGitCredentials() {
90365
+ return await requestService.request({
90366
+ url: "core/forgejo/git-credentials",
90367
+ method: "get",
90368
+ schema: external_exports.object({
90369
+ forgejoBaseUrl: external_exports.string(),
90370
+ forgejoToken: external_exports.string(),
90371
+ forgejoUsername: external_exports.string()
90372
+ })
90373
+ });
90374
+ }
90375
+ async function updateConfigPath(projectUid, configPath) {
90376
+ return await requestService.request({
90377
+ url: "core/docs-projects/update-config-path",
90378
+ method: "post",
90379
+ data: { projectUid, configPath },
90380
+ schema: external_exports.null()
90381
+ });
90382
+ }
90383
+ async function linkGithub(data) {
90384
+ return await requestService.request({
90385
+ url: `core/docs-projects/${data.projectUid}/link-github`,
90386
+ method: "post",
90387
+ data: { installationId: data.installationId, repoId: data.repoId },
90388
+ schema: external_exports.object({
90389
+ pullRequest: external_exports.object({
90390
+ url: external_exports.string(),
90391
+ number: external_exports.number().int(),
90392
+ branch: external_exports.string()
90393
+ }),
90394
+ project: docsProjectSchema
90395
+ })
90396
+ });
90397
+ }
90398
+ async function unlinkGithub(projectUid) {
90399
+ return await requestService.request({
90400
+ url: `core/docs-projects/${projectUid}/unlink-github`,
90401
+ method: "post",
90402
+ schema: external_exports.object({ project: docsProjectSchema })
90403
+ });
90404
+ }
90405
+ async function linkBitbucket(data) {
90406
+ return await requestService.request({
90407
+ url: `core/docs-projects/${data.projectUid}/link-bitbucket`,
90408
+ method: "post",
90409
+ data: {
90410
+ workspaceUuid: data.workspaceUuid,
90411
+ repoUuid: data.repoUuid
90412
+ },
90413
+ schema: external_exports.object({
90414
+ pullRequest: external_exports.object({
90415
+ url: external_exports.string(),
90416
+ number: external_exports.number().int(),
90417
+ branch: external_exports.string()
90418
+ }),
90419
+ project: docsProjectSchema
90420
+ })
90421
+ });
90422
+ }
90423
+ async function unlinkBitbucket(projectUid) {
90424
+ return await requestService.request({
90425
+ url: `core/docs-projects/${projectUid}/unlink-bitbucket`,
90426
+ method: "post",
90427
+ schema: external_exports.object({ project: docsProjectSchema })
90428
+ });
90429
+ }
90430
+ async function refreshBitbucketWebhook(projectUid) {
90431
+ return await requestService.request({
90432
+ url: `core/docs-projects/${projectUid}/bitbucket/refresh-webhook`,
90433
+ method: "post",
90434
+ schema: external_exports.object({ project: docsProjectSchema })
90435
+ });
90436
+ }
90437
+ return {
90438
+ createProject,
90439
+ deleteProject,
90440
+ getProject,
90441
+ getGitCredentials,
90442
+ updateConfigPath,
90443
+ linkGithub,
90444
+ unlinkGithub,
90445
+ linkBitbucket,
90446
+ unlinkBitbucket,
90447
+ refreshBitbucketWebhook
90448
+ };
90449
+ }
90450
+
89919
90451
  // ../../packages/service-api/dist/apis/feedback.js
89920
90452
  function feedbackApiFactory(requestService) {
89921
90453
  async function submit(email3, feedback) {
@@ -89936,6 +90468,19 @@ function feedbackApiFactory(requestService) {
89936
90468
 
89937
90469
  // ../../packages/service-api/dist/apis/github.js
89938
90470
  function githubApiFactory(requestService) {
90471
+ async function initiateLink(opts = {}) {
90472
+ const params = new URLSearchParams();
90473
+ if (opts.redirect)
90474
+ params.set("redirect", opts.redirect);
90475
+ const qs = params.toString() ? `?${params.toString()}` : "";
90476
+ return await requestService.request({
90477
+ url: `core/github/link/initiate${qs}`,
90478
+ method: "get",
90479
+ schema: external_exports.object({
90480
+ url: external_exports.string()
90481
+ })
90482
+ });
90483
+ }
89939
90484
  async function getRepos() {
89940
90485
  return await requestService.request({
89941
90486
  url: "core/github/repos",
@@ -89972,6 +90517,60 @@ function githubApiFactory(requestService) {
89972
90517
  schema: external_exports.null()
89973
90518
  });
89974
90519
  }
90520
+ async function getDocsProjectGithubCommits(uid, opts = {}) {
90521
+ const params = new URLSearchParams();
90522
+ if (opts.branch)
90523
+ params.set("branch", opts.branch);
90524
+ if (opts.page !== void 0)
90525
+ params.set("page", String(opts.page));
90526
+ if (opts.perPage !== void 0)
90527
+ params.set("perPage", String(opts.perPage));
90528
+ const qs = params.toString() ? `?${params.toString()}` : "";
90529
+ return await requestService.request({
90530
+ url: `core/github/docs-project/${uid}/commits${qs}`,
90531
+ method: "get",
90532
+ schema: external_exports.object({
90533
+ sha: external_exports.string(),
90534
+ message: external_exports.string(),
90535
+ authorName: external_exports.string(),
90536
+ authorEmail: external_exports.string(),
90537
+ timestamp: external_exports.number()
90538
+ }).array()
90539
+ });
90540
+ }
90541
+ async function listDocsProjectGithubBranches(uid, opts = {}) {
90542
+ const params = new URLSearchParams();
90543
+ if (opts.query)
90544
+ params.set("query", opts.query);
90545
+ if (opts.page !== void 0)
90546
+ params.set("page", String(opts.page));
90547
+ if (opts.perPage !== void 0)
90548
+ params.set("perPage", String(opts.perPage));
90549
+ const qs = params.toString() ? `?${params.toString()}` : "";
90550
+ return await requestService.request({
90551
+ url: `core/github/docs-project/${uid}/branches${qs}`,
90552
+ method: "get",
90553
+ schema: external_exports.object({
90554
+ branches: external_exports.object({
90555
+ name: external_exports.string(),
90556
+ isDefault: external_exports.boolean()
90557
+ }).array(),
90558
+ hasMore: external_exports.boolean()
90559
+ })
90560
+ });
90561
+ }
90562
+ async function createDocsProjectGithubPullRequest(uid, data) {
90563
+ return await requestService.request({
90564
+ url: `core/github/docs-project/${uid}/pull-request`,
90565
+ method: "post",
90566
+ data,
90567
+ schema: external_exports.object({
90568
+ url: external_exports.string(),
90569
+ number: external_exports.number(),
90570
+ alreadyExists: external_exports.boolean()
90571
+ })
90572
+ });
90573
+ }
89975
90574
  async function publishRepo(githubProjectId) {
89976
90575
  return await requestService.request({
89977
90576
  url: "core/publish/github",
@@ -90041,6 +90640,13 @@ function githubApiFactory(requestService) {
90041
90640
  })
90042
90641
  });
90043
90642
  }
90643
+ async function disconnectAccount() {
90644
+ return await requestService.request({
90645
+ url: "core/vcs/github/disconnect-account",
90646
+ method: "post",
90647
+ schema: external_exports.object({ success: external_exports.literal(true) })
90648
+ });
90649
+ }
90044
90650
  async function validateConfigFile(uid, configPath) {
90045
90651
  return await requestService.request({
90046
90652
  url: "core/github/config/validate",
@@ -90064,9 +90670,13 @@ function githubApiFactory(requestService) {
90064
90670
  });
90065
90671
  }
90066
90672
  return {
90673
+ initiateLink,
90067
90674
  getRepos,
90068
90675
  linkRepo,
90069
90676
  unlinkRepo,
90677
+ getDocsProjectGithubCommits,
90678
+ listDocsProjectGithubBranches,
90679
+ createDocsProjectGithubPullRequest,
90070
90680
  publishRepo,
90071
90681
  getRepoInfo,
90072
90682
  checkSlug,
@@ -90075,7 +90685,8 @@ function githubApiFactory(requestService) {
90075
90685
  deleteProject,
90076
90686
  validateConfigFile,
90077
90687
  getProject,
90078
- getProjects
90688
+ getProjects,
90689
+ disconnectAccount
90079
90690
  };
90080
90691
  }
90081
90692
 
@@ -90255,6 +90866,19 @@ function publishApiFactory(requestService) {
90255
90866
  schema: external_exports.object({ publishUid: nanoidSchema })
90256
90867
  });
90257
90868
  }
90869
+ async function publishDocsProject({ slug, configPath, preview, commitSha }) {
90870
+ return await requestService.request({
90871
+ url: "publish-deploy/publish/docs-project",
90872
+ method: "post",
90873
+ data: {
90874
+ slug,
90875
+ configPath,
90876
+ preview,
90877
+ commitSha
90878
+ },
90879
+ schema: external_exports.object({ publishUid: nanoidSchema })
90880
+ });
90881
+ }
90258
90882
  async function publishWysiwyg(uid) {
90259
90883
  return await requestService.request({
90260
90884
  url: "publish-deploy/publish/wysiwyg",
@@ -90313,6 +90937,16 @@ function publishApiFactory(requestService) {
90313
90937
  schema: external_exports.null()
90314
90938
  });
90315
90939
  }
90940
+ async function cancelPublish(publishUid) {
90941
+ return await requestService.request({
90942
+ url: "core/publish/cancel",
90943
+ method: "post",
90944
+ data: {
90945
+ publishUid
90946
+ },
90947
+ schema: external_exports.null()
90948
+ });
90949
+ }
90316
90950
  async function deleteRecord(publishUid) {
90317
90951
  return await requestService.request({
90318
90952
  url: "core/publish",
@@ -90394,6 +91028,7 @@ function publishApiFactory(requestService) {
90394
91028
  }
90395
91029
  return {
90396
91030
  publishCli,
91031
+ publishDocsProject,
90397
91032
  publishGithub: publishGithub2,
90398
91033
  publishTemplate,
90399
91034
  publishWysiwyg,
@@ -90402,6 +91037,7 @@ function publishApiFactory(requestService) {
90402
91037
  unpublish,
90403
91038
  deleteRecord,
90404
91039
  redeploy,
91040
+ cancelPublish,
90405
91041
  bulkDelete,
90406
91042
  getPublishLogs,
90407
91043
  getDomainAvailability,
@@ -90770,8 +91406,10 @@ var apiServiceFactory = (baseUrl, getAuthToken, getNewTokens) => {
90770
91406
  hocuspocus: hocuspocusApiFactory(requestService),
90771
91407
  publish: publishApiFactory(requestService),
90772
91408
  github: githubApiFactory(requestService),
91409
+ bitbucket: bitbucketApiFactory(requestService),
90773
91410
  signup: signupApiFactory(requestService),
90774
91411
  project: projectApiFactory(requestService),
91412
+ docsProject: docsProjectApiFactory(requestService),
90775
91413
  managedDocs: managedDocsApiFactory(requestService),
90776
91414
  managedSchemas: managedSchemasApiFactory(requestService),
90777
91415
  rules: rulesApiFactory(requestService),
@@ -90780,7 +91418,8 @@ var apiServiceFactory = (baseUrl, getAuthToken, getNewTokens) => {
90780
91418
  loginPortals: loginPortalsApiFactory(requestService),
90781
91419
  sdks: sdksApiFactory(requestService),
90782
91420
  waitlist: waitlistApiFactory(requestService),
90783
- workspace: workspaceApiFactory(requestService)
91421
+ workspace: workspaceApiFactory(requestService),
91422
+ analytics: analyticsApiFactory(requestService)
90784
91423
  };
90785
91424
  };
90786
91425
 
@@ -90801,7 +91440,7 @@ var config2 = {
90801
91440
  }
90802
91441
  },
90803
91442
  cdnUrl: process.env.CDN_URL ?? "https://cdn.scalar.com",
90804
- ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.3.9"
91443
+ ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.4.1"
90805
91444
  };
90806
91445
 
90807
91446
  // src/domains/auth/login/helpers/personal-token-generate-access.ts
@@ -90965,7 +91604,7 @@ var setMetadata = async (metadata) => {
90965
91604
  JSON.stringify({ ...currentMetadata, ...metadata })
90966
91605
  );
90967
91606
  };
90968
- var fileExists = async (path12) => !!await fs.stat(path12).catch(() => false);
91607
+ var fileExists = async (path13) => !!await fs.stat(path13).catch(() => false);
90969
91608
  var getMetadata = async () => {
90970
91609
  const metadata = await fileExists(METADATA_FILE_PATH) ? await fs.readFile(METADATA_FILE_PATH, { encoding: "utf-8" }) : "{}";
90971
91610
  try {
@@ -91605,7 +92244,7 @@ var printSpecificationBanner = (result) => {
91605
92244
  }
91606
92245
  const pathsCount = Object.keys(schema.paths ?? {}).length;
91607
92246
  const operationsCount = Object.values(schema.paths ?? {}).reduce(
91608
- (acc, path12) => acc + Object.keys(path12).length,
92247
+ (acc, path13) => acc + Object.keys(path13).length,
91609
92248
  0
91610
92249
  );
91611
92250
  output.info().title(
@@ -91744,8 +92383,8 @@ function BundleCommand() {
91744
92383
  }
91745
92384
 
91746
92385
  // src/domains/registry/helpers/links.ts
91747
- function registryUrl(path12) {
91748
- return `${config2.projects.registry}/${path12}`;
92386
+ function registryUrl(path13) {
92387
+ return `${config2.projects.registry}/${path13}`;
91749
92388
  }
91750
92389
 
91751
92390
  // src/domains/schema/helpers/links.ts
@@ -92595,16 +93234,16 @@ import { Command as Command17 } from "commander";
92595
93234
  import { join, normalize as normalize2 } from "@scalar/openapi-parser";
92596
93235
 
92597
93236
  // src/domains/document/join/helpers.ts
92598
- var getValueByPath = (input, path12) => {
92599
- return path12.reduce((acc, segment) => {
93237
+ var getValueByPath = (input, path13) => {
93238
+ return path13.reduce((acc, segment) => {
92600
93239
  if (acc && typeof acc === "object" && acc !== null && segment in acc) {
92601
93240
  return acc[segment];
92602
93241
  }
92603
93242
  return void 0;
92604
93243
  }, input);
92605
93244
  };
92606
- var getPrefixes = (documents, path12) => {
92607
- const segments = path12.split(".");
93245
+ var getPrefixes = (documents, path13) => {
93246
+ const segments = path13.split(".");
92608
93247
  return documents.map((doc) => {
92609
93248
  const value = getValueByPath(doc, segments);
92610
93249
  if (value === void 0) {
@@ -92915,16 +93554,16 @@ var printAvailablePaths = (specification) => {
92915
93554
  if (specification?.paths === void 0 || Object.keys(specification?.paths).length === 0) {
92916
93555
  output.warn().title(as17.grey("Could not find any paths in the OpenAPI file.")).print();
92917
93556
  }
92918
- for (const path12 in specification?.paths ?? []) {
92919
- if (specification?.paths?.[path12] === void 0) {
93557
+ for (const path13 in specification?.paths ?? []) {
93558
+ if (specification?.paths?.[path13] === void 0) {
92920
93559
  continue;
92921
93560
  }
92922
- for (const method in specification.paths[path12]) {
92923
- if (specification.paths[path12][method] === void 0) {
93561
+ for (const method in specification.paths[path13]) {
93562
+ if (specification.paths[path13][method] === void 0) {
92924
93563
  continue;
92925
93564
  }
92926
93565
  output.info().line(
92927
- `${as17[getMethodColor(method)].bold(method.toUpperCase().padEnd(6))} ${as17.grey(`${path12}`)}`
93566
+ `${as17[getMethodColor(method)].bold(method.toUpperCase().padEnd(6))} ${as17.grey(`${path13}`)}`
92928
93567
  ).print();
92929
93568
  }
92930
93569
  }
@@ -92974,7 +93613,7 @@ function MockCommand() {
92974
93613
  await watchFile(fileArgument, async () => {
92975
93614
  const newResult = await loadOpenApiFile(fileArgument);
92976
93615
  const specificationHasChanged = newResult?.specification && JSON.stringify(specification) !== JSON.stringify(newResult.specification);
92977
- if (specificationHasChanged) {
93616
+ if (specificationHasChanged && newResult.valid) {
92978
93617
  output.info().title(as18.grey("OpenAPI file modified")).print();
92979
93618
  printSpecificationBanner({
92980
93619
  version: newResult.version,
@@ -93110,7 +93749,7 @@ function ServeCommand() {
93110
93749
  const subscription = await watchFile(inputArgument, async () => {
93111
93750
  const newResult = await loadOpenApiFile(inputArgument);
93112
93751
  const specificationHasChanged = newResult?.specification && JSON.stringify(specification) !== JSON.stringify(newResult.specification);
93113
- if (specificationHasChanged) {
93752
+ if (specificationHasChanged && newResult.valid) {
93114
93753
  output.info().title(as20.grey("OpenAPI file modified")).print();
93115
93754
  printSpecificationBanner({
93116
93755
  version: newResult.version,
@@ -93415,12 +94054,12 @@ documentCommands.forEach((command) => documentDomain.addCommand(command()));
93415
94054
  var document_default = documentDomain;
93416
94055
 
93417
94056
  // src/domains/project/index.ts
93418
- import { Command as Command36 } from "commander";
94057
+ import { Command as Command37 } from "commander";
93419
94058
 
93420
94059
  // src/domains/project/preview/index.ts
93421
94060
  import { text as text4 } from "@clack/prompts";
93422
94061
  import as27 from "ansis";
93423
- import { Command as Command31 } from "commander";
94062
+ import { Command as Command32 } from "commander";
93424
94063
 
93425
94064
  // src/domains/project/check-config/index.ts
93426
94065
  import fs12 from "node:fs";
@@ -93784,7 +94423,7 @@ var internalLinkNavigationEntrySchema = linkNavigationEntrySchema.extend({
93784
94423
  uid: nanoidSchema
93785
94424
  });
93786
94425
 
93787
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/api-reference/api-client-plugin.js
94426
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-client-plugin.js
93788
94427
  var sectionViewSchema = external_exports.object({
93789
94428
  title: external_exports.string().optional(),
93790
94429
  // Since this is meant to be a Vue component, we'll use unknown
@@ -93816,7 +94455,7 @@ var apiClientPluginSchema = external_exports.function({
93816
94455
  })
93817
94456
  });
93818
94457
 
93819
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/api-reference/base-configuration.js
94458
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/base-configuration.js
93820
94459
  var externalUrlsSchema = zod_default.object({
93821
94460
  dashboardUrl: zod_default.string().prefault("https://dashboard.scalar.com"),
93822
94461
  registryUrl: zod_default.string().prefault("https://registry.scalar.com"),
@@ -93972,7 +94611,7 @@ var baseConfigurationSchema = zod_default.object({
93972
94611
  externalUrls: externalUrlsSchema.prefault({})
93973
94612
  });
93974
94613
 
93975
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/api-reference/source-configuration.js
94614
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/source-configuration.js
93976
94615
  var sourceConfigurationSchema = zod_default.object({
93977
94616
  default: zod_default.boolean().default(false).optional().catch(false),
93978
94617
  /**
@@ -94069,10 +94708,10 @@ var sourceConfigurationSchema = zod_default.object({
94069
94708
  }).optional()
94070
94709
  });
94071
94710
 
94072
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/api-reference/api-client-configuration.js
94711
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-client-configuration.js
94073
94712
  var apiClientConfigurationSchema = baseConfigurationSchema.extend(sourceConfigurationSchema.shape);
94074
94713
 
94075
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/api-reference/api-reference-plugin.js
94714
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-reference-plugin.js
94076
94715
  var openApiExtensionSchema = external_exports.object({
94077
94716
  /**
94078
94717
  * Name of specification extension property. Has to start with `x-`.
@@ -94145,7 +94784,7 @@ var apiReferencePluginSchema = external_exports.function({
94145
94784
  })
94146
94785
  });
94147
94786
 
94148
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/api-reference/api-reference-configuration.js
94787
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/api-reference-configuration.js
94149
94788
  var fetchLikeSchema = external_exports.custom();
94150
94789
  var apiReferenceConfigurationSchema = baseConfigurationSchema.extend({
94151
94790
  /**
@@ -94499,7 +95138,7 @@ var apiReferenceConfigurationWithSourceSchema = apiReferenceConfigurationSchema.
94499
95138
  return configuration;
94500
95139
  });
94501
95140
 
94502
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/api-reference/html-rendering-configuration.js
95141
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/api-reference/html-rendering-configuration.js
94503
95142
  var htmlRenderingConfigurationSchema = external_exports.object({
94504
95143
  /**
94505
95144
  * The URL to the Scalar API Reference JS CDN.
@@ -94517,7 +95156,7 @@ var htmlRenderingConfigurationSchema = external_exports.object({
94517
95156
  pageTitle: external_exports.string().optional().default("Scalar API Reference")
94518
95157
  });
94519
95158
 
94520
- // ../../node_modules/.pnpm/@scalar+types@0.9.3/node_modules/@scalar/types/dist/legacy/reference-config.js
95159
+ // ../../node_modules/.pnpm/@scalar+types@0.9.6/node_modules/@scalar/types/dist/legacy/reference-config.js
94521
95160
  var XScalarStability;
94522
95161
  (function(XScalarStability2) {
94523
95162
  XScalarStability2["Deprecated"] = "deprecated";
@@ -94525,6 +95164,17 @@ var XScalarStability;
94525
95164
  XScalarStability2["Stable"] = "stable";
94526
95165
  })(XScalarStability || (XScalarStability = {}));
94527
95166
 
95167
+ // ../../packages/scalar-config/dist/schema/ruleset.js
95168
+ var blockPublishOnSchema2 = external_exports.enum(["error", "warning", "info", "hint", "none"]).describe("Severity threshold at or above which ruleset findings block publishing.");
95169
+ var rulesetConfigSchema = external_exports.object({
95170
+ filepath: external_exports.string().optional().describe("Relative path to the Spectral ruleset file with respect to the configuration root."),
95171
+ slug: external_exports.string().optional().describe("Slug of the ruleset in the team registry."),
95172
+ namespace: external_exports.string().optional().describe("Namespace of the ruleset in the team registry."),
95173
+ version: external_exports.string().optional().describe("Version of the ruleset in the team registry."),
95174
+ 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."),
95175
+ blockPublishOn: blockPublishOnSchema2.optional().describe("Override the registry ruleset policy for this scope. Falls back to the registry ruleset record when omitted.")
95176
+ });
95177
+
94528
95178
  // ../../packages/scalar-config/dist/schema/navigation/openapi.js
94529
95179
  var scopedApiConfigSchema = apiReferenceConfigurationSchema.pick({
94530
95180
  authentication: true,
@@ -94557,26 +95207,27 @@ var openapiNavigationEntryBase = external_exports.object({
94557
95207
  /** Optional Scalar API reference configuration for the OpenAPI file. */
94558
95208
  config: scopedApiConfigSchema.optional().describe("Optional Scalar API reference configuration for the OpenAPI file."),
94559
95209
  singlePage: external_exports.boolean().default(false).describe("Render Scalar references in a single scrollable page. Navigation uses # fragments."),
94560
- showInSidebar: external_exports.boolean().default(true)
95210
+ showInSidebar: external_exports.boolean().default(true),
95211
+ /** Optional initial open state of the group in the sidebar. Note: This only applies if the mode is `folder`. */
95212
+ 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`.")
94561
95213
  });
94562
- var openapiNavigationEntryPathSchema = openapiNavigationEntryBase.extend({
94563
- /** Relative path to the OpenAPI file with respect to the configuration root. */
94564
- filepath: external_exports.string().describe("Relative path to the OpenAPI file with respect to the configuration root.")
94565
- }).describe("Local OpenAPI file.");
94566
- var openapiNavigationEntryRegistrySchema = openapiNavigationEntryBase.extend({
94567
- /** The slug of the OpenAPI file in the registry. */
94568
- slug: external_exports.string(),
94569
- /** The namespace of the OpenAPI file in the registry. */
94570
- namespace: external_exports.string(),
94571
- /** The version of the OpenAPI file in the registry. */
94572
- version: external_exports.string()
94573
- }).describe("OpenAPI file from a registry.");
95214
+ var openapiNavigationEntryPathBase = openapiNavigationEntryBase.extend({
95215
+ filepath: external_exports.string().optional().describe("Relative path to the OpenAPI file with respect to the configuration root."),
95216
+ slug: external_exports.string().optional().describe("The slug of the OpenAPI file in the registry."),
95217
+ namespace: external_exports.string().optional().describe("The namespace of the OpenAPI file in the registry."),
95218
+ version: external_exports.string().optional().describe("The version of the OpenAPI file in the registry."),
95219
+ disableSync: external_exports.boolean().optional().describe("When `filepath` is set, skip auto-publishing the spec to the Registry on docs publish."),
95220
+ ruleset: rulesetConfigSchema.optional().describe("Spectral ruleset and publish policy for this route. Overrides the project-level ruleset on a per-key basis.")
95221
+ });
95222
+ var hasOpenapiSource = (data) => !!data.filepath || !!data.slug && !!data.namespace && !!data.version;
95223
+ var openapiNavigationEntryPathSchema = openapiNavigationEntryPathBase.refine(hasOpenapiSource, {
95224
+ message: "OpenAPI route must have either `filepath`, or all of `namespace`, `slug`, and `version`."
95225
+ }).describe("Local OpenAPI file with optional Registry coordinates for auto-publish.");
94574
95226
  var openapiNavigationEntryLiveLinkSchema = openapiNavigationEntryBase.extend({
94575
95227
  url: external_exports.string()
94576
95228
  }).describe("Live OpenAPI file from a URL. Fetched on each page load");
94577
95229
  var openapiNavigationEntrySchema = external_exports.union([
94578
95230
  openapiNavigationEntryPathSchema,
94579
- openapiNavigationEntryRegistrySchema,
94580
95231
  openapiNavigationEntryLiveLinkSchema
94581
95232
  ]);
94582
95233
  var baseInternalOpenapiSchema = external_exports.object({
@@ -94591,8 +95242,13 @@ var baseInternalOpenapiSchema = external_exports.object({
94591
95242
  title: external_exports.string(),
94592
95243
  description: external_exports.string()
94593
95244
  });
94594
- var internalOpenapiNavigationEntryPathSchema = openapiNavigationEntryPathSchema.extend(baseInternalOpenapiSchema.shape);
94595
- var internalOpenapiNavigationEntryRegistrySchema = openapiNavigationEntryRegistrySchema.extend({
95245
+ var internalOpenapiNavigationEntryPathSchema = openapiNavigationEntryPathBase.extend({
95246
+ filepath: external_exports.string()
95247
+ }).extend(baseInternalOpenapiSchema.shape);
95248
+ var internalOpenapiNavigationEntryRegistrySchema = openapiNavigationEntryBase.extend({
95249
+ slug: external_exports.string(),
95250
+ namespace: external_exports.string(),
95251
+ version: external_exports.string(),
94596
95252
  apiVersion: external_exports.string()
94597
95253
  }).extend(baseInternalOpenapiSchema.shape);
94598
95254
  var internalOpenapiNavigationEntryLiveLinkSchema = openapiNavigationEntryLiveLinkSchema.extend(baseInternalOpenapiSchema.shape);
@@ -94626,7 +95282,9 @@ var pageFrontmatterSchema = external_exports.object({
94626
95282
  }).optional().describe("Search bar configuration")
94627
95283
  }).optional().describe("Optional layout options for the page. This will override the global layout options."),
94628
95284
  /** Optional head options (meta, scripts, etc-). */
94629
- head: headSchema.optional()
95285
+ head: headSchema.optional(),
95286
+ /** Cover photo URL rendered as a banner above the page content. */
95287
+ backgroundImage: external_exports.string().optional().describe("Cover photo URL rendered as a banner above the page content.")
94630
95288
  });
94631
95289
  var basePageNavigationEntrySchema = pageFrontmatterSchema.extend({
94632
95290
  type: external_exports.literal("page"),
@@ -94867,6 +95525,10 @@ var siteConfigSchema = external_exports.object({
94867
95525
  /** The subdomain prefix of the site. Will be used to publish to <subdomain>.apidocumentation.com. This must be unique on the Scalar platform. */
94868
95526
  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."),
94869
95527
  subpath: pathSchema.optional().describe("The subpath of the site, e.g. /docs. All routes will be resolved against the subpath"),
95528
+ /** Whether the published site is private. Access is controlled via accessGroups and loginPortal. */
95529
+ isPrivate: external_exports.boolean().optional().describe("Whether the published site is private. Access is controlled via accessGroups and loginPortal."),
95530
+ /** Slugs of access groups (defined in the dashboard) permitted to view the site when isPrivate is true. */
95531
+ accessGroups: slugSchema.array().max(50).optional().describe("Slugs of access groups permitted to view the site when isPrivate is true."),
94870
95532
  /** The login portal slug for the site. References a created login portal from dashboard.scalar.com */
94871
95533
  loginPortal: slugSchema.optional(),
94872
95534
  /** Global layout options to hide/show select elements */
@@ -94880,16 +95542,16 @@ var siteConfigSchema = external_exports.object({
94880
95542
  enabled: external_exports.boolean().optional().describe("Enable or disable search globally")
94881
95543
  }).optional().describe("Search bar configuration"),
94882
95544
  sidebar: external_exports.object({
95545
+ enabled: external_exports.boolean().optional().describe("Show or hide the sidebar globally"),
94883
95546
  navPosition: external_exports.enum(["top", "bottom"]).optional().describe("Top level sidebar nav item positioning")
94884
95547
  }).optional()
94885
95548
  }).optional().describe("Global layout options to hide/show select elements"),
94886
- /** Slug for a platform defined theme */
94887
- theme: external_exports.string().optional().describe("Slug for a platform defined theme"),
95549
+ /** Slug for a platform defined theme, or a relative path to a local .css file (must end with .css). */
95550
+ 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)."),
94888
95551
  /** Site logo shown in the header. Can be single URL or an object with a URL for dark and light mode */
94889
95552
  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"),
94890
95553
  /** Footer content. Can be a filepath to an HTML file, or raw HTML and CSS. */
94891
95554
  footer: external_exports.object({
94892
- belowSidebar: external_exports.boolean().optional().describe("Layout option to control if the footer pushes under the sidebar"),
94893
95555
  filepath: external_exports.string().endsWith(".html", 'The footer filepath must point to a ".html" file.').describe("File path to the footer HTML file")
94894
95556
  }).optional(),
94895
95557
  /** Routing options for the site */
@@ -94903,9 +95565,18 @@ var siteConfigSchema = external_exports.object({
94903
95565
  }).optional().describe("Customize light/dark mode color scheme and toggle preferences."),
94904
95566
  /** Ask AI agent configuration */
94905
95567
  agent: external_exports.object({
95568
+ enabled: external_exports.boolean().optional().describe("Whether the Ask AI button is shown on the site."),
94906
95569
  buttonText: external_exports.string().optional().describe('Label shown on the Ask AI button. Defaults to "Ask AI".'),
94907
- 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.')
94908
- }).optional().describe("Ask AI agent configuration")
95570
+ 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.'),
95571
+ mcp: external_exports.object({
95572
+ serverSlug: slugSchema.optional().describe("Slug of the MCP server (scoped to the team)."),
95573
+ installationSlug: slugSchema.optional().describe("Slug of the MCP installation (scoped to the MCP server).")
95574
+ }).optional().describe("References an MCP server + installation by slug. Resolved on publish to bind the docs project to a configured MCP.")
95575
+ }).optional().describe("Ask AI agent configuration"),
95576
+ /** Analytics tracking preferences for the site */
95577
+ analytics: external_exports.object({
95578
+ cookieBanner: external_exports.boolean().optional().describe("Show an opt-in cookie consent banner before tracking. Required for GDPR-compliant deployments.")
95579
+ }).optional().describe("Analytics tracking preferences for the site")
94909
95580
  }).default({});
94910
95581
 
94911
95582
  // ../../packages/scalar-config/dist/schema/schema.js
@@ -94931,6 +95602,7 @@ var baseScalarConfigSchema = external_exports.object({
94931
95602
  /** Whether to insert an H1 with Title and Description at top of each guide page, or not. Deprecated. */
94932
95603
  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."),
94933
95604
  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"),
95605
+ ruleset: rulesetConfigSchema.optional().describe("Default Spectral ruleset and publish policy applied to every OpenAPI route. Per-route ruleset config overrides individual keys."),
94934
95606
  siteConfig: siteConfigSchema
94935
95607
  });
94936
95608
  var externalScalarConfigSchema = baseScalarConfigSchema.extend({
@@ -94993,7 +95665,8 @@ function createError(code, detail) {
94993
95665
  }
94994
95666
 
94995
95667
  // ../../packages/scalar-config/dist/resolvers/resolve-config.js
94996
- import { nanoid as nanoid5 } from "nanoid";
95668
+ import { customAlphabet as customAlphabet2 } from "nanoid";
95669
+ var slugSafeNanoid = customAlphabet2("0123456789abcdefghijklmnopqrstuvwxyz", 40);
94997
95670
 
94998
95671
  // ../../node_modules/.pnpm/vue@3.5.33_typescript@6.0.2/node_modules/vue/index.mjs
94999
95672
  var vue_exports = {};
@@ -95001,11 +95674,11 @@ __reExport(vue_exports, __toESM(require_vue(), 1));
95001
95674
 
95002
95675
  // ../../packages/scalar-config/dist/transformers/helpers.js
95003
95676
  import { parse as parse4 } from "node:path";
95004
- function createUrlSlug({ name: name2, path: path12 }) {
95677
+ function createUrlSlug({ name: name2, path: path13 }) {
95005
95678
  if (name2)
95006
95679
  return `/${slugify3(name2)}`;
95007
- if (path12)
95008
- return `/${slugify3(parse4(path12).name)}`;
95680
+ if (path13)
95681
+ return `/${slugify3(parse4(path13).name)}`;
95009
95682
  return `/${slugify3(randomSlug({ words: 2 }))}`;
95010
95683
  }
95011
95684
 
@@ -95161,8 +95834,8 @@ var legacyTo2_0_0 = (config3) => {
95161
95834
  });
95162
95835
  }
95163
95836
  }
95164
- const cssStyles = config3.siteConfig.cssFiles?.map((path12) => ({
95165
- path: path12
95837
+ const cssStyles = config3.siteConfig.cssFiles?.map((path13) => ({
95838
+ path: path13
95166
95839
  })) ?? [];
95167
95840
  const legacyThemePath = "theme.css";
95168
95841
  if (config3.siteConfig.cssString) {
@@ -95215,11 +95888,12 @@ var legacyTo2_0_0 = (config3) => {
95215
95888
  siteConfig: {
95216
95889
  customDomain: config3.customDomain,
95217
95890
  subdomain: config3.subdomain,
95891
+ isPrivate: config3.isPrivate,
95892
+ accessGroups: config3.accessGroups,
95218
95893
  loginPortal: config3.loginPortal,
95219
95894
  ...config3.siteConfig.footer && {
95220
95895
  footer: {
95221
- filepath: legacyFooterPath,
95222
- belowSidebar: config3.siteConfig.footerBelowSidebar
95896
+ filepath: legacyFooterPath
95223
95897
  }
95224
95898
  },
95225
95899
  routing: config3.siteConfig.routing,
@@ -95342,7 +96016,8 @@ function generateGuideItems({ children, items }) {
95342
96016
  title: item.title,
95343
96017
  description: item.description,
95344
96018
  icon: item.icon?.src,
95345
- filepath: `${item.yjsReference}.yjs`
96019
+ filepath: `${item.yjsReference}.yjs`,
96020
+ ...item.backgroundImage && { backgroundImage: item.backgroundImage }
95346
96021
  };
95347
96022
  routes[slug] = item.children.length ? {
95348
96023
  type: "group",
@@ -95597,8 +96272,7 @@ var wysiwygProjectToV2 = n.safeFn(({ project, invalidRefs, theme }) => {
95597
96272
  subdomain: project.website.subdomainPrefix,
95598
96273
  subpath: project.website.subPath,
95599
96274
  footer: {
95600
- filepath: legacyFooterPath,
95601
- belowSidebar: activeVersion.footerBelowSidebar
96275
+ filepath: legacyFooterPath
95602
96276
  },
95603
96277
  ...(project.logo.darkMode || project.logo.lightMode) && {
95604
96278
  logo: {
@@ -95776,12 +96450,17 @@ function CheckConfigCommand() {
95776
96450
  }
95777
96451
 
95778
96452
  // src/domains/project/preview/v2.ts
95779
- import { execFile, spawn } from "node:child_process";
96453
+ import { spawn } from "node:child_process";
96454
+ import path7 from "node:path";
96455
+
96456
+ // src/domains/project/download-isolate/index.ts
96457
+ import { execFile } from "node:child_process";
95780
96458
  import fs13 from "node:fs/promises";
95781
96459
  import os2 from "node:os";
95782
96460
  import path6 from "node:path";
95783
96461
  import { Readable } from "node:stream";
95784
96462
  import zlib from "node:zlib";
96463
+ import { Command as Command31 } from "commander";
95785
96464
  import tar from "tar-fs";
95786
96465
 
95787
96466
  // src/helpers/run-command.ts
@@ -95800,7 +96479,7 @@ async function runCommand(command, cwd2) {
95800
96479
  });
95801
96480
  }
95802
96481
 
95803
- // src/domains/project/preview/v2.ts
96482
+ // src/domains/project/download-isolate/index.ts
95804
96483
  var ISOLATE_EXTRACTION_DIR = path6.join(os2.homedir(), ".scalar");
95805
96484
  var ISOLATE_DIR = path6.join(ISOLATE_EXTRACTION_DIR, "isolate");
95806
96485
  async function getExistingIsolateVersion() {
@@ -95876,6 +96555,16 @@ async function downloadIsolate() {
95876
96555
  logger.update("loader", 0, { content: "Download complete." });
95877
96556
  logger.finish();
95878
96557
  }
96558
+ var DownloadIsolateCommand = () => {
96559
+ const cmd2 = new Command31("download-isolate");
96560
+ cmd2.description("Download the docs isolate");
96561
+ cmd2.action(async () => {
96562
+ await downloadIsolate();
96563
+ });
96564
+ return cmd2;
96565
+ };
96566
+
96567
+ // src/domains/project/preview/v2.ts
95879
96568
  async function runIsolate(isolateOptions) {
95880
96569
  const child = spawn("node", ["dist/isolate-entry.js"], { cwd: ISOLATE_DIR });
95881
96570
  child.stdin.write(JSON.stringify(isolateOptions));
@@ -95904,8 +96593,8 @@ async function previewV2Project({
95904
96593
  config: config3,
95905
96594
  host
95906
96595
  }) {
95907
- const root = path6.resolve(path6.dirname(configPath), config3.root ?? "./");
95908
- const relativeConfigPath = path6.relative(root, configPath);
96596
+ const root = path7.resolve(path7.dirname(configPath), config3.root ?? "./");
96597
+ const relativeConfigPath = path7.relative(root, configPath);
95909
96598
  const accessToken = await getAccessToken();
95910
96599
  await downloadIsolate();
95911
96600
  output.info().message("Starting preview...").print();
@@ -95925,7 +96614,7 @@ async function previewV2Project({
95925
96614
 
95926
96615
  // src/domains/project/preview/index.ts
95927
96616
  var PreviewCommand = () => {
95928
- const cmd2 = new Command31("preview");
96617
+ const cmd2 = new Command32("preview");
95929
96618
  cmd2.description("Preview scalar guides");
95930
96619
  cmd2.argument(
95931
96620
  "[config]",
@@ -96018,9 +96707,9 @@ var PreviewCommand = () => {
96018
96707
  // src/domains/project/create/index.ts
96019
96708
  import { text as text5 } from "@clack/prompts";
96020
96709
  import as28 from "ansis";
96021
- import { Command as Command32 } from "commander";
96710
+ import { Command as Command33 } from "commander";
96022
96711
  var CreateCommand = () => {
96023
- const cmd2 = new Command32("create");
96712
+ const cmd2 = new Command33("create");
96024
96713
  cmd2.description(
96025
96714
  "Create a new project that is not linked to a github project."
96026
96715
  );
@@ -96066,18 +96755,18 @@ Project slug: ${as28.cyan(response.data.slug)}`
96066
96755
 
96067
96756
  // src/domains/project/init/index.ts
96068
96757
  import fs14 from "node:fs/promises";
96069
- import path7 from "node:path";
96758
+ import path8 from "node:path";
96070
96759
  import { cancel, confirm as confirm3, isCancel, text as text6 } from "@clack/prompts";
96071
96760
  import as29 from "ansis";
96072
- import { Command as Command33 } from "commander";
96761
+ import { Command as Command34 } from "commander";
96073
96762
 
96074
- // ../../node_modules/.pnpm/@scalar+galaxy@0.6.2/node_modules/@scalar/galaxy/dist/3.1.json
96763
+ // ../../node_modules/.pnpm/@scalar+galaxy@0.6.4/node_modules/@scalar/galaxy/dist/3.1.json
96075
96764
  var __default = {
96076
96765
  openapi: "3.1.1",
96077
96766
  info: {
96078
96767
  title: "Scalar Galaxy",
96079
96768
  description: "The Scalar Galaxy is an example OpenAPI document to test OpenAPI tools and libraries. It's a fictional universe with fictional planets and fictional data.\n\n## Resources\n\n* https://github.com/scalar/scalar\n* https://github.com/OAI/OpenAPI-Specification\n* https://scalar.com\n\n## Markdown Support\n\nAll descriptions *can* contain ~~tons of text~~ **Markdown**. [If GitHub supports the syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax), chances are we're supporting it, too.\n\n<details>\n <summary>Examples</summary>\n\n **Blockquotes**\n\n > I love OpenAPI. <3\n\n **Tables**\n\n | Feature | Availability |\n | ---------------- | ------------ |\n | Markdown Support | \u2713 |\n\n **Accordion**\n\n ```html\n <details>\n <summary>Using Details Tags</summary>\n <p>HTML Example</p>\n </details>\n ```\n\n **Images**\n\n Yes, there's support for images, too!\n\n ![Empty placeholder image showing the width/height](https://images.placeholders.dev/?width=1280&height=720)\n\n **Alerts**\n\n > [!tip]\n > You can use Markdown alerts in your descriptions.\n\n</details>\n",
96080
- version: "0.6.2",
96769
+ version: "0.6.4",
96081
96770
  contact: {
96082
96771
  name: "Scalar Support",
96083
96772
  url: "https://scalar.com",
@@ -96171,9 +96860,7 @@ var __default = {
96171
96860
  summary: "Get all planets",
96172
96861
  description: "It's easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.",
96173
96862
  operationId: "getAllData",
96174
- security: [
96175
- {}
96176
- ],
96863
+ security: [],
96177
96864
  parameters: [
96178
96865
  {
96179
96866
  $ref: "#/components/parameters/limit"
@@ -96262,6 +96949,7 @@ var __default = {
96262
96949
  planetCreated: {
96263
96950
  "{$request.body#/successCallbackUrl}": {
96264
96951
  post: {
96952
+ security: [],
96265
96953
  requestBody: {
96266
96954
  description: "Information about the newly created planet",
96267
96955
  content: {
@@ -96286,6 +96974,7 @@ var __default = {
96286
96974
  planetCreationFailed: {
96287
96975
  "{$request.body#/failureCallbackUrl}": {
96288
96976
  post: {
96977
+ security: [],
96289
96978
  requestBody: {
96290
96979
  description: "Information about which fields failed to validate",
96291
96980
  content: {
@@ -96307,6 +96996,7 @@ var __default = {
96307
96996
  planetExploded: {
96308
96997
  "{$request.body#/successCallbackUrl}": {
96309
96998
  post: {
96999
+ security: [],
96310
97000
  requestBody: {
96311
97001
  description: "Information about the newly exploded planet",
96312
97002
  content: {
@@ -96386,9 +97076,7 @@ var __default = {
96386
97076
  summary: "Get a planet",
96387
97077
  description: "You'll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.",
96388
97078
  operationId: "getPlanet",
96389
- security: [
96390
- {}
96391
- ],
97079
+ security: [],
96392
97080
  parameters: [
96393
97081
  {
96394
97082
  $ref: "#/components/parameters/planetId"
@@ -96601,9 +97289,7 @@ var __default = {
96601
97289
  summary: "Create a user",
96602
97290
  description: "Time to create a user account, eh?",
96603
97291
  operationId: "createUser",
96604
- security: [
96605
- {}
96606
- ],
97292
+ security: [],
96607
97293
  requestBody: {
96608
97294
  description: "User to create",
96609
97295
  content: {
@@ -96733,9 +97419,7 @@ var __default = {
96733
97419
  summary: "Get a token",
96734
97420
  description: "Yeah, this is the boring security stuff. Just get your super secret token and move on.",
96735
97421
  operationId: "getToken",
96736
- security: [
96737
- {}
96738
- ],
97422
+ security: [],
96739
97423
  requestBody: {
96740
97424
  description: "Body for credentials to authenticate a user",
96741
97425
  content: {
@@ -96875,6 +97559,7 @@ var __default = {
96875
97559
  tags: [
96876
97560
  "Planets"
96877
97561
  ],
97562
+ security: [],
96878
97563
  requestBody: {
96879
97564
  description: "Information about a new planet",
96880
97565
  content: {
@@ -98028,16 +98713,16 @@ We're here to help:
98028
98713
  `;
98029
98714
 
98030
98715
  // src/domains/project/init/index.ts
98031
- async function fileExists2(path12) {
98716
+ async function fileExists2(path13) {
98032
98717
  try {
98033
- await fs14.access(path12, fs14.constants.F_OK);
98718
+ await fs14.access(path13, fs14.constants.F_OK);
98034
98719
  return true;
98035
98720
  } catch {
98036
98721
  return false;
98037
98722
  }
98038
98723
  }
98039
98724
  var InitCommand = () => {
98040
- const cmd2 = new Command33("init");
98725
+ const cmd2 = new Command34("init");
98041
98726
  cmd2.description("Create a new Scalar Docs project.");
98042
98727
  cmd2.option("-s, --subdomain [url]", "subdomain to publish on");
98043
98728
  cmd2.option("--force", "override existing configuration");
@@ -98080,7 +98765,7 @@ var InitCommand = () => {
98080
98765
  handleCancel();
98081
98766
  }
98082
98767
  }
98083
- const currentDir = path7.resolve(path7.dirname(configFile));
98768
+ const currentDir = path8.resolve(path8.dirname(configFile));
98084
98769
  const configuration = scalarConfigSchema.parse({
98085
98770
  info: {},
98086
98771
  navigation: {
@@ -98128,11 +98813,11 @@ var InitCommand = () => {
98128
98813
  const content = JSON.stringify(configuration, null, 2);
98129
98814
  await fs14.writeFile(configFile, content);
98130
98815
  await fs14.writeFile(
98131
- path7.join(currentDir, DEFAULT_MARKDOWN_FILE_NAME),
98816
+ path8.join(currentDir, DEFAULT_MARKDOWN_FILE_NAME),
98132
98817
  quickstartMarkdown
98133
98818
  );
98134
98819
  await fs14.writeFile(
98135
- path7.join(currentDir, DEFAULT_OPENAPI_FILE_NAME),
98820
+ path8.join(currentDir, DEFAULT_OPENAPI_FILE_NAME),
98136
98821
  JSON.stringify(__default, null, 2)
98137
98822
  );
98138
98823
  output.info().line(`${as29.green("\u2714")} Configuration stored.
@@ -98150,11 +98835,11 @@ var InitCommand = () => {
98150
98835
  // src/domains/project/publish/index.ts
98151
98836
  import fs16 from "node:fs";
98152
98837
  import { dirname } from "node:path";
98153
- import { Command as Command34 } from "commander";
98838
+ import { Command as Command35 } from "commander";
98154
98839
 
98155
98840
  // src/domains/project/publish/publish.ts
98156
98841
  import fs15 from "node:fs";
98157
- import path8 from "node:path";
98842
+ import path9 from "node:path";
98158
98843
  import { Readable as Readable2 } from "node:stream";
98159
98844
  import ignore from "ignore";
98160
98845
  import tar2 from "tar-fs";
@@ -98165,7 +98850,7 @@ function isErrnoException(error48) {
98165
98850
  async function readGitIgnore(configDir) {
98166
98851
  try {
98167
98852
  const gitignore = await fs15.promises.readFile(
98168
- path8.resolve(configDir, ".gitignore"),
98853
+ path9.resolve(configDir, ".gitignore"),
98169
98854
  "utf8"
98170
98855
  );
98171
98856
  return gitignore;
@@ -98210,17 +98895,17 @@ async function publishProject({
98210
98895
  configDir,
98211
98896
  configPath,
98212
98897
  config: config3,
98213
- gitProject,
98898
+ slug,
98214
98899
  mode
98215
98900
  }) {
98216
98901
  try {
98217
- const root = path8.join(configDir, config3.root ?? "./");
98218
- const relativeConfigPath = path8.relative(root, configPath);
98902
+ const root = path9.join(configDir, config3.root ?? "./");
98903
+ const relativeConfigPath = path9.relative(root, configPath);
98219
98904
  const apiClient = await apiService();
98220
98905
  const projectTar = await createProjectTar(root);
98221
98906
  const result = await apiClient.publish.publishCli({
98222
98907
  tarStream: Readable2.toWeb(projectTar),
98223
- slug: gitProject.slug,
98908
+ slug,
98224
98909
  configPath: relativeConfigPath,
98225
98910
  mode
98226
98911
  });
@@ -98234,6 +98919,26 @@ async function publishProject({
98234
98919
  return { success: false, error: e };
98235
98920
  }
98236
98921
  }
98922
+ async function publishUnifiedDocsProjectFromGithub({
98923
+ slug,
98924
+ preview,
98925
+ apiClient
98926
+ }) {
98927
+ const result = await apiClient.publish.publishDocsProject({
98928
+ slug,
98929
+ preview
98930
+ });
98931
+ if (result.error) {
98932
+ return {
98933
+ success: false,
98934
+ error: result.message
98935
+ };
98936
+ }
98937
+ return {
98938
+ success: true,
98939
+ publishUid: result.data.publishUid
98940
+ };
98941
+ }
98237
98942
 
98238
98943
  // src/domains/project/publish/url.ts
98239
98944
  function getPublishDeploymentUrl(publish) {
@@ -98256,7 +98961,7 @@ var sleep = (ms) => {
98256
98961
 
98257
98962
  // src/domains/project/publish/index.ts
98258
98963
  var PublishCommand = () => {
98259
- const cmd2 = new Command34("publish");
98964
+ const cmd2 = new Command35("publish");
98260
98965
  cmd2.description(
98261
98966
  "Publish new build for a github sync project that is not linked."
98262
98967
  );
@@ -98288,19 +98993,46 @@ var PublishCommand = () => {
98288
98993
  if (!slug) {
98289
98994
  return output.error().title("Invalid argument").message("Slug is required. Try passing --slug flag.").exit("error");
98290
98995
  }
98291
- const gitProject = await getGithubProject(slug, apiClient);
98292
98996
  if (github) {
98293
- if (!gitProject.repository) {
98997
+ const resolved = await resolveProject(slug, apiClient);
98998
+ if (resolved.kind === "not-found") {
98999
+ return output.error().title("Project not found").message(`No project with slug "${slug}" was found for your team.`).exit("error");
99000
+ }
99001
+ if (resolved.kind === "github") {
99002
+ if (!resolved.project.repository) {
99003
+ return output.error().title("Your project is not linked to a GitHub repository").message(
99004
+ "For a sync publish, please configure your GitHub connection through the dashboard."
99005
+ ).exit("error");
99006
+ }
99007
+ if (resolved.project.repository.expired) {
99008
+ return output.error().title("Your GitHub repository access is expired.").message(
99009
+ "Please reconnect your project through the Scalar Dashboard to publish via sync."
99010
+ ).exit("error");
99011
+ }
99012
+ const publishResult3 = await publishGithub({ apiClient, slug, preview });
99013
+ if (!publishResult3.success) {
99014
+ return output.error().title("Could not publish sync project.").message(publishResult3.error).exit("error");
99015
+ }
99016
+ return await waitForPublish({
99017
+ teamUid: auth.teamUid,
99018
+ publishUid: publishResult3.publishUid
99019
+ });
99020
+ }
99021
+ if (!isGithubBackedDocsProject(resolved.project)) {
98294
99022
  return output.error().title("Your project is not linked to a GitHub repository").message(
98295
99023
  "For a sync publish, please configure your GitHub connection through the dashboard."
98296
99024
  ).exit("error");
98297
99025
  }
98298
- if (gitProject.repository.expired) {
99026
+ if (resolved.project.repository.expired) {
98299
99027
  return output.error().title("Your GitHub repository access is expired.").message(
98300
99028
  "Please reconnect your project through the Scalar Dashboard to publish via sync."
98301
99029
  ).exit("error");
98302
99030
  }
98303
- const publishResult2 = await publishGithub({ apiClient, slug, preview });
99031
+ const publishResult2 = await publishUnifiedDocsProjectFromGithub({
99032
+ apiClient,
99033
+ slug,
99034
+ preview
99035
+ });
98304
99036
  if (!publishResult2.success) {
98305
99037
  return output.error().title("Could not publish sync project.").message(publishResult2.error).exit("error");
98306
99038
  }
@@ -98322,7 +99054,7 @@ var PublishCommand = () => {
98322
99054
  }
98323
99055
  const publishResult = await publishProject({
98324
99056
  config: configParseResult.config,
98325
- gitProject,
99057
+ slug,
98326
99058
  configDir: dirname(configPath),
98327
99059
  configPath,
98328
99060
  ...preview && { mode: "preview" }
@@ -98373,12 +99105,16 @@ async function waitForPublish({
98373
99105
  await sleep(3e3);
98374
99106
  }
98375
99107
  }
98376
- async function getGithubProject(slug, apiClient) {
98377
- const project = await apiClient.github.getProject(slug);
98378
- if (project.error) {
98379
- return output.error().title("Error fetching github project").message(project.message).exit("error");
99108
+ async function resolveProject(slug, apiClient) {
99109
+ const githubResult = await apiClient.github.getProject(slug);
99110
+ if (!githubResult.error) {
99111
+ return { kind: "github", project: githubResult.data };
99112
+ }
99113
+ const docsResult = await apiClient.docsProject.getProject(slug);
99114
+ if (!docsResult.error) {
99115
+ return { kind: "docs", project: docsResult.data };
98380
99116
  }
98381
- return project.data;
99117
+ return { kind: "not-found" };
98382
99118
  }
98383
99119
  async function getDeployStatus({
98384
99120
  client,
@@ -98394,10 +99130,10 @@ async function getDeployStatus({
98394
99130
 
98395
99131
  // src/domains/project/upgrade/index.ts
98396
99132
  import fs17 from "node:fs/promises";
98397
- import path9 from "node:path";
99133
+ import path10 from "node:path";
98398
99134
  import { text as text7 } from "@clack/prompts";
98399
99135
  import as30 from "ansis";
98400
- import { Command as Command35 } from "commander";
99136
+ import { Command as Command36 } from "commander";
98401
99137
  import { n as n2 } from "neverpanic";
98402
99138
 
98403
99139
  // src/errors.ts
@@ -98426,7 +99162,7 @@ function displayError(error48, fallback = "Unknown error occurred. Please contac
98426
99162
 
98427
99163
  // src/domains/project/upgrade/index.ts
98428
99164
  var UpgradeCommand2 = () => {
98429
- const cmd2 = new Command35("upgrade");
99165
+ const cmd2 = new Command36("upgrade");
98430
99166
  cmd2.description("Upgrade scalar project");
98431
99167
  cmd2.argument(
98432
99168
  "[config]",
@@ -98483,8 +99219,8 @@ var UpgradeCommand2 = () => {
98483
99219
  if (legacyTheme) {
98484
99220
  const writeUpgradedThemeResult = await n2.fromUnsafe(
98485
99221
  () => fs17.writeFile(
98486
- path9.resolve(
98487
- path9.dirname(parseConfigResult.filePath),
99222
+ path10.resolve(
99223
+ path10.dirname(parseConfigResult.filePath),
98488
99224
  config3.root ?? "./",
98489
99225
  legacyTheme.path
98490
99226
  ),
@@ -98499,8 +99235,8 @@ var UpgradeCommand2 = () => {
98499
99235
  if (legacyFooter) {
98500
99236
  const writeUpgradedFooterResult = await n2.fromUnsafe(
98501
99237
  () => fs17.writeFile(
98502
- path9.resolve(
98503
- path9.dirname(parseConfigResult.filePath),
99238
+ path10.resolve(
99239
+ path10.dirname(parseConfigResult.filePath),
98504
99240
  config3.root ?? "./",
98505
99241
  legacyFooter.path
98506
99242
  ),
@@ -98515,8 +99251,8 @@ var UpgradeCommand2 = () => {
98515
99251
  if (legacyScript) {
98516
99252
  const writeUpgradedScriptResult = await n2.fromUnsafe(
98517
99253
  () => fs17.writeFile(
98518
- path9.resolve(
98519
- path9.dirname(parseConfigResult.filePath),
99254
+ path10.resolve(
99255
+ path10.dirname(parseConfigResult.filePath),
98520
99256
  config3.root ?? "./",
98521
99257
  legacyScript.path
98522
99258
  ),
@@ -98552,23 +99288,25 @@ var projectCommands = [
98552
99288
  PublishCommand,
98553
99289
  UpgradeCommand2
98554
99290
  ];
98555
- var projectDomain = new Command36("project");
99291
+ var projectDomain = new Command37("project");
98556
99292
  projectDomain.description("Manage scalar project");
98557
99293
  projectCommands.forEach((command) => projectDomain.addCommand(command()));
99294
+ projectDomain.addCommand(DownloadIsolateCommand(), { hidden: true });
98558
99295
  var project_default = projectDomain;
98559
99296
 
98560
99297
  // src/domains/readme/index.ts
98561
- import { Command as Command38 } from "commander";
99298
+ import { Command as Command39 } from "commander";
98562
99299
 
98563
99300
  // src/domains/readme/generate.ts
98564
99301
  import { text as text8 } from "@clack/prompts";
98565
99302
  import as31 from "ansis";
98566
- import { Command as Command37 } from "commander";
99303
+ import { Command as Command38 } from "commander";
98567
99304
 
98568
99305
  // src/helpers/documentation/index.ts
98569
99306
  import fs18 from "node:fs/promises";
98570
- import path10 from "node:path";
99307
+ import path11 from "node:path";
98571
99308
  var generateDocs = (command, depth = 0) => {
99309
+ if (command._hidden) return [];
98572
99310
  const documentation = [];
98573
99311
  documentation.push({
98574
99312
  title: command.name(),
@@ -98596,7 +99334,7 @@ ${docs.content}${codeBlock}`);
98596
99334
  var generateDocumentationFile = async (outputPath) => {
98597
99335
  const commandDocumentation = generateCommandDocumentation(getProgram());
98598
99336
  const template = await fs18.readFile(
98599
- path10.join(import.meta.dirname, "template.md"),
99337
+ path11.join(import.meta.dirname, "template.md"),
98600
99338
  {
98601
99339
  encoding: "utf-8"
98602
99340
  }
@@ -98609,7 +99347,7 @@ var generateDocumentationFile = async (outputPath) => {
98609
99347
 
98610
99348
  // src/domains/readme/generate.ts
98611
99349
  function GenerateReadmeCommand() {
98612
- const cmd2 = new Command37("generate");
99350
+ const cmd2 = new Command38("generate");
98613
99351
  cmd2.description("Self generate documentation for the cli");
98614
99352
  cmd2.option(
98615
99353
  "-o, --output [file]",
@@ -98643,7 +99381,7 @@ function GenerateReadmeCommand() {
98643
99381
 
98644
99382
  // src/domains/readme/serve.ts
98645
99383
  import fs19 from "node:fs/promises";
98646
- import path11 from "node:path";
99384
+ import path12 from "node:path";
98647
99385
  import as32 from "ansis";
98648
99386
  var fileExists3 = async (filePath) => {
98649
99387
  try {
@@ -98656,13 +99394,13 @@ var fileExists3 = async (filePath) => {
98656
99394
  function ServeReadmeCommand(cmd2) {
98657
99395
  cmd2.description("Open documentation for the CLI");
98658
99396
  cmd2.action(async () => {
98659
- const docsPath = path11.join(import.meta.dirname, "docs.html");
99397
+ const docsPath = path12.join(import.meta.dirname, "docs.html");
98660
99398
  if (await fileExists3(docsPath) === false) {
98661
99399
  return output.error().title("Documentation not found").message(
98662
99400
  "You can access documentation only by running the bundled version of the CLI."
98663
99401
  ).exit("error");
98664
99402
  }
98665
- const docsUrl = `file://${path11.join(import.meta.dirname, "docs.html")}`;
99403
+ const docsUrl = `file://${path12.join(import.meta.dirname, "docs.html")}`;
98666
99404
  openBrowser(docsUrl);
98667
99405
  output.info().message(
98668
99406
  "Documentation is being opened in your default browser. If it does not open automatically, please visit the following URL:"
@@ -98672,22 +99410,21 @@ function ServeReadmeCommand(cmd2) {
98672
99410
  }
98673
99411
 
98674
99412
  // src/domains/readme/index.ts
98675
- var readmeDomain = new Command38("readme");
99413
+ var readmeDomain = new Command39("readme");
98676
99414
  readmeDomain.addCommand(GenerateReadmeCommand());
98677
99415
  ServeReadmeCommand(readmeDomain);
98678
99416
  var readme_default = readmeDomain;
98679
99417
 
98680
99418
  // src/domains/registry/index.ts
98681
- import { Command as Command44 } from "commander";
99419
+ import { Command as Command45 } from "commander";
98682
99420
 
98683
99421
  // src/domains/registry/publish/index.ts
98684
99422
  import { text as text9 } from "@clack/prompts";
98685
99423
  import as33 from "ansis";
98686
- import { Command as Command39 } from "commander";
99424
+ import { Command as Command40 } from "commander";
98687
99425
  import { bundle as bundle4 } from "@scalar/json-magic/bundle";
98688
99426
  import { fetchUrls as fetchUrls4, readFiles as readFiles4 } from "@scalar/json-magic/bundle/plugins/node";
98689
99427
  import { parseJsonOrYaml as parseJsonOrYaml2 } from "@scalar/oas-utils/helpers";
98690
- import { validate as validate3 } from "@scalar/openapi-parser";
98691
99428
 
98692
99429
  // src/domains/registry/publish/helpers/links.ts
98693
99430
  function apiDashboardUrl(uid) {
@@ -98696,7 +99433,7 @@ function apiDashboardUrl(uid) {
98696
99433
 
98697
99434
  // src/domains/registry/publish/index.ts
98698
99435
  var PublishCommand2 = () => {
98699
- const cmd2 = new Command39("publish");
99436
+ const cmd2 = new Command40("publish");
98700
99437
  cmd2.description("Publish an OpenAPI document to the Scalar registry");
98701
99438
  cmd2.argument("[file]", "OpenAPI file to upload");
98702
99439
  cmd2.option(
@@ -98792,13 +99529,10 @@ var PublishCommand2 = () => {
98792
99529
  treeShake: data.treeShake,
98793
99530
  urlMap: data.urlMap
98794
99531
  });
98795
- const result = await validate3(bundledDocument);
98796
- if (!result.valid || !result.specification) {
98797
- return output.error().title("Invalid API document").message("File does not match the OpenAPI specification.").table([result.errors?.map((err) => err.message) || []]).exit("error");
98798
- }
98799
- const apiSlug = data.slug || (result.specification.info?.title ? slugify3(result.specification.info.title) : randomSlug({ words: 3 }));
99532
+ const specification = bundledDocument;
99533
+ const apiSlug = data.slug || toRegistrySlug(specification.info?.title ?? "");
98800
99534
  const parsedVersion = docVersionSchema.safeParse(
98801
- data.version || result.specification.info?.version
99535
+ data.version || specification.info?.version
98802
99536
  );
98803
99537
  const version3 = parsedVersion.data || (await text9({
98804
99538
  message: "What is the version of your document (e.g. 0.1.0)?",
@@ -98819,8 +99553,8 @@ var PublishCommand2 = () => {
98819
99553
  force: data.force,
98820
99554
  isCurrent: data.current
98821
99555
  }) : await client.managedDocs.create(namespace, {
98822
- title: result.specification.info?.title || "My API",
98823
- description: result.specification.info?.description,
99556
+ title: specification.info?.title || "My API",
99557
+ description: specification.info?.description,
98824
99558
  version: version3,
98825
99559
  slug: apiSlug,
98826
99560
  isPrivate: data.private,
@@ -98841,9 +99575,9 @@ var PublishCommand2 = () => {
98841
99575
  };
98842
99576
 
98843
99577
  // src/domains/registry/delete/index.ts
98844
- import { Command as Command40 } from "commander";
99578
+ import { Command as Command41 } from "commander";
98845
99579
  var DeleteCommand = () => {
98846
- const cmd2 = new Command40("delete");
99580
+ const cmd2 = new Command41("delete");
98847
99581
  cmd2.description("Delete a document from scalar registry");
98848
99582
  cmd2.argument("[namespace]", "Team namespace");
98849
99583
  cmd2.argument("[slug]", "Managed doc slug");
@@ -98861,10 +99595,10 @@ var DeleteCommand = () => {
98861
99595
 
98862
99596
  // src/domains/registry/get/index.ts
98863
99597
  import fs20 from "node:fs";
98864
- import { Command as Command41 } from "commander";
99598
+ import { Command as Command42 } from "commander";
98865
99599
  var versionSchema3 = external_exports.union([docVersionSchema, external_exports.literal("latest")]);
98866
99600
  var GetCommand = () => {
98867
- const cmd2 = new Command41("get");
99601
+ const cmd2 = new Command42("get");
98868
99602
  cmd2.description("Get a document version from scalar registry");
98869
99603
  cmd2.argument("[namespace]", "Team namespace");
98870
99604
  cmd2.argument("[slug]", "Managed doc slug");
@@ -98939,9 +99673,9 @@ var GetCommand = () => {
98939
99673
 
98940
99674
  // src/domains/registry/list/index.ts
98941
99675
  import as34 from "ansis";
98942
- import { Command as Command42 } from "commander";
99676
+ import { Command as Command43 } from "commander";
98943
99677
  var ListCommand = () => {
98944
- const cmd2 = new Command42("list");
99678
+ const cmd2 = new Command43("list");
98945
99679
  cmd2.description("List all registry APIs for a team namespace");
98946
99680
  cmd2.option("--namespace <namespace>", "Team namespace");
98947
99681
  cmd2.action(async (args) => {
@@ -99000,9 +99734,9 @@ var ListCommand = () => {
99000
99734
  // src/domains/registry/update/index.ts
99001
99735
  import { text as text10 } from "@clack/prompts";
99002
99736
  import as35 from "ansis";
99003
- import { Command as Command43 } from "commander";
99737
+ import { Command as Command44 } from "commander";
99004
99738
  var UpdateCommand = () => {
99005
- const cmd2 = new Command43("update");
99739
+ const cmd2 = new Command44("update");
99006
99740
  cmd2.description("Update document metadata on scalar registry");
99007
99741
  cmd2.argument("[namespace]", "namespace of document you want to update");
99008
99742
  cmd2.argument("[slug]", "slug of document you want to update");
@@ -99056,17 +99790,17 @@ var registryCommands = [
99056
99790
  ListCommand,
99057
99791
  GetCommand
99058
99792
  ];
99059
- var registryDomain = new Command44("registry");
99793
+ var registryDomain = new Command45("registry");
99060
99794
  registryDomain.description("Manage your scalar registry");
99061
99795
  registryCommands.forEach((command) => registryDomain.addCommand(command()));
99062
99796
  var registry_default = registryDomain;
99063
99797
 
99064
99798
  // src/domains/team/index.ts
99065
- import { Command as Command47 } from "commander";
99799
+ import { Command as Command48 } from "commander";
99066
99800
 
99067
99801
  // src/domains/team/list/index.ts
99068
99802
  import as36 from "ansis";
99069
- import { Command as Command45 } from "commander";
99803
+ import { Command as Command46 } from "commander";
99070
99804
 
99071
99805
  // src/domains/team/helpers.ts
99072
99806
  var getUserTeams = async (client, email3) => {
@@ -99081,7 +99815,7 @@ var getUserTeams = async (client, email3) => {
99081
99815
 
99082
99816
  // src/domains/team/list/index.ts
99083
99817
  var ListCommand2 = () => {
99084
- const cmd2 = new Command45("list");
99818
+ const cmd2 = new Command46("list");
99085
99819
  cmd2.description("List all teams current user is part of");
99086
99820
  cmd2.action(async () => {
99087
99821
  const auth = await getAuthData();
@@ -99107,9 +99841,9 @@ var ListCommand2 = () => {
99107
99841
  // src/domains/team/set/index.ts
99108
99842
  import { select as select7 } from "@clack/prompts";
99109
99843
  import as37 from "ansis";
99110
- import { Command as Command46 } from "commander";
99844
+ import { Command as Command47 } from "commander";
99111
99845
  var SetCommand = () => {
99112
- const cmd2 = new Command46("set");
99846
+ const cmd2 = new Command47("set");
99113
99847
  cmd2.description("Set current active team for the user");
99114
99848
  cmd2.option("--team <team>", "Team uid");
99115
99849
  cmd2.action(async ({ team }) => {
@@ -99149,7 +99883,7 @@ var SetCommand = () => {
99149
99883
 
99150
99884
  // src/domains/team/index.ts
99151
99885
  var teamCommands = [ListCommand2, SetCommand];
99152
- var teamDomain = new Command47("team");
99886
+ var teamDomain = new Command48("team");
99153
99887
  teamDomain.description("Manage user teams");
99154
99888
  teamCommands.forEach((command) => teamDomain.addCommand(command()));
99155
99889
  var team_default = teamDomain;
@@ -99157,7 +99891,7 @@ var team_default = teamDomain;
99157
99891
  // src/domains/upgrade/index.ts
99158
99892
  import { execSync } from "node:child_process";
99159
99893
  import as39 from "ansis";
99160
- import { Command as Command48 } from "commander";
99894
+ import { Command as Command49 } from "commander";
99161
99895
 
99162
99896
  // src/helpers/upgrade.ts
99163
99897
  import as38 from "ansis";
@@ -99213,7 +99947,7 @@ async function checkUpgrade() {
99213
99947
  }
99214
99948
 
99215
99949
  // src/domains/upgrade/index.ts
99216
- var cmd = new Command48("upgrade");
99950
+ var cmd = new Command49("upgrade");
99217
99951
  cmd.description("Upgrade current version of your cli");
99218
99952
  cmd.action(async () => {
99219
99953
  const upgradeStatus = await getUpgradeInformation();
@@ -99251,7 +99985,7 @@ var domains_default = domains;
99251
99985
 
99252
99986
  // src/program.ts
99253
99987
  var getProgram = () => {
99254
- const program2 = new Command49();
99988
+ const program2 = new Command50();
99255
99989
  program2.enablePositionalOptions().name(Object.keys(bin)[0]).description("CLI to work with your OpenAPI files").version(version, "-v, --version");
99256
99990
  program2.showHelpAfterError();
99257
99991
  domains_default.forEach((domain2) => program2.addCommand(domain2));