caprover-api 0.0.14 → 0.0.16
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/.vscode/settings.json +2 -0
- package/dist/api/ApiManager.d.ts +1 -0
- package/dist/api/ApiManager.js +5 -0
- package/dist/example.js +5 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/src/api/ApiManager.ts +11 -0
- package/src/example.ts +7 -0
- package/src/index.ts +2 -0
package/.vscode/settings.json
CHANGED
package/dist/api/ApiManager.d.ts
CHANGED
|
@@ -123,4 +123,5 @@ export default class ApiManager {
|
|
|
123
123
|
addNewCustomOneClickRepo(repositoryUrl: string): Promise<void>;
|
|
124
124
|
deleteCustomOneClickRepo(repositoryUrl: string): Promise<void>;
|
|
125
125
|
addDockerNode(nodeType: string, privateKey: string, remoteNodeIpAddress: string, sshPort: string, sshUser: string, captainIpAddress: string): Promise<void>;
|
|
126
|
+
executeGenericApiCommand(verb: 'GET' | 'POST', endpoint: string, data: any): Promise<any>;
|
|
126
127
|
}
|
package/dist/api/ApiManager.js
CHANGED
|
@@ -507,5 +507,10 @@ class ApiManager {
|
|
|
507
507
|
captainIpAddress,
|
|
508
508
|
}));
|
|
509
509
|
}
|
|
510
|
+
executeGenericApiCommand(verb, endpoint, data) {
|
|
511
|
+
const http = this.http;
|
|
512
|
+
return Promise.resolve() //
|
|
513
|
+
.then(http.fetch(verb, endpoint, data));
|
|
514
|
+
}
|
|
510
515
|
}
|
|
511
516
|
exports.default = ApiManager;
|
package/dist/example.js
CHANGED
|
@@ -49,6 +49,11 @@ Promise.resolve()
|
|
|
49
49
|
console.log('=============================================== getAllNodes:');
|
|
50
50
|
console.log(response);
|
|
51
51
|
return caprover.getDockerRegistries();
|
|
52
|
+
})
|
|
53
|
+
.then((response) => {
|
|
54
|
+
console.log('=============================================== getDockerRegistries:');
|
|
55
|
+
console.log(response);
|
|
56
|
+
return caprover.executeGenericApiCommand('GET', '/user/registries', {});
|
|
52
57
|
})
|
|
53
58
|
.then((response) => {
|
|
54
59
|
console.log('=============================================== getDockerRegistries:');
|
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;
|
package/package.json
CHANGED
package/src/api/ApiManager.ts
CHANGED
|
@@ -861,4 +861,15 @@ export default class ApiManager {
|
|
|
861
861
|
})
|
|
862
862
|
)
|
|
863
863
|
}
|
|
864
|
+
|
|
865
|
+
executeGenericApiCommand(
|
|
866
|
+
verb: 'GET' | 'POST',
|
|
867
|
+
endpoint: string,
|
|
868
|
+
data: any
|
|
869
|
+
): Promise<any> {
|
|
870
|
+
const http = this.http
|
|
871
|
+
|
|
872
|
+
return Promise.resolve() //
|
|
873
|
+
.then(http.fetch(verb, endpoint, data))
|
|
874
|
+
}
|
|
864
875
|
}
|
package/src/example.ts
CHANGED
|
@@ -27,6 +27,13 @@ Promise.resolve()
|
|
|
27
27
|
console.log(response)
|
|
28
28
|
return caprover.getDockerRegistries()
|
|
29
29
|
})
|
|
30
|
+
.then((response) => {
|
|
31
|
+
console.log(
|
|
32
|
+
'=============================================== getDockerRegistries:'
|
|
33
|
+
)
|
|
34
|
+
console.log(response)
|
|
35
|
+
return caprover.executeGenericApiCommand('GET', '/user/registries', {})
|
|
36
|
+
})
|
|
30
37
|
.then((response) => {
|
|
31
38
|
console.log(
|
|
32
39
|
'=============================================== getDockerRegistries:'
|
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
|
}
|