@gewis/grooster-backend-ts 1.2.2 → 1.3.1

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gewis/grooster-backend-ts",
3
3
  "main": "./dist/index.js",
4
- "version": "1.2.2",
4
+ "version": "1.3.1",
5
5
  "types": "./dist/index.d.ts",
6
6
  "repository": {
7
7
  "url": "git+https://github.com/GEWIS/grooster-backend.git",
@@ -19,6 +19,7 @@ docs/RosterShiftApi.md
19
19
  docs/RosterShiftCreateRequest.md
20
20
  docs/RosterTemplate.md
21
21
  docs/RosterTemplateCreateRequest.md
22
+ docs/RosterTemplateUpdateParams.md
22
23
  docs/RosterUpdateRequest.md
23
24
  docs/SavedShift.md
24
25
  docs/SavedShiftApi.md
package/src/api.ts CHANGED
@@ -430,6 +430,25 @@ export interface RosterTemplateCreateRequest {
430
430
  */
431
431
  'shifts'?: Array<string>;
432
432
  }
433
+ /**
434
+ *
435
+ * @export
436
+ * @interface RosterTemplateUpdateParams
437
+ */
438
+ export interface RosterTemplateUpdateParams {
439
+ /**
440
+ *
441
+ * @type {string}
442
+ * @memberof RosterTemplateUpdateParams
443
+ */
444
+ 'name'?: string;
445
+ /**
446
+ *
447
+ * @type {Array<string>}
448
+ * @memberof RosterTemplateUpdateParams
449
+ */
450
+ 'shifts'?: Array<string>;
451
+ }
433
452
  /**
434
453
  *
435
454
  * @export
@@ -1134,6 +1153,47 @@ export const RosterApiAxiosParamCreator = function (configuration?: Configuratio
1134
1153
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1135
1154
  localVarRequestOptions.data = serializeDataIfNeeded(updateParams, localVarRequestOptions, configuration)
1136
1155
 
1156
+ return {
1157
+ url: toPathString(localVarUrlObj),
1158
+ options: localVarRequestOptions,
1159
+ };
1160
+ },
1161
+ /**
1162
+ *
1163
+ * @summary Updates a roster template by ID
1164
+ * @param {number} id Template ID
1165
+ * @param {RosterTemplateUpdateParams} [params] Update params
1166
+ * @param {*} [options] Override http request option.
1167
+ * @throws {RequiredError}
1168
+ */
1169
+ updateRosterTemplate: async (id: number, params?: RosterTemplateUpdateParams, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1170
+ // verify required parameter 'id' is not null or undefined
1171
+ assertParamExists('updateRosterTemplate', 'id', id)
1172
+ const localVarPath = `/roster/template/{id}`
1173
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1174
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1175
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1176
+ let baseOptions;
1177
+ if (configuration) {
1178
+ baseOptions = configuration.baseOptions;
1179
+ }
1180
+
1181
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
1182
+ const localVarHeaderParameter = {} as any;
1183
+ const localVarQueryParameter = {} as any;
1184
+
1185
+ // authentication BearerAuth required
1186
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
1187
+
1188
+
1189
+
1190
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1191
+
1192
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1193
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1194
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1195
+ localVarRequestOptions.data = serializeDataIfNeeded(params, localVarRequestOptions, configuration)
1196
+
1137
1197
  return {
1138
1198
  url: toPathString(localVarUrlObj),
1139
1199
  options: localVarRequestOptions,
@@ -1169,7 +1229,7 @@ export const RosterApiFp = function(configuration?: Configuration) {
1169
1229
  * @param {*} [options] Override http request option.
1170
1230
  * @throws {RequiredError}
1171
1231
  */
1172
- async createRosterTemplate(params?: RosterTemplateCreateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<SavedShift>>> {
1232
+ async createRosterTemplate(params?: RosterTemplateCreateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<RosterTemplate>>> {
1173
1233
  const localVarAxiosArgs = await localVarAxiosParamCreator.createRosterTemplate(params, options);
1174
1234
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1175
1235
  const localVarOperationServerBasePath = operationServerMap['RosterApi.createRosterTemplate']?.[localVarOperationServerIndex]?.url;
@@ -1268,6 +1328,20 @@ export const RosterApiFp = function(configuration?: Configuration) {
1268
1328
  const localVarOperationServerBasePath = operationServerMap['RosterApi.updateRoster']?.[localVarOperationServerIndex]?.url;
1269
1329
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1270
1330
  },
1331
+ /**
1332
+ *
1333
+ * @summary Updates a roster template by ID
1334
+ * @param {number} id Template ID
1335
+ * @param {RosterTemplateUpdateParams} [params] Update params
1336
+ * @param {*} [options] Override http request option.
1337
+ * @throws {RequiredError}
1338
+ */
1339
+ async updateRosterTemplate(id: number, params?: RosterTemplateUpdateParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RosterTemplate>> {
1340
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateRosterTemplate(id, params, options);
1341
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1342
+ const localVarOperationServerBasePath = operationServerMap['RosterApi.updateRosterTemplate']?.[localVarOperationServerIndex]?.url;
1343
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1344
+ },
1271
1345
  }
1272
1346
  };
1273
1347
 
@@ -1295,7 +1369,7 @@ export const RosterApiFactory = function (configuration?: Configuration, basePat
1295
1369
  * @param {*} [options] Override http request option.
1296
1370
  * @throws {RequiredError}
1297
1371
  */
1298
- createRosterTemplate(params?: RosterTemplateCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<SavedShift>> {
1372
+ createRosterTemplate(params?: RosterTemplateCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<RosterTemplate>> {
1299
1373
  return localVarFp.createRosterTemplate(params, options).then((request) => request(axios, basePath));
1300
1374
  },
1301
1375
  /**
@@ -1370,6 +1444,17 @@ export const RosterApiFactory = function (configuration?: Configuration, basePat
1370
1444
  updateRoster(id: number, updateParams: RosterUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise<Roster> {
1371
1445
  return localVarFp.updateRoster(id, updateParams, options).then((request) => request(axios, basePath));
1372
1446
  },
1447
+ /**
1448
+ *
1449
+ * @summary Updates a roster template by ID
1450
+ * @param {number} id Template ID
1451
+ * @param {RosterTemplateUpdateParams} [params] Update params
1452
+ * @param {*} [options] Override http request option.
1453
+ * @throws {RequiredError}
1454
+ */
1455
+ updateRosterTemplate(id: number, params?: RosterTemplateUpdateParams, options?: RawAxiosRequestConfig): AxiosPromise<RosterTemplate> {
1456
+ return localVarFp.updateRosterTemplate(id, params, options).then((request) => request(axios, basePath));
1457
+ },
1373
1458
  };
1374
1459
  };
1375
1460
 
@@ -1489,6 +1574,19 @@ export class RosterApi extends BaseAPI {
1489
1574
  public updateRoster(id: number, updateParams: RosterUpdateRequest, options?: RawAxiosRequestConfig) {
1490
1575
  return RosterApiFp(this.configuration).updateRoster(id, updateParams, options).then((request) => request(this.axios, this.basePath));
1491
1576
  }
1577
+
1578
+ /**
1579
+ *
1580
+ * @summary Updates a roster template by ID
1581
+ * @param {number} id Template ID
1582
+ * @param {RosterTemplateUpdateParams} [params] Update params
1583
+ * @param {*} [options] Override http request option.
1584
+ * @throws {RequiredError}
1585
+ * @memberof RosterApi
1586
+ */
1587
+ public updateRosterTemplate(id: number, params?: RosterTemplateUpdateParams, options?: RawAxiosRequestConfig) {
1588
+ return RosterApiFp(this.configuration).updateRosterTemplate(id, params, options).then((request) => request(this.axios, this.basePath));
1589
+ }
1492
1590
  }
1493
1591
 
1494
1592
 
@@ -13,6 +13,7 @@ All URIs are relative to *http://localhost*
13
13
  |[**getRosterTemplates**](#getrostertemplates) | **GET** /roster/template | Get all rosters templates or query by organ ID|
14
14
  |[**getRosters**](#getrosters) | **GET** /roster | Get all rosters or query by date and organ|
15
15
  |[**updateRoster**](#updateroster) | **PATCH** /roster/{id} | Update a roster|
16
+ |[**updateRosterTemplate**](#updaterostertemplate) | **PUT** /roster/template/{id} | Updates a roster template by ID|
16
17
 
17
18
  # **createRoster**
18
19
  > Roster createRoster(createParams)
@@ -67,7 +68,7 @@ const { status, data } = await apiInstance.createRoster(
67
68
  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
68
69
 
69
70
  # **createRosterTemplate**
70
- > Array<SavedShift> createRosterTemplate()
71
+ > Array<RosterTemplate> createRosterTemplate()
71
72
 
72
73
 
73
74
  ### Example
@@ -98,7 +99,7 @@ const { status, data } = await apiInstance.createRosterTemplate(
98
99
 
99
100
  ### Return type
100
101
 
101
- **Array<SavedShift>**
102
+ **Array<RosterTemplate>**
102
103
 
103
104
  ### Authorization
104
105
 
@@ -486,3 +487,59 @@ const { status, data } = await apiInstance.updateRoster(
486
487
 
487
488
  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
488
489
 
490
+ # **updateRosterTemplate**
491
+ > RosterTemplate updateRosterTemplate()
492
+
493
+
494
+ ### Example
495
+
496
+ ```typescript
497
+ import {
498
+ RosterApi,
499
+ Configuration,
500
+ RosterTemplateUpdateParams
501
+ } from './api';
502
+
503
+ const configuration = new Configuration();
504
+ const apiInstance = new RosterApi(configuration);
505
+
506
+ let id: number; //Template ID (default to undefined)
507
+ let params: RosterTemplateUpdateParams; //Update params (optional)
508
+
509
+ const { status, data } = await apiInstance.updateRosterTemplate(
510
+ id,
511
+ params
512
+ );
513
+ ```
514
+
515
+ ### Parameters
516
+
517
+ |Name | Type | Description | Notes|
518
+ |------------- | ------------- | ------------- | -------------|
519
+ | **params** | **RosterTemplateUpdateParams**| Update params | |
520
+ | **id** | [**number**] | Template ID | defaults to undefined|
521
+
522
+
523
+ ### Return type
524
+
525
+ **RosterTemplate**
526
+
527
+ ### Authorization
528
+
529
+ [BearerAuth](../README.md#BearerAuth)
530
+
531
+ ### HTTP request headers
532
+
533
+ - **Content-Type**: application/json
534
+ - **Accept**: application/json
535
+
536
+
537
+ ### HTTP response details
538
+ | Status code | Description | Response headers |
539
+ |-------------|-------------|------------------|
540
+ |**200** | OK | - |
541
+ |**400** | Bad Request | - |
542
+ |**404** | Not Found | - |
543
+
544
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
545
+
@@ -0,0 +1,22 @@
1
+ # RosterTemplateUpdateParams
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **name** | **string** | | [optional] [default to undefined]
9
+ **shifts** | **Array&lt;string&gt;** | | [optional] [default to undefined]
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import { RosterTemplateUpdateParams } from './api';
15
+
16
+ const instance: RosterTemplateUpdateParams = {
17
+ name,
18
+ shifts,
19
+ };
20
+ ```
21
+
22
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* tslint:disable */
2
- /* eslint-disable */
2
+
3
3
  /**
4
4
  * GRooster
5
5
  * A GEWIS Rooster maker