Update deps and Zammad version (6.4.1)
This commit is contained in:
parent
07ee819520
commit
9e5ea2fc41
40 changed files with 973 additions and 849 deletions
|
|
@ -22,9 +22,9 @@ const getVisualization = async (visualizationID: string) => {
|
|||
);
|
||||
const hit = hits[0];
|
||||
const visualization = {
|
||||
id: hit._id.split(":")[1],
|
||||
title: hit._source.visualization.title,
|
||||
description: hit._source.visualization.description,
|
||||
id: hit?._id.split(":")[1],
|
||||
title: hit?._source?.visualization.title,
|
||||
description: hit?._source?.visualization.description,
|
||||
url: `/app/visualize?security_tenant=global#/edit/${
|
||||
hit._id.split(":")[1]
|
||||
}?embed=true`,
|
||||
|
|
|
|||
|
|
@ -10,27 +10,29 @@ const userMetadataIndexName = "user_metadata";
|
|||
|
||||
const baseURL = `https://${process.env.OPENSEARCH_USERNAME}:${process.env.OPENSEARCH_PASSWORD}@${process.env.OPENSEARCH_URL}`;
|
||||
|
||||
const createClient = () => new Client({
|
||||
node: baseURL,
|
||||
auth: {
|
||||
username: process.env.OPENSEARCH_USERNAME!,
|
||||
password: process.env.OPENSEARCH_PASSWORD!,
|
||||
},
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
const createClient = () =>
|
||||
new Client({
|
||||
node: baseURL,
|
||||
auth: {
|
||||
username: process.env.OPENSEARCH_USERNAME!,
|
||||
password: process.env.OPENSEARCH_PASSWORD!,
|
||||
},
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
|
||||
const createUserClient = (username: string, password: string) => new Client({
|
||||
node: baseURL,
|
||||
auth: {
|
||||
username,
|
||||
password,
|
||||
},
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
const createUserClient = (username: string, password: string) =>
|
||||
new Client({
|
||||
node: baseURL,
|
||||
auth: {
|
||||
username,
|
||||
password,
|
||||
},
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
|
||||
export const checkAuth = async (username: string, password: string) => {
|
||||
const client = createUserClient(username, password);
|
||||
|
|
@ -115,7 +117,7 @@ export const getUserMetadata = async (username: string) => {
|
|||
await client.create({
|
||||
id: username,
|
||||
index: userMetadataIndexName,
|
||||
body: { username, savedSearches: [] }
|
||||
body: { username, savedSearches: [] },
|
||||
});
|
||||
|
||||
res = await client.get({
|
||||
|
|
@ -132,7 +134,7 @@ export const saveUserMetadata = async (username: string, metadata: any) => {
|
|||
await client.update({
|
||||
id: username,
|
||||
index: userMetadataIndexName,
|
||||
body: { doc: { username, ...metadata } }
|
||||
body: { doc: { username, ...metadata } },
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -181,7 +183,7 @@ const getIndexPattern: any = async (index: string) => {
|
|||
sort: ["updated_at:desc"],
|
||||
});
|
||||
|
||||
if (res.body.hits.total.value === 0) {
|
||||
if (res?.body?.hits?.total?.valueOf() === 0) {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
return createCurrentUserIndexPattern(index);
|
||||
}
|
||||
|
|
@ -226,7 +228,7 @@ interface createUserVisualizationProps {
|
|||
}
|
||||
|
||||
export const createUserVisualization = async (
|
||||
props: createUserVisualizationProps
|
||||
props: createUserVisualizationProps,
|
||||
) => {
|
||||
const { email, query, visualizationID, title, description } = props;
|
||||
const userIndex = await getCurrentUserIndex(email);
|
||||
|
|
@ -279,7 +281,7 @@ interface updateVisualizationProps {
|
|||
}
|
||||
|
||||
export const updateUserVisualization = async (
|
||||
props: updateVisualizationProps
|
||||
props: updateVisualizationProps,
|
||||
) => {
|
||||
const { email, id, query, title, description } = props;
|
||||
const userIndex = await getCurrentUserIndex(email);
|
||||
|
|
@ -469,10 +471,18 @@ export const performQuery = async (searchQuery: any, limit: number) => {
|
|||
const results = hits.map((hit: any) => ({
|
||||
...hit._source,
|
||||
id: hit._id,
|
||||
incident: Array.isArray(hit._source.incident) ? hit._source.incident.join(", ") : hit._source.incident,
|
||||
technology: Array.isArray(hit._source.technology) ? hit._source.technology.join(", ") : hit._source.technology,
|
||||
targeted_group: Array.isArray(hit._source.targeted_group) ? hit._source.targeted_group.join(", ") : hit._source.targeted_group,
|
||||
country: Array.isArray(hit._source.country) ? hit._source.country.join(", ") : hit._source.country,
|
||||
incident: Array.isArray(hit._source.incident)
|
||||
? hit._source.incident.join(", ")
|
||||
: hit._source.incident,
|
||||
technology: Array.isArray(hit._source.technology)
|
||||
? hit._source.technology.join(", ")
|
||||
: hit._source.technology,
|
||||
targeted_group: Array.isArray(hit._source.targeted_group)
|
||||
? hit._source.targeted_group.join(", ")
|
||||
: hit._source.targeted_group,
|
||||
country: Array.isArray(hit._source.country)
|
||||
? hit._source.country.join(", ")
|
||||
: hit._source.country,
|
||||
}));
|
||||
|
||||
return results;
|
||||
|
|
@ -570,7 +580,6 @@ export const getTemplates = async (limit: number) => {
|
|||
},
|
||||
};
|
||||
|
||||
|
||||
const rawResponse = await client.search({
|
||||
index: globalIndex,
|
||||
size: limit,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@link-stack/leafcutter",
|
||||
"version": "2.3.4",
|
||||
"version": "2.4.0b1",
|
||||
"scripts": {
|
||||
"dev": "next dev -p 3001",
|
||||
"login": "aws sso login --sso-session cdr",
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
"@mui/icons-material": "^6",
|
||||
"@mui/material": "^6",
|
||||
"@mui/material-nextjs": "^6",
|
||||
"@mui/x-date-pickers-pro": "^7.23.2",
|
||||
"@opensearch-project/opensearch": "^2.13.0",
|
||||
"@mui/x-date-pickers-pro": "^7.23.6",
|
||||
"@opensearch-project/opensearch": "^3.1.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"http-proxy-middleware": "^3.0.3",
|
||||
"material-ui-popup-state": "^5.3.1",
|
||||
"next": "15.1.0",
|
||||
"material-ui-popup-state": "^5.3.3",
|
||||
"next": "15.1.4",
|
||||
"next-auth": "^4.24.11",
|
||||
"react": "19.0.0",
|
||||
"react-cookie": "^7.2.2",
|
||||
|
|
@ -36,14 +36,14 @@
|
|||
"react-iframe": "^1.8.5",
|
||||
"react-polyglot": "^0.7.2",
|
||||
"sharp": "^0.33.5",
|
||||
"uuid": "^11.0.3"
|
||||
"uuid": "^11.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.2",
|
||||
"@types/react": "19.0.1",
|
||||
"@types/node": "^22.10.6",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@link-stack/eslint-config": "*",
|
||||
"@link-stack/typescript-config": "*",
|
||||
"typescript": "5.7.2"
|
||||
"typescript": "5.7.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue