@skillswaveca/nova-shared-libraries 3.15.0 → 4.15.1
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.
- package/docs-base/package-info.js +5 -5
- package/package.json +1 -1
- package/packages/drivers/package.json +1 -1
- package/packages/drivers/src/oauth.js +18 -9
- package/packages/nova-middleware/package.json +1 -1
- package/packages/nova-model/package.json +1 -1
- package/packages/nova-router/package.json +1 -1
- package/packages/nova-utils/package.json +1 -1
- package/packages/nova-utils/src/config.js +2 -2
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
export const packageInfo = [
|
|
2
2
|
{
|
|
3
3
|
"name": "@skillswaveca/nova-utils",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.15.1",
|
|
5
5
|
"description": "A collection of random utils used in nova repos",
|
|
6
6
|
"docsPath": "./nova-utils/index.html"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
"name": "nova-router",
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.15.1",
|
|
11
11
|
"description": "An extended Koa router that enables better validation",
|
|
12
12
|
"docsPath": "./nova-router/index.html"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "@skillswaveca/nova-model",
|
|
16
|
-
"version": "3.
|
|
16
|
+
"version": "3.15.1",
|
|
17
17
|
"description": "Nova model stuff",
|
|
18
18
|
"docsPath": "./nova-model/index.html"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"name": "@skillswaveca/nova-middleware",
|
|
22
|
-
"version": "3.
|
|
22
|
+
"version": "3.15.1",
|
|
23
23
|
"description": "A collection of middleware used by nova projects",
|
|
24
24
|
"docsPath": "./nova-middleware/index.html"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"name": "@skillswaveca/nova-drivers",
|
|
28
|
-
"version": "3.
|
|
28
|
+
"version": "3.15.1",
|
|
29
29
|
"description": "Some helper drivers for AWS services",
|
|
30
30
|
"docsPath": "./drivers/index.html"
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "@skillswaveca/nova-shared-libraries",
|
|
4
4
|
"description": "A monorepo of shared libraries for Nova projects.",
|
|
5
5
|
"repository": "https://github.com/SkillsWave/nova-shared-libraries",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "4.15.1",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"keywords": [],
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "@skillswaveca/nova-drivers",
|
|
4
4
|
"description": "Some helper drivers for AWS services",
|
|
5
5
|
"repository": "https://github.com/SkillsWave/nova-shared-libraries",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "4.15.1",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"pre-release": "pnpm run create-index",
|
|
@@ -154,17 +154,26 @@ export class OAuthDriver extends HttpDriver {
|
|
|
154
154
|
* @returns {Promise<{message, status: string}|*|{message: string, status: string}>}
|
|
155
155
|
*/
|
|
156
156
|
async health() {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
try {
|
|
158
|
+
const response = await super.get('/api/v2/health');
|
|
159
|
+
const { success, body, error, statusCode } = response;
|
|
160
|
+
|
|
161
|
+
this.log.trace({ baseUrl: this.baseUrl, success, error, statusCode, body } , 'Checking the health of the service');
|
|
162
|
+
|
|
163
|
+
if (success) return body;
|
|
164
|
+
|
|
165
|
+
if (statusCode === 404) {
|
|
166
|
+
this.log.warn({ baseUrl: this.baseUrl, statusCode }, 'Health check endpoint not found');
|
|
163
167
|
return { status: 'unknown', message: 'No health check endpoint found' };
|
|
164
|
-
} else {
|
|
165
|
-
return { status: 'error', message: error };
|
|
166
168
|
}
|
|
167
|
-
}
|
|
168
169
|
|
|
170
|
+
this.log.error({ baseUrl: this.baseUrl, error, statusCode }, 'Service health check failed');
|
|
171
|
+
|
|
172
|
+
return { status: 'error', message: error || 'An unknown error occurred during health check' };
|
|
173
|
+
} catch (err) {
|
|
174
|
+
this.log.error({ baseUrl: this.baseUrl, error: err }, 'Unexpected error during health check');
|
|
175
|
+
return { status: 'error', message: 'Unexpected error occurred while checking service health' };
|
|
176
|
+
}
|
|
169
177
|
}
|
|
178
|
+
|
|
170
179
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "@skillswaveca/nova-middleware",
|
|
4
4
|
"description": "A collection of middleware used by nova projects",
|
|
5
5
|
"repository": "https://github.com/SkillsWave/nova-shared-libraries",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "4.15.1",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"pre-release": "pnpm run create-index",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "@skillswaveca/nova-model",
|
|
4
4
|
"description": "Nova model stuff",
|
|
5
5
|
"repository": "https://github.com/SkillsWave/nova-shared-libraries",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "4.15.1",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"pre-release": "pnpm run create-index",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "nova-router",
|
|
4
4
|
"description": "An extended Koa router that enables better validation",
|
|
5
5
|
"repository": "https://github.com/SkillsWave/nova-shared-libraries",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "4.15.1",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"pre-release": "pnpm run create-index",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "@skillswaveca/nova-utils",
|
|
4
4
|
"description": "A collection of random utils used in nova repos",
|
|
5
5
|
"repository": "https://github.com/SkillsWave/nova-shared-libraries",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "4.15.1",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"pre-release": "pnpm run create-index",
|
|
@@ -236,8 +236,8 @@ export class NovaStageConfig {
|
|
|
236
236
|
createConfigForStage(stage, region) {
|
|
237
237
|
const baseConfig = this.baseConfig(stage);
|
|
238
238
|
const stageConfig = this.stages[stage] || this.stages.dev;
|
|
239
|
-
const
|
|
240
|
-
const accountConfig = this.accounts ? this.accounts[
|
|
239
|
+
const appEnvironment = stageConfig?.appEnvironment || baseConfig?.appEnvironment;
|
|
240
|
+
const accountConfig = this.accounts ? this.accounts[appEnvironment] : {};
|
|
241
241
|
const regionConfig = region ? this.stages[`${stage}.${region}`] : {};
|
|
242
242
|
let ret = deepMerge(baseConfig, accountConfig);
|
|
243
243
|
ret = deepMerge(ret, stageConfig);
|