caprover-api 0.0.12 → 0.0.14

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.
Files changed (88) hide show
  1. package/dist/api/ApiManager.d.ts +2 -1
  2. package/dist/api/ApiManager.js +4 -3
  3. package/dist/api/ErrorFactory.d.ts +0 -0
  4. package/dist/api/ErrorFactory.js +0 -0
  5. package/dist/api/HttpClient.d.ts +0 -0
  6. package/dist/api/HttpClient.js +0 -0
  7. package/dist/example.d.ts +0 -0
  8. package/dist/example.js +0 -0
  9. package/dist/index.d.ts +0 -0
  10. package/dist/index.js +0 -0
  11. package/dist/models/AppDefinition.d.ts +0 -0
  12. package/dist/models/AppDefinition.js +0 -0
  13. package/dist/models/AppDefinitionsResponse.d.ts +0 -0
  14. package/dist/models/AppDefinitionsResponse.js +0 -0
  15. package/dist/models/AppDeleteResponse.d.ts +0 -0
  16. package/dist/models/AppDeleteResponse.js +0 -0
  17. package/dist/models/AutomatedCleanupConfigs.d.ts +0 -0
  18. package/dist/models/AutomatedCleanupConfigs.js +0 -0
  19. package/dist/models/BackupMeta.d.ts +0 -0
  20. package/dist/models/BackupMeta.js +0 -0
  21. package/dist/models/BuildLogsResponse.d.ts +0 -0
  22. package/dist/models/BuildLogsResponse.js +0 -0
  23. package/dist/models/CapRoverTheme.d.ts +0 -0
  24. package/dist/models/CapRoverTheme.js +0 -0
  25. package/dist/models/CaptainInfo.d.ts +0 -0
  26. package/dist/models/CaptainInfo.js +0 -0
  27. package/dist/models/ContainerProps.d.ts +0 -0
  28. package/dist/models/ContainerProps.js +0 -0
  29. package/dist/models/DockerAuthObj.d.ts +0 -0
  30. package/dist/models/DockerAuthObj.js +0 -0
  31. package/dist/models/DockerSecret.d.ts +0 -0
  32. package/dist/models/DockerSecret.js +0 -0
  33. package/dist/models/DockerService.d.ts +0 -0
  34. package/dist/models/DockerService.js +0 -0
  35. package/dist/models/GoAccessInfo.d.ts +0 -0
  36. package/dist/models/GoAccessInfo.js +0 -0
  37. package/dist/models/GoAccessReportResponse.d.ts +0 -0
  38. package/dist/models/GoAccessReportResponse.js +0 -0
  39. package/dist/models/IBuiltImage.d.ts +0 -0
  40. package/dist/models/IBuiltImage.js +0 -0
  41. package/dist/models/ICaptainDefinition.d.ts +0 -0
  42. package/dist/models/ICaptainDefinition.js +0 -0
  43. package/dist/models/IGoAccessInfo.d.ts +0 -0
  44. package/dist/models/IGoAccessInfo.js +0 -0
  45. package/dist/models/IHashMapGeneric.d.ts +0 -0
  46. package/dist/models/IHashMapGeneric.js +0 -0
  47. package/dist/models/IImageSource.d.ts +0 -0
  48. package/dist/models/IImageSource.js +0 -0
  49. package/dist/models/IOneClickAppModels.d.ts +0 -0
  50. package/dist/models/IOneClickAppModels.js +0 -0
  51. package/dist/models/IProFeatures.d.ts +0 -0
  52. package/dist/models/IProFeatures.js +0 -0
  53. package/dist/models/IRegistryInfo.d.ts +0 -0
  54. package/dist/models/IRegistryInfo.js +0 -0
  55. package/dist/models/IServerBlockDetails.d.ts +0 -0
  56. package/dist/models/IServerBlockDetails.js +0 -0
  57. package/dist/models/IVersionInfo.d.ts +0 -0
  58. package/dist/models/IVersionInfo.js +0 -0
  59. package/dist/models/LoadBalancerInfo.d.ts +0 -0
  60. package/dist/models/LoadBalancerInfo.js +0 -0
  61. package/dist/models/LogsResponse.d.ts +0 -0
  62. package/dist/models/LogsResponse.js +0 -0
  63. package/dist/models/NetDataInfo.d.ts +0 -0
  64. package/dist/models/NetDataInfo.js +0 -0
  65. package/dist/models/NginxConfig.d.ts +0 -0
  66. package/dist/models/NginxConfig.js +0 -0
  67. package/dist/models/OneClickAppDefinitionResponse.d.ts +0 -0
  68. package/dist/models/OneClickAppDefinitionResponse.js +0 -0
  69. package/dist/models/OneClickAppRepositories.d.ts +0 -0
  70. package/dist/models/OneClickAppRepositories.js +0 -0
  71. package/dist/models/OneClickAppResponse.d.ts +0 -0
  72. package/dist/models/OneClickAppResponse.js +0 -0
  73. package/dist/models/OtherTypes.d.ts +0 -0
  74. package/dist/models/OtherTypes.js +0 -0
  75. package/dist/models/ProjectDefinition.d.ts +0 -0
  76. package/dist/models/ProjectDefinition.js +0 -0
  77. package/dist/models/ProjectsResponse.d.ts +0 -0
  78. package/dist/models/ProjectsResponse.js +0 -0
  79. package/dist/models/RegistriesResponse.d.ts +0 -0
  80. package/dist/models/RegistriesResponse.js +0 -0
  81. package/dist/models/ServerDockerInfo.d.ts +0 -0
  82. package/dist/models/ServerDockerInfo.js +0 -0
  83. package/dist/models/UnusedImagesResponse.d.ts +0 -0
  84. package/dist/models/UnusedImagesResponse.js +0 -0
  85. package/dist/models/index.d.ts +0 -0
  86. package/dist/models/index.js +0 -0
  87. package/package.json +1 -1
  88. package/src/api/ApiManager.ts +8 -5
@@ -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<string>;
49
+ login(password: string, otpToken?: string): Promise<void>;
49
50
  getAllThemes(): Promise<{
50
51
  themes: CapRoverTheme[] | undefined;
51
52
  }>;
@@ -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
File without changes
File without changes
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
File without changes
package/dist/index.js CHANGED
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
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caprover-api",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "API client for CapRover",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -65,7 +65,10 @@ export class SimpleAuthenticationProvider implements AuthenticationProvider {
65
65
  export default class ApiManager {
66
66
  private http: HttpClient
67
67
 
68
- constructor(baseDomain: string, authProvider: AuthenticationProvider) {
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<string> {
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 }> {