@naisys/erp 3.0.0-beta.22 → 3.0.0-beta.24

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.
@@ -1,5 +1,5 @@
1
1
  import { r as __toESM } from "./rolldown-runtime-CvHMtSRF.js";
2
- import { $ as BrowserRouter, $t as Box, A as IconLogout, At as Image, B as IconApi, Bt as Autocomplete, C as useForm, Ct as Tooltip, D as IconTrash, Dt as Modal, E as IconUpload, Et as NumberInput, F as IconFile, Ft as Code, G as array, Gt as Alert, H as IconAlertCircle, Ht as AppShell, I as IconEye$1, It as Center, J as object, Jt as ActionIcon, K as boolean, Kt as Accordion, L as IconChevronDown, Lt as Card, M as IconLayoutSidebarLeftExpand, Mt as Drawer, N as IconLayoutSidebarLeftCollapse, Nt as Divider, O as IconPlus, Ot as Menu, P as IconInfoCircle, Pt as Container, Q as unknown, Qt as ScrollArea, R as IconCheck, Rt as Button, S as IconCopy, St as SegmentedControl, T as IconUser, Tt as Pagination, U as ZodIssueCode, Ut as Anchor, V as IconAlertTriangle, Vt as Checkbox, W as _enum, Wt as Text, X as string, Xt as Popover, Y as record, Yt as Loader, Z as union, Zt as UnstyledButton, _ as IconRefresh, _t as Tabs, a as _undefined, an as require_react, at as useLocation, b as IconEyeOff, bt as Stack, c as boolean$1, ct as useParams, d as object$1, dt as notifications, en as MantineProvider, et as Link, f as string$1, ft as DateTimePicker, g as Markdown, gt as TextInput, h as remarkGfm, ht as Title, i as _null, in as require_client, it as Routes, j as IconListDetails, jt as FileButton, k as IconNote, kt as Textarea, l as literal, lt as useSearchParams, m as datetime, mt as DatesProvider, n as string$2, nn as useDebouncedValue, nt as Outlet, o as any, ot as useNavigate, p as union$1, pt as DateInput, q as number, qt as Group, r as _enum$1, rn as require_jsx_runtime, rt as Route, s as array$1, st as useOutletContext, t as number$2, tn as useDisclosure, tt as Navigate, u as number$1, ut as Notifications, v as IconPhoto, vt as Table, w as IconX, wt as PasswordInput, x as IconDownload, xt as Select, y as IconEye, yt as Switch, z as IconArrowBackUp, zt as Badge } from "./vendor-DlmcA82d.js";
2
+ import { $ as unknown, $t as ScrollArea, A as IconLogout, At as Textarea, B as IconApi, Bt as Badge, C as useForm, Ct as SegmentedControl, D as IconTrash, Dt as NumberInput, E as IconUpload, Et as Pagination, F as IconFile, Ft as Container, G as _enum, Gt as Text, H as IconAlertCircle, Ht as Checkbox, I as IconEye$1, It as Code, J as number, Jt as Group, K as array, Kt as Alert, L as IconChevronDown, Lt as Center, M as IconLayoutSidebarLeftExpand, Mt as FileButton, N as IconLayoutSidebarLeftCollapse, Nt as Drawer, O as IconPlus, Ot as Modal, P as IconInfoCircle, Pt as Divider, Q as union, Qt as UnstyledButton, R as IconCheck, Rt as Card, S as IconCopy, St as Select, T as IconUser, Tt as PasswordInput, U as require_semver, Ut as AppShell, V as IconAlertTriangle, Vt as Autocomplete, W as ZodIssueCode, Wt as Anchor, X as record, Xt as Loader, Y as object, Yt as ActionIcon, Z as string, Zt as Popover, _ as IconRefresh, _t as TextInput, a as _undefined, an as require_client, at as Routes, b as IconEyeOff, bt as Switch, c as boolean$1, ct as useOutletContext, d as object$1, dt as Notifications, en as Box, et as BrowserRouter, f as string$1, ft as notifications, g as Markdown, gt as Title, h as remarkGfm, ht as DatesProvider, i as _null, in as require_jsx_runtime, it as Route, j as IconListDetails, jt as Image, k as IconNote, kt as Menu, l as literal, lt as useParams, m as datetime, mt as DateInput, n as string$2, nn as useDisclosure, nt as Navigate, o as any, on as require_react, ot as useLocation, p as union$1, pt as DateTimePicker, q as boolean, qt as Accordion, r as _enum$1, rn as useDebouncedValue, rt as Outlet, s as array$1, st as useNavigate, t as number$2, tn as MantineProvider, tt as Link, u as number$1, ut as useSearchParams, v as IconPhoto, vt as Tabs, w as IconX, wt as Tooltip, x as IconDownload, xt as Stack, y as IconEye, yt as Table, z as IconArrowBackUp, zt as Button } from "./vendor-MNFI7PUp.js";
3
3
  //#region \0vite/modulepreload-polyfill.js
4
4
  (function polyfill() {
5
5
  const relList = document.createElement("link").relList;
@@ -155,46 +155,58 @@ function formatFileSize(bytes) {
155
155
  }
156
156
  //#endregion
157
157
  //#region ../../../packages/common/dist/formatVersion.js
158
+ var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
158
159
  /**
159
- * Parse a version string that may contain "npmVersion/commitHash".
160
- * "1.2.3/abc123..." → { npm: "1.2.3", hash: "abc123..." }
161
- * "1.2.3" → { npm: "1.2.3", hash: "" }
162
- * "/abc123..." → { npm: "", hash: "abc123..." }
160
+ * Parse a version string that may contain ">=" operator and/or "/commitHash".
161
+ * ">=1.2.3" → { operator: ">=", npm: "1.2.3", hash: "" }
162
+ * "1.2.3/abc123..." → { operator: "", npm: "1.2.3", hash: "abc123..." }
163
+ * "1.2.3" → { operator: "", npm: "1.2.3", hash: "" }
164
+ * "/abc123..." → { operator: "", npm: "", hash: "abc123..." }
163
165
  */
164
166
  function parseVersion(version) {
165
- const slashIndex = version.indexOf("/");
167
+ let operator = "";
168
+ let rest = version;
169
+ if (rest.startsWith(">=")) {
170
+ operator = ">=";
171
+ rest = rest.substring(2);
172
+ }
173
+ const slashIndex = rest.indexOf("/");
166
174
  if (slashIndex === -1) return {
167
- npm: version,
175
+ operator,
176
+ npm: rest,
168
177
  hash: ""
169
178
  };
170
179
  return {
171
- npm: version.substring(0, slashIndex),
172
- hash: version.substring(slashIndex + 1)
180
+ operator,
181
+ npm: rest.substring(0, slashIndex),
182
+ hash: rest.substring(slashIndex + 1)
173
183
  };
174
184
  }
175
185
  /**
176
186
  * Format a version string for display.
177
- * "1.2.3/abc123def456..." → "1.2.3 (abc123de)"
178
- * "1.2.3" → "1.2.3"
179
- * "/abc123def456..." → "abc123de"
187
+ * ">=1.2.3" → ">=1.2.3"
188
+ * "1.2.3/abc123def456…" → "1.2.3 (abc123de)"
189
+ * "1.2.3" → "1.2.3"
190
+ * "/abc123def456…" → "abc123de"
180
191
  */
181
192
  function formatVersion(version) {
182
- const { npm, hash } = parseVersion(version);
183
- if (!hash) return npm;
193
+ const { operator, npm, hash } = parseVersion(version);
194
+ if (!hash) return `${operator}${npm}`;
184
195
  const shortHash = hash.substring(0, 8);
185
- if (npm) return `${npm} (${shortHash})`;
196
+ if (npm) return `${operator}${npm} (${shortHash})`;
186
197
  return shortHash;
187
198
  }
188
199
  /**
189
- * Check if an instance version matches the target version.
190
- * Handles the "npmVersion/commitHash" format:
191
- * - If target has a hash, the instance must have the same hash to match.
192
- * - Otherwise, npm version parts are compared.
200
+ * Check if an instance version satisfies the target version.
201
+ * - If target has a hash, the instance must have the same hash.
202
+ * - If target npm has ">=" operator, instance npm must be >= target npm.
203
+ * - Otherwise, npm versions must match exactly.
193
204
  */
194
205
  function versionsMatch(instanceVersion, targetVersion) {
195
206
  const target = parseVersion(targetVersion);
196
207
  const instance = parseVersion(instanceVersion);
197
208
  if (target.hash) return instance.hash === target.hash;
209
+ if (target.operator === ">=") return import_semver.default.gte(instance.npm, target.npm);
198
210
  return instance.npm === target.npm;
199
211
  }
200
212
  //#endregion
@@ -908,6 +920,18 @@ var ServerLogViewer = ({ fetchLogs: fetchLogsFn, logFiles }) => {
908
920
  ] });
909
921
  };
910
922
  //#endregion
923
+ //#region ../../../packages/common-browser/dist/VersionBadge.js
924
+ var VersionBadge = ({ version, size = "sm" }) => {
925
+ if (!version) return null;
926
+ const isGit = version.includes("/");
927
+ return (0, import_jsx_runtime.jsx)(Badge, {
928
+ size,
929
+ variant: "light",
930
+ color: isGit ? "grape" : "cyan",
931
+ children: isGit ? "git" : "npm"
932
+ });
933
+ };
934
+ //#endregion
911
935
  //#region ../../../packages/common-browser/dist/zodResolver.js
912
936
  function zodResolver(schema) {
913
937
  return (values) => {
@@ -2390,12 +2414,16 @@ var AdminPage = () => {
2390
2414
  children: "ERP Version"
2391
2415
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Group, {
2392
2416
  gap: "xs",
2393
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formatVersion(data.erpVersion) }), data.targetVersion && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
2394
- size: "sm",
2395
- variant: "light",
2396
- color: versionsMatch(data.erpVersion, data.targetVersion) ? "green" : "red",
2397
- children: ["target: ", formatVersion(data.targetVersion)]
2398
- })]
2417
+ children: [
2418
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: formatVersion(data.erpVersion) }),
2419
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VersionBadge, { version: data.erpVersion }),
2420
+ data.targetVersion && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
2421
+ size: "sm",
2422
+ variant: "light",
2423
+ color: versionsMatch(data.erpVersion, data.targetVersion) ? "green" : "red",
2424
+ children: ["target: ", formatVersion(data.targetVersion)]
2425
+ })
2426
+ ]
2399
2427
  }) })] }),
2400
2428
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table.Tr, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, {
2401
2429
  fw: 600,