@burdenoff/microfe-export 2026.1108.1 → 2026.1113.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 (65) hide show
  1. package/dist/export/ExportRoot.js +45 -40
  2. package/dist/export/ExportRoot.js.map +1 -1
  3. package/dist/export/ExportRoutes.d.ts +7 -0
  4. package/dist/export/ExportRoutes.js +70 -51
  5. package/dist/export/ExportRoutes.js.map +1 -1
  6. package/dist/export/components/ConfirmDestructiveDialog.d.ts +21 -0
  7. package/dist/export/components/ConfirmDestructiveDialog.js +37 -0
  8. package/dist/export/components/ConfirmDestructiveDialog.js.map +1 -0
  9. package/dist/export/components/DownloadSections.d.ts +10 -0
  10. package/dist/export/components/DownloadSections.js +161 -0
  11. package/dist/export/components/DownloadSections.js.map +1 -0
  12. package/dist/export/components/DownloadStatus.d.ts +13 -0
  13. package/dist/export/components/DownloadStatus.js +36 -0
  14. package/dist/export/components/DownloadStatus.js.map +1 -0
  15. package/dist/export/components/DownloadsTabs.d.ts +5 -0
  16. package/dist/export/components/DownloadsTabs.js +25 -0
  17. package/dist/export/components/DownloadsTabs.js.map +1 -0
  18. package/dist/export/hooks/useEntityLabel.d.ts +7 -0
  19. package/dist/export/hooks/useEntityLabel.js +16 -0
  20. package/dist/export/hooks/useEntityLabel.js.map +1 -0
  21. package/dist/export/hooks/useExportQueries.d.ts +3 -1
  22. package/dist/export/hooks/useExportQueries.js +23 -23
  23. package/dist/export/hooks/useExportQueries.js.map +1 -1
  24. package/dist/export/navigation-v2/NavigationV2.d.ts +7 -0
  25. package/dist/export/navigation-v2/NavigationV2.js +16 -0
  26. package/dist/export/navigation-v2/NavigationV2.js.map +1 -0
  27. package/dist/export/pages/CreateExportPage.js +123 -121
  28. package/dist/export/pages/CreateExportPage.js.map +1 -1
  29. package/dist/export/pages/ExportDetailPage.js +131 -124
  30. package/dist/export/pages/ExportDetailPage.js.map +1 -1
  31. package/dist/export/pages/ExportHistoryPage.js +61 -57
  32. package/dist/export/pages/ExportHistoryPage.js.map +1 -1
  33. package/dist/export/pages/ExportTemplatesPage.js +214 -182
  34. package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
  35. package/dist/export/pages/TemplateDetailPage.js +141 -119
  36. package/dist/export/pages/TemplateDetailPage.js.map +1 -1
  37. package/dist/export/pages/v2/DownloadDetailPage.d.ts +8 -0
  38. package/dist/export/pages/v2/DownloadDetailPage.js +176 -0
  39. package/dist/export/pages/v2/DownloadDetailPage.js.map +1 -0
  40. package/dist/export/pages/v2/DownloadsPage.d.ts +10 -0
  41. package/dist/export/pages/v2/DownloadsPage.js +401 -0
  42. package/dist/export/pages/v2/DownloadsPage.js.map +1 -0
  43. package/dist/export/pages/v2/NewDownloadPage.d.ts +8 -0
  44. package/dist/export/pages/v2/NewDownloadPage.js +440 -0
  45. package/dist/export/pages/v2/NewDownloadPage.js.map +1 -0
  46. package/dist/export/types/index.d.ts +7 -0
  47. package/dist/export/utils/billing.d.ts +6 -0
  48. package/dist/export/utils/billing.js +7 -0
  49. package/dist/export/utils/billing.js.map +1 -0
  50. package/dist/export/utils/downloadStatus.d.ts +15 -0
  51. package/dist/export/utils/downloadStatus.js +48 -0
  52. package/dist/export/utils/downloadStatus.js.map +1 -0
  53. package/dist/export/utils/entityLabels.d.ts +47 -0
  54. package/dist/export/utils/entityLabels.js +150 -0
  55. package/dist/export/utils/entityLabels.js.map +1 -0
  56. package/dist/export/utils/formatBytes.d.ts +2 -0
  57. package/dist/export/utils/formatBytes.js +15 -0
  58. package/dist/export/utils/formatBytes.js.map +1 -0
  59. package/dist/export/utils/newDownloadForm.d.ts +32 -0
  60. package/dist/export/utils/newDownloadForm.js +42 -0
  61. package/dist/export/utils/newDownloadForm.js.map +1 -0
  62. package/dist/export/utils/paths.d.ts +2 -0
  63. package/dist/export/utils/paths.js +7 -0
  64. package/dist/export/utils/paths.js.map +1 -0
  65. package/package.json +2 -2
@@ -0,0 +1,161 @@
1
+ import { useTr as e } from "../hooks/useTr.js";
2
+ import { PageSection as t } from "./PageLayout.js";
3
+ import { ExportProgressBar as n } from "./ExportProgressBar.js";
4
+ import { formatBytes as r } from "../utils/formatBytes.js";
5
+ import { isInProgress as i } from "../utils/downloadStatus.js";
6
+ import { AlertCircle as a, CheckCircle2 as o, Clock as s, Download as c, FileDown as l, HardDrive as u } from "lucide-react";
7
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
8
+ import { GlassCard as m, ShowTechnicalDetails as h } from "@burdenoff/fe-libs/ui";
9
+ // src/export/components/DownloadSections.tsx
10
+ function g({ job: g, label: _ }) {
11
+ let v = e(), y = i(g.status);
12
+ return /* @__PURE__ */ p(d, { children: [
13
+ y && /* @__PURE__ */ p("div", {
14
+ className: "space-y-2 rounded-xl border border-border-subtle bg-bg-surface p-5",
15
+ role: "status",
16
+ children: [
17
+ /* @__PURE__ */ f("p", {
18
+ className: "font-medium text-text-primary",
19
+ children: v("export.detail.progress.preparing", "Preparing your files…")
20
+ }),
21
+ /* @__PURE__ */ f(n, {
22
+ progress: g.progress,
23
+ size: "md"
24
+ }),
25
+ g.processedEntities != null && g.totalEntities != null && /* @__PURE__ */ f("p", {
26
+ className: "text-sm text-text-secondary",
27
+ children: v("export.detail.progress.items", "{{processed}} of {{total}} items ready", {
28
+ processed: g.processedEntities.toLocaleString(),
29
+ total: g.totalEntities.toLocaleString()
30
+ })
31
+ })
32
+ ]
33
+ }),
34
+ g.status === "FAILED" && /* @__PURE__ */ p("div", {
35
+ className: "flex items-start gap-3 rounded-xl border border-border-default bg-status-error-bg-subtle p-5",
36
+ children: [/* @__PURE__ */ f(a, {
37
+ size: 20,
38
+ "aria-hidden": "true",
39
+ className: "mt-0.5 shrink-0 text-status-error-text"
40
+ }), /* @__PURE__ */ p("div", {
41
+ className: "min-w-0 space-y-2",
42
+ children: [
43
+ /* @__PURE__ */ f("p", {
44
+ className: "font-medium text-status-error-text",
45
+ children: v("export.detail.failed.title", "This download didn't finish")
46
+ }),
47
+ /* @__PURE__ */ f("p", {
48
+ className: "text-sm text-text-secondary",
49
+ children: v("export.detail.failed.description", "Try again. If it stops again, pick less data or a shorter date range.")
50
+ }),
51
+ g.errorMessage ? /* @__PURE__ */ f(h, {
52
+ copyable: !0,
53
+ children: g.errorMessage
54
+ }) : null
55
+ ]
56
+ })]
57
+ }),
58
+ g.status === "EXPIRED" && /* @__PURE__ */ f("p", {
59
+ className: "rounded-xl border border-border-subtle bg-bg-surface p-4 text-sm text-text-secondary",
60
+ children: v("export.detail.expired.description", "The download link has expired. Try again to make a fresh copy.")
61
+ }),
62
+ /* @__PURE__ */ f("div", {
63
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
64
+ children: [{
65
+ icon: /* @__PURE__ */ f(u, {
66
+ size: 16,
67
+ "aria-hidden": "true"
68
+ }),
69
+ name: v("export.detail.info.totalSize", "Total Size"),
70
+ value: g.totalSizeBytes == null ? "-" : r(g.totalSizeBytes)
71
+ }, {
72
+ icon: /* @__PURE__ */ f(s, {
73
+ size: 16,
74
+ "aria-hidden": "true"
75
+ }),
76
+ name: v("export.detail.info.created", "Created"),
77
+ value: new Date(g.createdAt).toLocaleDateString()
78
+ }].map((e) => /* @__PURE__ */ p(m, {
79
+ treatment: "metric",
80
+ className: "border-border-seam p-4",
81
+ children: [/* @__PURE__ */ p("div", {
82
+ className: "mb-1 flex items-center gap-2 text-text-secondary",
83
+ children: [e.icon, /* @__PURE__ */ f("span", {
84
+ className: "text-xs font-medium",
85
+ children: e.name
86
+ })]
87
+ }), /* @__PURE__ */ f("p", {
88
+ className: "text-lg font-bold tabular-nums",
89
+ children: e.value
90
+ })]
91
+ }, e.name))
92
+ }),
93
+ g.parts.length > 0 && /* @__PURE__ */ f(t, {
94
+ title: v("export.detail.parts.title", "Export Parts"),
95
+ children: /* @__PURE__ */ f("ul", {
96
+ className: "space-y-2",
97
+ children: g.parts.map((e) => /* @__PURE__ */ p("li", {
98
+ className: "flex flex-col gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
99
+ children: [/* @__PURE__ */ p("div", {
100
+ className: "flex min-w-0 items-center gap-3",
101
+ children: [/* @__PURE__ */ f(l, {
102
+ size: 20,
103
+ "aria-hidden": "true",
104
+ className: "shrink-0 text-text-secondary"
105
+ }), /* @__PURE__ */ p("div", {
106
+ className: "min-w-0",
107
+ children: [/* @__PURE__ */ f("p", {
108
+ className: "truncate font-medium",
109
+ children: e.fileName
110
+ }), /* @__PURE__ */ p("p", {
111
+ className: "text-sm text-text-secondary",
112
+ children: [
113
+ e.entityTypes.map(_).join(", "),
114
+ " ·",
115
+ " ",
116
+ r(e.sizeBytes),
117
+ e.downloadExpiresAt && ` · ${v("export.detail.parts.availableUntil", "Available until {{date}}", { date: new Date(e.downloadExpiresAt).toLocaleDateString() })}`
118
+ ]
119
+ })]
120
+ })]
121
+ }), e.downloadUrl ? /* @__PURE__ */ p("a", {
122
+ href: e.downloadUrl,
123
+ className: "inline-flex shrink-0 items-center gap-2 self-start rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium hover:bg-accent sm:self-auto",
124
+ "aria-label": v("export.detail.parts.downloadAria", "Download {{name}}", { name: e.fileName }),
125
+ children: [/* @__PURE__ */ f(c, {
126
+ size: 14,
127
+ "aria-hidden": "true"
128
+ }), v("export.detail.parts.download", "Download")]
129
+ }) : /* @__PURE__ */ p("span", {
130
+ className: "inline-flex items-center gap-1.5 text-sm text-text-secondary",
131
+ children: [/* @__PURE__ */ f(s, {
132
+ size: 14,
133
+ "aria-hidden": "true"
134
+ }), v("export.detail.parts.pending", "Pending")]
135
+ })]
136
+ }, e.id))
137
+ })
138
+ }),
139
+ g.status === "COMPLETED" && g.parts.length === 0 && /* @__PURE__ */ p("div", {
140
+ className: "rounded-xl border border-border-subtle bg-bg-surface p-6 text-center",
141
+ children: [
142
+ /* @__PURE__ */ f(o, {
143
+ size: 36,
144
+ "aria-hidden": "true",
145
+ className: "mx-auto mb-2 text-text-secondary"
146
+ }),
147
+ /* @__PURE__ */ f("p", {
148
+ className: "font-semibold",
149
+ children: v("export.detail.complete.title", "Export Complete")
150
+ }),
151
+ /* @__PURE__ */ f("p", {
152
+ className: "text-sm text-text-secondary",
153
+ children: v("export.detail.complete.noParts", "Your export has completed but no download parts are available yet.")
154
+ })
155
+ ]
156
+ })
157
+ ] });
158
+ }
159
+ export { g as DownloadSections };
160
+
161
+ //# sourceMappingURL=DownloadSections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadSections.js","names":["_Fragment","DownloadSections","tr","useTr","inProgress","isInProgress","job","Fragment","ExportProgressBar","AlertCircle","ShowTechnicalDetails","HardDrive","formatBytes","Clock","GlassCard","item","PageSection","FileDown","part","label","Download","CheckCircle2"],"sources":["../../../src/export/components/DownloadSections.tsx"],"sourcesContent":["import {\n AlertCircle,\n CheckCircle2,\n Clock,\n Download,\n FileDown,\n HardDrive,\n} from \"lucide-react\";\nimport { GlassCard, ShowTechnicalDetails } from \"@burdenoff/fe-libs/ui\";\nimport { useTr } from \"../hooks/useTr\";\nimport { PageSection } from \"./PageLayout\";\nimport { ExportProgressBar } from \"./ExportProgressBar\";\nimport { formatBytes } from \"../utils/formatBytes\";\nimport { isInProgress } from \"../utils/downloadStatus\";\nimport type { ExportJob } from \"../types\";\n\n/**\n * The body of a download's page in Navigation v2 (BOFF-11870): progress while\n * it prepares, the failure or expiry note, the size and date cards, the files\n * and the \"complete, files not ready yet\" state.\n */\nexport function DownloadSections({\n job,\n label,\n}: {\n job: ExportJob;\n label: (entityType: string) => string;\n}) {\n const tr = useTr();\n const inProgress = isInProgress(job.status);\n return (\n <>\n {inProgress && (\n <div\n className=\"space-y-2 rounded-xl border border-border-subtle bg-bg-surface p-5\"\n role=\"status\"\n >\n <p className=\"font-medium text-text-primary\">\n {tr(\"export.detail.progress.preparing\", \"Preparing your files…\")}\n </p>\n <ExportProgressBar progress={job.progress} size=\"md\" />\n {job.processedEntities != null && job.totalEntities != null && (\n <p className=\"text-sm text-text-secondary\">\n {tr(\n \"export.detail.progress.items\",\n \"{{processed}} of {{total}} items ready\",\n {\n processed: job.processedEntities.toLocaleString(),\n total: job.totalEntities.toLocaleString(),\n },\n )}\n </p>\n )}\n </div>\n )}\n\n {job.status === \"FAILED\" && (\n <div className=\"flex items-start gap-3 rounded-xl border border-border-default bg-status-error-bg-subtle p-5\">\n <AlertCircle\n size={20}\n aria-hidden=\"true\"\n className=\"mt-0.5 shrink-0 text-status-error-text\"\n />\n <div className=\"min-w-0 space-y-2\">\n <p className=\"font-medium text-status-error-text\">\n {tr(\"export.detail.failed.title\", \"This download didn't finish\")}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n \"export.detail.failed.description\",\n \"Try again. If it stops again, pick less data or a shorter date range.\",\n )}\n </p>\n {job.errorMessage ? (\n <ShowTechnicalDetails copyable>\n {job.errorMessage}\n </ShowTechnicalDetails>\n ) : null}\n </div>\n </div>\n )}\n\n {job.status === \"EXPIRED\" && (\n <p className=\"rounded-xl border border-border-subtle bg-bg-surface p-4 text-sm text-text-secondary\">\n {tr(\n \"export.detail.expired.description\",\n \"The download link has expired. Try again to make a fresh copy.\",\n )}\n </p>\n )}\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n {[\n {\n icon: <HardDrive size={16} aria-hidden=\"true\" />,\n name: tr(\"export.detail.info.totalSize\", \"Total Size\"),\n value:\n job.totalSizeBytes != null\n ? formatBytes(job.totalSizeBytes)\n : \"-\",\n },\n {\n icon: <Clock size={16} aria-hidden=\"true\" />,\n name: tr(\"export.detail.info.created\", \"Created\"),\n value: new Date(job.createdAt).toLocaleDateString(),\n },\n ].map((item) => (\n <GlassCard\n key={item.name}\n treatment=\"metric\"\n className=\"border-border-seam p-4\"\n >\n <div className=\"mb-1 flex items-center gap-2 text-text-secondary\">\n {item.icon}\n <span className=\"text-xs font-medium\">{item.name}</span>\n </div>\n <p className=\"text-lg font-bold tabular-nums\">{item.value}</p>\n </GlassCard>\n ))}\n </div>\n\n {job.parts.length > 0 && (\n <PageSection title={tr(\"export.detail.parts.title\", \"Export Parts\")}>\n <ul className=\"space-y-2\">\n {job.parts.map((part) => (\n <li\n key={part.id}\n className=\"flex flex-col gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex min-w-0 items-center gap-3\">\n <FileDown\n size={20}\n aria-hidden=\"true\"\n className=\"shrink-0 text-text-secondary\"\n />\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium\">{part.fileName}</p>\n <p className=\"text-sm text-text-secondary\">\n {part.entityTypes.map(label).join(\", \")} ·{\" \"}\n {formatBytes(part.sizeBytes)}\n {part.downloadExpiresAt &&\n ` · ${tr(\n \"export.detail.parts.availableUntil\",\n \"Available until {{date}}\",\n {\n date: new Date(\n part.downloadExpiresAt,\n ).toLocaleDateString(),\n },\n )}`}\n </p>\n </div>\n </div>\n {part.downloadUrl ? (\n <a\n href={part.downloadUrl}\n className=\"inline-flex shrink-0 items-center gap-2 self-start rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium hover:bg-accent sm:self-auto\"\n aria-label={tr(\n \"export.detail.parts.downloadAria\",\n \"Download {{name}}\",\n {\n name: part.fileName,\n },\n )}\n >\n <Download size={14} aria-hidden=\"true\" />\n {tr(\"export.detail.parts.download\", \"Download\")}\n </a>\n ) : (\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <Clock size={14} aria-hidden=\"true\" />\n {tr(\"export.detail.parts.pending\", \"Pending\")}\n </span>\n )}\n </li>\n ))}\n </ul>\n </PageSection>\n )}\n\n {job.status === \"COMPLETED\" && job.parts.length === 0 && (\n <div className=\"rounded-xl border border-border-subtle bg-bg-surface p-6 text-center\">\n <CheckCircle2\n size={36}\n aria-hidden=\"true\"\n className=\"mx-auto mb-2 text-text-secondary\"\n />\n <p className=\"font-semibold\">\n {tr(\"export.detail.complete.title\", \"Export Complete\")}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n \"export.detail.complete.noParts\",\n \"Your export has completed but no download parts are available yet.\",\n )}\n </p>\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAgBC,EAAiB,EAC/B,QACA,YAIC;CACD,IAAMC,IAAKC,EAAM,GACXC,IAAaC,EAAaC,EAAI,MAAM;CAC1C,OACE,kBAAAN,GAAA,EAAA,UAAA;EACGI,KACC,kBAAC,OAAD;GACE,WAAU;GACV,MAAK;GAFP,UAAA;IAIE,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAF,EAAG,oCAAoC,uBAAuB;IAC9D,CAAA;IACH,kBAACM,GAAD;KAAmB,UAAUF,EAAI;KAAU,MAAK;IAAM,CAAA;IACrDA,EAAI,qBAAqB,QAAQA,EAAI,iBAAiB,QACrD,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAJ,EACC,gCACA,0CACA;MACE,WAAWI,EAAI,kBAAkB,eAAe;MAChD,OAAOA,EAAI,cAAc,eAAe;KAC1C,CACF;IACC,CAAA;GAEF;;EAGNA,EAAI,WAAW,YACd,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAACG,GAAD;IACE,MAAM;IACN,eAAY;IACZ,WAAU;GACX,CAAA,GACD,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,KAAD;MAAG,WAAU;MACV,UAAAP,EAAG,8BAA8B,6BAA6B;KAC9D,CAAA;KACH,kBAAC,KAAD;MAAG,WAAU;MACV,UAAAA,EACC,oCACA,uEACF;KACC,CAAA;KACFI,EAAI,eACH,kBAACI,GAAD;MAAsB,UAAA;MACnB,UAAAJ,EAAI;KACe,CAAA,IACpB;IACD;GACF,CAAA,CAAA;;EAGNA,EAAI,WAAW,aACd,kBAAC,KAAD;GAAG,WAAU;GACV,UAAAJ,EACC,qCACA,gEACF;EACC,CAAA;EAGL,kBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,CACC;IACE,MAAM,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AM,IAAI,KACRgB,EAAK,iBACP,CAAC,CAAC,mBAAmB,EACvB,CACF;QACD;OACA,CAAA,CAAA;MACF,CAAA,CAAA;KACJ,CAAA,GAAAA,EAAK,cACJ,kBAAC,KAAD;MACE,MAAMA,EAAK;MACX,WAAU;MACV,cAAYhB,EACV,oCACA,qBACA,EACE,MAAMgB,EAAK,SACb,CACF;MATF,UAAA,CAWE,kBAACE,GAAD;OAAU,MAAM;OAAI,eAAY;MAAQ,CAAA,GACvClB,EAAG,gCAAgC,UAAU,CAC7C;KAEH,CAAA,IAAA,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,kBAACW,GAAD;OAAO,MAAM;OAAI,eAAY;MAAQ,CAAA,GACpCX,EAAG,+BAA+B,SAAS,CACxC;KAEN,CAAA,CAAA;IAhDG,GAAAgB,EAAK,EAgDR,CACL;GACC,CAAA;EACO,CAAA;EAGdZ,EAAI,WAAW,eAAeA,EAAI,MAAM,WAAW,KAClD,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAACe,GAAD;KACE,MAAM;KACN,eAAY;KACZ,WAAU;IACX,CAAA;IACD,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAnB,EAAG,gCAAgC,iBAAiB;IACpD,CAAA;IACH,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAA,EACC,kCACA,oEACF;IACC,CAAA;GACA;;CAEP,EAAA,CAAA;AAEN"}
@@ -0,0 +1,13 @@
1
+ import { ExportJobStatus } from '../types';
2
+ /** The plain status words, for code that needs the text only. */
3
+ export declare function useDownloadStatusLabel(): (status: ExportJobStatus) => string;
4
+ /**
5
+ * Navigation v2 status: an icon and the plain words, in the text colour. The
6
+ * words carry the meaning, so nothing depends on colour.
7
+ */
8
+ export declare function DownloadStatus({ status, className, badge, }: {
9
+ status: ExportJobStatus;
10
+ className?: string;
11
+ /** A bordered pill, for a page header. */
12
+ badge?: boolean;
13
+ }): import('react').JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { useTr as e } from "../hooks/useTr.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { DOWNLOAD_PHASE_COPY as n, downloadPhase as r } from "../utils/downloadStatus.js";
4
+ import { CheckCircle2 as i, Loader2 as a, RotateCcw as o, XCircle as s } from "lucide-react";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ // src/export/components/DownloadStatus.tsx
7
+ var u = {
8
+ preparing: a,
9
+ ready: i,
10
+ failed: s,
11
+ cancelled: s,
12
+ expired: o,
13
+ deleted: s
14
+ };
15
+ function d() {
16
+ let t = e();
17
+ return (e) => {
18
+ let i = n[r(e)];
19
+ return t(i.key, i.label);
20
+ };
21
+ }
22
+ function f({ status: e, className: n, badge: i = !1 }) {
23
+ let a = d(), o = r(e), s = u[o];
24
+ return /* @__PURE__ */ l("span", {
25
+ "data-phase": o,
26
+ className: t("inline-flex items-center gap-1.5 text-sm text-text-secondary", i && "rounded-full border border-border-subtle bg-bg-surface px-2.5 py-0.5 text-xs font-medium text-text-primary", n),
27
+ children: [/* @__PURE__ */ c(s, {
28
+ size: 14,
29
+ "aria-hidden": "true",
30
+ className: t("shrink-0", o === "preparing" && "motion-safe:animate-spin")
31
+ }), a(e)]
32
+ });
33
+ }
34
+ export { f as DownloadStatus, d as useDownloadStatusLabel };
35
+
36
+ //# sourceMappingURL=DownloadStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadStatus.js","names":["PHASE_ICON","Loader2","CheckCircle2","XCircle","RotateCcw","useDownloadStatusLabel","tr","useTr","copy","DOWNLOAD_PHASE_COPY","downloadPhase","status","DownloadStatus","label","phase","Icon","cn","badge","className"],"sources":["../../../src/export/components/DownloadStatus.tsx"],"sourcesContent":["import { CheckCircle2, Clock, Loader2, RotateCcw, XCircle } from \"lucide-react\";\nimport { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport {\n DOWNLOAD_PHASE_COPY,\n downloadPhase,\n type DownloadPhase,\n} from \"../utils/downloadStatus\";\nimport type { ExportJobStatus } from \"../types\";\n\nconst PHASE_ICON: Record<DownloadPhase, typeof Clock> = {\n preparing: Loader2,\n ready: CheckCircle2,\n failed: XCircle,\n cancelled: XCircle,\n expired: RotateCcw,\n deleted: XCircle,\n};\n\n/** The plain status words, for code that needs the text only. */\nexport function useDownloadStatusLabel(): (status: ExportJobStatus) => string {\n const tr = useTr();\n return (status) => {\n const copy = DOWNLOAD_PHASE_COPY[downloadPhase(status)];\n return tr(copy.key, copy.label);\n };\n}\n\n/**\n * Navigation v2 status: an icon and the plain words, in the text colour. The\n * words carry the meaning, so nothing depends on colour.\n */\nexport function DownloadStatus({\n status,\n className,\n badge = false,\n}: {\n status: ExportJobStatus;\n className?: string;\n /** A bordered pill, for a page header. */\n badge?: boolean;\n}) {\n const label = useDownloadStatusLabel();\n const phase = downloadPhase(status);\n const Icon = PHASE_ICON[phase];\n return (\n <span\n data-phase={phase}\n className={cn(\n \"inline-flex items-center gap-1.5 text-sm text-text-secondary\",\n badge &&\n \"rounded-full border border-border-subtle bg-bg-surface px-2.5 py-0.5 text-xs font-medium text-text-primary\",\n className,\n )}\n >\n <Icon\n size={14}\n aria-hidden=\"true\"\n className={cn(\n \"shrink-0\",\n phase === \"preparing\" && \"motion-safe:animate-spin\",\n )}\n />\n {label(status)}\n </span>\n );\n}\n"],"mappings":";;;;;;AAUA,IAAMA,IAAkD;CACtD,WAAWC;CACX,OAAOC;CACP,QAAQC;CACR,WAAWA;CACX,SAASC;CACT,SAASD;AACX;AAGA,SAAgBE,IAA8D;CAC5E,IAAMC,IAAKC,EAAM;CACjB,QAAQ,MAAW;EACjB,IAAMC,IAAOC,EAAoBC,EAAcC,CAAM;EACrD,OAAOL,EAAGE,EAAK,KAAKA,EAAK,KAAK;CAChC;AACF;AAMA,SAAgBI,EAAe,EAC7B,WACA,cACA,WAAQ,MAMP;CACD,IAAMC,IAAQR,EAAuB,GAC/BS,IAAQJ,EAAcC,CAAM,GAC5BI,IAAOf,EAAWc;CACxB,OACE,kBAAC,QAAD;EACE,cAAYA;EACZ,WAAWE,EACT,gEACAC,KACE,8GACFC,CACF;EAPF,UAAA,CASE,kBAACH,GAAD;GACE,MAAM;GACN,eAAY;GACZ,WAAWC,EACT,YACAF,MAAU,eAAe,0BAC3B;EACD,CAAA,GACAD,EAAMF,CAAM,CACT;;AAEV"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Navigation v2 tab row for "Download your data": the list first, "Saved
3
+ * setups" one click away under "More ▾" (BOFF-11870, page table row 4).
4
+ */
5
+ export declare function DownloadsTabs(): import('react').JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { useExport as e } from "../providers/ExportProvider.js";
2
+ import { useTr as t } from "../hooks/useTr.js";
3
+ import { joinPath as n } from "../utils/paths.js";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { PageTabs as i } from "@burdenoff/fe-libs/ui";
6
+ // src/export/components/DownloadsTabs.tsx
7
+ function a() {
8
+ let { basePath: a = "/" } = e(), o = t(), s = [{
9
+ id: "downloads",
10
+ label: o("export.downloads.tabs.downloads", "Downloads"),
11
+ href: a
12
+ }, {
13
+ id: "templates",
14
+ label: o("export.downloads.tabs.savedSetups", "Saved setups"),
15
+ href: n(a, "templates")
16
+ }];
17
+ return /* @__PURE__ */ r(i, {
18
+ tabs: s,
19
+ maxVisible: 1,
20
+ ariaLabel: o("export.downloads.tabs.label", "Download your data")
21
+ });
22
+ }
23
+ export { a as DownloadsTabs };
24
+
25
+ //# sourceMappingURL=DownloadsTabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadsTabs.js","names":["DownloadsTabs","useExport","tr","useTr","tabs","basePath","joinPath","PageTabs"],"sources":["../../../src/export/components/DownloadsTabs.tsx"],"sourcesContent":["import { PageTabs, type PageTabItem } from \"@burdenoff/fe-libs/ui\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport { useTr } from \"../hooks/useTr\";\nimport { joinPath } from \"../utils/paths\";\n\n/**\n * Navigation v2 tab row for \"Download your data\": the list first, \"Saved\n * setups\" one click away under \"More ▾\" (BOFF-11870, page table row 4).\n */\nexport function DownloadsTabs() {\n const { basePath = \"/\" } = useExport();\n const tr = useTr();\n const tabs: PageTabItem[] = [\n {\n id: \"downloads\",\n label: tr(\"export.downloads.tabs.downloads\", \"Downloads\"),\n href: basePath,\n },\n {\n id: \"templates\",\n label: tr(\"export.downloads.tabs.savedSetups\", \"Saved setups\"),\n href: joinPath(basePath, \"templates\"),\n },\n ];\n return (\n <PageTabs\n tabs={tabs}\n maxVisible={1}\n ariaLabel={tr(\"export.downloads.tabs.label\", \"Download your data\")}\n />\n );\n}\n"],"mappings":";;;;;;AASA,SAAgBA,IAAgB;CAC9B,IAAM,EAAE,cAAW,QAAQC,EAAU,GAC/BC,IAAKC,EAAM,GACXC,IAAsB,CAC1B;EACE,IAAI;EACJ,OAAOF,EAAG,mCAAmC,WAAW;EACxD,MAAMG;CACR,GACA;EACE,IAAI;EACJ,OAAOH,EAAG,qCAAqC,cAAc;EAC7D,MAAMI,EAASD,GAAU,WAAW;CACtC,CACF;CACA,OACE,kBAACE,GAAD;EACQ;EACN,YAAY;EACZ,WAAWL,EAAG,+BAA+B,oBAAoB;CAClE,CAAA;AAEL"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `(entityType) => plain name`, backed by the workspace's entity catalog
3
+ * (`useAvailableEntities`). Use it wherever an entity type is shown, so a raw
4
+ * key such as `rbac_role_members` never reaches the page. Pass `false` to
5
+ * keep the raw key and skip the catalog query.
6
+ */
7
+ export declare function useEntityLabel(enabled?: boolean): (entityType: string) => string;
@@ -0,0 +1,16 @@
1
+ import { useAvailableEntities as e } from "./useExportQueries.js";
2
+ import { useTr as t } from "./useTr.js";
3
+ import { entityLabel as n } from "../utils/entityLabels.js";
4
+ import { useCallback as r } from "react";
5
+ // src/export/hooks/useEntityLabel.ts
6
+ function i(i = !0) {
7
+ let a = t(), { data: o } = e(void 0, { skip: !i });
8
+ return r((e) => i ? n(e, a, o) : e, [
9
+ i,
10
+ a,
11
+ o
12
+ ]);
13
+ }
14
+ export { i as useEntityLabel };
15
+
16
+ //# sourceMappingURL=useEntityLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEntityLabel.js","names":["useEntityLabel","tr","useTr","available","useAvailableEntities","enabled","useCallback","entityLabel","entityType"],"sources":["../../../src/export/hooks/useEntityLabel.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useAvailableEntities } from \"./useExportQueries\";\nimport { useTr } from \"./useTr\";\nimport { entityLabel } from \"../utils/entityLabels\";\n\n/**\n * `(entityType) => plain name`, backed by the workspace's entity catalog\n * (`useAvailableEntities`). Use it wherever an entity type is shown, so a raw\n * key such as `rbac_role_members` never reaches the page. Pass `false` to\n * keep the raw key and skip the catalog query.\n */\nexport function useEntityLabel(enabled = true): (entityType: string) => string {\n const tr = useTr();\n // Off (the legacy pages), the catalog is not fetched and the label is the key.\n const { data: available } = useAvailableEntities(undefined, {\n skip: !enabled,\n });\n return useCallback(\n (entityType: string) =>\n enabled ? entityLabel(entityType, tr, available) : entityType,\n [enabled, tr, available],\n );\n}\n"],"mappings":";;;;;AAWA,SAAgBA,EAAe,IAAU,IAAsC;CAC7E,IAAMC,IAAKC,EAAM,GAEX,EAAE,MAAMC,MAAcC,EAAqB,KAAA,GAAW,EAC1D,MAAM,CAACC,EACT,CAAC;CACD,OAAOC,GACJ,MACCD,IAAUE,EAAYC,GAAYP,GAAIE,CAAS,IAAIK,GACrD;EAACH;EAASJ;EAAIE;CAAS,CACzB;AACF"}
@@ -83,7 +83,9 @@ export declare function useExportJobProgress(jobId: string | undefined): {
83
83
  /**
84
84
  * Hook to fetch available entity types for export in a workspace
85
85
  */
86
- export declare function useAvailableEntities(overrideWorkspaceId?: string): {
86
+ export declare function useAvailableEntities(overrideWorkspaceId?: string, options?: {
87
+ skip?: boolean;
88
+ }): {
87
89
  data: ExportAvailableEntity[];
88
90
  totalCount: number;
89
91
  pageInfo: PageInfo | null;
@@ -180,50 +180,50 @@ function R(e, { fetchMoreResult: t }) {
180
180
  edges: [...e.getAvailableExportEntities.edges, ...t.getAvailableExportEntities.edges]
181
181
  } } : e;
182
182
  }
183
- function z(e) {
184
- let { workspaceId: t } = g(), n = e ?? t, { data: r, loading: i, error: a, refetch: o, fetchMore: c } = x(s, {
183
+ function z(e, t = {}) {
184
+ let { workspaceId: n } = g(), r = t.skip ? void 0 : e ?? n, { data: i, loading: a, error: o, refetch: c, fetchMore: l } = x(s, {
185
185
  variables: {
186
- context: { workspaceId: n },
186
+ context: { workspaceId: r },
187
187
  pagination: { first: 100 }
188
188
  },
189
- skip: !n
190
- }), l = r?.getAvailableExportEntities, u = l?.edges.map((e) => j(e.node)) ?? [], d = async () => {
191
- n && l?.pageInfo.hasNextPage && await c({
189
+ skip: !r
190
+ }), u = i?.getAvailableExportEntities, d = u?.edges.map((e) => j(e.node)) ?? [], f = async () => {
191
+ r && u?.pageInfo.hasNextPage && await l({
192
192
  variables: {
193
- context: { workspaceId: n },
193
+ context: { workspaceId: r },
194
194
  pagination: {
195
195
  first: 100,
196
- after: l.pageInfo.endCursor
196
+ after: u.pageInfo.endCursor
197
197
  }
198
198
  },
199
199
  updateQuery: R
200
200
  });
201
- }, f = l?.pageInfo.hasNextPage ?? !1, p = l?.pageInfo.endCursor ?? null, m = y(null);
201
+ }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = y(null);
202
202
  return v(() => {
203
- !i && n && f && p && m.current !== p && (m.current = p, c({
203
+ !a && r && p && m && h.current !== m && (h.current = m, l({
204
204
  variables: {
205
- context: { workspaceId: n },
205
+ context: { workspaceId: r },
206
206
  pagination: {
207
207
  first: 100,
208
- after: p
208
+ after: m
209
209
  }
210
210
  },
211
211
  updateQuery: R
212
212
  }));
213
213
  }, [
214
- i,
215
- n,
216
- f,
214
+ a,
215
+ r,
217
216
  p,
218
- c
217
+ m,
218
+ l
219
219
  ]), {
220
- data: u,
221
- totalCount: l?.totalCount ?? 0,
222
- pageInfo: l?.pageInfo ? D(l.pageInfo) : null,
223
- loadMore: d,
224
- error: a ?? null,
225
- isLoading: i,
226
- refetch: o
220
+ data: d,
221
+ totalCount: u?.totalCount ?? 0,
222
+ pageInfo: u?.pageInfo ? D(u.pageInfo) : null,
223
+ loadMore: f,
224
+ error: o ?? null,
225
+ isLoading: a,
226
+ refetch: c
227
227
  };
228
228
  }
229
229
  function B(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"useExportQueries.js","names":["GqlExportFormat","GqlExportJobStatus","GqlExportScope","optionalString","value","optionalNumber","parsed","numberOrZero","optionalRecord","mapPageInfo","pageInfo","mapPart","part","mapJob","job","mapTemplate","template","mapAvailableEntity","entity","toGqlFormat","format","ExportFormat","toGqlStatus","status","ExportJobStatus","toGqlScope","scope","ExportScope","useExportJobs","useExport","backendFilter","filter","workspaceId","useQuery","ListExportJobsDocument","data","loading","error","useExportJob","GetExportJobDocument","jobId","useExportJobProgress","useSubscription","ExportJobProgressDocument","appendEntityPage","fetchMoreResult","previous","useAvailableEntities","ctxWorkspaceId","overrideWorkspaceId","GetAvailableExportEntitiesDocument","connection","entities","edge","loadMore","fetchMore","hasNextPage","endCursor","requestedCursor","useRef","useEffect","useExportTemplates","ListExportTemplatesDocument","useExportTemplate","GetExportTemplateDocument","templateId","useCreateExportJob","exportContext","mutate","useMutation","CreateExportJobDocument","createJob","restInput","input","gqlInput","filters","result","emitExportEvent","useCancelExportJob","CancelExportJobDocument","cancelJob","id","useDeleteExportJob","DeleteExportJobDocument","deleteJob","useRetryExportJob","RetryExportJobDocument","useCreateExportTemplate","CreateExportTemplateDocument","useDeleteExportTemplate","DeleteExportTemplateDocument","useOrganizationExportPermission","ExportOrganizationPermissionDocument","organizationId","permission"],"sources":["../../../src/export/hooks/useExportQueries.ts"],"sourcesContent":["/**\n * Export Query Hooks\n *\n * Real Apollo Client hooks for all export operations.\n * Keep these documents in sync with src/operations/wspace/export/*.graphql.\n */\n\nimport { useEffect, useRef } from \"react\";\nimport { useMutation, useQuery, useSubscription } from \"@apollo/client/react\";\nimport {\n CancelExportJobDocument,\n CreateExportJobDocument,\n CreateExportTemplateDocument,\n DeleteExportJobDocument,\n DeleteExportTemplateDocument,\n ExportJobProgressDocument,\n ExportOrganizationPermissionDocument,\n GetAvailableExportEntitiesDocument,\n GetExportJobDocument,\n GetExportTemplateDocument,\n ListExportJobsDocument,\n ListExportTemplatesDocument,\n RetryExportJobDocument,\n type CancelExportJobMutation,\n type CancelExportJobMutationVariables,\n type CreateExportJobMutation,\n type CreateExportJobMutationVariables,\n type CreateExportTemplateMutation,\n type CreateExportTemplateMutationVariables,\n type DeleteExportJobMutation,\n type DeleteExportJobMutationVariables,\n type DeleteExportTemplateMutation,\n type DeleteExportTemplateMutationVariables,\n type ExportJobProgressSubscription,\n type ExportOrganizationPermissionQuery,\n type ExportOrganizationPermissionQueryVariables,\n type ExportJobProgressSubscriptionVariables,\n type GetAvailableExportEntitiesQuery,\n type GetAvailableExportEntitiesQueryVariables,\n type GetExportJobQuery,\n type GetExportJobQueryVariables,\n type GetExportTemplateQuery,\n type GetExportTemplateQueryVariables,\n type ListExportJobsQuery,\n type ListExportJobsQueryVariables,\n type ListExportTemplatesQuery,\n type ListExportTemplatesQueryVariables,\n type RetryExportJobMutation,\n type RetryExportJobMutationVariables,\n} from \"../../generated/wspace-operations\";\nimport {\n ExportFormat as GqlExportFormat,\n ExportJobStatus as GqlExportJobStatus,\n ExportScope as GqlExportScope,\n type CreateExportJobInput as GqlCreateExportJobInput,\n type CreateExportTemplateInput as GqlCreateExportTemplateInput,\n type ExportJobFilterInput as GqlExportJobFilterInput,\n type ExportPaginationInput as GqlExportPaginationInput,\n} from \"../../generated/wspace-types\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport { emitExportEvent } from \"../utils/events\";\nimport type {\n ExportArchiveFormat,\n ExportFormat,\n ExportJob,\n ExportJobStatus,\n ExportScope,\n ExportTemplate,\n ExportAvailableEntity,\n ExportPart,\n ExportFilter,\n PageInfo,\n} from \"../types\";\n\n// ---------------------------------------------------------------------------\n// Mapping helpers\n// ---------------------------------------------------------------------------\n\ntype Nullable<T> = T | null | undefined;\n\ninterface ExportPartLike {\n id: string;\n jobId?: Nullable<string>;\n partNumber: number;\n fileName: string;\n sizeBytes: number | string;\n entityTypes: string[];\n downloadUrl?: Nullable<string>;\n downloadExpiresAt?: Nullable<string>;\n checksum?: Nullable<string>;\n createdAt?: Nullable<string>;\n}\n\ninterface ExportJobLike {\n id: string;\n name: string;\n description?: Nullable<string>;\n status: string;\n progress: number;\n exportScope?: Nullable<string>;\n organizationId?: Nullable<string>;\n targetWorkspaceIds?: Nullable<string[]>;\n entityTypes: string[];\n format: string;\n archiveFormat?: Nullable<string>;\n totalEntities?: Nullable<number>;\n processedEntities?: Nullable<number>;\n totalSizeBytes?: Nullable<number | string>;\n parts?: Nullable<ExportPartLike[]>;\n archiveFileId?: Nullable<string>;\n downloadUrl?: Nullable<string>;\n downloadExpiresAt?: Nullable<string>;\n templateId?: Nullable<string>;\n entityFilters?: Nullable<Record<string, unknown>>;\n errorMessage?: Nullable<string>;\n startedAt?: Nullable<string>;\n completedAt?: Nullable<string>;\n expiresAt?: Nullable<string>;\n createdBy: string;\n temporalWorkflowId?: Nullable<string>;\n workspaceId?: Nullable<string>;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface ExportTemplateLike {\n id: string;\n name: string;\n description?: Nullable<string>;\n entityTypes: string[];\n format: string;\n entityFilters?: Nullable<Record<string, unknown>>;\n isDefault: boolean;\n workspaceId?: Nullable<string>;\n createdBy: string;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface ExportAvailableEntityLike {\n entityType: string;\n displayName: string;\n description?: Nullable<string>;\n estimatedSize?: Nullable<string>;\n supportsDateRange: boolean;\n supportsMediaExport: boolean;\n enabled: boolean;\n}\n\nfunction optionalString(value: Nullable<string>): string | undefined {\n return value ?? undefined;\n}\n\nfunction optionalNumber(value: Nullable<number | string>): number | undefined {\n if (value == null) return undefined;\n const parsed = typeof value === \"number\" ? value : Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction numberOrZero(value: Nullable<number | string>): number {\n return optionalNumber(value) ?? 0;\n}\n\nfunction optionalRecord(\n value: Nullable<Record<string, unknown>>,\n): Record<string, unknown> | undefined {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? value\n : undefined;\n}\n\nfunction mapPageInfo(pageInfo: {\n hasNextPage: boolean;\n hasPreviousPage: boolean;\n startCursor?: Nullable<string>;\n endCursor?: Nullable<string>;\n}): PageInfo {\n return {\n hasNextPage: pageInfo.hasNextPage,\n hasPreviousPage: pageInfo.hasPreviousPage,\n startCursor: optionalString(pageInfo.startCursor),\n endCursor: optionalString(pageInfo.endCursor),\n };\n}\n\nfunction mapPart(part: ExportPartLike): ExportPart {\n return {\n id: part.id,\n jobId: optionalString(part.jobId),\n partNumber: part.partNumber,\n fileName: part.fileName,\n sizeBytes: numberOrZero(part.sizeBytes),\n entityTypes: part.entityTypes,\n downloadUrl: optionalString(part.downloadUrl),\n downloadExpiresAt: optionalString(part.downloadExpiresAt),\n checksum: optionalString(part.checksum),\n createdAt: optionalString(part.createdAt),\n };\n}\n\nfunction mapJob(job: ExportJobLike): ExportJob {\n return {\n id: job.id,\n name: job.name,\n description: optionalString(job.description),\n status: job.status as ExportJobStatus,\n progress: job.progress,\n exportScope: job.exportScope ? (job.exportScope as ExportScope) : undefined,\n organizationId: optionalString(job.organizationId),\n targetWorkspaceIds: job.targetWorkspaceIds ?? undefined,\n entityTypes: job.entityTypes,\n format: job.format as ExportFormat,\n archiveFormat: (job.archiveFormat ?? \"ZIP\") as ExportArchiveFormat,\n totalEntities: optionalNumber(job.totalEntities),\n processedEntities: optionalNumber(job.processedEntities),\n totalSizeBytes: optionalNumber(job.totalSizeBytes),\n parts: job.parts?.map(mapPart) ?? [],\n archiveFileId: optionalString(job.archiveFileId),\n downloadUrl: optionalString(job.downloadUrl),\n downloadExpiresAt: optionalString(job.downloadExpiresAt),\n templateId: optionalString(job.templateId),\n filters: optionalRecord(job.entityFilters),\n errorMessage: optionalString(job.errorMessage),\n startedAt: optionalString(job.startedAt),\n completedAt: optionalString(job.completedAt),\n expiresAt: optionalString(job.expiresAt),\n createdBy: job.createdBy,\n temporalWorkflowId: optionalString(job.temporalWorkflowId),\n workspaceId: optionalString(job.workspaceId),\n createdAt: job.createdAt,\n updatedAt: job.updatedAt,\n };\n}\n\nfunction mapTemplate(template: ExportTemplateLike): ExportTemplate {\n return {\n id: template.id,\n name: template.name,\n description: optionalString(template.description),\n entityTypes: template.entityTypes,\n format: template.format as ExportFormat,\n filters: optionalRecord(template.entityFilters),\n isDefault: template.isDefault,\n createdBy: template.createdBy,\n workspaceId: optionalString(template.workspaceId),\n createdAt: template.createdAt,\n updatedAt: template.updatedAt,\n };\n}\n\nfunction mapAvailableEntity(\n entity: ExportAvailableEntityLike,\n): ExportAvailableEntity {\n return {\n entityType: entity.entityType,\n displayName: entity.displayName,\n description: optionalString(entity.description),\n estimatedSize: optionalString(entity.estimatedSize),\n supportsDateRange: entity.supportsDateRange,\n supportsMediaExport: entity.supportsMediaExport,\n enabled: entity.enabled,\n };\n}\n\nfunction toGqlFormat(format: ExportFormat | string): GqlExportFormat {\n if (format === \"CSV\") return GqlExportFormat.Csv;\n if (format === \"JSON\") return GqlExportFormat.Json;\n throw new Error(`Unsupported export format: ${format}`);\n}\n\nfunction toGqlStatus(status: ExportJobStatus | string): GqlExportJobStatus {\n switch (status) {\n case \"CANCELLED\":\n return GqlExportJobStatus.Cancelled;\n case \"COMPLETED\":\n return GqlExportJobStatus.Completed;\n case \"CREATED\":\n return GqlExportJobStatus.Created;\n case \"DELETED\":\n return GqlExportJobStatus.Deleted;\n case \"EXPIRED\":\n return GqlExportJobStatus.Expired;\n case \"FAILED\":\n return GqlExportJobStatus.Failed;\n case \"QUEUED\":\n return GqlExportJobStatus.Queued;\n case \"RUNNING\":\n return GqlExportJobStatus.Running;\n default:\n throw new Error(`Unsupported export status: ${status}`);\n }\n}\n\nfunction toGqlScope(scope: ExportScope | string): GqlExportScope {\n switch (scope) {\n case \"INDIVIDUAL\":\n return GqlExportScope.Individual;\n case \"WORKSPACE_ADMIN\":\n return GqlExportScope.WorkspaceAdmin;\n case \"ORG_ADMIN\":\n return GqlExportScope.OrgAdmin;\n default:\n throw new Error(`Unsupported export scope: ${scope}`);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Query Hooks\n// ---------------------------------------------------------------------------\n\n/**\n * Input for creating an export job\n */\nexport interface CreateExportJobInput {\n name: string;\n description?: string;\n exportScope?: ExportScope;\n organizationId?: string;\n entityTypes: string[];\n format: ExportFormat;\n filters?: Record<string, unknown>;\n templateId?: string;\n dateRangeStart?: string | null;\n dateRangeEnd?: string | null;\n}\n\n/**\n * Input for creating an export template\n */\nexport interface CreateExportTemplateInput {\n name: string;\n description?: string;\n entityTypes: string[];\n format: ExportFormat;\n}\n\n/**\n * Filter input for listing export jobs\n */\nexport interface ExportJobFilterInput {\n status?: ExportJobStatus[];\n format?: ExportFormat;\n entityTypes?: string[];\n search?: string;\n dateFrom?: string;\n dateTo?: string;\n}\n\n/**\n * Pagination input for export job list\n */\nexport interface ExportPaginationInput {\n first?: number;\n after?: string;\n last?: number;\n before?: string;\n}\n\n/**\n * Hook to fetch a paginated list of export jobs\n */\nexport function useExportJobs(\n filter?: Partial<ExportFilter>,\n pagination?: ExportPaginationInput,\n) {\n const { workspaceId } = useExport();\n\n // Build the backend filter from the UI filter shape\n const backendFilter: GqlExportJobFilterInput | undefined =\n filter && workspaceId\n ? {\n status:\n filter.status && filter.status !== \"all\"\n ? [toGqlStatus(filter.status)]\n : undefined,\n format:\n filter.format && filter.format !== \"all\"\n ? toGqlFormat(filter.format)\n : undefined,\n search: filter.search ?? undefined,\n }\n : undefined;\n\n const { data, loading, error, refetch } = useQuery<\n ListExportJobsQuery,\n ListExportJobsQueryVariables\n >(ListExportJobsDocument, {\n variables: {\n filter: backendFilter,\n pagination: pagination as GqlExportPaginationInput | undefined,\n context: { workspaceId },\n },\n skip: !workspaceId,\n });\n\n const jobs = data?.listExportJobs.edges.map((e) => mapJob(e.node)) ?? [];\n const totalCount = data?.listExportJobs.totalCount ?? 0;\n const pageInfo = data?.listExportJobs.pageInfo\n ? mapPageInfo(data.listExportJobs.pageInfo)\n : null;\n\n return {\n data: jobs,\n totalCount,\n pageInfo,\n isLoading: loading,\n error: error ?? null,\n refetch,\n };\n}\n\n/**\n * Hook to fetch a single export job by ID.\n */\nexport function useExportJob(jobId: string | undefined) {\n const { workspaceId } = useExport();\n\n const { data, loading, error, refetch } = useQuery<\n GetExportJobQuery,\n GetExportJobQueryVariables\n >(GetExportJobDocument, {\n variables: { id: jobId ?? \"\", context: { workspaceId } },\n skip: !jobId || !workspaceId,\n });\n\n const job = data?.getExportJob ? mapJob(data.getExportJob) : null;\n\n return {\n data: job,\n isLoading: loading,\n error: error ?? null,\n refetch,\n };\n}\n\n/**\n * Hook to subscribe to live progress updates for an export job.\n */\nexport function useExportJobProgress(jobId: string | undefined) {\n const { data, loading, error } = useSubscription<\n ExportJobProgressSubscription,\n ExportJobProgressSubscriptionVariables\n >(ExportJobProgressDocument, {\n variables: { jobId: jobId ?? \"\" },\n skip: !jobId,\n });\n\n return {\n data: data?.exportJobProgress ? mapJob(data.exportJobProgress) : null,\n isLoading: loading,\n error: error ?? null,\n };\n}\n\n/** Apollo `updateQuery` for the catalog: append a fetched page's edges. */\nfunction appendEntityPage(\n previous: GetAvailableExportEntitiesQuery,\n { fetchMoreResult }: { fetchMoreResult?: GetAvailableExportEntitiesQuery },\n): GetAvailableExportEntitiesQuery {\n if (!fetchMoreResult) return previous;\n return {\n getAvailableExportEntities: {\n ...fetchMoreResult.getAvailableExportEntities,\n edges: [\n ...previous.getAvailableExportEntities.edges,\n ...fetchMoreResult.getAvailableExportEntities.edges,\n ],\n },\n };\n}\n\n/**\n * Hook to fetch available entity types for export in a workspace\n */\nexport function useAvailableEntities(overrideWorkspaceId?: string) {\n const { workspaceId: ctxWorkspaceId } = useExport();\n const workspaceId = overrideWorkspaceId ?? ctxWorkspaceId;\n\n const { data, loading, error, refetch, fetchMore } = useQuery<\n GetAvailableExportEntitiesQuery,\n GetAvailableExportEntitiesQueryVariables\n >(GetAvailableExportEntitiesDocument, {\n variables: {\n context: { workspaceId },\n pagination: { first: 100 },\n },\n skip: !workspaceId,\n });\n\n const connection = data?.getAvailableExportEntities;\n const entities =\n connection?.edges.map((edge) => mapAvailableEntity(edge.node)) ?? [];\n\n const loadMore = async () => {\n if (!workspaceId || !connection?.pageInfo.hasNextPage) return;\n await fetchMore({\n variables: {\n context: { workspaceId },\n pagination: { first: 100, after: connection.pageInfo.endCursor },\n },\n updateQuery: appendEntityPage,\n });\n };\n\n // The entity picker and the template editor need the whole catalog (well\n // over one 100-entry page: entities are sorted by display name, so products\n // late in the alphabet, e.g. VibeControls, were never shown). Fetch the\n // remaining pages, once per cursor.\n const hasNextPage = connection?.pageInfo.hasNextPage ?? false;\n const endCursor = connection?.pageInfo.endCursor ?? null;\n const requestedCursor = useRef<string | null>(null);\n useEffect(() => {\n if (loading || !workspaceId || !hasNextPage || !endCursor) return;\n if (requestedCursor.current === endCursor) return;\n requestedCursor.current = endCursor;\n void fetchMore({\n variables: {\n context: { workspaceId },\n pagination: { first: 100, after: endCursor },\n },\n updateQuery: appendEntityPage,\n });\n }, [loading, workspaceId, hasNextPage, endCursor, fetchMore]);\n\n return {\n data: entities,\n totalCount: connection?.totalCount ?? 0,\n pageInfo: connection?.pageInfo ? mapPageInfo(connection.pageInfo) : null,\n loadMore,\n error: error ?? null,\n isLoading: loading,\n refetch,\n };\n}\n\n/**\n * Hook to fetch all export templates for the current workspace\n */\nexport function useExportTemplates(overrideWorkspaceId?: string) {\n const { workspaceId: ctxWorkspaceId } = useExport();\n const workspaceId = overrideWorkspaceId ?? ctxWorkspaceId;\n\n const { data, loading, error, refetch, fetchMore } = useQuery<\n ListExportTemplatesQuery,\n ListExportTemplatesQueryVariables\n >(ListExportTemplatesDocument, {\n variables: {\n context: { workspaceId },\n pagination: { first: 50 },\n },\n skip: !workspaceId,\n });\n\n const connection = data?.listExportTemplates;\n const templates =\n connection?.edges.map((edge) => mapTemplate(edge.node)) ?? [];\n\n const loadMore = async () => {\n if (!workspaceId || !connection?.pageInfo.hasNextPage) return;\n await fetchMore({\n variables: {\n context: { workspaceId },\n pagination: { first: 50, after: connection.pageInfo.endCursor },\n },\n updateQuery: (previous, { fetchMoreResult }) => {\n if (!fetchMoreResult) return previous;\n return {\n listExportTemplates: {\n ...fetchMoreResult.listExportTemplates,\n edges: [\n ...previous.listExportTemplates.edges,\n ...fetchMoreResult.listExportTemplates.edges,\n ],\n },\n };\n },\n });\n };\n\n return {\n data: templates,\n totalCount: connection?.totalCount ?? 0,\n pageInfo: connection?.pageInfo ? mapPageInfo(connection.pageInfo) : null,\n loadMore,\n isLoading: loading,\n error: error ?? null,\n refetch,\n };\n}\n\n/**\n * Hook to fetch a single export template by ID\n */\nexport function useExportTemplate(templateId: string | undefined) {\n const { workspaceId } = useExport();\n\n const { data, loading, error } = useQuery<\n GetExportTemplateQuery,\n GetExportTemplateQueryVariables\n >(GetExportTemplateDocument, {\n variables: { id: templateId ?? \"\", context: { workspaceId } },\n skip: !templateId || !workspaceId,\n });\n\n return {\n data: data?.getExportTemplate ? mapTemplate(data.getExportTemplate) : null,\n isLoading: loading,\n error: error ?? null,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Mutation Hooks\n// ---------------------------------------------------------------------------\n\n/**\n * Hook to create a new export job\n */\nexport function useCreateExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n CreateExportJobMutation,\n CreateExportJobMutationVariables\n >(CreateExportJobDocument);\n\n const createJob = async (input: CreateExportJobInput): Promise<ExportJob> => {\n const { filters, ...restInput } = input;\n const gqlInput: GqlCreateExportJobInput = {\n ...restInput,\n exportScope: restInput.exportScope\n ? toGqlScope(restInput.exportScope)\n : undefined,\n format: toGqlFormat(restInput.format),\n entityFilters: filters,\n };\n\n const result = await mutate({\n variables: {\n context: { workspaceId },\n input: gqlInput,\n },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"createExportJob\",\n });\n throw new Error(\"Failed to create export job\");\n }\n emitExportEvent(exportContext, \"export.job.created\", {\n jobId: result.data.createExportJob.id,\n });\n return mapJob(result.data.createExportJob);\n };\n\n return {\n createJob,\n // Keep legacy names for existing callers\n mutate: createJob,\n mutateAsync: createJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to cancel an export job\n */\nexport function useCancelExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n CancelExportJobMutation,\n CancelExportJobMutationVariables\n >(CancelExportJobDocument);\n\n const cancelJob = async (id: string) => {\n const result = await mutate({\n variables: {\n id,\n context: { workspaceId },\n },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"cancelExportJob\",\n jobId: id,\n });\n throw new Error(\"Failed to cancel export job\");\n }\n emitExportEvent(exportContext, \"export.job.cancelled\", { jobId: id });\n return result.data.cancelExportJob;\n };\n\n return {\n cancelJob,\n mutate: cancelJob,\n mutateAsync: cancelJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to delete an export job\n */\nexport function useDeleteExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n DeleteExportJobMutation,\n DeleteExportJobMutationVariables\n >(DeleteExportJobDocument);\n\n const deleteJob = async (id: string): Promise<boolean> => {\n await mutate({\n variables: {\n id,\n context: { workspaceId },\n },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n emitExportEvent(exportContext, \"export.job.deleted\", { jobId: id });\n return true;\n };\n\n return {\n deleteJob,\n mutate: deleteJob,\n mutateAsync: deleteJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to retry a failed export job\n */\nexport function useRetryExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n RetryExportJobMutation,\n RetryExportJobMutationVariables\n >(RetryExportJobDocument);\n\n const retryJob = async (id: string): Promise<ExportJob> => {\n const result = await mutate({\n variables: { id, context: { workspaceId } },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"retryExportJob\",\n jobId: id,\n });\n throw new Error(\"Failed to retry export job\");\n }\n emitExportEvent(exportContext, \"export.job.retried\", {\n originalJobId: id,\n jobId: result.data.retryExportJob.id,\n });\n return mapJob(result.data.retryExportJob);\n };\n\n return {\n retryJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to create a new export template\n */\nexport function useCreateExportTemplate() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n CreateExportTemplateMutation,\n CreateExportTemplateMutationVariables\n >(CreateExportTemplateDocument);\n\n const createTemplate = async (\n input: CreateExportTemplateInput,\n ): Promise<ExportTemplate> => {\n const gqlInput: GqlCreateExportTemplateInput = {\n ...input,\n format: toGqlFormat(input.format),\n };\n\n const result = await mutate({\n variables: {\n context: { workspaceId },\n input: gqlInput,\n },\n refetchQueries: [\n {\n query: ListExportTemplatesDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"createExportTemplate\",\n });\n throw new Error(\"Failed to create export template\");\n }\n emitExportEvent(exportContext, \"export.template.created\", {\n templateId: result.data.createExportTemplate.id,\n });\n return mapTemplate(result.data.createExportTemplate);\n };\n\n return {\n createTemplate,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to delete an export template\n */\nexport function useDeleteExportTemplate() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n DeleteExportTemplateMutation,\n DeleteExportTemplateMutationVariables\n >(DeleteExportTemplateDocument);\n\n const deleteTemplate = async (id: string): Promise<boolean> => {\n await mutate({\n variables: {\n id,\n context: { workspaceId },\n },\n refetchQueries: [\n {\n query: ListExportTemplatesDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n emitExportEvent(exportContext, \"export.template.deleted\", {\n templateId: id,\n });\n return true;\n };\n\n return {\n deleteTemplate,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/** Organization scope is independent of workspace grants; this is a UX hint only. */\nexport function useOrganizationExportPermission(\n organizationId: string | undefined,\n): boolean {\n const { data, loading, error } = useQuery<\n ExportOrganizationPermissionQuery,\n ExportOrganizationPermissionQueryVariables\n >(ExportOrganizationPermissionDocument, {\n variables: { scopeId: organizationId ?? \"\" },\n skip: !organizationId,\n fetchPolicy: \"network-only\",\n });\n return (\n !!organizationId &&\n !!data &&\n !loading &&\n !error &&\n data?.myPermissions.scopeId === organizationId &&\n data.myPermissions.permissions.some(\n (permission) =>\n permission.resourceType === \"export\" &&\n permission.allowedActions.includes(\"organization_admin\"),\n )\n );\n}\n"],"mappings":";;;;;;;AAqJA,SAASG,EAAe,GAA6C;CACnE,OAAOC,KAAS,KAAA;AAClB;AAEA,SAASC,EAAe,GAAsD;CAC5E,IAAID,KAAS,MAAM;CACnB,IAAME,IAAS,OAAOF,KAAU,WAAWA,IAAQ,OAAOA,CAAK;CAC/D,OAAO,OAAO,SAASE,CAAM,IAAIA,IAAS,KAAA;AAC5C;AAEA,SAASC,EAAa,GAA0C;CAC9D,OAAOF,EAAeD,CAAK,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L,uBApB4B,OAC5B,MAAMtB,EAAO;GACX,WAAW;IACT;IACA,SAAS,EAAE,eAAY;GACzB;GACA,gBAAgB,CACd;IACE,OAAON;IACP,WAAW,EAAE,SAAS,EAAE,eAAY,EAAE;GACxC,CACF;EACF,CAAC,GACDe,EAAgBV,GAAe,2BAA2B,EACxD,YAAYc,EACd,CAAC,GACM;EAKP;EACA,WAAW7C;EACX,OAAOC,KAAS;CAClB;AACF;AAGA,SAAgBsD,EACd,GACS;CACT,IAAM,EAAE,SAAM,YAAS,aAAU1D,EAG/B2D,GAAsC;EACtC,WAAW,EAAE,SAASC,KAAkB,GAAG;EAC3C,MAAM,CAACA;EACP,aAAa;CACf,CAAC;CACD,OACE,CAAC,CAACA,KACF,CAAC,CAAC1D,KACF,CAACC,KACD,CAACC,KACDF,GAAM,cAAc,YAAY0D,KAChC1D,EAAK,cAAc,YAAY,MAC5B,MACC2D,EAAW,iBAAiB,YAC5BA,EAAW,eAAe,SAAS,oBAAoB,CAC3D;AAEJ"}
1
+ {"version":3,"file":"useExportQueries.js","names":["GqlExportFormat","GqlExportJobStatus","GqlExportScope","optionalString","value","optionalNumber","parsed","numberOrZero","optionalRecord","mapPageInfo","pageInfo","mapPart","part","mapJob","job","mapTemplate","template","mapAvailableEntity","entity","toGqlFormat","format","ExportFormat","toGqlStatus","status","ExportJobStatus","toGqlScope","scope","ExportScope","useExportJobs","useExport","backendFilter","filter","workspaceId","useQuery","ListExportJobsDocument","data","loading","error","useExportJob","GetExportJobDocument","jobId","useExportJobProgress","useSubscription","ExportJobProgressDocument","appendEntityPage","fetchMoreResult","previous","useAvailableEntities","ctxWorkspaceId","options","overrideWorkspaceId","GetAvailableExportEntitiesDocument","connection","entities","edge","loadMore","fetchMore","hasNextPage","endCursor","requestedCursor","useRef","useEffect","useExportTemplates","ListExportTemplatesDocument","useExportTemplate","GetExportTemplateDocument","templateId","useCreateExportJob","exportContext","mutate","useMutation","CreateExportJobDocument","createJob","restInput","input","gqlInput","filters","result","emitExportEvent","useCancelExportJob","CancelExportJobDocument","cancelJob","id","useDeleteExportJob","DeleteExportJobDocument","deleteJob","useRetryExportJob","RetryExportJobDocument","useCreateExportTemplate","CreateExportTemplateDocument","useDeleteExportTemplate","DeleteExportTemplateDocument","useOrganizationExportPermission","ExportOrganizationPermissionDocument","organizationId","permission"],"sources":["../../../src/export/hooks/useExportQueries.ts"],"sourcesContent":["/**\n * Export Query Hooks\n *\n * Real Apollo Client hooks for all export operations.\n * Keep these documents in sync with src/operations/wspace/export/*.graphql.\n */\n\nimport { useEffect, useRef } from \"react\";\nimport { useMutation, useQuery, useSubscription } from \"@apollo/client/react\";\nimport {\n CancelExportJobDocument,\n CreateExportJobDocument,\n CreateExportTemplateDocument,\n DeleteExportJobDocument,\n DeleteExportTemplateDocument,\n ExportJobProgressDocument,\n ExportOrganizationPermissionDocument,\n GetAvailableExportEntitiesDocument,\n GetExportJobDocument,\n GetExportTemplateDocument,\n ListExportJobsDocument,\n ListExportTemplatesDocument,\n RetryExportJobDocument,\n type CancelExportJobMutation,\n type CancelExportJobMutationVariables,\n type CreateExportJobMutation,\n type CreateExportJobMutationVariables,\n type CreateExportTemplateMutation,\n type CreateExportTemplateMutationVariables,\n type DeleteExportJobMutation,\n type DeleteExportJobMutationVariables,\n type DeleteExportTemplateMutation,\n type DeleteExportTemplateMutationVariables,\n type ExportJobProgressSubscription,\n type ExportOrganizationPermissionQuery,\n type ExportOrganizationPermissionQueryVariables,\n type ExportJobProgressSubscriptionVariables,\n type GetAvailableExportEntitiesQuery,\n type GetAvailableExportEntitiesQueryVariables,\n type GetExportJobQuery,\n type GetExportJobQueryVariables,\n type GetExportTemplateQuery,\n type GetExportTemplateQueryVariables,\n type ListExportJobsQuery,\n type ListExportJobsQueryVariables,\n type ListExportTemplatesQuery,\n type ListExportTemplatesQueryVariables,\n type RetryExportJobMutation,\n type RetryExportJobMutationVariables,\n} from \"../../generated/wspace-operations\";\nimport {\n ExportFormat as GqlExportFormat,\n ExportJobStatus as GqlExportJobStatus,\n ExportScope as GqlExportScope,\n type CreateExportJobInput as GqlCreateExportJobInput,\n type CreateExportTemplateInput as GqlCreateExportTemplateInput,\n type ExportJobFilterInput as GqlExportJobFilterInput,\n type ExportPaginationInput as GqlExportPaginationInput,\n} from \"../../generated/wspace-types\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport { emitExportEvent } from \"../utils/events\";\nimport type {\n ExportArchiveFormat,\n ExportFormat,\n ExportJob,\n ExportJobStatus,\n ExportScope,\n ExportTemplate,\n ExportAvailableEntity,\n ExportPart,\n ExportFilter,\n PageInfo,\n} from \"../types\";\n\n// ---------------------------------------------------------------------------\n// Mapping helpers\n// ---------------------------------------------------------------------------\n\ntype Nullable<T> = T | null | undefined;\n\ninterface ExportPartLike {\n id: string;\n jobId?: Nullable<string>;\n partNumber: number;\n fileName: string;\n sizeBytes: number | string;\n entityTypes: string[];\n downloadUrl?: Nullable<string>;\n downloadExpiresAt?: Nullable<string>;\n checksum?: Nullable<string>;\n createdAt?: Nullable<string>;\n}\n\ninterface ExportJobLike {\n id: string;\n name: string;\n description?: Nullable<string>;\n status: string;\n progress: number;\n exportScope?: Nullable<string>;\n organizationId?: Nullable<string>;\n targetWorkspaceIds?: Nullable<string[]>;\n entityTypes: string[];\n format: string;\n archiveFormat?: Nullable<string>;\n totalEntities?: Nullable<number>;\n processedEntities?: Nullable<number>;\n totalSizeBytes?: Nullable<number | string>;\n parts?: Nullable<ExportPartLike[]>;\n archiveFileId?: Nullable<string>;\n downloadUrl?: Nullable<string>;\n downloadExpiresAt?: Nullable<string>;\n templateId?: Nullable<string>;\n entityFilters?: Nullable<Record<string, unknown>>;\n errorMessage?: Nullable<string>;\n startedAt?: Nullable<string>;\n completedAt?: Nullable<string>;\n expiresAt?: Nullable<string>;\n createdBy: string;\n temporalWorkflowId?: Nullable<string>;\n workspaceId?: Nullable<string>;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface ExportTemplateLike {\n id: string;\n name: string;\n description?: Nullable<string>;\n entityTypes: string[];\n format: string;\n entityFilters?: Nullable<Record<string, unknown>>;\n isDefault: boolean;\n workspaceId?: Nullable<string>;\n createdBy: string;\n createdAt: string;\n updatedAt: string;\n}\n\ninterface ExportAvailableEntityLike {\n entityType: string;\n displayName: string;\n description?: Nullable<string>;\n estimatedSize?: Nullable<string>;\n supportsDateRange: boolean;\n supportsMediaExport: boolean;\n enabled: boolean;\n}\n\nfunction optionalString(value: Nullable<string>): string | undefined {\n return value ?? undefined;\n}\n\nfunction optionalNumber(value: Nullable<number | string>): number | undefined {\n if (value == null) return undefined;\n const parsed = typeof value === \"number\" ? value : Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n\nfunction numberOrZero(value: Nullable<number | string>): number {\n return optionalNumber(value) ?? 0;\n}\n\nfunction optionalRecord(\n value: Nullable<Record<string, unknown>>,\n): Record<string, unknown> | undefined {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? value\n : undefined;\n}\n\nfunction mapPageInfo(pageInfo: {\n hasNextPage: boolean;\n hasPreviousPage: boolean;\n startCursor?: Nullable<string>;\n endCursor?: Nullable<string>;\n}): PageInfo {\n return {\n hasNextPage: pageInfo.hasNextPage,\n hasPreviousPage: pageInfo.hasPreviousPage,\n startCursor: optionalString(pageInfo.startCursor),\n endCursor: optionalString(pageInfo.endCursor),\n };\n}\n\nfunction mapPart(part: ExportPartLike): ExportPart {\n return {\n id: part.id,\n jobId: optionalString(part.jobId),\n partNumber: part.partNumber,\n fileName: part.fileName,\n sizeBytes: numberOrZero(part.sizeBytes),\n entityTypes: part.entityTypes,\n downloadUrl: optionalString(part.downloadUrl),\n downloadExpiresAt: optionalString(part.downloadExpiresAt),\n checksum: optionalString(part.checksum),\n createdAt: optionalString(part.createdAt),\n };\n}\n\nfunction mapJob(job: ExportJobLike): ExportJob {\n return {\n id: job.id,\n name: job.name,\n description: optionalString(job.description),\n status: job.status as ExportJobStatus,\n progress: job.progress,\n exportScope: job.exportScope ? (job.exportScope as ExportScope) : undefined,\n organizationId: optionalString(job.organizationId),\n targetWorkspaceIds: job.targetWorkspaceIds ?? undefined,\n entityTypes: job.entityTypes,\n format: job.format as ExportFormat,\n archiveFormat: (job.archiveFormat ?? \"ZIP\") as ExportArchiveFormat,\n totalEntities: optionalNumber(job.totalEntities),\n processedEntities: optionalNumber(job.processedEntities),\n totalSizeBytes: optionalNumber(job.totalSizeBytes),\n parts: job.parts?.map(mapPart) ?? [],\n archiveFileId: optionalString(job.archiveFileId),\n downloadUrl: optionalString(job.downloadUrl),\n downloadExpiresAt: optionalString(job.downloadExpiresAt),\n templateId: optionalString(job.templateId),\n filters: optionalRecord(job.entityFilters),\n errorMessage: optionalString(job.errorMessage),\n startedAt: optionalString(job.startedAt),\n completedAt: optionalString(job.completedAt),\n expiresAt: optionalString(job.expiresAt),\n createdBy: job.createdBy,\n temporalWorkflowId: optionalString(job.temporalWorkflowId),\n workspaceId: optionalString(job.workspaceId),\n createdAt: job.createdAt,\n updatedAt: job.updatedAt,\n };\n}\n\nfunction mapTemplate(template: ExportTemplateLike): ExportTemplate {\n return {\n id: template.id,\n name: template.name,\n description: optionalString(template.description),\n entityTypes: template.entityTypes,\n format: template.format as ExportFormat,\n filters: optionalRecord(template.entityFilters),\n isDefault: template.isDefault,\n createdBy: template.createdBy,\n workspaceId: optionalString(template.workspaceId),\n createdAt: template.createdAt,\n updatedAt: template.updatedAt,\n };\n}\n\nfunction mapAvailableEntity(\n entity: ExportAvailableEntityLike,\n): ExportAvailableEntity {\n return {\n entityType: entity.entityType,\n displayName: entity.displayName,\n description: optionalString(entity.description),\n estimatedSize: optionalString(entity.estimatedSize),\n supportsDateRange: entity.supportsDateRange,\n supportsMediaExport: entity.supportsMediaExport,\n enabled: entity.enabled,\n };\n}\n\nfunction toGqlFormat(format: ExportFormat | string): GqlExportFormat {\n if (format === \"CSV\") return GqlExportFormat.Csv;\n if (format === \"JSON\") return GqlExportFormat.Json;\n throw new Error(`Unsupported export format: ${format}`);\n}\n\nfunction toGqlStatus(status: ExportJobStatus | string): GqlExportJobStatus {\n switch (status) {\n case \"CANCELLED\":\n return GqlExportJobStatus.Cancelled;\n case \"COMPLETED\":\n return GqlExportJobStatus.Completed;\n case \"CREATED\":\n return GqlExportJobStatus.Created;\n case \"DELETED\":\n return GqlExportJobStatus.Deleted;\n case \"EXPIRED\":\n return GqlExportJobStatus.Expired;\n case \"FAILED\":\n return GqlExportJobStatus.Failed;\n case \"QUEUED\":\n return GqlExportJobStatus.Queued;\n case \"RUNNING\":\n return GqlExportJobStatus.Running;\n default:\n throw new Error(`Unsupported export status: ${status}`);\n }\n}\n\nfunction toGqlScope(scope: ExportScope | string): GqlExportScope {\n switch (scope) {\n case \"INDIVIDUAL\":\n return GqlExportScope.Individual;\n case \"WORKSPACE_ADMIN\":\n return GqlExportScope.WorkspaceAdmin;\n case \"ORG_ADMIN\":\n return GqlExportScope.OrgAdmin;\n default:\n throw new Error(`Unsupported export scope: ${scope}`);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Query Hooks\n// ---------------------------------------------------------------------------\n\n/**\n * Input for creating an export job\n */\nexport interface CreateExportJobInput {\n name: string;\n description?: string;\n exportScope?: ExportScope;\n organizationId?: string;\n entityTypes: string[];\n format: ExportFormat;\n filters?: Record<string, unknown>;\n templateId?: string;\n dateRangeStart?: string | null;\n dateRangeEnd?: string | null;\n}\n\n/**\n * Input for creating an export template\n */\nexport interface CreateExportTemplateInput {\n name: string;\n description?: string;\n entityTypes: string[];\n format: ExportFormat;\n}\n\n/**\n * Filter input for listing export jobs\n */\nexport interface ExportJobFilterInput {\n status?: ExportJobStatus[];\n format?: ExportFormat;\n entityTypes?: string[];\n search?: string;\n dateFrom?: string;\n dateTo?: string;\n}\n\n/**\n * Pagination input for export job list\n */\nexport interface ExportPaginationInput {\n first?: number;\n after?: string;\n last?: number;\n before?: string;\n}\n\n/**\n * Hook to fetch a paginated list of export jobs\n */\nexport function useExportJobs(\n filter?: Partial<ExportFilter>,\n pagination?: ExportPaginationInput,\n) {\n const { workspaceId } = useExport();\n\n // Build the backend filter from the UI filter shape\n const backendFilter: GqlExportJobFilterInput | undefined =\n filter && workspaceId\n ? {\n status:\n filter.status && filter.status !== \"all\"\n ? [toGqlStatus(filter.status)]\n : undefined,\n format:\n filter.format && filter.format !== \"all\"\n ? toGqlFormat(filter.format)\n : undefined,\n search: filter.search ?? undefined,\n }\n : undefined;\n\n const { data, loading, error, refetch } = useQuery<\n ListExportJobsQuery,\n ListExportJobsQueryVariables\n >(ListExportJobsDocument, {\n variables: {\n filter: backendFilter,\n pagination: pagination as GqlExportPaginationInput | undefined,\n context: { workspaceId },\n },\n skip: !workspaceId,\n });\n\n const jobs = data?.listExportJobs.edges.map((e) => mapJob(e.node)) ?? [];\n const totalCount = data?.listExportJobs.totalCount ?? 0;\n const pageInfo = data?.listExportJobs.pageInfo\n ? mapPageInfo(data.listExportJobs.pageInfo)\n : null;\n\n return {\n data: jobs,\n totalCount,\n pageInfo,\n isLoading: loading,\n error: error ?? null,\n refetch,\n };\n}\n\n/**\n * Hook to fetch a single export job by ID.\n */\nexport function useExportJob(jobId: string | undefined) {\n const { workspaceId } = useExport();\n\n const { data, loading, error, refetch } = useQuery<\n GetExportJobQuery,\n GetExportJobQueryVariables\n >(GetExportJobDocument, {\n variables: { id: jobId ?? \"\", context: { workspaceId } },\n skip: !jobId || !workspaceId,\n });\n\n const job = data?.getExportJob ? mapJob(data.getExportJob) : null;\n\n return {\n data: job,\n isLoading: loading,\n error: error ?? null,\n refetch,\n };\n}\n\n/**\n * Hook to subscribe to live progress updates for an export job.\n */\nexport function useExportJobProgress(jobId: string | undefined) {\n const { data, loading, error } = useSubscription<\n ExportJobProgressSubscription,\n ExportJobProgressSubscriptionVariables\n >(ExportJobProgressDocument, {\n variables: { jobId: jobId ?? \"\" },\n skip: !jobId,\n });\n\n return {\n data: data?.exportJobProgress ? mapJob(data.exportJobProgress) : null,\n isLoading: loading,\n error: error ?? null,\n };\n}\n\n/** Apollo `updateQuery` for the catalog: append a fetched page's edges. */\nfunction appendEntityPage(\n previous: GetAvailableExportEntitiesQuery,\n { fetchMoreResult }: { fetchMoreResult?: GetAvailableExportEntitiesQuery },\n): GetAvailableExportEntitiesQuery {\n if (!fetchMoreResult) return previous;\n return {\n getAvailableExportEntities: {\n ...fetchMoreResult.getAvailableExportEntities,\n edges: [\n ...previous.getAvailableExportEntities.edges,\n ...fetchMoreResult.getAvailableExportEntities.edges,\n ],\n },\n };\n}\n\n/**\n * Hook to fetch available entity types for export in a workspace\n */\nexport function useAvailableEntities(\n overrideWorkspaceId?: string,\n options: { skip?: boolean } = {},\n) {\n const { workspaceId: ctxWorkspaceId } = useExport();\n const workspaceId = options.skip\n ? undefined\n : (overrideWorkspaceId ?? ctxWorkspaceId);\n\n const { data, loading, error, refetch, fetchMore } = useQuery<\n GetAvailableExportEntitiesQuery,\n GetAvailableExportEntitiesQueryVariables\n >(GetAvailableExportEntitiesDocument, {\n variables: {\n context: { workspaceId },\n pagination: { first: 100 },\n },\n skip: !workspaceId,\n });\n\n const connection = data?.getAvailableExportEntities;\n const entities =\n connection?.edges.map((edge) => mapAvailableEntity(edge.node)) ?? [];\n\n const loadMore = async () => {\n if (!workspaceId || !connection?.pageInfo.hasNextPage) return;\n await fetchMore({\n variables: {\n context: { workspaceId },\n pagination: { first: 100, after: connection.pageInfo.endCursor },\n },\n updateQuery: appendEntityPage,\n });\n };\n\n // The entity picker and the template editor need the whole catalog (well\n // over one 100-entry page: entities are sorted by display name, so products\n // late in the alphabet, e.g. VibeControls, were never shown). Fetch the\n // remaining pages, once per cursor.\n const hasNextPage = connection?.pageInfo.hasNextPage ?? false;\n const endCursor = connection?.pageInfo.endCursor ?? null;\n const requestedCursor = useRef<string | null>(null);\n useEffect(() => {\n if (loading || !workspaceId || !hasNextPage || !endCursor) return;\n if (requestedCursor.current === endCursor) return;\n requestedCursor.current = endCursor;\n void fetchMore({\n variables: {\n context: { workspaceId },\n pagination: { first: 100, after: endCursor },\n },\n updateQuery: appendEntityPage,\n });\n }, [loading, workspaceId, hasNextPage, endCursor, fetchMore]);\n\n return {\n data: entities,\n totalCount: connection?.totalCount ?? 0,\n pageInfo: connection?.pageInfo ? mapPageInfo(connection.pageInfo) : null,\n loadMore,\n error: error ?? null,\n isLoading: loading,\n refetch,\n };\n}\n\n/**\n * Hook to fetch all export templates for the current workspace\n */\nexport function useExportTemplates(overrideWorkspaceId?: string) {\n const { workspaceId: ctxWorkspaceId } = useExport();\n const workspaceId = overrideWorkspaceId ?? ctxWorkspaceId;\n\n const { data, loading, error, refetch, fetchMore } = useQuery<\n ListExportTemplatesQuery,\n ListExportTemplatesQueryVariables\n >(ListExportTemplatesDocument, {\n variables: {\n context: { workspaceId },\n pagination: { first: 50 },\n },\n skip: !workspaceId,\n });\n\n const connection = data?.listExportTemplates;\n const templates =\n connection?.edges.map((edge) => mapTemplate(edge.node)) ?? [];\n\n const loadMore = async () => {\n if (!workspaceId || !connection?.pageInfo.hasNextPage) return;\n await fetchMore({\n variables: {\n context: { workspaceId },\n pagination: { first: 50, after: connection.pageInfo.endCursor },\n },\n updateQuery: (previous, { fetchMoreResult }) => {\n if (!fetchMoreResult) return previous;\n return {\n listExportTemplates: {\n ...fetchMoreResult.listExportTemplates,\n edges: [\n ...previous.listExportTemplates.edges,\n ...fetchMoreResult.listExportTemplates.edges,\n ],\n },\n };\n },\n });\n };\n\n return {\n data: templates,\n totalCount: connection?.totalCount ?? 0,\n pageInfo: connection?.pageInfo ? mapPageInfo(connection.pageInfo) : null,\n loadMore,\n isLoading: loading,\n error: error ?? null,\n refetch,\n };\n}\n\n/**\n * Hook to fetch a single export template by ID\n */\nexport function useExportTemplate(templateId: string | undefined) {\n const { workspaceId } = useExport();\n\n const { data, loading, error } = useQuery<\n GetExportTemplateQuery,\n GetExportTemplateQueryVariables\n >(GetExportTemplateDocument, {\n variables: { id: templateId ?? \"\", context: { workspaceId } },\n skip: !templateId || !workspaceId,\n });\n\n return {\n data: data?.getExportTemplate ? mapTemplate(data.getExportTemplate) : null,\n isLoading: loading,\n error: error ?? null,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Mutation Hooks\n// ---------------------------------------------------------------------------\n\n/**\n * Hook to create a new export job\n */\nexport function useCreateExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n CreateExportJobMutation,\n CreateExportJobMutationVariables\n >(CreateExportJobDocument);\n\n const createJob = async (input: CreateExportJobInput): Promise<ExportJob> => {\n const { filters, ...restInput } = input;\n const gqlInput: GqlCreateExportJobInput = {\n ...restInput,\n exportScope: restInput.exportScope\n ? toGqlScope(restInput.exportScope)\n : undefined,\n format: toGqlFormat(restInput.format),\n entityFilters: filters,\n };\n\n const result = await mutate({\n variables: {\n context: { workspaceId },\n input: gqlInput,\n },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"createExportJob\",\n });\n throw new Error(\"Failed to create export job\");\n }\n emitExportEvent(exportContext, \"export.job.created\", {\n jobId: result.data.createExportJob.id,\n });\n return mapJob(result.data.createExportJob);\n };\n\n return {\n createJob,\n // Keep legacy names for existing callers\n mutate: createJob,\n mutateAsync: createJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to cancel an export job\n */\nexport function useCancelExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n CancelExportJobMutation,\n CancelExportJobMutationVariables\n >(CancelExportJobDocument);\n\n const cancelJob = async (id: string) => {\n const result = await mutate({\n variables: {\n id,\n context: { workspaceId },\n },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"cancelExportJob\",\n jobId: id,\n });\n throw new Error(\"Failed to cancel export job\");\n }\n emitExportEvent(exportContext, \"export.job.cancelled\", { jobId: id });\n return result.data.cancelExportJob;\n };\n\n return {\n cancelJob,\n mutate: cancelJob,\n mutateAsync: cancelJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to delete an export job\n */\nexport function useDeleteExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n DeleteExportJobMutation,\n DeleteExportJobMutationVariables\n >(DeleteExportJobDocument);\n\n const deleteJob = async (id: string): Promise<boolean> => {\n await mutate({\n variables: {\n id,\n context: { workspaceId },\n },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n emitExportEvent(exportContext, \"export.job.deleted\", { jobId: id });\n return true;\n };\n\n return {\n deleteJob,\n mutate: deleteJob,\n mutateAsync: deleteJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to retry a failed export job\n */\nexport function useRetryExportJob() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n RetryExportJobMutation,\n RetryExportJobMutationVariables\n >(RetryExportJobDocument);\n\n const retryJob = async (id: string): Promise<ExportJob> => {\n const result = await mutate({\n variables: { id, context: { workspaceId } },\n refetchQueries: [\n {\n query: ListExportJobsDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"retryExportJob\",\n jobId: id,\n });\n throw new Error(\"Failed to retry export job\");\n }\n emitExportEvent(exportContext, \"export.job.retried\", {\n originalJobId: id,\n jobId: result.data.retryExportJob.id,\n });\n return mapJob(result.data.retryExportJob);\n };\n\n return {\n retryJob,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to create a new export template\n */\nexport function useCreateExportTemplate() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n CreateExportTemplateMutation,\n CreateExportTemplateMutationVariables\n >(CreateExportTemplateDocument);\n\n const createTemplate = async (\n input: CreateExportTemplateInput,\n ): Promise<ExportTemplate> => {\n const gqlInput: GqlCreateExportTemplateInput = {\n ...input,\n format: toGqlFormat(input.format),\n };\n\n const result = await mutate({\n variables: {\n context: { workspaceId },\n input: gqlInput,\n },\n refetchQueries: [\n {\n query: ListExportTemplatesDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n if (!result.data) {\n emitExportEvent(exportContext, \"export.api.failed\", {\n operation: \"createExportTemplate\",\n });\n throw new Error(\"Failed to create export template\");\n }\n emitExportEvent(exportContext, \"export.template.created\", {\n templateId: result.data.createExportTemplate.id,\n });\n return mapTemplate(result.data.createExportTemplate);\n };\n\n return {\n createTemplate,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/**\n * Hook to delete an export template\n */\nexport function useDeleteExportTemplate() {\n const exportContext = useExport();\n const { workspaceId } = exportContext;\n const [mutate, { loading, error }] = useMutation<\n DeleteExportTemplateMutation,\n DeleteExportTemplateMutationVariables\n >(DeleteExportTemplateDocument);\n\n const deleteTemplate = async (id: string): Promise<boolean> => {\n await mutate({\n variables: {\n id,\n context: { workspaceId },\n },\n refetchQueries: [\n {\n query: ListExportTemplatesDocument,\n variables: { context: { workspaceId } },\n },\n ],\n });\n emitExportEvent(exportContext, \"export.template.deleted\", {\n templateId: id,\n });\n return true;\n };\n\n return {\n deleteTemplate,\n loading,\n isPending: loading,\n error: error ?? null,\n };\n}\n\n/** Organization scope is independent of workspace grants; this is a UX hint only. */\nexport function useOrganizationExportPermission(\n organizationId: string | undefined,\n): boolean {\n const { data, loading, error } = useQuery<\n ExportOrganizationPermissionQuery,\n ExportOrganizationPermissionQueryVariables\n >(ExportOrganizationPermissionDocument, {\n variables: { scopeId: organizationId ?? \"\" },\n skip: !organizationId,\n fetchPolicy: \"network-only\",\n });\n return (\n !!organizationId &&\n !!data &&\n !loading &&\n !error &&\n data?.myPermissions.scopeId === organizationId &&\n data.myPermissions.permissions.some(\n (permission) =>\n permission.resourceType === \"export\" &&\n permission.allowedActions.includes(\"organization_admin\"),\n )\n );\n}\n"],"mappings":";;;;;;;AAqJA,SAASG,EAAe,GAA6C;CACnE,OAAOC,KAAS,KAAA;AAClB;AAEA,SAASC,EAAe,GAAsD;CAC5E,IAAID,KAAS,MAAM;CACnB,IAAME,IAAS,OAAOF,KAAU,WAAWA,IAAQ,OAAOA,CAAK;CAC/D,OAAO,OAAO,SAASE,CAAM,IAAIA,IAAS,KAAA;AAC5C;AAEA,SAASC,EAAa,GAA0C;CAC9D,OAAOF,EAAeD,CAAK,KAAK;AAClC;AAEA,SAASI,EACP,GACqC;CACrC,OAAOJ,KAAS,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK,IAC7DA,IACA,KAAA;AACN;AAEA,SAASK,EAAY,GAKR;CACX,OAAO;EACL,aAAaC,EAAS;EACtB,iBAAiBA,EAAS;EAC1B,aAAaP,EAAeO,EAAS,WAAW;EAChD,WAAWP,EAAeO,EAAS,SAAS;CAC9C;AACF;AAEA,SAASC,EAAQ,GAAkC;CACjD,OAAO;EACL,IAAIC,EAAK;EACT,OAAOT,EAAeS,EAAK,KAAK;EAChC,YAAYA,EAAK;EACjB,UAAUA,EAAK;EACf,WAAWL,EAAaK,EAAK,SAAS;EACtC,aAAaA,EAAK;EAClB,aAAaT,EAAeS,EAAK,WAAW;EAC5C,mBAAmBT,EAAeS,EAAK,iBAAiB;EACxD,UAAUT,EAAeS,EAAK,QAAQ;EACtC,WAAWT,EAAeS,EAAK,SAAS;CAC1C;AACF;AAEA,SAASC,EAAO,GAA+B;CAC7C,OAAO;EACL,IAAIC,EAAI;EACR,MAAMA,EAAI;EACV,aAAaX,EAAeW,EAAI,WAAW;EAC3C,QAAQA,EAAI;EACZ,UAAUA,EAAI;EACd,aAAaA,EAAI,cAAeA,EAAI,cAA8B,KAAA;EAClE,gBAAgBX,EAAeW,EAAI,cAAc;EACjD,oBAAoBA,EAAI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GACD,IAAI,CAACc,EAAO,MAIV,MAHAC,EAAgBV,GAAe,qBAAqB,EAClD,WAAW,uBACb,CAAC,GACS,MAAM,kCAAkC;GAKpD,OAHAU,EAAgBV,GAAe,2BAA2B,EACxD,YAAYS,EAAO,KAAK,qBAAqB,GAC/C,CAAC,GACM9D,EAAY8D,EAAO,KAAK,oBAAoB;EACrD;EAIE;EACA,WAAWzC;EACX,OAAOC,KAAS;CAClB;AACF;AAKA,SAAgBqD,IAA0B;CACxC,IAAMtB,IAAgBvC,EAAU,GAC1B,EAAE,mBAAgBuC,GAClB,CAACC,GAAQ,EAAE,YAAS,cAAWC,EAGnCqB,CAA4B;CAqB9B,OAAO;EACL,uBApB4B,OAC5B,MAAMtB,EAAO;GACX,WAAW;IACT;IACA,SAAS,EAAE,eAAY;GACzB;GACA,gBAAgB,CACd;IACE,OAAON;IACP,WAAW,EAAE,SAAS,EAAE,eAAY,EAAE;GACxC,CACF;EACF,CAAC,GACDe,EAAgBV,GAAe,2BAA2B,EACxD,YAAYc,EACd,CAAC,GACM;EAKP;EACA,WAAW9C;EACX,OAAOC,KAAS;CAClB;AACF;AAGA,SAAgBuD,EACd,GACS;CACT,IAAM,EAAE,SAAM,YAAS,aAAU3D,EAG/B4D,GAAsC;EACtC,WAAW,EAAE,SAASC,KAAkB,GAAG;EAC3C,MAAM,CAACA;EACP,aAAa;CACf,CAAC;CACD,OACE,CAAC,CAACA,KACF,CAAC,CAAC3D,KACF,CAACC,KACD,CAACC,KACDF,GAAM,cAAc,YAAY2D,KAChC3D,EAAK,cAAc,YAAY,MAC5B,MACC4D,EAAW,iBAAiB,YAC5BA,EAAW,eAAe,SAAS,oBAAoB,CAC3D;AAEJ"}
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function NavigationV2Provider({ enabled, children, }: {
3
+ enabled: boolean;
4
+ children: ReactNode;
5
+ }): import('react').JSX.Element;
6
+ /** True only inside an app that opted in with `navigationV2`. */
7
+ export declare function useNavigationV2(): boolean;
@@ -0,0 +1,16 @@
1
+ import { createContext as e, useContext as t } from "react";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ // src/export/navigation-v2/NavigationV2.tsx
4
+ var r = e(!1);
5
+ function i({ enabled: e, children: t }) {
6
+ return /* @__PURE__ */ n(r.Provider, {
7
+ value: e,
8
+ children: t
9
+ });
10
+ }
11
+ function a() {
12
+ return t(r);
13
+ }
14
+ export { i as NavigationV2Provider, a as useNavigationV2 };
15
+
16
+ //# sourceMappingURL=NavigationV2.js.map