@ercioko/meblotex-api 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +6 -0
- package/.nvmrc +1 -0
- package/.prettierrc +11 -0
- package/package.json +5 -16
- package/src/api/Api.ts +140 -0
- package/src/api/Endpoint.ts +76 -0
- package/src/api/createApi.ts +116 -0
- package/src/api/error.ts +17 -0
- package/{dist/api/index.d.ts → src/api/index.ts} +1 -0
- package/src/api/status.ts +3 -0
- package/src/api/utils/getAlert.ts +75 -0
- package/src/app_types.ts +695 -0
- package/src/components/ApiHostProvider.tsx +13 -0
- package/src/components/StatusTag.tsx +83 -0
- package/src/components/Table/DataTableWrapper.tsx +28 -0
- package/src/components/Table/FloatingActions.tsx +152 -0
- package/src/components/Table/Spinner.tsx +35 -0
- package/src/components/Table/Summary.tsx +18 -0
- package/src/components/Table/Table.tsx +474 -0
- package/src/components/Table/addIndexToObject.ts +6 -0
- package/src/components/Table/areProvidedColumnsDifferent.ts +26 -0
- package/src/components/Table/clicked.js +12 -0
- package/src/components/Table/displayActions.tsx +19 -0
- package/src/components/Table/hooks/useFetchPage.tsx +83 -0
- package/src/components/Table/hooks/useGetCellRenderer.tsx +197 -0
- package/src/components/Table/hooks/useGetColumnsWithCheckbox.tsx +34 -0
- package/src/components/Table/hooks/useGetDeleteRow.tsx +37 -0
- package/src/components/Table/hooks/useGetResizeColumn.ts +33 -0
- package/src/components/Table/hooks/useGetRowCheckbox.tsx +25 -0
- package/src/components/Table/hooks/useLoadDataSource.ts +24 -0
- package/src/components/Table/hooks/usePageSize.tsx +20 -0
- package/src/components/Table/hooks/useRenderRowActions.tsx +45 -0
- package/src/components/Table/hooks/useResizeColumns.ts +61 -0
- package/src/components/Table/index.ts +1 -0
- package/src/components/Table/providers/OrderProvider.tsx +20 -0
- package/src/components/Table/styles.ts +208 -0
- package/src/config.ts +7 -0
- package/src/db_types.ts +220 -0
- package/src/hooks/useApi.ts +43 -0
- package/src/hooks/useEndpoint.ts +35 -0
- package/src/lib/jednostkaNazwa.ts +6 -0
- package/src/lib/typDokumentuNazwa.ts +8 -0
- package/src/utils/Query.ts +30 -0
- package/src/utils/getWZNumber.ts +13 -0
- package/src/utils/getZamowienieDokumentNumber.ts +11 -0
- package/{dist/src/utils/index.js → src/utils/index.ts} +2 -2
- package/tsconfig.json +25 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/dist/api/Api.d.ts +0 -33
- package/dist/api/Api.js +0 -152
- package/dist/api/Endpoint.d.ts +0 -13
- package/dist/api/Endpoint.js +0 -126
- package/dist/api/createApi.d.ts +0 -52
- package/dist/api/createApi.js +0 -81
- package/dist/api/error.d.ts +0 -15
- package/dist/api/error.js +0 -18
- package/dist/api/index.js +0 -34
- package/dist/api/status.d.ts +0 -3
- package/dist/api/status.js +0 -6
- package/dist/api/utils/getAlert.d.ts +0 -6
- package/dist/api/utils/getAlert.js +0 -65
- package/dist/api/utils/index.js +0 -8
- package/dist/app_types.d.ts +0 -607
- package/dist/app_types.js +0 -75
- package/dist/components/ApiHostProvider.d.ts +0 -7
- package/dist/components/ApiHostProvider.js +0 -35
- package/dist/components/StatusTag.d.ts +0 -11
- package/dist/components/StatusTag.js +0 -86
- package/dist/components/Table/DataTableWrapper.d.ts +0 -3
- package/dist/components/Table/DataTableWrapper.js +0 -44
- package/dist/components/Table/FloatingActions.d.ts +0 -14
- package/dist/components/Table/FloatingActions.js +0 -32
- package/dist/components/Table/Spinner.d.ts +0 -2
- package/dist/components/Table/Spinner.js +0 -26
- package/dist/components/Table/Summary.js +0 -16
- package/dist/components/Table/Table.d.ts +0 -28
- package/dist/components/Table/Table.js +0 -330
- package/dist/components/Table/addIndexToObject.d.ts +0 -3
- package/dist/components/Table/addIndexToObject.js +0 -17
- package/dist/components/Table/areProvidedColumnsDifferent.d.ts +0 -2
- package/dist/components/Table/areProvidedColumnsDifferent.js +0 -16
- package/dist/components/Table/clicked.js +0 -11
- package/dist/components/Table/displayActions.js +0 -11
- package/dist/components/Table/hooks/useFetchPage.d.ts +0 -18
- package/dist/components/Table/hooks/useFetchPage.js +0 -123
- package/dist/components/Table/hooks/useGetCellRenderer.d.ts +0 -25
- package/dist/components/Table/hooks/useGetCellRenderer.js +0 -166
- package/dist/components/Table/hooks/useGetColumnsWithCheckbox.d.ts +0 -5
- package/dist/components/Table/hooks/useGetColumnsWithCheckbox.js +0 -53
- package/dist/components/Table/hooks/useGetDeleteRow.d.ts +0 -9
- package/dist/components/Table/hooks/useGetDeleteRow.js +0 -74
- package/dist/components/Table/hooks/useGetResizeColumn.d.ts +0 -8
- package/dist/components/Table/hooks/useGetResizeColumn.js +0 -28
- package/dist/components/Table/hooks/useGetRowCheckbox.d.ts +0 -5
- package/dist/components/Table/hooks/useGetRowCheckbox.js +0 -54
- package/dist/components/Table/hooks/useLoadDataSource.d.ts +0 -10
- package/dist/components/Table/hooks/useLoadDataSource.js +0 -20
- package/dist/components/Table/hooks/usePageSize.d.ts +0 -5
- package/dist/components/Table/hooks/usePageSize.js +0 -16
- package/dist/components/Table/hooks/useRenderRowActions.d.ts +0 -6
- package/dist/components/Table/hooks/useRenderRowActions.js +0 -51
- package/dist/components/Table/hooks/useResizeColumns.d.ts +0 -9
- package/dist/components/Table/hooks/useResizeColumns.js +0 -60
- package/dist/components/Table/index.d.ts +0 -1
- package/dist/components/Table/index.js +0 -8
- package/dist/components/Table/providers/OrderProvider.d.ts +0 -9
- package/dist/components/Table/providers/OrderProvider.js +0 -17
- package/dist/components/Table/styles.d.ts +0 -6
- package/dist/components/Table/styles.js +0 -37
- package/dist/components/index.js +0 -26
- package/dist/config.d.ts +0 -6
- package/dist/config.js +0 -8
- package/dist/db_types.d.ts +0 -208
- package/dist/db_types.js +0 -2
- package/dist/hooks/index.js +0 -10
- package/dist/hooks/useApi.d.ts +0 -2
- package/dist/hooks/useApi.js +0 -42
- package/dist/hooks/useEndpoint.d.ts +0 -2
- package/dist/hooks/useEndpoint.js +0 -34
- package/dist/index.js +0 -19
- package/dist/lib/index.js +0 -18
- package/dist/lib/jednostka.d.ts +0 -6
- package/dist/lib/jednostkaNazwa.d.ts +0 -6
- package/dist/lib/jednostkaNazwa.js +0 -9
- package/dist/lib/typDokumentuNazwa.d.ts +0 -6
- package/dist/lib/typDokumentuNazwa.js +0 -11
- package/dist/lib/typ_dokument.d.ts +0 -0
- package/dist/lib/typ_dokumentu.d.ts +0 -6
- package/dist/lib/unit.d.ts +0 -0
- package/dist/src/api/Api.js +0 -316
- package/dist/src/api/Endpoint.js +0 -365
- package/dist/src/api/createApi.js +0 -50
- package/dist/src/api/error.js +0 -15
- package/dist/src/api/index.js +0 -5
- package/dist/src/api/status.js +0 -3
- package/dist/src/api/utils/getAlert.js +0 -63
- package/dist/src/api/utils/index.js +0 -1
- package/dist/src/app_types.js +0 -72
- package/dist/src/components/ApiHostProvider.js +0 -11
- package/dist/src/components/StatusTag.js +0 -153
- package/dist/src/components/Table/DataTableWrapper.js +0 -115
- package/dist/src/components/Table/FloatingActions.js +0 -60
- package/dist/src/components/Table/Spinner.js +0 -40
- package/dist/src/components/Table/Summary.js +0 -16
- package/dist/src/components/Table/Table.js +0 -498
- package/dist/src/components/Table/addIndexToObject.js +0 -57
- package/dist/src/components/Table/areProvidedColumnsDifferent.js +0 -19
- package/dist/src/components/Table/clicked.js +0 -12
- package/dist/src/components/Table/displayActions.js +0 -11
- package/dist/src/components/Table/hooks/useFetchPage.js +0 -254
- package/dist/src/components/Table/hooks/useGetCellRenderer.js +0 -231
- package/dist/src/components/Table/hooks/useGetColumnsWithCheckbox.js +0 -33
- package/dist/src/components/Table/hooks/useGetDeleteRow.js +0 -181
- package/dist/src/components/Table/hooks/useGetResizeColumn.js +0 -72
- package/dist/src/components/Table/hooks/useGetRowCheckbox.js +0 -55
- package/dist/src/components/Table/hooks/useLoadDataSource.js +0 -16
- package/dist/src/components/Table/hooks/usePageSize.js +0 -15
- package/dist/src/components/Table/hooks/useRenderRowActions.js +0 -50
- package/dist/src/components/Table/hooks/useResizeColumns.js +0 -70
- package/dist/src/components/Table/index.js +0 -1
- package/dist/src/components/Table/providers/OrderProvider.js +0 -65
- package/dist/src/components/Table/styles.js +0 -66
- package/dist/src/components/index.js +0 -4
- package/dist/src/config.js +0 -6
- package/dist/src/db_types.js +0 -1
- package/dist/src/hooks/index.js +0 -2
- package/dist/src/hooks/useApi.js +0 -84
- package/dist/src/hooks/useEndpoint.js +0 -60
- package/dist/src/index.js +0 -3
- package/dist/src/lib/index.js +0 -2
- package/dist/src/lib/jednostkaNazwa.js +0 -6
- package/dist/src/lib/typDokumentuNazwa.js +0 -16
- package/dist/src/utils/Query.js +0 -73
- package/dist/src/utils/getWZNumber.js +0 -4
- package/dist/src/utils/getZamowienieDokumentNumber.js +0 -4
- package/dist/utils/AlertContext.d.ts +0 -3
- package/dist/utils/AlertContext.js +0 -3
- package/dist/utils/Query.d.ts +0 -6
- package/dist/utils/Query.js +0 -33
- package/dist/utils/geNumber.d.ts +0 -2
- package/dist/utils/getDocNumber.d.ts +0 -2
- package/dist/utils/getWZNumber.js +0 -10
- package/dist/utils/getWzNumber.d.ts +0 -2
- package/dist/utils/getZamowienieDokumentNumber copy.d.ts +0 -2
- package/dist/utils/getZamowienieDokumentNumber.d.ts +0 -2
- package/dist/utils/getZamowienieDokumentNumber.js +0 -8
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -12
- /package/{dist/api/utils/index.d.ts → src/api/utils/index.ts} +0 -0
- /package/{dist/components/index.d.ts → src/components/index.ts} +0 -0
- /package/{dist/hooks/index.d.ts → src/hooks/index.ts} +0 -0
- /package/{dist/index.d.ts → src/index.ts} +0 -0
- /package/{dist/lib/index.d.ts → src/lib/index.ts} +0 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const DataTable = styled.div`
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 100%;
|
|
6
|
+
flex: 1;
|
|
7
|
+
|
|
8
|
+
& > div {
|
|
9
|
+
width: 100%;
|
|
10
|
+
margin-top: 16px;
|
|
11
|
+
}
|
|
12
|
+
& .data-table-no-data {
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
color: #262626;
|
|
22
|
+
}
|
|
23
|
+
& .resized {
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
& .DragHandle {
|
|
30
|
+
flex: 0 0 16px;
|
|
31
|
+
z-index: 2;
|
|
32
|
+
cursor: col-resize;
|
|
33
|
+
color: #1890ff;
|
|
34
|
+
right: 0;
|
|
35
|
+
position: absolute;
|
|
36
|
+
}
|
|
37
|
+
& .DragHandle:hover {
|
|
38
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
39
|
+
}
|
|
40
|
+
& .DragHandleActive,
|
|
41
|
+
& .DragHandleActive:hover {
|
|
42
|
+
color: #1890ff;
|
|
43
|
+
z-index: 3;
|
|
44
|
+
}
|
|
45
|
+
& .DragHandleIcon {
|
|
46
|
+
flex: 0 0 12px;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.data-table-wrapper .table .td.table-actions div .action span {
|
|
54
|
+
padding: 6px;
|
|
55
|
+
border-radius: 100px;
|
|
56
|
+
transition: 150ms ease-in-out;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
}
|
|
61
|
+
.data-table-wrapper .table .td.table-actions div .action span:hover {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
background: rgba(0, 0, 0, 0.1);
|
|
64
|
+
}
|
|
65
|
+
& .table .td p {
|
|
66
|
+
margin: 0;
|
|
67
|
+
}
|
|
68
|
+
& .table .td .ant-tag {
|
|
69
|
+
line-height: 16.5px;
|
|
70
|
+
}
|
|
71
|
+
& .spinner-wrapper {
|
|
72
|
+
position: absolute;
|
|
73
|
+
bottom: -34px;
|
|
74
|
+
left: 50%;
|
|
75
|
+
}
|
|
76
|
+
& .ant-spin {
|
|
77
|
+
display: flex;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
margin: 15px 0;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
export const StyledTable = styled.div`
|
|
84
|
+
width: 100%;
|
|
85
|
+
min-height: fit-content;
|
|
86
|
+
background: #f5f5f5;
|
|
87
|
+
|
|
88
|
+
&:focus {
|
|
89
|
+
border: none;
|
|
90
|
+
outline: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:hover:not(.selected):not(:first-child):not(.summary) {
|
|
94
|
+
background: #d5f0ff !important;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.td-light {
|
|
98
|
+
background-color: white;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.header {
|
|
102
|
+
background: #e8e8e8;
|
|
103
|
+
}
|
|
104
|
+
:not(:first-child) {
|
|
105
|
+
height: 39px;
|
|
106
|
+
}
|
|
107
|
+
:nth-child(2n) {
|
|
108
|
+
background: #fff;
|
|
109
|
+
}
|
|
110
|
+
.selected > td {
|
|
111
|
+
background: #bae7ff;
|
|
112
|
+
}
|
|
113
|
+
.selectable:hover {
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
}
|
|
116
|
+
.summary {
|
|
117
|
+
border-bottom: none;
|
|
118
|
+
}
|
|
119
|
+
.summary .td {
|
|
120
|
+
color: #000;
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
}
|
|
123
|
+
.summary .td:not(.orphan) {
|
|
124
|
+
border-bottom: 1px solid #e8e8e8;
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
const tableData = css`
|
|
129
|
+
color: #000;
|
|
130
|
+
line-height: 24px;
|
|
131
|
+
font-size: 14px;
|
|
132
|
+
padding: 0 8px;
|
|
133
|
+
text-overflow: ellipsis;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
|
|
137
|
+
&.checkbox-cell {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
}
|
|
142
|
+
&.table-actions {
|
|
143
|
+
padding-top: 0;
|
|
144
|
+
padding-bottom: 0;
|
|
145
|
+
}
|
|
146
|
+
&.table-actions div {
|
|
147
|
+
height: 100%;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
}
|
|
151
|
+
&.table-actions div .action {
|
|
152
|
+
height: 24px;
|
|
153
|
+
width: 24px;
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
|
|
160
|
+
export const TableHeader = styled.div`
|
|
161
|
+
${tableData};
|
|
162
|
+
border: none;
|
|
163
|
+
position: sticky;
|
|
164
|
+
top: 0;
|
|
165
|
+
z-index: 1;
|
|
166
|
+
background: #e8e8e8;
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
background: #e8e8e8;
|
|
170
|
+
color: #262626;
|
|
171
|
+
padding: 0 5px 0 0;
|
|
172
|
+
font-weight: 600;
|
|
173
|
+
font-size: 16px;
|
|
174
|
+
height: 55px;
|
|
175
|
+
|
|
176
|
+
&:hover {
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
& > div {
|
|
181
|
+
text-overflow: ellipsis;
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
}
|
|
184
|
+
&:not(:first-child) {
|
|
185
|
+
border-left: 1px solid #fff;
|
|
186
|
+
}
|
|
187
|
+
& > span {
|
|
188
|
+
padding: 15px 6px 15px 11px;
|
|
189
|
+
width: 100%;
|
|
190
|
+
text-overflow: ellipsis;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
}
|
|
194
|
+
& > span:hover,
|
|
195
|
+
&.table-actions:hover {
|
|
196
|
+
cursor: initial;
|
|
197
|
+
}
|
|
198
|
+
&.checkbox-header {
|
|
199
|
+
align-items: center;
|
|
200
|
+
justify-content: center;
|
|
201
|
+
padding: 0;
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
204
|
+
|
|
205
|
+
export const TableData = styled.div<{ $align?: 'right' }>`
|
|
206
|
+
${tableData}
|
|
207
|
+
${(p) => (p.$align ? 'text-align: ' + p.$align + ';' : '')}
|
|
208
|
+
`;
|
package/src/config.ts
ADDED
package/src/db_types.ts
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { DokumentTyp, DokumentTypDowolny, FormaPlatnosci, TypDokumentu, TypWplaty } from './app_types';
|
|
2
|
+
|
|
3
|
+
export interface BufferAttributes {
|
|
4
|
+
id: number;
|
|
5
|
+
date_buffer: Date;
|
|
6
|
+
date_completion: Date;
|
|
7
|
+
buffer_type: string;
|
|
8
|
+
buffer_method: string;
|
|
9
|
+
buffer_status: string;
|
|
10
|
+
foreign_number: string;
|
|
11
|
+
pieces: number;
|
|
12
|
+
meters: number;
|
|
13
|
+
sq_meters: number;
|
|
14
|
+
value: number;
|
|
15
|
+
file_path: string;
|
|
16
|
+
comments: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface KlientAttributes {
|
|
20
|
+
id_klient: number;
|
|
21
|
+
nazwa_skrocona: string;
|
|
22
|
+
nazwa1: string;
|
|
23
|
+
nazwa2: string;
|
|
24
|
+
nazwa3: string;
|
|
25
|
+
kraj: string;
|
|
26
|
+
miasto: string;
|
|
27
|
+
wojewodztwo: string;
|
|
28
|
+
ulica: string;
|
|
29
|
+
numer_domu: string;
|
|
30
|
+
numer_lokalu: string;
|
|
31
|
+
ulica_txt: string;
|
|
32
|
+
kod: string;
|
|
33
|
+
poczta: string;
|
|
34
|
+
nip_kraj: string;
|
|
35
|
+
nip: string;
|
|
36
|
+
vip: boolean;
|
|
37
|
+
platnik_vat: boolean;
|
|
38
|
+
regon: string;
|
|
39
|
+
pesel: string;
|
|
40
|
+
telefon1: string;
|
|
41
|
+
telefon2: string;
|
|
42
|
+
fax: string;
|
|
43
|
+
email: string;
|
|
44
|
+
www: string;
|
|
45
|
+
uwagi: string;
|
|
46
|
+
frontman: boolean;
|
|
47
|
+
frontman_login: string;
|
|
48
|
+
frontman_haslo: string;
|
|
49
|
+
frontman_data_login: Date | number;
|
|
50
|
+
frontman_data_logout: Date | number;
|
|
51
|
+
portal: boolean;
|
|
52
|
+
portal_login: string;
|
|
53
|
+
portal_haslo: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface UzytkownikAttributes {
|
|
57
|
+
id_uzytkownik: number;
|
|
58
|
+
login: string;
|
|
59
|
+
haslo: string;
|
|
60
|
+
imie?: string;
|
|
61
|
+
nazwisko?: string;
|
|
62
|
+
inicjaly?: string;
|
|
63
|
+
data_login?: Date | number;
|
|
64
|
+
data_logout?: Date | number;
|
|
65
|
+
czas_dodanie: Date;
|
|
66
|
+
czas_edycja?: Date;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface WplataAttributes {
|
|
70
|
+
id_wplata: number;
|
|
71
|
+
data_wplaty: Date;
|
|
72
|
+
typ_wplaty: TypWplaty;
|
|
73
|
+
numer_idx: number;
|
|
74
|
+
numer: number;
|
|
75
|
+
kwota_wplaty: number;
|
|
76
|
+
uwagi: string;
|
|
77
|
+
rozliczono: number;
|
|
78
|
+
id_klient?: number;
|
|
79
|
+
id_zamowienie_dokument?: number;
|
|
80
|
+
id_uzytkownik_dodanie?: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ZamowienieDokumentAttributes {
|
|
84
|
+
id_zamowienie_dokument: number;
|
|
85
|
+
data_sprzedazy: Date;
|
|
86
|
+
data_wystawienia: Date;
|
|
87
|
+
data_platnosci: Date;
|
|
88
|
+
typ_dokumentu: TypDokumentu;
|
|
89
|
+
numer: number;
|
|
90
|
+
numer_idx: number;
|
|
91
|
+
forma_platnosci: FormaPlatnosci;
|
|
92
|
+
wartosc: number;
|
|
93
|
+
netto: number;
|
|
94
|
+
nazwa_skrocona: string;
|
|
95
|
+
nazwa1: string;
|
|
96
|
+
nazwa2: string;
|
|
97
|
+
nazwa3: string;
|
|
98
|
+
kraj: string;
|
|
99
|
+
miasto: string;
|
|
100
|
+
ulica: string;
|
|
101
|
+
numer_domu: string;
|
|
102
|
+
numer_lokalu: string;
|
|
103
|
+
ulica_txt: string;
|
|
104
|
+
kod: string;
|
|
105
|
+
nip_kraj: string;
|
|
106
|
+
nip: string;
|
|
107
|
+
id_klient?: number;
|
|
108
|
+
id_klient_nabywca?: number;
|
|
109
|
+
id_zamowienie_dokument_parent?: number;
|
|
110
|
+
id_zamowienie?: number;
|
|
111
|
+
id_uzytkownik_dodanie?: number;
|
|
112
|
+
czas_edycja?: Date;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface ZamowienieElementAttributes {
|
|
116
|
+
id_zamowienie_element: number;
|
|
117
|
+
zrodlo: string;
|
|
118
|
+
nazwa: string;
|
|
119
|
+
towar_kategoria: string;
|
|
120
|
+
sztuk: number;
|
|
121
|
+
metry: string;
|
|
122
|
+
metry_kw: string;
|
|
123
|
+
jednostka: number;
|
|
124
|
+
cena_jednostka: string;
|
|
125
|
+
cena: string;
|
|
126
|
+
podatek: number;
|
|
127
|
+
rabat_cena: number;
|
|
128
|
+
rabat_prefix: string;
|
|
129
|
+
rabat_sufix: string;
|
|
130
|
+
etykieta: boolean;
|
|
131
|
+
id_atrybut_konfig_grupa?: number;
|
|
132
|
+
id_zamowienie_element_parent?: number;
|
|
133
|
+
id_zamowienie?: number;
|
|
134
|
+
czas_dodanie?: Date;
|
|
135
|
+
czas_edycja?: Date;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface ZamowienieElementAtrybutAttributes {
|
|
139
|
+
id_zamowienie_element_atrybut: number;
|
|
140
|
+
cecha: string;
|
|
141
|
+
cecha_typ: string;
|
|
142
|
+
wartosc_opis: string;
|
|
143
|
+
wartosc: string;
|
|
144
|
+
wartosc_rownanie: number;
|
|
145
|
+
narzut_cena: number;
|
|
146
|
+
narzut_prefix: string;
|
|
147
|
+
narzut_sufix: string;
|
|
148
|
+
nazwa_zasob: string;
|
|
149
|
+
predef: boolean;
|
|
150
|
+
czas_dodanie?: Date;
|
|
151
|
+
czas_edycja?: Date;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface AtrybutKonfigGrupaAttributes {
|
|
155
|
+
id_atrybut_konfig_grupa: number;
|
|
156
|
+
data_utworzenia: Date;
|
|
157
|
+
data_zamkniecia: Date;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface ZamowienieAttributes {
|
|
161
|
+
id_zamowienie: number;
|
|
162
|
+
data_przyjecia: Date;
|
|
163
|
+
data_realizacji: Date;
|
|
164
|
+
data_status: Date;
|
|
165
|
+
zamowienie_status: string;
|
|
166
|
+
zamowienie_typ: string;
|
|
167
|
+
zamowienie_metoda: string;
|
|
168
|
+
numer: number;
|
|
169
|
+
numer_idx: number;
|
|
170
|
+
numer_obcy: string;
|
|
171
|
+
sztuk: number;
|
|
172
|
+
metry: number;
|
|
173
|
+
metry_kw: number;
|
|
174
|
+
wartosc: number;
|
|
175
|
+
paczki: number;
|
|
176
|
+
plik_sciezka: string;
|
|
177
|
+
uwagi: string;
|
|
178
|
+
portal_archiwum: boolean;
|
|
179
|
+
numer_konsumenta: string;
|
|
180
|
+
numer_txt: string;
|
|
181
|
+
id_klient?: number;
|
|
182
|
+
id_zamowienie_wydanie?: number;
|
|
183
|
+
id_zamowienie_dokument?: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface ZamowienieDokumentElementAttributes {
|
|
187
|
+
id_zamowienie_dokument_element: number;
|
|
188
|
+
korekta: boolean;
|
|
189
|
+
nazwa: string;
|
|
190
|
+
jednostka: number;
|
|
191
|
+
cena_jednostka: number;
|
|
192
|
+
cena_jednostka_netto: number;
|
|
193
|
+
podatek: number;
|
|
194
|
+
ilosc: number;
|
|
195
|
+
wartosc: number;
|
|
196
|
+
netto: number;
|
|
197
|
+
czas_dodanie: string;
|
|
198
|
+
czas_edycja: string;
|
|
199
|
+
id_zamowienie_dokument?: number;
|
|
200
|
+
id_uzytkownik?: number;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface ZamowienieDokumentMagazynAttributes {
|
|
204
|
+
id_zamowienie_dokument_magazyn: number;
|
|
205
|
+
data_wystawienia: Date;
|
|
206
|
+
dokument_typ: DokumentTyp | DokumentTypDowolny;
|
|
207
|
+
numer: number;
|
|
208
|
+
numer_idx: number;
|
|
209
|
+
id_zamowienie?: number;
|
|
210
|
+
id_zamowienie_dokument?: number;
|
|
211
|
+
id_uzytkownik_dodanie?: number;
|
|
212
|
+
id_uzytkownik_edycja?: number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface ZaliczkaRozliczenieAttributes {
|
|
216
|
+
id_zaliczka_rozliczenie: number;
|
|
217
|
+
kwota_rozliczenia: number;
|
|
218
|
+
id_zamowienie_dokument?: number;
|
|
219
|
+
id_wplata?: number;
|
|
220
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { createApi } from '../api/createApi';
|
|
4
|
+
import Endpoint from '../api/Endpoint';
|
|
5
|
+
import { useApiHost } from '../components';
|
|
6
|
+
|
|
7
|
+
export default function useApi(
|
|
8
|
+
onUnauthorized = () => {}
|
|
9
|
+
): ReturnType<typeof createApi> | undefined {
|
|
10
|
+
const host = useApiHost();
|
|
11
|
+
const api = useMemo(
|
|
12
|
+
() =>
|
|
13
|
+
Object.fromEntries(
|
|
14
|
+
Object.entries(createApi(host)).map(([key, { endpoint }]) => [
|
|
15
|
+
key,
|
|
16
|
+
new Endpoint(endpoint, host, errorCallback),
|
|
17
|
+
])
|
|
18
|
+
) as ReturnType<typeof createApi>,
|
|
19
|
+
[]
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const errorCallback = useCallback(
|
|
23
|
+
(e) => {
|
|
24
|
+
let error;
|
|
25
|
+
try {
|
|
26
|
+
error = JSON.parse(e.message);
|
|
27
|
+
} catch (syntaxError) {
|
|
28
|
+
error = { statusText: e.message };
|
|
29
|
+
}
|
|
30
|
+
if (error.status === 401) {
|
|
31
|
+
onUnauthorized();
|
|
32
|
+
}
|
|
33
|
+
if (error.status === 400) {
|
|
34
|
+
throw Error(`${error.statusText}: ${error.text}`);
|
|
35
|
+
} else {
|
|
36
|
+
throw Error(error.statusText);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
[onUnauthorized]
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return api;
|
|
43
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
import Endpoint from '../api/Endpoint';
|
|
3
|
+
import { createApi } from '../api/createApi';
|
|
4
|
+
import { useApiHost } from '../components';
|
|
5
|
+
|
|
6
|
+
export default function useEndpoint<GetResponseElement>(
|
|
7
|
+
path: string,
|
|
8
|
+
onError: (error: string) => void = () => {}
|
|
9
|
+
): Endpoint<GetResponseElement> {
|
|
10
|
+
const host = useApiHost();
|
|
11
|
+
const handleErrors = useCallback(
|
|
12
|
+
(func: Function) =>
|
|
13
|
+
(...args: any) => {
|
|
14
|
+
try {
|
|
15
|
+
func(...args);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
const error = JSON.parse(e.message);
|
|
18
|
+
onError(error);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
[onError]
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const endpoint = useMemo(() => {
|
|
25
|
+
const endpoint = createApi(host)[path];
|
|
26
|
+
|
|
27
|
+
endpoint.get = handleErrors(endpoint.get);
|
|
28
|
+
endpoint.post = handleErrors(endpoint.post);
|
|
29
|
+
endpoint.put = handleErrors(endpoint.put);
|
|
30
|
+
endpoint.delete = handleErrors(endpoint.delete);
|
|
31
|
+
return endpoint;
|
|
32
|
+
}, [path, handleErrors, host]);
|
|
33
|
+
|
|
34
|
+
return endpoint;
|
|
35
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TypDokumentu } from '../app_types';
|
|
2
|
+
|
|
3
|
+
export const typDokumentuNazwa = {
|
|
4
|
+
[TypDokumentu.Faktura]: 'Faktura VAT',
|
|
5
|
+
[TypDokumentu.FakturaDetal]: 'Faktura FADET',
|
|
6
|
+
[TypDokumentu.FakturaEksport]: 'Faktura Eksportowa',
|
|
7
|
+
[TypDokumentu.Paragon]: 'Paragon',
|
|
8
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function encode<T = Record<string, unknown>>(data: T): string {
|
|
2
|
+
return data
|
|
3
|
+
? Object.entries(data)
|
|
4
|
+
.filter(([k, v]) => k !== undefined && v !== undefined)
|
|
5
|
+
.map(([k, v]) =>
|
|
6
|
+
(Array.isArray(v) ? v : [v])
|
|
7
|
+
.map((e) => `${encodeURIComponent(k)}=${encodeURIComponent(e)}`)
|
|
8
|
+
.join('&')
|
|
9
|
+
)
|
|
10
|
+
.join('&')
|
|
11
|
+
: '';
|
|
12
|
+
}
|
|
13
|
+
const Query = {
|
|
14
|
+
decode: (query: string): Record<string, unknown> => {
|
|
15
|
+
if (!query) return {};
|
|
16
|
+
|
|
17
|
+
const q: Record<string, unknown> = {};
|
|
18
|
+
const pairs = query.replace(/\?/g, '').split('&');
|
|
19
|
+
pairs.forEach((pair) => {
|
|
20
|
+
const p = pair.split('=');
|
|
21
|
+
q[decodeURIComponent(p[0])] = decodeURIComponent(p[1] || '');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return q;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
encode,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default Query;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ZamowienieDokumentMagazynAttributes } from '../db_types';
|
|
2
|
+
|
|
3
|
+
export const getWZNumber = ({
|
|
4
|
+
numer,
|
|
5
|
+
numer_idx,
|
|
6
|
+
}: Pick<
|
|
7
|
+
ZamowienieDokumentMagazynAttributes,
|
|
8
|
+
'numer_idx' | 'numer'
|
|
9
|
+
>): string => {
|
|
10
|
+
return `WZ ${numer_idx.toString().slice(0, 4)}/${numer_idx
|
|
11
|
+
.toString()
|
|
12
|
+
.slice(4)}/${numer.toString().padStart(4, '0')}/M`;
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ZamowienieDokument } from '../app_types';
|
|
2
|
+
|
|
3
|
+
export const getZamowienieDokumentNumber = (
|
|
4
|
+
row: Pick<ZamowienieDokument, 'typ_dokumentu' | 'numer_idx' | 'numer'>
|
|
5
|
+
): string => {
|
|
6
|
+
return `${row?.typ_dokumentu}/${row?.numer_idx
|
|
7
|
+
?.toString()
|
|
8
|
+
.slice(0, 4)}/${row?.numer_idx?.toString().slice(4)}/${row?.numer
|
|
9
|
+
?.toString()
|
|
10
|
+
.padStart(4, '0')}/M`;
|
|
11
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as Query } from "./Query";
|
|
2
|
-
export { getZamowienieDokumentNumber } from './getZamowienieDokumentNumber'
|
|
3
|
-
export { getWZNumber } from './getWZNumber'
|
|
2
|
+
export { getZamowienieDokumentNumber } from './getZamowienieDokumentNumber'
|
|
3
|
+
export { getWZNumber } from './getWZNumber'
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowSyntheticDefaultImports": true,
|
|
4
|
+
"jsx": "react",
|
|
5
|
+
"lib": [
|
|
6
|
+
"dom",
|
|
7
|
+
"dom.iterable",
|
|
8
|
+
"esnext"
|
|
9
|
+
],
|
|
10
|
+
"target": "ES5",
|
|
11
|
+
"module": "CommonJS",
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"outDir": "./dist",
|
|
17
|
+
},
|
|
18
|
+
"exclude": [
|
|
19
|
+
"node_modules",
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"include": [
|
|
23
|
+
"src/**/*.ts",
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.es2021.d.ts","./node_modules/typescript/lib/lib.es2022.d.ts","./node_modules/typescript/lib/lib.esnext.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.es2021.promise.d.ts","./node_modules/typescript/lib/lib.es2021.string.d.ts","./node_modules/typescript/lib/lib.es2021.weakref.d.ts","./node_modules/typescript/lib/lib.es2021.intl.d.ts","./node_modules/typescript/lib/lib.es2022.array.d.ts","./node_modules/typescript/lib/lib.es2022.error.d.ts","./node_modules/typescript/lib/lib.es2022.intl.d.ts","./node_modules/typescript/lib/lib.es2022.object.d.ts","./node_modules/typescript/lib/lib.es2022.string.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/config.ts","./src/types.ts","./src/utils/query.ts","./src/utils/index.ts","./src/api/api.ts","./src/api/endpoint.ts","./src/api/error.ts","./src/api/hooks/useendpoint.ts","./node_modules/@types/react/global.d.ts","./node_modules/csstype/index.d.ts","./node_modules/@types/prop-types/index.d.ts","./node_modules/@types/scheduler/tracing.d.ts","./node_modules/@types/react/index.d.ts","./src/api/hooks/useapi.ts","./src/api/hooks/index.ts","./src/api/status.ts","./src/api/utils/getalert.ts","./src/api/utils/index.ts","./src/api/index.ts","./src/index.ts","./node_modules/@types/scheduler/index.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/react/jsx-runtime.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","3eb679a56cab01203a1ba7edeade937f6a2a4c718513b2cd930b579807fa9359","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"1272277fe7daa738e555eb6cc45ded42cc2d0f76c07294142283145d49e96186","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"ff667ee99e5a28c3dc5063a3cfd4d3436699e3fb035d4451037da7f567da542a","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},{"version":"f127524561569c0c8ae3654369d31862bfbeff651177b8e9fa263b145d1ac435","signature":"267b5bf632fca35818b7b60d739a85f211f604ae69e7e2aed793f79cb36f4f18"},{"version":"8f9846744c5663ddf05433588c4924f257821963db5c37b63ab8f8b2014d191d","signature":"c6031808967f552d0d4e43fad99b9167b280908db795051b8d77e2a41e67421d"},{"version":"750b5eafecebace74dede83ff296213589664e5b51d51eeadd7b2cfcec4d53dc","signature":"7015a3fc7565ea2180b354bbbcc09bd803a20b0205cd8baf354501762bdffe1f"},"7e72df3cd147763b0f30cf0d71316f4be368ee820511764b5d3daff0de0aa8bf",{"version":"b657dd3ba938264f8959a147dbbd28cbba0fc07d4742acf26cb9256f3cd79818","signature":"ff673d12b8bd81e014bcb097cbc10664cbf7e90420f431b6656db1a6c8779cc2"},{"version":"ea5b3fa2424e4f6d1569f7f38c8963f79af481c5d4608330e9f78824db663c0d","signature":"15739ace61999bd4bc0df94bbd344e83b1e9dfa847a198fe0f8739c8aaf543d4"},{"version":"a1538a68802695aeba28c80fa92838732b51c9fcfb9c5f787354508153b6d535","signature":"5123edd9bcd15eb5a15ba3ee41694e92245e7ab6e7b74cb0970171c0bba87949"},{"version":"c7661305de295e02208a1165b95b0927f4b2335068b4e6910267c905bf3c46c5","signature":"0cfb63b0217ffd9b7f21428080343683c0931e09d918074e62087b5725140762"},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"ba7617784f6b9aeac5e20c5eea869bbc3ef31b905f59c796b0fd401dae17c111","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"e870860b52176fc9c884bbd62b6dbb4982e84a3dd33782333b952653979911eb","affectsGlobalScope":true},{"version":"5b44f8d3baeea3c4acd81490b66fdb526b39b550f5380bb90768894b4c8cba70","signature":"c6c0a2976693234cb3bb9f46ba730f50639f5450567544269d3ec3958da4dd6c"},"81cc2c40f534e9e21df1c33e807fb6c010a4ac35ae698a03d8ec575426f63e5e",{"version":"2e33e0439dda626d9edd57357553cfe135df882b7c3833042a790852b74c4302","signature":"3c8835713a596081b171318c11cc6ce5b68da8eb40ea2e82b4e1d7b6d267ef1f"},{"version":"91f121781b852fa0be7830e0e49ff12e343dbbbffc2df9704b665fa603edc230","signature":"03035e6a172d121afd33f01c689f4c1b83a2390571c73aef9029440600549de8"},"b9d9b79b59e5aaef0dc0b388c55414ed565cb3e79b31bdf9eaa4428646a38f43",{"version":"d9bee74a43be46515c6d6b3b61558b8981fb1e2956fc90cf6b90d6680c7088ab","signature":"1a48434b56d422a0c943ffc74f0e36873004fe17bc861a214c5fc525138f69e9"},"a39f0d65b0963333f5718cb6e029a2c95070395ca1792cf8811debb3015a4c2e","74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":true,"jsx":2,"module":99,"noUnusedLocals":true,"noUnusedParameters":true,"preserveConstEnums":true,"removeComments":true,"rootDir":"./src","skipLibCheck":true,"sourceMap":true,"target":1},"fileIdsList":[[63,64,65,66],[55,56,58,73],[56,59],[62,68],[60,67,73],[60,73],[56,60,61,69,70,72],[61,70],[71],[73],[57],[76],[63,64,65,66,76],[56,73],[62,68,76,77],[60],[71,76,77],[73,76,77],[57,76,77]],"referencedMap":[[67,1],[59,2],[60,3],[69,4],[68,5],[62,6],[73,7],[71,8],[72,9],[74,10],[58,11]],"exportedModulesMap":[[65,12],[63,12],[67,13],[75,12],[66,12],[64,12],[11,12],[12,12],[14,12],[13,12],[2,12],[15,12],[16,12],[17,12],[18,12],[19,12],[20,12],[21,12],[22,12],[3,12],[4,12],[26,12],[23,12],[24,12],[25,12],[27,12],[28,12],[29,12],[5,12],[30,12],[31,12],[32,12],[33,12],[6,12],[34,12],[35,12],[36,12],[37,12],[7,12],[38,12],[43,12],[44,12],[39,12],[40,12],[41,12],[42,12],[8,12],[48,12],[45,12],[46,12],[47,12],[49,12],[9,12],[50,12],[51,12],[52,12],[53,12],[1,12],[10,12],[54,12],[59,14],[60,3],[69,15],[68,10],[62,16],[73,7],[72,17],[74,18],[58,19]],"semanticDiagnosticsPerFile":[65,63,67,75,66,64,11,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,34,35,36,37,7,38,43,44,39,40,41,42,8,48,45,46,47,49,9,50,51,52,53,1,10,54,59,60,61,69,68,62,73,70,71,72,55,74,56,58,57]},"version":"4.7.4"}
|
package/dist/api/Api.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DataRow, Order } from '../app_types';
|
|
2
|
-
import { createApi } from './createApi';
|
|
3
|
-
type QueryType<T> = {
|
|
4
|
-
page?: number;
|
|
5
|
-
records?: number;
|
|
6
|
-
fields?: (keyof T)[];
|
|
7
|
-
order?: Order[];
|
|
8
|
-
} & Record<string, unknown>;
|
|
9
|
-
export type RequestOptions<T> = {
|
|
10
|
-
token?: string;
|
|
11
|
-
id?: number | string;
|
|
12
|
-
noId?: boolean;
|
|
13
|
-
query?: QueryType<T>;
|
|
14
|
-
};
|
|
15
|
-
export type RequestData = Record<string, unknown>;
|
|
16
|
-
export type ApiResponse<RowType = DataRow> = {
|
|
17
|
-
[key in keyof ReturnType<typeof createApi>]: RowType;
|
|
18
|
-
} & {
|
|
19
|
-
total: number;
|
|
20
|
-
};
|
|
21
|
-
export default class Api {
|
|
22
|
-
host: string;
|
|
23
|
-
namespace: string;
|
|
24
|
-
endpoint: string;
|
|
25
|
-
private endpointUrl;
|
|
26
|
-
constructor(endpoint: string, host?: string);
|
|
27
|
-
get<DataType>(opts?: RequestOptions<DataType extends any[] ? DataType[0] : DataType>): Promise<any>;
|
|
28
|
-
post<T, ResponseType>(data?: T, opts?: RequestOptions<T>): Promise<ResponseType>;
|
|
29
|
-
put(id: number, data: RequestData, opts?: RequestOptions<{}>): Promise<ApiResponse>;
|
|
30
|
-
delete(id: number, opts?: RequestOptions<{}>): Promise<ApiResponse>;
|
|
31
|
-
private getQuery;
|
|
32
|
-
}
|
|
33
|
-
export {};
|