fern-api 0.30.8-rc3 → 0.30.8-rc4
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 +155 -98
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -22232,7 +22232,8 @@ var init_ApiNavigationItem = __esm({
|
|
|
22232
22232
|
schemas_exports.record(schemas_exports.string(), schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiNavigationItems)),
|
|
22233
22233
|
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).PageConfiguration),
|
|
22234
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))).
|
|
22235
|
+
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferenceSectionConfiguration),
|
|
22236
|
+
schemas_exports.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiReferencePackageConfiguration)
|
|
22236
22237
|
]);
|
|
22237
22238
|
}
|
|
22238
22239
|
});
|
|
@@ -22249,14 +22250,31 @@ var init_SubpackageOrSubpackages = __esm({
|
|
|
22249
22250
|
}
|
|
22250
22251
|
});
|
|
22251
22252
|
|
|
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/
|
|
22253
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceSectionConfiguration.js
|
|
22254
|
+
var ApiReferenceSectionConfiguration;
|
|
22255
|
+
var init_ApiReferenceSectionConfiguration = __esm({
|
|
22256
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferenceSectionConfiguration.js"() {
|
|
22256
22257
|
init_core();
|
|
22257
|
-
|
|
22258
|
+
ApiReferenceSectionConfiguration = schemas_exports.object({
|
|
22259
|
+
section: schemas_exports.string(),
|
|
22260
|
+
package: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).SubpackageOrSubpackages).optional(),
|
|
22261
|
+
summary: schemas_exports.string().optional(),
|
|
22262
|
+
contents: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiNavigationItems),
|
|
22263
|
+
slug: schemas_exports.string().optional(),
|
|
22264
|
+
icon: schemas_exports.string().optional(),
|
|
22265
|
+
hidden: schemas_exports.boolean().optional(),
|
|
22266
|
+
skipSlug: schemas_exports.property("skip-slug", schemas_exports.boolean().optional())
|
|
22267
|
+
});
|
|
22268
|
+
}
|
|
22269
|
+
});
|
|
22270
|
+
|
|
22271
|
+
// pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferencePackageConfiguration.js
|
|
22272
|
+
var ApiReferencePackageConfiguration;
|
|
22273
|
+
var init_ApiReferencePackageConfiguration = __esm({
|
|
22274
|
+
"pnp:/home/circleci/project/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/ApiReferencePackageConfiguration.js"() {
|
|
22275
|
+
init_core();
|
|
22276
|
+
ApiReferencePackageConfiguration = schemas_exports.object({
|
|
22258
22277
|
package: schemas_exports.string(),
|
|
22259
|
-
subpackage: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).SubpackageOrSubpackages).optional(),
|
|
22260
22278
|
summary: schemas_exports.string().optional(),
|
|
22261
22279
|
contents: schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ApiNavigationItems),
|
|
22262
22280
|
slug: schemas_exports.string().optional(),
|
|
@@ -22612,7 +22630,8 @@ var init_types = __esm({
|
|
|
22612
22630
|
init_ApiSectionConfiguration();
|
|
22613
22631
|
init_ApiNavigationItem();
|
|
22614
22632
|
init_SubpackageOrSubpackages();
|
|
22615
|
-
|
|
22633
|
+
init_ApiReferenceSectionConfiguration();
|
|
22634
|
+
init_ApiReferencePackageConfiguration();
|
|
22616
22635
|
init_ApiNavigationItems();
|
|
22617
22636
|
init_LinkConfiguration();
|
|
22618
22637
|
init_VersionedSnippetLanguageConfiguration();
|
|
@@ -22644,7 +22663,8 @@ var docs_exports3 = {};
|
|
|
22644
22663
|
__export(docs_exports3, {
|
|
22645
22664
|
ApiNavigationItem: () => ApiNavigationItem,
|
|
22646
22665
|
ApiNavigationItems: () => ApiNavigationItems,
|
|
22647
|
-
|
|
22666
|
+
ApiReferencePackageConfiguration: () => ApiReferencePackageConfiguration,
|
|
22667
|
+
ApiReferenceSectionConfiguration: () => ApiReferenceSectionConfiguration,
|
|
22648
22668
|
ApiSectionConfiguration: () => ApiSectionConfiguration,
|
|
22649
22669
|
AudiencesConfig: () => AudiencesConfig,
|
|
22650
22670
|
BackgroundImageConfiguration: () => BackgroundImageConfiguration,
|
|
@@ -22720,7 +22740,8 @@ var serialization_exports = {};
|
|
|
22720
22740
|
__export(serialization_exports, {
|
|
22721
22741
|
ApiNavigationItem: () => ApiNavigationItem,
|
|
22722
22742
|
ApiNavigationItems: () => ApiNavigationItems,
|
|
22723
|
-
|
|
22743
|
+
ApiReferencePackageConfiguration: () => ApiReferencePackageConfiguration,
|
|
22744
|
+
ApiReferenceSectionConfiguration: () => ApiReferenceSectionConfiguration,
|
|
22724
22745
|
ApiSectionConfiguration: () => ApiSectionConfiguration,
|
|
22725
22746
|
AudiencesConfig: () => AudiencesConfig,
|
|
22726
22747
|
BackgroundImageConfiguration: () => BackgroundImageConfiguration,
|
|
@@ -1050256,12 +1050277,25 @@ function parseApiNavigationItem(item, absolutePathToConfig) {
|
|
|
1050256
1050277
|
icon: item.icon
|
|
1050257
1050278
|
}
|
|
1050258
1050279
|
];
|
|
1050259
|
-
} else if (
|
|
1050280
|
+
} else if (isRawApiRefSectionConfiguration(item)) {
|
|
1050281
|
+
return [
|
|
1050282
|
+
{
|
|
1050283
|
+
type: "section",
|
|
1050284
|
+
section: item.section,
|
|
1050285
|
+
subpackages: typeof item.package === "string" ? [item.package] : item.package ?? [],
|
|
1050286
|
+
summaryAbsolutePath: resolveFilepath(item.summary, absolutePathToConfig),
|
|
1050287
|
+
contents: item.contents.flatMap((value) => parseApiNavigationItem(value, absolutePathToConfig)),
|
|
1050288
|
+
slug: item.slug,
|
|
1050289
|
+
hidden: item.hidden,
|
|
1050290
|
+
skipUrlSlug: item.skipSlug,
|
|
1050291
|
+
icon: item.icon
|
|
1050292
|
+
}
|
|
1050293
|
+
];
|
|
1050294
|
+
} else if (isRawApiRefPackageConfiguration(item)) {
|
|
1050260
1050295
|
return [
|
|
1050261
1050296
|
{
|
|
1050262
1050297
|
type: "package",
|
|
1050263
1050298
|
package: item.package,
|
|
1050264
|
-
subpackages: typeof item.subpackage === "string" ? [item.subpackage] : item.subpackage ?? [],
|
|
1050265
1050299
|
summaryAbsolutePath: resolveFilepath(item.summary, absolutePathToConfig),
|
|
1050266
1050300
|
contents: item.contents.flatMap((value) => parseApiNavigationItem(value, absolutePathToConfig)),
|
|
1050267
1050301
|
slug: item.slug,
|
|
@@ -1050274,7 +1050308,6 @@ function parseApiNavigationItem(item, absolutePathToConfig) {
|
|
|
1050274
1050308
|
return Object.entries(item).map(([key2, values3]) => ({
|
|
1050275
1050309
|
type: "package",
|
|
1050276
1050310
|
package: key2,
|
|
1050277
|
-
subpackages: [],
|
|
1050278
1050311
|
summaryAbsolutePath: void 0,
|
|
1050279
1050312
|
contents: values3.flatMap((value) => parseApiNavigationItem(value, absolutePathToConfig)),
|
|
1050280
1050313
|
hidden: false,
|
|
@@ -1050303,8 +1050336,11 @@ function isRawApiSectionConfig(item) {
|
|
|
1050303
1050336
|
function isRawLinkConfig(item) {
|
|
1050304
1050337
|
return isPlainObject(item) && typeof item.link === "string" && typeof item.href === "string";
|
|
1050305
1050338
|
}
|
|
1050306
|
-
function
|
|
1050307
|
-
return isPlainObject(item) && typeof item.
|
|
1050339
|
+
function isRawApiRefSectionConfiguration(item) {
|
|
1050340
|
+
return isPlainObject(item) && typeof item.section === "string" && Array.isArray(item.contents);
|
|
1050341
|
+
}
|
|
1050342
|
+
function isRawApiRefPackageConfiguration(item) {
|
|
1050343
|
+
return isPlainObject(item) && item.section == null && typeof item.package === "string" && Array.isArray(item.contents);
|
|
1050308
1050344
|
}
|
|
1050309
1050345
|
function resolveFilepath(unresolvedFilepath, absoluteFilepathToDocsConfig) {
|
|
1050310
1050346
|
if (unresolvedFilepath == null) {
|
|
@@ -1054306,7 +1054342,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1054306
1054342
|
properties: {
|
|
1054307
1054343
|
...event,
|
|
1054308
1054344
|
...event.properties,
|
|
1054309
|
-
version: "0.30.8-
|
|
1054345
|
+
version: "0.30.8-rc4",
|
|
1054310
1054346
|
usingAccessToken: true
|
|
1054311
1054347
|
}
|
|
1054312
1054348
|
});
|
|
@@ -1054368,7 +1054404,7 @@ var UserPosthogManager = class {
|
|
|
1054368
1054404
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1054369
1054405
|
event: "CLI",
|
|
1054370
1054406
|
properties: {
|
|
1054371
|
-
version: "0.30.8-
|
|
1054407
|
+
version: "0.30.8-rc4",
|
|
1054372
1054408
|
...event,
|
|
1054373
1054409
|
...event.properties
|
|
1054374
1054410
|
}
|
|
@@ -1080311,10 +1080347,10 @@ var CliContext = class {
|
|
|
1080311
1080347
|
return "fern-api";
|
|
1080312
1080348
|
}
|
|
1080313
1080349
|
getPackageVersion() {
|
|
1080314
|
-
if ("0.30.8-
|
|
1080350
|
+
if ("0.30.8-rc4" == null) {
|
|
1080315
1080351
|
this.logger.error("CLI_VERSION is not defined");
|
|
1080316
1080352
|
}
|
|
1080317
|
-
return "0.30.8-
|
|
1080353
|
+
return "0.30.8-rc4";
|
|
1080318
1080354
|
}
|
|
1080319
1080355
|
getCliName() {
|
|
1080320
1080356
|
if ("fern" == null) {
|
|
@@ -1087624,9 +1087660,10 @@ function stringifyEndpointPathParts22(path42) {
|
|
|
1087624
1087660
|
var ROOT_PACKAGE_ID = "root";
|
|
1087625
1087661
|
var _endpoints2, _webSockets2, _webhooks2, _endpointsInverted, _webSocketsInverted, _webhooksInverted, _subpackages, _endpointsByLocator, _webSocketsByLocator, _webhooksByLocator, _subpackagesByLocator, _constructSubpackageLocators, constructSubpackageLocators_fn;
|
|
1087626
1087662
|
var _ApiDefinitionHolder2 = class {
|
|
1087627
|
-
constructor(api) {
|
|
1087663
|
+
constructor(api, context) {
|
|
1087628
1087664
|
__privateAdd(this, _constructSubpackageLocators);
|
|
1087629
1087665
|
__publicField(this, "api");
|
|
1087666
|
+
__publicField(this, "context");
|
|
1087630
1087667
|
__privateAdd(this, _endpoints2, /* @__PURE__ */ new Map());
|
|
1087631
1087668
|
__privateAdd(this, _webSockets2, /* @__PURE__ */ new Map());
|
|
1087632
1087669
|
__privateAdd(this, _webhooks2, /* @__PURE__ */ new Map());
|
|
@@ -1087639,6 +1087676,7 @@ var _ApiDefinitionHolder2 = class {
|
|
|
1087639
1087676
|
__privateAdd(this, _webhooksByLocator, /* @__PURE__ */ new Map());
|
|
1087640
1087677
|
__privateAdd(this, _subpackagesByLocator, /* @__PURE__ */ new Map());
|
|
1087641
1087678
|
this.api = api;
|
|
1087679
|
+
this.context = context;
|
|
1087642
1087680
|
[api.rootPackage, ...Object.values(api.subpackages)].forEach((pkg2) => {
|
|
1087643
1087681
|
const subpackageId = _ApiDefinitionHolder2.getSubpackageId(pkg2);
|
|
1087644
1087682
|
const subpackageHolder = {
|
|
@@ -1087648,50 +1087686,69 @@ var _ApiDefinitionHolder2 = class {
|
|
|
1087648
1087686
|
};
|
|
1087649
1087687
|
__privateGet(this, _subpackages).set(subpackageId, subpackageHolder);
|
|
1087650
1087688
|
pkg2.endpoints.forEach((endpoint) => {
|
|
1087689
|
+
var _a5;
|
|
1087651
1087690
|
subpackageHolder.endpoints.set(endpoint.id, endpoint);
|
|
1087652
1087691
|
const endpointId = _ApiDefinitionHolder2.createEndpointId(endpoint, subpackageId);
|
|
1087653
1087692
|
__privateGet(this, _endpoints2).set(endpointId, endpoint);
|
|
1087654
|
-
|
|
1087655
|
-
|
|
1087656
|
-
|
|
1087657
|
-
|
|
1087658
|
-
}
|
|
1087659
|
-
|
|
1087660
|
-
|
|
1087661
|
-
|
|
1087662
|
-
|
|
1087663
|
-
|
|
1087664
|
-
|
|
1087665
|
-
|
|
1087666
|
-
|
|
1087667
|
-
|
|
1087668
|
-
|
|
1087693
|
+
const locators = [];
|
|
1087694
|
+
const methods = [endpoint.method];
|
|
1087695
|
+
if (((_a5 = endpoint.response) == null ? void 0 : _a5.type.type) === "stream") {
|
|
1087696
|
+
methods.push("STREAM");
|
|
1087697
|
+
}
|
|
1087698
|
+
methods.forEach((method2) => {
|
|
1087699
|
+
locators.push(`${method2} ${stringifyEndpointPathParts2(endpoint.path.parts)}`);
|
|
1087700
|
+
locators.push(`${method2} ${stringifyEndpointPathParts22(endpoint.path.parts)}`);
|
|
1087701
|
+
endpoint.environments.forEach((environment) => {
|
|
1087702
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts2(endpoint.path.parts))}`);
|
|
1087703
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts22(endpoint.path.parts))}`);
|
|
1087704
|
+
const basePath = getBasePath(environment);
|
|
1087705
|
+
if (basePath != null) {
|
|
1087706
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts2(endpoint.path.parts))}`);
|
|
1087707
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts22(endpoint.path.parts))}`);
|
|
1087708
|
+
}
|
|
1087709
|
+
});
|
|
1087710
|
+
});
|
|
1087711
|
+
locators.forEach((locator) => {
|
|
1087712
|
+
var _a6;
|
|
1087713
|
+
(_a6 = this.context) == null ? void 0 : _a6.logger.debug(`Registering endpoint locator: ${locator}`);
|
|
1087714
|
+
__privateGet(this, _endpointsByLocator).set(locator, endpoint);
|
|
1087669
1087715
|
});
|
|
1087670
1087716
|
});
|
|
1087671
1087717
|
pkg2.websockets.forEach((webSocket) => {
|
|
1087672
1087718
|
subpackageHolder.webSockets.set(webSocket.id, webSocket);
|
|
1087673
1087719
|
const webSocketId = _ApiDefinitionHolder2.createWebSocketId(webSocket, subpackageId);
|
|
1087674
1087720
|
__privateGet(this, _webSockets2).set(webSocketId, webSocket);
|
|
1087675
|
-
|
|
1087676
|
-
|
|
1087677
|
-
|
|
1087678
|
-
|
|
1087679
|
-
|
|
1087680
|
-
|
|
1087681
|
-
|
|
1087682
|
-
|
|
1087683
|
-
|
|
1087684
|
-
|
|
1087685
|
-
|
|
1087686
|
-
|
|
1087687
|
-
|
|
1087688
|
-
|
|
1087689
|
-
|
|
1087721
|
+
const locators = [];
|
|
1087722
|
+
const methods = ["GET", "WSS"];
|
|
1087723
|
+
methods.forEach((method2) => {
|
|
1087724
|
+
locators.push(`${method2} ${stringifyEndpointPathParts2(webSocket.path.parts)}`);
|
|
1087725
|
+
locators.push(`${method2} ${stringifyEndpointPathParts22(webSocket.path.parts)}`);
|
|
1087726
|
+
webSocket.environments.forEach((environment) => {
|
|
1087727
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts2(webSocket.path.parts))}`);
|
|
1087728
|
+
locators.push(`${method2} ${urlJoin22(environment.baseUrl, stringifyEndpointPathParts22(webSocket.path.parts))}`);
|
|
1087729
|
+
const basePath = getBasePath(environment);
|
|
1087730
|
+
if (basePath != null) {
|
|
1087731
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts2(webSocket.path.parts))}`);
|
|
1087732
|
+
locators.push(`${method2} ${urlJoin22(basePath, stringifyEndpointPathParts22(webSocket.path.parts))}`);
|
|
1087733
|
+
}
|
|
1087734
|
+
});
|
|
1087735
|
+
});
|
|
1087736
|
+
locators.forEach((locator) => {
|
|
1087737
|
+
var _a5;
|
|
1087738
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering websocket locator: ${locator}`);
|
|
1087739
|
+
__privateGet(this, _webSocketsByLocator).set(locator, webSocket);
|
|
1087690
1087740
|
});
|
|
1087691
1087741
|
});
|
|
1087692
1087742
|
pkg2.webhooks.forEach((webhook) => {
|
|
1087693
1087743
|
subpackageHolder.webhooks.set(webhook.id, webhook);
|
|
1087694
1087744
|
__privateGet(this, _webhooks2).set(_ApiDefinitionHolder2.createWebhookId(webhook, subpackageId), webhook);
|
|
1087745
|
+
const locators = [];
|
|
1087746
|
+
locators.push(`${webhook.method} ${urlJoin22("/", ...webhook.path)}`);
|
|
1087747
|
+
locators.forEach((locator) => {
|
|
1087748
|
+
var _a5;
|
|
1087749
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering webhook locator: ${locator}`);
|
|
1087750
|
+
__privateGet(this, _webhooksByLocator).set(locator, webhook);
|
|
1087751
|
+
});
|
|
1087695
1087752
|
});
|
|
1087696
1087753
|
});
|
|
1087697
1087754
|
__privateGet(this, _endpoints2).forEach((endpoint, endpointId) => {
|
|
@@ -1087705,8 +1087762,8 @@ var _ApiDefinitionHolder2 = class {
|
|
|
1087705
1087762
|
});
|
|
1087706
1087763
|
__privateMethod(this, _constructSubpackageLocators, constructSubpackageLocators_fn).call(this, api.rootPackage, []);
|
|
1087707
1087764
|
}
|
|
1087708
|
-
static create(api) {
|
|
1087709
|
-
return new _ApiDefinitionHolder2(api);
|
|
1087765
|
+
static create(api, context) {
|
|
1087766
|
+
return new _ApiDefinitionHolder2(api, context);
|
|
1087710
1087767
|
}
|
|
1087711
1087768
|
static getSubpackageId(pkg2) {
|
|
1087712
1087769
|
return isSubpackage2(pkg2) ? pkg2.subpackageId : ROOT_PACKAGE_ID;
|
|
@@ -1087792,15 +1087849,21 @@ constructSubpackageLocators_fn = function(pkg2, parents) {
|
|
|
1087792
1087849
|
return __privateMethod(this, _constructSubpackageLocators, constructSubpackageLocators_fn).call(this, this.api.subpackages[pkg2.pointsTo], packageList);
|
|
1087793
1087850
|
}
|
|
1087794
1087851
|
pkg2.endpoints.forEach((endpoint) => {
|
|
1087852
|
+
var _a5;
|
|
1087795
1087853
|
const locator = [...packageList, endpoint.id].join(".");
|
|
1087854
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering endpoint locator: ${locator}`);
|
|
1087796
1087855
|
__privateGet(this, _endpointsByLocator).set(locator, endpoint);
|
|
1087797
1087856
|
});
|
|
1087798
1087857
|
pkg2.websockets.forEach((webSocket) => {
|
|
1087858
|
+
var _a5;
|
|
1087799
1087859
|
const locator = [...packageList, webSocket.id].join(".");
|
|
1087860
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering websocket locator: ${locator}`);
|
|
1087800
1087861
|
__privateGet(this, _webSocketsByLocator).set(locator, webSocket);
|
|
1087801
1087862
|
});
|
|
1087802
1087863
|
pkg2.webhooks.forEach((webhook) => {
|
|
1087864
|
+
var _a5;
|
|
1087803
1087865
|
const locator = [...packageList, webhook.id].join(".");
|
|
1087866
|
+
(_a5 = this.context) == null ? void 0 : _a5.logger.debug(`Registering webhook locator: ${locator}`);
|
|
1087804
1087867
|
__privateGet(this, _webhooksByLocator).set(locator, webhook);
|
|
1087805
1087868
|
});
|
|
1087806
1087869
|
pkg2.subpackages.forEach((subpackageId) => {
|
|
@@ -1087989,11 +1088052,12 @@ var NodeIdGenerator2 = class {
|
|
|
1087989
1088052
|
};
|
|
1087990
1088053
|
|
|
1087991
1088054
|
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/ApiReferenceNodeConverter.js
|
|
1087992
|
-
var _holder2, _visitedEndpoints2, _visitedWebSockets2, _visitedWebhooks2, _visitedSubpackages2, _nodeIdToSubpackageId, _children, _overviewPageId, _slug, _convertApiNavigationItems, convertApiNavigationItems_fn, _convertPackage, convertPackage_fn, _convertApiDefinitionPackage, convertApiDefinitionPackage_fn, _convertUnknownIdentifier, convertUnknownIdentifier_fn;
|
|
1088055
|
+
var _holder2, _visitedEndpoints2, _visitedWebSockets2, _visitedWebhooks2, _visitedSubpackages2, _nodeIdToSubpackageId, _children, _overviewPageId, _slug, _convertApiNavigationItems, convertApiNavigationItems_fn, _convertPackage, convertPackage_fn, _convertSection, convertSection_fn, _convertApiDefinitionPackage, convertApiDefinitionPackage_fn, _convertUnknownIdentifier, convertUnknownIdentifier_fn;
|
|
1087993
1088056
|
var ApiReferenceNodeConverter = class {
|
|
1087994
1088057
|
constructor(apiSection, api, parentSlug, workspace, docsWorkspace, taskContext, markdownFilesToFullSlugs) {
|
|
1087995
1088058
|
__privateAdd(this, _convertApiNavigationItems);
|
|
1087996
1088059
|
__privateAdd(this, _convertPackage);
|
|
1088060
|
+
__privateAdd(this, _convertSection);
|
|
1087997
1088061
|
__privateAdd(this, _convertApiDefinitionPackage);
|
|
1087998
1088062
|
__privateAdd(this, _convertUnknownIdentifier);
|
|
1087999
1088063
|
__publicField(this, "apiSection");
|
|
@@ -1088017,7 +1088081,7 @@ var ApiReferenceNodeConverter = class {
|
|
|
1088017
1088081
|
this.taskContext = taskContext;
|
|
1088018
1088082
|
this.markdownFilesToFullSlugs = markdownFilesToFullSlugs;
|
|
1088019
1088083
|
this.apiDefinitionId = navigation_exports2.ApiDefinitionId(api.id);
|
|
1088020
|
-
__privateSet(this, _holder2, ApiDefinitionHolder2.create(api));
|
|
1088084
|
+
__privateSet(this, _holder2, ApiDefinitionHolder2.create(api, taskContext));
|
|
1088021
1088085
|
const idgen = NodeIdGenerator2.init(this.apiDefinitionId);
|
|
1088022
1088086
|
__privateSet(this, _overviewPageId, this.apiSection.summaryAbsolutePath != null ? navigation_exports2.PageId(this.toRelativeFilepath(this.apiSection.summaryAbsolutePath)) : void 0);
|
|
1088023
1088087
|
const maybeFullSlug = this.apiSection.summaryAbsolutePath != null ? this.markdownFilesToFullSlugs.get(this.apiSection.summaryAbsolutePath) : void 0;
|
|
@@ -1088127,6 +1088191,7 @@ convertApiNavigationItems_fn = function(navigation, apiDefinitionPackage, parent
|
|
|
1088127
1088191
|
};
|
|
1088128
1088192
|
},
|
|
1088129
1088193
|
package: (pkg2) => __privateMethod(this, _convertPackage, convertPackage_fn).call(this, pkg2, parentSlug, idgen),
|
|
1088194
|
+
section: (section) => __privateMethod(this, _convertSection, convertSection_fn).call(this, section, parentSlug, idgen),
|
|
1088130
1088195
|
item: ({ value: unknownIdentifier }) => __privateMethod(this, _convertUnknownIdentifier, convertUnknownIdentifier_fn).call(this, unknownIdentifier, apiDefinitionPackageId, parentSlug, idgen)
|
|
1088131
1088196
|
})).filter(isNonNullish);
|
|
1088132
1088197
|
};
|
|
@@ -1088134,50 +1088199,6 @@ _convertPackage = new WeakSet();
|
|
|
1088134
1088199
|
convertPackage_fn = function(pkg2, parentSlug, idgen) {
|
|
1088135
1088200
|
const overviewPageId = pkg2.summaryAbsolutePath != null ? navigation_exports2.PageId(this.toRelativeFilepath(pkg2.summaryAbsolutePath)) : void 0;
|
|
1088136
1088201
|
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
1088202
|
const subpackage = __privateGet(this, _holder2).getSubpackage(pkg2.package);
|
|
1088182
1088203
|
if (subpackage != null) {
|
|
1088183
1088204
|
const subpackageId = ApiDefinitionHolder2.getSubpackageId(subpackage);
|
|
@@ -1088205,6 +1088226,7 @@ convertPackage_fn = function(pkg2, parentSlug, idgen) {
|
|
|
1088205
1088226
|
pointsTo: void 0
|
|
1088206
1088227
|
};
|
|
1088207
1088228
|
} else {
|
|
1088229
|
+
this.taskContext.logger.error(`Subpackage ${pkg2.package} not found in ${this.apiDefinitionId}`);
|
|
1088208
1088230
|
const urlSlug = pkg2.slug ?? kebabCase_default2(pkg2.package);
|
|
1088209
1088231
|
const slug = parentSlug.apply({
|
|
1088210
1088232
|
fullSlug: maybeFullSlug == null ? void 0 : maybeFullSlug.split("/"),
|
|
@@ -1088227,6 +1088249,41 @@ convertPackage_fn = function(pkg2, parentSlug, idgen) {
|
|
|
1088227
1088249
|
};
|
|
1088228
1088250
|
}
|
|
1088229
1088251
|
};
|
|
1088252
|
+
_convertSection = new WeakSet();
|
|
1088253
|
+
convertSection_fn = function(section, parentSlug, idgen) {
|
|
1088254
|
+
const overviewPageId = section.summaryAbsolutePath != null ? navigation_exports2.PageId(this.toRelativeFilepath(section.summaryAbsolutePath)) : void 0;
|
|
1088255
|
+
const maybeFullSlug = section.summaryAbsolutePath != null ? this.markdownFilesToFullSlugs.get(section.summaryAbsolutePath) : void 0;
|
|
1088256
|
+
const nodeId = idgen.append(`section:${kebabCase_default2(section.section)}`);
|
|
1088257
|
+
section.subpackages.forEach((subpackageId) => {
|
|
1088258
|
+
const subpackage = __privateGet(this, _holder2).getSubpackage(subpackageId);
|
|
1088259
|
+
if (subpackage == null) {
|
|
1088260
|
+
this.taskContext.logger.error(`Subpackage ${subpackageId} not found in ${this.apiDefinitionId}`);
|
|
1088261
|
+
return;
|
|
1088262
|
+
}
|
|
1088263
|
+
__privateGet(this, _visitedSubpackages2).add(subpackageId);
|
|
1088264
|
+
__privateGet(this, _nodeIdToSubpackageId).set(nodeId.get(), subpackageId);
|
|
1088265
|
+
});
|
|
1088266
|
+
const urlSlug = section.slug ?? kebabCase_default2(section.section);
|
|
1088267
|
+
const slug = parentSlug.apply({
|
|
1088268
|
+
fullSlug: maybeFullSlug == null ? void 0 : maybeFullSlug.split("/"),
|
|
1088269
|
+
skipUrlSlug: section.skipUrlSlug,
|
|
1088270
|
+
urlSlug
|
|
1088271
|
+
});
|
|
1088272
|
+
const convertedItems = __privateMethod(this, _convertApiNavigationItems, convertApiNavigationItems_fn).call(this, section.contents, section.subpackages.length === 1 ? __privateGet(this, _holder2).getSubpackage(section.subpackages[0]) : void 0, slug, idgen);
|
|
1088273
|
+
return {
|
|
1088274
|
+
id: nodeId.get(),
|
|
1088275
|
+
type: "apiPackage",
|
|
1088276
|
+
children: convertedItems,
|
|
1088277
|
+
title: section.section,
|
|
1088278
|
+
slug: slug.get(),
|
|
1088279
|
+
icon: section.icon,
|
|
1088280
|
+
hidden: section.hidden,
|
|
1088281
|
+
overviewPageId,
|
|
1088282
|
+
availability: void 0,
|
|
1088283
|
+
apiDefinitionId: this.apiDefinitionId,
|
|
1088284
|
+
pointsTo: void 0
|
|
1088285
|
+
};
|
|
1088286
|
+
};
|
|
1088230
1088287
|
_convertApiDefinitionPackage = new WeakSet();
|
|
1088231
1088288
|
convertApiDefinitionPackage_fn = function(packageId, children2, parentSlug, idgen) {
|
|
1088232
1088289
|
const pkg2 = packageId != null ? __privateGet(this, _holder2).resolveSubpackage(__privateGet(this, _holder2).getSubpackage(packageId)) : void 0;
|