@se-uulm/snowballr-api-client 0.1.1-alpha.1909657

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 (59) 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/CHANGELOG.md +9 -0
  5. package/LICENSE +674 -0
  6. package/README.md +46 -0
  7. package/dist/apis/ProjectsControllerApi.d.ts +102 -0
  8. package/dist/apis/ProjectsControllerApi.js +141 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +19 -0
  11. package/dist/esm/apis/ProjectsControllerApi.d.ts +102 -0
  12. package/dist/esm/apis/ProjectsControllerApi.js +137 -0
  13. package/dist/esm/apis/index.d.ts +1 -0
  14. package/dist/esm/apis/index.js +3 -0
  15. package/dist/esm/index.d.ts +3 -0
  16. package/dist/esm/index.js +5 -0
  17. package/dist/esm/models/CreateProjectRequest.d.ts +32 -0
  18. package/dist/esm/models/CreateProjectRequest.js +41 -0
  19. package/dist/esm/models/DecisionMatrixPattern.d.ts +49 -0
  20. package/dist/esm/models/DecisionMatrixPattern.js +53 -0
  21. package/dist/esm/models/DecisionMatrixPatternEntry.d.ts +47 -0
  22. package/dist/esm/models/DecisionMatrixPatternEntry.js +51 -0
  23. package/dist/esm/models/Project.d.ts +117 -0
  24. package/dist/esm/models/Project.js +80 -0
  25. package/dist/esm/models/ReviewDecisionMatrix.d.ts +39 -0
  26. package/dist/esm/models/ReviewDecisionMatrix.js +44 -0
  27. package/dist/esm/models/index.d.ts +5 -0
  28. package/dist/esm/models/index.js +7 -0
  29. package/dist/esm/runtime.d.ts +184 -0
  30. package/dist/esm/runtime.js +334 -0
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.js +21 -0
  33. package/dist/models/CreateProjectRequest.d.ts +32 -0
  34. package/dist/models/CreateProjectRequest.js +48 -0
  35. package/dist/models/DecisionMatrixPattern.d.ts +49 -0
  36. package/dist/models/DecisionMatrixPattern.js +61 -0
  37. package/dist/models/DecisionMatrixPatternEntry.d.ts +47 -0
  38. package/dist/models/DecisionMatrixPatternEntry.js +59 -0
  39. package/dist/models/Project.d.ts +117 -0
  40. package/dist/models/Project.js +88 -0
  41. package/dist/models/ReviewDecisionMatrix.d.ts +39 -0
  42. package/dist/models/ReviewDecisionMatrix.js +51 -0
  43. package/dist/models/index.d.ts +5 -0
  44. package/dist/models/index.js +23 -0
  45. package/dist/runtime.d.ts +184 -0
  46. package/dist/runtime.js +350 -0
  47. package/package.json +22 -0
  48. package/src/apis/ProjectsControllerApi.ts +238 -0
  49. package/src/apis/index.ts +3 -0
  50. package/src/index.ts +5 -0
  51. package/src/models/CreateProjectRequest.ts +65 -0
  52. package/src/models/DecisionMatrixPattern.ts +94 -0
  53. package/src/models/DecisionMatrixPatternEntry.ts +85 -0
  54. package/src/models/Project.ts +177 -0
  55. package/src/models/ReviewDecisionMatrix.ts +81 -0
  56. package/src/models/index.ts +7 -0
  57. package/src/runtime.ts +432 -0
  58. package/tsconfig.esm.json +7 -0
  59. package/tsconfig.json +16 -0
@@ -0,0 +1,350 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * SnowballR API
6
+ * REST API for the SnowballR Application
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
26
+ exports.querystring = querystring;
27
+ exports.exists = exists;
28
+ exports.mapValues = mapValues;
29
+ exports.canConsumeForm = canConsumeForm;
30
+ exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
31
+ class Configuration {
32
+ constructor(configuration = {}) {
33
+ this.configuration = configuration;
34
+ }
35
+ set config(configuration) {
36
+ this.configuration = configuration;
37
+ }
38
+ get basePath() {
39
+ return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
40
+ }
41
+ get fetchApi() {
42
+ return this.configuration.fetchApi;
43
+ }
44
+ get middleware() {
45
+ return this.configuration.middleware || [];
46
+ }
47
+ get queryParamsStringify() {
48
+ return this.configuration.queryParamsStringify || querystring;
49
+ }
50
+ get username() {
51
+ return this.configuration.username;
52
+ }
53
+ get password() {
54
+ return this.configuration.password;
55
+ }
56
+ get apiKey() {
57
+ const apiKey = this.configuration.apiKey;
58
+ if (apiKey) {
59
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
60
+ }
61
+ return undefined;
62
+ }
63
+ get accessToken() {
64
+ const accessToken = this.configuration.accessToken;
65
+ if (accessToken) {
66
+ return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
67
+ }
68
+ return undefined;
69
+ }
70
+ get headers() {
71
+ return this.configuration.headers;
72
+ }
73
+ get credentials() {
74
+ return this.configuration.credentials;
75
+ }
76
+ }
77
+ exports.Configuration = Configuration;
78
+ exports.DefaultConfig = new Configuration();
79
+ /**
80
+ * This is the base class for all generated API classes.
81
+ */
82
+ class BaseAPI {
83
+ constructor(configuration = exports.DefaultConfig) {
84
+ this.configuration = configuration;
85
+ this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
86
+ let fetchParams = { url, init };
87
+ for (const middleware of this.middleware) {
88
+ if (middleware.pre) {
89
+ fetchParams = (yield middleware.pre(Object.assign({ fetch: this.fetchApi }, fetchParams))) || fetchParams;
90
+ }
91
+ }
92
+ let response = undefined;
93
+ try {
94
+ response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
95
+ }
96
+ catch (e) {
97
+ for (const middleware of this.middleware) {
98
+ if (middleware.onError) {
99
+ response = (yield middleware.onError({
100
+ fetch: this.fetchApi,
101
+ url: fetchParams.url,
102
+ init: fetchParams.init,
103
+ error: e,
104
+ response: response ? response.clone() : undefined,
105
+ })) || response;
106
+ }
107
+ }
108
+ if (response === undefined) {
109
+ if (e instanceof Error) {
110
+ throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
111
+ }
112
+ else {
113
+ throw e;
114
+ }
115
+ }
116
+ }
117
+ for (const middleware of this.middleware) {
118
+ if (middleware.post) {
119
+ response = (yield middleware.post({
120
+ fetch: this.fetchApi,
121
+ url: fetchParams.url,
122
+ init: fetchParams.init,
123
+ response: response.clone(),
124
+ })) || response;
125
+ }
126
+ }
127
+ return response;
128
+ });
129
+ this.middleware = configuration.middleware;
130
+ }
131
+ withMiddleware(...middlewares) {
132
+ const next = this.clone();
133
+ next.middleware = next.middleware.concat(...middlewares);
134
+ return next;
135
+ }
136
+ withPreMiddleware(...preMiddlewares) {
137
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
138
+ return this.withMiddleware(...middlewares);
139
+ }
140
+ withPostMiddleware(...postMiddlewares) {
141
+ const middlewares = postMiddlewares.map((post) => ({ post }));
142
+ return this.withMiddleware(...middlewares);
143
+ }
144
+ /**
145
+ * Check if the given MIME is a JSON MIME.
146
+ * JSON MIME examples:
147
+ * application/json
148
+ * application/json; charset=UTF8
149
+ * APPLICATION/JSON
150
+ * application/vnd.company+json
151
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
152
+ * @return True if the given MIME is JSON, false otherwise.
153
+ */
154
+ isJsonMime(mime) {
155
+ if (!mime) {
156
+ return false;
157
+ }
158
+ return BaseAPI.jsonRegex.test(mime);
159
+ }
160
+ request(context, initOverrides) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ const { url, init } = yield this.createFetchParams(context, initOverrides);
163
+ const response = yield this.fetchApi(url, init);
164
+ if (response && (response.status >= 200 && response.status < 300)) {
165
+ return response;
166
+ }
167
+ throw new ResponseError(response, 'Response returned an error code');
168
+ });
169
+ }
170
+ createFetchParams(context, initOverrides) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ let url = this.configuration.basePath + context.path;
173
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
174
+ // only add the querystring to the URL if there are query parameters.
175
+ // this is done to avoid urls ending with a "?" character which buggy webservers
176
+ // do not handle correctly sometimes.
177
+ url += '?' + this.configuration.queryParamsStringify(context.query);
178
+ }
179
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
180
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
181
+ const initOverrideFn = typeof initOverrides === "function"
182
+ ? initOverrides
183
+ : () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
184
+ const initParams = {
185
+ method: context.method,
186
+ headers,
187
+ body: context.body,
188
+ credentials: this.configuration.credentials,
189
+ };
190
+ const overriddenInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
191
+ init: initParams,
192
+ context,
193
+ })));
194
+ let body;
195
+ if (isFormData(overriddenInit.body)
196
+ || (overriddenInit.body instanceof URLSearchParams)
197
+ || isBlob(overriddenInit.body)) {
198
+ body = overriddenInit.body;
199
+ }
200
+ else if (this.isJsonMime(headers['Content-Type'])) {
201
+ body = JSON.stringify(overriddenInit.body);
202
+ }
203
+ else {
204
+ body = overriddenInit.body;
205
+ }
206
+ const init = Object.assign(Object.assign({}, overriddenInit), { body });
207
+ return { url, init };
208
+ });
209
+ }
210
+ /**
211
+ * Create a shallow clone of `this` by constructing a new instance
212
+ * and then shallow cloning data members.
213
+ */
214
+ clone() {
215
+ const constructor = this.constructor;
216
+ const next = new constructor(this.configuration);
217
+ next.middleware = this.middleware.slice();
218
+ return next;
219
+ }
220
+ }
221
+ exports.BaseAPI = BaseAPI;
222
+ BaseAPI.jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
223
+ ;
224
+ function isBlob(value) {
225
+ return typeof Blob !== 'undefined' && value instanceof Blob;
226
+ }
227
+ function isFormData(value) {
228
+ return typeof FormData !== "undefined" && value instanceof FormData;
229
+ }
230
+ class ResponseError extends Error {
231
+ constructor(response, msg) {
232
+ super(msg);
233
+ this.response = response;
234
+ this.name = "ResponseError";
235
+ }
236
+ }
237
+ exports.ResponseError = ResponseError;
238
+ class FetchError extends Error {
239
+ constructor(cause, msg) {
240
+ super(msg);
241
+ this.cause = cause;
242
+ this.name = "FetchError";
243
+ }
244
+ }
245
+ exports.FetchError = FetchError;
246
+ class RequiredError extends Error {
247
+ constructor(field, msg) {
248
+ super(msg);
249
+ this.field = field;
250
+ this.name = "RequiredError";
251
+ }
252
+ }
253
+ exports.RequiredError = RequiredError;
254
+ exports.COLLECTION_FORMATS = {
255
+ csv: ",",
256
+ ssv: " ",
257
+ tsv: "\t",
258
+ pipes: "|",
259
+ };
260
+ function querystring(params, prefix = '') {
261
+ return Object.keys(params)
262
+ .map(key => querystringSingleKey(key, params[key], prefix))
263
+ .filter(part => part.length > 0)
264
+ .join('&');
265
+ }
266
+ function querystringSingleKey(key, value, keyPrefix = '') {
267
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
268
+ if (value instanceof Array) {
269
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
270
+ .join(`&${encodeURIComponent(fullKey)}=`);
271
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
272
+ }
273
+ if (value instanceof Set) {
274
+ const valueAsArray = Array.from(value);
275
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
276
+ }
277
+ if (value instanceof Date) {
278
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
279
+ }
280
+ if (value instanceof Object) {
281
+ return querystring(value, fullKey);
282
+ }
283
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
284
+ }
285
+ function exists(json, key) {
286
+ const value = json[key];
287
+ return value !== null && value !== undefined;
288
+ }
289
+ function mapValues(data, fn) {
290
+ const result = {};
291
+ for (const key of Object.keys(data)) {
292
+ result[key] = fn(data[key]);
293
+ }
294
+ return result;
295
+ }
296
+ function canConsumeForm(consumes) {
297
+ for (const consume of consumes) {
298
+ if ('multipart/form-data' === consume.contentType) {
299
+ return true;
300
+ }
301
+ }
302
+ return false;
303
+ }
304
+ class JSONApiResponse {
305
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
306
+ this.raw = raw;
307
+ this.transformer = transformer;
308
+ }
309
+ value() {
310
+ return __awaiter(this, void 0, void 0, function* () {
311
+ return this.transformer(yield this.raw.json());
312
+ });
313
+ }
314
+ }
315
+ exports.JSONApiResponse = JSONApiResponse;
316
+ class VoidApiResponse {
317
+ constructor(raw) {
318
+ this.raw = raw;
319
+ }
320
+ value() {
321
+ return __awaiter(this, void 0, void 0, function* () {
322
+ return undefined;
323
+ });
324
+ }
325
+ }
326
+ exports.VoidApiResponse = VoidApiResponse;
327
+ class BlobApiResponse {
328
+ constructor(raw) {
329
+ this.raw = raw;
330
+ }
331
+ value() {
332
+ return __awaiter(this, void 0, void 0, function* () {
333
+ return yield this.raw.blob();
334
+ });
335
+ }
336
+ ;
337
+ }
338
+ exports.BlobApiResponse = BlobApiResponse;
339
+ class TextApiResponse {
340
+ constructor(raw) {
341
+ this.raw = raw;
342
+ }
343
+ value() {
344
+ return __awaiter(this, void 0, void 0, function* () {
345
+ return yield this.raw.text();
346
+ });
347
+ }
348
+ ;
349
+ }
350
+ exports.TextApiResponse = TextApiResponse;
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@se-uulm/snowballr-api-client",
3
+ "version": "0.1.1-alpha.1909657",
4
+ "description": "OpenAPI client for @se-uulm/snowballr-api-client",
5
+ "author": "OpenAPI-Generator",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/SE-UUlm/snowballr-backend.git"
9
+ },
10
+ "license": "GPL-3.0-or-later",
11
+ "main": "./dist/index.js",
12
+ "typings": "./dist/index.d.ts",
13
+ "module": "./dist/esm/index.js",
14
+ "sideEffects": false,
15
+ "scripts": {
16
+ "build": "tsc && tsc -p tsconfig.esm.json",
17
+ "prepare": "npm run build"
18
+ },
19
+ "devDependencies": {
20
+ "typescript": "^4.0 || ^5.0"
21
+ }
22
+ }
@@ -0,0 +1,238 @@
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
+ import * as runtime from '../runtime';
17
+ import type {
18
+ CreateProjectRequest,
19
+ Project,
20
+ } from '../models/index';
21
+ import {
22
+ CreateProjectRequestFromJSON,
23
+ CreateProjectRequestToJSON,
24
+ ProjectFromJSON,
25
+ ProjectToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface CreateProjectOperationRequest {
29
+ createProjectRequest: CreateProjectRequest;
30
+ }
31
+
32
+ export interface DeleteProjectRequest {
33
+ id: string;
34
+ }
35
+
36
+ export interface GetProjectRequest {
37
+ id: string;
38
+ }
39
+
40
+ /**
41
+ * ProjectsControllerApi - interface
42
+ *
43
+ * @export
44
+ * @interface ProjectsControllerApiInterface
45
+ */
46
+ export interface ProjectsControllerApiInterface {
47
+ /**
48
+ *
49
+ * @param {CreateProjectRequest} createProjectRequest
50
+ * @param {*} [options] Override http request option.
51
+ * @throws {RequiredError}
52
+ * @memberof ProjectsControllerApiInterface
53
+ */
54
+ createProjectRaw(requestParameters: CreateProjectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Project>>;
55
+
56
+ /**
57
+ */
58
+ createProject(requestParameters: CreateProjectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Project>;
59
+
60
+ /**
61
+ *
62
+ * @param {string} id
63
+ * @param {*} [options] Override http request option.
64
+ * @throws {RequiredError}
65
+ * @memberof ProjectsControllerApiInterface
66
+ */
67
+ deleteProjectRaw(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
68
+
69
+ /**
70
+ */
71
+ deleteProject(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
72
+
73
+ /**
74
+ *
75
+ * @param {*} [options] Override http request option.
76
+ * @throws {RequiredError}
77
+ * @memberof ProjectsControllerApiInterface
78
+ */
79
+ getAllProjectsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Project>>>;
80
+
81
+ /**
82
+ */
83
+ getAllProjects(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Project>>;
84
+
85
+ /**
86
+ *
87
+ * @param {string} id
88
+ * @param {*} [options] Override http request option.
89
+ * @throws {RequiredError}
90
+ * @memberof ProjectsControllerApiInterface
91
+ */
92
+ getProjectRaw(requestParameters: GetProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Project>>;
93
+
94
+ /**
95
+ */
96
+ getProject(requestParameters: GetProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Project>;
97
+
98
+ }
99
+
100
+ /**
101
+ *
102
+ */
103
+ export class ProjectsControllerApi extends runtime.BaseAPI implements ProjectsControllerApiInterface {
104
+
105
+ /**
106
+ */
107
+ async createProjectRaw(requestParameters: CreateProjectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Project>> {
108
+ if (requestParameters['createProjectRequest'] == null) {
109
+ throw new runtime.RequiredError(
110
+ 'createProjectRequest',
111
+ 'Required parameter "createProjectRequest" was null or undefined when calling createProject().'
112
+ );
113
+ }
114
+
115
+ const queryParameters: any = {};
116
+
117
+ const headerParameters: runtime.HTTPHeaders = {};
118
+
119
+ headerParameters['Content-Type'] = 'application/json';
120
+
121
+
122
+ let urlPath = `/projects`;
123
+
124
+ const response = await this.request({
125
+ path: urlPath,
126
+ method: 'POST',
127
+ headers: headerParameters,
128
+ query: queryParameters,
129
+ body: CreateProjectRequestToJSON(requestParameters['createProjectRequest']),
130
+ }, initOverrides);
131
+
132
+ return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue));
133
+ }
134
+
135
+ /**
136
+ */
137
+ async createProject(requestParameters: CreateProjectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Project> {
138
+ const response = await this.createProjectRaw(requestParameters, initOverrides);
139
+ return await response.value();
140
+ }
141
+
142
+ /**
143
+ */
144
+ async deleteProjectRaw(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
145
+ if (requestParameters['id'] == null) {
146
+ throw new runtime.RequiredError(
147
+ 'id',
148
+ 'Required parameter "id" was null or undefined when calling deleteProject().'
149
+ );
150
+ }
151
+
152
+ const queryParameters: any = {};
153
+
154
+ const headerParameters: runtime.HTTPHeaders = {};
155
+
156
+
157
+ let urlPath = `/projects/{id}`;
158
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
159
+
160
+ const response = await this.request({
161
+ path: urlPath,
162
+ method: 'DELETE',
163
+ headers: headerParameters,
164
+ query: queryParameters,
165
+ }, initOverrides);
166
+
167
+ return new runtime.VoidApiResponse(response);
168
+ }
169
+
170
+ /**
171
+ */
172
+ async deleteProject(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
173
+ await this.deleteProjectRaw(requestParameters, initOverrides);
174
+ }
175
+
176
+ /**
177
+ */
178
+ async getAllProjectsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Project>>> {
179
+ const queryParameters: any = {};
180
+
181
+ const headerParameters: runtime.HTTPHeaders = {};
182
+
183
+
184
+ let urlPath = `/projects`;
185
+
186
+ const response = await this.request({
187
+ path: urlPath,
188
+ method: 'GET',
189
+ headers: headerParameters,
190
+ query: queryParameters,
191
+ }, initOverrides);
192
+
193
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ProjectFromJSON));
194
+ }
195
+
196
+ /**
197
+ */
198
+ async getAllProjects(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Project>> {
199
+ const response = await this.getAllProjectsRaw(initOverrides);
200
+ return await response.value();
201
+ }
202
+
203
+ /**
204
+ */
205
+ async getProjectRaw(requestParameters: GetProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Project>> {
206
+ if (requestParameters['id'] == null) {
207
+ throw new runtime.RequiredError(
208
+ 'id',
209
+ 'Required parameter "id" was null or undefined when calling getProject().'
210
+ );
211
+ }
212
+
213
+ const queryParameters: any = {};
214
+
215
+ const headerParameters: runtime.HTTPHeaders = {};
216
+
217
+
218
+ let urlPath = `/projects/{id}`;
219
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
220
+
221
+ const response = await this.request({
222
+ path: urlPath,
223
+ method: 'GET',
224
+ headers: headerParameters,
225
+ query: queryParameters,
226
+ }, initOverrides);
227
+
228
+ return new runtime.JSONApiResponse(response, (jsonValue) => ProjectFromJSON(jsonValue));
229
+ }
230
+
231
+ /**
232
+ */
233
+ async getProject(requestParameters: GetProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Project> {
234
+ const response = await this.getProjectRaw(requestParameters, initOverrides);
235
+ return await response.value();
236
+ }
237
+
238
+ }
@@ -0,0 +1,3 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './ProjectsControllerApi';
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './runtime';
4
+ export * from './apis/index';
5
+ export * from './models/index';
@@ -0,0 +1,65 @@
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
+ /**
17
+ *
18
+ * @export
19
+ * @interface CreateProjectRequest
20
+ */
21
+ export interface CreateProjectRequest {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof CreateProjectRequest
26
+ */
27
+ name?: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the CreateProjectRequest interface.
32
+ */
33
+ export function instanceOfCreateProjectRequest(value: object): value is CreateProjectRequest {
34
+ return true;
35
+ }
36
+
37
+ export function CreateProjectRequestFromJSON(json: any): CreateProjectRequest {
38
+ return CreateProjectRequestFromJSONTyped(json, false);
39
+ }
40
+
41
+ export function CreateProjectRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateProjectRequest {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ return {
46
+
47
+ 'name': json['name'] == null ? undefined : json['name'],
48
+ };
49
+ }
50
+
51
+ export function CreateProjectRequestToJSON(json: any): CreateProjectRequest {
52
+ return CreateProjectRequestToJSONTyped(json, false);
53
+ }
54
+
55
+ export function CreateProjectRequestToJSONTyped(value?: CreateProjectRequest | null, ignoreDiscriminator: boolean = false): any {
56
+ if (value == null) {
57
+ return value;
58
+ }
59
+
60
+ return {
61
+
62
+ 'name': value['name'],
63
+ };
64
+ }
65
+