@evolver-fi/evolver-basics-admin-components 1.0.0 → 8.2.2-alpha.3
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/dist/EnumSelectFilter-DDWIjz5i.js +35 -0
- package/dist/EnumSelectFilter-DDWIjz5i.js.map +1 -0
- package/dist/FilterLink-OxQDWR5G.js +29 -0
- package/dist/FilterLink-OxQDWR5G.js.map +1 -0
- package/dist/Table-IciQttr3.js +79 -0
- package/dist/Table-IciQttr3.js.map +1 -0
- package/dist/TableMetadataDisplay-BM61EulC.js +49 -0
- package/dist/TableMetadataDisplay-BM61EulC.js.map +1 -0
- package/dist/TextFilter-CLOKjiSd.js +54 -0
- package/dist/TextFilter-CLOKjiSd.js.map +1 -0
- package/dist/api-CMiZYkfc.js +32 -0
- package/dist/api-CMiZYkfc.js.map +1 -0
- package/dist/breadcrumbs/index.js +2 -5
- package/dist/breadcrumbs-BAwnKRxL.js +32 -0
- package/dist/breadcrumbs-BAwnKRxL.js.map +1 -0
- package/dist/breadcrumbs.css +1 -0
- package/dist/client/index.js +330 -369
- package/dist/client/index.js.map +1 -1
- package/dist/configuration-values/index.js +2 -13
- package/dist/configuration-values-CjOfmPRq.js +3464 -0
- package/dist/configuration-values-CjOfmPRq.js.map +1 -0
- package/dist/control-values/index.js +2 -10
- package/dist/control-values-CzQOB4WJ.js +144 -0
- package/dist/control-values-CzQOB4WJ.js.map +1 -0
- package/dist/exhaustiveValues-BYWkg9M1.js +6 -0
- package/dist/exhaustiveValues-BYWkg9M1.js.map +1 -0
- package/dist/filter/index.js +4 -10
- package/dist/formData-BO275hRZ.js +43 -0
- package/dist/formData-BO275hRZ.js.map +1 -0
- package/dist/jwt-tokens/index.js +2 -9
- package/dist/jwt-tokens-DnKsHei4.js +71 -0
- package/dist/jwt-tokens-DnKsHei4.js.map +1 -0
- package/dist/main/index.js +17 -87
- package/dist/message-log/index.js +2 -12
- package/dist/message-log-BdrJtbsP.js +337 -0
- package/dist/message-log-BdrJtbsP.js.map +1 -0
- package/dist/message-sending/index.js +2 -10
- package/dist/message-sending-dvTw2fFm.js +181 -0
- package/dist/message-sending-dvTw2fFm.js.map +1 -0
- package/dist/message-targets/index.js +2 -15
- package/dist/message-targets-8EppIJde.js +406 -0
- package/dist/message-targets-8EppIJde.js.map +1 -0
- package/dist/pagination-C4QUYRMf.js +20 -0
- package/dist/pagination-C4QUYRMf.js.map +1 -0
- package/dist/scheduled-tasks/index.js +2 -16
- package/dist/scheduled-tasks-BtBnBrE7.js +647 -0
- package/dist/scheduled-tasks-BtBnBrE7.js.map +1 -0
- package/dist/schemas-D-8_LuND.js +2986 -0
- package/dist/schemas-D-8_LuND.js.map +1 -0
- package/dist/table/index.js +2 -6
- package/dist/triggerables/index.js +3 -11
- package/dist/triggerables-DgrIeQMi.js +51 -0
- package/dist/triggerables-DgrIeQMi.js.map +1 -0
- package/dist/types/breadcrumbs.d.ts +1 -0
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client.d.ts +1 -0
- package/dist/types/common/exhaustiveValues.d.ts +5 -0
- package/dist/types/common/formData.d.ts +20 -0
- package/dist/types/common/format.d.ts +1 -0
- package/dist/types/common/pagination.d.ts +8 -0
- package/dist/types/common/types.d.ts +27 -0
- package/dist/types/common/validation.d.ts +5 -0
- package/dist/types/components/breadcrumbs/BreadCrumbs.d.ts +10 -0
- package/dist/types/components/breadcrumbs/index.d.ts +1 -0
- package/dist/types/components/filter/EnumSelectFilter.d.ts +7 -0
- package/dist/types/components/filter/FilterHelperTexts.d.ts +4 -0
- package/dist/types/components/filter/FilterLink.d.ts +2 -0
- package/dist/types/components/filter/TextFilter.d.ts +2 -0
- package/dist/types/components/filter/createEnumSelectFilter.d.ts +5 -0
- package/dist/types/components/filter/index.d.ts +5 -0
- package/dist/types/components/filter/types.d.ts +20 -0
- package/dist/types/components/metadata/TableMetadataDisplay.d.ts +2 -0
- package/dist/types/components/metadata/utils.d.ts +1 -0
- package/dist/types/components/table/Pagination.d.ts +7 -0
- package/dist/types/components/table/Table.d.ts +3 -0
- package/dist/types/components/table/index.d.ts +3 -0
- package/dist/types/components/table/types.d.ts +48 -0
- package/dist/types/configuration-values.d.ts +1 -0
- package/dist/types/control-values.d.ts +1 -0
- package/dist/types/filter.d.ts +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/jwt-tokens.d.ts +1 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/message-log.d.ts +1 -0
- package/dist/types/message-sending.d.ts +1 -0
- package/dist/types/message-targets.d.ts +1 -0
- package/dist/types/routes/configuration-values/ConfigurationValueFormRoute.d.ts +2 -0
- package/dist/types/routes/configuration-values/ConfigurationValuesRoute.d.ts +2 -0
- package/dist/types/routes/configuration-values/action.d.ts +8 -0
- package/dist/types/routes/configuration-values/api.d.ts +53 -0
- package/dist/types/routes/configuration-values/configurationValueColumns.d.ts +4 -0
- package/dist/types/routes/configuration-values/index.d.ts +5 -0
- package/dist/types/routes/configuration-values/loader.d.ts +52 -0
- package/dist/types/routes/control-values/ControlValuesRoute.d.ts +2 -0
- package/dist/types/routes/control-values/SingleControlValueRoute.d.ts +2 -0
- package/dist/types/routes/control-values/api.d.ts +43 -0
- package/dist/types/routes/control-values/controlValueColumns.d.ts +4 -0
- package/dist/types/routes/control-values/index.d.ts +4 -0
- package/dist/types/routes/control-values/loader.d.ts +43 -0
- package/dist/types/routes/jwt-tokens/JwtTokensRoute.d.ts +6 -0
- package/dist/types/routes/jwt-tokens/api.d.ts +41 -0
- package/dist/types/routes/jwt-tokens/index.d.ts +3 -0
- package/dist/types/routes/jwt-tokens/loader.d.ts +35 -0
- package/dist/types/routes/message-log/LogBodyLink.d.ts +6 -0
- package/dist/types/routes/message-log/MessageLogRoute.d.ts +2 -0
- package/dist/types/routes/message-log/SingleLogMessageRoute.d.ts +6 -0
- package/dist/types/routes/message-log/api.d.ts +88 -0
- package/dist/types/routes/message-log/index.d.ts +4 -0
- package/dist/types/routes/message-log/loader.d.ts +53 -0
- package/dist/types/routes/message-log/messageLogColumns.d.ts +3 -0
- package/dist/types/routes/message-log/types.d.ts +37 -0
- package/dist/types/routes/message-sending/MessageSendingRoute.d.ts +2 -0
- package/dist/types/routes/message-sending/SingleMessageRoute.d.ts +2 -0
- package/dist/types/routes/message-sending/api.d.ts +92 -0
- package/dist/types/routes/message-sending/index.d.ts +4 -0
- package/dist/types/routes/message-sending/loader.d.ts +34 -0
- package/dist/types/routes/message-sending/messageSendingColumns.d.ts +3 -0
- package/dist/types/routes/message-sending/types.d.ts +43 -0
- package/dist/types/routes/message-targets/MessageTargetFormRoute.d.ts +2 -0
- package/dist/types/routes/message-targets/MessageTargetsRoute.d.ts +2 -0
- package/dist/types/routes/message-targets/action.d.ts +8 -0
- package/dist/types/routes/message-targets/api.d.ts +12 -0
- package/dist/types/routes/message-targets/index.d.ts +5 -0
- package/dist/types/routes/message-targets/loader.d.ts +15 -0
- package/dist/types/routes/scheduled-tasks/ScheduledTaskFormRoute.d.ts +2 -0
- package/dist/types/routes/scheduled-tasks/ScheduledTasksRoute.d.ts +2 -0
- package/dist/types/routes/scheduled-tasks/action.d.ts +21 -0
- package/dist/types/routes/scheduled-tasks/api.d.ts +75 -0
- package/dist/types/routes/scheduled-tasks/index.d.ts +5 -0
- package/dist/types/routes/scheduled-tasks/loader.d.ts +57 -0
- package/dist/types/routes/scheduled-tasks/parseScheduledTask.d.ts +15 -0
- package/dist/types/routes/triggerables/TriggerablesRoute.d.ts +2 -0
- package/dist/types/routes/triggerables/action.d.ts +6 -0
- package/dist/types/routes/triggerables/api.d.ts +33 -0
- package/dist/types/routes/triggerables/index.d.ts +4 -0
- package/dist/types/routes/triggerables/loader.d.ts +3 -0
- package/dist/types/scheduled-tasks.d.ts +1 -0
- package/dist/types/table.d.ts +1 -0
- package/dist/types/triggerables.d.ts +1 -0
- package/dist/types/types/openapiTypes.d.ts +3321 -0
- package/package.json +12 -5
- package/dist/ArrowBack-Bifnzxvs.js +0 -6430
- package/dist/ArrowBack-Bifnzxvs.js.map +0 -1
- package/dist/BreadCrumbs-DMuPCevY.js +0 -19
- package/dist/BreadCrumbs-DMuPCevY.js.map +0 -1
- package/dist/BreadCrumbs.css +0 -1
- package/dist/EnumSelectFilter-BdGla5Yf.js +0 -36
- package/dist/EnumSelectFilter-BdGla5Yf.js.map +0 -1
- package/dist/ExpandMore-DUn2zrFA.js +0 -1644
- package/dist/ExpandMore-DUn2zrFA.js.map +0 -1
- package/dist/FilterLink-DIeFjfZX.js +0 -49
- package/dist/FilterLink-DIeFjfZX.js.map +0 -1
- package/dist/JwtTokensRoute-C74zNV7A.js +0 -2374
- package/dist/JwtTokensRoute-C74zNV7A.js.map +0 -1
- package/dist/ScheduledTasksRoute-BAetDHqN.js +0 -611
- package/dist/ScheduledTasksRoute-BAetDHqN.js.map +0 -1
- package/dist/SingleLogMessageRoute-Dl2NFfqG.js +0 -419
- package/dist/SingleLogMessageRoute-Dl2NFfqG.js.map +0 -1
- package/dist/SingleMessageRoute-fC94BR1C.js +0 -306
- package/dist/SingleMessageRoute-fC94BR1C.js.map +0 -1
- package/dist/Table-DWiRP1za.js +0 -120
- package/dist/Table-DWiRP1za.js.map +0 -1
- package/dist/TextFilter-BHWY2B7i.js +0 -67
- package/dist/TextFilter-BHWY2B7i.js.map +0 -1
- package/dist/TriggerablesRoute-DiEEX1cR.js +0 -3552
- package/dist/TriggerablesRoute-DiEEX1cR.js.map +0 -1
- package/dist/api-BD_4zyJw.js +0 -38
- package/dist/api-BD_4zyJw.js.map +0 -1
- package/dist/breadcrumbs/index.js.map +0 -1
- package/dist/configuration-values/index.js.map +0 -1
- package/dist/control-values/index.js.map +0 -1
- package/dist/createSvgIcon-dA_Vj2W0.js +0 -3914
- package/dist/createSvgIcon-dA_Vj2W0.js.map +0 -1
- package/dist/exhaustiveValues-Dx50G3yz.js +0 -5
- package/dist/exhaustiveValues-Dx50G3yz.js.map +0 -1
- package/dist/filter/index.js.map +0 -1
- package/dist/formData-BH8saYep.js +0 -65
- package/dist/formData-BH8saYep.js.map +0 -1
- package/dist/jsx-runtime-D858t2LC.js +0 -617
- package/dist/jsx-runtime-D858t2LC.js.map +0 -1
- package/dist/jwt-tokens/index.js.map +0 -1
- package/dist/loader-CrveWlGb.js +0 -375
- package/dist/loader-CrveWlGb.js.map +0 -1
- package/dist/loader-D-oC32OJ.js +0 -3612
- package/dist/loader-D-oC32OJ.js.map +0 -1
- package/dist/loader-rVy8Z9xH.js +0 -130
- package/dist/loader-rVy8Z9xH.js.map +0 -1
- package/dist/main/index.js.map +0 -1
- package/dist/message-log/index.js.map +0 -1
- package/dist/message-sending/index.js.map +0 -1
- package/dist/message-targets/index.js.map +0 -1
- package/dist/pagination-Dy4ansKN.js +0 -21
- package/dist/pagination-Dy4ansKN.js.map +0 -1
- package/dist/scheduled-tasks/index.js.map +0 -1
- package/dist/schemas-CBHIJ_eF.js +0 -3059
- package/dist/schemas-CBHIJ_eF.js.map +0 -1
- package/dist/table/index.js.map +0 -1
- package/dist/triggerables/index.js.map +0 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { n as e, t } from "./Table-IciQttr3.js";
|
|
2
|
+
import { n, t as r } from "./pagination-C4QUYRMf.js";
|
|
3
|
+
import { useLoaderData as i, useNavigate as a, useSearchParams as o } from "react-router";
|
|
4
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { Box as u, Button as d, Paper as f, Table as p, TableBody as m, TableCell as h, TableContainer as g, TableRow as _, Typography as v } from "@mui/material";
|
|
6
|
+
//#region src/routes/control-values/controlValueColumns.tsx
|
|
7
|
+
var y = [
|
|
8
|
+
{
|
|
9
|
+
key: "id",
|
|
10
|
+
title: "ID",
|
|
11
|
+
minWidth: 100
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
key: "key",
|
|
15
|
+
title: "Key",
|
|
16
|
+
minWidth: 240
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: "value",
|
|
20
|
+
title: "Value",
|
|
21
|
+
minWidth: 360
|
|
22
|
+
}
|
|
23
|
+
], b = () => {
|
|
24
|
+
let r = a(), [u, d] = o(), f = i();
|
|
25
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(g, {
|
|
26
|
+
sx: { height: "calc(100vh - 130px)" },
|
|
27
|
+
children: /* @__PURE__ */ c(t, {
|
|
28
|
+
columns: y,
|
|
29
|
+
rows: f.content,
|
|
30
|
+
getRowId: (e) => String(e.id),
|
|
31
|
+
onRowClick: (e) => {
|
|
32
|
+
e.id !== void 0 && r(`./${e.id}`, { relative: "path" });
|
|
33
|
+
},
|
|
34
|
+
defaultFilter: {}
|
|
35
|
+
})
|
|
36
|
+
}), /* @__PURE__ */ c(e, {
|
|
37
|
+
page: f.number ?? 0,
|
|
38
|
+
rowsPerPage: f.size ?? 100,
|
|
39
|
+
total: f.totalElements ?? 0,
|
|
40
|
+
onPageChange: (e) => {
|
|
41
|
+
d(n(u, e));
|
|
42
|
+
}
|
|
43
|
+
})] });
|
|
44
|
+
}, x = () => {
|
|
45
|
+
let e = i(), t = a();
|
|
46
|
+
return /* @__PURE__ */ l(u, {
|
|
47
|
+
component: "section",
|
|
48
|
+
sx: {
|
|
49
|
+
p: 2,
|
|
50
|
+
maxWidth: 900
|
|
51
|
+
},
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ c(d, {
|
|
54
|
+
variant: "outlined",
|
|
55
|
+
onClick: () => t(-1),
|
|
56
|
+
children: "Back"
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ c(v, {
|
|
59
|
+
variant: "h4",
|
|
60
|
+
component: "h1",
|
|
61
|
+
sx: {
|
|
62
|
+
mt: 2,
|
|
63
|
+
mb: 2
|
|
64
|
+
},
|
|
65
|
+
children: "Control value"
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ c(g, {
|
|
68
|
+
component: f,
|
|
69
|
+
children: /* @__PURE__ */ c(p, {
|
|
70
|
+
size: "small",
|
|
71
|
+
children: /* @__PURE__ */ l(m, { children: [
|
|
72
|
+
/* @__PURE__ */ l(_, { children: [/* @__PURE__ */ c(h, {
|
|
73
|
+
component: "th",
|
|
74
|
+
scope: "row",
|
|
75
|
+
sx: { width: 180 },
|
|
76
|
+
children: "ID"
|
|
77
|
+
}), /* @__PURE__ */ c(h, { children: e.id ?? "" })] }),
|
|
78
|
+
/* @__PURE__ */ l(_, { children: [/* @__PURE__ */ c(h, {
|
|
79
|
+
component: "th",
|
|
80
|
+
scope: "row",
|
|
81
|
+
children: "Key"
|
|
82
|
+
}), /* @__PURE__ */ c(h, { children: e.key ?? "" })] }),
|
|
83
|
+
/* @__PURE__ */ l(_, { children: [/* @__PURE__ */ c(h, {
|
|
84
|
+
component: "th",
|
|
85
|
+
scope: "row",
|
|
86
|
+
children: "Value"
|
|
87
|
+
}), /* @__PURE__ */ c(h, { children: /* @__PURE__ */ c(u, {
|
|
88
|
+
component: "pre",
|
|
89
|
+
sx: {
|
|
90
|
+
m: 0,
|
|
91
|
+
whiteSpace: "pre-wrap",
|
|
92
|
+
wordBreak: "break-word"
|
|
93
|
+
},
|
|
94
|
+
children: e.value ?? ""
|
|
95
|
+
}) })] })
|
|
96
|
+
] })
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
}, S = async (e, t) => {
|
|
102
|
+
let n = await t.GET("/controlValue", { params: { query: {
|
|
103
|
+
page: e.page,
|
|
104
|
+
size: e.size,
|
|
105
|
+
sort: e.sort
|
|
106
|
+
} } });
|
|
107
|
+
if ("error" in n) throw Error(`Failed to fetch control values: ${n.response.status}`);
|
|
108
|
+
return {
|
|
109
|
+
...n.data,
|
|
110
|
+
content: n.data.content ?? []
|
|
111
|
+
};
|
|
112
|
+
}, C = async (e, t) => {
|
|
113
|
+
let n = await t.GET("/controlValue/{id}", { params: { path: { id: e } } });
|
|
114
|
+
if ("error" in n) throw Error(`Failed to fetch control value: ${n.response.status}`);
|
|
115
|
+
return n.data;
|
|
116
|
+
}, w = (e) => {
|
|
117
|
+
let t = r(e), n = e.getAll("sort");
|
|
118
|
+
return n.length && (t.sort = n), t;
|
|
119
|
+
}, T = (e) => async ({ request: t }) => {
|
|
120
|
+
try {
|
|
121
|
+
return await S(w(new URL(t.url).searchParams), e);
|
|
122
|
+
} catch (e) {
|
|
123
|
+
throw console.error(e), Error("Failed to fetch control values");
|
|
124
|
+
}
|
|
125
|
+
}, E = (e) => async ({ params: t }) => {
|
|
126
|
+
try {
|
|
127
|
+
if (!t.id) throw new Response("", {
|
|
128
|
+
status: 404,
|
|
129
|
+
statusText: "Not found"
|
|
130
|
+
});
|
|
131
|
+
let n = parseInt(t.id, 10);
|
|
132
|
+
if (isNaN(n)) throw new Response("", {
|
|
133
|
+
status: 404,
|
|
134
|
+
statusText: "Not found"
|
|
135
|
+
});
|
|
136
|
+
return await C(n, e);
|
|
137
|
+
} catch (e) {
|
|
138
|
+
throw console.error(e), e;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
export { x as a, S as i, E as n, b as o, C as r, T as t };
|
|
143
|
+
|
|
144
|
+
//# sourceMappingURL=control-values-CzQOB4WJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-values-CzQOB4WJ.js","names":[],"sources":["../src/routes/control-values/controlValueColumns.tsx","../src/routes/control-values/ControlValuesRoute.tsx","../src/routes/control-values/SingleControlValueRoute.tsx","../src/routes/control-values/api.ts","../src/routes/control-values/loader.ts"],"sourcesContent":["import type { ColumnDefinitions } from \"../../components/table/types\";\nimport type { ControlValue } from \"./api\";\n\nexport type ControlValueFilter = Partial<Record<keyof ControlValue, string>>;\n\nexport const controlValueColumns: ColumnDefinitions<ControlValue, ControlValueFilter> = [\n {\n key: \"id\",\n title: \"ID\",\n minWidth: 100,\n },\n {\n key: \"key\",\n title: \"Key\",\n minWidth: 240,\n },\n {\n key: \"value\",\n title: \"Value\",\n minWidth: 360,\n },\n];\n","import { TableContainer } from \"@mui/material\";\nimport { useLoaderData, useNavigate, useSearchParams } from \"react-router\";\nimport { getSearchParamsWithPage } from \"../../common/pagination\";\nimport { Pagination } from \"../../components/table/Pagination\";\nimport { Table } from \"../../components/table/Table\";\nimport { controlValueColumns } from \"./controlValueColumns\";\nimport type { ControlValuesLoader } from \"./loader\";\n\nconst ControlValuesRoute = () => {\n const navigate = useNavigate();\n const [searchParams, setSearchParams] = useSearchParams();\n const controlValuesPage = useLoaderData<ControlValuesLoader>();\n\n return (\n <>\n <TableContainer sx={{ height: \"calc(100vh - 130px)\" }}>\n <Table\n columns={controlValueColumns}\n rows={controlValuesPage.content}\n getRowId={(row) => String(row.id)}\n onRowClick={(row) => {\n if (row.id !== undefined) {\n navigate(`./${row.id}`, { relative: \"path\" });\n }\n }}\n defaultFilter={{}}\n />\n </TableContainer>\n <Pagination\n page={controlValuesPage.number ?? 0}\n rowsPerPage={controlValuesPage.size ?? 100}\n total={controlValuesPage.totalElements ?? 0}\n onPageChange={(page) => {\n setSearchParams(getSearchParamsWithPage(searchParams, page));\n }}\n />\n </>\n );\n};\n\nexport default ControlValuesRoute;\n","import {\n Box,\n Button,\n Paper,\n Table as MuiTable,\n TableBody,\n TableCell,\n TableContainer,\n TableRow,\n Typography,\n} from \"@mui/material\";\nimport { useLoaderData, useNavigate } from \"react-router\";\nimport type { SingleControlValueLoader } from \"./loader\";\n\nconst SingleControlValueRoute = () => {\n const controlValue = useLoaderData<SingleControlValueLoader>();\n const navigate = useNavigate();\n\n return (\n <Box component=\"section\" sx={{ p: 2, maxWidth: 900 }}>\n <Button variant=\"outlined\" onClick={() => navigate(-1)}>\n Back\n </Button>\n <Typography variant=\"h4\" component=\"h1\" sx={{ mt: 2, mb: 2 }}>\n Control value\n </Typography>\n <TableContainer component={Paper}>\n <MuiTable size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" sx={{ width: 180 }}>\n ID\n </TableCell>\n <TableCell>{controlValue.id ?? \"\"}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\">\n Key\n </TableCell>\n <TableCell>{controlValue.key ?? \"\"}</TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\">\n Value\n </TableCell>\n <TableCell>\n <Box component=\"pre\" sx={{ m: 0, whiteSpace: \"pre-wrap\", wordBreak: \"break-word\" }}>\n {controlValue.value ?? \"\"}\n </Box>\n </TableCell>\n </TableRow>\n </TableBody>\n </MuiTable>\n </TableContainer>\n </Box>\n );\n};\n\nexport default SingleControlValueRoute;\n","import type { ApiClient } from \"../../client\";\nimport type { components, paths } from \"../../types/openapiTypes\";\n\ntype ControlValueListQuery = paths[\"/controlValue\"][\"get\"][\"parameters\"][\"query\"];\n\nexport type ControlValue = components[\"schemas\"][\"ControlValue\"];\nexport type ControlValuePageFilter = Pick<ControlValueListQuery, \"page\" | \"size\" | \"sort\">;\n\nexport const fetchControlValues = async (filter: ControlValuePageFilter, client: ApiClient) => {\n const result = await client.GET(\"/controlValue\", {\n params: {\n query: {\n page: filter.page,\n size: filter.size,\n sort: filter.sort,\n },\n },\n });\n\n if (\"error\" in result) {\n throw new Error(`Failed to fetch control values: ${result.response.status}`);\n }\n\n return {\n ...result.data,\n content: result.data.content ?? [],\n };\n};\n\nexport const fetchControlValueById = async (id: number, client: ApiClient) => {\n const result = await client.GET(\"/controlValue/{id}\", {\n params: {\n path: { id },\n },\n });\n\n if (\"error\" in result) {\n throw new Error(`Failed to fetch control value: ${result.response.status}`);\n }\n\n return result.data;\n};\n","import type { LoaderFunctionArgs } from \"react-router\";\nimport type { ApiClient } from \"../../client\";\nimport { getPagingValuesFromSearchParams } from \"../../common/pagination\";\nimport type { ControlValuePageFilter } from \"./api\";\nimport { fetchControlValueById, fetchControlValues } from \"./api\";\n\nexport const getControlValuePageFilterFromSearchParams = (\n searchParams: URLSearchParams,\n): ControlValuePageFilter => {\n const filter: ControlValuePageFilter = getPagingValuesFromSearchParams(searchParams);\n\n const sort = searchParams.getAll(\"sort\");\n if (sort.length) {\n filter.sort = sort;\n }\n\n return filter;\n};\n\nexport const getControlValuesLoader =\n (client: ApiClient) =>\n async ({ request }: LoaderFunctionArgs) => {\n try {\n const requestUrl = new URL(request.url);\n const filter = getControlValuePageFilterFromSearchParams(requestUrl.searchParams);\n\n return await fetchControlValues(filter, client);\n } catch (error) {\n console.error(error);\n throw new Error(\"Failed to fetch control values\");\n }\n };\n\nexport type ControlValuesLoader = ReturnType<typeof getControlValuesLoader>;\n\nexport const getSingleControlValueLoader =\n (client: ApiClient) =>\n async ({ params }: LoaderFunctionArgs) => {\n try {\n if (!params.id) {\n throw new Response(\"\", {\n status: 404,\n statusText: \"Not found\",\n });\n }\n\n const id = parseInt(params.id, 10);\n\n if (isNaN(id)) {\n throw new Response(\"\", {\n status: 404,\n statusText: \"Not found\",\n });\n }\n\n return await fetchControlValueById(id, client);\n } catch (error) {\n console.error(error);\n throw error;\n }\n };\n\nexport type SingleControlValueLoader = ReturnType<typeof getSingleControlValueLoader>;\n"],"mappings":";;;;;;AAKA,IAAa,IAA2E;CACtF;EACE,KAAK;EACL,OAAO;EACP,UAAU;CACZ;CACA;EACE,KAAK;EACL,OAAO;EACP,UAAU;CACZ;CACA;EACE,KAAK;EACL,OAAO;EACP,UAAU;CACZ;AACF,GCbM,UAA2B;CAC/B,IAAM,IAAW,EAAY,GACvB,CAAC,GAAc,KAAmB,EAAgB,GAClD,IAAoB,EAAmC;CAE7D,OACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EAAgB,IAAI,EAAE,QAAQ,sBAAsB;YAClD,kBAAC,GAAD;GACE,SAAS;GACT,MAAM,EAAkB;GACxB,WAAW,MAAQ,OAAO,EAAI,EAAE;GAChC,aAAa,MAAQ;IACnB,AAAI,EAAI,OAAO,KAAA,KACb,EAAS,KAAK,EAAI,MAAM,EAAE,UAAU,OAAO,CAAC;GAEhD;GACA,eAAe,CAA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AAsB,GAAI,CAAM;CAC/C,SAAS,GAAO;EAEd,MADA,QAAQ,MAAM,CAAK,GACb;CACR;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exhaustiveValues-BYWkg9M1.js","names":[],"sources":["../src/common/exhaustiveValues.ts"],"sourcesContent":["type MissingValues<T extends string, Values extends readonly T[]> =\n Exclude<T, Values[number]> extends never\n ? unknown\n : { readonly missingValues: Exclude<T, Values[number]> };\n\nexport const exhaustiveStringValues =\n <T extends string>() =>\n <const Values extends readonly [T, ...T[]]>(values: Values & MissingValues<T, Values>): Values =>\n values;\n"],"mappings":";AAKA,IAAa,WAEiC,MAC1C"}
|
package/dist/filter/index.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
t as EnumSelectFilter,
|
|
6
|
-
o as FilterHelperTexts,
|
|
7
|
-
s as FilterLink,
|
|
8
|
-
F as TextFilter
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { n as e, t } from "../TextFilter-CLOKjiSd.js";
|
|
2
|
+
import { t as n } from "../EnumSelectFilter-DDWIjz5i.js";
|
|
3
|
+
import { t as r } from "../FilterLink-OxQDWR5G.js";
|
|
4
|
+
export { n as EnumSelectFilter, e as FilterHelperTexts, r as FilterLink, t as TextFilter };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { a as e, n as t, o as n } from "./schemas-D-8_LuND.js";
|
|
2
|
+
//#region src/common/formData.ts
|
|
3
|
+
var r = (e) => ({
|
|
4
|
+
ok: !0,
|
|
5
|
+
value: e
|
|
6
|
+
}), i = (e) => ({
|
|
7
|
+
ok: !1,
|
|
8
|
+
message: e
|
|
9
|
+
}), a = (t) => e().trim().min(1, { message: `${t} is required` }), o = e().optional().default(""), s = (t) => e().trim().regex(/^-?\d+$/, { message: `${t} must be an integer` }).transform((e) => Number.parseInt(e, 10)), c = (t) => e().trim().refine((e) => e === "" || /^-?\d+$/.test(e), { message: `${t} must be an integer` }).transform((e) => e === "" ? void 0 : Number.parseInt(e, 10)), l = (e, n) => t((e) => typeof e == "string" && n.some((t) => t === e), { message: `${e} must be one of the listed options` }), u = (t) => e().transform((e, r) => {
|
|
10
|
+
if (!e.trim()) return {};
|
|
11
|
+
try {
|
|
12
|
+
let i = JSON.parse(e);
|
|
13
|
+
return !i || typeof i != "object" || Array.isArray(i) ? (r.addIssue({
|
|
14
|
+
code: "custom",
|
|
15
|
+
message: `${t} must be a JSON object`
|
|
16
|
+
}), n) : Object.fromEntries(Object.entries(i).map(([e, t]) => [e, String(t)]));
|
|
17
|
+
} catch {
|
|
18
|
+
return r.addIssue({
|
|
19
|
+
code: "custom",
|
|
20
|
+
message: `${t} must be valid JSON`
|
|
21
|
+
}), n;
|
|
22
|
+
}
|
|
23
|
+
}), d = (e, t) => {
|
|
24
|
+
let n = e.get(t);
|
|
25
|
+
return typeof n == "string" ? n : "";
|
|
26
|
+
}, f = (e) => Object.fromEntries(Array.from(e.entries()).flatMap(([e, t]) => typeof t == "string" ? [[e, t]] : [])), p = (e, t, n) => {
|
|
27
|
+
let a = t.safeParse(f(e));
|
|
28
|
+
return a.success ? r(a.data) : i(a.error.issues[0]?.message ?? n);
|
|
29
|
+
}, m = (e, t) => d(e, t).trim(), h = (e, t, n) => {
|
|
30
|
+
let a = m(e, t);
|
|
31
|
+
if (!a) return r(void 0);
|
|
32
|
+
let o = s(n).safeParse(a);
|
|
33
|
+
return o.success ? r(o.data) : i(`${n} must be an integer`);
|
|
34
|
+
}, g = (e, t, n) => {
|
|
35
|
+
let a = m(e, t);
|
|
36
|
+
if (!a) return i(`${n} is required`);
|
|
37
|
+
let o = s(n).safeParse(a);
|
|
38
|
+
return o.success ? r(o.data) : i(`${n} must be an integer`);
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { s as a, p as c, d as i, a as l, h as n, c as o, g as r, o as s, l as t, u };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=formData-BO275hRZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formData-BO275hRZ.js","names":[],"sources":["../src/common/formData.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport type FormDataParseResult<T> =\n | {\n ok: true;\n value: T;\n }\n | {\n ok: false;\n message: string;\n };\n\nexport const formDataParseSuccess = <T>(value: T): FormDataParseResult<T> => ({\n ok: true,\n value,\n});\n\nexport const formDataParseError = <T>(message: string): FormDataParseResult<T> => ({\n ok: false,\n message,\n});\n\nexport const requiredStringFormSchema = (label: string) =>\n z\n .string()\n .trim()\n .min(1, { message: `${label} is required` });\n\nexport const optionalStringFormSchema = z.string().optional().default(\"\");\n\nexport const integerFormSchema = (label: string) =>\n z\n .string()\n .trim()\n .regex(/^-?\\d+$/, { message: `${label} must be an integer` })\n .transform((value) => Number.parseInt(value, 10));\n\nexport const optionalIntegerFormSchema = (label: string) =>\n z\n .string()\n .trim()\n .refine((value) => value === \"\" || /^-?\\d+$/.test(value), {\n message: `${label} must be an integer`,\n })\n .transform((value) => (value === \"\" ? undefined : Number.parseInt(value, 10)));\n\nexport const enumFormSchema = <T extends string>(\n label: string,\n values: readonly T[],\n): z.ZodType<T> =>\n z.custom<T>(\n (candidate): candidate is T =>\n typeof candidate === \"string\" && values.some((enumValue) => enumValue === candidate),\n { message: `${label} must be one of the listed options` },\n );\n\nexport const stringRecordJsonFormSchema = (label: string) =>\n z.string().transform((value, context): Record<string, string> => {\n if (!value.trim()) {\n return {};\n }\n\n try {\n const parsed: unknown = JSON.parse(value);\n\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n context.addIssue({\n code: \"custom\",\n message: `${label} must be a JSON object`,\n });\n return z.NEVER;\n }\n\n return Object.fromEntries(\n Object.entries(parsed).map(([key, propertyValue]) => [key, String(propertyValue)]),\n );\n } catch {\n context.addIssue({\n code: \"custom\",\n message: `${label} must be valid JSON`,\n });\n return z.NEVER;\n }\n });\n\nexport const getStringFormValue = (formData: FormData, name: string): string => {\n const value = formData.get(name);\n return typeof value === \"string\" ? value : \"\";\n};\n\nconst getFormDataStringRecord = (formData: FormData): Record<string, string> =>\n Object.fromEntries(\n Array.from(formData.entries()).flatMap(([key, value]) =>\n typeof value === \"string\" ? [[key, value]] : [],\n ),\n );\n\nexport const parseFormDataWithSchema = <T>(\n formData: FormData,\n schema: z.ZodType<T>,\n defaultMessage: string,\n): FormDataParseResult<T> => {\n const result = schema.safeParse(getFormDataStringRecord(formData));\n\n return result.success\n ? formDataParseSuccess(result.data)\n : formDataParseError(result.error.issues[0]?.message ?? defaultMessage);\n};\n\nconst getTrimmedStringFormValue = (formData: FormData, name: string): string =>\n getStringFormValue(formData, name).trim();\n\nexport const getOptionalIntFormValue = (\n formData: FormData,\n name: string,\n label: string,\n): FormDataParseResult<number | undefined> => {\n const value = getTrimmedStringFormValue(formData, name);\n\n if (!value) {\n return formDataParseSuccess(undefined);\n }\n\n const result = integerFormSchema(label).safeParse(value);\n\n if (!result.success) {\n return formDataParseError(`${label} must be an integer`);\n }\n\n return formDataParseSuccess(result.data);\n};\n\nexport const getRequiredIntFormValue = (\n formData: FormData,\n name: string,\n label: string,\n): FormDataParseResult<number> => {\n const value = getTrimmedStringFormValue(formData, name);\n\n if (!value) {\n return formDataParseError(`${label} is required`);\n }\n\n const result = integerFormSchema(label).safeParse(value);\n\n if (!result.success) {\n return formDataParseError(`${label} must be an integer`);\n }\n\n return formDataParseSuccess(result.data);\n};\n"],"mappings":";;AAYA,IAAa,KAA2B,OAAsC;CAC5E,IAAI;CACJ;AACF,IAEa,KAAyB,OAA6C;CACjF,IAAI;CACJ;AACF,IAEa,KAA4B,MACvC,EACU,EACP,KAAK,EACL,IAAI,GAAG,EAAE,SAAS,GAAG,EAAM,cAAc,CAAC,GAElC,IAA2B,EAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAE3D,KAAqB,MAChC,EAC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,MAC2B;CAC3B,IAAM,IAAS,EAAO,UAAU,EAAwB,CAAQ,CAAC;CAEjE,OAAO,EAAO,UACV,EAAqB,EAAO,IAAI,IAChC,EAAmB,EAAO,MAAM,OAAO,IAAI,WAAW,CAAc;AAC1E,GAEM,KAA6B,GAAoB,MACrD,EAAmB,GAAU,CAAI,EAAE,KAAK,GAE7B,KACX,GACA,GACA,MAC4C;CAC5C,IAAM,IAAQ,EAA0B,GAAU,CAAI;CAEtD,IAAI,CAAC,GACH,OAAO,EAAqB,KAAA,CAAS;CAGvC,IAAM,IAAS,EAAkB,CAAK,EAAE,UAAU,CAAK;CAMvD,OAJK,EAAO,UAIL,EAAqB,EAAO,IAAI,IAH9B,EAAmB,GAAG,EAAM,oBAAoB;AAI3D,GAEa,KACX,GACA,GACA,MACgC;CAChC,IAAM,IAAQ,EAA0B,GAAU,CAAI;CAEtD,IAAI,CAAC,GACH,OAAO,EAAmB,GAAG,EAAM,aAAa;CAGlD,IAAM,IAAS,EAAkB,CAAK,EAAE,UAAU,CAAK;CAMvD,OAJK,EAAO,UAIL,EAAqB,EAAO,IAAI,IAH9B,EAAmB,GAAG,EAAM,oBAAoB;AAI3D"}
|
package/dist/jwt-tokens/index.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
t as JwtTokensRoute,
|
|
4
|
-
o as deleteJwtToken,
|
|
5
|
-
a as fetchJwtTokens,
|
|
6
|
-
J as getJwtTokensLoader,
|
|
7
|
-
k as saveJwtToken
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "../jwt-tokens-DnKsHei4.js";
|
|
2
|
+
export { i as JwtTokensRoute, r as deleteJwtToken, t as fetchJwtTokens, n as getJwtTokensLoader, e as saveJwtToken };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { n as e, t } from "./pagination-C4QUYRMf.js";
|
|
2
|
+
import { useLoaderData as n, useNavigation as r, useRevalidator as i, useSearchParams as a } from "react-router";
|
|
3
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
+
import { useState as s } from "react";
|
|
5
|
+
import { JwtComponent as c } from "@evolver-fi/evolver-basics/jwt";
|
|
6
|
+
//#region src/routes/jwt-tokens/api.ts
|
|
7
|
+
var l = async (e, t) => {
|
|
8
|
+
let n = await t.GET("/jwt", { params: { query: {
|
|
9
|
+
page: e.page,
|
|
10
|
+
size: e.size
|
|
11
|
+
} } });
|
|
12
|
+
if ("error" in n) throw Error(`Failed to fetch JWT tokens: ${n.response.status}`);
|
|
13
|
+
return {
|
|
14
|
+
...n.data,
|
|
15
|
+
content: n.data.content ?? []
|
|
16
|
+
};
|
|
17
|
+
}, u = async (e, t) => {
|
|
18
|
+
let { error: n, response: r } = await t.POST("/jwt", { body: e });
|
|
19
|
+
if (n) throw Error(`Failed to save JWT token: ${r.status}`);
|
|
20
|
+
}, d = async (e, t) => {
|
|
21
|
+
let { error: n, response: r } = await t.POST("/jwt/{id}/delete", { params: { path: { id: e } } });
|
|
22
|
+
if (n) throw Error(`Failed to delete JWT token: ${r.status}`);
|
|
23
|
+
}, f = (e) => async ({ request: n }) => {
|
|
24
|
+
try {
|
|
25
|
+
return await l(t(new URL(n.url).searchParams), e);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
throw console.error(e), Error("Failed to fetch");
|
|
28
|
+
}
|
|
29
|
+
}, p = ({ client: t }) => {
|
|
30
|
+
let [l, f] = s(void 0), [p, m] = s("uninitialized"), [h, g] = s("uninitialized"), [_, v] = a(), y = r(), b = i(), x = n();
|
|
31
|
+
if (!x) return "Loading...";
|
|
32
|
+
let { content: S, number: C, totalPages: w } = x, T = async (e) => {
|
|
33
|
+
try {
|
|
34
|
+
m("loading"), await d(e, t), m("success");
|
|
35
|
+
} catch {
|
|
36
|
+
m("error");
|
|
37
|
+
}
|
|
38
|
+
b.revalidate();
|
|
39
|
+
}, E = async (e) => {
|
|
40
|
+
try {
|
|
41
|
+
g("loading"), await u(e, t), g("success");
|
|
42
|
+
} catch {
|
|
43
|
+
g("error");
|
|
44
|
+
}
|
|
45
|
+
b.revalidate();
|
|
46
|
+
}, D = (t) => {
|
|
47
|
+
v(e(_, t));
|
|
48
|
+
}, O = (e, t) => {
|
|
49
|
+
f(e ? t : void 0), m("uninitialized"), g("uninitialized");
|
|
50
|
+
}, k = {
|
|
51
|
+
onTokenDelete: T,
|
|
52
|
+
onTokenSave: E,
|
|
53
|
+
deleteStatus: p,
|
|
54
|
+
saveStatus: h
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ o(c, {
|
|
57
|
+
tokens: S ?? [],
|
|
58
|
+
isLoading: y.state !== "idle",
|
|
59
|
+
isError: !1,
|
|
60
|
+
openTokenId: l,
|
|
61
|
+
tokenOperations: k,
|
|
62
|
+
page: C,
|
|
63
|
+
totalNumberOfPages: w,
|
|
64
|
+
onPageChange: D,
|
|
65
|
+
onExpandedChange: O
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { u as a, l as i, f as n, d as r, p as t };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=jwt-tokens-DnKsHei4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-tokens-DnKsHei4.js","names":[],"sources":["../src/routes/jwt-tokens/api.ts","../src/routes/jwt-tokens/loader.ts","../src/routes/jwt-tokens/JwtTokensRoute.tsx"],"sourcesContent":["import type { ApiClient } from \"../../client\";\nimport type { paths } from \"../../types/openapiTypes\";\n\ntype JwtListQuery = NonNullable<paths[\"/jwt\"][\"get\"]>[\"parameters\"][\"query\"];\ntype JwtTokenRequest = NonNullable<\n paths[\"/jwt\"][\"post\"]\n>[\"requestBody\"][\"content\"][\"application/json\"];\n\nexport type JwtTokensPageFilter = Pick<JwtListQuery, \"page\" | \"size\">;\n\nexport const fetchJwtTokens = async (filter: JwtTokensPageFilter, client: ApiClient) => {\n const result = await client.GET(\"/jwt\", {\n params: {\n query: {\n page: filter.page,\n size: filter.size,\n },\n },\n });\n\n if (\"error\" in result) {\n throw new Error(`Failed to fetch JWT tokens: ${result.response.status}`);\n }\n\n return {\n ...result.data,\n content: result.data.content ?? [],\n };\n};\n\nexport const saveJwtToken = async (token: JwtTokenRequest, client: ApiClient): Promise<void> => {\n const { error, response } = await client.POST(\"/jwt\", {\n body: token,\n });\n\n if (error) {\n throw new Error(`Failed to save JWT token: ${response.status}`);\n }\n};\n\nexport const deleteJwtToken = async (tokenId: number, client: ApiClient): Promise<void> => {\n const { error, response } = await client.POST(\"/jwt/{id}/delete\", {\n params: {\n path: { id: tokenId },\n },\n });\n\n if (error) {\n throw new Error(`Failed to delete JWT token: ${response.status}`);\n }\n};\n","import type { LoaderFunctionArgs } from \"react-router\";\nimport { fetchJwtTokens } from \"./api\";\nimport type { ApiClient } from \"../../client\";\nimport { getPagingValuesFromSearchParams } from \"../../common/pagination\";\n\nexport const getJwtTokensLoader =\n (client: ApiClient) =>\n async ({ request }: LoaderFunctionArgs) => {\n try {\n const requestUrl = new URL(request.url);\n const filter = getPagingValuesFromSearchParams(requestUrl.searchParams);\n\n return await fetchJwtTokens(filter, client);\n } catch (error) {\n console.error(error);\n throw new Error(\"Failed to fetch\");\n }\n };\n","import type {\n JwtToken,\n JwtTokenResponse,\n TokenOperations,\n TokenOperationState,\n} from \"@evolver-fi/evolver-basics/jwt\";\nimport { JwtComponent } from \"@evolver-fi/evolver-basics/jwt\";\nimport { useState } from \"react\";\nimport { deleteJwtToken, saveJwtToken } from \"./api\";\nimport type { ApiClient } from \"../../client\";\nimport { useLoaderData, useNavigation, useRevalidator, useSearchParams } from \"react-router\";\nimport { getSearchParamsWithPage } from \"../../common/pagination\";\n\ntype JwtTokensRouteProps = {\n client: ApiClient;\n};\n\nconst JwtTokensRoute = ({ client }: JwtTokensRouteProps) => {\n const [openTokenId, setOpenTokenId] = useState<number | \"new\" | undefined>(undefined);\n const [deleteStatus, setDeleteStatus] = useState<TokenOperationState>(\"uninitialized\");\n const [saveStatus, setSaveStatus] = useState<TokenOperationState>(\"uninitialized\");\n\n const [searchParams, setSearchParams] = useSearchParams();\n const navigation = useNavigation();\n const revalidator = useRevalidator();\n const jwtData = useLoaderData() as JwtTokenResponse; // TODO: cast to <typeof [loader]> later\n\n if (!jwtData) return \"Loading...\";\n\n const { content, number, totalPages } = jwtData;\n\n const handleTokenDelete = async (tokenId: number) => {\n try {\n setDeleteStatus(\"loading\");\n await deleteJwtToken(tokenId, client);\n setDeleteStatus(\"success\");\n } catch {\n setDeleteStatus(\"error\");\n }\n\n revalidator.revalidate();\n };\n\n const handleTokenSave = async (token: JwtToken) => {\n try {\n setSaveStatus(\"loading\");\n await saveJwtToken(token, client);\n setSaveStatus(\"success\");\n } catch {\n setSaveStatus(\"error\");\n }\n revalidator.revalidate();\n };\n\n const handlePageChange = (value: number) => {\n setSearchParams(getSearchParamsWithPage(searchParams, value));\n };\n\n const handleTokenExpandedChange = (isExpanded: boolean, tokenId: number | \"new\" | undefined) => {\n if (isExpanded) {\n setOpenTokenId(tokenId);\n } else {\n setOpenTokenId(undefined);\n }\n\n setDeleteStatus(\"uninitialized\");\n setSaveStatus(\"uninitialized\");\n };\n\n // TODO: right now the status states are shared between all tokens. Differentiate between them or reset when changing token\n const tokenOperations: TokenOperations = {\n onTokenDelete: handleTokenDelete,\n onTokenSave: handleTokenSave,\n deleteStatus: deleteStatus,\n saveStatus: saveStatus,\n };\n\n return (\n <JwtComponent\n tokens={content ?? []}\n isLoading={navigation.state !== \"idle\"}\n isError={false}\n openTokenId={openTokenId}\n tokenOperations={tokenOperations}\n page={number}\n totalNumberOfPages={totalPages}\n onPageChange={handlePageChange}\n onExpandedChange={handleTokenExpandedChange}\n />\n );\n};\n\nexport default JwtTokensRoute;\n"],"mappings":";;;;;;AAUA,IAAa,IAAiB,OAAO,GAA6B,MAAsB;CACtF,IAAM,IAAS,MAAM,EAAO,IAAI,QAAQ,E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S;EAC3B,QAAQ;GACN,EAAgB,OAAO;EACzB;EAEA,EAAY,WAAW;CACzB,GAEM,IAAkB,OAAO,MAAoB;EACjD,IAAI;GAGF,AAFA,EAAc,SAAS,GACvB,MAAM,EAAa,GAAO,CAAM,GAChC,EAAc,SAAS;EACzB,QAAQ;GACN,EAAc,OAAO;EACvB;EACA,EAAY,WAAW;CACzB,GAEM,KAAoB,MAAkB;EAC1C,EAAgB,EAAwB,GAAc,CAAK,CAAC;CAC9D,GAEM,KAA6B,GAAqB,MAAwC;EAQ9F,AANE,EADE,IACa,IAEA,KAAA,CAAS,GAG1B,EAAgB,eAAe,GAC/B,EAAc,eAAe;CAC/B,GAGM,IAAmC;EACvC,eAAe;EACf,aAAa;EACC;EACF;CACd;CAEA,OACE,kBAAC,GAAD;EACE,QAAQ,KAAW,CAAC;EACpB,WAAW,EAAW,UAAU;EAChC,SAAS;EACI;EACI;EACjB,MAAM;EACN,oBAAoB;EACpB,cAAc;EACd,kBAAkB;CACnB,CAAA;AAEL"}
|
package/dist/main/index.js
CHANGED
|
@@ -1,87 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { f as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
h as ConfigurationValuesRoute,
|
|
19
|
-
V as ControlValuesRoute,
|
|
20
|
-
o as EnumSelectFilter,
|
|
21
|
-
r as FilterHelperTexts,
|
|
22
|
-
u as FilterLink,
|
|
23
|
-
w as JwtTokensRoute,
|
|
24
|
-
H as MessageLogListRoute,
|
|
25
|
-
oe as MessageSendingRoute,
|
|
26
|
-
O as MessageTargetFormRoute,
|
|
27
|
-
Q as MessageTargetsRoute,
|
|
28
|
-
n as Pagination,
|
|
29
|
-
ne as ScheduledTaskFormRoute,
|
|
30
|
-
fe as ScheduledTasksRoute,
|
|
31
|
-
R as SingleControlValueRoute,
|
|
32
|
-
U as SingleMessageLogRoute,
|
|
33
|
-
ge as SingleMessageRoute,
|
|
34
|
-
f as Table,
|
|
35
|
-
d as TextFilter,
|
|
36
|
-
Ve as TriggerablesRoute,
|
|
37
|
-
W as createMessageTarget,
|
|
38
|
-
M as deleteConfigurationValue,
|
|
39
|
-
A as deleteJwtToken,
|
|
40
|
-
X as deleteMessageTarget,
|
|
41
|
-
Te as deleteScheduledTask,
|
|
42
|
-
j as downloadLogBody,
|
|
43
|
-
Be as fetchActiveTaskStatuses,
|
|
44
|
-
S as fetchConfigurationValueById,
|
|
45
|
-
L as fetchConfigurationValues,
|
|
46
|
-
b as fetchControlValueById,
|
|
47
|
-
F as fetchControlValues,
|
|
48
|
-
J as fetchJwtTokens,
|
|
49
|
-
re as fetchMessageById,
|
|
50
|
-
q as fetchMessageLogById,
|
|
51
|
-
z as fetchMessageLogs,
|
|
52
|
-
Y as fetchMessageTargetById,
|
|
53
|
-
Z as fetchMessageTargets,
|
|
54
|
-
de as fetchMessages,
|
|
55
|
-
ce as fetchScheduledTaskById,
|
|
56
|
-
he as fetchScheduledTasks,
|
|
57
|
-
ye as fetchTriggerables,
|
|
58
|
-
m as getConfigurationValueAction,
|
|
59
|
-
k as getConfigurationValueFormLoader,
|
|
60
|
-
C as getConfigurationValuesLoader,
|
|
61
|
-
B as getControlValuesLoader,
|
|
62
|
-
_ as getInitialMessageTarget,
|
|
63
|
-
v as getJwtTokensLoader,
|
|
64
|
-
D as getLogBodyUrl,
|
|
65
|
-
le as getMessageListLoader,
|
|
66
|
-
G as getMessageLogLoader,
|
|
67
|
-
$ as getMessageTargetAction,
|
|
68
|
-
ee as getMessageTargetFormLoader,
|
|
69
|
-
ae as getMessageTargetsLoader,
|
|
70
|
-
Me as getScheduledTaskFormAction,
|
|
71
|
-
Se as getScheduledTasksAction,
|
|
72
|
-
Le as getScheduledTasksLoader,
|
|
73
|
-
y as getSingleControlValueLoader,
|
|
74
|
-
K as getSingleLogMessageLoader,
|
|
75
|
-
ue as getSingleMessageLoader,
|
|
76
|
-
me as getSingleTaskLoader,
|
|
77
|
-
Re as getTriggerablesAction,
|
|
78
|
-
be as getTriggerablesLoader,
|
|
79
|
-
ke as runScheduledTask,
|
|
80
|
-
p as saveConfigurationValue,
|
|
81
|
-
E as saveJwtToken,
|
|
82
|
-
Ce as saveScheduledTask,
|
|
83
|
-
Ie as triggerTriggerable,
|
|
84
|
-
se as updateMessageTarget,
|
|
85
|
-
pe as updateScheduledTaskState
|
|
86
|
-
};
|
|
87
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { t as e } from "../breadcrumbs-BAwnKRxL.js";
|
|
2
|
+
import { n as t, t as n } from "../TextFilter-CLOKjiSd.js";
|
|
3
|
+
import { t as r } from "../EnumSelectFilter-DDWIjz5i.js";
|
|
4
|
+
import { t as i } from "../FilterLink-OxQDWR5G.js";
|
|
5
|
+
import "../filter/index.js";
|
|
6
|
+
import { n as a, t as o } from "../Table-IciQttr3.js";
|
|
7
|
+
import "../table/index.js";
|
|
8
|
+
import { a as s, c, i as l, l as u, n as d, o as f, r as p, s as m, t as h } from "../configuration-values-CjOfmPRq.js";
|
|
9
|
+
import { a as g, i as _, n as v, o as y, r as b, t as x } from "../control-values-CzQOB4WJ.js";
|
|
10
|
+
import { a as S, i as C, n as w, r as T, t as E } from "../jwt-tokens-DnKsHei4.js";
|
|
11
|
+
import { a as D, c as O, i as k, n as A, o as j, r as M, s as N, t as P } from "../message-log-BdrJtbsP.js";
|
|
12
|
+
import { a as F, c as I, d as L, i as R, l as z, n as B, o as V, r as H, s as U, t as W, u as G } from "../message-targets-8EppIJde.js";
|
|
13
|
+
import { a as K, i as q, n as J, o as Y, r as X, t as Z } from "../message-sending-dvTw2fFm.js";
|
|
14
|
+
import { a as Q, c as $, d as ee, f as te, i as ne, l as re, n as ie, o as ae, r as oe, s as se, t as ce, u as le } from "../scheduled-tasks-BtBnBrE7.js";
|
|
15
|
+
import { n as ue, r as de, t as fe } from "../api-CMiZYkfc.js";
|
|
16
|
+
import { n as pe, r as me, t as he } from "../triggerables-DgrIeQMi.js";
|
|
17
|
+
export { e as BreadCrumbs, u as ConfigurationValueFormRoute, c as ConfigurationValuesRoute, y as ControlValuesRoute, r as EnumSelectFilter, t as FilterHelperTexts, i as FilterLink, E as JwtTokensRoute, A as MessageLogListRoute, J as MessageSendingRoute, V as MessageTargetFormRoute, F as MessageTargetsRoute, a as Pagination, ie as ScheduledTaskFormRoute, ce as ScheduledTasksRoute, g as SingleControlValueRoute, P as SingleMessageLogRoute, Z as SingleMessageRoute, o as Table, n as TextFilter, he as TriggerablesRoute, U as createMessageTarget, l as deleteConfigurationValue, T as deleteJwtToken, I as deleteMessageTarget, se as deleteScheduledTask, D as downloadLogBody, fe as fetchActiveTaskStatuses, s as fetchConfigurationValueById, f as fetchConfigurationValues, b as fetchControlValueById, _ as fetchControlValues, C as fetchJwtTokens, K as fetchMessageById, j as fetchMessageLogById, N as fetchMessageLogs, z as fetchMessageTargetById, G as fetchMessageTargets, Y as fetchMessages, $ as fetchScheduledTaskById, re as fetchScheduledTasks, ue as fetchTriggerables, p as getConfigurationValueAction, h as getConfigurationValueFormLoader, d as getConfigurationValuesLoader, x as getControlValuesLoader, W as getInitialMessageTarget, w as getJwtTokensLoader, O as getLogBodyUrl, X as getMessageListLoader, M as getMessageLogLoader, R as getMessageTargetAction, B as getMessageTargetFormLoader, H as getMessageTargetsLoader, Q as getScheduledTaskFormAction, ae as getScheduledTasksAction, oe as getScheduledTasksLoader, v as getSingleControlValueLoader, k as getSingleLogMessageLoader, q as getSingleMessageLoader, ne as getSingleTaskLoader, me as getTriggerablesAction, pe as getTriggerablesLoader, le as runScheduledTask, m as saveConfigurationValue, S as saveJwtToken, ee as saveScheduledTask, de as triggerTriggerable, L as updateMessageTarget, te as updateScheduledTaskState };
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
g as MessageLogListRoute,
|
|
4
|
-
a as SingleMessageLogRoute,
|
|
5
|
-
o as downloadLogBody,
|
|
6
|
-
L as fetchMessageLogById,
|
|
7
|
-
t as fetchMessageLogs,
|
|
8
|
-
d as getLogBodyUrl,
|
|
9
|
-
M as getMessageLogLoader,
|
|
10
|
-
r as getSingleLogMessageLoader
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../message-log-BdrJtbsP.js";
|
|
2
|
+
export { r as MessageLogListRoute, s as SingleMessageLogRoute, e as downloadLogBody, i as fetchMessageLogById, o as fetchMessageLogs, t as getLogBodyUrl, a as getMessageLogLoader, n as getSingleLogMessageLoader };
|