fern-api 0.15.9 → 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 -81
  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.9",
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.9",
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.9" == null) {
743252
+ if ("0.15.10" == null) {
743253
743253
  this.logger.error("CLI_VERSION is not defined");
743254
743254
  }
743255
- return "0.15.9";
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
  });
@@ -745436,15 +745433,7 @@ function getOriginalTypeDeclarationForProperty({ typeName, wirePropertyKey, rawO
745436
745433
  var _a2;
745437
745434
  const rawPropertyType = (_a2 = rawObject.properties) == null ? void 0 : _a2[wirePropertyKey];
745438
745435
  if (rawPropertyType != null) {
745439
- const resolvedType = typeResolver.resolveTypeOrThrow({
745440
- type: typeof rawPropertyType === "string" ? rawPropertyType : rawPropertyType.type,
745441
- file
745442
- });
745443
- if (resolvedType._type === "named") {
745444
- return { typeName, rawPropertyType, file: resolvedType.file };
745445
- } else {
745446
- return { typeName, rawPropertyType, file };
745447
- }
745436
+ return { typeName, rawPropertyType, file };
745448
745437
  } else {
745449
745438
  return getOriginalTypeDeclarationForPropertyFromExtensions({
745450
745439
  wirePropertyKey,
@@ -747313,7 +747302,7 @@ var TypeResolverImpl = class {
747313
747302
  getDeclarationOfNamedTypeOrThrow({ referenceToNamedType, file }) {
747314
747303
  const declaration = this.getDeclarationOfNamedType({ referenceToNamedType, file });
747315
747304
  if (declaration == null) {
747316
- throw new Error("Cannot find declaration of type: " + referenceToNamedType);
747305
+ throw new Error("Cannot find declaration of type: " + referenceToNamedType + " in file " + file.relativeFilepath);
747317
747306
  }
747318
747307
  return declaration;
747319
747308
  }
@@ -756468,14 +756457,15 @@ var DOCKER_GENERATORS_DIRECTORY = import_path30.default.join(DOCKER_FERN_DIRECTO
756468
756457
 
756469
756458
  // pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/run-generator/getGeneratorConfig.js
756470
756459
  var import_generator_exec_sdk = __toESM(require_generator_exec_sdk());
756471
- 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 }) {
756472
756462
  const binds = [];
756473
756463
  const output = generatorInvocation.outputMode._visit({
756474
756464
  publish: () => {
756475
- return DUMMY_PUBLISH_OUTPUT_CONFIG;
756465
+ return newDummyPublishOutputConfig(outputVersion);
756476
756466
  },
756477
756467
  publishV2: () => {
756478
- return DUMMY_PUBLISH_OUTPUT_CONFIG;
756468
+ return newDummyPublishOutputConfig(outputVersion);
756479
756469
  },
756480
756470
  downloadFiles: () => {
756481
756471
  return {
@@ -756487,7 +756477,7 @@ function getGeneratorConfig({ generatorInvocation, customConfig, workspaceName,
756487
756477
  const outputConfig = {
756488
756478
  mode: import_generator_exec_sdk.FernGeneratorExec.OutputMode.github({
756489
756479
  repoUrl: `https://github.com/${value.owner}/${value.repo}`,
756490
- version: "0.0.1"
756480
+ version: outputVersion
756491
756481
  }),
756492
756482
  path: DOCKER_CODEGEN_OUTPUT_DIRECTORY
756493
756483
  };
@@ -756515,48 +756505,50 @@ function getGeneratorConfig({ generatorInvocation, customConfig, workspaceName,
756515
756505
  }
756516
756506
  };
756517
756507
  }
756518
- var DUMMY_PUBLISH_OUTPUT_CONFIG = {
756519
- mode: import_generator_exec_sdk.FernGeneratorExec.OutputMode.publish({
756520
- registries: {
756521
- maven: {
756522
- group: "",
756523
- password: "",
756524
- registryUrl: "",
756525
- 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
+ }
756526
756523
  },
756527
- npm: {
756528
- registryUrl: "",
756529
- scope: "",
756530
- token: ""
756531
- }
756532
- },
756533
- publishTarget: void 0,
756534
- registriesV2: {
756535
- maven: {
756536
- password: "",
756537
- registryUrl: "",
756538
- username: "",
756539
- coordinate: ""
756540
- },
756541
- npm: {
756542
- registryUrl: "",
756543
- token: "",
756544
- packageName: ""
756545
- },
756546
- pypi: {
756547
- packageName: "",
756548
- password: "",
756549
- registryUrl: "",
756550
- username: ""
756551
- }
756552
- },
756553
- version: "0.0.1"
756554
- }),
756555
- path: DOCKER_CODEGEN_OUTPUT_DIRECTORY
756556
- };
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
+ }
756557
756549
 
756558
756550
  // pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/run-generator/runGenerator.js
756559
- async function runGenerator({ workspaceName, organization, absolutePathToOutput, absolutePathToSnippet, absolutePathToIr, absolutePathToWriteConfigJson, keepDocker, generatorInvocation }) {
756551
+ async function runGenerator({ workspaceName, organization, outputVersion, absolutePathToOutput, absolutePathToSnippet, absolutePathToIr, absolutePathToWriteConfigJson, keepDocker, generatorInvocation }) {
756560
756552
  const { name: name2, version: version3, config: customConfig } = generatorInvocation;
756561
756553
  const imageName = `${name2}:${version3}`;
756562
756554
  const binds = [
@@ -756568,6 +756560,7 @@ async function runGenerator({ workspaceName, organization, absolutePathToOutput,
756568
756560
  generatorInvocation,
756569
756561
  customConfig,
756570
756562
  workspaceName,
756563
+ outputVersion,
756571
756564
  organization,
756572
756565
  absolutePathToSnippet
756573
756566
  });
@@ -756607,6 +756600,7 @@ async function runLocalGenerationForWorkspace({ organization, workspace, generat
756607
756600
  keepDocker,
756608
756601
  context: interactiveTaskContext,
756609
756602
  irVersionOverride: void 0,
756603
+ outputVersionOverride: void 0,
756610
756604
  writeSnippets: false
756611
756605
  });
756612
756606
  interactiveTaskContext.logger.info(source_default.green("Wrote files to " + generatorInvocation.absolutePathToLocalOutput));
@@ -756623,7 +756617,7 @@ async function getWorkspaceTempDir() {
756623
756617
  prefix: "fern"
756624
756618
  });
756625
756619
  }
756626
- 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 }) {
756627
756621
  const absolutePathToIr = await writeIrToFile({
756628
756622
  workspace,
756629
756623
  audiences,
@@ -756658,6 +756652,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, workspace, genera
756658
756652
  absolutePathToWriteConfigJson,
756659
756653
  workspaceName: workspace.name,
756660
756654
  organization,
756655
+ outputVersion: outputVersionOverride,
756661
756656
  keepDocker,
756662
756657
  generatorInvocation
756663
756658
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.15.9",
3
+ "version": "0.15.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",