adapt-authoring-spoortracking 1.1.3 → 1.2.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/.github/workflows/releases.yml +9 -24
- package/.github/workflows/standardjs.yml +2 -2
- package/lib/SpoorTrackingModule.js +4 -12
- package/package.json +7 -32
- package/routes.json +17 -0
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
name: Release
|
|
2
|
+
|
|
2
3
|
on:
|
|
3
4
|
push:
|
|
4
5
|
branches:
|
|
5
6
|
- master
|
|
6
7
|
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
issues: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
id-token: write
|
|
13
|
+
packages: write
|
|
14
|
+
|
|
7
15
|
jobs:
|
|
8
16
|
release:
|
|
9
|
-
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
permissions:
|
|
12
|
-
contents: write # to be able to publish a GitHub release
|
|
13
|
-
issues: write # to be able to comment on released issues
|
|
14
|
-
pull-requests: write # to be able to comment on released pull requests
|
|
15
|
-
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout
|
|
18
|
-
uses: actions/checkout@v3
|
|
19
|
-
with:
|
|
20
|
-
fetch-depth: 0
|
|
21
|
-
- name: Setup Node.js
|
|
22
|
-
uses: actions/setup-node@v3
|
|
23
|
-
with:
|
|
24
|
-
node-version: 'lts/*'
|
|
25
|
-
- name: Update npm
|
|
26
|
-
run: npm install -g npm@latest
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: npm install
|
|
29
|
-
- name: Release
|
|
30
|
-
env:
|
|
31
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
32
|
-
run: npx semantic-release
|
|
17
|
+
uses: adaptlearning/semantic-release-config/.github/workflows/release.yml@master
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AbstractModule } from 'adapt-authoring-core'
|
|
2
|
+
import { loadRouteConfig, registerRoutes } from 'adapt-authoring-server'
|
|
2
3
|
/**
|
|
3
4
|
* Module for making course content compatible with spoor
|
|
4
5
|
* @memberof spoortracking
|
|
@@ -11,18 +12,9 @@ class SpoorTrackingModule extends AbstractModule {
|
|
|
11
12
|
|
|
12
13
|
content.preInsertHook.tap(this.insertTrackingId.bind(this))
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
meta: {
|
|
18
|
-
post: {
|
|
19
|
-
summary: 'Reset course tracking IDs',
|
|
20
|
-
description: 'Fully resets all tracking IDs for a single course.',
|
|
21
|
-
responses: { 204: {} }
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
auth.secureRoute('/api/spoortracking/reset/:_courseId', 'post', ['write:content'])
|
|
15
|
+
const config = await loadRouteConfig(this.rootDir, this)
|
|
16
|
+
const router = server.api.createChildRouter(config.root)
|
|
17
|
+
registerRoutes(router, config.routes, auth)
|
|
26
18
|
}
|
|
27
19
|
|
|
28
20
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-spoortracking",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Module for making course content compatible with spoor",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-spoortracking",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"test": "node --test 'tests/**/*.spec.js'"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"adapt-authoring-core": "^
|
|
14
|
+
"adapt-authoring-core": "^3.0.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"adapt-authoring-auth": "^
|
|
18
|
-
"adapt-authoring-content": "^
|
|
17
|
+
"adapt-authoring-auth": "^2.0.0",
|
|
18
|
+
"adapt-authoring-content": "^3.0.0",
|
|
19
19
|
"adapt-authoring-server": "^2.0.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
@@ -30,36 +30,11 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@semantic-release
|
|
34
|
-
"
|
|
35
|
-
"semantic-release": "^25.0.2",
|
|
33
|
+
"@adaptlearning/semantic-release-config": "^1.0.0",
|
|
34
|
+
"adapt-authoring-server": "^2.0.0",
|
|
36
35
|
"standard": "^17.1.0"
|
|
37
36
|
},
|
|
38
37
|
"release": {
|
|
39
|
-
"
|
|
40
|
-
[
|
|
41
|
-
"@semantic-release/commit-analyzer",
|
|
42
|
-
{
|
|
43
|
-
"preset": "eslint"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
"@semantic-release/release-notes-generator",
|
|
48
|
-
{
|
|
49
|
-
"preset": "eslint"
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"@semantic-release/npm",
|
|
53
|
-
"@semantic-release/github",
|
|
54
|
-
[
|
|
55
|
-
"@semantic-release/git",
|
|
56
|
-
{
|
|
57
|
-
"assets": [
|
|
58
|
-
"package.json"
|
|
59
|
-
],
|
|
60
|
-
"message": "Chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
]
|
|
38
|
+
"extends": "@adaptlearning/semantic-release-config"
|
|
64
39
|
}
|
|
65
40
|
}
|
package/routes.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": "spoortracking",
|
|
3
|
+
"routes": [
|
|
4
|
+
{
|
|
5
|
+
"route": "/reset/:_courseId",
|
|
6
|
+
"handlers": { "post": "resetTrackingHandler" },
|
|
7
|
+
"permissions": { "post": ["write:content"] },
|
|
8
|
+
"meta": {
|
|
9
|
+
"post": {
|
|
10
|
+
"summary": "Reset course tracking IDs",
|
|
11
|
+
"description": "Fully resets all tracking IDs for a single course.",
|
|
12
|
+
"responses": { "204": {} }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|