fern-api 0.16.4 → 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.
- package/bundle.cjs +47 -44
- 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.
|
|
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.
|
|
736750
|
+
version: "0.16.6",
|
|
736751
736751
|
...event,
|
|
736752
736752
|
...event.properties
|
|
736753
736753
|
}
|
|
@@ -751984,8 +751984,31 @@ 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
|
-
var
|
|
751990
|
+
var APPLICATION_JSON_REGEX = /^application.*json$/;
|
|
751991
|
+
function getApplicationJsonSchemaFromMedia(media) {
|
|
751992
|
+
for (const contentType of Object.keys(media)) {
|
|
751993
|
+
if (contentType.includes(APPLICATION_JSON_CONTENT) || APPLICATION_JSON_REGEX.test(contentType)) {
|
|
751994
|
+
const schema2 = getSchemaForContentType({
|
|
751995
|
+
contentType,
|
|
751996
|
+
media
|
|
751997
|
+
});
|
|
751998
|
+
if (schema2 != null) {
|
|
751999
|
+
return schema2;
|
|
752000
|
+
}
|
|
752001
|
+
}
|
|
752002
|
+
}
|
|
752003
|
+
return void 0;
|
|
752004
|
+
}
|
|
752005
|
+
function getSchemaForContentType({ contentType, media }) {
|
|
752006
|
+
var _a2;
|
|
752007
|
+
return (_a2 = media[contentType]) == null ? void 0 : _a2.schema;
|
|
752008
|
+
}
|
|
752009
|
+
|
|
752010
|
+
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/convertRequest.js
|
|
752011
|
+
var APPLICATION_JSON_CONTENT2 = "application/json";
|
|
751989
752012
|
var MULTIPART_CONTENT = "multipart/form-data";
|
|
751990
752013
|
var OCTET_STREAM = "application/octet-stream";
|
|
751991
752014
|
function getMultipartFormDataRequest(requestBody) {
|
|
@@ -751997,29 +752020,10 @@ function getOctetStreamRequest(requestBody) {
|
|
|
751997
752020
|
return (_a2 = requestBody.content[OCTET_STREAM]) == null ? void 0 : _a2.schema;
|
|
751998
752021
|
}
|
|
751999
752022
|
function getApplicationJsonRequest(requestBody) {
|
|
752000
|
-
const
|
|
752001
|
-
|
|
752002
|
-
|
|
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
|
-
};
|
|
752017
|
-
}
|
|
752018
|
-
return void 0;
|
|
752019
|
-
}
|
|
752020
|
-
function getSchemaForContentType({ contentType, media }) {
|
|
752021
|
-
var _a2;
|
|
752022
|
-
return (_a2 = media[contentType]) == null ? void 0 : _a2.schema;
|
|
752023
|
+
const schema2 = getApplicationJsonSchemaFromMedia(requestBody.content);
|
|
752024
|
+
return schema2 != null ? {
|
|
752025
|
+
schema: schema2
|
|
752026
|
+
} : schema2;
|
|
752023
752027
|
}
|
|
752024
752028
|
function multipartRequestHasFile(multipartSchema, document4) {
|
|
752025
752029
|
const resolvedMultipartSchema = isReferenceObject(multipartSchema) ? resolveSchema(multipartSchema, document4) : {
|
|
@@ -752160,7 +752164,7 @@ function removeApplicationJsonAndMultipartConflictsFromOperationObject(operation
|
|
|
752160
752164
|
};
|
|
752161
752165
|
}
|
|
752162
752166
|
function removeApplicationJsonAndMultipartConflictsFromRequestBody(requestBody) {
|
|
752163
|
-
const jsonContent = requestBody.content[
|
|
752167
|
+
const jsonContent = requestBody.content[APPLICATION_JSON_CONTENT2];
|
|
752164
752168
|
const multipartContent = requestBody.content[MULTIPART_CONTENT];
|
|
752165
752169
|
if (multipartContent != null && jsonContent != null) {
|
|
752166
752170
|
return {
|
|
@@ -752432,11 +752436,8 @@ var HEADERS_TO_SKIP = /* @__PURE__ */ new Set([
|
|
|
752432
752436
|
]);
|
|
752433
752437
|
|
|
752434
752438
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/endpoint/convertResponse.js
|
|
752435
|
-
var APPLICATION_JSON_CONTENT2 = "application/json";
|
|
752436
|
-
var APPLICATION_JSON_UTF_8_CONTENT2 = "application/json; charset=utf-8";
|
|
752437
752439
|
var APPLICATION_OCTET_STREAM_CONTENT = "application/octet-stream";
|
|
752438
752440
|
var APPLICATION_PDF = "application/pdf";
|
|
752439
|
-
var APPLICATION_VND_JSON = "application/x-ndjson";
|
|
752440
752441
|
var AUDIO_MPEG = "audio/mpeg";
|
|
752441
752442
|
var TEXT_PLAIN_CONTENT = "text/plain";
|
|
752442
752443
|
var SUCCESSFUL_STATUS_CODES = ["200", "201", "204"];
|
|
@@ -752481,37 +752482,37 @@ function convertResponse({ responses, context, responseBreadcrumbs, responseStat
|
|
|
752481
752482
|
};
|
|
752482
752483
|
}
|
|
752483
752484
|
function convertResolvedResponse({ isStreaming, response, context, responseBreadcrumbs }) {
|
|
752484
|
-
var _a2, _b2, _c2, _d, _e, _f, _g, _h
|
|
752485
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h;
|
|
752485
752486
|
const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
|
|
752486
|
-
const
|
|
752487
|
-
if (
|
|
752487
|
+
const jsonResponseSchema = getApplicationJsonResponse(resolvedResponse);
|
|
752488
|
+
if (jsonResponseSchema != null) {
|
|
752488
752489
|
if (isStreaming) {
|
|
752489
752490
|
return {
|
|
752490
752491
|
type: "streamingJson",
|
|
752491
752492
|
description: resolvedResponse.description,
|
|
752492
|
-
schema: convertSchemaWithExampleToSchema(convertSchema(
|
|
752493
|
+
schema: convertSchemaWithExampleToSchema(convertSchema(jsonResponseSchema, false, context, responseBreadcrumbs))
|
|
752493
752494
|
};
|
|
752494
752495
|
}
|
|
752495
752496
|
return {
|
|
752496
752497
|
type: "json",
|
|
752497
752498
|
description: resolvedResponse.description,
|
|
752498
|
-
schema: convertSchema(
|
|
752499
|
+
schema: convertSchema(jsonResponseSchema, false, context, responseBreadcrumbs)
|
|
752499
752500
|
};
|
|
752500
752501
|
}
|
|
752501
|
-
if (((
|
|
752502
|
+
if (((_b2 = (_a2 = resolvedResponse.content) == null ? void 0 : _a2[APPLICATION_OCTET_STREAM_CONTENT]) == null ? void 0 : _b2.schema) != null) {
|
|
752502
752503
|
return {
|
|
752503
752504
|
type: "file",
|
|
752504
752505
|
description: resolvedResponse.description
|
|
752505
752506
|
};
|
|
752506
752507
|
}
|
|
752507
|
-
if (((
|
|
752508
|
+
if (((_d = (_c2 = resolvedResponse.content) == null ? void 0 : _c2[APPLICATION_PDF]) == null ? void 0 : _d.schema) != null) {
|
|
752508
752509
|
return {
|
|
752509
752510
|
type: "file",
|
|
752510
752511
|
description: resolvedResponse.description
|
|
752511
752512
|
};
|
|
752512
752513
|
}
|
|
752513
|
-
if (((
|
|
752514
|
-
const textPlainSchema = (
|
|
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;
|
|
752515
752516
|
if (textPlainSchema == null) {
|
|
752516
752517
|
return {
|
|
752517
752518
|
type: "text",
|
|
@@ -752530,7 +752531,7 @@ function convertResolvedResponse({ isStreaming, response, context, responseBread
|
|
|
752530
752531
|
description: resolvedResponse.description
|
|
752531
752532
|
};
|
|
752532
752533
|
}
|
|
752533
|
-
if (((
|
|
752534
|
+
if (((_h = resolvedResponse.content) == null ? void 0 : _h[AUDIO_MPEG]) != null) {
|
|
752534
752535
|
return {
|
|
752535
752536
|
type: "file",
|
|
752536
752537
|
description: resolvedResponse.description
|
|
@@ -752538,8 +752539,10 @@ function convertResolvedResponse({ isStreaming, response, context, responseBread
|
|
|
752538
752539
|
}
|
|
752539
752540
|
return void 0;
|
|
752540
752541
|
}
|
|
752542
|
+
function getApplicationJsonResponse(response) {
|
|
752543
|
+
return getApplicationJsonSchemaFromMedia(response.content ?? {});
|
|
752544
|
+
}
|
|
752541
752545
|
function markErrorSchemas({ responses, context }) {
|
|
752542
|
-
var _a2, _b2, _c2, _d;
|
|
752543
752546
|
const errorStatusCodes = [];
|
|
752544
752547
|
for (const [statusCode, response] of Object.entries(responses)) {
|
|
752545
752548
|
if (statusCode === "default") {
|
|
@@ -752551,7 +752554,7 @@ function markErrorSchemas({ responses, context }) {
|
|
|
752551
752554
|
}
|
|
752552
752555
|
errorStatusCodes.push(parsedStatusCode);
|
|
752553
752556
|
const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
|
|
752554
|
-
const errorSchema = (
|
|
752557
|
+
const errorSchema = getApplicationJsonResponse(resolvedResponse) ?? {};
|
|
752555
752558
|
context.markSchemaForStatusCode(parsedStatusCode, errorSchema);
|
|
752556
752559
|
}
|
|
752557
752560
|
return errorStatusCodes;
|
|
@@ -761172,10 +761175,10 @@ var CliContext = class {
|
|
|
761172
761175
|
return "fern-api";
|
|
761173
761176
|
}
|
|
761174
761177
|
getPackageVersion() {
|
|
761175
|
-
if ("0.16.
|
|
761178
|
+
if ("0.16.6" == null) {
|
|
761176
761179
|
this.logger.error("CLI_VERSION is not defined");
|
|
761177
761180
|
}
|
|
761178
|
-
return "0.16.
|
|
761181
|
+
return "0.16.6";
|
|
761179
761182
|
}
|
|
761180
761183
|
getCliName() {
|
|
761181
761184
|
if ("fern" == null) {
|