@skillswaveca/nova-shared-libraries 3.12.1 → 3.14.0

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.
@@ -0,0 +1,25 @@
1
+ name: Reviewer Assigned
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - review_requested
6
+ permissions:
7
+ pull-requests: write
8
+
9
+ jobs:
10
+ assign-assignee:
11
+ runs-on: ubuntu-latest
12
+ if: github.event.pull_request.assignee == null && github.event.requested_reviewer != null
13
+ steps:
14
+ - name: Update assignee
15
+ uses: actions/github-script@v7
16
+ with:
17
+ github-token: ${{ secrets.GITHUB_TOKEN }}
18
+ script: |
19
+ const { repo: { owner, repo } } = context;
20
+ await github.rest.issues.addAssignees({
21
+ owner,
22
+ repo,
23
+ issue_number: context.issue.number,
24
+ assignees: [context.payload.requested_reviewer.login]
25
+ });
@@ -1,31 +1,31 @@
1
1
  export const packageInfo = [
2
2
  {
3
3
  "name": "@skillswaveca/nova-utils",
4
- "version": "3.12.0",
4
+ "version": "3.13.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.12.0",
10
+ "version": "3.13.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.12.0",
16
+ "version": "3.13.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.12.0",
22
+ "version": "3.13.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.12.0",
28
+ "version": "3.13.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.12.1",
6
+ "version": "3.14.0",
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.12.1",
6
+ "version": "3.14.0",
7
7
  "main": "index.js",
8
8
  "scripts": {
9
9
  "pre-release": "pnpm run create-index",
@@ -80,6 +80,50 @@ export class WaveDriver extends OAuthDriver {
80
80
  }
81
81
  }
82
82
 
83
+ /**
84
+ * Gets a tenant SSO objects from the Wave platform
85
+ *
86
+ * @param tenantId the guid of the tenant
87
+ * @returns {Promise<*>} the tenant object
88
+ */
89
+ async getTenantSSO(tenantId) {
90
+ const url = `/api/v2/tenants/${tenantId}/sso`;
91
+
92
+ this.log.debug({ tenantId, url }, 'Getting tenant SSO from Wave');
93
+ const response = await this.get(url, {});
94
+
95
+ const { success, body, error } = response;
96
+
97
+ if (response.success) {
98
+ this.log.info({ 'response': { success, body } }, 'Tenant SSO retrieved from wave');
99
+ return body;
100
+ } else {
101
+ this.log.error({ 'response': { success, error } }, 'Failed to retrieve tenant SSO from wave');
102
+ throw new Error(`Failed to retrieve tenant from Wave: ${error}`);
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Gets all tenants from the Wave platform
108
+ *
109
+ * @returns {*}
110
+ */
111
+ getAllTenants() {
112
+ const url = '/api/v2/tenants';
113
+ this.log.debug({ url }, 'Getting all tenants from Wave');
114
+ const response = this.get(url, {});
115
+
116
+ const { success, body, error } = response;
117
+
118
+ if (response.success) {
119
+ this.log.info({ 'response': { success, body } }, 'Tenants retrieved from wave');
120
+ return body;
121
+ } else {
122
+ this.log.error({ 'response': { success, error } }, 'Failed to retrieve tenants from wave');
123
+ throw new Error(`Failed to retrieve tenants from Wave: ${error}`);
124
+ }
125
+ }
126
+
83
127
  _deleteUser(guid) {
84
128
  const url = `/api/v2/users/${guid}`;
85
129
  this.log.debug({ guid, url }, 'Deleting user from Wave');
@@ -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.12.1",
6
+ "version": "3.14.0",
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.12.1",
6
+ "version": "3.14.0",
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.12.1",
6
+ "version": "3.14.0",
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.12.1",
6
+ "version": "3.14.0",
7
7
  "main": "index.js",
8
8
  "scripts": {
9
9
  "pre-release": "pnpm run create-index",