@salesforcedevs/docs-components 1.14.6-loader → 1.14.8-alpha2
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/package.json
CHANGED
|
@@ -38,9 +38,11 @@ export class FetchContent {
|
|
|
38
38
|
pdf_url,
|
|
39
39
|
deliverable
|
|
40
40
|
} = await this.fetchResource<ApiDocData>(
|
|
41
|
-
|
|
41
|
+
`/cx-router/dsc/toc?projectId=sfdocs-asl_dev_guide&projectVersion=254-7-dev&locale=en-us`
|
|
42
42
|
);
|
|
43
43
|
|
|
44
|
+
console.log(docId);
|
|
45
|
+
|
|
44
46
|
const { normalizedToc, tocMap } = this.normalizeToc(toc);
|
|
45
47
|
return {
|
|
46
48
|
availableLanguages:
|
|
@@ -70,26 +72,24 @@ export class FetchContent {
|
|
|
70
72
|
deliverable: string,
|
|
71
73
|
contentId: string,
|
|
72
74
|
options: ContentApiOptions
|
|
73
|
-
): Promise<
|
|
74
|
-
return this.fetchResource<ContentData>(
|
|
75
|
-
|
|
75
|
+
): Promise<String> {
|
|
76
|
+
return await this.fetchResource<ContentData>(
|
|
77
|
+
`/cx-router/dsc/topic?projectId=sfdocs-asl_dev_guide&projectVersion=254-7-dev&locale=en-us&topic=${contentId}`
|
|
76
78
|
);
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
private async fetchResource<T>(url: string): Promise<T> {
|
|
80
82
|
const response = await fetch(url);
|
|
81
|
-
if (!response.ok) {
|
|
83
|
+
/*if (!response.ok) {
|
|
82
84
|
throw new Error(response.statusText);
|
|
83
|
-
}
|
|
85
|
+
}*/
|
|
84
86
|
|
|
85
87
|
const json = await response.json();
|
|
86
88
|
|
|
87
|
-
return json;
|
|
89
|
+
return json.response;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
private normalizeToc(
|
|
91
|
-
apiToc: Array<ApiNavItem>
|
|
92
|
-
): {
|
|
92
|
+
private normalizeToc(apiToc: Array<ApiNavItem>): {
|
|
93
93
|
tocMap: { [key: string]: TreeNode };
|
|
94
94
|
normalizedToc: Array<TreeNode>;
|
|
95
95
|
} {
|