fern-api 0.16.3 → 0.16.5

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 +44 -26
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -736685,7 +736685,7 @@ var AccessTokenPosthogManager = class {
736685
736685
  properties: {
736686
736686
  ...event,
736687
736687
  ...event.properties,
736688
- version: "0.16.3",
736688
+ version: "0.16.5",
736689
736689
  usingAccessToken: true
736690
736690
  }
736691
736691
  });
@@ -736747,7 +736747,7 @@ var UserPosthogManager = class {
736747
736747
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
736748
736748
  event: "CLI",
736749
736749
  properties: {
736750
- version: "0.16.3",
736750
+ version: "0.16.5",
736751
736751
  ...event,
736752
736752
  ...event.properties
736753
736753
  }
@@ -749339,8 +749339,12 @@ function convertPrimitive(primitiveExample) {
749339
749339
  return primitiveExample.float;
749340
749340
  case "double":
749341
749341
  return primitiveExample.double;
749342
- case "string":
749342
+ case "string": {
749343
+ if (primitiveExample.string.startsWith("$")) {
749344
+ return `\\$${primitiveExample.string}`;
749345
+ }
749343
749346
  return primitiveExample.string;
749347
+ }
749344
749348
  case "datetime":
749345
749349
  return primitiveExample.datetime;
749346
749350
  case "date":
@@ -751532,6 +751536,25 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
751532
751536
  });
751533
751537
  }
751534
751538
  }
751539
+ if (isListOfStrings(schema2.type) && schema2.type.length > 1) {
751540
+ const wrapVariantAsNullable = schema2.type.includes("null");
751541
+ const subtypes = schema2.type.filter((val) => val !== "null").map((type2) => {
751542
+ return {
751543
+ type: type2,
751544
+ nullable: wrapVariantAsNullable
751545
+ };
751546
+ });
751547
+ return convertUndiscriminatedOneOf({
751548
+ nameOverride,
751549
+ generatedName,
751550
+ breadcrumbs,
751551
+ description,
751552
+ wrapAsNullable,
751553
+ context,
751554
+ subtypes,
751555
+ groupName
751556
+ });
751557
+ }
751535
751558
  if (schema2 === "boolean" || schema2.type === "boolean") {
751536
751559
  const literalValue = getExtension(schema2, FernOpenAPIExtension.BOOLEAN_LITERAL);
751537
751560
  if (literalValue != null) {
@@ -751962,7 +751985,7 @@ function getProperty(object, property2) {
751962
751985
  var import_finalIr9 = __toESM(require_finalIr());
751963
751986
  var import_parseIr11 = __toESM(require_parseIr());
751964
751987
  var APPLICATION_JSON_CONTENT = "application/json";
751965
- var APPLICATION_JSON_UTF_8_CONTENT = "application/json; charset=utf-8";
751988
+ var APPLICATION_JSON_REGEX = /^application.*json$/;
751966
751989
  var MULTIPART_CONTENT = "multipart/form-data";
751967
751990
  var OCTET_STREAM = "application/octet-stream";
751968
751991
  function getMultipartFormDataRequest(requestBody) {
@@ -751974,23 +751997,18 @@ function getOctetStreamRequest(requestBody) {
751974
751997
  return (_a2 = requestBody.content[OCTET_STREAM]) == null ? void 0 : _a2.schema;
751975
751998
  }
751976
751999
  function getApplicationJsonRequest(requestBody) {
751977
- const applicationJsonSchema = getSchemaForContentType({
751978
- contentType: APPLICATION_JSON_CONTENT,
751979
- media: requestBody.content
751980
- });
751981
- if (applicationJsonSchema != null) {
751982
- return {
751983
- schema: applicationJsonSchema
751984
- };
751985
- }
751986
- const applicationJsonUtf8Schema = getSchemaForContentType({
751987
- contentType: APPLICATION_JSON_UTF_8_CONTENT,
751988
- media: requestBody.content
751989
- });
751990
- if (applicationJsonUtf8Schema != null) {
751991
- return {
751992
- schema: applicationJsonUtf8Schema
751993
- };
752000
+ for (const contentType of Object.keys(requestBody.content)) {
752001
+ if (contentType.includes(APPLICATION_JSON_CONTENT) || APPLICATION_JSON_REGEX.test(contentType)) {
752002
+ const schema2 = getSchemaForContentType({
752003
+ contentType,
752004
+ media: requestBody.content
752005
+ });
752006
+ if (schema2 != null) {
752007
+ return {
752008
+ schema: schema2
752009
+ };
752010
+ }
752011
+ }
751994
752012
  }
751995
752013
  return void 0;
751996
752014
  }
@@ -752410,7 +752428,7 @@ var HEADERS_TO_SKIP = /* @__PURE__ */ new Set([
752410
752428
 
752411
752429
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/convertResponse.js
752412
752430
  var APPLICATION_JSON_CONTENT2 = "application/json";
752413
- var APPLICATION_JSON_UTF_8_CONTENT2 = "application/json; charset=utf-8";
752431
+ var APPLICATION_JSON_UTF_8_CONTENT = "application/json; charset=utf-8";
752414
752432
  var APPLICATION_OCTET_STREAM_CONTENT = "application/octet-stream";
752415
752433
  var APPLICATION_PDF = "application/pdf";
752416
752434
  var APPLICATION_VND_JSON = "application/x-ndjson";
@@ -752460,7 +752478,7 @@ function convertResponse({ responses, context, responseBreadcrumbs, responseStat
752460
752478
  function convertResolvedResponse({ isStreaming, response, context, responseBreadcrumbs }) {
752461
752479
  var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
752462
752480
  const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
752463
- const responseSchema = ((_b2 = (_a2 = resolvedResponse.content) == null ? void 0 : _a2[APPLICATION_JSON_CONTENT2]) == null ? void 0 : _b2.schema) ?? ((_d = (_c2 = resolvedResponse.content) == null ? void 0 : _c2[APPLICATION_JSON_UTF_8_CONTENT2]) == null ? void 0 : _d.schema) ?? ((_f = (_e = resolvedResponse.content) == null ? void 0 : _e[APPLICATION_VND_JSON]) == null ? void 0 : _f.schema);
752481
+ const responseSchema = ((_b2 = (_a2 = resolvedResponse.content) == null ? void 0 : _a2[APPLICATION_JSON_CONTENT2]) == null ? void 0 : _b2.schema) ?? ((_d = (_c2 = resolvedResponse.content) == null ? void 0 : _c2[APPLICATION_JSON_UTF_8_CONTENT]) == null ? void 0 : _d.schema) ?? ((_f = (_e = resolvedResponse.content) == null ? void 0 : _e[APPLICATION_VND_JSON]) == null ? void 0 : _f.schema);
752464
752482
  if (responseSchema != null) {
752465
752483
  if (isStreaming) {
752466
752484
  return {
@@ -752528,7 +752546,7 @@ function markErrorSchemas({ responses, context }) {
752528
752546
  }
752529
752547
  errorStatusCodes.push(parsedStatusCode);
752530
752548
  const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
752531
- const errorSchema = ((_b2 = (_a2 = resolvedResponse.content) == null ? void 0 : _a2[APPLICATION_JSON_CONTENT2]) == null ? void 0 : _b2.schema) ?? ((_d = (_c2 = resolvedResponse.content) == null ? void 0 : _c2[APPLICATION_JSON_UTF_8_CONTENT2]) == null ? void 0 : _d.schema) ?? {};
752549
+ const errorSchema = ((_b2 = (_a2 = resolvedResponse.content) == null ? void 0 : _a2[APPLICATION_JSON_CONTENT2]) == null ? void 0 : _b2.schema) ?? ((_d = (_c2 = resolvedResponse.content) == null ? void 0 : _c2[APPLICATION_JSON_UTF_8_CONTENT]) == null ? void 0 : _d.schema) ?? {};
752532
752550
  context.markSchemaForStatusCode(parsedStatusCode, errorSchema);
752533
752551
  }
752534
752552
  return errorStatusCodes;
@@ -761149,10 +761167,10 @@ var CliContext = class {
761149
761167
  return "fern-api";
761150
761168
  }
761151
761169
  getPackageVersion() {
761152
- if ("0.16.3" == null) {
761170
+ if ("0.16.5" == null) {
761153
761171
  this.logger.error("CLI_VERSION is not defined");
761154
761172
  }
761155
- return "0.16.3";
761173
+ return "0.16.5";
761156
761174
  }
761157
761175
  getCliName() {
761158
761176
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.16.3",
3
+ "version": "0.16.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",