@fern-api/fern-api-dev 3.34.0 → 3.35.0-1-g8faa399935

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/cli.cjs +28 -10
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1413765,7 +1413765,7 @@ var AccessTokenPosthogManager = class {
1413765
1413765
  properties: {
1413766
1413766
  ...event,
1413767
1413767
  ...event.properties,
1413768
- version: "3.34.0",
1413768
+ version: "3.35.0-1-g8faa399935",
1413769
1413769
  usingAccessToken: true
1413770
1413770
  }
1413771
1413771
  });
@@ -1413864,7 +1413864,7 @@ var UserPosthogManager = class {
1413864
1413864
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1413865
1413865
  event: "CLI",
1413866
1413866
  properties: {
1413867
- version: "3.34.0",
1413867
+ version: "3.35.0-1-g8faa399935",
1413868
1413868
  ...event,
1413869
1413869
  ...event.properties,
1413870
1413870
  usingAccessToken: false,
@@ -1493968,7 +1493968,7 @@ var CliContext = class {
1493968
1493968
  if (false) {
1493969
1493969
  this.logger.error("CLI_VERSION is not defined");
1493970
1493970
  }
1493971
- return "3.34.0";
1493971
+ return "3.35.0-1-g8faa399935";
1493972
1493972
  }
1493973
1493973
  getCliName() {
1493974
1493974
  if (false) {
@@ -1508143,8 +1508143,14 @@ function buildChannel({ channel, context: context2, declarationFile }) {
1508143
1508143
  const firstServer = channel.servers[0];
1508144
1508144
  const urlId = firstServer != null ? context2.options.groupEnvironmentsByHost ? context2.getUrlId(firstServer.url) ?? generateWebsocketUrlId(firstServer.name, firstServer.url, true) : firstServer.name : void 0;
1508145
1508145
  context2.logger.debug(`[buildChannel] Channel path="${channel.path}", server name="${firstServer?.name}", server url="${firstServer?.url}", resolved urlId="${urlId}" (from collision map: ${context2.getUrlId(firstServer?.url ?? "") != null})`);
1508146
+ let convertedPath = channel.path;
1508147
+ for (const pathParameter of channel.handshake.pathParameters) {
1508148
+ if (pathParameter.parameterNameOverride != null) {
1508149
+ convertedPath = convertedPath.replace(`{${pathParameter.name}}`, `{${pathParameter.parameterNameOverride}}`);
1508150
+ }
1508151
+ }
1508146
1508152
  const convertedChannel = {
1508147
- path: channel.path,
1508153
+ path: convertedPath,
1508148
1508154
  url: urlId,
1508149
1508155
  auth: false
1508150
1508156
  };
@@ -1508161,7 +1508167,8 @@ function buildChannel({ channel, context: context2, declarationFile }) {
1508161
1508167
  const pathParameters = {};
1508162
1508168
  if (channel.handshake.pathParameters.length > 0) {
1508163
1508169
  for (const pathParameter of channel.handshake.pathParameters) {
1508164
- pathParameters[pathParameter.name] = buildPathParameter({
1508170
+ const parameterKey = pathParameter.parameterNameOverride ?? pathParameter.name;
1508171
+ pathParameters[parameterKey] = buildPathParameter({
1508165
1508172
  pathParameter,
1508166
1508173
  context: context2,
1508167
1508174
  fileContainingReference: declarationFile,
@@ -1517329,7 +1517336,19 @@ var FernAsyncAPIExtension = {
1517329
1517336
  * /my-channel:
1517330
1517337
  * x-fern-ignore: true
1517331
1517338
  */
1517332
- IGNORE: "x-fern-ignore"
1517339
+ IGNORE: "x-fern-ignore",
1517340
+ /**
1517341
+ * Used to customize the name of a channel parameter in generated SDKs.
1517342
+ * The original parameter name is preserved as the wire value.
1517343
+ *
1517344
+ * channels:
1517345
+ * /my-channel/{userId}:
1517346
+ * parameters:
1517347
+ * userId:
1517348
+ * description: The user ID
1517349
+ * x-fern-parameter-name: id
1517350
+ */
1517351
+ FERN_PARAMETER_NAME: "x-fern-parameter-name"
1517333
1517352
  };
1517334
1517353
 
1517335
1517354
  // ../api-importers/openapi/openapi-ir-parser/lib/asyncapi/getFernExamples.js
@@ -1517377,10 +1517396,11 @@ function parseAsyncAPIV2({ context: context2, breadcrumbs, source: source2, asyn
1517377
1517396
  const pathParameters = [];
1517378
1517397
  if (channel.parameters != null) {
1517379
1517398
  for (const [name2, parameter] of Object.entries(channel.parameters ?? {})) {
1517399
+ const parameterNameOverride = getExtension(parameter, FernAsyncAPIExtension.FERN_PARAMETER_NAME);
1517380
1517400
  pathParameters.push({
1517381
1517401
  name: name2,
1517382
1517402
  description: parameter.description,
1517383
- parameterNameOverride: void 0,
1517403
+ parameterNameOverride,
1517384
1517404
  schema: parameter.schema != null ? convertSchema(parameter.schema, false, false, context2, breadcrumbs, source2, context2.namespace) : SchemaWithExample.primitive({
1517385
1517405
  schema: PrimitiveSchemaValueWithExample.string({
1517386
1517406
  default: void 0,
@@ -1517590,8 +1517610,6 @@ function parseAsyncAPIV2({ context: context2, breadcrumbs, source: source2, asyn
1517590
1517610
  pathParameters: pathParameters.map((param) => {
1517591
1517611
  return {
1517592
1517612
  ...param,
1517593
- parameterNameOverride: void 0,
1517594
- // come back
1517595
1517613
  schema: convertSchemaWithExampleToSchema(param.schema)
1517596
1517614
  };
1517597
1517615
  })
@@ -1588848,7 +1588866,7 @@ var import_path35 = __toESM(require("path"), 1);
1588848
1588866
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1588849
1588867
  var LOGS_FOLDER_NAME = "logs";
1588850
1588868
  function getCliSource() {
1588851
- const version6 = "3.34.0";
1588869
+ const version6 = "3.35.0-1-g8faa399935";
1588852
1588870
  return `cli@${version6}`;
1588853
1588871
  }
1588854
1588872
  var DebugLogger = class {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.34.0",
2
+ "version": "3.35.0-1-g8faa399935",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",