caprover-api 0.0.15 → 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.
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "cSpell.words": [
3
3
  "apikey",
4
+ "caprover",
5
+ "oneclick",
4
6
  "setcurrent"
5
7
  ]
6
8
  }
@@ -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
  }
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caprover-api",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "API client for CapRover",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -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:'