fern-api 0.37.8 → 0.37.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 +31 -12
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -1215398,7 +1215398,7 @@ var AccessTokenPosthogManager = class {
1215398
1215398
  properties: {
1215399
1215399
  ...event,
1215400
1215400
  ...event.properties,
1215401
- version: "0.37.8",
1215401
+ version: "0.37.10",
1215402
1215402
  usingAccessToken: true
1215403
1215403
  }
1215404
1215404
  });
@@ -1215460,7 +1215460,7 @@ var UserPosthogManager = class {
1215460
1215460
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1215461
1215461
  event: "CLI",
1215462
1215462
  properties: {
1215463
- version: "0.37.8",
1215463
+ version: "0.37.10",
1215464
1215464
  ...event,
1215465
1215465
  ...event.properties
1215466
1215466
  }
@@ -1244417,10 +1244417,10 @@ var CliContext = class {
1244417
1244417
  return "fern-api";
1244418
1244418
  }
1244419
1244419
  getPackageVersion() {
1244420
- if ("0.37.8" == null) {
1244420
+ if ("0.37.10" == null) {
1244421
1244421
  this.logger.error("CLI_VERSION is not defined");
1244422
1244422
  }
1244423
- return "0.37.8";
1244423
+ return "0.37.10";
1244424
1244424
  }
1244425
1244425
  getCliName() {
1244426
1244426
  if ("fern" == null) {
@@ -1249248,13 +1249248,18 @@ function getReferencedTypesFromRawDeclaration({ typeDeclaration, file, typeResol
1249248
1249248
  return types3;
1249249
1249249
  },
1249250
1249250
  discriminatedUnion: (unionDeclaration) => {
1249251
- return Object.values(unionDeclaration.union).reduce((types3, singleUnionType) => {
1249251
+ const types3 = [];
1249252
+ if (unionDeclaration["base-properties"] != null) {
1249253
+ types3.push(...Object.values(unionDeclaration["base-properties"]).map((property5) => typeof property5 === "string" ? property5 : property5.type));
1249254
+ }
1249255
+ types3.push(...Object.values(unionDeclaration.union).reduce((types4, singleUnionType) => {
1249252
1249256
  const rawType = typeof singleUnionType === "string" ? singleUnionType : singleUnionType.type;
1249253
1249257
  if (typeof rawType === "string") {
1249254
- types3.push(rawType);
1249258
+ types4.push(rawType);
1249255
1249259
  }
1249256
- return types3;
1249257
- }, []);
1249260
+ return types4;
1249261
+ }, []));
1249262
+ return types3;
1249258
1249263
  },
1249259
1249264
  undiscriminatedUnion: (unionDeclaration) => {
1249260
1249265
  return Object.values(unionDeclaration.union).reduce((types3, unionMember) => {
@@ -1250256,9 +1250261,9 @@ var IrGraph = class {
1250256
1250261
  });
1250257
1250262
  }
1250258
1250263
  }
1250259
- markEnvironmentForAudiences(environment, audiences) {
1250264
+ markEnvironmentForAudiences(environment, audiences, ignoreAudiences) {
1250260
1250265
  if (environment) {
1250261
- if (this.hasAudience(audiences)) {
1250266
+ if (this.hasAudience(audiences) || ignoreAudiences) {
1250262
1250267
  this.environmentsNeededForAudience.add(environment.id);
1250263
1250268
  }
1250264
1250269
  }
@@ -1252085,12 +1252090,26 @@ async function generateIntermediateRepresentation({ fdrApiDefinitionId, workspac
1252085
1252090
  });
1252086
1252091
  intermediateRepresentation.serviceTypeReferenceInfo = computeServiceTypeReferenceInfo(irGraph);
1252087
1252092
  const intermediateRepresentationWithGeneratedExamples = new ExampleGenerator(intermediateRepresentation).enrichWithAutogeneratedExamples();
1252093
+ const workspaceDefinitionRootApiFileContents = workspace.definition.rootApiFile.contents;
1252088
1252094
  const environments = convertEnvironments({
1252089
1252095
  casingsGenerator,
1252090
- rawApiFileSchema: workspace.definition.rootApiFile.contents
1252096
+ rawApiFileSchema: workspaceDefinitionRootApiFileContents
1252097
+ });
1252098
+ const ignoreAudiences = environments == null ? void 0 : environments.environments._visit({
1252099
+ singleBaseUrl: (value) => {
1252100
+ return value.environments.filter((environment) => {
1252101
+ return getAudienceForEnvironment(environment.id, workspaceDefinitionRootApiFileContents.environments) != null;
1252102
+ }).length === 0;
1252103
+ },
1252104
+ multipleBaseUrls: (value) => {
1252105
+ return value.environments.filter((environment) => {
1252106
+ return getAudienceForEnvironment(environment.id, workspaceDefinitionRootApiFileContents.environments) != null;
1252107
+ }).length === 0;
1252108
+ },
1252109
+ _other: () => false
1252091
1252110
  });
1252092
1252111
  environments == null ? void 0 : environments.environments.environments.forEach((environment) => {
1252093
- irGraph.markEnvironmentForAudiences(environment, getAudienceForEnvironment(environment.id, workspace.definition.rootApiFile.contents.environments) ?? []);
1252112
+ irGraph.markEnvironmentForAudiences(environment, getAudienceForEnvironment(environment.id, workspaceDefinitionRootApiFileContents.environments) ?? [], ignoreAudiences);
1252094
1252113
  });
1252095
1252114
  const filteredIr = !irGraph.hasNoAudiences() ? irGraph.build() : void 0;
1252096
1252115
  const intermediateRepresentationForAudiences = filterIntermediateRepresentationForAudiences(intermediateRepresentationWithGeneratedExamples, filteredIr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.37.8",
3
+ "version": "0.37.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",