fern-api 0.30.8-rc3 → 0.30.8-rc5
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 +438 -305
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -22002,7 +22002,7 @@ var init_NavigationItem = __esm({
|
|
|
22002
22002
|
NavigationItem = schemas_exports.undiscriminatedUnion([
|
|
22003
22003
|
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).PageConfiguration),
|
|
22004
22004
|
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).SectionConfiguration),
|
|
22005
|
-
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).
|
|
22005
|
+
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceConfiguration),
|
|
22006
22006
|
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).LinkConfiguration)
|
|
22007
22007
|
]);
|
|
22008
22008
|
}
|
|
@@ -22198,19 +22198,19 @@ var init_SectionConfiguration = __esm({
|
|
|
22198
22198
|
}
|
|
22199
22199
|
});
|
|
22200
22200
|
|
|
22201
|
-
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22202
|
-
var
|
|
22203
|
-
var
|
|
22204
|
-
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22201
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceConfiguration.js
|
|
22202
|
+
var ApiReferenceConfiguration;
|
|
22203
|
+
var init_ApiReferenceConfiguration = __esm({
|
|
22204
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceConfiguration.js"() {
|
|
22205
22205
|
init_core();
|
|
22206
|
-
|
|
22206
|
+
ApiReferenceConfiguration = schemas_exports.object({
|
|
22207
22207
|
api: schemas_exports.string(),
|
|
22208
22208
|
apiName: schemas_exports.property("api-name", schemas_exports.string().optional()),
|
|
22209
22209
|
audiences: schemas_exports.list(schemas_exports.string()).optional(),
|
|
22210
22210
|
displayErrors: schemas_exports.property("display-errors", schemas_exports.boolean().optional()),
|
|
22211
22211
|
snippets: schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).SnippetsConfiguration).optional(),
|
|
22212
22212
|
summary: schemas_exports.string().optional(),
|
|
22213
|
-
layout: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).
|
|
22213
|
+
layout: schemas_exports.list(schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceLayoutItem)).optional(),
|
|
22214
22214
|
icon: schemas_exports.string().optional(),
|
|
22215
22215
|
slug: schemas_exports.string().optional(),
|
|
22216
22216
|
hidden: schemas_exports.boolean().optional(),
|
|
@@ -22222,43 +22222,61 @@ var init_ApiSectionConfiguration = __esm({
|
|
|
22222
22222
|
}
|
|
22223
22223
|
});
|
|
22224
22224
|
|
|
22225
|
-
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22226
|
-
var
|
|
22227
|
-
var
|
|
22228
|
-
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22225
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceLayoutItem.js
|
|
22226
|
+
var ApiReferenceLayoutItem;
|
|
22227
|
+
var init_ApiReferenceLayoutItem = __esm({
|
|
22228
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceLayoutItem.js"() {
|
|
22229
22229
|
init_core();
|
|
22230
|
-
|
|
22230
|
+
ApiReferenceLayoutItem = schemas_exports.undiscriminatedUnion([
|
|
22231
22231
|
schemas_exports.string(),
|
|
22232
|
-
schemas_exports.record(schemas_exports.string(), schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).
|
|
22232
|
+
schemas_exports.record(schemas_exports.string(), schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferencePackageConfiguration)),
|
|
22233
|
+
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceSectionConfiguration),
|
|
22234
|
+
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceEndpointConfiguration),
|
|
22233
22235
|
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).PageConfiguration),
|
|
22234
|
-
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).LinkConfiguration)
|
|
22235
|
-
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiPackageConfiguration)
|
|
22236
|
+
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).LinkConfiguration)
|
|
22236
22237
|
]);
|
|
22237
22238
|
}
|
|
22238
22239
|
});
|
|
22239
22240
|
|
|
22240
|
-
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22241
|
-
var
|
|
22242
|
-
var
|
|
22243
|
-
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22241
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceSectionConfiguration.js
|
|
22242
|
+
var ApiReferenceSectionConfiguration;
|
|
22243
|
+
var init_ApiReferenceSectionConfiguration = __esm({
|
|
22244
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceSectionConfiguration.js"() {
|
|
22244
22245
|
init_core();
|
|
22245
|
-
|
|
22246
|
-
schemas_exports.string(),
|
|
22247
|
-
schemas_exports.list(schemas_exports.string())
|
|
22246
|
+
ApiReferenceSectionConfiguration = schemas_exports.object({
|
|
22247
|
+
section: schemas_exports.string(),
|
|
22248
|
+
referencedPackages: schemas_exports.property("referenced-packages", schemas_exports.list(schemas_exports.string()).optional()),
|
|
22249
|
+
summary: schemas_exports.string().optional(),
|
|
22250
|
+
contents: schemas_exports.list(schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceLayoutItem)).optional(),
|
|
22251
|
+
slug: schemas_exports.string().optional(),
|
|
22252
|
+
icon: schemas_exports.string().optional(),
|
|
22253
|
+
hidden: schemas_exports.boolean().optional(),
|
|
22254
|
+
skipSlug: schemas_exports.property("skip-slug", schemas_exports.boolean().optional())
|
|
22255
|
+
});
|
|
22256
|
+
}
|
|
22257
|
+
});
|
|
22258
|
+
|
|
22259
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferencePackageConfiguration.js
|
|
22260
|
+
var ApiReferencePackageConfiguration;
|
|
22261
|
+
var init_ApiReferencePackageConfiguration = __esm({
|
|
22262
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferencePackageConfiguration.js"() {
|
|
22263
|
+
init_core();
|
|
22264
|
+
ApiReferencePackageConfiguration = schemas_exports.undiscriminatedUnion([
|
|
22265
|
+
schemas_exports.list(schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceLayoutItem)),
|
|
22266
|
+
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferencePackageConfigurationWithOptions)
|
|
22248
22267
|
]);
|
|
22249
22268
|
}
|
|
22250
22269
|
});
|
|
22251
22270
|
|
|
22252
|
-
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22253
|
-
var
|
|
22254
|
-
var
|
|
22255
|
-
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22271
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferencePackageConfigurationWithOptions.js
|
|
22272
|
+
var ApiReferencePackageConfigurationWithOptions;
|
|
22273
|
+
var init_ApiReferencePackageConfigurationWithOptions = __esm({
|
|
22274
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferencePackageConfigurationWithOptions.js"() {
|
|
22256
22275
|
init_core();
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
subpackage: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).SubpackageOrSubpackages).optional(),
|
|
22276
|
+
ApiReferencePackageConfigurationWithOptions = schemas_exports.object({
|
|
22277
|
+
title: schemas_exports.string().optional(),
|
|
22260
22278
|
summary: schemas_exports.string().optional(),
|
|
22261
|
-
contents: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).
|
|
22279
|
+
contents: schemas_exports.list(schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceLayoutItem)).optional(),
|
|
22262
22280
|
slug: schemas_exports.string().optional(),
|
|
22263
22281
|
icon: schemas_exports.string().optional(),
|
|
22264
22282
|
hidden: schemas_exports.boolean().optional(),
|
|
@@ -22267,12 +22285,18 @@ var init_ApiPackageConfiguration = __esm({
|
|
|
22267
22285
|
}
|
|
22268
22286
|
});
|
|
22269
22287
|
|
|
22270
|
-
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22271
|
-
var
|
|
22272
|
-
var
|
|
22273
|
-
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
22288
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceEndpointConfiguration.js
|
|
22289
|
+
var ApiReferenceEndpointConfiguration;
|
|
22290
|
+
var init_ApiReferenceEndpointConfiguration = __esm({
|
|
22291
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceEndpointConfiguration.js"() {
|
|
22274
22292
|
init_core();
|
|
22275
|
-
|
|
22293
|
+
ApiReferenceEndpointConfiguration = schemas_exports.object({
|
|
22294
|
+
endpoint: schemas_exports.string(),
|
|
22295
|
+
title: schemas_exports.string().optional(),
|
|
22296
|
+
slug: schemas_exports.string().optional(),
|
|
22297
|
+
icon: schemas_exports.string().optional(),
|
|
22298
|
+
hidden: schemas_exports.boolean().optional()
|
|
22299
|
+
});
|
|
22276
22300
|
}
|
|
22277
22301
|
});
|
|
22278
22302
|
|
|
@@ -22609,11 +22633,12 @@ var init_types = __esm({
|
|
|
22609
22633
|
init_FontConfigVariant();
|
|
22610
22634
|
init_PageConfiguration();
|
|
22611
22635
|
init_SectionConfiguration();
|
|
22612
|
-
|
|
22613
|
-
|
|
22614
|
-
|
|
22615
|
-
|
|
22616
|
-
|
|
22636
|
+
init_ApiReferenceConfiguration();
|
|
22637
|
+
init_ApiReferenceLayoutItem();
|
|
22638
|
+
init_ApiReferenceSectionConfiguration();
|
|
22639
|
+
init_ApiReferencePackageConfiguration();
|
|
22640
|
+
init_ApiReferencePackageConfigurationWithOptions();
|
|
22641
|
+
init_ApiReferenceEndpointConfiguration();
|
|
22617
22642
|
init_LinkConfiguration();
|
|
22618
22643
|
init_VersionedSnippetLanguageConfiguration();
|
|
22619
22644
|
init_SnippetLanguageConfiguration();
|
|
@@ -22642,10 +22667,12 @@ var init_types = __esm({
|
|
|
22642
22667
|
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/index.js
|
|
22643
22668
|
var docs_exports3 = {};
|
|
22644
22669
|
__export(docs_exports3, {
|
|
22645
|
-
|
|
22646
|
-
|
|
22647
|
-
|
|
22648
|
-
|
|
22670
|
+
ApiReferenceConfiguration: () => ApiReferenceConfiguration,
|
|
22671
|
+
ApiReferenceEndpointConfiguration: () => ApiReferenceEndpointConfiguration,
|
|
22672
|
+
ApiReferenceLayoutItem: () => ApiReferenceLayoutItem,
|
|
22673
|
+
ApiReferencePackageConfiguration: () => ApiReferencePackageConfiguration,
|
|
22674
|
+
ApiReferencePackageConfigurationWithOptions: () => ApiReferencePackageConfigurationWithOptions,
|
|
22675
|
+
ApiReferenceSectionConfiguration: () => ApiReferenceSectionConfiguration,
|
|
22649
22676
|
AudiencesConfig: () => AudiencesConfig,
|
|
22650
22677
|
BackgroundImageConfiguration: () => BackgroundImageConfiguration,
|
|
22651
22678
|
BackgroundImageThemedConfig: () => BackgroundImageThemedConfig,
|
|
@@ -22689,7 +22716,6 @@ __export(docs_exports3, {
|
|
|
22689
22716
|
SidebarOrHeaderPlacement: () => SidebarOrHeaderPlacement4,
|
|
22690
22717
|
SnippetLanguageConfiguration: () => SnippetLanguageConfiguration,
|
|
22691
22718
|
SnippetsConfiguration: () => SnippetsConfiguration,
|
|
22692
|
-
SubpackageOrSubpackages: () => SubpackageOrSubpackages,
|
|
22693
22719
|
TabConfig: () => TabConfig,
|
|
22694
22720
|
TabId: () => TabId2,
|
|
22695
22721
|
TabbedNavigationConfig: () => TabbedNavigationConfig,
|
|
@@ -22718,10 +22744,12 @@ var init_resources = __esm({
|
|
|
22718
22744
|
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/index.js
|
|
22719
22745
|
var serialization_exports = {};
|
|
22720
22746
|
__export(serialization_exports, {
|
|
22721
|
-
|
|
22722
|
-
|
|
22723
|
-
|
|
22724
|
-
|
|
22747
|
+
ApiReferenceConfiguration: () => ApiReferenceConfiguration,
|
|
22748
|
+
ApiReferenceEndpointConfiguration: () => ApiReferenceEndpointConfiguration,
|
|
22749
|
+
ApiReferenceLayoutItem: () => ApiReferenceLayoutItem,
|
|
22750
|
+
ApiReferencePackageConfiguration: () => ApiReferencePackageConfiguration,
|
|
22751
|
+
ApiReferencePackageConfigurationWithOptions: () => ApiReferencePackageConfigurationWithOptions,
|
|
22752
|
+
ApiReferenceSectionConfiguration: () => ApiReferenceSectionConfiguration,
|
|
22725
22753
|
AudiencesConfig: () => AudiencesConfig,
|
|
22726
22754
|
BackgroundImageConfiguration: () => BackgroundImageConfiguration,
|
|
22727
22755
|
BackgroundImageThemedConfig: () => BackgroundImageThemedConfig,
|
|
@@ -22765,7 +22793,6 @@ __export(serialization_exports, {
|
|
|
22765
22793
|
SidebarOrHeaderPlacement: () => SidebarOrHeaderPlacement4,
|
|
22766
22794
|
SnippetLanguageConfiguration: () => SnippetLanguageConfiguration,
|
|
22767
22795
|
SnippetsConfiguration: () => SnippetsConfiguration,
|
|
22768
|
-
SubpackageOrSubpackages: () => SubpackageOrSubpackages,
|
|
22769
22796
|
TabConfig: () => TabConfig,
|
|
22770
22797
|
TabId: () => TabId2,
|
|
22771
22798
|
TabbedNavigationConfig: () => TabbedNavigationConfig,
|
|
@@ -1049702,7 +1049729,7 @@ async function getAllPages({ navigation, absolutePathToFernFolder }) {
|
|
|
1049702
1049729
|
async function getAllPagesFromNavigationItem({ item, absolutePathToFernFolder }) {
|
|
1049703
1049730
|
switch (item.type) {
|
|
1049704
1049731
|
case "apiSection": {
|
|
1049705
|
-
const toRet = combineMaps(await Promise.all(item.navigation.map((apiNavigation) =>
|
|
1049732
|
+
const toRet = combineMaps(await Promise.all(item.navigation.map((apiNavigation) => getAllPagesFromApiReferenceLayoutItem({ item: apiNavigation, absolutePathToFernFolder }))));
|
|
1049706
1049733
|
if (item.summaryAbsolutePath != null) {
|
|
1049707
1049734
|
toRet[await relativize(absolutePathToFernFolder, item.summaryAbsolutePath)] = (await (0, import_promises7.readFile)(item.summaryAbsolutePath)).toString();
|
|
1049708
1049735
|
}
|
|
@@ -1049725,14 +1049752,14 @@ async function getAllPagesFromNavigationItem({ item, absolutePathToFernFolder })
|
|
|
1049725
1049752
|
function combineMaps(maps) {
|
|
1049726
1049753
|
return maps.reduce((acc, record4) => ({ ...acc, ...record4 }), {});
|
|
1049727
1049754
|
}
|
|
1049728
|
-
async function
|
|
1049755
|
+
async function getAllPagesFromApiReferenceLayoutItem({ item, absolutePathToFernFolder }) {
|
|
1049729
1049756
|
if (item.type === "page") {
|
|
1049730
1049757
|
return {
|
|
1049731
1049758
|
[await relativize(absolutePathToFernFolder, item.absolutePath)]: (await (0, import_promises7.readFile)(item.absolutePath)).toString()
|
|
1049732
1049759
|
};
|
|
1049733
|
-
} else if (item.type === "package") {
|
|
1049760
|
+
} else if (item.type === "package" || item.type === "section") {
|
|
1049734
1049761
|
const toRet = combineMaps(await Promise.all(item.contents.map(async (subItem) => {
|
|
1049735
|
-
return await
|
|
1049762
|
+
return await getAllPagesFromApiReferenceLayoutItem({ item: subItem, absolutePathToFernFolder });
|
|
1049736
1049763
|
})));
|
|
1049737
1049764
|
if (item.summaryAbsolutePath != null) {
|
|
1049738
1049765
|
toRet[await relativize(absolutePathToFernFolder, item.summaryAbsolutePath)] = (await (0, import_promises7.readFile)(item.summaryAbsolutePath)).toString();
|
|
@@ -1050212,7 +1050239,7 @@ async function convertNavigationItem({ rawConfig, absolutePathToFernFolder, abso
|
|
|
1050212
1050239
|
audiences: rawConfig.audiences != null ? { type: "select", audiences: rawConfig.audiences } : { type: "all" },
|
|
1050213
1050240
|
showErrors: rawConfig.displayErrors ?? false,
|
|
1050214
1050241
|
snippetsConfiguration: rawConfig.snippets != null ? convertSnippetsConfiguration({ rawConfig: rawConfig.snippets }) : void 0,
|
|
1050215
|
-
navigation: ((_a5 = rawConfig.layout) == null ? void 0 : _a5.flatMap((item) =>
|
|
1050242
|
+
navigation: ((_a5 = rawConfig.layout) == null ? void 0 : _a5.flatMap((item) => parseApiReferenceLayoutItem(item, absolutePathToConfig))) ?? [],
|
|
1050216
1050243
|
summaryAbsolutePath: resolveFilepath(rawConfig.summary, absolutePathToConfig),
|
|
1050217
1050244
|
hidden: rawConfig.hidden ?? void 0,
|
|
1050218
1050245
|
slug: rawConfig.slug,
|
|
@@ -1050232,7 +1050259,8 @@ async function convertNavigationItem({ rawConfig, absolutePathToFernFolder, abso
|
|
|
1050232
1050259
|
}
|
|
1050233
1050260
|
assertNever(rawConfig);
|
|
1050234
1050261
|
}
|
|
1050235
|
-
function
|
|
1050262
|
+
function parseApiReferenceLayoutItem(item, absolutePathToConfig) {
|
|
1050263
|
+
var _a5;
|
|
1050236
1050264
|
if (typeof item === "string") {
|
|
1050237
1050265
|
return [{ type: "item", value: item }];
|
|
1050238
1050266
|
}
|
|
@@ -1050256,32 +1050284,59 @@ function parseApiNavigationItem(item, absolutePathToConfig) {
|
|
|
1050256
1050284
|
icon: item.icon
|
|
1050257
1050285
|
}
|
|
1050258
1050286
|
];
|
|
1050259
|
-
} else if (
|
|
1050287
|
+
} else if (isRawApiRefSectionConfiguration(item)) {
|
|
1050260
1050288
|
return [
|
|
1050261
1050289
|
{
|
|
1050262
|
-
type: "
|
|
1050263
|
-
|
|
1050264
|
-
|
|
1050290
|
+
type: "section",
|
|
1050291
|
+
title: item.section,
|
|
1050292
|
+
referencedSubpackages: item.referencedPackages ?? [],
|
|
1050265
1050293
|
summaryAbsolutePath: resolveFilepath(item.summary, absolutePathToConfig),
|
|
1050266
|
-
contents: item.contents.flatMap((value) =>
|
|
1050294
|
+
contents: ((_a5 = item.contents) == null ? void 0 : _a5.flatMap((value) => parseApiReferenceLayoutItem(value, absolutePathToConfig))) ?? [],
|
|
1050267
1050295
|
slug: item.slug,
|
|
1050268
1050296
|
hidden: item.hidden,
|
|
1050269
1050297
|
skipUrlSlug: item.skipSlug,
|
|
1050270
1050298
|
icon: item.icon
|
|
1050271
1050299
|
}
|
|
1050272
1050300
|
];
|
|
1050301
|
+
} else if (isRawApiRefEndpointConfiguration(item)) {
|
|
1050302
|
+
return [
|
|
1050303
|
+
{
|
|
1050304
|
+
type: "endpoint",
|
|
1050305
|
+
endpoint: item.endpoint,
|
|
1050306
|
+
title: item.title,
|
|
1050307
|
+
icon: item.icon,
|
|
1050308
|
+
slug: item.slug,
|
|
1050309
|
+
hidden: item.hidden
|
|
1050310
|
+
}
|
|
1050311
|
+
];
|
|
1050273
1050312
|
}
|
|
1050274
|
-
return Object.entries(item).map(([key2,
|
|
1050275
|
-
|
|
1050276
|
-
|
|
1050277
|
-
|
|
1050278
|
-
|
|
1050279
|
-
|
|
1050280
|
-
|
|
1050281
|
-
|
|
1050282
|
-
|
|
1050283
|
-
|
|
1050284
|
-
|
|
1050313
|
+
return Object.entries(item).map(([key2, value]) => {
|
|
1050314
|
+
var _a6;
|
|
1050315
|
+
if (isRawApiRefPackageConfiguration(value)) {
|
|
1050316
|
+
return {
|
|
1050317
|
+
type: "package",
|
|
1050318
|
+
title: value.title,
|
|
1050319
|
+
package: key2,
|
|
1050320
|
+
summaryAbsolutePath: resolveFilepath(value.summary, absolutePathToConfig),
|
|
1050321
|
+
contents: ((_a6 = value.contents) == null ? void 0 : _a6.flatMap((value2) => parseApiReferenceLayoutItem(value2, absolutePathToConfig))) ?? [],
|
|
1050322
|
+
slug: value.slug,
|
|
1050323
|
+
hidden: value.hidden,
|
|
1050324
|
+
skipUrlSlug: value.skipSlug,
|
|
1050325
|
+
icon: value.icon
|
|
1050326
|
+
};
|
|
1050327
|
+
}
|
|
1050328
|
+
return {
|
|
1050329
|
+
type: "package",
|
|
1050330
|
+
title: void 0,
|
|
1050331
|
+
package: key2,
|
|
1050332
|
+
summaryAbsolutePath: void 0,
|
|
1050333
|
+
contents: value.flatMap((value2) => parseApiReferenceLayoutItem(value2, absolutePathToConfig)),
|
|
1050334
|
+
hidden: false,
|
|
1050335
|
+
slug: void 0,
|
|
1050336
|
+
skipUrlSlug: false,
|
|
1050337
|
+
icon: void 0
|
|
1050338
|
+
};
|
|
1050339
|
+
});
|
|
1050285
1050340
|
}
|
|
1050286
1050341
|
function convertSnippetsConfiguration({ rawConfig }) {
|
|
1050287
1050342
|
return {
|
|
@@ -1050301,10 +1050356,17 @@ function isRawApiSectionConfig(item) {
|
|
|
1050301
1050356
|
return item.api != null;
|
|
1050302
1050357
|
}
|
|
1050303
1050358
|
function isRawLinkConfig(item) {
|
|
1050359
|
+
api_exports4;
|
|
1050304
1050360
|
return isPlainObject(item) && typeof item.link === "string" && typeof item.href === "string";
|
|
1050305
1050361
|
}
|
|
1050306
|
-
function
|
|
1050307
|
-
return isPlainObject(item) && typeof item.
|
|
1050362
|
+
function isRawApiRefSectionConfiguration(item) {
|
|
1050363
|
+
return isPlainObject(item) && typeof item.section === "string" && Array.isArray(item.contents);
|
|
1050364
|
+
}
|
|
1050365
|
+
function isRawApiRefEndpointConfiguration(item) {
|
|
1050366
|
+
return isPlainObject(item) && typeof item.endpoint === "string";
|
|
1050367
|
+
}
|
|
1050368
|
+
function isRawApiRefPackageConfiguration(item) {
|
|
1050369
|
+
return !Array.isArray(item);
|
|
1050308
1050370
|
}
|
|
1050309
1050371
|
function resolveFilepath(unresolvedFilepath, absoluteFilepathToDocsConfig) {
|
|
1050310
1050372
|
if (unresolvedFilepath == null) {
|
|
@@ -1054306,7 +1054368,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1054306
1054368
|
properties: {
|
|
1054307
1054369
|
...event,
|
|
1054308
1054370
|
...event.properties,
|
|
1054309
|
-
version: "0.30.8-
|
|
1054371
|
+
version: "0.30.8-rc5",
|
|
1054310
1054372
|
usingAccessToken: true
|
|
1054311
1054373
|
}
|
|
1054312
1054374
|
});
|
|
@@ -1054368,7 +1054430,7 @@ var UserPosthogManager = class {
|
|
|
1054368
1054430
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1054369
1054431
|
event: "CLI",
|
|
1054370
1054432
|
properties: {
|
|
1054371
|
-
version: "0.30.8-
|
|
1054433
|
+
version: "0.30.8-rc5",
|
|
1054372
1054434
|
...event,
|
|
1054373
1054435
|
...event.properties
|
|
1054374
1054436
|
}
|
|
@@ -1080311,10 +1080373,10 @@ var CliContext = class {
|
|
|
1080311
1080373
|
return "fern-api";
|
|
1080312
1080374
|
}
|
|
1080313
1080375
|
getPackageVersion() {
|
|
1080314
|
-
if ("0.30.8-
|
|
1080376
|
+
if ("0.30.8-rc5" == null) {
|
|
1080315
1080377
|
this.logger.error("CLI_VERSION is not defined");
|
|
1080316
1080378
|
}
|
|
1080317
|
-
return "0.30.8-
|
|
1080379
|
+
return "0.30.8-rc5";
|
|
1080318
1080380
|
}
|
|
1080319
1080381
|
getCliName() {
|
|
1080320
1080382
|
if ("fern" == null) {
|
|
@@ -1087621,12 +1087683,13 @@ function stringifyEndpointPathParts22(path42) {
|
|
|
1087621
1087683
|
}
|
|
1087622
1087684
|
|
|
1087623
1087685
|
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/ApiDefinitionHolder.js
|
|
1087624
|
-
var ROOT_PACKAGE_ID = "
|
|
1087686
|
+
var ROOT_PACKAGE_ID = "__package__";
|
|
1087625
1087687
|
var _endpoints2, _webSockets2, _webhooks2, _endpointsInverted, _webSocketsInverted, _webhooksInverted, _subpackages, _endpointsByLocator, _webSocketsByLocator, _webhooksByLocator, _subpackagesByLocator, _constructSubpackageLocators, constructSubpackageLocators_fn;
|
|
1087626
1087688
|
var _ApiDefinitionHolder2 = class {
|
|
1087627
|
-
constructor(api) {
|
|
1087689
|
+
constructor(api, context) {
|
|
1087628
1087690
|
__privateAdd(this, _constructSubpackageLocators);
|
|
1087629
1087691
|
__publicField(this, "api");
|
|
1087692
|
+
__publicField(this, "context");
|
|
1087630
1087693
|
__privateAdd(this, _endpoints2, /* @__PURE__ */ new Map());
|
|
1087631
1087694
|
__privateAdd(this, _webSockets2, /* @__PURE__ */ new Map());
|
|
1087632
1087695
|
__privateAdd(this, _webhooks2, /* @__PURE__ */ new Map());
|
|
@@ -1087639,6 +1087702,7 @@ var _ApiDefinitionHolder2 = class {
|
|
|
1087639
1087702
|
__privateAdd(this, _webhooksByLocator, /* @__PURE__ */ new Map());
|
|
1087640
1087703
|
__privateAdd(this, _subpackagesByLocator, /* @__PURE__ */ new Map());
|
|
1087641
1087704
|
this.api = api;
|
|
1087705
|
+
this.context = context;
|
|
1087642
1087706
|
[api.rootPackage, ...Object.values(api.subpackages)].forEach((pkg2) => {
|
|
1087643
1087707
|
const subpackageId = _ApiDefinitionHolder2.getSubpackageId(pkg2);
|
|
1087644
1087708
|
const subpackageHolder = {
|
|
@@ -1087648,45 +1087712,57 @@ var _ApiDefinitionHolder2 = class {
|
|
|
1087648
1087712
|
};
|
|
1087649
1087713
|
__privateGet(this, _subpackages).set(subpackageId, subpackageHolder);
|
|
1087650
1087714
|
pkg2.endpoints.forEach((endpoint) => {
|
|
1087715
|
+
var _a5;
|
|
1087651
1087716
|
subpackageHolder.endpoints.set(endpoint.id, endpoint);
|
|
1087652
1087717
|
const endpointId = _ApiDefinitionHolder2.createEndpointId(endpoint, subpackageId);
|
|
1087653
1087718
|
__privateGet(this, _endpoints2).set(endpointId, endpoint);
|
|
1087654
|
-
|
|
1087655
|
-
|
|
1087656
|
-
|
|
1087657
|
-
|
|
1087658
|
-
}
|
|
1087659
|
-
|
|
1087660
|
-
|
|
1087661
|
-
|
|
1087662
|
-
|
|
1087663
|
-
|
|
1087664
|
-
|
|
1087665
|
-
|
|
1087666
|
-
|
|
1087667
|
-
|
|
1087668
|
-
|
|
1087719
|
+
const locators = [];
|
|
1087720
|
+
const methods = [endpoint.method];
|
|
1087721
|
+
if (((_a5 = endpoint.response) == null ? void 0 : _a5.type.type) === "stream") {
|
|
1087722
|
+
methods.push("STREAM");
|
|
1087723
|
+
}
|
|
1087724
|
+
methods.forEach((method2) => {
|
|
1087725
|
+
locators.push(`${method2} ${stringifyEndpointPathParts2(endpoint.path.parts)}`);
|
|
1087726
|
+
locators.push(`${method2} ${stringifyEndpointPathParts22(endpoint.path.parts)}`);
|
|
1087727
|
+
endpoint.environments.forEach((environment) => {
|
|
1087728
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts2(endpoint.path.parts))}`);
|
|
1087729
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts22(endpoint.path.parts))}`);
|
|
1087730
|
+
const basePath = getBasePath(environment);
|
|
1087731
|
+
if (basePath != null) {
|
|
1087732
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts2(endpoint.path.parts))}`);
|
|
1087733
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts22(endpoint.path.parts))}`);
|
|
1087734
|
+
}
|
|
1087735
|
+
});
|
|
1087736
|
+
});
|
|
1087737
|
+
locators.forEach((locator) => {
|
|
1087738
|
+
var _a6;
|
|
1087739
|
+
(_a6 = this.context) == null ? void 0 : _a6.logger.debug(`Registering endpoint locator: ${locator}`);
|
|
1087740
|
+
__privateGet(this, _endpointsByLocator).set(locator, endpoint);
|
|
1087669
1087741
|
});
|
|
1087670
1087742
|
});
|
|
1087671
1087743
|
pkg2.websockets.forEach((webSocket) => {
|
|
1087672
1087744
|
subpackageHolder.webSockets.set(webSocket.id, webSocket);
|
|
1087673
1087745
|
const webSocketId = _ApiDefinitionHolder2.createWebSocketId(webSocket, subpackageId);
|
|
1087674
1087746
|
__privateGet(this, _webSockets2).set(webSocketId, webSocket);
|
|
1087675
|
-
|
|
1087676
|
-
|
|
1087677
|
-
|
|
1087678
|
-
|
|
1087679
|
-
|
|
1087680
|
-
|
|
1087681
|
-
|
|
1087682
|
-
|
|
1087683
|
-
|
|
1087684
|
-
|
|
1087685
|
-
|
|
1087686
|
-
|
|
1087687
|
-
|
|
1087688
|
-
|
|
1087689
|
-
|
|
1087747
|
+
const locators = [];
|
|
1087748
|
+
const methods = ["GET", "WSS"];
|
|
1087749
|
+
methods.forEach((method2) => {
|
|
1087750
|
+
locators.push(`${method2} ${stringifyEndpointPathParts2(webSocket.path.parts)}`);
|
|
1087751
|
+
locators.push(`${method2} ${stringifyEndpointPathParts22(webSocket.path.parts)}`);
|
|
1087752
|
+
webSocket.environments.forEach((environment) => {
|
|
1087753
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts2(webSocket.path.parts))}`);
|
|
1087754
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts22(webSocket.path.parts))}`);
|
|
1087755
|
+
const basePath = getBasePath(environment);
|
|
1087756
|
+
if (basePath != null) {
|
|
1087757
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts2(webSocket.path.parts))}`);
|
|
1087758
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts22(webSocket.path.parts))}`);
|
|
1087759
|
+
}
|
|
1087760
|
+
});
|
|
1087761
|
+
});
|
|
1087762
|
+
locators.forEach((locator) => {
|
|
1087763
|
+
var _a5;
|
|
1087764
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering websocket locator: ${locator}`);
|
|
1087765
|
+
__privateGet(this, _webSocketsByLocator).set(locator, webSocket);
|
|
1087690
1087766
|
});
|
|
1087691
1087767
|
});
|
|
1087692
1087768
|
pkg2.webhooks.forEach((webhook) => {
|
|
@@ -1087705,8 +1087781,8 @@ var _ApiDefinitionHolder2 = class {
|
|
|
1087705
1087781
|
});
|
|
1087706
1087782
|
__privateMethod(this, _constructSubpackageLocators, constructSubpackageLocators_fn).call(this, api.rootPackage, []);
|
|
1087707
1087783
|
}
|
|
1087708
|
-
static create(api) {
|
|
1087709
|
-
return new _ApiDefinitionHolder2(api);
|
|
1087784
|
+
static create(api, context) {
|
|
1087785
|
+
return new _ApiDefinitionHolder2(api, context);
|
|
1087710
1087786
|
}
|
|
1087711
1087787
|
static getSubpackageId(pkg2) {
|
|
1087712
1087788
|
return isSubpackage2(pkg2) ? pkg2.subpackageId : ROOT_PACKAGE_ID;
|
|
@@ -1087750,6 +1087826,9 @@ var _ApiDefinitionHolder2 = class {
|
|
|
1087750
1087826
|
get subpackages() {
|
|
1087751
1087827
|
return __privateGet(this, _subpackages);
|
|
1087752
1087828
|
}
|
|
1087829
|
+
get subpackagesByLocator() {
|
|
1087830
|
+
return __privateGet(this, _subpackagesByLocator);
|
|
1087831
|
+
}
|
|
1087753
1087832
|
getEndpointId(endpoint) {
|
|
1087754
1087833
|
return __privateGet(this, _endpointsInverted).get(endpoint);
|
|
1087755
1087834
|
}
|
|
@@ -1087787,21 +1087866,42 @@ constructSubpackageLocators_fn = function(pkg2, parents) {
|
|
|
1087787
1087866
|
return;
|
|
1087788
1087867
|
}
|
|
1087789
1087868
|
const packageList = isSubpackage2(pkg2) ? [...parents, pkg2.name] : parents;
|
|
1087790
|
-
|
|
1087869
|
+
const path42 = packageList.length === 0 ? [ROOT_PACKAGE_ID] : packageList;
|
|
1087870
|
+
const locators = [path42.join("."), path42.join("/"), `${path42.join(".")}.yml`];
|
|
1087871
|
+
locators.forEach((locator) => {
|
|
1087872
|
+
var _a5;
|
|
1087873
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering subpackage locator: ${locator}`);
|
|
1087874
|
+
__privateGet(this, _subpackagesByLocator).set(locator, pkg2);
|
|
1087875
|
+
});
|
|
1087791
1087876
|
if (pkg2.pointsTo != null) {
|
|
1087792
1087877
|
return __privateMethod(this, _constructSubpackageLocators, constructSubpackageLocators_fn).call(this, this.api.subpackages[pkg2.pointsTo], packageList);
|
|
1087793
1087878
|
}
|
|
1087794
1087879
|
pkg2.endpoints.forEach((endpoint) => {
|
|
1087795
|
-
const
|
|
1087796
|
-
|
|
1087880
|
+
const path43 = [...packageList, endpoint.id];
|
|
1087881
|
+
const locators2 = [path43.join("."), path43.join("/")];
|
|
1087882
|
+
locators2.forEach((locator) => {
|
|
1087883
|
+
var _a5;
|
|
1087884
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering endpoint locator: ${locator}`);
|
|
1087885
|
+
__privateGet(this, _endpointsByLocator).set(locator, endpoint);
|
|
1087886
|
+
});
|
|
1087797
1087887
|
});
|
|
1087798
1087888
|
pkg2.websockets.forEach((webSocket) => {
|
|
1087799
|
-
const
|
|
1087800
|
-
|
|
1087889
|
+
const path43 = [...packageList, webSocket.id];
|
|
1087890
|
+
const locators2 = [path43.join("."), path43.join("/")];
|
|
1087891
|
+
locators2.forEach((locator) => {
|
|
1087892
|
+
var _a5;
|
|
1087893
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering websocket locator: ${locator}`);
|
|
1087894
|
+
__privateGet(this, _webSocketsByLocator).set(locator, webSocket);
|
|
1087895
|
+
});
|
|
1087801
1087896
|
});
|
|
1087802
1087897
|
pkg2.webhooks.forEach((webhook) => {
|
|
1087803
|
-
const
|
|
1087804
|
-
|
|
1087898
|
+
const path43 = [...packageList, webhook.id];
|
|
1087899
|
+
const locators2 = [path43.join("."), path43.join("/")];
|
|
1087900
|
+
locators2.forEach((locator) => {
|
|
1087901
|
+
var _a5;
|
|
1087902
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering webhook locator: ${locator}`);
|
|
1087903
|
+
__privateGet(this, _webhooksByLocator).set(locator, webhook);
|
|
1087904
|
+
});
|
|
1087805
1087905
|
});
|
|
1087806
1087906
|
pkg2.subpackages.forEach((subpackageId) => {
|
|
1087807
1087907
|
__privateMethod(this, _constructSubpackageLocators, constructSubpackageLocators_fn).call(this, this.api.subpackages[subpackageId], packageList);
|
|
@@ -1087989,13 +1088089,18 @@ var NodeIdGenerator2 = class {
|
|
|
1087989
1088089
|
};
|
|
1087990
1088090
|
|
|
1087991
1088091
|
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/ApiReferenceNodeConverter.js
|
|
1087992
|
-
var _holder2, _visitedEndpoints2, _visitedWebSockets2, _visitedWebhooks2, _visitedSubpackages2, _nodeIdToSubpackageId, _children, _overviewPageId, _slug,
|
|
1088092
|
+
var _holder2, _visitedEndpoints2, _visitedWebSockets2, _visitedWebhooks2, _visitedSubpackages2, _nodeIdToSubpackageId, _children, _overviewPageId, _slug, _convertApiReferenceLayoutItems, convertApiReferenceLayoutItems_fn, _convertPackage, convertPackage_fn, _convertSection, convertSection_fn, _convertUnknownIdentifier, convertUnknownIdentifier_fn, _convertEndpoint, convertEndpoint_fn, _mergeAndFilterChildren, mergeAndFilterChildren_fn, _convertApiPackageChild, convertApiPackageChild_fn, _convertApiDefinitionPackage, convertApiDefinitionPackage_fn, _convertApiDefinitionPackageId, convertApiDefinitionPackageId_fn;
|
|
1087993
1088093
|
var ApiReferenceNodeConverter = class {
|
|
1087994
1088094
|
constructor(apiSection, api, parentSlug, workspace, docsWorkspace, taskContext, markdownFilesToFullSlugs) {
|
|
1087995
|
-
__privateAdd(this,
|
|
1088095
|
+
__privateAdd(this, _convertApiReferenceLayoutItems);
|
|
1087996
1088096
|
__privateAdd(this, _convertPackage);
|
|
1087997
|
-
__privateAdd(this,
|
|
1088097
|
+
__privateAdd(this, _convertSection);
|
|
1087998
1088098
|
__privateAdd(this, _convertUnknownIdentifier);
|
|
1088099
|
+
__privateAdd(this, _convertEndpoint);
|
|
1088100
|
+
__privateAdd(this, _mergeAndFilterChildren);
|
|
1088101
|
+
__privateAdd(this, _convertApiPackageChild);
|
|
1088102
|
+
__privateAdd(this, _convertApiDefinitionPackage);
|
|
1088103
|
+
__privateAdd(this, _convertApiDefinitionPackageId);
|
|
1087999
1088104
|
__publicField(this, "apiSection");
|
|
1088000
1088105
|
__publicField(this, "workspace");
|
|
1088001
1088106
|
__publicField(this, "docsWorkspace");
|
|
@@ -1088017,7 +1088122,7 @@ var ApiReferenceNodeConverter = class {
|
|
|
1088017
1088122
|
this.taskContext = taskContext;
|
|
1088018
1088123
|
this.markdownFilesToFullSlugs = markdownFilesToFullSlugs;
|
|
1088019
1088124
|
this.apiDefinitionId = navigation_exports2.ApiDefinitionId(api.id);
|
|
1088020
|
-
__privateSet(this, _holder2, ApiDefinitionHolder2.create(api));
|
|
1088125
|
+
__privateSet(this, _holder2, ApiDefinitionHolder2.create(api, taskContext));
|
|
1088021
1088126
|
const idgen = NodeIdGenerator2.init(this.apiDefinitionId);
|
|
1088022
1088127
|
__privateSet(this, _overviewPageId, this.apiSection.summaryAbsolutePath != null ? navigation_exports2.PageId(this.toRelativeFilepath(this.apiSection.summaryAbsolutePath)) : void 0);
|
|
1088023
1088128
|
const maybeFullSlug = this.apiSection.summaryAbsolutePath != null ? this.markdownFilesToFullSlugs.get(this.apiSection.summaryAbsolutePath) : void 0;
|
|
@@ -1088027,9 +1088132,9 @@ var ApiReferenceNodeConverter = class {
|
|
|
1088027
1088132
|
urlSlug: this.apiSection.slug ?? kebabCase_default2(this.apiSection.title)
|
|
1088028
1088133
|
}));
|
|
1088029
1088134
|
if (this.apiSection.navigation != null) {
|
|
1088030
|
-
__privateSet(this, _children, __privateMethod(this,
|
|
1088135
|
+
__privateSet(this, _children, __privateMethod(this, _convertApiReferenceLayoutItems, convertApiReferenceLayoutItems_fn).call(this, this.apiSection.navigation, __privateGet(this, _holder2).api.rootPackage, __privateGet(this, _slug), idgen));
|
|
1088031
1088136
|
}
|
|
1088032
|
-
__privateSet(this, _children, __privateMethod(this,
|
|
1088137
|
+
__privateSet(this, _children, __privateMethod(this, _mergeAndFilterChildren, mergeAndFilterChildren_fn).call(this, __privateGet(this, _children).map((child) => __privateMethod(this, _convertApiPackageChild, convertApiPackageChild_fn).call(this, child, __privateGet(this, _slug), idgen)), __privateMethod(this, _convertApiDefinitionPackage, convertApiDefinitionPackage_fn).call(this, __privateGet(this, _holder2).api.rootPackage, __privateGet(this, _slug), idgen)));
|
|
1088033
1088138
|
}
|
|
1088034
1088139
|
get() {
|
|
1088035
1088140
|
const pointsTo = navigation_exports2.utils.followRedirects(__privateGet(this, _children));
|
|
@@ -1088098,8 +1088203,8 @@ _nodeIdToSubpackageId = new WeakMap();
|
|
|
1088098
1088203
|
_children = new WeakMap();
|
|
1088099
1088204
|
_overviewPageId = new WeakMap();
|
|
1088100
1088205
|
_slug = new WeakMap();
|
|
1088101
|
-
|
|
1088102
|
-
|
|
1088206
|
+
_convertApiReferenceLayoutItems = new WeakSet();
|
|
1088207
|
+
convertApiReferenceLayoutItems_fn = function(navigation, apiDefinitionPackage, parentSlug, idgen) {
|
|
1088103
1088208
|
apiDefinitionPackage = __privateGet(this, _holder2).resolveSubpackage(apiDefinitionPackage);
|
|
1088104
1088209
|
const apiDefinitionPackageId = apiDefinitionPackage != null ? ApiDefinitionHolder2.getSubpackageId(apiDefinitionPackage) : void 0;
|
|
1088105
1088210
|
return navigation.map((item) => visitDiscriminatedUnion2(item)._visit({
|
|
@@ -1088113,89 +1088218,51 @@ convertApiNavigationItems_fn = function(navigation, apiDefinitionPackage, parent
|
|
|
1088113
1088218
|
page: (page) => {
|
|
1088114
1088219
|
var _a5;
|
|
1088115
1088220
|
const pageId = navigation_exports2.PageId(this.toRelativeFilepath(page.absolutePath));
|
|
1088221
|
+
const pageSlug = parentSlug.apply({
|
|
1088222
|
+
fullSlug: (_a5 = this.markdownFilesToFullSlugs.get(page.absolutePath)) == null ? void 0 : _a5.split("/"),
|
|
1088223
|
+
urlSlug: page.slug ?? kebabCase_default2(page.title)
|
|
1088224
|
+
});
|
|
1088116
1088225
|
return {
|
|
1088117
1088226
|
id: idgen.append(`page:${pageId}`).get(),
|
|
1088118
1088227
|
type: "page",
|
|
1088119
1088228
|
pageId,
|
|
1088120
1088229
|
title: page.title,
|
|
1088121
|
-
slug:
|
|
1088122
|
-
fullSlug: (_a5 = this.markdownFilesToFullSlugs.get(page.absolutePath)) == null ? void 0 : _a5.split("/"),
|
|
1088123
|
-
urlSlug: page.slug ?? kebabCase_default2(page.title)
|
|
1088124
|
-
}).get(),
|
|
1088230
|
+
slug: pageSlug.get(),
|
|
1088125
1088231
|
icon: page.icon,
|
|
1088126
1088232
|
hidden: page.hidden
|
|
1088127
1088233
|
};
|
|
1088128
1088234
|
},
|
|
1088129
1088235
|
package: (pkg2) => __privateMethod(this, _convertPackage, convertPackage_fn).call(this, pkg2, parentSlug, idgen),
|
|
1088130
|
-
|
|
1088236
|
+
section: (section) => __privateMethod(this, _convertSection, convertSection_fn).call(this, section, parentSlug, idgen),
|
|
1088237
|
+
item: ({ value: unknownIdentifier }) => __privateMethod(this, _convertUnknownIdentifier, convertUnknownIdentifier_fn).call(this, unknownIdentifier, apiDefinitionPackageId, parentSlug, idgen),
|
|
1088238
|
+
endpoint: (endpoint) => __privateMethod(this, _convertEndpoint, convertEndpoint_fn).call(this, endpoint, apiDefinitionPackageId, parentSlug, idgen)
|
|
1088131
1088239
|
})).filter(isNonNullish);
|
|
1088132
1088240
|
};
|
|
1088133
1088241
|
_convertPackage = new WeakSet();
|
|
1088134
1088242
|
convertPackage_fn = function(pkg2, parentSlug, idgen) {
|
|
1088135
1088243
|
const overviewPageId = pkg2.summaryAbsolutePath != null ? navigation_exports2.PageId(this.toRelativeFilepath(pkg2.summaryAbsolutePath)) : void 0;
|
|
1088136
1088244
|
const maybeFullSlug = pkg2.summaryAbsolutePath != null ? this.markdownFilesToFullSlugs.get(pkg2.summaryAbsolutePath) : void 0;
|
|
1088137
|
-
if (pkg2.subpackages.length > 0) {
|
|
1088138
|
-
let subpackage2 = void 0;
|
|
1088139
|
-
let i2 = 0;
|
|
1088140
|
-
while (subpackage2 == null && i2 < pkg2.subpackages.length) {
|
|
1088141
|
-
subpackage2 = __privateGet(this, _holder2).getSubpackage(pkg2.subpackages[i2]);
|
|
1088142
|
-
i2++;
|
|
1088143
|
-
}
|
|
1088144
|
-
if (subpackage2 != null) {
|
|
1088145
|
-
const subpackageId = ApiDefinitionHolder2.getSubpackageId(subpackage2);
|
|
1088146
|
-
const subpackageNodeId = idgen.append(subpackageId);
|
|
1088147
|
-
__privateGet(this, _visitedSubpackages2).add(subpackageId);
|
|
1088148
|
-
__privateGet(this, _nodeIdToSubpackageId).set(subpackageNodeId.get(), subpackageId);
|
|
1088149
|
-
const urlSlug = pkg2.slug ?? (isSubpackage2(subpackage2) ? subpackage2.urlSlug : this.apiSection.slug ?? kebabCase_default2(this.apiSection.title));
|
|
1088150
|
-
const slug = parentSlug.apply({
|
|
1088151
|
-
fullSlug: maybeFullSlug == null ? void 0 : maybeFullSlug.split("/"),
|
|
1088152
|
-
skipUrlSlug: pkg2.skipUrlSlug,
|
|
1088153
|
-
urlSlug
|
|
1088154
|
-
});
|
|
1088155
|
-
const convertedItems = [];
|
|
1088156
|
-
pkg2.subpackages.forEach((subpackageId2) => {
|
|
1088157
|
-
const subpackage3 = __privateGet(this, _holder2).getSubpackage(subpackageId2);
|
|
1088158
|
-
if (subpackage3 == null) {
|
|
1088159
|
-
this.taskContext.logger.error(`Subpackage ${subpackageId2} not found in ${this.apiDefinitionId}`);
|
|
1088160
|
-
return;
|
|
1088161
|
-
}
|
|
1088162
|
-
__privateGet(this, _visitedSubpackages2).add(subpackageId2);
|
|
1088163
|
-
__privateGet(this, _nodeIdToSubpackageId).set(subpackageNodeId.get(), subpackageId2);
|
|
1088164
|
-
convertedItems.push(...__privateMethod(this, _convertApiNavigationItems, convertApiNavigationItems_fn).call(this, pkg2.contents, subpackage3, slug, subpackageNodeId));
|
|
1088165
|
-
});
|
|
1088166
|
-
return {
|
|
1088167
|
-
id: subpackageNodeId.get(),
|
|
1088168
|
-
type: "apiPackage",
|
|
1088169
|
-
children: convertedItems,
|
|
1088170
|
-
title: pkg2.package,
|
|
1088171
|
-
slug: slug.get(),
|
|
1088172
|
-
icon: pkg2.icon,
|
|
1088173
|
-
hidden: pkg2.hidden,
|
|
1088174
|
-
overviewPageId,
|
|
1088175
|
-
availability: void 0,
|
|
1088176
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
1088177
|
-
pointsTo: void 0
|
|
1088178
|
-
};
|
|
1088179
|
-
}
|
|
1088180
|
-
}
|
|
1088181
1088245
|
const subpackage = __privateGet(this, _holder2).getSubpackage(pkg2.package);
|
|
1088182
1088246
|
if (subpackage != null) {
|
|
1088183
1088247
|
const subpackageId = ApiDefinitionHolder2.getSubpackageId(subpackage);
|
|
1088184
1088248
|
const subpackageNodeId = idgen.append(subpackageId);
|
|
1088249
|
+
if (__privateGet(this, _visitedSubpackages2).has(subpackageId)) {
|
|
1088250
|
+
this.taskContext.logger.error(`Duplicate subpackage found in the API Reference layout: ${subpackageId}`);
|
|
1088251
|
+
}
|
|
1088185
1088252
|
__privateGet(this, _visitedSubpackages2).add(subpackageId);
|
|
1088186
|
-
__privateGet(this, _nodeIdToSubpackageId).set(subpackageNodeId.get(), subpackageId);
|
|
1088253
|
+
__privateGet(this, _nodeIdToSubpackageId).set(subpackageNodeId.get(), [subpackageId]);
|
|
1088187
1088254
|
const urlSlug = pkg2.slug ?? (isSubpackage2(subpackage) ? subpackage.urlSlug : this.apiSection.slug ?? kebabCase_default2(this.apiSection.title));
|
|
1088188
1088255
|
const slug = parentSlug.apply({
|
|
1088189
1088256
|
fullSlug: maybeFullSlug == null ? void 0 : maybeFullSlug.split("/"),
|
|
1088190
1088257
|
skipUrlSlug: pkg2.skipUrlSlug,
|
|
1088191
1088258
|
urlSlug
|
|
1088192
1088259
|
});
|
|
1088193
|
-
const convertedItems = __privateMethod(this,
|
|
1088260
|
+
const convertedItems = __privateMethod(this, _convertApiReferenceLayoutItems, convertApiReferenceLayoutItems_fn).call(this, pkg2.contents, subpackage, slug, subpackageNodeId);
|
|
1088194
1088261
|
return {
|
|
1088195
1088262
|
id: subpackageNodeId.get(),
|
|
1088196
1088263
|
type: "apiPackage",
|
|
1088197
1088264
|
children: convertedItems,
|
|
1088198
|
-
title: isSubpackage2(subpackage) ? subpackage.displayName ?? titleCase(subpackage.name) : this.apiSection.title,
|
|
1088265
|
+
title: pkg2.title ?? (isSubpackage2(subpackage) ? subpackage.displayName ?? titleCase(subpackage.name) : this.apiSection.title),
|
|
1088199
1088266
|
slug: slug.get(),
|
|
1088200
1088267
|
icon: pkg2.icon,
|
|
1088201
1088268
|
hidden: pkg2.hidden,
|
|
@@ -1088205,18 +1088272,19 @@ convertPackage_fn = function(pkg2, parentSlug, idgen) {
|
|
|
1088205
1088272
|
pointsTo: void 0
|
|
1088206
1088273
|
};
|
|
1088207
1088274
|
} else {
|
|
1088275
|
+
this.taskContext.logger.warn(`Subpackage ${pkg2.package} not found in ${this.apiDefinitionId}, treating it as a section`);
|
|
1088208
1088276
|
const urlSlug = pkg2.slug ?? kebabCase_default2(pkg2.package);
|
|
1088209
1088277
|
const slug = parentSlug.apply({
|
|
1088210
1088278
|
fullSlug: maybeFullSlug == null ? void 0 : maybeFullSlug.split("/"),
|
|
1088211
1088279
|
skipUrlSlug: pkg2.skipUrlSlug,
|
|
1088212
1088280
|
urlSlug
|
|
1088213
1088281
|
});
|
|
1088214
|
-
const convertedItems = __privateMethod(this,
|
|
1088282
|
+
const convertedItems = __privateMethod(this, _convertApiReferenceLayoutItems, convertApiReferenceLayoutItems_fn).call(this, pkg2.contents, void 0, slug, idgen);
|
|
1088215
1088283
|
return {
|
|
1088216
1088284
|
id: idgen.append(kebabCase_default2(pkg2.package)).get(),
|
|
1088217
1088285
|
type: "apiPackage",
|
|
1088218
1088286
|
children: convertedItems,
|
|
1088219
|
-
title: pkg2.package,
|
|
1088287
|
+
title: pkg2.title ?? pkg2.package,
|
|
1088220
1088288
|
slug: slug.get(),
|
|
1088221
1088289
|
icon: pkg2.icon,
|
|
1088222
1088290
|
hidden: pkg2.hidden,
|
|
@@ -1088227,11 +1088295,184 @@ convertPackage_fn = function(pkg2, parentSlug, idgen) {
|
|
|
1088227
1088295
|
};
|
|
1088228
1088296
|
}
|
|
1088229
1088297
|
};
|
|
1088298
|
+
_convertSection = new WeakSet();
|
|
1088299
|
+
convertSection_fn = function(section, parentSlug, idgen) {
|
|
1088300
|
+
const overviewPageId = section.summaryAbsolutePath != null ? navigation_exports2.PageId(this.toRelativeFilepath(section.summaryAbsolutePath)) : void 0;
|
|
1088301
|
+
const maybeFullSlug = section.summaryAbsolutePath != null ? this.markdownFilesToFullSlugs.get(section.summaryAbsolutePath) : void 0;
|
|
1088302
|
+
const nodeId = idgen.append(`section:${kebabCase_default2(section.title)}`);
|
|
1088303
|
+
const subpackages = section.referencedSubpackages.filter((subpackageId) => {
|
|
1088304
|
+
const subpackage = __privateGet(this, _holder2).getSubpackage(subpackageId);
|
|
1088305
|
+
if (subpackage == null) {
|
|
1088306
|
+
this.taskContext.logger.error(`Subpackage ${subpackageId} not found in ${this.apiDefinitionId}`);
|
|
1088307
|
+
return false;
|
|
1088308
|
+
}
|
|
1088309
|
+
return true;
|
|
1088310
|
+
});
|
|
1088311
|
+
__privateGet(this, _nodeIdToSubpackageId).set(nodeId.get(), subpackages);
|
|
1088312
|
+
subpackages.forEach((subpackageId) => {
|
|
1088313
|
+
if (__privateGet(this, _visitedSubpackages2).has(subpackageId)) {
|
|
1088314
|
+
this.taskContext.logger.error(`Duplicate subpackage found in the API Reference layout: ${subpackageId}`);
|
|
1088315
|
+
}
|
|
1088316
|
+
__privateGet(this, _visitedSubpackages2).add(subpackageId);
|
|
1088317
|
+
});
|
|
1088318
|
+
const urlSlug = section.slug ?? kebabCase_default2(section.title);
|
|
1088319
|
+
const slug = parentSlug.apply({
|
|
1088320
|
+
fullSlug: maybeFullSlug == null ? void 0 : maybeFullSlug.split("/"),
|
|
1088321
|
+
skipUrlSlug: section.skipUrlSlug,
|
|
1088322
|
+
urlSlug
|
|
1088323
|
+
});
|
|
1088324
|
+
const convertedItems = __privateMethod(this, _convertApiReferenceLayoutItems, convertApiReferenceLayoutItems_fn).call(this, section.contents, void 0, slug, idgen);
|
|
1088325
|
+
return {
|
|
1088326
|
+
id: nodeId.get(),
|
|
1088327
|
+
type: "apiPackage",
|
|
1088328
|
+
children: convertedItems,
|
|
1088329
|
+
title: section.title,
|
|
1088330
|
+
slug: slug.get(),
|
|
1088331
|
+
icon: section.icon,
|
|
1088332
|
+
hidden: section.hidden,
|
|
1088333
|
+
overviewPageId,
|
|
1088334
|
+
availability: void 0,
|
|
1088335
|
+
apiDefinitionId: this.apiDefinitionId,
|
|
1088336
|
+
pointsTo: void 0
|
|
1088337
|
+
};
|
|
1088338
|
+
};
|
|
1088339
|
+
_convertUnknownIdentifier = new WeakSet();
|
|
1088340
|
+
convertUnknownIdentifier_fn = function(unknownIdentifier, apiDefinitionPackageId, parentSlug, idgen) {
|
|
1088341
|
+
unknownIdentifier = unknownIdentifier.trim();
|
|
1088342
|
+
const subpackage = __privateGet(this, _holder2).getSubpackage(unknownIdentifier);
|
|
1088343
|
+
if (subpackage != null) {
|
|
1088344
|
+
const subpackageId = ApiDefinitionHolder2.getSubpackageId(subpackage);
|
|
1088345
|
+
const subpackageNodeId = idgen.append(subpackageId);
|
|
1088346
|
+
if (__privateGet(this, _visitedSubpackages2).has(subpackageId)) {
|
|
1088347
|
+
this.taskContext.logger.error(`Duplicate subpackage found in the API Reference layout: ${subpackageId}`);
|
|
1088348
|
+
}
|
|
1088349
|
+
__privateGet(this, _visitedSubpackages2).add(subpackageId);
|
|
1088350
|
+
__privateGet(this, _nodeIdToSubpackageId).set(subpackageNodeId.get(), [subpackageId]);
|
|
1088351
|
+
const urlSlug = isSubpackage2(subpackage) ? subpackage.urlSlug : "";
|
|
1088352
|
+
const slug = parentSlug.apply({ urlSlug });
|
|
1088353
|
+
return {
|
|
1088354
|
+
id: subpackageNodeId.get(),
|
|
1088355
|
+
type: "apiPackage",
|
|
1088356
|
+
children: [],
|
|
1088357
|
+
title: isSubpackage2(subpackage) ? subpackage.displayName ?? titleCase(subpackage.name) : this.apiSection.title,
|
|
1088358
|
+
slug: slug.get(),
|
|
1088359
|
+
icon: void 0,
|
|
1088360
|
+
hidden: void 0,
|
|
1088361
|
+
overviewPageId: void 0,
|
|
1088362
|
+
availability: void 0,
|
|
1088363
|
+
apiDefinitionId: this.apiDefinitionId,
|
|
1088364
|
+
pointsTo: void 0
|
|
1088365
|
+
};
|
|
1088366
|
+
}
|
|
1088367
|
+
return __privateMethod(this, _convertEndpoint, convertEndpoint_fn).call(this, {
|
|
1088368
|
+
type: "endpoint",
|
|
1088369
|
+
endpoint: unknownIdentifier,
|
|
1088370
|
+
title: void 0,
|
|
1088371
|
+
icon: void 0,
|
|
1088372
|
+
slug: void 0,
|
|
1088373
|
+
hidden: void 0
|
|
1088374
|
+
}, apiDefinitionPackageId, parentSlug, idgen);
|
|
1088375
|
+
};
|
|
1088376
|
+
_convertEndpoint = new WeakSet();
|
|
1088377
|
+
convertEndpoint_fn = function(endpointItem, apiDefinitionPackageId, parentSlug, idgen) {
|
|
1088378
|
+
var _a5, _b4, _c4, _d2;
|
|
1088379
|
+
const endpoint = (apiDefinitionPackageId != null ? (_a5 = __privateGet(this, _holder2).subpackages.get(apiDefinitionPackageId)) == null ? void 0 : _a5.endpoints.get(endpointItem.endpoint) : void 0) ?? __privateGet(this, _holder2).endpointsByLocator.get(endpointItem.endpoint);
|
|
1088380
|
+
if (endpoint != null) {
|
|
1088381
|
+
const endpointId = __privateGet(this, _holder2).getEndpointId(endpoint);
|
|
1088382
|
+
if (endpointId == null) {
|
|
1088383
|
+
throw new Error(`Expected Endpoint ID for ${endpoint.id}. Got undefined.`);
|
|
1088384
|
+
}
|
|
1088385
|
+
if (__privateGet(this, _visitedEndpoints2).has(endpointId)) {
|
|
1088386
|
+
this.taskContext.logger.error(`Duplicate endpoint found in the API Reference layout: ${endpointId}`);
|
|
1088387
|
+
}
|
|
1088388
|
+
__privateGet(this, _visitedEndpoints2).add(endpointId);
|
|
1088389
|
+
return {
|
|
1088390
|
+
id: idgen.append(endpoint.id).get(),
|
|
1088391
|
+
type: "endpoint",
|
|
1088392
|
+
method: endpoint.method,
|
|
1088393
|
+
endpointId,
|
|
1088394
|
+
apiDefinitionId: this.apiDefinitionId,
|
|
1088395
|
+
availability: navigation_exports2.utils.convertAvailability(endpoint.availability),
|
|
1088396
|
+
isResponseStream: ((_b4 = endpoint.response) == null ? void 0 : _b4.type.type) === "stream",
|
|
1088397
|
+
title: endpointItem.title ?? endpoint.name ?? stringifyEndpointPathParts2(endpoint.path.parts),
|
|
1088398
|
+
slug: (endpointItem.slug != null ? parentSlug.append(endpointItem.slug) : parentSlug.apply(endpoint)).get(),
|
|
1088399
|
+
icon: endpointItem.icon,
|
|
1088400
|
+
hidden: endpointItem.hidden
|
|
1088401
|
+
};
|
|
1088402
|
+
}
|
|
1088403
|
+
const webSocket = (apiDefinitionPackageId != null ? (_c4 = __privateGet(this, _holder2).subpackages.get(apiDefinitionPackageId)) == null ? void 0 : _c4.webSockets.get(endpointItem.endpoint) : void 0) ?? __privateGet(this, _holder2).webSocketsByLocator.get(endpointItem.endpoint);
|
|
1088404
|
+
if (webSocket != null) {
|
|
1088405
|
+
const webSocketId = __privateGet(this, _holder2).getWebSocketId(webSocket);
|
|
1088406
|
+
if (webSocketId == null) {
|
|
1088407
|
+
throw new Error(`Expected WebSocket ID for ${webSocket.id}. Got undefined.`);
|
|
1088408
|
+
}
|
|
1088409
|
+
if (__privateGet(this, _visitedWebSockets2).has(webSocketId)) {
|
|
1088410
|
+
this.taskContext.logger.error(`Duplicate web socket found in the API Reference layout: ${webSocketId}`);
|
|
1088411
|
+
}
|
|
1088412
|
+
__privateGet(this, _visitedWebSockets2).add(webSocketId);
|
|
1088413
|
+
return {
|
|
1088414
|
+
id: idgen.append(webSocket.id).get(),
|
|
1088415
|
+
type: "webSocket",
|
|
1088416
|
+
webSocketId,
|
|
1088417
|
+
title: endpointItem.title ?? webSocket.name ?? stringifyEndpointPathParts2(webSocket.path.parts),
|
|
1088418
|
+
slug: (endpointItem.slug != null ? parentSlug.append(endpointItem.slug) : parentSlug.apply(webSocket)).get(),
|
|
1088419
|
+
icon: endpointItem.icon,
|
|
1088420
|
+
hidden: endpointItem.hidden,
|
|
1088421
|
+
apiDefinitionId: this.apiDefinitionId,
|
|
1088422
|
+
availability: navigation_exports2.utils.convertAvailability(webSocket.availability)
|
|
1088423
|
+
};
|
|
1088424
|
+
}
|
|
1088425
|
+
const webhook = (apiDefinitionPackageId != null ? (_d2 = __privateGet(this, _holder2).subpackages.get(apiDefinitionPackageId)) == null ? void 0 : _d2.webhooks.get(endpointItem.endpoint) : void 0) ?? __privateGet(this, _holder2).webhooks.get(navigation_exports2.WebhookId(endpointItem.endpoint));
|
|
1088426
|
+
if (webhook != null) {
|
|
1088427
|
+
const webhookId = __privateGet(this, _holder2).getWebhookId(webhook);
|
|
1088428
|
+
if (webhookId == null) {
|
|
1088429
|
+
throw new Error(`Expected Webhook ID for ${webhook.id}. Got undefined.`);
|
|
1088430
|
+
}
|
|
1088431
|
+
if (__privateGet(this, _visitedWebhooks2).has(webhookId)) {
|
|
1088432
|
+
this.taskContext.logger.error(`Duplicate webhook found in the API Reference layout: ${webhookId}`);
|
|
1088433
|
+
}
|
|
1088434
|
+
__privateGet(this, _visitedWebhooks2).add(webhookId);
|
|
1088435
|
+
return {
|
|
1088436
|
+
id: idgen.append(webhook.id).get(),
|
|
1088437
|
+
type: "webhook",
|
|
1088438
|
+
webhookId,
|
|
1088439
|
+
method: webhook.method,
|
|
1088440
|
+
title: endpointItem.title ?? webhook.name ?? urlJoin22("/", ...webhook.path),
|
|
1088441
|
+
slug: (endpointItem.slug != null ? parentSlug.append(endpointItem.slug) : parentSlug.apply(webhook)).get(),
|
|
1088442
|
+
icon: endpointItem.icon,
|
|
1088443
|
+
hidden: endpointItem.hidden,
|
|
1088444
|
+
apiDefinitionId: this.apiDefinitionId,
|
|
1088445
|
+
availability: void 0
|
|
1088446
|
+
};
|
|
1088447
|
+
}
|
|
1088448
|
+
this.taskContext.logger.error("Unknown identifier in the API Reference layout: ", endpointItem.endpoint);
|
|
1088449
|
+
return;
|
|
1088450
|
+
};
|
|
1088451
|
+
_mergeAndFilterChildren = new WeakSet();
|
|
1088452
|
+
mergeAndFilterChildren_fn = function(left3, right3) {
|
|
1088453
|
+
return this.mergeEndpointPairs([...left3, ...right3], NodeIdGenerator2.init(this.apiDefinitionId)).filter((child) => child.type === "apiPackage" ? child.children.length > 0 : true);
|
|
1088454
|
+
};
|
|
1088455
|
+
_convertApiPackageChild = new WeakSet();
|
|
1088456
|
+
convertApiPackageChild_fn = function(child, parentSlug, idgen) {
|
|
1088457
|
+
if (child.type === "apiPackage") {
|
|
1088458
|
+
const slug = parentSlug.set(child.slug);
|
|
1088459
|
+
const innerIdgen = idgen.append(kebabCase_default2(child.title));
|
|
1088460
|
+
const subpackageIds = __privateGet(this, _nodeIdToSubpackageId).get(child.id) ?? [];
|
|
1088461
|
+
const subpackageChildren = subpackageIds.flatMap((subpackageId) => __privateMethod(this, _convertApiDefinitionPackageId, convertApiDefinitionPackageId_fn).call(this, subpackageId, slug, innerIdgen));
|
|
1088462
|
+
const children2 = __privateMethod(this, _mergeAndFilterChildren, mergeAndFilterChildren_fn).call(this, child.children, subpackageChildren);
|
|
1088463
|
+
return {
|
|
1088464
|
+
...child,
|
|
1088465
|
+
children: children2,
|
|
1088466
|
+
pointsTo: navigation_exports2.utils.followRedirects(children2)
|
|
1088467
|
+
};
|
|
1088468
|
+
}
|
|
1088469
|
+
return child;
|
|
1088470
|
+
};
|
|
1088230
1088471
|
_convertApiDefinitionPackage = new WeakSet();
|
|
1088231
|
-
convertApiDefinitionPackage_fn = function(
|
|
1088232
|
-
const pkg2 = packageId != null ? __privateGet(this, _holder2).resolveSubpackage(__privateGet(this, _holder2).getSubpackage(packageId)) : void 0;
|
|
1088472
|
+
convertApiDefinitionPackage_fn = function(pkg2, parentSlug, idgen) {
|
|
1088233
1088473
|
let additionalChildren = [];
|
|
1088234
|
-
|
|
1088474
|
+
idgen = idgen.append(isSubpackage2(pkg2) ? pkg2.subpackageId : ROOT_PACKAGE_ID);
|
|
1088475
|
+
pkg2.endpoints.forEach((endpoint) => {
|
|
1088235
1088476
|
var _a5;
|
|
1088236
1088477
|
const endpointId = __privateGet(this, _holder2).getEndpointId(endpoint);
|
|
1088237
1088478
|
if (endpointId == null) {
|
|
@@ -1088254,7 +1088495,7 @@ convertApiDefinitionPackage_fn = function(packageId, children2, parentSlug, idge
|
|
|
1088254
1088495
|
hidden: void 0
|
|
1088255
1088496
|
});
|
|
1088256
1088497
|
});
|
|
1088257
|
-
pkg2
|
|
1088498
|
+
pkg2.websockets.forEach((webSocket) => {
|
|
1088258
1088499
|
const webSocketId = __privateGet(this, _holder2).getWebSocketId(webSocket);
|
|
1088259
1088500
|
if (webSocketId == null) {
|
|
1088260
1088501
|
throw new Error(`Expected WebSocket ID for ${webSocket.id}. Got undefined.`);
|
|
@@ -1088274,7 +1088515,7 @@ convertApiDefinitionPackage_fn = function(packageId, children2, parentSlug, idge
|
|
|
1088274
1088515
|
availability: navigation_exports2.utils.convertAvailability(webSocket.availability)
|
|
1088275
1088516
|
});
|
|
1088276
1088517
|
});
|
|
1088277
|
-
pkg2
|
|
1088518
|
+
pkg2.webhooks.forEach((webhook) => {
|
|
1088278
1088519
|
const webhookId = __privateGet(this, _holder2).getWebhookId(webhook);
|
|
1088279
1088520
|
if (webhookId == null) {
|
|
1088280
1088521
|
throw new Error(`Expected Webhook ID for ${webhook.id}. Got undefined.`);
|
|
@@ -1088287,7 +1088528,7 @@ convertApiDefinitionPackage_fn = function(packageId, children2, parentSlug, idge
|
|
|
1088287
1088528
|
type: "webhook",
|
|
1088288
1088529
|
webhookId,
|
|
1088289
1088530
|
method: webhook.method,
|
|
1088290
|
-
title: webhook.name ??
|
|
1088531
|
+
title: webhook.name ?? titleCase(webhook.id),
|
|
1088291
1088532
|
slug: parentSlug.apply(webhook).get(),
|
|
1088292
1088533
|
icon: void 0,
|
|
1088293
1088534
|
hidden: void 0,
|
|
@@ -1088295,7 +1088536,7 @@ convertApiDefinitionPackage_fn = function(packageId, children2, parentSlug, idge
|
|
|
1088295
1088536
|
availability: void 0
|
|
1088296
1088537
|
});
|
|
1088297
1088538
|
});
|
|
1088298
|
-
pkg2
|
|
1088539
|
+
pkg2.subpackages.forEach((subpackageId) => {
|
|
1088299
1088540
|
if (__privateGet(this, _visitedSubpackages2).has(subpackageId)) {
|
|
1088300
1088541
|
return;
|
|
1088301
1088542
|
}
|
|
@@ -1088306,7 +1088547,7 @@ convertApiDefinitionPackage_fn = function(packageId, children2, parentSlug, idge
|
|
|
1088306
1088547
|
}
|
|
1088307
1088548
|
const subpackageNodeId = idgen.append(subpackageId);
|
|
1088308
1088549
|
const slug = isSubpackage2(subpackage) ? parentSlug.apply(subpackage) : parentSlug;
|
|
1088309
|
-
const subpackageChildren = __privateMethod(this,
|
|
1088550
|
+
const subpackageChildren = __privateMethod(this, _convertApiDefinitionPackageId, convertApiDefinitionPackageId_fn).call(this, subpackageId, slug, subpackageNodeId);
|
|
1088310
1088551
|
additionalChildren.push({
|
|
1088311
1088552
|
id: subpackageNodeId.get(),
|
|
1088312
1088553
|
type: "apiPackage",
|
|
@@ -1088328,124 +1088569,16 @@ convertApiDefinitionPackage_fn = function(packageId, children2, parentSlug, idge
|
|
|
1088328
1088569
|
return aTitle.localeCompare(bTitle);
|
|
1088329
1088570
|
});
|
|
1088330
1088571
|
}
|
|
1088331
|
-
|
|
1088332
|
-
...children2.map((child) => {
|
|
1088333
|
-
if (child.type === "apiPackage") {
|
|
1088334
|
-
const subpackageId = __privateGet(this, _nodeIdToSubpackageId).get(child.id);
|
|
1088335
|
-
const newChildren = __privateMethod(this, _convertApiDefinitionPackage, convertApiDefinitionPackage_fn).call(this, subpackageId, child.children, parentSlug.set(child.slug), idgen.append(subpackageId ?? kebabCase_default2(child.title)));
|
|
1088336
|
-
return {
|
|
1088337
|
-
...child,
|
|
1088338
|
-
children: newChildren,
|
|
1088339
|
-
pointsTo: navigation_exports2.utils.followRedirects(newChildren)
|
|
1088340
|
-
};
|
|
1088341
|
-
}
|
|
1088342
|
-
return child;
|
|
1088343
|
-
}),
|
|
1088344
|
-
...additionalChildren
|
|
1088345
|
-
];
|
|
1088346
|
-
toRet = this.mergeEndpointPairs(toRet, idgen);
|
|
1088347
|
-
return toRet.filter((child) => child.type === "apiPackage" ? child.children.length > 0 : true);
|
|
1088572
|
+
return additionalChildren;
|
|
1088348
1088573
|
};
|
|
1088349
|
-
|
|
1088350
|
-
|
|
1088351
|
-
|
|
1088352
|
-
|
|
1088353
|
-
|
|
1088354
|
-
|
|
1088355
|
-
const subpackageId = ApiDefinitionHolder2.getSubpackageId(subpackage);
|
|
1088356
|
-
const subpackageNodeId = idgen.append(subpackageId);
|
|
1088357
|
-
if (__privateGet(this, _visitedSubpackages2).has(subpackageId)) {
|
|
1088358
|
-
this.taskContext.logger.error(`Duplicate subpackage found in the API Reference layout: ${subpackageId}`);
|
|
1088359
|
-
}
|
|
1088360
|
-
__privateGet(this, _visitedSubpackages2).add(subpackageId);
|
|
1088361
|
-
__privateGet(this, _nodeIdToSubpackageId).set(subpackageNodeId.get(), subpackageId);
|
|
1088362
|
-
const urlSlug = isSubpackage2(subpackage) ? subpackage.urlSlug : "";
|
|
1088363
|
-
const slug = parentSlug.apply({ urlSlug });
|
|
1088364
|
-
return {
|
|
1088365
|
-
id: subpackageNodeId.get(),
|
|
1088366
|
-
type: "apiPackage",
|
|
1088367
|
-
children: [],
|
|
1088368
|
-
title: isSubpackage2(subpackage) ? subpackage.displayName ?? titleCase(subpackage.name) : this.apiSection.title,
|
|
1088369
|
-
slug: slug.get(),
|
|
1088370
|
-
icon: void 0,
|
|
1088371
|
-
hidden: void 0,
|
|
1088372
|
-
overviewPageId: void 0,
|
|
1088373
|
-
availability: void 0,
|
|
1088374
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
1088375
|
-
pointsTo: void 0
|
|
1088376
|
-
};
|
|
1088377
|
-
}
|
|
1088378
|
-
const endpoint = (apiDefinitionPackageId != null ? (_a5 = __privateGet(this, _holder2).subpackages.get(apiDefinitionPackageId)) == null ? void 0 : _a5.endpoints.get(unknownIdentifier) : void 0) ?? __privateGet(this, _holder2).endpointsByLocator.get(unknownIdentifier);
|
|
1088379
|
-
if (endpoint != null) {
|
|
1088380
|
-
const endpointId = __privateGet(this, _holder2).getEndpointId(endpoint);
|
|
1088381
|
-
if (endpointId == null) {
|
|
1088382
|
-
throw new Error(`Expected Endpoint ID for ${endpoint.id}. Got undefined.`);
|
|
1088383
|
-
}
|
|
1088384
|
-
if (__privateGet(this, _visitedEndpoints2).has(endpointId)) {
|
|
1088385
|
-
this.taskContext.logger.error(`Duplicate endpoint found in the API Reference layout: ${endpointId}`);
|
|
1088386
|
-
}
|
|
1088387
|
-
__privateGet(this, _visitedEndpoints2).add(endpointId);
|
|
1088388
|
-
return {
|
|
1088389
|
-
id: idgen.append(endpoint.id).get(),
|
|
1088390
|
-
type: "endpoint",
|
|
1088391
|
-
method: endpoint.method,
|
|
1088392
|
-
endpointId,
|
|
1088393
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
1088394
|
-
availability: navigation_exports2.utils.convertAvailability(endpoint.availability),
|
|
1088395
|
-
isResponseStream: ((_b4 = endpoint.response) == null ? void 0 : _b4.type.type) === "stream",
|
|
1088396
|
-
title: endpoint.name ?? stringifyEndpointPathParts2(endpoint.path.parts),
|
|
1088397
|
-
slug: parentSlug.apply(endpoint).get(),
|
|
1088398
|
-
icon: void 0,
|
|
1088399
|
-
hidden: void 0
|
|
1088400
|
-
};
|
|
1088401
|
-
}
|
|
1088402
|
-
const webSocket = (apiDefinitionPackageId != null ? (_c4 = __privateGet(this, _holder2).subpackages.get(apiDefinitionPackageId)) == null ? void 0 : _c4.webSockets.get(unknownIdentifier) : void 0) ?? __privateGet(this, _holder2).webSocketsByLocator.get(unknownIdentifier);
|
|
1088403
|
-
if (webSocket != null) {
|
|
1088404
|
-
const webSocketId = __privateGet(this, _holder2).getWebSocketId(webSocket);
|
|
1088405
|
-
if (webSocketId == null) {
|
|
1088406
|
-
throw new Error(`Expected WebSocket ID for ${webSocket.id}. Got undefined.`);
|
|
1088407
|
-
}
|
|
1088408
|
-
if (__privateGet(this, _visitedWebSockets2).has(webSocketId)) {
|
|
1088409
|
-
this.taskContext.logger.error(`Duplicate web socket found in the API Reference layout: ${webSocketId}`);
|
|
1088410
|
-
}
|
|
1088411
|
-
__privateGet(this, _visitedWebSockets2).add(webSocketId);
|
|
1088412
|
-
return {
|
|
1088413
|
-
id: idgen.append(webSocket.id).get(),
|
|
1088414
|
-
type: "webSocket",
|
|
1088415
|
-
webSocketId,
|
|
1088416
|
-
title: webSocket.name ?? stringifyEndpointPathParts2(webSocket.path.parts),
|
|
1088417
|
-
slug: parentSlug.apply(webSocket).get(),
|
|
1088418
|
-
icon: void 0,
|
|
1088419
|
-
hidden: void 0,
|
|
1088420
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
1088421
|
-
availability: navigation_exports2.utils.convertAvailability(webSocket.availability)
|
|
1088422
|
-
};
|
|
1088423
|
-
}
|
|
1088424
|
-
const webhook = (apiDefinitionPackageId != null ? (_d2 = __privateGet(this, _holder2).subpackages.get(apiDefinitionPackageId)) == null ? void 0 : _d2.webhooks.get(unknownIdentifier) : void 0) ?? __privateGet(this, _holder2).webhooks.get(navigation_exports2.WebhookId(unknownIdentifier));
|
|
1088425
|
-
if (webhook != null) {
|
|
1088426
|
-
const webhookId = __privateGet(this, _holder2).getWebhookId(webhook);
|
|
1088427
|
-
if (webhookId == null) {
|
|
1088428
|
-
throw new Error(`Expected Webhook ID for ${webhook.id}. Got undefined.`);
|
|
1088429
|
-
}
|
|
1088430
|
-
if (__privateGet(this, _visitedWebhooks2).has(webhookId)) {
|
|
1088431
|
-
this.taskContext.logger.error(`Duplicate webhook found in the API Reference layout: ${webhookId}`);
|
|
1088432
|
-
}
|
|
1088433
|
-
__privateGet(this, _visitedWebhooks2).add(webhookId);
|
|
1088434
|
-
return {
|
|
1088435
|
-
id: idgen.append(webhook.id).get(),
|
|
1088436
|
-
type: "webhook",
|
|
1088437
|
-
webhookId,
|
|
1088438
|
-
method: webhook.method,
|
|
1088439
|
-
title: webhook.name ?? urlJoin22("/", ...webhook.path),
|
|
1088440
|
-
slug: parentSlug.apply(webhook).get(),
|
|
1088441
|
-
icon: void 0,
|
|
1088442
|
-
hidden: void 0,
|
|
1088443
|
-
apiDefinitionId: this.apiDefinitionId,
|
|
1088444
|
-
availability: void 0
|
|
1088445
|
-
};
|
|
1088574
|
+
_convertApiDefinitionPackageId = new WeakSet();
|
|
1088575
|
+
convertApiDefinitionPackageId_fn = function(packageId, parentSlug, idgen) {
|
|
1088576
|
+
const pkg2 = packageId != null ? __privateGet(this, _holder2).resolveSubpackage(__privateGet(this, _holder2).getSubpackage(packageId)) : void 0;
|
|
1088577
|
+
if (pkg2 == null) {
|
|
1088578
|
+
this.taskContext.logger.error(`Subpackage ${packageId} not found in ${this.apiDefinitionId}`);
|
|
1088579
|
+
return [];
|
|
1088446
1088580
|
}
|
|
1088447
|
-
this.
|
|
1088448
|
-
return;
|
|
1088581
|
+
return __privateMethod(this, _convertApiDefinitionPackage, convertApiDefinitionPackage_fn).call(this, pkg2, parentSlug, idgen);
|
|
1088449
1088582
|
};
|
|
1088450
1088583
|
|
|
1088451
1088584
|
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/utils/convertDocsSnippetsConfigToFdr.js
|