@se-uulm/snowballr-api-client 0.2.1-alpha.3ebad36 → 0.2.1-alpha.4860d5f

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 (225) hide show
  1. package/.openapi-generator/FILES +17 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +2 -2
  5. package/dist/apis/ProjectsControllerApi.d.ts +13 -94
  6. package/dist/apis/ProjectsControllerApi.js +11 -120
  7. package/dist/apis/index.d.ts +0 -11
  8. package/dist/apis/index.js +0 -11
  9. package/dist/esm/apis/ProjectsControllerApi.d.ts +13 -94
  10. package/dist/esm/apis/ProjectsControllerApi.js +11 -120
  11. package/dist/esm/apis/index.d.ts +0 -11
  12. package/dist/esm/apis/index.js +0 -11
  13. package/dist/{models/ProjectResponse.d.ts → esm/models/Project.d.ts} +25 -25
  14. package/dist/esm/models/{ProjectResponse.js → Project.js} +10 -10
  15. package/dist/esm/models/index.d.ts +1 -38
  16. package/dist/esm/models/index.js +1 -38
  17. package/dist/{esm/models/ProjectResponse.d.ts → models/Project.d.ts} +25 -25
  18. package/dist/models/{ProjectResponse.js → Project.js} +16 -16
  19. package/dist/models/index.d.ts +1 -38
  20. package/dist/models/index.js +1 -38
  21. package/package.json +4 -10
  22. package/src/apis/ProjectsControllerApi.ts +238 -0
  23. package/src/apis/index.ts +3 -0
  24. package/src/index.ts +5 -0
  25. package/src/models/CreateProjectRequest.ts +65 -0
  26. package/src/models/DecisionMatrixPattern.ts +94 -0
  27. package/src/models/DecisionMatrixPatternEntry.ts +85 -0
  28. package/src/models/Project.ts +177 -0
  29. package/src/models/ReviewDecisionMatrix.ts +81 -0
  30. package/src/models/index.ts +7 -0
  31. package/src/runtime.ts +432 -0
  32. package/tsconfig.esm.json +7 -0
  33. package/tsconfig.json +16 -0
  34. package/dist/apis/AuthControllerApi.d.ts +0 -118
  35. package/dist/apis/AuthControllerApi.js +0 -170
  36. package/dist/apis/CriterionControllerApi.d.ts +0 -108
  37. package/dist/apis/CriterionControllerApi.js +0 -151
  38. package/dist/apis/ExportControllerApi.d.ts +0 -70
  39. package/dist/apis/ExportControllerApi.js +0 -101
  40. package/dist/apis/FetcherControllerApi.d.ts +0 -86
  41. package/dist/apis/FetcherControllerApi.js +0 -125
  42. package/dist/apis/InvitationControllerApi.d.ts +0 -88
  43. package/dist/apis/InvitationControllerApi.js +0 -120
  44. package/dist/apis/PaperControllerApi.d.ts +0 -128
  45. package/dist/apis/PaperControllerApi.js +0 -179
  46. package/dist/apis/ProjectMemberControllerApi.d.ts +0 -92
  47. package/dist/apis/ProjectMemberControllerApi.js +0 -128
  48. package/dist/apis/ProjectPaperControllerApi.d.ts +0 -190
  49. package/dist/apis/ProjectPaperControllerApi.js +0 -266
  50. package/dist/apis/ReadingListControllerApi.d.ts +0 -102
  51. package/dist/apis/ReadingListControllerApi.js +0 -138
  52. package/dist/apis/ReviewControllerApi.d.ts +0 -88
  53. package/dist/apis/ReviewControllerApi.js +0 -122
  54. package/dist/apis/UsersControllerApi.d.ts +0 -182
  55. package/dist/apis/UsersControllerApi.js +0 -257
  56. package/dist/esm/apis/AuthControllerApi.d.ts +0 -118
  57. package/dist/esm/apis/AuthControllerApi.js +0 -166
  58. package/dist/esm/apis/CriterionControllerApi.d.ts +0 -108
  59. package/dist/esm/apis/CriterionControllerApi.js +0 -147
  60. package/dist/esm/apis/ExportControllerApi.d.ts +0 -70
  61. package/dist/esm/apis/ExportControllerApi.js +0 -97
  62. package/dist/esm/apis/FetcherControllerApi.d.ts +0 -86
  63. package/dist/esm/apis/FetcherControllerApi.js +0 -121
  64. package/dist/esm/apis/InvitationControllerApi.d.ts +0 -88
  65. package/dist/esm/apis/InvitationControllerApi.js +0 -116
  66. package/dist/esm/apis/PaperControllerApi.d.ts +0 -128
  67. package/dist/esm/apis/PaperControllerApi.js +0 -175
  68. package/dist/esm/apis/ProjectMemberControllerApi.d.ts +0 -92
  69. package/dist/esm/apis/ProjectMemberControllerApi.js +0 -124
  70. package/dist/esm/apis/ProjectPaperControllerApi.d.ts +0 -190
  71. package/dist/esm/apis/ProjectPaperControllerApi.js +0 -262
  72. package/dist/esm/apis/ReadingListControllerApi.d.ts +0 -102
  73. package/dist/esm/apis/ReadingListControllerApi.js +0 -134
  74. package/dist/esm/apis/ReviewControllerApi.d.ts +0 -88
  75. package/dist/esm/apis/ReviewControllerApi.js +0 -118
  76. package/dist/esm/apis/UsersControllerApi.d.ts +0 -182
  77. package/dist/esm/apis/UsersControllerApi.js +0 -253
  78. package/dist/esm/models/AddPaperToProjectRequest.d.ts +0 -38
  79. package/dist/esm/models/AddPaperToProjectRequest.js +0 -43
  80. package/dist/esm/models/Author.d.ts +0 -38
  81. package/dist/esm/models/Author.js +0 -43
  82. package/dist/esm/models/ChangePasswordRequest.d.ts +0 -38
  83. package/dist/esm/models/ChangePasswordRequest.js +0 -43
  84. package/dist/esm/models/CreateCriterionRequest.d.ts +0 -65
  85. package/dist/esm/models/CreateCriterionRequest.js +0 -57
  86. package/dist/esm/models/CreatePaperRequest.d.ts +0 -84
  87. package/dist/esm/models/CreatePaperRequest.js +0 -59
  88. package/dist/esm/models/CreateReviewRequest.d.ts +0 -53
  89. package/dist/esm/models/CreateReviewRequest.js +0 -53
  90. package/dist/esm/models/Criterion.d.ts +0 -77
  91. package/dist/esm/models/Criterion.js +0 -61
  92. package/dist/esm/models/ExternalId.d.ts +0 -53
  93. package/dist/esm/models/ExternalId.js +0 -57
  94. package/dist/esm/models/FetcherInformation.d.ts +0 -54
  95. package/dist/esm/models/FetcherInformation.js +0 -50
  96. package/dist/esm/models/FetcherInformationWithId.d.ts +0 -39
  97. package/dist/esm/models/FetcherInformationWithId.js +0 -44
  98. package/dist/esm/models/FetcherOptionsSchema.d.ts +0 -56
  99. package/dist/esm/models/FetcherOptionsSchema.js +0 -49
  100. package/dist/esm/models/FetcherPaperResponse.d.ts +0 -96
  101. package/dist/esm/models/FetcherPaperResponse.js +0 -63
  102. package/dist/esm/models/GetCriterionById200Response.d.ts +0 -23
  103. package/dist/esm/models/GetCriterionById200Response.js +0 -51
  104. package/dist/esm/models/InvitationResponse.d.ts +0 -80
  105. package/dist/esm/models/InvitationResponse.js +0 -67
  106. package/dist/esm/models/InviteUserRequest.d.ts +0 -32
  107. package/dist/esm/models/InviteUserRequest.js +0 -41
  108. package/dist/esm/models/Link.d.ts +0 -38
  109. package/dist/esm/models/Link.js +0 -43
  110. package/dist/esm/models/LoginRequest.d.ts +0 -38
  111. package/dist/esm/models/LoginRequest.js +0 -43
  112. package/dist/esm/models/PaperResponse.d.ts +0 -96
  113. package/dist/esm/models/PaperResponse.js +0 -63
  114. package/dist/esm/models/ProjectCriterion.d.ts +0 -83
  115. package/dist/esm/models/ProjectCriterion.js +0 -63
  116. package/dist/esm/models/ProjectDecisionCount.d.ts +0 -48
  117. package/dist/esm/models/ProjectDecisionCount.js +0 -52
  118. package/dist/esm/models/ProjectDecisionStatistics.d.ts +0 -33
  119. package/dist/esm/models/ProjectDecisionStatistics.js +0 -42
  120. package/dist/esm/models/ProjectInformation.d.ts +0 -44
  121. package/dist/esm/models/ProjectInformation.js +0 -45
  122. package/dist/esm/models/ProjectMember.d.ts +0 -70
  123. package/dist/esm/models/ProjectMember.js +0 -59
  124. package/dist/esm/models/ProjectMemberWithUser.d.ts +0 -40
  125. package/dist/esm/models/ProjectMemberWithUser.js +0 -45
  126. package/dist/esm/models/ProjectPaperResponse.d.ts +0 -74
  127. package/dist/esm/models/ProjectPaperResponse.js +0 -62
  128. package/dist/esm/models/RegisterRequest.d.ts +0 -50
  129. package/dist/esm/models/RegisterRequest.js +0 -47
  130. package/dist/esm/models/ReviewResponse.d.ts +0 -77
  131. package/dist/esm/models/ReviewResponse.js +0 -62
  132. package/dist/esm/models/UpdateCriterionRequest.d.ts +0 -65
  133. package/dist/esm/models/UpdateCriterionRequest.js +0 -57
  134. package/dist/esm/models/UpdateMemberRoleRequest.d.ts +0 -40
  135. package/dist/esm/models/UpdateMemberRoleRequest.js +0 -48
  136. package/dist/esm/models/UpdatePaperRequest.d.ts +0 -82
  137. package/dist/esm/models/UpdatePaperRequest.js +0 -59
  138. package/dist/esm/models/UpdateProjectRequest.d.ts +0 -62
  139. package/dist/esm/models/UpdateProjectRequest.js +0 -58
  140. package/dist/esm/models/UpdateProjectSettingRequest.d.ts +0 -70
  141. package/dist/esm/models/UpdateProjectSettingRequest.js +0 -58
  142. package/dist/esm/models/UpdateUserRequest.d.ts +0 -80
  143. package/dist/esm/models/UpdateUserRequest.js +0 -67
  144. package/dist/esm/models/User.d.ts +0 -122
  145. package/dist/esm/models/User.js +0 -82
  146. package/dist/esm/models/UserCriterion.d.ts +0 -77
  147. package/dist/esm/models/UserCriterion.js +0 -61
  148. package/dist/esm/models/UserSettings.d.ts +0 -88
  149. package/dist/esm/models/UserSettings.js +0 -64
  150. package/dist/esm/models/UserSettingsWithCriteria.d.ts +0 -40
  151. package/dist/esm/models/UserSettingsWithCriteria.js +0 -45
  152. package/dist/models/AddPaperToProjectRequest.d.ts +0 -38
  153. package/dist/models/AddPaperToProjectRequest.js +0 -50
  154. package/dist/models/Author.d.ts +0 -38
  155. package/dist/models/Author.js +0 -50
  156. package/dist/models/ChangePasswordRequest.d.ts +0 -38
  157. package/dist/models/ChangePasswordRequest.js +0 -50
  158. package/dist/models/CreateCriterionRequest.d.ts +0 -65
  159. package/dist/models/CreateCriterionRequest.js +0 -65
  160. package/dist/models/CreatePaperRequest.d.ts +0 -84
  161. package/dist/models/CreatePaperRequest.js +0 -66
  162. package/dist/models/CreateReviewRequest.d.ts +0 -53
  163. package/dist/models/CreateReviewRequest.js +0 -61
  164. package/dist/models/Criterion.d.ts +0 -77
  165. package/dist/models/Criterion.js +0 -69
  166. package/dist/models/ExternalId.d.ts +0 -53
  167. package/dist/models/ExternalId.js +0 -65
  168. package/dist/models/FetcherInformation.d.ts +0 -54
  169. package/dist/models/FetcherInformation.js +0 -57
  170. package/dist/models/FetcherInformationWithId.d.ts +0 -39
  171. package/dist/models/FetcherInformationWithId.js +0 -51
  172. package/dist/models/FetcherOptionsSchema.d.ts +0 -56
  173. package/dist/models/FetcherOptionsSchema.js +0 -56
  174. package/dist/models/FetcherPaperResponse.d.ts +0 -96
  175. package/dist/models/FetcherPaperResponse.js +0 -70
  176. package/dist/models/GetCriterionById200Response.d.ts +0 -23
  177. package/dist/models/GetCriterionById200Response.js +0 -57
  178. package/dist/models/InvitationResponse.d.ts +0 -80
  179. package/dist/models/InvitationResponse.js +0 -75
  180. package/dist/models/InviteUserRequest.d.ts +0 -32
  181. package/dist/models/InviteUserRequest.js +0 -48
  182. package/dist/models/Link.d.ts +0 -38
  183. package/dist/models/Link.js +0 -50
  184. package/dist/models/LoginRequest.d.ts +0 -38
  185. package/dist/models/LoginRequest.js +0 -50
  186. package/dist/models/PaperResponse.d.ts +0 -96
  187. package/dist/models/PaperResponse.js +0 -70
  188. package/dist/models/ProjectCriterion.d.ts +0 -83
  189. package/dist/models/ProjectCriterion.js +0 -71
  190. package/dist/models/ProjectDecisionCount.d.ts +0 -48
  191. package/dist/models/ProjectDecisionCount.js +0 -60
  192. package/dist/models/ProjectDecisionStatistics.d.ts +0 -33
  193. package/dist/models/ProjectDecisionStatistics.js +0 -49
  194. package/dist/models/ProjectInformation.d.ts +0 -44
  195. package/dist/models/ProjectInformation.js +0 -52
  196. package/dist/models/ProjectMember.d.ts +0 -70
  197. package/dist/models/ProjectMember.js +0 -67
  198. package/dist/models/ProjectMemberWithUser.d.ts +0 -40
  199. package/dist/models/ProjectMemberWithUser.js +0 -52
  200. package/dist/models/ProjectPaperResponse.d.ts +0 -74
  201. package/dist/models/ProjectPaperResponse.js +0 -70
  202. package/dist/models/RegisterRequest.d.ts +0 -50
  203. package/dist/models/RegisterRequest.js +0 -54
  204. package/dist/models/ReviewResponse.d.ts +0 -77
  205. package/dist/models/ReviewResponse.js +0 -70
  206. package/dist/models/UpdateCriterionRequest.d.ts +0 -65
  207. package/dist/models/UpdateCriterionRequest.js +0 -65
  208. package/dist/models/UpdateMemberRoleRequest.d.ts +0 -40
  209. package/dist/models/UpdateMemberRoleRequest.js +0 -56
  210. package/dist/models/UpdatePaperRequest.d.ts +0 -82
  211. package/dist/models/UpdatePaperRequest.js +0 -66
  212. package/dist/models/UpdateProjectRequest.d.ts +0 -62
  213. package/dist/models/UpdateProjectRequest.js +0 -66
  214. package/dist/models/UpdateProjectSettingRequest.d.ts +0 -70
  215. package/dist/models/UpdateProjectSettingRequest.js +0 -66
  216. package/dist/models/UpdateUserRequest.d.ts +0 -80
  217. package/dist/models/UpdateUserRequest.js +0 -75
  218. package/dist/models/User.d.ts +0 -122
  219. package/dist/models/User.js +0 -90
  220. package/dist/models/UserCriterion.d.ts +0 -77
  221. package/dist/models/UserCriterion.js +0 -69
  222. package/dist/models/UserSettings.d.ts +0 -88
  223. package/dist/models/UserSettings.js +0 -72
  224. package/dist/models/UserSettingsWithCriteria.d.ts +0 -40
  225. package/dist/models/UserSettingsWithCriteria.js +0 -52
@@ -0,0 +1,177 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnowballR API
5
+ * REST API for the SnowballR Application
6
+ *
7
+ * The version of the OpenAPI document: v1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ReviewDecisionMatrix } from './ReviewDecisionMatrix';
17
+ import {
18
+ ReviewDecisionMatrixFromJSON,
19
+ ReviewDecisionMatrixFromJSONTyped,
20
+ ReviewDecisionMatrixToJSON,
21
+ ReviewDecisionMatrixToJSONTyped,
22
+ } from './ReviewDecisionMatrix';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface Project
28
+ */
29
+ export interface Project {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof Project
34
+ */
35
+ id?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof Project
40
+ */
41
+ name?: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof Project
46
+ */
47
+ status?: ProjectStatusEnum;
48
+ /**
49
+ *
50
+ * @type {number}
51
+ * @memberof Project
52
+ */
53
+ currentStage?: number;
54
+ /**
55
+ *
56
+ * @type {number}
57
+ * @memberof Project
58
+ */
59
+ maxStage?: number;
60
+ /**
61
+ *
62
+ * @type {number}
63
+ * @memberof Project
64
+ */
65
+ similarityThreshold?: number;
66
+ /**
67
+ *
68
+ * @type {string}
69
+ * @memberof Project
70
+ */
71
+ snowballingType?: ProjectSnowballingTypeEnum;
72
+ /**
73
+ *
74
+ * @type {boolean}
75
+ * @memberof Project
76
+ */
77
+ reviewMaybeAllowed?: boolean;
78
+ /**
79
+ *
80
+ * @type {ReviewDecisionMatrix}
81
+ * @memberof Project
82
+ */
83
+ reviewDecisionMatrix?: ReviewDecisionMatrix;
84
+ /**
85
+ *
86
+ * @type {{ [key: string]: { [key: string]: string; }; }}
87
+ * @memberof Project
88
+ */
89
+ fetchers?: { [key: string]: { [key: string]: string; }; };
90
+ /**
91
+ *
92
+ * @type {Date}
93
+ * @memberof Project
94
+ */
95
+ currentStageStartedAt?: Date;
96
+ }
97
+
98
+
99
+ /**
100
+ * @export
101
+ */
102
+ export const ProjectStatusEnum = {
103
+ ACTIVE: 'ACTIVE',
104
+ ACTIVE_LOCKED: 'ACTIVE_LOCKED',
105
+ ARCHIVED: 'ARCHIVED',
106
+ DELETED: 'DELETED',
107
+ CLEARED: 'CLEARED'
108
+ } as const;
109
+ export type ProjectStatusEnum = typeof ProjectStatusEnum[keyof typeof ProjectStatusEnum];
110
+
111
+ /**
112
+ * @export
113
+ */
114
+ export const ProjectSnowballingTypeEnum = {
115
+ FORWARD: 'FORWARD',
116
+ BACKWARD: 'BACKWARD',
117
+ BOTH: 'BOTH'
118
+ } as const;
119
+ export type ProjectSnowballingTypeEnum = typeof ProjectSnowballingTypeEnum[keyof typeof ProjectSnowballingTypeEnum];
120
+
121
+
122
+ /**
123
+ * Check if a given object implements the Project interface.
124
+ */
125
+ export function instanceOfProject(value: object): value is Project {
126
+ return true;
127
+ }
128
+
129
+ export function ProjectFromJSON(json: any): Project {
130
+ return ProjectFromJSONTyped(json, false);
131
+ }
132
+
133
+ export function ProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): Project {
134
+ if (json == null) {
135
+ return json;
136
+ }
137
+ return {
138
+
139
+ 'id': json['id'] == null ? undefined : json['id'],
140
+ 'name': json['name'] == null ? undefined : json['name'],
141
+ 'status': json['status'] == null ? undefined : json['status'],
142
+ 'currentStage': json['currentStage'] == null ? undefined : json['currentStage'],
143
+ 'maxStage': json['maxStage'] == null ? undefined : json['maxStage'],
144
+ 'similarityThreshold': json['similarityThreshold'] == null ? undefined : json['similarityThreshold'],
145
+ 'snowballingType': json['snowballingType'] == null ? undefined : json['snowballingType'],
146
+ 'reviewMaybeAllowed': json['reviewMaybeAllowed'] == null ? undefined : json['reviewMaybeAllowed'],
147
+ 'reviewDecisionMatrix': json['reviewDecisionMatrix'] == null ? undefined : ReviewDecisionMatrixFromJSON(json['reviewDecisionMatrix']),
148
+ 'fetchers': json['fetchers'] == null ? undefined : json['fetchers'],
149
+ 'currentStageStartedAt': json['currentStageStartedAt'] == null ? undefined : (new Date(json['currentStageStartedAt'])),
150
+ };
151
+ }
152
+
153
+ export function ProjectToJSON(json: any): Project {
154
+ return ProjectToJSONTyped(json, false);
155
+ }
156
+
157
+ export function ProjectToJSONTyped(value?: Project | null, ignoreDiscriminator: boolean = false): any {
158
+ if (value == null) {
159
+ return value;
160
+ }
161
+
162
+ return {
163
+
164
+ 'id': value['id'],
165
+ 'name': value['name'],
166
+ 'status': value['status'],
167
+ 'currentStage': value['currentStage'],
168
+ 'maxStage': value['maxStage'],
169
+ 'similarityThreshold': value['similarityThreshold'],
170
+ 'snowballingType': value['snowballingType'],
171
+ 'reviewMaybeAllowed': value['reviewMaybeAllowed'],
172
+ 'reviewDecisionMatrix': ReviewDecisionMatrixToJSON(value['reviewDecisionMatrix']),
173
+ 'fetchers': value['fetchers'],
174
+ 'currentStageStartedAt': value['currentStageStartedAt'] == null ? undefined : ((value['currentStageStartedAt']).toISOString()),
175
+ };
176
+ }
177
+
@@ -0,0 +1,81 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnowballR API
5
+ * REST API for the SnowballR Application
6
+ *
7
+ * The version of the OpenAPI document: v1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { DecisionMatrixPattern } from './DecisionMatrixPattern';
17
+ import {
18
+ DecisionMatrixPatternFromJSON,
19
+ DecisionMatrixPatternFromJSONTyped,
20
+ DecisionMatrixPatternToJSON,
21
+ DecisionMatrixPatternToJSONTyped,
22
+ } from './DecisionMatrixPattern';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ReviewDecisionMatrix
28
+ */
29
+ export interface ReviewDecisionMatrix {
30
+ /**
31
+ *
32
+ * @type {number}
33
+ * @memberof ReviewDecisionMatrix
34
+ */
35
+ numberOfReviewers?: number;
36
+ /**
37
+ *
38
+ * @type {Array<DecisionMatrixPattern>}
39
+ * @memberof ReviewDecisionMatrix
40
+ */
41
+ patterns?: Array<DecisionMatrixPattern>;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the ReviewDecisionMatrix interface.
46
+ */
47
+ export function instanceOfReviewDecisionMatrix(value: object): value is ReviewDecisionMatrix {
48
+ return true;
49
+ }
50
+
51
+ export function ReviewDecisionMatrixFromJSON(json: any): ReviewDecisionMatrix {
52
+ return ReviewDecisionMatrixFromJSONTyped(json, false);
53
+ }
54
+
55
+ export function ReviewDecisionMatrixFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReviewDecisionMatrix {
56
+ if (json == null) {
57
+ return json;
58
+ }
59
+ return {
60
+
61
+ 'numberOfReviewers': json['numberOfReviewers'] == null ? undefined : json['numberOfReviewers'],
62
+ 'patterns': json['patterns'] == null ? undefined : ((json['patterns'] as Array<any>).map(DecisionMatrixPatternFromJSON)),
63
+ };
64
+ }
65
+
66
+ export function ReviewDecisionMatrixToJSON(json: any): ReviewDecisionMatrix {
67
+ return ReviewDecisionMatrixToJSONTyped(json, false);
68
+ }
69
+
70
+ export function ReviewDecisionMatrixToJSONTyped(value?: ReviewDecisionMatrix | null, ignoreDiscriminator: boolean = false): any {
71
+ if (value == null) {
72
+ return value;
73
+ }
74
+
75
+ return {
76
+
77
+ 'numberOfReviewers': value['numberOfReviewers'],
78
+ 'patterns': value['patterns'] == null ? undefined : ((value['patterns'] as Array<any>).map(DecisionMatrixPatternToJSON)),
79
+ };
80
+ }
81
+
@@ -0,0 +1,7 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './CreateProjectRequest';
4
+ export * from './DecisionMatrixPattern';
5
+ export * from './DecisionMatrixPatternEntry';
6
+ export * from './Project';
7
+ export * from './ReviewDecisionMatrix';
package/src/runtime.ts ADDED
@@ -0,0 +1,432 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnowballR API
5
+ * REST API for the SnowballR Application
6
+ *
7
+ * The version of the OpenAPI document: v1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
17
+
18
+ export interface ConfigurationParameters {
19
+ basePath?: string; // override base path
20
+ fetchApi?: FetchAPI; // override for fetch implementation
21
+ middleware?: Middleware[]; // middleware to apply before/after fetch requests
22
+ queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
23
+ username?: string; // parameter for basic security
24
+ password?: string; // parameter for basic security
25
+ apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
26
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
27
+ headers?: HTTPHeaders; //header params we want to use on every request
28
+ credentials?: RequestCredentials; //value for the credentials param we want to use on each request
29
+ }
30
+
31
+ export class Configuration {
32
+ constructor(private configuration: ConfigurationParameters = {}) {}
33
+
34
+ set config(configuration: Configuration) {
35
+ this.configuration = configuration;
36
+ }
37
+
38
+ get basePath(): string {
39
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
40
+ }
41
+
42
+ get fetchApi(): FetchAPI | undefined {
43
+ return this.configuration.fetchApi;
44
+ }
45
+
46
+ get middleware(): Middleware[] {
47
+ return this.configuration.middleware || [];
48
+ }
49
+
50
+ get queryParamsStringify(): (params: HTTPQuery) => string {
51
+ return this.configuration.queryParamsStringify || querystring;
52
+ }
53
+
54
+ get username(): string | undefined {
55
+ return this.configuration.username;
56
+ }
57
+
58
+ get password(): string | undefined {
59
+ return this.configuration.password;
60
+ }
61
+
62
+ get apiKey(): ((name: string) => string | Promise<string>) | undefined {
63
+ const apiKey = this.configuration.apiKey;
64
+ if (apiKey) {
65
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
66
+ }
67
+ return undefined;
68
+ }
69
+
70
+ get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
71
+ const accessToken = this.configuration.accessToken;
72
+ if (accessToken) {
73
+ return typeof accessToken === 'function' ? accessToken : async () => accessToken;
74
+ }
75
+ return undefined;
76
+ }
77
+
78
+ get headers(): HTTPHeaders | undefined {
79
+ return this.configuration.headers;
80
+ }
81
+
82
+ get credentials(): RequestCredentials | undefined {
83
+ return this.configuration.credentials;
84
+ }
85
+ }
86
+
87
+ export const DefaultConfig = new Configuration();
88
+
89
+ /**
90
+ * This is the base class for all generated API classes.
91
+ */
92
+ export class BaseAPI {
93
+
94
+ private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
95
+ private middleware: Middleware[];
96
+
97
+ constructor(protected configuration = DefaultConfig) {
98
+ this.middleware = configuration.middleware;
99
+ }
100
+
101
+ withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
102
+ const next = this.clone<T>();
103
+ next.middleware = next.middleware.concat(...middlewares);
104
+ return next;
105
+ }
106
+
107
+ withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
108
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
109
+ return this.withMiddleware<T>(...middlewares);
110
+ }
111
+
112
+ withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
113
+ const middlewares = postMiddlewares.map((post) => ({ post }));
114
+ return this.withMiddleware<T>(...middlewares);
115
+ }
116
+
117
+ /**
118
+ * Check if the given MIME is a JSON MIME.
119
+ * JSON MIME examples:
120
+ * application/json
121
+ * application/json; charset=UTF8
122
+ * APPLICATION/JSON
123
+ * application/vnd.company+json
124
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
125
+ * @return True if the given MIME is JSON, false otherwise.
126
+ */
127
+ protected isJsonMime(mime: string | null | undefined): boolean {
128
+ if (!mime) {
129
+ return false;
130
+ }
131
+ return BaseAPI.jsonRegex.test(mime);
132
+ }
133
+
134
+ protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
135
+ const { url, init } = await this.createFetchParams(context, initOverrides);
136
+ const response = await this.fetchApi(url, init);
137
+ if (response && (response.status >= 200 && response.status < 300)) {
138
+ return response;
139
+ }
140
+ throw new ResponseError(response, 'Response returned an error code');
141
+ }
142
+
143
+ private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
144
+ let url = this.configuration.basePath + context.path;
145
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
146
+ // only add the querystring to the URL if there are query parameters.
147
+ // this is done to avoid urls ending with a "?" character which buggy webservers
148
+ // do not handle correctly sometimes.
149
+ url += '?' + this.configuration.queryParamsStringify(context.query);
150
+ }
151
+
152
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
153
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
154
+
155
+ const initOverrideFn =
156
+ typeof initOverrides === "function"
157
+ ? initOverrides
158
+ : async () => initOverrides;
159
+
160
+ const initParams = {
161
+ method: context.method,
162
+ headers,
163
+ body: context.body,
164
+ credentials: this.configuration.credentials,
165
+ };
166
+
167
+ const overriddenInit: RequestInit = {
168
+ ...initParams,
169
+ ...(await initOverrideFn({
170
+ init: initParams,
171
+ context,
172
+ }))
173
+ };
174
+
175
+ let body: any;
176
+ if (isFormData(overriddenInit.body)
177
+ || (overriddenInit.body instanceof URLSearchParams)
178
+ || isBlob(overriddenInit.body)) {
179
+ body = overriddenInit.body;
180
+ } else if (this.isJsonMime(headers['Content-Type'])) {
181
+ body = JSON.stringify(overriddenInit.body);
182
+ } else {
183
+ body = overriddenInit.body;
184
+ }
185
+
186
+ const init: RequestInit = {
187
+ ...overriddenInit,
188
+ body
189
+ };
190
+
191
+ return { url, init };
192
+ }
193
+
194
+ private fetchApi = async (url: string, init: RequestInit) => {
195
+ let fetchParams = { url, init };
196
+ for (const middleware of this.middleware) {
197
+ if (middleware.pre) {
198
+ fetchParams = await middleware.pre({
199
+ fetch: this.fetchApi,
200
+ ...fetchParams,
201
+ }) || fetchParams;
202
+ }
203
+ }
204
+ let response: Response | undefined = undefined;
205
+ try {
206
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
207
+ } catch (e) {
208
+ for (const middleware of this.middleware) {
209
+ if (middleware.onError) {
210
+ response = await middleware.onError({
211
+ fetch: this.fetchApi,
212
+ url: fetchParams.url,
213
+ init: fetchParams.init,
214
+ error: e,
215
+ response: response ? response.clone() : undefined,
216
+ }) || response;
217
+ }
218
+ }
219
+ if (response === undefined) {
220
+ if (e instanceof Error) {
221
+ throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
222
+ } else {
223
+ throw e;
224
+ }
225
+ }
226
+ }
227
+ for (const middleware of this.middleware) {
228
+ if (middleware.post) {
229
+ response = await middleware.post({
230
+ fetch: this.fetchApi,
231
+ url: fetchParams.url,
232
+ init: fetchParams.init,
233
+ response: response.clone(),
234
+ }) || response;
235
+ }
236
+ }
237
+ return response;
238
+ }
239
+
240
+ /**
241
+ * Create a shallow clone of `this` by constructing a new instance
242
+ * and then shallow cloning data members.
243
+ */
244
+ private clone<T extends BaseAPI>(this: T): T {
245
+ const constructor = this.constructor as any;
246
+ const next = new constructor(this.configuration);
247
+ next.middleware = this.middleware.slice();
248
+ return next;
249
+ }
250
+ };
251
+
252
+ function isBlob(value: any): value is Blob {
253
+ return typeof Blob !== 'undefined' && value instanceof Blob;
254
+ }
255
+
256
+ function isFormData(value: any): value is FormData {
257
+ return typeof FormData !== "undefined" && value instanceof FormData;
258
+ }
259
+
260
+ export class ResponseError extends Error {
261
+ override name: "ResponseError" = "ResponseError";
262
+ constructor(public response: Response, msg?: string) {
263
+ super(msg);
264
+ }
265
+ }
266
+
267
+ export class FetchError extends Error {
268
+ override name: "FetchError" = "FetchError";
269
+ constructor(public cause: Error, msg?: string) {
270
+ super(msg);
271
+ }
272
+ }
273
+
274
+ export class RequiredError extends Error {
275
+ override name: "RequiredError" = "RequiredError";
276
+ constructor(public field: string, msg?: string) {
277
+ super(msg);
278
+ }
279
+ }
280
+
281
+ export const COLLECTION_FORMATS = {
282
+ csv: ",",
283
+ ssv: " ",
284
+ tsv: "\t",
285
+ pipes: "|",
286
+ };
287
+
288
+ export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
289
+
290
+ export type Json = any;
291
+ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
292
+ export type HTTPHeaders = { [key: string]: string };
293
+ export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery };
294
+ export type HTTPBody = Json | FormData | URLSearchParams;
295
+ export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody };
296
+ export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
297
+
298
+ export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
299
+
300
+ export interface FetchParams {
301
+ url: string;
302
+ init: RequestInit;
303
+ }
304
+
305
+ export interface RequestOpts {
306
+ path: string;
307
+ method: HTTPMethod;
308
+ headers: HTTPHeaders;
309
+ query?: HTTPQuery;
310
+ body?: HTTPBody;
311
+ }
312
+
313
+ export function querystring(params: HTTPQuery, prefix: string = ''): string {
314
+ return Object.keys(params)
315
+ .map(key => querystringSingleKey(key, params[key], prefix))
316
+ .filter(part => part.length > 0)
317
+ .join('&');
318
+ }
319
+
320
+ function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
321
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
322
+ if (value instanceof Array) {
323
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
324
+ .join(`&${encodeURIComponent(fullKey)}=`);
325
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
326
+ }
327
+ if (value instanceof Set) {
328
+ const valueAsArray = Array.from(value);
329
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
330
+ }
331
+ if (value instanceof Date) {
332
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
333
+ }
334
+ if (value instanceof Object) {
335
+ return querystring(value as HTTPQuery, fullKey);
336
+ }
337
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
338
+ }
339
+
340
+ export function exists(json: any, key: string) {
341
+ const value = json[key];
342
+ return value !== null && value !== undefined;
343
+ }
344
+
345
+ export function mapValues(data: any, fn: (item: any) => any) {
346
+ const result: { [key: string]: any } = {};
347
+ for (const key of Object.keys(data)) {
348
+ result[key] = fn(data[key]);
349
+ }
350
+ return result;
351
+ }
352
+
353
+ export function canConsumeForm(consumes: Consume[]): boolean {
354
+ for (const consume of consumes) {
355
+ if ('multipart/form-data' === consume.contentType) {
356
+ return true;
357
+ }
358
+ }
359
+ return false;
360
+ }
361
+
362
+ export interface Consume {
363
+ contentType: string;
364
+ }
365
+
366
+ export interface RequestContext {
367
+ fetch: FetchAPI;
368
+ url: string;
369
+ init: RequestInit;
370
+ }
371
+
372
+ export interface ResponseContext {
373
+ fetch: FetchAPI;
374
+ url: string;
375
+ init: RequestInit;
376
+ response: Response;
377
+ }
378
+
379
+ export interface ErrorContext {
380
+ fetch: FetchAPI;
381
+ url: string;
382
+ init: RequestInit;
383
+ error: unknown;
384
+ response?: Response;
385
+ }
386
+
387
+ export interface Middleware {
388
+ pre?(context: RequestContext): Promise<FetchParams | void>;
389
+ post?(context: ResponseContext): Promise<Response | void>;
390
+ onError?(context: ErrorContext): Promise<Response | void>;
391
+ }
392
+
393
+ export interface ApiResponse<T> {
394
+ raw: Response;
395
+ value(): Promise<T>;
396
+ }
397
+
398
+ export interface ResponseTransformer<T> {
399
+ (json: any): T;
400
+ }
401
+
402
+ export class JSONApiResponse<T> {
403
+ constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
404
+
405
+ async value(): Promise<T> {
406
+ return this.transformer(await this.raw.json());
407
+ }
408
+ }
409
+
410
+ export class VoidApiResponse {
411
+ constructor(public raw: Response) {}
412
+
413
+ async value(): Promise<void> {
414
+ return undefined;
415
+ }
416
+ }
417
+
418
+ export class BlobApiResponse {
419
+ constructor(public raw: Response) {}
420
+
421
+ async value(): Promise<Blob> {
422
+ return await this.raw.blob();
423
+ };
424
+ }
425
+
426
+ export class TextApiResponse {
427
+ constructor(public raw: Response) {}
428
+
429
+ async value(): Promise<string> {
430
+ return await this.raw.text();
431
+ };
432
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "esnext",
5
+ "outDir": "dist/esm"
6
+ }
7
+ }