fern-api 0.15.8 → 0.15.10

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 +76 -73
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -718941,7 +718941,7 @@ var AccessTokenPosthogManager = class {
718941
718941
  properties: {
718942
718942
  ...event,
718943
718943
  ...event.properties,
718944
- version: "0.15.8",
718944
+ version: "0.15.10",
718945
718945
  usingAccessToken: true
718946
718946
  }
718947
718947
  });
@@ -719003,7 +719003,7 @@ var UserPosthogManager = class {
719003
719003
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
719004
719004
  event: "CLI",
719005
719005
  properties: {
719006
- version: "0.15.8",
719006
+ version: "0.15.10",
719007
719007
  ...event,
719008
719008
  ...event.properties
719009
719009
  }
@@ -743249,10 +743249,10 @@ var CliContext = class {
743249
743249
  return "fern-api";
743250
743250
  }
743251
743251
  getPackageVersion() {
743252
- if ("0.15.8" == null) {
743252
+ if ("0.15.10" == null) {
743253
743253
  this.logger.error("CLI_VERSION is not defined");
743254
743254
  }
743255
- return "0.15.8";
743255
+ return "0.15.10";
743256
743256
  }
743257
743257
  getCliName() {
743258
743258
  if ("fern" == null) {
@@ -745291,7 +745291,7 @@ function convertTypeReferenceExample({ example, fileContainingExample, rawTypeBe
745291
745291
  },
745292
745292
  named: (named) => {
745293
745293
  const typeDeclaration = typeResolver.getDeclarationOfNamedTypeOrThrow({
745294
- referenceToNamedType: named,
745294
+ referenceToNamedType: rawTypeBeingExemplified,
745295
745295
  file: fileContainingRawTypeReference
745296
745296
  });
745297
745297
  const parsedReferenceToNamedType = fileContainingRawTypeReference.parseTypeReference(named);
@@ -745406,28 +745406,25 @@ function convertObject3({ typeName, rawObject, example, fileContainingType, file
745406
745406
  if (originalTypeDeclaration == null) {
745407
745407
  throw new Error("Could not find original type declaration for property: " + wireKey);
745408
745408
  }
745409
- try {
745410
- const valueExample = convertTypeReferenceExample({
745411
- example: propertyExample,
745412
- fileContainingExample,
745413
- rawTypeBeingExemplified: typeof originalTypeDeclaration.rawPropertyType === "string" ? originalTypeDeclaration.rawPropertyType : originalTypeDeclaration.rawPropertyType.type,
745414
- fileContainingRawTypeReference: originalTypeDeclaration.file,
745415
- typeResolver,
745416
- exampleResolver
745417
- });
745418
- exampleProperties.push({
745419
- name: fileContainingExample.casingsGenerator.generateNameAndWireValue({
745420
- name: getPropertyName({
745421
- propertyKey: wireKey,
745422
- property: originalTypeDeclaration.rawPropertyType
745423
- }).name,
745424
- wireValue: wireKey
745425
- }),
745426
- value: valueExample,
745427
- originalTypeDeclaration: originalTypeDeclaration.typeName
745428
- });
745429
- } catch (e) {
745430
- }
745409
+ const valueExample = convertTypeReferenceExample({
745410
+ example: propertyExample,
745411
+ fileContainingExample,
745412
+ rawTypeBeingExemplified: typeof originalTypeDeclaration.rawPropertyType === "string" ? originalTypeDeclaration.rawPropertyType : originalTypeDeclaration.rawPropertyType.type,
745413
+ fileContainingRawTypeReference: originalTypeDeclaration.file,
745414
+ typeResolver,
745415
+ exampleResolver
745416
+ });
745417
+ exampleProperties.push({
745418
+ name: fileContainingExample.casingsGenerator.generateNameAndWireValue({
745419
+ name: getPropertyName({
745420
+ propertyKey: wireKey,
745421
+ property: originalTypeDeclaration.rawPropertyType
745422
+ }).name,
745423
+ wireValue: wireKey
745424
+ }),
745425
+ value: valueExample,
745426
+ originalTypeDeclaration: originalTypeDeclaration.typeName
745427
+ });
745431
745428
  return exampleProperties;
745432
745429
  }, []) : []
745433
745430
  });
@@ -745752,7 +745749,7 @@ function convertExampleRequestBody({ endpoint, example, typeResolver, exampleRes
745752
745749
  rawTypeBeingExemplified: typeof originalTypeDeclaration.rawPropertyType === "string" ? originalTypeDeclaration.rawPropertyType : originalTypeDeclaration.rawPropertyType.type,
745753
745750
  typeResolver,
745754
745751
  exampleResolver,
745755
- fileContainingRawTypeReference: file,
745752
+ fileContainingRawTypeReference: originalTypeDeclaration.file,
745756
745753
  fileContainingExample: file
745757
745754
  }),
745758
745755
  originalTypeDeclaration: originalTypeDeclaration.typeName
@@ -747305,7 +747302,7 @@ var TypeResolverImpl = class {
747305
747302
  getDeclarationOfNamedTypeOrThrow({ referenceToNamedType, file }) {
747306
747303
  const declaration = this.getDeclarationOfNamedType({ referenceToNamedType, file });
747307
747304
  if (declaration == null) {
747308
- throw new Error("Cannot find declaration of type: " + referenceToNamedType);
747305
+ throw new Error("Cannot find declaration of type: " + referenceToNamedType + " in file " + file.relativeFilepath);
747309
747306
  }
747310
747307
  return declaration;
747311
747308
  }
@@ -756460,14 +756457,15 @@ var DOCKER_GENERATORS_DIRECTORY = import_path30.default.join(DOCKER_FERN_DIRECTO
756460
756457
 
756461
756458
  // pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/run-generator/getGeneratorConfig.js
756462
756459
  var import_generator_exec_sdk = __toESM(require_generator_exec_sdk());
756463
- function getGeneratorConfig({ generatorInvocation, customConfig, workspaceName, organization, absolutePathToSnippet }) {
756460
+ var DEFAULT_OUTPUT_VERSION = "0.0.1";
756461
+ function getGeneratorConfig({ generatorInvocation, customConfig, workspaceName, organization, outputVersion = DEFAULT_OUTPUT_VERSION, absolutePathToSnippet }) {
756464
756462
  const binds = [];
756465
756463
  const output = generatorInvocation.outputMode._visit({
756466
756464
  publish: () => {
756467
- return DUMMY_PUBLISH_OUTPUT_CONFIG;
756465
+ return newDummyPublishOutputConfig(outputVersion);
756468
756466
  },
756469
756467
  publishV2: () => {
756470
- return DUMMY_PUBLISH_OUTPUT_CONFIG;
756468
+ return newDummyPublishOutputConfig(outputVersion);
756471
756469
  },
756472
756470
  downloadFiles: () => {
756473
756471
  return {
@@ -756479,7 +756477,7 @@ function getGeneratorConfig({ generatorInvocation, customConfig, workspaceName,
756479
756477
  const outputConfig = {
756480
756478
  mode: import_generator_exec_sdk.FernGeneratorExec.OutputMode.github({
756481
756479
  repoUrl: `https://github.com/${value.owner}/${value.repo}`,
756482
- version: "0.0.1"
756480
+ version: outputVersion
756483
756481
  }),
756484
756482
  path: DOCKER_CODEGEN_OUTPUT_DIRECTORY
756485
756483
  };
@@ -756507,48 +756505,50 @@ function getGeneratorConfig({ generatorInvocation, customConfig, workspaceName,
756507
756505
  }
756508
756506
  };
756509
756507
  }
756510
- var DUMMY_PUBLISH_OUTPUT_CONFIG = {
756511
- mode: import_generator_exec_sdk.FernGeneratorExec.OutputMode.publish({
756512
- registries: {
756513
- maven: {
756514
- group: "",
756515
- password: "",
756516
- registryUrl: "",
756517
- username: ""
756508
+ function newDummyPublishOutputConfig(version3) {
756509
+ return {
756510
+ mode: import_generator_exec_sdk.FernGeneratorExec.OutputMode.publish({
756511
+ registries: {
756512
+ maven: {
756513
+ group: "",
756514
+ password: "",
756515
+ registryUrl: "",
756516
+ username: ""
756517
+ },
756518
+ npm: {
756519
+ registryUrl: "",
756520
+ scope: "",
756521
+ token: ""
756522
+ }
756518
756523
  },
756519
- npm: {
756520
- registryUrl: "",
756521
- scope: "",
756522
- token: ""
756523
- }
756524
- },
756525
- publishTarget: void 0,
756526
- registriesV2: {
756527
- maven: {
756528
- password: "",
756529
- registryUrl: "",
756530
- username: "",
756531
- coordinate: ""
756532
- },
756533
- npm: {
756534
- registryUrl: "",
756535
- token: "",
756536
- packageName: ""
756537
- },
756538
- pypi: {
756539
- packageName: "",
756540
- password: "",
756541
- registryUrl: "",
756542
- username: ""
756543
- }
756544
- },
756545
- version: "0.0.1"
756546
- }),
756547
- path: DOCKER_CODEGEN_OUTPUT_DIRECTORY
756548
- };
756524
+ publishTarget: void 0,
756525
+ registriesV2: {
756526
+ maven: {
756527
+ password: "",
756528
+ registryUrl: "",
756529
+ username: "",
756530
+ coordinate: ""
756531
+ },
756532
+ npm: {
756533
+ registryUrl: "",
756534
+ token: "",
756535
+ packageName: ""
756536
+ },
756537
+ pypi: {
756538
+ packageName: "",
756539
+ password: "",
756540
+ registryUrl: "",
756541
+ username: ""
756542
+ }
756543
+ },
756544
+ version: version3
756545
+ }),
756546
+ path: DOCKER_CODEGEN_OUTPUT_DIRECTORY
756547
+ };
756548
+ }
756549
756549
 
756550
756550
  // pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/run-generator/runGenerator.js
756551
- async function runGenerator({ workspaceName, organization, absolutePathToOutput, absolutePathToSnippet, absolutePathToIr, absolutePathToWriteConfigJson, keepDocker, generatorInvocation }) {
756551
+ async function runGenerator({ workspaceName, organization, outputVersion, absolutePathToOutput, absolutePathToSnippet, absolutePathToIr, absolutePathToWriteConfigJson, keepDocker, generatorInvocation }) {
756552
756552
  const { name: name2, version: version3, config: customConfig } = generatorInvocation;
756553
756553
  const imageName = `${name2}:${version3}`;
756554
756554
  const binds = [
@@ -756560,6 +756560,7 @@ async function runGenerator({ workspaceName, organization, absolutePathToOutput,
756560
756560
  generatorInvocation,
756561
756561
  customConfig,
756562
756562
  workspaceName,
756563
+ outputVersion,
756563
756564
  organization,
756564
756565
  absolutePathToSnippet
756565
756566
  });
@@ -756599,6 +756600,7 @@ async function runLocalGenerationForWorkspace({ organization, workspace, generat
756599
756600
  keepDocker,
756600
756601
  context: interactiveTaskContext,
756601
756602
  irVersionOverride: void 0,
756603
+ outputVersionOverride: void 0,
756602
756604
  writeSnippets: false
756603
756605
  });
756604
756606
  interactiveTaskContext.logger.info(source_default.green("Wrote files to " + generatorInvocation.absolutePathToLocalOutput));
@@ -756615,7 +756617,7 @@ async function getWorkspaceTempDir() {
756615
756617
  prefix: "fern"
756616
756618
  });
756617
756619
  }
756618
- async function writeFilesToDiskAndRunGenerator({ organization, workspace, generatorInvocation, absolutePathToLocalOutput, audiences, workspaceTempDir, keepDocker, context, irVersionOverride, writeSnippets }) {
756620
+ async function writeFilesToDiskAndRunGenerator({ organization, workspace, generatorInvocation, absolutePathToLocalOutput, audiences, workspaceTempDir, keepDocker, context, irVersionOverride, outputVersionOverride, writeSnippets }) {
756619
756621
  const absolutePathToIr = await writeIrToFile({
756620
756622
  workspace,
756621
756623
  audiences,
@@ -756650,6 +756652,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, workspace, genera
756650
756652
  absolutePathToWriteConfigJson,
756651
756653
  workspaceName: workspace.name,
756652
756654
  organization,
756655
+ outputVersion: outputVersionOverride,
756653
756656
  keepDocker,
756654
756657
  generatorInvocation
756655
756658
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.15.8",
3
+ "version": "0.15.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",