@aloma.io/integration-sdk 3.8.27 → 3.8.28
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.
@@ -109,6 +109,7 @@ export class AbstractController {
|
|
109
109
|
async __healthCheck(configSchema) {
|
110
110
|
const errors = [];
|
111
111
|
const schema = configSchema();
|
112
|
+
const fields = schema.fields;
|
112
113
|
try {
|
113
114
|
await this.healthCheck();
|
114
115
|
}
|
@@ -116,13 +117,13 @@ export class AbstractController {
|
|
116
117
|
errors.push(e.message);
|
117
118
|
}
|
118
119
|
try {
|
119
|
-
await this.defaultConfigCheck(
|
120
|
+
await this.defaultConfigCheck(fields);
|
120
121
|
}
|
121
122
|
catch (e) {
|
122
123
|
errors.push(e.message);
|
123
124
|
}
|
124
125
|
try {
|
125
|
-
await this.configCheck(
|
126
|
+
await this.configCheck(fields);
|
126
127
|
}
|
127
128
|
catch (e) {
|
128
129
|
errors.push(e.message);
|
@@ -133,13 +134,12 @@ export class AbstractController {
|
|
133
134
|
}
|
134
135
|
async defaultConfigCheck(configSchema) {
|
135
136
|
const config = this.config;
|
136
|
-
console.dir(configSchema, { depth: null });
|
137
137
|
const missing = Object.entries(configSchema)
|
138
138
|
.map(([key, field]) => {
|
139
139
|
if (!field)
|
140
140
|
return;
|
141
141
|
if (!field.optional && config[key] == null) {
|
142
|
-
return `Configuration: ${field.name} is required`;
|
142
|
+
return `Configuration: ${field.name || key} is required`;
|
143
143
|
}
|
144
144
|
})
|
145
145
|
.filter((what) => !!what);
|
package/package.json
CHANGED
package/src/controller/index.mts
CHANGED
@@ -160,6 +160,7 @@ export abstract class AbstractController {
|
|
160
160
|
async __healthCheck(configSchema: () => {[key: string]: ConfigField}): Promise<void> {
|
161
161
|
const errors: string[] = [];
|
162
162
|
const schema = configSchema();
|
163
|
+
const fields: any = schema.fields;
|
163
164
|
|
164
165
|
try {
|
165
166
|
await this.healthCheck();
|
@@ -168,13 +169,13 @@ export abstract class AbstractController {
|
|
168
169
|
}
|
169
170
|
|
170
171
|
try {
|
171
|
-
await this.defaultConfigCheck(
|
172
|
+
await this.defaultConfigCheck(fields);
|
172
173
|
} catch (e: any) {
|
173
174
|
errors.push(e.message);
|
174
175
|
}
|
175
176
|
|
176
177
|
try {
|
177
|
-
await this.configCheck(
|
178
|
+
await this.configCheck(fields);
|
178
179
|
} catch (e: any) {
|
179
180
|
errors.push(e.message);
|
180
181
|
}
|
@@ -187,14 +188,12 @@ export abstract class AbstractController {
|
|
187
188
|
private async defaultConfigCheck(configSchema: {[key: string]: ConfigField}): Promise<void> {
|
188
189
|
const config = this.config;
|
189
190
|
|
190
|
-
console.dir(configSchema, { depth: null })
|
191
|
-
|
192
191
|
const missing = Object.entries(configSchema)
|
193
192
|
.map(([key, field]) => {
|
194
193
|
if (!field) return;
|
195
194
|
|
196
195
|
if (!field.optional && config[key] == null) {
|
197
|
-
return `Configuration: ${field.name} is required`;
|
196
|
+
return `Configuration: ${field.name || key} is required`;
|
198
197
|
}
|
199
198
|
})
|
200
199
|
.filter((what) => !!what);
|