Constructor
new AdaptFrameworkModule()
Extends
- AbstractModule
Members
_targetFrameworkVersion :Number
- Description:
- The major version of the Adapt framework this module is designed to work with
- Source:
The major version of the Adapt framework this module is designed to work with
Type:
- Number
buildHook :Hook
- Description:
- Middleware hook wrapping the full build lifecycle (pre → build → post). Observers receive (next, builder) and must call next() to proceed.
- Source:
Middleware hook wrapping the full build lifecycle (pre → build → post).
Observers receive (next, builder) and must call next() to proceed.
Type:
- Hook
contentMigrations :Array
- Description:
- Content migration functions to be run on import
- Source:
Content migration functions to be run on import
Type:
- Array
importHook :Hook
- Description:
- Middleware hook wrapping the full import lifecycle (pre → import → post). Observers receive (next, importer) and must call next() to proceed.
- Source:
Middleware hook wrapping the full import lifecycle (pre → import → post).
Observers receive (next, importer) and must call next() to proceed.
Type:
- Hook
path :String
- Description:
- Location of the local Adapt framework files
- Source:
Location of the local Adapt framework files
Type:
- String
postBuildHook :Hook
- Description:
- Invoked after a course has been built. The AdaptFrameworkBuild instance is passed to any observers.
- Source:
Invoked after a course has been built. The AdaptFrameworkBuild instance is passed to any observers.
Type:
- Hook
postImportHook :Hook
- Description:
- Invoked after a course has been imported. The AdaptFrameworkImport instance is passed to any observers.
- Source:
Invoked after a course has been imported. The AdaptFrameworkImport instance is passed to any observers.
Type:
- Hook
postInstallHook :Hook
- Description:
- Invoked after a framework install
- Source:
Invoked after a framework install
Type:
- Hook
postUpdateHook :Hook
- Description:
- Invoked after a framework update
- Source:
Invoked after a framework update
Type:
- Hook
preBuildHook :Hook
- Description:
- Invoked prior to a course being built. The AdaptFrameworkBuild instance is passed to any observers.
- Source:
Invoked prior to a course being built. The AdaptFrameworkBuild instance is passed to any observers.
Type:
- Hook
preImportHook :Hook
- Description:
- Invoked prior to a course being imported. The AdaptFrameworkImport instance is passed to any observers.
- Source:
Invoked prior to a course being imported. The AdaptFrameworkImport instance is passed to any observers.
Type:
- Hook
rootRouter :Router
- Description:
- Router for handling all non-API calls
- Source:
Router for handling all non-API calls
Type:
- Router
runCliCommand
- Description:
- Reference to runCliCommand utility
- Source:
Reference to runCliCommand utility
targetFrameworkVersion :Number|undefined
- Description:
- The major version of the Adapt framework this module is designed to work with
- Source:
The major version of the Adapt framework this module is designed to work with
Type:
- Number | undefined
targetVersionRange :String|undefined
- Description:
- Returns a semver range string constrained to the target major version, or undefined if no target is set
- Source:
Returns a semver range string constrained to the target major version, or undefined if no target is set
Type:
- String | undefined
version :String
- Description:
- Semver formatted version number of the local framework copy
- Source:
Semver formatted version number of the local framework copy
Type:
- String
Methods
(async) buildCourse(options) → {AdaptFrameworkBuild}
- Description:
- Builds a single Adapt framework course
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
options |
AdaptFrameworkBuildOptions |
Returns:
- Type
- AdaptFrameworkBuild
(async) checkContentAccess(req, data) → {Promise}
- Description:
- Checks whether the request user should be given access to the content they're requesting
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
req |
external:ExpressRequest | |
data |
Object |
Returns:
Resolves with boolean
- Type
- Promise
checkVersionCompatibility(version)
- Description:
- Checks whether the given version is compatible with the configured target major version
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string | Semver version string to check |
Throws:
If the version's major does not match the target major version
(async) getInstalledPlugins() → {Promise}
- Description:
- Retrieves the locally installed plugins
- Source:
Returns:
- Type
- Promise
(async) getLatestVersion() → {Promise}
- Description:
- Updates the local copy of the Adapt framework
- Source:
Returns:
- Type
- Promise
(async) getManifestPlugins() → {Promise}
- Description:
- Retrieves the plugins listed in the framework manifest, but not necessarily installed
- Source:
Returns:
- Type
- Promise
(async) getPluginHash() → {Promise.<String>}
- Description:
- Returns a cached plugin hash, computing it on first call
- Source:
Returns:
- Type
- Promise.<String>
(async) importCourse(options) → {AdaptFrameworkImportSummary}
- Description:
- Imports a single Adapt framework course
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
options |
AdaptFrameworkImportOptions |
Returns:
- Type
- AdaptFrameworkImportSummary
(async) init()
(async) initRoutes() → {Promise}
- Description:
- Initialises the module routing
- Source:
Returns:
- Type
- Promise
(async) installFramework() → {Promise}
- Description:
- Installs a local copy of the Adapt framework
- Source:
Returns:
- Type
- Promise
(async) invalidatePrebuiltCache()
- Description:
- Invalidates the prebuilt compilation cache and optionally triggers an eager rebuild of the shared cache in the background
- Source:
(async) loadSchemas() → {Promise}
- Description:
- Loads schemas from the local copy of the Adapt framework and registers them with the app
- Source:
Returns:
- Type
- Promise
(async) logStatus()
- Description:
- Logs relevant framework status messages
- Source:
(async) migrateCourses(options) → {Promise.<{migrated: Number, failed: Number, errors: Array}>}
- Description:
- Migrates content for specific courses. Called by contentplugin on plugin update.
- Source:
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
- Type
- Promise.<{migrated: Number, failed: Number, errors: Array}>
prebuildCache() → {Promise.<void>}
- Description:
- Eagerly rebuilds the prebuilt cache in the background, iterating every (theme, menu) combination of installed plugins. Safe to call multiple times — if a build is already in progress, it will be reused. Idempotent — already-cached combos are skipped.
- Source:
Returns:
- Type
- Promise.<void>
(async) updateFramework(version) → {Promise}
- Description:
- Updates the local copy of the Adapt framework
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string | The version to update to |
Returns:
- Type
- Promise