caprover-api 0.0.12 → 0.0.15
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/dist/api/ApiManager.d.ts +2 -1
- package/dist/api/ApiManager.js +4 -3
- package/dist/api/ErrorFactory.d.ts +0 -0
- package/dist/api/ErrorFactory.js +0 -0
- package/dist/api/HttpClient.d.ts +0 -0
- package/dist/api/HttpClient.js +0 -0
- package/dist/example.d.ts +0 -0
- package/dist/example.js +0 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/models/AppDefinition.d.ts +0 -0
- package/dist/models/AppDefinition.js +0 -0
- package/dist/models/AppDefinitionsResponse.d.ts +0 -0
- package/dist/models/AppDefinitionsResponse.js +0 -0
- package/dist/models/AppDeleteResponse.d.ts +0 -0
- package/dist/models/AppDeleteResponse.js +0 -0
- package/dist/models/AutomatedCleanupConfigs.d.ts +0 -0
- package/dist/models/AutomatedCleanupConfigs.js +0 -0
- package/dist/models/BackupMeta.d.ts +0 -0
- package/dist/models/BackupMeta.js +0 -0
- package/dist/models/BuildLogsResponse.d.ts +0 -0
- package/dist/models/BuildLogsResponse.js +0 -0
- package/dist/models/CapRoverTheme.d.ts +0 -0
- package/dist/models/CapRoverTheme.js +0 -0
- package/dist/models/CaptainInfo.d.ts +0 -0
- package/dist/models/CaptainInfo.js +0 -0
- package/dist/models/ContainerProps.d.ts +0 -0
- package/dist/models/ContainerProps.js +0 -0
- package/dist/models/DockerAuthObj.d.ts +0 -0
- package/dist/models/DockerAuthObj.js +0 -0
- package/dist/models/DockerSecret.d.ts +0 -0
- package/dist/models/DockerSecret.js +0 -0
- package/dist/models/DockerService.d.ts +0 -0
- package/dist/models/DockerService.js +0 -0
- package/dist/models/GoAccessInfo.d.ts +0 -0
- package/dist/models/GoAccessInfo.js +0 -0
- package/dist/models/GoAccessReportResponse.d.ts +0 -0
- package/dist/models/GoAccessReportResponse.js +0 -0
- package/dist/models/IBuiltImage.d.ts +0 -0
- package/dist/models/IBuiltImage.js +0 -0
- package/dist/models/ICaptainDefinition.d.ts +0 -0
- package/dist/models/ICaptainDefinition.js +0 -0
- package/dist/models/IGoAccessInfo.d.ts +0 -0
- package/dist/models/IGoAccessInfo.js +0 -0
- package/dist/models/IHashMapGeneric.d.ts +0 -0
- package/dist/models/IHashMapGeneric.js +0 -0
- package/dist/models/IImageSource.d.ts +0 -0
- package/dist/models/IImageSource.js +0 -0
- package/dist/models/IOneClickAppModels.d.ts +0 -0
- package/dist/models/IOneClickAppModels.js +0 -0
- package/dist/models/IProFeatures.d.ts +0 -0
- package/dist/models/IProFeatures.js +0 -0
- package/dist/models/IRegistryInfo.d.ts +0 -0
- package/dist/models/IRegistryInfo.js +0 -0
- package/dist/models/IServerBlockDetails.d.ts +0 -0
- package/dist/models/IServerBlockDetails.js +0 -0
- package/dist/models/IVersionInfo.d.ts +0 -0
- package/dist/models/IVersionInfo.js +0 -0
- package/dist/models/LoadBalancerInfo.d.ts +0 -0
- package/dist/models/LoadBalancerInfo.js +0 -0
- package/dist/models/LogsResponse.d.ts +0 -0
- package/dist/models/LogsResponse.js +0 -0
- package/dist/models/NetDataInfo.d.ts +0 -0
- package/dist/models/NetDataInfo.js +0 -0
- package/dist/models/NginxConfig.d.ts +0 -0
- package/dist/models/NginxConfig.js +0 -0
- package/dist/models/OneClickAppDefinitionResponse.d.ts +0 -0
- package/dist/models/OneClickAppDefinitionResponse.js +0 -0
- package/dist/models/OneClickAppRepositories.d.ts +0 -0
- package/dist/models/OneClickAppRepositories.js +0 -0
- package/dist/models/OneClickAppResponse.d.ts +0 -0
- package/dist/models/OneClickAppResponse.js +0 -0
- package/dist/models/OtherTypes.d.ts +0 -0
- package/dist/models/OtherTypes.js +0 -0
- package/dist/models/ProjectDefinition.d.ts +0 -0
- package/dist/models/ProjectDefinition.js +0 -0
- package/dist/models/ProjectsResponse.d.ts +0 -0
- package/dist/models/ProjectsResponse.js +0 -0
- package/dist/models/RegistriesResponse.d.ts +0 -0
- package/dist/models/RegistriesResponse.js +0 -0
- package/dist/models/ServerDockerInfo.d.ts +0 -0
- package/dist/models/ServerDockerInfo.js +0 -0
- package/dist/models/UnusedImagesResponse.d.ts +0 -0
- package/dist/models/UnusedImagesResponse.js +0 -0
- package/dist/models/index.d.ts +0 -0
- package/dist/models/index.js +0 -0
- package/package.json +1 -1
- package/src/api/ApiManager.ts +8 -5
- package/src/index.ts +2 -0
package/dist/api/ApiManager.d.ts
CHANGED
|
@@ -42,10 +42,11 @@ export declare class SimpleAuthenticationProvider implements AuthenticationProvi
|
|
|
42
42
|
onAuthTokenUpdated(newAuthToken: string): void;
|
|
43
43
|
}
|
|
44
44
|
export default class ApiManager {
|
|
45
|
+
private authProvider;
|
|
45
46
|
private http;
|
|
46
47
|
constructor(baseDomain: string, authProvider: AuthenticationProvider);
|
|
47
48
|
destroy(): void;
|
|
48
|
-
login(password: string, otpToken?: string): Promise<
|
|
49
|
+
login(password: string, otpToken?: string): Promise<void>;
|
|
49
50
|
getAllThemes(): Promise<{
|
|
50
51
|
themes: CapRoverTheme[] | undefined;
|
|
51
52
|
}>;
|
package/dist/api/ApiManager.js
CHANGED
|
@@ -23,6 +23,7 @@ class SimpleAuthenticationProvider {
|
|
|
23
23
|
exports.SimpleAuthenticationProvider = SimpleAuthenticationProvider;
|
|
24
24
|
class ApiManager {
|
|
25
25
|
constructor(baseDomain, authProvider) {
|
|
26
|
+
this.authProvider = authProvider;
|
|
26
27
|
const self = this;
|
|
27
28
|
const URL = baseDomain + '/api/v2';
|
|
28
29
|
this.http = new HttpClient_1.default(URL, () => {
|
|
@@ -34,9 +35,6 @@ class ApiManager {
|
|
|
34
35
|
})
|
|
35
36
|
.then((authContent) => {
|
|
36
37
|
return self.login(authContent.password, authContent.otpToken);
|
|
37
|
-
}) //
|
|
38
|
-
.then((authToken) => {
|
|
39
|
-
authProvider.onAuthTokenUpdated(authToken);
|
|
40
38
|
});
|
|
41
39
|
});
|
|
42
40
|
}
|
|
@@ -56,6 +54,9 @@ class ApiManager {
|
|
|
56
54
|
})
|
|
57
55
|
.then(function (data) {
|
|
58
56
|
return data.token;
|
|
57
|
+
})
|
|
58
|
+
.then((authToken) => {
|
|
59
|
+
self.authProvider.onAuthTokenUpdated(authToken);
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
getAllThemes() {
|
|
File without changes
|
package/dist/api/ErrorFactory.js
CHANGED
|
File without changes
|
package/dist/api/HttpClient.d.ts
CHANGED
|
File without changes
|
package/dist/api/HttpClient.js
CHANGED
|
File without changes
|
package/dist/example.d.ts
CHANGED
|
File without changes
|
package/dist/example.js
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import CapRoverAPI from './api/ApiManager';
|
|
2
2
|
import * as CapRoverModels from './models';
|
|
3
3
|
import { AuthenticationContent, SimpleAuthenticationProvider, AuthenticationProvider } from './api/ApiManager';
|
|
4
|
+
import errorFactory from './api/ErrorFactory';
|
|
4
5
|
export default CapRoverAPI;
|
|
5
6
|
export { CapRoverModels };
|
|
6
|
-
export { AuthenticationContent, SimpleAuthenticationProvider, AuthenticationProvider, };
|
|
7
|
+
export { AuthenticationContent, SimpleAuthenticationProvider, AuthenticationProvider, errorFactory, };
|
package/dist/index.js
CHANGED
|
@@ -36,10 +36,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.SimpleAuthenticationProvider = exports.CapRoverModels = void 0;
|
|
39
|
+
exports.errorFactory = exports.SimpleAuthenticationProvider = exports.CapRoverModels = void 0;
|
|
40
40
|
const ApiManager_1 = __importDefault(require("./api/ApiManager"));
|
|
41
41
|
const CapRoverModels = __importStar(require("./models"));
|
|
42
42
|
exports.CapRoverModels = CapRoverModels;
|
|
43
43
|
const ApiManager_2 = require("./api/ApiManager");
|
|
44
44
|
Object.defineProperty(exports, "SimpleAuthenticationProvider", { enumerable: true, get: function () { return ApiManager_2.SimpleAuthenticationProvider; } });
|
|
45
|
+
const ErrorFactory_1 = __importDefault(require("./api/ErrorFactory"));
|
|
46
|
+
exports.errorFactory = ErrorFactory_1.default;
|
|
45
47
|
exports.default = ApiManager_1.default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/models/index.d.ts
CHANGED
|
File without changes
|
package/dist/models/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/api/ApiManager.ts
CHANGED
|
@@ -65,7 +65,10 @@ export class SimpleAuthenticationProvider implements AuthenticationProvider {
|
|
|
65
65
|
export default class ApiManager {
|
|
66
66
|
private http: HttpClient
|
|
67
67
|
|
|
68
|
-
constructor(
|
|
68
|
+
constructor(
|
|
69
|
+
baseDomain: string,
|
|
70
|
+
private authProvider: AuthenticationProvider
|
|
71
|
+
) {
|
|
69
72
|
const self = this
|
|
70
73
|
const URL = baseDomain + '/api/v2'
|
|
71
74
|
this.http = new HttpClient(
|
|
@@ -83,9 +86,6 @@ export default class ApiManager {
|
|
|
83
86
|
authContent.password,
|
|
84
87
|
authContent.otpToken
|
|
85
88
|
)
|
|
86
|
-
}) //
|
|
87
|
-
.then((authToken) => {
|
|
88
|
-
authProvider.onAuthTokenUpdated(authToken)
|
|
89
89
|
})
|
|
90
90
|
}
|
|
91
91
|
)
|
|
@@ -95,7 +95,7 @@ export default class ApiManager {
|
|
|
95
95
|
this.http.destroy()
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
login(password: string, otpToken?: string): Promise<
|
|
98
|
+
login(password: string, otpToken?: string): Promise<void> {
|
|
99
99
|
const self = this
|
|
100
100
|
const http = self.http
|
|
101
101
|
|
|
@@ -112,6 +112,9 @@ export default class ApiManager {
|
|
|
112
112
|
.then(function (data) {
|
|
113
113
|
return data.token
|
|
114
114
|
})
|
|
115
|
+
.then((authToken) => {
|
|
116
|
+
self.authProvider.onAuthTokenUpdated(authToken)
|
|
117
|
+
})
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
getAllThemes(): Promise<{ themes: CapRoverTheme[] | undefined }> {
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
SimpleAuthenticationProvider,
|
|
6
6
|
AuthenticationProvider,
|
|
7
7
|
} from './api/ApiManager'
|
|
8
|
+
import errorFactory from './api/ErrorFactory'
|
|
8
9
|
|
|
9
10
|
export default CapRoverAPI
|
|
10
11
|
export { CapRoverModels }
|
|
@@ -12,4 +13,5 @@ export {
|
|
|
12
13
|
AuthenticationContent,
|
|
13
14
|
SimpleAuthenticationProvider,
|
|
14
15
|
AuthenticationProvider,
|
|
16
|
+
errorFactory,
|
|
15
17
|
}
|