fern-api 0.31.0-rc2 → 0.31.0-rc3

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 (2) hide show
  1. package/bundle.cjs +771 -776
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -44920,7 +44920,7 @@ var require_buffer_list = __commonJS({
44920
44920
  }
44921
44921
  }, {
44922
44922
  key: "join",
44923
- value: function join5(s2) {
44923
+ value: function join4(s2) {
44924
44924
  if (this.length === 0)
44925
44925
  return "";
44926
44926
  var p2 = this.head;
@@ -124644,7 +124644,7 @@ var require_doc = __commonJS({
124644
124644
  type: "cursor",
124645
124645
  placeholder: Symbol("cursor")
124646
124646
  };
124647
- function join5(sep, arr) {
124647
+ function join4(sep, arr) {
124648
124648
  const res = [];
124649
124649
  for (let i2 = 0; i2 < arr.length; i2++) {
124650
124650
  if (i2 !== 0) {
@@ -124674,7 +124674,7 @@ var require_doc = __commonJS({
124674
124674
  }
124675
124675
  module22.exports = {
124676
124676
  concat: concat2,
124677
- join: join5,
124677
+ join: join4,
124678
124678
  line,
124679
124679
  softline,
124680
124680
  hardline,
@@ -124866,7 +124866,7 @@ var require_doc = __commonJS({
124866
124866
  var getLast = require_get_last();
124867
124867
  var {
124868
124868
  literalline,
124869
- join: join5
124869
+ join: join4
124870
124870
  } = require_doc_builders();
124871
124871
  var isConcat = (doc) => Array.isArray(doc) || doc && doc.type === "concat";
124872
124872
  var getDocParts = (doc) => {
@@ -125179,7 +125179,7 @@ var require_doc = __commonJS({
125179
125179
  }
125180
125180
  function replaceTextEndOfLine(text8) {
125181
125181
  let replacement = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : literalline;
125182
- return join5(replacement, text8.split("\n")).parts;
125182
+ return join4(replacement, text8.split("\n")).parts;
125183
125183
  }
125184
125184
  function canBreakFn(doc) {
125185
125185
  if (doc.type === "line") {
@@ -312335,7 +312335,7 @@ var require_prettier = __commonJS({
312335
312335
  tokenize: function tokenize2(value) {
312336
312336
  return value.split("");
312337
312337
  },
312338
- join: function join5(chars) {
312338
+ join: function join4(chars) {
312339
312339
  return chars.join("");
312340
312340
  }
312341
312341
  };
@@ -318257,7 +318257,7 @@ ${frame}`;
318257
318257
  breakParent,
318258
318258
  indent: indent3,
318259
318259
  lineSuffix,
318260
- join: join5,
318260
+ join: join4,
318261
318261
  cursor
318262
318262
  }
318263
318263
  } = require_doc();
@@ -318639,9 +318639,9 @@ ${frame}`;
318639
318639
  return "";
318640
318640
  }
318641
318641
  if (sameIndent) {
318642
- return join5(hardline, parts);
318642
+ return join4(hardline, parts);
318643
318643
  }
318644
- return indent3([hardline, join5(hardline, parts)]);
318644
+ return indent3([hardline, join4(hardline, parts)]);
318645
318645
  }
318646
318646
  function printCommentsSeparately(path42, options2, ignored) {
318647
318647
  const value = path42.getValue();
@@ -332899,7 +332899,7 @@ ${fromBody}`;
332899
332899
  } = require_util8();
332900
332900
  var {
332901
332901
  builders: {
332902
- join: join5,
332902
+ join: join4,
332903
332903
  hardline,
332904
332904
  softline,
332905
332905
  group,
@@ -333011,7 +333011,7 @@ ${fromBody}`;
333011
333011
  maxColumnWidths[index3] = Math.max(maxColumnWidths[index3], getStringWidth(cell));
333012
333012
  }
333013
333013
  }
333014
- parts.push(lineSuffixBoundary, "`", indent3([hardline, join5(hardline, table2.map((row) => join5(" | ", row.cells.map((cell, index3) => row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index3] - getStringWidth(cell))))))]), hardline, "`");
333014
+ parts.push(lineSuffixBoundary, "`", indent3([hardline, join4(hardline, table2.map((row) => join4(" | ", row.cells.map((cell, index3) => row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index3] - getStringWidth(cell))))))]), hardline, "`");
333015
333015
  return parts;
333016
333016
  }
333017
333017
  }
@@ -333155,7 +333155,7 @@ ${fromBody}`;
333155
333155
  var {
333156
333156
  builders: {
333157
333157
  indent: indent3,
333158
- join: join5,
333158
+ join: join4,
333159
333159
  hardline
333160
333160
  }
333161
333161
  } = require_doc();
@@ -333211,7 +333211,7 @@ ${fromBody}`;
333211
333211
  parts.push(expressionDoc);
333212
333212
  }
333213
333213
  }
333214
- return ["`", indent3([hardline, join5(hardline, parts)]), hardline, "`"];
333214
+ return ["`", indent3([hardline, join4(hardline, parts)]), hardline, "`"];
333215
333215
  }
333216
333216
  function printGraphqlComments(lines) {
333217
333217
  const parts = [];
@@ -333228,7 +333228,7 @@ ${fromBody}`;
333228
333228
  }
333229
333229
  seenComment = true;
333230
333230
  }
333231
- return parts.length === 0 ? null : join5(hardline, parts);
333231
+ return parts.length === 0 ? null : join4(hardline, parts);
333232
333232
  }
333233
333233
  module22.exports = format5;
333234
333234
  }
@@ -334844,7 +334844,7 @@ ${fromBody}`;
334844
334844
  "use strict";
334845
334845
  var {
334846
334846
  builders: {
334847
- join: join5,
334847
+ join: join4,
334848
334848
  line,
334849
334849
  group,
334850
334850
  softline,
@@ -334861,7 +334861,7 @@ ${fromBody}`;
334861
334861
  }
334862
334862
  if (options2.__isVueForBindingLeft) {
334863
334863
  return path42.call((functionDeclarationPath) => {
334864
- const printed = join5([",", line], functionDeclarationPath.map(print, "params"));
334864
+ const printed = join4([",", line], functionDeclarationPath.map(print, "params"));
334865
334865
  const {
334866
334866
  params
334867
334867
  } = functionDeclarationPath.getValue();
@@ -334872,7 +334872,7 @@ ${fromBody}`;
334872
334872
  }, "program", "body", 0);
334873
334873
  }
334874
334874
  if (options2.__isVueBindings) {
334875
- return path42.call((functionDeclarationPath) => join5([",", line], functionDeclarationPath.map(print, "params")), "program", "body", 0);
334875
+ return path42.call((functionDeclarationPath) => join4([",", line], functionDeclarationPath.map(print, "params")), "program", "body", 0);
334876
334876
  }
334877
334877
  }
334878
334878
  function isVueEventBindingExpression(node3) {
@@ -334908,7 +334908,7 @@ ${fromBody}`;
334908
334908
  } = require_util8();
334909
334909
  var {
334910
334910
  builders: {
334911
- join: join5,
334911
+ join: join4,
334912
334912
  line,
334913
334913
  softline,
334914
334914
  group,
@@ -334991,7 +334991,7 @@ ${fromBody}`;
334991
334991
  const shouldInline = shouldInlineLogicalExpression(node3);
334992
334992
  const lineBeforeOperator = (node3.operator === "|>" || node3.type === "NGPipeExpression" || node3.operator === "|" && options2.parser === "__vue_expression") && !hasLeadingOwnLineComment(options2.originalText, node3.right);
334993
334993
  const operator = node3.type === "NGPipeExpression" ? "|" : node3.operator;
334994
- const rightSuffix = node3.type === "NGPipeExpression" && node3.arguments.length > 0 ? group(indent3([softline, ": ", join5([softline, ":", ifBreak(" ")], path42.map(print, "arguments").map((arg) => align2(2, group(arg))))])) : "";
334994
+ const rightSuffix = node3.type === "NGPipeExpression" && node3.arguments.length > 0 ? group(indent3([softline, ": ", join4([softline, ":", ifBreak(" ")], path42.map(print, "arguments").map((arg) => align2(2, group(arg))))])) : "";
334995
334995
  let right3;
334996
334996
  if (shouldInline) {
334997
334997
  right3 = [operator, " ", print("right"), rightSuffix];
@@ -335041,7 +335041,7 @@ ${fromBody}`;
335041
335041
  "use strict";
335042
335042
  var {
335043
335043
  builders: {
335044
- join: join5,
335044
+ join: join4,
335045
335045
  line,
335046
335046
  group
335047
335047
  }
@@ -335065,7 +335065,7 @@ ${fromBody}`;
335065
335065
  case "NGPipeExpression":
335066
335066
  return printBinaryishExpression(path42, options2, print);
335067
335067
  case "NGChainedExpression":
335068
- return group(join5([";", line], path42.map((childPath) => hasNgSideEffect(childPath) ? print() : ["(", print(), ")"], "expressions")));
335068
+ return group(join4([";", line], path42.map((childPath) => hasNgSideEffect(childPath) ? print() : ["(", print(), ")"], "expressions")));
335069
335069
  case "NGEmptyExpression":
335070
335070
  return "";
335071
335071
  case "NGQuotedExpression":
@@ -335128,7 +335128,7 @@ ${fromBody}`;
335128
335128
  fill: fill2,
335129
335129
  ifBreak,
335130
335130
  lineSuffixBoundary,
335131
- join: join5
335131
+ join: join4
335132
335132
  },
335133
335133
  utils: {
335134
335134
  willBreak
@@ -335451,9 +335451,9 @@ ${fromBody}`;
335451
335451
  case "JSXIdentifier":
335452
335452
  return String(node3.name);
335453
335453
  case "JSXNamespacedName":
335454
- return join5(":", [print("namespace"), print("name")]);
335454
+ return join4(":", [print("namespace"), print("name")]);
335455
335455
  case "JSXMemberExpression":
335456
- return join5(".", [print("object"), print("property")]);
335456
+ return join4(".", [print("object"), print("property")]);
335457
335457
  case "JSXSpreadAttribute":
335458
335458
  return printJsxSpreadAttribute(path42, options2, print);
335459
335459
  case "JSXSpreadChild": {
@@ -335533,7 +335533,7 @@ ${fromBody}`;
335533
335533
  var {
335534
335534
  builders: {
335535
335535
  indent: indent3,
335536
- join: join5,
335536
+ join: join4,
335537
335537
  line
335538
335538
  }
335539
335539
  } = require_doc();
@@ -335583,7 +335583,7 @@ ${fromBody}`;
335583
335583
  if (!isNonEmptyArray(node3.modifiers)) {
335584
335584
  return "";
335585
335585
  }
335586
- return [join5(" ", path42.map(print, "modifiers")), " "];
335586
+ return [join4(" ", path42.map(print, "modifiers")), " "];
335587
335587
  }
335588
335588
  function adjustClause(node3, clause, forceSpace) {
335589
335589
  if (node3.type === "EmptyStatement") {
@@ -335956,7 +335956,7 @@ ${fromBody}`;
335956
335956
  } = require_loc();
335957
335957
  var {
335958
335958
  builders: {
335959
- join: join5,
335959
+ join: join4,
335960
335960
  hardline,
335961
335961
  group,
335962
335962
  indent: indent3,
@@ -336100,7 +336100,7 @@ ${fromBody}`;
336100
336100
  if (groups2.length === 0) {
336101
336101
  return "";
336102
336102
  }
336103
- return indent3(group([hardline, join5(hardline, groups2.map(printGroup))]));
336103
+ return indent3(group([hardline, join4(hardline, groups2.map(printGroup))]));
336104
336104
  }
336105
336105
  const printedGroups = groups.map(printGroup);
336106
336106
  const oneLine = printedGroups;
@@ -336140,7 +336140,7 @@ ${fromBody}`;
336140
336140
  "use strict";
336141
336141
  var {
336142
336142
  builders: {
336143
- join: join5,
336143
+ join: join4,
336144
336144
  group
336145
336145
  }
336146
336146
  } = require_doc();
@@ -336173,7 +336173,7 @@ ${fromBody}`;
336173
336173
  iterateCallArgumentsPath(path42, () => {
336174
336174
  printed.push(print());
336175
336175
  });
336176
- return [isNew ? "new " : "", print("callee"), optional4, printFunctionTypeParameters(path42, options2, print), "(", join5(", ", printed), ")"];
336176
+ return [isNew ? "new " : "", print("callee"), optional4, printFunctionTypeParameters(path42, options2, print), "(", join4(", ", printed), ")"];
336177
336177
  }
336178
336178
  const isIdentifierWithFlowAnnotation = (options2.parser === "babel" || options2.parser === "babel-flow") && node3.callee && node3.callee.type === "Identifier" && hasFlowAnnotationComment(node3.callee.trailingComments);
336179
336179
  if (isIdentifierWithFlowAnnotation) {
@@ -336655,7 +336655,7 @@ ${fromBody}`;
336655
336655
  var {
336656
336656
  builders: {
336657
336657
  group,
336658
- join: join5,
336658
+ join: join4,
336659
336659
  line,
336660
336660
  softline,
336661
336661
  indent: indent3,
@@ -336756,10 +336756,10 @@ ${fromBody}`;
336756
336756
  return printComments(typePath, printedType, options2);
336757
336757
  }, "types");
336758
336758
  if (shouldHug) {
336759
- return join5(" | ", printed);
336759
+ return join4(" | ", printed);
336760
336760
  }
336761
336761
  const shouldAddStartLine = shouldIndent && !hasLeadingOwnLineComment(options2.originalText, node3);
336762
- const code3 = [ifBreak([shouldAddStartLine ? line : "", "| "]), join5([line, "| "], printed)];
336762
+ const code3 = [ifBreak([shouldAddStartLine ? line : "", "| "]), join4([line, "| "], printed)];
336763
336763
  if (pathNeedsParens(path42, options2)) {
336764
336764
  return group([indent3(code3), softline]);
336765
336765
  }
@@ -336834,7 +336834,7 @@ ${fromBody}`;
336834
336834
  } = require_comments();
336835
336835
  var {
336836
336836
  builders: {
336837
- join: join5,
336837
+ join: join4,
336838
336838
  line,
336839
336839
  hardline,
336840
336840
  softline,
@@ -336875,10 +336875,10 @@ ${fromBody}`;
336875
336875
  const isArrowFunctionVariable = path42.match((node22) => !(node22[paramsKey].length === 1 && isObjectType(node22[paramsKey][0])), void 0, (node22, name3) => name3 === "typeAnnotation", (node22) => node22.type === "Identifier", isArrowFunctionVariableDeclarator);
336876
336876
  const shouldInline = !isArrowFunctionVariable && (isParameterInTestCall || node3[paramsKey].length === 0 || node3[paramsKey].length === 1 && (node3[paramsKey][0].type === "NullableTypeAnnotation" || shouldHugType(node3[paramsKey][0])));
336877
336877
  if (shouldInline) {
336878
- return ["<", join5(", ", path42.map(print, paramsKey)), printDanglingCommentsForInline(path42, options2), ">"];
336878
+ return ["<", join4(", ", path42.map(print, paramsKey)), printDanglingCommentsForInline(path42, options2), ">"];
336879
336879
  }
336880
336880
  const trailingComma = node3.type === "TSTypeParameterInstantiation" ? "" : getFunctionParameters(node3).length === 1 && isTSXFile(options2) && !node3[paramsKey][0].constraint && path42.getParentNode().type === "ArrowFunctionExpression" ? "," : shouldPrintComma(options2, "all") ? ifBreak(",") : "";
336881
- return group(["<", indent3([softline, join5([",", line], path42.map(print, paramsKey))]), trailingComma, softline, ">"], {
336881
+ return group(["<", indent3([softline, join4([",", line], path42.map(print, paramsKey))]), trailingComma, softline, ">"], {
336882
336882
  id: getTypeParametersGroupId(node3)
336883
336883
  });
336884
336884
  }
@@ -337016,7 +337016,7 @@ ${fromBody}`;
337016
337016
  indent: indent3,
337017
337017
  ifBreak,
337018
337018
  hardline,
337019
- join: join5,
337019
+ join: join4,
337020
337020
  indentIfBreak
337021
337021
  },
337022
337022
  utils: {
@@ -337172,7 +337172,7 @@ ${fromBody}`;
337172
337172
  if (tailNode.body.type === "SequenceExpression") {
337173
337173
  bodyDoc = group(["(", indent3([softline, bodyDoc]), softline, ")"]);
337174
337174
  }
337175
- return group([group(indent3([isCallee || isAssignmentRhs ? softline : "", group(join5([" =>", line], signatures), {
337175
+ return group([group(indent3([isCallee || isAssignmentRhs ? softline : "", group(join4([" =>", line], signatures), {
337176
337176
  shouldBreak
337177
337177
  })]), {
337178
337178
  id: groupId,
@@ -337324,7 +337324,7 @@ ${fromBody}`;
337324
337324
  builders: {
337325
337325
  line,
337326
337326
  hardline,
337327
- join: join5,
337327
+ join: join4,
337328
337328
  breakParent,
337329
337329
  group
337330
337330
  }
@@ -337338,10 +337338,10 @@ ${fromBody}`;
337338
337338
  } = require_utils72();
337339
337339
  function printClassMemberDecorators(path42, options2, print) {
337340
337340
  const node3 = path42.getValue();
337341
- return group([join5(line, path42.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators(node3, options2) ? hardline : line]);
337341
+ return group([join4(line, path42.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators(node3, options2) ? hardline : line]);
337342
337342
  }
337343
337343
  function printDecoratorsBeforeExport(path42, options2, print) {
337344
- return [join5(hardline, path42.map(print, "declaration", "decorators")), hardline];
337344
+ return [join4(hardline, path42.map(print, "declaration", "decorators")), hardline];
337345
337345
  }
337346
337346
  function printDecorators(path42, options2, print) {
337347
337347
  const node3 = path42.getValue();
@@ -337352,7 +337352,7 @@ ${fromBody}`;
337352
337352
  return;
337353
337353
  }
337354
337354
  const shouldBreak = node3.type === "ClassExpression" || node3.type === "ClassDeclaration" || hasNewlineBetweenOrAfterDecorators(node3, options2);
337355
- return [getParentExportDeclaration(path42) ? hardline : shouldBreak ? breakParent : "", join5(line, path42.map(print, "decorators")), line];
337355
+ return [getParentExportDeclaration(path42) ? hardline : shouldBreak ? breakParent : "", join4(line, path42.map(print, "decorators")), line];
337356
337356
  }
337357
337357
  function hasNewlineBetweenOrAfterDecorators(node3, options2) {
337358
337358
  return node3.decorators.some((decorator) => hasNewline(options2.originalText, locEnd(decorator)));
@@ -337387,7 +337387,7 @@ ${fromBody}`;
337387
337387
  } = require_comments();
337388
337388
  var {
337389
337389
  builders: {
337390
- join: join5,
337390
+ join: join4,
337391
337391
  line,
337392
337392
  hardline,
337393
337393
  softline,
@@ -337487,7 +337487,7 @@ ${fromBody}`;
337487
337487
  }) => marker === listName);
337488
337488
  return [shouldIndentOnlyHeritageClauses(node3) ? ifBreak(" ", line, {
337489
337489
  groupId: getTypeParametersGroupId(node3.typeParameters)
337490
- }) : line, printedLeadingComments, printedLeadingComments && hardline, listName, group(indent3([line, join5([",", line], path42.map(print, listName))]))];
337490
+ }) : line, printedLeadingComments, printedLeadingComments && hardline, listName, group(indent3([line, join4([",", line], path42.map(print, listName))]))];
337491
337491
  }
337492
337492
  function printSuperClass(path42, options2, print) {
337493
337493
  const printed = print("superClass");
@@ -337574,7 +337574,7 @@ ${fromBody}`;
337574
337574
  } = require_util8();
337575
337575
  var {
337576
337576
  builders: {
337577
- join: join5,
337577
+ join: join4,
337578
337578
  line,
337579
337579
  group,
337580
337580
  indent: indent3,
@@ -337611,7 +337611,7 @@ ${fromBody}`;
337611
337611
  if (isNonEmptyArray(node3.extends)) {
337612
337612
  extendsParts.push(shouldIndentOnlyHeritageClauses ? ifBreak(" ", line, {
337613
337613
  groupId: getTypeParametersGroupId(node3.typeParameters)
337614
- }) : line, "extends ", (node3.extends.length === 1 ? identity3 : indent3)(join5([",", line], path42.map(print, "extends"))));
337614
+ }) : line, "extends ", (node3.extends.length === 1 ? identity3 : indent3)(join4([",", line], path42.map(print, "extends"))));
337615
337615
  }
337616
337616
  if (node3.id && hasComment(node3.id, CommentCheckFlags.Trailing) || isNonEmptyArray(node3.extends)) {
337617
337617
  if (shouldIndentOnlyHeritageClauses) {
@@ -337641,7 +337641,7 @@ ${fromBody}`;
337641
337641
  softline,
337642
337642
  group,
337643
337643
  indent: indent3,
337644
- join: join5,
337644
+ join: join4,
337645
337645
  line,
337646
337646
  ifBreak,
337647
337647
  hardline
@@ -337782,14 +337782,14 @@ ${fromBody}`;
337782
337782
  throw new Error(`Unknown specifier type ${JSON.stringify(specifierType)}`);
337783
337783
  }
337784
337784
  }, "specifiers");
337785
- parts.push(join5(", ", standaloneSpecifiers));
337785
+ parts.push(join4(", ", standaloneSpecifiers));
337786
337786
  if (groupedSpecifiers.length > 0) {
337787
337787
  if (standaloneSpecifiers.length > 0) {
337788
337788
  parts.push(", ");
337789
337789
  }
337790
337790
  const canBreak = groupedSpecifiers.length > 1 || standaloneSpecifiers.length > 0 || node3.specifiers.some((node22) => hasComment(node22));
337791
337791
  if (canBreak) {
337792
- parts.push(group(["{", indent3([options2.bracketSpacing ? line : softline, join5([",", line], groupedSpecifiers)]), ifBreak(shouldPrintComma(options2) ? "," : ""), options2.bracketSpacing ? line : softline, "}"]));
337792
+ parts.push(group(["{", indent3([options2.bracketSpacing ? line : softline, join4([",", line], groupedSpecifiers)]), ifBreak(shouldPrintComma(options2) ? "," : ""), options2.bracketSpacing ? line : softline, "}"]));
337793
337793
  } else {
337794
337794
  parts.push(["{", options2.bracketSpacing ? " " : "", ...groupedSpecifiers, options2.bracketSpacing ? " " : "", "}"]);
337795
337795
  }
@@ -337814,7 +337814,7 @@ ${fromBody}`;
337814
337814
  function printImportAssertions(path42, options2, print) {
337815
337815
  const node3 = path42.getNode();
337816
337816
  if (isNonEmptyArray(node3.assertions)) {
337817
- return [" assert {", options2.bracketSpacing ? " " : "", join5(", ", path42.map(print, "assertions")), options2.bracketSpacing ? " " : "", "}"];
337817
+ return [" assert {", options2.bracketSpacing ? " " : "", join4(", ", path42.map(print, "assertions")), options2.bracketSpacing ? " " : "", "}"];
337818
337818
  }
337819
337819
  return "";
337820
337820
  }
@@ -338718,7 +338718,7 @@ ${fromBody}`;
338718
338718
  } = require_util8();
338719
338719
  var {
338720
338720
  builders: {
338721
- join: join5,
338721
+ join: join4,
338722
338722
  line,
338723
338723
  hardline,
338724
338724
  softline,
@@ -338826,7 +338826,7 @@ ${fromBody}`;
338826
338826
  case "TSTypeAliasDeclaration":
338827
338827
  return printTypeAlias(path42, options2, print);
338828
338828
  case "TSQualifiedName":
338829
- return join5(".", [print("left"), print("right")]);
338829
+ return join4(".", [print("left"), print("right")]);
338830
338830
  case "TSAbstractMethodDefinition":
338831
338831
  case "TSDeclareMethod":
338832
338832
  return printClassMethod(path42, options2, print);
@@ -338902,7 +338902,7 @@ ${fromBody}`;
338902
338902
  case "TSIndexSignature": {
338903
338903
  const parent2 = path42.getParentNode();
338904
338904
  const trailingComma = node3.parameters.length > 1 ? ifBreak(shouldPrintComma(options2) ? "," : "") : "";
338905
- const parametersGroup = group([indent3([softline, join5([", ", softline], path42.map(print, "parameters"))]), trailingComma, softline]);
338905
+ const parametersGroup = group([indent3([softline, join4([", ", softline], path42.map(print, "parameters"))]), trailingComma, softline]);
338906
338906
  return [node3.export ? "export " : "", node3.accessibility ? [node3.accessibility, " "] : "", node3.static ? "static " : "", node3.readonly ? "readonly " : "", node3.declare ? "declare " : "", "[", node3.parameters ? parametersGroup : "", node3.typeAnnotation ? "]: " : "]", node3.typeAnnotation ? print("typeAnnotation") : "", parent2.type === "ClassBody" ? semi : ""];
338907
338907
  }
338908
338908
  case "TSTypePredicate":
@@ -339074,7 +339074,7 @@ ${fromBody}`;
339074
339074
  } = require_util8();
339075
339075
  var {
339076
339076
  builders: {
339077
- join: join5,
339077
+ join: join4,
339078
339078
  hardline
339079
339079
  },
339080
339080
  utils: {
@@ -339116,7 +339116,7 @@ ${fromBody}`;
339116
339116
  }
339117
339117
  function printIndentableBlockComment(comment2) {
339118
339118
  const lines = comment2.value.split("\n");
339119
- return ["/*", join5(hardline, lines.map((line, index3) => index3 === 0 ? line.trimEnd() : " " + (index3 < lines.length - 1 ? line.trim() : line.trimStart()))), "*/"];
339119
+ return ["/*", join4(hardline, lines.map((line, index3) => index3 === 0 ? line.trimEnd() : " " + (index3 < lines.length - 1 ? line.trim() : line.trimStart()))), "*/"];
339120
339120
  }
339121
339121
  module22.exports = {
339122
339122
  printComment
@@ -339196,7 +339196,7 @@ ${fromBody}`;
339196
339196
  } = require_util8();
339197
339197
  var {
339198
339198
  builders: {
339199
- join: join5,
339199
+ join: join4,
339200
339200
  line,
339201
339201
  hardline,
339202
339202
  softline,
@@ -339546,7 +339546,7 @@ ${fromBody}`;
339546
339546
  }, "expressions");
339547
339547
  return group(parts2);
339548
339548
  }
339549
- return group(join5([",", line], path42.map(print, "expressions")));
339549
+ return group(join4([",", line], path42.map(print, "expressions")));
339550
339550
  }
339551
339551
  case "ThisExpression":
339552
339552
  return "this";
@@ -339669,7 +339669,7 @@ ${fromBody}`;
339669
339669
  }
339670
339670
  return ["catch ", print("body")];
339671
339671
  case "SwitchStatement":
339672
- return [group(["switch (", indent3([softline, print("discriminant")]), softline, ")"]), " {", node3.cases.length > 0 ? indent3([hardline, join5(hardline, path42.map((casePath, index3, cases) => {
339672
+ return [group(["switch (", indent3([softline, print("discriminant")]), softline, ")"]), " {", node3.cases.length > 0 ? indent3([hardline, join4(hardline, path42.map((casePath, index3, cases) => {
339673
339673
  const caseNode = casePath.getValue();
339674
339674
  return [print(), index3 !== cases.length - 1 && isNextLineEmpty(caseNode, options2) ? hardline : ""];
339675
339675
  }, "cases"))]) : "", hardline, "}"];
@@ -339778,7 +339778,7 @@ ${fromBody}`;
339778
339778
  builders: {
339779
339779
  hardline,
339780
339780
  indent: indent3,
339781
- join: join5
339781
+ join: join4
339782
339782
  }
339783
339783
  } = require_doc();
339784
339784
  var preprocess3 = require_print_preprocess();
@@ -339792,10 +339792,10 @@ ${fromBody}`;
339792
339792
  return "[]";
339793
339793
  }
339794
339794
  const printed = path42.map(() => path42.getValue() === null ? "null" : print(), "elements");
339795
- return ["[", indent3([hardline, join5([",", hardline], printed)]), hardline, "]"];
339795
+ return ["[", indent3([hardline, join4([",", hardline], printed)]), hardline, "]"];
339796
339796
  }
339797
339797
  case "ObjectExpression":
339798
- return node3.properties.length === 0 ? "{}" : ["{", indent3([hardline, join5([",", hardline], path42.map(print, "properties"))]), hardline, "}"];
339798
+ return node3.properties.length === 0 ? "{}" : ["{", indent3([hardline, join4([",", hardline], path42.map(print, "properties"))]), hardline, "}"];
339799
339799
  case "ObjectProperty":
339800
339800
  return [print("key"), ": ", print("value")];
339801
339801
  case "UnaryExpression":
@@ -341060,7 +341060,7 @@ ${fromBody}`;
341060
341060
  } = require_util8();
341061
341061
  var {
341062
341062
  builders: {
341063
- join: join5,
341063
+ join: join4,
341064
341064
  line,
341065
341065
  hardline,
341066
341066
  softline,
@@ -341200,10 +341200,10 @@ ${fromBody}`;
341200
341200
  }
341201
341201
  parts.push(print());
341202
341202
  }, "nodes");
341203
- return group(indent3(join5(line, parts)));
341203
+ return group(indent3(join4(line, parts)));
341204
341204
  }
341205
341205
  case "media-query": {
341206
- return [join5(" ", path42.map(print, "nodes")), isLastNode(path42, node3) ? "" : ","];
341206
+ return [join4(" ", path42.map(print, "nodes")), isLastNode(path42, node3) ? "" : ","];
341207
341207
  }
341208
341208
  case "media-type": {
341209
341209
  return adjustNumbers(adjustStrings(node3.value, options2));
@@ -341233,7 +341233,7 @@ ${fromBody}`;
341233
341233
  return node3.value;
341234
341234
  }
341235
341235
  case "selector-root": {
341236
- return group([insideAtRuleNode(path42, "custom-selector") ? [getAncestorNode(path42, "css-atrule").customSelector, line] : "", join5([",", insideAtRuleNode(path42, ["extend", "custom-selector", "nest"]) ? line : hardline], path42.map(print, "nodes"))]);
341236
+ return group([insideAtRuleNode(path42, "custom-selector") ? [getAncestorNode(path42, "css-atrule").customSelector, line] : "", join4([",", insideAtRuleNode(path42, ["extend", "custom-selector", "nest"]) ? line : hardline], path42.map(print, "nodes"))]);
341237
341237
  }
341238
341238
  case "selector-selector": {
341239
341239
  return group(indent3(path42.map(print, "nodes")));
@@ -341273,7 +341273,7 @@ ${fromBody}`;
341273
341273
  return [node3.namespace ? [node3.namespace === true ? "" : node3.namespace.trim(), "|"] : "", node3.value];
341274
341274
  }
341275
341275
  case "selector-pseudo": {
341276
- return [maybeToLowerCase(node3.value), isNonEmptyArray(node3.nodes) ? ["(", join5(", ", path42.map(print, "nodes")), ")"] : ""];
341276
+ return [maybeToLowerCase(node3.value), isNonEmptyArray(node3.nodes) ? ["(", join4(", ", path42.map(print, "nodes")), ")"] : ""];
341277
341277
  }
341278
341278
  case "selector-nesting": {
341279
341279
  return node3.value;
@@ -341454,7 +341454,7 @@ ${fromBody}`;
341454
341454
  case "value-paren_group": {
341455
341455
  const parentNode = path42.getParentNode();
341456
341456
  if (parentNode && isURLFunctionNode(parentNode) && (node3.groups.length === 1 || node3.groups.length > 0 && node3.groups[0].type === "value-comma_group" && node3.groups[0].groups.length > 0 && node3.groups[0].groups[0].type === "value-word" && node3.groups[0].groups[0].value.startsWith("data:"))) {
341457
- return [node3.open ? print("open") : "", join5(",", path42.map(print, "groups")), node3.close ? print("close") : ""];
341457
+ return [node3.open ? print("open") : "", join4(",", path42.map(print, "groups")), node3.close ? print("close") : ""];
341458
341458
  }
341459
341459
  if (!node3.open) {
341460
341460
  const printed2 = path42.map(print, "groups");
@@ -341474,7 +341474,7 @@ ${fromBody}`;
341474
341474
  const isConfiguration = isConfigurationNode(node3, parentNode);
341475
341475
  const shouldBreak = isConfiguration || isSCSSMapItem && !isKey2;
341476
341476
  const shouldDedent = isConfiguration || isKey2;
341477
- const printed = group([node3.open ? print("open") : "", indent3([softline, join5([line], path42.map((childPath, index3) => {
341477
+ const printed = group([node3.open ? print("open") : "", indent3([softline, join4([line], path42.map((childPath, index3) => {
341478
341478
  const child = childPath.getValue();
341479
341479
  const isLast = index3 === node3.groups.length - 1;
341480
341480
  const printed2 = [print(), isLast ? "" : ","];
@@ -341844,7 +341844,7 @@ ${fromBody}`;
341844
341844
  hardline,
341845
341845
  ifBreak,
341846
341846
  indent: indent3,
341847
- join: join5,
341847
+ join: join4,
341848
341848
  line,
341849
341849
  softline
341850
341850
  },
@@ -341936,7 +341936,7 @@ ${fromBody}`;
341936
341936
  return path42.map(print2, "parts");
341937
341937
  }
341938
341938
  case "Hash": {
341939
- return join5(line, path42.map(print2, "pairs"));
341939
+ return join4(line, path42.map(print2, "pairs"));
341940
341940
  }
341941
341941
  case "HashPair": {
341942
341942
  return [node3.key, "=", print2("value")];
@@ -342225,7 +342225,7 @@ ${fromBody}`;
342225
342225
  return "";
342226
342226
  }
342227
342227
  function getTextValueParts(value) {
342228
- return getDocParts(join5(line, splitByHtmlWhitespace(value)));
342228
+ return getDocParts(join4(line, splitByHtmlWhitespace(value)));
342229
342229
  }
342230
342230
  function splitByHtmlWhitespace(string8) {
342231
342231
  return string8.split(/[\t\n\f\r ]+/);
@@ -342309,7 +342309,7 @@ ${fromBody}`;
342309
342309
  if (parts.length === 0) {
342310
342310
  return "";
342311
342311
  }
342312
- return join5(line, parts);
342312
+ return join4(line, parts);
342313
342313
  }
342314
342314
  function printBlockParams(node3) {
342315
342315
  return ["as |", node3.blockParams.join(" "), "|"];
@@ -342406,7 +342406,7 @@ ${fromBody}`;
342406
342406
  "use strict";
342407
342407
  var {
342408
342408
  builders: {
342409
- join: join5,
342409
+ join: join4,
342410
342410
  hardline,
342411
342411
  line,
342412
342412
  softline,
@@ -342451,16 +342451,16 @@ ${fromBody}`;
342451
342451
  case "OperationDefinition": {
342452
342452
  const hasOperation = options2.originalText[locStart(node3)] !== "{";
342453
342453
  const hasName = Boolean(node3.name);
342454
- return [hasOperation ? node3.operation : "", hasOperation && hasName ? [" ", print("name")] : "", hasOperation && !hasName && isNonEmptyArray(node3.variableDefinitions) ? " " : "", isNonEmptyArray(node3.variableDefinitions) ? group(["(", indent3([softline, join5([ifBreak("", ", "), softline], path42.map(print, "variableDefinitions"))]), softline, ")"]) : "", printDirectives(path42, print, node3), node3.selectionSet ? !hasOperation && !hasName ? "" : " " : "", print("selectionSet")];
342454
+ return [hasOperation ? node3.operation : "", hasOperation && hasName ? [" ", print("name")] : "", hasOperation && !hasName && isNonEmptyArray(node3.variableDefinitions) ? " " : "", isNonEmptyArray(node3.variableDefinitions) ? group(["(", indent3([softline, join4([ifBreak("", ", "), softline], path42.map(print, "variableDefinitions"))]), softline, ")"]) : "", printDirectives(path42, print, node3), node3.selectionSet ? !hasOperation && !hasName ? "" : " " : "", print("selectionSet")];
342455
342455
  }
342456
342456
  case "FragmentDefinition": {
342457
- return ["fragment ", print("name"), isNonEmptyArray(node3.variableDefinitions) ? group(["(", indent3([softline, join5([ifBreak("", ", "), softline], path42.map(print, "variableDefinitions"))]), softline, ")"]) : "", " on ", print("typeCondition"), printDirectives(path42, print, node3), " ", print("selectionSet")];
342457
+ return ["fragment ", print("name"), isNonEmptyArray(node3.variableDefinitions) ? group(["(", indent3([softline, join4([ifBreak("", ", "), softline], path42.map(print, "variableDefinitions"))]), softline, ")"]) : "", " on ", print("typeCondition"), printDirectives(path42, print, node3), " ", print("selectionSet")];
342458
342458
  }
342459
342459
  case "SelectionSet": {
342460
- return ["{", indent3([hardline, join5(hardline, printSequence(path42, options2, print, "selections"))]), hardline, "}"];
342460
+ return ["{", indent3([hardline, join4(hardline, printSequence(path42, options2, print, "selections"))]), hardline, "}"];
342461
342461
  }
342462
342462
  case "Field": {
342463
- return group([node3.alias ? [print("alias"), ": "] : "", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join5([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : "", printDirectives(path42, print, node3), node3.selectionSet ? " " : "", print("selectionSet")]);
342463
+ return group([node3.alias ? [print("alias"), ": "] : "", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join4([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : "", printDirectives(path42, print, node3), node3.selectionSet ? " " : "", print("selectionSet")]);
342464
342464
  }
342465
342465
  case "Name": {
342466
342466
  return node3.value;
@@ -342474,7 +342474,7 @@ ${fromBody}`;
342474
342474
  if (lines.every((line2) => line2 === "")) {
342475
342475
  lines.length = 0;
342476
342476
  }
342477
- return join5(hardline, ['"""', ...lines, '"""']);
342477
+ return join4(hardline, ['"""', ...lines, '"""']);
342478
342478
  }
342479
342479
  return ['"', node3.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"), '"'];
342480
342480
  }
@@ -342493,17 +342493,17 @@ ${fromBody}`;
342493
342493
  return ["$", print("name")];
342494
342494
  }
342495
342495
  case "ListValue": {
342496
- return group(["[", indent3([softline, join5([ifBreak("", ", "), softline], path42.map(print, "values"))]), softline, "]"]);
342496
+ return group(["[", indent3([softline, join4([ifBreak("", ", "), softline], path42.map(print, "values"))]), softline, "]"]);
342497
342497
  }
342498
342498
  case "ObjectValue": {
342499
- return group(["{", options2.bracketSpacing && node3.fields.length > 0 ? " " : "", indent3([softline, join5([ifBreak("", ", "), softline], path42.map(print, "fields"))]), softline, ifBreak("", options2.bracketSpacing && node3.fields.length > 0 ? " " : ""), "}"]);
342499
+ return group(["{", options2.bracketSpacing && node3.fields.length > 0 ? " " : "", indent3([softline, join4([ifBreak("", ", "), softline], path42.map(print, "fields"))]), softline, ifBreak("", options2.bracketSpacing && node3.fields.length > 0 ? " " : ""), "}"]);
342500
342500
  }
342501
342501
  case "ObjectField":
342502
342502
  case "Argument": {
342503
342503
  return [print("name"), ": ", print("value")];
342504
342504
  }
342505
342505
  case "Directive": {
342506
- return ["@", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join5([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : ""];
342506
+ return ["@", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join4([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : ""];
342507
342507
  }
342508
342508
  case "NamedType": {
342509
342509
  return print("name");
@@ -342513,17 +342513,17 @@ ${fromBody}`;
342513
342513
  }
342514
342514
  case "ObjectTypeExtension":
342515
342515
  case "ObjectTypeDefinition": {
342516
- return [print("description"), node3.description ? hardline : "", node3.kind === "ObjectTypeExtension" ? "extend " : "", "type ", print("name"), node3.interfaces.length > 0 ? [" implements ", ...printInterfaces(path42, options2, print)] : "", printDirectives(path42, print, node3), node3.fields.length > 0 ? [" {", indent3([hardline, join5(hardline, printSequence(path42, options2, print, "fields"))]), hardline, "}"] : ""];
342516
+ return [print("description"), node3.description ? hardline : "", node3.kind === "ObjectTypeExtension" ? "extend " : "", "type ", print("name"), node3.interfaces.length > 0 ? [" implements ", ...printInterfaces(path42, options2, print)] : "", printDirectives(path42, print, node3), node3.fields.length > 0 ? [" {", indent3([hardline, join4(hardline, printSequence(path42, options2, print, "fields"))]), hardline, "}"] : ""];
342517
342517
  }
342518
342518
  case "FieldDefinition": {
342519
- return [print("description"), node3.description ? hardline : "", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join5([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : "", ": ", print("type"), printDirectives(path42, print, node3)];
342519
+ return [print("description"), node3.description ? hardline : "", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join4([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : "", ": ", print("type"), printDirectives(path42, print, node3)];
342520
342520
  }
342521
342521
  case "DirectiveDefinition": {
342522
- return [print("description"), node3.description ? hardline : "", "directive ", "@", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join5([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : "", node3.repeatable ? " repeatable" : "", " on ", join5(" | ", path42.map(print, "locations"))];
342522
+ return [print("description"), node3.description ? hardline : "", "directive ", "@", print("name"), node3.arguments.length > 0 ? group(["(", indent3([softline, join4([ifBreak("", ", "), softline], printSequence(path42, options2, print, "arguments"))]), softline, ")"]) : "", node3.repeatable ? " repeatable" : "", " on ", join4(" | ", path42.map(print, "locations"))];
342523
342523
  }
342524
342524
  case "EnumTypeExtension":
342525
342525
  case "EnumTypeDefinition": {
342526
- return [print("description"), node3.description ? hardline : "", node3.kind === "EnumTypeExtension" ? "extend " : "", "enum ", print("name"), printDirectives(path42, print, node3), node3.values.length > 0 ? [" {", indent3([hardline, join5(hardline, printSequence(path42, options2, print, "values"))]), hardline, "}"] : ""];
342526
+ return [print("description"), node3.description ? hardline : "", node3.kind === "EnumTypeExtension" ? "extend " : "", "enum ", print("name"), printDirectives(path42, print, node3), node3.values.length > 0 ? [" {", indent3([hardline, join4(hardline, printSequence(path42, options2, print, "values"))]), hardline, "}"] : ""];
342527
342527
  }
342528
342528
  case "EnumValueDefinition": {
342529
342529
  return [print("description"), node3.description ? hardline : "", print("name"), printDirectives(path42, print, node3)];
@@ -342533,20 +342533,20 @@ ${fromBody}`;
342533
342533
  }
342534
342534
  case "InputObjectTypeExtension":
342535
342535
  case "InputObjectTypeDefinition": {
342536
- return [print("description"), node3.description ? hardline : "", node3.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", print("name"), printDirectives(path42, print, node3), node3.fields.length > 0 ? [" {", indent3([hardline, join5(hardline, printSequence(path42, options2, print, "fields"))]), hardline, "}"] : ""];
342536
+ return [print("description"), node3.description ? hardline : "", node3.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", print("name"), printDirectives(path42, print, node3), node3.fields.length > 0 ? [" {", indent3([hardline, join4(hardline, printSequence(path42, options2, print, "fields"))]), hardline, "}"] : ""];
342537
342537
  }
342538
342538
  case "SchemaExtension": {
342539
- return ["extend schema", printDirectives(path42, print, node3), ...node3.operationTypes.length > 0 ? [" {", indent3([hardline, join5(hardline, printSequence(path42, options2, print, "operationTypes"))]), hardline, "}"] : []];
342539
+ return ["extend schema", printDirectives(path42, print, node3), ...node3.operationTypes.length > 0 ? [" {", indent3([hardline, join4(hardline, printSequence(path42, options2, print, "operationTypes"))]), hardline, "}"] : []];
342540
342540
  }
342541
342541
  case "SchemaDefinition": {
342542
- return [print("description"), node3.description ? hardline : "", "schema", printDirectives(path42, print, node3), " {", node3.operationTypes.length > 0 ? indent3([hardline, join5(hardline, printSequence(path42, options2, print, "operationTypes"))]) : "", hardline, "}"];
342542
+ return [print("description"), node3.description ? hardline : "", "schema", printDirectives(path42, print, node3), " {", node3.operationTypes.length > 0 ? indent3([hardline, join4(hardline, printSequence(path42, options2, print, "operationTypes"))]) : "", hardline, "}"];
342543
342543
  }
342544
342544
  case "OperationTypeDefinition": {
342545
342545
  return [print("operation"), ": ", print("type")];
342546
342546
  }
342547
342547
  case "InterfaceTypeExtension":
342548
342548
  case "InterfaceTypeDefinition": {
342549
- return [print("description"), node3.description ? hardline : "", node3.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", print("name"), node3.interfaces.length > 0 ? [" implements ", ...printInterfaces(path42, options2, print)] : "", printDirectives(path42, print, node3), node3.fields.length > 0 ? [" {", indent3([hardline, join5(hardline, printSequence(path42, options2, print, "fields"))]), hardline, "}"] : ""];
342549
+ return [print("description"), node3.description ? hardline : "", node3.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", print("name"), node3.interfaces.length > 0 ? [" implements ", ...printInterfaces(path42, options2, print)] : "", printDirectives(path42, print, node3), node3.fields.length > 0 ? [" {", indent3([hardline, join4(hardline, printSequence(path42, options2, print, "fields"))]), hardline, "}"] : ""];
342550
342550
  }
342551
342551
  case "FragmentSpread": {
342552
342552
  return ["...", print("name"), printDirectives(path42, print, node3)];
@@ -342556,7 +342556,7 @@ ${fromBody}`;
342556
342556
  }
342557
342557
  case "UnionTypeExtension":
342558
342558
  case "UnionTypeDefinition": {
342559
- return group([print("description"), node3.description ? hardline : "", group([node3.kind === "UnionTypeExtension" ? "extend " : "", "union ", print("name"), printDirectives(path42, print, node3), node3.types.length > 0 ? [" =", ifBreak("", " "), indent3([ifBreak([line, " "]), join5([line, "| "], path42.map(print, "types"))])] : ""])]);
342559
+ return group([print("description"), node3.description ? hardline : "", group([node3.kind === "UnionTypeExtension" ? "extend " : "", "union ", print("name"), printDirectives(path42, print, node3), node3.types.length > 0 ? [" =", ifBreak("", " "), indent3([ifBreak([line, " "]), join4([line, "| "], path42.map(print, "types"))])] : ""])]);
342560
342560
  }
342561
342561
  case "ScalarTypeExtension":
342562
342562
  case "ScalarTypeDefinition": {
@@ -342576,7 +342576,7 @@ ${fromBody}`;
342576
342576
  if (node3.directives.length === 0) {
342577
342577
  return "";
342578
342578
  }
342579
- const printed = join5(line, path42.map(print, "directives"));
342579
+ const printed = join4(line, path42.map(print, "directives"));
342580
342580
  if (node3.kind === "FragmentDefinition" || node3.kind === "OperationDefinition") {
342581
342581
  return group([line, printed]);
342582
342582
  }
@@ -343201,7 +343201,7 @@ ${extracted.content}`;
343201
343201
  var {
343202
343202
  builders: {
343203
343203
  breakParent,
343204
- join: join5,
343204
+ join: join4,
343205
343205
  line,
343206
343206
  literalline,
343207
343207
  markAsRoot,
@@ -343502,9 +343502,9 @@ ${extracted.content}`;
343502
343502
  function printTableContents(isCompact) {
343503
343503
  const parts = [printRow(contents[0], isCompact), printAlign(isCompact)];
343504
343504
  if (contents.length > 1) {
343505
- parts.push(join5(hardlineWithoutBreakParent, contents.slice(1).map((rowContents) => printRow(rowContents, isCompact))));
343505
+ parts.push(join4(hardlineWithoutBreakParent, contents.slice(1).map((rowContents) => printRow(rowContents, isCompact))));
343506
343506
  }
343507
- return join5(hardlineWithoutBreakParent, parts);
343507
+ return join4(hardlineWithoutBreakParent, parts);
343508
343508
  }
343509
343509
  function printAlign(isCompact) {
343510
343510
  const align22 = columnMaxWidths.map((width, index3) => {
@@ -343941,7 +343941,7 @@ ${extracted.content}`;
343941
343941
  builders: {
343942
343942
  line,
343943
343943
  hardline,
343944
- join: join5
343944
+ join: join4
343945
343945
  },
343946
343946
  utils: {
343947
343947
  getDocParts,
@@ -344295,7 +344295,7 @@ ${extracted.content}`;
344295
344295
  return tagName === "script" && attributeName === "setup" || tagName === "style" && attributeName === "vars";
344296
344296
  }
344297
344297
  function getTextValueParts(node3, value = node3.value) {
344298
- return node3.parent.isWhitespaceSensitive ? node3.parent.isIndentationSensitive ? replaceTextEndOfLine(value) : replaceTextEndOfLine(dedentString(htmlTrimPreserveIndentation(value)), hardline) : getDocParts(join5(line, splitByHtmlWhitespace(value)));
344298
+ return node3.parent.isWhitespaceSensitive ? node3.parent.isIndentationSensitive ? replaceTextEndOfLine(value) : replaceTextEndOfLine(dedentString(htmlTrimPreserveIndentation(value)), hardline) : getDocParts(join4(line, splitByHtmlWhitespace(value)));
344299
344299
  }
344300
344300
  function isVueScriptTag(node3, options2) {
344301
344301
  return isVueSfcBlock(node3, options2) && node3.name === "script";
@@ -345590,7 +345590,7 @@ ${extracted.content}`;
345590
345590
  var {
345591
345591
  builders: {
345592
345592
  indent: indent3,
345593
- join: join5,
345593
+ join: join4,
345594
345594
  line,
345595
345595
  softline,
345596
345596
  hardline
@@ -345704,7 +345704,7 @@ ${extracted.content}`;
345704
345704
  const forceNotToBreakAttrContent = node3.type === "element" && node3.fullName === "script" && node3.attrs.length === 1 && node3.attrs[0].fullName === "src" && node3.children.length === 0;
345705
345705
  const shouldPrintAttributePerLine = options2.singleAttributePerLine && node3.attrs.length > 1 && !isVueSfcBlock(node3, options2);
345706
345706
  const attributeLine = shouldPrintAttributePerLine ? hardline : line;
345707
- const parts = [indent3([forceNotToBreakAttrContent ? " " : line, join5(attributeLine, printedAttributes)])];
345707
+ const parts = [indent3([forceNotToBreakAttrContent ? " " : line, join4(attributeLine, printedAttributes)])];
345708
345708
  if (node3.firstChild && needsToBorrowParentOpeningTagEndMarker(node3.firstChild) || node3.isSelfClosing && needsToBorrowLastChildClosingTagEndMarker(node3.parent) || forceNotToBreakAttrContent) {
345709
345709
  parts.push(node3.isSelfClosing ? " " : "");
345710
345710
  } else {
@@ -345938,7 +345938,7 @@ ${extracted.content}`;
345938
345938
  var {
345939
345939
  builders: {
345940
345940
  ifBreak,
345941
- join: join5,
345941
+ join: join4,
345942
345942
  line
345943
345943
  }
345944
345944
  } = require_doc();
@@ -345973,7 +345973,7 @@ ${extracted.content}`;
345973
345973
  return index3 === -1 ? descriptor.length : index3;
345974
345974
  });
345975
345975
  const maxDescriptorLeftLength = getMax(descriptorLeftLengths);
345976
- return join5([",", line], urls.map((url, index3) => {
345976
+ return join4([",", line], urls.map((url, index3) => {
345977
345977
  const parts = [url];
345978
345978
  const descriptor = descriptors[index3];
345979
345979
  if (descriptor) {
@@ -347147,7 +347147,7 @@ ${text8}`;
347147
347147
  line,
347148
347148
  softline,
347149
347149
  hardline,
347150
- join: join5
347150
+ join: join4
347151
347151
  }
347152
347152
  } = require_doc();
347153
347153
  var {
@@ -347170,7 +347170,7 @@ ${text8}`;
347170
347170
  }
347171
347171
  const lastItem = getLast(node3.children);
347172
347172
  const isLastItemEmptyMappingItem = lastItem && lastItem.type === "flowMappingItem" && isEmptyNode(lastItem.key) && isEmptyNode(lastItem.value);
347173
- return [openMarker, alignWithSpaces(options2.tabWidth, [bracketSpacing, printChildren(path42, print, options2), options2.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node3) ? [hardline, join5(hardline, path42.map(print, "endComments"))] : ""]), isLastItemEmptyMappingItem ? "" : bracketSpacing, closeMarker];
347173
+ return [openMarker, alignWithSpaces(options2.tabWidth, [bracketSpacing, printChildren(path42, print, options2), options2.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node3) ? [hardline, join4(hardline, path42.map(print, "endComments"))] : ""]), isLastItemEmptyMappingItem ? "" : bracketSpacing, closeMarker];
347174
347174
  }
347175
347175
  function printChildren(path42, print, options2) {
347176
347176
  const node3 = path42.getValue();
@@ -347192,7 +347192,7 @@ ${text8}`;
347192
347192
  group,
347193
347193
  hardline,
347194
347194
  ifBreak,
347195
- join: join5,
347195
+ join: join4,
347196
347196
  line
347197
347197
  }
347198
347198
  } = require_doc();
@@ -347234,7 +347234,7 @@ ${text8}`;
347234
347234
  return [": ", alignWithSpaces(2, printedValue)];
347235
347235
  }
347236
347236
  if (hasLeadingComments(value) || !isInlineNode(key2.content)) {
347237
- return ["? ", alignWithSpaces(2, printedKey), hardline, join5("", path42.map(print, "value", "leadingComments").map((comment2) => [comment2, hardline])), ": ", alignWithSpaces(2, printedValue)];
347237
+ return ["? ", alignWithSpaces(2, printedKey), hardline, join4("", path42.map(print, "value", "leadingComments").map((comment2) => [comment2, hardline])), ": ", alignWithSpaces(2, printedValue)];
347238
347238
  }
347239
347239
  if (isSingleLineNode(key2.content) && !hasLeadingComments(key2.content) && !hasMiddleComments(key2.content) && !hasTrailingComment(key2.content) && !hasEndComments(key2) && !hasLeadingComments(value.content) && !hasMiddleComments(value.content) && !hasEndComments(value) && isAbsolutelyPrintedAsSingleLineNode(value.content, options2)) {
347240
347240
  return [printedKey, spaceBeforeColon, ": ", printedValue];
@@ -347318,7 +347318,7 @@ ${text8}`;
347318
347318
  dedentToRoot,
347319
347319
  fill: fill2,
347320
347320
  hardline,
347321
- join: join5,
347321
+ join: join4,
347322
347322
  line,
347323
347323
  literalline,
347324
347324
  markAsRoot
@@ -347361,7 +347361,7 @@ ${text8}`;
347361
347361
  if (index3 === 0) {
347362
347362
  contentsParts.push(hardline);
347363
347363
  }
347364
- contentsParts.push(fill2(getDocParts(join5(line, lineWords))));
347364
+ contentsParts.push(fill2(getDocParts(join4(line, lineWords))));
347365
347365
  if (index3 !== lineContents.length - 1) {
347366
347366
  contentsParts.push(lineWords.length === 0 ? hardline : markAsRoot(literalline));
347367
347367
  } else if (node3.chomping === "keep" && isLastDescendant) {
@@ -347387,7 +347387,7 @@ ${text8}`;
347387
347387
  fill: fill2,
347388
347388
  group,
347389
347389
  hardline,
347390
- join: join5,
347390
+ join: join4,
347391
347391
  line,
347392
347392
  lineSuffix,
347393
347393
  literalline
@@ -347436,7 +347436,7 @@ ${text8}`;
347436
347436
  const node3 = path42.getValue();
347437
347437
  const parts = [];
347438
347438
  if (node3.type !== "mappingValue" && hasLeadingComments(node3)) {
347439
- parts.push([join5(hardline, path42.map(print, "leadingComments")), hardline]);
347439
+ parts.push([join4(hardline, path42.map(print, "leadingComments")), hardline]);
347440
347440
  }
347441
347441
  const {
347442
347442
  tag,
@@ -347463,7 +347463,7 @@ ${text8}`;
347463
347463
  }
347464
347464
  }
347465
347465
  if (hasMiddleComments(node3)) {
347466
- parts.push([node3.middleComments.length === 1 ? "" : hardline, join5(hardline, path42.map(print, "middleComments")), hardline]);
347466
+ parts.push([node3.middleComments.length === 1 ? "" : hardline, join4(hardline, path42.map(print, "middleComments")), hardline]);
347467
347467
  }
347468
347468
  const parentNode = path42.getParentNode();
347469
347469
  if (hasPrettierIgnore(path42)) {
@@ -347475,7 +347475,7 @@ ${text8}`;
347475
347475
  parts.push(lineSuffix([node3.type === "mappingValue" && !node3.content ? "" : " ", parentNode.type === "mappingKey" && path42.getParentNode(2).type === "mapping" && isInlineNode(node3) ? "" : breakParent, print("trailingComment")]));
347476
347476
  }
347477
347477
  if (shouldPrintEndComments(node3)) {
347478
- parts.push(alignWithSpaces(node3.type === "sequenceItem" ? 2 : 0, [hardline, join5(hardline, path42.map((path210) => [isPreviousLineEmpty(options2.originalText, path210.getValue(), locStart) ? hardline : "", print()], "endComments"))]));
347478
+ parts.push(alignWithSpaces(node3.type === "sequenceItem" ? 2 : 0, [hardline, join4(hardline, path42.map((path210) => [isPreviousLineEmpty(options2.originalText, path210.getValue(), locStart) ? hardline : "", print()], "endComments"))]));
347479
347479
  }
347480
347480
  parts.push(nextEmptyLine);
347481
347481
  return parts;
@@ -347525,10 +347525,10 @@ ${text8}`;
347525
347525
  if (shouldPrintDocumentBody(node3)) {
347526
347526
  parts.push(print("body"));
347527
347527
  }
347528
- return join5(hardline, parts);
347528
+ return join4(hardline, parts);
347529
347529
  }
347530
347530
  case "documentHead":
347531
- return join5(hardline, [...path42.map(print, "children"), ...path42.map(print, "endComments")]);
347531
+ return join4(hardline, [...path42.map(print, "children"), ...path42.map(print, "endComments")]);
347532
347532
  case "documentBody": {
347533
347533
  const {
347534
347534
  children: children2,
@@ -347545,10 +347545,10 @@ ${text8}`;
347545
347545
  separator = hardline;
347546
347546
  }
347547
347547
  }
347548
- return [join5(hardline, path42.map(print, "children")), separator, join5(hardline, path42.map(print, "endComments"))];
347548
+ return [join4(hardline, path42.map(print, "children")), separator, join4(hardline, path42.map(print, "endComments"))];
347549
347549
  }
347550
347550
  case "directive":
347551
- return ["%", join5(" ", [node3.name, ...node3.parameters])];
347551
+ return ["%", join4(" ", [node3.name, ...node3.parameters])];
347552
347552
  case "comment":
347553
347553
  return ["#", node3.value];
347554
347554
  case "alias":
@@ -347583,7 +347583,7 @@ ${text8}`;
347583
347583
  }
347584
347584
  case "mapping":
347585
347585
  case "sequence":
347586
- return join5(hardline, path42.map(print, "children"));
347586
+ return join4(hardline, path42.map(print, "children"));
347587
347587
  case "sequenceItem":
347588
347588
  return ["- ", alignWithSpaces(2, node3.content ? print("content") : "")];
347589
347589
  case "mappingKey":
@@ -347620,7 +347620,7 @@ ${text8}`;
347620
347620
  }
347621
347621
  function printFlowScalarContent(nodeType, content5, options2) {
347622
347622
  const lineContents = getFlowScalarLineContents(nodeType, content5, options2);
347623
- return join5(hardline, lineContents.map((lineContentWords) => fill2(getDocParts(join5(line, lineContentWords)))));
347623
+ return join4(hardline, lineContents.map((lineContentWords) => fill2(getDocParts(join4(line, lineContentWords)))));
347624
347624
  }
347625
347625
  function clean2(node3, newNode) {
347626
347626
  if (isNode4(newNode)) {
@@ -356329,6 +356329,7 @@ var init_ReadmeConfig2 = __esm({
356329
356329
  ReadmeConfig = schemas_exports4.objectWithoutOptionalProperties({
356330
356330
  defaultEndpoint: schemas_exports4.lazy(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).EndpointId).optional(),
356331
356331
  bannerLink: schemas_exports4.string().optional(),
356332
+ introduction: schemas_exports4.string().optional(),
356332
356333
  apiReferenceLink: schemas_exports4.string().optional(),
356333
356334
  features: schemas_exports4.record(schemas_exports4.lazy(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).FeatureId), schemas_exports4.list(schemas_exports4.lazy(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).EndpointId))).optional()
356334
356335
  });
@@ -362930,7 +362931,7 @@ var require_path_reservations = __commonJS({
362930
362931
  var assert2 = require("assert");
362931
362932
  var normalize4 = require_normalize_unicode();
362932
362933
  var stripSlashes = require_strip_trailing_slashes();
362933
- var { join: join5 } = require("path");
362934
+ var { join: join4 } = require("path");
362934
362935
  var platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
362935
362936
  var isWindows = platform === "win32";
362936
362937
  module2.exports = () => {
@@ -362939,7 +362940,7 @@ var require_path_reservations = __commonJS({
362939
362940
  const getDirs = (path42) => {
362940
362941
  const dirs = path42.split("/").slice(0, -1).reduce((set7, path43) => {
362941
362942
  if (set7.length) {
362942
- path43 = join5(set7[set7.length - 1], path43);
362943
+ path43 = join4(set7[set7.length - 1], path43);
362943
362944
  }
362944
362945
  set7.push(path43 || "/");
362945
362946
  return set7;
@@ -363007,7 +363008,7 @@ var require_path_reservations = __commonJS({
363007
363008
  };
363008
363009
  const reserve = (paths, fn2) => {
363009
363010
  paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p2) => {
363010
- return stripSlashes(join5(normalize4(p2))).toLowerCase();
363011
+ return stripSlashes(join4(normalize4(p2))).toLowerCase();
363011
363012
  });
363012
363013
  const dirs = new Set(
363013
363014
  paths.map((path42) => getDirs(path42)).reduce((a2, b2) => a2.concat(b2))
@@ -427649,7 +427650,7 @@ var require_require_directory = __commonJS({
427649
427650
  "pnp:/home/circleci/project/.yarn/cache/require-directory-npm-2.1.1-8608aee50b-fb47e70bf0.zip/node_modules/require-directory/index.js"(exports2, module2) {
427650
427651
  "use strict";
427651
427652
  var fs9 = require("fs");
427652
- var join5 = require("path").join;
427653
+ var join4 = require("path").join;
427653
427654
  var resolve6 = require("path").resolve;
427654
427655
  var dirname5 = require("path").dirname;
427655
427656
  var defaultOptions2 = {
@@ -427679,7 +427680,7 @@ var require_require_directory = __commonJS({
427679
427680
  }
427680
427681
  path42 = !path42 ? dirname5(m.filename) : resolve6(dirname5(m.filename), path42);
427681
427682
  fs9.readdirSync(path42).forEach(function(filename) {
427682
- var joined = join5(path42, filename), files, key2, obj;
427683
+ var joined = join4(path42, filename), files, key2, obj;
427683
427684
  if (fs9.statSync(joined).isDirectory() && options2.recurse) {
427684
427685
  files = requireDirectory(m, joined, options2);
427685
427686
  if (Object.keys(files).length) {
@@ -432330,7 +432331,7 @@ var require_minimist = __commonJS({
432330
432331
  var require_rc = __commonJS({
432331
432332
  "pnp:/home/circleci/project/.yarn/cache/rc-npm-1.2.8-d6768ac936-2e26e052f8.zip/node_modules/rc/index.js"(exports2, module2) {
432332
432333
  var cc = require_utils19();
432333
- var join5 = require("path").join;
432334
+ var join4 = require("path").join;
432334
432335
  var deepExtend = require_deep_extend();
432335
432336
  var etc = "/etc";
432336
432337
  var win = process.platform === "win32";
@@ -432356,15 +432357,15 @@ var require_rc = __commonJS({
432356
432357
  }
432357
432358
  if (!win)
432358
432359
  [
432359
- join5(etc, name3, "config"),
432360
- join5(etc, name3 + "rc")
432360
+ join4(etc, name3, "config"),
432361
+ join4(etc, name3 + "rc")
432361
432362
  ].forEach(addConfigFile);
432362
432363
  if (home)
432363
432364
  [
432364
- join5(home, ".config", name3, "config"),
432365
- join5(home, ".config", name3),
432366
- join5(home, "." + name3, "config"),
432367
- join5(home, "." + name3 + "rc")
432365
+ join4(home, ".config", name3, "config"),
432366
+ join4(home, ".config", name3),
432367
+ join4(home, "." + name3, "config"),
432368
+ join4(home, "." + name3 + "rc")
432368
432369
  ].forEach(addConfigFile);
432369
432370
  addConfigFile(cc.find("." + name3 + "rc"));
432370
432371
  if (env5.config)
@@ -441188,7 +441189,7 @@ var require_view = __commonJS({
441188
441189
  var dirname5 = path42.dirname;
441189
441190
  var basename4 = path42.basename;
441190
441191
  var extname3 = path42.extname;
441191
- var join5 = path42.join;
441192
+ var join4 = path42.join;
441192
441193
  var resolve6 = path42.resolve;
441193
441194
  module2.exports = View;
441194
441195
  function View(name3, options2) {
@@ -441236,12 +441237,12 @@ var require_view = __commonJS({
441236
441237
  };
441237
441238
  View.prototype.resolve = function resolve7(dir, file) {
441238
441239
  var ext = this.ext;
441239
- var path43 = join5(dir, file);
441240
+ var path43 = join4(dir, file);
441240
441241
  var stat = tryStat(path43);
441241
441242
  if (stat && stat.isFile()) {
441242
441243
  return path43;
441243
441244
  }
441244
- path43 = join5(dir, basename4(file, ext), "index" + ext);
441245
+ path43 = join4(dir, basename4(file, ext), "index" + ext);
441245
441246
  stat = tryStat(path43);
441246
441247
  if (stat && stat.isFile()) {
441247
441248
  return path43;
@@ -441700,7 +441701,7 @@ var require_send = __commonJS({
441700
441701
  var Stream2 = require("stream");
441701
441702
  var util2 = require("util");
441702
441703
  var extname3 = path42.extname;
441703
- var join5 = path42.join;
441704
+ var join4 = path42.join;
441704
441705
  var normalize4 = path42.normalize;
441705
441706
  var resolve6 = path42.resolve;
441706
441707
  var sep = path42.sep;
@@ -441919,7 +441920,7 @@ var require_send = __commonJS({
441919
441920
  return res;
441920
441921
  }
441921
441922
  parts = path43.split(sep);
441922
- path43 = normalize4(join5(root4, path43));
441923
+ path43 = normalize4(join4(root4, path43));
441923
441924
  } else {
441924
441925
  if (UP_PATH_REGEXP.test(path43)) {
441925
441926
  debug('malicious path "%s"', path43);
@@ -442060,7 +442061,7 @@ var require_send = __commonJS({
442060
442061
  return self2.onStatError(err);
442061
442062
  return self2.error(404);
442062
442063
  }
442063
- var p2 = join5(path43, self2._index[i2]);
442064
+ var p2 = join4(path43, self2._index[i2]);
442064
442065
  debug('stat "%s"', p2);
442065
442066
  fs9.stat(p2, function(err2, stat) {
442066
442067
  if (err2)
@@ -445140,9 +445141,9 @@ var require_express3 = __commonJS({
445140
445141
  }
445141
445142
  });
445142
445143
 
445143
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/stream.js
445144
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/stream.js
445144
445145
  var require_stream2 = __commonJS({
445145
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/stream.js"(exports2, module2) {
445146
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/stream.js"(exports2, module2) {
445146
445147
  "use strict";
445147
445148
  var { Duplex } = require("stream");
445148
445149
  function emitClose(stream) {
@@ -445245,9 +445246,9 @@ var require_stream2 = __commonJS({
445245
445246
  }
445246
445247
  });
445247
445248
 
445248
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/constants.js
445249
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/constants.js
445249
445250
  var require_constants6 = __commonJS({
445250
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/constants.js"(exports2, module2) {
445251
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/constants.js"(exports2, module2) {
445251
445252
  "use strict";
445252
445253
  module2.exports = {
445253
445254
  BINARY_TYPES: ["nodebuffer", "arraybuffer", "fragments"],
@@ -445263,9 +445264,9 @@ var require_constants6 = __commonJS({
445263
445264
  }
445264
445265
  });
445265
445266
 
445266
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/buffer-util.js
445267
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/buffer-util.js
445267
445268
  var require_buffer_util = __commonJS({
445268
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/buffer-util.js"(exports2, module2) {
445269
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/buffer-util.js"(exports2, module2) {
445269
445270
  "use strict";
445270
445271
  var { EMPTY_BUFFER } = require_constants6();
445271
445272
  var FastBuffer = Buffer[Symbol.species];
@@ -445345,9 +445346,9 @@ var require_buffer_util = __commonJS({
445345
445346
  }
445346
445347
  });
445347
445348
 
445348
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/limiter.js
445349
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/limiter.js
445349
445350
  var require_limiter2 = __commonJS({
445350
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/limiter.js"(exports2, module2) {
445351
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/limiter.js"(exports2, module2) {
445351
445352
  "use strict";
445352
445353
  var kDone = Symbol("kDone");
445353
445354
  var kRun = Symbol("kRun");
@@ -445379,9 +445380,9 @@ var require_limiter2 = __commonJS({
445379
445380
  }
445380
445381
  });
445381
445382
 
445382
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/permessage-deflate.js
445383
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/permessage-deflate.js
445383
445384
  var require_permessage_deflate = __commonJS({
445384
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
445385
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
445385
445386
  "use strict";
445386
445387
  var zlib2 = require("zlib");
445387
445388
  var bufferUtil = require_buffer_util();
@@ -445661,9 +445662,9 @@ var require_permessage_deflate = __commonJS({
445661
445662
  }
445662
445663
  });
445663
445664
 
445664
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/validation.js
445665
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/validation.js
445665
445666
  var require_validation6 = __commonJS({
445666
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/validation.js"(exports2, module2) {
445667
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/validation.js"(exports2, module2) {
445667
445668
  "use strict";
445668
445669
  var { isUtf8 } = require("buffer");
445669
445670
  var tokenChars = [
@@ -445847,9 +445848,9 @@ var require_validation6 = __commonJS({
445847
445848
  }
445848
445849
  });
445849
445850
 
445850
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/receiver.js
445851
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/receiver.js
445851
445852
  var require_receiver = __commonJS({
445852
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/receiver.js"(exports2, module2) {
445853
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/receiver.js"(exports2, module2) {
445853
445854
  "use strict";
445854
445855
  var { Writable: Writable2 } = require("stream");
445855
445856
  var PerMessageDeflate = require_permessage_deflate();
@@ -446344,9 +446345,9 @@ var require_receiver = __commonJS({
446344
446345
  }
446345
446346
  });
446346
446347
 
446347
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/sender.js
446348
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/sender.js
446348
446349
  var require_sender = __commonJS({
446349
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/sender.js"(exports2, module2) {
446350
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/sender.js"(exports2, module2) {
446350
446351
  "use strict";
446351
446352
  var { Duplex } = require("stream");
446352
446353
  var { randomFillSync } = require("crypto");
@@ -446356,6 +446357,9 @@ var require_sender = __commonJS({
446356
446357
  var { mask: applyMask, toBuffer } = require_buffer_util();
446357
446358
  var kByteLength = Symbol("kByteLength");
446358
446359
  var maskBuffer = Buffer.alloc(4);
446360
+ var RANDOM_POOL_SIZE = 8 * 1024;
446361
+ var randomPool;
446362
+ var randomPoolPointer = RANDOM_POOL_SIZE;
446359
446363
  var Sender2 = class {
446360
446364
  constructor(socket, extensions, generateMask) {
446361
446365
  this._extensions = extensions || {};
@@ -446380,7 +446384,17 @@ var require_sender = __commonJS({
446380
446384
  if (options2.generateMask) {
446381
446385
  options2.generateMask(mask2);
446382
446386
  } else {
446383
- randomFillSync(mask2, 0, 4);
446387
+ if (randomPoolPointer === RANDOM_POOL_SIZE) {
446388
+ if (randomPool === void 0) {
446389
+ randomPool = Buffer.alloc(RANDOM_POOL_SIZE);
446390
+ }
446391
+ randomFillSync(randomPool, 0, RANDOM_POOL_SIZE);
446392
+ randomPoolPointer = 0;
446393
+ }
446394
+ mask2[0] = randomPool[randomPoolPointer++];
446395
+ mask2[1] = randomPool[randomPoolPointer++];
446396
+ mask2[2] = randomPool[randomPoolPointer++];
446397
+ mask2[3] = randomPool[randomPoolPointer++];
446384
446398
  }
446385
446399
  skipMasking = (mask2[0] | mask2[1] | mask2[2] | mask2[3]) === 0;
446386
446400
  offset2 = 6;
@@ -446644,9 +446658,9 @@ var require_sender = __commonJS({
446644
446658
  }
446645
446659
  });
446646
446660
 
446647
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/event-target.js
446661
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/event-target.js
446648
446662
  var require_event_target = __commonJS({
446649
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/event-target.js"(exports2, module2) {
446663
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/event-target.js"(exports2, module2) {
446650
446664
  "use strict";
446651
446665
  var { kForOnEventAttribute, kListener } = require_constants6();
446652
446666
  var kCode = Symbol("kCode");
@@ -446794,9 +446808,9 @@ var require_event_target = __commonJS({
446794
446808
  }
446795
446809
  });
446796
446810
 
446797
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/extension.js
446811
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/extension.js
446798
446812
  var require_extension = __commonJS({
446799
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/extension.js"(exports2, module2) {
446813
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/extension.js"(exports2, module2) {
446800
446814
  "use strict";
446801
446815
  var { tokenChars } = require_validation6();
446802
446816
  function push3(dest, name3, elem) {
@@ -446964,9 +446978,9 @@ var require_extension = __commonJS({
446964
446978
  }
446965
446979
  });
446966
446980
 
446967
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/websocket.js
446981
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/websocket.js
446968
446982
  var require_websocket = __commonJS({
446969
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/websocket.js"(exports2, module2) {
446983
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/websocket.js"(exports2, module2) {
446970
446984
  "use strict";
446971
446985
  var EventEmitter2 = require("events");
446972
446986
  var https = require("https");
@@ -447509,7 +447523,8 @@ var require_websocket = __commonJS({
447509
447523
  if (websocket.readyState !== WebSocket2.CONNECTING)
447510
447524
  return;
447511
447525
  req2 = websocket._req = null;
447512
- if (res.headers.upgrade.toLowerCase() !== "websocket") {
447526
+ const upgrade2 = res.headers.upgrade;
447527
+ if (upgrade2 === void 0 || upgrade2.toLowerCase() !== "websocket") {
447513
447528
  abortHandshake(websocket, socket, "Invalid Upgrade header");
447514
447529
  return;
447515
447530
  }
@@ -447715,9 +447730,9 @@ var require_websocket = __commonJS({
447715
447730
  }
447716
447731
  });
447717
447732
 
447718
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/subprotocol.js
447733
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/subprotocol.js
447719
447734
  var require_subprotocol = __commonJS({
447720
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
447735
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
447721
447736
  "use strict";
447722
447737
  var { tokenChars } = require_validation6();
447723
447738
  function parse8(header) {
@@ -447763,9 +447778,9 @@ var require_subprotocol = __commonJS({
447763
447778
  }
447764
447779
  });
447765
447780
 
447766
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/websocket-server.js
447781
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/websocket-server.js
447767
447782
  var require_websocket_server = __commonJS({
447768
- "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/lib/websocket-server.js"(exports2, module2) {
447783
+ "pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/lib/websocket-server.js"(exports2, module2) {
447769
447784
  "use strict";
447770
447785
  var EventEmitter2 = require("events");
447771
447786
  var http4 = require("http");
@@ -447901,18 +447916,19 @@ var require_websocket_server = __commonJS({
447901
447916
  handleUpgrade(req2, socket, head2, cb) {
447902
447917
  socket.on("error", socketOnError);
447903
447918
  const key2 = req2.headers["sec-websocket-key"];
447919
+ const upgrade2 = req2.headers.upgrade;
447904
447920
  const version3 = +req2.headers["sec-websocket-version"];
447905
447921
  if (req2.method !== "GET") {
447906
447922
  const message = "Invalid HTTP method";
447907
447923
  abortHandshakeOrEmitwsClientError(this, req2, socket, 405, message);
447908
447924
  return;
447909
447925
  }
447910
- if (req2.headers.upgrade.toLowerCase() !== "websocket") {
447926
+ if (upgrade2 === void 0 || upgrade2.toLowerCase() !== "websocket") {
447911
447927
  const message = "Invalid Upgrade header";
447912
447928
  abortHandshakeOrEmitwsClientError(this, req2, socket, 400, message);
447913
447929
  return;
447914
447930
  }
447915
- if (!key2 || !keyRegex.test(key2)) {
447931
+ if (key2 === void 0 || !keyRegex.test(key2)) {
447916
447932
  const message = "Missing or invalid Sec-WebSocket-Key header";
447917
447933
  abortHandshakeOrEmitwsClientError(this, req2, socket, 400, message);
447918
447934
  return;
@@ -448754,7 +448770,7 @@ var require_BufferList3 = __commonJS({
448754
448770
  this.head = this.tail = null;
448755
448771
  this.length = 0;
448756
448772
  };
448757
- BufferList.prototype.join = function join5(s2) {
448773
+ BufferList.prototype.join = function join4(s2) {
448758
448774
  if (this.length === 0)
448759
448775
  return "";
448760
448776
  var p2 = this.head;
@@ -1074372,6 +1074388,7 @@ var GeneratorInvocationSchema = z.strictObject({
1074372
1074388
  snippets: z.optional(GeneratorSnippetsSchema),
1074373
1074389
  "ir-version": z.optional(z.string()),
1074374
1074390
  "smart-casing": z.optional(z.boolean()),
1074391
+ api: z.optional(z.object({ settings: z.optional(APIDefinitionSettingsSchema) })),
1074375
1074392
  "disable-examples": z.optional(z.boolean()),
1074376
1074393
  "publish-metadata": z.optional(GeneratorPublishMetadataSchema)
1074377
1074394
  });
@@ -1074412,6 +1074429,7 @@ var ReadmeEndpointSchema = z.union([
1074412
1074429
  // pnp:/home/circleci/project/packages/cli/configuration/lib/generators-yml/schemas/ReadmeSchema.js
1074413
1074430
  var ReadmeSchema = z.strictObject({
1074414
1074431
  bannerLink: z.optional(z.string()),
1074432
+ introduction: z.optional(z.string()),
1074415
1074433
  apiReferenceLink: z.optional(z.string()),
1074416
1074434
  defaultEndpoint: z.optional(ReadmeEndpointSchema).describe("If set, use this endpoint's snippet as the default whenever possible"),
1074417
1074435
  features: z.optional(z.record(z.array(ReadmeEndpointSchema))).describe("Specifies a list of endpoints associated with the feature")
@@ -1074585,7 +1074603,7 @@ async function convertGroup({ absolutePathToGeneratorsConfiguration, groupName,
1074585
1074603
  };
1074586
1074604
  }
1074587
1074605
  async function convertGenerator({ absolutePathToGeneratorsConfiguration, generator, maybeGroupLevelMetadata, maybeTopLevelMetadata, readme }) {
1074588
- var _a5, _b4;
1074606
+ var _a5, _b4, _c4;
1074589
1074607
  return {
1074590
1074608
  name: generator.name,
1074591
1074609
  version: generator.version,
@@ -1074604,7 +1074622,8 @@ async function convertGenerator({ absolutePathToGeneratorsConfiguration, generat
1074604
1074622
  language: getLanguageFromGeneratorName(generator.name),
1074605
1074623
  irVersionOverride: generator["ir-version"] ?? void 0,
1074606
1074624
  publishMetadata: getPublishMetadata({ generatorInvocation: generator }),
1074607
- readme
1074625
+ readme,
1074626
+ settings: ((_c4 = generator.api) == null ? void 0 : _c4.settings) ?? void 0
1074608
1074627
  };
1074609
1074628
  }
1074610
1074629
  function getPublishMetadata({ generatorInvocation }) {
@@ -1077782,7 +1077801,7 @@ var AccessTokenPosthogManager = class {
1077782
1077801
  properties: {
1077783
1077802
  ...event,
1077784
1077803
  ...event.properties,
1077785
- version: "0.31.0-rc2",
1077804
+ version: "0.31.0-rc3",
1077786
1077805
  usingAccessToken: true
1077787
1077806
  }
1077788
1077807
  });
@@ -1077844,7 +1077863,7 @@ var UserPosthogManager = class {
1077844
1077863
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1077845
1077864
  event: "CLI",
1077846
1077865
  properties: {
1077847
- version: "0.31.0-rc2",
1077866
+ version: "0.31.0-rc3",
1077848
1077867
  ...event,
1077849
1077868
  ...event.properties
1077850
1077869
  }
@@ -1090102,10 +1090121,307 @@ function isRawMultipleBaseUrlsEnvironment(environment) {
1090102
1090121
  var import_fiddle_sdk3 = __toESM(require_fiddle_sdk());
1090103
1090122
  var import_axios3 = __toESM(require_axios4());
1090104
1090123
  var import_fs3 = require("fs");
1090105
- var import_path18 = __toESM(require("path"));
1090106
- var import_promises26 = require("stream/promises");
1090124
+ var import_path17 = __toESM(require("path"));
1090125
+ var import_promises24 = require("stream/promises");
1090107
1090126
  var import_tar = __toESM(require_tar());
1090108
1090127
  var import_tmp_promise2 = __toESM(require_tmp_promise());
1090128
+ var FIDDLE = createFiddleService();
1090129
+ async function loadDependency({ dependencyName, dependenciesConfiguration, context, rootApiFile, cliVersion }) {
1090130
+ let definition3;
1090131
+ let failure = {
1090132
+ type: WorkspaceLoaderFailureType.FAILED_TO_LOAD_DEPENDENCY,
1090133
+ dependencyName
1090134
+ };
1090135
+ const dependency = dependenciesConfiguration.dependencies[dependencyName];
1090136
+ if (dependency == null) {
1090137
+ failure = {
1090138
+ type: WorkspaceLoaderFailureType.DEPENDENCY_NOT_LISTED,
1090139
+ dependencyName
1090140
+ };
1090141
+ } else {
1090142
+ await context.runInteractiveTask({ name: `Download ${stringifyDependency(dependency)}` }, async (contextForDependency) => {
1090143
+ switch (dependency.type) {
1090144
+ case "version":
1090145
+ definition3 = await validateVersionedDependencyAndGetDefinition({
1090146
+ context: contextForDependency,
1090147
+ dependency,
1090148
+ cliVersion
1090149
+ });
1090150
+ return;
1090151
+ case "local":
1090152
+ definition3 = await validateLocalDependencyAndGetDefinition({
1090153
+ context: contextForDependency,
1090154
+ dependency,
1090155
+ cliVersion
1090156
+ });
1090157
+ return;
1090158
+ default:
1090159
+ assertNever(dependency);
1090160
+ }
1090161
+ });
1090162
+ }
1090163
+ if (definition3 != null) {
1090164
+ return { didSucceed: true, definition: definition3 };
1090165
+ } else {
1090166
+ return { didSucceed: false, failure };
1090167
+ }
1090168
+ }
1090169
+ async function validateLocalDependencyAndGetDefinition({ dependency, context, cliVersion }) {
1090170
+ context.logger.info("Parsing...");
1090171
+ const loadDependencyWorkspaceResult = await loadAPIWorkspace({
1090172
+ absolutePathToWorkspace: dependency.absoluteFilepath,
1090173
+ context,
1090174
+ cliVersion,
1090175
+ workspaceName: void 0
1090176
+ });
1090177
+ if (!loadDependencyWorkspaceResult.didSucceed) {
1090178
+ context.failWithoutThrowing("Failed to load api definition", loadDependencyWorkspaceResult.failures);
1090179
+ return void 0;
1090180
+ }
1090181
+ return await loadDependencyWorkspaceResult.workspace.getDefinition({ context });
1090182
+ }
1090183
+ async function validateVersionedDependencyAndGetDefinition({ dependency, context, cliVersion }) {
1090184
+ context.logger.info("Downloading manifest...");
1090185
+ const response = await FIDDLE.definitionRegistry.get(import_fiddle_sdk3.FernFiddle.OrganizationId(dependency.organization), import_fiddle_sdk3.FernFiddle.ApiId(dependency.apiName), dependency.version);
1090186
+ if (!response.ok) {
1090187
+ response.error._visit({
1090188
+ orgDoesNotExistError: () => {
1090189
+ context.failWithoutThrowing("Organization does not exist");
1090190
+ },
1090191
+ apiDoesNotExistError: () => {
1090192
+ context.failWithoutThrowing("API does not exist");
1090193
+ },
1090194
+ versionDoesNotExistError: () => {
1090195
+ context.failWithoutThrowing("Version does not exist");
1090196
+ },
1090197
+ _other: (error) => {
1090198
+ context.failWithoutThrowing("Failed to download API manifest", error);
1090199
+ }
1090200
+ });
1090201
+ return void 0;
1090202
+ }
1090203
+ const parsedYamlVersionOfDependency = response.body.yamlSchemaVersion != null ? parseInt(response.body.yamlSchemaVersion) : void 0;
1090204
+ const parsedCliVersion = parseVersion(cliVersion);
1090205
+ const parsedCliVersionOfDependency = parseVersion(response.body.cliVersion);
1090206
+ if (parsedYamlVersionOfDependency != null) {
1090207
+ if (parsedYamlVersionOfDependency > YAML_SCHEMA_VERSION) {
1090208
+ context.failWithoutThrowing(`${dependency.organization}/${dependency.apiName}@${dependency.version} on a higher version of fern. Upgrade this workspace to ${response.body.cliVersion}`);
1090209
+ return void 0;
1090210
+ } else if (parsedYamlVersionOfDependency < YAML_SCHEMA_VERSION) {
1090211
+ context.failWithoutThrowing(`${dependency.organization}/${dependency.apiName}@${dependency.version} on a lower version of fern. Upgrade it to ${cliVersion}`);
1090212
+ return void 0;
1090213
+ }
1090214
+ } else if (parsedCliVersion.major !== parsedCliVersionOfDependency.major || parsedCliVersion.minor !== parsedCliVersionOfDependency.minor) {
1090215
+ context.failWithoutThrowing(`CLI version is ${response.body.cliVersion}. Expected ${parsedCliVersion.major}.${parsedCliVersion.minor}.x (to match current workspace).`);
1090216
+ return void 0;
1090217
+ }
1090218
+ context.logger.info("Downloading...");
1090219
+ const pathToDependency = AbsoluteFilePath.of((await import_tmp_promise2.default.dir()).path);
1090220
+ context.logger.debug("Remote URL: " + response.body.definitionS3DownloadUrl);
1090221
+ try {
1090222
+ await downloadDependency({
1090223
+ s3PreSignedReadUrl: response.body.definitionS3DownloadUrl,
1090224
+ absolutePathToLocalOutput: pathToDependency
1090225
+ });
1090226
+ } catch (error) {
1090227
+ context.failWithoutThrowing("Failed to download API", error);
1090228
+ return void 0;
1090229
+ }
1090230
+ context.logger.info("Parsing...");
1090231
+ const loadDependencyWorkspaceResult = await loadAPIWorkspace({
1090232
+ absolutePathToWorkspace: pathToDependency,
1090233
+ context,
1090234
+ cliVersion: response.body.cliVersion,
1090235
+ workspaceName: void 0
1090236
+ });
1090237
+ if (!loadDependencyWorkspaceResult.didSucceed) {
1090238
+ context.failWithoutThrowing("Failed to parse dependency after downloading", loadDependencyWorkspaceResult.failures);
1090239
+ return void 0;
1090240
+ }
1090241
+ const workspaceOfDependency = loadDependencyWorkspaceResult.workspace;
1090242
+ if (workspaceOfDependency.type === "oss") {
1090243
+ context.failWithoutThrowing("Dependency must be a fern workspace.");
1090244
+ return void 0;
1090245
+ }
1090246
+ return await loadDependencyWorkspaceResult.workspace.getDefinition({ context });
1090247
+ }
1090248
+ async function downloadDependency({ s3PreSignedReadUrl, absolutePathToLocalOutput }) {
1090249
+ const request = await import_axios3.default.get(s3PreSignedReadUrl, {
1090250
+ responseType: "stream"
1090251
+ });
1090252
+ const tmpDir = await import_tmp_promise2.default.dir();
1090253
+ const outputTarPath = import_path17.default.join(tmpDir.path, "api.tgz");
1090254
+ await (0, import_promises24.pipeline)(request.data, (0, import_fs3.createWriteStream)(outputTarPath));
1090255
+ await import_tar.default.extract({ file: outputTarPath, cwd: absolutePathToLocalOutput });
1090256
+ }
1090257
+ function stringifyDependency(dependency) {
1090258
+ switch (dependency.type) {
1090259
+ case "version":
1090260
+ return `@${dependency.organization}/${dependency.apiName}`;
1090261
+ case "local":
1090262
+ return `${dependency.path}`;
1090263
+ default:
1090264
+ assertNever(dependency);
1090265
+ }
1090266
+ }
1090267
+
1090268
+ // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/processPackageMarkers.js
1090269
+ async function processPackageMarkers({ dependenciesConfiguration, structuralValidationResult, context, cliVersion }) {
1090270
+ const packageMarkers = {};
1090271
+ const importedDefinitions = {};
1090272
+ const failures = {};
1090273
+ await Promise.all(entries(structuralValidationResult.packageMarkers).map(async ([pathOfPackageMarker, packageMarker]) => {
1090274
+ if (packageMarker.contents.export == null) {
1090275
+ packageMarkers[pathOfPackageMarker] = packageMarker;
1090276
+ } else {
1090277
+ const { export: _4, ...otherPackageMarkerKeys } = packageMarker.contents;
1090278
+ if (size_default(otherPackageMarkerKeys) > 0) {
1090279
+ failures[pathOfPackageMarker] = {
1090280
+ type: WorkspaceLoaderFailureType.EXPORTING_PACKAGE_MARKER_OTHER_KEYS,
1090281
+ pathOfPackageMarker
1090282
+ };
1090283
+ } else {
1090284
+ const pathToPackage = dirname(pathOfPackageMarker);
1090285
+ const areDefinitionsDefinedInPackage = keys(structuralValidationResult.namedDefinitionFiles).some((filepath) => filepath !== pathOfPackageMarker && filepath.startsWith(pathToPackage));
1090286
+ if (areDefinitionsDefinedInPackage) {
1090287
+ failures[pathOfPackageMarker] = {
1090288
+ type: WorkspaceLoaderFailureType.EXPORT_PACKAGE_HAS_DEFINITIONS,
1090289
+ pathToPackage
1090290
+ };
1090291
+ } else {
1090292
+ const loadDependencyResult = await loadDependency({
1090293
+ dependencyName: packageMarker.contents.export,
1090294
+ dependenciesConfiguration,
1090295
+ context,
1090296
+ rootApiFile: structuralValidationResult.rootApiFile.contents,
1090297
+ cliVersion
1090298
+ });
1090299
+ if (loadDependencyResult.didSucceed) {
1090300
+ importedDefinitions[dirname(pathOfPackageMarker)] = loadDependencyResult.definition;
1090301
+ } else {
1090302
+ failures[pathOfPackageMarker] = loadDependencyResult.failure;
1090303
+ }
1090304
+ }
1090305
+ }
1090306
+ }
1090307
+ }));
1090308
+ if (size_default(failures) > 0) {
1090309
+ return {
1090310
+ didSucceed: false,
1090311
+ failures
1090312
+ };
1090313
+ } else {
1090314
+ return {
1090315
+ didSucceed: true,
1090316
+ packageMarkers,
1090317
+ importedDefinitions
1090318
+ };
1090319
+ }
1090320
+ }
1090321
+
1090322
+ // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/validateStructureOfYamlFiles.js
1090323
+ var import_path18 = __toESM(require("path"));
1090324
+ function validateStructureOfYamlFiles({ files, absolutePathToDefinition }) {
1090325
+ let rootApiFile = void 0;
1090326
+ const namesDefinitionFiles = {};
1090327
+ const packageMarkers = {};
1090328
+ const failures = {};
1090329
+ for (const [relativeFilepath, file] of entries(files)) {
1090330
+ const parsedFileContents = file.contents;
1090331
+ const addFailure = (error) => {
1090332
+ failures[relativeFilepath] = {
1090333
+ type: WorkspaceLoaderFailureType.STRUCTURE_VALIDATION,
1090334
+ error
1090335
+ };
1090336
+ };
1090337
+ if (relativeFilepath === ROOT_API_FILENAME) {
1090338
+ const maybeValidFileContents = RootApiFileSchema.safeParse(parsedFileContents);
1090339
+ if (maybeValidFileContents.success) {
1090340
+ rootApiFile = {
1090341
+ contents: maybeValidFileContents.data,
1090342
+ rawContents: file.rawContents
1090343
+ };
1090344
+ } else {
1090345
+ addFailure(maybeValidFileContents.error);
1090346
+ }
1090347
+ } else if (import_path18.default.basename(relativeFilepath) === FERN_PACKAGE_MARKER_FILENAME) {
1090348
+ const maybeValidFileContents = PackageMarkerFileSchema.safeParse(parsedFileContents);
1090349
+ if (maybeValidFileContents.success) {
1090350
+ packageMarkers[relativeFilepath] = {
1090351
+ contents: maybeValidFileContents.data,
1090352
+ rawContents: file.rawContents
1090353
+ };
1090354
+ } else {
1090355
+ addFailure(maybeValidFileContents.error);
1090356
+ }
1090357
+ } else {
1090358
+ const maybeValidFileContents = DefinitionFileSchema.safeParse(parsedFileContents);
1090359
+ if (maybeValidFileContents.success) {
1090360
+ namesDefinitionFiles[relativeFilepath] = {
1090361
+ contents: maybeValidFileContents.data,
1090362
+ rawContents: file.rawContents,
1090363
+ absoluteFilepath: join(absolutePathToDefinition, relativeFilepath)
1090364
+ };
1090365
+ } else {
1090366
+ addFailure(maybeValidFileContents.error);
1090367
+ }
1090368
+ }
1090369
+ }
1090370
+ if (rootApiFile == null) {
1090371
+ return {
1090372
+ didSucceed: false,
1090373
+ failures: {
1090374
+ [RelativeFilePath.of(ROOT_API_FILENAME)]: {
1090375
+ type: WorkspaceLoaderFailureType.FILE_MISSING
1090376
+ },
1090377
+ ...failures
1090378
+ }
1090379
+ };
1090380
+ }
1090381
+ if (Object.keys(failures).length > 0) {
1090382
+ return {
1090383
+ didSucceed: false,
1090384
+ failures
1090385
+ };
1090386
+ } else {
1090387
+ return {
1090388
+ didSucceed: true,
1090389
+ namedDefinitionFiles: namesDefinitionFiles,
1090390
+ rootApiFile,
1090391
+ packageMarkers
1090392
+ };
1090393
+ }
1090394
+ }
1090395
+
1090396
+ // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/workspaces/AbstractAPIWorkspace.js
1090397
+ var AbstractAPIWorkspace = class {
1090398
+ };
1090399
+
1090400
+ // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/workspaces/FernWorkspace.js
1090401
+ var FernWorkspace = class extends AbstractAPIWorkspace {
1090402
+ type = "fern";
1090403
+ workspaceName;
1090404
+ absoluteFilepath;
1090405
+ generatorsConfiguration;
1090406
+ dependenciesConfiguration;
1090407
+ definition;
1090408
+ changelog;
1090409
+ constructor({ absoluteFilepath, workspaceName, generatorsConfiguration, dependenciesConfiguration, definition: definition3, changelog }) {
1090410
+ super();
1090411
+ this.absoluteFilepath = absoluteFilepath;
1090412
+ this.workspaceName = workspaceName;
1090413
+ this.changelog = changelog;
1090414
+ this.generatorsConfiguration = generatorsConfiguration;
1090415
+ this.dependenciesConfiguration = dependenciesConfiguration;
1090416
+ this.definition = definition3;
1090417
+ }
1090418
+ async getDefinition() {
1090419
+ return this.definition;
1090420
+ }
1090421
+ async toFernWorkspace() {
1090422
+ return this;
1090423
+ }
1090424
+ };
1090109
1090425
 
1090110
1090426
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/index.js
1090111
1090427
  init_api2();
@@ -1091061,8 +1091377,8 @@ function buildPathParameter({ pathParameter, context, fileContainingReference })
1091061
1091377
  return pathParameterSchema;
1091062
1091378
  }
1091063
1091379
 
1091064
- // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/parse.js
1091065
- var import_promises25 = require("fs/promises");
1091380
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/parse.js
1091381
+ var import_promises26 = require("fs/promises");
1091066
1091382
 
1091067
1091383
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/getExtension.js
1091068
1091384
  function getExtension(object4, extension3) {
@@ -1092714,7 +1093030,7 @@ function getTitleAsName(title2) {
1092714
1093030
  }
1092715
1093031
  function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude = /* @__PURE__ */ new Set(), referencedAsRequest = false) {
1092716
1093032
  var _a5;
1092717
- const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME) ?? (context.shouldUseTitleAsName ? getTitleAsName(schema2.title) : void 0);
1093033
+ const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME) ?? (context.options.useTitlesAsName ? getTitleAsName(schema2.title) : void 0);
1092718
1093034
  const mixedGroupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME) ?? ((_a5 = getExtension(schema2, OpenAPIExtension.TAGS)) == null ? void 0 : _a5[0]);
1092719
1093035
  const groupName = typeof mixedGroupName === "string" ? [mixedGroupName] : mixedGroupName;
1092720
1093036
  const generatedName = getGeneratedTypeName(breadcrumbs);
@@ -1092973,7 +1093289,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
1092973
1093289
  });
1092974
1093290
  }
1092975
1093291
  if (schema2.type === "object" && schema2.discriminator != null && schema2.discriminator.mapping != null) {
1092976
- if (!context.shouldUseUndiscriminatedUnionsWithLiterals) {
1093292
+ if (!context.options.discriminatedUnionV2) {
1092977
1093293
  return convertDiscriminatedOneOf({
1092978
1093294
  nameOverride,
1092979
1093295
  generatedName,
@@ -1093000,7 +1093316,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
1093000
1093316
  }
1093001
1093317
  if (schema2.oneOf != null && schema2.oneOf.length > 0) {
1093002
1093318
  if (schema2.discriminator != null && schema2.discriminator.mapping != null && Object.keys(schema2.discriminator.mapping).length > 0) {
1093003
- if (!context.shouldUseUndiscriminatedUnionsWithLiterals) {
1093319
+ if (!context.options.discriminatedUnionV2) {
1093004
1093320
  return convertDiscriminatedOneOf({
1093005
1093321
  nameOverride,
1093006
1093322
  generatedName,
@@ -1093052,7 +1093368,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
1093052
1093368
  });
1093053
1093369
  }
1093054
1093370
  const maybeDiscriminant = getDiscriminant({ schemas: schema2.oneOf, context });
1093055
- if (maybeDiscriminant != null && !context.shouldUseUndiscriminatedUnionsWithLiterals) {
1093371
+ if (maybeDiscriminant != null && !context.options.discriminatedUnionV2) {
1093056
1093372
  return convertDiscriminatedOneOfWithVariants({
1093057
1093373
  nameOverride,
1093058
1093374
  generatedName,
@@ -1093105,7 +1093421,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
1093105
1093421
  schemas: schema2.anyOf,
1093106
1093422
  context
1093107
1093423
  });
1093108
- if (maybeDiscriminant != null && !context.shouldUseUndiscriminatedUnionsWithLiterals) {
1093424
+ if (maybeDiscriminant != null && !context.options.discriminatedUnionV2) {
1093109
1093425
  return convertDiscriminatedOneOfWithVariants({
1093110
1093426
  nameOverride,
1093111
1093427
  generatedName,
@@ -1093418,15 +1093734,13 @@ var AbstractAsyncAPIV2ParserContext = class {
1093418
1093734
  document;
1093419
1093735
  taskContext;
1093420
1093736
  DUMMY;
1093421
- shouldUseTitleAsName;
1093422
- shouldUseUndiscriminatedUnionsWithLiterals;
1093423
- constructor({ document: document6, taskContext, shouldUseTitleAsName, shouldUseUndiscriminatedUnionsWithLiterals, sdkLanguage }) {
1093737
+ options;
1093738
+ constructor({ document: document6, taskContext, options: options2 }) {
1093424
1093739
  this.document = document6;
1093425
1093740
  this.taskContext = taskContext;
1093426
1093741
  this.logger = taskContext.logger;
1093427
1093742
  this.DUMMY = this;
1093428
- this.shouldUseTitleAsName = shouldUseTitleAsName;
1093429
- this.shouldUseUndiscriminatedUnionsWithLiterals = shouldUseUndiscriminatedUnionsWithLiterals && sdkLanguage === generators_yml_exports.GenerationLanguage.PYTHON;
1093743
+ this.options = options2;
1093430
1093744
  }
1093431
1093745
  resolveSchemaReference(schema2) {
1093432
1093746
  var _a5;
@@ -1093481,13 +1093795,11 @@ var AbstractAsyncAPIV2ParserContext = class {
1093481
1093795
  }
1093482
1093796
  };
1093483
1093797
  var AsyncAPIV2ParserContext = class extends AbstractAsyncAPIV2ParserContext {
1093484
- constructor({ document: document6, taskContext, shouldUseTitleAsName, shouldUseUndiscriminatedUnionsWithLiterals, sdkLanguage }) {
1093798
+ constructor({ document: document6, taskContext, options: options2 }) {
1093485
1093799
  super({
1093486
1093800
  document: document6,
1093487
1093801
  taskContext,
1093488
- shouldUseTitleAsName,
1093489
- shouldUseUndiscriminatedUnionsWithLiterals,
1093490
- sdkLanguage
1093802
+ options: options2
1093491
1093803
  });
1093492
1093804
  }
1093493
1093805
  markSchemaAsReferencedByNonRequest(schemaId) {
@@ -1095021,7 +1095333,7 @@ function getFernExamples(channel) {
1095021
1095333
  }
1095022
1095334
 
1095023
1095335
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/asyncapi/parse.js
1095024
- function parseAsyncAPI({ document: document6, taskContext, sdkLanguage, shouldUseTitleAsName, shouldUseUndiscriminatedUnionsWithLiterals }) {
1095336
+ function parseAsyncAPI({ document: document6, taskContext, options: options2 }) {
1095025
1095337
  var _a5, _b4, _c4, _d2;
1095026
1095338
  const breadcrumbs = [];
1095027
1095339
  if (((_a5 = document6.tags) == null ? void 0 : _a5[0]) != null) {
@@ -1095032,9 +1095344,7 @@ function parseAsyncAPI({ document: document6, taskContext, sdkLanguage, shouldUs
1095032
1095344
  const context = new AsyncAPIV2ParserContext({
1095033
1095345
  document: document6,
1095034
1095346
  taskContext,
1095035
- shouldUseTitleAsName,
1095036
- shouldUseUndiscriminatedUnionsWithLiterals,
1095037
- sdkLanguage
1095347
+ options: options2
1095038
1095348
  });
1095039
1095349
  const schemas = {};
1095040
1095350
  let parsedChannel = void 0;
@@ -1095214,11 +1095524,11 @@ var import_swagger_parser = __toESM(require_lib17());
1095214
1095524
  var import_openapi_core = __toESM(require_lib19());
1095215
1095525
 
1095216
1095526
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/mergeWithOverrides.js
1095217
- var import_promises24 = require("fs/promises");
1095527
+ var import_promises25 = require("fs/promises");
1095218
1095528
  async function mergeWithOverrides({ absoluteFilepathToOverrides, data: data2, context }) {
1095219
1095529
  let parsedOverrides = null;
1095220
1095530
  try {
1095221
- const contents = (await (0, import_promises24.readFile)(absoluteFilepathToOverrides, "utf8")).toString();
1095531
+ const contents = (await (0, import_promises25.readFile)(absoluteFilepathToOverrides, "utf8")).toString();
1095222
1095532
  try {
1095223
1095533
  parsedOverrides = JSON.parse(contents);
1095224
1095534
  } catch (err) {
@@ -1095489,18 +1095799,15 @@ var AbstractOpenAPIV3ParserContext = class {
1095489
1095799
  authHeaders;
1095490
1095800
  refOccurrences;
1095491
1095801
  DUMMY;
1095492
- shouldUseTitleAsName;
1095493
- shouldUseUndiscriminatedUnionsWithLiterals;
1095494
- sdkLanguage;
1095495
- constructor({ document: document6, taskContext, authHeaders, shouldUseTitleAsName, shouldUseUndiscriminatedUnionsWithLiterals, sdkLanguage }) {
1095802
+ options;
1095803
+ constructor({ document: document6, taskContext, authHeaders, options: options2 }) {
1095496
1095804
  this.document = document6;
1095497
1095805
  this.logger = taskContext.logger;
1095498
1095806
  this.taskContext = taskContext;
1095499
1095807
  this.authHeaders = authHeaders;
1095500
1095808
  this.refOccurrences = getReferenceOccurrences(document6);
1095809
+ this.options = options2;
1095501
1095810
  this.DUMMY = this.getDummy();
1095502
- this.shouldUseTitleAsName = shouldUseTitleAsName;
1095503
- this.shouldUseUndiscriminatedUnionsWithLiterals = shouldUseUndiscriminatedUnionsWithLiterals;
1095504
1095811
  }
1095505
1095812
  getNumberOfOccurrencesForRef(schema2) {
1095506
1095813
  return this.refOccurrences[schema2.$ref] ?? 0;
@@ -1095599,14 +1095906,12 @@ var AbstractOpenAPIV3ParserContext = class {
1095599
1095906
 
1095600
1095907
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/DummyOpenAPIV3ParserContext.js
1095601
1095908
  var DummyOpenAPIV3ParserContext = class extends AbstractOpenAPIV3ParserContext {
1095602
- constructor({ document: document6, taskContext }) {
1095909
+ constructor({ document: document6, taskContext, options: options2 }) {
1095603
1095910
  super({
1095604
1095911
  document: document6,
1095605
1095912
  taskContext,
1095606
1095913
  authHeaders: /* @__PURE__ */ new Set(),
1095607
- shouldUseTitleAsName: false,
1095608
- shouldUseUndiscriminatedUnionsWithLiterals: false,
1095609
- sdkLanguage: void 0
1095914
+ options: options2
1095610
1095915
  });
1095611
1095916
  }
1095612
1095917
  getDummy() {
@@ -1096232,7 +1096537,8 @@ function convertHttpOperation({ operationContext, context, responseStatusCode, s
1096232
1096537
  document: document6,
1096233
1096538
  context: new DummyOpenAPIV3ParserContext({
1096234
1096539
  document: context.document,
1096235
- taskContext: context.taskContext
1096540
+ taskContext: context.taskContext,
1096541
+ options: context.options
1096236
1096542
  }),
1096237
1096543
  requestBreadcrumbs
1096238
1096544
  }) : void 0;
@@ -1096949,18 +1097255,20 @@ var OpenAPIV3ParserContext = class extends AbstractOpenAPIV3ParserContext {
1096949
1097255
  discrminatedUnionReferences = {};
1096950
1097256
  discrminatedUnionMetadata = {};
1096951
1097257
  schemasToExclude = /* @__PURE__ */ new Set();
1096952
- constructor({ document: document6, taskContext, authHeaders, shouldUseTitleAsName, shouldUseUndiscriminatedUnionsWithLiterals, sdkLanguage }) {
1097258
+ constructor({ document: document6, taskContext, authHeaders, options: options2 }) {
1096953
1097259
  super({
1096954
1097260
  document: document6,
1096955
1097261
  taskContext,
1096956
1097262
  authHeaders,
1096957
- shouldUseTitleAsName,
1096958
- shouldUseUndiscriminatedUnionsWithLiterals,
1096959
- sdkLanguage
1097263
+ options: options2
1096960
1097264
  });
1096961
1097265
  }
1096962
1097266
  getDummy() {
1096963
- return new DummyOpenAPIV3ParserContext({ document: this.document, taskContext: this.taskContext });
1097267
+ return new DummyOpenAPIV3ParserContext({
1097268
+ document: this.document,
1097269
+ taskContext: this.taskContext,
1097270
+ options: this.options
1097271
+ });
1096964
1097272
  }
1096965
1097273
  markSchemaAsReferencedByNonRequest(schemaId) {
1096966
1097274
  this.nonRequestReferencedSchemas.add(schemaId);
@@ -1097094,7 +1097402,7 @@ function replaceWithSchemaReference({ openapi, replaceReference, schemaReference
1097094
1097402
  }
1097095
1097403
 
1097096
1097404
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/generateIr.js
1097097
- function generateIr({ openApi, taskContext, disableExamples, audiences, shouldUseTitleAsName, shouldUseUndiscriminatedUnionsWithLiterals, sdkLanguage }) {
1097405
+ function generateIr({ openApi, taskContext, options: options2 }) {
1097098
1097406
  var _a5, _b4, _c4;
1097099
1097407
  openApi = runResolutions({ openapi: openApi });
1097100
1097408
  const securitySchemes = Object.fromEntries(Object.entries(((_a5 = openApi.components) == null ? void 0 : _a5.securitySchemes) ?? {}).map(([key2, securityScheme]) => {
@@ -1097116,13 +1097424,12 @@ function generateIr({ openApi, taskContext, disableExamples, audiences, shouldUs
1097116
1097424
  document: openApi,
1097117
1097425
  taskContext,
1097118
1097426
  authHeaders,
1097119
- shouldUseTitleAsName,
1097120
- shouldUseUndiscriminatedUnionsWithLiterals,
1097121
- sdkLanguage
1097427
+ options: options2
1097122
1097428
  });
1097123
1097429
  const variables = getVariableDefinitions(openApi);
1097124
1097430
  const globalHeaders = getGlobalHeaders(openApi);
1097125
1097431
  const idempotencyHeaders = getIdempotencyHeaders(openApi);
1097432
+ const audiences = options2.audiences ?? [];
1097126
1097433
  const endpointsWithExample = [];
1097127
1097434
  const webhooks = [];
1097128
1097435
  Object.entries(openApi.paths ?? {}).forEach(([path42, pathItem]) => {
@@ -1097207,7 +1097514,7 @@ function generateIr({ openApi, taskContext, disableExamples, audiences, shouldUs
1097207
1097514
  const endpoints = endpointsWithExample.map((endpointWithExample) => {
1097208
1097515
  const extensionExamples = endpointWithExample.examples;
1097209
1097516
  let examples = extensionExamples;
1097210
- if (!disableExamples && (extensionExamples.length === 0 || extensionExamples.every(hasIncompleteExample))) {
1097517
+ if (!options2.disableExamples && (extensionExamples.length === 0 || extensionExamples.every(hasIncompleteExample))) {
1097211
1097518
  const endpointExample = exampleEndpointFactory.buildEndpointExample(endpointWithExample);
1097212
1097519
  if (endpointExample.length > 0) {
1097213
1097520
  examples = [
@@ -1097426,22 +1097733,25 @@ function getAudiences({ operation }) {
1097426
1097733
  }
1097427
1097734
 
1097428
1097735
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v2/generateIr.js
1097429
- async function generateIr2({ openApi, taskContext, disableExamples, audiences, shouldUseTitleAsName, shouldUseUndiscriminatedUnionsWithLiterals, sdkLanguage }) {
1097736
+ async function generateIr2({ openApi, taskContext, options: options2 }) {
1097430
1097737
  const conversionResult = await (0, import_swagger2openapi.convertObj)(openApi, {});
1097431
1097738
  return generateIr({
1097432
1097739
  openApi: conversionResult.openapi,
1097433
1097740
  taskContext,
1097434
- disableExamples,
1097435
- audiences,
1097436
- shouldUseTitleAsName,
1097437
- shouldUseUndiscriminatedUnionsWithLiterals,
1097438
- sdkLanguage
1097741
+ options: options2
1097439
1097742
  });
1097440
1097743
  }
1097441
1097744
 
1097442
- // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/parse.js
1097443
- async function parse3({ workspace, taskContext, sdkLanguage }) {
1097444
- var _a5, _b4, _c4, _d2, _e, _f, _g, _h;
1097745
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/options.js
1097746
+ var DEFAULT_PARSE_OPENAPI_SETTINGS = {
1097747
+ disableExamples: false,
1097748
+ discriminatedUnionV2: false,
1097749
+ useTitlesAsName: true,
1097750
+ audiences: void 0
1097751
+ };
1097752
+
1097753
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/parse.js
1097754
+ async function parse3({ specs, taskContext, optionOverrides }) {
1097445
1097755
  let ir = {
1097446
1097756
  title: void 0,
1097447
1097757
  description: void 0,
@@ -1097463,8 +1097773,8 @@ async function parse3({ workspace, taskContext, sdkLanguage }) {
1097463
1097773
  idempotencyHeaders: [],
1097464
1097774
  groups: {}
1097465
1097775
  };
1097466
- for (const spec of workspace.specs) {
1097467
- const contents = (await (0, import_promises25.readFile)(spec.absoluteFilepath)).toString();
1097776
+ for (const spec of specs) {
1097777
+ const contents = (await (0, import_promises26.readFile)(spec.absoluteFilepath)).toString();
1097468
1097778
  if (contents.includes("openapi") || contents.includes("swagger")) {
1097469
1097779
  const openApiDocument = await loadOpenAPI({
1097470
1097780
  absolutePathToOpenAPI: spec.absoluteFilepath,
@@ -1097475,22 +1097785,14 @@ async function parse3({ workspace, taskContext, sdkLanguage }) {
1097475
1097785
  const openapiIr = generateIr({
1097476
1097786
  openApi: openApiDocument,
1097477
1097787
  taskContext,
1097478
- disableExamples: false,
1097479
- audiences: ((_a5 = spec.settings) == null ? void 0 : _a5.audiences) ?? [],
1097480
- shouldUseTitleAsName: ((_b4 = spec.settings) == null ? void 0 : _b4.shouldUseTitleAsName) ?? true,
1097481
- shouldUseUndiscriminatedUnionsWithLiterals: ((_c4 = spec.settings) == null ? void 0 : _c4.shouldUseUndiscriminatedUnionsWithLiterals) ?? false,
1097482
- sdkLanguage
1097788
+ options: getParseOptions({ specSettings: spec.settings, overrides: optionOverrides })
1097483
1097789
  });
1097484
1097790
  ir = merge3(ir, openapiIr);
1097485
1097791
  } else if (isOpenApiV2(openApiDocument)) {
1097486
1097792
  const openapiIr = await generateIr2({
1097487
1097793
  openApi: openApiDocument,
1097488
1097794
  taskContext,
1097489
- disableExamples: false,
1097490
- audiences: ((_d2 = spec.settings) == null ? void 0 : _d2.audiences) ?? [],
1097491
- shouldUseTitleAsName: ((_e = spec.settings) == null ? void 0 : _e.shouldUseTitleAsName) ?? true,
1097492
- shouldUseUndiscriminatedUnionsWithLiterals: ((_f = spec.settings) == null ? void 0 : _f.shouldUseUndiscriminatedUnionsWithLiterals) ?? false,
1097493
- sdkLanguage
1097795
+ options: getParseOptions({ specSettings: spec.settings })
1097494
1097796
  });
1097495
1097797
  ir = merge3(ir, openapiIr);
1097496
1097798
  }
@@ -1097503,9 +1097805,7 @@ async function parse3({ workspace, taskContext, sdkLanguage }) {
1097503
1097805
  const parsedAsyncAPI = parseAsyncAPI({
1097504
1097806
  document: asyncAPI,
1097505
1097807
  taskContext,
1097506
- shouldUseTitleAsName: ((_g = spec.settings) == null ? void 0 : _g.shouldUseTitleAsName) ?? true,
1097507
- shouldUseUndiscriminatedUnionsWithLiterals: ((_h = spec.settings) == null ? void 0 : _h.shouldUseUndiscriminatedUnionsWithLiterals) ?? false,
1097508
- sdkLanguage
1097808
+ options: getParseOptions({ specSettings: spec.settings })
1097509
1097809
  });
1097510
1097810
  if (parsedAsyncAPI.channel != null) {
1097511
1097811
  ir.channel.push(parsedAsyncAPI.channel);
@@ -1097522,6 +1097822,14 @@ async function parse3({ workspace, taskContext, sdkLanguage }) {
1097522
1097822
  }
1097523
1097823
  return ir;
1097524
1097824
  }
1097825
+ function getParseOptions({ specSettings, overrides }) {
1097826
+ return {
1097827
+ disableExamples: (overrides == null ? void 0 : overrides.disableExamples) ?? DEFAULT_PARSE_OPENAPI_SETTINGS.disableExamples,
1097828
+ discriminatedUnionV2: (overrides == null ? void 0 : overrides.discriminatedUnionV2) ?? (specSettings == null ? void 0 : specSettings.shouldUseUndiscriminatedUnionsWithLiterals) ?? DEFAULT_PARSE_OPENAPI_SETTINGS.discriminatedUnionV2,
1097829
+ useTitlesAsName: (overrides == null ? void 0 : overrides.useTitlesAsName) ?? (specSettings == null ? void 0 : specSettings.shouldUseTitleAsName) ?? DEFAULT_PARSE_OPENAPI_SETTINGS.useTitlesAsName,
1097830
+ audiences: (overrides == null ? void 0 : overrides.audiences) ?? (specSettings == null ? void 0 : specSettings.audiences) ?? DEFAULT_PARSE_OPENAPI_SETTINGS.audiences
1097831
+ };
1097832
+ }
1097525
1097833
  function merge3(ir1, ir2) {
1097526
1097834
  return {
1097527
1097835
  title: ir1.title ?? ir2.title,
@@ -1097561,7 +1097869,7 @@ function merge3(ir1, ir2) {
1097561
1097869
  };
1097562
1097870
  }
1097563
1097871
  async function loadAsyncAPI({ absoluteFilePathToAsyncAPI, absoluteFilePathToAsyncAPIOverrides, context }) {
1097564
- const contents = (await (0, import_promises25.readFile)(absoluteFilePathToAsyncAPI)).toString();
1097872
+ const contents = (await (0, import_promises26.readFile)(absoluteFilePathToAsyncAPI)).toString();
1097565
1097873
  const parsed = await js_yaml_default.load(contents);
1097566
1097874
  if (absoluteFilePathToAsyncAPIOverrides != null) {
1097567
1097875
  return await mergeWithOverrides({
@@ -1099191,7 +1099499,7 @@ function buildFernDefinition(context) {
1099191
1099499
  }
1099192
1099500
 
1099193
1099501
  // pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/FernDefnitionBuilder.js
1099194
- var import_path17 = __toESM(require("path"));
1099502
+ var import_path19 = __toESM(require("path"));
1099195
1099503
  var FernDefinitionBuilderImpl = class {
1099196
1099504
  modifyBasePaths;
1099197
1099505
  enableUniqueErrorsPerEndpoint;
@@ -1099293,7 +1099601,7 @@ var FernDefinitionBuilderImpl = class {
1099293
1099601
  if (file === fileToImport) {
1099294
1099602
  return void 0;
1099295
1099603
  }
1099296
- const importPrefix = camelCase_default((0, import_path17.basename)(fileToImport, (0, import_path17.extname)(fileToImport)).replaceAll("__package__", "root"));
1099604
+ const importPrefix = camelCase_default((0, import_path19.basename)(fileToImport, (0, import_path19.extname)(fileToImport)).replaceAll("__package__", "root"));
1099297
1099605
  if (file === RelativeFilePath.of(ROOT_API_FILENAME)) {
1099298
1099606
  if (this.rootApiFile.imports == null) {
1099299
1099607
  this.rootApiFile.imports = {};
@@ -1099490,7 +1099798,7 @@ var FernDefinitionBuilderImpl = class {
1099490
1099798
  id,
1099491
1099799
  {
1099492
1099800
  ...endpoint,
1099493
- path: import_path17.default.join(basePath, endpoint.path)
1099801
+ path: import_path19.default.join(basePath, endpoint.path)
1099494
1099802
  }
1099495
1099803
  ];
1099496
1099804
  }))
@@ -1099505,7 +1099813,7 @@ var FernDefinitionBuilderImpl = class {
1099505
1099813
  id,
1099506
1099814
  {
1099507
1099815
  ...endpoint,
1099508
- path: import_path17.default.join(basePath, endpoint.path)
1099816
+ path: import_path19.default.join(basePath, endpoint.path)
1099509
1099817
  }
1099510
1099818
  ];
1099511
1099819
  }))
@@ -1099607,28 +1099915,34 @@ function convert3(opts) {
1099607
1099915
  return buildFernDefinition(context);
1099608
1099916
  }
1099609
1099917
 
1099610
- // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/utils/convertOpenApiWorkspaceToFernWorkspace.js
1099611
- async function convertToFernWorkspace(openapiWorkspace, context, enableUniqueErrorsPerEndpoint = false, sdkLanguage) {
1099612
- const openApiIr = await parse3({
1099613
- workspace: openapiWorkspace,
1099614
- taskContext: context,
1099615
- sdkLanguage
1099616
- });
1099617
- const definition3 = convert3({
1099618
- taskContext: context,
1099619
- ir: openApiIr,
1099620
- enableUniqueErrorsPerEndpoint
1099621
- });
1099622
- return {
1099623
- type: "fern",
1099624
- name: openapiWorkspace.name,
1099625
- generatorsConfiguration: openapiWorkspace.generatorsConfiguration,
1099626
- absoluteFilepath: openapiWorkspace.absoluteFilepath,
1099627
- dependenciesConfiguration: {
1099628
- dependencies: {}
1099629
- },
1099630
- workspaceName: openapiWorkspace.workspaceName,
1099631
- definition: {
1099918
+ // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/workspaces/OSSWorkspace.js
1099919
+ var OSSWorkspace = class extends AbstractAPIWorkspace {
1099920
+ type = "oss";
1099921
+ absoluteFilepath;
1099922
+ workspaceName;
1099923
+ specs;
1099924
+ changelog;
1099925
+ generatorsConfiguration;
1099926
+ constructor({ absoluteFilepath, workspaceName, specs, changelog, generatorsConfiguration }) {
1099927
+ super();
1099928
+ this.absoluteFilepath = absoluteFilepath;
1099929
+ this.workspaceName = workspaceName;
1099930
+ this.specs = specs;
1099931
+ this.changelog = changelog;
1099932
+ this.generatorsConfiguration = generatorsConfiguration;
1099933
+ }
1099934
+ async getDefinition({ context }, settings) {
1099935
+ const openApiIr = await parse3({
1099936
+ specs: this.specs,
1099937
+ taskContext: context,
1099938
+ optionOverrides: getOptionsOverridesFromSettings(settings)
1099939
+ });
1099940
+ const definition3 = convert3({
1099941
+ taskContext: context,
1099942
+ ir: openApiIr,
1099943
+ enableUniqueErrorsPerEndpoint: (settings == null ? void 0 : settings.enableUniqueErrorsPerEndpoint) ?? false
1099944
+ });
1099945
+ return {
1099632
1099946
  absoluteFilepath: AbsoluteFilePath.of("/DUMMY_PATH"),
1099633
1099947
  rootApiFile: {
1099634
1099948
  contents: definition3.rootApiFile,
@@ -1099648,291 +1099962,48 @@ async function convertToFernWorkspace(openapiWorkspace, context, enableUniqueErr
1099648
1099962
  },
1099649
1099963
  packageMarkers: {},
1099650
1099964
  importedDefinitions: {}
1099651
- },
1099652
- changelog: openapiWorkspace.changelog
1099653
- };
1099654
- }
1099655
- function mapValues2(items, mapper) {
1099656
- return mapValues_default2(items, mapper);
1099657
- }
1099658
-
1099659
- // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/loadDependency.js
1099660
- var FIDDLE = createFiddleService();
1099661
- async function loadDependency({ dependencyName, dependenciesConfiguration, context, rootApiFile, cliVersion, sdkLanguage }) {
1099662
- let definition3;
1099663
- let failure = {
1099664
- type: WorkspaceLoaderFailureType.FAILED_TO_LOAD_DEPENDENCY,
1099665
- dependencyName
1099666
- };
1099667
- const dependency = dependenciesConfiguration.dependencies[dependencyName];
1099668
- if (dependency == null) {
1099669
- failure = {
1099670
- type: WorkspaceLoaderFailureType.DEPENDENCY_NOT_LISTED,
1099671
- dependencyName
1099672
1099965
  };
1099673
- } else {
1099674
- await context.runInteractiveTask({ name: `Download ${stringifyDependency(dependency)}` }, async (contextForDependency) => {
1099675
- switch (dependency.type) {
1099676
- case "version":
1099677
- definition3 = await validateVersionedDependencyAndGetDefinition({
1099678
- context: contextForDependency,
1099679
- dependency,
1099680
- cliVersion,
1099681
- sdkLanguage
1099682
- });
1099683
- return;
1099684
- case "local":
1099685
- definition3 = await validateLocalDependencyAndGetDefinition({
1099686
- context: contextForDependency,
1099687
- dependency,
1099688
- cliVersion,
1099689
- sdkLanguage
1099690
- });
1099691
- return;
1099692
- default:
1099693
- assertNever(dependency);
1099694
- }
1099695
- });
1099696
- }
1099697
- if (definition3 != null) {
1099698
- return { didSucceed: true, definition: definition3 };
1099699
- } else {
1099700
- return { didSucceed: false, failure };
1099701
- }
1099702
- }
1099703
- async function validateLocalDependencyAndGetDefinition({ dependency, context, cliVersion, sdkLanguage }) {
1099704
- context.logger.info("Parsing...");
1099705
- const loadDependencyWorkspaceResult = await loadAPIWorkspace({
1099706
- absolutePathToWorkspace: dependency.absoluteFilepath,
1099707
- context,
1099708
- cliVersion,
1099709
- workspaceName: void 0,
1099710
- sdkLanguage
1099711
- });
1099712
- if (!loadDependencyWorkspaceResult.didSucceed) {
1099713
- context.failWithoutThrowing("Failed to load api definition", loadDependencyWorkspaceResult.failures);
1099714
- return void 0;
1099715
1099966
  }
1099716
- const workspaceOfDependency = loadDependencyWorkspaceResult.workspace.type === "fern" ? loadDependencyWorkspaceResult.workspace : await convertToFernWorkspace(loadDependencyWorkspaceResult.workspace, context, false, sdkLanguage);
1099717
- return workspaceOfDependency.definition;
1099718
- }
1099719
- async function validateVersionedDependencyAndGetDefinition({ dependency, context, cliVersion, sdkLanguage }) {
1099720
- context.logger.info("Downloading manifest...");
1099721
- const response = await FIDDLE.definitionRegistry.get(import_fiddle_sdk3.FernFiddle.OrganizationId(dependency.organization), import_fiddle_sdk3.FernFiddle.ApiId(dependency.apiName), dependency.version);
1099722
- if (!response.ok) {
1099723
- response.error._visit({
1099724
- orgDoesNotExistError: () => {
1099725
- context.failWithoutThrowing("Organization does not exist");
1099726
- },
1099727
- apiDoesNotExistError: () => {
1099728
- context.failWithoutThrowing("API does not exist");
1099967
+ async toFernWorkspace({ context }, settings) {
1099968
+ const definition3 = await this.getDefinition({ context }, settings);
1099969
+ return new FernWorkspace({
1099970
+ absoluteFilepath: this.absoluteFilepath,
1099971
+ workspaceName: this.workspaceName,
1099972
+ generatorsConfiguration: this.generatorsConfiguration,
1099973
+ dependenciesConfiguration: {
1099974
+ dependencies: {}
1099729
1099975
  },
1099730
- versionDoesNotExistError: () => {
1099731
- context.failWithoutThrowing("Version does not exist");
1099732
- },
1099733
- _other: (error) => {
1099734
- context.failWithoutThrowing("Failed to download API manifest", error);
1099735
- }
1099736
- });
1099737
- return void 0;
1099738
- }
1099739
- const parsedYamlVersionOfDependency = response.body.yamlSchemaVersion != null ? parseInt(response.body.yamlSchemaVersion) : void 0;
1099740
- const parsedCliVersion = parseVersion(cliVersion);
1099741
- const parsedCliVersionOfDependency = parseVersion(response.body.cliVersion);
1099742
- if (parsedYamlVersionOfDependency != null) {
1099743
- if (parsedYamlVersionOfDependency > YAML_SCHEMA_VERSION) {
1099744
- context.failWithoutThrowing(`${dependency.organization}/${dependency.apiName}@${dependency.version} on a higher version of fern. Upgrade this workspace to ${response.body.cliVersion}`);
1099745
- return void 0;
1099746
- } else if (parsedYamlVersionOfDependency < YAML_SCHEMA_VERSION) {
1099747
- context.failWithoutThrowing(`${dependency.organization}/${dependency.apiName}@${dependency.version} on a lower version of fern. Upgrade it to ${cliVersion}`);
1099748
- return void 0;
1099749
- }
1099750
- } else if (parsedCliVersion.major !== parsedCliVersionOfDependency.major || parsedCliVersion.minor !== parsedCliVersionOfDependency.minor) {
1099751
- context.failWithoutThrowing(`CLI version is ${response.body.cliVersion}. Expected ${parsedCliVersion.major}.${parsedCliVersion.minor}.x (to match current workspace).`);
1099752
- return void 0;
1099753
- }
1099754
- context.logger.info("Downloading...");
1099755
- const pathToDependency = AbsoluteFilePath.of((await import_tmp_promise2.default.dir()).path);
1099756
- context.logger.debug("Remote URL: " + response.body.definitionS3DownloadUrl);
1099757
- try {
1099758
- await downloadDependency({
1099759
- s3PreSignedReadUrl: response.body.definitionS3DownloadUrl,
1099760
- absolutePathToLocalOutput: pathToDependency
1099976
+ definition: definition3,
1099977
+ changelog: this.changelog
1099761
1099978
  });
1099762
- } catch (error) {
1099763
- context.failWithoutThrowing("Failed to download API", error);
1099764
- return void 0;
1099765
1099979
  }
1099766
- context.logger.info("Parsing...");
1099767
- const loadDependencyWorkspaceResult = await loadAPIWorkspace({
1099768
- absolutePathToWorkspace: pathToDependency,
1099769
- context,
1099770
- cliVersion: response.body.cliVersion,
1099771
- workspaceName: void 0,
1099772
- sdkLanguage
1099773
- });
1099774
- if (!loadDependencyWorkspaceResult.didSucceed) {
1099775
- context.failWithoutThrowing("Failed to parse dependency after downloading", loadDependencyWorkspaceResult.failures);
1099980
+ };
1099981
+ function getOSSWorkspaceSettingsFromGeneratorInvocation(generatorInvocation) {
1099982
+ if (generatorInvocation.settings == null) {
1099776
1099983
  return void 0;
1099777
1099984
  }
1099778
- const workspaceOfDependency = loadDependencyWorkspaceResult.workspace;
1099779
- if (workspaceOfDependency.type === "oss") {
1099780
- context.failWithoutThrowing("Dependency must be a fern workspace.");
1099781
- return void 0;
1099985
+ const result2 = {};
1099986
+ if (generatorInvocation.settings.unions === "v1") {
1099987
+ result2.enableDiscriminatedUnionV2 = true;
1099782
1099988
  }
1099783
- return workspaceOfDependency.definition;
1099784
- }
1099785
- async function downloadDependency({ s3PreSignedReadUrl, absolutePathToLocalOutput }) {
1099786
- const request = await import_axios3.default.get(s3PreSignedReadUrl, {
1099787
- responseType: "stream"
1099788
- });
1099789
- const tmpDir = await import_tmp_promise2.default.dir();
1099790
- const outputTarPath = import_path18.default.join(tmpDir.path, "api.tgz");
1099791
- await (0, import_promises26.pipeline)(request.data, (0, import_fs3.createWriteStream)(outputTarPath));
1099792
- await import_tar.default.extract({ file: outputTarPath, cwd: absolutePathToLocalOutput });
1099989
+ return result2;
1099793
1099990
  }
1099794
- function stringifyDependency(dependency) {
1099795
- switch (dependency.type) {
1099796
- case "version":
1099797
- return `@${dependency.organization}/${dependency.apiName}`;
1099798
- case "local":
1099799
- return `${dependency.path}`;
1099800
- default:
1099801
- assertNever(dependency);
1099991
+ function getOptionsOverridesFromSettings(settings) {
1099992
+ if (settings == null) {
1099993
+ return void 0;
1099802
1099994
  }
1099803
- }
1099804
-
1099805
- // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/processPackageMarkers.js
1099806
- async function processPackageMarkers({ dependenciesConfiguration, structuralValidationResult, context, cliVersion, sdkLanguage }) {
1099807
- const packageMarkers = {};
1099808
- const importedDefinitions = {};
1099809
- const failures = {};
1099810
- await Promise.all(entries(structuralValidationResult.packageMarkers).map(async ([pathOfPackageMarker, packageMarker]) => {
1099811
- if (packageMarker.contents.export == null) {
1099812
- packageMarkers[pathOfPackageMarker] = packageMarker;
1099813
- } else {
1099814
- const { export: _4, ...otherPackageMarkerKeys } = packageMarker.contents;
1099815
- if (size_default(otherPackageMarkerKeys) > 0) {
1099816
- failures[pathOfPackageMarker] = {
1099817
- type: WorkspaceLoaderFailureType.EXPORTING_PACKAGE_MARKER_OTHER_KEYS,
1099818
- pathOfPackageMarker
1099819
- };
1099820
- } else {
1099821
- const pathToPackage = dirname(pathOfPackageMarker);
1099822
- const areDefinitionsDefinedInPackage = keys(structuralValidationResult.namedDefinitionFiles).some((filepath) => filepath !== pathOfPackageMarker && filepath.startsWith(pathToPackage));
1099823
- if (areDefinitionsDefinedInPackage) {
1099824
- failures[pathOfPackageMarker] = {
1099825
- type: WorkspaceLoaderFailureType.EXPORT_PACKAGE_HAS_DEFINITIONS,
1099826
- pathToPackage
1099827
- };
1099828
- } else {
1099829
- const loadDependencyResult = await loadDependency({
1099830
- dependencyName: packageMarker.contents.export,
1099831
- dependenciesConfiguration,
1099832
- context,
1099833
- rootApiFile: structuralValidationResult.rootApiFile.contents,
1099834
- cliVersion,
1099835
- sdkLanguage
1099836
- });
1099837
- if (loadDependencyResult.didSucceed) {
1099838
- importedDefinitions[dirname(pathOfPackageMarker)] = loadDependencyResult.definition;
1099839
- } else {
1099840
- failures[pathOfPackageMarker] = loadDependencyResult.failure;
1099841
- }
1099842
- }
1099843
- }
1099844
- }
1099845
- }));
1099846
- if (size_default(failures) > 0) {
1099847
- return {
1099848
- didSucceed: false,
1099849
- failures
1099850
- };
1099851
- } else {
1099852
- return {
1099853
- didSucceed: true,
1099854
- packageMarkers,
1099855
- importedDefinitions
1099856
- };
1099995
+ const result2 = {};
1099996
+ if (settings.enableDiscriminatedUnionV2) {
1099997
+ result2.discriminatedUnionV2 = true;
1099857
1099998
  }
1099999
+ return result2;
1099858
1100000
  }
1099859
-
1099860
- // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/validateStructureOfYamlFiles.js
1099861
- var import_path19 = __toESM(require("path"));
1099862
- function validateStructureOfYamlFiles({ files, absolutePathToDefinition }) {
1099863
- let rootApiFile = void 0;
1099864
- const namesDefinitionFiles = {};
1099865
- const packageMarkers = {};
1099866
- const failures = {};
1099867
- for (const [relativeFilepath, file] of entries(files)) {
1099868
- const parsedFileContents = file.contents;
1099869
- const addFailure = (error) => {
1099870
- failures[relativeFilepath] = {
1099871
- type: WorkspaceLoaderFailureType.STRUCTURE_VALIDATION,
1099872
- error
1099873
- };
1099874
- };
1099875
- if (relativeFilepath === ROOT_API_FILENAME) {
1099876
- const maybeValidFileContents = RootApiFileSchema.safeParse(parsedFileContents);
1099877
- if (maybeValidFileContents.success) {
1099878
- rootApiFile = {
1099879
- contents: maybeValidFileContents.data,
1099880
- rawContents: file.rawContents
1099881
- };
1099882
- } else {
1099883
- addFailure(maybeValidFileContents.error);
1099884
- }
1099885
- } else if (import_path19.default.basename(relativeFilepath) === FERN_PACKAGE_MARKER_FILENAME) {
1099886
- const maybeValidFileContents = PackageMarkerFileSchema.safeParse(parsedFileContents);
1099887
- if (maybeValidFileContents.success) {
1099888
- packageMarkers[relativeFilepath] = {
1099889
- contents: maybeValidFileContents.data,
1099890
- rawContents: file.rawContents
1099891
- };
1099892
- } else {
1099893
- addFailure(maybeValidFileContents.error);
1099894
- }
1099895
- } else {
1099896
- const maybeValidFileContents = DefinitionFileSchema.safeParse(parsedFileContents);
1099897
- if (maybeValidFileContents.success) {
1099898
- namesDefinitionFiles[relativeFilepath] = {
1099899
- contents: maybeValidFileContents.data,
1099900
- rawContents: file.rawContents,
1099901
- absoluteFilepath: join(absolutePathToDefinition, relativeFilepath)
1099902
- };
1099903
- } else {
1099904
- addFailure(maybeValidFileContents.error);
1099905
- }
1099906
- }
1099907
- }
1099908
- if (rootApiFile == null) {
1099909
- return {
1099910
- didSucceed: false,
1099911
- failures: {
1099912
- [RelativeFilePath.of(ROOT_API_FILENAME)]: {
1099913
- type: WorkspaceLoaderFailureType.FILE_MISSING
1099914
- },
1099915
- ...failures
1099916
- }
1099917
- };
1099918
- }
1099919
- if (Object.keys(failures).length > 0) {
1099920
- return {
1099921
- didSucceed: false,
1099922
- failures
1099923
- };
1099924
- } else {
1099925
- return {
1099926
- didSucceed: true,
1099927
- namedDefinitionFiles: namesDefinitionFiles,
1099928
- rootApiFile,
1099929
- packageMarkers
1099930
- };
1099931
- }
1100001
+ function mapValues2(items, mapper) {
1100002
+ return mapValues_default2(items, mapper);
1099932
1100003
  }
1099933
1100004
 
1099934
1100005
  // pnp:/home/circleci/project/packages/cli/workspace-loader/lib/loadAPIWorkspace.js
1099935
- async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion, workspaceName, sdkLanguage }) {
1100006
+ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion, workspaceName }) {
1099936
1100007
  var _a5, _b4;
1099937
1100008
  const generatorsConfiguration = await generators_yml_exports.loadGeneratorsConfiguration({
1099938
1100009
  absolutePathToWorkspace,
@@ -1099984,15 +1100055,13 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
1099984
1100055
  }
1099985
1100056
  return {
1099986
1100057
  didSucceed: true,
1099987
- workspace: {
1099988
- type: "oss",
1099989
- name: "api",
1100058
+ workspace: new OSSWorkspace({
1099990
1100059
  specs,
1099991
1100060
  workspaceName,
1099992
1100061
  absoluteFilepath: absolutePathToWorkspace,
1099993
1100062
  generatorsConfiguration,
1099994
1100063
  changelog
1099995
- }
1100064
+ })
1099996
1100065
  };
1099997
1100066
  }
1099998
1100067
  if (openApiDirectoryExists) {
@@ -1100023,15 +1100092,13 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
1100023
1100092
  }
1100024
1100093
  return {
1100025
1100094
  didSucceed: true,
1100026
- workspace: {
1100027
- type: "oss",
1100028
- name: "api",
1100095
+ workspace: new OSSWorkspace({
1100029
1100096
  specs,
1100030
1100097
  workspaceName,
1100031
1100098
  absoluteFilepath: absolutePathToWorkspace,
1100032
1100099
  generatorsConfiguration,
1100033
1100100
  changelog
1100034
- }
1100101
+ })
1100035
1100102
  };
1100036
1100103
  }
1100037
1100104
  const absolutePathToDefinition = join(absolutePathToWorkspace, RelativeFilePath.of(DEFINITION_DIRECTORY));
@@ -1100055,15 +1100122,12 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
1100055
1100122
  dependenciesConfiguration,
1100056
1100123
  structuralValidationResult,
1100057
1100124
  context,
1100058
- cliVersion,
1100059
- sdkLanguage
1100125
+ cliVersion
1100060
1100126
  });
1100061
1100127
  if (!processPackageMarkersResult.didSucceed) {
1100062
1100128
  return processPackageMarkersResult;
1100063
1100129
  }
1100064
- const fernWorkspace = {
1100065
- type: "fern",
1100066
- name: structuralValidationResult.rootApiFile.contents.name,
1100130
+ const fernWorkspace = new FernWorkspace({
1100067
1100131
  absoluteFilepath: absolutePathToWorkspace,
1100068
1100132
  generatorsConfiguration,
1100069
1100133
  dependenciesConfiguration,
@@ -1100076,7 +1100140,7 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
1100076
1100140
  importedDefinitions: processPackageMarkersResult.importedDefinitions
1100077
1100141
  },
1100078
1100142
  changelog
1100079
- };
1100143
+ });
1100080
1100144
  return {
1100081
1100145
  didSucceed: true,
1100082
1100146
  workspace: fernWorkspace
@@ -1100289,7 +1100353,7 @@ function parseIssue(issue) {
1100289
1100353
  }
1100290
1100354
 
1100291
1100355
  // pnp:/home/circleci/project/packages/cli/project-loader/lib/loadProject.js
1100292
- async function loadProject({ cliName, cliVersion, commandLineApiWorkspace, defaultToAllApiWorkspaces, context, nameOverride, sdkLanguage }) {
1100356
+ async function loadProject({ cliName, cliVersion, commandLineApiWorkspace, defaultToAllApiWorkspaces, context, nameOverride }) {
1100293
1100357
  const fernDirectory = await getFernDirectory(nameOverride);
1100294
1100358
  if (fernDirectory == null) {
1100295
1100359
  return context.failAndThrow(`Directory "${nameOverride ?? FERN_DIRECTORY}" not found.`);
@@ -1100300,8 +1100364,7 @@ async function loadProject({ cliName, cliVersion, commandLineApiWorkspace, defau
1100300
1100364
  cliVersion,
1100301
1100365
  context,
1100302
1100366
  commandLineApiWorkspace,
1100303
- defaultToAllApiWorkspaces,
1100304
- sdkLanguage
1100367
+ defaultToAllApiWorkspaces
1100305
1100368
  });
1100306
1100369
  return {
1100307
1100370
  config: await fern_config_json_exports.loadProjectConfig({ directory: fernDirectory, context }),
@@ -1100309,7 +1100372,7 @@ async function loadProject({ cliName, cliVersion, commandLineApiWorkspace, defau
1100309
1100372
  docsWorkspaces: await loadDocsWorkspace({ fernDirectory, context })
1100310
1100373
  };
1100311
1100374
  }
1100312
- async function loadApis({ cliName, fernDirectory, context, cliVersion, commandLineApiWorkspace, defaultToAllApiWorkspaces, sdkLanguage }) {
1100375
+ async function loadApis({ cliName, fernDirectory, context, cliVersion, commandLineApiWorkspace, defaultToAllApiWorkspaces }) {
1100313
1100376
  const apisDirectory = join(fernDirectory, RelativeFilePath.of(APIS_DIRECTORY));
1100314
1100377
  const apisDirectoryExists = await doesPathExist(apisDirectory);
1100315
1100378
  if (apisDirectoryExists) {
@@ -1100344,8 +1100407,7 @@ async function loadApis({ cliName, fernDirectory, context, cliVersion, commandLi
1100344
1100407
  absolutePathToWorkspace: join(apisDirectory, RelativeFilePath.of(workspaceDirectoryName)),
1100345
1100408
  context,
1100346
1100409
  cliVersion,
1100347
- workspaceName: workspaceDirectoryName,
1100348
- sdkLanguage
1100410
+ workspaceName: workspaceDirectoryName
1100349
1100411
  });
1100350
1100412
  if (workspace2.didSucceed) {
1100351
1100413
  apiWorkspaces.push(workspace2.workspace);
@@ -1100360,8 +1100422,7 @@ async function loadApis({ cliName, fernDirectory, context, cliVersion, commandLi
1100360
1100422
  absolutePathToWorkspace: fernDirectory,
1100361
1100423
  context,
1100362
1100424
  cliVersion,
1100363
- workspaceName: void 0,
1100364
- sdkLanguage
1100425
+ workspaceName: void 0
1100365
1100426
  });
1100366
1100427
  if (workspace.didSucceed) {
1100367
1100428
  return [workspace.workspace];
@@ -1103786,10 +1103847,10 @@ var CliContext = class {
1103786
1103847
  return "fern-api";
1103787
1103848
  }
1103788
1103849
  getPackageVersion() {
1103789
- if ("0.31.0-rc2" == null) {
1103850
+ if ("0.31.0-rc3" == null) {
1103790
1103851
  this.logger.error("CLI_VERSION is not defined");
1103791
1103852
  }
1103792
- return "0.31.0-rc2";
1103853
+ return "0.31.0-rc3";
1103793
1103854
  }
1103794
1103855
  getCliName() {
1103795
1103856
  if ("fern" == null) {
@@ -1103850,7 +1103911,7 @@ var CliContext = class {
1103850
1103911
  }
1103851
1103912
  registerWorkspaces(workspaces) {
1103852
1103913
  const longestWorkspaceName = maxBy_default(
1103853
- workspaces.map((workspace) => workspace.type === "docs" ? "docs" : workspace.name),
1103914
+ workspaces.map((workspace) => workspace.type === "docs" ? "docs" : workspace.workspaceName ?? "api"),
1103854
1103915
  (name3) => name3.length
1103855
1103916
  );
1103856
1103917
  if (longestWorkspaceName != null) {
@@ -1103891,7 +1103952,9 @@ var CliContext = class {
1103891
1103952
  (await getPosthogManager()).sendEvent(event);
1103892
1103953
  }
1103893
1103954
  constructTaskInitForWorkspace(workspace) {
1103894
- const prefixWithoutPadding = wrapWorkspaceNameForPrefix(workspace.type === "docs" ? "docs" : workspace.name);
1103955
+ const prefixWithoutPadding = wrapWorkspaceNameForPrefix(
1103956
+ workspace.type === "docs" ? "docs" : workspace.workspaceName ?? "api"
1103957
+ );
1103895
1103958
  const minLengthForPrefix = 1 + (this.longestWorkspaceName != null ? wrapWorkspaceNameForPrefix(this.longestWorkspaceName) : prefixWithoutPadding).length;
1103896
1103959
  const prefix = prefixWithoutPadding.padEnd(minLengthForPrefix);
1103897
1103960
  const colorForWorkspace = WORKSPACE_NAME_COLORS[this.numTasks++ % WORKSPACE_NAME_COLORS.length];
@@ -1108172,6 +1108235,7 @@ function convertReadmeConfig({ readme, services }) {
1108172
1108235
  return {
1108173
1108236
  apiReferenceLink: readme.apiReferenceLink,
1108174
1108237
  bannerLink: readme.bannerLink,
1108238
+ introduction: readme.introduction,
1108175
1108239
  defaultEndpoint: readme.defaultEndpoint != null ? readmeEndpointCache.getEndpointForReadmeOrThrow(readme.defaultEndpoint).id : void 0,
1108176
1108240
  features: readme.features != null ? Object.fromEntries(Object.entries(readme.features).map(([featureId, endpoints]) => {
1108177
1108241
  return [
@@ -1110793,7 +1110857,7 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
1110793
1110857
  const exampleResolver = new ExampleResolverImpl(typeResolver);
1110794
1110858
  const variableResolver = new VariableResolverImpl();
1110795
1110859
  const intermediateRepresentation = {
1110796
- apiName: casingsGenerator.generateName(workspace.name),
1110860
+ apiName: casingsGenerator.generateName(workspace.definition.rootApiFile.contents.name),
1110797
1110861
  apiDisplayName: workspace.definition.rootApiFile.contents["display-name"],
1110798
1110862
  apiDocs: await formatDocs(workspace.definition.rootApiFile.contents.docs),
1110799
1110863
  auth: await convertApiAuth({
@@ -1124786,7 +1124850,7 @@ var Watcher = class extends import_node_events.EventEmitter {
1124786
1124850
  };
1124787
1124851
  var watcher_default = Watcher;
1124788
1124852
 
1124789
- // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-1829670845/0/cache/ws-npm-8.17.0-05fb441faf-147ef9eab0.zip/node_modules/ws/wrapper.mjs
1124853
+ // pnp:/home/circleci/project/.yarn/__virtual__/ws-virtual-4b3d6e6175/0/cache/ws-npm-8.17.1-f57fb24a2c-442badcce1.zip/node_modules/ws/wrapper.mjs
1124790
1124854
  var import_stream3 = __toESM(require_stream2(), 1);
1124791
1124855
  var import_receiver = __toESM(require_receiver(), 1);
1124792
1124856
  var import_sender = __toESM(require_sender(), 1);
@@ -1124877,7 +1124941,7 @@ async function getPreviewDocsDefinition({ domain: domain2, project, context }) {
1124877
1124941
  if (docsWorkspace == null) {
1124878
1124942
  throw new Error("No docs workspace found in project");
1124879
1124943
  }
1124880
- const fernWorkspaces = await Promise.all(apiWorkspaces.map((workspace) => workspace.type === "oss" ? convertToFernWorkspace(workspace, context, false, void 0) : workspace));
1124944
+ const fernWorkspaces = await Promise.all(apiWorkspaces.map(async (workspace) => await workspace.toFernWorkspace({ context }, { enableUniqueErrorsPerEndpoint: true })));
1124881
1124945
  const apiCollector = new ReferencedAPICollector();
1124882
1124946
  const filesV2 = {};
1124883
1124947
  const resolver3 = new DocsDefinitionResolver(domain2, docsWorkspace, fernWorkspaces, context, void 0, async (files) => files.map((file) => {
@@ -1148001,7 +1148065,7 @@ async function formatWorkspaces({
1148001
1148065
  }) {
1148002
1148066
  await Promise.all(
1148003
1148067
  project.apiWorkspaces.map(async (workspace) => {
1148004
- if (workspace.type === "oss") {
1148068
+ if (workspace instanceof OSSWorkspace) {
1148005
1148069
  return;
1148006
1148070
  }
1148007
1148071
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
@@ -1151904,8 +1151968,8 @@ async function validateAPIWorkspaceAndLogIssues({
1151904
1151968
  context,
1151905
1151969
  logWarnings
1151906
1151970
  }) {
1151907
- if (!(0, import_validate_npm_package_name.default)(workspace.name).validForNewPackages) {
1151908
- context.failAndThrow("Workspace name is not valid.");
1151971
+ if (!(0, import_validate_npm_package_name.default)(workspace.definition.rootApiFile.contents.name).validForNewPackages) {
1151972
+ context.failAndThrow("API name is not valid.");
1151909
1151973
  }
1151910
1151974
  const violations = await validateFernWorkspace(workspace, context.logger);
1151911
1151975
  const { hasErrors } = logViolations({ violations, context, logWarnings });
@@ -1151947,7 +1152011,7 @@ async function generateFdrApiDefinitionForWorkspaces({
1151947
1152011
  await Promise.all(
1151948
1152012
  project.apiWorkspaces.map(async (workspace) => {
1151949
1152013
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1151950
- const fernWorkspace = workspace.type === "oss" ? await convertToFernWorkspace(workspace, context, false, void 0) : workspace;
1152014
+ const fernWorkspace = await workspace.toFernWorkspace({ context });
1151951
1152015
  const ir = await generateIrForFernWorkspace({
1151952
1152016
  workspace: fernWorkspace,
1151953
1152017
  context,
@@ -1159737,30 +1159801,8 @@ async function generateIrForWorkspaces({
1159737
1159801
  await Promise.all(
1159738
1159802
  project.apiWorkspaces.map(async (workspace) => {
1159739
1159803
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1159740
- cliContext.logger.info(`Generating IR for workspace ${workspace.name}`);
1159741
- let fernWorkspace;
1159742
- if (workspace.type === "fern") {
1159743
- cliContext.logger.info("Found a fern workspace");
1159744
- fernWorkspace = workspace;
1159745
- } else {
1159746
- workspace.specs = workspace.specs.map((spec) => {
1159747
- var _a5, _b4, _c4;
1159748
- return {
1159749
- ...spec,
1159750
- settings: {
1159751
- audiences: ((_a5 = spec.settings) == null ? void 0 : _a5.audiences) ?? [],
1159752
- shouldUseTitleAsName: ((_b4 = spec.settings) == null ? void 0 : _b4.shouldUseTitleAsName) ?? true,
1159753
- shouldUseUndiscriminatedUnionsWithLiterals: ((_c4 = spec.settings) == null ? void 0 : _c4.shouldUseUndiscriminatedUnionsWithLiterals) ?? false
1159754
- }
1159755
- };
1159756
- });
1159757
- fernWorkspace = await convertToFernWorkspace(
1159758
- workspace,
1159759
- context,
1159760
- false,
1159761
- generationLanguage
1159762
- );
1159763
- }
1159804
+ cliContext.logger.info(`Generating IR for workspace ${workspace.workspaceName}`);
1159805
+ const fernWorkspace = await workspace.toFernWorkspace({ context });
1159764
1159806
  const intermediateRepresentation = await getIntermediateRepresentation({
1159765
1159807
  workspace: fernWorkspace,
1159766
1159808
  context,
@@ -1159827,25 +1159869,13 @@ async function generateOpenAPIIrForWorkspaces({
1159827
1159869
  await Promise.all(
1159828
1159870
  project.apiWorkspaces.map(async (workspace) => {
1159829
1159871
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1159830
- if (workspace.type === "fern") {
1159872
+ if (workspace instanceof FernWorkspace) {
1159831
1159873
  context.logger.info("Skipping, API is specified as a Fern Definition.");
1159832
1159874
  return;
1159833
1159875
  }
1159834
- workspace.specs = workspace.specs.map((spec) => {
1159835
- var _a5, _b4, _c4;
1159836
- return {
1159837
- ...spec,
1159838
- settings: {
1159839
- audiences: ((_a5 = spec.settings) == null ? void 0 : _a5.audiences) ?? [],
1159840
- shouldUseTitleAsName: ((_b4 = spec.settings) == null ? void 0 : _b4.shouldUseTitleAsName) ?? true,
1159841
- shouldUseUndiscriminatedUnionsWithLiterals: ((_c4 = spec.settings) == null ? void 0 : _c4.shouldUseUndiscriminatedUnionsWithLiterals) ?? false
1159842
- }
1159843
- };
1159844
- });
1159845
1159876
  const openAPIIr = await parse3({
1159846
- workspace,
1159847
- taskContext: context,
1159848
- sdkLanguage
1159877
+ specs: workspace.specs,
1159878
+ taskContext: context
1159849
1159879
  });
1159850
1159880
  const irOutputFilePath = import_path35.default.resolve(irFilepath);
1159851
1159881
  const openApiIrJson = await serialization_exports3.OpenApiIntermediateRepresentation.jsonOrThrow(openAPIIr, {
@@ -1159868,7 +1159898,7 @@ async function writeOverridesForWorkspaces({
1159868
1159898
  await Promise.all(
1159869
1159899
  project.apiWorkspaces.map(async (workspace) => {
1159870
1159900
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1159871
- if (workspace.type === "oss") {
1159901
+ if (workspace instanceof OSSWorkspace) {
1159872
1159902
  await writeDefinitionForOpenAPIWorkspace({
1159873
1159903
  workspace,
1159874
1159904
  context,
@@ -1159902,11 +1159932,8 @@ async function writeDefinitionForOpenAPIWorkspace({
1159902
1159932
  }) {
1159903
1159933
  for (const spec of workspace.specs) {
1159904
1159934
  const ir = await parse3({
1159905
- workspace: {
1159906
- specs: [spec]
1159907
- },
1159908
- taskContext: context,
1159909
- sdkLanguage: void 0
1159935
+ specs: [spec],
1159936
+ taskContext: context
1159910
1159937
  });
1159911
1159938
  let existingOverrides = {};
1159912
1159939
  if (spec.absoluteFilepathToOverrides !== void 0) {
@@ -1159950,9 +1159977,6 @@ async function writeDefinitionForOpenAPIWorkspace({
1159950
1159977
  }
1159951
1159978
  }
1159952
1159979
 
1159953
- // pnp:/home/circleci/project/packages/cli/cli/src/commands/generate/generateAPIWorkspaces.ts
1159954
- var import_path39 = require("path");
1159955
-
1159956
1159980
  // pnp:/home/circleci/project/packages/cli/cli/src/constants.ts
1159957
1159981
  var API_CLI_OPTION = "api";
1159958
1159982
  var GROUP_CLI_OPTION = "group";
@@ -1160444,7 +1160468,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, workspace, genera
1160444
1160468
  absolutePathToSnippetTemplates: absolutePathToTmpSnippetTemplatesJSON,
1160445
1160469
  absolutePathToIr,
1160446
1160470
  absolutePathToWriteConfigJson,
1160447
- workspaceName: workspace.name,
1160471
+ workspaceName: workspace.definition.rootApiFile.contents.name,
1160448
1160472
  organization,
1160449
1160473
  outputVersion: outputVersionOverride,
1160450
1160474
  keepDocker,
@@ -1160528,44 +1160552,38 @@ async function runGenerator({ workspaceName, organization, outputVersion, absolu
1160528
1160552
  var import_os5 = __toESM(require("os"));
1160529
1160553
  var import_path37 = __toESM(require("path"));
1160530
1160554
  var import_tmp_promise8 = __toESM(require_tmp_promise());
1160531
- async function runLocalGenerationForWorkspace({ projectConfig, workspaceGetter, keepDocker, context }) {
1160555
+ async function runLocalGenerationForWorkspace({ projectConfig, workspace, generatorGroup, keepDocker, context }) {
1160532
1160556
  const workspaceTempDir = await getWorkspaceTempDir();
1160533
- const toplevelWorkspaceMetadata = await workspaceGetter(void 0);
1160534
- const generatorGroup = toplevelWorkspaceMetadata == null ? void 0 : toplevelWorkspaceMetadata.group;
1160535
- if (generatorGroup == null) {
1160536
- context.failWithoutThrowing("Could not load workspace");
1160537
- return;
1160538
- }
1160539
1160557
  const results = await Promise.all(generatorGroup.generators.map(async (generatorInvocation) => {
1160540
1160558
  return context.runInteractiveTask({ name: generatorInvocation.name }, async (interactiveTaskContext) => {
1160541
- const workspaceMetadata = await workspaceGetter(generatorInvocation.language);
1160542
- if (workspaceMetadata == null) {
1160543
- interactiveTaskContext.failWithoutThrowing("Could not load workspace");
1160544
- return;
1160559
+ if (generatorInvocation.absolutePathToLocalOutput == null) {
1160560
+ interactiveTaskContext.failWithoutThrowing("Cannot generate because output location is not local-file-system");
1160545
1160561
  } else {
1160546
- if (generatorInvocation.absolutePathToLocalOutput == null) {
1160547
- interactiveTaskContext.failWithoutThrowing("Cannot generate because output location is not local-file-system");
1160562
+ let fernWorkspace;
1160563
+ if (workspace instanceof OSSWorkspace) {
1160564
+ fernWorkspace = await workspace.toFernWorkspace({ context }, getOSSWorkspaceSettingsFromGeneratorInvocation(generatorInvocation));
1160548
1160565
  } else {
1160549
- await writeFilesToDiskAndRunGenerator({
1160550
- organization: projectConfig.organization,
1160551
- absolutePathToFernConfig: projectConfig._absolutePath,
1160552
- workspace: workspaceMetadata.workspace,
1160553
- generatorInvocation,
1160554
- absolutePathToLocalOutput: generatorInvocation.absolutePathToLocalOutput,
1160555
- absolutePathToLocalSnippetJSON: void 0,
1160556
- absolutePathToLocalSnippetTemplateJSON: void 0,
1160557
- audiences: generatorGroup.audiences,
1160558
- workspaceTempDir,
1160559
- keepDocker,
1160560
- context: interactiveTaskContext,
1160561
- irVersionOverride: generatorInvocation.irVersionOverride,
1160562
- outputVersionOverride: void 0,
1160563
- writeUnitTests: false,
1160564
- generateOauthClients: false,
1160565
- generatePaginatedClients: false
1160566
- });
1160567
- interactiveTaskContext.logger.info(source_default.green("Wrote files to " + generatorInvocation.absolutePathToLocalOutput));
1160566
+ fernWorkspace = workspace;
1160568
1160567
  }
1160568
+ await writeFilesToDiskAndRunGenerator({
1160569
+ organization: projectConfig.organization,
1160570
+ absolutePathToFernConfig: projectConfig._absolutePath,
1160571
+ workspace: fernWorkspace,
1160572
+ generatorInvocation,
1160573
+ absolutePathToLocalOutput: generatorInvocation.absolutePathToLocalOutput,
1160574
+ absolutePathToLocalSnippetJSON: void 0,
1160575
+ absolutePathToLocalSnippetTemplateJSON: void 0,
1160576
+ audiences: generatorGroup.audiences,
1160577
+ workspaceTempDir,
1160578
+ keepDocker,
1160579
+ context: interactiveTaskContext,
1160580
+ irVersionOverride: generatorInvocation.irVersionOverride,
1160581
+ outputVersionOverride: void 0,
1160582
+ writeUnitTests: false,
1160583
+ generateOauthClients: false,
1160584
+ generatePaginatedClients: false
1160585
+ });
1160586
+ interactiveTaskContext.logger.info(source_default.green("Wrote files to " + generatorInvocation.absolutePathToLocalOutput));
1160569
1160587
  }
1160570
1160588
  });
1160571
1160589
  }));
@@ -1160684,7 +1160702,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
1160684
1160702
  await import_tar2.default.create({ file: tarPath, cwd: absolutePathToTmpFernDirectory }, ["."]);
1160685
1160703
  context.logger.debug("Getting upload URL for Fern definition.");
1160686
1160704
  const definitionUploadUrlRequest = await remoteGenerationService.remoteGen.getDefinitionUploadUrl({
1160687
- apiName: workspace.name,
1160705
+ apiName: workspace.definition.rootApiFile.contents.name,
1160688
1160706
  organizationName: organization,
1160689
1160707
  version: version3
1160690
1160708
  });
@@ -1160709,7 +1160727,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
1160709
1160727
  }
1160710
1160728
  }
1160711
1160729
  const createResponse = await remoteGenerationService.remoteGen.createJobV3({
1160712
- apiName: workspace.name,
1160730
+ apiName: workspace.definition.rootApiFile.contents.name,
1160713
1160731
  version: version3,
1160714
1160732
  organizationName: organization,
1160715
1160733
  generators: [generatorConfigsWithEnvVarSubstitutions],
@@ -1160726,7 +1160744,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
1160726
1160744
  if (!createResponse.ok) {
1160727
1160745
  return convertCreateJobError(createResponse.error)._visit({
1160728
1160746
  illegalApiNameError: () => {
1160729
- return context.failAndThrow("API name is invalid: " + workspace.name);
1160747
+ return context.failAndThrow("API name is invalid: " + workspace.definition.rootApiFile.contents.name);
1160730
1160748
  },
1160731
1160749
  illegalApiVersionError: () => {
1160732
1160750
  return context.failAndThrow("API version is invalid: " + version3);
@@ -1161070,13 +1161088,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
1161070
1161088
  }
1161071
1161089
 
1161072
1161090
  // pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
1161073
- async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspaceGetter, context, version: version3, shouldLogS3Url, token }) {
1161074
- const toplevelWorkspaceMetadata = await workspaceGetter(void 0);
1161075
- const generatorGroup = toplevelWorkspaceMetadata == null ? void 0 : toplevelWorkspaceMetadata.group;
1161076
- if (generatorGroup == null) {
1161077
- context.failWithoutThrowing("Could not load workspace");
1161078
- return null;
1161079
- }
1161091
+ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context, generatorGroup, version: version3, shouldLogS3Url, token, whitelabel, absolutePathToPreview }) {
1161080
1161092
  if (generatorGroup.generators.length === 0) {
1161081
1161093
  context.logger.warn("No generators specified.");
1161082
1161094
  return null;
@@ -1161084,36 +1161096,35 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
1161084
1161096
  const interactiveTasks = [];
1161085
1161097
  const snippetsProducedBy = [];
1161086
1161098
  interactiveTasks.push(...generatorGroup.generators.map((generatorInvocation) => context.runInteractiveTask({ name: generatorInvocation.name }, async (interactiveTaskContext) => {
1161087
- var _a5;
1161088
- const workspaceMetadata = await workspaceGetter(generatorInvocation.language);
1161089
- if (workspaceMetadata == null) {
1161090
- interactiveTaskContext.failWithoutThrowing("Could not load workspace");
1161091
- return;
1161099
+ let fernWorkspace;
1161100
+ if (workspace instanceof OSSWorkspace) {
1161101
+ fernWorkspace = await workspace.toFernWorkspace({ context }, getOSSWorkspaceSettingsFromGeneratorInvocation(generatorInvocation));
1161092
1161102
  } else {
1161093
- const remoteTaskHandlerResponse = await runRemoteGenerationForGenerator({
1161094
- projectConfig,
1161095
- organization,
1161096
- workspace: workspaceMetadata.workspace,
1161097
- interactiveTaskContext,
1161098
- generatorInvocation,
1161099
- version: version3,
1161100
- audiences: generatorGroup.audiences,
1161101
- shouldLogS3Url,
1161102
- token,
1161103
- whitelabel: (_a5 = workspaceMetadata.workspace.generatorsConfiguration) == null ? void 0 : _a5.whitelabel,
1161104
- irVersionOverride: generatorInvocation.irVersionOverride,
1161105
- absolutePathToPreview: workspaceMetadata.absolutePathToPreview,
1161106
- readme: generatorInvocation.readme
1161107
- });
1161108
- if (remoteTaskHandlerResponse != null && remoteTaskHandlerResponse.createdSnippets) {
1161109
- snippetsProducedBy.push(generatorInvocation);
1161110
- if (generatorInvocation.absolutePathToLocalSnippets != null && remoteTaskHandlerResponse.snippetsS3PreSignedReadUrl != null) {
1161111
- await downloadSnippetsForTask({
1161112
- snippetsS3PreSignedReadUrl: remoteTaskHandlerResponse.snippetsS3PreSignedReadUrl,
1161113
- absolutePathToLocalSnippetJSON: generatorInvocation.absolutePathToLocalSnippets,
1161114
- context: interactiveTaskContext
1161115
- });
1161116
- }
1161103
+ fernWorkspace = workspace;
1161104
+ }
1161105
+ const remoteTaskHandlerResponse = await runRemoteGenerationForGenerator({
1161106
+ projectConfig,
1161107
+ organization,
1161108
+ workspace: fernWorkspace,
1161109
+ interactiveTaskContext,
1161110
+ generatorInvocation,
1161111
+ version: version3,
1161112
+ audiences: generatorGroup.audiences,
1161113
+ shouldLogS3Url,
1161114
+ token,
1161115
+ whitelabel,
1161116
+ readme: generatorInvocation.readme,
1161117
+ irVersionOverride: generatorInvocation.irVersionOverride,
1161118
+ absolutePathToPreview
1161119
+ });
1161120
+ if (remoteTaskHandlerResponse != null && remoteTaskHandlerResponse.createdSnippets) {
1161121
+ snippetsProducedBy.push(generatorInvocation);
1161122
+ if (generatorInvocation.absolutePathToLocalSnippets != null && remoteTaskHandlerResponse.snippetsS3PreSignedReadUrl != null) {
1161123
+ await downloadSnippetsForTask({
1161124
+ snippetsS3PreSignedReadUrl: remoteTaskHandlerResponse.snippetsS3PreSignedReadUrl,
1161125
+ absolutePathToLocalSnippetJSON: generatorInvocation.absolutePathToLocalSnippets,
1161126
+ context: interactiveTaskContext
1161127
+ });
1161117
1161128
  }
1161118
1161129
  }
1161119
1161130
  })));
@@ -1161376,19 +1161387,47 @@ async function runRemoteGenerationForDocsWorkspace({ organization, fernWorkspace
1161376
1161387
  // pnp:/home/circleci/project/packages/cli/cli/src/commands/generate/generateAPIWorkspace.ts
1161377
1161388
  async function generateWorkspace({
1161378
1161389
  organization,
1161390
+ workspace,
1161379
1161391
  projectConfig,
1161380
- workspaceGetter,
1161381
1161392
  context,
1161393
+ groupName,
1161382
1161394
  version: version3,
1161383
1161395
  shouldLogS3Url,
1161384
1161396
  token,
1161385
1161397
  useLocalDocker,
1161386
- keepDocker
1161398
+ keepDocker,
1161399
+ absolutePathToPreview
1161387
1161400
  }) {
1161401
+ if (workspace.generatorsConfiguration == null) {
1161402
+ context.logger.warn("This workspaces has no generators.yml");
1161403
+ return;
1161404
+ }
1161405
+ if (workspace.generatorsConfiguration.groups.length === 0) {
1161406
+ context.logger.warn(`This workspaces has no groups specified in ${GENERATORS_CONFIGURATION_FILENAME}`);
1161407
+ return;
1161408
+ }
1161409
+ const groupNameOrDefault = groupName ?? workspace.generatorsConfiguration.defaultGroup;
1161410
+ if (groupNameOrDefault == null) {
1161411
+ return context.failAndThrow(
1161412
+ `No group specified. Use the --${GROUP_CLI_OPTION} option, or set "${DEFAULT_GROUP_GENERATORS_CONFIG_KEY}" in ${GENERATORS_CONFIGURATION_FILENAME}`
1161413
+ );
1161414
+ }
1161415
+ const group = workspace.generatorsConfiguration.groups.find(
1161416
+ (otherGroup) => otherGroup.groupName === groupNameOrDefault
1161417
+ );
1161418
+ if (group == null) {
1161419
+ return context.failAndThrow(`Group '${groupNameOrDefault}' does not exist.`);
1161420
+ }
1161421
+ await validateAPIWorkspaceAndLogIssues({
1161422
+ workspace: await workspace.toFernWorkspace({ context }),
1161423
+ context,
1161424
+ logWarnings: false
1161425
+ });
1161388
1161426
  if (useLocalDocker) {
1161389
1161427
  await runLocalGenerationForWorkspace({
1161390
1161428
  projectConfig,
1161391
- workspaceGetter,
1161429
+ workspace,
1161430
+ generatorGroup: group,
1161392
1161431
  keepDocker,
1161393
1161432
  context
1161394
1161433
  });
@@ -1161396,55 +1161435,19 @@ async function generateWorkspace({
1161396
1161435
  await runRemoteGenerationForAPIWorkspace({
1161397
1161436
  projectConfig,
1161398
1161437
  organization,
1161399
- workspaceGetter,
1161438
+ workspace,
1161400
1161439
  context,
1161440
+ generatorGroup: group,
1161401
1161441
  version: version3,
1161402
1161442
  shouldLogS3Url,
1161403
- token
1161443
+ token,
1161444
+ whitelabel: workspace.generatorsConfiguration.whitelabel,
1161445
+ absolutePathToPreview
1161404
1161446
  });
1161405
1161447
  }
1161406
1161448
  }
1161407
1161449
 
1161408
1161450
  // pnp:/home/circleci/project/packages/cli/cli/src/commands/generate/generateAPIWorkspaces.ts
1161409
- async function getFernWorkspace(sdkLanguage, groupName, apiWorkspace, context, preview) {
1161410
- var _a5, _b4;
1161411
- let fernWorkspace;
1161412
- if (apiWorkspace.type === "fern") {
1161413
- fernWorkspace = apiWorkspace;
1161414
- } else {
1161415
- fernWorkspace = await convertToFernWorkspace(apiWorkspace, context, false, sdkLanguage);
1161416
- }
1161417
- if (fernWorkspace.generatorsConfiguration == null) {
1161418
- context.logger.warn("This workspaces has no generators.yml");
1161419
- return;
1161420
- }
1161421
- if (fernWorkspace.generatorsConfiguration.groups.length === 0) {
1161422
- context.logger.warn(`This workspaces has no groups specified in ${GENERATORS_CONFIGURATION_FILENAME}`);
1161423
- return;
1161424
- }
1161425
- const absolutePathToPreview = preview ? AbsoluteFilePath.of((0, import_path39.join)(fernWorkspace.absoluteFilepath, RelativeFilePath.of(PREVIEW_DIRECTORY))) : void 0;
1161426
- if (absolutePathToPreview != null) {
1161427
- context.logger.info(`Writing preview to ${absolutePathToPreview}`);
1161428
- }
1161429
- await validateAPIWorkspaceAndLogIssues({ workspace: fernWorkspace, context, logWarnings: false });
1161430
- const groupNameOrDefault = groupName ?? ((_a5 = fernWorkspace.generatorsConfiguration) == null ? void 0 : _a5.defaultGroup);
1161431
- if (groupNameOrDefault == null) {
1161432
- return context.failAndThrow(
1161433
- `No group specified. Use the --${GROUP_CLI_OPTION} option, or set "${DEFAULT_GROUP_GENERATORS_CONFIG_KEY}" in ${GENERATORS_CONFIGURATION_FILENAME}`
1161434
- );
1161435
- }
1161436
- const group = (_b4 = fernWorkspace.generatorsConfiguration) == null ? void 0 : _b4.groups.find(
1161437
- (otherGroup) => otherGroup.groupName === groupNameOrDefault
1161438
- );
1161439
- if (group == null) {
1161440
- return context.failAndThrow(`Group '${groupNameOrDefault}' does not exist.`);
1161441
- }
1161442
- return {
1161443
- workspace: fernWorkspace,
1161444
- absolutePathToPreview,
1161445
- group
1161446
- };
1161447
- }
1161448
1161451
  async function generateAPIWorkspaces({
1161449
1161452
  project,
1161450
1161453
  cliContext,
@@ -1161474,7 +1161477,7 @@ async function generateAPIWorkspaces({
1161474
1161477
  workspaces: project.apiWorkspaces.map((workspace) => {
1161475
1161478
  var _a5;
1161476
1161479
  return {
1161477
- name: workspace.name,
1161480
+ name: workspace.workspaceName,
1161478
1161481
  group: groupName,
1161479
1161482
  generators: (_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.groups.filter((group) => groupName == null ? true : group.groupName === groupName).map((group) => {
1161480
1161483
  return group.generators.map((generator) => {
@@ -1161493,17 +1161496,22 @@ async function generateAPIWorkspaces({
1161493
1161496
  await Promise.all(
1161494
1161497
  project.apiWorkspaces.map(async (workspace) => {
1161495
1161498
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1161496
- const fernWorkspaceGetter = async (sdkLanguage) => getFernWorkspace(sdkLanguage, groupName, workspace, context, preview);
1161499
+ const absolutePathToPreview = preview ? join(workspace.absoluteFilepath, RelativeFilePath.of(PREVIEW_DIRECTORY)) : void 0;
1161500
+ if (absolutePathToPreview != null) {
1161501
+ context.logger.info(`Writing preview to ${absolutePathToPreview}`);
1161502
+ }
1161497
1161503
  await generateWorkspace({
1161498
1161504
  organization: project.config.organization,
1161499
- workspaceGetter: fernWorkspaceGetter,
1161505
+ workspace,
1161500
1161506
  projectConfig: project.config,
1161501
1161507
  context,
1161502
1161508
  version: version3,
1161509
+ groupName,
1161503
1161510
  shouldLogS3Url,
1161504
1161511
  token,
1161505
1161512
  useLocalDocker,
1161506
- keepDocker
1161513
+ keepDocker,
1161514
+ absolutePathToPreview
1161507
1161515
  });
1161508
1161516
  });
1161509
1161517
  })
@@ -1161541,7 +1161549,7 @@ async function generateDocsWorkspace({
1161541
1161549
  await validateDocsWorkspaceAndLogIssues({ workspace: docsWorkspace, context, logWarnings: false });
1161542
1161550
  const fernWorkspaces = await Promise.all(
1161543
1161551
  project.apiWorkspaces.map(async (workspace) => {
1161544
- return workspace.type === "fern" ? workspace : await convertToFernWorkspace(workspace, context, true, void 0);
1161552
+ return workspace.toFernWorkspace({ context }, { enableUniqueErrorsPerEndpoint: true });
1161545
1161553
  })
1161546
1161554
  );
1161547
1161555
  await runRemoteGenerationForDocsWorkspace({
@@ -1161816,7 +1161824,7 @@ async function mockServer({
1161816
1161824
  }
1161817
1161825
  const workspace = project.apiWorkspaces[0];
1161818
1161826
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1161819
- const fernWorkspace = workspace.type === "fern" ? workspace : await convertToFernWorkspace(workspace, context, false, void 0);
1161827
+ const fernWorkspace = await workspace.toFernWorkspace({ context });
1161820
1161828
  await validateAPIWorkspaceAndLogIssues({
1161821
1161829
  context,
1161822
1161830
  logWarnings: false,
@@ -1161845,7 +1161853,7 @@ async function mockServer({
1161845
1161853
  var import_fiddle_sdk5 = __toESM(require_fiddle_sdk());
1161846
1161854
  var import_axios9 = __toESM(require_axios4());
1161847
1161855
  var import_promises47 = require("fs/promises");
1161848
- var import_path40 = __toESM(require("path"));
1161856
+ var import_path39 = __toESM(require("path"));
1161849
1161857
  var import_tar3 = __toESM(require_tar());
1161850
1161858
  var import_tmp_promise11 = __toESM(require_tmp_promise());
1161851
1161859
  async function registerWorkspacesV1({
@@ -1161867,7 +1161875,7 @@ async function registerWorkspacesV1({
1161867
1161875
  await Promise.all(
1161868
1161876
  project.apiWorkspaces.map(async (workspace) => {
1161869
1161877
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1161870
- if (workspace.type === "oss") {
1161878
+ if (workspace instanceof OSSWorkspace) {
1161871
1161879
  context.failWithoutThrowing("Registering from OpenAPI not currently supported.");
1161872
1161880
  return;
1161873
1161881
  }
@@ -1161889,7 +1161897,7 @@ async function registerWorkspacesV1({
1161889
1161897
  return;
1161890
1161898
  }
1161891
1161899
  const tmpDir = await import_tmp_promise11.default.dir();
1161892
- const tarPath = import_path40.default.join(tmpDir.path, "definition.tgz");
1161900
+ const tarPath = import_path39.default.join(tmpDir.path, "definition.tgz");
1161893
1161901
  context.logger.debug(`Compressing definition at ${tmpDir.path}`);
1161894
1161902
  await import_tar3.default.create({ file: tarPath, cwd: workspace.absoluteFilepath }, ["."]);
1161895
1161903
  context.logger.info("Uploading definition...");
@@ -1161911,19 +1161919,15 @@ async function registerWorkspacesV2({
1161911
1161919
  await Promise.all(
1161912
1161920
  project.apiWorkspaces.map(async (workspace) => {
1161913
1161921
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1161914
- if (workspace.type === "oss") {
1161915
- context.failWithoutThrowing("Cannot register OpenAPI workspace");
1161916
- } else {
1161917
- await registerApi({
1161918
- organization: project.config.organization,
1161919
- workspace,
1161920
- context,
1161921
- token,
1161922
- audiences: { type: "all" },
1161923
- snippetsConfig: {}
1161924
- });
1161925
- context.logger.info(source_default.green("Registered API"));
1161926
- }
1161922
+ await registerApi({
1161923
+ organization: project.config.organization,
1161924
+ workspace: await workspace.toFernWorkspace({ context }),
1161925
+ context,
1161926
+ token,
1161927
+ audiences: { type: "all" },
1161928
+ snippetsConfig: {}
1161929
+ });
1161930
+ context.logger.info(source_default.green("Registered API"));
1161927
1161931
  });
1161928
1161932
  })
1161929
1161933
  );
@@ -1161948,7 +1161952,7 @@ async function testOutput({
1161948
1161952
  }
1161949
1161953
  const workspace = project.apiWorkspaces[0];
1161950
1161954
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1161951
- const fernWorkspace = workspace.type === "fern" ? workspace : await convertToFernWorkspace(workspace, context, false, generationLanguage);
1161955
+ const fernWorkspace = await workspace.toFernWorkspace({ context });
1161952
1161956
  await validateAPIWorkspaceAndLogIssues({
1161953
1161957
  context,
1161954
1161958
  logWarnings: false,
@@ -1162022,7 +1162026,7 @@ async function generateToken({
1162022
1162026
  // pnp:/home/circleci/project/packages/cli/cli/src/commands/upgrade/updateApiSpec.ts
1162023
1162027
  var fs8 = __toESM(require("fs"));
1162024
1162028
  var import_promises48 = require("fs/promises");
1162025
- var import_path41 = __toESM(require("path"));
1162029
+ var import_path40 = __toESM(require("path"));
1162026
1162030
  var import_stream5 = require("stream");
1162027
1162031
  var import_promises49 = require("stream/promises");
1162028
1162032
  async function fetchAndWriteFile(url, path42, logger) {
@@ -1162067,7 +1162071,7 @@ async function updateApiSpec({
1162067
1162071
  for (const api of apis) {
1162068
1162072
  if (typeof api !== "string" && api.origin != null) {
1162069
1162073
  cliContext.logger.info(`Origin found, fetching spec from ${api.origin}`);
1162070
- await fetchAndWriteFile(api.origin, import_path41.default.join(fernDirectory, api.path), cliContext.logger);
1162074
+ await fetchAndWriteFile(api.origin, import_path40.default.join(fernDirectory, api.path), cliContext.logger);
1162071
1162075
  }
1162072
1162076
  }
1162073
1162077
  } else if (generatorConfig[generators_yml_exports.ASYNC_API_LOCATION_KEY] != null) {
@@ -1162078,7 +1162082,7 @@ async function updateApiSpec({
1162078
1162082
  const origin2 = generatorConfig[generators_yml_exports.API_ORIGIN_LOCATION_KEY];
1162079
1162083
  const location2 = generatorConfig[generators_yml_exports.ASYNC_API_LOCATION_KEY];
1162080
1162084
  if (origin2 != null && location2 != null) {
1162081
- await fetchAndWriteFile(origin2, import_path41.default.join(fernDirectory, location2), cliContext.logger);
1162085
+ await fetchAndWriteFile(origin2, import_path40.default.join(fernDirectory, location2), cliContext.logger);
1162082
1162086
  }
1162083
1162087
  }
1162084
1162088
  } else if (generatorConfig[generators_yml_exports.OPENAPI_LOCATION_KEY] != null) {
@@ -1162088,7 +1162092,7 @@ async function updateApiSpec({
1162088
1162092
  if (apiOrigin != null && apiOutput != null) {
1162089
1162093
  origin = apiOrigin;
1162090
1162094
  cliContext.logger.info(`Origin found, fetching spec from ${apiOrigin}`);
1162091
- await fetchAndWriteFile(apiOrigin, import_path41.default.join(fernDirectory, apiOutput), cliContext.logger);
1162095
+ await fetchAndWriteFile(apiOrigin, import_path40.default.join(fernDirectory, apiOutput), cliContext.logger);
1162092
1162096
  }
1162093
1162097
  }
1162094
1162098
  return;
@@ -1164666,17 +1164670,8 @@ async function validateWorkspaces({
1164666
1164670
  await Promise.all(
1164667
1164671
  project.apiWorkspaces.map(async (workspace) => {
1164668
1164672
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1164669
- if (workspace.type === "oss") {
1164670
- const fernWorkspace = await convertToFernWorkspace(
1164671
- workspace,
1164672
- context,
1164673
- false,
1164674
- void 0
1164675
- );
1164676
- await validateAPIWorkspaceAndLogIssues({ workspace: fernWorkspace, context, logWarnings });
1164677
- } else {
1164678
- await validateAPIWorkspaceAndLogIssues({ workspace, context, logWarnings });
1164679
- }
1164673
+ const fernWorkspace = await workspace.toFernWorkspace({ context });
1164674
+ await validateAPIWorkspaceAndLogIssues({ workspace: fernWorkspace, context, logWarnings });
1164680
1164675
  });
1164681
1164676
  })
1164682
1164677
  );
@@ -1164684,7 +1164679,7 @@ async function validateWorkspaces({
1164684
1164679
 
1164685
1164680
  // pnp:/home/circleci/project/packages/cli/cli/src/commands/write-definition/writeDefinitionForWorkspaces.ts
1164686
1164681
  var import_promises75 = require("fs/promises");
1164687
- var import_path42 = __toESM(require("path"));
1164682
+ var import_path41 = __toESM(require("path"));
1164688
1164683
  async function writeDefinitionForWorkspaces({
1164689
1164684
  project,
1164690
1164685
  cliContext,
@@ -1164693,9 +1164688,9 @@ async function writeDefinitionForWorkspaces({
1164693
1164688
  await Promise.all(
1164694
1164689
  project.apiWorkspaces.map(async (workspace) => {
1164695
1164690
  await cliContext.runTaskForWorkspace(workspace, async (context) => {
1164696
- if (workspace.type === "oss") {
1164691
+ if (workspace instanceof OSSWorkspace) {
1164697
1164692
  await writeDefinitionForOpenAPIWorkspace2({ workspace, context, sdkLanguage });
1164698
- } else {
1164693
+ } else if (workspace instanceof FernWorkspace) {
1164699
1164694
  await writeDefinitionForFernWorkspace({ workspace, context });
1164700
1164695
  }
1164701
1164696
  });
@@ -1164718,7 +1164713,7 @@ async function writeDefinitionForFernWorkspace({
1164718
1164713
  absolutePathToOutputDirectory
1164719
1164714
  });
1164720
1164715
  context.logger.info(
1164721
- source_default.green(`Wrote imported definition at ${import_path42.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
1164716
+ source_default.green(`Wrote imported definition at ${import_path41.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
1164722
1164717
  );
1164723
1164718
  }
1164724
1164719
  }
@@ -1164727,7 +1164722,7 @@ async function writeDefinitionForOpenAPIWorkspace2({
1164727
1164722
  context,
1164728
1164723
  sdkLanguage
1164729
1164724
  }) {
1164730
- const fernWorkspace = await convertToFernWorkspace(workspace, context, false, sdkLanguage);
1164725
+ const fernWorkspace = await workspace.toFernWorkspace({ context });
1164731
1164726
  const absolutePathToOutputDirectory = join(
1164732
1164727
  workspace.absoluteFilepath,
1164733
1164728
  RelativeFilePath.of(`.${DEFINITION_DIRECTORY}`)
@@ -1164737,7 +1164732,7 @@ async function writeDefinitionForOpenAPIWorkspace2({
1164737
1164732
  absolutePathToOutputDirectory
1164738
1164733
  });
1164739
1164734
  context.logger.info(
1164740
- source_default.green(`Wrote definition to ${import_path42.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
1164735
+ source_default.green(`Wrote definition to ${import_path41.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
1164741
1164736
  );
1164742
1164737
  }
1164743
1164738
  async function writeFernDefinition2({