@cartanova/qgrid-cli 1.4.0 → 1.5.1

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 (28) hide show
  1. package/bundle/dist/application/qgrid/pool.js +6 -3
  2. package/bundle/dist/application/qgrid/worker.js +1 -1
  3. package/bundle/src/application/qgrid/pool.ts +6 -2
  4. package/bundle/src/application/qgrid/worker.ts +1 -1
  5. package/bundle/web-dist/client/assets/copy-dnxfhGiF.js +1 -0
  6. package/bundle/web-dist/client/assets/index-BVj-Wxnl.css +1 -0
  7. package/bundle/web-dist/client/assets/index-C8rLkdK0.js +116 -0
  8. package/bundle/web-dist/client/assets/logs-BhPrkIxX.js +1 -0
  9. package/bundle/web-dist/client/assets/preload-helper-ca-nBW7U.js +1 -0
  10. package/bundle/web-dist/client/assets/routes-C8VZv8Ii.js +5 -0
  11. package/bundle/web-dist/client/assets/show-QSjdjp8w.js +29 -0
  12. package/bundle/web-dist/client/assets/tokens-BX0VO0Os.js +1 -0
  13. package/bundle/web-dist/client/index.html +3 -2
  14. package/bundle/web-dist/server/assets/copy-C9YkjJVm.js +42 -0
  15. package/bundle/web-dist/server/assets/lazyRouteComponent-Dyl_0WZs.js +1982 -0
  16. package/bundle/web-dist/server/assets/logs-bLRMIO1J.js +244 -0
  17. package/bundle/web-dist/server/assets/{routes-Dx59lTlD.js → routes-qwzTPLE2.js} +14 -388
  18. package/bundle/web-dist/server/assets/{show-BEFi1cKV.js → show-CvoILmu3.js} +237 -33
  19. package/bundle/web-dist/server/assets/{tokens-Dyi6qMmP.js → tokens-BWmL4GfT.js} +2 -40
  20. package/bundle/web-dist/server/entry-server.generated.js +70 -2008
  21. package/dist/cli.js +25 -4
  22. package/package.json +1 -1
  23. package/bundle/web-dist/client/assets/index-BP0XRvKL.css +0 -1
  24. package/bundle/web-dist/client/assets/index-CgXTSTgN.js +0 -116
  25. package/bundle/web-dist/client/assets/routes-DvViUcG1.js +0 -5
  26. package/bundle/web-dist/client/assets/show-CFGLH8f_.js +0 -29
  27. package/bundle/web-dist/client/assets/tokens-Bib8aQbc.js +0 -1
  28. /package/bundle/web-dist/client/assets/{services.generated-CAJQk7Wk.js → services.generated-1X7EKUWg.js} +0 -0
@@ -1,6 +1,8 @@
1
1
  import { $ as __commonJSMin, S as require_react, et as __exportAll, nt as __toESM, x as require_jsx_runtime } from "./sd.generated-BeEKgSOs.js";
2
2
  import { n as RequestLogService } from "./services.generated-DjxCLdMu.js";
3
- import { a as Link, t as Route } from "../entry-server.generated.js";
3
+ import { a as Link } from "./lazyRouteComponent-Dyl_0WZs.js";
4
+ import { t as Route } from "../entry-server.generated.js";
5
+ import { n as lucideCheck, t as lucideCopy } from "./copy-C9YkjJVm.js";
4
6
  import minpath from "node:path";
5
7
  import minproc from "node:process";
6
8
  import { fileURLToPath as urlToPath } from "node:url";
@@ -18108,7 +18110,7 @@ function isUint8Array(value) {
18108
18110
  * Transformed URL (optional).
18109
18111
  */
18110
18112
  var import_jsx_runtime = require_jsx_runtime();
18111
- require_react();
18113
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
18112
18114
  /** @type {PluggableList} */
18113
18115
  var emptyPlugins = [];
18114
18116
  /** @type {Readonly<RemarkRehypeOptions>} */
@@ -23195,6 +23197,22 @@ var lucideArrowLeft = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("sv
23195
23197
  })
23196
23198
  });
23197
23199
  //#endregion
23200
+ //#region ~icons/lucide/chevron-down.jsx
23201
+ var lucideChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
23202
+ viewBox: "0 0 24 24",
23203
+ width: "1.2em",
23204
+ height: "1.2em",
23205
+ ...props,
23206
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
23207
+ fill: "none",
23208
+ stroke: "currentColor",
23209
+ strokeLinecap: "round",
23210
+ strokeLinejoin: "round",
23211
+ strokeWidth: 2,
23212
+ d: "m6 9l6 6l6-6"
23213
+ })
23214
+ });
23215
+ //#endregion
23198
23216
  //#region src/routes/requests/show.tsx?tsr-split=component
23199
23217
  function RequestShowPage() {
23200
23218
  const { id } = Route.useSearch();
@@ -23212,6 +23230,197 @@ function formatDateTime(iso) {
23212
23230
  second: "2-digit"
23213
23231
  });
23214
23232
  }
23233
+ function tryParseJson(text) {
23234
+ try {
23235
+ return JSON.parse(text);
23236
+ } catch {
23237
+ return null;
23238
+ }
23239
+ }
23240
+ function JsonValue({ value, defaultOpen = true }) {
23241
+ if (value === null) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23242
+ className: "text-sand-400",
23243
+ children: "null"
23244
+ });
23245
+ if (value === void 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23246
+ className: "text-sand-400",
23247
+ children: "undefined"
23248
+ });
23249
+ if (typeof value === "boolean") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23250
+ className: "text-amber-600",
23251
+ children: String(value)
23252
+ });
23253
+ if (typeof value === "number") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23254
+ className: "text-blue-600",
23255
+ children: String(value)
23256
+ });
23257
+ if (typeof value === "string") {
23258
+ if (value.length > 200) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
23259
+ className: "inline",
23260
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
23261
+ className: "cursor-pointer text-sage-700",
23262
+ children: [
23263
+ "\"",
23264
+ value.slice(0, 80),
23265
+ "...\"",
23266
+ " ",
23267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
23268
+ className: "text-sand-400 text-[10px]",
23269
+ children: [
23270
+ "(",
23271
+ value.length,
23272
+ " chars)"
23273
+ ]
23274
+ })
23275
+ ]
23276
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("pre", {
23277
+ className: "mt-1 ml-2 text-sage-700 whitespace-pre-wrap wrap-break-word",
23278
+ children: [
23279
+ "\"",
23280
+ value,
23281
+ "\""
23282
+ ]
23283
+ })]
23284
+ });
23285
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
23286
+ className: "text-sage-700",
23287
+ children: [
23288
+ "\"",
23289
+ value,
23290
+ "\""
23291
+ ]
23292
+ });
23293
+ }
23294
+ if (Array.isArray(value)) {
23295
+ if (value.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23296
+ className: "text-sand-500",
23297
+ children: "[]"
23298
+ });
23299
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
23300
+ open: defaultOpen,
23301
+ className: "inline-block w-full",
23302
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", {
23303
+ className: "cursor-pointer text-sand-500",
23304
+ children: "[]"
23305
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23306
+ className: "ml-4 border-l border-sand-200 pl-3",
23307
+ children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23308
+ className: "py-0.5",
23309
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(JsonValue, {
23310
+ value: item,
23311
+ defaultOpen: true
23312
+ })
23313
+ }, i))
23314
+ })]
23315
+ });
23316
+ }
23317
+ if (typeof value === "object") {
23318
+ const entries = Object.entries(value);
23319
+ if (entries.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23320
+ className: "text-sand-500",
23321
+ children: "{}"
23322
+ });
23323
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
23324
+ open: defaultOpen,
23325
+ className: "inline-block w-full",
23326
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", {
23327
+ className: "cursor-pointer text-sand-500",
23328
+ children: "{}"
23329
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23330
+ className: "ml-4 border-l border-sand-200 pl-3",
23331
+ children: entries.map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23332
+ className: "py-0.5",
23333
+ children: [
23334
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23335
+ className: "text-sienna-500 font-medium",
23336
+ children: key
23337
+ }),
23338
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23339
+ className: "text-sand-400",
23340
+ children: ": "
23341
+ }),
23342
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(JsonValue, {
23343
+ value: val,
23344
+ defaultOpen: true
23345
+ })
23346
+ ]
23347
+ }, key))
23348
+ })]
23349
+ });
23350
+ }
23351
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: String(value) });
23352
+ }
23353
+ function CopyButton({ text }) {
23354
+ const [copied, setCopied] = (0, import_react.useState)(false);
23355
+ (0, import_react.useEffect)(() => {
23356
+ if (!copied) return;
23357
+ const id = setTimeout(() => setCopied(false), 1500);
23358
+ return () => clearTimeout(id);
23359
+ }, [copied]);
23360
+ const handleCopy = () => {
23361
+ navigator.clipboard.writeText(text);
23362
+ setCopied(true);
23363
+ };
23364
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
23365
+ type: "button",
23366
+ className: "absolute top-2 right-2 p-1 rounded text-sand-400 hover:text-sand-600 transition-colors",
23367
+ onClick: handleCopy,
23368
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideCheck, { className: "size-3.5 text-sage-500" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideCopy, { className: "size-3.5" })
23369
+ });
23370
+ }
23371
+ function FormattedContent({ text, markdown }) {
23372
+ const parsed = tryParseJson(text);
23373
+ const [mode, setMode] = (0, import_react.useState)("pretty");
23374
+ if (parsed === null) {
23375
+ if (markdown) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23376
+ className: "prose prose-sm prose-sand max-w-none",
23377
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
23378
+ remarkPlugins: [remarkGfm],
23379
+ children: text
23380
+ })
23381
+ });
23382
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
23383
+ className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
23384
+ children: text
23385
+ });
23386
+ }
23387
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23388
+ className: "flex gap-1 mb-2",
23389
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
23390
+ type: "button",
23391
+ className: `px-2 py-0.5 text-[10px] rounded-md transition-colors ${mode === "plain" ? "bg-sand-200 text-sand-700" : "text-sand-400 hover:text-sand-600"}`,
23392
+ onClick: () => setMode("plain"),
23393
+ children: "Plain"
23394
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
23395
+ type: "button",
23396
+ className: `px-2 py-0.5 text-[10px] rounded-md transition-colors ${mode === "pretty" ? "bg-sand-200 text-sand-700" : "text-sand-400 hover:text-sand-600"}`,
23397
+ onClick: () => setMode("pretty"),
23398
+ children: "Pretty"
23399
+ })]
23400
+ }), mode === "pretty" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23401
+ className: "text-sm font-mono leading-relaxed",
23402
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(JsonValue, { value: parsed })
23403
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
23404
+ className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
23405
+ children: JSON.stringify(parsed, null, 2)
23406
+ })] });
23407
+ }
23408
+ function Section({ title, defaultOpen = true, children }) {
23409
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
23410
+ open: defaultOpen,
23411
+ className: "group",
23412
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
23413
+ className: "flex items-center gap-1 cursor-pointer select-none list-none",
23414
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3.5 text-sand-400 transition-transform group-open:rotate-0 -rotate-90" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23415
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
23416
+ children: title
23417
+ })]
23418
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23419
+ className: "mt-1.5",
23420
+ children
23421
+ })]
23422
+ });
23423
+ }
23215
23424
  function RequestDetail({ id }) {
23216
23425
  const { data, isLoading } = RequestLogService.useRequestLog("A", id);
23217
23426
  if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -23247,33 +23456,27 @@ function RequestDetail({ id }) {
23247
23456
  className: "text-xl font-medium text-sand-900 tracking-tight",
23248
23457
  children: "Request Detail"
23249
23458
  }),
23250
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23251
- className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
23252
- children: "Query"
23253
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23254
- className: "mt-1.5 rounded-lg bg-sand-50 px-4 py-3",
23255
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
23256
- className: "text-sm text-sand-800 whitespace-pre-wrap break-words font-mono leading-relaxed",
23257
- children: data.query
23459
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
23460
+ title: "Query",
23461
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23462
+ className: "rounded-lg bg-sand-50 px-4 py-3",
23463
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, { text: data.query })
23258
23464
  })
23259
- })] }),
23260
- data.response && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23261
- className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
23262
- children: "Response"
23263
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23264
- className: "mt-1.5 rounded-lg bg-sand-50 px-4 py-3 prose prose-sm prose-sand max-w-none",
23265
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
23266
- remarkPlugins: [remarkGfm],
23267
- children: data.response
23465
+ }),
23466
+ data.response && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
23467
+ title: "Response",
23468
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23469
+ className: "relative rounded-lg bg-sand-50 px-4 py-3",
23470
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.response }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
23471
+ text: data.response,
23472
+ markdown: true
23473
+ })]
23268
23474
  })
23269
- })] }),
23270
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23271
- className: "space-y-4",
23272
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23273
- className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
23274
- children: "Token Breakdown"
23275
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23276
- className: "mt-1.5 rounded-lg bg-sand-50 px-5 py-4",
23475
+ }),
23476
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
23477
+ title: "Token Breakdown",
23478
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23479
+ className: "rounded-lg bg-sand-50 px-5 py-4",
23277
23480
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", {
23278
23481
  className: "w-full text-sm tabular-nums",
23279
23482
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tbody", {
@@ -23320,11 +23523,12 @@ function RequestDetail({ id }) {
23320
23523
  ]
23321
23524
  })
23322
23525
  })
23323
- })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
23324
- className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
23325
- children: "Info"
23326
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23327
- className: "mt-1.5 rounded-lg bg-sand-50 px-5 py-4",
23526
+ })
23527
+ }),
23528
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
23529
+ title: "Info",
23530
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
23531
+ className: "rounded-lg bg-sand-50 px-5 py-4",
23328
23532
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", {
23329
23533
  className: "w-full text-sm",
23330
23534
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tbody", {
@@ -23354,7 +23558,7 @@ function RequestDetail({ id }) {
23354
23558
  ]
23355
23559
  })
23356
23560
  })
23357
- })] })]
23561
+ })
23358
23562
  }),
23359
23563
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pb-8" })
23360
23564
  ]
@@ -1,6 +1,7 @@
1
1
  import { S as require_react, b as useQueryClient, c as array, d as custom, f as date, g as string, h as object, i as SonamuQueryMode, l as bigint, m as number, nt as __toESM, o as zArrayable, p as int, s as _enum, u as boolean, x as require_jsx_runtime } from "./sd.generated-BeEKgSOs.js";
2
2
  import { r as TokenService, t as QgridService } from "./services.generated-DjxCLdMu.js";
3
- import { i as lucideKeyRound, n as m5, r as mn } from "../entry-server.generated.js";
3
+ import { a as lucideKeyRound, i as mn, r as m5 } from "../entry-server.generated.js";
4
+ import { n as lucideCheck, t as lucideCopy } from "./copy-C9YkjJVm.js";
4
5
  //#region ~icons/lucide/eye.jsx
5
6
  var import_react = /* @__PURE__ */ __toESM(require_react());
6
7
  var import_jsx_runtime = require_jsx_runtime();
@@ -313,45 +314,6 @@ function AddTokenModal() {
313
314
  })] });
314
315
  }
315
316
  //#endregion
316
- //#region ~icons/lucide/check.jsx
317
- var lucideCheck = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
318
- viewBox: "0 0 24 24",
319
- width: "1.2em",
320
- height: "1.2em",
321
- ...props,
322
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
323
- fill: "none",
324
- stroke: "currentColor",
325
- strokeLinecap: "round",
326
- strokeLinejoin: "round",
327
- strokeWidth: 2,
328
- d: "M20 6L9 17l-5-5"
329
- })
330
- });
331
- //#endregion
332
- //#region ~icons/lucide/copy.jsx
333
- var lucideCopy = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
334
- viewBox: "0 0 24 24",
335
- width: "1.2em",
336
- height: "1.2em",
337
- ...props,
338
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", {
339
- fill: "none",
340
- stroke: "currentColor",
341
- strokeLinecap: "round",
342
- strokeLinejoin: "round",
343
- strokeWidth: 2,
344
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
345
- width: 14,
346
- height: 14,
347
- x: 8,
348
- y: 8,
349
- rx: 2,
350
- ry: 2
351
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]
352
- })
353
- });
354
- //#endregion
355
317
  //#region ~icons/lucide/pencil.jsx
356
318
  var lucidePencil = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
357
319
  viewBox: "0 0 24 24",