@burdenoff/microfe-govcitizenhub 2026.705.1 → 2026.705.2

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 (69) hide show
  1. package/dist/govcitizenhub/components/Avatar.js +55 -0
  2. package/dist/govcitizenhub/components/Avatar.js.map +1 -0
  3. package/dist/govcitizenhub/components/DocumentUploadField.js +95 -45
  4. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  5. package/dist/govcitizenhub/components/FilterTabs.js +5 -4
  6. package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
  7. package/dist/govcitizenhub/components/KeyValueList.js +23 -0
  8. package/dist/govcitizenhub/components/KeyValueList.js.map +1 -0
  9. package/dist/govcitizenhub/components/MetricsCard.js +51 -26
  10. package/dist/govcitizenhub/components/MetricsCard.js.map +1 -1
  11. package/dist/govcitizenhub/components/PageLayout.js +81 -51
  12. package/dist/govcitizenhub/components/PageLayout.js.map +1 -1
  13. package/dist/govcitizenhub/components/Pagination.js +41 -19
  14. package/dist/govcitizenhub/components/Pagination.js.map +1 -1
  15. package/dist/govcitizenhub/components/SectionCard.js +31 -0
  16. package/dist/govcitizenhub/components/SectionCard.js.map +1 -0
  17. package/dist/govcitizenhub/components/SlaBadge.js +71 -0
  18. package/dist/govcitizenhub/components/SlaBadge.js.map +1 -0
  19. package/dist/govcitizenhub/components/StateViews.js +1 -16
  20. package/dist/govcitizenhub/components/StateViews.js.map +1 -1
  21. package/dist/govcitizenhub/components/StatusBadge.js +23 -10
  22. package/dist/govcitizenhub/components/StatusBadge.js.map +1 -1
  23. package/dist/govcitizenhub/components/StatusStepper.js +55 -0
  24. package/dist/govcitizenhub/components/StatusStepper.js.map +1 -0
  25. package/dist/govcitizenhub/components/SummaryStrip.js +54 -0
  26. package/dist/govcitizenhub/components/SummaryStrip.js.map +1 -0
  27. package/dist/govcitizenhub/components/TagInput.js +2 -2
  28. package/dist/govcitizenhub/components/TagInput.js.map +1 -1
  29. package/dist/govcitizenhub/components/Timeline.js +61 -0
  30. package/dist/govcitizenhub/components/Timeline.js.map +1 -0
  31. package/dist/govcitizenhub/hooks/useFiles.js +50 -22
  32. package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
  33. package/dist/govcitizenhub/hooks/useGovApi.js +40 -31
  34. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  35. package/dist/govcitizenhub/pages/DashboardPage.js +118 -50
  36. package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
  37. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +258 -137
  38. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  39. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +103 -90
  40. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js.map +1 -1
  41. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +493 -397
  42. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  43. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +266 -80
  44. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  45. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +412 -174
  46. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  47. package/dist/govcitizenhub/pages/documents/DocumentsPage.js +313 -115
  48. package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
  49. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +379 -176
  50. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  51. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +275 -184
  52. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  53. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +251 -133
  54. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  55. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +175 -105
  56. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  57. package/dist/govcitizenhub/pages/permits/PermitsPage.js +204 -110
  58. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  59. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js +290 -113
  60. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
  61. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +301 -0
  62. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -0
  63. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +248 -163
  64. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
  65. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +183 -149
  66. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  67. package/dist/govcitizenhub/pages/services/ServicesPage.js +228 -137
  68. package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
  69. package/package.json +1 -1
@@ -0,0 +1,61 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region src/govcitizenhub/components/Timeline.tsx
4
+ var r = {
5
+ default: "bg-bg-sunken text-text-secondary ring-border-seam",
6
+ info: "bg-[var(--color-accent-soft)] text-action-primary-text ring-transparent",
7
+ success: "bg-status-success-bg-subtle text-status-success-text ring-transparent",
8
+ warning: "bg-status-warning-bg-subtle text-status-warning-text ring-transparent",
9
+ error: "bg-status-error-bg-subtle text-status-error-text ring-transparent",
10
+ accent: "bg-[color-mix(in_oklab,var(--color-accent-purple)_16%,transparent)] text-[var(--color-accent-purple)] ring-transparent"
11
+ }, i = {
12
+ default: "text-text-primary",
13
+ info: "text-action-primary-text",
14
+ success: "text-status-success-text",
15
+ warning: "text-status-warning-text",
16
+ error: "text-status-error-text",
17
+ accent: "text-[var(--color-accent-purple)]"
18
+ }, a = ({ tone: a = "default", icon: o, title: s, author: c, timestamp: l, children: u, last: d = !1, className: f }) => /* @__PURE__ */ n("li", {
19
+ className: e("relative flex gap-3 pb-6 last:pb-0", f),
20
+ children: [
21
+ !d && /* @__PURE__ */ t("span", {
22
+ "aria-hidden": "true",
23
+ className: "absolute left-[15px] top-8 h-[calc(100%-1.5rem)] w-px bg-border-seam"
24
+ }),
25
+ /* @__PURE__ */ t("span", {
26
+ "aria-hidden": "true",
27
+ className: e("relative z-10 mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-full ring-1 [&>svg]:size-4", r[a]),
28
+ children: o
29
+ }),
30
+ /* @__PURE__ */ n("div", {
31
+ className: "min-w-0 flex-1 pt-0.5",
32
+ children: [/* @__PURE__ */ n("div", {
33
+ className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5",
34
+ children: [
35
+ /* @__PURE__ */ t("span", {
36
+ className: e("text-sm font-semibold", i[a]),
37
+ children: s
38
+ }),
39
+ c && /* @__PURE__ */ t("span", {
40
+ className: "text-sm text-text-secondary",
41
+ children: c
42
+ }),
43
+ l && /* @__PURE__ */ t("span", {
44
+ className: "ml-auto shrink-0 text-xs text-text-muted tabular-nums",
45
+ children: l
46
+ })
47
+ ]
48
+ }), u && /* @__PURE__ */ t("div", {
49
+ className: "mt-1 text-sm text-text-secondary",
50
+ children: u
51
+ })]
52
+ })
53
+ ]
54
+ }), o = ({ children: n, className: r }) => /* @__PURE__ */ t("ol", {
55
+ className: e("flex flex-col", r),
56
+ children: n
57
+ });
58
+ //#endregion
59
+ export { o as Timeline, a as TimelineItem };
60
+
61
+ //# sourceMappingURL=Timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timeline.js","names":[],"sources":["../../../src/govcitizenhub/components/Timeline.tsx"],"sourcesContent":["/**\n * Timeline + TimelineItem\n * @module govcitizenhub/components\n *\n * A vertical event timeline for case notes, grievance history and audit trails.\n * Each item shows a colour-coded dot (optionally wrapping an icon), an author,\n * a timestamp and a free-form body. Compose items as children of {@link Timeline}\n * so the connecting rail is drawn automatically.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\nexport type TimelineTone = 'default' | 'info' | 'success' | 'warning' | 'error' | 'accent';\n\nconst dotClass: Record<TimelineTone, string> = {\n default: 'bg-bg-sunken text-text-secondary ring-border-seam',\n info: 'bg-[var(--color-accent-soft)] text-action-primary-text ring-transparent',\n success: 'bg-status-success-bg-subtle text-status-success-text ring-transparent',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text ring-transparent',\n error: 'bg-status-error-bg-subtle text-status-error-text ring-transparent',\n accent:\n 'bg-[color-mix(in_oklab,var(--color-accent-purple)_16%,transparent)] text-[var(--color-accent-purple)] ring-transparent',\n};\n\nconst titleClass: Record<TimelineTone, string> = {\n default: 'text-text-primary',\n info: 'text-action-primary-text',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n error: 'text-status-error-text',\n accent: 'text-[var(--color-accent-purple)]',\n};\n\nexport interface TimelineItemProps {\n /** Colour-coded dot tone. */\n tone?: TimelineTone;\n /** Optional icon rendered inside the dot. */\n icon?: ReactNode;\n /** Event title / type label (e.g. \"Info request\", \"Decision\"). */\n title: ReactNode;\n /** Who created the event. */\n author?: ReactNode;\n /** When it happened (already-formatted string or node). */\n timestamp?: ReactNode;\n /** Event body. */\n children?: ReactNode;\n /** Set on the final item to stop the connecting rail. */\n last?: boolean;\n className?: string;\n}\n\n/** A single event row within a {@link Timeline}. */\nexport const TimelineItem: FC<TimelineItemProps> = ({\n tone = 'default',\n icon,\n title,\n author,\n timestamp,\n children,\n last = false,\n className,\n}) => (\n <li className={cn('relative flex gap-3 pb-6 last:pb-0', className)}>\n {/* Rail */}\n {!last && (\n <span\n aria-hidden=\"true\"\n className=\"absolute left-[15px] top-8 h-[calc(100%-1.5rem)] w-px bg-border-seam\"\n />\n )}\n {/* Dot */}\n <span\n aria-hidden=\"true\"\n className={cn(\n 'relative z-10 mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-full ring-1 [&>svg]:size-4',\n dotClass[tone]\n )}\n >\n {icon}\n </span>\n {/* Body */}\n <div className=\"min-w-0 flex-1 pt-0.5\">\n <div className=\"flex flex-wrap items-baseline gap-x-2 gap-y-0.5\">\n <span className={cn('text-sm font-semibold', titleClass[tone])}>{title}</span>\n {author && <span className=\"text-sm text-text-secondary\">{author}</span>}\n {timestamp && (\n <span className=\"ml-auto shrink-0 text-xs text-text-muted tabular-nums\">{timestamp}</span>\n )}\n </div>\n {children && <div className=\"mt-1 text-sm text-text-secondary\">{children}</div>}\n </div>\n </li>\n);\n\nexport interface TimelineProps {\n children: ReactNode;\n className?: string;\n}\n\n/** Vertical timeline wrapper. Render {@link TimelineItem} children inside. */\nexport const Timeline: FC<TimelineProps> = ({ children, className }) => (\n <ol className={cn('flex flex-col', className)}>{children}</ol>\n);\n"],"mappings":";;;AAeA,IAAM,IAAyC;CAC7C,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;CACP,QACE;CACH,EAEK,IAA2C;CAC/C,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACT,EAqBY,KAAuC,EAClD,UAAO,WACP,SACA,UACA,WACA,cACA,aACA,UAAO,IACP,mBAEA,kBAAC,MAAD;CAAI,WAAW,EAAG,sCAAsC,EAAU;WAAlE;EAEG,CAAC,KACA,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;GACV,CAAA;EAGJ,kBAAC,QAAD;GACE,eAAY;GACZ,WAAW,EACT,mHACA,EAAS,GACV;aAEA;GACI,CAAA;EAEP,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,QAAD;MAAM,WAAW,EAAG,yBAAyB,EAAW,GAAM;gBAAG;MAAa,CAAA;KAC7E,KAAU,kBAAC,QAAD;MAAM,WAAU;gBAA+B;MAAc,CAAA;KACvE,KACC,kBAAC,QAAD;MAAM,WAAU;gBAAyD;MAAiB,CAAA;KAExF;OACL,KAAY,kBAAC,OAAD;IAAK,WAAU;IAAoC;IAAe,CAAA,CAC3E;;EACH;IASM,KAA+B,EAAE,aAAU,mBACtD,kBAAC,MAAD;CAAI,WAAW,EAAG,iBAAiB,EAAU;CAAG;CAAc,CAAA"}
@@ -1,56 +1,57 @@
1
+ import { useGovCitizenHub as e } from "../context/GovCitizenHubContext.js";
1
2
  import "../context/index.js";
2
- import "@tanstack/react-query";
3
- import { graphqlFetch as e } from "@burdenoff/fe-libs/shared/graphql";
3
+ import { useQuery as t } from "@tanstack/react-query";
4
+ import { graphqlFetch as n } from "@burdenoff/fe-libs/shared/graphql";
4
5
  //#region src/govcitizenhub/hooks/useFiles.ts
5
- var t = 31536e3, n = {
6
+ var r = 31536e3, i = {
6
7
  documents: "/GovCitizenHub/Documents",
7
8
  permits: "/GovCitizenHub/Permits",
8
9
  grievances: "/GovCitizenHub/Grievances"
9
10
  };
10
- async function r(t, n) {
11
- let r = await e({
11
+ async function a(e, t) {
12
+ let r = await n({
12
13
  gateway: "workspace",
13
- query: t,
14
- variables: n,
14
+ query: e,
15
+ variables: t,
15
16
  workspaceToken: !0
16
17
  });
17
18
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "Files request failed");
18
19
  if (!r.data) throw Error("Files response did not include data");
19
20
  return r.data;
20
21
  }
21
- var i = "\n mutation GovEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }\n", a = "\n mutation GovInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }\n", o = "\n mutation GovCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }\n", s = "\n query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n";
22
- function c(e, t) {
22
+ var o = "\n mutation GovEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }\n", s = "\n mutation GovInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }\n", c = "\n mutation GovCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }\n", l = "\n query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n";
23
+ function u(e, t) {
23
24
  let n = e.lastIndexOf(".");
24
25
  return n > -1 && n < e.length - 1 ? e.slice(n + 1).toLowerCase() : (t.split("/")[1] ?? "bin").toLowerCase();
25
26
  }
26
- async function l(e, n) {
27
- let l = (await r(i, { path: n })).ensureFolderByPath?.id;
28
- if (!l) throw Error("Could not resolve the upload folder.");
29
- let u = e.type || "application/octet-stream", d = e.size, f = await r(a, { input: {
27
+ async function d(e, t) {
28
+ let n = (await a(o, { path: t })).ensureFolderByPath?.id;
29
+ if (!n) throw Error("Could not resolve the upload folder.");
30
+ let i = e.type || "application/octet-stream", d = e.size, f = await a(s, { input: {
30
31
  fileName: e.name,
31
- extension: c(e.name, u),
32
+ extension: u(e.name, i),
32
33
  fileSize: d,
33
- mimeType: u,
34
- folderId: l
34
+ mimeType: i,
35
+ folderId: n
35
36
  } }), p = f.initiateUpload?.uploadUrl, m = f.initiateUpload?.session.id;
36
37
  if (!p || !m) throw Error("The files service did not return an upload URL.");
37
38
  let h = await fetch(p, {
38
39
  method: "PUT",
39
40
  body: e,
40
- headers: { "Content-Type": u }
41
+ headers: { "Content-Type": i }
41
42
  });
42
43
  if (!h.ok) throw Error(`Upload to storage failed (${h.status}).`);
43
- let g = (await r(o, { input: {
44
+ let g = (await a(c, { input: {
44
45
  sessionId: m,
45
46
  fileSize: d,
46
- folderId: l
47
+ folderId: n
47
48
  } })).completeUpload?.file;
48
49
  if (!g?.id) throw Error("The upload could not be finalized.");
49
50
  let _ = "";
50
51
  try {
51
- _ = (await r(s, {
52
+ _ = (await a(l, {
52
53
  id: g.id,
53
- expiresIn: t
54
+ expiresIn: r
54
55
  })).getFileDownloadUrl ?? "";
55
56
  } catch {
56
57
  _ = "";
@@ -61,7 +62,34 @@ async function l(e, n) {
61
62
  name: g.name
62
63
  };
63
64
  }
65
+ function f(i) {
66
+ let { apiGatewayUrl: a } = e();
67
+ return t({
68
+ queryKey: [
69
+ "govcitizenhub",
70
+ "file-url",
71
+ i ?? ""
72
+ ],
73
+ enabled: !!i,
74
+ staleTime: 1800 * 1e3,
75
+ retry: 1,
76
+ queryFn: async () => {
77
+ let e = await n({
78
+ gateway: "workspace",
79
+ baseUrl: a,
80
+ workspaceToken: !0,
81
+ query: l,
82
+ variables: {
83
+ id: i,
84
+ expiresIn: r
85
+ }
86
+ });
87
+ if (e.errors?.length) throw Error(e.errors[0]?.message ?? "Could not resolve file URL");
88
+ return e.data?.getFileDownloadUrl ?? null;
89
+ }
90
+ });
91
+ }
64
92
  //#endregion
65
- export { n as FILE_FOLDERS, l as uploadFileToFiles };
93
+ export { i as FILE_FOLDERS, d as uploadFileToFiles, f as useFileUrl };
66
94
 
67
95
  //# sourceMappingURL=useFiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFiles.js","names":[],"sources":["../../../src/govcitizenhub/hooks/useFiles.ts"],"sourcesContent":["/**\n * File hooks — documents & permit PDFs via wspace-files-svc (NO duplication).\n * @module govcitizenhub/hooks\n *\n * GovCitizenHub never stores blobs. Documents/permits reference files owned by\n * wspace-files-svc by id. Upload uses the SAME proven `graphqlFetch` transport\n * as every other read/write in this MFE (the shell's workspace gateway + token),\n * driving the wspace-files 3-step presigned flow directly:\n * ensureFolderByPath -> initiateUpload -> HTTP PUT -> completeUpload\n * Display resolves a file id to a presigned URL via `getFileDownloadUrl`.\n *\n * NOTE: we deliberately do NOT use the Apollo-based `uploadBlobToFiles` /\n * `getWorkspaceClient()` helper here — this shell wires its data plane through\n * `graphqlFetch`, not a global Apollo client, so `getWorkspaceClient()` returns\n * an un-networked client and the upload silently no-ops. `graphqlFetch` is the\n * transport the whole MFE already uses successfully.\n */\n\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useGovCitizenHub } from '../context';\n\n/** One year — permit PDFs / document scans are long-lived references. */\nconst DOWNLOAD_URL_TTL_SECONDS = 31_536_000;\n\nexport const FILE_FOLDERS = {\n documents: '/GovCitizenHub/Documents',\n permits: '/GovCitizenHub/Permits',\n grievances: '/GovCitizenHub/Grievances',\n} as const;\n\nexport interface UploadedFile {\n id: string;\n url: string;\n name: string;\n}\n\n/** Thin wrapper over the workspace gateway using the MFE's proven transport. */\nasync function filesFetch<TData>(\n query: string,\n variables: Record<string, unknown>\n): Promise<TData> {\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n query,\n variables,\n workspaceToken: true,\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Files request failed');\n }\n if (!response.data) {\n throw new Error('Files response did not include data');\n }\n return response.data;\n}\n\nconst ENSURE_FOLDER = `\n mutation GovEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }\n`;\n\nconst INITIATE_UPLOAD = `\n mutation GovInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }\n`;\n\nconst COMPLETE_UPLOAD = `\n mutation GovCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }\n`;\n\nconst GET_FILE_DOWNLOAD_URL = `\n query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n`;\n\nfunction fileExtension(name: string, mimeType: string): string {\n const dot = name.lastIndexOf('.');\n if (dot > -1 && dot < name.length - 1) return name.slice(dot + 1).toLowerCase();\n const fromMime = mimeType.split('/')[1];\n return (fromMime ?? 'bin').toLowerCase();\n}\n\n/**\n * Upload a file to wspace-files-svc and return its id + a presigned URL. The\n * caller persists the id (e.g. via `govAddDocument({ fileId })`); the URL is used\n * for an immediate preview / download link.\n */\nexport async function uploadFileToFiles(file: File, folderPath: string): Promise<UploadedFile> {\n // 1. Resolve (or create) the destination folder — File.folderId is a real FK.\n const folder = await filesFetch<{ ensureFolderByPath?: { id: string } | null }>(ENSURE_FOLDER, {\n path: folderPath,\n });\n const folderId = folder.ensureFolderByPath?.id;\n if (!folderId) {\n throw new Error('Could not resolve the upload folder.');\n }\n\n const mimeType = file.type || 'application/octet-stream';\n const fileSize = file.size;\n\n // 2. Open a presigned upload session.\n const initiated = await filesFetch<{\n initiateUpload?: { uploadUrl?: string | null; session: { id: string } } | null;\n }>(INITIATE_UPLOAD, {\n input: {\n fileName: file.name,\n extension: fileExtension(file.name, mimeType),\n fileSize,\n mimeType,\n folderId,\n },\n });\n const uploadUrl = initiated.initiateUpload?.uploadUrl;\n const sessionId = initiated.initiateUpload?.session.id;\n if (!uploadUrl || !sessionId) {\n throw new Error('The files service did not return an upload URL.');\n }\n\n // 3. PUT the bytes straight to storage using the presigned URL. Content-Type\n // must match what was signed at initiateUpload.\n const putResponse = await fetch(uploadUrl, {\n method: 'PUT',\n body: file,\n headers: { 'Content-Type': mimeType },\n });\n if (!putResponse.ok) {\n throw new Error(`Upload to storage failed (${putResponse.status}).`);\n }\n\n // 4. Finalize — creates the File record. fileSize must match initiateUpload.\n const completed = await filesFetch<{\n completeUpload?: { fileId: string; file: { id: string; name: string } } | null;\n }>(COMPLETE_UPLOAD, {\n input: { sessionId, fileSize, folderId },\n });\n const fileRecord = completed.completeUpload?.file;\n if (!fileRecord?.id) {\n throw new Error('The upload could not be finalized.');\n }\n\n // 5. Resolve a presigned URL for immediate preview/download (best-effort).\n let url = '';\n try {\n const urlData = await filesFetch<{ getFileDownloadUrl?: string | null }>(\n GET_FILE_DOWNLOAD_URL,\n {\n id: fileRecord.id,\n expiresIn: DOWNLOAD_URL_TTL_SECONDS,\n }\n );\n url = urlData.getFileDownloadUrl ?? '';\n } catch {\n url = '';\n }\n\n return { id: fileRecord.id, url, name: fileRecord.name };\n}\n\n/** Resolve a wspace-files-svc file id to a presigned download URL for display. */\nexport function useFileUrl(fileId?: string | null) {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'file-url', fileId ?? ''],\n enabled: Boolean(fileId),\n staleTime: 30 * 60 * 1000,\n retry: 1,\n queryFn: async () => {\n const response = await graphqlFetch<{ getFileDownloadUrl: string | null }>({\n gateway: 'workspace',\n baseUrl: apiGatewayUrl,\n workspaceToken: true,\n query: GET_FILE_DOWNLOAD_URL,\n variables: { id: fileId, expiresIn: DOWNLOAD_URL_TTL_SECONDS },\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Could not resolve file URL');\n }\n return response.data?.getFileDownloadUrl ?? null;\n },\n });\n}\n"],"mappings":";;;;AAwBA,IAAM,IAA2B,SAEpB,IAAe;CAC1B,WAAW;CACX,SAAS;CACT,YAAY;CACb;AASD,eAAe,EACb,GACA,GACgB;CAChB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA,gBAAgB;EACjB,CAAC;AACF,KAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,uBAAuB;AAExE,KAAI,CAAC,EAAS,KACZ,OAAU,MAAM,sCAAsC;AAExD,QAAO,EAAS;;AAGlB,IAAM,IAAgB,qGAMhB,IAAkB,4JASlB,IAAkB,2JASlB,IAAwB;AAM9B,SAAS,EAAc,GAAc,GAA0B;CAC7D,IAAM,IAAM,EAAK,YAAY,IAAI;AAGjC,QAFI,IAAM,MAAM,IAAM,EAAK,SAAS,IAAU,EAAK,MAAM,IAAM,EAAE,CAAC,aAAa,IAC9D,EAAS,MAAM,IAAI,CAAC,MACjB,OAAO,aAAa;;AAQ1C,eAAsB,EAAkB,GAAY,GAA2C;CAK7F,IAAM,KAHS,MAAM,EAA2D,GAAe,EAC7F,MAAM,GACP,CAAC,EACsB,oBAAoB;AAC5C,KAAI,CAAC,EACH,OAAU,MAAM,uCAAuC;CAGzD,IAAM,IAAW,EAAK,QAAQ,4BACxB,IAAW,EAAK,MAGhB,IAAY,MAAM,EAErB,GAAiB,EAClB,OAAO;EACL,UAAU,EAAK;EACf,WAAW,EAAc,EAAK,MAAM,EAAS;EAC7C;EACA;EACA;EACD,EACF,CAAC,EACI,IAAY,EAAU,gBAAgB,WACtC,IAAY,EAAU,gBAAgB,QAAQ;AACpD,KAAI,CAAC,KAAa,CAAC,EACjB,OAAU,MAAM,kDAAkD;CAKpE,IAAM,IAAc,MAAM,MAAM,GAAW;EACzC,QAAQ;EACR,MAAM;EACN,SAAS,EAAE,gBAAgB,GAAU;EACtC,CAAC;AACF,KAAI,CAAC,EAAY,GACf,OAAU,MAAM,6BAA6B,EAAY,OAAO,IAAI;CAStE,IAAM,KALY,MAAM,EAErB,GAAiB,EAClB,OAAO;EAAE;EAAW;EAAU;EAAU,EACzC,CAAC,EAC2B,gBAAgB;AAC7C,KAAI,CAAC,GAAY,GACf,OAAU,MAAM,qCAAqC;CAIvD,IAAI,IAAM;AACV,KAAI;AAQF,OAPgB,MAAM,EACpB,GACA;GACE,IAAI,EAAW;GACf,WAAW;GACZ,CACF,EACa,sBAAsB;SAC9B;AACN,MAAM;;AAGR,QAAO;EAAE,IAAI,EAAW;EAAI;EAAK,MAAM,EAAW;EAAM"}
1
+ {"version":3,"file":"useFiles.js","names":[],"sources":["../../../src/govcitizenhub/hooks/useFiles.ts"],"sourcesContent":["/**\n * File hooks — documents & permit PDFs via wspace-files-svc (NO duplication).\n * @module govcitizenhub/hooks\n *\n * GovCitizenHub never stores blobs. Documents/permits reference files owned by\n * wspace-files-svc by id. Upload uses the SAME proven `graphqlFetch` transport\n * as every other read/write in this MFE (the shell's workspace gateway + token),\n * driving the wspace-files 3-step presigned flow directly:\n * ensureFolderByPath -> initiateUpload -> HTTP PUT -> completeUpload\n * Display resolves a file id to a presigned URL via `getFileDownloadUrl`.\n *\n * NOTE: we deliberately do NOT use the Apollo-based `uploadBlobToFiles` /\n * `getWorkspaceClient()` helper here — this shell wires its data plane through\n * `graphqlFetch`, not a global Apollo client, so `getWorkspaceClient()` returns\n * an un-networked client and the upload silently no-ops. `graphqlFetch` is the\n * transport the whole MFE already uses successfully.\n */\n\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useGovCitizenHub } from '../context';\n\n/** One year — permit PDFs / document scans are long-lived references. */\nconst DOWNLOAD_URL_TTL_SECONDS = 31_536_000;\n\nexport const FILE_FOLDERS = {\n documents: '/GovCitizenHub/Documents',\n permits: '/GovCitizenHub/Permits',\n grievances: '/GovCitizenHub/Grievances',\n} as const;\n\nexport interface UploadedFile {\n id: string;\n url: string;\n name: string;\n}\n\n/** Thin wrapper over the workspace gateway using the MFE's proven transport. */\nasync function filesFetch<TData>(\n query: string,\n variables: Record<string, unknown>\n): Promise<TData> {\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n query,\n variables,\n workspaceToken: true,\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Files request failed');\n }\n if (!response.data) {\n throw new Error('Files response did not include data');\n }\n return response.data;\n}\n\nconst ENSURE_FOLDER = `\n mutation GovEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }\n`;\n\nconst INITIATE_UPLOAD = `\n mutation GovInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }\n`;\n\nconst COMPLETE_UPLOAD = `\n mutation GovCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }\n`;\n\nconst GET_FILE_DOWNLOAD_URL = `\n query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n`;\n\nfunction fileExtension(name: string, mimeType: string): string {\n const dot = name.lastIndexOf('.');\n if (dot > -1 && dot < name.length - 1) return name.slice(dot + 1).toLowerCase();\n const fromMime = mimeType.split('/')[1];\n return (fromMime ?? 'bin').toLowerCase();\n}\n\n/**\n * Upload a file to wspace-files-svc and return its id + a presigned URL. The\n * caller persists the id (e.g. via `govAddDocument({ fileId })`); the URL is used\n * for an immediate preview / download link.\n */\nexport async function uploadFileToFiles(file: File, folderPath: string): Promise<UploadedFile> {\n // 1. Resolve (or create) the destination folder — File.folderId is a real FK.\n const folder = await filesFetch<{ ensureFolderByPath?: { id: string } | null }>(ENSURE_FOLDER, {\n path: folderPath,\n });\n const folderId = folder.ensureFolderByPath?.id;\n if (!folderId) {\n throw new Error('Could not resolve the upload folder.');\n }\n\n const mimeType = file.type || 'application/octet-stream';\n const fileSize = file.size;\n\n // 2. Open a presigned upload session.\n const initiated = await filesFetch<{\n initiateUpload?: { uploadUrl?: string | null; session: { id: string } } | null;\n }>(INITIATE_UPLOAD, {\n input: {\n fileName: file.name,\n extension: fileExtension(file.name, mimeType),\n fileSize,\n mimeType,\n folderId,\n },\n });\n const uploadUrl = initiated.initiateUpload?.uploadUrl;\n const sessionId = initiated.initiateUpload?.session.id;\n if (!uploadUrl || !sessionId) {\n throw new Error('The files service did not return an upload URL.');\n }\n\n // 3. PUT the bytes straight to storage using the presigned URL. Content-Type\n // must match what was signed at initiateUpload.\n const putResponse = await fetch(uploadUrl, {\n method: 'PUT',\n body: file,\n headers: { 'Content-Type': mimeType },\n });\n if (!putResponse.ok) {\n throw new Error(`Upload to storage failed (${putResponse.status}).`);\n }\n\n // 4. Finalize — creates the File record. fileSize must match initiateUpload.\n const completed = await filesFetch<{\n completeUpload?: { fileId: string; file: { id: string; name: string } } | null;\n }>(COMPLETE_UPLOAD, {\n input: { sessionId, fileSize, folderId },\n });\n const fileRecord = completed.completeUpload?.file;\n if (!fileRecord?.id) {\n throw new Error('The upload could not be finalized.');\n }\n\n // 5. Resolve a presigned URL for immediate preview/download (best-effort).\n let url = '';\n try {\n const urlData = await filesFetch<{ getFileDownloadUrl?: string | null }>(\n GET_FILE_DOWNLOAD_URL,\n {\n id: fileRecord.id,\n expiresIn: DOWNLOAD_URL_TTL_SECONDS,\n }\n );\n url = urlData.getFileDownloadUrl ?? '';\n } catch {\n url = '';\n }\n\n return { id: fileRecord.id, url, name: fileRecord.name };\n}\n\n/** Resolve a wspace-files-svc file id to a presigned download URL for display. */\nexport function useFileUrl(fileId?: string | null) {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'file-url', fileId ?? ''],\n enabled: Boolean(fileId),\n staleTime: 30 * 60 * 1000,\n retry: 1,\n queryFn: async () => {\n const response = await graphqlFetch<{ getFileDownloadUrl: string | null }>({\n gateway: 'workspace',\n baseUrl: apiGatewayUrl,\n workspaceToken: true,\n query: GET_FILE_DOWNLOAD_URL,\n variables: { id: fileId, expiresIn: DOWNLOAD_URL_TTL_SECONDS },\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Could not resolve file URL');\n }\n return response.data?.getFileDownloadUrl ?? null;\n },\n });\n}\n"],"mappings":";;;;;AAwBA,IAAM,IAA2B,SAEpB,IAAe;CAC1B,WAAW;CACX,SAAS;CACT,YAAY;CACb;AASD,eAAe,EACb,GACA,GACgB;CAChB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA,gBAAgB;EACjB,CAAC;AACF,KAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,uBAAuB;AAExE,KAAI,CAAC,EAAS,KACZ,OAAU,MAAM,sCAAsC;AAExD,QAAO,EAAS;;AAGlB,IAAM,IAAgB,qGAMhB,IAAkB,4JASlB,IAAkB,2JASlB,IAAwB;AAM9B,SAAS,EAAc,GAAc,GAA0B;CAC7D,IAAM,IAAM,EAAK,YAAY,IAAI;AAGjC,QAFI,IAAM,MAAM,IAAM,EAAK,SAAS,IAAU,EAAK,MAAM,IAAM,EAAE,CAAC,aAAa,IAC9D,EAAS,MAAM,IAAI,CAAC,MACjB,OAAO,aAAa;;AAQ1C,eAAsB,EAAkB,GAAY,GAA2C;CAK7F,IAAM,KAHS,MAAM,EAA2D,GAAe,EAC7F,MAAM,GACP,CAAC,EACsB,oBAAoB;AAC5C,KAAI,CAAC,EACH,OAAU,MAAM,uCAAuC;CAGzD,IAAM,IAAW,EAAK,QAAQ,4BACxB,IAAW,EAAK,MAGhB,IAAY,MAAM,EAErB,GAAiB,EAClB,OAAO;EACL,UAAU,EAAK;EACf,WAAW,EAAc,EAAK,MAAM,EAAS;EAC7C;EACA;EACA;EACD,EACF,CAAC,EACI,IAAY,EAAU,gBAAgB,WACtC,IAAY,EAAU,gBAAgB,QAAQ;AACpD,KAAI,CAAC,KAAa,CAAC,EACjB,OAAU,MAAM,kDAAkD;CAKpE,IAAM,IAAc,MAAM,MAAM,GAAW;EACzC,QAAQ;EACR,MAAM;EACN,SAAS,EAAE,gBAAgB,GAAU;EACtC,CAAC;AACF,KAAI,CAAC,EAAY,GACf,OAAU,MAAM,6BAA6B,EAAY,OAAO,IAAI;CAStE,IAAM,KALY,MAAM,EAErB,GAAiB,EAClB,OAAO;EAAE;EAAW;EAAU;EAAU,EACzC,CAAC,EAC2B,gBAAgB;AAC7C,KAAI,CAAC,GAAY,GACf,OAAU,MAAM,qCAAqC;CAIvD,IAAI,IAAM;AACV,KAAI;AAQF,OAPgB,MAAM,EACpB,GACA;GACE,IAAI,EAAW;GACf,WAAW;GACZ,CACF,EACa,sBAAsB;SAC9B;AACN,MAAM;;AAGR,QAAO;EAAE,IAAI,EAAW;EAAI;EAAK,MAAM,EAAW;EAAM;;AAI1D,SAAgB,EAAW,GAAwB;CACjD,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU;GAAC;GAAiB;GAAY,KAAU;GAAG;EACrD,SAAS,EAAQ;EACjB,WAAW,OAAU;EACrB,OAAO;EACP,SAAS,YAAY;GACnB,IAAM,IAAW,MAAM,EAAoD;IACzE,SAAS;IACT,SAAS;IACT,gBAAgB;IAChB,OAAO;IACP,WAAW;KAAE,IAAI;KAAQ,WAAW;KAA0B;IAC/D,CAAC;AACF,OAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,6BAA6B;AAE9E,UAAO,EAAS,MAAM,sBAAsB;;EAE/C,CAAC"}
@@ -70,7 +70,16 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
70
70
  pagination: u(t.pagination ?? { limit: 100 })
71
71
  }, n)).govListAgencies
72
72
  });
73
- }, x = () => {
73
+ }, x = (t) => {
74
+ let { apiGatewayUrl: n } = e();
75
+ return r({
76
+ queryKey: c.agency(t ?? ""),
77
+ enabled: !!t,
78
+ queryFn: async () => (await s(`query GovAgency($id: ID!) {
79
+ govAgency(id: $id) { ${d} services { ${f} } }
80
+ }`, { id: t }, n)).govAgency
81
+ });
82
+ }, S = () => {
74
83
  let { apiGatewayUrl: t } = e(), r = i();
75
84
  return n({
76
85
  mutationFn: async (e) => (await s(`mutation GovCreateAgency($input: GovCreateAgencyInput!) {
@@ -78,7 +87,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
78
87
  }`, { input: e }, t)).govCreateAgency,
79
88
  onSuccess: () => r.invalidateQueries({ queryKey: c.agencies })
80
89
  });
81
- }, S = () => {
90
+ }, C = () => {
82
91
  let { apiGatewayUrl: t } = e(), r = i();
83
92
  return n({
84
93
  mutationFn: async (e) => (await s(`mutation GovUpdateAgency($id: ID!, $input: GovUpdateAgencyInput!) {
@@ -88,13 +97,13 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
88
97
  r.invalidateQueries({ queryKey: c.agencies }), r.invalidateQueries({ queryKey: c.agency(e.id) });
89
98
  }
90
99
  });
91
- }, C = () => {
100
+ }, w = () => {
92
101
  let { apiGatewayUrl: t } = e(), r = i();
93
102
  return n({
94
103
  mutationFn: async (e) => (await s("mutation GovArchiveAgency($id: ID!) { govArchiveAgency(id: $id) }", { id: e }, t)).govArchiveAgency,
95
104
  onSuccess: () => r.invalidateQueries({ queryKey: c.agencies })
96
105
  });
97
- }, w = (t = {}) => {
106
+ }, T = (t = {}) => {
98
107
  let { apiGatewayUrl: n } = e();
99
108
  return r({
100
109
  queryKey: [...c.services, t],
@@ -110,7 +119,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
110
119
  pagination: u(t.pagination)
111
120
  }, n)).govListServices
112
121
  });
113
- }, T = (t) => {
122
+ }, E = (t) => {
114
123
  let { apiGatewayUrl: n } = e();
115
124
  return r({
116
125
  queryKey: c.service(t ?? ""),
@@ -119,7 +128,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
119
128
  govService(id: $id) { ${f} agency { ${d} } }
120
129
  }`, { id: t }, n)).govService
121
130
  });
122
- }, E = () => {
131
+ }, D = () => {
123
132
  let { apiGatewayUrl: t } = e(), r = i();
124
133
  return n({
125
134
  mutationFn: async (e) => (await s(`mutation GovCreateService($input: GovCreateServiceInput!) {
@@ -127,7 +136,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
127
136
  }`, { input: e }, t)).govCreateService,
128
137
  onSuccess: () => r.invalidateQueries({ queryKey: c.services })
129
138
  });
130
- }, D = () => {
139
+ }, O = () => {
131
140
  let { apiGatewayUrl: t } = e(), r = i();
132
141
  return n({
133
142
  mutationFn: async (e) => (await s(`mutation GovUpdateService($id: ID!, $input: GovUpdateServiceInput!) {
@@ -137,7 +146,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
137
146
  r.invalidateQueries({ queryKey: c.services }), r.invalidateQueries({ queryKey: c.service(e.id) });
138
147
  }
139
148
  });
140
- }, O = () => {
149
+ }, k = () => {
141
150
  let { apiGatewayUrl: t } = e(), r = i();
142
151
  return n({
143
152
  mutationFn: async (e) => (await s(`mutation GovTransitionService($id: ID!, $status: GovServiceStatus!) {
@@ -147,7 +156,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
147
156
  r.invalidateQueries({ queryKey: c.services }), r.invalidateQueries({ queryKey: c.service(e.id) });
148
157
  }
149
158
  });
150
- }, k = (t = {}) => {
159
+ }, A = (t = {}) => {
151
160
  let { apiGatewayUrl: n } = e();
152
161
  return r({
153
162
  queryKey: [...c.applications, t],
@@ -164,7 +173,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
164
173
  pagination: u(t.pagination)
165
174
  }, n)).govListApplications
166
175
  });
167
- }, A = (t) => {
176
+ }, j = (t) => {
168
177
  let { apiGatewayUrl: n } = e();
169
178
  return r({
170
179
  queryKey: c.application(t ?? ""),
@@ -179,7 +188,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
179
188
  }
180
189
  }`, { id: t }, n)).govApplication
181
190
  });
182
- }, j = () => {
191
+ }, M = () => {
183
192
  let { apiGatewayUrl: t } = e(), r = i();
184
193
  return n({
185
194
  mutationFn: async (e) => (await s(`mutation GovCreateApplication($input: GovCreateApplicationInput!) {
@@ -187,7 +196,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
187
196
  }`, { input: e }, t)).govCreateApplication,
188
197
  onSuccess: () => r.invalidateQueries({ queryKey: c.applications })
189
198
  });
190
- }, M = () => {
199
+ }, N = () => {
191
200
  let { apiGatewayUrl: t } = e(), r = i();
192
201
  return n({
193
202
  mutationFn: async (e) => (await s(`mutation GovUpdateApplication($id: ID!, $input: GovUpdateApplicationInput!) {
@@ -197,7 +206,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
197
206
  r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
198
207
  }
199
208
  });
200
- }, N = () => {
209
+ }, P = () => {
201
210
  let { apiGatewayUrl: t } = e(), r = i();
202
211
  return n({
203
212
  mutationFn: async (e) => (await s(`mutation GovSubmitApplication($id: ID!) {
@@ -207,7 +216,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
207
216
  r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
208
217
  }
209
218
  });
210
- }, P = () => {
219
+ }, F = () => {
211
220
  let { apiGatewayUrl: t } = e(), r = i();
212
221
  return n({
213
222
  mutationFn: async (e) => (await s(`mutation GovTransitionApplication($id: ID!, $status: GovApplicationStatus!, $reason: String) {
@@ -217,7 +226,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
217
226
  r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
218
227
  }
219
228
  });
220
- }, F = () => {
229
+ }, I = () => {
221
230
  let { apiGatewayUrl: t } = e(), r = i();
222
231
  return n({
223
232
  mutationFn: async (e) => (await s(`mutation GovAddDocument($input: GovAddDocumentInput!) {
@@ -227,7 +236,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
227
236
  r.invalidateQueries({ queryKey: c.application(e.applicationId) }), r.invalidateQueries({ queryKey: c.applications });
228
237
  }
229
238
  });
230
- }, I = () => {
239
+ }, L = () => {
231
240
  let { apiGatewayUrl: t } = e(), r = i();
232
241
  return n({
233
242
  mutationFn: async (e) => (await s(`mutation GovReviewDocument($id: ID!, $status: GovDocumentStatus!, $rejectionReason: String) {
@@ -241,7 +250,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
241
250
  r.invalidateQueries({ queryKey: c.application(e.applicationId) });
242
251
  }
243
252
  });
244
- }, L = () => {
253
+ }, R = () => {
245
254
  let { apiGatewayUrl: t } = e(), r = i();
246
255
  return n({
247
256
  mutationFn: async (e) => (await s(`mutation GovAddCaseNote($input: GovAddCaseNoteInput!) {
@@ -251,7 +260,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
251
260
  r.invalidateQueries({ queryKey: c.application(e.applicationId) });
252
261
  }
253
262
  });
254
- }, R = (t = {}) => {
263
+ }, z = (t = {}) => {
255
264
  let { apiGatewayUrl: n } = e();
256
265
  return r({
257
266
  queryKey: [...c.payments, t],
@@ -267,7 +276,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
267
276
  pagination: u(t.pagination)
268
277
  }, n)).govListPayments
269
278
  });
270
- }, z = () => {
279
+ }, B = () => {
271
280
  let { apiGatewayUrl: t } = e(), r = i();
272
281
  return n({
273
282
  mutationFn: async (e) => (await s(`mutation GovCreatePayment($input: GovCreatePaymentInput!) {
@@ -277,7 +286,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
277
286
  r.invalidateQueries({ queryKey: c.payments }), e.applicationId && r.invalidateQueries({ queryKey: c.application(e.applicationId) });
278
287
  }
279
288
  });
280
- }, B = () => {
289
+ }, V = () => {
281
290
  let { apiGatewayUrl: t } = e(), r = i();
282
291
  return n({
283
292
  mutationFn: async (e) => (await s(`mutation GovMarkPaymentPaid($id: ID!, $providerRef: String) {
@@ -285,7 +294,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
285
294
  }`, e, t)).govMarkPaymentPaid,
286
295
  onSuccess: () => r.invalidateQueries({ queryKey: c.payments })
287
296
  });
288
- }, V = () => {
297
+ }, H = () => {
289
298
  let { apiGatewayUrl: t } = e(), r = i();
290
299
  return n({
291
300
  mutationFn: async (e) => (await s(`mutation GovRefundPayment($id: ID!) {
@@ -293,7 +302,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
293
302
  }`, { id: e }, t)).govRefundPayment,
294
303
  onSuccess: () => r.invalidateQueries({ queryKey: c.payments })
295
304
  });
296
- }, H = (t = {}) => {
305
+ }, U = (t = {}) => {
297
306
  let { apiGatewayUrl: n } = e();
298
307
  return r({
299
308
  queryKey: [...c.permits, t],
@@ -306,7 +315,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
306
315
  pagination: u(t.pagination)
307
316
  }, n)).govListPermits
308
317
  });
309
- }, U = () => {
318
+ }, W = () => {
310
319
  let { apiGatewayUrl: t } = e(), r = i();
311
320
  return n({
312
321
  mutationFn: async (e) => (await s(`mutation GovIssuePermit($input: GovIssuePermitInput!) {
@@ -316,7 +325,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
316
325
  r.invalidateQueries({ queryKey: c.permits }), e.applicationId && r.invalidateQueries({ queryKey: c.application(e.applicationId) });
317
326
  }
318
327
  });
319
- }, W = () => {
328
+ }, G = () => {
320
329
  let { apiGatewayUrl: t } = e(), r = i();
321
330
  return n({
322
331
  mutationFn: async (e) => (await s(`mutation GovRevokePermit($id: ID!, $reason: String) {
@@ -324,7 +333,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
324
333
  }`, e, t)).govRevokePermit,
325
334
  onSuccess: () => r.invalidateQueries({ queryKey: c.permits })
326
335
  });
327
- }, G = (t) => {
336
+ }, K = (t) => {
328
337
  let { apiGatewayUrl: n } = e();
329
338
  return r({
330
339
  queryKey: [
@@ -338,7 +347,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
338
347
  govVerifyPermit(verificationCode: $verificationCode) { ${h} }
339
348
  }`, { verificationCode: t }, n)).govVerifyPermit
340
349
  });
341
- }, K = (t = {}) => {
350
+ }, q = (t = {}) => {
342
351
  let { apiGatewayUrl: n } = e();
343
352
  return r({
344
353
  queryKey: [...c.grievances, t],
@@ -354,7 +363,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
354
363
  pagination: u(t.pagination)
355
364
  }, n)).govListGrievances
356
365
  });
357
- }, q = (t) => {
366
+ }, J = (t) => {
358
367
  let { apiGatewayUrl: n } = e();
359
368
  return r({
360
369
  queryKey: c.grievance(t ?? ""),
@@ -363,7 +372,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
363
372
  govGrievance(id: $id) { ${v} }
364
373
  }`, { id: t }, n)).govGrievance
365
374
  });
366
- }, J = () => {
375
+ }, Y = () => {
367
376
  let { apiGatewayUrl: t } = e(), r = i();
368
377
  return n({
369
378
  mutationFn: async (e) => (await s(`mutation GovReportGrievance($input: GovReportGrievanceInput!) {
@@ -371,7 +380,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
371
380
  }`, { input: e }, t)).govReportGrievance,
372
381
  onSuccess: () => r.invalidateQueries({ queryKey: c.grievances })
373
382
  });
374
- }, Y = () => {
383
+ }, X = () => {
375
384
  let { apiGatewayUrl: t } = e(), r = i();
376
385
  return n({
377
386
  mutationFn: async (e) => (await s(`mutation GovUpdateGrievance($id: ID!, $input: GovUpdateGrievanceInput!) {
@@ -381,7 +390,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
381
390
  r.invalidateQueries({ queryKey: c.grievances }), r.invalidateQueries({ queryKey: c.grievance(e.id) });
382
391
  }
383
392
  });
384
- }, X = () => {
393
+ }, Z = () => {
385
394
  let { apiGatewayUrl: t } = e(), r = i();
386
395
  return n({
387
396
  mutationFn: async (e) => (await s(`mutation GovTransitionGrievance($id: ID!, $status: GovGrievanceStatus!, $resolution: String) {
@@ -393,6 +402,6 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
393
402
  });
394
403
  };
395
404
  //#endregion
396
- export { L as useGovAddCaseNote, F as useGovAddDocument, b as useGovAgencies, A as useGovApplication, k as useGovApplications, C as useGovArchiveAgency, x as useGovCreateAgency, j as useGovCreateApplication, z as useGovCreatePayment, E as useGovCreateService, y as useGovDashboardSummary, q as useGovGrievance, K as useGovGrievances, U as useGovIssuePermit, B as useGovMarkPaymentPaid, R as useGovPayments, H as useGovPermits, V as useGovRefundPayment, J as useGovReportGrievance, I as useGovReviewDocument, W as useGovRevokePermit, T as useGovService, w as useGovServices, N as useGovSubmitApplication, P as useGovTransitionApplication, X as useGovTransitionGrievance, O as useGovTransitionService, S as useGovUpdateAgency, M as useGovUpdateApplication, Y as useGovUpdateGrievance, D as useGovUpdateService, G as useGovVerifyPermit };
405
+ export { R as useGovAddCaseNote, I as useGovAddDocument, b as useGovAgencies, x as useGovAgency, j as useGovApplication, A as useGovApplications, w as useGovArchiveAgency, S as useGovCreateAgency, M as useGovCreateApplication, B as useGovCreatePayment, D as useGovCreateService, y as useGovDashboardSummary, J as useGovGrievance, q as useGovGrievances, W as useGovIssuePermit, V as useGovMarkPaymentPaid, z as useGovPayments, U as useGovPermits, H as useGovRefundPayment, Y as useGovReportGrievance, L as useGovReviewDocument, G as useGovRevokePermit, E as useGovService, T as useGovServices, P as useGovSubmitApplication, F as useGovTransitionApplication, Z as useGovTransitionGrievance, k as useGovTransitionService, C as useGovUpdateAgency, N as useGovUpdateApplication, X as useGovUpdateGrievance, O as useGovUpdateService, K as useGovVerifyPermit };
397
406
 
398
407
  //# sourceMappingURL=useGovApi.js.map