@akanjs/ui 0.9.55 → 0.9.57

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.
Files changed (60) hide show
  1. package/Data/CardList.d.ts +3 -3
  2. package/Data/TableList.d.ts +4 -4
  3. package/Field.d.ts +11 -12
  4. package/Model/Remove.d.ts +3 -1
  5. package/Select.d.ts +2 -2
  6. package/Signal/Arg.d.ts +14 -11
  7. package/Signal/Doc.d.ts +8 -1
  8. package/Signal/GraphQL.d.ts +13 -16
  9. package/Signal/Message.d.ts +12 -15
  10. package/Signal/PubSub.d.ts +13 -15
  11. package/Signal/Response.d.ts +3 -5
  12. package/Signal/RestApi.d.ts +17 -20
  13. package/Signal/WebSocket.d.ts +1 -1
  14. package/System/CSR.d.ts +2 -2
  15. package/System/Common.d.ts +2 -25
  16. package/System/SSR.d.ts +2 -2
  17. package/Table.d.ts +2 -2
  18. package/cjs/Data/Insight.js +1 -1
  19. package/cjs/Data/Item.js +1 -1
  20. package/cjs/Data/ListContainer.js +5 -5
  21. package/cjs/Data/TableList.js +2 -5
  22. package/cjs/Field.js +11 -9
  23. package/cjs/Model/EditModal.js +1 -1
  24. package/cjs/Model/Remove.js +6 -11
  25. package/cjs/Model/ViewEditModal.js +14 -1
  26. package/cjs/Select.js +1 -1
  27. package/cjs/Signal/Arg.js +22 -22
  28. package/cjs/Signal/Doc.js +18 -27
  29. package/cjs/Signal/GraphQL.js +37 -52
  30. package/cjs/Signal/Message.js +25 -53
  31. package/cjs/Signal/Object.js +4 -12
  32. package/cjs/Signal/PubSub.js +20 -54
  33. package/cjs/Signal/Response.js +2 -2
  34. package/cjs/Signal/RestApi.js +63 -79
  35. package/cjs/Signal/WebSocket.js +14 -15
  36. package/cjs/System/CSR.js +5 -10
  37. package/cjs/System/Common.js +6 -6
  38. package/cjs/System/SSR.js +5 -10
  39. package/esm/Data/Insight.js +1 -1
  40. package/esm/Data/Item.js +1 -1
  41. package/esm/Data/ListContainer.js +5 -5
  42. package/esm/Data/TableList.js +2 -5
  43. package/esm/Field.js +12 -10
  44. package/esm/Model/EditModal.js +1 -1
  45. package/esm/Model/Remove.js +7 -12
  46. package/esm/Model/ViewEditModal.js +15 -2
  47. package/esm/Select.js +2 -2
  48. package/esm/Signal/Arg.js +24 -24
  49. package/esm/Signal/Doc.js +17 -26
  50. package/esm/Signal/GraphQL.js +39 -62
  51. package/esm/Signal/Message.js +27 -55
  52. package/esm/Signal/Object.js +4 -12
  53. package/esm/Signal/PubSub.js +22 -56
  54. package/esm/Signal/Response.js +2 -2
  55. package/esm/Signal/RestApi.js +66 -90
  56. package/esm/Signal/WebSocket.js +14 -15
  57. package/esm/System/CSR.js +5 -10
  58. package/esm/System/Common.js +6 -6
  59. package/esm/System/SSR.js +5 -10
  60. package/package.json +1 -1
@@ -4,7 +4,7 @@ import { usePage } from "@akanjs/client";
4
4
  import { capitalize } from "@akanjs/common";
5
5
  import { st } from "@akanjs/store";
6
6
  import { AiOutlineEdit, AiOutlineSave } from "react-icons/ai";
7
- import { BiDotsVertical } from "react-icons/bi";
7
+ import { BiDotsVertical, BiTrash } from "react-icons/bi";
8
8
  import { Modal } from "../Modal";
9
9
  import Remove from "./Remove";
10
10
  import View from "./View";
@@ -62,7 +62,20 @@ function ViewEditModal({
62
62
  /* @__PURE__ */ jsx(Title, {}),
63
63
  /* @__PURE__ */ jsxs("div", { className: "dropdown dropdown-end", children: [
64
64
  /* @__PURE__ */ jsx("label", { tabIndex: 0, className: "btn btn-square m-1", children: /* @__PURE__ */ jsx(BiDotsVertical, {}) }),
65
- /* @__PURE__ */ jsx("ul", { tabIndex: 0, className: "dropdown-content menu bg-base-100 rounded-box z-[1] p-2 shadow-sm", children: model ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Remove, { sliceName, modelId: model.id, modal: null }) }) : null })
65
+ /* @__PURE__ */ jsx("ul", { tabIndex: 0, className: "dropdown-content menu bg-base-100 rounded-box z-[1] p-2 shadow-sm", children: model ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { children: /* @__PURE__ */ jsxs(
66
+ Remove,
67
+ {
68
+ className: "text-error flex items-center gap-2",
69
+ sliceName,
70
+ modelId: model.id,
71
+ modal: null,
72
+ children: [
73
+ /* @__PURE__ */ jsx(BiTrash, {}),
74
+ " ",
75
+ l("base.remove")
76
+ ]
77
+ }
78
+ ) }) }) : null })
66
79
  ] })
67
80
  ] }),
68
81
  action: modelModal === "view" ? /* @__PURE__ */ jsxs(
package/esm/Select.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { Enum } from "@akanjs/base";
3
+ import { isEnum } from "@akanjs/base";
4
4
  import { clsx, usePage } from "@akanjs/client";
5
5
  import { useDebounce } from "@akanjs/next";
6
6
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -31,7 +31,7 @@ const Select = ({
31
31
  const { l } = usePage();
32
32
  const [isOpen, setIsOpen] = useState(false);
33
33
  const labeledOptions = useMemo(
34
- () => options instanceof Enum ? options.values.map((v) => ({
34
+ () => isEnum(options) ? options.values.map((v) => ({
35
35
  label: typeof v === "string" ? v : typeof v === "object" ? JSON.stringify(v) : String(v),
36
36
  value: v
37
37
  })) : options[0]?.label && options[0]?.value ? options : options.map((v) => ({ label: v, value: v })),
package/esm/Signal/Arg.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { getNonArrayModel, isGqlScalar } from "@akanjs/base";
3
+ import { isGqlScalar } from "@akanjs/base";
4
4
  import { usePage } from "@akanjs/client";
5
- import { getGqlTypeStr, getScalarExample } from "@akanjs/constant";
5
+ import { constantInfo, getGqlTypeStr, getScalarExample } from "@akanjs/constant";
6
6
  import { st } from "@akanjs/store";
7
7
  import { AiOutlineDelete } from "react-icons/ai";
8
8
  import { DatePicker } from "../DatePicker";
@@ -11,7 +11,7 @@ import Object from "./Object";
11
11
  function Arg({ argType, value, onChange }) {
12
12
  return argType === "ID" ? /* @__PURE__ */ jsx(Arg.ID, { value, onChange }) : argType === "Int" ? /* @__PURE__ */ jsx(Arg.Int, { value, onChange }) : argType === "Float" ? /* @__PURE__ */ jsx(Arg.Float, { value, onChange }) : argType === "String" ? /* @__PURE__ */ jsx(Arg.String, { value, onChange }) : argType === "Boolean" ? /* @__PURE__ */ jsx(Arg.Boolean, { value, onChange }) : argType === "Date" ? /* @__PURE__ */ jsx(Arg.Date, { value, onChange }) : argType === "JSON" ? /* @__PURE__ */ jsx(Arg.Json, { value, onChange }) : argType === "Upload" ? /* @__PURE__ */ jsx(Arg.Upload, { value, onChange }) : /* @__PURE__ */ jsx(Fragment, {});
13
13
  }
14
- const ArgTable = ({ sigMeta, gqlMeta, argMetas }) => {
14
+ const ArgTable = ({ refName, gqlKey, argMetas }) => {
15
15
  const { l } = usePage();
16
16
  const onCopy = (text) => {
17
17
  void navigator.clipboard.writeText(text);
@@ -26,14 +26,14 @@ const ArgTable = ({ sigMeta, gqlMeta, argMetas }) => {
26
26
  /* @__PURE__ */ jsx("th", { className: "text-center", children: "Description" })
27
27
  ] }) }),
28
28
  argMetas.map((argMeta, idx) => {
29
- const [argRef, argArrDepth] = getNonArrayModel(argMeta.returns());
29
+ const argRef = constantInfo.getModelRef(argMeta.refName, argMeta.modelType);
30
30
  return /* @__PURE__ */ jsx("tbody", { className: "font-normal", children: /* @__PURE__ */ jsxs("tr", { children: [
31
31
  /* @__PURE__ */ jsx("td", { children: argMeta.name }),
32
- /* @__PURE__ */ jsx("td", { className: "text-center", children: /* @__PURE__ */ jsx(Object.Type, { objRef: argRef, arrDepth: argArrDepth }) }),
32
+ /* @__PURE__ */ jsx("td", { className: "text-center", children: /* @__PURE__ */ jsx(Object.Type, { objRef: argRef, arrDepth: argMeta.arrDepth }) }),
33
33
  /* @__PURE__ */ jsx("td", { width: argMeta.argsOption.enum ? "20%" : "10%", className: "text-center", children: argMeta.argsOption.enum ? /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: argMeta.argsOption.enum.map((opt, idx2) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
34
34
  "button",
35
35
  {
36
- "data-tip": l.enum(sigMeta.refName, argMeta.name, opt),
36
+ "data-tip": l._(`${argMeta.argsOption.enum?.refName}.${opt}`),
37
37
  onClick: () => {
38
38
  onCopy(opt);
39
39
  },
@@ -42,19 +42,19 @@ const ArgTable = ({ sigMeta, gqlMeta, argMetas }) => {
42
42
  },
43
43
  idx2
44
44
  ) }, idx2)) }) : "-" }),
45
- /* @__PURE__ */ jsx("td", { className: "text-center", children: l.arg(sigMeta.refName, gqlMeta.key, argMeta.name) }),
46
- /* @__PURE__ */ jsx("td", { className: "text-center", children: l.argdesc(sigMeta.refName, gqlMeta.key, argMeta.name) })
45
+ /* @__PURE__ */ jsx("td", { className: "text-center", children: l._(`${refName}.signal.${gqlKey}.arg.${argMeta.name}`) }),
46
+ /* @__PURE__ */ jsx("td", { className: "text-center", children: l._(`${refName}.signal.${gqlKey}.arg.${argMeta.name}.desc`) })
47
47
  ] }) }, idx);
48
48
  })
49
49
  ] });
50
50
  };
51
51
  Arg.Table = ArgTable;
52
- const ArgParam = ({ argMeta, value, onChange }) => {
53
- const [argRef, argArrDepth] = getNonArrayModel(argMeta.returns());
52
+ const ArgParam = ({ gqlKey, argMeta, value, onChange }) => {
53
+ const argRef = constantInfo.getModelRef(argMeta.refName, argMeta.modelType);
54
54
  if (!isGqlScalar(argRef))
55
- throw new Error(`Param arg - ${argMeta.key}/${argMeta.name} must be scalar`);
56
- else if (argArrDepth > 0)
57
- throw new Error(`Param arg - ${argMeta.key}/${argMeta.name} must not be array`);
55
+ throw new Error(`Param arg - ${gqlKey}/${argMeta.name} must be scalar`);
56
+ else if (argMeta.arrDepth > 0)
57
+ throw new Error(`Param arg - ${gqlKey}/${argMeta.name} must not be array`);
58
58
  const argType = getGqlTypeStr(argRef);
59
59
  return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2", children: [
60
60
  /* @__PURE__ */ jsxs("div", { className: "w-36 pl-2", children: [
@@ -65,19 +65,19 @@ const ArgParam = ({ argMeta, value, onChange }) => {
65
65
  ] });
66
66
  };
67
67
  Arg.Param = ArgParam;
68
- const ArgQuery = ({ argMeta, value, onChange }) => {
69
- const [argRef, argArrDepth] = getNonArrayModel(argMeta.returns());
68
+ const ArgQuery = ({ gqlKey, argMeta, value, onChange }) => {
69
+ const argRef = constantInfo.getModelRef(argMeta.refName, argMeta.modelType);
70
70
  if (!isGqlScalar(argRef))
71
- throw new Error(`Query arg - ${argMeta.key}/${argMeta.name} must be scalar`);
72
- else if (argArrDepth > 1)
73
- throw new Error(`Query arg - ${argMeta.key}/${argMeta.name} must not be more than 2D array`);
71
+ throw new Error(`Query arg - ${gqlKey}/${argMeta.name} must be scalar`);
72
+ else if (argMeta.arrDepth > 1)
73
+ throw new Error(`Query arg - ${gqlKey}/${argMeta.name} must not be more than 2D array`);
74
74
  const argType = getGqlTypeStr(argRef);
75
75
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
76
76
  /* @__PURE__ */ jsxs("div", { className: "w-36 pl-2", children: [
77
77
  "- ",
78
78
  argMeta.name
79
79
  ] }),
80
- /* @__PURE__ */ jsx("div", { className: "w-full", children: argArrDepth && Array.isArray(value) ? /* @__PURE__ */ jsxs("div", { children: [
80
+ /* @__PURE__ */ jsx("div", { className: "w-full", children: argMeta.arrDepth > 0 && Array.isArray(value) ? /* @__PURE__ */ jsxs("div", { children: [
81
81
  value.map((val, idx) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
82
82
  /* @__PURE__ */ jsx(
83
83
  Arg,
@@ -114,12 +114,12 @@ const ArgQuery = ({ argMeta, value, onChange }) => {
114
114
  ] });
115
115
  };
116
116
  Arg.Query = ArgQuery;
117
- const ArgFormData = ({ argMeta, value, onChange }) => {
118
- const [argRef, argArrDepth] = getNonArrayModel(argMeta.returns());
117
+ const ArgFormData = ({ gqlKey, argMeta, value, onChange }) => {
118
+ const argRef = constantInfo.getModelRef(argMeta.refName, argMeta.modelType);
119
119
  if (getGqlTypeStr(argRef) !== "Upload")
120
- throw new Error(`FormData arg - ${argMeta.key}/${argMeta.name} must be Upload`);
121
- else if (argArrDepth < 1)
122
- throw new Error(`FormData arg - ${argMeta.key}/${argMeta.name} must be array`);
120
+ throw new Error(`FormData arg - ${gqlKey}/${argMeta.name} must be Upload`);
121
+ else if (argMeta.arrDepth < 1)
122
+ throw new Error(`FormData arg - ${gqlKey}/${argMeta.name} must be array`);
123
123
  return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2", children: [
124
124
  /* @__PURE__ */ jsxs("div", { className: "w-36 pl-2", children: [
125
125
  "- ",
package/esm/Signal/Doc.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { usePage } from "@akanjs/client";
4
4
  import { lowerlize } from "@akanjs/common";
5
- import { client, defaultAccount, getAllSignalRefs, getSigMeta, roleTypes } from "@akanjs/signal";
5
+ import { client, defaultAccount } from "@akanjs/signal";
6
6
  import { st } from "@akanjs/store";
7
7
  import decode from "jsonwebtoken/decode";
8
- import { useState } from "react";
8
+ import { useEffect, useState } from "react";
9
9
  import { AiOutlineApi, AiOutlineCopy } from "react-icons/ai";
10
10
  import { BiLock, BiLogoGraphql } from "react-icons/bi";
11
11
  import { Copy } from "../Copy";
@@ -17,12 +17,20 @@ import WebSocket from "./WebSocket";
17
17
  function Doc() {
18
18
  return /* @__PURE__ */ jsx("div", {});
19
19
  }
20
- const DocSetting = () => {
20
+ const DocSetting = ({
21
+ guardNames = ["Public"],
22
+ roleTypes = ["Public", "User", "Admin", "SuperAdmin"],
23
+ roleKeys = { me: "Admin", self: "User" }
24
+ }) => {
21
25
  const trySignalType = st.use.trySignalType();
22
26
  const tryRoles = st.use.tryRoles();
23
27
  const tryAccount = st.use.tryAccount();
28
+ useEffect(() => {
29
+ st.set({ tryRoles: [...roleTypes] });
30
+ }, []);
24
31
  const tryRoleForAll = roleTypes.every((roleType) => tryRoles.includes(roleType));
25
32
  const baseUrl = trySignalType === "graphql" ? client.uri : client.uri.replace("/graphql", "");
33
+ const currentRoles = Object.entries(roleKeys).filter(([key, roleType]) => !!tryAccount[key]).map(([key, roleType]) => roleType);
26
34
  return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-wrap items-center justify-between gap-4", children: [
27
35
  /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-1", children: [
28
36
  "BaseURL:",
@@ -93,14 +101,10 @@ const DocSetting = () => {
93
101
  ] }),
94
102
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
95
103
  "Auth:",
96
- /* @__PURE__ */ jsx(DocAuthModal, { children: /* @__PURE__ */ jsxs("button", { className: `btn btn-sm ${!tryAccount.me && !tryAccount.self ? "btn-neutral" : "btn-warning"} `, children: [
104
+ /* @__PURE__ */ jsx(DocAuthModal, { children: /* @__PURE__ */ jsxs("button", { className: `btn btn-sm ${currentRoles.length > 0 ? "btn-warning" : "btn-neutral"} `, children: [
97
105
  /* @__PURE__ */ jsx(BiLock, {}),
98
106
  " ",
99
- [
100
- tryAccount.me ? "Admin" : null,
101
- tryAccount.self ? "User" : null,
102
- !tryAccount.me && !tryAccount.self ? "Public" : null
103
- ].filter((roleType) => !!roleType).join(",")
107
+ currentRoles.length > 0 ? currentRoles.join(", ") : "Public"
104
108
  ] }) })
105
109
  ] })
106
110
  ] });
@@ -154,18 +158,7 @@ const DocAuthModal = ({ children }) => {
154
158
  /* @__PURE__ */ jsx(Input, { inputClassName: "w-full", value: jwt ?? "", onChange: setJwt, validate: () => true })
155
159
  ] }),
156
160
  /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
157
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
158
- "Account Decoded",
159
- !decodedAccount?.me && !decodedAccount?.self ? /* @__PURE__ */ jsx("div", { className: "badge badge-primary", children: "Public" }) : null,
160
- decodedAccount?.me?.roles.map((role) => /* @__PURE__ */ jsxs("div", { className: "badge badge-warning", children: [
161
- "Admin-",
162
- role
163
- ] }, role)),
164
- decodedAccount?.self?.roles.map((role) => /* @__PURE__ */ jsxs("div", { className: "badge badge-neutral", children: [
165
- "User-",
166
- role
167
- ] }, role))
168
- ] }),
161
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: "Account Decoded" }),
169
162
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
170
163
  /* @__PURE__ */ jsx(
171
164
  Input.TextArea,
@@ -190,10 +183,8 @@ const DocAuthModal = ({ children }) => {
190
183
  };
191
184
  Doc.AuthModal = DocAuthModal;
192
185
  const DocSignals = () => {
193
- const sigRefs = getAllSignalRefs();
194
- const refNames = [...new Set(sigRefs.map((sigRef) => getSigMeta(sigRef).refName))].sort(
195
- (a, b) => lowerlize(a) > lowerlize(b) ? 1 : -1
196
- );
186
+ const signals = global.signals;
187
+ const refNames = signals.map((signal) => signal.refName).sort((a, b) => lowerlize(a) > lowerlize(b) ? 1 : -1);
197
188
  return /* @__PURE__ */ jsx("div", { children: refNames.map((refName, idx) => {
198
189
  return /* @__PURE__ */ jsx("div", { className: "px-5 pb-5 text-3xl font-bold", children: /* @__PURE__ */ jsx(DocSignal, { refName }) }, idx);
199
190
  }) });
@@ -214,7 +205,7 @@ const Zone = ({ refName, openAll }) => {
214
205
  /* @__PURE__ */ jsx("div", { className: "text-3xl font-bold", children: refName }),
215
206
  /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
216
207
  " - ",
217
- l.field(refName, "modelDesc")
208
+ l._(`${refName}.modelDesc`)
218
209
  ] }),
219
210
  /* @__PURE__ */ jsx("div", { className: "text-2xl font-bold", children: "APIs" }),
220
211
  /* @__PURE__ */ jsx(DocSetting, {}),
@@ -1,17 +1,9 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { getNonArrayModel, isGqlScalar } from "@akanjs/base";
3
+ import { isGqlScalar } from "@akanjs/base";
4
4
  import { usePage } from "@akanjs/client";
5
5
  import { constantInfo } from "@akanjs/constant";
6
- import {
7
- fetch,
8
- getArgMetas,
9
- getGqlMetas,
10
- getGqlStr,
11
- getSigMeta,
12
- getSignalRefsOnStorage,
13
- makeRequestExample
14
- } from "@akanjs/signal";
6
+ import { fetch, getGqlStr, makeRequestExample } from "@akanjs/signal";
15
7
  import { st } from "@akanjs/store";
16
8
  import { useMemo, useState } from "react";
17
9
  import { AiOutlineFileWord, AiOutlineSend } from "react-icons/ai";
@@ -24,43 +16,39 @@ function GraphQL() {
24
16
  return /* @__PURE__ */ jsx("div", {});
25
17
  }
26
18
  const GraphQLEndpoints = ({ refName, openAll }) => {
27
- const sigRefs = getSignalRefsOnStorage(refName);
19
+ const signals = global.signals;
20
+ const signal = signals.find((signal2) => signal2.refName === refName);
28
21
  const tryRoles = st.use.tryRoles();
29
- const gqlInfos = sigRefs.reduce(
30
- (acc, sigRef) => [...acc, ...getGqlMetas(sigRef).map((gqlMeta) => ({ key: gqlMeta.key, gqlMeta, sigRef }))],
31
- []
32
- ).sort((a, b) => a.key > b.key ? 1 : -1).filter(({ gqlMeta }) => gqlMeta.signalOption.onlyFor !== "restapi").filter(({ gqlMeta }) => {
33
- if (gqlMeta.type === "Pubsub" || gqlMeta.type === "Message")
22
+ if (!signal)
23
+ return null;
24
+ const gqlInfos = global.Object.entries(signal.endpoint).sort(([keyA], [keyB]) => keyA > keyB ? 1 : -1).filter(([key, gqlMeta]) => gqlMeta.signalOption?.onlyFor !== "restapi").filter(([key, gqlMeta]) => {
25
+ if (gqlMeta.type !== "query" && gqlMeta.type !== "mutation")
34
26
  return false;
35
- if (gqlMeta.guards.includes("Public") && tryRoles.includes("Public"))
27
+ if (gqlMeta.signalOption?.guards?.includes("Public") && tryRoles.includes("Public"))
36
28
  return true;
37
- if ((gqlMeta.guards.includes("User") || gqlMeta.guards.includes("Every")) && tryRoles.includes("User"))
29
+ if ((gqlMeta.signalOption?.guards?.includes("User") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("User"))
38
30
  return true;
39
- if ((gqlMeta.guards.includes("Admin") || gqlMeta.guards.includes("Every")) && tryRoles.includes("Admin"))
31
+ if ((gqlMeta.signalOption?.guards?.includes("Admin") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("Admin"))
40
32
  return true;
41
- if (gqlMeta.guards.includes("SuperAdmin") && tryRoles.includes("SuperAdmin"))
33
+ if ((gqlMeta.signalOption?.guards?.includes("SuperAdmin") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("SuperAdmin"))
42
34
  return true;
43
35
  return false;
44
36
  });
45
- return /* @__PURE__ */ jsx("div", { children: gqlInfos.map(({ gqlMeta, sigRef }, idx) => /* @__PURE__ */ jsx(GraphQLEndpoint, { sigRef, gqlMeta, open: openAll }, idx)) });
37
+ return /* @__PURE__ */ jsx("div", { children: gqlInfos.map(([gqlKey, gqlMeta], idx) => /* @__PURE__ */ jsx(GraphQLEndpoint, { refName, gqlKey, gqlMeta, open: openAll }, idx)) });
46
38
  };
47
39
  GraphQL.Endpoints = GraphQLEndpoints;
48
- const GraphQLEndpoint = ({ sigRef, gqlMeta, open }) => {
40
+ const GraphQLEndpoint = ({ refName, gqlKey, gqlMeta, open }) => {
49
41
  const { l } = usePage();
50
- const sigMeta = getSigMeta(sigRef);
51
42
  const [viewStatus, setViewStatus] = useState("doc");
52
- const [argMetas] = getArgMetas(sigRef, gqlMeta.key);
53
- const gqlArgMetas = argMetas.filter((argMeta) => argMeta.type !== "Upload");
54
- const uploadArgMetas = argMetas.filter((argMeta) => argMeta.type === "Upload");
55
43
  return /* @__PURE__ */ jsxs("div", { className: "collapse-arrow bg-base-300 collapse my-1", children: [
56
44
  /* @__PURE__ */ jsx("input", { type: "checkbox", checked: open }),
57
45
  /* @__PURE__ */ jsx("div", { className: "collapse-title text-xl", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
58
- /* @__PURE__ */ jsx("div", { className: `btn btn-xs w-16 ${gqlMeta.type === "Query" ? "btn-success" : "btn-accent"}`, children: gqlMeta.type }),
59
- gqlMeta.key,
46
+ /* @__PURE__ */ jsx("div", { className: `btn btn-xs w-16 ${gqlMeta.type === "query" ? "btn-success" : "btn-accent"}`, children: gqlMeta.type }),
47
+ gqlKey,
60
48
  " ",
61
49
  /* @__PURE__ */ jsxs("span", { className: "text-sm", children: [
62
50
  "(",
63
- l.api(sigMeta.refName, gqlMeta.key),
51
+ l._(`${refName}.signal.${gqlKey}`),
64
52
  ")"
65
53
  ] })
66
54
  ] }) }),
@@ -68,9 +56,9 @@ const GraphQLEndpoint = ({ sigRef, gqlMeta, open }) => {
68
56
  /* @__PURE__ */ jsxs("div", { className: "mt-4 text-lg", children: [
69
57
  "Description",
70
58
  /* @__PURE__ */ jsx("hr", { className: "my-2 border-[0.1px] border-gray-400" }),
71
- gqlMeta.guards.some((guard) => guard !== "None") ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-3 pl-3 text-base font-normal", children: [
59
+ gqlMeta.signalOption?.guards?.some((guard) => guard !== "None") ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-3 pl-3 text-base font-normal", children: [
72
60
  "- Guards:",
73
- gqlMeta.guards.map((guard) => /* @__PURE__ */ jsx(
61
+ gqlMeta.signalOption.guards.map((guard) => /* @__PURE__ */ jsx(
74
62
  "span",
75
63
  {
76
64
  className: `badge ${guard === "Public" ? "badge-success" : guard === "SuperAdmin" ? "badge-error" : guard === "Admin" ? "badge-error" : guard === "User" ? "badge-accent" : guard === "Owner" ? "badge-accent" : guard === "Every" ? "badge-warning" : ""}`,
@@ -81,7 +69,7 @@ const GraphQLEndpoint = ({ sigRef, gqlMeta, open }) => {
81
69
  ] }) : null,
82
70
  /* @__PURE__ */ jsxs("div", { className: "pb-3 pl-3 text-base font-normal", children: [
83
71
  "- ",
84
- l.apidesc(sigMeta.refName, gqlMeta.key)
72
+ l._(`${refName}.signal.${gqlKey}.desc`)
85
73
  ] })
86
74
  ] }),
87
75
  /* @__PURE__ */ jsxs("div", { className: "my-4 flex w-full gap-5 px-5", children: [
@@ -112,31 +100,25 @@ const GraphQLEndpoint = ({ sigRef, gqlMeta, open }) => {
112
100
  }
113
101
  )
114
102
  ] }),
115
- viewStatus === "doc" ? /* @__PURE__ */ jsx(
116
- GraphQLInterface,
117
- {
118
- sigRef,
119
- gqlMeta,
120
- gqlArgMetas,
121
- uploadArgMetas
122
- }
123
- ) : /* @__PURE__ */ jsx(GraphQLTry, { sigRef, gqlMeta, gqlArgMetas, uploadArgMetas })
103
+ viewStatus === "doc" ? /* @__PURE__ */ jsx(GraphQLInterface, { refName, gqlKey, gqlMeta }) : /* @__PURE__ */ jsx(GraphQLTry, { gqlKey, gqlMeta })
124
104
  ] })
125
105
  ] });
126
106
  };
127
107
  GraphQL.Endpoint = GraphQLEndpoint;
128
- const GraphQLInterface = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
129
- const sigMeta = getSigMeta(sigRef);
130
- const [returnRef, arrDepth] = getNonArrayModel(gqlMeta.returns());
108
+ const GraphQLInterface = ({ refName, gqlKey, gqlMeta }) => {
109
+ const returnRef = constantInfo.getModelRef(gqlMeta.returns.refName, gqlMeta.returns.modelType);
110
+ const arrDepth = gqlMeta.returns.arrDepth;
131
111
  const isReturnModelType = !isGqlScalar(returnRef);
112
+ const uploadArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Upload");
113
+ const gqlArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type !== "Upload");
132
114
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
133
115
  uploadArgMetas.length ? /* @__PURE__ */ jsxs("div", { children: [
134
116
  /* @__PURE__ */ jsx("div", { className: "text-lg", children: "Form data upload" }),
135
- /* @__PURE__ */ jsx("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { sigMeta, gqlMeta, argMetas: uploadArgMetas }) })
117
+ /* @__PURE__ */ jsx("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { refName, gqlKey, argMetas: uploadArgMetas }) })
136
118
  ] }) : null,
137
119
  gqlArgMetas.length ? /* @__PURE__ */ jsxs("div", { className: "text-start", children: [
138
120
  /* @__PURE__ */ jsx("span", { className: "text-start text-xl font-bold", children: "Variables" }),
139
- /* @__PURE__ */ jsx("div", { className: "bg-base-100 mt-3 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { sigMeta, gqlMeta, argMetas: gqlArgMetas }) })
121
+ /* @__PURE__ */ jsx("div", { className: "bg-base-100 mt-3 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { refName, gqlKey, argMetas: gqlArgMetas }) })
140
122
  ] }) : null,
141
123
  /* @__PURE__ */ jsx("div", { className: "text-lg font-bold", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-2 rounded-md font-normal md:flex-col", children: [
142
124
  /* @__PURE__ */ jsxs("div", { className: "w-full text-start md:w-full", children: [
@@ -149,27 +131,21 @@ const GraphQLInterface = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
149
131
  ] }),
150
132
  /* @__PURE__ */ jsxs("div", { className: "w-full text-start md:w-full", children: [
151
133
  /* @__PURE__ */ jsx("span", { className: "text-xl font-bold", children: "Response Example" }),
152
- /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(Response.Example, { sigRef, gqlMeta }) })
134
+ /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(Response.Example, { gqlMeta }) })
153
135
  ] })
154
136
  ] }) })
155
137
  ] });
156
138
  };
157
139
  GraphQL.Interface = GraphQLInterface;
158
- const GraphQLTry = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
140
+ const GraphQLTry = ({ gqlKey, gqlMeta }) => {
159
141
  const tryJwt = st.use.tryJwt();
160
- const [modelRef, arrDepth] = getNonArrayModel(gqlMeta.returns());
142
+ const modelRef = constantInfo.getModelRef(gqlMeta.returns.refName, gqlMeta.returns.modelType);
143
+ const uploadArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Upload");
144
+ const gqlArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type !== "Upload");
161
145
  const isScalar = isGqlScalar(modelRef);
162
- const returnRef = isScalar || arrDepth === 0 ? modelRef : constantInfo.isFull(modelRef) ? constantInfo.getDatabase(constantInfo.getRefName(modelRef)).light : modelRef;
163
- const gqlStr = useMemo(
164
- () => getGqlStr(
165
- modelRef,
166
- gqlMeta.key,
167
- [...gqlArgMetas, ...uploadArgMetas].sort((a, b) => a.idx - b.idx),
168
- returnRef
169
- ),
170
- []
171
- );
172
- const requestExample = useMemo(() => JSON.stringify(makeRequestExample(sigRef, gqlMeta.key), null, 2), []);
146
+ const returnRef = isScalar || gqlMeta.returns.arrDepth === 0 ? modelRef : constantInfo.isFull(modelRef) ? constantInfo.getDatabase(constantInfo.getRefName(modelRef)).light : modelRef;
147
+ const gqlStr = useMemo(() => getGqlStr(modelRef, gqlKey, gqlMeta, returnRef), []);
148
+ const requestExample = useMemo(() => JSON.stringify(makeRequestExample(gqlMeta), null, 2), []);
173
149
  const [gqlRequest, setGqlRequest] = useState(requestExample);
174
150
  const [uploadRequest, setUploadRequest] = useState({});
175
151
  const [response, setResponse] = useState({
@@ -179,8 +155,8 @@ const GraphQLTry = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
179
155
  const onSend = async () => {
180
156
  setResponse({ status: "loading", data: null });
181
157
  const request = { ...JSON.parse(gqlRequest), ...uploadRequest };
182
- const argData = [...gqlArgMetas, ...uploadArgMetas].sort((a, b) => a.idx - b.idx).map((argMeta) => request[argMeta.name]);
183
- const fetchFn = fetch[gqlMeta.key].bind(fetch);
158
+ const argData = gqlMeta.args.map((argMeta) => request[argMeta.name]);
159
+ const fetchFn = fetch[gqlKey].bind(fetch);
184
160
  const data = await fetchFn(...argData, {
185
161
  token: tryJwt,
186
162
  onError: (data2) => {
@@ -195,6 +171,7 @@ const GraphQLTry = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
195
171
  uploadArgMetas.map((argMeta) => /* @__PURE__ */ jsx(
196
172
  Arg.FormData,
197
173
  {
174
+ gqlKey,
198
175
  argMeta,
199
176
  value: uploadRequest[argMeta.name],
200
177
  onChange: (fileList) => {
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { getNonArrayModel, isGqlScalar } from "@akanjs/base";
3
+ import { isGqlScalar } from "@akanjs/base";
4
4
  import { usePage } from "@akanjs/client";
5
5
  import { capitalize } from "@akanjs/common";
6
- import { fetch, getArgMetas, getSigMeta, makeRequestExample } from "@akanjs/signal";
7
- import { st } from "@akanjs/store";
6
+ import { constantInfo } from "@akanjs/constant";
7
+ import { fetch, makeRequestExample } from "@akanjs/signal";
8
8
  import { useEffect, useMemo, useState } from "react";
9
9
  import { AiOutlineDisconnect, AiOutlineFileWord, AiOutlineSend, AiOutlineSwap } from "react-icons/ai";
10
10
  import { BiSolidNetworkChart } from "react-icons/bi";
@@ -15,22 +15,20 @@ import Response from "./Response";
15
15
  function Message() {
16
16
  return /* @__PURE__ */ jsx("div", {});
17
17
  }
18
- const MessageEndpoint = ({ sigRef, gqlMeta, open }) => {
18
+ const MessageEndpoint = ({ refName, gqlKey, gqlMeta, open }) => {
19
19
  const { l } = usePage();
20
- const sigMeta = getSigMeta(sigRef);
21
20
  const [viewStatus, setViewStatus] = useState("doc");
22
- const [argMetas] = getArgMetas(sigRef, gqlMeta.key);
23
- const gqlArgMetas = argMetas.filter((argMeta) => argMeta.type !== "Upload");
24
- const uploadArgMetas = argMetas.filter((argMeta) => argMeta.type === "Upload");
21
+ const gqlArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type !== "Upload");
22
+ const uploadArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Upload");
25
23
  return /* @__PURE__ */ jsxs("div", { className: "collapse-arrow bg-base-300 collapse my-1", children: [
26
24
  /* @__PURE__ */ jsx("input", { type: "checkbox", checked: open }),
27
25
  /* @__PURE__ */ jsx("div", { className: "collapse-title text-xl", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
28
- /* @__PURE__ */ jsx("div", { className: `btn btn-xs w-16 ${gqlMeta.type === "Pubsub" ? "btn-info" : "btn-warning"}`, children: gqlMeta.type }),
29
- gqlMeta.key,
26
+ /* @__PURE__ */ jsx("div", { className: `btn btn-xs w-16 ${gqlMeta.type === "pubsub" ? "btn-info" : "btn-warning"}`, children: gqlMeta.type }),
27
+ gqlKey,
30
28
  " ",
31
29
  /* @__PURE__ */ jsxs("span", { className: "text-sm", children: [
32
30
  "(",
33
- l.api(sigMeta.refName, gqlMeta.key),
31
+ l._(`${refName}.signal.${gqlKey}`),
34
32
  ")"
35
33
  ] })
36
34
  ] }) }),
@@ -38,9 +36,9 @@ const MessageEndpoint = ({ sigRef, gqlMeta, open }) => {
38
36
  /* @__PURE__ */ jsxs("div", { className: "mt-4 text-lg", children: [
39
37
  "Description",
40
38
  /* @__PURE__ */ jsx("hr", { className: "my-2 border-[0.1px] border-gray-400" }),
41
- gqlMeta.guards.some((guard) => guard !== "None") ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-3 pl-3 text-base font-normal", children: [
39
+ gqlMeta.signalOption?.guards?.some((guard) => guard !== "None") ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-3 pl-3 text-base font-normal", children: [
42
40
  "- Guards:",
43
- gqlMeta.guards.map((guard) => /* @__PURE__ */ jsx(
41
+ gqlMeta.signalOption.guards.map((guard) => /* @__PURE__ */ jsx(
44
42
  "span",
45
43
  {
46
44
  className: `badge ${guard === "Public" ? "badge-success" : guard === "SuperAdmin" ? "badge-error" : guard === "Admin" ? "badge-error" : guard === "User" ? "badge-accent" : guard === "Owner" ? "badge-accent" : guard === "Every" ? "badge-warning" : ""}`,
@@ -51,7 +49,7 @@ const MessageEndpoint = ({ sigRef, gqlMeta, open }) => {
51
49
  ] }) : null,
52
50
  /* @__PURE__ */ jsxs("div", { className: "pb-3 pl-3 text-base font-normal", children: [
53
51
  "- ",
54
- l.apidesc(sigMeta.refName, gqlMeta.key)
52
+ l._(`${refName}.signal.${gqlKey}.desc`)
55
53
  ] })
56
54
  ] }),
57
55
  /* @__PURE__ */ jsxs("div", { className: "my-4 flex w-full gap-5 px-5", children: [
@@ -82,69 +80,57 @@ const MessageEndpoint = ({ sigRef, gqlMeta, open }) => {
82
80
  }
83
81
  )
84
82
  ] }),
85
- viewStatus === "doc" ? /* @__PURE__ */ jsx(
86
- MessageInterface,
87
- {
88
- sigRef,
89
- gqlMeta,
90
- gqlArgMetas,
91
- uploadArgMetas
92
- }
93
- ) : /* @__PURE__ */ jsx(MessageTry, { sigRef, gqlMeta, gqlArgMetas, uploadArgMetas })
83
+ viewStatus === "doc" ? /* @__PURE__ */ jsx(MessageInterface, { refName, gqlKey, gqlMeta }) : /* @__PURE__ */ jsx(MessageTry, { gqlKey, gqlMeta })
94
84
  ] })
95
85
  ] });
96
86
  };
97
87
  Message.Endpoint = MessageEndpoint;
98
- const MessageInterface = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
99
- const sigMeta = getSigMeta(sigRef);
100
- const [returnRef, arrDepth] = getNonArrayModel(gqlMeta.returns());
88
+ const MessageInterface = ({ refName, gqlKey, gqlMeta }) => {
89
+ const returnRef = constantInfo.getModelRef(gqlMeta.returns.refName, gqlMeta.returns.modelType);
90
+ const uploadArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Upload");
91
+ const gqlArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type !== "Upload");
101
92
  const isReturnModelType = !isGqlScalar(returnRef);
102
93
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
103
94
  uploadArgMetas.length ? /* @__PURE__ */ jsxs("div", { children: [
104
95
  /* @__PURE__ */ jsx("div", { className: "text-lg", children: "Form data upload" }),
105
- /* @__PURE__ */ jsx("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { sigMeta, gqlMeta, argMetas: uploadArgMetas }) })
96
+ /* @__PURE__ */ jsx("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { refName, gqlKey, argMetas: uploadArgMetas }) })
106
97
  ] }) : null,
107
98
  gqlArgMetas.length ? /* @__PURE__ */ jsxs("div", { children: [
108
99
  /* @__PURE__ */ jsx("div", { className: "text-lg", children: "Variables" }),
109
- /* @__PURE__ */ jsx("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { sigMeta, gqlMeta, argMetas: gqlArgMetas }) })
100
+ /* @__PURE__ */ jsx("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ jsx(Arg.Table, { refName, gqlKey, argMetas: gqlArgMetas }) })
110
101
  ] }) : null,
111
102
  /* @__PURE__ */ jsx("div", { className: "text-lg font-bold", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-2 rounded-md font-normal md:flex-row", children: [
112
103
  /* @__PURE__ */ jsxs("div", { className: "w-full md:w-1/2", children: [
113
104
  "Response Type",
114
105
  /* @__PURE__ */ jsxs("div", { className: "bg-base-100 max-h-[500px] overflow-auto rounded-md p-4 md:h-[500px]", children: [
115
106
  "Returns: ",
116
- /* @__PURE__ */ jsx(Object.Type, { objRef: returnRef, arrDepth }),
107
+ /* @__PURE__ */ jsx(Object.Type, { objRef: returnRef, arrDepth: gqlMeta.returns.arrDepth }),
117
108
  isReturnModelType ? /* @__PURE__ */ jsx(Object.Detail, { objRef: returnRef }) : null
118
109
  ] })
119
110
  ] }),
120
111
  /* @__PURE__ */ jsxs("div", { className: "w-full md:w-1/2", children: [
121
112
  "Response Example",
122
- /* @__PURE__ */ jsx(Response.Example, { sigRef, gqlMeta })
113
+ /* @__PURE__ */ jsx(Response.Example, { gqlMeta })
123
114
  ] })
124
115
  ] }) })
125
116
  ] });
126
117
  };
127
118
  Message.Interface = MessageInterface;
128
- const MessageTry = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
129
- const tryJwt = st.use.tryJwt();
130
- const [modelRef, arrDepth] = getNonArrayModel(gqlMeta.returns());
131
- const isScalar = isGqlScalar(modelRef);
132
- const requestExample = useMemo(() => JSON.stringify(makeRequestExample(sigRef, gqlMeta.key), null, 2), []);
119
+ const MessageTry = ({ gqlKey, gqlMeta }) => {
120
+ const requestExample = useMemo(() => JSON.stringify(makeRequestExample(gqlMeta), null, 2), []);
133
121
  const [gqlRequest, setGqlRequest] = useState(requestExample);
134
- const [uploadRequest, setUploadRequest] = useState({});
135
122
  const [stopListen, setStopListen] = useState(null);
136
123
  const [messages, setMessages] = useState("");
137
124
  const [response, setResponse] = useState({ status: "ready", data: "" });
138
125
  const onSend = async () => {
139
- const request = { ...JSON.parse(gqlRequest), ...uploadRequest };
140
- const argData = [...gqlArgMetas, ...uploadArgMetas].sort((a, b) => a.idx - b.idx).map((argMeta) => request[argMeta.name]);
141
- const fetchFn = fetch[gqlMeta.key].bind(fetch);
126
+ const request = JSON.parse(gqlRequest);
127
+ const argData = gqlMeta.args.map((argMeta) => request[argMeta.name]);
128
+ const fetchFn = fetch[gqlKey].bind(fetch);
142
129
  await fetchFn(...argData);
143
130
  };
144
131
  const onListen = () => {
145
132
  setResponse({ status: "loading", data: null });
146
- const request = { ...JSON.parse(gqlRequest), ...uploadRequest };
147
- const fetchFn = fetch[`listen${capitalize(gqlMeta.key)}`].bind(fetch);
133
+ const fetchFn = fetch[`listen${capitalize(gqlKey)}`].bind(fetch);
148
134
  setResponse({ status: "loading", data: messages });
149
135
  const stopListen2 = fetchFn((data) => {
150
136
  setMessages(
@@ -171,20 +157,6 @@ ${data}` : typeof data === "object" ? [...prev && prev.length ? [...prev] : [],
171
157
  };
172
158
  }, [stopListen]);
173
159
  return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-4", children: [
174
- uploadArgMetas.length ? /* @__PURE__ */ jsxs("div", { children: [
175
- /* @__PURE__ */ jsx("div", { className: "text-lg", children: "Form data uplaod" }),
176
- uploadArgMetas.map((argMeta) => /* @__PURE__ */ jsx(
177
- Arg.FormData,
178
- {
179
- argMeta,
180
- value: uploadRequest[argMeta.name],
181
- onChange: (fileList) => {
182
- setUploadRequest({ ...uploadRequest, [argMeta.name]: fileList });
183
- }
184
- },
185
- argMeta.name
186
- ))
187
- ] }) : null,
188
160
  /* @__PURE__ */ jsxs("div", { children: [
189
161
  /* @__PURE__ */ jsx("div", { className: "grid gap-2 lg:grid-cols-2", children: /* @__PURE__ */ jsxs("div", { children: [
190
162
  /* @__PURE__ */ jsx("div", { className: "text-lg", children: "Variables" }),