fern-api 0.16.5 → 0.16.6

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 -36
  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.5",
736688
+ version: "0.16.6",
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.5",
736750
+ version: "0.16.6",
736751
736751
  ...event,
736752
736752
  ...event.properties
736753
736753
  }
@@ -751984,29 +751984,19 @@ function getProperty(object, property2) {
751984
751984
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/convertRequest.js
751985
751985
  var import_finalIr9 = __toESM(require_finalIr());
751986
751986
  var import_parseIr11 = __toESM(require_parseIr());
751987
+
751988
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/getApplicationJsonSchema.js
751987
751989
  var APPLICATION_JSON_CONTENT = "application/json";
751988
751990
  var APPLICATION_JSON_REGEX = /^application.*json$/;
751989
- var MULTIPART_CONTENT = "multipart/form-data";
751990
- var OCTET_STREAM = "application/octet-stream";
751991
- function getMultipartFormDataRequest(requestBody) {
751992
- var _a2;
751993
- return (_a2 = requestBody.content[MULTIPART_CONTENT]) == null ? void 0 : _a2.schema;
751994
- }
751995
- function getOctetStreamRequest(requestBody) {
751996
- var _a2;
751997
- return (_a2 = requestBody.content[OCTET_STREAM]) == null ? void 0 : _a2.schema;
751998
- }
751999
- function getApplicationJsonRequest(requestBody) {
752000
- for (const contentType of Object.keys(requestBody.content)) {
751991
+ function getApplicationJsonSchemaFromMedia(media) {
751992
+ for (const contentType of Object.keys(media)) {
752001
751993
  if (contentType.includes(APPLICATION_JSON_CONTENT) || APPLICATION_JSON_REGEX.test(contentType)) {
752002
751994
  const schema2 = getSchemaForContentType({
752003
751995
  contentType,
752004
- media: requestBody.content
751996
+ media
752005
751997
  });
752006
751998
  if (schema2 != null) {
752007
- return {
752008
- schema: schema2
752009
- };
751999
+ return schema2;
752010
752000
  }
752011
752001
  }
752012
752002
  }
@@ -752016,6 +752006,25 @@ function getSchemaForContentType({ contentType, media }) {
752016
752006
  var _a2;
752017
752007
  return (_a2 = media[contentType]) == null ? void 0 : _a2.schema;
752018
752008
  }
752009
+
752010
+ // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/convertRequest.js
752011
+ var APPLICATION_JSON_CONTENT2 = "application/json";
752012
+ var MULTIPART_CONTENT = "multipart/form-data";
752013
+ var OCTET_STREAM = "application/octet-stream";
752014
+ function getMultipartFormDataRequest(requestBody) {
752015
+ var _a2;
752016
+ return (_a2 = requestBody.content[MULTIPART_CONTENT]) == null ? void 0 : _a2.schema;
752017
+ }
752018
+ function getOctetStreamRequest(requestBody) {
752019
+ var _a2;
752020
+ return (_a2 = requestBody.content[OCTET_STREAM]) == null ? void 0 : _a2.schema;
752021
+ }
752022
+ function getApplicationJsonRequest(requestBody) {
752023
+ const schema2 = getApplicationJsonSchemaFromMedia(requestBody.content);
752024
+ return schema2 != null ? {
752025
+ schema: schema2
752026
+ } : schema2;
752027
+ }
752019
752028
  function multipartRequestHasFile(multipartSchema, document4) {
752020
752029
  const resolvedMultipartSchema = isReferenceObject(multipartSchema) ? resolveSchema(multipartSchema, document4) : {
752021
752030
  id: void 0,
@@ -752155,7 +752164,7 @@ function removeApplicationJsonAndMultipartConflictsFromOperationObject(operation
752155
752164
  };
752156
752165
  }
752157
752166
  function removeApplicationJsonAndMultipartConflictsFromRequestBody(requestBody) {
752158
- const jsonContent = requestBody.content[APPLICATION_JSON_CONTENT];
752167
+ const jsonContent = requestBody.content[APPLICATION_JSON_CONTENT2];
752159
752168
  const multipartContent = requestBody.content[MULTIPART_CONTENT];
752160
752169
  if (multipartContent != null && jsonContent != null) {
752161
752170
  return {
@@ -752427,11 +752436,8 @@ var HEADERS_TO_SKIP = /* @__PURE__ */ new Set([
752427
752436
  ]);
752428
752437
 
752429
752438
  // pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/convertResponse.js
752430
- var APPLICATION_JSON_CONTENT2 = "application/json";
752431
- var APPLICATION_JSON_UTF_8_CONTENT = "application/json; charset=utf-8";
752432
752439
  var APPLICATION_OCTET_STREAM_CONTENT = "application/octet-stream";
752433
752440
  var APPLICATION_PDF = "application/pdf";
752434
- var APPLICATION_VND_JSON = "application/x-ndjson";
752435
752441
  var AUDIO_MPEG = "audio/mpeg";
752436
752442
  var TEXT_PLAIN_CONTENT = "text/plain";
752437
752443
  var SUCCESSFUL_STATUS_CODES = ["200", "201", "204"];
@@ -752476,37 +752482,37 @@ function convertResponse({ responses, context, responseBreadcrumbs, responseStat
752476
752482
  };
752477
752483
  }
752478
752484
  function convertResolvedResponse({ isStreaming, response, context, responseBreadcrumbs }) {
752479
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
752485
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h;
752480
752486
  const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
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);
752482
- if (responseSchema != null) {
752487
+ const jsonResponseSchema = getApplicationJsonResponse(resolvedResponse);
752488
+ if (jsonResponseSchema != null) {
752483
752489
  if (isStreaming) {
752484
752490
  return {
752485
752491
  type: "streamingJson",
752486
752492
  description: resolvedResponse.description,
752487
- schema: convertSchemaWithExampleToSchema(convertSchema(responseSchema, false, context, responseBreadcrumbs))
752493
+ schema: convertSchemaWithExampleToSchema(convertSchema(jsonResponseSchema, false, context, responseBreadcrumbs))
752488
752494
  };
752489
752495
  }
752490
752496
  return {
752491
752497
  type: "json",
752492
752498
  description: resolvedResponse.description,
752493
- schema: convertSchema(responseSchema, false, context, responseBreadcrumbs)
752499
+ schema: convertSchema(jsonResponseSchema, false, context, responseBreadcrumbs)
752494
752500
  };
752495
752501
  }
752496
- if (((_h = (_g = resolvedResponse.content) == null ? void 0 : _g[APPLICATION_OCTET_STREAM_CONTENT]) == null ? void 0 : _h.schema) != null) {
752502
+ if (((_b2 = (_a2 = resolvedResponse.content) == null ? void 0 : _a2[APPLICATION_OCTET_STREAM_CONTENT]) == null ? void 0 : _b2.schema) != null) {
752497
752503
  return {
752498
752504
  type: "file",
752499
752505
  description: resolvedResponse.description
752500
752506
  };
752501
752507
  }
752502
- if (((_j = (_i = resolvedResponse.content) == null ? void 0 : _i[APPLICATION_PDF]) == null ? void 0 : _j.schema) != null) {
752508
+ if (((_d = (_c2 = resolvedResponse.content) == null ? void 0 : _c2[APPLICATION_PDF]) == null ? void 0 : _d.schema) != null) {
752503
752509
  return {
752504
752510
  type: "file",
752505
752511
  description: resolvedResponse.description
752506
752512
  };
752507
752513
  }
752508
- if (((_l = (_k = resolvedResponse.content) == null ? void 0 : _k[TEXT_PLAIN_CONTENT]) == null ? void 0 : _l.schema) != null) {
752509
- const textPlainSchema = (_m = resolvedResponse.content[TEXT_PLAIN_CONTENT]) == null ? void 0 : _m.schema;
752514
+ if (((_f = (_e = resolvedResponse.content) == null ? void 0 : _e[TEXT_PLAIN_CONTENT]) == null ? void 0 : _f.schema) != null) {
752515
+ const textPlainSchema = (_g = resolvedResponse.content[TEXT_PLAIN_CONTENT]) == null ? void 0 : _g.schema;
752510
752516
  if (textPlainSchema == null) {
752511
752517
  return {
752512
752518
  type: "text",
@@ -752525,7 +752531,7 @@ function convertResolvedResponse({ isStreaming, response, context, responseBread
752525
752531
  description: resolvedResponse.description
752526
752532
  };
752527
752533
  }
752528
- if (((_n = resolvedResponse.content) == null ? void 0 : _n[AUDIO_MPEG]) != null) {
752534
+ if (((_h = resolvedResponse.content) == null ? void 0 : _h[AUDIO_MPEG]) != null) {
752529
752535
  return {
752530
752536
  type: "file",
752531
752537
  description: resolvedResponse.description
@@ -752533,8 +752539,10 @@ function convertResolvedResponse({ isStreaming, response, context, responseBread
752533
752539
  }
752534
752540
  return void 0;
752535
752541
  }
752542
+ function getApplicationJsonResponse(response) {
752543
+ return getApplicationJsonSchemaFromMedia(response.content ?? {});
752544
+ }
752536
752545
  function markErrorSchemas({ responses, context }) {
752537
- var _a2, _b2, _c2, _d;
752538
752546
  const errorStatusCodes = [];
752539
752547
  for (const [statusCode, response] of Object.entries(responses)) {
752540
752548
  if (statusCode === "default") {
@@ -752546,7 +752554,7 @@ function markErrorSchemas({ responses, context }) {
752546
752554
  }
752547
752555
  errorStatusCodes.push(parsedStatusCode);
752548
752556
  const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
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) ?? {};
752557
+ const errorSchema = getApplicationJsonResponse(resolvedResponse) ?? {};
752550
752558
  context.markSchemaForStatusCode(parsedStatusCode, errorSchema);
752551
752559
  }
752552
752560
  return errorStatusCodes;
@@ -761167,10 +761175,10 @@ var CliContext = class {
761167
761175
  return "fern-api";
761168
761176
  }
761169
761177
  getPackageVersion() {
761170
- if ("0.16.5" == null) {
761178
+ if ("0.16.6" == null) {
761171
761179
  this.logger.error("CLI_VERSION is not defined");
761172
761180
  }
761173
- return "0.16.5";
761181
+ return "0.16.6";
761174
761182
  }
761175
761183
  getCliName() {
761176
761184
  if ("fern" == null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.16.5",
3
+ "version": "0.16.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",