@fern-api/fern-api-dev 3.70.2 → 3.71.0

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 +374 -7
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -671980,7 +671980,7 @@ var AccessTokenPosthogManager = class {
671980
671980
  properties: {
671981
671981
  ...event,
671982
671982
  ...event.properties,
671983
- version: "3.70.2",
671983
+ version: "3.71.0",
671984
671984
  usingAccessToken: true
671985
671985
  }
671986
671986
  });
@@ -672079,7 +672079,7 @@ var UserPosthogManager = class {
672079
672079
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
672080
672080
  event: "CLI",
672081
672081
  properties: {
672082
- version: "3.70.2",
672082
+ version: "3.71.0",
672083
672083
  ...event,
672084
672084
  ...event.properties,
672085
672085
  usingAccessToken: false,
@@ -726124,6 +726124,7 @@ __export(serialization_exports4, {
726124
726124
  ApiReferenceConfiguration: () => ApiReferenceConfiguration,
726125
726125
  ApiReferenceEndpointConfiguration: () => ApiReferenceEndpointConfiguration,
726126
726126
  ApiReferenceLayoutItem: () => ApiReferenceLayoutItem,
726127
+ ApiReferenceOperationConfiguration: () => ApiReferenceOperationConfiguration,
726127
726128
  ApiReferencePackageConfiguration: () => ApiReferencePackageConfiguration,
726128
726129
  ApiReferencePackageConfigurationWithOptions: () => ApiReferencePackageConfigurationWithOptions,
726129
726130
  ApiReferenceSectionConfiguration: () => ApiReferenceSectionConfiguration,
@@ -726263,6 +726264,7 @@ __export(docs_exports5, {
726263
726264
  ApiReferenceConfiguration: () => ApiReferenceConfiguration,
726264
726265
  ApiReferenceEndpointConfiguration: () => ApiReferenceEndpointConfiguration,
726265
726266
  ApiReferenceLayoutItem: () => ApiReferenceLayoutItem,
726267
+ ApiReferenceOperationConfiguration: () => ApiReferenceOperationConfiguration,
726266
726268
  ApiReferencePackageConfiguration: () => ApiReferencePackageConfiguration,
726267
726269
  ApiReferencePackageConfigurationWithOptions: () => ApiReferencePackageConfigurationWithOptions,
726268
726270
  ApiReferenceSectionConfiguration: () => ApiReferenceSectionConfiguration,
@@ -727933,6 +727935,15 @@ var ApiReferenceEndpointConfiguration = schemas_exports8.object({
727933
727935
  playground: PlaygroundSettings.optional()
727934
727936
  }).extend(WithPermissions).extend(WithFeatureFlags);
727935
727937
 
727938
+ // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceOperationConfiguration.js
727939
+ var ApiReferenceOperationConfiguration = schemas_exports8.object({
727940
+ operation: schemas_exports8.string(),
727941
+ title: schemas_exports8.string().optional(),
727942
+ slug: schemas_exports8.string().optional(),
727943
+ hidden: schemas_exports8.boolean().optional(),
727944
+ availability: Availability4.optional()
727945
+ }).extend(WithPermissions).extend(WithFeatureFlags);
727946
+
727936
727947
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/Target.js
727937
727948
  var Target2 = schemas_exports8.enum_(["_blank", "_self", "_parent", "_top"]);
727938
727949
 
@@ -727961,6 +727972,7 @@ var ApiReferenceLayoutItem = schemas_exports8.undiscriminatedUnion([
727961
727972
  schemas_exports8.record(schemas_exports8.string(), schemas_exports8.lazy(() => ApiReferencePackageConfiguration)),
727962
727973
  schemas_exports8.lazyObject(() => ApiReferenceSectionConfiguration),
727963
727974
  ApiReferenceEndpointConfiguration,
727975
+ ApiReferenceOperationConfiguration,
727964
727976
  PageConfiguration,
727965
727977
  LinkConfiguration
727966
727978
  ]);
@@ -731099,7 +731111,7 @@ var GraphQlSpecSchema = schemas_exports10.object({
731099
731111
  graphql: schemas_exports10.string(),
731100
731112
  origin: schemas_exports10.string().optional(),
731101
731113
  overrides: schemas_exports10.string().optional(),
731102
- resource: schemas_exports10.string().optional()
731114
+ name: schemas_exports10.string().optional()
731103
731115
  });
731104
731116
 
731105
731117
  // ../configuration/lib/generators-yml/schemas/serialization/resources/generators/types/OpenApiSpecSchema.js
@@ -754528,6 +754540,20 @@ function parseApiReferenceLayoutItem(item, absolutePathToConfig) {
754528
754540
  featureFlags: convertFeatureFlag(item.featureFlag)
754529
754541
  }
754530
754542
  ];
754543
+ } else if (isRawApiRefOperationConfiguration(item)) {
754544
+ return [
754545
+ {
754546
+ type: "operation",
754547
+ operation: item.operation,
754548
+ title: item.title,
754549
+ slug: item.slug,
754550
+ hidden: item.hidden,
754551
+ availability: item.availability,
754552
+ viewers: parseRoles(item.viewers),
754553
+ orphaned: item.orphaned,
754554
+ featureFlags: convertFeatureFlag(item.featureFlag)
754555
+ }
754556
+ ];
754531
754557
  }
754532
754558
  return Object.entries(item).map(([key2, value]) => {
754533
754559
  if (isRawApiRefPackageConfiguration(value)) {
@@ -754634,6 +754660,9 @@ function isRawApiRefSectionConfiguration(item) {
754634
754660
  function isRawApiRefEndpointConfiguration(item) {
754635
754661
  return isPlainObject4(item) && typeof item.endpoint === "string";
754636
754662
  }
754663
+ function isRawApiRefOperationConfiguration(item) {
754664
+ return isPlainObject4(item) && typeof item.operation === "string";
754665
+ }
754637
754666
  function isRawApiRefPackageConfiguration(item) {
754638
754667
  return !Array.isArray(item);
754639
754668
  }
@@ -760496,7 +760525,7 @@ async function parseApiConfigurationV2Schema({ apiConfiguration, rawConfiguratio
760496
760525
  } else {
760497
760526
  continue;
760498
760527
  }
760499
- const namespaceValue = generators_yml_exports.isGraphQLSpecSchema(spec) && "resource" in spec ? spec.resource : "namespace" in spec ? spec.namespace : void 0;
760528
+ const namespaceValue = generators_yml_exports.isGraphQLSpecSchema(spec) && "name" in spec ? spec.name : "namespace" in spec ? spec.namespace : void 0;
760500
760529
  if (namespaceValue != null) {
760501
760530
  namespacedDefinitions[namespaceValue] ??= [];
760502
760531
  namespacedDefinitions[namespaceValue].push(definitionLocation);
@@ -1088381,6 +1088410,88 @@ var definitions4 = {
1088381
1088410
  ],
1088382
1088411
  additionalProperties: false
1088383
1088412
  },
1088413
+ "docs.ApiReferenceOperationConfiguration": {
1088414
+ type: "object",
1088415
+ properties: {
1088416
+ viewers: {
1088417
+ oneOf: [
1088418
+ {
1088419
+ $ref: "#/definitions/docs.Role"
1088420
+ },
1088421
+ {
1088422
+ type: "null"
1088423
+ }
1088424
+ ]
1088425
+ },
1088426
+ orphaned: {
1088427
+ oneOf: [
1088428
+ {
1088429
+ type: "boolean"
1088430
+ },
1088431
+ {
1088432
+ type: "null"
1088433
+ }
1088434
+ ]
1088435
+ },
1088436
+ "feature-flag": {
1088437
+ oneOf: [
1088438
+ {
1088439
+ $ref: "#/definitions/docs.FeatureFlagConfiguration"
1088440
+ },
1088441
+ {
1088442
+ type: "null"
1088443
+ }
1088444
+ ]
1088445
+ },
1088446
+ operation: {
1088447
+ type: "string"
1088448
+ },
1088449
+ title: {
1088450
+ oneOf: [
1088451
+ {
1088452
+ type: "string"
1088453
+ },
1088454
+ {
1088455
+ type: "null"
1088456
+ }
1088457
+ ]
1088458
+ },
1088459
+ slug: {
1088460
+ oneOf: [
1088461
+ {
1088462
+ type: "string"
1088463
+ },
1088464
+ {
1088465
+ type: "null"
1088466
+ }
1088467
+ ]
1088468
+ },
1088469
+ hidden: {
1088470
+ oneOf: [
1088471
+ {
1088472
+ type: "boolean"
1088473
+ },
1088474
+ {
1088475
+ type: "null"
1088476
+ }
1088477
+ ]
1088478
+ },
1088479
+ availability: {
1088480
+ oneOf: [
1088481
+ {
1088482
+ $ref: "#/definitions/docs.Availability"
1088483
+ },
1088484
+ {
1088485
+ type: "null"
1088486
+ }
1088487
+ ]
1088488
+ }
1088489
+ },
1088490
+ required: [
1088491
+ "operation"
1088492
+ ],
1088493
+ additionalProperties: false
1088494
+ },
1088384
1088495
  "docs.LinkConfiguration": {
1088385
1088496
  type: "object",
1088386
1088497
  properties: {
@@ -1088436,6 +1088547,9 @@ var definitions4 = {
1088436
1088547
  {
1088437
1088548
  $ref: "#/definitions/docs.ApiReferenceEndpointConfiguration"
1088438
1088549
  },
1088550
+ {
1088551
+ $ref: "#/definitions/docs.ApiReferenceOperationConfiguration"
1088552
+ },
1088439
1088553
  {
1088440
1088554
  $ref: "#/definitions/docs.PageConfiguration"
1088441
1088555
  },
@@ -1134565,7 +1134679,8 @@ ${escapedDescription}`;
1134565
1134679
  package: (pkg2) => this.#convertPackage(pkg2, parentSlug, parentAvailability),
1134566
1134680
  section: (section) => this.#convertSection(section, parentSlug, parentAvailability),
1134567
1134681
  item: ({ value: unknownIdentifier }) => this.#convertUnknownIdentifier(unknownIdentifier, apiDefinitionPackageId, parentSlug, parentAvailability),
1134568
- endpoint: (endpoint3) => this.#convertEndpoint(endpoint3, apiDefinitionPackageId, parentSlug, parentAvailability)
1134682
+ endpoint: (endpoint3) => this.#convertEndpoint(endpoint3, apiDefinitionPackageId, parentSlug, parentAvailability),
1134683
+ operation: (operation) => this.#convertOperation(operation, apiDefinitionPackageId, parentSlug, parentAvailability)
1134569
1134684
  })).filter(isNonNullish2);
1134570
1134685
  }
1134571
1134686
  #toPageNode(page, parentSlug, parentAvailability) {
@@ -1134866,6 +1134981,88 @@ ${escapedDescription}`;
1134866
1134981
  this.taskContext.logger.error("Unknown identifier in the API Reference layout: ", endpointItem.endpoint);
1134867
1134982
  return;
1134868
1134983
  }
1134984
+ #convertOperation(operationItem, apiDefinitionPackageIdRaw, parentSlug, parentAvailability) {
1134985
+ const operationParts = operationItem.operation.trim().split(/\s+/, 2);
1134986
+ if (operationParts.length !== 2) {
1134987
+ this.taskContext.logger.error(`Invalid operation format in the API Reference layout: ${operationItem.operation}. Expected format: "OPERATION_TYPE operationName" (e.g., "QUERY account")`);
1134988
+ return;
1134989
+ }
1134990
+ const [operationType, operationName] = operationParts;
1134991
+ if (!operationName) {
1134992
+ this.taskContext.logger.error(`Invalid operation format in the API Reference layout: ${operationItem.operation}. Expected format: "OPERATION_TYPE operationName" (e.g., "QUERY account")`);
1134993
+ return;
1134994
+ }
1134995
+ const allOperations = this.#holder.api.rootPackage.graphqlOperations ?? [];
1134996
+ const matchingOperations = allOperations.filter((op5) => {
1134997
+ if (op5.operationType !== operationType) {
1134998
+ return false;
1134999
+ }
1135000
+ if (operationName.includes(".")) {
1135001
+ if (op5.id === operationName) {
1135002
+ return true;
1135003
+ }
1135004
+ if (op5.name === operationName) {
1135005
+ return true;
1135006
+ }
1135007
+ const namespacedParts = operationName.split(".");
1135008
+ const opName = namespacedParts[namespacedParts.length - 1];
1135009
+ const namespace = namespacedParts.slice(0, -1).join(".");
1135010
+ if (op5.name === opName || op5.id === opName) {
1135011
+ return op5.id.startsWith(namespace + ".") || this.#graphqlNamespacesByOperationId.get(FdrAPI_exports.GraphQlOperationId(op5.id)) === namespace;
1135012
+ }
1135013
+ } else {
1135014
+ return op5.name === operationName || op5.id === operationName;
1135015
+ }
1135016
+ return false;
1135017
+ });
1135018
+ if (!operationName.includes(".")) {
1135019
+ const sameNameOperations = allOperations.filter((op5) => op5.operationType === operationType && (op5.name === operationName || op5.id === operationName));
1135020
+ if (sameNameOperations.length > 1) {
1135021
+ const suggestions = sameNameOperations.map((op5) => {
1135022
+ const namespace = this.#graphqlNamespacesByOperationId.get(FdrAPI_exports.GraphQlOperationId(op5.id));
1135023
+ if (namespace) {
1135024
+ return `"${operationType} ${namespace}.${operationName}"`;
1135025
+ }
1135026
+ const idParts = op5.id.split("_");
1135027
+ if (idParts.length >= 3) {
1135028
+ const extractedNamespace = idParts[0];
1135029
+ return `"${operationType} ${extractedNamespace}.${operationName}"`;
1135030
+ }
1135031
+ return `"${operationType} ${op5.id}"`;
1135032
+ }).join(", ");
1135033
+ this.taskContext.logger.warn(`Ambiguous operation reference: "${operationItem.operation}". Found ${sameNameOperations.length} operations with name "${operationName}". Using first match: "${suggestions.split(", ")[0]}". Please use the full namespaced format for clarity. Available options: ${suggestions}`);
1135034
+ }
1135035
+ }
1135036
+ const graphqlOperation = matchingOperations[0];
1135037
+ if (graphqlOperation == null) {
1135038
+ this.taskContext.logger.error(`GraphQL operation not found in the API Reference layout: ${operationItem.operation}`);
1135039
+ return;
1135040
+ }
1135041
+ const operationId = APIV1Read_exports.GraphQlOperationId(graphqlOperation.id);
1135042
+ if (this.#visitedGraphqlOperations.has(operationId)) {
1135043
+ this.taskContext.logger.error(`Duplicate GraphQL operation found in the API Reference layout: ${operationId}`);
1135044
+ return;
1135045
+ }
1135046
+ this.#visitedGraphqlOperations.add(operationId);
1135047
+ const operationSlug = operationItem.slug != null ? parentSlug.append(operationItem.slug) : parentSlug.append(graphqlOperation.name ?? graphqlOperation.id);
1135048
+ return {
1135049
+ id: this.#idgen.get(`${this.apiDefinitionId}:${operationId}`),
1135050
+ type: "graphql",
1135051
+ operationType: graphqlOperation.operationType,
1135052
+ graphqlOperationId: APIV1Read_exports.GraphQlOperationId(graphqlOperation.id),
1135053
+ apiDefinitionId: this.apiDefinitionId,
1135054
+ availability: operationItem.availability ?? parentAvailability,
1135055
+ title: operationItem.title ?? graphqlOperation.displayName ?? graphqlOperation.name ?? graphqlOperation.id,
1135056
+ slug: operationSlug.get(),
1135057
+ icon: void 0,
1135058
+ hidden: this.hideChildren || operationItem.hidden,
1135059
+ playground: void 0,
1135060
+ authed: void 0,
1135061
+ viewers: operationItem.viewers,
1135062
+ orphaned: operationItem.orphaned,
1135063
+ featureFlags: operationItem.featureFlags
1135064
+ };
1135065
+ }
1134869
1135066
  // Step 2
1134870
1135067
  #mergeAndFilterChildren(left3, right3) {
1134871
1135068
  return mergeAndFilterChildren({
@@ -1180360,7 +1180557,7 @@ var CliContext = class {
1180360
1180557
  if (false) {
1180361
1180558
  this.logger.error("CLI_VERSION is not defined");
1180362
1180559
  }
1180363
- return "3.70.2";
1180560
+ return "3.71.0";
1180364
1180561
  }
1180365
1180562
  getCliName() {
1180366
1180563
  if (false) {
@@ -1183480,7 +1183677,7 @@ var import_path58 = __toESM(require("path"), 1);
1183480
1183677
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1183481
1183678
  var LOGS_FOLDER_NAME = "logs";
1183482
1183679
  function getCliSource() {
1183483
- const version7 = "3.70.2";
1183680
+ const version7 = "3.71.0";
1183484
1183681
  return `cli@${version7}`;
1183485
1183682
  }
1183486
1183683
  var DebugLogger = class {
@@ -1186260,6 +1186457,88 @@ var definitions5 = {
1186260
1186457
  ],
1186261
1186458
  additionalProperties: false
1186262
1186459
  },
1186460
+ "docs.ApiReferenceOperationConfiguration": {
1186461
+ type: "object",
1186462
+ properties: {
1186463
+ viewers: {
1186464
+ oneOf: [
1186465
+ {
1186466
+ $ref: "#/definitions/docs.Role"
1186467
+ },
1186468
+ {
1186469
+ type: "null"
1186470
+ }
1186471
+ ]
1186472
+ },
1186473
+ orphaned: {
1186474
+ oneOf: [
1186475
+ {
1186476
+ type: "boolean"
1186477
+ },
1186478
+ {
1186479
+ type: "null"
1186480
+ }
1186481
+ ]
1186482
+ },
1186483
+ "feature-flag": {
1186484
+ oneOf: [
1186485
+ {
1186486
+ $ref: "#/definitions/docs.FeatureFlagConfiguration"
1186487
+ },
1186488
+ {
1186489
+ type: "null"
1186490
+ }
1186491
+ ]
1186492
+ },
1186493
+ operation: {
1186494
+ type: "string"
1186495
+ },
1186496
+ title: {
1186497
+ oneOf: [
1186498
+ {
1186499
+ type: "string"
1186500
+ },
1186501
+ {
1186502
+ type: "null"
1186503
+ }
1186504
+ ]
1186505
+ },
1186506
+ slug: {
1186507
+ oneOf: [
1186508
+ {
1186509
+ type: "string"
1186510
+ },
1186511
+ {
1186512
+ type: "null"
1186513
+ }
1186514
+ ]
1186515
+ },
1186516
+ hidden: {
1186517
+ oneOf: [
1186518
+ {
1186519
+ type: "boolean"
1186520
+ },
1186521
+ {
1186522
+ type: "null"
1186523
+ }
1186524
+ ]
1186525
+ },
1186526
+ availability: {
1186527
+ oneOf: [
1186528
+ {
1186529
+ $ref: "#/definitions/docs.Availability"
1186530
+ },
1186531
+ {
1186532
+ type: "null"
1186533
+ }
1186534
+ ]
1186535
+ }
1186536
+ },
1186537
+ required: [
1186538
+ "operation"
1186539
+ ],
1186540
+ additionalProperties: false
1186541
+ },
1186263
1186542
  "docs.LinkConfiguration": {
1186264
1186543
  type: "object",
1186265
1186544
  properties: {
@@ -1186315,6 +1186594,9 @@ var definitions5 = {
1186315
1186594
  {
1186316
1186595
  $ref: "#/definitions/docs.ApiReferenceEndpointConfiguration"
1186317
1186596
  },
1186597
+ {
1186598
+ $ref: "#/definitions/docs.ApiReferenceOperationConfiguration"
1186599
+ },
1186318
1186600
  {
1186319
1186601
  $ref: "#/definitions/docs.PageConfiguration"
1186320
1186602
  },
@@ -1188182,6 +1188464,88 @@ var definitions6 = {
1188182
1188464
  ],
1188183
1188465
  additionalProperties: false
1188184
1188466
  },
1188467
+ "docs.ApiReferenceOperationConfiguration": {
1188468
+ type: "object",
1188469
+ properties: {
1188470
+ viewers: {
1188471
+ oneOf: [
1188472
+ {
1188473
+ $ref: "#/definitions/docs.Role"
1188474
+ },
1188475
+ {
1188476
+ type: "null"
1188477
+ }
1188478
+ ]
1188479
+ },
1188480
+ orphaned: {
1188481
+ oneOf: [
1188482
+ {
1188483
+ type: "boolean"
1188484
+ },
1188485
+ {
1188486
+ type: "null"
1188487
+ }
1188488
+ ]
1188489
+ },
1188490
+ "feature-flag": {
1188491
+ oneOf: [
1188492
+ {
1188493
+ $ref: "#/definitions/docs.FeatureFlagConfiguration"
1188494
+ },
1188495
+ {
1188496
+ type: "null"
1188497
+ }
1188498
+ ]
1188499
+ },
1188500
+ operation: {
1188501
+ type: "string"
1188502
+ },
1188503
+ title: {
1188504
+ oneOf: [
1188505
+ {
1188506
+ type: "string"
1188507
+ },
1188508
+ {
1188509
+ type: "null"
1188510
+ }
1188511
+ ]
1188512
+ },
1188513
+ slug: {
1188514
+ oneOf: [
1188515
+ {
1188516
+ type: "string"
1188517
+ },
1188518
+ {
1188519
+ type: "null"
1188520
+ }
1188521
+ ]
1188522
+ },
1188523
+ hidden: {
1188524
+ oneOf: [
1188525
+ {
1188526
+ type: "boolean"
1188527
+ },
1188528
+ {
1188529
+ type: "null"
1188530
+ }
1188531
+ ]
1188532
+ },
1188533
+ availability: {
1188534
+ oneOf: [
1188535
+ {
1188536
+ $ref: "#/definitions/docs.Availability"
1188537
+ },
1188538
+ {
1188539
+ type: "null"
1188540
+ }
1188541
+ ]
1188542
+ }
1188543
+ },
1188544
+ required: [
1188545
+ "operation"
1188546
+ ],
1188547
+ additionalProperties: false
1188548
+ },
1188185
1188549
  "docs.LinkConfiguration": {
1188186
1188550
  type: "object",
1188187
1188551
  properties: {
@@ -1188237,6 +1188601,9 @@ var definitions6 = {
1188237
1188601
  {
1188238
1188602
  $ref: "#/definitions/docs.ApiReferenceEndpointConfiguration"
1188239
1188603
  },
1188604
+ {
1188605
+ $ref: "#/definitions/docs.ApiReferenceOperationConfiguration"
1188606
+ },
1188240
1188607
  {
1188241
1188608
  $ref: "#/definitions/docs.PageConfiguration"
1188242
1188609
  },
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.70.2",
2
+ "version": "3.71.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",