@burdenoff/microfe-govcitizenhub 2026.705.1 → 2026.705.3
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.
- package/dist/govcitizenhub/components/Avatar.js +55 -0
- package/dist/govcitizenhub/components/Avatar.js.map +1 -0
- package/dist/govcitizenhub/components/DocumentUploadField.js +95 -45
- package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
- package/dist/govcitizenhub/components/FilterTabs.js +5 -4
- package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
- package/dist/govcitizenhub/components/KeyValueList.js +23 -0
- package/dist/govcitizenhub/components/KeyValueList.js.map +1 -0
- package/dist/govcitizenhub/components/MetricsCard.js +51 -26
- package/dist/govcitizenhub/components/MetricsCard.js.map +1 -1
- package/dist/govcitizenhub/components/PageLayout.js +81 -51
- package/dist/govcitizenhub/components/PageLayout.js.map +1 -1
- package/dist/govcitizenhub/components/Pagination.js +41 -19
- package/dist/govcitizenhub/components/Pagination.js.map +1 -1
- package/dist/govcitizenhub/components/SectionCard.js +31 -0
- package/dist/govcitizenhub/components/SectionCard.js.map +1 -0
- package/dist/govcitizenhub/components/SlaBadge.js +71 -0
- package/dist/govcitizenhub/components/SlaBadge.js.map +1 -0
- package/dist/govcitizenhub/components/StateViews.js +1 -16
- package/dist/govcitizenhub/components/StateViews.js.map +1 -1
- package/dist/govcitizenhub/components/StatusBadge.js +23 -10
- package/dist/govcitizenhub/components/StatusBadge.js.map +1 -1
- package/dist/govcitizenhub/components/StatusStepper.js +55 -0
- package/dist/govcitizenhub/components/StatusStepper.js.map +1 -0
- package/dist/govcitizenhub/components/SummaryStrip.js +54 -0
- package/dist/govcitizenhub/components/SummaryStrip.js.map +1 -0
- package/dist/govcitizenhub/components/TagInput.js +2 -2
- package/dist/govcitizenhub/components/TagInput.js.map +1 -1
- package/dist/govcitizenhub/components/Timeline.js +61 -0
- package/dist/govcitizenhub/components/Timeline.js.map +1 -0
- package/dist/govcitizenhub/hooks/useFiles.js +50 -22
- package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js +44 -34
- package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
- package/dist/govcitizenhub/pages/DashboardPage.js +118 -50
- package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +258 -137
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +103 -90
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +493 -397
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +268 -80
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +412 -174
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js +313 -115
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +379 -176
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +275 -184
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js +251 -133
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +175 -105
- package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/PermitsPage.js +204 -110
- package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js +290 -113
- package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
- package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +301 -0
- package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -0
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +248 -163
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +182 -148
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/services/ServicesPage.js +228 -137
- package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
- 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
|
|
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
|
|
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
|
|
11
|
-
let r = await
|
|
11
|
+
async function a(e, t) {
|
|
12
|
+
let r = await n({
|
|
12
13
|
gateway: "workspace",
|
|
13
|
-
query:
|
|
14
|
-
variables:
|
|
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
|
|
22
|
-
function
|
|
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
|
|
27
|
-
let
|
|
28
|
-
if (!
|
|
29
|
-
let
|
|
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:
|
|
32
|
+
extension: u(e.name, i),
|
|
32
33
|
fileSize: d,
|
|
33
|
-
mimeType:
|
|
34
|
-
folderId:
|
|
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":
|
|
41
|
+
headers: { "Content-Type": i }
|
|
41
42
|
});
|
|
42
43
|
if (!h.ok) throw Error(`Upload to storage failed (${h.status}).`);
|
|
43
|
-
let g = (await
|
|
44
|
+
let g = (await a(c, { input: {
|
|
44
45
|
sessionId: m,
|
|
45
46
|
fileSize: d,
|
|
46
|
-
folderId:
|
|
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
|
|
52
|
+
_ = (await a(l, {
|
|
52
53
|
id: g.id,
|
|
53
|
-
expiresIn:
|
|
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 {
|
|
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":"
|
|
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"}
|
|
@@ -14,9 +14,10 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
14
14
|
variables: n,
|
|
15
15
|
workspaceToken: !0
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
i && t();
|
|
18
|
+
let c = s.data;
|
|
19
|
+
if (!(c != null && Object.values(c).some((e) => e != null))) throw Error(s.errors?.[0]?.message ?? "GraphQL response did not include data");
|
|
20
|
+
return s.errors?.length && console.warn("[govcitizenhub] GraphQL partial error (data returned):", s.errors), s.data;
|
|
20
21
|
}, c = {
|
|
21
22
|
dashboard: ["govcitizenhub", "dashboard-summary"],
|
|
22
23
|
agencies: ["govcitizenhub", "agencies"],
|
|
@@ -70,7 +71,16 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
70
71
|
pagination: u(t.pagination ?? { limit: 100 })
|
|
71
72
|
}, n)).govListAgencies
|
|
72
73
|
});
|
|
73
|
-
}, x = () => {
|
|
74
|
+
}, x = (t) => {
|
|
75
|
+
let { apiGatewayUrl: n } = e();
|
|
76
|
+
return r({
|
|
77
|
+
queryKey: c.agency(t ?? ""),
|
|
78
|
+
enabled: !!t,
|
|
79
|
+
queryFn: async () => (await s(`query GovAgency($id: ID!) {
|
|
80
|
+
govAgency(id: $id) { ${d} services { ${f} } }
|
|
81
|
+
}`, { id: t }, n)).govAgency
|
|
82
|
+
});
|
|
83
|
+
}, S = () => {
|
|
74
84
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
75
85
|
return n({
|
|
76
86
|
mutationFn: async (e) => (await s(`mutation GovCreateAgency($input: GovCreateAgencyInput!) {
|
|
@@ -78,7 +88,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
78
88
|
}`, { input: e }, t)).govCreateAgency,
|
|
79
89
|
onSuccess: () => r.invalidateQueries({ queryKey: c.agencies })
|
|
80
90
|
});
|
|
81
|
-
},
|
|
91
|
+
}, C = () => {
|
|
82
92
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
83
93
|
return n({
|
|
84
94
|
mutationFn: async (e) => (await s(`mutation GovUpdateAgency($id: ID!, $input: GovUpdateAgencyInput!) {
|
|
@@ -88,13 +98,13 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
88
98
|
r.invalidateQueries({ queryKey: c.agencies }), r.invalidateQueries({ queryKey: c.agency(e.id) });
|
|
89
99
|
}
|
|
90
100
|
});
|
|
91
|
-
},
|
|
101
|
+
}, w = () => {
|
|
92
102
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
93
103
|
return n({
|
|
94
104
|
mutationFn: async (e) => (await s("mutation GovArchiveAgency($id: ID!) { govArchiveAgency(id: $id) }", { id: e }, t)).govArchiveAgency,
|
|
95
105
|
onSuccess: () => r.invalidateQueries({ queryKey: c.agencies })
|
|
96
106
|
});
|
|
97
|
-
},
|
|
107
|
+
}, T = (t = {}) => {
|
|
98
108
|
let { apiGatewayUrl: n } = e();
|
|
99
109
|
return r({
|
|
100
110
|
queryKey: [...c.services, t],
|
|
@@ -110,7 +120,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
110
120
|
pagination: u(t.pagination)
|
|
111
121
|
}, n)).govListServices
|
|
112
122
|
});
|
|
113
|
-
},
|
|
123
|
+
}, E = (t) => {
|
|
114
124
|
let { apiGatewayUrl: n } = e();
|
|
115
125
|
return r({
|
|
116
126
|
queryKey: c.service(t ?? ""),
|
|
@@ -119,7 +129,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
119
129
|
govService(id: $id) { ${f} agency { ${d} } }
|
|
120
130
|
}`, { id: t }, n)).govService
|
|
121
131
|
});
|
|
122
|
-
},
|
|
132
|
+
}, D = () => {
|
|
123
133
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
124
134
|
return n({
|
|
125
135
|
mutationFn: async (e) => (await s(`mutation GovCreateService($input: GovCreateServiceInput!) {
|
|
@@ -127,7 +137,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
127
137
|
}`, { input: e }, t)).govCreateService,
|
|
128
138
|
onSuccess: () => r.invalidateQueries({ queryKey: c.services })
|
|
129
139
|
});
|
|
130
|
-
},
|
|
140
|
+
}, O = () => {
|
|
131
141
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
132
142
|
return n({
|
|
133
143
|
mutationFn: async (e) => (await s(`mutation GovUpdateService($id: ID!, $input: GovUpdateServiceInput!) {
|
|
@@ -137,7 +147,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
137
147
|
r.invalidateQueries({ queryKey: c.services }), r.invalidateQueries({ queryKey: c.service(e.id) });
|
|
138
148
|
}
|
|
139
149
|
});
|
|
140
|
-
},
|
|
150
|
+
}, k = () => {
|
|
141
151
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
142
152
|
return n({
|
|
143
153
|
mutationFn: async (e) => (await s(`mutation GovTransitionService($id: ID!, $status: GovServiceStatus!) {
|
|
@@ -147,7 +157,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
147
157
|
r.invalidateQueries({ queryKey: c.services }), r.invalidateQueries({ queryKey: c.service(e.id) });
|
|
148
158
|
}
|
|
149
159
|
});
|
|
150
|
-
},
|
|
160
|
+
}, A = (t = {}) => {
|
|
151
161
|
let { apiGatewayUrl: n } = e();
|
|
152
162
|
return r({
|
|
153
163
|
queryKey: [...c.applications, t],
|
|
@@ -164,7 +174,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
164
174
|
pagination: u(t.pagination)
|
|
165
175
|
}, n)).govListApplications
|
|
166
176
|
});
|
|
167
|
-
},
|
|
177
|
+
}, j = (t) => {
|
|
168
178
|
let { apiGatewayUrl: n } = e();
|
|
169
179
|
return r({
|
|
170
180
|
queryKey: c.application(t ?? ""),
|
|
@@ -179,7 +189,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
179
189
|
}
|
|
180
190
|
}`, { id: t }, n)).govApplication
|
|
181
191
|
});
|
|
182
|
-
},
|
|
192
|
+
}, M = () => {
|
|
183
193
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
184
194
|
return n({
|
|
185
195
|
mutationFn: async (e) => (await s(`mutation GovCreateApplication($input: GovCreateApplicationInput!) {
|
|
@@ -187,7 +197,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
187
197
|
}`, { input: e }, t)).govCreateApplication,
|
|
188
198
|
onSuccess: () => r.invalidateQueries({ queryKey: c.applications })
|
|
189
199
|
});
|
|
190
|
-
},
|
|
200
|
+
}, N = () => {
|
|
191
201
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
192
202
|
return n({
|
|
193
203
|
mutationFn: async (e) => (await s(`mutation GovUpdateApplication($id: ID!, $input: GovUpdateApplicationInput!) {
|
|
@@ -197,7 +207,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
197
207
|
r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
|
|
198
208
|
}
|
|
199
209
|
});
|
|
200
|
-
},
|
|
210
|
+
}, P = () => {
|
|
201
211
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
202
212
|
return n({
|
|
203
213
|
mutationFn: async (e) => (await s(`mutation GovSubmitApplication($id: ID!) {
|
|
@@ -207,7 +217,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
207
217
|
r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
|
|
208
218
|
}
|
|
209
219
|
});
|
|
210
|
-
},
|
|
220
|
+
}, F = () => {
|
|
211
221
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
212
222
|
return n({
|
|
213
223
|
mutationFn: async (e) => (await s(`mutation GovTransitionApplication($id: ID!, $status: GovApplicationStatus!, $reason: String) {
|
|
@@ -217,7 +227,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
217
227
|
r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
|
|
218
228
|
}
|
|
219
229
|
});
|
|
220
|
-
},
|
|
230
|
+
}, I = () => {
|
|
221
231
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
222
232
|
return n({
|
|
223
233
|
mutationFn: async (e) => (await s(`mutation GovAddDocument($input: GovAddDocumentInput!) {
|
|
@@ -227,7 +237,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
227
237
|
r.invalidateQueries({ queryKey: c.application(e.applicationId) }), r.invalidateQueries({ queryKey: c.applications });
|
|
228
238
|
}
|
|
229
239
|
});
|
|
230
|
-
},
|
|
240
|
+
}, L = () => {
|
|
231
241
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
232
242
|
return n({
|
|
233
243
|
mutationFn: async (e) => (await s(`mutation GovReviewDocument($id: ID!, $status: GovDocumentStatus!, $rejectionReason: String) {
|
|
@@ -241,7 +251,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
241
251
|
r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
242
252
|
}
|
|
243
253
|
});
|
|
244
|
-
},
|
|
254
|
+
}, R = () => {
|
|
245
255
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
246
256
|
return n({
|
|
247
257
|
mutationFn: async (e) => (await s(`mutation GovAddCaseNote($input: GovAddCaseNoteInput!) {
|
|
@@ -251,7 +261,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
251
261
|
r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
252
262
|
}
|
|
253
263
|
});
|
|
254
|
-
},
|
|
264
|
+
}, z = (t = {}) => {
|
|
255
265
|
let { apiGatewayUrl: n } = e();
|
|
256
266
|
return r({
|
|
257
267
|
queryKey: [...c.payments, t],
|
|
@@ -267,7 +277,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
267
277
|
pagination: u(t.pagination)
|
|
268
278
|
}, n)).govListPayments
|
|
269
279
|
});
|
|
270
|
-
},
|
|
280
|
+
}, B = () => {
|
|
271
281
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
272
282
|
return n({
|
|
273
283
|
mutationFn: async (e) => (await s(`mutation GovCreatePayment($input: GovCreatePaymentInput!) {
|
|
@@ -277,7 +287,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
277
287
|
r.invalidateQueries({ queryKey: c.payments }), e.applicationId && r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
278
288
|
}
|
|
279
289
|
});
|
|
280
|
-
},
|
|
290
|
+
}, V = () => {
|
|
281
291
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
282
292
|
return n({
|
|
283
293
|
mutationFn: async (e) => (await s(`mutation GovMarkPaymentPaid($id: ID!, $providerRef: String) {
|
|
@@ -285,7 +295,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
285
295
|
}`, e, t)).govMarkPaymentPaid,
|
|
286
296
|
onSuccess: () => r.invalidateQueries({ queryKey: c.payments })
|
|
287
297
|
});
|
|
288
|
-
},
|
|
298
|
+
}, H = () => {
|
|
289
299
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
290
300
|
return n({
|
|
291
301
|
mutationFn: async (e) => (await s(`mutation GovRefundPayment($id: ID!) {
|
|
@@ -293,7 +303,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
293
303
|
}`, { id: e }, t)).govRefundPayment,
|
|
294
304
|
onSuccess: () => r.invalidateQueries({ queryKey: c.payments })
|
|
295
305
|
});
|
|
296
|
-
},
|
|
306
|
+
}, U = (t = {}) => {
|
|
297
307
|
let { apiGatewayUrl: n } = e();
|
|
298
308
|
return r({
|
|
299
309
|
queryKey: [...c.permits, t],
|
|
@@ -306,7 +316,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
306
316
|
pagination: u(t.pagination)
|
|
307
317
|
}, n)).govListPermits
|
|
308
318
|
});
|
|
309
|
-
},
|
|
319
|
+
}, W = () => {
|
|
310
320
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
311
321
|
return n({
|
|
312
322
|
mutationFn: async (e) => (await s(`mutation GovIssuePermit($input: GovIssuePermitInput!) {
|
|
@@ -316,7 +326,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
316
326
|
r.invalidateQueries({ queryKey: c.permits }), e.applicationId && r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
317
327
|
}
|
|
318
328
|
});
|
|
319
|
-
},
|
|
329
|
+
}, G = () => {
|
|
320
330
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
321
331
|
return n({
|
|
322
332
|
mutationFn: async (e) => (await s(`mutation GovRevokePermit($id: ID!, $reason: String) {
|
|
@@ -324,7 +334,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
324
334
|
}`, e, t)).govRevokePermit,
|
|
325
335
|
onSuccess: () => r.invalidateQueries({ queryKey: c.permits })
|
|
326
336
|
});
|
|
327
|
-
},
|
|
337
|
+
}, K = (t) => {
|
|
328
338
|
let { apiGatewayUrl: n } = e();
|
|
329
339
|
return r({
|
|
330
340
|
queryKey: [
|
|
@@ -338,7 +348,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
338
348
|
govVerifyPermit(verificationCode: $verificationCode) { ${h} }
|
|
339
349
|
}`, { verificationCode: t }, n)).govVerifyPermit
|
|
340
350
|
});
|
|
341
|
-
},
|
|
351
|
+
}, q = (t = {}) => {
|
|
342
352
|
let { apiGatewayUrl: n } = e();
|
|
343
353
|
return r({
|
|
344
354
|
queryKey: [...c.grievances, t],
|
|
@@ -354,7 +364,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
354
364
|
pagination: u(t.pagination)
|
|
355
365
|
}, n)).govListGrievances
|
|
356
366
|
});
|
|
357
|
-
},
|
|
367
|
+
}, J = (t) => {
|
|
358
368
|
let { apiGatewayUrl: n } = e();
|
|
359
369
|
return r({
|
|
360
370
|
queryKey: c.grievance(t ?? ""),
|
|
@@ -363,7 +373,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
363
373
|
govGrievance(id: $id) { ${v} }
|
|
364
374
|
}`, { id: t }, n)).govGrievance
|
|
365
375
|
});
|
|
366
|
-
},
|
|
376
|
+
}, Y = () => {
|
|
367
377
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
368
378
|
return n({
|
|
369
379
|
mutationFn: async (e) => (await s(`mutation GovReportGrievance($input: GovReportGrievanceInput!) {
|
|
@@ -371,7 +381,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
371
381
|
}`, { input: e }, t)).govReportGrievance,
|
|
372
382
|
onSuccess: () => r.invalidateQueries({ queryKey: c.grievances })
|
|
373
383
|
});
|
|
374
|
-
},
|
|
384
|
+
}, X = () => {
|
|
375
385
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
376
386
|
return n({
|
|
377
387
|
mutationFn: async (e) => (await s(`mutation GovUpdateGrievance($id: ID!, $input: GovUpdateGrievanceInput!) {
|
|
@@ -381,7 +391,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
381
391
|
r.invalidateQueries({ queryKey: c.grievances }), r.invalidateQueries({ queryKey: c.grievance(e.id) });
|
|
382
392
|
}
|
|
383
393
|
});
|
|
384
|
-
},
|
|
394
|
+
}, Z = () => {
|
|
385
395
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
386
396
|
return n({
|
|
387
397
|
mutationFn: async (e) => (await s(`mutation GovTransitionGrievance($id: ID!, $status: GovGrievanceStatus!, $resolution: String) {
|
|
@@ -393,6 +403,6 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
393
403
|
});
|
|
394
404
|
};
|
|
395
405
|
//#endregion
|
|
396
|
-
export {
|
|
406
|
+
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
407
|
|
|
398
408
|
//# sourceMappingURL=useGovApi.js.map
|