eservices-core 1.0.534 → 1.0.535
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.
|
@@ -15,3 +15,25 @@ export interface INotificationConfig {
|
|
|
15
15
|
mark?: string;
|
|
16
16
|
link?: string;
|
|
17
17
|
}
|
|
18
|
+
export interface IHistoryResponse {
|
|
19
|
+
entity: string;
|
|
20
|
+
primaryKey: string;
|
|
21
|
+
history: IHistoryItemResponse[];
|
|
22
|
+
}
|
|
23
|
+
export interface IHistoryItemResponse {
|
|
24
|
+
version: number;
|
|
25
|
+
utcCreated: string;
|
|
26
|
+
action: "Insert" | "Update";
|
|
27
|
+
machineName: string;
|
|
28
|
+
changes: IHistoryChanges[] | null;
|
|
29
|
+
currentValues: IHistoryCurrentValues[];
|
|
30
|
+
}
|
|
31
|
+
export interface IHistoryChanges {
|
|
32
|
+
fieldName: string;
|
|
33
|
+
newValue: string;
|
|
34
|
+
originalValue: string;
|
|
35
|
+
}
|
|
36
|
+
export interface IHistoryCurrentValues {
|
|
37
|
+
fieldName: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}
|
|
@@ -6,6 +6,7 @@ import Table from "./classes/table/Table";
|
|
|
6
6
|
import "./../styles/index.css";
|
|
7
7
|
import StylesInterface from "./styles/types";
|
|
8
8
|
import { Values } from "./types";
|
|
9
|
+
import historyService from "./services/history-service";
|
|
9
10
|
import * as newImport from "./new/new-import";
|
|
10
11
|
export { newImport };
|
|
11
12
|
import { ICustomerContext, ApplicationType } from "./classes/ApplicationManager";
|
|
@@ -80,7 +81,7 @@ clickOutside,
|
|
|
80
81
|
* @deprecated
|
|
81
82
|
* */
|
|
82
83
|
requestHandler, useSocket, setupSocket, useListRead, useListSearch, IListOrder, IListFilter, equipmentService, useListSelect };
|
|
83
|
-
export { ApplicationManager, Manager, NotificationSystem, Table, CoreError, List, ProcessWrap, Communication, ListConfig, IActionResponse };
|
|
84
|
+
export { ApplicationManager, Manager, NotificationSystem, Table, CoreError, List, ProcessWrap, Communication, ListConfig, IActionResponse, historyService };
|
|
84
85
|
export { fileService, processWizardService, viewService, authService, dataService, communicationService, metadataService, invitationService, ruleValidationService, openService, actionService };
|
|
85
86
|
/**
|
|
86
87
|
* HOOKS
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IHistoryChanges, IHistoryCurrentValues } from "./../../../backend/src/types/main";
|
|
2
|
+
export default class historyService {
|
|
3
|
+
readHistoryById(entity: string, id: number): Promise<{
|
|
4
|
+
history: IParsedHistoryItemResponse[];
|
|
5
|
+
entity: string;
|
|
6
|
+
primaryKey: string;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export interface IParsedHistoryChanges extends IHistoryChanges {
|
|
10
|
+
oldValue: IHistoryChanges['originalValue'];
|
|
11
|
+
}
|
|
12
|
+
export interface IParsedHistoryItemResponse {
|
|
13
|
+
version: number;
|
|
14
|
+
utcCreated: string;
|
|
15
|
+
action: "Insert" | "Update";
|
|
16
|
+
machineName: string;
|
|
17
|
+
changes: IParsedHistoryChanges[] | null;
|
|
18
|
+
currentValues: IHistoryCurrentValues[];
|
|
19
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.535
|
|
3
3
|
* (c) 2023 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -2919,6 +2919,26 @@ function useTableRequest(table, options) {
|
|
|
2919
2919
|
var css_248z$h = "*{\r\n --extra-fast :0.1s;\r\n --fast :0.2s;\r\n --medium :0.3s;\r\n\r\n box-sizing: border-box;\r\n --primary: #3949ab\r\n}\r\nhtml, body, #app{\r\n height: 100%;\r\n}\r\nbody{\r\n margin: 0;\r\n}\r\nul{\r\n text-align: left;\r\n}\r\n.flex{\r\n display: flex;\r\n}\r\n.flex_column{\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n.flex_center{\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n.flex_full, .flex_grow{\r\n flex-grow: 1;\r\n}\r\n.grid{\r\n display: grid;\r\n}\r\n.link{\r\n text-decoration: var(--link-decoration);\r\n color: var(--link-color);\r\n}\r\n.link_hover-underline:hover,\r\n.link_hover_underline:hover{\r\n text-decoration: underline;\r\n}\r\n.link_full{\r\n position: absolute;\r\n height: 100%;\r\n width: 100%;\r\n left: 0;\r\n top:0;\r\n}\r\n.text_sm{\r\n font-weight: 400;\r\n font-size: 12px;\r\n line-height: 16px;\r\n}\r\n.text_md{\r\n font-size: 14px;\r\n line-height: 20px;\r\n}\r\n.text_lg{\r\n font-size: 16px;\r\n line-height: 24px;\r\n}\r\n.text_size_xxl{\r\n font-size: 18px;\r\n line-height: 25px;\r\n}\r\n.text_center{\r\n text-align: center;\r\n}\r\n.text_bold{\r\n font-weight: 600;\r\n}\r\n.text_nowrap{\r\n white-space: nowrap;\r\n}\r\n.text_right{\r\n text-align: right;\r\n}\r\n.text_center{\r\n text-align: center;\r\n}\r\n.text_size_sm{\r\n font-size: 12px;\r\n line-height: 130%;\r\n}\r\n.text_size_md{\r\n font-size: 14px;\r\n line-height: 140%;\r\n}\r\n.text_error{\r\n color: red;\r\n}\r\n.title_sm{\r\n font-weight: 600;\r\n font-size: 16px;\r\n line-height: 24px;\r\n}\r\n.title_md{\r\n font-weight: 600;\r\n font-size: 24px;\r\n line-height: 32px;\r\n}\r\n.title_lg{\r\n font-weight: bold;\r\n font-size: 32px;\r\n line-height: 48px;\r\n}\r\n.title_xxl, .title_xl{\r\n font-weight: bold;\r\n font-size: 48px;\r\n line-height: 64px;\r\n}\r\n.cursor_pointer{\r\n cursor: pointer;\r\n}\r\n.cursor_default{\r\n cursor: default;\r\n}\r\nbutton{\r\n outline: none;\r\n user-select: none;\r\n\r\n transition: background-color 0.2s;\r\n}\r\n.button{\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n outline: none;\r\n}\r\n.button_main{\r\n background-color: var(--button-background);\r\n color: var(--button-color);\r\n}\r\n.button_main:focus{\r\n background-color: var(--button-background-active);\r\n}\r\n.button_main:active{\r\n background-color: var(--button-background-active);\r\n}\r\n.button_white{\r\n background-color: var(--white);\r\n color: var(--main);\r\n}\r\n.button_sm{\r\n height: 30px;\r\n width: 130px;\r\n}\r\n.button_shadow{\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);\r\n}\r\n.button_lg{\r\n font-weight: 600;\r\n font-size: 16px;\r\n line-height: 24px;\r\n\r\n padding: 12px 0;\r\n height: 50px;\r\n width: 200px;\r\n}\r\n.button_disabled{\r\n background-color: var(--gray-1);\r\n}\r\n.button_resolve{\r\n background-color: var(--main);\r\n color: var(--white);\r\n border-radius: 2px;\r\n}\r\n.button_reject{\r\n border: 1px solid var(--color-dark);\r\n border-radius: 2px;\r\n}\r\n.button_md{\r\n height: 30px;\r\n padding: 0 10px;\r\n\r\n min-width: 80px;\r\n}\r\n.button_disabled{\r\n background-color: var(--button-disabled-background-color);\r\n cursor: pointer !important;\r\n}\r\n*{\r\n\r\n\r\n\r\n}\r\n.color_main,\r\n.color__text_main{\r\n color: var(--main);\r\n}\r\n.color__text_black{\r\n color: var(--black-1);\r\n}\r\n.color__text_gray{\r\n color: var(--text-gray);\r\n}\r\n.color__text_red,\r\n.color_red{\r\n color: var(--red);\r\n}\r\n.color__text_white{\r\n color: var(--white);\r\n}\r\n.background_orange{\r\n background-color: var(--orange)\r\n}\r\n.background_red{\r\n background-color: var(--red)\r\n}\r\n.color_dark{\r\n color: var(--dark);\r\n}\r\n.color_light{\r\n color: var(--light);\r\n}\r\n.move-vertical-enter-active,\r\n.move-vertical-leave-active {\r\n transition: transform 0.5s ease;\r\n}\r\n.move-vertical-enter-from,\r\n.move-vertical-leave-to {\r\n transform: translateY(-10px);\r\n}\r\n.move-horizontal-enter-active,\r\n.move-horizontal-leave-active {\r\n transition: transform 0.5s;\r\n}\r\n.move-horizontal-enter-from,\r\n.move-horizontal-leave-to {\r\n transform: translateX(-40px);\r\n}\r\n.modal-vertical-enter-active , .modal-vertical-leave-active, .modal-default {\r\n transition: transform var(--medium);\r\n}\r\n.modal-vertical-enter-active .modal-default, .modal-vertical-leave-active .modal-default{\r\n transform: translateY(-100px);\r\n}\r\n.move-vertical-fast-enter-active,\r\n.move-vertical-fast-leave-active {\r\n transition: transform var(--fast) ease;\r\n}\r\n.move-vertical-fast-enter-from,\r\n.move-vertical-fast-leave-to {\r\n transform: translateY(-20px);\r\n}\r\n.slide-up-enter-active,\r\n.slide-up-leave-active {\r\n transition: transform var(--fast) ease, opacity var(--fast);\r\n\r\n}\r\n.slide-up-enter-from,\r\n.slide-up-leave-to {\r\n transform: translateY(20px);\r\n opacity: 0;\r\n}\r\n.opacity-enter-active,\r\n.opacity-leave-active {\r\n transition: opacity var(--fast) ease;\r\n}\r\n.opacity-enter-from,\r\n.opacity-leave-to {\r\n opacity: 0;\r\n}\r\n.list-move, /* apply transition to moving elements */\r\n.list-enter-active,\r\n.list-leave-active {\r\n transition: all 0.5s ease;\r\n}\r\n.list-enter-from,\r\n.list-leave-to {\r\n opacity: 0;\r\n transform: translateX(30px);\r\n}\r\n/* ensure leaving items are taken out of layout flow so that moving\r\n animations can be calculated correctly. */\r\n.list-leave-active {\r\n position: absolute;\r\n}\r\n.modal-default{\r\n background-color: var(--white);\r\n position: relative;\r\n z-index: 1;\r\n\r\n width: auto;\r\n\r\n background: var(--white);\r\n border-radius: var(--border-radius);\r\n\r\n\r\n}\r\n.modal-default__head{\r\n background-color: var(--black-1);\r\n text-align: center;\r\n padding: 5px 0;\r\n border-radius: 6px 6px 0 0;\r\n}\r\n.modal-default__body{\r\n gap: 20px;\r\n padding: 0 15px;\r\n}\r\n.modal-default__foot{\r\n padding: 30px 0;\r\n display: flex;\r\n justify-content: center;\r\n}\r\n.tooltip-help-elem{}\r\n.hint-tooltip{\r\n display: block;\r\n\r\n z-index: 222;\r\n margin: auto;\r\n pointer-events: none;\r\n\r\n box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);\r\n}\r\n.tooltip-help-circle-in,\r\n.tooltip-help-circle-out{\r\n border-radius: 50%;\r\n}\r\n.tooltip-help-undefined{\r\n border-radius: 50px;\r\n}\r\n.tooltip-card{\r\n position: fixed;\r\n z-index: 315;\r\n\r\n display: flex;\r\n flex-direction: column;\r\n\r\n width: 480px;\r\n height: fit-content;\r\n\r\n margin: auto;\r\n\r\n border-radius: 10px;\r\n background-color: var(--hint-background);\r\n\r\n cursor: default;\r\n}\r\n.tooltip-card__foot{\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n\r\n background-color: var(--hint-background-navigation);\r\n border-radius: 10px;\r\n\r\n padding: 20px ;\r\n}\r\n.tooltip-card__foot-current{\r\n font-weight: 600;\r\n font-size: 20px;\r\n line-height: 24px;\r\n\r\n color: var(--white);\r\n}\r\n.tooltip-card__body{\r\n position: relative;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n gap: 8px;\r\n\r\n padding: 20px 20px 10px 20px;\r\n}\r\n.tooltip-card__body-title{\r\n font-weight: bold;\r\n font-size: 20px;\r\n line-height: 24px;\r\n\r\n color: var(--white);\r\n}\r\n.tooltip-card__body-text{\r\n font-size: 16px;\r\n line-height: 24px;\r\n\r\n color: var(--white);\r\n}\r\n.tooltip-card__foot-button_back{\r\n background-color: var(--main-1);\r\n}\r\n.tooltip-card__foot-button_next{\r\n background-color: var(--hint);\r\n}\r\n.tooltip-card__body-close{\r\n position: absolute;\r\n right: 22px;\r\n top: 12px;\r\n width: 20px;\r\n height: 16px;\r\n opacity: 0.3;\r\n\r\n cursor: pointer;\r\n}\r\n.tooltip-card__body-close:hover {\r\n opacity: 1;\r\n}\r\n.tooltip-card__body-close:before,\r\n.tooltip-card__body-close:after {\r\n position: absolute;\r\n left: 15px;\r\n content: ' ';\r\n height: 21px;\r\n width: 2px;\r\n background-color: white;\r\n}\r\n.tooltip-card__body-close:before {\r\n transform: rotate(45deg);\r\n}\r\n.tooltip-card__body-close:after {\r\n transform: rotate(-45deg);\r\n}\r\n.tooltip-card-container-wrap{\r\n pointer-events: none;\r\n position: absolute;\r\n left: 0;\r\n top:0;\r\n\r\n z-index: 123132;\r\n\r\n height: 100%;\r\n width: 100%;\r\n}\r\n.tooltip-card-container-wrap>div{\r\n\r\n height: 100%;\r\n width: 100%;\r\n\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n.tester-box-tooltip{\r\n pointer-events: all;\r\n}\r\n.position_relative{\r\n position: relative;\r\n}\r\n.position_absolute{\r\n position: absolute;\r\n}\r\n.gap_5{\r\n gap: 5px;\r\n}\r\n.gap_10{\r\n gap: 10px;\r\n}\r\n.gap_20{\r\n gap: 20px;\r\n}\r\n.margin-0{\r\n margin: 0;\r\n}\r\n.widget-input{\r\n\tbackground-color: var(--input-background);\r\n\tborder: var(--input-border);\r\n\tborder-radius: var(--input-border-radius);\r\n\tcolor: var(--input-color);\r\n}\r\n.widget-input:disabled{\r\n\tbackground-color: var(--input-background-disabled);\r\n\tborder: var(--input-border-disabled);\r\n}\r\n.widget-input[error=\"true\"] {\r\n\tborder: var(--input-border-error);\r\n}\r\n.widget-input::placeholder{\r\n\tcolor: var(--input-placeholder-color);\r\n}\r\n.widget-input:disabled::placeholder{\r\n\tcolor: var(--input-placeholder-color-disabled);\r\n}\r\n.input_error{\r\n\tborder: 1px solid red !important;\r\n}\r\n.input_size_md{\r\n\theight: var(--input-height);\r\n}\r\n.input-title{\r\n\tfont-size: 12px;\r\n\tline-height: 16px;\r\n\tcolor: #667085;\r\n\r\n\tmargin: 4px 0;\r\n}\r\n.widget-table{\r\n border-collapse: collapse;\r\n}\r\n.widget-table_mini{\r\n\r\n}\r\n.widget-table_mini p{\r\n margin: 0;\r\n}\r\n.widget-table_mini{\r\n\r\n}\r\n.list-cell-link>a{\r\n position: absolute;\r\n left: 0;\r\n top:0;\r\n z-index: 1;\r\n height: 100%;\r\n width: 100%;\r\n\r\n cursor: pointer;\r\n}\r\n.list-cell-link>p{\r\n font-weight: 500;\r\n}\r\n.widget-table__cell{\r\n padding: 0 20px;\r\n font-weight: 400;\r\n font-size: 14px;\r\n line-height: 19px;\r\n\r\n color: #4F4F4F;\r\n}\r\n.widget-table-cell_use{\r\n cursor: pointer;\r\n}\r\n.widget-table-cell_select{\r\n width: min-content ;\r\n}\r\n.table-cell-toggle{\r\n --border-color: black;\r\n position: relative;\r\n display: grid;\r\n place-content: center;\r\n border: 1px solid var(--border-color);\r\n height: 15px;\r\n aspect-ratio: 1 / 1;\r\n border-radius: 50%;\r\n}\r\n.table-cell-toggle_active:after {\r\n content: \"\";\r\n border-radius: 50%;\r\n background-color: var(--border-color);\r\n height: 9px;\r\n aspect-ratio: 1/1;\r\n}\r\n.widget-list-cell-text {\r\n\r\n}\r\n.widget-table-cell_number {\r\n text-align: right;\r\n}\r\n.overflow_auto {\r\n overflow: auto;\r\n}\r\n.padding_5{\r\n padding: 5px;\r\n}\r\n.padding_10 {\r\n padding: 10px;\r\n}\r\n.padding_0{\r\n padding: 0;\r\n}\r\n.padding_15 {\r\n padding: 15px;\r\n}\r\n.padding_20 {\r\n padding: 15px;\r\n}\r\n";
|
|
2920
2920
|
styleInject(css_248z$h);
|
|
2921
2921
|
|
|
2922
|
+
class historyService {
|
|
2923
|
+
readHistoryById(entity, id) {
|
|
2924
|
+
return Request(`/close-api/audits/history/${entity}/${id}`, {
|
|
2925
|
+
method: 'GET',
|
|
2926
|
+
headers: {
|
|
2927
|
+
'Content-Type': 'application/json',
|
|
2928
|
+
},
|
|
2929
|
+
})
|
|
2930
|
+
.then(res => {
|
|
2931
|
+
const newHistory = res.history.map(elem => {
|
|
2932
|
+
if (!elem.changes)
|
|
2933
|
+
return elem;
|
|
2934
|
+
const newChanges = elem.changes.map((elem) => (Object.assign(Object.assign({}, elem), { oldValue: elem.originalValue })));
|
|
2935
|
+
return Object.assign(Object.assign({}, elem), { changes: newChanges });
|
|
2936
|
+
});
|
|
2937
|
+
return Object.assign(Object.assign({}, res), { history: newHistory });
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2922
2942
|
var _primaryKeys, _config, _order, _filters, _wait, _readData, _saveData;
|
|
2923
2943
|
const LIST_ROW_KEY = '_______LIST_______ROW_______INDEX________NAME_______';
|
|
2924
2944
|
class List extends EventEmitter {
|
|
@@ -5815,6 +5835,7 @@ exports["default"] = index;
|
|
|
5815
5835
|
exports.documentsService = documentsService;
|
|
5816
5836
|
exports.equipmentService = equipmentService;
|
|
5817
5837
|
exports.fileService = fileService;
|
|
5838
|
+
exports.historyService = historyService;
|
|
5818
5839
|
exports.invitationService = InvitationService;
|
|
5819
5840
|
exports.metadataService = metadataService;
|
|
5820
5841
|
exports.newImport = newImport;
|