adapt-authoring-adaptframework 2.1.0 → 2.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.
@@ -3,7 +3,7 @@ import AdaptFrameworkBuild from './AdaptFrameworkBuild.js'
3
3
  import AdaptFrameworkImport from './AdaptFrameworkImport.js'
4
4
  import fs from 'node:fs/promises'
5
5
  import { getHandler, postHandler, importHandler, postUpdateHandler, getUpdateHandler } from './handlers.js'
6
- import { loadRouteConfig } from 'adapt-authoring-server'
6
+ import { loadRouteConfig, registerRoutes } from 'adapt-authoring-server'
7
7
  import { runCliCommand } from './utils.js'
8
8
  import path from 'node:path'
9
9
  import semver from 'semver'
@@ -233,13 +233,7 @@ class AdaptFrameworkModule extends AbstractModule {
233
233
  handlerAliases: { getHandler, postHandler, importHandler, postUpdateHandler, getUpdateHandler }
234
234
  })
235
235
  this.apiRouter = server.api.createChildRouter(config.root)
236
- for (const r of config.routes) {
237
- this.apiRouter.addRoute(r)
238
- if (!r.permissions) continue
239
- for (const [method, perms] of Object.entries(r.permissions)) {
240
- auth.secureRoute(`${this.apiRouter.path}${r.route}`, method, perms)
241
- }
242
- }
236
+ registerRoutes(this.apiRouter, config.routes, auth)
243
237
  }
244
238
 
245
239
  registerImportContentMigration (migration) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-adaptframework",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Adapt framework integration for the Adapt authoring tool",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-adaptframework",
6
6
  "license": "GPL-3.0",