adapt-authoring-roles 1.3.2 → 1.3.4

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.
@@ -25,7 +25,7 @@ jobs:
25
25
  - name: Update npm
26
26
  run: npm install -g npm@latest
27
27
  - name: Install dependencies
28
- run: npm install --legacy-peer-deps
28
+ run: npm install
29
29
  - name: Release
30
30
  env:
31
31
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -8,5 +8,5 @@ jobs:
8
8
  - uses: actions/setup-node@master
9
9
  with:
10
10
  node-version: 'lts/*'
11
- - run: npm install --legacy-peer-deps
11
+ - run: npm install
12
12
  - run: npx standard
@@ -10,5 +10,5 @@ jobs:
10
10
  - uses: actions/setup-node@v4
11
11
  with:
12
12
  node-version: 'lts/*'
13
- - run: npm install --legacy-peer-deps
13
+ - run: npm install
14
14
  - run: npm test
@@ -41,7 +41,7 @@ class RolesModule extends AbstractApiModule {
41
41
  return
42
42
  }
43
43
  try {
44
- await this.insert(r)
44
+ await this.insert(r, { validate: false })
45
45
  this.log('debug', 'INSERT', this.schemaName, r.shortName)
46
46
  } catch (e) {
47
47
  if (e.code !== 11000) this.log('warn', `failed to add '${r.shortName}' role, ${e.message}`)
@@ -56,6 +56,7 @@ class RolesModule extends AbstractApiModule {
56
56
  async shortNamesToIds (roles) {
57
57
  return Promise.all(roles.map(async r => {
58
58
  const [role] = await this.find({ shortName: r })
59
+ if (!role) throw new Error(`role '${r}' not found`)
59
60
  return role._id.toString()
60
61
  }))
61
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-roles",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Module for managing user roles",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-roles",
6
6
  "license": "GPL-3.0",
@@ -47,27 +47,10 @@
47
47
  "adapt-authoring-api": "^2.0.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "adapt-authoring-auth": "^1.0.7",
51
- "adapt-authoring-auth-local": "^1.0.3",
50
+ "adapt-authoring-auth": "^2.0.0",
51
+ "adapt-authoring-auth-local": "^2.0.0",
52
52
  "adapt-authoring-core": "^2.0.0",
53
53
  "adapt-authoring-mongodb": "^2.0.0",
54
54
  "adapt-authoring-users": "^1.0.2"
55
- },
56
- "peerDependenciesMeta": {
57
- "adapt-authoring-auth": {
58
- "optional": true
59
- },
60
- "adapt-authoring-auth-local": {
61
- "optional": true
62
- },
63
- "adapt-authoring-core": {
64
- "optional": true
65
- },
66
- "adapt-authoring-mongodb": {
67
- "optional": true
68
- },
69
- "adapt-authoring-users": {
70
- "optional": true
71
- }
72
55
  }
73
56
  }