@evenicanpm/admin-integrate 2.3.0 → 2.4.0

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.
@@ -0,0 +1,7 @@
1
+
2
+  WARN  Failed to replace env in config: ${NPM_TOKEN}
3
+ ../../apps/strapi |  WARN  Unsupported engine: wanted: {"node":">=18.0.0 <=22.x.x"} (current: {"node":"v24.16.0","pnpm":"11.0.0"})
4
+ $ pnpm dlx @biomejs/biome check --write .
5
+  WARN  Failed to replace env in config: ${NPM_TOKEN}
6
+  WARN  Failed to replace env in config: ${NPM_TOKEN}
7
+ Checked 275 files in 489ms. No fixes applied.
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # @evenicanpm/admin-integrate
2
+
3
+ ## 2.4.0
package/package.json CHANGED
@@ -1,25 +1,44 @@
1
1
  {
2
- "name": "@evenicanpm/admin-integrate",
3
- "version": "2.3.0",
4
- "description": "e4Integrate Admin Panel",
5
- "type": "module",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "exports": {
10
- ".": "./index.js",
11
- "./*": "./*"
12
- },
13
- "author": "Evenica",
14
- "license": "ISC",
15
- "peerDependencies": {
16
- "@dnd-kit/core": "^6.3.1",
17
- "@dnd-kit/modifiers": "^9.0.0",
18
- "@dnd-kit/sortable": "^10.0.0",
19
- "@tanstack/react-query": "^5.81.5",
20
- "@xyflow/react": "^12.8.4",
21
- "elkjs": "^0.10.0",
22
- "lodash": "^4.17.21"
23
- },
24
- "gitHead": "72bf1aeb02a3d96c587706c0d91606698e38ff6a"
25
- }
2
+ "name": "@evenicanpm/admin-integrate",
3
+ "version": "2.4.0",
4
+ "description": "e4Integrate Admin Panel",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./index.js",
8
+ "./*": "./*"
9
+ },
10
+ "author": "Evenica",
11
+ "license": "ISC",
12
+ "peerDependencies": {
13
+ "@dnd-kit/core": "^6.3.1",
14
+ "@dnd-kit/modifiers": "^9.0.0",
15
+ "@dnd-kit/sortable": "^10.0.0",
16
+ "@dnd-kit/utilities": "^3.2.2",
17
+ "@emotion/react": "^11.11.3",
18
+ "@emotion/styled": "^11.11.0",
19
+ "@mui/icons-material": "^6.1.7",
20
+ "@mui/material": "^6.1.7",
21
+ "@mui/system": "^6.3.1",
22
+ "@tanstack/react-query": "^5.100.4",
23
+ "@xyflow/react": "^12.8.4",
24
+ "elkjs": "^0.10.0",
25
+ "lodash": "^4.17.21",
26
+ "react": "^19.2.7",
27
+ "react-dom": "^19.2.7"
28
+ },
29
+ "devDependencies": {
30
+ "@emotion/react": "^11.11.3",
31
+ "@emotion/styled": "^11.11.0",
32
+ "@mui/icons-material": "^6.1.7",
33
+ "@mui/material": "^6.1.7",
34
+ "@mui/system": "^6.3.1",
35
+ "@types/react": "^19.2.2",
36
+ "@types/react-dom": "^19.2.2",
37
+ "react": "^19.2.7",
38
+ "react-dom": "^19.2.7",
39
+ "typescript": "5.9.2"
40
+ },
41
+ "scripts": {
42
+ "test": "echo \"Error: no test specified\" && exit 1"
43
+ }
44
+ }
@@ -1,4 +1,5 @@
1
1
  import { BaseEdge, type EdgeProps, getSmoothStepPath } from "@xyflow/react";
2
+ import type React from "react";
2
3
 
3
4
  export function DefaultEdge({
4
5
  id,
@@ -7,7 +8,7 @@ export function DefaultEdge({
7
8
  targetX,
8
9
  targetY,
9
10
  markerEnd,
10
- }: EdgeProps): JSX.Element {
11
+ }: EdgeProps): React.ReactElement {
11
12
  const [edgePath] = getSmoothStepPath({
12
13
  sourceX,
13
14
  sourceY,
@@ -432,7 +432,7 @@ const IntegrationView: React.FC<Props> = ({
432
432
  );
433
433
  }, [drawerOpen, selectedProcessTaskId]);
434
434
 
435
- const handleNodeDragStart = (_e: ReactMouseEvent, node: Node) => {
435
+ const handleNodeDragStart = (_e: MouseEvent | TouchEvent, node: Node) => {
436
436
  let edgesFiltered = [];
437
437
 
438
438
  const edgeList: FlowEdge[] = [];
@@ -479,7 +479,7 @@ const IntegrationView: React.FC<Props> = ({
479
479
  setNodes(nodesFiltered);
480
480
  };
481
481
 
482
- const handleNodeDragEnd = (_e: ReactMouseEvent, node: Node) => {
482
+ const handleNodeDragEnd = (_e: MouseEvent | TouchEvent, node: Node) => {
483
483
  const nodeY = node?.position?.y ?? 0;
484
484
  const nodeH = node?.height ?? 0;
485
485
 
@@ -1,7 +1,8 @@
1
1
  import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
2
  import { IconButton, useTheme } from "@mui/material";
3
+ import type React from "react";
3
4
 
4
- export function AddNode(): JSX.Element {
5
+ export function AddNode(): React.ReactElement {
5
6
  const theme = useTheme();
6
7
 
7
8
  return (
@@ -1,6 +1,7 @@
1
1
  import { Handle, Position } from "@xyflow/react";
2
+ import type React from "react";
2
3
 
3
- export function ConnectionNode(): JSX.Element {
4
+ export function ConnectionNode(): React.ReactElement {
4
5
  return (
5
6
  <div>
6
7
  <Handle type="source" position={Position.Bottom} style={{ opacity: 1 }} />
@@ -2,8 +2,9 @@ import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
2
  import { Box, Card, CardContent, CardHeader, Typography } from "@mui/material";
3
3
  import { Handle, type NodeProps, Position } from "@xyflow/react";
4
4
  import { useTranslations } from "next-intl";
5
+ import type React from "react";
5
6
 
6
- export function EmptyNode(props: NodeProps): JSX.Element {
7
+ export function EmptyNode(props: NodeProps): React.ReactElement {
7
8
  const t = useTranslations("Integrate.IntegrationDetails.View.EmptyNode");
8
9
  return (
9
10
  <Box sx={{ opacity: props.data.disabled ? 0.5 : 1 }}>
@@ -9,9 +9,10 @@ import {
9
9
  } from "@mui/material";
10
10
  import { Handle, type NodeProps, Position } from "@xyflow/react";
11
11
  import { useTranslations } from "next-intl";
12
+ import type React from "react";
12
13
  import { inputIcon, timerIcon, triggerIcon } from "../task-icon";
13
14
 
14
- export function EntryNode(props: NodeProps): JSX.Element {
15
+ export function EntryNode(props: NodeProps): React.ReactElement {
15
16
  const t = useTranslations("Integrate.IntegrationDetails.View.EntryNode");
16
17
 
17
18
  const theme = useTheme();
@@ -9,9 +9,10 @@ import {
9
9
  useTheme,
10
10
  } from "@mui/material";
11
11
  import { Handle, type NodeProps, Position } from "@xyflow/react";
12
+ import type React from "react";
12
13
  import type { ReactNode } from "react";
13
14
 
14
- export function ExecutionEntryNode(props: NodeProps): JSX.Element {
15
+ export function ExecutionEntryNode(props: NodeProps): React.ReactElement {
15
16
  const theme = useTheme();
16
17
  const styles = getStyles(theme, props);
17
18
 
@@ -2,9 +2,10 @@ import type { ProcessTaskExecution } from "@evenicanpm/admin-core/api/e4/graphql
2
2
  import { ExecutionTag } from "@evenicanpm/admin-integrate/components/execution";
3
3
  import { Box, Card, CardContent, Typography, useTheme } from "@mui/material";
4
4
  import { Handle, type NodeProps, Position } from "@xyflow/react";
5
+ import type React from "react";
5
6
  import { mapIconByOrchestrationType } from "../task-icon";
6
7
 
7
- export function ExecutionTaskNode(props: NodeProps): JSX.Element {
8
+ export function ExecutionTaskNode(props: NodeProps): React.ReactElement {
8
9
  const theme = useTheme();
9
10
 
10
11
  const borderColor = () => {
@@ -1,8 +1,9 @@
1
1
  import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
2
  import { Box, Card, CardContent, CardHeader, Typography } from "@mui/material";
3
3
  import { Handle, type NodeProps, Position } from "@xyflow/react";
4
+ import type React from "react";
4
5
 
5
- export function GroupNode(props: NodeProps): JSX.Element {
6
+ export function GroupNode(props: NodeProps): React.ReactElement {
6
7
  return (
7
8
  <Box sx={{ opacity: props.data.disabled ? 0.5 : 1 }}>
8
9
  <Card
@@ -1,7 +1,8 @@
1
1
  import { Box } from "@mui/material";
2
2
  import type { NodeProps } from "@xyflow/react";
3
+ import type React from "react";
3
4
 
4
- export function RowNode(props: NodeProps): JSX.Element {
5
+ export function RowNode(props: NodeProps): React.ReactElement {
5
6
  return (
6
7
  // <Box sx={{ opacity: props.data.disabled ? 0.5 : 1 }}>
7
8
  <Box>
@@ -8,10 +8,11 @@ import {
8
8
  useTheme,
9
9
  } from "@mui/material";
10
10
  import { Handle, type NodeProps, Position } from "@xyflow/react";
11
+ import type React from "react";
11
12
  import type { ProcessTask } from "../../../../../admin-core/src/api/e4/graphqlRequestSdk";
12
13
  import { mapIconByOrchestrationType } from "../task-icon";
13
14
 
14
- export function TaskNode(props: NodeProps): JSX.Element {
15
+ export function TaskNode(props: NodeProps): React.ReactElement {
15
16
  const theme = useTheme();
16
17
 
17
18
  return (
@@ -74,14 +74,12 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
74
74
  (values, [key, filter]) => {
75
75
  if (filter.type === "select" && filter.value) {
76
76
  return Object.assign(values, {
77
- // @ts-expect-error
78
77
  [key]: filter.options.find((o) => o.id === filter.value[0].id),
79
78
  });
80
79
  }
81
80
  if (filter.type === "multiSelect" && filter.value) {
82
81
  return Object.assign(values, {
83
82
  [key]: filter.options.filter((o) =>
84
- // @ts-expect-error
85
83
  filter.value.find((v) => v.id === o.id),
86
84
  ),
87
85
  });
@@ -112,7 +112,7 @@ export default function PageForm({
112
112
  }}
113
113
  >
114
114
  {(formik) => {
115
- formikRef.current = formik;
115
+ formikRef.current = formik as FormikProps<FormState>;
116
116
  useEffect(() => {
117
117
  if (setSubmitRef) setSubmitRef(submit);
118
118
  return () => {
@@ -0,0 +1,3 @@
1
+ declare module "*.css";
2
+ declare module "*.scss";
3
+ declare module "*.sass";
@@ -50,7 +50,7 @@ export default function PreCreationStep(props: Readonly<Props>) {
50
50
  processTaskId={undefined}
51
51
  onTaskClick={(processTask: ProcessTask) => {
52
52
  const endpoint = (props.processConfig?.Endpoints ?? []).find(
53
- (ep) => ep?.Name === processTask.endpoint,
53
+ (ep) => ep?.Name === processTask.endpoint?.name,
54
54
  );
55
55
 
56
56
  let templateConfig: string | undefined;
@@ -3,6 +3,7 @@ import type {
3
3
  ConfigImport,
4
4
  ConfigurationExportQuery,
5
5
  GetProcessByIdQuery,
6
+ ProcessTask,
6
7
  } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
7
8
  import { getProcessById } from "@evenicanpm/admin-integrate/api/process/queries";
8
9
  import { buildProcessByIdQueryKey } from "@evenicanpm/admin-integrate/api/process/queries/get-process-by-id.query";
@@ -37,22 +38,22 @@ import {
37
38
  taskReducer,
38
39
  } from "./task-drawer/task-reducer";
39
40
 
40
- function mergeByKey(
41
+ function mergeByKey<T>(
41
42
  keyFields: string | string[],
42
- arr1: any[] = [],
43
- arr2: any[] = [],
44
- ) {
43
+ arr1: T[] = [],
44
+ arr2: T[] = [],
45
+ ): T[] {
45
46
  const keys = Array.isArray(keyFields) ? keyFields : [keyFields];
46
47
 
47
48
  // Build lookup maps for each key -> value => baseItem (from arr1)
48
- const lookupByKey: Record<string, Map<any, any>> = {};
49
+ const lookupByKey: Record<string, Map<unknown, T>> = {};
49
50
  for (const k of keys) {
50
51
  lookupByKey[k] = new Map();
51
52
  }
52
53
 
53
54
  for (const item of arr1) {
54
55
  for (const key of keys) {
55
- const val = item?.[key];
56
+ const val = (item as Record<string, unknown> | null | undefined)?.[key];
56
57
  if (val !== undefined && val !== null) {
57
58
  lookupByKey[key].set(val, item);
58
59
  }
@@ -60,28 +61,29 @@ function mergeByKey(
60
61
  }
61
62
 
62
63
  // Use a Set to preserve insertion order and ensure uniqueness
63
- const resultSet = new Set<any>(arr1);
64
+ const resultSet = new Set<T>(arr1);
64
65
 
65
66
  for (const item of arr2) {
66
- let matchedBase: any = null;
67
+ let matchedBase: T | undefined;
67
68
 
68
69
  // Try keys in order of priority
69
70
  for (const key of keys) {
70
- const val = item?.[key];
71
+ const val = (item as Record<string, unknown> | null | undefined)?.[key];
71
72
  if (val !== undefined && val !== null) {
72
73
  const candidate = lookupByKey[key].get(val);
73
- if (candidate) {
74
+ if (candidate !== undefined) {
74
75
  matchedBase = candidate;
75
76
  break;
76
77
  }
77
78
  }
78
79
  }
79
80
 
80
- if (matchedBase) {
81
+ if (matchedBase !== undefined) {
81
82
  // Merge properties from item into matched base (respecting exclusions)
82
- for (const prop of Object.keys(item)) {
83
+ const itemRecord = item as Record<string, unknown> | null | undefined;
84
+ for (const prop of Object.keys(itemRecord ?? {})) {
83
85
  if (prop !== "Sort" && prop !== "ParallelProcessingGroup") {
84
- matchedBase[prop] = item[prop];
86
+ (matchedBase as Record<string, unknown>)[prop] = itemRecord?.[prop];
85
87
  }
86
88
  }
87
89
  } else {
@@ -89,7 +91,7 @@ function mergeByKey(
89
91
  resultSet.add(item);
90
92
  // Register the newly added item in lookups so subsequent arr2 items can match it
91
93
  for (const key of keys) {
92
- const val = item?.[key];
94
+ const val = (item as Record<string, unknown> | null | undefined)?.[key];
93
95
  if (val !== undefined && val !== null) {
94
96
  lookupByKey[key].set(val, item);
95
97
  }
@@ -175,7 +177,9 @@ export default function IntegrationDetails() {
175
177
  //setConfig(newConfig);
176
178
 
177
179
  const configData: ConfigExport =
178
- config ?? (configFromApi as any)?.configurationExport;
180
+ config ??
181
+ ((configFromApi as ConfigurationExportQuery)
182
+ ?.configurationExport as ConfigExport);
179
183
 
180
184
  configData.DepotGroups = mergeByKey(
181
185
  "DepotGroup",
@@ -287,12 +291,15 @@ export default function IntegrationDetails() {
287
291
  }
288
292
  }, [scheduleLoading]);
289
293
 
290
- const onAdd = (data: any) => {
294
+ const onAdd = (data: {
295
+ sort?: number;
296
+ paralellelProcessingGroup?: string;
297
+ }) => {
291
298
  dispatchTaskState({
292
299
  type: TaskActionType.OPEN_ADD,
293
300
  sort: data.sort,
294
301
  parallelProcessingGroup: data.paralellelProcessingGroup,
295
- } as EditAction);
302
+ } as unknown as EditAction);
296
303
  };
297
304
 
298
305
  useEffect(() => {
@@ -314,14 +321,21 @@ export default function IntegrationDetails() {
314
321
  <IntegrateBreadcrumbs breadcrumbs={breadcrumbs} />
315
322
  <IntegrationDetailsHeader
316
323
  name={
317
- (config || (configFromApi as any)?.configurationExport)?.Processes[0]
318
- ?.Name || "Untitled Integration"
324
+ (
325
+ config ||
326
+ ((configFromApi as ConfigurationExportQuery)
327
+ ?.configurationExport as ConfigExport)
328
+ )?.Processes?.[0]?.Name || "Untitled Integration"
319
329
  }
320
330
  icon={details?.processById?.processIcon ?? ""}
321
331
  setName={(name) => {
322
332
  const configData =
323
- config || (configFromApi as any)?.configurationExport;
324
- configData.Processes[0].Name = name;
333
+ config ||
334
+ ((configFromApi as ConfigurationExportQuery)
335
+ ?.configurationExport as ConfigExport);
336
+ if (configData?.Processes?.[0]) {
337
+ configData.Processes[0].Name = name as string;
338
+ }
325
339
  setConfig(configData);
326
340
  }}
327
341
  onImportClick={() => {
@@ -391,15 +405,15 @@ export default function IntegrationDetails() {
391
405
  .configurationExport as ConfigExport)
392
406
  }
393
407
  variant="process"
394
- onTaskClick={(processTask: any) => {
408
+ onTaskClick={(processTask: ProcessTask) => {
395
409
  const endpoint = (
396
410
  config ??
397
411
  (configFromApi as ConfigurationExportQuery).configurationExport
398
412
  )?.Endpoints?.find(
399
- (ep) => !!ep && ep.Name === processTask.endpoint,
413
+ (ep) => !!ep && ep.Name === processTask.endpoint?.name,
400
414
  );
401
415
 
402
- let templateConfig: any;
416
+ let templateConfig: string | undefined;
403
417
 
404
418
  if (endpoint) {
405
419
  if (typeof endpoint.TemplateConfig === "string") {
@@ -437,7 +451,11 @@ export default function IntegrationDetails() {
437
451
  renderKey={taskState.processTaskId ?? 0}
438
452
  dispatch={dispatchTaskState}
439
453
  handleUpdateConfig={handleUpdateConfig}
440
- config={config ?? (configFromApi as any)?.configurationExport}
454
+ config={
455
+ config ??
456
+ ((configFromApi as ConfigurationExportQuery)
457
+ ?.configurationExport as ConfigExport)
458
+ }
441
459
  />
442
460
  </Box>
443
461
  <ScheduleDrawer
package/tsconfig.json CHANGED
@@ -12,27 +12,13 @@
12
12
  "outDir": "./dist",
13
13
  "jsx": "preserve",
14
14
  "baseUrl": "./",
15
- "typeRoots": ["../../../../admin/node_modules/@types"],
16
15
  "paths": {
17
- "*": ["../../../../admin/node_modules/*"],
18
- "@/lib/*": [
19
- "../../../../admin/node_modules/@evenicanpm/admin-integrate/src/lib/*"
20
- ],
21
- "@/auth/*": [
22
- "../../../../admin/node_modules/@evenicanpm/admin-integrate/src/auth/*"
23
- ],
24
- "@/api/*": [
25
- "../../../../admin/node_modules/@evenicanpm/admin-integrate/src/api/*"
26
- ],
27
- "@/components/*": [
28
- "../../../../admin/node_modules/@evenicanpm/admin-integrate/src/components/*"
29
- ],
30
- "@evenicanpm/admin-core/*": [
31
- "../../../../admin/node_modules/@evenicanpm/admin-core/src/*"
32
- ],
33
- "@evenicanpm/admin-integrate/*": [
34
- "../../../../admin/node_modules/@evenicanpm/admin-integrate/src/*"
35
- ]
16
+ "@/lib/*": ["src/lib/*"],
17
+ "@/auth/*": ["src/auth/*"],
18
+ "@/api/*": ["src/api/*"],
19
+ "@/components/*": ["src/components/*"],
20
+ "@evenicanpm/admin-core/*": ["../admin-core/src/*"],
21
+ "@evenicanpm/admin-integrate/*": ["src/*"]
36
22
  }
37
23
  },
38
24
  "include": ["src"]