fern-api 0.19.0-rc0 → 0.19.0-rc2
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 +41 -19
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -799111,7 +799111,7 @@ var AccessTokenPosthogManager = class {
|
|
|
799111
799111
|
properties: {
|
|
799112
799112
|
...event,
|
|
799113
799113
|
...event.properties,
|
|
799114
|
-
version: "0.19.0-
|
|
799114
|
+
version: "0.19.0-rc2",
|
|
799115
799115
|
usingAccessToken: true
|
|
799116
799116
|
}
|
|
799117
799117
|
});
|
|
@@ -799173,7 +799173,7 @@ var UserPosthogManager = class {
|
|
|
799173
799173
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
799174
799174
|
event: "CLI",
|
|
799175
799175
|
properties: {
|
|
799176
|
-
version: "0.19.0-
|
|
799176
|
+
version: "0.19.0-rc2",
|
|
799177
799177
|
...event,
|
|
799178
799178
|
...event.properties
|
|
799179
799179
|
}
|
|
@@ -811983,7 +811983,8 @@ var OpenAPIExtension = {
|
|
|
811983
811983
|
BEARER_FORMAT: "x-bearer-format",
|
|
811984
811984
|
ENUM_VAR_NAMES: "x-enum-varnames",
|
|
811985
811985
|
INTERNAL: "x-internal",
|
|
811986
|
-
EXAMPLES: "x-examples"
|
|
811986
|
+
EXAMPLES: "x-examples",
|
|
811987
|
+
TAGS: "x-tags"
|
|
811987
811988
|
};
|
|
811988
811989
|
|
|
811989
811990
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/fernExtensions.js
|
|
@@ -813299,8 +813300,9 @@ function getTitleAsName(title) {
|
|
|
813299
813300
|
return title;
|
|
813300
813301
|
}
|
|
813301
813302
|
function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude = /* @__PURE__ */ new Set(), referencedAsRequest = false) {
|
|
813303
|
+
var _a2;
|
|
813302
813304
|
const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME) ?? getTitleAsName(schema2.title);
|
|
813303
|
-
const groupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME);
|
|
813305
|
+
const groupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME) ?? ((_a2 = getExtension(schema2, OpenAPIExtension.TAGS)) == null ? void 0 : _a2[0]);
|
|
813304
813306
|
const generatedName = getGeneratedTypeName(breadcrumbs);
|
|
813305
813307
|
const description = schema2.description;
|
|
813306
813308
|
const examples = getExtension(schema2, OpenAPIExtension.EXAMPLES);
|
|
@@ -814025,7 +814027,13 @@ var ExampleTypeFactory = class {
|
|
|
814025
814027
|
this.schemas = schemas;
|
|
814026
814028
|
}
|
|
814027
814029
|
buildExample({ schema: schema2, example, options }) {
|
|
814028
|
-
return this.buildExampleHelper({
|
|
814030
|
+
return this.buildExampleHelper({
|
|
814031
|
+
schema: schema2,
|
|
814032
|
+
visitedSchemaIds: /* @__PURE__ */ new Set(),
|
|
814033
|
+
example,
|
|
814034
|
+
options: { ...options, maxCheckerDepth: options.maxCheckerDepth ?? 5 },
|
|
814035
|
+
depth: 0
|
|
814036
|
+
});
|
|
814029
814037
|
}
|
|
814030
814038
|
buildExampleHelper({ example, schema: schema2, depth, visitedSchemaIds, options }) {
|
|
814031
814039
|
var _a2, _b2;
|
|
@@ -814038,7 +814046,7 @@ var ExampleTypeFactory = class {
|
|
|
814038
814046
|
case "literal":
|
|
814039
814047
|
return FullExample.literal(schema2.value);
|
|
814040
814048
|
case "nullable": {
|
|
814041
|
-
if (example == null && !this.hasExample(schema2.value) && (options.ignoreOptionals || this.exceedsMaxDepth(depth, options))) {
|
|
814049
|
+
if (example == null && !this.hasExample(schema2.value, 0, visitedSchemaIds, options) && (options.ignoreOptionals || this.exceedsMaxDepth(depth, options))) {
|
|
814042
814050
|
return void 0;
|
|
814043
814051
|
}
|
|
814044
814052
|
const result2 = this.buildExampleHelper({
|
|
@@ -814060,7 +814068,7 @@ var ExampleTypeFactory = class {
|
|
|
814060
814068
|
return result2;
|
|
814061
814069
|
}
|
|
814062
814070
|
case "optional": {
|
|
814063
|
-
if (example == null && !this.hasExample(schema2.value) && (options.ignoreOptionals || this.exceedsMaxDepth(depth, options))) {
|
|
814071
|
+
if (example == null && !this.hasExample(schema2.value, 0, visitedSchemaIds, options) && (options.ignoreOptionals || this.exceedsMaxDepth(depth, options))) {
|
|
814064
814072
|
return void 0;
|
|
814065
814073
|
}
|
|
814066
814074
|
const result2 = this.buildExampleHelper({
|
|
@@ -814315,23 +814323,26 @@ var ExampleTypeFactory = class {
|
|
|
814315
814323
|
assertNever(schema2);
|
|
814316
814324
|
}
|
|
814317
814325
|
}
|
|
814318
|
-
hasExample(schema2) {
|
|
814326
|
+
hasExample(schema2, depth, visitedSchemaIds = /* @__PURE__ */ new Set(), options) {
|
|
814327
|
+
if (this.exceedsMaxCheckerDepth(depth, options)) {
|
|
814328
|
+
return false;
|
|
814329
|
+
}
|
|
814319
814330
|
switch (schema2.type) {
|
|
814320
814331
|
case "array":
|
|
814321
|
-
return this.hasExample(schema2.value);
|
|
814332
|
+
return this.hasExample(schema2.value, depth + 1, visitedSchemaIds, options);
|
|
814322
814333
|
case "enum":
|
|
814323
814334
|
return schema2.example != null;
|
|
814324
814335
|
case "literal":
|
|
814325
814336
|
return false;
|
|
814326
814337
|
case "map":
|
|
814327
|
-
return schema2.key.schema.example != null && this.hasExample(schema2.value);
|
|
814338
|
+
return schema2.key.schema.example != null && this.hasExample(schema2.value, depth + 1, visitedSchemaIds, options);
|
|
814328
814339
|
case "object": {
|
|
814329
814340
|
const objectExample = schema2.fullExamples != null && schema2.fullExamples.length > 0;
|
|
814330
814341
|
if (objectExample) {
|
|
814331
814342
|
return true;
|
|
814332
814343
|
}
|
|
814333
814344
|
for (const property5 of schema2.properties) {
|
|
814334
|
-
if (this.hasExample(property5.schema)) {
|
|
814345
|
+
if (this.hasExample(property5.schema, depth + 1, visitedSchemaIds, options)) {
|
|
814335
814346
|
return true;
|
|
814336
814347
|
}
|
|
814337
814348
|
}
|
|
@@ -814341,19 +814352,25 @@ var ExampleTypeFactory = class {
|
|
|
814341
814352
|
return schema2.schema.example != null;
|
|
814342
814353
|
case "reference": {
|
|
814343
814354
|
const resolvedSchema = this.schemas[schema2.schema];
|
|
814344
|
-
if (resolvedSchema != null) {
|
|
814345
|
-
|
|
814355
|
+
if (resolvedSchema != null && !visitedSchemaIds.has(schema2.schema)) {
|
|
814356
|
+
visitedSchemaIds.add(schema2.schema);
|
|
814357
|
+
const hasExample = this.hasExample(resolvedSchema, depth, visitedSchemaIds, options);
|
|
814358
|
+
visitedSchemaIds.delete(schema2.schema);
|
|
814359
|
+
return hasExample;
|
|
814346
814360
|
}
|
|
814347
814361
|
return false;
|
|
814348
814362
|
}
|
|
814349
814363
|
case "unknown":
|
|
814350
814364
|
return schema2.example != null;
|
|
814351
814365
|
case "oneOf":
|
|
814352
|
-
return Object.values(schema2.value.schemas).some((schema3) => this.hasExample(schema3));
|
|
814366
|
+
return Object.values(schema2.value.schemas).some((schema3) => this.hasExample(schema3, depth, visitedSchemaIds, options));
|
|
814353
814367
|
default:
|
|
814354
814368
|
return false;
|
|
814355
814369
|
}
|
|
814356
814370
|
}
|
|
814371
|
+
exceedsMaxCheckerDepth(depth, options) {
|
|
814372
|
+
return depth > (options.maxCheckerDepth ?? 0);
|
|
814373
|
+
}
|
|
814357
814374
|
exceedsMaxDepth(depth, options) {
|
|
814358
814375
|
return depth > (options.maxDepth ?? 0);
|
|
814359
814376
|
}
|
|
@@ -825850,10 +825867,10 @@ var CliContext = class {
|
|
|
825850
825867
|
return "fern-api";
|
|
825851
825868
|
}
|
|
825852
825869
|
getPackageVersion() {
|
|
825853
|
-
if ("0.19.0-
|
|
825870
|
+
if ("0.19.0-rc2" == null) {
|
|
825854
825871
|
this.logger.error("CLI_VERSION is not defined");
|
|
825855
825872
|
}
|
|
825856
|
-
return "0.19.0-
|
|
825873
|
+
return "0.19.0-rc2";
|
|
825857
825874
|
}
|
|
825858
825875
|
getCliName() {
|
|
825859
825876
|
if ("fern" == null) {
|
|
@@ -843802,7 +843819,12 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
|
|
|
843802
843819
|
token,
|
|
843803
843820
|
version: version3
|
|
843804
843821
|
})));
|
|
843805
|
-
|
|
843822
|
+
for (const untabbedItem of untabbedItems) {
|
|
843823
|
+
pages = {
|
|
843824
|
+
...pages,
|
|
843825
|
+
...untabbedItem.pages
|
|
843826
|
+
};
|
|
843827
|
+
}
|
|
843806
843828
|
config = {
|
|
843807
843829
|
items: untabbedItems.map((item) => item.item)
|
|
843808
843830
|
};
|
|
@@ -843862,7 +843884,7 @@ async function convertNavigationConfig({ navigationConfig, tabs, parsedDocsConfi
|
|
|
843862
843884
|
}
|
|
843863
843885
|
return {
|
|
843864
843886
|
config,
|
|
843865
|
-
pages
|
|
843887
|
+
pages
|
|
843866
843888
|
};
|
|
843867
843889
|
}
|
|
843868
843890
|
function convertAvailability2(availability) {
|
|
@@ -843941,7 +843963,7 @@ async function convertUnversionedNavigationConfig({ navigationConfig, tabs, pars
|
|
|
843941
843963
|
}
|
|
843942
843964
|
return {
|
|
843943
843965
|
config,
|
|
843944
|
-
pages
|
|
843966
|
+
pages
|
|
843945
843967
|
};
|
|
843946
843968
|
}
|
|
843947
843969
|
function convertDocsTypographyConfiguration({ typographyConfiguration, parsedDocsConfig, uploadUrls, context }) {
|