fern-api 0.31.14 → 0.31.15
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 +141 -117
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -1115837,7 +1115837,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1115837
1115837
|
properties: {
|
|
1115838
1115838
|
...event,
|
|
1115839
1115839
|
...event.properties,
|
|
1115840
|
-
version: "0.31.
|
|
1115840
|
+
version: "0.31.15",
|
|
1115841
1115841
|
usingAccessToken: true
|
|
1115842
1115842
|
}
|
|
1115843
1115843
|
});
|
|
@@ -1115899,7 +1115899,7 @@ var UserPosthogManager = class {
|
|
|
1115899
1115899
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1115900
1115900
|
event: "CLI",
|
|
1115901
1115901
|
properties: {
|
|
1115902
|
-
version: "0.31.
|
|
1115902
|
+
version: "0.31.15",
|
|
1115903
1115903
|
...event,
|
|
1115904
1115904
|
...event.properties
|
|
1115905
1115905
|
}
|
|
@@ -1139780,115 +1139780,6 @@ function convertNumber({ nameOverride, generatedName, format: format5, _default:
|
|
|
1139780
1139780
|
});
|
|
1139781
1139781
|
}
|
|
1139782
1139782
|
|
|
1139783
|
-
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/utils/getBreadcrumbsFromReference.js
|
|
1139784
|
-
var STARTS_WITH_COMPONENTS_SCHEMAS = {
|
|
1139785
|
-
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "#" && refUnderProcessing[1] === "components" && refUnderProcessing[2] === "schemas",
|
|
1139786
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139787
|
-
const newBreadcrumbs = [refUnderProcessing[3] ?? ""];
|
|
1139788
|
-
return {
|
|
1139789
|
-
refUnderProcessing: refUnderProcessing.slice(4),
|
|
1139790
|
-
newBreadcrumbs
|
|
1139791
|
-
};
|
|
1139792
|
-
}
|
|
1139793
|
-
};
|
|
1139794
|
-
var STARTS_WITH_COMPONENTS_RESPONSES = {
|
|
1139795
|
-
isApplicable: (breadcrumbs) => breadcrumbs[0] === "#" && breadcrumbs[1] === "components" && breadcrumbs[2] === "responses",
|
|
1139796
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139797
|
-
const newBreadcrumbs = [refUnderProcessing[3] ?? ""];
|
|
1139798
|
-
refUnderProcessing = refUnderProcessing.slice(4);
|
|
1139799
|
-
return {
|
|
1139800
|
-
refUnderProcessing: refUnderProcessing.slice(4),
|
|
1139801
|
-
newBreadcrumbs
|
|
1139802
|
-
};
|
|
1139803
|
-
}
|
|
1139804
|
-
};
|
|
1139805
|
-
var STARTS_WITH_COMPONENTS_PARAMETERS = {
|
|
1139806
|
-
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "#" && refUnderProcessing[1] === "components" && refUnderProcessing[2] === "parameters",
|
|
1139807
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139808
|
-
const newBreadcrumbs = [refUnderProcessing[3] ?? ""];
|
|
1139809
|
-
refUnderProcessing = refUnderProcessing.slice(4);
|
|
1139810
|
-
if (refUnderProcessing[0] === "schema") {
|
|
1139811
|
-
refUnderProcessing = refUnderProcessing.slice(1);
|
|
1139812
|
-
}
|
|
1139813
|
-
return {
|
|
1139814
|
-
refUnderProcessing,
|
|
1139815
|
-
newBreadcrumbs
|
|
1139816
|
-
};
|
|
1139817
|
-
}
|
|
1139818
|
-
};
|
|
1139819
|
-
var EXTRACT_PROPERTY = {
|
|
1139820
|
-
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "properties",
|
|
1139821
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139822
|
-
const newBreadcrumbs = [refUnderProcessing[1] ?? ""];
|
|
1139823
|
-
return {
|
|
1139824
|
-
refUnderProcessing: refUnderProcessing.slice(2),
|
|
1139825
|
-
newBreadcrumbs
|
|
1139826
|
-
};
|
|
1139827
|
-
}
|
|
1139828
|
-
};
|
|
1139829
|
-
var REMOVE_ITEMS_KEYWORD = {
|
|
1139830
|
-
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "items",
|
|
1139831
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139832
|
-
return {
|
|
1139833
|
-
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1139834
|
-
newBreadcrumbs: []
|
|
1139835
|
-
};
|
|
1139836
|
-
}
|
|
1139837
|
-
};
|
|
1139838
|
-
var REMOVE_ALL_OF_KEYWORD = {
|
|
1139839
|
-
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "allOf",
|
|
1139840
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139841
|
-
return {
|
|
1139842
|
-
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1139843
|
-
newBreadcrumbs: []
|
|
1139844
|
-
};
|
|
1139845
|
-
}
|
|
1139846
|
-
};
|
|
1139847
|
-
var REMOVE_ANY_OF_KEYWORD = {
|
|
1139848
|
-
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "anyOf",
|
|
1139849
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139850
|
-
return {
|
|
1139851
|
-
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1139852
|
-
newBreadcrumbs: []
|
|
1139853
|
-
};
|
|
1139854
|
-
}
|
|
1139855
|
-
};
|
|
1139856
|
-
var REMOVE_ONE_OF_KEYWORD = {
|
|
1139857
|
-
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "oneOf",
|
|
1139858
|
-
applyStrategy: (refUnderProcessing) => {
|
|
1139859
|
-
return {
|
|
1139860
|
-
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1139861
|
-
newBreadcrumbs: []
|
|
1139862
|
-
};
|
|
1139863
|
-
}
|
|
1139864
|
-
};
|
|
1139865
|
-
function getBreadcrumbsFromReference(reference) {
|
|
1139866
|
-
let refUnderProcessing = reference.split("/").map((breadcrumb) => breadcrumb.replace(/~1/g, "/"));
|
|
1139867
|
-
let breadcrumbs = [];
|
|
1139868
|
-
const strategies = [
|
|
1139869
|
-
STARTS_WITH_COMPONENTS_SCHEMAS,
|
|
1139870
|
-
STARTS_WITH_COMPONENTS_RESPONSES,
|
|
1139871
|
-
STARTS_WITH_COMPONENTS_PARAMETERS,
|
|
1139872
|
-
EXTRACT_PROPERTY,
|
|
1139873
|
-
REMOVE_ITEMS_KEYWORD,
|
|
1139874
|
-
REMOVE_ALL_OF_KEYWORD,
|
|
1139875
|
-
REMOVE_ANY_OF_KEYWORD,
|
|
1139876
|
-
REMOVE_ONE_OF_KEYWORD
|
|
1139877
|
-
];
|
|
1139878
|
-
let previousRefUnderProcessing;
|
|
1139879
|
-
do {
|
|
1139880
|
-
previousRefUnderProcessing = refUnderProcessing;
|
|
1139881
|
-
for (const strategy of strategies) {
|
|
1139882
|
-
if (strategy.isApplicable(refUnderProcessing)) {
|
|
1139883
|
-
const { refUnderProcessing: newRefUnderProcessing, newBreadcrumbs } = strategy.applyStrategy(refUnderProcessing);
|
|
1139884
|
-
refUnderProcessing = newRefUnderProcessing;
|
|
1139885
|
-
breadcrumbs = [...breadcrumbs, ...newBreadcrumbs];
|
|
1139886
|
-
}
|
|
1139887
|
-
}
|
|
1139888
|
-
} while (refUnderProcessing.join("") !== previousRefUnderProcessing.join(""));
|
|
1139889
|
-
return breadcrumbs;
|
|
1139890
|
-
}
|
|
1139891
|
-
|
|
1139892
1139783
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/utils/getSchemaName.js
|
|
1139893
1139784
|
function getGeneratedTypeName(breadcrumbs) {
|
|
1139894
1139785
|
const underscoreDelimeted = breadcrumbs.join("_");
|
|
@@ -1140135,6 +1140026,115 @@ function isObjectEqual(a2, b2) {
|
|
|
1140135
1140026
|
});
|
|
1140136
1140027
|
}
|
|
1140137
1140028
|
|
|
1140029
|
+
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/utils/getBreadcrumbsFromReference.js
|
|
1140030
|
+
var STARTS_WITH_COMPONENTS_SCHEMAS = {
|
|
1140031
|
+
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "#" && refUnderProcessing[1] === "components" && refUnderProcessing[2] === "schemas",
|
|
1140032
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140033
|
+
const newBreadcrumbs = [refUnderProcessing[3] ?? ""];
|
|
1140034
|
+
return {
|
|
1140035
|
+
refUnderProcessing: refUnderProcessing.slice(4),
|
|
1140036
|
+
newBreadcrumbs
|
|
1140037
|
+
};
|
|
1140038
|
+
}
|
|
1140039
|
+
};
|
|
1140040
|
+
var STARTS_WITH_COMPONENTS_RESPONSES = {
|
|
1140041
|
+
isApplicable: (breadcrumbs) => breadcrumbs[0] === "#" && breadcrumbs[1] === "components" && breadcrumbs[2] === "responses",
|
|
1140042
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140043
|
+
const newBreadcrumbs = [refUnderProcessing[3] ?? ""];
|
|
1140044
|
+
refUnderProcessing = refUnderProcessing.slice(4);
|
|
1140045
|
+
return {
|
|
1140046
|
+
refUnderProcessing: refUnderProcessing.slice(4),
|
|
1140047
|
+
newBreadcrumbs
|
|
1140048
|
+
};
|
|
1140049
|
+
}
|
|
1140050
|
+
};
|
|
1140051
|
+
var STARTS_WITH_COMPONENTS_PARAMETERS = {
|
|
1140052
|
+
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "#" && refUnderProcessing[1] === "components" && refUnderProcessing[2] === "parameters",
|
|
1140053
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140054
|
+
const newBreadcrumbs = [refUnderProcessing[3] ?? ""];
|
|
1140055
|
+
refUnderProcessing = refUnderProcessing.slice(4);
|
|
1140056
|
+
if (refUnderProcessing[0] === "schema") {
|
|
1140057
|
+
refUnderProcessing = refUnderProcessing.slice(1);
|
|
1140058
|
+
}
|
|
1140059
|
+
return {
|
|
1140060
|
+
refUnderProcessing,
|
|
1140061
|
+
newBreadcrumbs
|
|
1140062
|
+
};
|
|
1140063
|
+
}
|
|
1140064
|
+
};
|
|
1140065
|
+
var EXTRACT_PROPERTY = {
|
|
1140066
|
+
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "properties",
|
|
1140067
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140068
|
+
const newBreadcrumbs = [refUnderProcessing[1] ?? ""];
|
|
1140069
|
+
return {
|
|
1140070
|
+
refUnderProcessing: refUnderProcessing.slice(2),
|
|
1140071
|
+
newBreadcrumbs
|
|
1140072
|
+
};
|
|
1140073
|
+
}
|
|
1140074
|
+
};
|
|
1140075
|
+
var REMOVE_ITEMS_KEYWORD = {
|
|
1140076
|
+
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "items",
|
|
1140077
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140078
|
+
return {
|
|
1140079
|
+
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1140080
|
+
newBreadcrumbs: []
|
|
1140081
|
+
};
|
|
1140082
|
+
}
|
|
1140083
|
+
};
|
|
1140084
|
+
var REMOVE_ALL_OF_KEYWORD = {
|
|
1140085
|
+
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "allOf",
|
|
1140086
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140087
|
+
return {
|
|
1140088
|
+
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1140089
|
+
newBreadcrumbs: []
|
|
1140090
|
+
};
|
|
1140091
|
+
}
|
|
1140092
|
+
};
|
|
1140093
|
+
var REMOVE_ANY_OF_KEYWORD = {
|
|
1140094
|
+
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "anyOf",
|
|
1140095
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140096
|
+
return {
|
|
1140097
|
+
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1140098
|
+
newBreadcrumbs: []
|
|
1140099
|
+
};
|
|
1140100
|
+
}
|
|
1140101
|
+
};
|
|
1140102
|
+
var REMOVE_ONE_OF_KEYWORD = {
|
|
1140103
|
+
isApplicable: (refUnderProcessing) => refUnderProcessing[0] === "oneOf",
|
|
1140104
|
+
applyStrategy: (refUnderProcessing) => {
|
|
1140105
|
+
return {
|
|
1140106
|
+
refUnderProcessing: refUnderProcessing.slice(1),
|
|
1140107
|
+
newBreadcrumbs: []
|
|
1140108
|
+
};
|
|
1140109
|
+
}
|
|
1140110
|
+
};
|
|
1140111
|
+
function getBreadcrumbsFromReference(reference) {
|
|
1140112
|
+
let refUnderProcessing = reference.split("/").map((breadcrumb) => breadcrumb.replace(/~1/g, "/"));
|
|
1140113
|
+
let breadcrumbs = [];
|
|
1140114
|
+
const strategies = [
|
|
1140115
|
+
STARTS_WITH_COMPONENTS_SCHEMAS,
|
|
1140116
|
+
STARTS_WITH_COMPONENTS_RESPONSES,
|
|
1140117
|
+
STARTS_WITH_COMPONENTS_PARAMETERS,
|
|
1140118
|
+
EXTRACT_PROPERTY,
|
|
1140119
|
+
REMOVE_ITEMS_KEYWORD,
|
|
1140120
|
+
REMOVE_ALL_OF_KEYWORD,
|
|
1140121
|
+
REMOVE_ANY_OF_KEYWORD,
|
|
1140122
|
+
REMOVE_ONE_OF_KEYWORD
|
|
1140123
|
+
];
|
|
1140124
|
+
let previousRefUnderProcessing;
|
|
1140125
|
+
do {
|
|
1140126
|
+
previousRefUnderProcessing = refUnderProcessing;
|
|
1140127
|
+
for (const strategy of strategies) {
|
|
1140128
|
+
if (strategy.isApplicable(refUnderProcessing)) {
|
|
1140129
|
+
const { refUnderProcessing: newRefUnderProcessing, newBreadcrumbs } = strategy.applyStrategy(refUnderProcessing);
|
|
1140130
|
+
refUnderProcessing = newRefUnderProcessing;
|
|
1140131
|
+
breadcrumbs = [...breadcrumbs, ...newBreadcrumbs];
|
|
1140132
|
+
}
|
|
1140133
|
+
}
|
|
1140134
|
+
} while (refUnderProcessing.join("") !== previousRefUnderProcessing.join(""));
|
|
1140135
|
+
return breadcrumbs;
|
|
1140136
|
+
}
|
|
1140137
|
+
|
|
1140138
1140138
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertObject.js
|
|
1140139
1140139
|
function convertObject({ nameOverride, generatedName, breadcrumbs, properties, description, required, wrapAsNullable, allOf, context, propertiesToExclude, groupName, fullExamples, additionalProperties }) {
|
|
1140140
1140140
|
const allRequired = [...required ?? []];
|
|
@@ -1141056,9 +1141056,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
|
|
|
1141056
1141056
|
if (schema2.allOf != null || schema2.properties != null) {
|
|
1141057
1141057
|
const filteredAllOfs = [];
|
|
1141058
1141058
|
for (const allOf of schema2.allOf ?? []) {
|
|
1141059
|
-
if (isReferenceObject(allOf)) {
|
|
1141060
|
-
filteredAllOfs.push(allOf);
|
|
1141061
|
-
} else if (Object.keys(allOf).length > 0 && Object.keys(allOf).includes("type")) {
|
|
1141059
|
+
if (isReferenceObject(allOf) || Object.keys(allOf).length > 0) {
|
|
1141062
1141060
|
filteredAllOfs.push(allOf);
|
|
1141063
1141061
|
}
|
|
1141064
1141062
|
}
|
|
@@ -1141066,6 +1141064,17 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
|
|
|
1141066
1141064
|
const convertedSchema = convertSchema(filteredAllOfs[0], wrapAsNullable, context, breadcrumbs, referencedAsRequest);
|
|
1141067
1141065
|
return maybeInjectDescriptionOrGroupName(convertedSchema, description, groupName);
|
|
1141068
1141066
|
}
|
|
1141067
|
+
const filteredAllOfObjects = filteredAllOfs.filter((allOf) => {
|
|
1141068
|
+
const valid2 = isValidAllOfObject(allOf);
|
|
1141069
|
+
if (!valid2) {
|
|
1141070
|
+
context.logger.warn(`Skipping non-object allOf element: ${JSON.stringify(allOf)}`);
|
|
1141071
|
+
}
|
|
1141072
|
+
return valid2;
|
|
1141073
|
+
});
|
|
1141074
|
+
if ((schema2.properties == null || schema2.properties.length === 0) && filteredAllOfObjects.length === 1 && filteredAllOfObjects[0] != null) {
|
|
1141075
|
+
const convertedSchema = convertSchema(filteredAllOfObjects[0], wrapAsNullable, context, breadcrumbs, referencedAsRequest);
|
|
1141076
|
+
return maybeInjectDescriptionOrGroupName(convertedSchema, description, groupName);
|
|
1141077
|
+
}
|
|
1141069
1141078
|
return convertObject({
|
|
1141070
1141079
|
nameOverride,
|
|
1141071
1141080
|
generatedName,
|
|
@@ -1141074,7 +1141083,7 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
|
|
|
1141074
1141083
|
description,
|
|
1141075
1141084
|
required: schema2.required,
|
|
1141076
1141085
|
wrapAsNullable,
|
|
1141077
|
-
allOf:
|
|
1141086
|
+
allOf: filteredAllOfObjects,
|
|
1141078
1141087
|
context,
|
|
1141079
1141088
|
propertiesToExclude,
|
|
1141080
1141089
|
groupName,
|
|
@@ -1141185,6 +1141194,21 @@ function maybeInjectDescriptionOrGroupName(schema2, description, groupName) {
|
|
|
1141185
1141194
|
}
|
|
1141186
1141195
|
return schema2;
|
|
1141187
1141196
|
}
|
|
1141197
|
+
function isValidAllOfObject(allOf) {
|
|
1141198
|
+
if (isReferenceObject(allOf) || allOf.type === "object" || allOf.properties != null) {
|
|
1141199
|
+
return true;
|
|
1141200
|
+
}
|
|
1141201
|
+
if (allOf.allOf != null) {
|
|
1141202
|
+
return allOf.allOf.every((elem) => isValidAllOfObject(elem));
|
|
1141203
|
+
}
|
|
1141204
|
+
if (allOf.oneOf != null) {
|
|
1141205
|
+
return allOf.oneOf.every((elem) => isValidAllOfObject(elem));
|
|
1141206
|
+
}
|
|
1141207
|
+
if (allOf.anyOf != null) {
|
|
1141208
|
+
return allOf.anyOf.every((elem) => isValidAllOfObject(elem));
|
|
1141209
|
+
}
|
|
1141210
|
+
return false;
|
|
1141211
|
+
}
|
|
1141188
1141212
|
function wrapLiteral({ literal: literal2, wrapAsNullable, groupName, description, nameOverride, generatedName }) {
|
|
1141189
1141213
|
if (wrapAsNullable) {
|
|
1141190
1141214
|
return SchemaWithExample.nullable({
|
|
@@ -1151467,10 +1151491,10 @@ var CliContext = class {
|
|
|
1151467
1151491
|
return "fern-api";
|
|
1151468
1151492
|
}
|
|
1151469
1151493
|
getPackageVersion() {
|
|
1151470
|
-
if ("0.31.
|
|
1151494
|
+
if ("0.31.15" == null) {
|
|
1151471
1151495
|
this.logger.error("CLI_VERSION is not defined");
|
|
1151472
1151496
|
}
|
|
1151473
|
-
return "0.31.
|
|
1151497
|
+
return "0.31.15";
|
|
1151474
1151498
|
}
|
|
1151475
1151499
|
getCliName() {
|
|
1151476
1151500
|
if ("fern" == null) {
|