@fern-api/fern-api-dev 3.26.2-1-g9fb59bd745 → 3.26.3-1-gdbbf15752a

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 +90 -26
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1334422,7 +1334422,7 @@ var AccessTokenPosthogManager = class {
1334422
1334422
  properties: {
1334423
1334423
  ...event,
1334424
1334424
  ...event.properties,
1334425
- version: "3.26.2-1-g9fb59bd745",
1334425
+ version: "3.26.3-1-gdbbf15752a",
1334426
1334426
  usingAccessToken: true
1334427
1334427
  }
1334428
1334428
  });
@@ -1334521,7 +1334521,7 @@ var UserPosthogManager = class {
1334521
1334521
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1334522
1334522
  event: "CLI",
1334523
1334523
  properties: {
1334524
- version: "3.26.2-1-g9fb59bd745",
1334524
+ version: "3.26.3-1-gdbbf15752a",
1334525
1334525
  ...event,
1334526
1334526
  ...event.properties,
1334527
1334527
  usingAccessToken: false,
@@ -1394287,6 +1394287,7 @@ var WebSocketMessageBody2 = schemas_exports5.union("type", {
1394287
1394287
  var WebSocketMessage = schemas_exports5.objectWithoutOptionalProperties({
1394288
1394288
  type: WebSocketMessageId2,
1394289
1394289
  displayName: schemas_exports5.string().optional(),
1394290
+ methodName: schemas_exports5.string().optional(),
1394290
1394291
  origin: WebSocketMessageOrigin3,
1394291
1394292
  body: WebSocketMessageBody2
1394292
1394293
  }).extend(Declaration);
@@ -1395551,6 +1395552,7 @@ __export(serialization_exports5, {
1395551
1395552
  WithEnvironmentVariable: () => WithEnvironmentVariable2,
1395552
1395553
  WithEnvironmentsSchema: () => WithEnvironmentsSchema2,
1395553
1395554
  WithHeadersSchema: () => WithHeadersSchema2,
1395555
+ WithMethodName: () => WithMethodName,
1395554
1395556
  WithName: () => WithName2,
1395555
1395557
  WithValidation: () => WithValidation,
1395556
1395558
  auth: () => auth_exports9,
@@ -1397022,6 +1397024,7 @@ __export(commons_exports20, {
1397022
1397024
  WithAvailability: () => WithAvailability2,
1397023
1397025
  WithDisplayName: () => WithDisplayName,
1397024
1397026
  WithDocsSchema: () => WithDocsSchema2,
1397027
+ WithMethodName: () => WithMethodName,
1397025
1397028
  WithName: () => WithName2,
1397026
1397029
  WithValidation: () => WithValidation
1397027
1397030
  });
@@ -1397036,6 +1397039,11 @@ var WithDisplayName = schemas_exports6.object({
1397036
1397039
  "display-name": schemas_exports6.string().optional()
1397037
1397040
  });
1397038
1397041
 
1397042
+ // ../fern-definition/schema/lib/schemas/serialization/resources/commons/types/WithMethodName.js
1397043
+ var WithMethodName = schemas_exports6.object({
1397044
+ "method-name": schemas_exports6.string().optional()
1397045
+ });
1397046
+
1397039
1397047
  // ../fern-definition/schema/lib/schemas/serialization/resources/validation/types/StringValidationSchema.js
1397040
1397048
  var StringValidationSchema2 = schemas_exports6.object({
1397041
1397049
  minLength: schemas_exports6.number().optional(),
@@ -1397695,7 +1397703,7 @@ var WebSocketChannelMessageBodySchema = schemas_exports6.undiscriminatedUnion([
1397695
1397703
  var WebSocketChannelMessageSchema = schemas_exports6.object({
1397696
1397704
  origin: WebSocketOrigin2,
1397697
1397705
  body: WebSocketChannelMessageBodySchema
1397698
- }).extend(DeclarationSchema).extend(WithDisplayName);
1397706
+ }).extend(DeclarationSchema).extend(WithDisplayName).extend(WithMethodName);
1397699
1397707
 
1397700
1397708
  // ../fern-definition/schema/lib/schemas/serialization/resources/websocket/types/WebSocketChannelSchema.js
1397701
1397709
  var WebSocketChannelSchema = schemas_exports6.object({
@@ -1414551,7 +1414559,7 @@ var CliContext = class {
1414551
1414559
  if (false) {
1414552
1414560
  this.logger.error("CLI_VERSION is not defined");
1414553
1414561
  }
1414554
- return "3.26.2-1-g9fb59bd745";
1414562
+ return "3.26.3-1-gdbbf15752a";
1414555
1414563
  }
1414556
1414564
  getCliName() {
1414557
1414565
  if (false) {
@@ -1425503,7 +1425511,8 @@ var WebsocketMessageOrigin2 = schemas_exports8.enum_(["client", "server"]);
1425503
1425511
  var WebsocketMessageSchema = schemas_exports8.objectWithoutOptionalProperties({
1425504
1425512
  name: schemas_exports8.string(),
1425505
1425513
  origin: WebsocketMessageOrigin2,
1425506
- body: schemas_exports8.lazy(() => Schema4)
1425514
+ body: schemas_exports8.lazy(() => Schema4),
1425515
+ methodName: schemas_exports8.string().optional()
1425507
1425516
  });
1425508
1425517
 
1425509
1425518
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebsocketServer.js
@@ -1428791,18 +1428800,22 @@ function buildChannel({ channel, context: context2, declarationFile }) {
1428791
1428800
  channel: convertedChannel
1428792
1428801
  });
1428793
1428802
  for (const message of channel.messages) {
1428803
+ const messageSchema = {
1428804
+ origin: message.origin,
1428805
+ body: buildTypeReference({
1428806
+ schema: message.body,
1428807
+ context: context2,
1428808
+ fileContainingReference: declarationFile,
1428809
+ namespace: maybeChannelNamespace,
1428810
+ declarationDepth: 0
1428811
+ })
1428812
+ };
1428813
+ if (message.methodName != null) {
1428814
+ messageSchema["method-name"] = message.methodName;
1428815
+ }
1428794
1428816
  context2.builder.addChannelMessage(declarationFile, {
1428795
1428817
  messageId: message.name,
1428796
- message: {
1428797
- origin: message.origin,
1428798
- body: buildTypeReference({
1428799
- schema: message.body,
1428800
- context: context2,
1428801
- fileContainingReference: declarationFile,
1428802
- namespace: maybeChannelNamespace,
1428803
- declarationDepth: 0
1428804
- })
1428805
- }
1428818
+ message: messageSchema
1428806
1428819
  });
1428807
1428820
  }
1428808
1428821
  for (const example of channel.examples) {
@@ -1437816,6 +1437829,20 @@ var FernAsyncAPIExtension = {
1437816
1437829
  * The x-fern-sdk-group-name allows you to specify the SDK group name for the websocket channel.
1437817
1437830
  */
1437818
1437831
  FERN_SDK_GROUP_NAME: "x-fern-sdk-group-name",
1437832
+ /**
1437833
+ * The x-fern-sdk-method-name allows you to specify the SDK method name for an AsyncAPI operation.
1437834
+ * This extension is applied to AsyncAPI v3 operations to customize the generated method names.
1437835
+ *
1437836
+ * operations:
1437837
+ * SendMessage:
1437838
+ * action: send
1437839
+ * x-fern-sdk-method-name: sendChatMessage
1437840
+ * channel:
1437841
+ * $ref: '#/channels/chat'
1437842
+ * messages:
1437843
+ * - $ref: '#/channels/chat/messages/userMessage'
1437844
+ */
1437845
+ FERN_SDK_METHOD_NAME: "x-fern-sdk-method-name",
1437819
1437846
  /**
1437820
1437847
  * The x-fern-examples allows you to specify examples for the websocket session.
1437821
1437848
  *
@@ -1438098,14 +1438125,18 @@ function parseAsyncAPIV2({ context: context2, breadcrumbs, source: source2, asyn
1438098
1438125
  messages2.push({
1438099
1438126
  origin: "client",
1438100
1438127
  name: "publish",
1438101
- body: convertSchemaWithExampleToSchema(publishSchema)
1438128
+ body: convertSchemaWithExampleToSchema(publishSchema),
1438129
+ methodName: void 0
1438130
+ // AsyncAPI v2 doesn't support operations with custom method names
1438102
1438131
  });
1438103
1438132
  }
1438104
1438133
  if (subscribeSchema != null) {
1438105
1438134
  messages2.push({
1438106
1438135
  origin: "server",
1438107
1438136
  name: "subscribe",
1438108
- body: convertSchemaWithExampleToSchema(subscribeSchema)
1438137
+ body: convertSchemaWithExampleToSchema(subscribeSchema),
1438138
+ methodName: void 0
1438139
+ // AsyncAPI v2 doesn't support operations with custom method names
1438109
1438140
  });
1438110
1438141
  }
1438111
1438142
  parsedChannels[channelPath] = {
@@ -1438354,7 +1438385,11 @@ function parseAsyncAPIV3({ context: context2, breadcrumbs, source: source2, asyn
1438354
1438385
  }
1438355
1438386
  const channelPath = getChannelPathFromOperation(operation);
1438356
1438387
  if (!channelEvents[channelPath]) {
1438357
- channelEvents[channelPath] = { subscribe: [], publish: [], __parsedMessages: [] };
1438388
+ channelEvents[channelPath] = { subscribe: [], publish: [], __parsedMessages: [], operationMethodNames: {} };
1438389
+ }
1438390
+ const methodName = getExtension(operation, FernAsyncAPIExtension.FERN_SDK_METHOD_NAME);
1438391
+ if (methodName && channelEvents[channelPath].operationMethodNames) {
1438392
+ channelEvents[channelPath].operationMethodNames[operationId] = methodName;
1438358
1438393
  }
1438359
1438394
  if (operation.action === "receive") {
1438360
1438395
  channelEvents[channelPath].subscribe.push(...operation.messages);
@@ -1438372,7 +1438407,8 @@ function parseAsyncAPIV3({ context: context2, breadcrumbs, source: source2, asyn
1438372
1438407
  origin: "server",
1438373
1438408
  messageSchemas: messageSchemas[channelPath] ?? {},
1438374
1438409
  duplicatedMessageIds,
1438375
- context: context2
1438410
+ context: context2,
1438411
+ operationMethodNames: events.operationMethodNames
1438376
1438412
  }));
1438377
1438413
  channelMessages.push(...convertMessageReferencesToWebsocketSchemas({
1438378
1438414
  messages: events.publish,
@@ -1438380,7 +1438416,8 @@ function parseAsyncAPIV3({ context: context2, breadcrumbs, source: source2, asyn
1438380
1438416
  origin: "client",
1438381
1438417
  messageSchemas: messageSchemas[channelPath] ?? {},
1438382
1438418
  duplicatedMessageIds,
1438383
- context: context2
1438419
+ context: context2,
1438420
+ operationMethodNames: events.operationMethodNames
1438384
1438421
  }));
1438385
1438422
  if (channelEvents[channelPath] != null) {
1438386
1438423
  channelEvents[channelPath].__parsedMessages = channelMessages;
@@ -1438570,7 +1438607,7 @@ function getServerNameFromServerRef(servers, serverRef) {
1438570
1438607
  }
1438571
1438608
  return server;
1438572
1438609
  }
1438573
- function convertMessageReferencesToWebsocketSchemas({ messages: messages2, channelPath, origin: origin2, messageSchemas, duplicatedMessageIds, context: context2 }) {
1438610
+ function convertMessageReferencesToWebsocketSchemas({ messages: messages2, channelPath, origin: origin2, messageSchemas, duplicatedMessageIds, context: context2, operationMethodNames }) {
1438574
1438611
  const results = [];
1438575
1438612
  messages2.forEach((messageRef, i11) => {
1438576
1438613
  const channelMessage = context2.resolveMessageReference(messageRef, true);
@@ -1438580,10 +1438617,12 @@ function convertMessageReferencesToWebsocketSchemas({ messages: messages2, chann
1438580
1438617
  }
1438581
1438618
  const schema2 = messageSchemas[schemaId];
1438582
1438619
  if (schema2 != null) {
1438620
+ const potentialMethodName = operationMethodNames ? Object.values(operationMethodNames)[i11] : void 0;
1438583
1438621
  results.push({
1438584
1438622
  origin: origin2,
1438585
1438623
  name: schemaId ?? `${origin2}Message${i11 + 1}`,
1438586
- body: convertSchemaWithExampleToSchema(schema2)
1438624
+ body: convertSchemaWithExampleToSchema(schema2),
1438625
+ methodName: potentialMethodName
1438587
1438626
  });
1438588
1438627
  }
1438589
1438628
  });
@@ -1449728,6 +1449767,16 @@ var definitions2 = {
1449728
1449767
  }
1449729
1449768
  ]
1449730
1449769
  },
1449770
+ "method-name": {
1449771
+ oneOf: [
1449772
+ {
1449773
+ type: "string"
1449774
+ },
1449775
+ {
1449776
+ type: "null"
1449777
+ }
1449778
+ ]
1449779
+ },
1449731
1449780
  origin: {
1449732
1449781
  $ref: "#/definitions/websocket.WebSocketOrigin"
1449733
1449782
  },
@@ -1453397,6 +1453446,16 @@ var definitions3 = {
1453397
1453446
  }
1453398
1453447
  ]
1453399
1453448
  },
1453449
+ "method-name": {
1453450
+ oneOf: [
1453451
+ {
1453452
+ type: "string"
1453453
+ },
1453454
+ {
1453455
+ type: "null"
1453456
+ }
1453457
+ ]
1453458
+ },
1453400
1453459
  origin: {
1453401
1453460
  $ref: "#/definitions/websocket.WebSocketOrigin"
1453402
1453461
  },
@@ -1454501,7 +1454560,9 @@ var ChannelConverter2_X = class extends AbstractChannelConverter {
1454501
1454560
  node: operation,
1454502
1454561
  breadcrumbs: this.breadcrumbs
1454503
1454562
  }),
1454504
- docs: operation.description
1454563
+ docs: operation.description,
1454564
+ methodName: void 0
1454565
+ // AsyncAPI v2 doesn't support x-fern-sdk-method-name extension
1454505
1454566
  };
1454506
1454567
  }
1454507
1454568
  return void 0;
@@ -1454704,7 +1454765,9 @@ var ChannelConverter3_0 = class extends AbstractChannelConverter {
1454704
1454765
  node: operation,
1454705
1454766
  breadcrumbs: this.breadcrumbs
1454706
1454767
  }),
1454707
- docs: operation.description
1454768
+ docs: operation.description,
1454769
+ methodName: void 0
1454770
+ // AsyncAPI direct-to-IR doesn't support x-fern-sdk-method-name extension
1454708
1454771
  });
1454709
1454772
  }
1454710
1454773
  }
@@ -1489372,7 +1489435,8 @@ function convertChannel({ channel, typeResolver, exampleResolver, variableResolv
1489372
1489435
  docs: message.docs,
1489373
1489436
  origin: message.origin,
1489374
1489437
  body: convertMessageSchema({ body: message.body, file }),
1489375
- displayName: message["display-name"]
1489438
+ displayName: message["display-name"],
1489439
+ methodName: message["method-name"]
1489376
1489440
  });
1489377
1489441
  }
1489378
1489442
  return {
@@ -1508922,7 +1508986,7 @@ var import_path35 = __toESM(require("path"), 1);
1508922
1508986
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1508923
1508987
  var LOGS_FOLDER_NAME = "logs";
1508924
1508988
  function getCliSource() {
1508925
- const version6 = "3.26.2-1-g9fb59bd745";
1508989
+ const version6 = "3.26.3-1-gdbbf15752a";
1508926
1508990
  return `cli@${version6}`;
1508927
1508991
  }
1508928
1508992
  var DebugLogger = class {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.26.2-1-g9fb59bd745",
2
+ "version": "3.26.3-1-gdbbf15752a",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",