@veltrixsecops/app-sdk 3.1.0 → 3.5.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.
Files changed (79) hide show
  1. package/README.md +1 -1
  2. package/dist/byol/index.cjs +3802 -0
  3. package/dist/byol/index.cjs.map +1 -0
  4. package/dist/byol/index.d.cts +578 -0
  5. package/dist/byol/index.d.ts +578 -0
  6. package/dist/byol/index.js +2587 -0
  7. package/dist/byol/index.js.map +1 -0
  8. package/dist/chunk-3WK4EVQ3.js +842 -0
  9. package/dist/chunk-3WK4EVQ3.js.map +1 -0
  10. package/dist/{chunk-6KUTYJW5.js → chunk-HIL6RIDG.js} +107 -3
  11. package/dist/chunk-HIL6RIDG.js.map +1 -0
  12. package/dist/{chunk-VWFTOFTI.js → chunk-Y6XBNZGR.js} +8 -2
  13. package/dist/chunk-Y6XBNZGR.js.map +1 -0
  14. package/dist/client/index.cjs +112 -2
  15. package/dist/client/index.cjs.map +1 -1
  16. package/dist/client/index.d.cts +127 -6
  17. package/dist/client/index.d.ts +127 -6
  18. package/dist/client/index.js +13 -1
  19. package/dist/connections/index.cjs +1787 -0
  20. package/dist/connections/index.cjs.map +1 -0
  21. package/dist/connections/index.d.cts +78 -0
  22. package/dist/connections/index.d.ts +78 -0
  23. package/dist/connections/index.js +754 -0
  24. package/dist/connections/index.js.map +1 -0
  25. package/dist/hooks/index.cjs +7 -0
  26. package/dist/hooks/index.cjs.map +1 -1
  27. package/dist/hooks/index.d.cts +24 -3
  28. package/dist/hooks/index.d.ts +24 -3
  29. package/dist/hooks/index.js +7 -1
  30. package/dist/hooks/index.js.map +1 -1
  31. package/dist/index.cjs +7 -0
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +3 -3
  34. package/dist/index.d.ts +3 -3
  35. package/dist/index.js +3 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/opentofu/index.cjs +138 -0
  38. package/dist/opentofu/index.cjs.map +1 -0
  39. package/dist/opentofu/index.d.cts +131 -0
  40. package/dist/opentofu/index.d.ts +131 -0
  41. package/dist/opentofu/index.js +109 -0
  42. package/dist/opentofu/index.js.map +1 -0
  43. package/dist/pipeline/index.cjs +7 -0
  44. package/dist/pipeline/index.cjs.map +1 -1
  45. package/dist/pipeline/index.d.cts +9 -2
  46. package/dist/pipeline/index.d.ts +9 -2
  47. package/dist/pipeline/index.js +3 -1
  48. package/dist/pipeline-beeT8dje.d.cts +408 -0
  49. package/dist/pipeline-beeT8dje.d.ts +408 -0
  50. package/dist/ui/index.cjs +248 -0
  51. package/dist/ui/index.cjs.map +1 -1
  52. package/dist/ui/index.d.cts +238 -1
  53. package/dist/ui/index.d.ts +238 -1
  54. package/dist/ui/index.js +39 -573
  55. package/dist/ui/index.js.map +1 -1
  56. package/dist/{use-app-context-SEU1tyZd.d.cts → use-app-context-Byv_fam0.d.cts} +241 -4
  57. package/dist/{use-app-context-SEU1tyZd.d.ts → use-app-context-Byv_fam0.d.ts} +241 -4
  58. package/opentofu/README.md +114 -0
  59. package/opentofu/modules/aws/main.tf +1008 -0
  60. package/opentofu/modules/aws/outputs.tf +90 -0
  61. package/opentofu/modules/aws/variables.tf +437 -0
  62. package/opentofu/modules/aws/versions.tf +23 -0
  63. package/opentofu/modules/azure/main.tf +920 -0
  64. package/opentofu/modules/azure/outputs.tf +72 -0
  65. package/opentofu/modules/azure/variables.tf +498 -0
  66. package/opentofu/modules/azure/versions.tf +27 -0
  67. package/opentofu/modules/gcp/main.tf +645 -0
  68. package/opentofu/modules/gcp/outputs.tf +73 -0
  69. package/opentofu/modules/gcp/variables.tf +428 -0
  70. package/opentofu/modules/gcp/versions.tf +27 -0
  71. package/opentofu/modules/hetzner/main.tf +432 -0
  72. package/opentofu/modules/hetzner/outputs.tf +72 -0
  73. package/opentofu/modules/hetzner/variables.tf +423 -0
  74. package/opentofu/modules/hetzner/versions.tf +26 -0
  75. package/package.json +33 -1
  76. package/dist/chunk-6KUTYJW5.js.map +0 -1
  77. package/dist/chunk-VWFTOFTI.js.map +0 -1
  78. package/dist/pipeline-A-gSsPRR.d.cts +0 -189
  79. package/dist/pipeline-A-gSsPRR.d.ts +0 -189
package/dist/ui/index.cjs CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/ui/index.tsx
31
31
  var ui_exports = {};
32
32
  __export(ui_exports, {
33
+ Alert: () => Alert,
33
34
  Badge: () => Badge,
34
35
  Button: () => Button,
35
36
  Card: () => Card,
@@ -39,13 +40,19 @@ __export(ui_exports, {
39
40
  Checkbox: () => Checkbox,
40
41
  DataTable: () => DataTable,
41
42
  EmptyState: () => EmptyState,
43
+ FilterBar: () => FilterBar,
42
44
  FormDialog: () => FormDialog,
43
45
  FormField: () => FormField,
44
46
  Input: () => Input,
47
+ Modal: () => Modal,
48
+ MultiSelect: () => MultiSelect,
49
+ Pagination: () => Pagination,
50
+ SearchBox: () => SearchBox,
45
51
  Select: () => Select,
46
52
  Skeleton: () => Skeleton,
47
53
  SkeletonCard: () => SkeletonCard,
48
54
  SkeletonText: () => SkeletonText,
55
+ SortSelect: () => SortSelect,
49
56
  Spinner: () => Spinner,
50
57
  StatsCard: () => StatsCard,
51
58
  Tabs: () => Tabs,
@@ -295,6 +302,110 @@ var Select = (props) => {
295
302
  ] });
296
303
  };
297
304
  Select.displayName = "Select";
305
+ var SearchBox = (props) => {
306
+ const HostSearchBox = getHostUi("SearchBox");
307
+ if (HostSearchBox) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostSearchBox, { ...props });
308
+ const { value, onChange, placeholder, disabled, className, "aria-label": ariaLabel } = props;
309
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
310
+ "input",
311
+ {
312
+ type: "search",
313
+ value,
314
+ onChange: (event) => onChange(event.target.value),
315
+ placeholder,
316
+ disabled,
317
+ "aria-label": ariaLabel ?? placeholder ?? "Search",
318
+ className,
319
+ style: { ...fallbackNote, width: "100%", padding: "6px 10px", borderRadius: 6, border: "1px solid #9ca3af" }
320
+ }
321
+ );
322
+ };
323
+ SearchBox.displayName = "SearchBox";
324
+ var Pagination = (props) => {
325
+ const HostPagination = getHostUi("Pagination");
326
+ if (HostPagination) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostPagination, { ...props });
327
+ const { page, pageSize, totalItems, onPageChange, disabled, className } = props;
328
+ const pageCount = Math.max(1, Math.ceil(totalItems / pageSize));
329
+ const canGoPrev = !disabled && page > 1;
330
+ const canGoNext = !disabled && page < pageCount;
331
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", { "aria-label": "Pagination", className, style: { ...fallbackNote, display: "flex", alignItems: "center", gap: 12 }, children: [
332
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => onPageChange(page - 1), disabled: !canGoPrev, style: { padding: "4px 10px" }, children: "Prev" }),
333
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
334
+ "page ",
335
+ page,
336
+ " of ",
337
+ pageCount
338
+ ] }),
339
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => onPageChange(page + 1), disabled: !canGoNext, style: { padding: "4px 10px" }, children: "Next" })
340
+ ] });
341
+ };
342
+ Pagination.displayName = "Pagination";
343
+ var FilterBar = (props) => {
344
+ const HostFilterBar = getHostUi("FilterBar");
345
+ if (HostFilterBar) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostFilterBar, { ...props });
346
+ const { filters, search, className } = props;
347
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className, style: { ...fallbackNote, display: "flex", flexWrap: "wrap", gap: 8, alignItems: "center" }, children: [
348
+ search && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
349
+ "input",
350
+ {
351
+ type: "search",
352
+ "aria-label": search.placeholder ?? "Search",
353
+ placeholder: search.placeholder,
354
+ value: search.value,
355
+ onChange: (event) => search.onChange(event.target.value),
356
+ style: { padding: "6px 10px", borderRadius: 6, border: "1px solid #9ca3af" }
357
+ }
358
+ ),
359
+ filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { style: { display: "flex", flexDirection: "column", fontSize: 12 }, children: [
360
+ filter.label,
361
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
362
+ "select",
363
+ {
364
+ "aria-label": filter.label,
365
+ value: filter.value ?? "",
366
+ onChange: (event) => filter.onChange(event.target.value === "" ? null : event.target.value),
367
+ style: { padding: "6px 10px", borderRadius: 6, border: "1px solid #9ca3af" },
368
+ children: [
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "", children: filter.label }),
370
+ filter.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: option.value, children: option.label }, option.value))
371
+ ]
372
+ }
373
+ )
374
+ ] }, filter.key))
375
+ ] });
376
+ };
377
+ FilterBar.displayName = "FilterBar";
378
+ var SortSelect = (props) => {
379
+ const HostSortSelect = getHostUi("SortSelect");
380
+ if (HostSortSelect) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostSortSelect, { ...props });
381
+ const { options, value, direction, onChange, disabled, className } = props;
382
+ const directionLabel = direction === "asc" ? "Sort ascending" : "Sort descending";
383
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className, style: { ...fallbackNote, display: "flex", alignItems: "center", gap: 6 }, children: [
384
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
385
+ "select",
386
+ {
387
+ "aria-label": "Sort by",
388
+ value,
389
+ disabled,
390
+ onChange: (event) => onChange(event.target.value, direction),
391
+ style: { padding: "6px 10px", borderRadius: 6, border: "1px solid #9ca3af" },
392
+ children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: option.value, children: option.label }, option.value))
393
+ }
394
+ ),
395
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
396
+ "button",
397
+ {
398
+ type: "button",
399
+ disabled,
400
+ onClick: () => onChange(value, direction === "asc" ? "desc" : "asc"),
401
+ "aria-label": directionLabel,
402
+ style: { padding: "4px 10px" },
403
+ children: direction === "asc" ? "\u2191" : "\u2193"
404
+ }
405
+ )
406
+ ] });
407
+ };
408
+ SortSelect.displayName = "SortSelect";
298
409
  var FormField = (props) => {
299
410
  const HostFormField = getHostUi("FormField");
300
411
  if (HostFormField) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostFormField, { ...props });
@@ -598,6 +709,136 @@ var FormDialog = (props) => {
598
709
  );
599
710
  };
600
711
  FormDialog.displayName = "FormDialog";
712
+ var MODAL_MAX_WIDTH = { sm: 420, md: 520, lg: 680, xl: 896 };
713
+ var Modal = (props) => {
714
+ const HostModal = getHostUi("Modal");
715
+ if (HostModal) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostModal, { ...props });
716
+ const {
717
+ isOpen,
718
+ onClose,
719
+ title,
720
+ subtitle,
721
+ children,
722
+ footer,
723
+ size = "md",
724
+ disableBackdropClose = false,
725
+ disableEscapeClose = false,
726
+ hideCloseButton = false,
727
+ closeLabel = "Close",
728
+ className
729
+ } = props;
730
+ React.useEffect(() => {
731
+ if (!isOpen) return;
732
+ const handleKeyDown = (event) => {
733
+ if (event.key === "Escape" && !disableEscapeClose) onClose();
734
+ };
735
+ document.addEventListener("keydown", handleKeyDown);
736
+ return () => document.removeEventListener("keydown", handleKeyDown);
737
+ }, [isOpen, disableEscapeClose, onClose]);
738
+ if (!isOpen) return null;
739
+ const hasHeader = title != null || subtitle != null || !hideCloseButton;
740
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
741
+ "div",
742
+ {
743
+ style: { position: "fixed", inset: 0, background: "rgba(0,0,0,0.5)", display: "flex", alignItems: "center", justifyContent: "center", zIndex: 50 },
744
+ onClick: disableBackdropClose ? void 0 : onClose,
745
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
746
+ "div",
747
+ {
748
+ role: "dialog",
749
+ "aria-modal": "true",
750
+ style: { background: "white", color: "black", borderRadius: 8, width: "100%", maxWidth: MODAL_MAX_WIDTH[size], maxHeight: "80vh", overflow: "auto", ...fallbackNote },
751
+ className,
752
+ onClick: (event) => event.stopPropagation(),
753
+ children: [
754
+ hasHeader && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { padding: 16, borderBottom: "1px solid #d1d5db", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 16 }, children: [
755
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { minWidth: 0 }, children: [
756
+ title != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { style: { margin: 0, fontSize: 16, fontWeight: 600 }, children: title }),
757
+ subtitle != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#6b7280" }, children: subtitle })
758
+ ] }),
759
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: onClose, "aria-label": closeLabel, style: { background: "none", border: "none", cursor: "pointer", fontSize: 18, lineHeight: 1 }, children: "\xD7" })
760
+ ] }),
761
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { padding: 16, display: "flex", flexDirection: "column", gap: 12 }, children }),
762
+ footer != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { padding: 16, borderTop: "1px solid #d1d5db", display: "flex", justifyContent: "flex-end", gap: 8 }, children: footer })
763
+ ]
764
+ }
765
+ )
766
+ }
767
+ );
768
+ };
769
+ Modal.displayName = "Modal";
770
+ var ALERT_FALLBACK_COLORS = {
771
+ info: { bg: "#eff6ff", fg: "#1e40af", border: "#93c5fd" },
772
+ success: { bg: "#ecfdf5", fg: "#065f46", border: "#6ee7b7" },
773
+ warning: { bg: "#fffbeb", fg: "#92400e", border: "#fcd34d" },
774
+ danger: { bg: "#fef2f2", fg: "#991b1b", border: "#fca5a5" }
775
+ };
776
+ var Alert = (props) => {
777
+ const HostAlert = getHostUi("Alert");
778
+ if (HostAlert) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostAlert, { ...props });
779
+ const { variant = "info", title, children, icon, onDismiss, action, className } = props;
780
+ const c = ALERT_FALLBACK_COLORS[variant];
781
+ const role = variant === "danger" || variant === "warning" ? "alert" : "status";
782
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
783
+ "div",
784
+ {
785
+ role,
786
+ className,
787
+ style: {
788
+ display: "flex",
789
+ alignItems: "flex-start",
790
+ gap: 10,
791
+ border: `1px solid ${c.border}`,
792
+ background: c.bg,
793
+ color: c.fg,
794
+ borderRadius: 8,
795
+ padding: "12px 16px",
796
+ ...fallbackNote
797
+ },
798
+ children: [
799
+ icon !== false && icon != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { flexShrink: 0 }, children: icon }),
800
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { minWidth: 0, flex: 1 }, children: [
801
+ title != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: { margin: 0, fontSize: 14, fontWeight: 600 }, children: title }),
802
+ children != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { fontSize: 14, marginTop: title != null ? 2 : 0 }, children })
803
+ ] }),
804
+ action != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { flexShrink: 0 }, children: action }),
805
+ onDismiss && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
806
+ "button",
807
+ {
808
+ type: "button",
809
+ onClick: onDismiss,
810
+ "aria-label": "Dismiss",
811
+ style: { flexShrink: 0, background: "none", border: "none", cursor: "pointer", color: "inherit", opacity: 0.7 },
812
+ children: "\xD7"
813
+ }
814
+ )
815
+ ]
816
+ }
817
+ );
818
+ };
819
+ Alert.displayName = "Alert";
820
+ var MultiSelect = (props) => {
821
+ const HostMultiSelect = getHostUi("MultiSelect");
822
+ if (HostMultiSelect) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HostMultiSelect, { ...props });
823
+ const { options, value = [], onChange, label, disabled, fullWidth = true, name } = props;
824
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { style: { ...fallbackNote, display: "block", width: fullWidth ? "100%" : void 0 }, children: [
825
+ label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { display: "block", marginBottom: 4, fontSize: 14, fontWeight: 500 }, children: label }),
826
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
827
+ "select",
828
+ {
829
+ multiple: true,
830
+ name,
831
+ disabled,
832
+ value,
833
+ "aria-label": props["aria-label"],
834
+ onChange: (e) => onChange?.(Array.from(e.target.selectedOptions, (o) => o.value)),
835
+ style: { width: "100%", minHeight: 96, padding: "6px 10px", borderRadius: 6, border: "1px solid #9ca3af" },
836
+ children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value))
837
+ }
838
+ )
839
+ ] });
840
+ };
841
+ MultiSelect.displayName = "MultiSelect";
601
842
  function fallbackToast(message, options) {
602
843
  console.warn(`[@veltrixsecops/app-sdk/ui] Toast (${options?.variant ?? "info"}): ${message}`);
603
844
  return "fallback-toast";
@@ -635,6 +876,7 @@ function useConfirmDialog() {
635
876
  }
636
877
  // Annotate the CommonJS export names for ESM import in node:
637
878
  0 && (module.exports = {
879
+ Alert,
638
880
  Badge,
639
881
  Button,
640
882
  Card,
@@ -644,13 +886,19 @@ function useConfirmDialog() {
644
886
  Checkbox,
645
887
  DataTable,
646
888
  EmptyState,
889
+ FilterBar,
647
890
  FormDialog,
648
891
  FormField,
649
892
  Input,
893
+ Modal,
894
+ MultiSelect,
895
+ Pagination,
896
+ SearchBox,
650
897
  Select,
651
898
  Skeleton,
652
899
  SkeletonCard,
653
900
  SkeletonText,
901
+ SortSelect,
654
902
  Spinner,
655
903
  StatsCard,
656
904
  Tabs,