fern-api 0.19.22 → 0.19.23

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 +68 -9
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -340602,6 +340602,12 @@ var init_OpenApiIntermediateRepresentation = __esm({
340602
340602
  }
340603
340603
  });
340604
340604
 
340605
+ // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/SdkGroupInfo.js
340606
+ var init_SdkGroupInfo = __esm({
340607
+ "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/SdkGroupInfo.js"() {
340608
+ }
340609
+ });
340610
+
340605
340611
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/GlobalHeader.js
340606
340612
  var init_GlobalHeader = __esm({
340607
340613
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/GlobalHeader.js"() {
@@ -341536,6 +341542,7 @@ var init_UnDiscriminatedOneOfSchema = __esm({
341536
341542
  var init_types28 = __esm({
341537
341543
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/index.js"() {
341538
341544
  init_OpenApiIntermediateRepresentation();
341545
+ init_SdkGroupInfo();
341539
341546
  init_GlobalHeader();
341540
341547
  init_Tags();
341541
341548
  init_HttpError();
@@ -344300,6 +344307,7 @@ var init_OpenApiIntermediateRepresentation2 = __esm({
344300
344307
  title: schemas_exports5.string().optional(),
344301
344308
  description: schemas_exports5.string().optional(),
344302
344309
  servers: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Server)),
344310
+ groups: schemas_exports5.record(schemas_exports5.string(), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SdkGroupInfo)),
344303
344311
  tags: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Tags),
344304
344312
  hasEndpointsMarkedInternal: schemas_exports5.boolean(),
344305
344313
  endpoints: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Endpoint)),
@@ -344315,6 +344323,18 @@ var init_OpenApiIntermediateRepresentation2 = __esm({
344315
344323
  }
344316
344324
  });
344317
344325
 
344326
+ // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/SdkGroupInfo.js
344327
+ var SdkGroupInfo;
344328
+ var init_SdkGroupInfo2 = __esm({
344329
+ "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/SdkGroupInfo.js"() {
344330
+ init_core3();
344331
+ SdkGroupInfo = schemas_exports5.objectWithoutOptionalProperties({
344332
+ summary: schemas_exports5.string().optional(),
344333
+ description: schemas_exports5.string().optional()
344334
+ });
344335
+ }
344336
+ });
344337
+
344318
344338
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/GlobalHeader.js
344319
344339
  var GlobalHeader;
344320
344340
  var init_GlobalHeader2 = __esm({
@@ -345216,6 +345236,7 @@ var init_UnDiscriminatedOneOfSchema2 = __esm({
345216
345236
  var init_types32 = __esm({
345217
345237
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/index.js"() {
345218
345238
  init_OpenApiIntermediateRepresentation2();
345239
+ init_SdkGroupInfo2();
345219
345240
  init_GlobalHeader2();
345220
345241
  init_Tags2();
345221
345242
  init_HttpError2();
@@ -345326,6 +345347,7 @@ __export(finalIr_exports2, {
345326
345347
  Request: () => Request3,
345327
345348
  Response: () => Response3,
345328
345349
  Schema: () => Schema3,
345350
+ SdkGroupInfo: () => SdkGroupInfo,
345329
345351
  StringSchema: () => StringSchema,
345330
345352
  SupportedSdkLanguage: () => SupportedSdkLanguage4,
345331
345353
  Tags: () => Tags,
@@ -346087,6 +346109,7 @@ __export(serialization_exports3, {
346087
346109
  Schema: () => Schema3,
346088
346110
  SchemaId: () => SchemaId,
346089
346111
  SchemaWithExample: () => SchemaWithExample2,
346112
+ SdkGroupInfo: () => SdkGroupInfo,
346090
346113
  SdkGroupName: () => SdkGroupName,
346091
346114
  SecurityScheme: () => SecurityScheme2,
346092
346115
  SecuritySchemeId: () => SecuritySchemeId,
@@ -827010,7 +827033,7 @@ var AccessTokenPosthogManager = class {
827010
827033
  properties: {
827011
827034
  ...event,
827012
827035
  ...event.properties,
827013
- version: "0.19.22",
827036
+ version: "0.19.23",
827014
827037
  usingAccessToken: true
827015
827038
  }
827016
827039
  });
@@ -827072,7 +827095,7 @@ var UserPosthogManager = class {
827072
827095
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
827073
827096
  event: "CLI",
827074
827097
  properties: {
827075
- version: "0.19.22",
827098
+ version: "0.19.23",
827076
827099
  ...event,
827077
827100
  ...event.properties
827078
827101
  }
@@ -839766,6 +839789,7 @@ var FernOpenAPIExtension = {
839766
839789
  BOOLEAN_LITERAL: "x-fern-boolean-literal",
839767
839790
  SERVER_NAME_V1: "x-name",
839768
839791
  SERVER_NAME_V2: "x-fern-server-name",
839792
+ GROUPS: TypedExtensionId.of("x-fern-groups"),
839769
839793
  OPENAPI_OVERIDES_FILEPATH: "x-fern-overrides-filepath",
839770
839794
  TYPE_DEFINITION: "x-fern-type",
839771
839795
  STREAMING: "x-fern-streaming",
@@ -842911,6 +842935,7 @@ var ExampleWebsocketSessionFactory = class {
842911
842935
 
842912
842936
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/asyncapi/fernExtensions.js
842913
842937
  var FernAsyncAPIExtension = {
842938
+ FERN_DISPLAY_NAME: "x-fern-display-name",
842914
842939
  FERN_EXAMPLES: "x-fern-examples"
842915
842940
  };
842916
842941
 
@@ -843033,7 +843058,7 @@ function parseAsyncAPI({ document: document4, taskContext }) {
843033
843058
  groupName: (tag == null ? void 0 : tag.name) != null ? [tag.name] : ["Websocket"],
843034
843059
  publish: publishSchema != null ? convertSchemaWithExampleToSchema(publishSchema) : publishSchema,
843035
843060
  subscribe: subscribeSchema != null ? convertSchemaWithExampleToSchema(subscribeSchema) : subscribeSchema,
843036
- summary: void 0,
843061
+ summary: getExtension(channel, FernAsyncAPIExtension.FERN_DISPLAY_NAME),
843037
843062
  path: channelPath,
843038
843063
  description: void 0,
843039
843064
  examples
@@ -844468,6 +844493,15 @@ function convertToError({ statusCode, errorBodyCollector, context }) {
844468
844493
  };
844469
844494
  }
844470
844495
 
844496
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernGroups.js
844497
+ var XFernGroupsSchema = z.record(z.string(), z.object({
844498
+ summary: z.string().optional(),
844499
+ description: z.string().optional()
844500
+ }));
844501
+ function getFernGroups({ document: document4, context }) {
844502
+ return getExtensionAndValidate(document4, FernOpenAPIExtension.GROUPS, XFernGroupsSchema, context);
844503
+ }
844504
+
844471
844505
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getGlobalHeaders.js
844472
844506
  function getGlobalHeaders(document4) {
844473
844507
  const globalHeaders = getExtension(document4, FernOpenAPIExtension.FERN_GLOBAL_HEADERS);
@@ -844842,9 +844876,13 @@ function generateIr({ openApi, taskContext, disableExamples }) {
844842
844876
  schemas[key2] = schema2;
844843
844877
  taskContext.logger.debug(`Converted schema ${key2}`);
844844
844878
  }
844879
+ const groupInfo = getFernGroups({ document: openApi, context });
844845
844880
  const ir = {
844846
844881
  title: openApi.info.title,
844847
844882
  description: openApi.info.description,
844883
+ groups: Object.fromEntries(Object.entries(groupInfo ?? {}).map(([key2, value]) => {
844884
+ return [key2, { summary: value.summary ?? void 0, description: value.description ?? void 0 }];
844885
+ })),
844848
844886
  servers: (openApi.servers ?? []).map((server) => convertServer(server)),
844849
844887
  tags: {
844850
844888
  tagsById: Object.fromEntries((openApi.tags ?? []).map((tag) => {
@@ -844952,7 +844990,8 @@ async function parse3({ workspace, taskContext }) {
844952
844990
  variables: {},
844953
844991
  nonRequestReferencedSchemas: /* @__PURE__ */ new Set(),
844954
844992
  securitySchemes: {},
844955
- globalHeaders: []
844993
+ globalHeaders: [],
844994
+ groups: {}
844956
844995
  };
844957
844996
  for (const spec of workspace.specs) {
844958
844997
  const contents = (await (0, import_promises25.readFile)(spec.absoluteFilepath)).toString();
@@ -845032,7 +845071,11 @@ function merge3(ir1, ir2) {
845032
845071
  ...ir1.securitySchemes,
845033
845072
  ...ir2.securitySchemes
845034
845073
  },
845035
- globalHeaders: ir1.globalHeaders != null ? [...ir1.globalHeaders, ...ir2.globalHeaders ?? []] : void 0
845074
+ globalHeaders: ir1.globalHeaders != null ? [...ir1.globalHeaders, ...ir2.globalHeaders ?? []] : void 0,
845075
+ groups: {
845076
+ ...ir1.groups,
845077
+ ...ir2.groups
845078
+ }
845036
845079
  };
845037
845080
  }
845038
845081
  async function loadAsyncAPI({ absoluteFilePathToAsyncAPI, absoluteFilePathToAsyncAPIOverrides, context }) {
@@ -845397,6 +845440,9 @@ function buildChannel({ channel, context, declarationFile }) {
845397
845440
  path: channel.path,
845398
845441
  auth: false
845399
845442
  };
845443
+ if (channel.summary != null) {
845444
+ convertedChannel["display-name"] = channel.summary;
845445
+ }
845400
845446
  const queryParameters = {};
845401
845447
  if (channel.handshake.queryParameters.length > 0) {
845402
845448
  for (const queryParameter of channel.handshake.queryParameters) {
@@ -846245,6 +846291,19 @@ function buildServices(context) {
846245
846291
  if (sdkGroup != null) {
846246
846292
  sdkGroups.add(sdkGroup);
846247
846293
  }
846294
+ let group = void 0;
846295
+ if (endpoint.sdkName != null) {
846296
+ const groupInfo = context.ir.groups;
846297
+ for (const groupName of endpoint.sdkName.groupName) {
846298
+ const value = groupInfo[groupName];
846299
+ if (value == null) {
846300
+ break;
846301
+ } else if (value.summary != null || value.description != null) {
846302
+ group = groupInfo[groupName];
846303
+ break;
846304
+ }
846305
+ }
846306
+ }
846248
846307
  const irTag = tag == null ? void 0 : tags.tagsById[tag];
846249
846308
  const convertedEndpoint = buildEndpoint({
846250
846309
  context,
@@ -846258,8 +846317,8 @@ function buildServices(context) {
846258
846317
  });
846259
846318
  if ((irTag == null ? void 0 : irTag.id) != null || (irTag == null ? void 0 : irTag.description) != null) {
846260
846319
  context.builder.setServiceInfo(file, {
846261
- displayName: irTag == null ? void 0 : irTag.id,
846262
- docs: (irTag == null ? void 0 : irTag.description) ?? void 0
846320
+ displayName: (group == null ? void 0 : group.summary) ?? (irTag == null ? void 0 : irTag.id),
846321
+ docs: (group == null ? void 0 : group.description) ?? (irTag == null ? void 0 : irTag.description) ?? void 0
846263
846322
  });
846264
846323
  }
846265
846324
  }
@@ -850806,10 +850865,10 @@ var CliContext = class {
850806
850865
  return "fern-api";
850807
850866
  }
850808
850867
  getPackageVersion() {
850809
- if ("0.19.22" == null) {
850868
+ if ("0.19.23" == null) {
850810
850869
  this.logger.error("CLI_VERSION is not defined");
850811
850870
  }
850812
- return "0.19.22";
850871
+ return "0.19.23";
850813
850872
  }
850814
850873
  getCliName() {
850815
850874
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.19.22",
3
+ "version": "0.19.23",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",