@fern-api/fern-api-dev 4.108.0-3-g5b83e6bc23f → 4.108.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 +45 -161
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -614192,7 +614192,6 @@ __export(schemas_exports13, {
614192
614192
  GitOutputSchema: () => GitOutputSchema,
614193
614193
  GitSelfHostedOutputModeSchema: () => GitSelfHostedOutputModeSchema,
614194
614194
  GitSelfHostedOutputSchema: () => GitSelfHostedOutputSchema,
614195
- GraphQlSpecSchema: () => GraphQlSpecSchema2,
614196
614195
  HeaderConfigSchema: () => HeaderConfigSchema,
614197
614196
  HeaderSchema: () => HeaderSchema2,
614198
614197
  IntegrationsConfigSchema: () => IntegrationsConfigSchema2,
@@ -614392,18 +614391,6 @@ var FernSpecSchema = external_exports.object({
614392
614391
  settings: FernSettingsSchema.optional()
614393
614392
  });
614394
614393
 
614395
- // ../config/lib/schemas/specs/GraphQlSpecSchema.js
614396
- var GraphQlSpecSchema2 = external_exports.object({
614397
- /** Path to the GraphQL schema file. */
614398
- graphql: external_exports.string(),
614399
- /** URL origin for the GraphQL endpoint. */
614400
- origin: external_exports.string().optional(),
614401
- /** Path to overrides file for the GraphQL spec. */
614402
- overrides: external_exports.union([external_exports.string(), external_exports.array(external_exports.string()).nonempty()]).optional(),
614403
- /** Name used to group this GraphQL spec in the docs (rendered as a top-level section). */
614404
- name: external_exports.string().optional()
614405
- });
614406
-
614407
614394
  // ../config/lib/schemas/settings/DefaultIntegerFormatSchema.js
614408
614395
  var DefaultIntegerFormatSchema = external_exports.enum(["int32", "int64", "uint32", "uint64"]);
614409
614396
 
@@ -614553,8 +614540,7 @@ var ApiSpecSchema = external_exports.union([
614553
614540
  ProtobufSpecSchema2,
614554
614541
  FernSpecSchema,
614555
614542
  ConjureSpecSchema,
614556
- OpenRpcSpecSchema2,
614557
- GraphQlSpecSchema2
614543
+ OpenRpcSpecSchema2
614558
614544
  ]);
614559
614545
 
614560
614546
  // ../config/lib/schemas/AuthSchemesSchema.js
@@ -621386,7 +621372,7 @@ var AccessTokenPosthogManager = class {
621386
621372
  properties: {
621387
621373
  ...event,
621388
621374
  ...event.properties,
621389
- version: "4.108.0-3-g5b83e6bc23f",
621375
+ version: "4.108.0",
621390
621376
  usingAccessToken: true
621391
621377
  }
621392
621378
  });
@@ -621440,7 +621426,7 @@ var UserPosthogManager = class {
621440
621426
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
621441
621427
  event: "CLI",
621442
621428
  properties: {
621443
- version: "4.108.0-3-g5b83e6bc23f",
621429
+ version: "4.108.0",
621444
621430
  ...event,
621445
621431
  ...event.properties,
621446
621432
  usingAccessToken: false,
@@ -625266,13 +625252,6 @@ var ApiDefinitionConverter = class {
625266
625252
  sourced
625267
625253
  });
625268
625254
  }
625269
- if ("graphql" in spec && "graphql" in sourced) {
625270
- return await this.convertGraphQlSpec({
625271
- absoluteFernYmlPath,
625272
- spec,
625273
- sourced
625274
- });
625275
- }
625276
625255
  throw new CliError({
625277
625256
  message: `Unknown spec type: ${JSON.stringify(spec)}`,
625278
625257
  code: CliError.Code.InternalError
@@ -625382,25 +625361,6 @@ var ApiDefinitionConverter = class {
625382
625361
  }
625383
625362
  return result;
625384
625363
  }
625385
- async convertGraphQlSpec({ absoluteFernYmlPath, spec, sourced }) {
625386
- const result = {
625387
- graphql: await this.resolvePath({ absoluteFernYmlPath, path: spec.graphql, sourced: sourced.graphql })
625388
- };
625389
- if (spec.origin != null) {
625390
- result.origin = spec.origin;
625391
- }
625392
- if (spec.overrides != null && !isNullish2(sourced.overrides)) {
625393
- result.overrides = await this.resolvePathOrPaths({
625394
- absoluteFernYmlPath,
625395
- paths: spec.overrides,
625396
- sourced: sourced.overrides
625397
- });
625398
- }
625399
- if (spec.name != null) {
625400
- result.name = spec.name;
625401
- }
625402
- return result;
625403
- }
625404
625364
  async convertOpenRpcSpec({ absoluteFernYmlPath, spec, sourced }) {
625405
625365
  const result = {
625406
625366
  openrpc: await this.resolvePath({ absoluteFernYmlPath, path: spec.openrpc, sourced: sourced.openrpc })
@@ -626679,11 +626639,6 @@ var TaskContextAdapter = class {
626679
626639
  // ../cli-v2/lib/api/adapter/LegacyApiSpecAdapter.js
626680
626640
  init_lib6();
626681
626641
 
626682
- // ../cli-v2/lib/api/config/GraphQlSpec.js
626683
- function isGraphQlSpec(spec) {
626684
- return "graphql" in spec;
626685
- }
626686
-
626687
626642
  // ../cli-v2/lib/api/config/OpenRpcSpec.js
626688
626643
  function isOpenRpcSpec(spec) {
626689
626644
  return "openrpc" in spec;
@@ -626695,24 +626650,6 @@ function isProtobufSpec(spec) {
626695
626650
  }
626696
626651
 
626697
626652
  // ../cli-v2/lib/api/adapter/LegacyApiSpecAdapter.js
626698
- function partitionV1Specs(v1Specs) {
626699
- const filteredSpecs = v1Specs.filter((spec) => {
626700
- if (spec.type === "openrpc" || spec.type === "graphql") {
626701
- return false;
626702
- }
626703
- if (spec.type === "protobuf" && !spec.fromOpenAPI) {
626704
- return false;
626705
- }
626706
- return true;
626707
- });
626708
- const allSpecs = v1Specs.filter((spec) => {
626709
- if (spec.type === "protobuf" && spec.fromOpenAPI) {
626710
- return false;
626711
- }
626712
- return true;
626713
- });
626714
- return { filteredSpecs, allSpecs };
626715
- }
626716
626653
  var LegacyApiSpecAdapter = class {
626717
626654
  context;
626718
626655
  constructor(config5) {
@@ -626731,9 +626668,6 @@ var LegacyApiSpecAdapter = class {
626731
626668
  if (isOpenRpcSpec(spec)) {
626732
626669
  return this.adaptOpenRpcSpec(spec);
626733
626670
  }
626734
- if (isGraphQlSpec(spec)) {
626735
- return this.adaptGraphQlSpec(spec);
626736
- }
626737
626671
  throw new CliError({
626738
626672
  message: `Unsupported spec type: ${JSON.stringify(spec)}`,
626739
626673
  code: CliError.Code.InternalError
@@ -626792,14 +626726,6 @@ var LegacyApiSpecAdapter = class {
626792
626726
  namespace: void 0
626793
626727
  };
626794
626728
  }
626795
- adaptGraphQlSpec(spec) {
626796
- return {
626797
- type: "graphql",
626798
- absoluteFilepath: spec.graphql,
626799
- absoluteFilepathToOverrides: spec.overrides,
626800
- namespace: spec.name
626801
- };
626802
- }
626803
626729
  adaptOpenApiSettings(settings) {
626804
626730
  if (settings == null) {
626805
626731
  return void 0;
@@ -627012,10 +626938,21 @@ var ApiDefinitionValidator = class {
627012
626938
  }
627013
626939
  const specAdapter = new LegacyApiSpecAdapter({ context: this.context });
627014
626940
  const v1Specs = specAdapter.convertAll(ossSpecs);
627015
- const { filteredSpecs, allSpecs } = partitionV1Specs(v1Specs);
627016
- if (filteredSpecs.length === 0) {
627017
- return violations;
627018
- }
626941
+ const filteredSpecs = v1Specs.filter((spec) => {
626942
+ if (spec.type === "openrpc") {
626943
+ return false;
626944
+ }
626945
+ if (spec.type === "protobuf" && !spec.fromOpenAPI) {
626946
+ return false;
626947
+ }
626948
+ return true;
626949
+ });
626950
+ const allSpecs = v1Specs.filter((spec) => {
626951
+ if (spec.type === "protobuf" && spec.fromOpenAPI) {
626952
+ return false;
626953
+ }
626954
+ return true;
626955
+ });
627019
626956
  const ossWorkspace = new OSSWorkspace({
627020
626957
  specs: filteredSpecs,
627021
626958
  allSpecs,
@@ -753841,9 +753778,22 @@ var LegacyOSSWorkspaceAdapter = class {
753841
753778
  return void 0;
753842
753779
  }
753843
753780
  const v1Specs = this.specAdapter.convertAll(ossSpecs);
753844
- const { filteredSpecs, allSpecs } = partitionV1Specs(v1Specs);
753845
- const hasGraphQlSpec = allSpecs.some((spec) => spec.type === "graphql");
753846
- if (filteredSpecs.length === 0 && !hasGraphQlSpec) {
753781
+ const filteredSpecs = v1Specs.filter((spec) => {
753782
+ if (spec.type === "openrpc") {
753783
+ return false;
753784
+ }
753785
+ if (spec.type === "protobuf" && !spec.fromOpenAPI) {
753786
+ return false;
753787
+ }
753788
+ return true;
753789
+ });
753790
+ const allSpecs = v1Specs.filter((spec) => {
753791
+ if (spec.type === "protobuf" && spec.fromOpenAPI) {
753792
+ return false;
753793
+ }
753794
+ return true;
753795
+ });
753796
+ if (filteredSpecs.length === 0) {
753847
753797
  return void 0;
753848
753798
  }
753849
753799
  return new OSSWorkspace({
@@ -829207,8 +829157,8 @@ var LegacyProjectAdapter = class {
829207
829157
  this.context = context3;
829208
829158
  this.ossAdapter = new LegacyOSSWorkspaceAdapter({ context: context3 });
829209
829159
  }
829210
- async adapt(workspace) {
829211
- const apiWorkspaces = await this.buildApiWorkspaces(workspace);
829160
+ adapt(workspace) {
829161
+ const apiWorkspaces = this.buildApiWorkspaces(workspace);
829212
829162
  const docsWorkspace = workspace.docs != null ? this.docsAdapter.adapt({
829213
829163
  docsConfig: workspace.docs,
829214
829164
  absoluteFilePath: workspace.docs.absoluteFilePath ?? workspace.absoluteFilePath ?? this.context.cwd
@@ -829236,9 +829186,8 @@ var LegacyProjectAdapter = class {
829236
829186
  /**
829237
829187
  * Bridges API definitions to legacy AbstractAPIWorkspace instances.
829238
829188
  */
829239
- async buildApiWorkspaces(workspace) {
829189
+ buildApiWorkspaces(workspace) {
829240
829190
  const workspaces = [];
829241
- const taskContext = new TaskContextAdapter({ context: this.context });
829242
829191
  for (const [apiName, apiDef] of Object.entries(workspace.apis)) {
829243
829192
  const ossWorkspace = this.ossAdapter.build({
829244
829193
  definition: apiDef,
@@ -829247,7 +829196,6 @@ var LegacyProjectAdapter = class {
829247
829196
  absoluteFilePath: this.context.cwd
829248
829197
  });
829249
829198
  if (ossWorkspace != null) {
829250
- await ossWorkspace.processGraphQLSpecs(taskContext);
829251
829199
  workspaces.push(ossWorkspace);
829252
829200
  }
829253
829201
  }
@@ -829310,7 +829258,7 @@ var DocsChecker = class {
829310
829258
  };
829311
829259
  }
829312
829260
  const adapter2 = new LegacyProjectAdapter({ context: this.context });
829313
- const project = await adapter2.adapt(workspace);
829261
+ const project = adapter2.adapt(workspace);
829314
829262
  const docsWorkspace = project.docsWorkspaces;
829315
829263
  if (docsWorkspace == null) {
829316
829264
  throw new CliError({
@@ -829417,7 +829365,6 @@ var SdkChecker = class {
829417
829365
  this.validateTargetApiReferences({ workspace, sdks: sdks2, violations });
829418
829366
  this.validateDefaultGroup({ sdks: sdks2, fernYmlRelativePath, violations });
829419
829367
  this.validateEmptyVersions({ sdks: sdks2, violations });
829420
- this.validateGraphQlSpecs({ workspace, sdks: sdks2, violations });
829421
829368
  await this.validateVersions({ sdks: sdks2, violations });
829422
829369
  return {
829423
829370
  violations,
@@ -829499,31 +829446,6 @@ var SdkChecker = class {
829499
829446
  }
829500
829447
  }
829501
829448
  }
829502
- /**
829503
- * Emits a warning for any target whose referenced API contains a GraphQL spec.
829504
- * GraphQL SDKs are not supported; the graphql specs will be skipped during generation.
829505
- */
829506
- validateGraphQlSpecs({ workspace, sdks: sdks2, violations }) {
829507
- for (const target of sdks2.targets) {
829508
- const api2 = workspace.apis[target.api];
829509
- if (api2 == null) {
829510
- continue;
829511
- }
829512
- const hasGraphQl = api2.specs.some(isGraphQlSpec);
829513
- if (!hasGraphQl) {
829514
- continue;
829515
- }
829516
- violations.push({
829517
- severity: "warning",
829518
- relativeFilepath: target.sourceLocation.relativeFilePath,
829519
- nodePath: ["sdks", "targets", target.name, "api"],
829520
- message: `API '${target.api}' contains a GraphQL spec. GraphQL SDKs are not supported and graphql specs will be skipped for this target.`,
829521
- displayRelativeFilepath: target.sourceLocation.relativeFilePath,
829522
- line: target.sourceLocation.line,
829523
- column: target.sourceLocation.column
829524
- });
829525
- }
829526
- }
829527
829449
  /**
829528
829450
  * Checks that pinned versions exist in the registry.
829529
829451
  */
@@ -829929,13 +829851,6 @@ function adjustSpecPaths(specs, apiName) {
829929
829851
  overrides: spec.overrides != null ? adjustPathOrPaths(spec.overrides, apiName) : void 0
829930
829852
  };
829931
829853
  }
829932
- if ("graphql" in spec) {
829933
- return {
829934
- ...spec,
829935
- graphql: adjustPath(spec.graphql, apiName),
829936
- overrides: spec.overrides != null ? adjustPathOrPaths(spec.overrides, apiName) : void 0
829937
- };
829938
- }
829939
829854
  if ("proto" in spec) {
829940
829855
  return {
829941
829856
  ...spec,
@@ -830086,22 +830001,6 @@ function convertSpec(spec, warnings) {
830086
830001
  }
830087
830002
  return result;
830088
830003
  }
830089
- if ("graphql" in spec) {
830090
- const graphqlSpec = spec;
830091
- const result = {
830092
- graphql: graphqlSpec.graphql
830093
- };
830094
- if (graphqlSpec.origin != null) {
830095
- result.origin = graphqlSpec.origin;
830096
- }
830097
- if (graphqlSpec.overrides != null) {
830098
- result.overrides = graphqlSpec.overrides;
830099
- }
830100
- if (graphqlSpec.name != null) {
830101
- result.name = graphqlSpec.name;
830102
- }
830103
- return result;
830104
- }
830105
830004
  warnings.push({
830106
830005
  type: "unsupported",
830107
830006
  message: `Unknown spec type: ${JSON.stringify(Object.keys(spec))}`
@@ -830117,8 +830016,6 @@ function convertNamespacedSpecs(config5, warnings) {
830117
830016
  specs.push({ ...spec, namespace });
830118
830017
  } else if ("asyncapi" in spec) {
830119
830018
  specs.push({ ...spec, namespace });
830120
- } else if ("graphql" in spec) {
830121
- specs.push({ ...spec, name: spec.name ?? namespace });
830122
830019
  } else if ("fern" in spec) {
830123
830020
  warnings.push({
830124
830021
  type: "info",
@@ -833175,7 +833072,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
833175
833072
  var LOGS_FOLDER_NAME = "logs";
833176
833073
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
833177
833074
  function getCliSource() {
833178
- const version7 = "4.108.0-3-g5b83e6bc23f";
833075
+ const version7 = "4.108.0";
833179
833076
  return `cli@${version7}`;
833180
833077
  }
833181
833078
  var DebugLogger = class {
@@ -835674,7 +835571,7 @@ var LegacyDevServer = class {
835674
835571
  */
835675
835572
  async start({ port, backendPort, forceDownload, bundlePath, logLevel }) {
835676
835573
  const workspace = await this.context.loadWorkspaceOrThrow();
835677
- const initialProject = await this.adapter.adapt(workspace);
835574
+ const initialProject = this.adapter.adapt(workspace);
835678
835575
  const taskContext = new TaskContextAdapter({ context: this.context, logLevel });
835679
835576
  this.context.stderr.info("Bootstrapping docs preview (this may take a few seconds)...");
835680
835577
  await runAppPreviewServer({
@@ -845593,7 +845490,7 @@ var LegacyDocsPublisher = class {
845593
845490
  previewId,
845594
845491
  disableTemplates: void 0,
845595
845492
  skipUpload,
845596
- cliVersion: "4.108.0-3-g5b83e6bc23f",
845493
+ cliVersion: "4.108.0",
845597
845494
  loginCommand: "fern auth login"
845598
845495
  });
845599
845496
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -846237,7 +846134,7 @@ var PublishCommand = class {
846237
846134
  }
846238
846135
  }
846239
846136
  const adapter2 = new LegacyProjectAdapter({ context: context3 });
846240
- const project = await adapter2.adapt(workspace);
846137
+ const project = adapter2.adapt(workspace);
846241
846138
  const docsWorkspace = project.docsWorkspaces;
846242
846139
  if (docsWorkspace == null) {
846243
846140
  throw new CliError({
@@ -848876,12 +848773,8 @@ var import_path67 = __toESM(require("path"), 1);
848876
848773
  // ../cli-v2/lib/api/resolver/ApiSpecDetector.js
848877
848774
  init_js_yaml();
848878
848775
  var DETECTABLE_SPEC_TYPES = ["openapi", "asyncapi"];
848879
- var GRAPHQL_EXTENSIONS = [".graphql", ".graphqls", ".gql"];
848880
848776
  var ApiSpecDetector = class {
848881
848777
  async detect({ absoluteFilePath, reference: reference4, content: content5 }) {
848882
- if (this.hasGraphQlExtension(absoluteFilePath) || this.hasGraphQlExtension(reference4)) {
848883
- return "graphql";
848884
- }
848885
848778
  const parsed = this.parseOrThrow({ content: content5, reference: reference4 });
848886
848779
  if (typeof parsed !== "object" || parsed == null) {
848887
848780
  throw new CliError({
@@ -848899,10 +848792,6 @@ var ApiSpecDetector = class {
848899
848792
  code: CliError.Code.InternalError
848900
848793
  });
848901
848794
  }
848902
- hasGraphQlExtension(path105) {
848903
- const lower = path105.toLowerCase();
848904
- return GRAPHQL_EXTENSIONS.some((ext2) => lower.endsWith(ext2));
848905
- }
848906
848795
  parseOrThrow({ content: content5, reference: reference4 }) {
848907
848796
  try {
848908
848797
  return jsYaml.load(content5);
@@ -848980,10 +848869,7 @@ var ApiSpecResolver = class {
848980
848869
  return { content: content5, contentType };
848981
848870
  }
848982
848871
  inferExtension({ url: url3, contentType }) {
848983
- const urlPath = new URL(url3).pathname.toLowerCase();
848984
- if (urlPath.endsWith(".graphql") || urlPath.endsWith(".graphqls") || urlPath.endsWith(".gql")) {
848985
- return ".graphql";
848986
- }
848872
+ const urlPath = new URL(url3).pathname;
848987
848873
  if (urlPath.endsWith(".json")) {
848988
848874
  return ".json";
848989
848875
  }
@@ -849001,11 +848887,9 @@ var ApiSpecResolver = class {
849001
848887
  return { openapi: absoluteFilePath, origin: origin2 };
849002
848888
  case "asyncapi":
849003
848889
  return { asyncapi: absoluteFilePath, origin: origin2 };
849004
- case "graphql":
849005
- return { graphql: absoluteFilePath, origin: origin2 };
849006
848890
  default:
849007
848891
  throw new CliError({
849008
- message: `Unsupported spec type for flags mode: "${specType}". Supported: openapi, asyncapi, graphql`,
848892
+ message: `Unsupported spec type for flags mode: "${specType}". Supported: openapi, asyncapi`,
849009
848893
  code: CliError.Code.ConfigError
849010
848894
  });
849011
848895
  }
@@ -919841,7 +919725,7 @@ var CliContext = class _CliContext {
919841
919725
  if (false) {
919842
919726
  this.logger.error("CLI_VERSION is not defined");
919843
919727
  }
919844
- return "4.108.0-3-g5b83e6bc23f";
919728
+ return "4.108.0";
919845
919729
  }
919846
919730
  getCliName() {
919847
919731
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.108.0-3-g5b83e6bc23f",
2
+ "version": "4.108.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",