adapt-authoring-jsonschema 0.0.1 → 1.1.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.
@@ -1,142 +1,142 @@
1
- export default {
2
- a: ['class', 'href', 'target', 'title'],
3
- abbr: ['title'],
4
- address: [],
5
- area: ['alt', 'coords', 'href', 'shape'],
6
- article: [],
7
- aside: ['aria-hidden', 'class', 'role'],
8
- audio: [
9
- 'autoplay',
10
- 'controls',
11
- 'crossorigin',
12
- 'loop',
13
- 'muted',
14
- 'preload',
15
- 'src'
16
- ],
17
- b: [],
18
- bdi: ['dir'],
19
- bdo: ['dir'],
20
- big: [],
21
- blockquote: ['cite'],
22
- br: [],
23
- button: ['class'],
24
- caption: [],
25
- center: [],
26
- cite: [],
27
- code: [],
28
- col: ['align', 'span', 'valign', 'width'],
29
- colgroup: ['align', 'span', 'valign', 'width'],
30
- data: [],
31
- dd: [],
32
- del: ['datetime'],
33
- dfn: [],
34
- details: ['open'],
35
- div: [
36
- 'aria-describedby',
37
- 'aria-description',
38
- 'aria-label',
39
- 'aria-hidden',
40
- 'class',
41
- 'role',
42
- 'tabindex'
43
- ],
44
- dl: [],
45
- dt: [],
46
- em: [],
47
- figcaption: [],
48
- figure: ['class'],
49
- font: ['color', 'face', 'size'],
50
- footer: [],
51
- h1: ['class'],
52
- h2: ['class'],
53
- h3: ['class'],
54
- h4: ['class'],
55
- h5: ['class'],
56
- h6: ['class'],
57
- header: [],
58
- hr: [],
59
- i: [],
60
- img: [
61
- 'alt',
62
- 'aria-hidden',
63
- 'aria-label',
64
- 'class',
65
- 'height',
66
- 'loading',
67
- 'src',
68
- 'title',
69
- 'width'
70
- ],
71
- ins: ['datetime'],
72
- kbd: [],
73
- li: ['class'],
74
- mark: [],
75
- math: [],
76
- mfrac: [],
77
- mi: [],
78
- mn: [],
79
- mo: [],
80
- mover: [],
81
- mrow: [],
82
- ms: [],
83
- mspace: [],
84
- msub: [],
85
- msubsup: [],
86
- msup: [],
87
- mtext: [],
88
- munder: [],
89
- munderover: [],
90
- nav: [],
91
- ol: ['class'],
92
- p: ['lang'],
93
- pre: [],
94
- q: [],
95
- rp: [],
96
- rt: [],
97
- ruby: [],
98
- s: [],
99
- samp: [],
100
- section: [],
101
- small: [],
102
- span: [
103
- 'aria-describedby',
104
- 'aria-description',
105
- 'aria-label',
106
- 'aria-hidden',
107
- 'class',
108
- 'role',
109
- 'tabindex'
110
- ],
111
- sub: [],
112
- summary: [],
113
- sup: [],
114
- strong: [],
115
- strike: [],
116
- table: ['align', 'border', 'width', 'valign'],
117
- tbody: ['align', 'valign'],
118
- td: ['align', 'colspan', 'rowspan', 'valign', 'width'],
119
- tfoot: ['align', 'valign'],
120
- th: ['align', 'colspan', 'rowspan', 'valign', 'width'],
121
- thead: ['align', 'valign'],
122
- time: [],
123
- tr: ['align', 'rowspan', 'valign'],
124
- tt: [],
125
- u: [],
126
- ul: ['class'],
127
- var: [],
128
- video: [
129
- 'autoplay',
130
- 'controls',
131
- 'crossorigin',
132
- 'loop',
133
- 'muted',
134
- 'playsinline',
135
- 'poster',
136
- 'preload',
137
- 'src',
138
- 'height',
139
- 'width'
140
- ],
141
- wbr: []
142
- }
1
+ export default {
2
+ a: ['class', 'href', 'target', 'title'],
3
+ abbr: ['title'],
4
+ address: [],
5
+ area: ['alt', 'coords', 'href', 'shape'],
6
+ article: [],
7
+ aside: ['aria-hidden', 'class', 'role'],
8
+ audio: [
9
+ 'autoplay',
10
+ 'controls',
11
+ 'crossorigin',
12
+ 'loop',
13
+ 'muted',
14
+ 'preload',
15
+ 'src'
16
+ ],
17
+ b: [],
18
+ bdi: ['dir'],
19
+ bdo: ['dir'],
20
+ big: [],
21
+ blockquote: ['cite'],
22
+ br: [],
23
+ button: ['class'],
24
+ caption: [],
25
+ center: [],
26
+ cite: [],
27
+ code: [],
28
+ col: ['align', 'span', 'valign', 'width'],
29
+ colgroup: ['align', 'span', 'valign', 'width'],
30
+ data: [],
31
+ dd: [],
32
+ del: ['datetime'],
33
+ dfn: [],
34
+ details: ['open'],
35
+ div: [
36
+ 'aria-describedby',
37
+ 'aria-description',
38
+ 'aria-label',
39
+ 'aria-hidden',
40
+ 'class',
41
+ 'role',
42
+ 'tabindex'
43
+ ],
44
+ dl: [],
45
+ dt: [],
46
+ em: [],
47
+ figcaption: [],
48
+ figure: ['class'],
49
+ font: ['color', 'face', 'size'],
50
+ footer: [],
51
+ h1: ['class'],
52
+ h2: ['class'],
53
+ h3: ['class'],
54
+ h4: ['class'],
55
+ h5: ['class'],
56
+ h6: ['class'],
57
+ header: [],
58
+ hr: [],
59
+ i: [],
60
+ img: [
61
+ 'alt',
62
+ 'aria-hidden',
63
+ 'aria-label',
64
+ 'class',
65
+ 'height',
66
+ 'loading',
67
+ 'src',
68
+ 'title',
69
+ 'width'
70
+ ],
71
+ ins: ['datetime'],
72
+ kbd: [],
73
+ li: ['class'],
74
+ mark: [],
75
+ math: [],
76
+ mfrac: [],
77
+ mi: [],
78
+ mn: [],
79
+ mo: [],
80
+ mover: [],
81
+ mrow: [],
82
+ ms: [],
83
+ mspace: [],
84
+ msub: [],
85
+ msubsup: [],
86
+ msup: [],
87
+ mtext: [],
88
+ munder: [],
89
+ munderover: [],
90
+ nav: [],
91
+ ol: ['class'],
92
+ p: ['lang'],
93
+ pre: [],
94
+ q: [],
95
+ rp: [],
96
+ rt: [],
97
+ ruby: [],
98
+ s: [],
99
+ samp: [],
100
+ section: [],
101
+ small: [],
102
+ span: [
103
+ 'aria-describedby',
104
+ 'aria-description',
105
+ 'aria-label',
106
+ 'aria-hidden',
107
+ 'class',
108
+ 'role',
109
+ 'tabindex'
110
+ ],
111
+ sub: [],
112
+ summary: [],
113
+ sup: [],
114
+ strong: [],
115
+ strike: [],
116
+ table: ['align', 'border', 'width', 'valign'],
117
+ tbody: ['align', 'valign'],
118
+ td: ['align', 'colspan', 'rowspan', 'valign', 'width'],
119
+ tfoot: ['align', 'valign'],
120
+ th: ['align', 'colspan', 'rowspan', 'valign', 'width'],
121
+ thead: ['align', 'valign'],
122
+ time: [],
123
+ tr: ['align', 'rowspan', 'valign'],
124
+ tt: [],
125
+ u: [],
126
+ ul: ['class'],
127
+ var: [],
128
+ video: [
129
+ 'autoplay',
130
+ 'controls',
131
+ 'crossorigin',
132
+ 'loop',
133
+ 'muted',
134
+ 'playsinline',
135
+ 'poster',
136
+ 'preload',
137
+ 'src',
138
+ 'height',
139
+ 'width'
140
+ ],
141
+ wbr: []
142
+ }
package/lib/typedefs.js CHANGED
@@ -1,48 +1,48 @@
1
- /**
2
- * This file exists to define the below types for documentation purposes.
3
- */
4
- /**
5
- * Ajv JSON Schema validator
6
- * @memberof jsonschema
7
- * @external Ajv
8
- * @see {@link https://ajv.js.org/api.html#ajv-constructor-and-methods}
9
- */
10
- /**
11
- * Ajv custom keyword definition
12
- * @memberof jsonschema
13
- * @external AjvKeyword
14
- * @see {@link https://ajv.js.org/keywords.html}
15
- */
16
- /**
17
- * @memberof jsonschema
18
- * @typedef {Object} ApplyPatchProperties
19
- * @property {Object} extendAnnotations Whether annotation properties should be overwitten by the patch
20
- * @property {Object} strict Restricts patches to only merge/patch schemas
21
- * @property {Object} overwriteProperties Whether existing properties should be overwritten by the patch schema
22
- */
23
- /**
24
- * @memberof jsonschema
25
- * @typedef {Object} LoadSchemaOptions
26
- * @property {Boolean} applyExtensions Whether extension schemas are applied
27
- * @property {function} extensionFilter Function to selectively apply schema extensions. Function should return a boolean to signify whether the extension should be applied
28
- * @property {Boolean} useCache Whether cached should be returned
29
- */
30
- /**
31
- * @memberof jsonschema
32
- * @typedef {Object} RegisterSchemaOptions
33
- * @property {Boolean} replace Will replace the existing schema if one exists
34
- */
35
- /**
36
- * @memberof jsonschema
37
- * @typedef {Object} SanitiseOptions
38
- * @property {Boolean} isInternal Whether internal attributes should be filtered
39
- * @property {Boolean} isReadOnly Whether read-only attributes should be filtered
40
- * @property {Boolean} sanitiseHtml Whether HTML text should be filtered
41
- * @property {Boolean} strict Whether to throw errors
42
- */
43
- /**
44
- * @memberof jsonschema
45
- * @typedef {Object} ValidateOptions
46
- * @property {Boolean} useDefaults Whether to apply defaults
47
- * @property {Boolean} ignoreRequired Whether to ignore missing required fields
1
+ /**
2
+ * This file exists to define the below types for documentation purposes.
3
+ */
4
+ /**
5
+ * Ajv JSON Schema validator
6
+ * @memberof jsonschema
7
+ * @external Ajv
8
+ * @see {@link https://ajv.js.org/api.html#ajv-constructor-and-methods}
9
+ */
10
+ /**
11
+ * Ajv custom keyword definition
12
+ * @memberof jsonschema
13
+ * @external AjvKeyword
14
+ * @see {@link https://ajv.js.org/keywords.html}
15
+ */
16
+ /**
17
+ * @memberof jsonschema
18
+ * @typedef {Object} ApplyPatchProperties
19
+ * @property {Object} extendAnnotations Whether annotation properties should be overwitten by the patch
20
+ * @property {Object} strict Restricts patches to only merge/patch schemas
21
+ * @property {Object} overwriteProperties Whether existing properties should be overwritten by the patch schema
22
+ */
23
+ /**
24
+ * @memberof jsonschema
25
+ * @typedef {Object} LoadSchemaOptions
26
+ * @property {Boolean} applyExtensions Whether extension schemas are applied
27
+ * @property {function} extensionFilter Function to selectively apply schema extensions. Function should return a boolean to signify whether the extension should be applied
28
+ * @property {Boolean} useCache Whether cached should be returned
29
+ */
30
+ /**
31
+ * @memberof jsonschema
32
+ * @typedef {Object} RegisterSchemaOptions
33
+ * @property {Boolean} replace Will replace the existing schema if one exists
34
+ */
35
+ /**
36
+ * @memberof jsonschema
37
+ * @typedef {Object} SanitiseOptions
38
+ * @property {Boolean} isInternal Whether internal attributes should be filtered
39
+ * @property {Boolean} isReadOnly Whether read-only attributes should be filtered
40
+ * @property {Boolean} sanitiseHtml Whether HTML text should be filtered
41
+ * @property {Boolean} strict Whether to throw errors
42
+ */
43
+ /**
44
+ * @memberof jsonschema
45
+ * @typedef {Object} ValidateOptions
46
+ * @property {Boolean} useDefaults Whether to apply defaults
47
+ * @property {Boolean} ignoreRequired Whether to ignore missing required fields
48
48
  */
package/package.json CHANGED
@@ -1,29 +1,64 @@
1
- {
2
- "name": "adapt-authoring-jsonschema",
3
- "version": "0.0.1",
4
- "description": "Module to add support for the JSON schema specification",
5
- "homepage": "https://github.com/adapt-security/adapt-authoring-jsonschema",
6
- "license": "GPL-3.0",
7
- "type": "module",
8
- "main": "index.js",
9
- "bin": {
10
- "at-schemacheck": "./bin/check.js"
11
- },
12
- "repository": "github:adapt-security/adapt-authoring-jsonschema",
13
- "dependencies": {
14
- "ajv": "^8.12.0",
15
- "bytes": "^3.1.2",
16
- "glob": "^11.0.0",
17
- "lodash": "^4.17.21",
18
- "ms": "^2.1.3",
19
- "safe-regex": "2.1.1",
20
- "xss": "^1.0.14"
21
- },
22
- "peerDependencies": {
23
- "adapt-authoring-core": "github:adapt-security/adapt-authoring-core"
24
- },
25
- "devDependencies": {
26
- "eslint": "^9.12.0",
27
- "standard": "^17.1.0"
28
- }
29
- }
1
+ {
2
+ "name": "adapt-authoring-jsonschema",
3
+ "version": "1.1.0",
4
+ "description": "Module to add support for the JSON schema specification",
5
+ "homepage": "https://github.com/adapt-security/adapt-authoring-jsonschema",
6
+ "license": "GPL-3.0",
7
+ "type": "module",
8
+ "main": "index.js",
9
+ "bin": {
10
+ "at-schemacheck": "./bin/check.js"
11
+ },
12
+ "repository": "github:adapt-security/adapt-authoring-jsonschema",
13
+ "dependencies": {
14
+ "ajv": "^8.12.0",
15
+ "bytes": "^3.1.2",
16
+ "glob": "^11.0.0",
17
+ "lodash": "^4.17.21",
18
+ "ms": "^2.1.3",
19
+ "safe-regex": "2.1.1",
20
+ "xss": "^1.0.14"
21
+ },
22
+ "peerDependencies": {
23
+ "adapt-authoring-core": "github:adapt-security/adapt-authoring-core"
24
+ },
25
+ "devDependencies": {
26
+ "eslint": "^9.12.0",
27
+ "standard": "^17.1.0",
28
+ "@semantic-release/commit-analyzer": "^9.0.2",
29
+ "@semantic-release/git": "^10.0.1",
30
+ "@semantic-release/github": "^8.0.5",
31
+ "@semantic-release/npm": "^9.0.1",
32
+ "@semantic-release/release-notes-generator": "^10.0.3",
33
+ "conventional-changelog-eslint": "^3.0.9",
34
+ "semantic-release": "^21.0.1",
35
+ "semantic-release-replace-plugin": "^1.2.7"
36
+ },
37
+ "release": {
38
+ "plugins": [
39
+ [
40
+ "@semantic-release/commit-analyzer",
41
+ {
42
+ "preset": "eslint"
43
+ }
44
+ ],
45
+ [
46
+ "@semantic-release/release-notes-generator",
47
+ {
48
+ "preset": "eslint"
49
+ }
50
+ ],
51
+ "@semantic-release/npm",
52
+ "@semantic-release/github",
53
+ [
54
+ "@semantic-release/git",
55
+ {
56
+ "assets": [
57
+ "package.json"
58
+ ],
59
+ "message": "Chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
60
+ }
61
+ ]
62
+ ]
63
+ }
64
+ }
@@ -1,13 +1,13 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$anchor": "base",
4
- "description": "The base schema inherited by all other schemas",
5
- "type": "object",
6
- "properties": {
7
- "_id": {
8
- "description": "Unique identifier",
9
- "type": "string",
10
- "isObjectId": true
11
- }
12
- }
13
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$anchor": "base",
4
+ "description": "The base schema inherited by all other schemas",
5
+ "type": "object",
6
+ "properties": {
7
+ "_id": {
8
+ "description": "Unique identifier",
9
+ "type": "string",
10
+ "isObjectId": true
11
+ }
12
+ }
13
+ }