fern-api 0.16.21 → 0.16.22
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 +60 -47
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -736945,7 +736945,7 @@ var AccessTokenPosthogManager = class {
|
|
|
736945
736945
|
properties: {
|
|
736946
736946
|
...event,
|
|
736947
736947
|
...event.properties,
|
|
736948
|
-
version: "0.16.
|
|
736948
|
+
version: "0.16.22",
|
|
736949
736949
|
usingAccessToken: true
|
|
736950
736950
|
}
|
|
736951
736951
|
});
|
|
@@ -737007,7 +737007,7 @@ var UserPosthogManager = class {
|
|
|
737007
737007
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
737008
737008
|
event: "CLI",
|
|
737009
737009
|
properties: {
|
|
737010
|
-
version: "0.16.
|
|
737010
|
+
version: "0.16.22",
|
|
737011
737011
|
...event,
|
|
737012
737012
|
...event.properties
|
|
737013
737013
|
}
|
|
@@ -753436,6 +753436,47 @@ function getScopes(oauthSecurityScheme) {
|
|
|
753436
753436
|
return void 0;
|
|
753437
753437
|
}
|
|
753438
753438
|
|
|
753439
|
+
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/convertToHttpError.js
|
|
753440
|
+
var import_finalIr14 = __toESM(require_finalIr());
|
|
753441
|
+
var ERROR_NAMES_BY_STATUS_CODE = {
|
|
753442
|
+
400: "BadRequestError",
|
|
753443
|
+
401: "UnauthorizedError",
|
|
753444
|
+
403: "ForbiddenError",
|
|
753445
|
+
404: "NotFoundError",
|
|
753446
|
+
408: "RequestTimeoutError",
|
|
753447
|
+
409: "ConflictError",
|
|
753448
|
+
413: "ContentTooLargeError",
|
|
753449
|
+
422: "UnprocessableEntityError",
|
|
753450
|
+
428: "PreconditionError",
|
|
753451
|
+
429: "TooManyRequestsError",
|
|
753452
|
+
500: "InternalServerError",
|
|
753453
|
+
501: "NotImplementedError",
|
|
753454
|
+
503: "ServiceUnavailableError"
|
|
753455
|
+
};
|
|
753456
|
+
var ERROR_NAMES = new Set(Object.values(ERROR_NAMES_BY_STATUS_CODE));
|
|
753457
|
+
function convertToError({ statusCode, errorBodyCollector, context }) {
|
|
753458
|
+
const errorName = ERROR_NAMES_BY_STATUS_CODE[statusCode];
|
|
753459
|
+
if (errorName == null) {
|
|
753460
|
+
return void 0;
|
|
753461
|
+
}
|
|
753462
|
+
const schemas = errorBodyCollector.getSchemas();
|
|
753463
|
+
if (schemas.length === 1 && schemas[0] != null) {
|
|
753464
|
+
const schema2 = convertSchema(schemas[0], false, context, [errorName, "Body"]);
|
|
753465
|
+
return {
|
|
753466
|
+
generatedName: errorName,
|
|
753467
|
+
nameOverride: null,
|
|
753468
|
+
schema: schema2,
|
|
753469
|
+
description: void 0
|
|
753470
|
+
};
|
|
753471
|
+
}
|
|
753472
|
+
return {
|
|
753473
|
+
generatedName: errorName,
|
|
753474
|
+
nameOverride: null,
|
|
753475
|
+
schema: import_finalIr14.Schema.unknown(),
|
|
753476
|
+
description: void 0
|
|
753477
|
+
};
|
|
753478
|
+
}
|
|
753479
|
+
|
|
753439
753480
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/utils/isSchemaRequired.js
|
|
753440
753481
|
function isSchemaRequired(schema2) {
|
|
753441
753482
|
return schema2.type !== "optional" && schema2.type !== "nullable";
|
|
@@ -753815,7 +753856,7 @@ function getResponseSchema(response) {
|
|
|
753815
753856
|
}
|
|
753816
753857
|
|
|
753817
753858
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/extensions/getVariableDefinitions.js
|
|
753818
|
-
var
|
|
753859
|
+
var import_finalIr15 = __toESM(require_finalIr());
|
|
753819
753860
|
function getVariableDefinitions(document4) {
|
|
753820
753861
|
const variables = getExtension(document4, FernOpenAPIExtension.SDK_VARIABLES);
|
|
753821
753862
|
if (variables == null) {
|
|
@@ -753826,7 +753867,7 @@ function getVariableDefinitions(document4) {
|
|
|
753826
753867
|
return [
|
|
753827
753868
|
variableName,
|
|
753828
753869
|
{
|
|
753829
|
-
schema:
|
|
753870
|
+
schema: import_finalIr15.PrimitiveSchemaValue.string({
|
|
753830
753871
|
minLength: void 0,
|
|
753831
753872
|
maxLength: void 0
|
|
753832
753873
|
}),
|
|
@@ -753840,46 +753881,6 @@ function getVariableDefinitions(document4) {
|
|
|
753840
753881
|
}));
|
|
753841
753882
|
}
|
|
753842
753883
|
|
|
753843
|
-
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/convertToHttpError.js
|
|
753844
|
-
var import_finalIr15 = __toESM(require_finalIr());
|
|
753845
|
-
var ERROR_NAMES_BY_STATUS_CODE = {
|
|
753846
|
-
400: "BadRequestError",
|
|
753847
|
-
401: "UnauthorizedError",
|
|
753848
|
-
403: "ForbiddenError",
|
|
753849
|
-
404: "NotFoundError",
|
|
753850
|
-
408: "RequestTimeoutError",
|
|
753851
|
-
409: "ConflictError",
|
|
753852
|
-
413: "ContentTooLargeError",
|
|
753853
|
-
422: "UnprocessableEntityError",
|
|
753854
|
-
428: "PreconditionError",
|
|
753855
|
-
429: "TooManyRequestsError",
|
|
753856
|
-
500: "InternalServerError",
|
|
753857
|
-
501: "NotImplementedError",
|
|
753858
|
-
503: "ServiceUnavailableError"
|
|
753859
|
-
};
|
|
753860
|
-
function convertToError({ statusCode, errorBodyCollector, context }) {
|
|
753861
|
-
const errorName = ERROR_NAMES_BY_STATUS_CODE[statusCode];
|
|
753862
|
-
if (errorName == null) {
|
|
753863
|
-
return void 0;
|
|
753864
|
-
}
|
|
753865
|
-
const schemas = errorBodyCollector.getSchemas();
|
|
753866
|
-
if (schemas.length === 1 && schemas[0] != null) {
|
|
753867
|
-
const schema2 = convertSchema(schemas[0], false, context, [errorName, "Body"]);
|
|
753868
|
-
return {
|
|
753869
|
-
generatedName: errorName,
|
|
753870
|
-
nameOverride: null,
|
|
753871
|
-
schema: schema2,
|
|
753872
|
-
description: void 0
|
|
753873
|
-
};
|
|
753874
|
-
}
|
|
753875
|
-
return {
|
|
753876
|
-
generatedName: errorName,
|
|
753877
|
-
nameOverride: null,
|
|
753878
|
-
schema: import_finalIr15.Schema.unknown(),
|
|
753879
|
-
description: void 0
|
|
753880
|
-
};
|
|
753881
|
-
}
|
|
753882
|
-
|
|
753883
753884
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/ErrorBodyCollector.js
|
|
753884
753885
|
var ErrorBodyCollector = class {
|
|
753885
753886
|
references = /* @__PURE__ */ new Set();
|
|
@@ -754039,6 +754040,17 @@ function generateIr(openApi, taskContext) {
|
|
|
754039
754040
|
if (ignoreSchema != null && ignoreSchema) {
|
|
754040
754041
|
return [];
|
|
754041
754042
|
}
|
|
754043
|
+
if (ERROR_NAMES.has(key2)) {
|
|
754044
|
+
return [
|
|
754045
|
+
key2,
|
|
754046
|
+
convertSchema(
|
|
754047
|
+
{ ...schema2, "x-fern-type-name": `${key2}Body` },
|
|
754048
|
+
false,
|
|
754049
|
+
context,
|
|
754050
|
+
[key2]
|
|
754051
|
+
)
|
|
754052
|
+
];
|
|
754053
|
+
}
|
|
754042
754054
|
}
|
|
754043
754055
|
return [key2, convertSchema(schema2, false, context, [key2])];
|
|
754044
754056
|
}).filter((entry) => entry.length > 0));
|
|
@@ -754086,7 +754098,8 @@ function generateIr(openApi, taskContext) {
|
|
|
754086
754098
|
});
|
|
754087
754099
|
const schemas = Object.fromEntries(Object.entries(schemasWithExample).map(([key2, schemaWithExample]) => {
|
|
754088
754100
|
taskContext.logger.debug(`Converting schema ${key2}`);
|
|
754089
|
-
|
|
754101
|
+
const schema2 = convertSchemaWithExampleToSchema(schemaWithExample);
|
|
754102
|
+
return [key2, schema2];
|
|
754090
754103
|
}));
|
|
754091
754104
|
const ir = {
|
|
754092
754105
|
title: openApi.info.title,
|
|
@@ -761553,10 +761566,10 @@ var CliContext = class {
|
|
|
761553
761566
|
return "fern-api";
|
|
761554
761567
|
}
|
|
761555
761568
|
getPackageVersion() {
|
|
761556
|
-
if ("0.16.
|
|
761569
|
+
if ("0.16.22" == null) {
|
|
761557
761570
|
this.logger.error("CLI_VERSION is not defined");
|
|
761558
761571
|
}
|
|
761559
|
-
return "0.16.
|
|
761572
|
+
return "0.16.22";
|
|
761560
761573
|
}
|
|
761561
761574
|
getCliName() {
|
|
761562
761575
|
if ("fern" == null) {
|