@burdenoff/microfe-govcitizenhub 2026.704.2 → 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.
- 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 +52 -35
- package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
- package/dist/govcitizenhub/pages/DashboardPage.js +166 -111
- 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 -395
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +266 -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 +209 -100
- 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 +183 -149
- 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>(query: string
|
|
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"}
|
|
@@ -18,6 +18,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
18
18
|
if (!s.data) throw Error("GraphQL response did not include data");
|
|
19
19
|
return s.data;
|
|
20
20
|
}, c = {
|
|
21
|
+
dashboard: ["govcitizenhub", "dashboard-summary"],
|
|
21
22
|
agencies: ["govcitizenhub", "agencies"],
|
|
22
23
|
agency: (e) => [
|
|
23
24
|
"govcitizenhub",
|
|
@@ -52,7 +53,13 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
52
53
|
}, l = { limit: 50 }, u = (e) => {
|
|
53
54
|
let t = e ?? l, n = { limit: t.limit ?? l.limit };
|
|
54
55
|
return t.offset != null && (n.offset = t.offset), t.cursor != null && (n.cursor = t.cursor), n;
|
|
55
|
-
}, d = "\n id workspaceId code contactEmail contactPhone description isActive jurisdiction\n name tags createdAt updatedAt\n", f = "\n id workspaceId agencyId category currency eligibility feeAmount feeType formSchema\n name publishedAt requiredDocuments slaDays slug status summary tags createdAt updatedAt\n", p = "\n id workspaceId applicationId name status requirement rejectionReason\n file { id } createdAt updatedAt\n", m = "\n id workspaceId applicationId authorId body type createdAt updatedAt\n", h = "\n id workspaceId applicationId serviceId holderId title verificationCode status\n issuedAt expiresAt revokedAt revokeReason file { id } createdAt updatedAt\n", g = "\n id workspaceId applicationId payerId amount currency status receiptNumber\n providerRef lineItems paidAt refundedAt createdAt updatedAt\n", _ = "\n id workspaceId reference serviceId citizenId assignedToId status priority dueDate\n submittedAt decidedAt decisionReason tags createdAt updatedAt\n", v = "\n id workspaceId title description category status priority location latitude longitude\n photoFileIds reporterId agencyId assignedToId resolution resolvedAt tags createdAt updatedAt\n", y = (
|
|
56
|
+
}, d = "\n id workspaceId code contactEmail contactPhone description isActive jurisdiction\n name tags createdAt updatedAt\n", f = "\n id workspaceId agencyId category currency eligibility feeAmount feeType formSchema\n name publishedAt requiredDocuments slaDays slug status summary tags createdAt updatedAt\n", p = "\n id workspaceId applicationId name status requirement rejectionReason\n file { id } createdAt updatedAt\n", m = "\n id workspaceId applicationId authorId body type createdAt updatedAt\n", h = "\n id workspaceId applicationId serviceId holderId title verificationCode status\n issuedAt expiresAt revokedAt revokeReason file { id } createdAt updatedAt\n", g = "\n id workspaceId applicationId payerId amount currency status receiptNumber\n providerRef lineItems paidAt refundedAt createdAt updatedAt\n", _ = "\n id workspaceId reference serviceId citizenId assignedToId status priority dueDate\n submittedAt decidedAt decisionReason tags createdAt updatedAt\n", v = "\n id workspaceId title description category status priority location latitude longitude\n photoFileIds reporterId agencyId assignedToId resolution resolvedAt tags createdAt updatedAt\n", y = () => {
|
|
57
|
+
let { apiGatewayUrl: t } = e();
|
|
58
|
+
return r({
|
|
59
|
+
queryKey: c.dashboard,
|
|
60
|
+
queryFn: async () => (await s("query GovDashboardSummary {\n govDashboardSummary {\n applicationsTotal\n applicationsByStatus { status count }\n pendingPayments\n pendingPaymentsAmount\n openGrievances\n activePermits\n publishedServices\n activeAgencies\n }\n }", {}, t)).govDashboardSummary
|
|
61
|
+
});
|
|
62
|
+
}, b = (t = {}) => {
|
|
56
63
|
let { apiGatewayUrl: n } = e();
|
|
57
64
|
return r({
|
|
58
65
|
queryKey: [...c.agencies, t],
|
|
@@ -63,7 +70,16 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
63
70
|
pagination: u(t.pagination ?? { limit: 100 })
|
|
64
71
|
}, n)).govListAgencies
|
|
65
72
|
});
|
|
66
|
-
},
|
|
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 = () => {
|
|
67
83
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
68
84
|
return n({
|
|
69
85
|
mutationFn: async (e) => (await s(`mutation GovCreateAgency($input: GovCreateAgencyInput!) {
|
|
@@ -71,7 +87,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
71
87
|
}`, { input: e }, t)).govCreateAgency,
|
|
72
88
|
onSuccess: () => r.invalidateQueries({ queryKey: c.agencies })
|
|
73
89
|
});
|
|
74
|
-
},
|
|
90
|
+
}, C = () => {
|
|
75
91
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
76
92
|
return n({
|
|
77
93
|
mutationFn: async (e) => (await s(`mutation GovUpdateAgency($id: ID!, $input: GovUpdateAgencyInput!) {
|
|
@@ -81,13 +97,13 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
81
97
|
r.invalidateQueries({ queryKey: c.agencies }), r.invalidateQueries({ queryKey: c.agency(e.id) });
|
|
82
98
|
}
|
|
83
99
|
});
|
|
84
|
-
},
|
|
100
|
+
}, w = () => {
|
|
85
101
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
86
102
|
return n({
|
|
87
103
|
mutationFn: async (e) => (await s("mutation GovArchiveAgency($id: ID!) { govArchiveAgency(id: $id) }", { id: e }, t)).govArchiveAgency,
|
|
88
104
|
onSuccess: () => r.invalidateQueries({ queryKey: c.agencies })
|
|
89
105
|
});
|
|
90
|
-
},
|
|
106
|
+
}, T = (t = {}) => {
|
|
91
107
|
let { apiGatewayUrl: n } = e();
|
|
92
108
|
return r({
|
|
93
109
|
queryKey: [...c.services, t],
|
|
@@ -103,7 +119,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
103
119
|
pagination: u(t.pagination)
|
|
104
120
|
}, n)).govListServices
|
|
105
121
|
});
|
|
106
|
-
},
|
|
122
|
+
}, E = (t) => {
|
|
107
123
|
let { apiGatewayUrl: n } = e();
|
|
108
124
|
return r({
|
|
109
125
|
queryKey: c.service(t ?? ""),
|
|
@@ -112,7 +128,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
112
128
|
govService(id: $id) { ${f} agency { ${d} } }
|
|
113
129
|
}`, { id: t }, n)).govService
|
|
114
130
|
});
|
|
115
|
-
},
|
|
131
|
+
}, D = () => {
|
|
116
132
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
117
133
|
return n({
|
|
118
134
|
mutationFn: async (e) => (await s(`mutation GovCreateService($input: GovCreateServiceInput!) {
|
|
@@ -120,7 +136,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
120
136
|
}`, { input: e }, t)).govCreateService,
|
|
121
137
|
onSuccess: () => r.invalidateQueries({ queryKey: c.services })
|
|
122
138
|
});
|
|
123
|
-
},
|
|
139
|
+
}, O = () => {
|
|
124
140
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
125
141
|
return n({
|
|
126
142
|
mutationFn: async (e) => (await s(`mutation GovUpdateService($id: ID!, $input: GovUpdateServiceInput!) {
|
|
@@ -130,7 +146,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
130
146
|
r.invalidateQueries({ queryKey: c.services }), r.invalidateQueries({ queryKey: c.service(e.id) });
|
|
131
147
|
}
|
|
132
148
|
});
|
|
133
|
-
},
|
|
149
|
+
}, k = () => {
|
|
134
150
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
135
151
|
return n({
|
|
136
152
|
mutationFn: async (e) => (await s(`mutation GovTransitionService($id: ID!, $status: GovServiceStatus!) {
|
|
@@ -140,7 +156,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
140
156
|
r.invalidateQueries({ queryKey: c.services }), r.invalidateQueries({ queryKey: c.service(e.id) });
|
|
141
157
|
}
|
|
142
158
|
});
|
|
143
|
-
},
|
|
159
|
+
}, A = (t = {}) => {
|
|
144
160
|
let { apiGatewayUrl: n } = e();
|
|
145
161
|
return r({
|
|
146
162
|
queryKey: [...c.applications, t],
|
|
@@ -157,7 +173,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
157
173
|
pagination: u(t.pagination)
|
|
158
174
|
}, n)).govListApplications
|
|
159
175
|
});
|
|
160
|
-
},
|
|
176
|
+
}, j = (t) => {
|
|
161
177
|
let { apiGatewayUrl: n } = e();
|
|
162
178
|
return r({
|
|
163
179
|
queryKey: c.application(t ?? ""),
|
|
@@ -172,7 +188,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
172
188
|
}
|
|
173
189
|
}`, { id: t }, n)).govApplication
|
|
174
190
|
});
|
|
175
|
-
},
|
|
191
|
+
}, M = () => {
|
|
176
192
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
177
193
|
return n({
|
|
178
194
|
mutationFn: async (e) => (await s(`mutation GovCreateApplication($input: GovCreateApplicationInput!) {
|
|
@@ -180,7 +196,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
180
196
|
}`, { input: e }, t)).govCreateApplication,
|
|
181
197
|
onSuccess: () => r.invalidateQueries({ queryKey: c.applications })
|
|
182
198
|
});
|
|
183
|
-
},
|
|
199
|
+
}, N = () => {
|
|
184
200
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
185
201
|
return n({
|
|
186
202
|
mutationFn: async (e) => (await s(`mutation GovUpdateApplication($id: ID!, $input: GovUpdateApplicationInput!) {
|
|
@@ -190,7 +206,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
190
206
|
r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
|
|
191
207
|
}
|
|
192
208
|
});
|
|
193
|
-
},
|
|
209
|
+
}, P = () => {
|
|
194
210
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
195
211
|
return n({
|
|
196
212
|
mutationFn: async (e) => (await s(`mutation GovSubmitApplication($id: ID!) {
|
|
@@ -200,7 +216,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
200
216
|
r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
|
|
201
217
|
}
|
|
202
218
|
});
|
|
203
|
-
},
|
|
219
|
+
}, F = () => {
|
|
204
220
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
205
221
|
return n({
|
|
206
222
|
mutationFn: async (e) => (await s(`mutation GovTransitionApplication($id: ID!, $status: GovApplicationStatus!, $reason: String) {
|
|
@@ -210,7 +226,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
210
226
|
r.invalidateQueries({ queryKey: c.applications }), r.invalidateQueries({ queryKey: c.application(e.id) });
|
|
211
227
|
}
|
|
212
228
|
});
|
|
213
|
-
},
|
|
229
|
+
}, I = () => {
|
|
214
230
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
215
231
|
return n({
|
|
216
232
|
mutationFn: async (e) => (await s(`mutation GovAddDocument($input: GovAddDocumentInput!) {
|
|
@@ -220,7 +236,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
220
236
|
r.invalidateQueries({ queryKey: c.application(e.applicationId) }), r.invalidateQueries({ queryKey: c.applications });
|
|
221
237
|
}
|
|
222
238
|
});
|
|
223
|
-
},
|
|
239
|
+
}, L = () => {
|
|
224
240
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
225
241
|
return n({
|
|
226
242
|
mutationFn: async (e) => (await s(`mutation GovReviewDocument($id: ID!, $status: GovDocumentStatus!, $rejectionReason: String) {
|
|
@@ -234,7 +250,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
234
250
|
r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
235
251
|
}
|
|
236
252
|
});
|
|
237
|
-
},
|
|
253
|
+
}, R = () => {
|
|
238
254
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
239
255
|
return n({
|
|
240
256
|
mutationFn: async (e) => (await s(`mutation GovAddCaseNote($input: GovAddCaseNoteInput!) {
|
|
@@ -244,7 +260,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
244
260
|
r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
245
261
|
}
|
|
246
262
|
});
|
|
247
|
-
},
|
|
263
|
+
}, z = (t = {}) => {
|
|
248
264
|
let { apiGatewayUrl: n } = e();
|
|
249
265
|
return r({
|
|
250
266
|
queryKey: [...c.payments, t],
|
|
@@ -260,7 +276,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
260
276
|
pagination: u(t.pagination)
|
|
261
277
|
}, n)).govListPayments
|
|
262
278
|
});
|
|
263
|
-
},
|
|
279
|
+
}, B = () => {
|
|
264
280
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
265
281
|
return n({
|
|
266
282
|
mutationFn: async (e) => (await s(`mutation GovCreatePayment($input: GovCreatePaymentInput!) {
|
|
@@ -270,7 +286,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
270
286
|
r.invalidateQueries({ queryKey: c.payments }), e.applicationId && r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
271
287
|
}
|
|
272
288
|
});
|
|
273
|
-
},
|
|
289
|
+
}, V = () => {
|
|
274
290
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
275
291
|
return n({
|
|
276
292
|
mutationFn: async (e) => (await s(`mutation GovMarkPaymentPaid($id: ID!, $providerRef: String) {
|
|
@@ -278,7 +294,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
278
294
|
}`, e, t)).govMarkPaymentPaid,
|
|
279
295
|
onSuccess: () => r.invalidateQueries({ queryKey: c.payments })
|
|
280
296
|
});
|
|
281
|
-
},
|
|
297
|
+
}, H = () => {
|
|
282
298
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
283
299
|
return n({
|
|
284
300
|
mutationFn: async (e) => (await s(`mutation GovRefundPayment($id: ID!) {
|
|
@@ -286,19 +302,20 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
286
302
|
}`, { id: e }, t)).govRefundPayment,
|
|
287
303
|
onSuccess: () => r.invalidateQueries({ queryKey: c.payments })
|
|
288
304
|
});
|
|
289
|
-
},
|
|
305
|
+
}, U = (t = {}) => {
|
|
290
306
|
let { apiGatewayUrl: n } = e();
|
|
291
307
|
return r({
|
|
292
308
|
queryKey: [...c.permits, t],
|
|
293
|
-
queryFn: async () => (await s(`query GovListPermits($holderId: ID, $serviceId: ID, $status: GovPermitStatus) {
|
|
294
|
-
govListPermits(holderId: $holderId, serviceId: $serviceId, status: $status) { ${h} }
|
|
309
|
+
queryFn: async () => (await s(`query GovListPermits($holderId: ID, $serviceId: ID, $status: GovPermitStatus, $pagination: PaginationInput) {
|
|
310
|
+
govListPermits(holderId: $holderId, serviceId: $serviceId, status: $status, pagination: $pagination) { ${h} }
|
|
295
311
|
}`, {
|
|
296
312
|
holderId: t.holderId,
|
|
297
313
|
serviceId: t.serviceId,
|
|
298
|
-
status: t.status
|
|
314
|
+
status: t.status,
|
|
315
|
+
pagination: u(t.pagination)
|
|
299
316
|
}, n)).govListPermits
|
|
300
317
|
});
|
|
301
|
-
},
|
|
318
|
+
}, W = () => {
|
|
302
319
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
303
320
|
return n({
|
|
304
321
|
mutationFn: async (e) => (await s(`mutation GovIssuePermit($input: GovIssuePermitInput!) {
|
|
@@ -308,7 +325,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
308
325
|
r.invalidateQueries({ queryKey: c.permits }), e.applicationId && r.invalidateQueries({ queryKey: c.application(e.applicationId) });
|
|
309
326
|
}
|
|
310
327
|
});
|
|
311
|
-
},
|
|
328
|
+
}, G = () => {
|
|
312
329
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
313
330
|
return n({
|
|
314
331
|
mutationFn: async (e) => (await s(`mutation GovRevokePermit($id: ID!, $reason: String) {
|
|
@@ -316,7 +333,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
316
333
|
}`, e, t)).govRevokePermit,
|
|
317
334
|
onSuccess: () => r.invalidateQueries({ queryKey: c.permits })
|
|
318
335
|
});
|
|
319
|
-
},
|
|
336
|
+
}, K = (t) => {
|
|
320
337
|
let { apiGatewayUrl: n } = e();
|
|
321
338
|
return r({
|
|
322
339
|
queryKey: [
|
|
@@ -330,7 +347,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
330
347
|
govVerifyPermit(verificationCode: $verificationCode) { ${h} }
|
|
331
348
|
}`, { verificationCode: t }, n)).govVerifyPermit
|
|
332
349
|
});
|
|
333
|
-
},
|
|
350
|
+
}, q = (t = {}) => {
|
|
334
351
|
let { apiGatewayUrl: n } = e();
|
|
335
352
|
return r({
|
|
336
353
|
queryKey: [...c.grievances, t],
|
|
@@ -346,7 +363,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
346
363
|
pagination: u(t.pagination)
|
|
347
364
|
}, n)).govListGrievances
|
|
348
365
|
});
|
|
349
|
-
},
|
|
366
|
+
}, J = (t) => {
|
|
350
367
|
let { apiGatewayUrl: n } = e();
|
|
351
368
|
return r({
|
|
352
369
|
queryKey: c.grievance(t ?? ""),
|
|
@@ -355,7 +372,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
355
372
|
govGrievance(id: $id) { ${v} }
|
|
356
373
|
}`, { id: t }, n)).govGrievance
|
|
357
374
|
});
|
|
358
|
-
},
|
|
375
|
+
}, Y = () => {
|
|
359
376
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
360
377
|
return n({
|
|
361
378
|
mutationFn: async (e) => (await s(`mutation GovReportGrievance($input: GovReportGrievanceInput!) {
|
|
@@ -363,7 +380,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
363
380
|
}`, { input: e }, t)).govReportGrievance,
|
|
364
381
|
onSuccess: () => r.invalidateQueries({ queryKey: c.grievances })
|
|
365
382
|
});
|
|
366
|
-
},
|
|
383
|
+
}, X = () => {
|
|
367
384
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
368
385
|
return n({
|
|
369
386
|
mutationFn: async (e) => (await s(`mutation GovUpdateGrievance($id: ID!, $input: GovUpdateGrievanceInput!) {
|
|
@@ -373,7 +390,7 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
373
390
|
r.invalidateQueries({ queryKey: c.grievances }), r.invalidateQueries({ queryKey: c.grievance(e.id) });
|
|
374
391
|
}
|
|
375
392
|
});
|
|
376
|
-
},
|
|
393
|
+
}, Z = () => {
|
|
377
394
|
let { apiGatewayUrl: t } = e(), r = i();
|
|
378
395
|
return n({
|
|
379
396
|
mutationFn: async (e) => (await s(`mutation GovTransitionGrievance($id: ID!, $status: GovGrievanceStatus!, $resolution: String) {
|
|
@@ -385,6 +402,6 @@ var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
|
385
402
|
});
|
|
386
403
|
};
|
|
387
404
|
//#endregion
|
|
388
|
-
export {
|
|
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 };
|
|
389
406
|
|
|
390
407
|
//# sourceMappingURL=useGovApi.js.map
|