@aloma.io/integration-sdk 3.8.13 → 3.8.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.
@@ -90,11 +90,18 @@ export declare abstract class AbstractController {
90
90
  * throw an error if unhealthy with a message describing what needs to be fixed
91
91
  */
92
92
  protected healthCheck(): Promise<any>;
93
+ /**
94
+ * config check, will be called periodically
95
+ * throw an error if the config is not valid
96
+ *
97
+ * @param configSchema the schema of the config
98
+ */
99
+ protected configCheck(configSchema: any): Promise<any>;
93
100
  __endpoint(arg: any): Promise<any | null>;
94
101
  __configQuery(arg: any): Promise<any | null>;
95
102
  __autocomplete(arg: any): Promise<any | null>;
96
103
  __default(arg: any): Promise<any | null>;
97
- __healthCheck(): Promise<any>;
104
+ __healthCheck(configSchema: any): Promise<any>;
98
105
  _doStart(config: any, oauth: any, newTask: any, updateTask: any, getClient: any, getBlob: any, getBlobContent: any, createBlob: any): Promise<void>;
99
106
  _doStop(isShutdown?: boolean): Promise<void>;
100
107
  }
@@ -91,6 +91,15 @@ export class AbstractController {
91
91
  async healthCheck() {
92
92
  // blank, throw an error if unhealthy
93
93
  }
94
+ /**
95
+ * config check, will be called periodically
96
+ * throw an error if the config is not valid
97
+ *
98
+ * @param configSchema the schema of the config
99
+ */
100
+ async configCheck(configSchema) {
101
+ // blank, throw an error if the config is not valid
102
+ }
94
103
  async __endpoint(arg) {
95
104
  return this.endpoint(arg);
96
105
  }
@@ -103,8 +112,9 @@ export class AbstractController {
103
112
  async __default(arg) {
104
113
  return this.fallback(arg);
105
114
  }
106
- async __healthCheck() {
107
- return this.healthCheck();
115
+ async __healthCheck(configSchema) {
116
+ await this.healthCheck();
117
+ await this.configCheck(configSchema);
108
118
  }
109
119
  async _doStart(config, oauth, newTask, updateTask, getClient, getBlob, getBlobContent, createBlob) {
110
120
  this.config = config;
@@ -62,7 +62,7 @@ export const onConnect = ({ dispatcher, configSchema, config, start, }) => {
62
62
  if (oauthClient) {
63
63
  await oauthClient.__healthCheck();
64
64
  }
65
- await controller.__healthCheck();
65
+ await controller.__healthCheck(configSchema);
66
66
  }
67
67
  catch (e) {
68
68
  result.ok = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.8.13",
3
+ "version": "3.8.15",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -138,6 +138,16 @@ export abstract class AbstractController {
138
138
  // blank, throw an error if unhealthy
139
139
  }
140
140
 
141
+ /**
142
+ * config check, will be called periodically
143
+ * throw an error if the config is not valid
144
+ *
145
+ * @param configSchema the schema of the config
146
+ */
147
+ protected async configCheck(configSchema: any): Promise<any> {
148
+ // blank, throw an error if the config is not valid
149
+ }
150
+
141
151
  async __endpoint(arg: any): Promise<any | null> {
142
152
  return this.endpoint(arg);
143
153
  }
@@ -154,8 +164,9 @@ export abstract class AbstractController {
154
164
  return this.fallback(arg);
155
165
  }
156
166
 
157
- async __healthCheck(): Promise<any> {
158
- return this.healthCheck();
167
+ async __healthCheck(configSchema: any): Promise<any> {
168
+ await this.healthCheck();
169
+ await this.configCheck(configSchema);
159
170
  }
160
171
 
161
172
  async _doStart(
@@ -104,7 +104,7 @@ export const onConnect = ({
104
104
  await oauthClient.__healthCheck();
105
105
  }
106
106
 
107
- await controller.__healthCheck();
107
+ await controller.__healthCheck(configSchema);
108
108
  } catch (e: any) {
109
109
  result.ok = false;
110
110
  result.error = e.message;