@fern-api/fern-api-dev 5.64.0 → 5.64.2

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/cli.cjs +99 -99
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -164335,9 +164335,10 @@ function convertResponse({ operationContext, responses, context: context3, respo
164335
164335
  context: context3,
164336
164336
  content: resolved.content ?? {}
164337
164337
  });
164338
- if (jsonMedia == null) {
164339
- hasNoContentResponse = true;
164338
+ if (jsonMedia != null) {
164339
+ context3.logger.warn(`${operationContext.method.toUpperCase()} ${operationContext.path}: the 204 response declares a body, but a 204 (No Content) response cannot include one. Ignoring the declared 204 body and treating the success response as optional.`);
164340
164340
  }
164341
+ hasNoContentResponse = true;
164341
164342
  }
164342
164343
  }
164343
164344
  if (hasNoContentResponse && convertedResponse != null && convertedResponse.type === "json") {
@@ -350046,6 +350047,15 @@ var init_ResponseBodyConverter = __esm({
350046
350047
  this.streamingExtension = streamingExtension;
350047
350048
  }
350048
350049
  convert() {
350050
+ if (parseInt(this.statusCode) === 204) {
350051
+ if (this.responseBody.content != null && Object.keys(this.responseBody.content).length > 0) {
350052
+ this.context.errorCollector.collect({
350053
+ message: "A 204 (No Content) response declares a body, but a 204 response cannot include one. Ignoring the declared body and treating the success response as optional.",
350054
+ path: this.breadcrumbs
350055
+ });
350056
+ }
350057
+ return void 0;
350058
+ }
350049
350059
  return this.shouldConvertAsStreaming() ? this.convertStreamingResponseBody() : this.convertNonStreamingResponseBody();
350050
350060
  }
350051
350061
  convertStreamingResponseBody() {
@@ -366386,39 +366396,6 @@ var init_GraphQLConverter = __esm({
366386
366396
  }
366387
366397
  return fields.every((f3) => f3.args.length > 0);
366388
366398
  }
366389
- // Returns the names of object types that will be consumed as namespace groupings by
366390
- // convertOperations — i.e. types that appear as the return type of a zero-arg root
366391
- // field whose own fields all accept arguments. These types must be excluded from the
366392
- // type registry in collectTypeDefinitions to prevent their fields from showing up
366393
- // both as object properties and as standalone operations.
366394
- collectNamespaceTypeNames() {
366395
- if (!this.schema) {
366396
- return /* @__PURE__ */ new Set();
366397
- }
366398
- const namespaceTypeNames = /* @__PURE__ */ new Set();
366399
- const rootTypes = [];
366400
- const queryType = this.schema.getQueryType();
366401
- if (queryType) {
366402
- rootTypes.push(queryType);
366403
- }
366404
- const mutationType = this.schema.getMutationType();
366405
- if (mutationType) {
366406
- rootTypes.push(mutationType);
366407
- }
366408
- const subscriptionType = this.schema.getSubscriptionType();
366409
- if (subscriptionType && this.isActualSubscriptionRootType(subscriptionType)) {
366410
- rootTypes.push(subscriptionType);
366411
- }
366412
- for (const rootType of rootTypes) {
366413
- for (const field5 of Object.values(rootType.getFields())) {
366414
- const returnRawType = this.unwrapNonNull(field5.type);
366415
- if (returnRawType instanceof GraphQLObjectType && field5.args.length === 0 && this.isNamespaceType(returnRawType)) {
366416
- namespaceTypeNames.add(returnRawType.name);
366417
- }
366418
- }
366419
- }
366420
- return namespaceTypeNames;
366421
- }
366422
366399
  async convert() {
366423
366400
  const sdlContent = await (0, import_promises38.readFile)(this.filePath, "utf-8");
366424
366401
  this.schema = buildSchema(sdlContent);
@@ -366460,7 +366437,6 @@ var init_GraphQLConverter = __esm({
366460
366437
  if (!this.schema) {
366461
366438
  return;
366462
366439
  }
366463
- const namespaceTypeNames = this.collectNamespaceTypeNames();
366464
366440
  const typeMap = this.schema.getTypeMap();
366465
366441
  for (const [typeName, type7] of Object.entries(typeMap)) {
366466
366442
  if (typeName.startsWith("__")) {
@@ -366472,9 +366448,6 @@ var init_GraphQLConverter = __esm({
366472
366448
  if (type7 === this.schema.getSubscriptionType() && type7 instanceof GraphQLObjectType && this.isActualSubscriptionRootType(type7)) {
366473
366449
  continue;
366474
366450
  }
366475
- if (type7 instanceof GraphQLObjectType && namespaceTypeNames.has(typeName)) {
366476
- continue;
366477
- }
366478
366451
  if (type7 instanceof GraphQLScalarType && this.isBuiltInScalar(typeName)) {
366479
366452
  continue;
366480
366453
  }
@@ -366560,14 +366533,30 @@ var init_GraphQLConverter = __esm({
366560
366533
  }
366561
366534
  }
366562
366535
  }
366536
+ // Builds an operation id of the form `<operationType>_<segments joined by ".">`.
366537
+ // Flat (top-level) ids use a single segment; namespaced ids include the full field
366538
+ // path so that fields sharing a leaf name across namespaces resolve to distinct ids.
366539
+ // resolveOperationIds falls back from the flat id to the namespaced id on collision,
366540
+ // so both must be produced with this same format for that fallback to line up.
366541
+ buildOperationId(operationType, segments) {
366542
+ return `${operationType.toLowerCase()}_${segments.join(".")}`;
366543
+ }
366563
366544
  convertOperations(type7, operationType, pending) {
366564
366545
  const fields = type7.getFields();
366565
366546
  for (const [fieldName, field5] of Object.entries(fields)) {
366566
366547
  const returnRawType = this.unwrapNonNull(field5.type);
366567
366548
  if (returnRawType instanceof GraphQLObjectType && field5.args.length === 0 && this.isNamespaceType(returnRawType)) {
366549
+ if (operationType === "QUERY") {
366550
+ const parentFlatId = this.buildOperationId(operationType, [fieldName]);
366551
+ pending.push({
366552
+ flatId: parentFlatId,
366553
+ namespacedId: parentFlatId,
366554
+ operation: this.convertField(field5, fieldName, operationType)
366555
+ });
366556
+ }
366568
366557
  this.convertNamespaceOperations(returnRawType, operationType, pending, [fieldName]);
366569
366558
  } else {
366570
- const flatId = `${operationType.toLowerCase()}_${fieldName}`;
366559
+ const flatId = this.buildOperationId(operationType, [fieldName]);
366571
366560
  pending.push({
366572
366561
  flatId,
366573
366562
  namespacedId: flatId,
@@ -366579,8 +366568,8 @@ var init_GraphQLConverter = __esm({
366579
366568
  convertNamespaceOperations(namespaceType, operationType, pending, fieldPath) {
366580
366569
  const fields = namespaceType.getFields();
366581
366570
  for (const [fieldName, field5] of Object.entries(fields)) {
366582
- const flatId = `${operationType.toLowerCase()}_${fieldName}`;
366583
- const namespacedId = `${operationType.toLowerCase()}_${[...fieldPath, fieldName].join(".")}`;
366571
+ const flatId = this.buildOperationId(operationType, [fieldName]);
366572
+ const namespacedId = this.buildOperationId(operationType, [...fieldPath, fieldName]);
366584
366573
  pending.push({
366585
366574
  flatId,
366586
366575
  namespacedId,
@@ -453327,6 +453316,9 @@ var init_toPageNode = __esm({
453327
453316
  function getFieldPath(operation) {
453328
453317
  return operation.fieldPath;
453329
453318
  }
453319
+ function getOperationName(operation) {
453320
+ return operation.name ?? operation.id;
453321
+ }
453330
453322
  var import_url_join21, ApiReferenceNodeConverter;
453331
453323
  var init_ApiReferenceNodeConverter = __esm({
453332
453324
  "../docs-resolver/lib/ApiReferenceNodeConverter.js"() {
@@ -453792,25 +453784,20 @@ ${tagInfo.description}`;
453792
453784
  }
453793
453785
  this.#visitedGraphqlOperations.add(operationId);
453794
453786
  const operationSlug = endpointItem.slug != null ? parentSlug.append(endpointItem.slug) : parentSlug.append(graphqlOperation.name ?? graphqlOperation.id);
453795
- return {
453787
+ return this.#buildGraphqlChildNode({
453796
453788
  id: this.#idgen.get(`${this.apiDefinitionId}:${operationId}`),
453797
- type: "graphql",
453798
- collapsed: void 0,
453799
453789
  operationType: graphqlOperation.operationType,
453800
453790
  graphqlOperationId: APIV1Read_exports.GraphQlOperationId(graphqlOperation.id),
453801
- graphqlOperationIds: void 0,
453802
- apiDefinitionId: this.apiDefinitionId,
453803
- availability: convertDocsAvailability(endpointItem.availability ?? parentAvailability),
453804
453791
  title: endpointItem.title ?? graphqlOperation.displayName ?? graphqlOperation.name ?? graphqlOperation.id,
453805
453792
  slug: operationSlug.get(),
453793
+ availability: endpointItem.availability ?? parentAvailability,
453806
453794
  icon: this.resolveIconFileId(endpointItem.icon),
453807
453795
  hidden: this.hideChildren || endpointItem.hidden,
453808
453796
  playground: this.#convertPlaygroundSettings(endpointItem.playground),
453809
- authed: void 0,
453810
453797
  viewers: endpointItem.viewers,
453811
453798
  orphaned: endpointItem.orphaned,
453812
453799
  featureFlags: endpointItem.featureFlags
453813
- };
453800
+ });
453814
453801
  }
453815
453802
  this.taskContext.logger.error("Unknown identifier in the API Reference layout: ", endpointItem.endpoint);
453816
453803
  return;
@@ -453879,25 +453866,18 @@ ${tagInfo.description}`;
453879
453866
  }
453880
453867
  this.#visitedGraphqlOperations.add(operationId);
453881
453868
  const operationSlug = operationItem.slug != null ? parentSlug.append(operationItem.slug) : parentSlug.append(graphqlOperation.name ?? graphqlOperation.id);
453882
- return {
453869
+ return this.#buildGraphqlChildNode({
453883
453870
  id: this.#idgen.get(`${this.apiDefinitionId}:${operationId}`),
453884
- type: "graphql",
453885
- collapsed: void 0,
453886
453871
  operationType: graphqlOperation.operationType,
453887
453872
  graphqlOperationId: APIV1Read_exports.GraphQlOperationId(graphqlOperation.id),
453888
- graphqlOperationIds: void 0,
453889
- apiDefinitionId: this.apiDefinitionId,
453890
- availability: convertDocsAvailability(operationItem.availability ?? parentAvailability),
453891
453873
  title: operationItem.title ?? graphqlOperation.displayName ?? graphqlOperation.name ?? graphqlOperation.id,
453892
453874
  slug: operationSlug.get(),
453893
- icon: void 0,
453875
+ availability: operationItem.availability ?? parentAvailability,
453894
453876
  hidden: this.hideChildren || operationItem.hidden,
453895
- playground: void 0,
453896
- authed: void 0,
453897
453877
  viewers: operationItem.viewers,
453898
453878
  orphaned: operationItem.orphaned,
453899
453879
  featureFlags: operationItem.featureFlags
453900
- };
453880
+ });
453901
453881
  }
453902
453882
  // Step 2
453903
453883
  #mergeAndFilterChildren(left3, right3) {
@@ -454215,6 +454195,32 @@ ${tagInfo.description}`;
454215
454195
  }
454216
454196
  return sections;
454217
454197
  }
454198
+ // Single source of truth for constructing a GraphQL navigation child node. Callers pass
454199
+ // the fields that vary; the fixed shape (type, apiDefinitionId, authed, ...) and the
454200
+ // availability conversion live here. Optional fields left unset serialize as `undefined`,
454201
+ // matching the previous inline literals exactly — `hidden` is passed explicitly by every
454202
+ // caller so its original value (which may be `undefined`) is preserved verbatim.
454203
+ #buildGraphqlChildNode({ id, operationType, graphqlOperationId, graphqlOperationIds, title: title2, slug, availability, hidden: hidden2, icon, playground, viewers, orphaned, featureFlags }) {
454204
+ return {
454205
+ id,
454206
+ type: "graphql",
454207
+ collapsed: void 0,
454208
+ operationType,
454209
+ graphqlOperationId,
454210
+ graphqlOperationIds,
454211
+ apiDefinitionId: this.apiDefinitionId,
454212
+ availability: convertDocsAvailability(availability),
454213
+ title: title2,
454214
+ slug,
454215
+ icon,
454216
+ hidden: hidden2,
454217
+ playground,
454218
+ authed: void 0,
454219
+ viewers,
454220
+ orphaned,
454221
+ featureFlags
454222
+ };
454223
+ }
454218
454224
  #buildFieldPathGroupedChildren(operations, parentSlug, parentAvailability, operationType) {
454219
454225
  const shouldGroup = operationType === "QUERY";
454220
454226
  const groupedByParent = /* @__PURE__ */ new Map();
@@ -454233,11 +454239,23 @@ ${tagInfo.description}`;
454233
454239
  insertionOrder.push({ type: "flat", operation });
454234
454240
  }
454235
454241
  }
454242
+ const parentOpsByGroup = /* @__PURE__ */ new Map();
454243
+ for (const entry of insertionOrder) {
454244
+ if (entry.type === "flat") {
454245
+ const name2 = getOperationName(entry.operation);
454246
+ if (groupedByParent.has(name2) && getFieldPath(entry.operation) == null) {
454247
+ parentOpsByGroup.set(name2, entry.operation);
454248
+ }
454249
+ }
454250
+ }
454236
454251
  const children2 = [];
454237
454252
  for (const entry of insertionOrder) {
454238
454253
  if (entry.type === "flat") {
454254
+ const leafName = getOperationName(entry.operation);
454255
+ if (parentOpsByGroup.has(leafName)) {
454256
+ continue;
454257
+ }
454239
454258
  const fieldPath = getFieldPath(entry.operation);
454240
- const leafName = entry.operation.name ?? entry.operation.id;
454241
454259
  let operationSlug = parentSlug;
454242
454260
  if (fieldPath != null && fieldPath.length > 0) {
454243
454261
  for (const segment of fieldPath) {
@@ -454245,51 +454263,33 @@ ${tagInfo.description}`;
454245
454263
  }
454246
454264
  }
454247
454265
  operationSlug = operationSlug.append(kebabCase_default(leafName));
454248
- children2.push({
454266
+ children2.push(this.#buildGraphqlChildNode({
454249
454267
  id: navigation_exports.V1.NodeId(`${this.apiDefinitionId}:${entry.operation.id}`),
454250
- type: "graphql",
454251
- collapsed: void 0,
454252
454268
  operationType: entry.operation.operationType,
454253
454269
  graphqlOperationId: APIV1Read_exports.GraphQlOperationId(entry.operation.id),
454254
- graphqlOperationIds: void 0,
454255
- apiDefinitionId: this.apiDefinitionId,
454256
- availability: convertDocsAvailability(parentAvailability),
454257
454270
  title: entry.operation.displayName ?? entry.operation.name ?? entry.operation.id,
454258
454271
  slug: operationSlug.get(),
454259
- icon: void 0,
454260
- hidden: this.hideChildren,
454261
- playground: void 0,
454262
- authed: void 0,
454263
- viewers: void 0,
454264
- orphaned: void 0,
454265
- featureFlags: void 0
454266
- });
454272
+ availability: parentAvailability,
454273
+ hidden: this.hideChildren
454274
+ }));
454267
454275
  } else {
454268
454276
  const groupOps = groupedByParent.get(entry.parentField) ?? [];
454269
- const firstOp = groupOps[0];
454270
- if (firstOp == null) {
454277
+ const parentOp = parentOpsByGroup.get(entry.parentField);
454278
+ const representativeOp = parentOp ?? groupOps[0];
454279
+ if (representativeOp == null) {
454271
454280
  continue;
454272
454281
  }
454273
454282
  const fieldSlug = parentSlug.append(kebabCase_default(entry.parentField));
454274
- children2.push({
454275
- id: navigation_exports.V1.NodeId(`${this.apiDefinitionId}:${firstOp.id}`),
454276
- type: "graphql",
454277
- collapsed: void 0,
454278
- operationType: firstOp.operationType,
454279
- graphqlOperationId: APIV1Read_exports.GraphQlOperationId(firstOp.id),
454283
+ children2.push(this.#buildGraphqlChildNode({
454284
+ id: navigation_exports.V1.NodeId(`${this.apiDefinitionId}:${representativeOp.id}`),
454285
+ operationType: representativeOp.operationType,
454286
+ graphqlOperationId: APIV1Read_exports.GraphQlOperationId(representativeOp.id),
454280
454287
  graphqlOperationIds: groupOps.map((op2) => APIV1Read_exports.GraphQlOperationId(op2.id)),
454281
- apiDefinitionId: this.apiDefinitionId,
454282
- availability: convertDocsAvailability(parentAvailability),
454283
454288
  title: entry.parentField,
454284
454289
  slug: fieldSlug.get(),
454285
- icon: void 0,
454286
- hidden: this.hideChildren,
454287
- playground: void 0,
454288
- authed: void 0,
454289
- viewers: void 0,
454290
- orphaned: void 0,
454291
- featureFlags: void 0
454292
- });
454290
+ availability: parentAvailability,
454291
+ hidden: this.hideChildren
454292
+ }));
454293
454293
  }
454294
454294
  }
454295
454295
  return children2;
@@ -687227,7 +687227,7 @@ var AccessTokenPosthogManager = class {
687227
687227
  properties: {
687228
687228
  ...event,
687229
687229
  ...event.properties,
687230
- version: "5.64.0",
687230
+ version: "5.64.2",
687231
687231
  usingAccessToken: true,
687232
687232
  ...getRunIdProperties()
687233
687233
  }
@@ -687293,7 +687293,7 @@ var UserPosthogManager = class {
687293
687293
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
687294
687294
  event: "CLI",
687295
687295
  properties: {
687296
- version: "5.64.0",
687296
+ version: "5.64.2",
687297
687297
  ...event,
687298
687298
  ...event.properties,
687299
687299
  usingAccessToken: false,
@@ -868388,7 +868388,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
868388
868388
  var LOGS_FOLDER_NAME = "logs";
868389
868389
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
868390
868390
  function getCliSource() {
868391
- const version7 = "5.64.0";
868391
+ const version7 = "5.64.2";
868392
868392
  return `cli@${version7}`;
868393
868393
  }
868394
868394
  var DebugLogger = class {
@@ -900905,7 +900905,7 @@ var LegacyDocsPublisher = class {
900905
900905
  previewId,
900906
900906
  disableTemplates: void 0,
900907
900907
  skipUpload,
900908
- cliVersion: "5.64.0",
900908
+ cliVersion: "5.64.2",
900909
900909
  loginCommand: "fern auth login"
900910
900910
  });
900911
900911
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -967213,7 +967213,7 @@ function getAutomationContextFromEnv() {
967213
967213
  config_branch: process.env.FERN_CONFIG_BRANCH,
967214
967214
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
967215
967215
  trigger: process.env.GITHUB_EVENT_NAME,
967216
- cli_version: "5.64.0"
967216
+ cli_version: "5.64.2"
967217
967217
  };
967218
967218
  }
967219
967219
  function isAutomationMode() {
@@ -968045,7 +968045,7 @@ var CliContext = class _CliContext {
968045
968045
  if (false) {
968046
968046
  this.logger.error("CLI_VERSION is not defined");
968047
968047
  }
968048
- return "5.64.0";
968048
+ return "5.64.2";
968049
968049
  }
968050
968050
  getCliName() {
968051
968051
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.64.0",
2
+ "version": "5.64.2",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",