fern-api 0.19.10 → 0.19.12

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 +230 -40
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -12480,9 +12480,9 @@ var require_src = __commonJS({
12480
12480
  }
12481
12481
  });
12482
12482
 
12483
- // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/debug.js
12483
+ // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/debug.js
12484
12484
  var require_debug = __commonJS({
12485
- "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/debug.js"(exports2, module2) {
12485
+ "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/debug.js"(exports2, module2) {
12486
12486
  var debug;
12487
12487
  module2.exports = function() {
12488
12488
  if (!debug) {
@@ -12500,9 +12500,9 @@ var require_debug = __commonJS({
12500
12500
  }
12501
12501
  });
12502
12502
 
12503
- // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/index.js
12503
+ // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/index.js
12504
12504
  var require_follow_redirects = __commonJS({
12505
- "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/index.js"(exports2, module2) {
12505
+ "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/index.js"(exports2, module2) {
12506
12506
  var url = require("url");
12507
12507
  var URL2 = url.URL;
12508
12508
  var http3 = require("http");
@@ -12813,7 +12813,7 @@ var require_follow_redirects = __commonJS({
12813
12813
  this._isRedirect = true;
12814
12814
  spreadUrlObject(redirectUrl, this._options);
12815
12815
  if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
12816
- removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
12816
+ removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
12817
12817
  }
12818
12818
  if (isFunction2(beforeRedirect)) {
12819
12819
  var responseDetails = {
@@ -106983,16 +106983,16 @@ var require_proxy_from_env = __commonJS({
106983
106983
  }
106984
106984
  });
106985
106985
 
106986
- // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/http.js
106986
+ // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/http.js
106987
106987
  var require_http2 = __commonJS({
106988
- "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/http.js"(exports2, module2) {
106988
+ "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/http.js"(exports2, module2) {
106989
106989
  module2.exports = require_follow_redirects().http;
106990
106990
  }
106991
106991
  });
106992
106992
 
106993
- // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/https.js
106993
+ // pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/https.js
106994
106994
  var require_https = __commonJS({
106995
- "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-c3a9c2b13a/0/cache/follow-redirects-npm-1.15.5-9d14db76ca-5ca49b5ce6.zip/node_modules/follow-redirects/https.js"(exports2, module2) {
106995
+ "pnp:/home/circleci/project/.yarn/__virtual__/follow-redirects-virtual-daf9138e0d/0/cache/follow-redirects-npm-1.15.6-50635fe51d-a62c378dfc.zip/node_modules/follow-redirects/https.js"(exports2, module2) {
106996
106996
  module2.exports = require_follow_redirects().https;
106997
106997
  }
106998
106998
  });
@@ -349202,6 +349202,10 @@ var init_types26 = __esm({
349202
349202
  });
349203
349203
 
349204
349204
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/commons/index.js
349205
+ var commons_exports3 = {};
349206
+ __export(commons_exports3, {
349207
+ SecurityScheme: () => SecurityScheme
349208
+ });
349205
349209
  var init_commons3 = __esm({
349206
349210
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/commons/index.js"() {
349207
349211
  init_types26();
@@ -349535,6 +349539,13 @@ var init_types27 = __esm({
349535
349539
  });
349536
349540
 
349537
349541
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/example/index.js
349542
+ var example_exports = {};
349543
+ __export(example_exports, {
349544
+ FullExample: () => FullExample,
349545
+ FullOneOfExample: () => FullOneOfExample,
349546
+ LiteralExample: () => LiteralExample,
349547
+ PrimitiveExample: () => PrimitiveExample
349548
+ });
349538
349549
  var init_example = __esm({
349539
349550
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/example/index.js"() {
349540
349551
  init_types27();
@@ -349596,8 +349607,23 @@ var init_WebsocketMessageExample = __esm({
349596
349607
  });
349597
349608
 
349598
349609
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/WebhookHttpMethod.js
349610
+ var WebhookHttpMethod3;
349599
349611
  var init_WebhookHttpMethod3 = __esm({
349600
349612
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/WebhookHttpMethod.js"() {
349613
+ WebhookHttpMethod3 = {
349614
+ Get: "GET",
349615
+ Post: "POST",
349616
+ _visit: (value, visitor) => {
349617
+ switch (value) {
349618
+ case WebhookHttpMethod3.Get:
349619
+ return visitor.get();
349620
+ case WebhookHttpMethod3.Post:
349621
+ return visitor.post();
349622
+ default:
349623
+ return visitor._other();
349624
+ }
349625
+ }
349626
+ };
349601
349627
  }
349602
349628
  });
349603
349629
 
@@ -349682,8 +349708,62 @@ var init_CustomCodeSampleSdk = __esm({
349682
349708
  });
349683
349709
 
349684
349710
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/SupportedSdkLanguage.js
349711
+ var SupportedSdkLanguage3;
349685
349712
  var init_SupportedSdkLanguage3 = __esm({
349686
349713
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/SupportedSdkLanguage.js"() {
349714
+ SupportedSdkLanguage3 = {
349715
+ Curl: "curl",
349716
+ Python: "python",
349717
+ Javascript: "javascript",
349718
+ Typescript: "typescript",
349719
+ Go: "go",
349720
+ Ruby: "ruby",
349721
+ Csharp: "csharp",
349722
+ Java: "java",
349723
+ Js: "js",
349724
+ Node: "node",
349725
+ Ts: "ts",
349726
+ Nodets: "nodets",
349727
+ Golang: "golang",
349728
+ Dotnet: "dotnet",
349729
+ Jvm: "jvm",
349730
+ _visit: (value, visitor) => {
349731
+ switch (value) {
349732
+ case SupportedSdkLanguage3.Curl:
349733
+ return visitor.curl();
349734
+ case SupportedSdkLanguage3.Python:
349735
+ return visitor.python();
349736
+ case SupportedSdkLanguage3.Javascript:
349737
+ return visitor.javascript();
349738
+ case SupportedSdkLanguage3.Typescript:
349739
+ return visitor.typescript();
349740
+ case SupportedSdkLanguage3.Go:
349741
+ return visitor.go();
349742
+ case SupportedSdkLanguage3.Ruby:
349743
+ return visitor.ruby();
349744
+ case SupportedSdkLanguage3.Csharp:
349745
+ return visitor.csharp();
349746
+ case SupportedSdkLanguage3.Java:
349747
+ return visitor.java();
349748
+ case SupportedSdkLanguage3.Js:
349749
+ return visitor.js();
349750
+ case SupportedSdkLanguage3.Node:
349751
+ return visitor.node();
349752
+ case SupportedSdkLanguage3.Ts:
349753
+ return visitor.ts();
349754
+ case SupportedSdkLanguage3.Nodets:
349755
+ return visitor.nodets();
349756
+ case SupportedSdkLanguage3.Golang:
349757
+ return visitor.golang();
349758
+ case SupportedSdkLanguage3.Dotnet:
349759
+ return visitor.dotnet();
349760
+ case SupportedSdkLanguage3.Jvm:
349761
+ return visitor.jvm();
349762
+ default:
349763
+ return visitor._other();
349764
+ }
349765
+ }
349766
+ };
349687
349767
  }
349688
349768
  });
349689
349769
 
@@ -350473,6 +350553,21 @@ var init_types28 = __esm({
350473
350553
  });
350474
350554
 
350475
350555
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/index.js
350556
+ var finalIr_exports = {};
350557
+ __export(finalIr_exports, {
350558
+ CustomCodeSample: () => CustomCodeSample,
350559
+ EndpointAvailability: () => EndpointAvailability,
350560
+ HttpMethod: () => HttpMethod3,
350561
+ LiteralSchemaValue: () => LiteralSchemaValue,
350562
+ MultipartSchema: () => MultipartSchema,
350563
+ OneOfSchema: () => OneOfSchema,
350564
+ PrimitiveSchemaValue: () => PrimitiveSchemaValue,
350565
+ Request: () => Request2,
350566
+ Response: () => Response2,
350567
+ Schema: () => Schema2,
350568
+ SupportedSdkLanguage: () => SupportedSdkLanguage3,
350569
+ WebhookHttpMethod: () => WebhookHttpMethod3
350570
+ });
350476
350571
  var init_finalIr = __esm({
350477
350572
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/index.js"() {
350478
350573
  init_types28();
@@ -351104,6 +351199,14 @@ var init_types29 = __esm({
351104
351199
  });
351105
351200
 
351106
351201
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/parseIr/index.js
351202
+ var parseIr_exports = {};
351203
+ __export(parseIr_exports, {
351204
+ OneOfSchemaWithExample: () => OneOfSchemaWithExample,
351205
+ PrimitiveSchemaValueWithExample: () => PrimitiveSchemaValueWithExample,
351206
+ RequestWithExample: () => RequestWithExample,
351207
+ ResponseWithExample: () => ResponseWithExample,
351208
+ SchemaWithExample: () => SchemaWithExample
351209
+ });
351107
351210
  var init_parseIr = __esm({
351108
351211
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/parseIr/index.js"() {
351109
351212
  init_types29();
@@ -351125,6 +351228,35 @@ var init_resources4 = __esm({
351125
351228
  });
351126
351229
 
351127
351230
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/index.js
351231
+ var api_exports3 = {};
351232
+ __export(api_exports3, {
351233
+ CustomCodeSample: () => CustomCodeSample,
351234
+ EndpointAvailability: () => EndpointAvailability,
351235
+ FullExample: () => FullExample,
351236
+ FullOneOfExample: () => FullOneOfExample,
351237
+ HttpMethod: () => HttpMethod3,
351238
+ LiteralExample: () => LiteralExample,
351239
+ LiteralSchemaValue: () => LiteralSchemaValue,
351240
+ MultipartSchema: () => MultipartSchema,
351241
+ OneOfSchema: () => OneOfSchema,
351242
+ OneOfSchemaWithExample: () => OneOfSchemaWithExample,
351243
+ PrimitiveExample: () => PrimitiveExample,
351244
+ PrimitiveSchemaValue: () => PrimitiveSchemaValue,
351245
+ PrimitiveSchemaValueWithExample: () => PrimitiveSchemaValueWithExample,
351246
+ Request: () => Request2,
351247
+ RequestWithExample: () => RequestWithExample,
351248
+ Response: () => Response2,
351249
+ ResponseWithExample: () => ResponseWithExample,
351250
+ Schema: () => Schema2,
351251
+ SchemaWithExample: () => SchemaWithExample,
351252
+ SecurityScheme: () => SecurityScheme,
351253
+ SupportedSdkLanguage: () => SupportedSdkLanguage3,
351254
+ WebhookHttpMethod: () => WebhookHttpMethod3,
351255
+ commons: () => commons_exports3,
351256
+ example: () => example_exports,
351257
+ finalIr: () => finalIr_exports,
351258
+ parseIr: () => parseIr_exports
351259
+ });
351128
351260
  var init_api2 = __esm({
351129
351261
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/index.js"() {
351130
351262
  init_resources4();
@@ -352811,7 +352943,7 @@ var SdkGroupName;
352811
352943
  var init_SdkGroupName2 = __esm({
352812
352944
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/commons/types/SdkGroupName.js"() {
352813
352945
  init_core3();
352814
- SdkGroupName = schemas_exports5.string();
352946
+ SdkGroupName = schemas_exports5.list(schemas_exports5.string());
352815
352947
  }
352816
352948
  });
352817
352949
 
@@ -353202,7 +353334,7 @@ var init_WebsocketChannel2 = __esm({
353202
353334
  init_core3();
353203
353335
  WebsocketChannel = schemas_exports5.objectWithoutOptionalProperties({
353204
353336
  path: schemas_exports5.string(),
353205
- groupName: schemas_exports5.list(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SdkGroupName)),
353337
+ groupName: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SdkGroupName),
353206
353338
  summary: schemas_exports5.string().optional(),
353207
353339
  handshake: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WebsocketHandshake),
353208
353340
  publish: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Schema).optional(),
@@ -353251,11 +353383,11 @@ var init_WebsocketMessageExample2 = __esm({
353251
353383
  });
353252
353384
 
353253
353385
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/WebhookHttpMethod.js
353254
- var WebhookHttpMethod3;
353386
+ var WebhookHttpMethod4;
353255
353387
  var init_WebhookHttpMethod4 = __esm({
353256
353388
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/WebhookHttpMethod.js"() {
353257
353389
  init_core3();
353258
- WebhookHttpMethod3 = schemas_exports5.enum_(["GET", "POST"]);
353390
+ WebhookHttpMethod4 = schemas_exports5.enum_(["GET", "POST"]);
353259
353391
  }
353260
353392
  });
353261
353393
 
@@ -353351,11 +353483,11 @@ var init_CustomCodeSampleSdk2 = __esm({
353351
353483
  });
353352
353484
 
353353
353485
  // pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/SupportedSdkLanguage.js
353354
- var SupportedSdkLanguage3;
353486
+ var SupportedSdkLanguage4;
353355
353487
  var init_SupportedSdkLanguage4 = __esm({
353356
353488
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/SupportedSdkLanguage.js"() {
353357
353489
  init_core3();
353358
- SupportedSdkLanguage3 = schemas_exports5.enum_([
353490
+ SupportedSdkLanguage4 = schemas_exports5.enum_([
353359
353491
  "curl",
353360
353492
  "python",
353361
353493
  "javascript",
@@ -353434,7 +353566,7 @@ var init_EndpointSdkName2 = __esm({
353434
353566
  "pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/EndpointSdkName.js"() {
353435
353567
  init_core3();
353436
353568
  EndpointSdkName = schemas_exports5.objectWithoutOptionalProperties({
353437
- groupName: schemas_exports5.list(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SdkGroupName)),
353569
+ groupName: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SdkGroupName),
353438
353570
  methodName: schemas_exports5.string()
353439
353571
  });
353440
353572
  }
@@ -354151,12 +354283,12 @@ __export(finalIr_exports2, {
354151
354283
  Response: () => Response3,
354152
354284
  Schema: () => Schema3,
354153
354285
  StringSchema: () => StringSchema,
354154
- SupportedSdkLanguage: () => SupportedSdkLanguage3,
354286
+ SupportedSdkLanguage: () => SupportedSdkLanguage4,
354155
354287
  Tags: () => Tags,
354156
354288
  TextResponse: () => TextResponse2,
354157
354289
  UnDiscriminatedOneOfSchema: () => UnDiscriminatedOneOfSchema,
354158
354290
  Webhook: () => Webhook2,
354159
- WebhookHttpMethod: () => WebhookHttpMethod3,
354291
+ WebhookHttpMethod: () => WebhookHttpMethod4,
354160
354292
  WebsocketChannel: () => WebsocketChannel,
354161
354293
  WebsocketHandshake: () => WebsocketHandshake,
354162
354294
  WebsocketMessageExample: () => WebsocketMessageExample,
@@ -354918,7 +355050,7 @@ __export(serialization_exports3, {
354918
355050
  StatusCode: () => StatusCode,
354919
355051
  StringSchema: () => StringSchema,
354920
355052
  StringSchemaWithExample: () => StringSchemaWithExample,
354921
- SupportedSdkLanguage: () => SupportedSdkLanguage3,
355053
+ SupportedSdkLanguage: () => SupportedSdkLanguage4,
354922
355054
  Tag: () => Tag,
354923
355055
  TagId: () => TagId,
354924
355056
  Tags: () => Tags,
@@ -354927,7 +355059,7 @@ __export(serialization_exports3, {
354927
355059
  UnDiscriminatedOneOfSchemaWithExample: () => UnDiscriminatedOneOfSchemaWithExample,
354928
355060
  UnknownSchemaWithExample: () => UnknownSchemaWithExample,
354929
355061
  Webhook: () => Webhook2,
354930
- WebhookHttpMethod: () => WebhookHttpMethod3,
355062
+ WebhookHttpMethod: () => WebhookHttpMethod4,
354931
355063
  WebsocketChannel: () => WebsocketChannel,
354932
355064
  WebsocketHandshake: () => WebsocketHandshake,
354933
355065
  WebsocketHandshakeWithExample: () => WebsocketHandshakeWithExample,
@@ -831746,7 +831878,7 @@ var AccessTokenPosthogManager = class {
831746
831878
  properties: {
831747
831879
  ...event,
831748
831880
  ...event.properties,
831749
- version: "0.19.10",
831881
+ version: "0.19.12",
831750
831882
  usingAccessToken: true
831751
831883
  }
831752
831884
  });
@@ -831808,7 +831940,7 @@ var UserPosthogManager = class {
831808
831940
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
831809
831941
  event: "CLI",
831810
831942
  properties: {
831811
- version: "0.19.10",
831943
+ version: "0.19.12",
831812
831944
  ...event,
831813
831945
  ...event.properties
831814
831946
  }
@@ -843800,7 +843932,7 @@ function buildReferenceTypeReference({ schema: schema2, fileContainingReference,
843800
843932
  const typeWithPrefix = getPrefixedType({
843801
843933
  context,
843802
843934
  fileContainingReference,
843803
- declarationFile: groupName != null ? RelativeFilePath.of(`${camelCase_default(groupName)}.yml`) : RelativeFilePath.of(FERN_PACKAGE_MARKER_FILENAME),
843935
+ declarationFile: groupName != null && groupName.length > 0 ? RelativeFilePath.of(`${groupName.map(camelCase_default).join("/")}.yml`) : RelativeFilePath.of(FERN_PACKAGE_MARKER_FILENAME),
843804
843936
  type: schemaName
843805
843937
  });
843806
843938
  const type2 = resolvedSchema.type === "nullable" ? `optional<${typeWithPrefix}>` : typeWithPrefix;
@@ -844469,10 +844601,17 @@ var OpenAPIExtension = {
844469
844601
  TAGS: "x-tags"
844470
844602
  };
844471
844603
 
844604
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/id.js
844605
+ var TypedExtensionId = {
844606
+ of(key2) {
844607
+ return key2;
844608
+ }
844609
+ };
844610
+
844472
844611
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/fernExtensions.js
844473
844612
  var FernOpenAPIExtension = {
844474
- SDK_METHOD_NAME: "x-fern-sdk-method-name",
844475
- SDK_GROUP_NAME: "x-fern-sdk-group-name",
844613
+ SDK_METHOD_NAME: TypedExtensionId.of("x-fern-sdk-method-name"),
844614
+ SDK_GROUP_NAME: TypedExtensionId.of("x-fern-sdk-group-name"),
844476
844615
  REQUEST_NAME_V1: "x-request-name",
844477
844616
  REQUEST_NAME_V2: "x-fern-request-name",
844478
844617
  TYPE_NAME: "x-fern-type-name",
@@ -844522,7 +844661,7 @@ function getFernTypeExtension({ nameOverride, generatedName, schema: schema2, de
844522
844661
  nameOverride,
844523
844662
  generatedName,
844524
844663
  description,
844525
- groupName
844664
+ groupName: typeof groupName === "string" ? [groupName] : groupName
844526
844665
  });
844527
844666
  }
844528
844667
  function getSchemaFromFernType({ fernType, nameOverride, generatedName, description, groupName }) {
@@ -845793,7 +845932,8 @@ function getTitleAsName(title) {
845793
845932
  function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude = /* @__PURE__ */ new Set(), referencedAsRequest = false) {
845794
845933
  var _a2;
845795
845934
  const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME) ?? getTitleAsName(schema2.title);
845796
- const groupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME) ?? ((_a2 = getExtension(schema2, OpenAPIExtension.TAGS)) == null ? void 0 : _a2[0]);
845935
+ const mixedGroupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME) ?? ((_a2 = getExtension(schema2, OpenAPIExtension.TAGS)) == null ? void 0 : _a2[0]);
845936
+ const groupName = typeof mixedGroupName === "string" ? [mixedGroupName] : mixedGroupName;
845797
845937
  const generatedName = getGeneratedTypeName(breadcrumbs);
845798
845938
  const description = schema2.description;
845799
845939
  const examples = getExtension(schema2, OpenAPIExtension.EXAMPLES);
@@ -846324,6 +846464,7 @@ function wrapLiteral({ literal: literal2, wrapAsNullable, groupName, description
846324
846464
  });
846325
846465
  }
846326
846466
  function wrapPrimitive({ primitive, wrapAsNullable, groupName, description, generatedName, nameOverride }) {
846467
+ groupName = typeof groupName === "string" ? [groupName] : groupName;
846327
846468
  if (wrapAsNullable) {
846328
846469
  return SchemaWithExample.nullable({
846329
846470
  nameOverride,
@@ -847022,6 +847163,11 @@ function isSchemaRequired4(schema2) {
847022
847163
  return schema2.type !== "optional" && schema2.type !== "nullable";
847023
847164
  }
847024
847165
 
847166
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/hasIncompleteExample.js
847167
+ function hasIncompleteExample(example) {
847168
+ return example.request == null && example.response == null && example.queryParameters == null && example.pathParameters == null && example.headers == null;
847169
+ }
847170
+
847025
847171
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/ExampleEndpointFactory.js
847026
847172
  var ExampleEndpointFactory = class {
847027
847173
  exampleTypeFactory;
@@ -847147,6 +847293,7 @@ var ExampleEndpointFactory = class {
847147
847293
  if (exampleName == null && (requestSchemaIdResponse == null ? void 0 : requestSchemaIdResponse.schema) != null) {
847148
847294
  exampleName = getNameFromSchemaWithExample(requestSchemaIdResponse.schema);
847149
847295
  }
847296
+ const codeSamples = endpoint.examples.filter(hasIncompleteExample).flatMap((example) => example.codeSamples);
847150
847297
  return {
847151
847298
  name: exampleName,
847152
847299
  description: void 0,
@@ -847155,7 +847302,7 @@ var ExampleEndpointFactory = class {
847155
847302
  headers,
847156
847303
  request: requestExample,
847157
847304
  response: responseExample,
847158
- codeSamples: []
847305
+ codeSamples
847159
847306
  };
847160
847307
  }
847161
847308
  isSchemaRequired(schema2) {
@@ -848083,7 +848230,38 @@ function getFernAvailability(operationObject) {
848083
848230
 
848084
848231
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernExamples.js
848085
848232
  function getFernExamples2(operationObject) {
848086
- return getExtension(operationObject, FernOpenAPIExtension.EXAMPLES) ?? [];
848233
+ const raw = getExtension(operationObject, FernOpenAPIExtension.EXAMPLES) ?? [];
848234
+ const validated = raw.map((value) => schemas_exports3.ExampleEndpointCallSchema.parse(value));
848235
+ return validated.map((value) => ({
848236
+ name: value.name,
848237
+ pathParameters: value["path-parameters"] ? Object.entries(value["path-parameters"]).map(([name2, value2]) => ({
848238
+ name: name2,
848239
+ value: value2
848240
+ })) : void 0,
848241
+ queryParameters: value["query-parameters"] ? Object.entries(value["query-parameters"]).map(([name2, value2]) => ({
848242
+ name: name2,
848243
+ value: value2
848244
+ })) : void 0,
848245
+ headers: value.headers ? Object.entries(value.headers).map(([name2, value2]) => ({
848246
+ name: name2,
848247
+ value: value2
848248
+ })) : void 0,
848249
+ request: value.request,
848250
+ response: value.response,
848251
+ codeSamples: (value["code-samples"] ?? []).map((value2) => "language" in value2 ? api_exports3.CustomCodeSample.language({
848252
+ name: value2.name,
848253
+ language: value2.language,
848254
+ code: value2.code,
848255
+ install: value2.install,
848256
+ description: value2.docs
848257
+ }) : api_exports3.CustomCodeSample.sdk({
848258
+ name: value2.name,
848259
+ sdk: value2.sdk === "c#" ? "csharp" : value2.sdk,
848260
+ code: value2.code,
848261
+ description: value2.docs
848262
+ })),
848263
+ description: void 0
848264
+ }));
848087
848265
  }
848088
848266
 
848089
848267
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/convertServer.js
@@ -849264,7 +849442,10 @@ function generateIr({ openApi, taskContext, disableExamples }) {
849264
849442
  if (!disableExamples && (examples.length === 0 || examples.every(hasIncompleteExample))) {
849265
849443
  const endpointExample = exampleEndpointFactory.buildEndpointExample(endpointWithExample);
849266
849444
  if (endpointExample != null) {
849267
- examples = [endpointExample, ...endpointWithExample.examples];
849445
+ examples = [
849446
+ endpointExample,
849447
+ ...endpointWithExample.examples.filter((example) => !hasIncompleteExample(example))
849448
+ ];
849268
849449
  }
849269
849450
  }
849270
849451
  const request = endpointWithExample.request;
@@ -849396,9 +849577,6 @@ function getAllParentSchemaIds({ schema: schema2, schemas }) {
849396
849577
  }
849397
849578
  return result2;
849398
849579
  }
849399
- function hasIncompleteExample(example) {
849400
- return example.request == null && example.response == null && example.queryParameters == null && example.pathParameters == null && example.headers == null;
849401
- }
849402
849580
 
849403
849581
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v2/generateIr.js
849404
849582
  async function generateIr2({ openApi, taskContext, disableExamples }) {
@@ -850124,7 +850302,7 @@ function buildEndpointExample({ endpointExample, context }) {
850124
850302
  if (endpointExample.response != null) {
850125
850303
  example.response = { body: convertFullExample2(endpointExample.response) };
850126
850304
  }
850127
- if (endpointExample.codeSamples.length > 0) {
850305
+ if (endpointExample.codeSamples != null && endpointExample.codeSamples.length > 0) {
850128
850306
  example["code-samples"] = endpointExample.codeSamples.map((codeSample) => {
850129
850307
  if (codeSample.type === "language") {
850130
850308
  return {
@@ -850869,6 +851047,12 @@ function getDeclarationFileFromGroupName(groupName) {
850869
851047
  if (groupName == null) {
850870
851048
  return PACKAGE_MARKER_RELATIVE_FILEPATH;
850871
851049
  }
851050
+ if (Array.isArray(groupName)) {
851051
+ if (groupName.length === 0) {
851052
+ return PACKAGE_MARKER_RELATIVE_FILEPATH;
851053
+ }
851054
+ return RelativeFilePath.of(`${groupName.map(camelCase_default).join("/")}.yml`);
851055
+ }
850872
851056
  return RelativeFilePath.of(`${camelCase_default(groupName)}.yml`);
850873
851057
  }
850874
851058
 
@@ -855272,10 +855456,10 @@ var CliContext = class {
855272
855456
  return "fern-api";
855273
855457
  }
855274
855458
  getPackageVersion() {
855275
- if ("0.19.10" == null) {
855459
+ if ("0.19.12" == null) {
855276
855460
  this.logger.error("CLI_VERSION is not defined");
855277
855461
  }
855278
- return "0.19.10";
855462
+ return "0.19.12";
855279
855463
  }
855280
855464
  getCliName() {
855281
855465
  if ("fern" == null) {
@@ -858301,7 +858485,7 @@ function convertPrimitiveExample({ example, typeBeingExemplified }) {
858301
858485
  }
858302
858486
  function convertObject4({ typeName, rawObject, example, fileContainingType, fileContainingExample, typeResolver, exampleResolver, workspace }) {
858303
858487
  if (!isPlainObject(example)) {
858304
- throw new Error("Example is not an object");
858488
+ throw new Error(`Example is not an object. Got: ${JSON.stringify(example)}`);
858305
858489
  }
858306
858490
  return ExampleTypeShape.object({
858307
858491
  properties: rawObject.properties != null ? Object.entries(example).reduce((exampleProperties, [wireKey, propertyExample]) => {
@@ -858673,8 +858857,11 @@ function convertExampleRequestBody({ endpoint, example, typeResolver, exampleRes
858673
858857
  workspace
858674
858858
  }));
858675
858859
  }
858860
+ if (!example.request) {
858861
+ return void 0;
858862
+ }
858676
858863
  if (!isPlainObject(example.request)) {
858677
- throw new Error("Example is not an object");
858864
+ throw new Error(`Example is not an object. Got: ${JSON.stringify(example.request)}`);
858678
858865
  }
858679
858866
  const exampleProperties = [];
858680
858867
  for (const [wireKey, propertyExample] of Object.entries(example.request)) {
@@ -858759,8 +858946,11 @@ function convertExampleResponseBody({ endpoint, example, typeResolver, exampleRe
858759
858946
  if (responseBodyType == null) {
858760
858947
  return void 0;
858761
858948
  }
858949
+ if (((_b2 = example.response) == null ? void 0 : _b2.body) == null) {
858950
+ return void 0;
858951
+ }
858762
858952
  return convertTypeReferenceExample({
858763
- example: (_b2 = example.response) == null ? void 0 : _b2.body,
858953
+ example: example.response.body,
858764
858954
  rawTypeBeingExemplified: responseBodyType,
858765
858955
  typeResolver,
858766
858956
  exampleResolver,
@@ -860251,7 +860441,7 @@ var ExampleGenerator = class {
860251
860441
  }
860252
860442
  jsonExampleToMapKey(jsonExample) {
860253
860443
  if (typeof jsonExample === "number") {
860254
- return 42;
860444
+ return 1;
860255
860445
  }
860256
860446
  return "string";
860257
860447
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.19.10",
3
+ "version": "0.19.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",