@dmptool/types 1.1.2 → 1.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.
Files changed (78) hide show
  1. package/README.md +119 -47
  2. package/dist/answers/__tests__/answers.spec.js +20 -28
  3. package/dist/answers/__tests__/usage.spec.d.ts +1 -0
  4. package/dist/answers/__tests__/usage.spec.js +175 -0
  5. package/dist/answers/answer.d.ts +12 -15
  6. package/dist/answers/answer.js +3 -4
  7. package/dist/answers/dateAnswers.d.ts +30 -30
  8. package/dist/answers/dateAnswers.js +6 -5
  9. package/dist/answers/graphQLAnswers.d.ts +25 -25
  10. package/dist/answers/graphQLAnswers.js +4 -4
  11. package/dist/answers/index.d.ts +860 -1088
  12. package/dist/answers/index.js +2 -2
  13. package/dist/answers/numberAnswers.d.ts +41 -41
  14. package/dist/answers/numberAnswers.js +8 -8
  15. package/dist/answers/optionBasedAnswers.d.ts +55 -55
  16. package/dist/answers/optionBasedAnswers.js +10 -10
  17. package/dist/answers/tableAnswers.d.ts +811 -1772
  18. package/dist/answers/tableAnswers.js +12 -8
  19. package/dist/answers/textAnswers.d.ts +44 -44
  20. package/dist/answers/textAnswers.js +8 -8
  21. package/dist/questions/__tests__/graphQLQuestions.spec.js +6 -4
  22. package/dist/questions/__tests__/optionBasedQuestions.spec.js +4 -12
  23. package/dist/questions/__tests__/usage.spec.d.ts +8 -0
  24. package/dist/questions/__tests__/usage.spec.js +312 -0
  25. package/dist/questions/dateQuestions.d.ts +90 -101
  26. package/dist/questions/dateQuestions.js +15 -34
  27. package/dist/questions/graphQLQuestions.d.ts +176 -182
  28. package/dist/questions/graphQLQuestions.js +44 -45
  29. package/dist/questions/index.d.ts +1791 -2170
  30. package/dist/questions/index.js +2 -2
  31. package/dist/questions/numberQuestions.d.ts +126 -142
  32. package/dist/questions/numberQuestions.js +11 -45
  33. package/dist/questions/optionBasedQuestions.d.ts +197 -225
  34. package/dist/questions/optionBasedQuestions.js +24 -88
  35. package/dist/questions/question.d.ts +24 -56
  36. package/dist/questions/question.js +78 -18
  37. package/dist/questions/tableQuestions.d.ts +2637 -2930
  38. package/dist/questions/tableQuestions.js +9 -21
  39. package/dist/questions/textQuestions.d.ts +125 -145
  40. package/dist/questions/textQuestions.js +16 -57
  41. package/dist/schemas/affiliationSearchAnswer.schema.json +9 -12
  42. package/dist/schemas/affiliationSearchQuestion.schema.json +57 -50
  43. package/dist/schemas/anyAnswer.schema.json +228 -237
  44. package/dist/schemas/anyQuestion.schema.json +349 -517
  45. package/dist/schemas/anyTableColumnAnswer.schema.json +93 -106
  46. package/dist/schemas/anyTableColumnQuestion.schema.json +259 -382
  47. package/dist/schemas/booleanAnswer.schema.json +8 -11
  48. package/dist/schemas/booleanQuestion.schema.json +9 -15
  49. package/dist/schemas/checkboxesAnswer.schema.json +13 -14
  50. package/dist/schemas/checkboxesQuestion.schema.json +18 -24
  51. package/dist/schemas/currencyAnswer.schema.json +8 -11
  52. package/dist/schemas/currencyQuestion.schema.json +13 -17
  53. package/dist/schemas/dateAnswer.schema.json +8 -11
  54. package/dist/schemas/dateQuestion.schema.json +9 -15
  55. package/dist/schemas/dateRangeAnswer.schema.json +16 -21
  56. package/dist/schemas/dateRangeQuestion.schema.json +40 -21
  57. package/dist/schemas/emailAnswer.schema.json +8 -11
  58. package/dist/schemas/emailQuestion.schema.json +11 -16
  59. package/dist/schemas/filteredSearchQuestion.schema.json +0 -3
  60. package/dist/schemas/multiselectBoxAnswer.schema.json +13 -14
  61. package/dist/schemas/multiselectBoxQuestion.schema.json +20 -25
  62. package/dist/schemas/numberAnswer.schema.json +8 -11
  63. package/dist/schemas/numberQuestion.schema.json +11 -16
  64. package/dist/schemas/numberRangeAnswer.schema.json +17 -22
  65. package/dist/schemas/numberRangeQuestion.schema.json +22 -21
  66. package/dist/schemas/radioButtonsAnswer.schema.json +8 -11
  67. package/dist/schemas/radioButtonsQuestion.schema.json +18 -24
  68. package/dist/schemas/selectBoxAnswer.schema.json +8 -11
  69. package/dist/schemas/selectBoxQuestion.schema.json +20 -25
  70. package/dist/schemas/tableAnswer.schema.json +337 -343
  71. package/dist/schemas/tableQuestion.schema.json +279 -416
  72. package/dist/schemas/textAnswer.schema.json +8 -11
  73. package/dist/schemas/textAreaAnswer.schema.json +8 -11
  74. package/dist/schemas/textAreaQuestion.schema.json +13 -17
  75. package/dist/schemas/textQuestion.schema.json +9 -15
  76. package/dist/schemas/urlAnswer.schema.json +8 -11
  77. package/dist/schemas/urlQuestion.schema.json +9 -15
  78. package/package.json +1 -1
@@ -21,32 +21,25 @@
21
21
  "type": "string"
22
22
  }
23
23
  },
24
- "additionalProperties": false
24
+ "additionalProperties": false,
25
+ "default": {}
25
26
  },
26
27
  "meta": {
27
28
  "type": "object",
28
29
  "properties": {
29
30
  "schemaVersion": {
30
31
  "type": "string",
31
- "const": "1.0"
32
+ "default": "1.0"
32
33
  },
33
34
  "title": {
34
- "type": "string",
35
- "const": "Affiliation Search"
35
+ "type": "string"
36
36
  },
37
37
  "usageDescription": {
38
- "type": "string",
39
- "const": "For questions that require the user to select from a controlled list of institutions."
40
- },
41
- "defaultJSON": {
42
- "type": "string",
43
- "const": "{\"type\":\"affiliationSearch\",\"attributes\":{},\"meta\":{\"schemaVersion\":\"1.0\"},\"graphQL\":{\"query\":\"query Affiliations($name: String!){affiliations(name: $name) { totalCount nextCursor items {id displayName uri}}}\",\"queryId\":\"useAffiliationsQuery\",\"variables\":[{\"name\":\"term\",\"type\":\"string\",\"label\":\"Search for your institution\",\"minLength\":3,\"labelTranslationKey\":\"SignupPage.institutionHelp\"}],\"answerField\":\"uri\",\"displayFields\":[{\"label\":\"Institution\",\"propertyName\":\"displayName\",\"labelTranslationKey\":\"SignupPage.institution\"}],\"responseField\":\"affiliations.items\"}}"
38
+ "type": "string"
44
39
  }
45
40
  },
46
- "required": [
47
- "schemaVersion"
48
- ],
49
- "additionalProperties": false
41
+ "additionalProperties": false,
42
+ "default": {}
50
43
  },
51
44
  "graphQL": {
52
45
  "type": "object",
@@ -57,74 +50,88 @@
57
50
  "type": "object",
58
51
  "properties": {
59
52
  "propertyName": {
60
- "type": "string"
53
+ "type": "string",
54
+ "const": "displayName",
55
+ "default": "displayName"
61
56
  },
62
57
  "label": {
63
- "type": "string"
58
+ "type": "string",
59
+ "default": "Institution"
64
60
  },
65
61
  "labelTranslationKey": {
66
- "type": "string"
62
+ "type": "string",
63
+ "default": "SignupPage.institution"
67
64
  }
68
65
  },
69
- "required": [
70
- "propertyName",
71
- "label"
72
- ],
73
66
  "additionalProperties": false
74
- }
67
+ },
68
+ "default": [
69
+ {}
70
+ ]
75
71
  },
76
72
  "localQueryId": {
77
73
  "type": "string"
78
74
  },
79
75
  "query": {
80
- "type": "string"
76
+ "type": "string",
77
+ "const": "\nquery Affiliations($name: String!){\n affiliations(name: $name) {\n totalCount\n nextCursor\n items {\n id\n displayName\n uri\n }\n }\n}",
78
+ "default": "\nquery Affiliations($name: String!){\n affiliations(name: $name) {\n totalCount\n nextCursor\n items {\n id\n displayName\n uri\n }\n }\n}"
81
79
  },
82
80
  "responseField": {
83
- "type": "string"
81
+ "type": "string",
82
+ "const": "affiliations.items",
83
+ "default": "affiliations.items"
84
84
  },
85
85
  "variables": {
86
86
  "type": "array",
87
87
  "items": {
88
88
  "type": "object",
89
89
  "properties": {
90
- "minLength": {
91
- "type": "number"
92
- },
93
- "label": {
94
- "type": "string"
95
- },
96
- "labelTranslationKey": {
97
- "type": "string"
98
- },
99
90
  "name": {
100
- "type": "string"
91
+ "type": "string",
92
+ "const": "name",
93
+ "default": "name"
101
94
  },
102
95
  "type": {
103
- "type": "string"
96
+ "type": "string",
97
+ "default": "string"
98
+ },
99
+ "label": {
100
+ "type": "string",
101
+ "default": "Search for your institution"
102
+ },
103
+ "minLength": {
104
+ "type": "number",
105
+ "const": 3,
106
+ "default": 3
104
107
  },
105
- "defaultValue": {
106
- "type": "string"
108
+ "labelTranslationKey": {
109
+ "type": "string",
110
+ "default": "SignupPage.institutionHelp"
107
111
  }
108
112
  },
109
- "required": [
110
- "name",
111
- "type"
112
- ],
113
113
  "additionalProperties": false
114
- }
114
+ },
115
+ "default": [
116
+ {}
117
+ ]
118
+ },
119
+ "queryId": {
120
+ "type": "string",
121
+ "default": "useAffiliationsQuery"
122
+ },
123
+ "answerField": {
124
+ "type": "string",
125
+ "const": "uri",
126
+ "default": "uri"
115
127
  }
116
128
  },
117
- "required": [
118
- "displayFields",
119
- "responseField"
120
- ],
121
- "additionalProperties": false
129
+ "additionalProperties": false,
130
+ "default": {}
122
131
  }
123
132
  },
124
133
  "required": [
125
- "type",
126
- "meta",
127
- "graphQL"
134
+ "type"
128
135
  ],
129
136
  "additionalProperties": false
130
137
  }