@aloma.io/integration-sdk 3.8.23 → 3.8.24
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.
@@ -102,7 +102,7 @@ export declare abstract class AbstractController {
|
|
102
102
|
__endpoint(arg: any): Promise<any | null>;
|
103
103
|
__autocomplete(arg: any): Promise<any | null>;
|
104
104
|
__default(arg: any): Promise<any | null>;
|
105
|
-
__healthCheck(configSchema: {
|
105
|
+
__healthCheck(configSchema: () => {
|
106
106
|
[key: string]: ConfigField;
|
107
107
|
}): Promise<void>;
|
108
108
|
private defaultConfigCheck;
|
@@ -108,6 +108,7 @@ export class AbstractController {
|
|
108
108
|
}
|
109
109
|
async __healthCheck(configSchema) {
|
110
110
|
const errors = [];
|
111
|
+
const schema = configSchema();
|
111
112
|
try {
|
112
113
|
await this.healthCheck();
|
113
114
|
}
|
@@ -115,13 +116,13 @@ export class AbstractController {
|
|
115
116
|
errors.push(e.message);
|
116
117
|
}
|
117
118
|
try {
|
118
|
-
await this.defaultConfigCheck(
|
119
|
+
await this.defaultConfigCheck(schema);
|
119
120
|
}
|
120
121
|
catch (e) {
|
121
122
|
errors.push(e.message);
|
122
123
|
}
|
123
124
|
try {
|
124
|
-
await this.configCheck(
|
125
|
+
await this.configCheck(schema);
|
125
126
|
}
|
126
127
|
catch (e) {
|
127
128
|
errors.push(e.message);
|
@@ -133,7 +134,7 @@ export class AbstractController {
|
|
133
134
|
async defaultConfigCheck(configSchema) {
|
134
135
|
const config = this.config;
|
135
136
|
console.log(this.config, configSchema);
|
136
|
-
const missing = Object.entries(configSchema)
|
137
|
+
const missing = Object.entries(configSchema())
|
137
138
|
.map(([key, field]) => {
|
138
139
|
console.log(key, field, config[key]);
|
139
140
|
if (!field)
|
package/package.json
CHANGED
package/src/controller/index.mts
CHANGED
@@ -157,8 +157,9 @@ export abstract class AbstractController {
|
|
157
157
|
return this.fallback(arg);
|
158
158
|
}
|
159
159
|
|
160
|
-
async __healthCheck(configSchema: {[key: string]: ConfigField}): Promise<void> {
|
160
|
+
async __healthCheck(configSchema: () => {[key: string]: ConfigField}): Promise<void> {
|
161
161
|
const errors: string[] = [];
|
162
|
+
const schema = configSchema();
|
162
163
|
|
163
164
|
try {
|
164
165
|
await this.healthCheck();
|
@@ -167,13 +168,13 @@ export abstract class AbstractController {
|
|
167
168
|
}
|
168
169
|
|
169
170
|
try {
|
170
|
-
await this.defaultConfigCheck(
|
171
|
+
await this.defaultConfigCheck(schema);
|
171
172
|
} catch (e: any) {
|
172
173
|
errors.push(e.message);
|
173
174
|
}
|
174
175
|
|
175
176
|
try {
|
176
|
-
await this.configCheck(
|
177
|
+
await this.configCheck(schema);
|
177
178
|
} catch (e: any) {
|
178
179
|
errors.push(e.message);
|
179
180
|
}
|
@@ -188,7 +189,7 @@ export abstract class AbstractController {
|
|
188
189
|
|
189
190
|
console.log(this.config, configSchema)
|
190
191
|
|
191
|
-
const missing = Object.entries(configSchema)
|
192
|
+
const missing = Object.entries(configSchema())
|
192
193
|
.map(([key, field]) => {
|
193
194
|
console.log(key, field, config[key])
|
194
195
|
if (!field) return;
|