fern-api 0.16.4 → 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 +20 -25
  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.4",
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.4",
736750
+ version: "0.16.5",
736751
736751
  ...event,
736752
736752
  ...event.properties
736753
736753
  }
@@ -751985,7 +751985,7 @@ function getProperty(object, property2) {
751985
751985
  var import_finalIr9 = __toESM(require_finalIr());
751986
751986
  var import_parseIr11 = __toESM(require_parseIr());
751987
751987
  var APPLICATION_JSON_CONTENT = "application/json";
751988
- var APPLICATION_JSON_UTF_8_CONTENT = "application/json; charset=utf-8";
751988
+ var APPLICATION_JSON_REGEX = /^application.*json$/;
751989
751989
  var MULTIPART_CONTENT = "multipart/form-data";
751990
751990
  var OCTET_STREAM = "application/octet-stream";
751991
751991
  function getMultipartFormDataRequest(requestBody) {
@@ -751997,23 +751997,18 @@ function getOctetStreamRequest(requestBody) {
751997
751997
  return (_a2 = requestBody.content[OCTET_STREAM]) == null ? void 0 : _a2.schema;
751998
751998
  }
751999
751999
  function getApplicationJsonRequest(requestBody) {
752000
- const applicationJsonSchema = getSchemaForContentType({
752001
- contentType: APPLICATION_JSON_CONTENT,
752002
- media: requestBody.content
752003
- });
752004
- if (applicationJsonSchema != null) {
752005
- return {
752006
- schema: applicationJsonSchema
752007
- };
752008
- }
752009
- const applicationJsonUtf8Schema = getSchemaForContentType({
752010
- contentType: APPLICATION_JSON_UTF_8_CONTENT,
752011
- media: requestBody.content
752012
- });
752013
- if (applicationJsonUtf8Schema != null) {
752014
- return {
752015
- schema: applicationJsonUtf8Schema
752016
- };
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
+ }
752017
752012
  }
752018
752013
  return void 0;
752019
752014
  }
@@ -752433,7 +752428,7 @@ var HEADERS_TO_SKIP = /* @__PURE__ */ new Set([
752433
752428
 
752434
752429
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/convertResponse.js
752435
752430
  var APPLICATION_JSON_CONTENT2 = "application/json";
752436
- var APPLICATION_JSON_UTF_8_CONTENT2 = "application/json; charset=utf-8";
752431
+ var APPLICATION_JSON_UTF_8_CONTENT = "application/json; charset=utf-8";
752437
752432
  var APPLICATION_OCTET_STREAM_CONTENT = "application/octet-stream";
752438
752433
  var APPLICATION_PDF = "application/pdf";
752439
752434
  var APPLICATION_VND_JSON = "application/x-ndjson";
@@ -752483,7 +752478,7 @@ function convertResponse({ responses, context, responseBreadcrumbs, responseStat
752483
752478
  function convertResolvedResponse({ isStreaming, response, context, responseBreadcrumbs }) {
752484
752479
  var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
752485
752480
  const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
752486
- 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);
752487
752482
  if (responseSchema != null) {
752488
752483
  if (isStreaming) {
752489
752484
  return {
@@ -752551,7 +752546,7 @@ function markErrorSchemas({ responses, context }) {
752551
752546
  }
752552
752547
  errorStatusCodes.push(parsedStatusCode);
752553
752548
  const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
752554
- 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) ?? {};
752555
752550
  context.markSchemaForStatusCode(parsedStatusCode, errorSchema);
752556
752551
  }
752557
752552
  return errorStatusCodes;
@@ -761172,10 +761167,10 @@ var CliContext = class {
761172
761167
  return "fern-api";
761173
761168
  }
761174
761169
  getPackageVersion() {
761175
- if ("0.16.4" == null) {
761170
+ if ("0.16.5" == null) {
761176
761171
  this.logger.error("CLI_VERSION is not defined");
761177
761172
  }
761178
- return "0.16.4";
761173
+ return "0.16.5";
761179
761174
  }
761180
761175
  getCliName() {
761181
761176
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",