@oondemand/oon-core-front 0.3.60 → 0.3.61
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/index.js +180 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4502,7 +4502,7 @@ function Sidebar({ app, menu, registry }) {
|
|
|
4502
4502
|
// package.json
|
|
4503
4503
|
var package_default = {
|
|
4504
4504
|
name: "@oondemand/oon-core-front",
|
|
4505
|
-
version: "0.3.
|
|
4505
|
+
version: "0.3.61",
|
|
4506
4506
|
repository: {
|
|
4507
4507
|
type: "git",
|
|
4508
4508
|
url: "git+https://github.com/oondemand/oon-platform.git",
|
|
@@ -5880,6 +5880,145 @@ function countActive(values) {
|
|
|
5880
5880
|
if (!values) return 0;
|
|
5881
5881
|
return Object.entries(values).filter(([status]) => !["Conclu\xEDdo", "Arquivado"].includes(status)).reduce((sum, [, count]) => sum + Number(count || 0), 0);
|
|
5882
5882
|
}
|
|
5883
|
+
var SUMMARY_LABELS = {
|
|
5884
|
+
mode: "Modo",
|
|
5885
|
+
received: "Recebidos",
|
|
5886
|
+
created: "Criados",
|
|
5887
|
+
updated: "Atualizados",
|
|
5888
|
+
skipped: "Ignorados",
|
|
5889
|
+
inactivated: "Inativados",
|
|
5890
|
+
errors: "Erros"
|
|
5891
|
+
};
|
|
5892
|
+
function isRecord(value2) {
|
|
5893
|
+
return Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
|
|
5894
|
+
}
|
|
5895
|
+
function primitiveText2(value2) {
|
|
5896
|
+
if (value2 === null || value2 === void 0 || value2 === "") return "\u2014";
|
|
5897
|
+
if (["string", "number", "boolean"].includes(typeof value2)) return String(value2);
|
|
5898
|
+
return JSON.stringify(value2) ?? "\u2014";
|
|
5899
|
+
}
|
|
5900
|
+
function diagnosticMessage(value2) {
|
|
5901
|
+
return value2.error?.message || value2.message || "Erro sem mensagem registrada.";
|
|
5902
|
+
}
|
|
5903
|
+
function diagnosticCode(value2) {
|
|
5904
|
+
return value2.error?.code || value2.code || value2.error?.statusCode || value2.statusCode;
|
|
5905
|
+
}
|
|
5906
|
+
function diagnosticIdentity(value2, position) {
|
|
5907
|
+
const parts = [`Registro ${value2.index !== void 0 ? value2.index + 1 : position + 1}`];
|
|
5908
|
+
if (value2.externalKey !== void 0 && value2.externalKey !== null && value2.externalKey !== "") {
|
|
5909
|
+
parts.push(`chave ${primitiveText2(value2.externalKey)}`);
|
|
5910
|
+
}
|
|
5911
|
+
const code = diagnosticCode(value2);
|
|
5912
|
+
if (code !== void 0 && code !== null && code !== "") parts.push(`c\xF3digo ${String(code)}`);
|
|
5913
|
+
return parts.join(" \xB7 ");
|
|
5914
|
+
}
|
|
5915
|
+
function executionDiagnostics(execution) {
|
|
5916
|
+
const values = [...execution.errors ?? []];
|
|
5917
|
+
if (execution.error?.message && !values.some((item) => diagnosticMessage(item) === execution.error?.message)) {
|
|
5918
|
+
values.push({ error: execution.error });
|
|
5919
|
+
}
|
|
5920
|
+
return values;
|
|
5921
|
+
}
|
|
5922
|
+
function JsonDiagnosticDetails({
|
|
5923
|
+
label,
|
|
5924
|
+
value: value2,
|
|
5925
|
+
count,
|
|
5926
|
+
limited
|
|
5927
|
+
}) {
|
|
5928
|
+
const hasValue = Array.isArray(value2) ? value2.length > 0 : isRecord(value2) ? Object.keys(value2).length > 0 : value2 !== void 0 && value2 !== null && value2 !== "";
|
|
5929
|
+
if (!hasValue) return null;
|
|
5930
|
+
return /* @__PURE__ */ jsxs23("details", { style: { borderTop: "1px solid #e2e8f0", paddingTop: "10px" }, children: [
|
|
5931
|
+
/* @__PURE__ */ jsxs23("summary", { style: { cursor: "pointer", fontWeight: 600, fontSize: "13px" }, children: [
|
|
5932
|
+
label,
|
|
5933
|
+
count !== void 0 ? ` (${count})` : "",
|
|
5934
|
+
limited ? " \xB7 visualiza\xE7\xE3o limitada" : ""
|
|
5935
|
+
] }),
|
|
5936
|
+
/* @__PURE__ */ jsx38(
|
|
5937
|
+
Box22,
|
|
5938
|
+
{
|
|
5939
|
+
as: "pre",
|
|
5940
|
+
mt: 2,
|
|
5941
|
+
mb: 0,
|
|
5942
|
+
p: 3,
|
|
5943
|
+
overflowX: "auto",
|
|
5944
|
+
borderRadius: "md",
|
|
5945
|
+
bg: "gray.50",
|
|
5946
|
+
fontSize: "xs",
|
|
5947
|
+
whiteSpace: "pre-wrap",
|
|
5948
|
+
wordBreak: "break-word",
|
|
5949
|
+
children: JSON.stringify(value2, null, 2)
|
|
5950
|
+
}
|
|
5951
|
+
)
|
|
5952
|
+
] });
|
|
5953
|
+
}
|
|
5954
|
+
function ExecutionDetails({ execution }) {
|
|
5955
|
+
const diagnostics = executionDiagnostics(execution);
|
|
5956
|
+
const summary = isRecord(execution.summary) ? execution.summary : {};
|
|
5957
|
+
const summaryEntries = Object.entries(summary).filter(([, value2]) => value2 === null || ["string", "number", "boolean"].includes(typeof value2));
|
|
5958
|
+
return /* @__PURE__ */ jsx38(Box22, { mt: 3, pt: 3, borderTopWidth: "1px", borderColor: "gray.100", children: /* @__PURE__ */ jsxs23(Stack9, { gap: 3, children: [
|
|
5959
|
+
summaryEntries.length ? /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
5960
|
+
/* @__PURE__ */ jsx38(Text23, { fontSize: "sm", fontWeight: "semibold", mb: 2, children: "Resumo da execu\xE7\xE3o" }),
|
|
5961
|
+
/* @__PURE__ */ jsx38(Flex14, { gap: 2, wrap: "wrap", children: summaryEntries.map(([key, value2]) => /* @__PURE__ */ jsxs23(
|
|
5962
|
+
Badge5,
|
|
5963
|
+
{
|
|
5964
|
+
variant: "outline",
|
|
5965
|
+
colorPalette: key === "errors" && Number(value2 ?? 0) > 0 ? "red" : "gray",
|
|
5966
|
+
children: [
|
|
5967
|
+
SUMMARY_LABELS[key] || key,
|
|
5968
|
+
": ",
|
|
5969
|
+
primitiveText2(value2)
|
|
5970
|
+
]
|
|
5971
|
+
},
|
|
5972
|
+
key
|
|
5973
|
+
)) })
|
|
5974
|
+
] }) : null,
|
|
5975
|
+
diagnostics.length ? /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
5976
|
+
/* @__PURE__ */ jsxs23(Flex14, { align: "center", justify: "space-between", gap: 2, mb: 2, wrap: "wrap", children: [
|
|
5977
|
+
/* @__PURE__ */ jsx38(Text23, { fontSize: "sm", fontWeight: "semibold", children: "Erros por registro" }),
|
|
5978
|
+
/* @__PURE__ */ jsxs23(Text23, { fontSize: "xs", color: "gray.500", children: [
|
|
5979
|
+
execution.errorCount ?? diagnostics.length,
|
|
5980
|
+
" erro(s)",
|
|
5981
|
+
execution.errorsLimited ? " \xB7 lista limitada" : ""
|
|
5982
|
+
] })
|
|
5983
|
+
] }),
|
|
5984
|
+
/* @__PURE__ */ jsx38(Stack9, { gap: 2, children: diagnostics.map((diagnostic, index) => /* @__PURE__ */ jsxs23(
|
|
5985
|
+
Box22,
|
|
5986
|
+
{
|
|
5987
|
+
p: 3,
|
|
5988
|
+
borderWidth: "1px",
|
|
5989
|
+
borderColor: "red.100",
|
|
5990
|
+
borderRadius: "md",
|
|
5991
|
+
bg: "red.50",
|
|
5992
|
+
children: [
|
|
5993
|
+
/* @__PURE__ */ jsx38(Text23, { fontSize: "xs", color: "gray.600", fontWeight: "semibold", children: diagnosticIdentity(diagnostic, index) }),
|
|
5994
|
+
/* @__PURE__ */ jsx38(Text23, { fontSize: "sm", color: "red.700", children: diagnosticMessage(diagnostic) }),
|
|
5995
|
+
diagnostic.error?.details ? /* @__PURE__ */ jsx38(Text23, { fontSize: "xs", color: "gray.600", mt: 1, children: primitiveText2(diagnostic.error.details) }) : null
|
|
5996
|
+
]
|
|
5997
|
+
},
|
|
5998
|
+
`${diagnostic.index ?? index}:${diagnosticMessage(diagnostic)}`
|
|
5999
|
+
)) })
|
|
6000
|
+
] }) : execution.status.toLowerCase().includes("erro") ? /* @__PURE__ */ jsx38(Text23, { fontSize: "sm", color: "red.600", children: execution.message || execution.error?.message || "A execu\xE7\xE3o terminou com erro, mas n\xE3o registrou detalhes adicionais." }) : null,
|
|
6001
|
+
/* @__PURE__ */ jsx38(
|
|
6002
|
+
JsonDiagnosticDetails,
|
|
6003
|
+
{
|
|
6004
|
+
label: "Itens processados",
|
|
6005
|
+
value: execution.items,
|
|
6006
|
+
count: execution.itemCount,
|
|
6007
|
+
limited: execution.itemsLimited
|
|
6008
|
+
}
|
|
6009
|
+
),
|
|
6010
|
+
/* @__PURE__ */ jsx38(
|
|
6011
|
+
JsonDiagnosticDetails,
|
|
6012
|
+
{
|
|
6013
|
+
label: "Chamadas sanitizadas",
|
|
6014
|
+
value: execution.requests,
|
|
6015
|
+
count: execution.requestCount,
|
|
6016
|
+
limited: execution.requestsLimited
|
|
6017
|
+
}
|
|
6018
|
+
),
|
|
6019
|
+
/* @__PURE__ */ jsx38(JsonDiagnosticDetails, { label: "Metadados", value: execution.metadata })
|
|
6020
|
+
] }) });
|
|
6021
|
+
}
|
|
5883
6022
|
function ProviderConfigurationPanel({ provider }) {
|
|
5884
6023
|
const { http } = useOonApi();
|
|
5885
6024
|
const [draft, setDraft] = useState14({
|
|
@@ -6109,6 +6248,7 @@ function ProviderConfigurationPanel({ provider }) {
|
|
|
6109
6248
|
}
|
|
6110
6249
|
function CoreIntegration({ label = "Integra\xE7\xF5es" }) {
|
|
6111
6250
|
const { http } = useOonApi();
|
|
6251
|
+
const [expandedExecutionId, setExpandedExecutionId] = useState14(null);
|
|
6112
6252
|
const providers = useQuery8({
|
|
6113
6253
|
queryKey: ["core-integrations", "health"],
|
|
6114
6254
|
queryFn: async () => (await http.get("/integrations/health")).data?.results ?? []
|
|
@@ -6243,23 +6383,46 @@ function CoreIntegration({ label = "Integra\xE7\xF5es" }) {
|
|
|
6243
6383
|
] }),
|
|
6244
6384
|
/* @__PURE__ */ jsxs23(Box22, { children: [
|
|
6245
6385
|
/* @__PURE__ */ jsx38(Heading12, { size: "md", mb: 3, children: "Hist\xF3rico" }),
|
|
6246
|
-
/* @__PURE__ */ jsx38(Stack9, { gap: 2, children: (history.data ?? []).length === 0 ? /* @__PURE__ */ jsx38(Text23, { color: "gray.400", children: "Nenhuma execu\xE7\xE3o registrada." }) : history.data?.map((execution) =>
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6386
|
+
/* @__PURE__ */ jsx38(Stack9, { gap: 2, children: (history.data ?? []).length === 0 ? /* @__PURE__ */ jsx38(Text23, { color: "gray.400", children: "Nenhuma execu\xE7\xE3o registrada." }) : history.data?.map((execution) => {
|
|
6387
|
+
const expanded = expandedExecutionId === execution._id;
|
|
6388
|
+
const diagnosticCount = execution.errorCount ?? execution.errors?.length ?? (execution.error?.message ? 1 : 0);
|
|
6389
|
+
return /* @__PURE__ */ jsxs23(Box22, { borderWidth: "1px", borderRadius: "md", p: 3, bg: "white", children: [
|
|
6390
|
+
/* @__PURE__ */ jsxs23(Flex14, { align: "center", justify: "space-between", gap: 3, wrap: "wrap", children: [
|
|
6391
|
+
/* @__PURE__ */ jsxs23(Box22, { children: [
|
|
6392
|
+
/* @__PURE__ */ jsx38(Text23, { fontWeight: "medium", children: execution.title }),
|
|
6393
|
+
/* @__PURE__ */ jsxs23(Text23, { fontSize: "sm", color: "gray.500", children: [
|
|
6394
|
+
execution.provider,
|
|
6395
|
+
" \xB7 ",
|
|
6396
|
+
execution.resource || "sem recurso",
|
|
6397
|
+
" \xB7 ",
|
|
6398
|
+
dateTime(execution.startedAt),
|
|
6399
|
+
" \xB7 ",
|
|
6400
|
+
execution.durationMs ?? 0,
|
|
6401
|
+
" ms"
|
|
6402
|
+
] }),
|
|
6403
|
+
execution.error?.message ? /* @__PURE__ */ jsx38(Text23, { fontSize: "sm", color: "red.600", children: execution.error.message }) : null
|
|
6404
|
+
] }),
|
|
6405
|
+
/* @__PURE__ */ jsxs23(Flex14, { align: "center", gap: 2, wrap: "wrap", children: [
|
|
6406
|
+
diagnosticCount > 0 ? /* @__PURE__ */ jsxs23(Badge5, { colorPalette: "red", children: [
|
|
6407
|
+
diagnosticCount,
|
|
6408
|
+
" erro(s)"
|
|
6409
|
+
] }) : null,
|
|
6410
|
+
/* @__PURE__ */ jsx38(Badge5, { colorPalette: statusPalette(execution.status), children: execution.status }),
|
|
6411
|
+
/* @__PURE__ */ jsx38(
|
|
6412
|
+
Button15,
|
|
6413
|
+
{
|
|
6414
|
+
size: "xs",
|
|
6415
|
+
variant: "outline",
|
|
6416
|
+
"aria-expanded": expanded,
|
|
6417
|
+
onClick: () => setExpandedExecutionId((current) => current === execution._id ? null : execution._id),
|
|
6418
|
+
children: expanded ? "Ocultar detalhes" : "Ver detalhes"
|
|
6419
|
+
}
|
|
6420
|
+
)
|
|
6421
|
+
] })
|
|
6258
6422
|
] }),
|
|
6259
|
-
|
|
6260
|
-
] })
|
|
6261
|
-
|
|
6262
|
-
] }) }, execution._id)) })
|
|
6423
|
+
expanded ? /* @__PURE__ */ jsx38(ExecutionDetails, { execution }) : null
|
|
6424
|
+
] }, execution._id);
|
|
6425
|
+
}) })
|
|
6263
6426
|
] })
|
|
6264
6427
|
] });
|
|
6265
6428
|
}
|