fern-api 0.23.7 → 0.24.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/bundle.cjs +54 -6
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -344910,6 +344910,7 @@ var init_OpenApiIntermediateRepresentation2 = __esm({
344910
344910
  OpenApiIntermediateRepresentation = schemas_exports5.objectWithoutOptionalProperties({
344911
344911
  title: schemas_exports5.string().optional(),
344912
344912
  description: schemas_exports5.string().optional(),
344913
+ basePath: schemas_exports5.string().optional(),
344913
344914
  servers: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Server)),
344914
344915
  groups: schemas_exports5.record(schemas_exports5.string(), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SdkGroupInfo)),
344915
344916
  tags: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Tags),
@@ -890699,7 +890700,7 @@ var AccessTokenPosthogManager = class {
890699
890700
  properties: {
890700
890701
  ...event,
890701
890702
  ...event.properties,
890702
- version: "0.23.7",
890703
+ version: "0.24.0",
890703
890704
  usingAccessToken: true
890704
890705
  }
890705
890706
  });
@@ -890761,7 +890762,7 @@ var UserPosthogManager = class {
890761
890762
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
890762
890763
  event: "CLI",
890763
890764
  properties: {
890764
- version: "0.23.7",
890765
+ version: "0.24.0",
890765
890766
  ...event,
890766
890767
  ...event.properties
890767
890768
  }
@@ -903578,6 +903579,7 @@ var FernOpenAPIExtension = {
903578
903579
  BOOLEAN_LITERAL: "x-fern-boolean-literal",
903579
903580
  SERVER_NAME_V1: "x-name",
903580
903581
  SERVER_NAME_V2: "x-fern-server-name",
903582
+ BASE_PATH: "x-fern-base-path",
903581
903583
  GROUPS: TypedExtensionId.of("x-fern-groups"),
903582
903584
  OPENAPI_OVERIDES_FILEPATH: "x-fern-overrides-filepath",
903583
903585
  TYPE_DEFINITION: "x-fern-type",
@@ -908858,6 +908860,11 @@ function getScopes(oauthSecurityScheme) {
908858
908860
  return void 0;
908859
908861
  }
908860
908862
 
908863
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernBasePath.js
908864
+ function getFernBasePath(parameter) {
908865
+ return getExtension(parameter, FernOpenAPIExtension.BASE_PATH);
908866
+ }
908867
+
908861
908868
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernGroups.js
908862
908869
  var XFernGroupsSchema = z.record(z.string(), z.object({
908863
908870
  summary: z.string().optional(),
@@ -909206,6 +909213,7 @@ function generateIr({ openApi, taskContext, disableExamples, audiences }) {
909206
909213
  });
909207
909214
  const groupInfo = getFernGroups({ document: openApi, context });
909208
909215
  const ir = {
909216
+ basePath: getFernBasePath(openApi),
909209
909217
  title: openApi.info.title,
909210
909218
  description: openApi.info.description,
909211
909219
  groups: Object.fromEntries(Object.entries(groupInfo ?? {}).map(([key2, value]) => {
@@ -909324,6 +909332,7 @@ async function parse3({ workspace, taskContext }) {
909324
909332
  let ir = {
909325
909333
  title: void 0,
909326
909334
  description: void 0,
909335
+ basePath: void 0,
909327
909336
  servers: [],
909328
909337
  tags: {
909329
909338
  tagsById: {},
@@ -909391,6 +909400,7 @@ function merge3(ir1, ir2) {
909391
909400
  return {
909392
909401
  title: ir1.title ?? ir2.title,
909393
909402
  description: ir1.description ?? ir2.description,
909403
+ basePath: ir1.basePath ?? ir2.basePath,
909394
909404
  servers: [...ir1.servers, ...ir2.servers],
909395
909405
  tags: {
909396
909406
  tagsById: {
@@ -910867,6 +910877,9 @@ function buildFernDefinition(context) {
910867
910877
  buildGlobalHeaders(context);
910868
910878
  buildAuthSchemes(context);
910869
910879
  buildVariables(context);
910880
+ if (context.ir.basePath != null) {
910881
+ context.builder.setBasePath(context.ir.basePath);
910882
+ }
910870
910883
  if (context.ir.hasEndpointsMarkedInternal) {
910871
910884
  context.builder.addAudience(EXTERNAL_AUDIENCE);
910872
910885
  }
@@ -910964,6 +910977,9 @@ var FernDefinitionBuilderImpl = class {
910964
910977
  setDefaultEnvironment(name2) {
910965
910978
  this.rootApiFile["default-environment"] = name2;
910966
910979
  }
910980
+ setBasePath(basePath) {
910981
+ this.rootApiFile["base-path"] = basePath;
910982
+ }
910967
910983
  getEnvironmentType() {
910968
910984
  const environmentEntry = Object.entries(this.rootApiFile.environments ?? {})[0];
910969
910985
  if (environmentEntry == null) {
@@ -911597,9 +911613,31 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
911597
911613
  if ((generatorsConfiguration == null ? void 0 : generatorsConfiguration.api) != null && generatorsConfiguration.api.definitions.length > 0) {
911598
911614
  const specs = [];
911599
911615
  for (const definition3 of generatorsConfiguration.api.definitions) {
911616
+ const absoluteFilepath = join(absolutePathToWorkspace, RelativeFilePath.of(definition3.path));
911617
+ const absoluteFilepathToOverrides = definition3.overrides != null ? join(absolutePathToWorkspace, RelativeFilePath.of(definition3.overrides)) : void 0;
911618
+ if (!await doesPathExist(absoluteFilepath)) {
911619
+ return {
911620
+ didSucceed: false,
911621
+ failures: {
911622
+ [RelativeFilePath.of(definition3.path)]: {
911623
+ type: WorkspaceLoaderFailureType.FILE_MISSING
911624
+ }
911625
+ }
911626
+ };
911627
+ }
911628
+ if (definition3.overrides != null && absoluteFilepathToOverrides != null && !await doesPathExist(absoluteFilepathToOverrides)) {
911629
+ return {
911630
+ didSucceed: false,
911631
+ failures: {
911632
+ [RelativeFilePath.of(definition3.overrides)]: {
911633
+ type: WorkspaceLoaderFailureType.FILE_MISSING
911634
+ }
911635
+ }
911636
+ };
911637
+ }
911600
911638
  specs.push({
911601
- absoluteFilepath: join(absolutePathToWorkspace, RelativeFilePath.of(definition3.path)),
911602
- absoluteFilepathToOverrides: definition3.overrides != null ? join(absolutePathToWorkspace, RelativeFilePath.of(definition3.overrides)) : void 0,
911639
+ absoluteFilepath,
911640
+ absoluteFilepathToOverrides,
911603
911641
  settings: {
911604
911642
  audiences: definition3.audiences ?? []
911605
911643
  }
@@ -911634,6 +911672,16 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
911634
911672
  absoluteFilepathToOverrides: void 0
911635
911673
  });
911636
911674
  }
911675
+ if (absolutePathToOpenAPI != null && absolutePathToAsyncAPI != null) {
911676
+ return {
911677
+ didSucceed: false,
911678
+ failures: {
911679
+ [RelativeFilePath.of("openapi/openapi.yml")]: {
911680
+ type: WorkspaceLoaderFailureType.FILE_MISSING
911681
+ }
911682
+ }
911683
+ };
911684
+ }
911637
911685
  return {
911638
911686
  didSucceed: true,
911639
911687
  workspace: {
@@ -915273,10 +915321,10 @@ var CliContext = class {
915273
915321
  return "fern-api";
915274
915322
  }
915275
915323
  getPackageVersion() {
915276
- if ("0.23.7" == null) {
915324
+ if ("0.24.0" == null) {
915277
915325
  this.logger.error("CLI_VERSION is not defined");
915278
915326
  }
915279
- return "0.23.7";
915327
+ return "0.24.0";
915280
915328
  }
915281
915329
  getCliName() {
915282
915330
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.23.7",
3
+ "version": "0.24.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",