@skillswaveca/nova-shared-libraries 3.15.0 → 3.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.
@@ -1,31 +1,31 @@
1
1
  export const packageInfo = [
2
2
  {
3
3
  "name": "@skillswaveca/nova-utils",
4
- "version": "3.14.0",
4
+ "version": "3.15.0",
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.14.0",
10
+ "version": "3.15.0",
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.14.0",
16
+ "version": "3.15.0",
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.14.0",
22
+ "version": "3.15.0",
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.14.0",
28
+ "version": "3.15.0",
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": "3.15.0",
6
+ "version": "3.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": "3.15.0",
6
+ "version": "3.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
- const response = await super.get('/health');
158
- const { success, body, error, statusCode } = response;
159
- if(success) {
160
- return body;
161
- } else {
162
- if(statusCode === 404) {
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": "3.15.0",
6
+ "version": "3.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": "3.15.0",
6
+ "version": "3.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": "3.15.0",
6
+ "version": "3.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": "3.15.0",
6
+ "version": "3.15.1",
7
7
  "main": "index.js",
8
8
  "scripts": {
9
9
  "pre-release": "pnpm run create-index",