@burdenoff/microfe-theglobalfuel 2026.528.1 → 2026.704.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/dev/main.d.ts +2 -0
  2. package/dist/dev/main.d.ts.map +1 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +6 -4
  6. package/dist/node_modules/{clsx → .bun/clsx@2.1.1/node_modules/clsx}/dist/clsx.js +1 -1
  7. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
  8. package/dist/node_modules/{tailwind-merge → .bun/tailwind-merge@3.5.0/node_modules/tailwind-merge}/dist/bundle-mjs.js +170 -212
  9. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  10. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +5 -0
  11. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -0
  12. package/dist/theglobalfuel/TheGlobalFuelRoot.js +109 -161
  13. package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
  14. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +4 -0
  15. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -0
  16. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +70 -85
  17. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
  18. package/dist/theglobalfuel/components/DataTable.d.ts +28 -0
  19. package/dist/theglobalfuel/components/DataTable.d.ts.map +1 -0
  20. package/dist/theglobalfuel/components/DataTable.js +71 -0
  21. package/dist/theglobalfuel/components/DataTable.js.map +1 -0
  22. package/dist/theglobalfuel/components/EmptyState.d.ts +18 -0
  23. package/dist/theglobalfuel/components/EmptyState.d.ts.map +1 -0
  24. package/dist/theglobalfuel/components/EmptyState.js +35 -0
  25. package/dist/theglobalfuel/components/EmptyState.js.map +1 -0
  26. package/dist/theglobalfuel/components/EvidenceUpload.d.ts +14 -0
  27. package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +1 -0
  28. package/dist/theglobalfuel/components/EvidenceUpload.js +93 -0
  29. package/dist/theglobalfuel/components/EvidenceUpload.js.map +1 -0
  30. package/dist/theglobalfuel/components/FileLink.d.ts +15 -0
  31. package/dist/theglobalfuel/components/FileLink.d.ts.map +1 -0
  32. package/dist/theglobalfuel/components/FileLink.js +36 -0
  33. package/dist/theglobalfuel/components/FileLink.js.map +1 -0
  34. package/dist/theglobalfuel/components/FilterTabs.d.ts +18 -0
  35. package/dist/theglobalfuel/components/FilterTabs.d.ts.map +1 -0
  36. package/dist/theglobalfuel/components/FilterTabs.js +27 -0
  37. package/dist/theglobalfuel/components/FilterTabs.js.map +1 -0
  38. package/dist/theglobalfuel/components/MetricsCard.d.ts +23 -0
  39. package/dist/theglobalfuel/components/MetricsCard.d.ts.map +1 -0
  40. package/dist/theglobalfuel/components/MetricsCard.js +64 -0
  41. package/dist/theglobalfuel/components/MetricsCard.js.map +1 -0
  42. package/dist/theglobalfuel/components/MiniBar.d.ts +16 -0
  43. package/dist/theglobalfuel/components/MiniBar.d.ts.map +1 -0
  44. package/dist/theglobalfuel/components/MiniBar.js +22 -0
  45. package/dist/theglobalfuel/components/MiniBar.js.map +1 -0
  46. package/dist/theglobalfuel/components/PageLayout.d.ts +16 -0
  47. package/dist/theglobalfuel/components/PageLayout.d.ts.map +1 -0
  48. package/dist/theglobalfuel/components/PageLayout.js +38 -0
  49. package/dist/theglobalfuel/components/PageLayout.js.map +1 -0
  50. package/dist/theglobalfuel/components/Pagination.d.ts +22 -0
  51. package/dist/theglobalfuel/components/Pagination.d.ts.map +1 -0
  52. package/dist/theglobalfuel/components/Pagination.js +50 -0
  53. package/dist/theglobalfuel/components/Pagination.js.map +1 -0
  54. package/dist/theglobalfuel/components/StateViews.d.ts +24 -0
  55. package/dist/theglobalfuel/components/StateViews.d.ts.map +1 -0
  56. package/dist/theglobalfuel/components/StateViews.js +49 -0
  57. package/dist/theglobalfuel/components/StateViews.js.map +1 -0
  58. package/dist/theglobalfuel/components/StatusBadge.d.ts +9 -0
  59. package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -0
  60. package/dist/theglobalfuel/components/StatusBadge.js +73 -0
  61. package/dist/theglobalfuel/components/StatusBadge.js.map +1 -0
  62. package/dist/theglobalfuel/components/Tabs.d.ts +17 -0
  63. package/dist/theglobalfuel/components/Tabs.d.ts.map +1 -0
  64. package/dist/theglobalfuel/components/Tabs.js +31 -0
  65. package/dist/theglobalfuel/components/Tabs.js.map +1 -0
  66. package/dist/theglobalfuel/components/TheDiscussion.d.ts +18 -0
  67. package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +1 -0
  68. package/dist/theglobalfuel/components/TheDiscussion.js +109 -0
  69. package/dist/theglobalfuel/components/TheDiscussion.js.map +1 -0
  70. package/dist/theglobalfuel/components/TheTags.d.ts +17 -0
  71. package/dist/theglobalfuel/components/TheTags.d.ts.map +1 -0
  72. package/dist/theglobalfuel/components/TheTags.js +149 -0
  73. package/dist/theglobalfuel/components/TheTags.js.map +1 -0
  74. package/dist/theglobalfuel/components/index.d.ts +19 -0
  75. package/dist/theglobalfuel/components/index.d.ts.map +1 -0
  76. package/dist/theglobalfuel/components/index.js +14 -0
  77. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +16 -0
  78. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +1 -0
  79. package/dist/theglobalfuel/context/TheGlobalFuelContext.js +85 -0
  80. package/dist/theglobalfuel/context/TheGlobalFuelContext.js.map +1 -0
  81. package/dist/theglobalfuel/context/index.d.ts +6 -0
  82. package/dist/theglobalfuel/context/index.d.ts.map +1 -0
  83. package/dist/theglobalfuel/context/index.js +1 -0
  84. package/dist/theglobalfuel/hooks/index.d.ts +10 -0
  85. package/dist/theglobalfuel/hooks/index.d.ts.map +1 -0
  86. package/dist/theglobalfuel/hooks/index.js +5 -0
  87. package/dist/theglobalfuel/hooks/useCursorPager.d.ts +33 -0
  88. package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +1 -0
  89. package/dist/theglobalfuel/hooks/useCursorPager.js +25 -0
  90. package/dist/theglobalfuel/hooks/useCursorPager.js.map +1 -0
  91. package/dist/theglobalfuel/hooks/useTheComments.d.ts +36 -0
  92. package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +1 -0
  93. package/dist/theglobalfuel/hooks/useTheComments.js +45 -0
  94. package/dist/theglobalfuel/hooks/useTheComments.js.map +1 -0
  95. package/dist/theglobalfuel/hooks/useTheFiles.d.ts +47 -0
  96. package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +1 -0
  97. package/dist/theglobalfuel/hooks/useTheFiles.js +81 -0
  98. package/dist/theglobalfuel/hooks/useTheFiles.js.map +1 -0
  99. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +75 -0
  100. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -0
  101. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +353 -0
  102. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -0
  103. package/dist/theglobalfuel/hooks/useTheTags.d.ts +44 -0
  104. package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +1 -0
  105. package/dist/theglobalfuel/hooks/useTheTags.js +89 -0
  106. package/dist/theglobalfuel/hooks/useTheTags.js.map +1 -0
  107. package/dist/theglobalfuel/index.d.ts +9 -0
  108. package/dist/theglobalfuel/index.d.ts.map +1 -0
  109. package/dist/theglobalfuel/index.js +5 -2
  110. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +13 -0
  111. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +1 -0
  112. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +869 -0
  113. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -0
  114. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +10 -0
  115. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +1 -0
  116. package/dist/theglobalfuel/pages/assets/AssetsPage.js +547 -0
  117. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -0
  118. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +11 -0
  119. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +1 -0
  120. package/dist/theglobalfuel/pages/compliance/CompliancePage.js +511 -0
  121. package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -0
  122. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +9 -0
  123. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +1 -0
  124. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +878 -0
  125. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -0
  126. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +8 -0
  127. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +1 -0
  128. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +588 -0
  129. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -0
  130. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +13 -0
  131. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +1 -0
  132. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +507 -0
  133. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -0
  134. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +12 -0
  135. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +1 -0
  136. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +479 -0
  137. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -0
  138. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +11 -0
  139. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +1 -0
  140. package/dist/theglobalfuel/pages/inventory/InventoryPage.js +592 -0
  141. package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -0
  142. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +11 -0
  143. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +1 -0
  144. package/dist/theglobalfuel/pages/production/ProductionPage.js +421 -0
  145. package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -0
  146. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +10 -0
  147. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +1 -0
  148. package/dist/theglobalfuel/pages/reserves/ReservesPage.js +439 -0
  149. package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -0
  150. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +10 -0
  151. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +1 -0
  152. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +550 -0
  153. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -0
  154. package/dist/theglobalfuel/types/index.d.ts +376 -0
  155. package/dist/theglobalfuel/types/index.d.ts.map +1 -0
  156. package/dist/theglobalfuel/utils/cn.d.ts +4 -0
  157. package/dist/theglobalfuel/utils/cn.d.ts.map +1 -0
  158. package/dist/theglobalfuel/utils/cn.js +2 -2
  159. package/dist/theglobalfuel/utils/formatters.d.ts +36 -0
  160. package/dist/theglobalfuel/utils/formatters.d.ts.map +1 -0
  161. package/dist/theglobalfuel/utils/formatters.js +94 -0
  162. package/dist/theglobalfuel/utils/formatters.js.map +1 -0
  163. package/dist/theglobalfuel/utils/i18n.d.ts +6 -0
  164. package/dist/theglobalfuel/utils/i18n.d.ts.map +1 -0
  165. package/dist/theglobalfuel/utils/index.d.ts +9 -0
  166. package/dist/theglobalfuel/utils/index.d.ts.map +1 -0
  167. package/dist/theglobalfuel/utils/navigation.d.ts +14 -0
  168. package/dist/theglobalfuel/utils/navigation.d.ts.map +1 -0
  169. package/dist/theglobalfuel/utils/navigation.js +2 -1
  170. package/dist/theglobalfuel/utils/navigation.js.map +1 -1
  171. package/package.json +3 -3
  172. package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
  173. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  174. package/dist/theglobalfuel/pages/AiIntelligencePage.js +0 -190
  175. package/dist/theglobalfuel/pages/AiIntelligencePage.js.map +0 -1
  176. package/dist/theglobalfuel/pages/AnalyticsPage.js +0 -241
  177. package/dist/theglobalfuel/pages/AnalyticsPage.js.map +0 -1
  178. package/dist/theglobalfuel/pages/CompliancePage.js +0 -173
  179. package/dist/theglobalfuel/pages/CompliancePage.js.map +0 -1
  180. package/dist/theglobalfuel/pages/DashboardPage.js +0 -145
  181. package/dist/theglobalfuel/pages/DashboardPage.js.map +0 -1
  182. package/dist/theglobalfuel/pages/FinancialPage.js +0 -204
  183. package/dist/theglobalfuel/pages/FinancialPage.js.map +0 -1
  184. package/dist/theglobalfuel/pages/FleetManagementPage.js +0 -244
  185. package/dist/theglobalfuel/pages/FleetManagementPage.js.map +0 -1
  186. package/dist/theglobalfuel/pages/MarketplacePage.js +0 -260
  187. package/dist/theglobalfuel/pages/MarketplacePage.js.map +0 -1
  188. package/dist/theglobalfuel/pages/OperationsPage.js +0 -190
  189. package/dist/theglobalfuel/pages/OperationsPage.js.map +0 -1
  190. package/dist/theglobalfuel/pages/QualityControlPage.js +0 -215
  191. package/dist/theglobalfuel/pages/QualityControlPage.js.map +0 -1
  192. package/dist/theglobalfuel/pages/ReportsPage.js +0 -247
  193. package/dist/theglobalfuel/pages/ReportsPage.js.map +0 -1
  194. package/dist/theglobalfuel/pages/ResourcesPage.js +0 -225
  195. package/dist/theglobalfuel/pages/ResourcesPage.js.map +0 -1
  196. package/dist/theglobalfuel/pages/RiskManagementPage.js +0 -230
  197. package/dist/theglobalfuel/pages/RiskManagementPage.js.map +0 -1
  198. package/dist/theglobalfuel/pages/SupplyChainPage.js +0 -214
  199. package/dist/theglobalfuel/pages/SupplyChainPage.js.map +0 -1
  200. package/dist/theglobalfuel/pages/SustainabilityPage.js +0 -261
  201. package/dist/theglobalfuel/pages/SustainabilityPage.js.map +0 -1
  202. package/dist/theglobalfuel/pages/TrainingPage.js +0 -253
  203. package/dist/theglobalfuel/pages/TrainingPage.js.map +0 -1
  204. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js +0 -27
  205. package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js.map +0 -1
  206. package/dist/theglobalfuel/store/theglobalfuelStore.js +0 -712
  207. package/dist/theglobalfuel/store/theglobalfuelStore.js.map +0 -1
  208. package/dist/theglobalfuel/utils/i18n.js +0 -15
  209. package/dist/theglobalfuel/utils/i18n.js.map +0 -1
@@ -0,0 +1,81 @@
1
+ import { useTheGlobalFuel as e } from "../context/TheGlobalFuelContext.js";
2
+ import "../context/index.js";
3
+ import { useCallback as t, useState as n } from "react";
4
+ import { useQuery as r } from "@tanstack/react-query";
5
+ import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
6
+ //#region src/theglobalfuel/hooks/useTheFiles.ts
7
+ var a = () => {
8
+ let e = globalThis;
9
+ e.__graphqlFetchResponseCache?.clear(), e.__graphqlFetchPendingResponses?.clear(), e.__boffGraphQLResponseCache?.clear();
10
+ }, o = async (e, t, n) => {
11
+ let r = await i({
12
+ gateway: "workspace",
13
+ baseUrl: n,
14
+ query: e,
15
+ variables: t,
16
+ workspaceToken: !0
17
+ });
18
+ if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
19
+ if (!r.data) throw Error("GraphQL response did not include data");
20
+ return /^\s*mutation\b/.test(e) && a(), r.data;
21
+ };
22
+ function s(e, t, n, r) {
23
+ return new Promise((i, a) => {
24
+ let o = new XMLHttpRequest();
25
+ o.open("PUT", e), o.setRequestHeader("Content-Type", n), o.upload.onprogress = (e) => {
26
+ e.lengthComputable && r(Math.round(e.loaded / e.total * 100));
27
+ }, o.onload = () => {
28
+ o.status >= 200 && o.status < 300 ? i() : a(/* @__PURE__ */ Error(`File storage rejected the upload (HTTP ${o.status}).`));
29
+ }, o.onerror = () => a(/* @__PURE__ */ Error("Network error while uploading the file.")), o.onabort = () => a(/* @__PURE__ */ Error("The upload was cancelled.")), o.send(t);
30
+ });
31
+ }
32
+ var c = () => {
33
+ let { apiGatewayUrl: r } = e(), [i, a] = n(!1), [c, l] = n(0), [u, d] = n(null), f = t(() => {
34
+ a(!1), l(0), d(null);
35
+ }, []);
36
+ return {
37
+ upload: t(async (e) => {
38
+ a(!0), l(0), d(null);
39
+ try {
40
+ let t = e.name.lastIndexOf("."), n = t > -1 ? e.name.slice(t + 1) : "", i = e.type || "application/octet-stream", a = await o("mutation TheInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }", { input: {
41
+ fileName: e.name,
42
+ extension: n,
43
+ mimeType: i,
44
+ fileSize: String(e.size),
45
+ visibility: "WORKSPACE"
46
+ } }, r), { uploadUrl: c } = a.initiateUpload, u = a.initiateUpload.session.id;
47
+ if (!c) throw Error("The file service did not return an upload URL.");
48
+ await s(c, e, i, l);
49
+ let d = await o("mutation TheCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }", { input: { sessionId: u } }, r);
50
+ return l(100), {
51
+ fileId: d.completeUpload.fileId,
52
+ fileName: d.completeUpload.file?.name ?? e.name
53
+ };
54
+ } catch (e) {
55
+ let t = e instanceof Error ? e.message : "The file could not be uploaded.";
56
+ throw d(t), e instanceof Error ? e : Error(t);
57
+ } finally {
58
+ a(!1);
59
+ }
60
+ }, [r]),
61
+ isUploading: i,
62
+ progress: c,
63
+ error: u,
64
+ reset: f
65
+ };
66
+ }, l = (t) => {
67
+ let { apiGatewayUrl: n } = e();
68
+ return r({
69
+ queryKey: [
70
+ "theglobalfuel",
71
+ "file",
72
+ t ?? ""
73
+ ],
74
+ enabled: !!t,
75
+ queryFn: async () => (await o("query TheGetFile($id: ID!) {\n getFile(id: $id) {\n id\n name\n downloadUrl\n mimeType\n size\n }\n }", { id: t }, n)).getFile
76
+ });
77
+ };
78
+ //#endregion
79
+ export { l as useTheFile, c as useTheFileUpload, o as wspaceFetch };
80
+
81
+ //# sourceMappingURL=useTheFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheFiles.js","names":[],"sources":["../../../src/theglobalfuel/hooks/useTheFiles.ts"],"sourcesContent":["/**\n * TheGlobalFuel — wspace-files-svc REUSE hooks (Integration A).\n * @module theglobalfuel/hooks/useTheFiles\n *\n * Reuses the platform file store (`wspace-files-svc`) WITHOUT any eco-svc\n * change: the theglobalfuel schema already exposes `TheObservation.evidenceFileId` /\n * `TheReport.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 `useTheGlobalFuelApi` exactly — `graphqlFetch({ gateway:\n * 'workspace', workspaceToken: true })` — so no ApolloProvider is required.\n * These hooks live in a SEPARATE file by design; `useTheGlobalFuelApi.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 { useTheGlobalFuel } 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 `useTheGlobalFuelApi` 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 UploadedTheFile {\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 UseTheFileUploadResult {\n upload: (file: File) => Promise<UploadedTheFile>;\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 theglobalfuel mutations accept\n * (`ecoRecordObservation.evidenceFileId`, `ecoPublishReport.fileId`).\n */\nexport const useTheFileUpload = (): UseTheFileUploadResult => {\n const { apiGatewayUrl } = useTheGlobalFuel();\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<UploadedTheFile> => {\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 TheInitiateUpload($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 TheCompleteUpload($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 TheFileMeta {\n id: string;\n name: string;\n downloadUrl: string | null;\n mimeType: string;\n size: string;\n}\n\nexport const useTheFile = (id: string | null | undefined) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: ['theglobalfuel', 'file', id ?? ''],\n enabled: Boolean(id),\n queryFn: async () => {\n const data = await wspaceFetch<{ getFile: TheFileMeta | null }>(\n `query TheGetFile($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":";;;;;;AAwCA,IAAM,UAAqC;CACzC,IAAM,IAAI;AAGV,CAFA,EAAE,6BAA6B,OAAO,EACtC,EAAE,gCAAgC,OAAO,EACzC,EAAE,4BAA4B,OAAO;GAI1B,IAAc,OACzB,GACA,GACA,MACmB;CACnB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA;EACA,gBAAgB;EACjB,CAAC;AAEF,KAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,yBAAyB;AAE1E,KAAI,CAAC,EAAS,KACZ,OAAU,MAAM,wCAAwC;AAK1D,QAHI,iBAAiB,KAAK,EAAM,IAC9B,GAAwB,EAEnB,EAAS;;AAalB,SAAS,EACP,GACA,GACA,GACA,GACe;AACf,QAAO,IAAI,SAAe,GAAS,MAAW;EAC5C,IAAM,IAAM,IAAI,gBAAgB;AAiBhC,EAhBA,EAAI,KAAK,OAAO,EAAI,EACpB,EAAI,iBAAiB,gBAAgB,EAAY,EACjD,EAAI,OAAO,cAAc,MAAU;AACjC,GAAI,EAAM,oBACR,EAAW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U,eAAe;KACjC,UAAU,EAAU,eAAe,MAAM,QAAQ,EAAK;KACvD;YACM,GAAK;IACZ,IAAM,IAAU,aAAe,QAAQ,EAAI,UAAU;AAErD,UADA,EAAS,EAAQ,EACX,aAAe,QAAQ,IAAU,MAAM,EAAQ;aAC7C;AACR,MAAe,GAAM;;KAGzB,CAAC,EAAc,CAChB;EAEgB;EAAa;EAAU;EAAO;EAAO;GAe3C,KAAc,MAAkC;CAC3D,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU;GAAC;GAAiB;GAAQ,KAAM;GAAG;EAC7C,SAAS,EAAQ;EACjB,SAAS,aACM,MAAM,EACjB,yLASA,EAAE,OAAI,EACN,EACD,EACW;EAEf,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { TheConnection, TheAsset, TheAssetKind, TheAssetStatus, TheCommodityType, TheProductionRecord, TheReserveEstimate, TheReserveCategory, TheOfftakeContract, TheContractSide, TheContractStatus, TheShipment, TheShipmentStatus, TheInventoryLot, TheInventoryStatus, TheEmissionRecord, TheEmissionScope, TheComplianceCert, TheComplianceCategory, TheComplianceStatus, TheCreateAssetInput, TheUpdateAssetInput, TheRecordProductionInput, TheCreateReserveEstimateInput, TheCreateOfftakeContractInput, TheUpdateOfftakeContractInput, TheCreateShipmentInput, TheCreateInventoryLotInput, TheRecordEmissionInput, TheCreateComplianceCertInput, PaginationInput } from '../types';
2
+
3
+ export interface AssetFilters {
4
+ commodity?: TheCommodityType;
5
+ kind?: TheAssetKind;
6
+ status?: TheAssetStatus;
7
+ pagination?: PaginationInput;
8
+ }
9
+ export declare const useTheAssets: (filters?: AssetFilters) => import('@tanstack/react-query').UseQueryResult<TheConnection<TheAsset>, Error>;
10
+ export declare const useTheAsset: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<TheAsset | null, Error>;
11
+ export declare const useTheCreateAsset: () => import('@tanstack/react-query').UseMutationResult<TheAsset, Error, TheCreateAssetInput, unknown>;
12
+ export declare const useTheUpdateAsset: () => import('@tanstack/react-query').UseMutationResult<TheAsset, Error, {
13
+ id: string;
14
+ input: TheUpdateAssetInput;
15
+ }, unknown>;
16
+ export declare const useTheTransitionAsset: () => import('@tanstack/react-query').UseMutationResult<TheAsset, Error, {
17
+ id: string;
18
+ status: TheAssetStatus;
19
+ }, unknown>;
20
+ export declare const useTheRetireAsset: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
21
+ export interface ProductionFilters {
22
+ assetId?: string;
23
+ pagination?: PaginationInput;
24
+ }
25
+ export declare const useTheProductionRecords: (filters?: ProductionFilters) => import('@tanstack/react-query').UseQueryResult<TheConnection<TheProductionRecord>, Error>;
26
+ export declare const useTheRecordProduction: () => import('@tanstack/react-query').UseMutationResult<TheProductionRecord, Error, TheRecordProductionInput, unknown>;
27
+ export declare const useTheReserveEstimates: (assetId?: string, category?: TheReserveCategory) => import('@tanstack/react-query').UseQueryResult<TheReserveEstimate[], Error>;
28
+ export declare const useTheCreateReserveEstimate: () => import('@tanstack/react-query').UseMutationResult<TheReserveEstimate, Error, TheCreateReserveEstimateInput, unknown>;
29
+ export interface ContractFilters {
30
+ commodity?: TheCommodityType;
31
+ side?: TheContractSide;
32
+ status?: TheContractStatus;
33
+ pagination?: PaginationInput;
34
+ }
35
+ export declare const useTheContracts: (filters?: ContractFilters) => import('@tanstack/react-query').UseQueryResult<TheConnection<TheOfftakeContract>, Error>;
36
+ export declare const useTheContract: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<TheOfftakeContract | null, Error>;
37
+ export declare const useTheCreateContract: () => import('@tanstack/react-query').UseMutationResult<TheOfftakeContract, Error, TheCreateOfftakeContractInput, unknown>;
38
+ export declare const useTheUpdateContract: () => import('@tanstack/react-query').UseMutationResult<TheOfftakeContract, Error, {
39
+ id: string;
40
+ input: TheUpdateOfftakeContractInput;
41
+ }, unknown>;
42
+ export declare const useTheTransitionContract: () => import('@tanstack/react-query').UseMutationResult<TheOfftakeContract, Error, {
43
+ id: string;
44
+ status: TheContractStatus;
45
+ }, unknown>;
46
+ export declare const useTheShipments: (contractId?: string, status?: TheShipmentStatus) => import('@tanstack/react-query').UseQueryResult<TheShipment[], Error>;
47
+ export declare const useTheScheduleShipment: () => import('@tanstack/react-query').UseMutationResult<TheShipment, Error, TheCreateShipmentInput, unknown>;
48
+ export declare const useTheDeliverShipment: () => import('@tanstack/react-query').UseMutationResult<TheShipment, Error, string, unknown>;
49
+ export interface InventoryFilters {
50
+ commodity?: TheCommodityType;
51
+ status?: TheInventoryStatus;
52
+ pagination?: PaginationInput;
53
+ }
54
+ export declare const useTheInventoryLots: (filters?: InventoryFilters) => import('@tanstack/react-query').UseQueryResult<TheConnection<TheInventoryLot>, Error>;
55
+ export declare const useTheCreateInventoryLot: () => import('@tanstack/react-query').UseMutationResult<TheInventoryLot, Error, TheCreateInventoryLotInput, unknown>;
56
+ export declare const useTheSetInventoryLotStatus: () => import('@tanstack/react-query').UseMutationResult<TheInventoryLot, Error, {
57
+ id: string;
58
+ status: TheInventoryStatus;
59
+ }, unknown>;
60
+ export interface EmissionFilters {
61
+ assetId?: string;
62
+ scope?: TheEmissionScope;
63
+ pagination?: PaginationInput;
64
+ }
65
+ export declare const useTheEmissionRecords: (filters?: EmissionFilters) => import('@tanstack/react-query').UseQueryResult<TheConnection<TheEmissionRecord>, Error>;
66
+ export declare const useTheRecordEmission: () => import('@tanstack/react-query').UseMutationResult<TheEmissionRecord, Error, TheRecordEmissionInput, unknown>;
67
+ export declare const useTheVerifyEmission: () => import('@tanstack/react-query').UseMutationResult<TheEmissionRecord, Error, string, unknown>;
68
+ export declare const useTheComplianceCerts: (assetId?: string, category?: TheComplianceCategory, status?: TheComplianceStatus) => import('@tanstack/react-query').UseQueryResult<TheComplianceCert[], Error>;
69
+ export declare const useTheComplianceCert: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<TheComplianceCert | null, Error>;
70
+ export declare const useTheCreateComplianceCert: () => import('@tanstack/react-query').UseMutationResult<TheComplianceCert, Error, TheCreateComplianceCertInput, unknown>;
71
+ export declare const useTheTransitionComplianceCert: () => import('@tanstack/react-query').UseMutationResult<TheComplianceCert, Error, {
72
+ id: string;
73
+ status: TheComplianceStatus;
74
+ }, unknown>;
75
+ //# sourceMappingURL=useTheGlobalFuelApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheGlobalFuelApi.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/hooks/useTheGlobalFuelApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EAChB,MAAM,UAAU,CAAC;AAuHlB,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,YAAY,GAAI,UAAS,YAAiB,mFAuBtD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,GAAG,SAAS,2EAoBjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,wGAgB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;QAIc,MAAM;WAAS,mBAAmB;WAe7E,CAAC;AAEF,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AAO,MAAM,mBAAmB,GAAI,UAAS,gBAAqB,0FAsBjE,CAAC;AAEF,eAAO,MAAM,wBAAwB,sHAgBpC,CAAC;AAEF,eAAO,MAAM,2BAA2B;QAIK,MAAM;YAAU,kBAAkB;WAY9E,CAAC;AAMF,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,GAAI,UAAS,eAAoB,4FAsBlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,oHAgBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oGAgBhC,CAAC;AAMF,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,WAAW,qBAAqB,EAChC,SAAS,mBAAmB,+EAgB7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,GAAG,SAAS,oFAgB1D,CAAC;AAEF,eAAO,MAAM,0BAA0B,0HAgBtC,CAAC;AAEF,eAAO,MAAM,8BAA8B;QAIE,MAAM;YAAU,mBAAmB;WAe/E,CAAC"}
@@ -0,0 +1,353 @@
1
+ import { useTheGlobalFuel as e } from "../context/TheGlobalFuelContext.js";
2
+ import "../context/index.js";
3
+ import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
4
+ import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
5
+ //#region src/theglobalfuel/hooks/useTheGlobalFuelApi.ts
6
+ var a = () => {
7
+ let e = globalThis;
8
+ e.__graphqlFetchResponseCache?.clear(), e.__graphqlFetchPendingResponses?.clear(), e.__boffGraphQLResponseCache?.clear();
9
+ }, o = async (e, t, n) => {
10
+ let r = await i({
11
+ gateway: "workspace",
12
+ baseUrl: n,
13
+ query: e,
14
+ variables: t,
15
+ workspaceToken: !0
16
+ });
17
+ if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
18
+ if (!r.data) throw Error("GraphQL response did not include data");
19
+ return /^\s*mutation\b/.test(e) && a(), r.data;
20
+ }, s = {
21
+ assets: ["theglobalfuel", "assets"],
22
+ asset: (e) => [
23
+ "theglobalfuel",
24
+ "asset",
25
+ e
26
+ ],
27
+ production: ["theglobalfuel", "production"],
28
+ reserves: ["theglobalfuel", "reserves"],
29
+ contracts: ["theglobalfuel", "contracts"],
30
+ contract: (e) => [
31
+ "theglobalfuel",
32
+ "contract",
33
+ e
34
+ ],
35
+ shipments: ["theglobalfuel", "shipments"],
36
+ inventory: ["theglobalfuel", "inventory"],
37
+ emissions: ["theglobalfuel", "emissions"],
38
+ compliance: ["theglobalfuel", "compliance"],
39
+ complianceCert: (e) => [
40
+ "theglobalfuel",
41
+ "compliance",
42
+ e
43
+ ]
44
+ }, c = { limit: 50 }, l = "\n id workspaceId name code kind commodity status location latitude longitude\n capacityPerDay capacityUnit workingInterestPct operatorLeadId\n commissionedAt decommissionedAt tags createdAt updatedAt\n", u = "\n id workspaceId assetId periodStart periodEnd volume unit grade downtimeHours\n notes createdAt updatedAt\n", d = "\n id workspaceId assetId category asOfDate recoverable recoveryFactor unit\n methodology notes createdAt updatedAt\n", f = "\n id workspaceId reference counterparty commodity side status pricingBasis\n pricePerUnit priceIndex currency contractedVolume deliveredVolume unit\n deliveryLocation startDate endDate signedAt notes tags createdAt updatedAt\n", p = "\n id workspaceId contractId reference mode status carrier origin destination\n volume unit scheduledAt departedAt deliveredAt document { id } notes\n createdAt updatedAt\n", m = "\n id workspaceId lotCode commodity assetId quantity unit grade status location\n unitValue currency producedAt notes createdAt updatedAt\n", h = "\n id workspaceId assetId scope co2eTonnes periodStart periodEnd source\n methodology verified verifiedAt notes createdAt updatedAt\n", g = "\n id workspaceId title category status assetId authority certNumber ownerId\n issuedAt expiresAt evidence { id } notes tags createdAt updatedAt\n", _ = (t = {}) => {
45
+ let { apiGatewayUrl: r } = e();
46
+ return n({
47
+ queryKey: [...s.assets, t],
48
+ queryFn: async () => (await o(`query TheListAssets($commodity: TheCommodityType, $kind: TheAssetKind, $status: TheAssetStatus, $pagination: PaginationInput) {
49
+ theListAssets(commodity: $commodity, kind: $kind, status: $status, pagination: $pagination) {
50
+ items { ${l} }
51
+ pageInfo { cursor hasMore }
52
+ }
53
+ }`, {
54
+ commodity: t.commodity,
55
+ kind: t.kind,
56
+ status: t.status,
57
+ pagination: t.pagination ?? c
58
+ }, r)).theListAssets
59
+ });
60
+ }, v = (t) => {
61
+ let { apiGatewayUrl: r } = e();
62
+ return n({
63
+ queryKey: s.asset(t ?? ""),
64
+ enabled: !!t,
65
+ queryFn: async () => (await o(`query TheAsset($id: ID!) {
66
+ theAsset(id: $id) {
67
+ ${l}
68
+ productionRecords { ${u} }
69
+ reserveEstimates { ${d} }
70
+ }
71
+ }`, { id: t }, r)).theAsset
72
+ });
73
+ }, y = () => {
74
+ let { apiGatewayUrl: n } = e(), i = r();
75
+ return t({
76
+ mutationFn: async (e) => (await o(`mutation TheCreateAsset($input: TheCreateAssetInput!) {
77
+ theCreateAsset(input: $input) { ${l} }
78
+ }`, { input: e }, n)).theCreateAsset,
79
+ onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
80
+ });
81
+ }, b = () => {
82
+ let { apiGatewayUrl: n } = e(), i = r();
83
+ return t({
84
+ mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionAsset($id: ID!, $status: TheAssetStatus!) {
85
+ theTransitionAsset(id: $id, status: $status) { ${l} }
86
+ }`, {
87
+ id: e,
88
+ status: t
89
+ }, n)).theTransitionAsset,
90
+ onSuccess: (e) => {
91
+ i.invalidateQueries({ queryKey: s.assets }), i.invalidateQueries({ queryKey: s.asset(e.id) });
92
+ }
93
+ });
94
+ }, x = () => {
95
+ let { apiGatewayUrl: n } = e(), i = r();
96
+ return t({
97
+ mutationFn: async (e) => (await o("mutation TheRetireAsset($id: ID!) { theRetireAsset(id: $id) }", { id: e }, n)).theRetireAsset,
98
+ onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
99
+ });
100
+ }, S = (t = {}) => {
101
+ let { apiGatewayUrl: r } = e();
102
+ return n({
103
+ queryKey: [...s.production, t],
104
+ queryFn: async () => (await o(`query TheListProductionRecords($assetId: ID, $pagination: PaginationInput) {
105
+ theListProductionRecords(assetId: $assetId, pagination: $pagination) {
106
+ items { ${u} }
107
+ pageInfo { cursor hasMore }
108
+ }
109
+ }`, {
110
+ assetId: t.assetId,
111
+ pagination: t.pagination ?? c
112
+ }, r)).theListProductionRecords
113
+ });
114
+ }, C = () => {
115
+ let { apiGatewayUrl: n } = e(), i = r();
116
+ return t({
117
+ mutationFn: async (e) => (await o(`mutation TheRecordProduction($input: TheRecordProductionInput!) {
118
+ theRecordProduction(input: $input) { ${u} }
119
+ }`, { input: e }, n)).theRecordProduction,
120
+ onSuccess: (e) => {
121
+ i.invalidateQueries({ queryKey: s.production }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
122
+ }
123
+ });
124
+ }, w = (t, r) => {
125
+ let { apiGatewayUrl: i } = e();
126
+ return n({
127
+ queryKey: [
128
+ ...s.reserves,
129
+ t ?? null,
130
+ r ?? null
131
+ ],
132
+ queryFn: async () => (await o(`query TheListReserveEstimates($assetId: ID, $category: TheReserveCategory) {
133
+ theListReserveEstimates(assetId: $assetId, category: $category) { ${d} }
134
+ }`, {
135
+ assetId: t,
136
+ category: r
137
+ }, i)).theListReserveEstimates
138
+ });
139
+ }, T = () => {
140
+ let { apiGatewayUrl: n } = e(), i = r();
141
+ return t({
142
+ mutationFn: async (e) => (await o(`mutation TheCreateReserveEstimate($input: TheCreateReserveEstimateInput!) {
143
+ theCreateReserveEstimate(input: $input) { ${d} }
144
+ }`, { input: e }, n)).theCreateReserveEstimate,
145
+ onSuccess: (e) => {
146
+ i.invalidateQueries({ queryKey: s.reserves }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
147
+ }
148
+ });
149
+ }, E = (t = {}) => {
150
+ let { apiGatewayUrl: r } = e();
151
+ return n({
152
+ queryKey: [...s.contracts, t],
153
+ queryFn: async () => (await o(`query TheListContracts($commodity: TheCommodityType, $side: TheContractSide, $status: TheContractStatus, $pagination: PaginationInput) {
154
+ theListContracts(commodity: $commodity, side: $side, status: $status, pagination: $pagination) {
155
+ items { ${f} }
156
+ pageInfo { cursor hasMore }
157
+ }
158
+ }`, {
159
+ commodity: t.commodity,
160
+ side: t.side,
161
+ status: t.status,
162
+ pagination: t.pagination ?? c
163
+ }, r)).theListContracts
164
+ });
165
+ }, D = (t) => {
166
+ let { apiGatewayUrl: r } = e();
167
+ return n({
168
+ queryKey: s.contract(t ?? ""),
169
+ enabled: !!t,
170
+ queryFn: async () => (await o(`query TheContract($id: ID!) {
171
+ theContract(id: $id) {
172
+ ${f}
173
+ shipments { ${p} }
174
+ }
175
+ }`, { id: t }, r)).theContract
176
+ });
177
+ }, O = () => {
178
+ let { apiGatewayUrl: n } = e(), i = r();
179
+ return t({
180
+ mutationFn: async (e) => (await o(`mutation TheCreateContract($input: TheCreateOfftakeContractInput!) {
181
+ theCreateContract(input: $input) { ${f} }
182
+ }`, { input: e }, n)).theCreateContract,
183
+ onSuccess: () => i.invalidateQueries({ queryKey: s.contracts })
184
+ });
185
+ }, k = () => {
186
+ let { apiGatewayUrl: n } = e(), i = r();
187
+ return t({
188
+ mutationFn: async ({ id: e, input: t }) => (await o(`mutation TheUpdateContract($id: ID!, $input: TheUpdateOfftakeContractInput!) {
189
+ theUpdateContract(id: $id, input: $input) { ${f} }
190
+ }`, {
191
+ id: e,
192
+ input: t
193
+ }, n)).theUpdateContract,
194
+ onSuccess: (e) => {
195
+ i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
196
+ }
197
+ });
198
+ }, A = () => {
199
+ let { apiGatewayUrl: n } = e(), i = r();
200
+ return t({
201
+ mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionContract($id: ID!, $status: TheContractStatus!) {
202
+ theTransitionContract(id: $id, status: $status) { ${f} }
203
+ }`, {
204
+ id: e,
205
+ status: t
206
+ }, n)).theTransitionContract,
207
+ onSuccess: (e) => {
208
+ i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
209
+ }
210
+ });
211
+ }, j = (t, r) => {
212
+ let { apiGatewayUrl: i } = e();
213
+ return n({
214
+ queryKey: [
215
+ ...s.shipments,
216
+ t ?? null,
217
+ r ?? null
218
+ ],
219
+ queryFn: async () => (await o(`query TheListShipments($contractId: ID, $status: TheShipmentStatus) {
220
+ theListShipments(contractId: $contractId, status: $status) { ${p} }
221
+ }`, {
222
+ contractId: t,
223
+ status: r
224
+ }, i)).theListShipments
225
+ });
226
+ }, M = () => {
227
+ let { apiGatewayUrl: n } = e(), i = r();
228
+ return t({
229
+ mutationFn: async (e) => (await o(`mutation TheScheduleShipment($input: TheCreateShipmentInput!) {
230
+ theScheduleShipment(input: $input) { ${p} }
231
+ }`, { input: e }, n)).theScheduleShipment,
232
+ onSuccess: (e) => {
233
+ i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
234
+ }
235
+ });
236
+ }, N = () => {
237
+ let { apiGatewayUrl: n } = e(), i = r();
238
+ return t({
239
+ mutationFn: async (e) => (await o(`mutation TheDeliverShipment($id: ID!) {
240
+ theDeliverShipment(id: $id) { ${p} }
241
+ }`, { id: e }, n)).theDeliverShipment,
242
+ onSuccess: (e) => {
243
+ i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
244
+ }
245
+ });
246
+ }, P = (t = {}) => {
247
+ let { apiGatewayUrl: r } = e();
248
+ return n({
249
+ queryKey: [...s.inventory, t],
250
+ queryFn: async () => (await o(`query TheListInventoryLots($commodity: TheCommodityType, $status: TheInventoryStatus, $pagination: PaginationInput) {
251
+ theListInventoryLots(commodity: $commodity, status: $status, pagination: $pagination) {
252
+ items { ${m} }
253
+ pageInfo { cursor hasMore }
254
+ }
255
+ }`, {
256
+ commodity: t.commodity,
257
+ status: t.status,
258
+ pagination: t.pagination ?? c
259
+ }, r)).theListInventoryLots
260
+ });
261
+ }, F = () => {
262
+ let { apiGatewayUrl: n } = e(), i = r();
263
+ return t({
264
+ mutationFn: async (e) => (await o(`mutation TheCreateInventoryLot($input: TheCreateInventoryLotInput!) {
265
+ theCreateInventoryLot(input: $input) { ${m} }
266
+ }`, { input: e }, n)).theCreateInventoryLot,
267
+ onSuccess: () => i.invalidateQueries({ queryKey: s.inventory })
268
+ });
269
+ }, I = () => {
270
+ let { apiGatewayUrl: n } = e(), i = r();
271
+ return t({
272
+ mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheSetInventoryLotStatus($id: ID!, $status: TheInventoryStatus!) {
273
+ theSetInventoryLotStatus(id: $id, status: $status) { ${m} }
274
+ }`, {
275
+ id: e,
276
+ status: t
277
+ }, n)).theSetInventoryLotStatus,
278
+ onSuccess: () => i.invalidateQueries({ queryKey: s.inventory })
279
+ });
280
+ }, L = (t = {}) => {
281
+ let { apiGatewayUrl: r } = e();
282
+ return n({
283
+ queryKey: [...s.emissions, t],
284
+ queryFn: async () => (await o(`query TheListEmissionRecords($assetId: ID, $scope: TheEmissionScope, $pagination: PaginationInput) {
285
+ theListEmissionRecords(assetId: $assetId, scope: $scope, pagination: $pagination) {
286
+ items { ${h} }
287
+ pageInfo { cursor hasMore }
288
+ }
289
+ }`, {
290
+ assetId: t.assetId,
291
+ scope: t.scope,
292
+ pagination: t.pagination ?? c
293
+ }, r)).theListEmissionRecords
294
+ });
295
+ }, R = () => {
296
+ let { apiGatewayUrl: n } = e(), i = r();
297
+ return t({
298
+ mutationFn: async (e) => (await o(`mutation TheRecordEmission($input: TheRecordEmissionInput!) {
299
+ theRecordEmission(input: $input) { ${h} }
300
+ }`, { input: e }, n)).theRecordEmission,
301
+ onSuccess: () => i.invalidateQueries({ queryKey: s.emissions })
302
+ });
303
+ }, z = () => {
304
+ let { apiGatewayUrl: n } = e(), i = r();
305
+ return t({
306
+ mutationFn: async (e) => (await o(`mutation TheVerifyEmission($id: ID!) {
307
+ theVerifyEmission(id: $id) { ${h} }
308
+ }`, { id: e }, n)).theVerifyEmission,
309
+ onSuccess: () => i.invalidateQueries({ queryKey: s.emissions })
310
+ });
311
+ }, B = (t, r, i) => {
312
+ let { apiGatewayUrl: a } = e();
313
+ return n({
314
+ queryKey: [
315
+ ...s.compliance,
316
+ t ?? null,
317
+ r ?? null,
318
+ i ?? null
319
+ ],
320
+ queryFn: async () => (await o(`query TheListComplianceCerts($assetId: ID, $category: TheComplianceCategory, $status: TheComplianceStatus) {
321
+ theListComplianceCerts(assetId: $assetId, category: $category, status: $status) { ${g} }
322
+ }`, {
323
+ assetId: t,
324
+ category: r,
325
+ status: i
326
+ }, a)).theListComplianceCerts
327
+ });
328
+ }, V = () => {
329
+ let { apiGatewayUrl: n } = e(), i = r();
330
+ return t({
331
+ mutationFn: async (e) => (await o(`mutation TheCreateComplianceCert($input: TheCreateComplianceCertInput!) {
332
+ theCreateComplianceCert(input: $input) { ${g} }
333
+ }`, { input: e }, n)).theCreateComplianceCert,
334
+ onSuccess: () => i.invalidateQueries({ queryKey: s.compliance })
335
+ });
336
+ }, H = () => {
337
+ let { apiGatewayUrl: n } = e(), i = r();
338
+ return t({
339
+ mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionComplianceCert($id: ID!, $status: TheComplianceStatus!) {
340
+ theTransitionComplianceCert(id: $id, status: $status) { ${g} }
341
+ }`, {
342
+ id: e,
343
+ status: t
344
+ }, n)).theTransitionComplianceCert,
345
+ onSuccess: (e) => {
346
+ i.invalidateQueries({ queryKey: s.compliance }), i.invalidateQueries({ queryKey: s.complianceCert(e.id) });
347
+ }
348
+ });
349
+ };
350
+ //#endregion
351
+ export { v as useTheAsset, _ as useTheAssets, B as useTheComplianceCerts, D as useTheContract, E as useTheContracts, y as useTheCreateAsset, V as useTheCreateComplianceCert, O as useTheCreateContract, F as useTheCreateInventoryLot, T as useTheCreateReserveEstimate, N as useTheDeliverShipment, L as useTheEmissionRecords, P as useTheInventoryLots, S as useTheProductionRecords, R as useTheRecordEmission, C as useTheRecordProduction, w as useTheReserveEstimates, x as useTheRetireAsset, M as useTheScheduleShipment, I as useTheSetInventoryLotStatus, j as useTheShipments, b as useTheTransitionAsset, H as useTheTransitionComplianceCert, A as useTheTransitionContract, k as useTheUpdateContract, z as useTheVerifyEmission };
352
+
353
+ //# sourceMappingURL=useTheGlobalFuelApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTheGlobalFuelApi.js","names":[],"sources":["../../../src/theglobalfuel/hooks/useTheGlobalFuelApi.ts"],"sourcesContent":["/**\n * TheGlobalFuel API hooks\n * @module theglobalfuel/hooks\n *\n * React-Query hooks wired DIRECTLY to the real `wspace-theglobalfuel-svc`\n * federated GraphQL contract (the `the*` operations). Every query/mutation\n * below uses an inline gql string whose fields match the svc\n * `.hive-schema.graphql` exactly. No mock data.\n *\n * Transport: `graphqlFetch({ gateway: 'workspace', workspaceToken: true })` —\n * the host shell supplies the gateway base URL + a workspace-scoped token.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useTheGlobalFuel } from '../context';\nimport type {\n TheConnection,\n TheAsset,\n TheAssetKind,\n TheAssetStatus,\n TheCommodityType,\n TheProductionRecord,\n TheReserveEstimate,\n TheReserveCategory,\n TheOfftakeContract,\n TheContractSide,\n TheContractStatus,\n TheShipment,\n TheShipmentStatus,\n TheInventoryLot,\n TheInventoryStatus,\n TheEmissionRecord,\n TheEmissionScope,\n TheComplianceCert,\n TheComplianceCategory,\n TheComplianceStatus,\n TheCreateAssetInput,\n TheUpdateAssetInput,\n TheRecordProductionInput,\n TheCreateReserveEstimateInput,\n TheCreateOfftakeContractInput,\n TheUpdateOfftakeContractInput,\n TheCreateShipmentInput,\n TheCreateInventoryLotInput,\n TheRecordEmissionInput,\n TheCreateComplianceCertInput,\n PaginationInput,\n} from '../types';\n\n// ============================================================================\n// Transport\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 keyed by operationName+variables (~15s; mutations never cached). A read\n * issued right after a write would otherwise return the pre-mutation snapshot\n * until the TTL expires — making just-created rows invisible. We clear those\n * caches after every mutation so every follow-up refetch reads fresh.\n */\nconst clearGraphqlReadCaches = (): void => {\n const g = globalThis as GraphqlReadCacheGlobals;\n g.__graphqlFetchResponseCache?.clear();\n g.__graphqlFetchPendingResponses?.clear();\n g.__boffGraphQLResponseCache?.clear();\n};\n\nconst theQuery = 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// React-Query key roots (one namespace per domain entity).\nconst KEY = {\n assets: ['theglobalfuel', 'assets'] as const,\n asset: (id: string) => ['theglobalfuel', 'asset', id] as const,\n production: ['theglobalfuel', 'production'] as const,\n reserves: ['theglobalfuel', 'reserves'] as const,\n contracts: ['theglobalfuel', 'contracts'] as const,\n contract: (id: string) => ['theglobalfuel', 'contract', id] as const,\n shipments: ['theglobalfuel', 'shipments'] as const,\n inventory: ['theglobalfuel', 'inventory'] as const,\n emissions: ['theglobalfuel', 'emissions'] as const,\n compliance: ['theglobalfuel', 'compliance'] as const,\n complianceCert: (id: string) => ['theglobalfuel', 'compliance', id] as const,\n};\n\nconst DEFAULT_PAGE: PaginationInput = { limit: 50 };\n\n// ============================================================================\n// Reusable gql field selections (codegen-free strictness)\n// ============================================================================\n\nconst ASSET_FIELDS = `\n id workspaceId name code kind commodity status location latitude longitude\n capacityPerDay capacityUnit workingInterestPct operatorLeadId\n commissionedAt decommissionedAt tags createdAt updatedAt\n`;\n\nconst PRODUCTION_FIELDS = `\n id workspaceId assetId periodStart periodEnd volume unit grade downtimeHours\n notes createdAt updatedAt\n`;\n\nconst RESERVE_FIELDS = `\n id workspaceId assetId category asOfDate recoverable recoveryFactor unit\n methodology notes createdAt updatedAt\n`;\n\nconst CONTRACT_FIELDS = `\n id workspaceId reference counterparty commodity side status pricingBasis\n pricePerUnit priceIndex currency contractedVolume deliveredVolume unit\n deliveryLocation startDate endDate signedAt notes tags createdAt updatedAt\n`;\n\nconst SHIPMENT_FIELDS = `\n id workspaceId contractId reference mode status carrier origin destination\n volume unit scheduledAt departedAt deliveredAt document { id } notes\n createdAt updatedAt\n`;\n\nconst INVENTORY_FIELDS = `\n id workspaceId lotCode commodity assetId quantity unit grade status location\n unitValue currency producedAt notes createdAt updatedAt\n`;\n\nconst EMISSION_FIELDS = `\n id workspaceId assetId scope co2eTonnes periodStart periodEnd source\n methodology verified verifiedAt notes createdAt updatedAt\n`;\n\nconst COMPLIANCE_FIELDS = `\n id workspaceId title category status assetId authority certNumber ownerId\n issuedAt expiresAt evidence { id } notes tags createdAt updatedAt\n`;\n\n// ============================================================================\n// Registry — Assets\n// ============================================================================\n\nexport interface AssetFilters {\n commodity?: TheCommodityType;\n kind?: TheAssetKind;\n status?: TheAssetStatus;\n pagination?: PaginationInput;\n}\n\nexport const useTheAssets = (filters: AssetFilters = {}) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.assets, filters],\n queryFn: async () => {\n const data = await theQuery<{ theListAssets: TheConnection<TheAsset> }>(\n `query TheListAssets($commodity: TheCommodityType, $kind: TheAssetKind, $status: TheAssetStatus, $pagination: PaginationInput) {\n theListAssets(commodity: $commodity, kind: $kind, status: $status, pagination: $pagination) {\n items { ${ASSET_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n commodity: filters.commodity,\n kind: filters.kind,\n status: filters.status,\n pagination: filters.pagination ?? DEFAULT_PAGE,\n },\n apiGatewayUrl\n );\n return data.theListAssets;\n },\n });\n};\n\nexport const useTheAsset = (id: string | undefined) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: KEY.asset(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const data = await theQuery<{ theAsset: TheAsset | null }>(\n `query TheAsset($id: ID!) {\n theAsset(id: $id) {\n ${ASSET_FIELDS}\n productionRecords { ${PRODUCTION_FIELDS} }\n reserveEstimates { ${RESERVE_FIELDS} }\n }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.theAsset;\n },\n });\n};\n\nexport const useTheCreateAsset = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheCreateAssetInput) => {\n const data = await theQuery<{ theCreateAsset: TheAsset }>(\n `mutation TheCreateAsset($input: TheCreateAssetInput!) {\n theCreateAsset(input: $input) { ${ASSET_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theCreateAsset;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.assets }),\n });\n};\n\nexport const useTheUpdateAsset = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, input }: { id: string; input: TheUpdateAssetInput }) => {\n const data = await theQuery<{ theUpdateAsset: TheAsset }>(\n `mutation TheUpdateAsset($id: ID!, $input: TheUpdateAssetInput!) {\n theUpdateAsset(id: $id, input: $input) { ${ASSET_FIELDS} }\n }`,\n { id, input },\n apiGatewayUrl\n );\n return data.theUpdateAsset;\n },\n onSuccess: (asset) => {\n qc.invalidateQueries({ queryKey: KEY.assets });\n qc.invalidateQueries({ queryKey: KEY.asset(asset.id) });\n },\n });\n};\n\nexport const useTheTransitionAsset = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheAssetStatus }) => {\n const data = await theQuery<{ theTransitionAsset: TheAsset }>(\n `mutation TheTransitionAsset($id: ID!, $status: TheAssetStatus!) {\n theTransitionAsset(id: $id, status: $status) { ${ASSET_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theTransitionAsset;\n },\n onSuccess: (asset) => {\n qc.invalidateQueries({ queryKey: KEY.assets });\n qc.invalidateQueries({ queryKey: KEY.asset(asset.id) });\n },\n });\n};\n\nexport const useTheRetireAsset = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const data = await theQuery<{ theRetireAsset: boolean }>(\n `mutation TheRetireAsset($id: ID!) { theRetireAsset(id: $id) }`,\n { id },\n apiGatewayUrl\n );\n return data.theRetireAsset;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.assets }),\n });\n};\n\n// ============================================================================\n// Registry — Production records\n// ============================================================================\n\nexport interface ProductionFilters {\n assetId?: string;\n pagination?: PaginationInput;\n}\n\nexport const useTheProductionRecords = (filters: ProductionFilters = {}) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.production, filters],\n queryFn: async () => {\n const data = await theQuery<{ theListProductionRecords: TheConnection<TheProductionRecord> }>(\n `query TheListProductionRecords($assetId: ID, $pagination: PaginationInput) {\n theListProductionRecords(assetId: $assetId, pagination: $pagination) {\n items { ${PRODUCTION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { assetId: filters.assetId, pagination: filters.pagination ?? DEFAULT_PAGE },\n apiGatewayUrl\n );\n return data.theListProductionRecords;\n },\n });\n};\n\nexport const useTheRecordProduction = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheRecordProductionInput) => {\n const data = await theQuery<{ theRecordProduction: TheProductionRecord }>(\n `mutation TheRecordProduction($input: TheRecordProductionInput!) {\n theRecordProduction(input: $input) { ${PRODUCTION_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theRecordProduction;\n },\n onSuccess: (rec) => {\n qc.invalidateQueries({ queryKey: KEY.production });\n qc.invalidateQueries({ queryKey: KEY.asset(rec.assetId) });\n },\n });\n};\n\n// ============================================================================\n// Registry — Reserve estimates\n// ============================================================================\n\nexport const useTheReserveEstimates = (assetId?: string, category?: TheReserveCategory) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.reserves, assetId ?? null, category ?? null],\n queryFn: async () => {\n const data = await theQuery<{ theListReserveEstimates: TheReserveEstimate[] }>(\n `query TheListReserveEstimates($assetId: ID, $category: TheReserveCategory) {\n theListReserveEstimates(assetId: $assetId, category: $category) { ${RESERVE_FIELDS} }\n }`,\n { assetId, category },\n apiGatewayUrl\n );\n return data.theListReserveEstimates;\n },\n });\n};\n\nexport const useTheCreateReserveEstimate = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheCreateReserveEstimateInput) => {\n const data = await theQuery<{ theCreateReserveEstimate: TheReserveEstimate }>(\n `mutation TheCreateReserveEstimate($input: TheCreateReserveEstimateInput!) {\n theCreateReserveEstimate(input: $input) { ${RESERVE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theCreateReserveEstimate;\n },\n onSuccess: (rec) => {\n qc.invalidateQueries({ queryKey: KEY.reserves });\n qc.invalidateQueries({ queryKey: KEY.asset(rec.assetId) });\n },\n });\n};\n\n// ============================================================================\n// Commerce — Offtake contracts\n// ============================================================================\n\nexport interface ContractFilters {\n commodity?: TheCommodityType;\n side?: TheContractSide;\n status?: TheContractStatus;\n pagination?: PaginationInput;\n}\n\nexport const useTheContracts = (filters: ContractFilters = {}) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.contracts, filters],\n queryFn: async () => {\n const data = await theQuery<{ theListContracts: TheConnection<TheOfftakeContract> }>(\n `query TheListContracts($commodity: TheCommodityType, $side: TheContractSide, $status: TheContractStatus, $pagination: PaginationInput) {\n theListContracts(commodity: $commodity, side: $side, status: $status, pagination: $pagination) {\n items { ${CONTRACT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n commodity: filters.commodity,\n side: filters.side,\n status: filters.status,\n pagination: filters.pagination ?? DEFAULT_PAGE,\n },\n apiGatewayUrl\n );\n return data.theListContracts;\n },\n });\n};\n\nexport const useTheContract = (id: string | undefined) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: KEY.contract(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const data = await theQuery<{ theContract: TheOfftakeContract | null }>(\n `query TheContract($id: ID!) {\n theContract(id: $id) {\n ${CONTRACT_FIELDS}\n shipments { ${SHIPMENT_FIELDS} }\n }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.theContract;\n },\n });\n};\n\nexport const useTheCreateContract = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheCreateOfftakeContractInput) => {\n const data = await theQuery<{ theCreateContract: TheOfftakeContract }>(\n `mutation TheCreateContract($input: TheCreateOfftakeContractInput!) {\n theCreateContract(input: $input) { ${CONTRACT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theCreateContract;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.contracts }),\n });\n};\n\nexport const useTheUpdateContract = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, input }: { id: string; input: TheUpdateOfftakeContractInput }) => {\n const data = await theQuery<{ theUpdateContract: TheOfftakeContract }>(\n `mutation TheUpdateContract($id: ID!, $input: TheUpdateOfftakeContractInput!) {\n theUpdateContract(id: $id, input: $input) { ${CONTRACT_FIELDS} }\n }`,\n { id, input },\n apiGatewayUrl\n );\n return data.theUpdateContract;\n },\n onSuccess: (c) => {\n qc.invalidateQueries({ queryKey: KEY.contracts });\n qc.invalidateQueries({ queryKey: KEY.contract(c.id) });\n },\n });\n};\n\nexport const useTheTransitionContract = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheContractStatus }) => {\n const data = await theQuery<{ theTransitionContract: TheOfftakeContract }>(\n `mutation TheTransitionContract($id: ID!, $status: TheContractStatus!) {\n theTransitionContract(id: $id, status: $status) { ${CONTRACT_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theTransitionContract;\n },\n onSuccess: (c) => {\n qc.invalidateQueries({ queryKey: KEY.contracts });\n qc.invalidateQueries({ queryKey: KEY.contract(c.id) });\n },\n });\n};\n\n// ============================================================================\n// Commerce — Shipments\n// ============================================================================\n\nexport const useTheShipments = (contractId?: string, status?: TheShipmentStatus) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.shipments, contractId ?? null, status ?? null],\n queryFn: async () => {\n const data = await theQuery<{ theListShipments: TheShipment[] }>(\n `query TheListShipments($contractId: ID, $status: TheShipmentStatus) {\n theListShipments(contractId: $contractId, status: $status) { ${SHIPMENT_FIELDS} }\n }`,\n { contractId, status },\n apiGatewayUrl\n );\n return data.theListShipments;\n },\n });\n};\n\nexport const useTheScheduleShipment = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheCreateShipmentInput) => {\n const data = await theQuery<{ theScheduleShipment: TheShipment }>(\n `mutation TheScheduleShipment($input: TheCreateShipmentInput!) {\n theScheduleShipment(input: $input) { ${SHIPMENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theScheduleShipment;\n },\n onSuccess: (s) => {\n qc.invalidateQueries({ queryKey: KEY.shipments });\n qc.invalidateQueries({ queryKey: KEY.contract(s.contractId) });\n },\n });\n};\n\nexport const useTheDeliverShipment = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const data = await theQuery<{ theDeliverShipment: TheShipment }>(\n `mutation TheDeliverShipment($id: ID!) {\n theDeliverShipment(id: $id) { ${SHIPMENT_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.theDeliverShipment;\n },\n onSuccess: (s) => {\n qc.invalidateQueries({ queryKey: KEY.shipments });\n qc.invalidateQueries({ queryKey: KEY.contracts });\n qc.invalidateQueries({ queryKey: KEY.contract(s.contractId) });\n },\n });\n};\n\n// ============================================================================\n// Commerce — Inventory lots\n// ============================================================================\n\nexport interface InventoryFilters {\n commodity?: TheCommodityType;\n status?: TheInventoryStatus;\n pagination?: PaginationInput;\n}\n\nexport const useTheInventoryLots = (filters: InventoryFilters = {}) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.inventory, filters],\n queryFn: async () => {\n const data = await theQuery<{ theListInventoryLots: TheConnection<TheInventoryLot> }>(\n `query TheListInventoryLots($commodity: TheCommodityType, $status: TheInventoryStatus, $pagination: PaginationInput) {\n theListInventoryLots(commodity: $commodity, status: $status, pagination: $pagination) {\n items { ${INVENTORY_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n commodity: filters.commodity,\n status: filters.status,\n pagination: filters.pagination ?? DEFAULT_PAGE,\n },\n apiGatewayUrl\n );\n return data.theListInventoryLots;\n },\n });\n};\n\nexport const useTheCreateInventoryLot = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheCreateInventoryLotInput) => {\n const data = await theQuery<{ theCreateInventoryLot: TheInventoryLot }>(\n `mutation TheCreateInventoryLot($input: TheCreateInventoryLotInput!) {\n theCreateInventoryLot(input: $input) { ${INVENTORY_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theCreateInventoryLot;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.inventory }),\n });\n};\n\nexport const useTheSetInventoryLotStatus = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheInventoryStatus }) => {\n const data = await theQuery<{ theSetInventoryLotStatus: TheInventoryLot }>(\n `mutation TheSetInventoryLotStatus($id: ID!, $status: TheInventoryStatus!) {\n theSetInventoryLotStatus(id: $id, status: $status) { ${INVENTORY_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theSetInventoryLotStatus;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.inventory }),\n });\n};\n\n// ============================================================================\n// Sustainability — Emission records\n// ============================================================================\n\nexport interface EmissionFilters {\n assetId?: string;\n scope?: TheEmissionScope;\n pagination?: PaginationInput;\n}\n\nexport const useTheEmissionRecords = (filters: EmissionFilters = {}) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.emissions, filters],\n queryFn: async () => {\n const data = await theQuery<{ theListEmissionRecords: TheConnection<TheEmissionRecord> }>(\n `query TheListEmissionRecords($assetId: ID, $scope: TheEmissionScope, $pagination: PaginationInput) {\n theListEmissionRecords(assetId: $assetId, scope: $scope, pagination: $pagination) {\n items { ${EMISSION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n assetId: filters.assetId,\n scope: filters.scope,\n pagination: filters.pagination ?? DEFAULT_PAGE,\n },\n apiGatewayUrl\n );\n return data.theListEmissionRecords;\n },\n });\n};\n\nexport const useTheRecordEmission = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheRecordEmissionInput) => {\n const data = await theQuery<{ theRecordEmission: TheEmissionRecord }>(\n `mutation TheRecordEmission($input: TheRecordEmissionInput!) {\n theRecordEmission(input: $input) { ${EMISSION_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theRecordEmission;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.emissions }),\n });\n};\n\nexport const useTheVerifyEmission = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const data = await theQuery<{ theVerifyEmission: TheEmissionRecord }>(\n `mutation TheVerifyEmission($id: ID!) {\n theVerifyEmission(id: $id) { ${EMISSION_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.theVerifyEmission;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.emissions }),\n });\n};\n\n// ============================================================================\n// Sustainability — Compliance certifications\n// ============================================================================\n\nexport const useTheComplianceCerts = (\n assetId?: string,\n category?: TheComplianceCategory,\n status?: TheComplianceStatus\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.compliance, assetId ?? null, category ?? null, status ?? null],\n queryFn: async () => {\n const data = await theQuery<{ theListComplianceCerts: TheComplianceCert[] }>(\n `query TheListComplianceCerts($assetId: ID, $category: TheComplianceCategory, $status: TheComplianceStatus) {\n theListComplianceCerts(assetId: $assetId, category: $category, status: $status) { ${COMPLIANCE_FIELDS} }\n }`,\n { assetId, category, status },\n apiGatewayUrl\n );\n return data.theListComplianceCerts;\n },\n });\n};\n\nexport const useTheComplianceCert = (id: string | undefined) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: KEY.complianceCert(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const data = await theQuery<{ theComplianceCert: TheComplianceCert | null }>(\n `query TheComplianceCert($id: ID!) {\n theComplianceCert(id: $id) { ${COMPLIANCE_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.theComplianceCert;\n },\n });\n};\n\nexport const useTheCreateComplianceCert = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheCreateComplianceCertInput) => {\n const data = await theQuery<{ theCreateComplianceCert: TheComplianceCert }>(\n `mutation TheCreateComplianceCert($input: TheCreateComplianceCertInput!) {\n theCreateComplianceCert(input: $input) { ${COMPLIANCE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theCreateComplianceCert;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.compliance }),\n });\n};\n\nexport const useTheTransitionComplianceCert = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheComplianceStatus }) => {\n const data = await theQuery<{ theTransitionComplianceCert: TheComplianceCert }>(\n `mutation TheTransitionComplianceCert($id: ID!, $status: TheComplianceStatus!) {\n theTransitionComplianceCert(id: $id, status: $status) { ${COMPLIANCE_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theTransitionComplianceCert;\n },\n onSuccess: (c) => {\n qc.invalidateQueries({ queryKey: KEY.compliance });\n qc.invalidateQueries({ queryKey: KEY.complianceCert(c.id) });\n },\n });\n};\n"],"mappings":";;;;;AAoEA,IAAM,UAAqC;CACzC,IAAM,IAAI;AAGV,CAFA,EAAE,6BAA6B,OAAO,EACtC,EAAE,gCAAgC,OAAO,EACzC,EAAE,4BAA4B,OAAO;GAGjC,IAAW,OACf,GACA,GACA,MACmB;CACnB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA;EACA,gBAAgB;EACjB,CAAC;AAEF,KAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,yBAAyB;AAE1E,KAAI,CAAC,EAAS,KACZ,OAAU,MAAM,wCAAwC;AAK1D,QA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