@fern-api/fern-api-dev 4.108.0 → 4.109.0-1-g1bf359628bd
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 +173 -57
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -510619,7 +510619,7 @@ var MetadataConfig = external_exports.object({
|
|
|
510619
510619
|
"twitter:url": external_exports.string().optional(),
|
|
510620
510620
|
"twitter:card": TwitterCardSetting.optional(),
|
|
510621
510621
|
"og:dynamic": external_exports.boolean().optional(),
|
|
510622
|
-
"og:background-image": external_exports.string().optional(),
|
|
510622
|
+
"og:dynamic:background-image": external_exports.string().optional(),
|
|
510623
510623
|
"og:dynamic:text-color": external_exports.string().optional(),
|
|
510624
510624
|
"og:dynamic:background-color": external_exports.string().optional(),
|
|
510625
510625
|
"og:dynamic:logo-color": external_exports.enum(["dark", "light"]).optional(),
|
|
@@ -513961,7 +513961,7 @@ var MetadataConfig2 = schemas_exports6.object({
|
|
|
513961
513961
|
twitterUrl: schemas_exports6.property("twitter:url", schemas_exports6.string().optional()),
|
|
513962
513962
|
twitterCard: schemas_exports6.property("twitter:card", TwitterCardSetting3.optional()),
|
|
513963
513963
|
ogDynamic: schemas_exports6.property("og:dynamic", schemas_exports6.boolean().optional()),
|
|
513964
|
-
|
|
513964
|
+
ogDynamicBackgroundImage: schemas_exports6.property("og:dynamic:background-image", schemas_exports6.string().optional()),
|
|
513965
513965
|
ogDynamicTextColor: schemas_exports6.property("og:dynamic:text-color", schemas_exports6.string().optional()),
|
|
513966
513966
|
ogDynamicBackgroundColor: schemas_exports6.property("og:dynamic:background-color", schemas_exports6.string().optional()),
|
|
513967
513967
|
ogDynamicLogoColor: schemas_exports6.property("og:dynamic:logo-color", OgDynamicLogoColor2.optional()),
|
|
@@ -543279,7 +543279,7 @@ async function convertMetadata(metadata, absoluteFilepathToDocsConfig, context3)
|
|
|
543279
543279
|
"twitter:url": metadata.twitterUrl,
|
|
543280
543280
|
"twitter:card": metadata.twitterCard,
|
|
543281
543281
|
"og:dynamic": metadata.ogDynamic,
|
|
543282
|
-
"og:background-image": await convertFilepathOrUrl(metadata.
|
|
543282
|
+
"og:dynamic:background-image": await convertFilepathOrUrl(metadata.ogDynamicBackgroundImage, absoluteFilepathToDocsConfig),
|
|
543283
543283
|
"og:dynamic:text-color": metadata.ogDynamicTextColor,
|
|
543284
543284
|
"og:dynamic:background-color": metadata.ogDynamicBackgroundColor,
|
|
543285
543285
|
"og:dynamic:logo-color": metadata.ogDynamicLogoColor,
|
|
@@ -543296,7 +543296,7 @@ async function convertMetadata(metadata, absoluteFilepathToDocsConfig, context3)
|
|
|
543296
543296
|
function warnOnMetadataConflicts(metadata, context3) {
|
|
543297
543297
|
const dynamicEnabled = metadata.ogDynamic === true;
|
|
543298
543298
|
const dynamicSettings = [
|
|
543299
|
-
["og:background-image", metadata.
|
|
543299
|
+
["og:dynamic:background-image", metadata.ogDynamicBackgroundImage],
|
|
543300
543300
|
["og:dynamic:text-color", metadata.ogDynamicTextColor],
|
|
543301
543301
|
["og:dynamic:background-color", metadata.ogDynamicBackgroundColor],
|
|
543302
543302
|
["og:dynamic:logo-color", metadata.ogDynamicLogoColor],
|
|
@@ -614192,6 +614192,7 @@ __export(schemas_exports13, {
|
|
|
614192
614192
|
GitOutputSchema: () => GitOutputSchema,
|
|
614193
614193
|
GitSelfHostedOutputModeSchema: () => GitSelfHostedOutputModeSchema,
|
|
614194
614194
|
GitSelfHostedOutputSchema: () => GitSelfHostedOutputSchema,
|
|
614195
|
+
GraphQlSpecSchema: () => GraphQlSpecSchema2,
|
|
614195
614196
|
HeaderConfigSchema: () => HeaderConfigSchema,
|
|
614196
614197
|
HeaderSchema: () => HeaderSchema2,
|
|
614197
614198
|
IntegrationsConfigSchema: () => IntegrationsConfigSchema2,
|
|
@@ -614391,6 +614392,18 @@ var FernSpecSchema = external_exports.object({
|
|
|
614391
614392
|
settings: FernSettingsSchema.optional()
|
|
614392
614393
|
});
|
|
614393
614394
|
|
|
614395
|
+
// ../config/lib/schemas/specs/GraphQlSpecSchema.js
|
|
614396
|
+
var GraphQlSpecSchema2 = external_exports.object({
|
|
614397
|
+
/** Path to the GraphQL schema file. */
|
|
614398
|
+
graphql: external_exports.string(),
|
|
614399
|
+
/** URL origin for the GraphQL endpoint. */
|
|
614400
|
+
origin: external_exports.string().optional(),
|
|
614401
|
+
/** Path to overrides file for the GraphQL spec. */
|
|
614402
|
+
overrides: external_exports.union([external_exports.string(), external_exports.array(external_exports.string()).nonempty()]).optional(),
|
|
614403
|
+
/** Name used to group this GraphQL spec in the docs (rendered as a top-level section). */
|
|
614404
|
+
name: external_exports.string().optional()
|
|
614405
|
+
});
|
|
614406
|
+
|
|
614394
614407
|
// ../config/lib/schemas/settings/DefaultIntegerFormatSchema.js
|
|
614395
614408
|
var DefaultIntegerFormatSchema = external_exports.enum(["int32", "int64", "uint32", "uint64"]);
|
|
614396
614409
|
|
|
@@ -614540,7 +614553,8 @@ var ApiSpecSchema = external_exports.union([
|
|
|
614540
614553
|
ProtobufSpecSchema2,
|
|
614541
614554
|
FernSpecSchema,
|
|
614542
614555
|
ConjureSpecSchema,
|
|
614543
|
-
OpenRpcSpecSchema2
|
|
614556
|
+
OpenRpcSpecSchema2,
|
|
614557
|
+
GraphQlSpecSchema2
|
|
614544
614558
|
]);
|
|
614545
614559
|
|
|
614546
614560
|
// ../config/lib/schemas/AuthSchemesSchema.js
|
|
@@ -621372,7 +621386,7 @@ var AccessTokenPosthogManager = class {
|
|
|
621372
621386
|
properties: {
|
|
621373
621387
|
...event,
|
|
621374
621388
|
...event.properties,
|
|
621375
|
-
version: "4.
|
|
621389
|
+
version: "4.109.0-1-g1bf359628bd",
|
|
621376
621390
|
usingAccessToken: true
|
|
621377
621391
|
}
|
|
621378
621392
|
});
|
|
@@ -621426,7 +621440,7 @@ var UserPosthogManager = class {
|
|
|
621426
621440
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
621427
621441
|
event: "CLI",
|
|
621428
621442
|
properties: {
|
|
621429
|
-
version: "4.
|
|
621443
|
+
version: "4.109.0-1-g1bf359628bd",
|
|
621430
621444
|
...event,
|
|
621431
621445
|
...event.properties,
|
|
621432
621446
|
usingAccessToken: false,
|
|
@@ -625252,6 +625266,13 @@ var ApiDefinitionConverter = class {
|
|
|
625252
625266
|
sourced
|
|
625253
625267
|
});
|
|
625254
625268
|
}
|
|
625269
|
+
if ("graphql" in spec && "graphql" in sourced) {
|
|
625270
|
+
return await this.convertGraphQlSpec({
|
|
625271
|
+
absoluteFernYmlPath,
|
|
625272
|
+
spec,
|
|
625273
|
+
sourced
|
|
625274
|
+
});
|
|
625275
|
+
}
|
|
625255
625276
|
throw new CliError({
|
|
625256
625277
|
message: `Unknown spec type: ${JSON.stringify(spec)}`,
|
|
625257
625278
|
code: CliError.Code.InternalError
|
|
@@ -625361,6 +625382,25 @@ var ApiDefinitionConverter = class {
|
|
|
625361
625382
|
}
|
|
625362
625383
|
return result;
|
|
625363
625384
|
}
|
|
625385
|
+
async convertGraphQlSpec({ absoluteFernYmlPath, spec, sourced }) {
|
|
625386
|
+
const result = {
|
|
625387
|
+
graphql: await this.resolvePath({ absoluteFernYmlPath, path: spec.graphql, sourced: sourced.graphql })
|
|
625388
|
+
};
|
|
625389
|
+
if (spec.origin != null) {
|
|
625390
|
+
result.origin = spec.origin;
|
|
625391
|
+
}
|
|
625392
|
+
if (spec.overrides != null && !isNullish2(sourced.overrides)) {
|
|
625393
|
+
result.overrides = await this.resolvePathOrPaths({
|
|
625394
|
+
absoluteFernYmlPath,
|
|
625395
|
+
paths: spec.overrides,
|
|
625396
|
+
sourced: sourced.overrides
|
|
625397
|
+
});
|
|
625398
|
+
}
|
|
625399
|
+
if (spec.name != null) {
|
|
625400
|
+
result.name = spec.name;
|
|
625401
|
+
}
|
|
625402
|
+
return result;
|
|
625403
|
+
}
|
|
625364
625404
|
async convertOpenRpcSpec({ absoluteFernYmlPath, spec, sourced }) {
|
|
625365
625405
|
const result = {
|
|
625366
625406
|
openrpc: await this.resolvePath({ absoluteFernYmlPath, path: spec.openrpc, sourced: sourced.openrpc })
|
|
@@ -626639,6 +626679,11 @@ var TaskContextAdapter = class {
|
|
|
626639
626679
|
// ../cli-v2/lib/api/adapter/LegacyApiSpecAdapter.js
|
|
626640
626680
|
init_lib6();
|
|
626641
626681
|
|
|
626682
|
+
// ../cli-v2/lib/api/config/GraphQlSpec.js
|
|
626683
|
+
function isGraphQlSpec(spec) {
|
|
626684
|
+
return "graphql" in spec;
|
|
626685
|
+
}
|
|
626686
|
+
|
|
626642
626687
|
// ../cli-v2/lib/api/config/OpenRpcSpec.js
|
|
626643
626688
|
function isOpenRpcSpec(spec) {
|
|
626644
626689
|
return "openrpc" in spec;
|
|
@@ -626650,6 +626695,24 @@ function isProtobufSpec(spec) {
|
|
|
626650
626695
|
}
|
|
626651
626696
|
|
|
626652
626697
|
// ../cli-v2/lib/api/adapter/LegacyApiSpecAdapter.js
|
|
626698
|
+
function partitionV1Specs(v1Specs) {
|
|
626699
|
+
const filteredSpecs = v1Specs.filter((spec) => {
|
|
626700
|
+
if (spec.type === "openrpc" || spec.type === "graphql") {
|
|
626701
|
+
return false;
|
|
626702
|
+
}
|
|
626703
|
+
if (spec.type === "protobuf" && !spec.fromOpenAPI) {
|
|
626704
|
+
return false;
|
|
626705
|
+
}
|
|
626706
|
+
return true;
|
|
626707
|
+
});
|
|
626708
|
+
const allSpecs = v1Specs.filter((spec) => {
|
|
626709
|
+
if (spec.type === "protobuf" && spec.fromOpenAPI) {
|
|
626710
|
+
return false;
|
|
626711
|
+
}
|
|
626712
|
+
return true;
|
|
626713
|
+
});
|
|
626714
|
+
return { filteredSpecs, allSpecs };
|
|
626715
|
+
}
|
|
626653
626716
|
var LegacyApiSpecAdapter = class {
|
|
626654
626717
|
context;
|
|
626655
626718
|
constructor(config5) {
|
|
@@ -626668,6 +626731,9 @@ var LegacyApiSpecAdapter = class {
|
|
|
626668
626731
|
if (isOpenRpcSpec(spec)) {
|
|
626669
626732
|
return this.adaptOpenRpcSpec(spec);
|
|
626670
626733
|
}
|
|
626734
|
+
if (isGraphQlSpec(spec)) {
|
|
626735
|
+
return this.adaptGraphQlSpec(spec);
|
|
626736
|
+
}
|
|
626671
626737
|
throw new CliError({
|
|
626672
626738
|
message: `Unsupported spec type: ${JSON.stringify(spec)}`,
|
|
626673
626739
|
code: CliError.Code.InternalError
|
|
@@ -626726,6 +626792,14 @@ var LegacyApiSpecAdapter = class {
|
|
|
626726
626792
|
namespace: void 0
|
|
626727
626793
|
};
|
|
626728
626794
|
}
|
|
626795
|
+
adaptGraphQlSpec(spec) {
|
|
626796
|
+
return {
|
|
626797
|
+
type: "graphql",
|
|
626798
|
+
absoluteFilepath: spec.graphql,
|
|
626799
|
+
absoluteFilepathToOverrides: spec.overrides,
|
|
626800
|
+
namespace: spec.name
|
|
626801
|
+
};
|
|
626802
|
+
}
|
|
626729
626803
|
adaptOpenApiSettings(settings) {
|
|
626730
626804
|
if (settings == null) {
|
|
626731
626805
|
return void 0;
|
|
@@ -626938,21 +627012,10 @@ var ApiDefinitionValidator = class {
|
|
|
626938
627012
|
}
|
|
626939
627013
|
const specAdapter = new LegacyApiSpecAdapter({ context: this.context });
|
|
626940
627014
|
const v1Specs = specAdapter.convertAll(ossSpecs);
|
|
626941
|
-
const filteredSpecs = v1Specs
|
|
626942
|
-
|
|
626943
|
-
|
|
626944
|
-
|
|
626945
|
-
if (spec.type === "protobuf" && !spec.fromOpenAPI) {
|
|
626946
|
-
return false;
|
|
626947
|
-
}
|
|
626948
|
-
return true;
|
|
626949
|
-
});
|
|
626950
|
-
const allSpecs = v1Specs.filter((spec) => {
|
|
626951
|
-
if (spec.type === "protobuf" && spec.fromOpenAPI) {
|
|
626952
|
-
return false;
|
|
626953
|
-
}
|
|
626954
|
-
return true;
|
|
626955
|
-
});
|
|
627015
|
+
const { filteredSpecs, allSpecs } = partitionV1Specs(v1Specs);
|
|
627016
|
+
if (filteredSpecs.length === 0) {
|
|
627017
|
+
return violations;
|
|
627018
|
+
}
|
|
626956
627019
|
const ossWorkspace = new OSSWorkspace({
|
|
626957
627020
|
specs: filteredSpecs,
|
|
626958
627021
|
allSpecs,
|
|
@@ -753778,22 +753841,9 @@ var LegacyOSSWorkspaceAdapter = class {
|
|
|
753778
753841
|
return void 0;
|
|
753779
753842
|
}
|
|
753780
753843
|
const v1Specs = this.specAdapter.convertAll(ossSpecs);
|
|
753781
|
-
const filteredSpecs = v1Specs
|
|
753782
|
-
|
|
753783
|
-
|
|
753784
|
-
}
|
|
753785
|
-
if (spec.type === "protobuf" && !spec.fromOpenAPI) {
|
|
753786
|
-
return false;
|
|
753787
|
-
}
|
|
753788
|
-
return true;
|
|
753789
|
-
});
|
|
753790
|
-
const allSpecs = v1Specs.filter((spec) => {
|
|
753791
|
-
if (spec.type === "protobuf" && spec.fromOpenAPI) {
|
|
753792
|
-
return false;
|
|
753793
|
-
}
|
|
753794
|
-
return true;
|
|
753795
|
-
});
|
|
753796
|
-
if (filteredSpecs.length === 0) {
|
|
753844
|
+
const { filteredSpecs, allSpecs } = partitionV1Specs(v1Specs);
|
|
753845
|
+
const hasGraphQlSpec = allSpecs.some((spec) => spec.type === "graphql");
|
|
753846
|
+
if (filteredSpecs.length === 0 && !hasGraphQlSpec) {
|
|
753797
753847
|
return void 0;
|
|
753798
753848
|
}
|
|
753799
753849
|
return new OSSWorkspace({
|
|
@@ -798769,8 +798819,8 @@ async function collectFilesFromDocsConfig({ parsedDocsConfig }) {
|
|
|
798769
798819
|
if (parsedDocsConfig.metadata?.["twitter:image"] != null && parsedDocsConfig.metadata["twitter:image"].type === "filepath") {
|
|
798770
798820
|
filepaths.add(parsedDocsConfig.metadata["twitter:image"].value);
|
|
798771
798821
|
}
|
|
798772
|
-
if (parsedDocsConfig.metadata?.["og:background-image"] != null && parsedDocsConfig.metadata["og:background-image"].type === "filepath") {
|
|
798773
|
-
filepaths.add(parsedDocsConfig.metadata["og:background-image"].value);
|
|
798822
|
+
if (parsedDocsConfig.metadata?.["og:dynamic:background-image"] != null && parsedDocsConfig.metadata["og:dynamic:background-image"].type === "filepath") {
|
|
798823
|
+
filepaths.add(parsedDocsConfig.metadata["og:dynamic:background-image"].value);
|
|
798774
798824
|
}
|
|
798775
798825
|
if (parsedDocsConfig.typography?.bodyFont != null) {
|
|
798776
798826
|
parsedDocsConfig.typography.bodyFont.variants.forEach((variant) => {
|
|
@@ -800752,13 +800802,13 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
800752
800802
|
if (this.parsedDocsConfig.metadata == null) {
|
|
800753
800803
|
return;
|
|
800754
800804
|
}
|
|
800755
|
-
const { "og:image": ogImage, "og:logo": ogLogo, "twitter:image": twitterImage, "og:background-image":
|
|
800805
|
+
const { "og:image": ogImage, "og:logo": ogLogo, "twitter:image": twitterImage, "og:dynamic:background-image": ogDynamicBackgroundImage, ...rest } = this.parsedDocsConfig.metadata;
|
|
800756
800806
|
return {
|
|
800757
800807
|
...rest,
|
|
800758
800808
|
"og:image": this.convertFileIdOrUrl(ogImage),
|
|
800759
800809
|
"og:logo": this.convertFileIdOrUrl(ogLogo),
|
|
800760
800810
|
"twitter:image": this.convertFileIdOrUrl(twitterImage),
|
|
800761
|
-
"og:background-image": this.convertFileIdOrUrl(
|
|
800811
|
+
"og:dynamic:background-image": this.convertFileIdOrUrl(ogDynamicBackgroundImage)
|
|
800762
800812
|
};
|
|
800763
800813
|
}
|
|
800764
800814
|
convertFileIdOrUrl(filepathOrUrl) {
|
|
@@ -800941,7 +800991,7 @@ async function resolveThemeFileUrls(themeConfig, tmpDir) {
|
|
|
800941
800991
|
cfg.footer = await maybeDownload(cfg.footer);
|
|
800942
800992
|
if (cfg.metadata != null && typeof cfg.metadata === "object") {
|
|
800943
800993
|
const meta5 = cfg.metadata;
|
|
800944
|
-
for (const imgKey of ["og:image", "twitter:image", "og:background-image", "og:logo"]) {
|
|
800994
|
+
for (const imgKey of ["og:image", "twitter:image", "og:dynamic:background-image", "og:logo"]) {
|
|
800945
800995
|
meta5[imgKey] = await maybeDownload(meta5[imgKey]);
|
|
800946
800996
|
}
|
|
800947
800997
|
}
|
|
@@ -829157,8 +829207,8 @@ var LegacyProjectAdapter = class {
|
|
|
829157
829207
|
this.context = context3;
|
|
829158
829208
|
this.ossAdapter = new LegacyOSSWorkspaceAdapter({ context: context3 });
|
|
829159
829209
|
}
|
|
829160
|
-
adapt(workspace) {
|
|
829161
|
-
const apiWorkspaces = this.buildApiWorkspaces(workspace);
|
|
829210
|
+
async adapt(workspace) {
|
|
829211
|
+
const apiWorkspaces = await this.buildApiWorkspaces(workspace);
|
|
829162
829212
|
const docsWorkspace = workspace.docs != null ? this.docsAdapter.adapt({
|
|
829163
829213
|
docsConfig: workspace.docs,
|
|
829164
829214
|
absoluteFilePath: workspace.docs.absoluteFilePath ?? workspace.absoluteFilePath ?? this.context.cwd
|
|
@@ -829186,8 +829236,9 @@ var LegacyProjectAdapter = class {
|
|
|
829186
829236
|
/**
|
|
829187
829237
|
* Bridges API definitions to legacy AbstractAPIWorkspace instances.
|
|
829188
829238
|
*/
|
|
829189
|
-
buildApiWorkspaces(workspace) {
|
|
829239
|
+
async buildApiWorkspaces(workspace) {
|
|
829190
829240
|
const workspaces = [];
|
|
829241
|
+
const taskContext = new TaskContextAdapter({ context: this.context });
|
|
829191
829242
|
for (const [apiName, apiDef] of Object.entries(workspace.apis)) {
|
|
829192
829243
|
const ossWorkspace = this.ossAdapter.build({
|
|
829193
829244
|
definition: apiDef,
|
|
@@ -829196,6 +829247,7 @@ var LegacyProjectAdapter = class {
|
|
|
829196
829247
|
absoluteFilePath: this.context.cwd
|
|
829197
829248
|
});
|
|
829198
829249
|
if (ossWorkspace != null) {
|
|
829250
|
+
await ossWorkspace.processGraphQLSpecs(taskContext);
|
|
829199
829251
|
workspaces.push(ossWorkspace);
|
|
829200
829252
|
}
|
|
829201
829253
|
}
|
|
@@ -829258,7 +829310,7 @@ var DocsChecker = class {
|
|
|
829258
829310
|
};
|
|
829259
829311
|
}
|
|
829260
829312
|
const adapter2 = new LegacyProjectAdapter({ context: this.context });
|
|
829261
|
-
const project = adapter2.adapt(workspace);
|
|
829313
|
+
const project = await adapter2.adapt(workspace);
|
|
829262
829314
|
const docsWorkspace = project.docsWorkspaces;
|
|
829263
829315
|
if (docsWorkspace == null) {
|
|
829264
829316
|
throw new CliError({
|
|
@@ -829365,6 +829417,7 @@ var SdkChecker = class {
|
|
|
829365
829417
|
this.validateTargetApiReferences({ workspace, sdks: sdks2, violations });
|
|
829366
829418
|
this.validateDefaultGroup({ sdks: sdks2, fernYmlRelativePath, violations });
|
|
829367
829419
|
this.validateEmptyVersions({ sdks: sdks2, violations });
|
|
829420
|
+
this.validateGraphQlSpecs({ workspace, sdks: sdks2, violations });
|
|
829368
829421
|
await this.validateVersions({ sdks: sdks2, violations });
|
|
829369
829422
|
return {
|
|
829370
829423
|
violations,
|
|
@@ -829446,6 +829499,31 @@ var SdkChecker = class {
|
|
|
829446
829499
|
}
|
|
829447
829500
|
}
|
|
829448
829501
|
}
|
|
829502
|
+
/**
|
|
829503
|
+
* Emits a warning for any target whose referenced API contains a GraphQL spec.
|
|
829504
|
+
* GraphQL SDKs are not supported; the graphql specs will be skipped during generation.
|
|
829505
|
+
*/
|
|
829506
|
+
validateGraphQlSpecs({ workspace, sdks: sdks2, violations }) {
|
|
829507
|
+
for (const target of sdks2.targets) {
|
|
829508
|
+
const api2 = workspace.apis[target.api];
|
|
829509
|
+
if (api2 == null) {
|
|
829510
|
+
continue;
|
|
829511
|
+
}
|
|
829512
|
+
const hasGraphQl = api2.specs.some(isGraphQlSpec);
|
|
829513
|
+
if (!hasGraphQl) {
|
|
829514
|
+
continue;
|
|
829515
|
+
}
|
|
829516
|
+
violations.push({
|
|
829517
|
+
severity: "warning",
|
|
829518
|
+
relativeFilepath: target.sourceLocation.relativeFilePath,
|
|
829519
|
+
nodePath: ["sdks", "targets", target.name, "api"],
|
|
829520
|
+
message: `API '${target.api}' contains a GraphQL spec. GraphQL SDKs are not supported and graphql specs will be skipped for this target.`,
|
|
829521
|
+
displayRelativeFilepath: target.sourceLocation.relativeFilePath,
|
|
829522
|
+
line: target.sourceLocation.line,
|
|
829523
|
+
column: target.sourceLocation.column
|
|
829524
|
+
});
|
|
829525
|
+
}
|
|
829526
|
+
}
|
|
829449
829527
|
/**
|
|
829450
829528
|
* Checks that pinned versions exist in the registry.
|
|
829451
829529
|
*/
|
|
@@ -829851,6 +829929,13 @@ function adjustSpecPaths(specs, apiName) {
|
|
|
829851
829929
|
overrides: spec.overrides != null ? adjustPathOrPaths(spec.overrides, apiName) : void 0
|
|
829852
829930
|
};
|
|
829853
829931
|
}
|
|
829932
|
+
if ("graphql" in spec) {
|
|
829933
|
+
return {
|
|
829934
|
+
...spec,
|
|
829935
|
+
graphql: adjustPath(spec.graphql, apiName),
|
|
829936
|
+
overrides: spec.overrides != null ? adjustPathOrPaths(spec.overrides, apiName) : void 0
|
|
829937
|
+
};
|
|
829938
|
+
}
|
|
829854
829939
|
if ("proto" in spec) {
|
|
829855
829940
|
return {
|
|
829856
829941
|
...spec,
|
|
@@ -830001,6 +830086,22 @@ function convertSpec(spec, warnings) {
|
|
|
830001
830086
|
}
|
|
830002
830087
|
return result;
|
|
830003
830088
|
}
|
|
830089
|
+
if ("graphql" in spec) {
|
|
830090
|
+
const graphqlSpec = spec;
|
|
830091
|
+
const result = {
|
|
830092
|
+
graphql: graphqlSpec.graphql
|
|
830093
|
+
};
|
|
830094
|
+
if (graphqlSpec.origin != null) {
|
|
830095
|
+
result.origin = graphqlSpec.origin;
|
|
830096
|
+
}
|
|
830097
|
+
if (graphqlSpec.overrides != null) {
|
|
830098
|
+
result.overrides = graphqlSpec.overrides;
|
|
830099
|
+
}
|
|
830100
|
+
if (graphqlSpec.name != null) {
|
|
830101
|
+
result.name = graphqlSpec.name;
|
|
830102
|
+
}
|
|
830103
|
+
return result;
|
|
830104
|
+
}
|
|
830004
830105
|
warnings.push({
|
|
830005
830106
|
type: "unsupported",
|
|
830006
830107
|
message: `Unknown spec type: ${JSON.stringify(Object.keys(spec))}`
|
|
@@ -830016,6 +830117,8 @@ function convertNamespacedSpecs(config5, warnings) {
|
|
|
830016
830117
|
specs.push({ ...spec, namespace });
|
|
830017
830118
|
} else if ("asyncapi" in spec) {
|
|
830018
830119
|
specs.push({ ...spec, namespace });
|
|
830120
|
+
} else if ("graphql" in spec) {
|
|
830121
|
+
specs.push({ ...spec, name: spec.name ?? namespace });
|
|
830019
830122
|
} else if ("fern" in spec) {
|
|
830020
830123
|
warnings.push({
|
|
830021
830124
|
type: "info",
|
|
@@ -833072,7 +833175,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
833072
833175
|
var LOGS_FOLDER_NAME = "logs";
|
|
833073
833176
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
833074
833177
|
function getCliSource() {
|
|
833075
|
-
const version7 = "4.
|
|
833178
|
+
const version7 = "4.109.0-1-g1bf359628bd";
|
|
833076
833179
|
return `cli@${version7}`;
|
|
833077
833180
|
}
|
|
833078
833181
|
var DebugLogger = class {
|
|
@@ -835571,7 +835674,7 @@ var LegacyDevServer = class {
|
|
|
835571
835674
|
*/
|
|
835572
835675
|
async start({ port, backendPort, forceDownload, bundlePath, logLevel }) {
|
|
835573
835676
|
const workspace = await this.context.loadWorkspaceOrThrow();
|
|
835574
|
-
const initialProject = this.adapter.adapt(workspace);
|
|
835677
|
+
const initialProject = await this.adapter.adapt(workspace);
|
|
835575
835678
|
const taskContext = new TaskContextAdapter({ context: this.context, logLevel });
|
|
835576
835679
|
this.context.stderr.info("Bootstrapping docs preview (this may take a few seconds)...");
|
|
835577
835680
|
await runAppPreviewServer({
|
|
@@ -841512,7 +841615,7 @@ var definitions6 = {
|
|
|
841512
841615
|
}
|
|
841513
841616
|
]
|
|
841514
841617
|
},
|
|
841515
|
-
"og:background-image": {
|
|
841618
|
+
"og:dynamic:background-image": {
|
|
841516
841619
|
oneOf: [
|
|
841517
841620
|
{
|
|
841518
841621
|
type: "string"
|
|
@@ -845490,7 +845593,7 @@ var LegacyDocsPublisher = class {
|
|
|
845490
845593
|
previewId,
|
|
845491
845594
|
disableTemplates: void 0,
|
|
845492
845595
|
skipUpload,
|
|
845493
|
-
cliVersion: "4.
|
|
845596
|
+
cliVersion: "4.109.0-1-g1bf359628bd",
|
|
845494
845597
|
loginCommand: "fern auth login"
|
|
845495
845598
|
});
|
|
845496
845599
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -846134,7 +846237,7 @@ var PublishCommand = class {
|
|
|
846134
846237
|
}
|
|
846135
846238
|
}
|
|
846136
846239
|
const adapter2 = new LegacyProjectAdapter({ context: context3 });
|
|
846137
|
-
const project = adapter2.adapt(workspace);
|
|
846240
|
+
const project = await adapter2.adapt(workspace);
|
|
846138
846241
|
const docsWorkspace = project.docsWorkspaces;
|
|
846139
846242
|
if (docsWorkspace == null) {
|
|
846140
846243
|
throw new CliError({
|
|
@@ -848773,8 +848876,12 @@ var import_path67 = __toESM(require("path"), 1);
|
|
|
848773
848876
|
// ../cli-v2/lib/api/resolver/ApiSpecDetector.js
|
|
848774
848877
|
init_js_yaml();
|
|
848775
848878
|
var DETECTABLE_SPEC_TYPES = ["openapi", "asyncapi"];
|
|
848879
|
+
var GRAPHQL_EXTENSIONS = [".graphql", ".graphqls", ".gql"];
|
|
848776
848880
|
var ApiSpecDetector = class {
|
|
848777
848881
|
async detect({ absoluteFilePath, reference: reference4, content: content5 }) {
|
|
848882
|
+
if (this.hasGraphQlExtension(absoluteFilePath) || this.hasGraphQlExtension(reference4)) {
|
|
848883
|
+
return "graphql";
|
|
848884
|
+
}
|
|
848778
848885
|
const parsed = this.parseOrThrow({ content: content5, reference: reference4 });
|
|
848779
848886
|
if (typeof parsed !== "object" || parsed == null) {
|
|
848780
848887
|
throw new CliError({
|
|
@@ -848792,6 +848899,10 @@ var ApiSpecDetector = class {
|
|
|
848792
848899
|
code: CliError.Code.InternalError
|
|
848793
848900
|
});
|
|
848794
848901
|
}
|
|
848902
|
+
hasGraphQlExtension(path105) {
|
|
848903
|
+
const lower = path105.toLowerCase();
|
|
848904
|
+
return GRAPHQL_EXTENSIONS.some((ext2) => lower.endsWith(ext2));
|
|
848905
|
+
}
|
|
848795
848906
|
parseOrThrow({ content: content5, reference: reference4 }) {
|
|
848796
848907
|
try {
|
|
848797
848908
|
return jsYaml.load(content5);
|
|
@@ -848869,7 +848980,10 @@ var ApiSpecResolver = class {
|
|
|
848869
848980
|
return { content: content5, contentType };
|
|
848870
848981
|
}
|
|
848871
848982
|
inferExtension({ url: url3, contentType }) {
|
|
848872
|
-
const urlPath = new URL(url3).pathname;
|
|
848983
|
+
const urlPath = new URL(url3).pathname.toLowerCase();
|
|
848984
|
+
if (urlPath.endsWith(".graphql") || urlPath.endsWith(".graphqls") || urlPath.endsWith(".gql")) {
|
|
848985
|
+
return ".graphql";
|
|
848986
|
+
}
|
|
848873
848987
|
if (urlPath.endsWith(".json")) {
|
|
848874
848988
|
return ".json";
|
|
848875
848989
|
}
|
|
@@ -848887,9 +849001,11 @@ var ApiSpecResolver = class {
|
|
|
848887
849001
|
return { openapi: absoluteFilePath, origin: origin2 };
|
|
848888
849002
|
case "asyncapi":
|
|
848889
849003
|
return { asyncapi: absoluteFilePath, origin: origin2 };
|
|
849004
|
+
case "graphql":
|
|
849005
|
+
return { graphql: absoluteFilePath, origin: origin2 };
|
|
848890
849006
|
default:
|
|
848891
849007
|
throw new CliError({
|
|
848892
|
-
message: `Unsupported spec type for flags mode: "${specType}". Supported: openapi, asyncapi`,
|
|
849008
|
+
message: `Unsupported spec type for flags mode: "${specType}". Supported: openapi, asyncapi, graphql`,
|
|
848893
849009
|
code: CliError.Code.ConfigError
|
|
848894
849010
|
});
|
|
848895
849011
|
}
|
|
@@ -919725,7 +919841,7 @@ var CliContext = class _CliContext {
|
|
|
919725
919841
|
if (false) {
|
|
919726
919842
|
this.logger.error("CLI_VERSION is not defined");
|
|
919727
919843
|
}
|
|
919728
|
-
return "4.
|
|
919844
|
+
return "4.109.0-1-g1bf359628bd";
|
|
919729
919845
|
}
|
|
919730
919846
|
getCliName() {
|
|
919731
919847
|
if (false) {
|
|
@@ -928713,7 +928829,7 @@ ${errors4.map((e8) => ` - ${e8}`).join("\n")}`,
|
|
|
928713
928829
|
collect2(raw.footer);
|
|
928714
928830
|
if (raw.metadata != null && typeof raw.metadata === "object") {
|
|
928715
928831
|
const meta5 = raw.metadata;
|
|
928716
|
-
for (const imgKey of ["og:image", "twitter:image", "og:background-image", "og:logo"]) {
|
|
928832
|
+
for (const imgKey of ["og:image", "twitter:image", "og:dynamic:background-image", "og:logo"]) {
|
|
928717
928833
|
if (typeof meta5[imgKey] === "string") {
|
|
928718
928834
|
collect2(meta5[imgKey]);
|
|
928719
928835
|
}
|
|
@@ -928801,7 +928917,7 @@ ${errors4.map((e8) => ` - ${e8}`).join("\n")}`,
|
|
|
928801
928917
|
cfg.footer = await field5(cfg.footer);
|
|
928802
928918
|
if (cfg.metadata != null && typeof cfg.metadata === "object") {
|
|
928803
928919
|
const meta5 = { ...cfg.metadata };
|
|
928804
|
-
for (const imgKey of ["og:image", "twitter:image", "og:background-image", "og:logo"]) {
|
|
928920
|
+
for (const imgKey of ["og:image", "twitter:image", "og:dynamic:background-image", "og:logo"]) {
|
|
928805
928921
|
if (typeof meta5[imgKey] === "string") {
|
|
928806
928922
|
meta5[imgKey] = await field5(meta5[imgKey]);
|
|
928807
928923
|
}
|
package/package.json
CHANGED