@burdenoff/microfe-ecoimpacthub 2026.704.2 → 2026.704.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/ecoimpacthub/components/EcoDiscussion.js +109 -0
- package/dist/ecoimpacthub/components/EcoDiscussion.js.map +1 -0
- package/dist/ecoimpacthub/components/EcoTags.js +149 -0
- package/dist/ecoimpacthub/components/EcoTags.js.map +1 -0
- package/dist/ecoimpacthub/components/EvidenceUpload.js +93 -0
- package/dist/ecoimpacthub/components/EvidenceUpload.js.map +1 -0
- package/dist/ecoimpacthub/components/FileLink.js +36 -0
- package/dist/ecoimpacthub/components/FileLink.js.map +1 -0
- package/dist/ecoimpacthub/components/PageLayout.js +2 -2
- package/dist/ecoimpacthub/components/PageLayout.js.map +1 -1
- package/dist/ecoimpacthub/hooks/index.js +3 -0
- package/dist/ecoimpacthub/hooks/useEcoComments.js +45 -0
- package/dist/ecoimpacthub/hooks/useEcoComments.js.map +1 -0
- package/dist/ecoimpacthub/hooks/useEcoFiles.js +81 -0
- package/dist/ecoimpacthub/hooks/useEcoFiles.js.map +1 -0
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js +169 -166
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js.map +1 -1
- package/dist/ecoimpacthub/hooks/useEcoTags.js +89 -0
- package/dist/ecoimpacthub/hooks/useEcoTags.js.map +1 -0
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +124 -101
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +153 -126
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +241 -230
- package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +260 -225
- package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEcoFiles.js","names":[],"sources":["../../../src/ecoimpacthub/hooks/useEcoFiles.ts"],"sourcesContent":["/**\n * EcoImpactHub — wspace-files-svc REUSE hooks (Integration A).\n * @module ecoimpacthub/hooks/useEcoFiles\n *\n * Reuses the platform file store (`wspace-files-svc`) WITHOUT any eco-svc\n * change: the eco schema already exposes `EcoObservation.evidenceFileId` /\n * `EcoReport.fileId`; this module lets the UI actually produce a `fileId` via\n * the canonical 3-step upload flow composed into the WORKSPACE supergraph:\n * 1. `initiateUpload(input)` → `{ uploadUrl, session { id } }`\n * 2. HTTP `PUT` the bytes to the returned signed `uploadUrl`\n * 3. `completeUpload(input: { sessionId })` → `{ fileId }`\n * plus `getFile(id)` to resolve an existing evidence/report file's name + URL.\n *\n * Transport mirrors `useEcoImpactHubApi` exactly — `graphqlFetch({ gateway:\n * 'workspace', workspaceToken: true })` — so no ApolloProvider is required.\n * These hooks live in a SEPARATE file by design; `useEcoImpactHubApi.ts` is\n * left untouched.\n */\n\nimport { useCallback, useState } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useEcoImpactHub } from '../context';\n\n// ============================================================================\n// Shared workspace-gateway transport (reused by the comments + tags hooks too)\n// ============================================================================\n\ntype GraphqlReadCacheGlobals = {\n __graphqlFetchResponseCache?: { clear: () => void };\n __graphqlFetchPendingResponses?: { clear: () => void };\n __boffGraphQLResponseCache?: { clear: () => void };\n};\n\n/**\n * fe-libs `graphqlFetch` coalesces `query` responses in a short-lived in-memory\n * cache. After a write we drop those caches so the invalidation refetch that\n * follows reads fresh data (same remedy `useEcoImpactHubApi` applies).\n */\nconst clearGraphqlReadCaches = (): void => {\n const g = globalThis as GraphqlReadCacheGlobals;\n g.__graphqlFetchResponseCache?.clear();\n g.__graphqlFetchPendingResponses?.clear();\n g.__boffGraphQLResponseCache?.clear();\n};\n\n/** Execute a workspace-gateway GraphQL operation with the workspace token. */\nexport const wspaceFetch = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string\n): Promise<TData> => {\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n });\n\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'GraphQL request failed');\n }\n if (!response.data) {\n throw new Error('GraphQL response did not include data');\n }\n if (/^\\s*mutation\\b/.test(query)) {\n clearGraphqlReadCaches();\n }\n return response.data;\n};\n\n// ============================================================================\n// File upload (initiate → PUT → complete)\n// ============================================================================\n\nexport interface UploadedEcoFile {\n fileId: string;\n fileName: string;\n}\n\n/** `PUT` the blob to the signed URL, reporting byte-progress via `onProgress`. */\nfunction putWithProgress(\n url: string,\n file: File,\n contentType: string,\n onProgress: (percent: number) => void\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open('PUT', url);\n xhr.setRequestHeader('Content-Type', contentType);\n xhr.upload.onprogress = (event) => {\n if (event.lengthComputable) {\n onProgress(Math.round((event.loaded / event.total) * 100));\n }\n };\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve();\n } else {\n reject(new Error(`File storage rejected the upload (HTTP ${xhr.status}).`));\n }\n };\n xhr.onerror = () => reject(new Error('Network error while uploading the file.'));\n xhr.onabort = () => reject(new Error('The upload was cancelled.'));\n xhr.send(file);\n });\n}\n\nexport interface UseEcoFileUploadResult {\n upload: (file: File) => Promise<UploadedEcoFile>;\n isUploading: boolean;\n /** 0–100 byte-progress of the signed-URL PUT. */\n progress: number;\n error: string | null;\n reset: () => void;\n}\n\n/**\n * Imperative upload hook: `await upload(file)` runs the platform 3-step flow and\n * resolves to `{ fileId, fileName }`. `fileId` is what the eco mutations accept\n * (`ecoRecordObservation.evidenceFileId`, `ecoPublishReport.fileId`).\n */\nexport const useEcoFileUpload = (): UseEcoFileUploadResult => {\n const { apiGatewayUrl } = useEcoImpactHub();\n const [isUploading, setIsUploading] = useState(false);\n const [progress, setProgress] = useState(0);\n const [error, setError] = useState<string | null>(null);\n\n const reset = useCallback(() => {\n setIsUploading(false);\n setProgress(0);\n setError(null);\n }, []);\n\n const upload = useCallback(\n async (file: File): Promise<UploadedEcoFile> => {\n setIsUploading(true);\n setProgress(0);\n setError(null);\n try {\n const dotIndex = file.name.lastIndexOf('.');\n const extension = dotIndex > -1 ? file.name.slice(dotIndex + 1) : '';\n const mimeType = file.type || 'application/octet-stream';\n\n // 1. initiate\n const initiated = await wspaceFetch<{\n initiateUpload: { uploadUrl: string | null; session: { id: string } };\n }>(\n `mutation EcoInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }`,\n {\n input: {\n fileName: file.name,\n extension,\n mimeType,\n fileSize: String(file.size),\n visibility: 'WORKSPACE',\n },\n },\n apiGatewayUrl\n );\n\n const { uploadUrl } = initiated.initiateUpload;\n const sessionId = initiated.initiateUpload.session.id;\n if (!uploadUrl) {\n throw new Error('The file service did not return an upload URL.');\n }\n\n // 2. PUT the bytes\n await putWithProgress(uploadUrl, file, mimeType, setProgress);\n\n // 3. complete\n const completed = await wspaceFetch<{\n completeUpload: { fileId: string; file: { id: string; name: string } | null };\n }>(\n `mutation EcoCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }`,\n { input: { sessionId } },\n apiGatewayUrl\n );\n\n setProgress(100);\n return {\n fileId: completed.completeUpload.fileId,\n fileName: completed.completeUpload.file?.name ?? file.name,\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : 'The file could not be uploaded.';\n setError(message);\n throw err instanceof Error ? err : new Error(message);\n } finally {\n setIsUploading(false);\n }\n },\n [apiGatewayUrl]\n );\n\n return { upload, isUploading, progress, error, reset };\n};\n\n// ============================================================================\n// Resolve an existing file (name + download URL) for rendering evidence links\n// ============================================================================\n\nexport interface EcoFileMeta {\n id: string;\n name: string;\n downloadUrl: string | null;\n mimeType: string;\n size: string;\n}\n\nexport const useEcoFile = (id: string | null | undefined) => {\n const { apiGatewayUrl } = useEcoImpactHub();\n return useQuery({\n queryKey: ['ecoimpacthub', 'file', id ?? ''],\n enabled: Boolean(id),\n queryFn: async () => {\n const data = await wspaceFetch<{ getFile: EcoFileMeta | null }>(\n `query EcoGetFile($id: ID!) {\n getFile(id: $id) {\n id\n name\n downloadUrl\n mimeType\n size\n }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.getFile;\n },\n });\n};\n"],"mappings":"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"}
|
|
@@ -3,7 +3,10 @@ import "../context/index.js";
|
|
|
3
3
|
import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
|
|
4
4
|
import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
|
|
5
5
|
//#region src/ecoimpacthub/hooks/useEcoImpactHubApi.ts
|
|
6
|
-
var a =
|
|
6
|
+
var a = () => {
|
|
7
|
+
let e = globalThis;
|
|
8
|
+
e.__graphqlFetchResponseCache?.clear(), e.__graphqlFetchPendingResponses?.clear(), e.__boffGraphQLResponseCache?.clear();
|
|
9
|
+
}, o = async (e, t, n) => {
|
|
7
10
|
let r = await i({
|
|
8
11
|
gateway: "workspace",
|
|
9
12
|
baseUrl: n,
|
|
@@ -13,8 +16,8 @@ var a = async (e, t, n) => {
|
|
|
13
16
|
});
|
|
14
17
|
if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
|
|
15
18
|
if (!r.data) throw Error("GraphQL response did not include data");
|
|
16
|
-
return r.data;
|
|
17
|
-
},
|
|
19
|
+
return /^\s*mutation\b/.test(e) && a(), r.data;
|
|
20
|
+
}, s = {
|
|
18
21
|
sites: ["ecoimpacthub", "sites"],
|
|
19
22
|
site: (e) => [
|
|
20
23
|
"ecoimpacthub",
|
|
@@ -47,90 +50,90 @@ var a = async (e, t, n) => {
|
|
|
47
50
|
"report",
|
|
48
51
|
e
|
|
49
52
|
]
|
|
50
|
-
},
|
|
53
|
+
}, c = {
|
|
51
54
|
limit: 50,
|
|
52
55
|
offset: 0
|
|
53
|
-
},
|
|
56
|
+
}, l = "\n id workspaceId name code type status description latitude longitude\n areaHectares country region createdAt updatedAt\n", u = "\n id workspaceId siteId name kind status hardwareId unit lastReadingAt installedAt\n createdAt updatedAt\n", d = "\n id workspaceId siteId sensorId parameter value unit source recordedAt isBreach notes\n createdAt updatedAt\n", f = "\n id workspaceId siteId parameter direction severity limitValue minValue maxValue unit\n isActive createdAt updatedAt\n", p = "\n id workspaceId commonName scientificName taxonGroup conservationStatus isPriority\n description createdAt updatedAt\n", m = "\n id workspaceId speciesId siteId method count observedAt latitude longitude observerId\n notes evidence { id } createdAt updatedAt\n", h = "\n id workspaceId name status description siteId targetHectares budgetAmount currency\n managerId startDate endDate completedAt createdAt updatedAt\n", g = "\n id workspaceId projectId type summary details quantity unit performedAt createdAt updatedAt\n", _ = "\n id workspaceId name scope activityUnit factorKgco2e source validYear isActive\n createdAt updatedAt\n", v = "\n id workspaceId siteId factorId scope status category activityValue activityUnit co2eKg\n periodStart notes createdAt updatedAt\n", y = "\n id workspaceId name status metric baselineYear baselineValue targetYear targetValue unit\n description createdAt updatedAt\n", b = "\n id workspaceId title framework status periodStart periodEnd summary publishedAt\n file { id } createdAt updatedAt\n", x = "\n id workspaceId reportId carbonEntryId label value unit category createdAt updatedAt\n", S = (t = {}) => {
|
|
54
57
|
let { apiGatewayUrl: r } = e();
|
|
55
58
|
return n({
|
|
56
|
-
queryKey: [...
|
|
57
|
-
queryFn: async () => (await
|
|
59
|
+
queryKey: [...s.sites, t],
|
|
60
|
+
queryFn: async () => (await o(`query EcoListSites($status: EcoSiteStatus, $type: EcoSiteType, $pagination: PaginationInput) {
|
|
58
61
|
ecoListSites(status: $status, type: $type, pagination: $pagination) {
|
|
59
|
-
items { ${
|
|
62
|
+
items { ${l} }
|
|
60
63
|
pageInfo { cursor hasMore }
|
|
61
64
|
}
|
|
62
65
|
}`, {
|
|
63
66
|
status: t.status,
|
|
64
67
|
type: t.type,
|
|
65
|
-
pagination: t.pagination ??
|
|
68
|
+
pagination: t.pagination ?? c
|
|
66
69
|
}, r)).ecoListSites
|
|
67
70
|
});
|
|
68
|
-
},
|
|
71
|
+
}, C = (t) => {
|
|
69
72
|
let { apiGatewayUrl: r } = e();
|
|
70
73
|
return n({
|
|
71
|
-
queryKey:
|
|
74
|
+
queryKey: s.site(t ?? ""),
|
|
72
75
|
enabled: !!t,
|
|
73
|
-
queryFn: async () => (await
|
|
76
|
+
queryFn: async () => (await o(`query EcoSite($id: ID!) {
|
|
74
77
|
ecoSite(id: $id) {
|
|
75
|
-
${
|
|
76
|
-
sensors { ${
|
|
77
|
-
thresholds { ${
|
|
78
|
+
${l}
|
|
79
|
+
sensors { ${u} }
|
|
80
|
+
thresholds { ${f} }
|
|
78
81
|
}
|
|
79
82
|
}`, { id: t }, r)).ecoSite
|
|
80
83
|
});
|
|
81
|
-
},
|
|
84
|
+
}, w = () => {
|
|
82
85
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
83
86
|
return t({
|
|
84
|
-
mutationFn: async (e) => (await
|
|
85
|
-
ecoCreateSite(input: $input) { ${
|
|
87
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateSite($input: EcoCreateSiteInput!) {
|
|
88
|
+
ecoCreateSite(input: $input) { ${l} }
|
|
86
89
|
}`, { input: e }, n)).ecoCreateSite,
|
|
87
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
90
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.sites })
|
|
88
91
|
});
|
|
89
|
-
},
|
|
92
|
+
}, T = () => {
|
|
90
93
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
91
94
|
return t({
|
|
92
|
-
mutationFn: async (e) => (await
|
|
93
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
95
|
+
mutationFn: async (e) => (await o("mutation EcoArchiveSite($id: ID!) { ecoArchiveSite(id: $id) }", { id: e }, n)).ecoArchiveSite,
|
|
96
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.sites })
|
|
94
97
|
});
|
|
95
|
-
},
|
|
98
|
+
}, E = (t = {}) => {
|
|
96
99
|
let { apiGatewayUrl: r } = e();
|
|
97
100
|
return n({
|
|
98
|
-
queryKey: [...
|
|
99
|
-
queryFn: async () => (await
|
|
100
|
-
ecoListSensors(siteId: $siteId, kind: $kind, status: $status) { ${
|
|
101
|
+
queryKey: [...s.sensors, t],
|
|
102
|
+
queryFn: async () => (await o(`query EcoListSensors($siteId: ID, $kind: EcoSensorKind, $status: EcoSensorStatus) {
|
|
103
|
+
ecoListSensors(siteId: $siteId, kind: $kind, status: $status) { ${u} }
|
|
101
104
|
}`, {
|
|
102
105
|
siteId: t.siteId,
|
|
103
106
|
kind: t.kind,
|
|
104
107
|
status: t.status
|
|
105
108
|
}, r)).ecoListSensors
|
|
106
109
|
});
|
|
107
|
-
},
|
|
110
|
+
}, D = () => {
|
|
108
111
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
109
112
|
return t({
|
|
110
|
-
mutationFn: async (e) => (await
|
|
111
|
-
ecoCreateSensor(input: $input) { ${
|
|
113
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateSensor($input: EcoCreateSensorInput!) {
|
|
114
|
+
ecoCreateSensor(input: $input) { ${u} }
|
|
112
115
|
}`, { input: e }, n)).ecoCreateSensor,
|
|
113
116
|
onSuccess: (e) => {
|
|
114
|
-
i.invalidateQueries({ queryKey:
|
|
117
|
+
i.invalidateQueries({ queryKey: s.sensors }), i.invalidateQueries({ queryKey: s.site(e.siteId) });
|
|
115
118
|
}
|
|
116
119
|
});
|
|
117
|
-
},
|
|
120
|
+
}, O = () => {
|
|
118
121
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
119
122
|
return t({
|
|
120
|
-
mutationFn: async (e) => (await
|
|
121
|
-
ecoSetSensorStatus(id: $id, status: $status) { ${
|
|
123
|
+
mutationFn: async (e) => (await o(`mutation EcoSetSensorStatus($id: ID!, $status: EcoSensorStatus!) {
|
|
124
|
+
ecoSetSensorStatus(id: $id, status: $status) { ${u} }
|
|
122
125
|
}`, e, n)).ecoSetSensorStatus,
|
|
123
126
|
onSuccess: (e) => {
|
|
124
|
-
i.invalidateQueries({ queryKey:
|
|
127
|
+
i.invalidateQueries({ queryKey: s.sensors }), i.invalidateQueries({ queryKey: s.site(e.siteId) });
|
|
125
128
|
}
|
|
126
129
|
});
|
|
127
|
-
},
|
|
130
|
+
}, k = (t = {}) => {
|
|
128
131
|
let { apiGatewayUrl: r } = e();
|
|
129
132
|
return n({
|
|
130
|
-
queryKey: [...
|
|
131
|
-
queryFn: async () => (await
|
|
133
|
+
queryKey: [...s.measurements, t],
|
|
134
|
+
queryFn: async () => (await o(`query EcoListMeasurements($siteId: ID, $sensorId: ID, $parameter: String, $breachesOnly: Boolean, $pagination: PaginationInput) {
|
|
132
135
|
ecoListMeasurements(siteId: $siteId, sensorId: $sensorId, parameter: $parameter, breachesOnly: $breachesOnly, pagination: $pagination) {
|
|
133
|
-
items { ${
|
|
136
|
+
items { ${d} }
|
|
134
137
|
pageInfo { cursor hasMore }
|
|
135
138
|
}
|
|
136
139
|
}`, {
|
|
@@ -138,313 +141,313 @@ var a = async (e, t, n) => {
|
|
|
138
141
|
sensorId: t.sensorId,
|
|
139
142
|
parameter: t.parameter,
|
|
140
143
|
breachesOnly: t.breachesOnly,
|
|
141
|
-
pagination: t.pagination ??
|
|
144
|
+
pagination: t.pagination ?? c
|
|
142
145
|
}, r)).ecoListMeasurements
|
|
143
146
|
});
|
|
144
|
-
},
|
|
147
|
+
}, A = () => {
|
|
145
148
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
146
149
|
return t({
|
|
147
|
-
mutationFn: async (e) => (await
|
|
148
|
-
ecoRecordMeasurement(input: $input) { ${
|
|
150
|
+
mutationFn: async (e) => (await o(`mutation EcoRecordMeasurement($input: EcoRecordMeasurementInput!) {
|
|
151
|
+
ecoRecordMeasurement(input: $input) { ${d} }
|
|
149
152
|
}`, { input: e }, n)).ecoRecordMeasurement,
|
|
150
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
153
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.measurements })
|
|
151
154
|
});
|
|
152
|
-
},
|
|
155
|
+
}, j = (t) => {
|
|
153
156
|
let { apiGatewayUrl: r } = e();
|
|
154
157
|
return n({
|
|
155
|
-
queryKey: [...
|
|
156
|
-
queryFn: async () => (await
|
|
157
|
-
ecoListThresholds(siteId: $siteId) { ${
|
|
158
|
+
queryKey: [...s.thresholds, t ?? "all"],
|
|
159
|
+
queryFn: async () => (await o(`query EcoListThresholds($siteId: ID) {
|
|
160
|
+
ecoListThresholds(siteId: $siteId) { ${f} }
|
|
158
161
|
}`, { siteId: t }, r)).ecoListThresholds
|
|
159
162
|
});
|
|
160
|
-
},
|
|
163
|
+
}, M = () => {
|
|
161
164
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
162
165
|
return t({
|
|
163
|
-
mutationFn: async (e) => (await
|
|
164
|
-
ecoCreateThreshold(input: $input) { ${
|
|
166
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateThreshold($input: EcoCreateThresholdInput!) {
|
|
167
|
+
ecoCreateThreshold(input: $input) { ${f} }
|
|
165
168
|
}`, { input: e }, n)).ecoCreateThreshold,
|
|
166
169
|
onSuccess: (e) => {
|
|
167
|
-
i.invalidateQueries({ queryKey:
|
|
170
|
+
i.invalidateQueries({ queryKey: s.thresholds }), i.invalidateQueries({ queryKey: s.site(e.siteId) });
|
|
168
171
|
}
|
|
169
172
|
});
|
|
170
|
-
},
|
|
173
|
+
}, N = () => {
|
|
171
174
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
172
175
|
return t({
|
|
173
|
-
mutationFn: async (e) => (await
|
|
174
|
-
ecoSetThresholdActive(id: $id, isActive: $isActive) { ${
|
|
176
|
+
mutationFn: async (e) => (await o(`mutation EcoSetThresholdActive($id: ID!, $isActive: Boolean!) {
|
|
177
|
+
ecoSetThresholdActive(id: $id, isActive: $isActive) { ${f} }
|
|
175
178
|
}`, e, n)).ecoSetThresholdActive,
|
|
176
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
179
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.thresholds })
|
|
177
180
|
});
|
|
178
|
-
},
|
|
181
|
+
}, P = (t = {}) => {
|
|
179
182
|
let { apiGatewayUrl: r } = e();
|
|
180
183
|
return n({
|
|
181
|
-
queryKey: [...
|
|
182
|
-
queryFn: async () => (await
|
|
184
|
+
queryKey: [...s.species, t],
|
|
185
|
+
queryFn: async () => (await o(`query EcoListSpecies($taxonGroup: EcoTaxonGroup, $conservationStatus: EcoConservationStatus, $priorityOnly: Boolean, $pagination: PaginationInput) {
|
|
183
186
|
ecoListSpecies(taxonGroup: $taxonGroup, conservationStatus: $conservationStatus, priorityOnly: $priorityOnly, pagination: $pagination) {
|
|
184
|
-
items { ${
|
|
187
|
+
items { ${p} }
|
|
185
188
|
pageInfo { cursor hasMore }
|
|
186
189
|
}
|
|
187
190
|
}`, {
|
|
188
191
|
taxonGroup: t.taxonGroup,
|
|
189
192
|
conservationStatus: t.conservationStatus,
|
|
190
193
|
priorityOnly: t.priorityOnly,
|
|
191
|
-
pagination: t.pagination ??
|
|
194
|
+
pagination: t.pagination ?? c
|
|
192
195
|
}, r)).ecoListSpecies
|
|
193
196
|
});
|
|
194
|
-
},
|
|
197
|
+
}, F = (t) => {
|
|
195
198
|
let { apiGatewayUrl: r } = e();
|
|
196
199
|
return n({
|
|
197
|
-
queryKey:
|
|
200
|
+
queryKey: s.speciesOne(t ?? ""),
|
|
198
201
|
enabled: !!t,
|
|
199
|
-
queryFn: async () => (await
|
|
202
|
+
queryFn: async () => (await o(`query EcoSpeciesDetail($id: ID!) {
|
|
200
203
|
ecoSpecies(id: $id) {
|
|
201
|
-
${
|
|
202
|
-
observations { ${
|
|
204
|
+
${p}
|
|
205
|
+
observations { ${m} }
|
|
203
206
|
}
|
|
204
207
|
}`, { id: t }, r)).ecoSpecies
|
|
205
208
|
});
|
|
206
|
-
},
|
|
209
|
+
}, I = () => {
|
|
207
210
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
208
211
|
return t({
|
|
209
|
-
mutationFn: async (e) => (await
|
|
210
|
-
ecoCreateSpecies(input: $input) { ${
|
|
212
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateSpecies($input: EcoCreateSpeciesInput!) {
|
|
213
|
+
ecoCreateSpecies(input: $input) { ${p} }
|
|
211
214
|
}`, { input: e }, n)).ecoCreateSpecies,
|
|
212
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
215
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.species })
|
|
213
216
|
});
|
|
214
|
-
},
|
|
217
|
+
}, L = () => {
|
|
215
218
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
216
219
|
return t({
|
|
217
|
-
mutationFn: async (e) => (await
|
|
218
|
-
ecoUpdateSpecies(id: $id, input: $input) { ${
|
|
220
|
+
mutationFn: async (e) => (await o(`mutation EcoUpdateSpecies($id: ID!, $input: EcoUpdateSpeciesInput!) {
|
|
221
|
+
ecoUpdateSpecies(id: $id, input: $input) { ${p} }
|
|
219
222
|
}`, e, n)).ecoUpdateSpecies,
|
|
220
223
|
onSuccess: (e) => {
|
|
221
|
-
i.invalidateQueries({ queryKey:
|
|
224
|
+
i.invalidateQueries({ queryKey: s.species }), i.invalidateQueries({ queryKey: s.speciesOne(e.id) });
|
|
222
225
|
}
|
|
223
226
|
});
|
|
224
|
-
},
|
|
227
|
+
}, ee = () => {
|
|
225
228
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
226
229
|
return t({
|
|
227
|
-
mutationFn: async (e) => (await
|
|
228
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
230
|
+
mutationFn: async (e) => (await o("mutation EcoArchiveSpecies($id: ID!) { ecoArchiveSpecies(id: $id) }", { id: e }, n)).ecoArchiveSpecies,
|
|
231
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.species })
|
|
229
232
|
});
|
|
230
|
-
},
|
|
233
|
+
}, R = (t = {}) => {
|
|
231
234
|
let { apiGatewayUrl: r } = e();
|
|
232
235
|
return n({
|
|
233
|
-
queryKey: [...
|
|
234
|
-
queryFn: async () => (await
|
|
236
|
+
queryKey: [...s.observations, t],
|
|
237
|
+
queryFn: async () => (await o(`query EcoListObservations($speciesId: ID, $siteId: ID, $pagination: PaginationInput) {
|
|
235
238
|
ecoListObservations(speciesId: $speciesId, siteId: $siteId, pagination: $pagination) {
|
|
236
|
-
items { ${
|
|
239
|
+
items { ${m} species { id commonName scientificName taxonGroup } }
|
|
237
240
|
pageInfo { cursor hasMore }
|
|
238
241
|
}
|
|
239
242
|
}`, {
|
|
240
243
|
speciesId: t.speciesId,
|
|
241
244
|
siteId: t.siteId,
|
|
242
|
-
pagination: t.pagination ??
|
|
245
|
+
pagination: t.pagination ?? c
|
|
243
246
|
}, r)).ecoListObservations
|
|
244
247
|
});
|
|
245
|
-
},
|
|
248
|
+
}, z = () => {
|
|
246
249
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
247
250
|
return t({
|
|
248
|
-
mutationFn: async (e) => (await
|
|
249
|
-
ecoRecordObservation(input: $input) { ${
|
|
251
|
+
mutationFn: async (e) => (await o(`mutation EcoRecordObservation($input: EcoRecordObservationInput!) {
|
|
252
|
+
ecoRecordObservation(input: $input) { ${m} }
|
|
250
253
|
}`, { input: e }, n)).ecoRecordObservation,
|
|
251
254
|
onSuccess: (e) => {
|
|
252
|
-
i.invalidateQueries({ queryKey:
|
|
255
|
+
i.invalidateQueries({ queryKey: s.observations }), i.invalidateQueries({ queryKey: s.speciesOne(e.speciesId) });
|
|
253
256
|
}
|
|
254
257
|
});
|
|
255
|
-
},
|
|
258
|
+
}, B = (t) => {
|
|
256
259
|
let { apiGatewayUrl: r } = e();
|
|
257
260
|
return n({
|
|
258
|
-
queryKey: [...
|
|
259
|
-
queryFn: async () => (await
|
|
260
|
-
ecoListHabitatProjects(status: $status) { ${
|
|
261
|
+
queryKey: [...s.habitatProjects, t ?? "all"],
|
|
262
|
+
queryFn: async () => (await o(`query EcoListHabitatProjects($status: EcoHabitatProjectStatus) {
|
|
263
|
+
ecoListHabitatProjects(status: $status) { ${h} }
|
|
261
264
|
}`, { status: t }, r)).ecoListHabitatProjects
|
|
262
265
|
});
|
|
263
|
-
},
|
|
266
|
+
}, V = (t) => {
|
|
264
267
|
let { apiGatewayUrl: r } = e();
|
|
265
268
|
return n({
|
|
266
|
-
queryKey:
|
|
269
|
+
queryKey: s.habitatProject(t ?? ""),
|
|
267
270
|
enabled: !!t,
|
|
268
|
-
queryFn: async () => (await
|
|
271
|
+
queryFn: async () => (await o(`query EcoHabitatProject($id: ID!) {
|
|
269
272
|
ecoHabitatProject(id: $id) {
|
|
270
|
-
${
|
|
271
|
-
activities { ${
|
|
273
|
+
${h}
|
|
274
|
+
activities { ${g} }
|
|
272
275
|
}
|
|
273
276
|
}`, { id: t }, r)).ecoHabitatProject
|
|
274
277
|
});
|
|
275
|
-
},
|
|
278
|
+
}, H = () => {
|
|
276
279
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
277
280
|
return t({
|
|
278
|
-
mutationFn: async (e) => (await
|
|
279
|
-
ecoCreateHabitatProject(input: $input) { ${
|
|
281
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateHabitatProject($input: EcoCreateHabitatProjectInput!) {
|
|
282
|
+
ecoCreateHabitatProject(input: $input) { ${h} }
|
|
280
283
|
}`, { input: e }, n)).ecoCreateHabitatProject,
|
|
281
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
284
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.habitatProjects })
|
|
282
285
|
});
|
|
283
|
-
},
|
|
286
|
+
}, U = () => {
|
|
284
287
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
285
288
|
return t({
|
|
286
|
-
mutationFn: async (e) => (await
|
|
287
|
-
ecoTransitionHabitatProject(id: $id, status: $status) { ${
|
|
289
|
+
mutationFn: async (e) => (await o(`mutation EcoTransitionHabitatProject($id: ID!, $status: EcoHabitatProjectStatus!) {
|
|
290
|
+
ecoTransitionHabitatProject(id: $id, status: $status) { ${h} }
|
|
288
291
|
}`, e, n)).ecoTransitionHabitatProject,
|
|
289
292
|
onSuccess: (e) => {
|
|
290
|
-
i.invalidateQueries({ queryKey:
|
|
293
|
+
i.invalidateQueries({ queryKey: s.habitatProjects }), i.invalidateQueries({ queryKey: s.habitatProject(e.id) });
|
|
291
294
|
}
|
|
292
295
|
});
|
|
293
|
-
},
|
|
296
|
+
}, W = () => {
|
|
294
297
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
295
298
|
return t({
|
|
296
|
-
mutationFn: async (e) => (await
|
|
297
|
-
ecoLogRestorationActivity(input: $input) { ${
|
|
299
|
+
mutationFn: async (e) => (await o(`mutation EcoLogRestorationActivity($input: EcoLogRestorationActivityInput!) {
|
|
300
|
+
ecoLogRestorationActivity(input: $input) { ${g} }
|
|
298
301
|
}`, { input: e }, n)).ecoLogRestorationActivity,
|
|
299
|
-
onSuccess: (e) => i.invalidateQueries({ queryKey:
|
|
302
|
+
onSuccess: (e) => i.invalidateQueries({ queryKey: s.habitatProject(e.projectId) })
|
|
300
303
|
});
|
|
301
|
-
},
|
|
304
|
+
}, G = (t, r) => {
|
|
302
305
|
let { apiGatewayUrl: i } = e();
|
|
303
306
|
return n({
|
|
304
307
|
queryKey: [
|
|
305
|
-
...
|
|
308
|
+
...s.emissionFactors,
|
|
306
309
|
t ?? "all",
|
|
307
310
|
r ?? !1
|
|
308
311
|
],
|
|
309
|
-
queryFn: async () => (await
|
|
310
|
-
ecoListEmissionFactors(scope: $scope, activeOnly: $activeOnly) { ${
|
|
312
|
+
queryFn: async () => (await o(`query EcoListEmissionFactors($scope: EcoEmissionScope, $activeOnly: Boolean) {
|
|
313
|
+
ecoListEmissionFactors(scope: $scope, activeOnly: $activeOnly) { ${_} }
|
|
311
314
|
}`, {
|
|
312
315
|
scope: t,
|
|
313
316
|
activeOnly: r
|
|
314
317
|
}, i)).ecoListEmissionFactors
|
|
315
318
|
});
|
|
316
|
-
},
|
|
319
|
+
}, K = () => {
|
|
317
320
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
318
321
|
return t({
|
|
319
|
-
mutationFn: async (e) => (await
|
|
320
|
-
ecoCreateEmissionFactor(input: $input) { ${
|
|
322
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateEmissionFactor($input: EcoCreateEmissionFactorInput!) {
|
|
323
|
+
ecoCreateEmissionFactor(input: $input) { ${_} }
|
|
321
324
|
}`, { input: e }, n)).ecoCreateEmissionFactor,
|
|
322
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
325
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.emissionFactors })
|
|
323
326
|
});
|
|
324
|
-
},
|
|
327
|
+
}, q = (t = {}) => {
|
|
325
328
|
let { apiGatewayUrl: r } = e();
|
|
326
329
|
return n({
|
|
327
|
-
queryKey: [...
|
|
328
|
-
queryFn: async () => (await
|
|
330
|
+
queryKey: [...s.carbonEntries, t],
|
|
331
|
+
queryFn: async () => (await o(`query EcoListCarbonEntries($scope: EcoEmissionScope, $siteId: ID, $status: EcoCarbonEntryStatus, $pagination: PaginationInput) {
|
|
329
332
|
ecoListCarbonEntries(scope: $scope, siteId: $siteId, status: $status, pagination: $pagination) {
|
|
330
|
-
items { ${
|
|
333
|
+
items { ${v} factor { id name factorKgco2e activityUnit } }
|
|
331
334
|
pageInfo { cursor hasMore }
|
|
332
335
|
}
|
|
333
336
|
}`, {
|
|
334
337
|
scope: t.scope,
|
|
335
338
|
siteId: t.siteId,
|
|
336
339
|
status: t.status,
|
|
337
|
-
pagination: t.pagination ??
|
|
340
|
+
pagination: t.pagination ?? c
|
|
338
341
|
}, r)).ecoListCarbonEntries
|
|
339
342
|
});
|
|
340
|
-
},
|
|
343
|
+
}, J = (t) => {
|
|
341
344
|
let { apiGatewayUrl: r } = e();
|
|
342
345
|
return n({
|
|
343
|
-
queryKey: [...
|
|
344
|
-
queryFn: async () => await
|
|
346
|
+
queryKey: [...s.carbonTotals, t ?? "all"],
|
|
347
|
+
queryFn: async () => await o("query EcoCarbonTotals($siteId: ID) {\n total: ecoCarbonTotalKg(siteId: $siteId)\n scope1: ecoCarbonTotalKg(scope: SCOPE_1, siteId: $siteId)\n scope2: ecoCarbonTotalKg(scope: SCOPE_2, siteId: $siteId)\n scope3: ecoCarbonTotalKg(scope: SCOPE_3, siteId: $siteId)\n }", { siteId: t }, r)
|
|
345
348
|
});
|
|
346
|
-
},
|
|
349
|
+
}, Y = () => {
|
|
347
350
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
348
351
|
return t({
|
|
349
|
-
mutationFn: async (e) => (await
|
|
350
|
-
ecoRecordCarbonEntry(input: $input) { ${
|
|
352
|
+
mutationFn: async (e) => (await o(`mutation EcoRecordCarbonEntry($input: EcoRecordCarbonEntryInput!) {
|
|
353
|
+
ecoRecordCarbonEntry(input: $input) { ${v} }
|
|
351
354
|
}`, { input: e }, n)).ecoRecordCarbonEntry,
|
|
352
355
|
onSuccess: () => {
|
|
353
|
-
i.invalidateQueries({ queryKey:
|
|
356
|
+
i.invalidateQueries({ queryKey: s.carbonEntries }), i.invalidateQueries({ queryKey: s.carbonTotals });
|
|
354
357
|
}
|
|
355
358
|
});
|
|
356
|
-
},
|
|
359
|
+
}, X = () => {
|
|
357
360
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
358
361
|
return t({
|
|
359
|
-
mutationFn: async (e) => (await
|
|
360
|
-
ecoVerifyCarbonEntry(id: $id) { ${
|
|
362
|
+
mutationFn: async (e) => (await o(`mutation EcoVerifyCarbonEntry($id: ID!) {
|
|
363
|
+
ecoVerifyCarbonEntry(id: $id) { ${v} }
|
|
361
364
|
}`, { id: e }, n)).ecoVerifyCarbonEntry,
|
|
362
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
365
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.carbonEntries })
|
|
363
366
|
});
|
|
364
|
-
},
|
|
367
|
+
}, Z = (t) => {
|
|
365
368
|
let { apiGatewayUrl: r } = e();
|
|
366
369
|
return n({
|
|
367
|
-
queryKey: [...
|
|
368
|
-
queryFn: async () => (await
|
|
369
|
-
ecoListReductionTargets(status: $status) { ${
|
|
370
|
+
queryKey: [...s.reductionTargets, t ?? "all"],
|
|
371
|
+
queryFn: async () => (await o(`query EcoListReductionTargets($status: EcoReductionTargetStatus) {
|
|
372
|
+
ecoListReductionTargets(status: $status) { ${y} }
|
|
370
373
|
}`, { status: t }, r)).ecoListReductionTargets
|
|
371
374
|
});
|
|
372
|
-
},
|
|
375
|
+
}, Q = () => {
|
|
373
376
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
374
377
|
return t({
|
|
375
|
-
mutationFn: async (e) => (await
|
|
376
|
-
ecoCreateReductionTarget(input: $input) { ${
|
|
378
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateReductionTarget($input: EcoCreateReductionTargetInput!) {
|
|
379
|
+
ecoCreateReductionTarget(input: $input) { ${y} }
|
|
377
380
|
}`, { input: e }, n)).ecoCreateReductionTarget,
|
|
378
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
381
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.reductionTargets })
|
|
379
382
|
});
|
|
380
|
-
},
|
|
383
|
+
}, $ = () => {
|
|
381
384
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
382
385
|
return t({
|
|
383
|
-
mutationFn: async (e) => (await
|
|
384
|
-
ecoSetReductionTargetStatus(id: $id, status: $status) { ${
|
|
386
|
+
mutationFn: async (e) => (await o(`mutation EcoSetReductionTargetStatus($id: ID!, $status: EcoReductionTargetStatus!) {
|
|
387
|
+
ecoSetReductionTargetStatus(id: $id, status: $status) { ${y} }
|
|
385
388
|
}`, e, n)).ecoSetReductionTargetStatus,
|
|
386
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
389
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.reductionTargets })
|
|
387
390
|
});
|
|
388
|
-
},
|
|
391
|
+
}, te = (t, r) => {
|
|
389
392
|
let { apiGatewayUrl: i } = e();
|
|
390
393
|
return n({
|
|
391
394
|
queryKey: [
|
|
392
|
-
...
|
|
395
|
+
...s.reports,
|
|
393
396
|
t ?? "all",
|
|
394
|
-
r ??
|
|
397
|
+
r ?? c
|
|
395
398
|
],
|
|
396
|
-
queryFn: async () => (await
|
|
399
|
+
queryFn: async () => (await o(`query EcoListReports($status: EcoReportStatus, $pagination: PaginationInput) {
|
|
397
400
|
ecoListReports(status: $status, pagination: $pagination) {
|
|
398
|
-
items { ${
|
|
401
|
+
items { ${b} }
|
|
399
402
|
pageInfo { cursor hasMore }
|
|
400
403
|
}
|
|
401
404
|
}`, {
|
|
402
405
|
status: t,
|
|
403
|
-
pagination: r ??
|
|
406
|
+
pagination: r ?? c
|
|
404
407
|
}, i)).ecoListReports
|
|
405
408
|
});
|
|
406
|
-
},
|
|
409
|
+
}, ne = (t) => {
|
|
407
410
|
let { apiGatewayUrl: r } = e();
|
|
408
411
|
return n({
|
|
409
|
-
queryKey:
|
|
412
|
+
queryKey: s.report(t ?? ""),
|
|
410
413
|
enabled: !!t,
|
|
411
|
-
queryFn: async () => (await
|
|
414
|
+
queryFn: async () => (await o(`query EcoReport($id: ID!) {
|
|
412
415
|
ecoReport(id: $id) {
|
|
413
|
-
${
|
|
414
|
-
lineItems { ${
|
|
416
|
+
${b}
|
|
417
|
+
lineItems { ${x} }
|
|
415
418
|
}
|
|
416
419
|
}`, { id: t }, r)).ecoReport
|
|
417
420
|
});
|
|
418
|
-
},
|
|
421
|
+
}, re = () => {
|
|
419
422
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
420
423
|
return t({
|
|
421
|
-
mutationFn: async (e) => (await
|
|
422
|
-
ecoCreateReport(input: $input) { ${
|
|
424
|
+
mutationFn: async (e) => (await o(`mutation EcoCreateReport($input: EcoCreateReportInput!) {
|
|
425
|
+
ecoCreateReport(input: $input) { ${b} }
|
|
423
426
|
}`, { input: e }, n)).ecoCreateReport,
|
|
424
|
-
onSuccess: () => i.invalidateQueries({ queryKey:
|
|
427
|
+
onSuccess: () => i.invalidateQueries({ queryKey: s.reports })
|
|
425
428
|
});
|
|
426
|
-
},
|
|
429
|
+
}, ie = () => {
|
|
427
430
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
428
431
|
return t({
|
|
429
|
-
mutationFn: async (e) => (await
|
|
430
|
-
ecoAddReportLineItem(input: $input) { ${
|
|
432
|
+
mutationFn: async (e) => (await o(`mutation EcoAddReportLineItem($input: EcoAddReportLineItemInput!) {
|
|
433
|
+
ecoAddReportLineItem(input: $input) { ${x} }
|
|
431
434
|
}`, { input: e }, n)).ecoAddReportLineItem,
|
|
432
435
|
onSuccess: (e) => {
|
|
433
|
-
i.invalidateQueries({ queryKey:
|
|
436
|
+
i.invalidateQueries({ queryKey: s.reports }), i.invalidateQueries({ queryKey: s.report(e.reportId) });
|
|
434
437
|
}
|
|
435
438
|
});
|
|
436
|
-
},
|
|
439
|
+
}, ae = () => {
|
|
437
440
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
438
441
|
return t({
|
|
439
|
-
mutationFn: async (e) => (await
|
|
440
|
-
ecoPublishReport(id: $id, fileId: $fileId) { ${
|
|
442
|
+
mutationFn: async (e) => (await o(`mutation EcoPublishReport($id: ID!, $fileId: ID) {
|
|
443
|
+
ecoPublishReport(id: $id, fileId: $fileId) { ${b} }
|
|
441
444
|
}`, e, n)).ecoPublishReport,
|
|
442
445
|
onSuccess: (e) => {
|
|
443
|
-
i.invalidateQueries({ queryKey:
|
|
446
|
+
i.invalidateQueries({ queryKey: s.reports }), i.invalidateQueries({ queryKey: s.report(e.id) });
|
|
444
447
|
}
|
|
445
448
|
});
|
|
446
449
|
};
|
|
447
450
|
//#endregion
|
|
448
|
-
export {
|
|
451
|
+
export { ie as useEcoAddReportLineItem, T as useEcoArchiveSite, ee as useEcoArchiveSpecies, q as useEcoCarbonEntries, J as useEcoCarbonTotals, K as useEcoCreateEmissionFactor, H as useEcoCreateHabitatProject, Q as useEcoCreateReductionTarget, re as useEcoCreateReport, D as useEcoCreateSensor, w as useEcoCreateSite, I as useEcoCreateSpecies, M as useEcoCreateThreshold, G as useEcoEmissionFactors, V as useEcoHabitatProject, B as useEcoHabitatProjects, W as useEcoLogRestorationActivity, k as useEcoMeasurements, R as useEcoObservations, ae as useEcoPublishReport, Y as useEcoRecordCarbonEntry, A as useEcoRecordMeasurement, z as useEcoRecordObservation, Z as useEcoReductionTargets, ne as useEcoReport, te as useEcoReports, E as useEcoSensors, $ as useEcoSetReductionTargetStatus, O as useEcoSetSensorStatus, N as useEcoSetThresholdActive, C as useEcoSite, S as useEcoSites, P as useEcoSpecies, F as useEcoSpeciesDetail, j as useEcoThresholds, U as useEcoTransitionHabitatProject, L as useEcoUpdateSpecies, X as useEcoVerifyCarbonEntry };
|
|
449
452
|
|
|
450
453
|
//# sourceMappingURL=useEcoImpactHubApi.js.map
|