adapt-authoring-spoortracking 1.1.3 → 1.2.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.
- package/lib/SpoorTrackingModule.js +4 -12
- package/package.json +5 -8
- package/routes.json +17 -0
|
@@ -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.
|
|
3
|
+
"version": "1.2.0",
|
|
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,12 +11,12 @@
|
|
|
11
11
|
"test": "node --test 'tests/**/*.spec.js'"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"adapt-authoring-core": "^2.0.0"
|
|
14
|
+
"adapt-authoring-core": "^2.0.0",
|
|
15
|
+
"adapt-authoring-server": "^2.1.0"
|
|
15
16
|
},
|
|
16
17
|
"peerDependencies": {
|
|
17
|
-
"adapt-authoring-auth": "^
|
|
18
|
-
"adapt-authoring-content": "^2.0.0"
|
|
19
|
-
"adapt-authoring-server": "^2.0.0"
|
|
18
|
+
"adapt-authoring-auth": "^2.0.0",
|
|
19
|
+
"adapt-authoring-content": "^2.0.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"adapt-authoring-auth": {
|
|
@@ -24,9 +24,6 @@
|
|
|
24
24
|
},
|
|
25
25
|
"adapt-authoring-content": {
|
|
26
26
|
"optional": true
|
|
27
|
-
},
|
|
28
|
-
"adapt-authoring-server": {
|
|
29
|
-
"optional": true
|
|
30
27
|
}
|
|
31
28
|
},
|
|
32
29
|
"devDependencies": {
|
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
|
+
}
|