@fern-api/fern-api-dev 5.64.0 → 5.64.1
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/cli.cjs +87 -97
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -366386,39 +366386,6 @@ var init_GraphQLConverter = __esm({
|
|
|
366386
366386
|
}
|
|
366387
366387
|
return fields.every((f3) => f3.args.length > 0);
|
|
366388
366388
|
}
|
|
366389
|
-
// Returns the names of object types that will be consumed as namespace groupings by
|
|
366390
|
-
// convertOperations — i.e. types that appear as the return type of a zero-arg root
|
|
366391
|
-
// field whose own fields all accept arguments. These types must be excluded from the
|
|
366392
|
-
// type registry in collectTypeDefinitions to prevent their fields from showing up
|
|
366393
|
-
// both as object properties and as standalone operations.
|
|
366394
|
-
collectNamespaceTypeNames() {
|
|
366395
|
-
if (!this.schema) {
|
|
366396
|
-
return /* @__PURE__ */ new Set();
|
|
366397
|
-
}
|
|
366398
|
-
const namespaceTypeNames = /* @__PURE__ */ new Set();
|
|
366399
|
-
const rootTypes = [];
|
|
366400
|
-
const queryType = this.schema.getQueryType();
|
|
366401
|
-
if (queryType) {
|
|
366402
|
-
rootTypes.push(queryType);
|
|
366403
|
-
}
|
|
366404
|
-
const mutationType = this.schema.getMutationType();
|
|
366405
|
-
if (mutationType) {
|
|
366406
|
-
rootTypes.push(mutationType);
|
|
366407
|
-
}
|
|
366408
|
-
const subscriptionType = this.schema.getSubscriptionType();
|
|
366409
|
-
if (subscriptionType && this.isActualSubscriptionRootType(subscriptionType)) {
|
|
366410
|
-
rootTypes.push(subscriptionType);
|
|
366411
|
-
}
|
|
366412
|
-
for (const rootType of rootTypes) {
|
|
366413
|
-
for (const field5 of Object.values(rootType.getFields())) {
|
|
366414
|
-
const returnRawType = this.unwrapNonNull(field5.type);
|
|
366415
|
-
if (returnRawType instanceof GraphQLObjectType && field5.args.length === 0 && this.isNamespaceType(returnRawType)) {
|
|
366416
|
-
namespaceTypeNames.add(returnRawType.name);
|
|
366417
|
-
}
|
|
366418
|
-
}
|
|
366419
|
-
}
|
|
366420
|
-
return namespaceTypeNames;
|
|
366421
|
-
}
|
|
366422
366389
|
async convert() {
|
|
366423
366390
|
const sdlContent = await (0, import_promises38.readFile)(this.filePath, "utf-8");
|
|
366424
366391
|
this.schema = buildSchema(sdlContent);
|
|
@@ -366460,7 +366427,6 @@ var init_GraphQLConverter = __esm({
|
|
|
366460
366427
|
if (!this.schema) {
|
|
366461
366428
|
return;
|
|
366462
366429
|
}
|
|
366463
|
-
const namespaceTypeNames = this.collectNamespaceTypeNames();
|
|
366464
366430
|
const typeMap = this.schema.getTypeMap();
|
|
366465
366431
|
for (const [typeName, type7] of Object.entries(typeMap)) {
|
|
366466
366432
|
if (typeName.startsWith("__")) {
|
|
@@ -366472,9 +366438,6 @@ var init_GraphQLConverter = __esm({
|
|
|
366472
366438
|
if (type7 === this.schema.getSubscriptionType() && type7 instanceof GraphQLObjectType && this.isActualSubscriptionRootType(type7)) {
|
|
366473
366439
|
continue;
|
|
366474
366440
|
}
|
|
366475
|
-
if (type7 instanceof GraphQLObjectType && namespaceTypeNames.has(typeName)) {
|
|
366476
|
-
continue;
|
|
366477
|
-
}
|
|
366478
366441
|
if (type7 instanceof GraphQLScalarType && this.isBuiltInScalar(typeName)) {
|
|
366479
366442
|
continue;
|
|
366480
366443
|
}
|
|
@@ -366560,14 +366523,30 @@ var init_GraphQLConverter = __esm({
|
|
|
366560
366523
|
}
|
|
366561
366524
|
}
|
|
366562
366525
|
}
|
|
366526
|
+
// Builds an operation id of the form `<operationType>_<segments joined by ".">`.
|
|
366527
|
+
// Flat (top-level) ids use a single segment; namespaced ids include the full field
|
|
366528
|
+
// path so that fields sharing a leaf name across namespaces resolve to distinct ids.
|
|
366529
|
+
// resolveOperationIds falls back from the flat id to the namespaced id on collision,
|
|
366530
|
+
// so both must be produced with this same format for that fallback to line up.
|
|
366531
|
+
buildOperationId(operationType, segments) {
|
|
366532
|
+
return `${operationType.toLowerCase()}_${segments.join(".")}`;
|
|
366533
|
+
}
|
|
366563
366534
|
convertOperations(type7, operationType, pending) {
|
|
366564
366535
|
const fields = type7.getFields();
|
|
366565
366536
|
for (const [fieldName, field5] of Object.entries(fields)) {
|
|
366566
366537
|
const returnRawType = this.unwrapNonNull(field5.type);
|
|
366567
366538
|
if (returnRawType instanceof GraphQLObjectType && field5.args.length === 0 && this.isNamespaceType(returnRawType)) {
|
|
366539
|
+
if (operationType === "QUERY") {
|
|
366540
|
+
const parentFlatId = this.buildOperationId(operationType, [fieldName]);
|
|
366541
|
+
pending.push({
|
|
366542
|
+
flatId: parentFlatId,
|
|
366543
|
+
namespacedId: parentFlatId,
|
|
366544
|
+
operation: this.convertField(field5, fieldName, operationType)
|
|
366545
|
+
});
|
|
366546
|
+
}
|
|
366568
366547
|
this.convertNamespaceOperations(returnRawType, operationType, pending, [fieldName]);
|
|
366569
366548
|
} else {
|
|
366570
|
-
const flatId =
|
|
366549
|
+
const flatId = this.buildOperationId(operationType, [fieldName]);
|
|
366571
366550
|
pending.push({
|
|
366572
366551
|
flatId,
|
|
366573
366552
|
namespacedId: flatId,
|
|
@@ -366579,8 +366558,8 @@ var init_GraphQLConverter = __esm({
|
|
|
366579
366558
|
convertNamespaceOperations(namespaceType, operationType, pending, fieldPath) {
|
|
366580
366559
|
const fields = namespaceType.getFields();
|
|
366581
366560
|
for (const [fieldName, field5] of Object.entries(fields)) {
|
|
366582
|
-
const flatId =
|
|
366583
|
-
const namespacedId =
|
|
366561
|
+
const flatId = this.buildOperationId(operationType, [fieldName]);
|
|
366562
|
+
const namespacedId = this.buildOperationId(operationType, [...fieldPath, fieldName]);
|
|
366584
366563
|
pending.push({
|
|
366585
366564
|
flatId,
|
|
366586
366565
|
namespacedId,
|
|
@@ -453327,6 +453306,9 @@ var init_toPageNode = __esm({
|
|
|
453327
453306
|
function getFieldPath(operation) {
|
|
453328
453307
|
return operation.fieldPath;
|
|
453329
453308
|
}
|
|
453309
|
+
function getOperationName(operation) {
|
|
453310
|
+
return operation.name ?? operation.id;
|
|
453311
|
+
}
|
|
453330
453312
|
var import_url_join21, ApiReferenceNodeConverter;
|
|
453331
453313
|
var init_ApiReferenceNodeConverter = __esm({
|
|
453332
453314
|
"../docs-resolver/lib/ApiReferenceNodeConverter.js"() {
|
|
@@ -453792,25 +453774,20 @@ ${tagInfo.description}`;
|
|
|
453792
453774
|
}
|
|
453793
453775
|
this.#visitedGraphqlOperations.add(operationId);
|
|
453794
453776
|
const operationSlug = endpointItem.slug != null ? parentSlug.append(endpointItem.slug) : parentSlug.append(graphqlOperation.name ?? graphqlOperation.id);
|
|
453795
|
-
return {
|
|
453777
|
+
return this.#buildGraphqlChildNode({
|
|
453796
453778
|
id: this.#idgen.get(`${this.apiDefinitionId}:${operationId}`),
|
|
453797
|
-
type: "graphql",
|
|
453798
|
-
collapsed: void 0,
|
|
453799
453779
|
operationType: graphqlOperation.operationType,
|
|
453800
453780
|
graphqlOperationId: APIV1Read_exports.GraphQlOperationId(graphqlOperation.id),
|
|
453801
|
-
graphqlOperationIds: void 0,
|
|
453802
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
453803
|
-
availability: convertDocsAvailability(endpointItem.availability ?? parentAvailability),
|
|
453804
453781
|
title: endpointItem.title ?? graphqlOperation.displayName ?? graphqlOperation.name ?? graphqlOperation.id,
|
|
453805
453782
|
slug: operationSlug.get(),
|
|
453783
|
+
availability: endpointItem.availability ?? parentAvailability,
|
|
453806
453784
|
icon: this.resolveIconFileId(endpointItem.icon),
|
|
453807
453785
|
hidden: this.hideChildren || endpointItem.hidden,
|
|
453808
453786
|
playground: this.#convertPlaygroundSettings(endpointItem.playground),
|
|
453809
|
-
authed: void 0,
|
|
453810
453787
|
viewers: endpointItem.viewers,
|
|
453811
453788
|
orphaned: endpointItem.orphaned,
|
|
453812
453789
|
featureFlags: endpointItem.featureFlags
|
|
453813
|
-
};
|
|
453790
|
+
});
|
|
453814
453791
|
}
|
|
453815
453792
|
this.taskContext.logger.error("Unknown identifier in the API Reference layout: ", endpointItem.endpoint);
|
|
453816
453793
|
return;
|
|
@@ -453879,25 +453856,18 @@ ${tagInfo.description}`;
|
|
|
453879
453856
|
}
|
|
453880
453857
|
this.#visitedGraphqlOperations.add(operationId);
|
|
453881
453858
|
const operationSlug = operationItem.slug != null ? parentSlug.append(operationItem.slug) : parentSlug.append(graphqlOperation.name ?? graphqlOperation.id);
|
|
453882
|
-
return {
|
|
453859
|
+
return this.#buildGraphqlChildNode({
|
|
453883
453860
|
id: this.#idgen.get(`${this.apiDefinitionId}:${operationId}`),
|
|
453884
|
-
type: "graphql",
|
|
453885
|
-
collapsed: void 0,
|
|
453886
453861
|
operationType: graphqlOperation.operationType,
|
|
453887
453862
|
graphqlOperationId: APIV1Read_exports.GraphQlOperationId(graphqlOperation.id),
|
|
453888
|
-
graphqlOperationIds: void 0,
|
|
453889
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
453890
|
-
availability: convertDocsAvailability(operationItem.availability ?? parentAvailability),
|
|
453891
453863
|
title: operationItem.title ?? graphqlOperation.displayName ?? graphqlOperation.name ?? graphqlOperation.id,
|
|
453892
453864
|
slug: operationSlug.get(),
|
|
453893
|
-
|
|
453865
|
+
availability: operationItem.availability ?? parentAvailability,
|
|
453894
453866
|
hidden: this.hideChildren || operationItem.hidden,
|
|
453895
|
-
playground: void 0,
|
|
453896
|
-
authed: void 0,
|
|
453897
453867
|
viewers: operationItem.viewers,
|
|
453898
453868
|
orphaned: operationItem.orphaned,
|
|
453899
453869
|
featureFlags: operationItem.featureFlags
|
|
453900
|
-
};
|
|
453870
|
+
});
|
|
453901
453871
|
}
|
|
453902
453872
|
// Step 2
|
|
453903
453873
|
#mergeAndFilterChildren(left3, right3) {
|
|
@@ -454215,6 +454185,32 @@ ${tagInfo.description}`;
|
|
|
454215
454185
|
}
|
|
454216
454186
|
return sections;
|
|
454217
454187
|
}
|
|
454188
|
+
// Single source of truth for constructing a GraphQL navigation child node. Callers pass
|
|
454189
|
+
// the fields that vary; the fixed shape (type, apiDefinitionId, authed, ...) and the
|
|
454190
|
+
// availability conversion live here. Optional fields left unset serialize as `undefined`,
|
|
454191
|
+
// matching the previous inline literals exactly — `hidden` is passed explicitly by every
|
|
454192
|
+
// caller so its original value (which may be `undefined`) is preserved verbatim.
|
|
454193
|
+
#buildGraphqlChildNode({ id, operationType, graphqlOperationId, graphqlOperationIds, title: title2, slug, availability, hidden: hidden2, icon, playground, viewers, orphaned, featureFlags }) {
|
|
454194
|
+
return {
|
|
454195
|
+
id,
|
|
454196
|
+
type: "graphql",
|
|
454197
|
+
collapsed: void 0,
|
|
454198
|
+
operationType,
|
|
454199
|
+
graphqlOperationId,
|
|
454200
|
+
graphqlOperationIds,
|
|
454201
|
+
apiDefinitionId: this.apiDefinitionId,
|
|
454202
|
+
availability: convertDocsAvailability(availability),
|
|
454203
|
+
title: title2,
|
|
454204
|
+
slug,
|
|
454205
|
+
icon,
|
|
454206
|
+
hidden: hidden2,
|
|
454207
|
+
playground,
|
|
454208
|
+
authed: void 0,
|
|
454209
|
+
viewers,
|
|
454210
|
+
orphaned,
|
|
454211
|
+
featureFlags
|
|
454212
|
+
};
|
|
454213
|
+
}
|
|
454218
454214
|
#buildFieldPathGroupedChildren(operations, parentSlug, parentAvailability, operationType) {
|
|
454219
454215
|
const shouldGroup = operationType === "QUERY";
|
|
454220
454216
|
const groupedByParent = /* @__PURE__ */ new Map();
|
|
@@ -454233,11 +454229,23 @@ ${tagInfo.description}`;
|
|
|
454233
454229
|
insertionOrder.push({ type: "flat", operation });
|
|
454234
454230
|
}
|
|
454235
454231
|
}
|
|
454232
|
+
const parentOpsByGroup = /* @__PURE__ */ new Map();
|
|
454233
|
+
for (const entry of insertionOrder) {
|
|
454234
|
+
if (entry.type === "flat") {
|
|
454235
|
+
const name2 = getOperationName(entry.operation);
|
|
454236
|
+
if (groupedByParent.has(name2) && getFieldPath(entry.operation) == null) {
|
|
454237
|
+
parentOpsByGroup.set(name2, entry.operation);
|
|
454238
|
+
}
|
|
454239
|
+
}
|
|
454240
|
+
}
|
|
454236
454241
|
const children2 = [];
|
|
454237
454242
|
for (const entry of insertionOrder) {
|
|
454238
454243
|
if (entry.type === "flat") {
|
|
454244
|
+
const leafName = getOperationName(entry.operation);
|
|
454245
|
+
if (parentOpsByGroup.has(leafName)) {
|
|
454246
|
+
continue;
|
|
454247
|
+
}
|
|
454239
454248
|
const fieldPath = getFieldPath(entry.operation);
|
|
454240
|
-
const leafName = entry.operation.name ?? entry.operation.id;
|
|
454241
454249
|
let operationSlug = parentSlug;
|
|
454242
454250
|
if (fieldPath != null && fieldPath.length > 0) {
|
|
454243
454251
|
for (const segment of fieldPath) {
|
|
@@ -454245,51 +454253,33 @@ ${tagInfo.description}`;
|
|
|
454245
454253
|
}
|
|
454246
454254
|
}
|
|
454247
454255
|
operationSlug = operationSlug.append(kebabCase_default(leafName));
|
|
454248
|
-
children2.push({
|
|
454256
|
+
children2.push(this.#buildGraphqlChildNode({
|
|
454249
454257
|
id: navigation_exports.V1.NodeId(`${this.apiDefinitionId}:${entry.operation.id}`),
|
|
454250
|
-
type: "graphql",
|
|
454251
|
-
collapsed: void 0,
|
|
454252
454258
|
operationType: entry.operation.operationType,
|
|
454253
454259
|
graphqlOperationId: APIV1Read_exports.GraphQlOperationId(entry.operation.id),
|
|
454254
|
-
graphqlOperationIds: void 0,
|
|
454255
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
454256
|
-
availability: convertDocsAvailability(parentAvailability),
|
|
454257
454260
|
title: entry.operation.displayName ?? entry.operation.name ?? entry.operation.id,
|
|
454258
454261
|
slug: operationSlug.get(),
|
|
454259
|
-
|
|
454260
|
-
hidden: this.hideChildren
|
|
454261
|
-
|
|
454262
|
-
authed: void 0,
|
|
454263
|
-
viewers: void 0,
|
|
454264
|
-
orphaned: void 0,
|
|
454265
|
-
featureFlags: void 0
|
|
454266
|
-
});
|
|
454262
|
+
availability: parentAvailability,
|
|
454263
|
+
hidden: this.hideChildren
|
|
454264
|
+
}));
|
|
454267
454265
|
} else {
|
|
454268
454266
|
const groupOps = groupedByParent.get(entry.parentField) ?? [];
|
|
454269
|
-
const
|
|
454270
|
-
|
|
454267
|
+
const parentOp = parentOpsByGroup.get(entry.parentField);
|
|
454268
|
+
const representativeOp = parentOp ?? groupOps[0];
|
|
454269
|
+
if (representativeOp == null) {
|
|
454271
454270
|
continue;
|
|
454272
454271
|
}
|
|
454273
454272
|
const fieldSlug = parentSlug.append(kebabCase_default(entry.parentField));
|
|
454274
|
-
children2.push({
|
|
454275
|
-
id: navigation_exports.V1.NodeId(`${this.apiDefinitionId}:${
|
|
454276
|
-
|
|
454277
|
-
|
|
454278
|
-
operationType: firstOp.operationType,
|
|
454279
|
-
graphqlOperationId: APIV1Read_exports.GraphQlOperationId(firstOp.id),
|
|
454273
|
+
children2.push(this.#buildGraphqlChildNode({
|
|
454274
|
+
id: navigation_exports.V1.NodeId(`${this.apiDefinitionId}:${representativeOp.id}`),
|
|
454275
|
+
operationType: representativeOp.operationType,
|
|
454276
|
+
graphqlOperationId: APIV1Read_exports.GraphQlOperationId(representativeOp.id),
|
|
454280
454277
|
graphqlOperationIds: groupOps.map((op2) => APIV1Read_exports.GraphQlOperationId(op2.id)),
|
|
454281
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
454282
|
-
availability: convertDocsAvailability(parentAvailability),
|
|
454283
454278
|
title: entry.parentField,
|
|
454284
454279
|
slug: fieldSlug.get(),
|
|
454285
|
-
|
|
454286
|
-
hidden: this.hideChildren
|
|
454287
|
-
|
|
454288
|
-
authed: void 0,
|
|
454289
|
-
viewers: void 0,
|
|
454290
|
-
orphaned: void 0,
|
|
454291
|
-
featureFlags: void 0
|
|
454292
|
-
});
|
|
454280
|
+
availability: parentAvailability,
|
|
454281
|
+
hidden: this.hideChildren
|
|
454282
|
+
}));
|
|
454293
454283
|
}
|
|
454294
454284
|
}
|
|
454295
454285
|
return children2;
|
|
@@ -687227,7 +687217,7 @@ var AccessTokenPosthogManager = class {
|
|
|
687227
687217
|
properties: {
|
|
687228
687218
|
...event,
|
|
687229
687219
|
...event.properties,
|
|
687230
|
-
version: "5.64.
|
|
687220
|
+
version: "5.64.1",
|
|
687231
687221
|
usingAccessToken: true,
|
|
687232
687222
|
...getRunIdProperties()
|
|
687233
687223
|
}
|
|
@@ -687293,7 +687283,7 @@ var UserPosthogManager = class {
|
|
|
687293
687283
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
687294
687284
|
event: "CLI",
|
|
687295
687285
|
properties: {
|
|
687296
|
-
version: "5.64.
|
|
687286
|
+
version: "5.64.1",
|
|
687297
687287
|
...event,
|
|
687298
687288
|
...event.properties,
|
|
687299
687289
|
usingAccessToken: false,
|
|
@@ -868388,7 +868378,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
868388
868378
|
var LOGS_FOLDER_NAME = "logs";
|
|
868389
868379
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
868390
868380
|
function getCliSource() {
|
|
868391
|
-
const version7 = "5.64.
|
|
868381
|
+
const version7 = "5.64.1";
|
|
868392
868382
|
return `cli@${version7}`;
|
|
868393
868383
|
}
|
|
868394
868384
|
var DebugLogger = class {
|
|
@@ -900905,7 +900895,7 @@ var LegacyDocsPublisher = class {
|
|
|
900905
900895
|
previewId,
|
|
900906
900896
|
disableTemplates: void 0,
|
|
900907
900897
|
skipUpload,
|
|
900908
|
-
cliVersion: "5.64.
|
|
900898
|
+
cliVersion: "5.64.1",
|
|
900909
900899
|
loginCommand: "fern auth login"
|
|
900910
900900
|
});
|
|
900911
900901
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -967213,7 +967203,7 @@ function getAutomationContextFromEnv() {
|
|
|
967213
967203
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
967214
967204
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
967215
967205
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
967216
|
-
cli_version: "5.64.
|
|
967206
|
+
cli_version: "5.64.1"
|
|
967217
967207
|
};
|
|
967218
967208
|
}
|
|
967219
967209
|
function isAutomationMode() {
|
|
@@ -968045,7 +968035,7 @@ var CliContext = class _CliContext {
|
|
|
968045
968035
|
if (false) {
|
|
968046
968036
|
this.logger.error("CLI_VERSION is not defined");
|
|
968047
968037
|
}
|
|
968048
|
-
return "5.64.
|
|
968038
|
+
return "5.64.1";
|
|
968049
968039
|
}
|
|
968050
968040
|
getCliName() {
|
|
968051
968041
|
if (false) {
|
package/package.json
CHANGED