fern-api 0.16.29 → 0.16.30
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 +27 -10
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -733310,10 +733310,12 @@ var GeneratorGroupSchema = z.strictObject({
|
|
|
733310
733310
|
// pnp:/home/circleci/project/packages/cli/config-management/generators-configuration/lib/schemas/GeneratorsConfigurationSchema.js
|
|
733311
733311
|
var DEFAULT_GROUP_GENERATORS_CONFIG_KEY = "default-group";
|
|
733312
733312
|
var OPENAPI_LOCATION_KEY = "openapi";
|
|
733313
|
+
var OPENAPI_OVERRIDES_LOCATION_KEY = "openapi-overrides";
|
|
733313
733314
|
var ASYNC_API_LOCATION_KEY = "async-api";
|
|
733314
733315
|
var GeneratorsConfigurationSchema = z.strictObject({
|
|
733315
733316
|
[DEFAULT_GROUP_GENERATORS_CONFIG_KEY]: z.optional(z.string()),
|
|
733316
733317
|
[OPENAPI_LOCATION_KEY]: z.optional(z.string()),
|
|
733318
|
+
[OPENAPI_OVERRIDES_LOCATION_KEY]: z.optional(z.string()),
|
|
733317
733319
|
[ASYNC_API_LOCATION_KEY]: z.optional(z.string()),
|
|
733318
733320
|
groups: z.optional(z.record(GeneratorGroupSchema))
|
|
733319
733321
|
});
|
|
@@ -733322,10 +733324,12 @@ var GeneratorsConfigurationSchema = z.strictObject({
|
|
|
733322
733324
|
async function convertGeneratorsConfiguration({ absolutePathToGeneratorsConfiguration, rawGeneratorsConfiguration }) {
|
|
733323
733325
|
const pathToOpenAPI = rawGeneratorsConfiguration[OPENAPI_LOCATION_KEY];
|
|
733324
733326
|
const pathToAsyncAPI = rawGeneratorsConfiguration[ASYNC_API_LOCATION_KEY];
|
|
733327
|
+
const pathToOpenAPIOverrides = rawGeneratorsConfiguration[OPENAPI_OVERRIDES_LOCATION_KEY];
|
|
733325
733328
|
return {
|
|
733326
733329
|
absolutePathToConfiguration: absolutePathToGeneratorsConfiguration,
|
|
733327
733330
|
absolutePathToAsyncAPI: pathToAsyncAPI != null ? join(dirname(absolutePathToGeneratorsConfiguration), RelativeFilePath.of(pathToAsyncAPI)) : void 0,
|
|
733328
733331
|
absolutePathToOpenAPI: pathToOpenAPI != null ? join(dirname(absolutePathToGeneratorsConfiguration), RelativeFilePath.of(pathToOpenAPI)) : void 0,
|
|
733332
|
+
absolutePathToOpenAPIOverrides: pathToOpenAPIOverrides != null ? join(dirname(absolutePathToGeneratorsConfiguration), RelativeFilePath.of(pathToOpenAPIOverrides)) : void 0,
|
|
733329
733333
|
rawConfiguration: rawGeneratorsConfiguration,
|
|
733330
733334
|
defaultGroup: rawGeneratorsConfiguration["default-group"],
|
|
733331
733335
|
groups: rawGeneratorsConfiguration.groups != null ? await Promise.all(Object.entries(rawGeneratorsConfiguration.groups).map(([groupName, group]) => convertGroup({
|
|
@@ -736951,7 +736955,7 @@ var AccessTokenPosthogManager = class {
|
|
|
736951
736955
|
properties: {
|
|
736952
736956
|
...event,
|
|
736953
736957
|
...event.properties,
|
|
736954
|
-
version: "0.16.
|
|
736958
|
+
version: "0.16.30",
|
|
736955
736959
|
usingAccessToken: true
|
|
736956
736960
|
}
|
|
736957
736961
|
});
|
|
@@ -737013,7 +737017,7 @@ var UserPosthogManager = class {
|
|
|
737013
737017
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
737014
737018
|
event: "CLI",
|
|
737015
737019
|
properties: {
|
|
737016
|
-
version: "0.16.
|
|
737020
|
+
version: "0.16.30",
|
|
737017
737021
|
...event,
|
|
737018
737022
|
...event.properties
|
|
737019
737023
|
}
|
|
@@ -754374,7 +754378,7 @@ var FERN_TYPE_EXTENSIONS = {
|
|
|
754374
754378
|
}
|
|
754375
754379
|
}
|
|
754376
754380
|
};
|
|
754377
|
-
async function loadOpenAPI({ absolutePathToOpenAPI, context }) {
|
|
754381
|
+
async function loadOpenAPI({ absolutePathToOpenAPI, absolutePathToOpenAPIOverrides, context }) {
|
|
754378
754382
|
const result2 = await (0, import_openapi_core.bundle)({
|
|
754379
754383
|
config: new import_openapi_core.Config({
|
|
754380
754384
|
apis: {},
|
|
@@ -754391,12 +754395,19 @@ async function loadOpenAPI({ absolutePathToOpenAPI, context }) {
|
|
|
754391
754395
|
keepUrlRefs: true
|
|
754392
754396
|
});
|
|
754393
754397
|
const parsed = await import_swagger_parser.default.parse(result2.bundle.parsed);
|
|
754394
|
-
|
|
754398
|
+
let overridesFilepath = void 0;
|
|
754399
|
+
if (absolutePathToOpenAPIOverrides != null) {
|
|
754400
|
+
overridesFilepath = absolutePathToOpenAPIOverrides;
|
|
754401
|
+
} else if (typeof parsed === "object" && parsed[FernOpenAPIExtension.OPENAPI_OVERIDES_FILEPATH] != null) {
|
|
754402
|
+
overridesFilepath = join(
|
|
754403
|
+
dirname(absolutePathToOpenAPI),
|
|
754404
|
+
RelativeFilePath.of(parsed[FernOpenAPIExtension.OPENAPI_OVERIDES_FILEPATH])
|
|
754405
|
+
);
|
|
754406
|
+
}
|
|
754395
754407
|
if (overridesFilepath != null) {
|
|
754396
|
-
const pathToFile = join(dirname(absolutePathToOpenAPI), RelativeFilePath.of(overridesFilepath));
|
|
754397
754408
|
let parsedOverrides = null;
|
|
754398
754409
|
try {
|
|
754399
|
-
const contents = (await (0, import_promises22.readFile)(
|
|
754410
|
+
const contents = (await (0, import_promises22.readFile)(overridesFilepath, "utf8")).toString();
|
|
754400
754411
|
try {
|
|
754401
754412
|
parsedOverrides = JSON.parse(contents);
|
|
754402
754413
|
} catch (err) {
|
|
@@ -754419,13 +754430,17 @@ async function generateIr2(openApi, taskContext) {
|
|
|
754419
754430
|
}
|
|
754420
754431
|
|
|
754421
754432
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/parse.js
|
|
754422
|
-
async function parse2({ absolutePathToAsyncAPI, absolutePathToOpenAPI, taskContext }) {
|
|
754433
|
+
async function parse2({ absolutePathToAsyncAPI, absolutePathToOpenAPI, absolutePathToOpenAPIOverrides, taskContext }) {
|
|
754423
754434
|
let asyncAPISchemas = {};
|
|
754424
754435
|
if (absolutePathToAsyncAPI != null) {
|
|
754425
754436
|
const asyncAPI = await loadAsyncAPI(absolutePathToAsyncAPI);
|
|
754426
754437
|
asyncAPISchemas = generateSchemasFromAsyncAPI(asyncAPI, taskContext);
|
|
754427
754438
|
}
|
|
754428
|
-
const openApiDocument = await loadOpenAPI({
|
|
754439
|
+
const openApiDocument = await loadOpenAPI({
|
|
754440
|
+
absolutePathToOpenAPI,
|
|
754441
|
+
context: taskContext,
|
|
754442
|
+
absolutePathToOpenAPIOverrides
|
|
754443
|
+
});
|
|
754429
754444
|
let openApiIr = void 0;
|
|
754430
754445
|
if (isOpenApiV3(openApiDocument)) {
|
|
754431
754446
|
openApiIr = generateIr(openApiDocument, taskContext);
|
|
@@ -754456,9 +754471,11 @@ function isOpenApiV2(openApi) {
|
|
|
754456
754471
|
|
|
754457
754472
|
// pnp:/home/circleci/project/packages/cli/workspace-loader/lib/utils/convertOpenApiWorkspaceToFernWorkspace.js
|
|
754458
754473
|
async function getOpenAPIIRFromOpenAPIWorkspace(openapiWorkspace, context) {
|
|
754474
|
+
var _a2;
|
|
754459
754475
|
return await parse2({
|
|
754460
754476
|
absolutePathToAsyncAPI: openapiWorkspace.absolutePathToAsyncAPI,
|
|
754461
754477
|
absolutePathToOpenAPI: openapiWorkspace.absolutePathToOpenAPI,
|
|
754478
|
+
absolutePathToOpenAPIOverrides: (_a2 = openapiWorkspace.generatorsConfiguration) == null ? void 0 : _a2.absolutePathToOpenAPIOverrides,
|
|
754462
754479
|
taskContext: context
|
|
754463
754480
|
});
|
|
754464
754481
|
}
|
|
@@ -761708,10 +761725,10 @@ var CliContext = class {
|
|
|
761708
761725
|
return "fern-api";
|
|
761709
761726
|
}
|
|
761710
761727
|
getPackageVersion() {
|
|
761711
|
-
if ("0.16.
|
|
761728
|
+
if ("0.16.30" == null) {
|
|
761712
761729
|
this.logger.error("CLI_VERSION is not defined");
|
|
761713
761730
|
}
|
|
761714
|
-
return "0.16.
|
|
761731
|
+
return "0.16.30";
|
|
761715
761732
|
}
|
|
761716
761733
|
getCliName() {
|
|
761717
761734
|
if ("fern" == null) {
|