fern-api 0.23.6 → 0.23.7

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 +88 -32
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -345019,7 +345019,8 @@ var init_WebsocketHandshake2 = __esm({
345019
345019
  init_core3();
345020
345020
  WebsocketHandshake = schemas_exports5.objectWithoutOptionalProperties({
345021
345021
  queryParameters: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).QueryParameter)),
345022
- headers: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Header))
345022
+ headers: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Header)),
345023
+ pathParameters: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).PathParameter))
345023
345024
  });
345024
345025
  }
345025
345026
  });
@@ -345716,6 +345717,7 @@ var init_ObjectProperty4 = __esm({
345716
345717
  schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Schema),
345717
345718
  conflict: schemas_exports5.record(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaId), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ObjectPropertyConflictInfo)),
345718
345719
  generatedName: schemas_exports5.string(),
345720
+ nameOverride: schemas_exports5.string().optional(),
345719
345721
  audiences: schemas_exports5.list(schemas_exports5.string())
345720
345722
  });
345721
345723
  }
@@ -346373,6 +346375,7 @@ var init_ObjectPropertyWithExample2 = __esm({
346373
346375
  schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaWithExample),
346374
346376
  audiences: schemas_exports5.list(schemas_exports5.string()),
346375
346377
  conflict: schemas_exports5.record(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaId), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ObjectPropertyConflictInfo)),
346378
+ nameOverride: schemas_exports5.string().optional(),
346376
346379
  generatedName: schemas_exports5.string()
346377
346380
  });
346378
346381
  }
@@ -890696,7 +890699,7 @@ var AccessTokenPosthogManager = class {
890696
890699
  properties: {
890697
890700
  ...event,
890698
890701
  ...event.properties,
890699
- version: "0.23.6",
890702
+ version: "0.23.7",
890700
890703
  usingAccessToken: true
890701
890704
  }
890702
890705
  });
@@ -890758,7 +890761,7 @@ var UserPosthogManager = class {
890758
890761
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
890759
890762
  event: "CLI",
890760
890763
  properties: {
890761
- version: "0.23.6",
890764
+ version: "0.23.7",
890762
890765
  ...event,
890763
890766
  ...event.properties
890764
890767
  }
@@ -903034,8 +903037,14 @@ function buildObjectTypeDeclaration({ schema: schema2, context, declarationFile
903034
903037
  context,
903035
903038
  fileContainingReference: declarationFile
903036
903039
  });
903037
- if (property5.audiences.length > 0) {
903038
- properties[property5.key] = typeof typeReference === "string" ? { type: typeReference, audiences: property5.audiences } : { ...typeReference, audiences: property5.audiences };
903040
+ const audiences = property5.audiences;
903041
+ const name2 = property5.nameOverride;
903042
+ if (audiences.length > 0 && name2 != null) {
903043
+ properties[property5.key] = typeof typeReference === "string" ? { type: typeReference, audiences, name: name2 } : { ...typeReference, audiences, name: name2 };
903044
+ } else if (name2 != null) {
903045
+ properties[property5.key] = typeof typeReference === "string" ? { type: typeReference, name: name2 } : { ...typeReference, name: name2 };
903046
+ } else if (audiences.length > 0) {
903047
+ properties[property5.key] = typeof typeReference === "string" ? { type: typeReference, audiences } : { ...typeReference, audiences };
903039
903048
  } else {
903040
903049
  properties[property5.key] = typeReference;
903041
903050
  }
@@ -903493,6 +903502,27 @@ function buildHeader({ header, context, fileContainingReference }) {
903493
903502
  return headerSchema;
903494
903503
  }
903495
903504
 
903505
+ // pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/buildPathParameter.js
903506
+ function buildPathParameter({ pathParameter, context, fileContainingReference }) {
903507
+ const typeReference = buildTypeReference({
903508
+ schema: pathParameter.schema,
903509
+ context,
903510
+ fileContainingReference
903511
+ });
903512
+ if (pathParameter.variableReference == null && pathParameter.description == null) {
903513
+ return getTypeFromTypeReference(typeReference);
903514
+ }
903515
+ const pathParameterSchema = pathParameter.variableReference != null ? {
903516
+ variable: `$${pathParameter.variableReference}`
903517
+ } : {
903518
+ type: getTypeFromTypeReference(typeReference)
903519
+ };
903520
+ if (pathParameter.description != null) {
903521
+ pathParameterSchema.docs = pathParameter.description;
903522
+ }
903523
+ return pathParameterSchema;
903524
+ }
903525
+
903496
903526
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/parse.js
903497
903527
  var import_promises25 = require("fs/promises");
903498
903528
 
@@ -903572,7 +903602,8 @@ var FernOpenAPIExtension = {
903572
903602
  FERN_BEARER_TOKEN: "x-fern-bearer",
903573
903603
  FERN_HEADER_AUTH: "x-fern-header",
903574
903604
  FERN_BASIC_AUTH: "x-fern-basic",
903575
- FERN_GLOBAL_HEADERS: "x-fern-global-headers"
903605
+ FERN_GLOBAL_HEADERS: "x-fern-global-headers",
903606
+ FERN_PROPERTY_NAME: "x-fern-property-name"
903576
903607
  };
903577
903608
 
903578
903609
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernEnum.js
@@ -904524,7 +904555,8 @@ function convertToObjectProperty(objectProperty) {
904524
904555
  generatedName: objectProperty.generatedName,
904525
904556
  key: objectProperty.key,
904526
904557
  schema: convertSchemaWithExampleToSchema(objectProperty.schema),
904527
- audiences: objectProperty.audiences
904558
+ audiences: objectProperty.audiences,
904559
+ nameOverride: objectProperty.nameOverride
904528
904560
  };
904529
904561
  }
904530
904562
 
@@ -904684,6 +904716,7 @@ function convertObject({ nameOverride, generatedName, breadcrumbs, properties, d
904684
904716
  const convertedProperties = Object.entries(propertiesToConvert).map(([propertyName, propertySchema]) => {
904685
904717
  const isRequired = allRequired.includes(propertyName);
904686
904718
  const audiences = getExtension(propertySchema, FernOpenAPIExtension.AUDIENCES) ?? [];
904719
+ const propertyNameOverride = getExtension(propertySchema, FernOpenAPIExtension.FERN_PROPERTY_NAME);
904687
904720
  const propertyBreadcrumbs = [...breadcrumbs, propertyName];
904688
904721
  const generatedName2 = getGeneratedPropertyName(propertyBreadcrumbs);
904689
904722
  const schema2 = isRequired ? convertSchema(propertySchema, false, context, propertyBreadcrumbs) : SchemaWithExample.optional({
@@ -904705,6 +904738,7 @@ function convertObject({ nameOverride, generatedName, breadcrumbs, properties, d
904705
904738
  return {
904706
904739
  key: propertyName,
904707
904740
  schema: schema2,
904741
+ nameOverride: propertyNameOverride,
904708
904742
  audiences,
904709
904743
  conflict: conflicts,
904710
904744
  generatedName: getGeneratedPropertyName([...breadcrumbs, propertyName])
@@ -906519,7 +906553,8 @@ function convertToObjectProperty2(objectProperty) {
906519
906553
  generatedName: objectProperty.generatedName,
906520
906554
  key: objectProperty.key,
906521
906555
  schema: convertSchemaToSchemaWithExample(objectProperty.schema),
906522
- audiences: objectProperty.audiences
906556
+ audiences: objectProperty.audiences,
906557
+ nameOverride: objectProperty.nameOverride
906523
906558
  };
906524
906559
  }
906525
906560
 
@@ -906937,7 +906972,8 @@ function convertMultipartRequestToSchema(request) {
906937
906972
  schema: convertSchemaToSchemaWithExample(property5.schema.value),
906938
906973
  audiences: [],
906939
906974
  conflict: {},
906940
- generatedName: property5.key
906975
+ generatedName: property5.key,
906976
+ nameOverride: void 0
906941
906977
  };
906942
906978
  }).filter(isNonNullish),
906943
906979
  allOf: [],
@@ -907189,6 +907225,28 @@ function parseAsyncAPI({ document: document6, taskContext }) {
907189
907225
  context.logger.error(`Channel ${channelPath} does not have websocket bindings. Skipping.`);
907190
907226
  continue;
907191
907227
  }
907228
+ const pathParameters = [];
907229
+ if (channel.parameters != null) {
907230
+ for (const [name2, parameter] of Object.entries(channel.parameters ?? {})) {
907231
+ pathParameters.push({
907232
+ name: name2,
907233
+ description: parameter.description,
907234
+ schema: parameter.schema != null ? convertSchema(parameter.schema, false, context, breadcrumbs) : SchemaWithExample.primitive({
907235
+ schema: PrimitiveSchemaValueWithExample.string({
907236
+ example: void 0,
907237
+ format: void 0,
907238
+ maxLength: void 0,
907239
+ minLength: void 0
907240
+ }),
907241
+ description: void 0,
907242
+ generatedName: "",
907243
+ groupName: void 0,
907244
+ nameOverride: void 0
907245
+ }),
907246
+ variableReference: void 0
907247
+ });
907248
+ }
907249
+ }
907192
907250
  const headers = [];
907193
907251
  if (channel.bindings.ws.headers != null) {
907194
907252
  const required = channel.bindings.ws.headers.required ?? [];
@@ -907276,6 +907334,12 @@ function parseAsyncAPI({ document: document6, taskContext }) {
907276
907334
  ...param,
907277
907335
  schema: convertSchemaWithExampleToSchema(param.schema)
907278
907336
  };
907337
+ }),
907338
+ pathParameters: pathParameters.map((param) => {
907339
+ return {
907340
+ ...param,
907341
+ schema: convertSchemaWithExampleToSchema(param.schema)
907342
+ };
907279
907343
  })
907280
907344
  },
907281
907345
  groupName: (tag == null ? void 0 : tag.name) != null ? [tag.name] : ["Websocket"],
@@ -909728,6 +909792,19 @@ function buildChannel({ channel, context, declarationFile }) {
909728
909792
  if (channel.summary != null) {
909729
909793
  convertedChannel["display-name"] = channel.summary;
909730
909794
  }
909795
+ const pathParameters = {};
909796
+ if (channel.handshake.pathParameters.length > 0) {
909797
+ for (const pathParameter of channel.handshake.pathParameters) {
909798
+ pathParameters[pathParameter.name] = buildPathParameter({
909799
+ pathParameter,
909800
+ context,
909801
+ fileContainingReference: declarationFile
909802
+ });
909803
+ }
909804
+ }
909805
+ if (Object.keys(pathParameters).length > 0) {
909806
+ convertedChannel["path-parameters"] = pathParameters;
909807
+ }
909731
909808
  const queryParameters = {};
909732
909809
  if (channel.handshake.queryParameters.length > 0) {
909733
909810
  for (const queryParameter of channel.handshake.queryParameters) {
@@ -910118,27 +910195,6 @@ function convertLiteralExample2(literal2) {
910118
910195
  }
910119
910196
  }
910120
910197
 
910121
- // pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/buildPathParameter.js
910122
- function buildPathParameter({ pathParameter, context, fileContainingReference }) {
910123
- const typeReference = buildTypeReference({
910124
- schema: pathParameter.schema,
910125
- context,
910126
- fileContainingReference
910127
- });
910128
- if (pathParameter.variableReference == null && pathParameter.description == null) {
910129
- return getTypeFromTypeReference(typeReference);
910130
- }
910131
- const pathParameterSchema = pathParameter.variableReference != null ? {
910132
- variable: `$${pathParameter.variableReference}`
910133
- } : {
910134
- type: getTypeFromTypeReference(typeReference)
910135
- };
910136
- if (pathParameter.description != null) {
910137
- pathParameterSchema.docs = pathParameter.description;
910138
- }
910139
- return pathParameterSchema;
910140
- }
910141
-
910142
910198
  // pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/utils/convertToHttpMethod.js
910143
910199
  function convertToHttpMethod(httpMethod) {
910144
910200
  return HttpMethod5._visit(httpMethod, {
@@ -915217,10 +915273,10 @@ var CliContext = class {
915217
915273
  return "fern-api";
915218
915274
  }
915219
915275
  getPackageVersion() {
915220
- if ("0.23.6" == null) {
915276
+ if ("0.23.7" == null) {
915221
915277
  this.logger.error("CLI_VERSION is not defined");
915222
915278
  }
915223
- return "0.23.6";
915279
+ return "0.23.7";
915224
915280
  }
915225
915281
  getCliName() {
915226
915282
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.23.6",
3
+ "version": "0.23.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",