@dmptool/types 1.2.6 → 2.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.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/dist/answers/__tests__/defaults.spec.js +216 -0
  3. package/dist/answers/answer.d.ts +29 -14
  4. package/dist/answers/answer.js +11 -5
  5. package/dist/answers/dateAnswers.d.ts +20 -47
  6. package/dist/answers/dateAnswers.js +20 -10
  7. package/dist/answers/graphQLAnswers.d.ts +48 -120
  8. package/dist/answers/graphQLAnswers.js +46 -21
  9. package/dist/answers/index.d.ts +155 -1439
  10. package/dist/answers/index.js +26 -1
  11. package/dist/answers/numberAnswers.d.ts +38 -92
  12. package/dist/answers/numberAnswers.js +38 -19
  13. package/dist/answers/optionBasedAnswers.d.ts +42 -87
  14. package/dist/answers/optionBasedAnswers.js +37 -21
  15. package/dist/answers/tableAnswers.d.ts +348 -3032
  16. package/dist/answers/tableAnswers.js +25 -61
  17. package/dist/answers/textAnswers.d.ts +32 -68
  18. package/dist/answers/textAnswers.js +30 -17
  19. package/dist/dmp/__tests__/commonStandard.spec.d.ts +1 -0
  20. package/dist/dmp/__tests__/commonStandard.spec.js +210 -0
  21. package/dist/dmp/__tests__/extensions.spec.d.ts +1 -0
  22. package/dist/dmp/__tests__/extensions.spec.js +99 -0
  23. package/dist/dmp/extension.d.ts +1006 -0
  24. package/dist/dmp/extension.js +234 -0
  25. package/dist/dmp/index.d.ts +9 -0
  26. package/dist/dmp/index.js +23 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/questions/__tests__/dateQuestions.spec.js +3 -0
  30. package/dist/questions/__tests__/defaults.spec.d.ts +1 -0
  31. package/dist/questions/__tests__/defaults.spec.js +668 -0
  32. package/dist/questions/__tests__/optionBasedQuestions.spec.js +3 -2
  33. package/dist/questions/__tests__/tableQuestion.spec.js +22 -23
  34. package/dist/questions/__tests__/textQuestions.spec.js +32 -0
  35. package/dist/questions/dateQuestions.d.ts +45 -191
  36. package/dist/questions/dateQuestions.js +26 -23
  37. package/dist/questions/graphQLQuestions.d.ts +262 -556
  38. package/dist/questions/graphQLQuestions.js +225 -223
  39. package/dist/questions/index.d.ts +670 -7441
  40. package/dist/questions/index.js +26 -1
  41. package/dist/questions/numberQuestions.d.ts +85 -331
  42. package/dist/questions/numberQuestions.js +50 -36
  43. package/dist/questions/optionBasedQuestions.d.ts +83 -290
  44. package/dist/questions/optionBasedQuestions.js +58 -41
  45. package/dist/questions/question.d.ts +72 -35
  46. package/dist/questions/question.js +14 -5
  47. package/dist/questions/tableQuestions.d.ts +2228 -9599
  48. package/dist/questions/tableQuestions.js +185 -192
  49. package/dist/questions/textQuestions.d.ts +70 -226
  50. package/dist/questions/textQuestions.js +31 -31
  51. package/dist/schemas/affiliationSearchAnswer.schema.json +35 -33
  52. package/dist/schemas/affiliationSearchQuestion.schema.json +124 -122
  53. package/dist/schemas/anyAnswer.schema.json +1229 -408
  54. package/dist/schemas/anyQuestion.schema.json +4312 -2023
  55. package/dist/schemas/anyTableColumnAnswer.schema.json +535 -314
  56. package/dist/schemas/anyTableColumnQuestion.schema.json +1309 -874
  57. package/dist/schemas/booleanAnswer.schema.json +22 -23
  58. package/dist/schemas/booleanQuestion.schema.json +39 -43
  59. package/dist/schemas/checkboxesAnswer.schema.json +27 -28
  60. package/dist/schemas/checkboxesQuestion.schema.json +63 -62
  61. package/dist/schemas/currencyAnswer.schema.json +22 -23
  62. package/dist/schemas/currencyQuestion.schema.json +57 -54
  63. package/dist/schemas/dateAnswer.schema.json +22 -23
  64. package/dist/schemas/dateQuestion.schema.json +50 -49
  65. package/dist/schemas/dateRangeAnswer.schema.json +35 -33
  66. package/dist/schemas/dateRangeQuestion.schema.json +87 -78
  67. package/dist/schemas/dmp.schema.json +2070 -0
  68. package/dist/schemas/dmpExtension.schema.json +1874 -0
  69. package/dist/schemas/emailAnswer.schema.json +22 -23
  70. package/dist/schemas/emailQuestion.schema.json +55 -53
  71. package/dist/schemas/licenseSearchAnswer.schema.json +40 -38
  72. package/dist/schemas/licenseSearchQuestion.schema.json +122 -146
  73. package/dist/schemas/metadataStandardSearchAnswer.schema.json +40 -38
  74. package/dist/schemas/metadataStandardSearchQuestion.schema.json +123 -156
  75. package/dist/schemas/multiselectBoxAnswer.schema.json +27 -28
  76. package/dist/schemas/multiselectBoxQuestion.schema.json +70 -71
  77. package/dist/schemas/numberAnswer.schema.json +22 -23
  78. package/dist/schemas/numberQuestion.schema.json +52 -50
  79. package/dist/schemas/numberRangeAnswer.schema.json +35 -33
  80. package/dist/schemas/numberRangeQuestion.schema.json +91 -60
  81. package/dist/schemas/numberWithContextAnswer.schema.json +35 -33
  82. package/dist/schemas/numberWithContextQuestion.schema.json +81 -70
  83. package/dist/schemas/radioButtonsAnswer.schema.json +22 -23
  84. package/dist/schemas/radioButtonsQuestion.schema.json +63 -62
  85. package/dist/schemas/repositorySearchAnswer.schema.json +40 -38
  86. package/dist/schemas/repositorySearchQuestion.schema.json +122 -162
  87. package/dist/schemas/researchOutputTableAnswer.schema.json +16622 -411
  88. package/dist/schemas/researchOutputTableQuestion.schema.json +114 -1157
  89. package/dist/schemas/selectBoxAnswer.schema.json +22 -23
  90. package/dist/schemas/selectBoxQuestion.schema.json +70 -71
  91. package/dist/schemas/tableAnswer.schema.json +581 -360
  92. package/dist/schemas/tableQuestion.schema.json +1388 -942
  93. package/dist/schemas/textAnswer.schema.json +22 -23
  94. package/dist/schemas/textAreaAnswer.schema.json +22 -23
  95. package/dist/schemas/textAreaQuestion.schema.json +65 -57
  96. package/dist/schemas/textQuestion.schema.json +50 -49
  97. package/dist/schemas/urlAnswer.schema.json +22 -23
  98. package/dist/schemas/urlQuestion.schema.json +50 -49
  99. package/package.json +6 -4
  100. package/dist/answers/__tests__/usage.spec.js +0 -178
  101. package/dist/questions/__tests__/usage.spec.d.ts +0 -8
  102. package/dist/questions/__tests__/usage.spec.js +0 -473
  103. /package/dist/answers/__tests__/{usage.spec.d.ts → defaults.spec.d.ts} +0 -0
@@ -1,34 +1,33 @@
1
1
  {
2
- "$ref": "#/definitions/BooleanAnswer",
3
- "definitions": {
4
- "BooleanAnswer": {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "const": "boolean"
8
+ },
9
+ "meta": {
5
10
  "type": "object",
6
11
  "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "boolean"
10
- },
11
- "meta": {
12
- "type": "object",
13
- "properties": {
14
- "schemaVersion": {
15
- "type": "string",
16
- "default": "1.0"
17
- }
18
- },
19
- "additionalProperties": false,
20
- "default": {}
21
- },
22
- "answer": {
23
- "type": "boolean",
24
- "default": false
12
+ "schemaVersion": {
13
+ "default": "1.0",
14
+ "type": "string"
25
15
  }
26
16
  },
27
17
  "required": [
28
- "type"
18
+ "schemaVersion"
29
19
  ],
30
20
  "additionalProperties": false
21
+ },
22
+ "answer": {
23
+ "default": false,
24
+ "type": "boolean"
31
25
  }
32
26
  },
33
- "$schema": "http://json-schema.org/draft-07/schema#"
27
+ "required": [
28
+ "type",
29
+ "meta",
30
+ "answer"
31
+ ],
32
+ "additionalProperties": false
34
33
  }
@@ -1,56 +1,52 @@
1
1
  {
2
- "$ref": "#/definitions/BooleanQuestion",
3
- "definitions": {
4
- "BooleanQuestion": {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "const": "boolean"
8
+ },
9
+ "attributes": {
5
10
  "type": "object",
6
11
  "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "boolean"
12
+ "label": {
13
+ "type": "string"
10
14
  },
11
- "attributes": {
12
- "type": "object",
13
- "properties": {
14
- "label": {
15
- "type": "string"
16
- },
17
- "help": {
18
- "type": "string"
19
- },
20
- "labelTranslationKey": {
21
- "type": "string"
22
- },
23
- "checked": {
24
- "type": "boolean",
25
- "default": false
26
- }
27
- },
28
- "additionalProperties": false,
29
- "default": {}
15
+ "value": {
16
+ "default": false,
17
+ "type": "boolean"
18
+ }
19
+ },
20
+ "required": [
21
+ "label",
22
+ "value"
23
+ ],
24
+ "additionalProperties": false
25
+ },
26
+ "meta": {
27
+ "type": "object",
28
+ "properties": {
29
+ "schemaVersion": {
30
+ "default": "1.0",
31
+ "type": "string"
32
+ },
33
+ "title": {
34
+ "type": "string"
30
35
  },
31
- "meta": {
32
- "type": "object",
33
- "properties": {
34
- "schemaVersion": {
35
- "type": "string",
36
- "default": "1.0"
37
- },
38
- "title": {
39
- "type": "string"
40
- },
41
- "usageDescription": {
42
- "type": "string"
43
- }
44
- },
45
- "additionalProperties": false,
46
- "default": {}
36
+ "usageDescription": {
37
+ "type": "string"
47
38
  }
48
39
  },
49
40
  "required": [
50
- "type"
41
+ "schemaVersion"
51
42
  ],
52
43
  "additionalProperties": false
53
44
  }
54
45
  },
55
- "$schema": "http://json-schema.org/draft-07/schema#"
46
+ "required": [
47
+ "type",
48
+ "attributes",
49
+ "meta"
50
+ ],
51
+ "additionalProperties": false
56
52
  }
@@ -1,39 +1,38 @@
1
1
  {
2
- "$ref": "#/definitions/CheckboxesAnswer",
3
- "definitions": {
4
- "CheckboxesAnswer": {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "const": "checkBoxes"
8
+ },
9
+ "meta": {
5
10
  "type": "object",
6
11
  "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "checkBoxes"
10
- },
11
- "meta": {
12
- "type": "object",
13
- "properties": {
14
- "schemaVersion": {
15
- "type": "string",
16
- "default": "1.0"
17
- }
18
- },
19
- "additionalProperties": false,
20
- "default": {}
21
- },
22
- "answer": {
23
- "type": "array",
24
- "items": {
25
- "type": "string"
26
- },
27
- "default": [
28
- ""
29
- ]
12
+ "schemaVersion": {
13
+ "default": "1.0",
14
+ "type": "string"
30
15
  }
31
16
  },
32
17
  "required": [
33
- "type"
18
+ "schemaVersion"
34
19
  ],
35
20
  "additionalProperties": false
21
+ },
22
+ "answer": {
23
+ "default": [
24
+ ""
25
+ ],
26
+ "type": "array",
27
+ "items": {
28
+ "type": "string"
29
+ }
36
30
  }
37
31
  },
38
- "$schema": "http://json-schema.org/draft-07/schema#"
32
+ "required": [
33
+ "type",
34
+ "meta",
35
+ "answer"
36
+ ],
37
+ "additionalProperties": false
39
38
  }
@@ -1,76 +1,77 @@
1
1
  {
2
- "$ref": "#/definitions/CheckboxesQuestion",
3
- "definitions": {
4
- "CheckboxesQuestion": {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "const": "checkBoxes"
8
+ },
9
+ "attributes": {
5
10
  "type": "object",
6
11
  "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "checkBoxes"
12
+ "label": {
13
+ "type": "string"
10
14
  },
11
- "attributes": {
12
- "type": "object",
13
- "properties": {
14
- "label": {
15
- "type": "string"
16
- },
17
- "help": {
18
- "type": "string"
19
- },
20
- "labelTranslationKey": {
21
- "type": "string"
22
- }
23
- },
24
- "additionalProperties": false,
25
- "default": {}
15
+ "help": {
16
+ "type": "string"
26
17
  },
27
- "meta": {
28
- "type": "object",
29
- "properties": {
30
- "schemaVersion": {
31
- "type": "string",
32
- "default": "1.0"
33
- },
34
- "title": {
35
- "type": "string"
36
- },
37
- "usageDescription": {
38
- "type": "string"
39
- }
40
- },
41
- "additionalProperties": false,
42
- "default": {}
18
+ "labelTranslationKey": {
19
+ "type": "string"
20
+ }
21
+ },
22
+ "additionalProperties": false
23
+ },
24
+ "meta": {
25
+ "type": "object",
26
+ "properties": {
27
+ "schemaVersion": {
28
+ "default": "1.0",
29
+ "type": "string"
43
30
  },
44
- "options": {
45
- "type": "array",
46
- "items": {
47
- "type": "object",
48
- "properties": {
49
- "label": {
50
- "type": "string",
51
- "default": "Option A"
52
- },
53
- "value": {
54
- "type": "string",
55
- "default": "a"
56
- },
57
- "checked": {
58
- "type": "boolean",
59
- "default": false
60
- }
61
- },
62
- "additionalProperties": false
63
- },
64
- "default": [
65
- {}
66
- ]
31
+ "title": {
32
+ "type": "string"
33
+ },
34
+ "usageDescription": {
35
+ "type": "string"
67
36
  }
68
37
  },
69
38
  "required": [
70
- "type"
39
+ "schemaVersion"
71
40
  ],
72
41
  "additionalProperties": false
42
+ },
43
+ "options": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "object",
47
+ "properties": {
48
+ "label": {
49
+ "default": "Option A",
50
+ "type": "string"
51
+ },
52
+ "value": {
53
+ "default": "a",
54
+ "type": "string"
55
+ },
56
+ "checked": {
57
+ "default": false,
58
+ "type": "boolean"
59
+ }
60
+ },
61
+ "required": [
62
+ "label",
63
+ "value",
64
+ "checked"
65
+ ],
66
+ "additionalProperties": false
67
+ }
73
68
  }
74
69
  },
75
- "$schema": "http://json-schema.org/draft-07/schema#"
70
+ "required": [
71
+ "type",
72
+ "attributes",
73
+ "meta",
74
+ "options"
75
+ ],
76
+ "additionalProperties": false
76
77
  }
@@ -1,34 +1,33 @@
1
1
  {
2
- "$ref": "#/definitions/CurrencyAnswer",
3
- "definitions": {
4
- "CurrencyAnswer": {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "const": "currency"
8
+ },
9
+ "meta": {
5
10
  "type": "object",
6
11
  "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "currency"
10
- },
11
- "meta": {
12
- "type": "object",
13
- "properties": {
14
- "schemaVersion": {
15
- "type": "string",
16
- "default": "1.0"
17
- }
18
- },
19
- "additionalProperties": false,
20
- "default": {}
21
- },
22
- "answer": {
23
- "type": "number",
24
- "default": 0
12
+ "schemaVersion": {
13
+ "default": "1.0",
14
+ "type": "string"
25
15
  }
26
16
  },
27
17
  "required": [
28
- "type"
18
+ "schemaVersion"
29
19
  ],
30
20
  "additionalProperties": false
21
+ },
22
+ "answer": {
23
+ "default": 0,
24
+ "type": "number"
31
25
  }
32
26
  },
33
- "$schema": "http://json-schema.org/draft-07/schema#"
27
+ "required": [
28
+ "type",
29
+ "meta",
30
+ "answer"
31
+ ],
32
+ "additionalProperties": false
34
33
  }
@@ -1,67 +1,70 @@
1
1
  {
2
- "$ref": "#/definitions/CurrencyQuestion",
3
- "definitions": {
4
- "CurrencyQuestion": {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "const": "currency"
8
+ },
9
+ "attributes": {
5
10
  "type": "object",
6
11
  "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "currency"
12
+ "label": {
13
+ "type": "string"
10
14
  },
11
- "attributes": {
12
- "type": "object",
13
- "properties": {
14
- "label": {
15
- "type": "string"
16
- },
17
- "help": {
18
- "type": "string"
19
- },
20
- "labelTranslationKey": {
21
- "type": "string"
22
- },
23
- "max": {
24
- "type": "number"
25
- },
26
- "min": {
27
- "type": "number",
28
- "default": 0
29
- },
30
- "step": {
31
- "type": "number",
32
- "default": 1
33
- },
34
- "denomination": {
35
- "type": "string",
36
- "default": "USD"
37
- }
38
- },
39
- "additionalProperties": false,
40
- "default": {}
15
+ "help": {
16
+ "type": "string"
41
17
  },
42
- "meta": {
43
- "type": "object",
44
- "properties": {
45
- "schemaVersion": {
46
- "type": "string",
47
- "default": "1.0"
48
- },
49
- "title": {
50
- "type": "string"
51
- },
52
- "usageDescription": {
53
- "type": "string"
54
- }
55
- },
56
- "additionalProperties": false,
57
- "default": {}
18
+ "labelTranslationKey": {
19
+ "type": "string"
20
+ },
21
+ "max": {
22
+ "type": "number"
23
+ },
24
+ "min": {
25
+ "default": 0,
26
+ "type": "number"
27
+ },
28
+ "step": {
29
+ "default": 1,
30
+ "type": "number"
31
+ },
32
+ "denomination": {
33
+ "default": "USD",
34
+ "type": "string"
35
+ }
36
+ },
37
+ "required": [
38
+ "min",
39
+ "step",
40
+ "denomination"
41
+ ],
42
+ "additionalProperties": false
43
+ },
44
+ "meta": {
45
+ "type": "object",
46
+ "properties": {
47
+ "schemaVersion": {
48
+ "default": "1.0",
49
+ "type": "string"
50
+ },
51
+ "title": {
52
+ "type": "string"
53
+ },
54
+ "usageDescription": {
55
+ "type": "string"
58
56
  }
59
57
  },
60
58
  "required": [
61
- "type"
59
+ "schemaVersion"
62
60
  ],
63
61
  "additionalProperties": false
64
62
  }
65
63
  },
66
- "$schema": "http://json-schema.org/draft-07/schema#"
64
+ "required": [
65
+ "type",
66
+ "attributes",
67
+ "meta"
68
+ ],
69
+ "additionalProperties": false
67
70
  }
@@ -1,34 +1,33 @@
1
1
  {
2
- "$ref": "#/definitions/DateAnswer",
3
- "definitions": {
4
- "DateAnswer": {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "type": {
6
+ "type": "string",
7
+ "const": "date"
8
+ },
9
+ "meta": {
5
10
  "type": "object",
6
11
  "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "date"
10
- },
11
- "meta": {
12
- "type": "object",
13
- "properties": {
14
- "schemaVersion": {
15
- "type": "string",
16
- "default": "1.0"
17
- }
18
- },
19
- "additionalProperties": false,
20
- "default": {}
21
- },
22
- "answer": {
23
- "type": "string",
24
- "default": ""
12
+ "schemaVersion": {
13
+ "default": "1.0",
14
+ "type": "string"
25
15
  }
26
16
  },
27
17
  "required": [
28
- "type"
18
+ "schemaVersion"
29
19
  ],
30
20
  "additionalProperties": false
21
+ },
22
+ "answer": {
23
+ "default": "",
24
+ "type": "string"
31
25
  }
32
26
  },
33
- "$schema": "http://json-schema.org/draft-07/schema#"
27
+ "required": [
28
+ "type",
29
+ "meta",
30
+ "answer"
31
+ ],
32
+ "additionalProperties": false
34
33
  }