@c8y/api-doc 1023.88.4 → 1023.92.0
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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c8y/api-doc",
|
|
3
|
-
"version": "1023.
|
|
3
|
+
"version": "1023.92.0",
|
|
4
4
|
"description": "This package is a blueprint application which allows to show all API documentations of the platform.",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@angular/animations": "^20.3.24",
|
|
7
7
|
"@angular/cdk": "^20.2.14",
|
|
8
|
-
"@c8y/bootstrap": "1023.
|
|
9
|
-
"@c8y/client": "1023.
|
|
10
|
-
"@c8y/ngx-components": "1023.
|
|
11
|
-
"@c8y/style": "1023.
|
|
8
|
+
"@c8y/bootstrap": "1023.92.0",
|
|
9
|
+
"@c8y/client": "1023.92.0",
|
|
10
|
+
"@c8y/ngx-components": "1023.92.0",
|
|
11
|
+
"@c8y/style": "1023.92.0",
|
|
12
12
|
"lodash": "^4.18.1",
|
|
13
13
|
"monaco-editor": "~0.53.0",
|
|
14
14
|
"ngx-bootstrap": "20.0.2",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"enabled": false
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@c8y/devkit": "1023.
|
|
23
|
-
"@c8y/options": "1023.
|
|
22
|
+
"@c8y/devkit": "1023.92.0",
|
|
23
|
+
"@c8y/options": "1023.92.0",
|
|
24
24
|
"@types/lodash": "4.17.24"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { hookNavigator, hookRoute } from '@c8y/ngx-components';
|
|
2
2
|
import { ApiDocNavigatorFactory } from './api-doc-navigator.factory';
|
|
3
|
+
import { ApiDocService } from './api-doc.service';
|
|
3
4
|
|
|
4
5
|
export const apiDocProviders = [
|
|
6
|
+
ApiDocService,
|
|
5
7
|
hookRoute([
|
|
6
8
|
{
|
|
7
9
|
path: 'api-docs',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, Injectable } from '@angular/core';
|
|
2
2
|
import { ApplicationService } from '@c8y/client';
|
|
3
|
-
import { AppStateService, HumanizeAppNamePipe } from '@c8y/ngx-components';
|
|
3
|
+
import { AppStateService, C8Y_PLUGIN_CONTEXT_PATH, HumanizeAppNamePipe } from '@c8y/ngx-components';
|
|
4
4
|
import {
|
|
5
5
|
combineLatest,
|
|
6
6
|
distinctUntilChanged,
|
|
@@ -17,14 +17,13 @@ import { ApiDocApp } from './api-doc-app.model';
|
|
|
17
17
|
import { sortBy } from 'lodash';
|
|
18
18
|
import { gettext } from '@c8y/ngx-components/gettext';
|
|
19
19
|
|
|
20
|
-
@Injectable(
|
|
21
|
-
providedIn: 'root'
|
|
22
|
-
})
|
|
20
|
+
@Injectable()
|
|
23
21
|
export class ApiDocService {
|
|
24
22
|
private appService = inject(ApplicationService);
|
|
25
23
|
private appStateService = inject(AppStateService);
|
|
26
24
|
private humanize = inject(HumanizeAppNamePipe);
|
|
27
25
|
private cache$: Observable<ApiDocApp[]> | null = null;
|
|
26
|
+
private pluginContextPath = inject(C8Y_PLUGIN_CONTEXT_PATH);
|
|
28
27
|
|
|
29
28
|
private readonly CORE_API_DOCS_APP: ApiDocApp = {
|
|
30
29
|
id: 'core-api',
|
|
@@ -59,16 +58,13 @@ export class ApiDocService {
|
|
|
59
58
|
)
|
|
60
59
|
)
|
|
61
60
|
);
|
|
62
|
-
this.cache$ = combineLatest([
|
|
63
|
-
|
|
64
|
-
this.appStateService.currentApplication,
|
|
65
|
-
this.appStateService.currentTenant
|
|
66
|
-
]).pipe(
|
|
67
|
-
map(([apps, currentApp, currentTenant]) => {
|
|
61
|
+
this.cache$ = combineLatest([appsOfCurrentUser$, this.appStateService.currentTenant]).pipe(
|
|
62
|
+
map(([apps, currentTenant]) => {
|
|
68
63
|
// Update coreApiDocApps with current app's contextPath
|
|
69
64
|
const coreApiDoc: ApiDocApp = {
|
|
70
65
|
...this.CORE_API_DOCS_APP,
|
|
71
|
-
contextPath:
|
|
66
|
+
contextPath: this.pluginContextPath,
|
|
67
|
+
downloadPath: `/apps/${this.pluginContextPath}/c8y-oas.yml`
|
|
72
68
|
};
|
|
73
69
|
|
|
74
70
|
// Filter apps with openApiSpec
|