adapt-authoring-adaptframework 0.0.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/.eslintignore +1 -0
- package/.eslintrc +14 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +55 -0
- package/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +22 -0
- package/.github/dependabot.yml +11 -0
- package/.github/pull_request_template.md +25 -0
- package/.github/workflows/labelled_prs.yml +16 -0
- package/.github/workflows/new.yml +29 -0
- package/adapt-authoring.json +5 -0
- package/conf/config.schema.json +44 -0
- package/errors/errors.json +100 -0
- package/index.js +8 -0
- package/lib/AdaptFrameworkBuild.js +517 -0
- package/lib/AdaptFrameworkImport.js +807 -0
- package/lib/AdaptFrameworkModule.js +319 -0
- package/lib/AdaptFrameworkUtils.js +362 -0
- package/lib/apidefs.js +152 -0
- package/lib/migrations/component.js +12 -0
- package/lib/migrations/config.js +11 -0
- package/lib/migrations/graphic-src.js +10 -0
- package/lib/migrations/nav-order.js +12 -0
- package/lib/migrations/parent-id.js +7 -0
- package/lib/migrations/remove-undef.js +13 -0
- package/lib/migrations/start-page.js +17 -0
- package/lib/migrations/theme-undef.js +9 -0
- package/package.json +31 -0
- package/schema/adaptbuild.schema.json +36 -0
package/.eslintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules
|
package/.eslintrc
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: File a bug report
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to fill out this bug report!
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: description
|
|
11
|
+
attributes:
|
|
12
|
+
label: What happened?
|
|
13
|
+
description: Please describe the issue
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: expected
|
|
18
|
+
attributes:
|
|
19
|
+
label: Expected behaviour
|
|
20
|
+
description: Tell us what should have happened
|
|
21
|
+
- type: textarea
|
|
22
|
+
id: repro-steps
|
|
23
|
+
attributes:
|
|
24
|
+
label: Steps to reproduce
|
|
25
|
+
description: Tell us how to reproduce the issue
|
|
26
|
+
validations:
|
|
27
|
+
required: true
|
|
28
|
+
- type: input
|
|
29
|
+
id: aat-version
|
|
30
|
+
attributes:
|
|
31
|
+
label: Authoring tool version
|
|
32
|
+
description: What version of the Adapt authoring tool are you running?
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
- type: input
|
|
36
|
+
id: fw-version
|
|
37
|
+
attributes:
|
|
38
|
+
label: Framework version
|
|
39
|
+
description: What version of the Adapt framework are you running?
|
|
40
|
+
- type: dropdown
|
|
41
|
+
id: browsers
|
|
42
|
+
attributes:
|
|
43
|
+
label: What browsers are you seeing the problem on?
|
|
44
|
+
multiple: true
|
|
45
|
+
options:
|
|
46
|
+
- Firefox
|
|
47
|
+
- Chrome
|
|
48
|
+
- Safari
|
|
49
|
+
- Microsoft Edge
|
|
50
|
+
- type: textarea
|
|
51
|
+
id: logs
|
|
52
|
+
attributes:
|
|
53
|
+
label: Relevant log output
|
|
54
|
+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
|
55
|
+
render: sh
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Request a new feature
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to request a new feature in the Adapt authoring tool! The Adapt team will consider all new feature requests, but unfortunately cannot commit to every one.
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: description
|
|
11
|
+
attributes:
|
|
12
|
+
label: Feature description
|
|
13
|
+
description: Please describe your feature request
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
16
|
+
- type: checkboxes
|
|
17
|
+
id: contribute
|
|
18
|
+
attributes:
|
|
19
|
+
label: Can you work on this feature?
|
|
20
|
+
description: If you are able to commit your own time to work on this feature, it will greatly increase the liklihood of it being implemented by the core dev team. Otherwise, it will be triaged and prioritised alongside the core team's current priorities.
|
|
21
|
+
options:
|
|
22
|
+
- label: I can contribute
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "npm" # See documentation for possible values
|
|
9
|
+
directory: "/" # Location of package manifests
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[//]: # (Please title your PR according to eslint commit conventions)
|
|
2
|
+
[//]: # (See https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint#eslint-convention for details)
|
|
3
|
+
|
|
4
|
+
[//]: # (Add a link to the original issue)
|
|
5
|
+
|
|
6
|
+
[//]: # (Delete as appropriate)
|
|
7
|
+
### Fix
|
|
8
|
+
* A sentence describing each fix
|
|
9
|
+
|
|
10
|
+
### Update
|
|
11
|
+
* A sentence describing each udpate
|
|
12
|
+
|
|
13
|
+
### New
|
|
14
|
+
* A sentence describing each new feature
|
|
15
|
+
|
|
16
|
+
### Breaking
|
|
17
|
+
* A sentence describing each breaking change
|
|
18
|
+
|
|
19
|
+
[//]: # (List appropriate steps for testing if needed)
|
|
20
|
+
### Testing
|
|
21
|
+
1. Steps for testing
|
|
22
|
+
|
|
23
|
+
[//]: # (Mention any other dependencies)
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Add labelled PRs to project
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [ labeled ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
add-to-project:
|
|
9
|
+
if: ${{ github.event.label.name == 'dependencies' }}
|
|
10
|
+
name: Add to main project
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/add-to-project@v0.1.0
|
|
14
|
+
with:
|
|
15
|
+
project-url: https://github.com/orgs/adapt-security/projects/5
|
|
16
|
+
github-token: ${{ secrets.PROJECTS_SECRET }}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Add to main project
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
pull_request:
|
|
8
|
+
types:
|
|
9
|
+
- opened
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
add-to-project:
|
|
13
|
+
name: Add to main project
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/add-to-project@v0.1.0
|
|
17
|
+
with:
|
|
18
|
+
project-url: https://github.com/orgs/adapt-security/projects/5
|
|
19
|
+
github-token: ${{ secrets.PROJECTS_SECRET }}
|
|
20
|
+
|
|
21
|
+
handle_precommit_pr:
|
|
22
|
+
if: contains(github.event.pull_request.title, '[pre-commit.ci]')
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Label pull request with "_bot"
|
|
27
|
+
run: gh pr edit ${{ github.event.pull_request.number }} -R ${{ github.repository }} --add-label "_bot"
|
|
28
|
+
env:
|
|
29
|
+
GH_TOKEN: ${{ secrets.PROJECTS_SECRET }}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"buildDir": {
|
|
6
|
+
"description": "Path to the folder where framework builds will be generated",
|
|
7
|
+
"type": "string",
|
|
8
|
+
"isDirectory": true,
|
|
9
|
+
"default": "$TEMP/framework-builds"
|
|
10
|
+
},
|
|
11
|
+
"buildLifespan": {
|
|
12
|
+
"description": "How long a build should remain valid for. Expects an amount followed by a space and then the unit (e.g. 5 hours)",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"isTimeMs": true,
|
|
15
|
+
"default": "7d"
|
|
16
|
+
},
|
|
17
|
+
"enableUpdateApi": {
|
|
18
|
+
"description": "Whether the Adapt framework can be updated via the REST API",
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"default": true,
|
|
21
|
+
"_adapt": {
|
|
22
|
+
"isPublic": true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"frameworkDir": {
|
|
26
|
+
"description": "Path to the adapt_framework source folder",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"isDirectory": true,
|
|
29
|
+
"default": "$TEMP/adapt_framework"
|
|
30
|
+
},
|
|
31
|
+
"frameworkRepository": {
|
|
32
|
+
"description": "URL of the Adapt framework git repository to install",
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"importMaxFileSize": {
|
|
36
|
+
"description": "Maximum file upload size for course imports",
|
|
37
|
+
"type": "string",
|
|
38
|
+
"isBytes": true,
|
|
39
|
+
"isMutable": true,
|
|
40
|
+
"isPublic": true,
|
|
41
|
+
"default": "1gb"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"FW_BUILD_NOT_FOUND": {
|
|
3
|
+
"data": {
|
|
4
|
+
"_id": "Database document _id value for the missing course build"
|
|
5
|
+
},
|
|
6
|
+
"description": "Framework build could not be found in the database",
|
|
7
|
+
"statusCode": 404
|
|
8
|
+
},
|
|
9
|
+
"FW_CLI_BUILD_FAILED": {
|
|
10
|
+
"data": {
|
|
11
|
+
"cmd": "The command that caused the error",
|
|
12
|
+
"raw": "The raw error output"
|
|
13
|
+
},
|
|
14
|
+
"description": "Framework build using the adapt-cli failed",
|
|
15
|
+
"statusCode": 500
|
|
16
|
+
},
|
|
17
|
+
"FW_CLI_UNKNOWN_CMD": {
|
|
18
|
+
"data": {
|
|
19
|
+
"command": "The command"
|
|
20
|
+
},
|
|
21
|
+
"description": "Framework build using the adapt-cli failed",
|
|
22
|
+
"statusCode": 500
|
|
23
|
+
},
|
|
24
|
+
"FW_IMPORT_CONTENT_FAILED": {
|
|
25
|
+
"data": {
|
|
26
|
+
"errors": "Accompanying errors"
|
|
27
|
+
},
|
|
28
|
+
"description": "Import of framework content failed",
|
|
29
|
+
"statusCode": 400
|
|
30
|
+
},
|
|
31
|
+
"FW_IMPORT_FAILED": {
|
|
32
|
+
"data": {
|
|
33
|
+
"error": "The error"
|
|
34
|
+
},
|
|
35
|
+
"description": "Import of framework course failed",
|
|
36
|
+
"statusCode": 400
|
|
37
|
+
},
|
|
38
|
+
"FW_IMPORT_INCOMPAT": {
|
|
39
|
+
"data": {
|
|
40
|
+
"import": "Framework version used in import course",
|
|
41
|
+
"installed": "Framework version currently installed on the server"
|
|
42
|
+
},
|
|
43
|
+
"description": "Course for import uses a framework version incompatible with that installed",
|
|
44
|
+
"statusCode": 400
|
|
45
|
+
},
|
|
46
|
+
"FW_IMPORT_INVALID": {
|
|
47
|
+
"description": "An invalid import zip has been provided",
|
|
48
|
+
"statusCode": 400
|
|
49
|
+
},
|
|
50
|
+
"FW_IMPORT_INVALID_COURSE": {
|
|
51
|
+
"description": "An invalid course has been provided",
|
|
52
|
+
"statusCode": 400
|
|
53
|
+
},
|
|
54
|
+
"FW_IMPORT_INVALID_CONTENT": {
|
|
55
|
+
"description": "An invalid content item has been found in import data",
|
|
56
|
+
"statusCode": 400,
|
|
57
|
+
"data": {
|
|
58
|
+
"item": "The invalid content item"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"FW_IMPORT_MISSING_PLUGINS": {
|
|
62
|
+
"description": "Course for import uses plugins which are missing from the server",
|
|
63
|
+
"statusCode": 400
|
|
64
|
+
},
|
|
65
|
+
"FW_IMPORT_PLUGINS_FAILED": {
|
|
66
|
+
"description": "Import of framework plugins failed",
|
|
67
|
+
"statusCode": 500
|
|
68
|
+
},
|
|
69
|
+
"FW_IMPORT_UNEXPECTED_STRUCTURE": {
|
|
70
|
+
"description": "Unable to generate valid course structure from input JSON data",
|
|
71
|
+
"statusCode": 500
|
|
72
|
+
},
|
|
73
|
+
"FW_INCOMPAT_PLUGIN_DEP": {
|
|
74
|
+
"data": {
|
|
75
|
+
"name": "Incompatible plugin name",
|
|
76
|
+
"version": "Incompatible plugin version"
|
|
77
|
+
},
|
|
78
|
+
"description": "Plugin is incompatible",
|
|
79
|
+
"statusCode": 500
|
|
80
|
+
},
|
|
81
|
+
"FW_INSTALL_FAILED": {
|
|
82
|
+
"description": "Installation of the framework failed",
|
|
83
|
+
"statusCode": 500
|
|
84
|
+
},
|
|
85
|
+
"FW_INVALID_VERSION": {
|
|
86
|
+
"data": {
|
|
87
|
+
"name": "Incompatible plugin name",
|
|
88
|
+
"version": "Incompatible plugin version"
|
|
89
|
+
},
|
|
90
|
+
"description": "Invalid version specified",
|
|
91
|
+
"statusCode": 400
|
|
92
|
+
},
|
|
93
|
+
"FW_MISSING_PLUGIN_DEP": {
|
|
94
|
+
"data": {
|
|
95
|
+
"name": "Missing plugin name"
|
|
96
|
+
},
|
|
97
|
+
"description": "Plugin is missing a dependency",
|
|
98
|
+
"statusCode": 500
|
|
99
|
+
}
|
|
100
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapt framework integration
|
|
3
|
+
* @namespace adaptframework
|
|
4
|
+
*/
|
|
5
|
+
export { default } from './lib/AdaptFrameworkModule.js'
|
|
6
|
+
export { default as AdaptFrameworkBuild } from './lib/AdaptFrameworkBuild.js'
|
|
7
|
+
export { default as AdaptFrameworkImport } from './lib/AdaptFrameworkImport.js'
|
|
8
|
+
export { default as AdaptFrameworkUtils } from './lib/AdaptFrameworkUtils.js'
|