From 7798846802a16fec6cd1e6a16c7de39b392538b8 Mon Sep 17 00:00:00 2001 From: Silevester Dongmo <58907550+SilverD3@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:33:06 +0100 Subject: [PATCH 1/4] chore:OH2-406 | Align API specs. Fix breaking changes introduced by OH2-253 (#670) --- api/oh.yaml | 1041 ++++++++--------- src/generated/.openapi-generator/FILES | 252 ++-- src/generated/apis/LoginApi.ts | 25 + src/generated/apis/UserGroupsApi.ts | 183 +++ src/generated/apis/UserSettingsApi.ts | 96 +- src/generated/apis/UsersApi.ts | 350 +----- src/generated/apis/index.ts | 2 + src/generated/models/AdmissionDTO.ts | 8 +- src/generated/models/LoginResponse.ts | 6 + ...PatientProfilePhotoPhotoAsImageGraphics.ts | 10 +- ...oPhotoAsImageGraphicsClipBoundsBounds2D.ts | 16 +- ...entProfilePhotoPhotoAsImageGraphicsFont.ts | 40 +- ...ilePhotoPhotoAsImageGraphicsFontMetrics.ts | 28 +- ...ageGraphicsFontMetricsFontRenderContext.ts | 20 +- src/generated/models/TherapyRow.ts | 10 +- src/generated/models/TokenRefreshRequest.ts | 24 + src/generated/models/WardDTO.ts | 4 +- src/generated/models/index.ts | 2 +- src/state/layouts/thunk.ts | 8 +- src/state/main/thunk.ts | 15 +- src/state/usergroups/thunk.ts | 8 +- src/state/users/thunk.ts | 2 +- 22 files changed, 1083 insertions(+), 1067 deletions(-) create mode 100644 src/generated/apis/UserGroupsApi.ts create mode 100644 src/generated/models/TokenRefreshRequest.ts diff --git a/api/oh.yaml b/api/oh.yaml index 5d439b62a..dced99431 100644 --- a/api/oh.yaml +++ b/api/oh.yaml @@ -202,44 +202,23 @@ paths: $ref: '#/components/schemas/VaccineDTO' security: - bearerAuth: [] - /users: - get: - tags: - - Users - operationId: getUser - parameters: - - name: group_id - in: query - required: false - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/UserDTO' - security: - - bearerAuth: [] + /usersettings/{id}: put: tags: - - Users - operationId: updateUser + - User Settings + operationId: updateUserSettings parameters: - - name: password - in: query - required: false + - name: id + in: path + required: true schema: - type: boolean - default: false + type: integer + format: int32 requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserDTO' + $ref: '#/components/schemas/UserSettingDTO' required: true responses: "200": @@ -247,65 +226,60 @@ paths: content: application/json: schema: - type: boolean + $ref: '#/components/schemas/UserSettingDTO' security: - bearerAuth: [] - post: + delete: tags: - - Users - operationId: newUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserDTO' + - User Settings + operationId: deleteUserSetting + parameters: + - name: id + in: path required: true + schema: + type: integer + format: int32 responses: - "200": - description: OK - content: - application/json: - schema: - type: boolean + "204": + description: No Content security: - bearerAuth: [] - /users/settings/{id}: + /users/{username}: get: tags: - Users - operationId: getUserSettingById + operationId: getUserByName parameters: - - name: id + - name: username in: path required: true schema: - type: integer - format: int32 + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/UserSettingDTO' + $ref: '#/components/schemas/UserDTO' security: - bearerAuth: [] put: tags: - Users - operationId: updateUserSettings + operationId: updateUser parameters: - - name: id + - name: username in: path required: true schema: - type: integer - format: int32 + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserSettingDTO' + $ref: '#/components/schemas/UserDTO' required: true responses: "200": @@ -313,54 +287,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserSettingDTO' + $ref: '#/components/schemas/UserDTO' security: - bearerAuth: [] delete: tags: - Users - operationId: deleteUserSetting + operationId: deleteUser parameters: - - name: id + - name: username in: path required: true schema: - type: integer - format: int32 + type: string responses: - "200": - description: OK - content: - application/json: - schema: - type: boolean + "204": + description: No Content security: - bearerAuth: [] - /users/groups: + /users/me: get: tags: - Users - operationId: getUserGroup + operationId: retrieveProfileByCurrentLoggedInUser responses: "200": description: OK content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/UserGroupDTO' + $ref: '#/components/schemas/UserProfileDTO' security: - bearerAuth: [] put: tags: - Users - operationId: updateUserGroup + operationId: updateProfile requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserGroupDTO' + $ref: '#/components/schemas/UserDTO' required: true responses: "200": @@ -368,13 +335,39 @@ paths: content: application/json: schema: - type: boolean + $ref: '#/components/schemas/UserProfileDTO' security: - bearerAuth: [] - post: + /usergroups/{group_code}: + get: tags: - - Users - operationId: newUserGroup + - User Groups + operationId: getUserGroup + parameters: + - name: group_code + in: path + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroupDTO' + security: + - bearerAuth: [] + put: + tags: + - User Groups + operationId: updateUserGroup + parameters: + - name: group_code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -387,7 +380,22 @@ paths: content: application/json: schema: - type: boolean + $ref: '#/components/schemas/UserGroupDTO' + security: + - bearerAuth: [] + delete: + tags: + - User Groups + operationId: deleteGroup + parameters: + - name: group_code + in: path + required: true + schema: + type: string + responses: + "204": + description: No Content security: - bearerAuth: [] /suppliers: @@ -2034,10 +2042,10 @@ paths: type: boolean security: - bearerAuth: [] - /users/settings: + /usersettings: get: tags: - - Users + - User Settings operationId: getUserSettings responses: "200": @@ -2052,7 +2060,7 @@ paths: - bearerAuth: [] post: tags: - - Users + - User Settings operationId: newUserSettings requestBody: content: @@ -2060,19 +2068,95 @@ paths: schema: $ref: '#/components/schemas/UserSettingDTO' required: true + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/UserSettingDTO' + security: + - bearerAuth: [] + /users: + get: + tags: + - Users + operationId: getUser + parameters: + - name: group_id + in: query + required: false + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/UserSettingDTO' + type: array + items: + $ref: '#/components/schemas/UserDTO' security: - bearerAuth: [] - /users/groups/{group_code}/permissions/{id}: post: tags: - Users + operationId: newUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserDTO' + required: true + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/UserDTO' + security: + - bearerAuth: [] + /usergroups: + get: + tags: + - User Groups + operationId: getUserGroups + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserGroupDTO' + security: + - bearerAuth: [] + post: + tags: + - User Groups + operationId: newUserGroup + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroupDTO' + required: true + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroupDTO' + security: + - bearerAuth: [] + /usergroups/{group_code}/permissions/{id}: + post: + tags: + - User Groups operationId: assignPermission parameters: - name: group_code @@ -2087,17 +2171,18 @@ paths: type: integer format: int32 responses: - "200": - description: OK + "201": + description: Created content: application/json: schema: - type: boolean + type: integer + format: int32 security: - bearerAuth: [] delete: tags: - - Users + - User Groups operationId: revokePermission parameters: - name: group_code @@ -2112,12 +2197,8 @@ paths: type: integer format: int32 responses: - "200": - description: OK - content: - application/json: - schema: - type: boolean + "204": + description: No Content security: - bearerAuth: [] /therapies: @@ -3084,6 +3165,26 @@ paths: $ref: '#/components/schemas/BillDTO' security: - bearerAuth: [] + /auth/refresh-token: + post: + tags: + - Login + operationId: refreshToken + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TokenRefreshRequest' + required: true + responses: + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/LoginResponse' + security: + - bearerAuth: [] /auth/logout: post: tags: @@ -3304,13 +3405,13 @@ paths: type: boolean security: - bearerAuth: [] - /users/{username}: + /usersettings/{configName}: get: tags: - - Users - operationId: getUserByName + - User Settings + operationId: getUserSettingByUser parameters: - - name: username + - name: configName in: path required: true schema: @@ -3321,71 +3422,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserDTO' + $ref: '#/components/schemas/UserSettingDTO' security: - bearerAuth: [] - delete: - tags: - - Users - operationId: deleteUser - parameters: - - name: username - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - type: boolean - security: - - bearerAuth: [] - /users/{userName}/settings/{configName}: - get: - tags: - - Users - operationId: getUserSettingByUser - parameters: - - name: userName - in: path - required: true - schema: - type: string - - name: configName - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UserSettingDTO' - security: - - bearerAuth: [] - /users/permissions: - get: - tags: - - Users - operationId: retrievePermissionsByCurrentLoggedInUser - responses: - "200": - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/LitePermissionDTO' - security: - - bearerAuth: [] - /users/permissions/username/{username}: - get: + /users/{username}/permissions: + get: tags: - Users operationId: retrievePermissionsByUsername @@ -3403,60 +3444,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/LitePermissionDTO' - security: - - bearerAuth: [] - /users/me: - get: - tags: - - Users - operationId: retrieveProfileByCurrentLoggedInUser - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UserProfileDTO' - security: - - bearerAuth: [] - /users/groups/{group_code}: - get: - tags: - - Users - operationId: getUserGroup_1 - parameters: - - name: group_code - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/UserGroupDTO' - security: - - bearerAuth: [] - delete: - tags: - - Users - operationId: deleteGroup - parameters: - - name: group_code - in: path - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - type: boolean + $ref: '#/components/schemas/PermissionDTO' security: - bearerAuth: [] /therapies/{code_patient}: @@ -6176,11 +6164,11 @@ components: description: lock format: int32 example: 0 - opd: + female: type: boolean male: type: boolean - female: + opd: type: boolean pharmacy: type: boolean @@ -6428,6 +6416,32 @@ components: format: int32 example: 0 description: Class representing a vaccine + UserSettingDTO: + required: + - configName + - configValue + - id + - user + type: object + properties: + id: + type: integer + description: The id of the setting (must be unique) + format: int32 + example: 1 + configName: + maxLength: 50 + type: string + description: The name of the setting + example: dashboard + user: + type: string + description: The name of the user + example: admin + configValue: + maxLength: 65535 + type: string + description: The value of the user PermissionDTO: required: - description @@ -6490,32 +6504,17 @@ components: items: $ref: '#/components/schemas/PermissionDTO' description: The user's group - UserSettingDTO: - required: - - configName - - configValue - - id - - user + UserProfileDTO: type: object properties: - id: - type: integer - description: The id of the setting (must be unique) - format: int32 - example: 1 - configName: - maxLength: 50 - type: string - description: The name of the setting - example: dashboard - user: - type: string - description: The name of the user - example: admin - configValue: - maxLength: 65535 + userName: type: string - description: The value of the user + permissions: + type: array + items: + type: string + userGroup: + $ref: '#/components/schemas/UserGroupDTO' SupplierDTO: required: - supId @@ -6836,11 +6835,11 @@ components: type: string description: "Flag record deleted, values are 'Y' OR 'N' " example: "N" - fhu: - type: string yprog: type: integer format: int32 + fhu: + type: string description: The admission AdmissionTypeDTO: required: @@ -7950,17 +7949,6 @@ components: type: object family: type: string - plain: - type: boolean - psname: - type: string - size2D: - type: number - format: float - availableAttributes: - type: array - items: - type: object fontName: type: string transform: @@ -8015,228 +8003,66 @@ components: format: float transformed: type: boolean - clip: + plain: + type: boolean + psname: + type: string + size2D: + type: number + format: float + availableAttributes: + type: array + items: + type: object + fontMetrics: type: object properties: - bounds: + font: type: object properties: - x: - type: number - format: double - "y": - type: number - format: double - width: - type: number - format: double - height: - type: number - format: double - empty: - type: boolean - location: + name: + type: string + style: + type: integer + format: int32 + size: + type: integer + format: int32 + attributes: + type: object + additionalProperties: + type: object + family: + type: string + fontName: + type: string + transform: type: object properties: - x: + scaleX: type: number format: double - "y": + shearY: type: number format: double - size: - type: object - properties: - width: + shearX: type: number format: double - height: + scaleY: type: number format: double - bounds2D: - type: object - properties: - empty: - type: boolean - "y": + translateX: type: number format: double - x: + translateY: type: number format: double - width: - type: number - format: double - maxX: - type: number - format: double - maxY: - type: number - format: double - centerX: - type: number - format: double - centerY: - type: number - format: double - height: - type: number - format: double - minX: - type: number - format: double - minY: - type: number - format: double - rect: - type: object - properties: - empty: - type: boolean - "y": - type: number - format: double - x: - type: number - format: double - width: - type: number - format: double - maxX: - type: number - format: double - maxY: - type: number - format: double - centerX: - type: number - format: double - centerY: - type: number - format: double - height: - type: number - format: double - minX: - type: number - format: double - minY: - type: number - format: double - writeOnly: true - maxX: - type: number - format: double - maxY: - type: number - format: double - centerX: - type: number - format: double - centerY: - type: number - format: double - minX: - type: number - format: double - minY: - type: number - format: double - bounds2D: - type: object - properties: - empty: - type: boolean - "y": - type: number - format: double - x: - type: number - format: double - width: - type: number - format: double - maxX: - type: number - format: double - maxY: - type: number - format: double - centerX: - type: number - format: double - centerY: - type: number - format: double - height: - type: number - format: double - minX: - type: number - format: double - minY: - type: number - format: double - fontMetrics: - type: object - properties: - font: - type: object - properties: - name: - type: string - style: - type: integer - format: int32 - size: - type: integer - format: int32 - attributes: - type: object - additionalProperties: - type: object - family: - type: string - plain: - type: boolean - psname: - type: string - size2D: - type: number - format: float - availableAttributes: - type: array - items: - type: object - fontName: - type: string - transform: - type: object - properties: - scaleX: - type: number - format: double - shearY: - type: number - format: double - shearX: - type: number - format: double - scaleY: - type: number - format: double - translateX: - type: number - format: double - translateY: - type: number - format: double - type: - type: integer - format: int32 - identity: - type: boolean - toRotation: + type: + type: integer + format: int32 + identity: + type: boolean + toRotation: type: number format: double writeOnly: true @@ -8262,6 +8088,29 @@ components: format: float transformed: type: boolean + plain: + type: boolean + psname: + type: string + size2D: + type: number + format: float + availableAttributes: + type: array + items: + type: object + ascent: + type: integer + format: int32 + descent: + type: integer + format: int32 + leading: + type: integer + format: int32 + height: + type: integer + format: int32 maxDescent: type: integer format: int32 @@ -8273,11 +8122,6 @@ components: fontRenderContext: type: object properties: - antiAliased: - type: boolean - transformType: - type: integer - format: int32 transform: type: object properties: @@ -8321,6 +8165,11 @@ components: type: object transformed: type: boolean + antiAliased: + type: boolean + transformType: + type: integer + format: int32 maxAscent: type: integer format: int32 @@ -8331,18 +8180,6 @@ components: maxAdvance: type: integer format: int32 - height: - type: integer - format: int32 - ascent: - type: integer - format: int32 - descent: - type: integer - format: int32 - leading: - type: integer - format: int32 clipBounds: type: object properties: @@ -8383,13 +8220,16 @@ components: properties: empty: type: boolean - "y": + width: type: number format: double - x: + height: type: number format: double - width: + "y": + type: number + format: double + x: type: number format: double maxX: @@ -8404,9 +8244,6 @@ components: centerY: type: number format: double - height: - type: number - format: double minX: type: number format: double @@ -8418,13 +8255,16 @@ components: properties: empty: type: boolean - "y": + width: type: number format: double - x: + height: type: number format: double - width: + "y": + type: number + format: double + x: type: number format: double maxX: @@ -8439,9 +8279,6 @@ components: centerY: type: number format: double - height: - type: number - format: double minX: type: number format: double @@ -8500,6 +8337,168 @@ components: type: integer format: int32 writeOnly: true + clip: + type: object + properties: + bounds: + type: object + properties: + x: + type: number + format: double + "y": + type: number + format: double + width: + type: number + format: double + height: + type: number + format: double + empty: + type: boolean + location: + type: object + properties: + x: + type: number + format: double + "y": + type: number + format: double + size: + type: object + properties: + width: + type: number + format: double + height: + type: number + format: double + bounds2D: + type: object + properties: + empty: + type: boolean + width: + type: number + format: double + height: + type: number + format: double + "y": + type: number + format: double + x: + type: number + format: double + maxX: + type: number + format: double + maxY: + type: number + format: double + centerX: + type: number + format: double + centerY: + type: number + format: double + minX: + type: number + format: double + minY: + type: number + format: double + rect: + type: object + properties: + empty: + type: boolean + width: + type: number + format: double + height: + type: number + format: double + "y": + type: number + format: double + x: + type: number + format: double + maxX: + type: number + format: double + maxY: + type: number + format: double + centerX: + type: number + format: double + centerY: + type: number + format: double + minX: + type: number + format: double + minY: + type: number + format: double + writeOnly: true + maxX: + type: number + format: double + maxY: + type: number + format: double + centerX: + type: number + format: double + centerY: + type: number + format: double + minX: + type: number + format: double + minY: + type: number + format: double + bounds2D: + type: object + properties: + empty: + type: boolean + width: + type: number + format: double + height: + type: number + format: double + "y": + type: number + format: double + x: + type: number + format: double + maxX: + type: number + format: double + maxY: + type: number + format: double + centerX: + type: number + format: double + centerY: + type: number + format: double + minX: + type: number + format: double + minY: + type: number + format: double clipRect: type: object properties: @@ -8540,13 +8539,16 @@ components: properties: empty: type: boolean - "y": + width: type: number format: double - x: + height: type: number format: double - width: + "y": + type: number + format: double + x: type: number format: double maxX: @@ -8561,9 +8563,6 @@ components: centerY: type: number format: double - height: - type: number - format: double minX: type: number format: double @@ -8575,13 +8574,16 @@ components: properties: empty: type: boolean - "y": + width: type: number format: double - x: + height: type: number format: double - width: + "y": + type: number + format: double + x: type: number format: double maxX: @@ -8596,9 +8598,6 @@ components: centerY: type: number format: double - height: - type: number - format: double minX: type: number format: double @@ -8686,13 +8685,13 @@ components: smsInt: type: integer format: int32 - medical: - type: integer - format: int32 sms: type: boolean notify: type: boolean + medical: + type: integer + format: int32 TherapyDTO: type: object properties: @@ -8926,26 +8925,20 @@ components: example: NEGATIVE exam: $ref: '#/components/schemas/ExamDTO' - LoginRequest: - required: - - password - - username + TokenRefreshRequest: type: object properties: - username: - type: string - description: User Name - example: admin - password: + refreshToken: type: string - description: Password of user - example: admin LoginResponse: type: object properties: token: type: string description: Token + refreshToken: + type: string + description: RefreshToken type: type: string description: Type of Token @@ -8955,22 +8948,20 @@ components: description: User name example: admin description: Class representing a Login response - LitePermissionDTO: + LoginRequest: + required: + - password + - username type: object properties: - name: + username: type: string - UserProfileDTO: - type: object - properties: - userName: + description: User Name + example: admin + password: type: string - permissions: - type: array - items: - type: string - userGroup: - $ref: '#/components/schemas/UserGroupDTO' + description: Password of user + example: admin PriceDTO: required: - description @@ -9177,4 +9168,4 @@ components: bearerAuth: type: http scheme: bearer - bearerFormat: JWT \ No newline at end of file + bearerFormat: JWT diff --git a/src/generated/.openapi-generator/FILES b/src/generated/.openapi-generator/FILES index da64a2958..e64020890 100644 --- a/src/generated/.openapi-generator/FILES +++ b/src/generated/.openapi-generator/FILES @@ -1,129 +1,131 @@ .gitignore -apis/AdmissionTypesApi.ts -apis/AdmissionsApi.ts -apis/AgeTypesApi.ts -apis/BillsApi.ts -apis/DeliveryResultTypeApi.ts -apis/DeliveryTypeApi.ts -apis/DischargeTypeApi.ts -apis/DiseaseTypesApi.ts -apis/DiseasesApi.ts -apis/ExamRowsApi.ts -apis/ExamTypesApi.ts -apis/ExaminationsApi.ts -apis/ExamsApi.ts -apis/HospitalsApi.ts -apis/LaboratoriesApi.ts -apis/LoginApi.ts -apis/MalnutritionsApi.ts -apis/MedicalStockMovementTypeApi.ts -apis/MedicalStockWardApi.ts -apis/MedicalTypesApi.ts -apis/MedicalsApi.ts -apis/OpdsApi.ts -apis/OperationsApi.ts -apis/OperationsTypesApi.ts -apis/OthersPriceApi.ts -apis/PatientConsensusApi.ts -apis/PatientVaccinesApi.ts -apis/PatientsApi.ts -apis/PermissionsApi.ts -apis/PregnantTreatmentTypesApi.ts -apis/PriceListsApi.ts -apis/ReportsApi.ts -apis/SMSApi.ts -apis/StockMovementsApi.ts -apis/SuppliersApi.ts -apis/TherapiesApi.ts -apis/UsersApi.ts -apis/VaccineTypeApi.ts -apis/VaccinesApi.ts -apis/VisitApi.ts -apis/WardsApi.ts -apis/index.ts +apis\AdmissionTypesApi.ts +apis\AdmissionsApi.ts +apis\AgeTypesApi.ts +apis\BillsApi.ts +apis\DeliveryResultTypeApi.ts +apis\DeliveryTypeApi.ts +apis\DischargeTypeApi.ts +apis\DiseaseTypesApi.ts +apis\DiseasesApi.ts +apis\ExamRowsApi.ts +apis\ExamTypesApi.ts +apis\ExaminationsApi.ts +apis\ExamsApi.ts +apis\HospitalsApi.ts +apis\LaboratoriesApi.ts +apis\LoginApi.ts +apis\MalnutritionsApi.ts +apis\MedicalStockMovementTypeApi.ts +apis\MedicalStockWardApi.ts +apis\MedicalTypesApi.ts +apis\MedicalsApi.ts +apis\OpdsApi.ts +apis\OperationsApi.ts +apis\OperationsTypesApi.ts +apis\OthersPriceApi.ts +apis\PatientConsensusApi.ts +apis\PatientVaccinesApi.ts +apis\PatientsApi.ts +apis\PermissionsApi.ts +apis\PregnantTreatmentTypesApi.ts +apis\PriceListsApi.ts +apis\ReportsApi.ts +apis\SMSApi.ts +apis\StockMovementsApi.ts +apis\SuppliersApi.ts +apis\TherapiesApi.ts +apis\UserGroupsApi.ts +apis\UserSettingsApi.ts +apis\UsersApi.ts +apis\VaccineTypeApi.ts +apis\VaccinesApi.ts +apis\VisitApi.ts +apis\WardsApi.ts +apis\index.ts index.ts -models/AdmissionDTO.ts -models/AdmissionTypeDTO.ts -models/AdmittedPatientDTO.ts -models/AgeType.ts -models/AgeTypeDTO.ts -models/BillDTO.ts -models/BillItemsDTO.ts -models/BillPaymentsDTO.ts -models/DeliveryResultTypeDTO.ts -models/DeliveryTypeDTO.ts -models/DischargeTypeDTO.ts -models/DiseaseDTO.ts -models/DiseaseTypeDTO.ts -models/ExamDTO.ts -models/ExamRowDTO.ts -models/ExamTypeDTO.ts -models/FullBillDTO.ts -models/HospitalDTO.ts -models/LabWithRowsDTO.ts -models/LaboratoryDTO.ts -models/LitePermissionDTO.ts -models/LoginRequest.ts -models/LoginResponse.ts -models/LotDTO.ts -models/MalnutritionDTO.ts -models/MedicalDTO.ts -models/MedicalTypeDTO.ts -models/MedicalWardDTO.ts -models/MedicalWardIdDTO.ts -models/MovementDTO.ts -models/MovementTypeDTO.ts -models/MovementWardDTO.ts -models/OpdDTO.ts -models/OpdWithOperationRowDTO.ts -models/OperationDTO.ts -models/OperationRowDTO.ts -models/OperationTypeDTO.ts -models/PageAdmissionDTO.ts -models/PageInfoDTO.ts -models/PageLabWithRowsDTO.ts -models/PageOpdDTO.ts -models/PagePatientDTO.ts -models/PagePatientExaminationDTO.ts -models/Patient.ts -models/PatientConsensus.ts -models/PatientConsensusDTO.ts -models/PatientDTO.ts -models/PatientExaminationDTO.ts -models/PatientProfilePhoto.ts -models/PatientProfilePhotoPhotoAsImage.ts -models/PatientProfilePhotoPhotoAsImageGraphics.ts -models/PatientProfilePhotoPhotoAsImageGraphicsClip.ts -models/PatientProfilePhotoPhotoAsImageGraphicsClipBounds.ts -models/PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D.ts -models/PatientProfilePhotoPhotoAsImageGraphicsClipBoundsLocation.ts -models/PatientProfilePhotoPhotoAsImageGraphicsClipBoundsSize.ts -models/PatientProfilePhotoPhotoAsImageGraphicsColor.ts -models/PatientProfilePhotoPhotoAsImageGraphicsColorColorSpace.ts -models/PatientProfilePhotoPhotoAsImageGraphicsFont.ts -models/PatientProfilePhotoPhotoAsImageGraphicsFontMetrics.ts -models/PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext.ts -models/PatientProfilePhotoPhotoAsImageGraphicsFontTransform.ts -models/PatientVaccineDTO.ts -models/PermissionDTO.ts -models/PregnantTreatmentTypeDTO.ts -models/PriceDTO.ts -models/PriceList.ts -models/PriceListDTO.ts -models/PricesOthersDTO.ts -models/SmsDTO.ts -models/SupplierDTO.ts -models/TherapyDTO.ts -models/TherapyRow.ts -models/TherapyRowDTO.ts -models/UserDTO.ts -models/UserGroupDTO.ts -models/UserProfileDTO.ts -models/UserSettingDTO.ts -models/VaccineDTO.ts -models/VaccineTypeDTO.ts -models/VisitDTO.ts -models/WardDTO.ts -models/index.ts +models\AdmissionDTO.ts +models\AdmissionTypeDTO.ts +models\AdmittedPatientDTO.ts +models\AgeType.ts +models\AgeTypeDTO.ts +models\BillDTO.ts +models\BillItemsDTO.ts +models\BillPaymentsDTO.ts +models\DeliveryResultTypeDTO.ts +models\DeliveryTypeDTO.ts +models\DischargeTypeDTO.ts +models\DiseaseDTO.ts +models\DiseaseTypeDTO.ts +models\ExamDTO.ts +models\ExamRowDTO.ts +models\ExamTypeDTO.ts +models\FullBillDTO.ts +models\HospitalDTO.ts +models\LabWithRowsDTO.ts +models\LaboratoryDTO.ts +models\LoginRequest.ts +models\LoginResponse.ts +models\LotDTO.ts +models\MalnutritionDTO.ts +models\MedicalDTO.ts +models\MedicalTypeDTO.ts +models\MedicalWardDTO.ts +models\MedicalWardIdDTO.ts +models\MovementDTO.ts +models\MovementTypeDTO.ts +models\MovementWardDTO.ts +models\OpdDTO.ts +models\OpdWithOperationRowDTO.ts +models\OperationDTO.ts +models\OperationRowDTO.ts +models\OperationTypeDTO.ts +models\PageAdmissionDTO.ts +models\PageInfoDTO.ts +models\PageLabWithRowsDTO.ts +models\PageOpdDTO.ts +models\PagePatientDTO.ts +models\PagePatientExaminationDTO.ts +models\Patient.ts +models\PatientConsensus.ts +models\PatientConsensusDTO.ts +models\PatientDTO.ts +models\PatientExaminationDTO.ts +models\PatientProfilePhoto.ts +models\PatientProfilePhotoPhotoAsImage.ts +models\PatientProfilePhotoPhotoAsImageGraphics.ts +models\PatientProfilePhotoPhotoAsImageGraphicsClip.ts +models\PatientProfilePhotoPhotoAsImageGraphicsClipBounds.ts +models\PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D.ts +models\PatientProfilePhotoPhotoAsImageGraphicsClipBoundsLocation.ts +models\PatientProfilePhotoPhotoAsImageGraphicsClipBoundsSize.ts +models\PatientProfilePhotoPhotoAsImageGraphicsColor.ts +models\PatientProfilePhotoPhotoAsImageGraphicsColorColorSpace.ts +models\PatientProfilePhotoPhotoAsImageGraphicsFont.ts +models\PatientProfilePhotoPhotoAsImageGraphicsFontMetrics.ts +models\PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext.ts +models\PatientProfilePhotoPhotoAsImageGraphicsFontTransform.ts +models\PatientVaccineDTO.ts +models\PermissionDTO.ts +models\PregnantTreatmentTypeDTO.ts +models\PriceDTO.ts +models\PriceList.ts +models\PriceListDTO.ts +models\PricesOthersDTO.ts +models\SmsDTO.ts +models\SupplierDTO.ts +models\TherapyDTO.ts +models\TherapyRow.ts +models\TherapyRowDTO.ts +models\TokenRefreshRequest.ts +models\UserDTO.ts +models\UserGroupDTO.ts +models\UserProfileDTO.ts +models\UserSettingDTO.ts +models\VaccineDTO.ts +models\VaccineTypeDTO.ts +models\VisitDTO.ts +models\WardDTO.ts +models\index.ts runtime.ts tsconfig.json diff --git a/src/generated/apis/LoginApi.ts b/src/generated/apis/LoginApi.ts index 8032f9fea..47ead5458 100644 --- a/src/generated/apis/LoginApi.ts +++ b/src/generated/apis/LoginApi.ts @@ -16,12 +16,17 @@ import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, OperationOpts, RawAjaxRes import { LoginRequest, LoginResponse, + TokenRefreshRequest, } from '../models'; export interface AuthenticateUserRequest { loginRequest: LoginRequest; } +export interface RefreshTokenRequest { + tokenRefreshRequest: TokenRefreshRequest; +} + /** * no description */ @@ -64,4 +69,24 @@ export class LoginApi extends BaseAPI { }, opts?.responseOpts); }; + /** + */ + refreshToken({ tokenRefreshRequest }: RefreshTokenRequest): Observable + refreshToken({ tokenRefreshRequest }: RefreshTokenRequest, opts?: OperationOpts): Observable> + refreshToken({ tokenRefreshRequest }: RefreshTokenRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(tokenRefreshRequest, 'tokenRefreshRequest', 'refreshToken'); + + const headers: HttpHeaders = { + 'Content-Type': 'application/json', + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/auth/refresh-token', + method: 'POST', + headers, + body: tokenRefreshRequest, + }, opts?.responseOpts); + }; + } diff --git a/src/generated/apis/UserGroupsApi.ts b/src/generated/apis/UserGroupsApi.ts new file mode 100644 index 000000000..3c4f33694 --- /dev/null +++ b/src/generated/apis/UserGroupsApi.ts @@ -0,0 +1,183 @@ +// tslint:disable +/** + * Open Hospital API Documentation + * Open Hospital API Documentation + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { Observable } from 'rxjs'; +import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; +import { + UserGroupDTO, +} from '../models'; + +export interface AssignPermissionRequest { + groupCode: string; + id: number; +} + +export interface DeleteGroupRequest { + groupCode: string; +} + +export interface GetUserGroupRequest { + groupCode: string; +} + +export interface NewUserGroupRequest { + userGroupDTO: UserGroupDTO; +} + +export interface RevokePermissionRequest { + groupCode: string; + id: number; +} + +export interface UpdateUserGroupRequest { + groupCode: string; + userGroupDTO: UserGroupDTO; +} + +/** + * no description + */ +export class UserGroupsApi extends BaseAPI { + + /** + */ + assignPermission({ groupCode, id }: AssignPermissionRequest): Observable + assignPermission({ groupCode, id }: AssignPermissionRequest, opts?: OperationOpts): Observable> + assignPermission({ groupCode, id }: AssignPermissionRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(groupCode, 'groupCode', 'assignPermission'); + throwIfNullOrUndefined(id, 'id', 'assignPermission'); + + const headers: HttpHeaders = { + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usergroups/{group_code}/permissions/{id}'.replace('{group_code}', encodeURI(groupCode)).replace('{id}', encodeURI(id)), + method: 'POST', + headers, + }, opts?.responseOpts); + }; + + /** + */ + deleteGroup({ groupCode }: DeleteGroupRequest): Observable + deleteGroup({ groupCode }: DeleteGroupRequest, opts?: OperationOpts): Observable> + deleteGroup({ groupCode }: DeleteGroupRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(groupCode, 'groupCode', 'deleteGroup'); + + const headers: HttpHeaders = { + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usergroups/{group_code}'.replace('{group_code}', encodeURI(groupCode)), + method: 'DELETE', + headers, + }, opts?.responseOpts); + }; + + /** + */ + getUserGroup({ groupCode }: GetUserGroupRequest): Observable + getUserGroup({ groupCode }: GetUserGroupRequest, opts?: OperationOpts): Observable> + getUserGroup({ groupCode }: GetUserGroupRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(groupCode, 'groupCode', 'getUserGroup'); + + const headers: HttpHeaders = { + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usergroups/{group_code}'.replace('{group_code}', encodeURI(groupCode)), + method: 'GET', + headers, + }, opts?.responseOpts); + }; + + /** + */ + getUserGroups(): Observable> + getUserGroups(opts?: OperationOpts): Observable>> + getUserGroups(opts?: OperationOpts): Observable | RawAjaxResponse>> { + const headers: HttpHeaders = { + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request>({ + url: '/usergroups', + method: 'GET', + headers, + }, opts?.responseOpts); + }; + + /** + */ + newUserGroup({ userGroupDTO }: NewUserGroupRequest): Observable + newUserGroup({ userGroupDTO }: NewUserGroupRequest, opts?: OperationOpts): Observable> + newUserGroup({ userGroupDTO }: NewUserGroupRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(userGroupDTO, 'userGroupDTO', 'newUserGroup'); + + const headers: HttpHeaders = { + 'Content-Type': 'application/json', + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usergroups', + method: 'POST', + headers, + body: userGroupDTO, + }, opts?.responseOpts); + }; + + /** + */ + revokePermission({ groupCode, id }: RevokePermissionRequest): Observable + revokePermission({ groupCode, id }: RevokePermissionRequest, opts?: OperationOpts): Observable> + revokePermission({ groupCode, id }: RevokePermissionRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(groupCode, 'groupCode', 'revokePermission'); + throwIfNullOrUndefined(id, 'id', 'revokePermission'); + + const headers: HttpHeaders = { + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usergroups/{group_code}/permissions/{id}'.replace('{group_code}', encodeURI(groupCode)).replace('{id}', encodeURI(id)), + method: 'DELETE', + headers, + }, opts?.responseOpts); + }; + + /** + */ + updateUserGroup({ groupCode, userGroupDTO }: UpdateUserGroupRequest): Observable + updateUserGroup({ groupCode, userGroupDTO }: UpdateUserGroupRequest, opts?: OperationOpts): Observable> + updateUserGroup({ groupCode, userGroupDTO }: UpdateUserGroupRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(groupCode, 'groupCode', 'updateUserGroup'); + throwIfNullOrUndefined(userGroupDTO, 'userGroupDTO', 'updateUserGroup'); + + const headers: HttpHeaders = { + 'Content-Type': 'application/json', + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usergroups/{group_code}'.replace('{group_code}', encodeURI(groupCode)), + method: 'PUT', + headers, + body: userGroupDTO, + }, opts?.responseOpts); + }; + +} diff --git a/src/generated/apis/UserSettingsApi.ts b/src/generated/apis/UserSettingsApi.ts index 2b676e0d4..50478299e 100644 --- a/src/generated/apis/UserSettingsApi.ts +++ b/src/generated/apis/UserSettingsApi.ts @@ -1,9 +1,9 @@ // tslint:disable /** - * OH 2.0 Api Documentation - * OH 2.0 Api Documentation + * Open Hospital API Documentation + * Open Hospital API Documentation * - * The version of the OpenAPI document: 1.0 + * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,12 +12,25 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, OperationOpts, RawAjaxResponse } from '../runtime'; +import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; import { UserSettingDTO, } from '../models'; -export interface NewUserSettingRequest { +export interface DeleteUserSettingRequest { + id: number; +} + +export interface GetUserSettingByUserRequest { + configName: string; +} + +export interface NewUserSettingsRequest { + userSettingDTO: UserSettingDTO; +} + +export interface UpdateUserSettingsRequest { + id: number; userSettingDTO: UserSettingDTO; } @@ -28,15 +41,35 @@ export class UserSettingsApi extends BaseAPI { /** */ - getUserSettingDashboard(): Observable - getUserSettingDashboard(opts?: OperationOpts): Observable> - getUserSettingDashboard(opts?: OperationOpts): Observable> { + deleteUserSetting({ id }: DeleteUserSettingRequest): Observable + deleteUserSetting({ id }: DeleteUserSettingRequest, opts?: OperationOpts): Observable> + deleteUserSetting({ id }: DeleteUserSettingRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(id, 'id', 'deleteUserSetting'); + + const headers: HttpHeaders = { + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usersettings/{id}'.replace('{id}', encodeURI(id)), + method: 'DELETE', + headers, + }, opts?.responseOpts); + }; + + /** + */ + getUserSettingByUser({ configName }: GetUserSettingByUserRequest): Observable + getUserSettingByUser({ configName }: GetUserSettingByUserRequest, opts?: OperationOpts): Observable> + getUserSettingByUser({ configName }: GetUserSettingByUserRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(configName, 'configName', 'getUserSettingByUser'); + const headers: HttpHeaders = { ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), }; return this.request({ - url: '/usersettings/dashboard', + url: '/usersettings/{configName}'.replace('{configName}', encodeURI(configName)), method: 'GET', headers, }, opts?.responseOpts); @@ -44,10 +77,26 @@ export class UserSettingsApi extends BaseAPI { /** */ - newUserSetting({ userSettingDTO }: NewUserSettingRequest): Observable - newUserSetting({ userSettingDTO }: NewUserSettingRequest, opts?: OperationOpts): Observable> - newUserSetting({ userSettingDTO }: NewUserSettingRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(userSettingDTO, 'userSettingDTO', 'newUserSetting'); + getUserSettings(): Observable> + getUserSettings(opts?: OperationOpts): Observable>> + getUserSettings(opts?: OperationOpts): Observable | RawAjaxResponse>> { + const headers: HttpHeaders = { + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request>({ + url: '/usersettings', + method: 'GET', + headers, + }, opts?.responseOpts); + }; + + /** + */ + newUserSettings({ userSettingDTO }: NewUserSettingsRequest): Observable + newUserSettings({ userSettingDTO }: NewUserSettingsRequest, opts?: OperationOpts): Observable> + newUserSettings({ userSettingDTO }: NewUserSettingsRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(userSettingDTO, 'userSettingDTO', 'newUserSettings'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -62,4 +111,25 @@ export class UserSettingsApi extends BaseAPI { }, opts?.responseOpts); }; + /** + */ + updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest): Observable + updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest, opts?: OperationOpts): Observable> + updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(id, 'id', 'updateUserSettings'); + throwIfNullOrUndefined(userSettingDTO, 'userSettingDTO', 'updateUserSettings'); + + const headers: HttpHeaders = { + 'Content-Type': 'application/json', + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), + }; + + return this.request({ + url: '/usersettings/{id}'.replace('{id}', encodeURI(id)), + method: 'PUT', + headers, + body: userSettingDTO, + }, opts?.responseOpts); + }; + } diff --git a/src/generated/apis/UsersApi.ts b/src/generated/apis/UsersApi.ts index 429f9b73b..17bf554cc 100644 --- a/src/generated/apis/UsersApi.ts +++ b/src/generated/apis/UsersApi.ts @@ -14,30 +14,15 @@ import { Observable } from 'rxjs'; import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, OperationOpts, RawAjaxResponse } from '../runtime'; import { - LitePermissionDTO, + PermissionDTO, UserDTO, - UserGroupDTO, UserProfileDTO, - UserSettingDTO, } from '../models'; -export interface AssignPermissionRequest { - groupCode: string; - id: number; -} - -export interface DeleteGroupRequest { - groupCode: string; -} - export interface DeleteUserRequest { username: string; } -export interface DeleteUserSettingRequest { - id: number; -} - export interface GetUserRequest { groupId?: string; } @@ -46,52 +31,21 @@ export interface GetUserByNameRequest { username: string; } -export interface GetUserGroup1Request { - groupCode: string; -} - -export interface GetUserSettingByIdRequest { - id: number; -} - -export interface GetUserSettingByUserRequest { - userName: string; - configName: string; -} - export interface NewUserRequest { userDTO: UserDTO; } -export interface NewUserGroupRequest { - userGroupDTO: UserGroupDTO; -} - -export interface NewUserSettingsRequest { - userSettingDTO: UserSettingDTO; -} - export interface RetrievePermissionsByUsernameRequest { username: string; } -export interface RevokePermissionRequest { - groupCode: string; - id: number; +export interface UpdateProfileRequest { + userDTO: UserDTO; } export interface UpdateUserRequest { + username: string; userDTO: UserDTO; - password?: boolean; -} - -export interface UpdateUserGroupRequest { - userGroupDTO: UserGroupDTO; -} - -export interface UpdateUserSettingsRequest { - id: number; - userSettingDTO: UserSettingDTO; } /** @@ -101,77 +55,22 @@ export class UsersApi extends BaseAPI { /** */ - assignPermission({ groupCode, id }: AssignPermissionRequest): Observable - assignPermission({ groupCode, id }: AssignPermissionRequest, opts?: OperationOpts): Observable> - assignPermission({ groupCode, id }: AssignPermissionRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(groupCode, 'groupCode', 'assignPermission'); - throwIfNullOrUndefined(id, 'id', 'assignPermission'); - - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/groups/{group_code}/permissions/{id}'.replace('{group_code}', encodeURI(groupCode)).replace('{id}', encodeURI(id)), - method: 'POST', - headers, - }, opts?.responseOpts); - }; - - /** - */ - deleteGroup({ groupCode }: DeleteGroupRequest): Observable - deleteGroup({ groupCode }: DeleteGroupRequest, opts?: OperationOpts): Observable> - deleteGroup({ groupCode }: DeleteGroupRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(groupCode, 'groupCode', 'deleteGroup'); - - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/groups/{group_code}'.replace('{group_code}', encodeURI(groupCode)), - method: 'DELETE', - headers, - }, opts?.responseOpts); - }; - - /** - */ - deleteUser({ username }: DeleteUserRequest): Observable - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> - deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { + deleteUser({ username }: DeleteUserRequest): Observable + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> + deleteUser({ username }: DeleteUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(username, 'username', 'deleteUser'); const headers: HttpHeaders = { ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), }; - return this.request({ + return this.request({ url: '/users/{username}'.replace('{username}', encodeURI(username)), method: 'DELETE', headers, }, opts?.responseOpts); }; - /** - */ - deleteUserSetting({ id }: DeleteUserSettingRequest): Observable - deleteUserSetting({ id }: DeleteUserSettingRequest, opts?: OperationOpts): Observable> - deleteUserSetting({ id }: DeleteUserSettingRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(id, 'id', 'deleteUserSetting'); - - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/settings/{id}'.replace('{id}', encodeURI(id)), - method: 'DELETE', - headers, - }, opts?.responseOpts); - }; - /** */ getUser({ groupId }: GetUserRequest): Observable> @@ -214,96 +113,9 @@ export class UsersApi extends BaseAPI { /** */ - getUserGroup(): Observable> - getUserGroup(opts?: OperationOpts): Observable>> - getUserGroup(opts?: OperationOpts): Observable | RawAjaxResponse>> { - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request>({ - url: '/users/groups', - method: 'GET', - headers, - }, opts?.responseOpts); - }; - - /** - */ - getUserGroup1({ groupCode }: GetUserGroup1Request): Observable - getUserGroup1({ groupCode }: GetUserGroup1Request, opts?: OperationOpts): Observable> - getUserGroup1({ groupCode }: GetUserGroup1Request, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(groupCode, 'groupCode', 'getUserGroup1'); - - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/groups/{group_code}'.replace('{group_code}', encodeURI(groupCode)), - method: 'GET', - headers, - }, opts?.responseOpts); - }; - - /** - */ - getUserSettingById({ id }: GetUserSettingByIdRequest): Observable - getUserSettingById({ id }: GetUserSettingByIdRequest, opts?: OperationOpts): Observable> - getUserSettingById({ id }: GetUserSettingByIdRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(id, 'id', 'getUserSettingById'); - - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/settings/{id}'.replace('{id}', encodeURI(id)), - method: 'GET', - headers, - }, opts?.responseOpts); - }; - - /** - */ - getUserSettingByUser({ userName, configName }: GetUserSettingByUserRequest): Observable - getUserSettingByUser({ userName, configName }: GetUserSettingByUserRequest, opts?: OperationOpts): Observable> - getUserSettingByUser({ userName, configName }: GetUserSettingByUserRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(userName, 'userName', 'getUserSettingByUser'); - throwIfNullOrUndefined(configName, 'configName', 'getUserSettingByUser'); - - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/{userName}/settings/{configName}'.replace('{userName}', encodeURI(userName)).replace('{configName}', encodeURI(configName)), - method: 'GET', - headers, - }, opts?.responseOpts); - }; - - /** - */ - getUserSettings(): Observable> - getUserSettings(opts?: OperationOpts): Observable>> - getUserSettings(opts?: OperationOpts): Observable | RawAjaxResponse>> { - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request>({ - url: '/users/settings', - method: 'GET', - headers, - }, opts?.responseOpts); - }; - - /** - */ - newUser({ userDTO }: NewUserRequest): Observable - newUser({ userDTO }: NewUserRequest, opts?: OperationOpts): Observable> - newUser({ userDTO }: NewUserRequest, opts?: OperationOpts): Observable> { + newUser({ userDTO }: NewUserRequest): Observable + newUser({ userDTO }: NewUserRequest, opts?: OperationOpts): Observable> + newUser({ userDTO }: NewUserRequest, opts?: OperationOpts): Observable> { throwIfNullOrUndefined(userDTO, 'userDTO', 'newUser'); const headers: HttpHeaders = { @@ -311,7 +123,7 @@ export class UsersApi extends BaseAPI { ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), }; - return this.request({ + return this.request({ url: '/users', method: 'POST', headers, @@ -321,73 +133,17 @@ export class UsersApi extends BaseAPI { /** */ - newUserGroup({ userGroupDTO }: NewUserGroupRequest): Observable - newUserGroup({ userGroupDTO }: NewUserGroupRequest, opts?: OperationOpts): Observable> - newUserGroup({ userGroupDTO }: NewUserGroupRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(userGroupDTO, 'userGroupDTO', 'newUserGroup'); - - const headers: HttpHeaders = { - 'Content-Type': 'application/json', - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/groups', - method: 'POST', - headers, - body: userGroupDTO, - }, opts?.responseOpts); - }; - - /** - */ - newUserSettings({ userSettingDTO }: NewUserSettingsRequest): Observable - newUserSettings({ userSettingDTO }: NewUserSettingsRequest, opts?: OperationOpts): Observable> - newUserSettings({ userSettingDTO }: NewUserSettingsRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(userSettingDTO, 'userSettingDTO', 'newUserSettings'); - - const headers: HttpHeaders = { - 'Content-Type': 'application/json', - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/settings', - method: 'POST', - headers, - body: userSettingDTO, - }, opts?.responseOpts); - }; - - /** - */ - retrievePermissionsByCurrentLoggedInUser(): Observable> - retrievePermissionsByCurrentLoggedInUser(opts?: OperationOpts): Observable>> - retrievePermissionsByCurrentLoggedInUser(opts?: OperationOpts): Observable | RawAjaxResponse>> { - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request>({ - url: '/users/permissions', - method: 'GET', - headers, - }, opts?.responseOpts); - }; - - /** - */ - retrievePermissionsByUsername({ username }: RetrievePermissionsByUsernameRequest): Observable> - retrievePermissionsByUsername({ username }: RetrievePermissionsByUsernameRequest, opts?: OperationOpts): Observable>> - retrievePermissionsByUsername({ username }: RetrievePermissionsByUsernameRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { + retrievePermissionsByUsername({ username }: RetrievePermissionsByUsernameRequest): Observable> + retrievePermissionsByUsername({ username }: RetrievePermissionsByUsernameRequest, opts?: OperationOpts): Observable>> + retrievePermissionsByUsername({ username }: RetrievePermissionsByUsernameRequest, opts?: OperationOpts): Observable | RawAjaxResponse>> { throwIfNullOrUndefined(username, 'username', 'retrievePermissionsByUsername'); const headers: HttpHeaders = { ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), }; - return this.request>({ - url: '/users/permissions/username/{username}'.replace('{username}', encodeURI(username)), + return this.request>({ + url: '/users/{username}/permissions'.replace('{username}', encodeURI(username)), method: 'GET', headers, }, opts?.responseOpts); @@ -411,86 +167,42 @@ export class UsersApi extends BaseAPI { /** */ - revokePermission({ groupCode, id }: RevokePermissionRequest): Observable - revokePermission({ groupCode, id }: RevokePermissionRequest, opts?: OperationOpts): Observable> - revokePermission({ groupCode, id }: RevokePermissionRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(groupCode, 'groupCode', 'revokePermission'); - throwIfNullOrUndefined(id, 'id', 'revokePermission'); - - const headers: HttpHeaders = { - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/groups/{group_code}/permissions/{id}'.replace('{group_code}', encodeURI(groupCode)).replace('{id}', encodeURI(id)), - method: 'DELETE', - headers, - }, opts?.responseOpts); - }; - - /** - */ - updateUser({ userDTO, password }: UpdateUserRequest): Observable - updateUser({ userDTO, password }: UpdateUserRequest, opts?: OperationOpts): Observable> - updateUser({ userDTO, password }: UpdateUserRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(userDTO, 'userDTO', 'updateUser'); + updateProfile({ userDTO }: UpdateProfileRequest): Observable + updateProfile({ userDTO }: UpdateProfileRequest, opts?: OperationOpts): Observable> + updateProfile({ userDTO }: UpdateProfileRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(userDTO, 'userDTO', 'updateProfile'); const headers: HttpHeaders = { 'Content-Type': 'application/json', ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), }; - const query: HttpQuery = {}; - - if (password != null) { query['password'] = password; } - - return this.request({ - url: '/users', + return this.request({ + url: '/users/me', method: 'PUT', headers, - query, body: userDTO, }, opts?.responseOpts); }; /** */ - updateUserGroup({ userGroupDTO }: UpdateUserGroupRequest): Observable - updateUserGroup({ userGroupDTO }: UpdateUserGroupRequest, opts?: OperationOpts): Observable> - updateUserGroup({ userGroupDTO }: UpdateUserGroupRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(userGroupDTO, 'userGroupDTO', 'updateUserGroup'); - - const headers: HttpHeaders = { - 'Content-Type': 'application/json', - ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), - }; - - return this.request({ - url: '/users/groups', - method: 'PUT', - headers, - body: userGroupDTO, - }, opts?.responseOpts); - }; - - /** - */ - updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest): Observable - updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest, opts?: OperationOpts): Observable> - updateUserSettings({ id, userSettingDTO }: UpdateUserSettingsRequest, opts?: OperationOpts): Observable> { - throwIfNullOrUndefined(id, 'id', 'updateUserSettings'); - throwIfNullOrUndefined(userSettingDTO, 'userSettingDTO', 'updateUserSettings'); + updateUser({ username, userDTO }: UpdateUserRequest): Observable + updateUser({ username, userDTO }: UpdateUserRequest, opts?: OperationOpts): Observable> + updateUser({ username, userDTO }: UpdateUserRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(username, 'username', 'updateUser'); + throwIfNullOrUndefined(userDTO, 'userDTO', 'updateUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), }; - return this.request({ - url: '/users/settings/{id}'.replace('{id}', encodeURI(id)), + return this.request({ + url: '/users/{username}'.replace('{username}', encodeURI(username)), method: 'PUT', headers, - body: userSettingDTO, + body: userDTO, }, opts?.responseOpts); }; diff --git a/src/generated/apis/index.ts b/src/generated/apis/index.ts index 26b19218d..852c54395 100644 --- a/src/generated/apis/index.ts +++ b/src/generated/apis/index.ts @@ -34,6 +34,8 @@ export * from './SMSApi'; export * from './StockMovementsApi'; export * from './SuppliersApi'; export * from './TherapiesApi'; +export * from './UserGroupsApi'; +export * from './UserSettingsApi'; export * from './UsersApi'; export * from './VaccineTypeApi'; export * from './VaccinesApi'; diff --git a/src/generated/models/AdmissionDTO.ts b/src/generated/models/AdmissionDTO.ts index df700ba52..4b933c05e 100644 --- a/src/generated/models/AdmissionDTO.ts +++ b/src/generated/models/AdmissionDTO.ts @@ -200,13 +200,13 @@ export interface AdmissionDTO { */ deleted: string; /** - * @type {string} + * @type {number} * @memberof AdmissionDTO */ - fhu?: string; + yprog?: number; /** - * @type {number} + * @type {string} * @memberof AdmissionDTO */ - yprog?: number; + fhu?: string; } diff --git a/src/generated/models/LoginResponse.ts b/src/generated/models/LoginResponse.ts index 55d8c59ba..5865c1f37 100644 --- a/src/generated/models/LoginResponse.ts +++ b/src/generated/models/LoginResponse.ts @@ -23,6 +23,12 @@ export interface LoginResponse { * @memberof LoginResponse */ token?: string; + /** + * RefreshToken + * @type {string} + * @memberof LoginResponse + */ + refreshToken?: string; /** * Type of Token * @type {string} diff --git a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphics.ts b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphics.ts index 6e981d77c..1b8ab4d7a 100644 --- a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphics.ts +++ b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphics.ts @@ -34,11 +34,6 @@ export interface PatientProfilePhotoPhotoAsImageGraphics { * @memberof PatientProfilePhotoPhotoAsImageGraphics */ font?: PatientProfilePhotoPhotoAsImageGraphicsFont; - /** - * @type {PatientProfilePhotoPhotoAsImageGraphicsClip} - * @memberof PatientProfilePhotoPhotoAsImageGraphics - */ - clip?: PatientProfilePhotoPhotoAsImageGraphicsClip; /** * @type {PatientProfilePhotoPhotoAsImageGraphicsFontMetrics} * @memberof PatientProfilePhotoPhotoAsImageGraphics @@ -54,6 +49,11 @@ export interface PatientProfilePhotoPhotoAsImageGraphics { * @memberof PatientProfilePhotoPhotoAsImageGraphics */ xormode?: PatientProfilePhotoPhotoAsImageGraphicsColor; + /** + * @type {PatientProfilePhotoPhotoAsImageGraphicsClip} + * @memberof PatientProfilePhotoPhotoAsImageGraphics + */ + clip?: PatientProfilePhotoPhotoAsImageGraphicsClip; /** * @type {PatientProfilePhotoPhotoAsImageGraphicsClipBounds} * @memberof PatientProfilePhotoPhotoAsImageGraphics diff --git a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D.ts b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D.ts index 8887613f4..dc513a8ec 100644 --- a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D.ts +++ b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D.ts @@ -25,42 +25,42 @@ export interface PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D { * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - y?: number; + width?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - x?: number; + height?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - width?: number; + y?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - maxX?: number; + x?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - maxY?: number; + maxX?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - centerX?: number; + maxY?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - centerY?: number; + centerX?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D */ - height?: number; + centerY?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsClipBoundsBounds2D diff --git a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFont.ts b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFont.ts index a99f10c1a..3517f0abc 100644 --- a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFont.ts +++ b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFont.ts @@ -45,26 +45,6 @@ export interface PatientProfilePhotoPhotoAsImageGraphicsFont { * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont */ family?: string; - /** - * @type {boolean} - * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont - */ - plain?: boolean; - /** - * @type {string} - * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont - */ - psname?: string; - /** - * @type {number} - * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont - */ - size2D?: number; - /** - * @type {Array} - * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont - */ - availableAttributes?: Array; /** * @type {string} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont @@ -105,4 +85,24 @@ export interface PatientProfilePhotoPhotoAsImageGraphicsFont { * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont */ transformed?: boolean; + /** + * @type {boolean} + * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont + */ + plain?: boolean; + /** + * @type {string} + * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont + */ + psname?: string; + /** + * @type {number} + * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont + */ + size2D?: number; + /** + * @type {Array} + * @memberof PatientProfilePhotoPhotoAsImageGraphicsFont + */ + availableAttributes?: Array; } diff --git a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetrics.ts b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetrics.ts index d60c5d564..0725940a7 100644 --- a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetrics.ts +++ b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetrics.ts @@ -30,50 +30,50 @@ export interface PatientProfilePhotoPhotoAsImageGraphicsFontMetrics { * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - maxDescent?: number; + ascent?: number; /** - * @type {Array} + * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - widths?: Array; + descent?: number; /** - * @type {PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext} + * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - fontRenderContext?: PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext; + leading?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - maxAscent?: number; + height?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - maxDecent?: number; + maxDescent?: number; /** - * @type {number} + * @type {Array} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - maxAdvance?: number; + widths?: Array; /** - * @type {number} + * @type {PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - height?: number; + fontRenderContext?: PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - ascent?: number; + maxAscent?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - descent?: number; + maxDecent?: number; /** * @type {number} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetrics */ - leading?: number; + maxAdvance?: number; } diff --git a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext.ts b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext.ts index 9dad14c81..d3e4d2313 100644 --- a/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext.ts +++ b/src/generated/models/PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext.ts @@ -20,16 +20,6 @@ import { * @interface PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext */ export interface PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext { - /** - * @type {boolean} - * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext - */ - antiAliased?: boolean; - /** - * @type {number} - * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext - */ - transformType?: number; /** * @type {PatientProfilePhotoPhotoAsImageGraphicsFontTransform} * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext @@ -50,4 +40,14 @@ export interface PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderCon * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext */ transformed?: boolean; + /** + * @type {boolean} + * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext + */ + antiAliased?: boolean; + /** + * @type {number} + * @memberof PatientProfilePhotoPhotoAsImageGraphicsFontMetricsFontRenderContext + */ + transformType?: number; } diff --git a/src/generated/models/TherapyRow.ts b/src/generated/models/TherapyRow.ts index efbd13c70..7f96100ce 100644 --- a/src/generated/models/TherapyRow.ts +++ b/src/generated/models/TherapyRow.ts @@ -105,11 +105,6 @@ export interface TherapyRow { * @memberof TherapyRow */ smsInt: number; - /** - * @type {number} - * @memberof TherapyRow - */ - medical?: number; /** * @type {boolean} * @memberof TherapyRow @@ -120,4 +115,9 @@ export interface TherapyRow { * @memberof TherapyRow */ notify?: boolean; + /** + * @type {number} + * @memberof TherapyRow + */ + medical?: number; } diff --git a/src/generated/models/TokenRefreshRequest.ts b/src/generated/models/TokenRefreshRequest.ts new file mode 100644 index 000000000..1d15df08d --- /dev/null +++ b/src/generated/models/TokenRefreshRequest.ts @@ -0,0 +1,24 @@ +// tslint:disable +/** + * Open Hospital API Documentation + * Open Hospital API Documentation + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * @export + * @interface TokenRefreshRequest + */ +export interface TokenRefreshRequest { + /** + * @type {string} + * @memberof TokenRefreshRequest + */ + refreshToken?: string; +} diff --git a/src/generated/models/WardDTO.ts b/src/generated/models/WardDTO.ts index 9e7f85115..6f8e7865d 100644 --- a/src/generated/models/WardDTO.ts +++ b/src/generated/models/WardDTO.ts @@ -76,7 +76,7 @@ export interface WardDTO { * @type {boolean} * @memberof WardDTO */ - opd?: boolean; + female?: boolean; /** * @type {boolean} * @memberof WardDTO @@ -86,7 +86,7 @@ export interface WardDTO { * @type {boolean} * @memberof WardDTO */ - female?: boolean; + opd?: boolean; /** * @type {boolean} * @memberof WardDTO diff --git a/src/generated/models/index.ts b/src/generated/models/index.ts index 55bdc1fe6..efb93d806 100644 --- a/src/generated/models/index.ts +++ b/src/generated/models/index.ts @@ -18,7 +18,6 @@ export * from './FullBillDTO'; export * from './HospitalDTO'; export * from './LabWithRowsDTO'; export * from './LaboratoryDTO'; -export * from './LitePermissionDTO'; export * from './LoginRequest'; export * from './LoginResponse'; export * from './LotDTO'; @@ -72,6 +71,7 @@ export * from './SupplierDTO'; export * from './TherapyDTO'; export * from './TherapyRow'; export * from './TherapyRowDTO'; +export * from './TokenRefreshRequest'; export * from './UserDTO'; export * from './UserGroupDTO'; export * from './UserProfileDTO'; diff --git a/src/state/layouts/thunk.ts b/src/state/layouts/thunk.ts index 024b1dbdd..e4062d5a6 100644 --- a/src/state/layouts/thunk.ts +++ b/src/state/layouts/thunk.ts @@ -1,15 +1,15 @@ import { createAsyncThunk } from "@reduxjs/toolkit"; -import { UserSettingDTO, UsersApi } from "../../generated"; -import { customConfiguration } from "../../libraries/apiUtils/configuration"; import { decodeLayoutConfig } from "../../components/accessories/dashboard/layouts/consts"; +import { UserSettingDTO, UserSettingsApi } from "../../generated"; +import { customConfiguration } from "../../libraries/apiUtils/configuration"; -const api = new UsersApi(customConfiguration()); +const api = new UserSettingsApi(customConfiguration()); export const getLayouts = createAsyncThunk( "layouts/getLayouts", async (userName: string, thunkApi) => api - .getUserSettingByUser({ configName: "dashboard", userName }) + .getUserSettingByUser({ configName: "dashboard" }) .toPromise() .catch((error) => thunkApi.rejectWithValue(error.response)) ); diff --git a/src/state/main/thunk.ts b/src/state/main/thunk.ts index a1ba1644b..04f5b85e9 100644 --- a/src/state/main/thunk.ts +++ b/src/state/main/thunk.ts @@ -1,23 +1,24 @@ -import { Dispatch, createAsyncThunk } from "@reduxjs/toolkit"; -import { LoginApi, UsersApi } from "../../generated"; -import { customConfiguration } from "../../libraries/apiUtils/configuration"; +import { createAsyncThunk, Dispatch } from "@reduxjs/toolkit"; import { concat } from "rxjs"; import { tap, toArray } from "rxjs/operators"; +import { LoginApi, UsersApi, UserSettingsApi } from "../../generated"; +import { customConfiguration } from "../../libraries/apiUtils/configuration"; import { saveAuthenticationDataToSession } from "../../libraries/authUtils/saveAuthenticationDataToSession"; import { savePermissionDataToSession } from "../../libraries/authUtils/savePermissionDataToSession"; import { SessionStorage } from "../../libraries/storage/storage"; -import { IAction } from "../types"; -import { setLogoutFailed, setLogoutLoading, setLogoutSuccess } from "./slice"; -import { getPatientsReset, searchPatientsReset } from "../patients"; import { getLabsReset, searchLabsReset } from "../laboratories"; import { getOpdsReset } from "../opds"; import { getOperationsByAdmissionReset, getOperationsReset, } from "../operations"; +import { getPatientsReset, searchPatientsReset } from "../patients"; +import { IAction } from "../types"; +import { setLogoutFailed, setLogoutLoading, setLogoutSuccess } from "./slice"; const loginApi = new LoginApi(customConfiguration(false)); const usersApi = new UsersApi(customConfiguration()); +const userSettingsApi = new UserSettingsApi(customConfiguration()); export const setAuthentication = createAsyncThunk( "main/getLayouts", @@ -71,7 +72,7 @@ export const setForgotPasswordThunk = createAsyncThunk( export const getUserSettings = createAsyncThunk( "main/getUserSettings", async (_, thunkApi) => - usersApi + userSettingsApi .getUserSettings() .toPromise() .catch((error) => thunkApi.rejectWithValue(error.response)) diff --git a/src/state/usergroups/thunk.ts b/src/state/usergroups/thunk.ts index 395307ade..eecb2b27a 100644 --- a/src/state/usergroups/thunk.ts +++ b/src/state/usergroups/thunk.ts @@ -1,14 +1,14 @@ import { createAsyncThunk } from "@reduxjs/toolkit"; -import { UserGroupDTO, UsersApi } from "../../generated"; +import { UserGroupDTO, UserGroupsApi } from "../../generated"; import { customConfiguration } from "../../libraries/apiUtils/configuration"; -const api = new UsersApi(customConfiguration()); +const api = new UserGroupsApi(customConfiguration()); export const getUserGroups = createAsyncThunk( "userGroups/getUserGroups", async (_, thunkApi) => api - .getUserGroup() + .getUserGroups() .toPromise() .catch((error) => thunkApi.rejectWithValue(error.response)) ); @@ -27,7 +27,7 @@ export const updateUserGroup = createAsyncThunk( "userGroups/updateUserGroup", async (userGroupDTO: UserGroupDTO, thunkApi) => api - .updateUserGroup({ userGroupDTO }) + .updateUserGroup({ groupCode: userGroupDTO.code, userGroupDTO }) .toPromise() .then(() => userGroupDTO) .catch((error) => thunkApi.rejectWithValue(error.response)) diff --git a/src/state/users/thunk.ts b/src/state/users/thunk.ts index 9e0e78ee2..e0da1fb36 100644 --- a/src/state/users/thunk.ts +++ b/src/state/users/thunk.ts @@ -27,7 +27,7 @@ export const updateUser = createAsyncThunk( "users/updateUser", async (userDTO: UserDTO, thunkApi) => api - .updateUser({ userDTO }) + .updateUser({ username: userDTO.userName, userDTO }) .toPromise() .then(() => userDTO) .catch((error) => thunkApi.rejectWithValue(error.response)) From a132f7112bfd4852fe56081c3ee4b90b98c9b1f5 Mon Sep 17 00:00:00 2001 From: Silevester Dongmo <58907550+SilverD3@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:27:58 +0100 Subject: [PATCH 2/4] fix:OH2-401 | Fix admission state slice (#669) --- src/state/admissions/slice.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state/admissions/slice.ts b/src/state/admissions/slice.ts index 1a371f993..20fb21690 100644 --- a/src/state/admissions/slice.ts +++ b/src/state/admissions/slice.ts @@ -58,7 +58,7 @@ export const admissionSlice = createSlice({ state.getAdmissions = ApiResponse.loading(); }) .addCase(thunks.getAdmissions.fulfilled, (state, action) => { - state.getAdmissions.status = isEmpty(action.payload.data) + state.getAdmissions.status = isEmpty(action.payload?.data) ? "SUCCESS_EMPTY" : "SUCCESS"; state.getAdmissions.data = action.payload; @@ -71,7 +71,7 @@ export const admissionSlice = createSlice({ state.getDischarges = ApiResponse.loading(); }) .addCase(thunks.getDischarges.fulfilled, (state, action) => { - state.getDischarges.status = isEmpty(action.payload.data) + state.getDischarges.status = isEmpty(action.payload?.data) ? "SUCCESS_EMPTY" : "SUCCESS"; state.getDischarges.data = action.payload; From 5b2773d3ddd30f4ba1b13e8c8ba486f3d67627ab Mon Sep 17 00:00:00 2001 From: Silevester Dongmo <58907550+SilverD3@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:50:59 +0100 Subject: [PATCH 3/4] OH2-382 | Fix ward admin bugs (#671) * fix:OH2-382 | Fix ward admin bugs * fix:fix ward e2e tests --- .../wards_activities/add_ward_activity.cy.ts | 2 +- .../accessories/admin/wards/wardForm/WardForm.tsx | 11 ++++++++--- .../accessories/admin/wards/wardTable/WardTable.tsx | 11 +++++++++-- src/mockServer/routes/wards.js | 4 ++-- src/resources/i18n/en.json | 8 ++++++++ 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/cypress/integrations/admin_activities/wards_activities/add_ward_activity.cy.ts b/cypress/integrations/admin_activities/wards_activities/add_ward_activity.cy.ts index e2f4a3ab5..16a9de629 100644 --- a/cypress/integrations/admin_activities/wards_activities/add_ward_activity.cy.ts +++ b/cypress/integrations/admin_activities/wards_activities/add_ward_activity.cy.ts @@ -14,7 +14,7 @@ describe("Add Ward Activity specs", () => { }); it("should fail to create a new ward", () => { - cy.byId("code").type("FAIL"); + cy.byId("code").type("FL"); cy.byId("description").type("Children ward"); cy.byId("email").type("children.ward@oh.com"); cy.byId("telephone").type("698123234"); diff --git a/src/components/accessories/admin/wards/wardForm/WardForm.tsx b/src/components/accessories/admin/wards/wardForm/WardForm.tsx index 8fbdef39e..f1773af1a 100644 --- a/src/components/accessories/admin/wards/wardForm/WardForm.tsx +++ b/src/components/accessories/admin/wards/wardForm/WardForm.tsx @@ -11,6 +11,7 @@ import React, { } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router"; +import { FIELD_VALIDATION } from "types"; import { number, object, string } from "yup"; import checkIcon from "../../../../../assets/check-icon.png"; import warningIcon from "../../../../../assets/warning-icon.png"; @@ -49,8 +50,8 @@ const WardForm: FC = ({ const errorMessage = useMemo( () => (creationMode - ? wardStore.create.error?.message - : wardStore.update.error?.message) ?? t("common.somethingwrong"), + ? t(wardStore.create.error?.message) + : t(wardStore.update.error?.message)) ?? t("common.somethingwrong"), [ creationMode, t, @@ -62,7 +63,9 @@ const WardForm: FC = ({ const initialValues = getFromFields(fields, "value"); const validationSchema = object({ - code: string().required(t("common.required")), + code: string() + .max(3, t("validations.maxLength", { max: 3 })) + .required(t("common.required")), description: string().required(t("common.required")), email: string().email(t("validations.email")), beds: number().min(0, t("validations.min", { min: 0 })), @@ -133,6 +136,7 @@ const WardForm: FC = ({ onBlur={formik.handleBlur} type="text" disabled={isLoading || !creationMode} + required={FIELD_VALIDATION.REQUIRED} />
@@ -145,6 +149,7 @@ const WardForm: FC = ({ onBlur={formik.handleBlur} type="text" disabled={isLoading} + required={FIELD_VALIDATION.REQUIRED} />
diff --git a/src/components/accessories/admin/wards/wardTable/WardTable.tsx b/src/components/accessories/admin/wards/wardTable/WardTable.tsx index 331aed61e..fffdd40b3 100644 --- a/src/components/accessories/admin/wards/wardTable/WardTable.tsx +++ b/src/components/accessories/admin/wards/wardTable/WardTable.tsx @@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next"; import checkIcon from "../../../../../assets/check-icon.png"; import { WardDTO } from "../../../../../generated"; import { scrollToElement } from "../../../../../libraries/uiUtils/scrollToElement"; -import { deleteWardReset } from "../../../../../state/ward"; +import { deleteWardReset, getWards } from "../../../../../state/ward"; import ConfirmationDialog from "../../../confirmationDialog/ConfirmationDialog"; import InfoBox from "../../../infoBox/InfoBox"; import { TFilterField } from "../../../table/filter/types"; @@ -72,7 +72,14 @@ export const WardTable: FunctionComponent = ({ if (deleteWard.status === "FAIL") { scrollToElement(infoBoxRef.current); } - }, [deleteWard.status]); + + if ( + deleteWard.status === "SUCCESS" || + deleteWard.status === "SUCCESS_EMPTY" + ) { + dispatch(getWards()); + } + }, [deleteWard.status, dispatch]); const formatDataToDisplay = (data: WardDTO[]) => { return data.map((item) => { diff --git a/src/mockServer/routes/wards.js b/src/mockServer/routes/wards.js index 6834e84ed..c692b5d38 100644 --- a/src/mockServer/routes/wards.js +++ b/src/mockServer/routes/wards.js @@ -19,7 +19,7 @@ export const wardsRoutes = (server) => { server.post("/").intercept((req, res) => { const body = req.jsonBody(); switch (body.code) { - case "FAIL": + case "FL": res.status(400).json({ message: "Fail to create ward" }); break; default: @@ -29,7 +29,7 @@ export const wardsRoutes = (server) => { server.put("/").intercept((req, res) => { const body = req.jsonBody(); switch (body.code) { - case "FAIL": + case "FL": res.status(400).json({ message: "Fail to update ward" }); break; default: diff --git a/src/resources/i18n/en.json b/src/resources/i18n/en.json index e7d72be51..d897b0658 100644 --- a/src/resources/i18n/en.json +++ b/src/resources/i18n/en.json @@ -831,6 +831,14 @@ "swabs": { "txt": "Swabs" }, "tissues": { "txt": "Tissues" }, "urine": { "txt": "Urine" } + }, + "common": { + "thecodeisalreadyinuse": { + "msg": "The ward code is already in use" + }, + "thecodeistoolongmax1char": { + "msg": "The ward is too long. It should three characters or less" + } } }, "exam": { From 43bf482b49e703174df14eef6085e4405204c060 Mon Sep 17 00:00:00 2001 From: Steve Tsala <45661418+SteveGT96@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:39:48 +0100 Subject: [PATCH 4/4] fix(OH2-384|OH2-402): Fix table filter crashing (#672) Co-authored-by: SteveGT96 --- src/components/accessories/table/Table.tsx | 4 ++-- src/components/accessories/table/filter/FilterButton.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/accessories/table/Table.tsx b/src/components/accessories/table/Table.tsx index f5bd9d6ea..8427f3101 100644 --- a/src/components/accessories/table/Table.tsx +++ b/src/components/accessories/table/Table.tsx @@ -37,10 +37,10 @@ import { import { TOrder } from "../../../libraries/sortUtils/types"; import Button from "../button/Button"; import ConfirmationDialog from "../confirmationDialog/ConfirmationDialog"; +import TableBodyRow from "./TableBodyRow"; import { FilterButton } from "./filter/FilterButton"; import { TFilterValues } from "./filter/types"; import "./styles.scss"; -import TableBodyRow from "./TableBodyRow"; import { IProps, TActions } from "./types"; const Table: FunctionComponent = ({ @@ -399,7 +399,7 @@ const Table: FunctionComponent = ({ field={filterField} onChange={(value) => setFilters((previous) => ({ - ...filters, + ...previous, [filterField.key]: value, })) } diff --git a/src/components/accessories/table/filter/FilterButton.tsx b/src/components/accessories/table/filter/FilterButton.tsx index 7c00a6e9b..38cba46ee 100644 --- a/src/components/accessories/table/filter/FilterButton.tsx +++ b/src/components/accessories/table/filter/FilterButton.tsx @@ -100,7 +100,11 @@ export const FilterButton = ({ field, onChange }: IOwnProps) => { }; useEffect(() => { - formik.submitForm(); + const submit = setTimeout(() => { + formik.submitForm(); + }, 250); + + return () => clearInterval(submit); }, [formik.values]); return (