fern-api 0.23.1-rc0 → 0.23.1-rc3
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 +122 -55
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -25921,7 +25921,7 @@ var init_DocsInstances = __esm({
|
|
|
25921
25921
|
init_core();
|
|
25922
25922
|
DocsInstances = schemas_exports.object({
|
|
25923
25923
|
url: schemas_exports.string(),
|
|
25924
|
-
customDomain: schemas_exports.property("custom-domain", schemas_exports.
|
|
25924
|
+
customDomain: schemas_exports.property("custom-domain", schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).CustomDomain).optional()),
|
|
25925
25925
|
audiences: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).AudiencesConfig).optional(),
|
|
25926
25926
|
private: schemas_exports.boolean().optional(),
|
|
25927
25927
|
editThisPage: schemas_exports.property("edit-this-page", schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).EditThisPageConfig).optional())
|
|
@@ -25929,6 +25929,18 @@ var init_DocsInstances = __esm({
|
|
|
25929
25929
|
}
|
|
25930
25930
|
});
|
|
25931
25931
|
|
|
25932
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/CustomDomain.js
|
|
25933
|
+
var CustomDomain;
|
|
25934
|
+
var init_CustomDomain = __esm({
|
|
25935
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/CustomDomain.js"() {
|
|
25936
|
+
init_core();
|
|
25937
|
+
CustomDomain = schemas_exports.undiscriminatedUnion([
|
|
25938
|
+
schemas_exports.string(),
|
|
25939
|
+
schemas_exports.list(schemas_exports.string())
|
|
25940
|
+
]);
|
|
25941
|
+
}
|
|
25942
|
+
});
|
|
25943
|
+
|
|
25932
25944
|
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/EditThisPageConfig.js
|
|
25933
25945
|
var EditThisPageConfig;
|
|
25934
25946
|
var init_EditThisPageConfig = __esm({
|
|
@@ -26499,6 +26511,7 @@ var init_types = __esm({
|
|
|
26499
26511
|
init_TabId();
|
|
26500
26512
|
init_TabConfig();
|
|
26501
26513
|
init_DocsInstances();
|
|
26514
|
+
init_CustomDomain();
|
|
26502
26515
|
init_EditThisPageConfig();
|
|
26503
26516
|
init_GithubEditThisPageConfig();
|
|
26504
26517
|
init_AudiencesConfig();
|
|
@@ -26561,6 +26574,7 @@ __export(docs_exports3, {
|
|
|
26561
26574
|
ColorsConfiguration: () => ColorsConfiguration,
|
|
26562
26575
|
ContentAlignment: () => ContentAlignment4,
|
|
26563
26576
|
CssConfig: () => CssConfig,
|
|
26577
|
+
CustomDomain: () => CustomDomain,
|
|
26564
26578
|
DocsConfiguration: () => DocsConfiguration,
|
|
26565
26579
|
DocsInstances: () => DocsInstances,
|
|
26566
26580
|
DocsTypographyConfig: () => DocsTypographyConfig,
|
|
@@ -26628,6 +26642,7 @@ __export(serialization_exports, {
|
|
|
26628
26642
|
ColorsConfiguration: () => ColorsConfiguration,
|
|
26629
26643
|
ContentAlignment: () => ContentAlignment4,
|
|
26630
26644
|
CssConfig: () => CssConfig,
|
|
26645
|
+
CustomDomain: () => CustomDomain,
|
|
26631
26646
|
DocsConfiguration: () => DocsConfiguration,
|
|
26632
26647
|
DocsInstances: () => DocsInstances,
|
|
26633
26648
|
DocsTypographyConfig: () => DocsTypographyConfig,
|
|
@@ -886384,7 +886399,8 @@ var APIDefinitionPathSchema = z.string().describe("Path to the OpenAPI, AsyncAPI
|
|
|
886384
886399
|
var APIDefintionWithOverridesSchema = z.object({
|
|
886385
886400
|
path: APIDefinitionPathSchema,
|
|
886386
886401
|
origin: z.optional(z.string()).describe("The URL of the API definition origin, from which the file should be polled."),
|
|
886387
|
-
overrides: z.optional(z.string()).describe("Path to the OpenAPI or AsyncAPI overrides")
|
|
886402
|
+
overrides: z.optional(z.string()).describe("Path to the OpenAPI or AsyncAPI overrides"),
|
|
886403
|
+
audiences: z.optional(z.array(z.string())).describe("Audiences that you would like to filter to")
|
|
886388
886404
|
});
|
|
886389
886405
|
var APIDefinitionList = z.array(z.union([APIDefinitionPathSchema, APIDefintionWithOverridesSchema]));
|
|
886390
886406
|
var APIConfigurationSchema = z.union([
|
|
@@ -886605,7 +886621,8 @@ async function parseAPIConfiguration(rawGeneratorsConfiguration) {
|
|
|
886605
886621
|
apiDefinitions.push({
|
|
886606
886622
|
path: apiConfiguration,
|
|
886607
886623
|
origin: void 0,
|
|
886608
|
-
overrides: void 0
|
|
886624
|
+
overrides: void 0,
|
|
886625
|
+
audiences: []
|
|
886609
886626
|
});
|
|
886610
886627
|
} else if (Array.isArray(apiConfiguration)) {
|
|
886611
886628
|
for (const definition2 of apiConfiguration) {
|
|
@@ -886613,13 +886630,15 @@ async function parseAPIConfiguration(rawGeneratorsConfiguration) {
|
|
|
886613
886630
|
apiDefinitions.push({
|
|
886614
886631
|
path: definition2,
|
|
886615
886632
|
origin: void 0,
|
|
886616
|
-
overrides: void 0
|
|
886633
|
+
overrides: void 0,
|
|
886634
|
+
audiences: []
|
|
886617
886635
|
});
|
|
886618
886636
|
} else {
|
|
886619
886637
|
apiDefinitions.push({
|
|
886620
886638
|
path: definition2.path,
|
|
886621
886639
|
origin: definition2.origin,
|
|
886622
|
-
overrides: definition2.overrides
|
|
886640
|
+
overrides: definition2.overrides,
|
|
886641
|
+
audiences: definition2.audiences
|
|
886623
886642
|
});
|
|
886624
886643
|
}
|
|
886625
886644
|
}
|
|
@@ -886627,7 +886646,8 @@ async function parseAPIConfiguration(rawGeneratorsConfiguration) {
|
|
|
886627
886646
|
apiDefinitions.push({
|
|
886628
886647
|
path: apiConfiguration.path,
|
|
886629
886648
|
origin: apiConfiguration.origin,
|
|
886630
|
-
overrides: apiConfiguration.overrides
|
|
886649
|
+
overrides: apiConfiguration.overrides,
|
|
886650
|
+
audiences: apiConfiguration.audiences
|
|
886631
886651
|
});
|
|
886632
886652
|
}
|
|
886633
886653
|
} else {
|
|
@@ -886639,20 +886659,23 @@ async function parseAPIConfiguration(rawGeneratorsConfiguration) {
|
|
|
886639
886659
|
apiDefinitions.push({
|
|
886640
886660
|
path: openapi,
|
|
886641
886661
|
origin: apiOrigin,
|
|
886642
|
-
overrides: openapiOverrides
|
|
886662
|
+
overrides: openapiOverrides,
|
|
886663
|
+
audiences: []
|
|
886643
886664
|
});
|
|
886644
886665
|
} else if (openapi != null) {
|
|
886645
886666
|
apiDefinitions.push({
|
|
886646
886667
|
path: openapi.path,
|
|
886647
886668
|
origin: openapi.origin,
|
|
886648
|
-
overrides: openapi.overrides
|
|
886669
|
+
overrides: openapi.overrides,
|
|
886670
|
+
audiences: []
|
|
886649
886671
|
});
|
|
886650
886672
|
}
|
|
886651
886673
|
if (asyncapi != null) {
|
|
886652
886674
|
apiDefinitions.push({
|
|
886653
886675
|
path: asyncapi,
|
|
886654
886676
|
origin: apiOrigin,
|
|
886655
|
-
overrides: void 0
|
|
886677
|
+
overrides: void 0,
|
|
886678
|
+
audiences: []
|
|
886656
886679
|
});
|
|
886657
886680
|
}
|
|
886658
886681
|
}
|
|
@@ -890227,7 +890250,7 @@ var AccessTokenPosthogManager = class {
|
|
|
890227
890250
|
properties: {
|
|
890228
890251
|
...event,
|
|
890229
890252
|
...event.properties,
|
|
890230
|
-
version: "0.23.1-
|
|
890253
|
+
version: "0.23.1-rc3",
|
|
890231
890254
|
usingAccessToken: true
|
|
890232
890255
|
}
|
|
890233
890256
|
});
|
|
@@ -890289,7 +890312,7 @@ var UserPosthogManager = class {
|
|
|
890289
890312
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
890290
890313
|
event: "CLI",
|
|
890291
890314
|
properties: {
|
|
890292
|
-
version: "0.23.1-
|
|
890315
|
+
version: "0.23.1-rc3",
|
|
890293
890316
|
...event,
|
|
890294
890317
|
...event.properties
|
|
890295
890318
|
}
|
|
@@ -902332,6 +902355,9 @@ function buildPrimitiveTypeReference(primitiveSchema) {
|
|
|
902332
902355
|
}
|
|
902333
902356
|
function buildReferenceTypeReference({ schema: schema2, fileContainingReference, context }) {
|
|
902334
902357
|
const resolvedSchema = context.getSchema(schema2.schema);
|
|
902358
|
+
if (resolvedSchema == null) {
|
|
902359
|
+
return "unknown";
|
|
902360
|
+
}
|
|
902335
902361
|
const schemaName = getSchemaName(resolvedSchema) ?? schema2.schema;
|
|
902336
902362
|
const groupName = getGroupNameForSchema(resolvedSchema);
|
|
902337
902363
|
const typeWithPrefix = getPrefixedType({
|
|
@@ -902563,6 +902589,9 @@ function buildObjectTypeDeclaration({ schema: schema2, context, declarationFile
|
|
|
902563
902589
|
const extendedSchemas = [];
|
|
902564
902590
|
for (const allOf of schema2.allOf) {
|
|
902565
902591
|
const resolvedSchemaId = getSchemaIdOfResolvedType({ schema: allOf.schema, context });
|
|
902592
|
+
if (resolvedSchemaId == null) {
|
|
902593
|
+
continue;
|
|
902594
|
+
}
|
|
902566
902595
|
if (schemasToInline.has(allOf.schema) || schemasToInline.has(resolvedSchemaId)) {
|
|
902567
902596
|
continue;
|
|
902568
902597
|
}
|
|
@@ -902627,6 +902656,9 @@ function buildObjectTypeDeclaration({ schema: schema2, context, declarationFile
|
|
|
902627
902656
|
}
|
|
902628
902657
|
function getAllParentSchemasToInline({ property: property5, schemaId, context }) {
|
|
902629
902658
|
const schema2 = context.getSchema(schemaId);
|
|
902659
|
+
if (schema2 == null) {
|
|
902660
|
+
return [];
|
|
902661
|
+
}
|
|
902630
902662
|
if (schema2.type === "reference") {
|
|
902631
902663
|
return getAllParentSchemasToInline({ property: property5, schemaId: schema2.schema, context });
|
|
902632
902664
|
}
|
|
@@ -902648,6 +902680,9 @@ function getAllParentSchemasToInline({ property: property5, schemaId, context })
|
|
|
902648
902680
|
}
|
|
902649
902681
|
function getProperties(context, schemaId) {
|
|
902650
902682
|
const schema2 = context.getSchema(schemaId);
|
|
902683
|
+
if (schema2 == null) {
|
|
902684
|
+
return { properties: [], allOf: [] };
|
|
902685
|
+
}
|
|
902651
902686
|
if (schema2.type === "object") {
|
|
902652
902687
|
return { properties: schema2.properties, allOf: schema2.allOf };
|
|
902653
902688
|
} else if (schema2.type === "reference") {
|
|
@@ -902819,6 +902854,9 @@ function startsWithNumber(str3) {
|
|
|
902819
902854
|
}
|
|
902820
902855
|
function getSchemaIdOfResolvedType({ schema: schema2, context }) {
|
|
902821
902856
|
const resolvedSchema = context.getSchema(schema2);
|
|
902857
|
+
if (resolvedSchema == null) {
|
|
902858
|
+
return void 0;
|
|
902859
|
+
}
|
|
902822
902860
|
if (resolvedSchema.type === "reference") {
|
|
902823
902861
|
return getSchemaIdOfResolvedType({ context, schema: resolvedSchema.schema });
|
|
902824
902862
|
}
|
|
@@ -908505,7 +908543,7 @@ function replaceWithSchemaReference({ openapi, replaceReference, schemaReference
|
|
|
908505
908543
|
}
|
|
908506
908544
|
|
|
908507
908545
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/generateIr.js
|
|
908508
|
-
function generateIr({ openApi, taskContext, disableExamples }) {
|
|
908546
|
+
function generateIr({ openApi, taskContext, disableExamples, audiences }) {
|
|
908509
908547
|
var _a5, _b4, _c4;
|
|
908510
908548
|
openApi = runResolutions({ openapi: openApi });
|
|
908511
908549
|
const securitySchemes = Object.fromEntries(Object.entries(((_a5 = openApi.components) == null ? void 0 : _a5.securitySchemes) ?? {}).map(([key2, securityScheme]) => {
|
|
@@ -908535,6 +908573,10 @@ function generateIr({ openApi, taskContext, disableExamples }) {
|
|
|
908535
908573
|
taskContext.logger.debug(`Converting path ${path34}`);
|
|
908536
908574
|
const convertedOperations = convertPathItem(path34, pathItem, openApi, context);
|
|
908537
908575
|
for (const operation of convertedOperations) {
|
|
908576
|
+
const operationAudiences = getAudiences({ operation });
|
|
908577
|
+
if (audiences.length > 0 && !audiences.some((audience) => operationAudiences.includes(audience))) {
|
|
908578
|
+
continue;
|
|
908579
|
+
}
|
|
908538
908580
|
switch (operation.type) {
|
|
908539
908581
|
case "async":
|
|
908540
908582
|
endpointsWithExample.push(operation.sync);
|
|
@@ -908743,19 +908785,40 @@ function getAllParentSchemaIds({ schema: schema2, schemas }) {
|
|
|
908743
908785
|
}
|
|
908744
908786
|
return result2;
|
|
908745
908787
|
}
|
|
908788
|
+
function getAudiences({ operation }) {
|
|
908789
|
+
let endpointAudiences = [];
|
|
908790
|
+
switch (operation.type) {
|
|
908791
|
+
case "async":
|
|
908792
|
+
endpointAudiences = operation.async.audiences;
|
|
908793
|
+
break;
|
|
908794
|
+
case "http":
|
|
908795
|
+
endpointAudiences = operation.value.audiences;
|
|
908796
|
+
break;
|
|
908797
|
+
case "streaming":
|
|
908798
|
+
endpointAudiences = operation.streaming.audiences;
|
|
908799
|
+
break;
|
|
908800
|
+
case "webhook":
|
|
908801
|
+
break;
|
|
908802
|
+
default:
|
|
908803
|
+
assertNever(operation);
|
|
908804
|
+
}
|
|
908805
|
+
return endpointAudiences;
|
|
908806
|
+
}
|
|
908746
908807
|
|
|
908747
908808
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v2/generateIr.js
|
|
908748
|
-
async function generateIr2({ openApi, taskContext, disableExamples }) {
|
|
908809
|
+
async function generateIr2({ openApi, taskContext, disableExamples, audiences }) {
|
|
908749
908810
|
const conversionResult = await (0, import_swagger2openapi.convertObj)(openApi, {});
|
|
908750
908811
|
return generateIr({
|
|
908751
908812
|
openApi: conversionResult.openapi,
|
|
908752
908813
|
taskContext,
|
|
908753
|
-
disableExamples
|
|
908814
|
+
disableExamples,
|
|
908815
|
+
audiences
|
|
908754
908816
|
});
|
|
908755
908817
|
}
|
|
908756
908818
|
|
|
908757
908819
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/parse.js
|
|
908758
908820
|
async function parse3({ workspace, taskContext }) {
|
|
908821
|
+
var _a5, _b4;
|
|
908759
908822
|
let ir = {
|
|
908760
908823
|
title: void 0,
|
|
908761
908824
|
description: void 0,
|
|
@@ -908775,6 +908838,7 @@ async function parse3({ workspace, taskContext }) {
|
|
|
908775
908838
|
globalHeaders: [],
|
|
908776
908839
|
groups: {}
|
|
908777
908840
|
};
|
|
908841
|
+
console.log("workspace.specs", JSON.stringify(workspace.specs));
|
|
908778
908842
|
for (const spec of workspace.specs) {
|
|
908779
908843
|
const contents = (await (0, import_promises25.readFile)(spec.absoluteFilepath)).toString();
|
|
908780
908844
|
if (contents.includes("openapi") || contents.includes("swagger")) {
|
|
@@ -908787,14 +908851,16 @@ async function parse3({ workspace, taskContext }) {
|
|
|
908787
908851
|
const openapiIr = generateIr({
|
|
908788
908852
|
openApi: openApiDocument,
|
|
908789
908853
|
taskContext,
|
|
908790
|
-
disableExamples: false
|
|
908854
|
+
disableExamples: false,
|
|
908855
|
+
audiences: ((_a5 = spec.settings) == null ? void 0 : _a5.audiences) ?? []
|
|
908791
908856
|
});
|
|
908792
908857
|
ir = merge3(ir, openapiIr);
|
|
908793
908858
|
} else if (isOpenApiV2(openApiDocument)) {
|
|
908794
908859
|
const openapiIr = await generateIr2({
|
|
908795
908860
|
openApi: openApiDocument,
|
|
908796
908861
|
taskContext,
|
|
908797
|
-
disableExamples: false
|
|
908862
|
+
disableExamples: false,
|
|
908863
|
+
audiences: ((_b4 = spec.settings) == null ? void 0 : _b4.audiences) ?? []
|
|
908798
908864
|
});
|
|
908799
908865
|
ir = merge3(ir, openapiIr);
|
|
908800
908866
|
}
|
|
@@ -908911,7 +908977,9 @@ function buildQueryParameter({ queryParameter, context, fileContainingReference
|
|
|
908911
908977
|
function getQueryParameterTypeReference({ schema: schema2, context, fileContainingReference }) {
|
|
908912
908978
|
if (schema2.type === "reference") {
|
|
908913
908979
|
const resolvedSchema = context.getSchema(schema2.schema);
|
|
908914
|
-
if (resolvedSchema
|
|
908980
|
+
if (resolvedSchema == null) {
|
|
908981
|
+
return void 0;
|
|
908982
|
+
} else if (resolvedSchema.type === "array") {
|
|
908915
908983
|
return {
|
|
908916
908984
|
value: buildTypeReference({
|
|
908917
908985
|
schema: Schema2.optional({
|
|
@@ -908965,7 +909033,9 @@ function getQueryParameterTypeReference({ schema: schema2, context, fileContaini
|
|
|
908965
909033
|
if (schema2.type === "optional" || schema2.type === "nullable") {
|
|
908966
909034
|
if (schema2.value.type === "reference") {
|
|
908967
909035
|
const resolvedSchema = context.getSchema(schema2.value.schema);
|
|
908968
|
-
if (resolvedSchema
|
|
909036
|
+
if (resolvedSchema == null) {
|
|
909037
|
+
return void 0;
|
|
909038
|
+
} else if (resolvedSchema.type === "array") {
|
|
908969
909039
|
return {
|
|
908970
909040
|
value: buildTypeReference({
|
|
908971
909041
|
schema: Schema2.optional({
|
|
@@ -909894,7 +909964,7 @@ function getRequest({ declarationFile, context, request, requestNameOverride, ge
|
|
|
909894
909964
|
if (request.type === "json") {
|
|
909895
909965
|
const maybeSchemaId = request.schema.type === "reference" ? request.schema.schema : void 0;
|
|
909896
909966
|
const resolvedSchema = request.schema.type === "reference" ? context.getSchema(request.schema.schema) : request.schema;
|
|
909897
|
-
if (resolvedSchema.type !== "object" || maybeSchemaId != null && nonRequestReferencedSchemas.includes(maybeSchemaId)) {
|
|
909967
|
+
if ((resolvedSchema == null ? void 0 : resolvedSchema.type) !== "object" || maybeSchemaId != null && nonRequestReferencedSchemas.includes(maybeSchemaId)) {
|
|
909898
909968
|
const requestTypeReference = buildTypeReference({
|
|
909899
909969
|
schema: request.schema,
|
|
909900
909970
|
fileContainingReference: declarationFile,
|
|
@@ -910678,13 +910748,6 @@ var OpenApiIrConverterContext = class {
|
|
|
910678
910748
|
}
|
|
910679
910749
|
getSchema(id) {
|
|
910680
910750
|
const schema2 = this.ir.schemas[id];
|
|
910681
|
-
if (schema2 == null) {
|
|
910682
|
-
this.logger.warn(`Schema with id ${id} not found. Treating as unknown.`);
|
|
910683
|
-
return Schema2.unknown({
|
|
910684
|
-
generatedName: "",
|
|
910685
|
-
nameOverride: void 0
|
|
910686
|
-
});
|
|
910687
|
-
}
|
|
910688
910751
|
return schema2;
|
|
910689
910752
|
}
|
|
910690
910753
|
getOrThrowDefaultServerName() {
|
|
@@ -911043,7 +911106,10 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
|
|
|
911043
911106
|
for (const definition2 of generatorsConfiguration.api.definitions) {
|
|
911044
911107
|
specs.push({
|
|
911045
911108
|
absoluteFilepath: join(absolutePathToWorkspace, RelativeFilePath.of(definition2.path)),
|
|
911046
|
-
absoluteFilepathToOverrides: definition2.overrides != null ? join(absolutePathToWorkspace, RelativeFilePath.of(definition2.overrides)) : void 0
|
|
911109
|
+
absoluteFilepathToOverrides: definition2.overrides != null ? join(absolutePathToWorkspace, RelativeFilePath.of(definition2.overrides)) : void 0,
|
|
911110
|
+
settings: {
|
|
911111
|
+
audiences: definition2.audiences ?? []
|
|
911112
|
+
}
|
|
911047
911113
|
});
|
|
911048
911114
|
}
|
|
911049
911115
|
return {
|
|
@@ -914714,10 +914780,10 @@ var CliContext = class {
|
|
|
914714
914780
|
return "fern-api";
|
|
914715
914781
|
}
|
|
914716
914782
|
getPackageVersion() {
|
|
914717
|
-
if ("0.23.1-
|
|
914783
|
+
if ("0.23.1-rc3" == null) {
|
|
914718
914784
|
this.logger.error("CLI_VERSION is not defined");
|
|
914719
914785
|
}
|
|
914720
|
-
return "0.23.1-
|
|
914786
|
+
return "0.23.1-rc3";
|
|
914721
914787
|
}
|
|
914722
914788
|
getCliName() {
|
|
914723
914789
|
if ("fern" == null) {
|
|
@@ -916516,7 +916582,7 @@ function convertAvailability(availability) {
|
|
|
916516
916582
|
message: typeof availability !== "string" ? availability.message : void 0
|
|
916517
916583
|
};
|
|
916518
916584
|
}
|
|
916519
|
-
function
|
|
916585
|
+
function getAudiences2(schema2) {
|
|
916520
916586
|
if (typeof schema2 === "string") {
|
|
916521
916587
|
return [];
|
|
916522
916588
|
}
|
|
@@ -922013,7 +922079,7 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
922013
922079
|
propertiesByAudience: convertedTypeDeclarationWithFilepaths.propertiesByAudience,
|
|
922014
922080
|
descendantFilepaths: subpackageFilepaths
|
|
922015
922081
|
});
|
|
922016
|
-
irGraph.markTypeForAudiences(convertedTypeDeclaration.name,
|
|
922082
|
+
irGraph.markTypeForAudiences(convertedTypeDeclaration.name, getAudiences2(typeDeclaration));
|
|
922017
922083
|
}
|
|
922018
922084
|
},
|
|
922019
922085
|
errors: (errors) => {
|
|
@@ -960138,39 +960204,27 @@ async function runRemoteGenerationForDocsWorkspace({ organization, fernWorkspace
|
|
|
960138
960204
|
context.failAndThrow("No instances specified in docs.yml! Cannot register docs.");
|
|
960139
960205
|
return;
|
|
960140
960206
|
}
|
|
960141
|
-
if (instances.length === 1 && instances[0] != null) {
|
|
960142
|
-
const instance = instances[0];
|
|
960143
|
-
await context.runInteractiveTask({ name: instance.url }, async () => {
|
|
960144
|
-
await publishDocs({
|
|
960145
|
-
docsWorkspace,
|
|
960146
|
-
customDomains: instance.customDomain != null ? [instance.customDomain] : [],
|
|
960147
|
-
domain: instance.url,
|
|
960148
|
-
token,
|
|
960149
|
-
organization,
|
|
960150
|
-
context,
|
|
960151
|
-
fernWorkspaces,
|
|
960152
|
-
version: "",
|
|
960153
|
-
preview,
|
|
960154
|
-
audiences: instance.audiences,
|
|
960155
|
-
editThisPage: instance.editThisPage,
|
|
960156
|
-
isPrivate: instance.private
|
|
960157
|
-
});
|
|
960158
|
-
});
|
|
960159
|
-
return;
|
|
960160
|
-
}
|
|
960161
960207
|
if (instances.length > 1 && instanceUrl == null) {
|
|
960162
960208
|
context.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${(_a5 = instances[0]) == null ? void 0 : _a5.url})`);
|
|
960163
960209
|
return;
|
|
960164
960210
|
}
|
|
960165
|
-
const maybeInstance = instances.find((instance) => instance.url === instanceUrl);
|
|
960211
|
+
const maybeInstance = instances.find((instance) => instance.url === instanceUrl) ?? instances[0];
|
|
960166
960212
|
if (maybeInstance == null) {
|
|
960167
960213
|
context.failAndThrow(`No docs instance with url ${instanceUrl}. Failed to register.`);
|
|
960168
960214
|
return;
|
|
960169
960215
|
}
|
|
960216
|
+
const customDomains = [];
|
|
960217
|
+
if (maybeInstance.customDomain != null) {
|
|
960218
|
+
if (typeof maybeInstance.customDomain === "string") {
|
|
960219
|
+
customDomains.push(maybeInstance.customDomain);
|
|
960220
|
+
} else if (Array.isArray(maybeInstance.customDomain)) {
|
|
960221
|
+
customDomains.push(...maybeInstance.customDomain);
|
|
960222
|
+
}
|
|
960223
|
+
}
|
|
960170
960224
|
await context.runInteractiveTask({ name: maybeInstance.url }, async () => {
|
|
960171
960225
|
await publishDocs({
|
|
960172
960226
|
docsWorkspace,
|
|
960173
|
-
customDomains
|
|
960227
|
+
customDomains,
|
|
960174
960228
|
domain: maybeInstance.url,
|
|
960175
960229
|
token,
|
|
960176
960230
|
organization,
|
|
@@ -962558,6 +962612,19 @@ var GeneratorsConfigurationSchema5 = z.strictObject({
|
|
|
962558
962612
|
groups: z.optional(z.record(GeneratorGroupSchema3))
|
|
962559
962613
|
});
|
|
962560
962614
|
|
|
962615
|
+
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsInstances.js
|
|
962616
|
+
function migrateDocsInstances(docsURLs) {
|
|
962617
|
+
return docsURLs.map((docsURL) => {
|
|
962618
|
+
if (Array.isArray(docsURL.customDomain)) {
|
|
962619
|
+
throw new Error("Expected custom-domain to be a string, but it was an array.");
|
|
962620
|
+
}
|
|
962621
|
+
return {
|
|
962622
|
+
...docsURL,
|
|
962623
|
+
customDomain: docsURL.customDomain
|
|
962624
|
+
};
|
|
962625
|
+
});
|
|
962626
|
+
}
|
|
962627
|
+
|
|
962561
962628
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
962562
962629
|
var APIS_DIRECTORY2 = "apis";
|
|
962563
962630
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
@@ -962597,7 +962664,7 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
962597
962664
|
}
|
|
962598
962665
|
const convertedDocsConfig = convertLegacyDocsConfig({
|
|
962599
962666
|
docsConfiguration,
|
|
962600
|
-
docsURLs,
|
|
962667
|
+
docsURLs: migrateDocsInstances(docsURLs),
|
|
962601
962668
|
apiName
|
|
962602
962669
|
});
|
|
962603
962670
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
@@ -962622,7 +962689,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
962622
962689
|
}
|
|
962623
962690
|
const convertedDocsConfig = convertLegacyDocsConfig({
|
|
962624
962691
|
docsConfiguration,
|
|
962625
|
-
docsURLs,
|
|
962692
|
+
docsURLs: migrateDocsInstances(docsURLs),
|
|
962626
962693
|
apiName: void 0
|
|
962627
962694
|
});
|
|
962628
962695
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|