@burdenoff/microfe-theglobalfuel 2026.801.1 → 2026.804.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -1
  2. package/dist/theglobalfuel/TheGlobalFuelRoot.js +75 -51
  3. package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
  4. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -1
  5. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +37 -25
  6. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
  7. package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -1
  8. package/dist/theglobalfuel/components/StatusBadge.js +19 -1
  9. package/dist/theglobalfuel/components/StatusBadge.js.map +1 -1
  10. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +33 -1
  11. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -1
  12. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +170 -29
  13. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
  14. package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.d.ts +14 -0
  15. package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.d.ts.map +1 -0
  16. package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.js +496 -0
  17. package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.js.map +1 -0
  18. package/dist/theglobalfuel/pages/safety/IncidentsPage.d.ts +15 -0
  19. package/dist/theglobalfuel/pages/safety/IncidentsPage.d.ts.map +1 -0
  20. package/dist/theglobalfuel/pages/safety/IncidentsPage.js +611 -0
  21. package/dist/theglobalfuel/pages/safety/IncidentsPage.js.map +1 -0
  22. package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.d.ts +12 -0
  23. package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.d.ts.map +1 -0
  24. package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.js +175 -0
  25. package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.js.map +1 -0
  26. package/dist/theglobalfuel/types/index.d.ts +122 -0
  27. package/dist/theglobalfuel/types/index.d.ts.map +1 -1
  28. package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -1
  29. package/dist/theglobalfuel/utils/pageContext.js +1 -0
  30. package/dist/theglobalfuel/utils/pageContext.js.map +1 -1
  31. package/package.json +1 -1
@@ -40,8 +40,17 @@ var a = () => {
40
40
  "theglobalfuel",
41
41
  "compliance",
42
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 discoveryAt area reservoirType waterDepth\n createdAt updatedAt\n", u = "\n id workspaceId assetId periodStart periodEnd volume unit grade downtimeHours\n source 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 createdAt updatedAt\n", p = "\n id workspaceId contractId reference mode status carrier trackingId 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 createdAt updatedAt\n", _ = (t = {}) => {
43
+ ],
44
+ esgDisclosures: ["theglobalfuel", "esg-disclosures"],
45
+ safetyIncidents: ["theglobalfuel", "safety-incidents"],
46
+ safetyIncident: (e) => [
47
+ "theglobalfuel",
48
+ "safety-incident",
49
+ e
50
+ ],
51
+ correctiveActions: ["theglobalfuel", "corrective-actions"],
52
+ safetyDashboard: ["theglobalfuel", "safety-dashboard"]
53
+ }, c = { limit: 50 }, l = "\n id workspaceId name code kind commodity status location latitude longitude\n capacityPerDay capacityUnit workingInterestPct operatorLeadId\n commissionedAt decommissionedAt discoveryAt area reservoirType waterDepth\n createdAt updatedAt\n", u = "\n id workspaceId assetId periodStart periodEnd volume unit grade downtimeHours\n source 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 createdAt updatedAt\n", p = "\n id workspaceId contractId reference mode status carrier trackingId 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 createdAt updatedAt\n", _ = "\n id workspaceId framework status periodStart periodEnd datapoints generatedAt\n notes createdAt updatedAt\n", v = "\n id workspaceId assetId category severity status title description occurredAt\n involvedParties linkedProductionRecordId linkedComplianceCertId\n investigationNotes evidence { id } closedAt notes createdAt updatedAt\n", y = "\n id workspaceId incidentId description status ownerId dueDate closedAt notes\n createdAt updatedAt\n", b = (t = {}) => {
45
54
  let { apiGatewayUrl: r } = e();
46
55
  return n({
47
56
  queryKey: [...s.assets, t],
@@ -57,7 +66,7 @@ var a = () => {
57
66
  pagination: t.pagination ?? c
58
67
  }, r)).theListAssets
59
68
  });
60
- }, v = (t) => {
69
+ }, x = (t) => {
61
70
  let { apiGatewayUrl: r } = e();
62
71
  return n({
63
72
  queryKey: s.asset(t ?? ""),
@@ -66,7 +75,7 @@ var a = () => {
66
75
  theAsset(id: $id) { ${l} }
67
76
  }`, { id: t }, r)).theAsset
68
77
  });
69
- }, y = () => {
78
+ }, S = () => {
70
79
  let { apiGatewayUrl: n } = e(), i = r();
71
80
  return t({
72
81
  mutationFn: async (e) => (await o(`mutation TheCreateAsset($input: TheCreateAssetInput!) {
@@ -74,7 +83,7 @@ var a = () => {
74
83
  }`, { input: e }, n)).theCreateAsset,
75
84
  onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
76
85
  });
77
- }, b = () => {
86
+ }, C = () => {
78
87
  let { apiGatewayUrl: n } = e(), i = r();
79
88
  return t({
80
89
  mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionAsset($id: ID!, $status: TheAssetStatus!) {
@@ -87,13 +96,13 @@ var a = () => {
87
96
  i.invalidateQueries({ queryKey: s.assets }), i.invalidateQueries({ queryKey: s.asset(e.id) });
88
97
  }
89
98
  });
90
- }, x = () => {
99
+ }, w = () => {
91
100
  let { apiGatewayUrl: n } = e(), i = r();
92
101
  return t({
93
102
  mutationFn: async (e) => (await o("mutation TheRetireAsset($id: ID!) { theRetireAsset(id: $id) }", { id: e }, n)).theRetireAsset,
94
103
  onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
95
104
  });
96
- }, S = (t = {}) => {
105
+ }, T = (t = {}) => {
97
106
  let { apiGatewayUrl: r } = e();
98
107
  return n({
99
108
  queryKey: [...s.production, t],
@@ -107,7 +116,7 @@ var a = () => {
107
116
  pagination: t.pagination ?? c
108
117
  }, r)).theListProductionRecords
109
118
  });
110
- }, C = () => {
119
+ }, E = () => {
111
120
  let { apiGatewayUrl: n } = e(), i = r();
112
121
  return t({
113
122
  mutationFn: async (e) => (await o(`mutation TheRecordProduction($input: TheRecordProductionInput!) {
@@ -117,7 +126,7 @@ var a = () => {
117
126
  i.invalidateQueries({ queryKey: s.production }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
118
127
  }
119
128
  });
120
- }, w = (t, r, i) => {
129
+ }, D = (t, r, i) => {
121
130
  let { apiGatewayUrl: a } = e();
122
131
  return n({
123
132
  queryKey: [
@@ -137,7 +146,7 @@ var a = () => {
137
146
  pagination: i ?? c
138
147
  }, a)).theListReserveEstimates
139
148
  });
140
- }, T = () => {
149
+ }, O = () => {
141
150
  let { apiGatewayUrl: n } = e(), i = r();
142
151
  return t({
143
152
  mutationFn: async (e) => (await o(`mutation TheCreateReserveEstimate($input: TheCreateReserveEstimateInput!) {
@@ -147,7 +156,7 @@ var a = () => {
147
156
  i.invalidateQueries({ queryKey: s.reserves }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
148
157
  }
149
158
  });
150
- }, E = (t = {}) => {
159
+ }, k = (t = {}) => {
151
160
  let { apiGatewayUrl: r } = e();
152
161
  return n({
153
162
  queryKey: [...s.contracts, t],
@@ -163,7 +172,7 @@ var a = () => {
163
172
  pagination: t.pagination ?? c
164
173
  }, r)).theListContracts
165
174
  });
166
- }, D = (t) => {
175
+ }, A = (t) => {
167
176
  let { apiGatewayUrl: r } = e();
168
177
  return n({
169
178
  queryKey: s.contract(t ?? ""),
@@ -172,7 +181,7 @@ var a = () => {
172
181
  theContract(id: $id) { ${f} }
173
182
  }`, { id: t }, r)).theContract
174
183
  });
175
- }, O = () => {
184
+ }, j = () => {
176
185
  let { apiGatewayUrl: n } = e(), i = r();
177
186
  return t({
178
187
  mutationFn: async (e) => (await o(`mutation TheCreateContract($input: TheCreateOfftakeContractInput!) {
@@ -180,7 +189,7 @@ var a = () => {
180
189
  }`, { input: e }, n)).theCreateContract,
181
190
  onSuccess: () => i.invalidateQueries({ queryKey: s.contracts })
182
191
  });
183
- }, k = () => {
192
+ }, M = () => {
184
193
  let { apiGatewayUrl: n } = e(), i = r();
185
194
  return t({
186
195
  mutationFn: async ({ id: e, input: t }) => (await o(`mutation TheUpdateContract($id: ID!, $input: TheUpdateOfftakeContractInput!) {
@@ -193,7 +202,7 @@ var a = () => {
193
202
  i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
194
203
  }
195
204
  });
196
- }, A = () => {
205
+ }, N = () => {
197
206
  let { apiGatewayUrl: n } = e(), i = r();
198
207
  return t({
199
208
  mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionContract($id: ID!, $status: TheContractStatus!) {
@@ -206,7 +215,7 @@ var a = () => {
206
215
  i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
207
216
  }
208
217
  });
209
- }, j = (t, r, i) => {
218
+ }, P = (t, r, i) => {
210
219
  let { apiGatewayUrl: a } = e();
211
220
  return n({
212
221
  queryKey: [
@@ -226,7 +235,7 @@ var a = () => {
226
235
  pagination: i ?? c
227
236
  }, a)).theListShipments
228
237
  });
229
- }, M = () => {
238
+ }, F = () => {
230
239
  let { apiGatewayUrl: n } = e(), i = r();
231
240
  return t({
232
241
  mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionShipment($id: ID!, $status: TheShipmentStatus!) {
@@ -239,7 +248,7 @@ var a = () => {
239
248
  i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
240
249
  }
241
250
  });
242
- }, N = () => {
251
+ }, I = () => {
243
252
  let { apiGatewayUrl: n } = e(), i = r();
244
253
  return t({
245
254
  mutationFn: async (e) => (await o(`mutation TheScheduleShipment($input: TheCreateShipmentInput!) {
@@ -249,7 +258,7 @@ var a = () => {
249
258
  i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
250
259
  }
251
260
  });
252
- }, P = () => {
261
+ }, ee = () => {
253
262
  let { apiGatewayUrl: n } = e(), i = r();
254
263
  return t({
255
264
  mutationFn: async (e) => (await o(`mutation TheDeliverShipment($id: ID!) {
@@ -259,7 +268,7 @@ var a = () => {
259
268
  i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
260
269
  }
261
270
  });
262
- }, F = (t = {}) => {
271
+ }, L = (t = {}) => {
263
272
  let { apiGatewayUrl: r } = e();
264
273
  return n({
265
274
  queryKey: [...s.inventory, t],
@@ -274,7 +283,7 @@ var a = () => {
274
283
  pagination: t.pagination ?? c
275
284
  }, r)).theListInventoryLots
276
285
  });
277
- }, I = () => {
286
+ }, R = () => {
278
287
  let { apiGatewayUrl: n } = e(), i = r();
279
288
  return t({
280
289
  mutationFn: async (e) => (await o(`mutation TheCreateInventoryLot($input: TheCreateInventoryLotInput!) {
@@ -282,7 +291,7 @@ var a = () => {
282
291
  }`, { input: e }, n)).theCreateInventoryLot,
283
292
  onSuccess: () => i.invalidateQueries({ queryKey: s.inventory })
284
293
  });
285
- }, L = () => {
294
+ }, z = () => {
286
295
  let { apiGatewayUrl: n } = e(), i = r();
287
296
  return t({
288
297
  mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheSetInventoryLotStatus($id: ID!, $status: TheInventoryStatus!) {
@@ -293,7 +302,7 @@ var a = () => {
293
302
  }, n)).theSetInventoryLotStatus,
294
303
  onSuccess: () => i.invalidateQueries({ queryKey: s.inventory })
295
304
  });
296
- }, R = (t = {}) => {
305
+ }, B = (t = {}) => {
297
306
  let { apiGatewayUrl: r } = e();
298
307
  return n({
299
308
  queryKey: [...s.emissions, t],
@@ -308,7 +317,7 @@ var a = () => {
308
317
  pagination: t.pagination ?? c
309
318
  }, r)).theListEmissionRecords
310
319
  });
311
- }, z = () => {
320
+ }, V = () => {
312
321
  let { apiGatewayUrl: n } = e(), i = r();
313
322
  return t({
314
323
  mutationFn: async (e) => (await o(`mutation TheRecordEmission($input: TheRecordEmissionInput!) {
@@ -316,7 +325,7 @@ var a = () => {
316
325
  }`, { input: e }, n)).theRecordEmission,
317
326
  onSuccess: () => i.invalidateQueries({ queryKey: s.emissions })
318
327
  });
319
- }, B = () => {
328
+ }, H = () => {
320
329
  let { apiGatewayUrl: n } = e(), i = r();
321
330
  return t({
322
331
  mutationFn: async (e) => (await o(`mutation TheVerifyEmission($id: ID!) {
@@ -324,7 +333,7 @@ var a = () => {
324
333
  }`, { id: e }, n)).theVerifyEmission,
325
334
  onSuccess: () => i.invalidateQueries({ queryKey: s.emissions })
326
335
  });
327
- }, V = (t, r, i, a) => {
336
+ }, U = (t, r, i, a) => {
328
337
  let { apiGatewayUrl: l } = e();
329
338
  return n({
330
339
  queryKey: [
@@ -346,7 +355,7 @@ var a = () => {
346
355
  pagination: a ?? c
347
356
  }, l)).theListComplianceCerts
348
357
  });
349
- }, H = () => {
358
+ }, W = () => {
350
359
  let { apiGatewayUrl: n } = e(), i = r();
351
360
  return t({
352
361
  mutationFn: async (e) => (await o(`mutation TheCreateComplianceCert($input: TheCreateComplianceCertInput!) {
@@ -354,7 +363,7 @@ var a = () => {
354
363
  }`, { input: e }, n)).theCreateComplianceCert,
355
364
  onSuccess: () => i.invalidateQueries({ queryKey: s.compliance })
356
365
  });
357
- }, U = () => {
366
+ }, G = () => {
358
367
  let { apiGatewayUrl: n } = e(), i = r();
359
368
  return t({
360
369
  mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionComplianceCert($id: ID!, $status: TheComplianceStatus!) {
@@ -367,8 +376,140 @@ var a = () => {
367
376
  i.invalidateQueries({ queryKey: s.compliance }), i.invalidateQueries({ queryKey: s.complianceCert(e.id) });
368
377
  }
369
378
  });
379
+ }, K = (t = {}) => {
380
+ let { apiGatewayUrl: r } = e();
381
+ return n({
382
+ queryKey: [...s.safetyIncidents, t],
383
+ queryFn: async () => (await o(`query TheListSafetyIncidents($assetId: ID, $category: TheSafetyIncidentCategory, $severity: TheSafetyIncidentSeverity, $status: TheSafetyIncidentStatus, $pagination: PaginationInput) {
384
+ theListSafetyIncidents(assetId: $assetId, category: $category, severity: $severity, status: $status, pagination: $pagination) {
385
+ items { ${v} }
386
+ pageInfo { cursor hasMore }
387
+ }
388
+ }`, {
389
+ assetId: t.assetId,
390
+ category: t.category,
391
+ severity: t.severity,
392
+ status: t.status,
393
+ pagination: t.pagination ?? c
394
+ }, r)).theListSafetyIncidents
395
+ });
396
+ }, q = () => {
397
+ let { apiGatewayUrl: n } = e(), i = r();
398
+ return t({
399
+ mutationFn: async (e) => (await o(`mutation TheReportSafetyIncident($input: TheReportSafetyIncidentInput!) {
400
+ theReportSafetyIncident(input: $input) { ${v} }
401
+ }`, { input: e }, n)).theReportSafetyIncident,
402
+ onSuccess: () => {
403
+ i.invalidateQueries({ queryKey: s.safetyIncidents }), i.invalidateQueries({ queryKey: s.safetyDashboard });
404
+ }
405
+ });
406
+ }, J = () => {
407
+ let { apiGatewayUrl: n } = e(), i = r();
408
+ return t({
409
+ mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionSafetyIncident($id: ID!, $status: TheSafetyIncidentStatus!) {
410
+ theTransitionSafetyIncident(id: $id, status: $status) { ${v} }
411
+ }`, {
412
+ id: e,
413
+ status: t
414
+ }, n)).theTransitionSafetyIncident,
415
+ onSuccess: (e) => {
416
+ i.invalidateQueries({ queryKey: s.safetyIncidents }), i.invalidateQueries({ queryKey: s.safetyIncident(e.id) }), i.invalidateQueries({ queryKey: s.safetyDashboard });
417
+ }
418
+ });
419
+ }, Y = () => {
420
+ let { apiGatewayUrl: n } = e(), i = r();
421
+ return t({
422
+ mutationFn: async ({ id: e, investigationNotes: t }) => (await o(`mutation TheUpdateIncidentInvestigation($id: ID!, $investigationNotes: String!) {
423
+ theUpdateIncidentInvestigation(id: $id, investigationNotes: $investigationNotes) { ${v} }
424
+ }`, {
425
+ id: e,
426
+ investigationNotes: t
427
+ }, n)).theUpdateIncidentInvestigation,
428
+ onSuccess: (e) => {
429
+ i.invalidateQueries({ queryKey: s.safetyIncidents }), i.invalidateQueries({ queryKey: s.safetyIncident(e.id) });
430
+ }
431
+ });
432
+ }, X = (t, r, i) => {
433
+ let { apiGatewayUrl: a } = e();
434
+ return n({
435
+ queryKey: [
436
+ ...s.correctiveActions,
437
+ t ?? null,
438
+ r ?? null,
439
+ i ?? null
440
+ ],
441
+ queryFn: async () => (await o(`query TheListCorrectiveActions($incidentId: ID, $status: TheCorrectiveActionStatus, $pagination: PaginationInput) {
442
+ theListCorrectiveActions(incidentId: $incidentId, status: $status, pagination: $pagination) {
443
+ items { ${y} }
444
+ pageInfo { cursor hasMore }
445
+ }
446
+ }`, {
447
+ incidentId: t,
448
+ status: r,
449
+ pagination: i ?? c
450
+ }, a)).theListCorrectiveActions
451
+ });
452
+ }, Z = () => {
453
+ let { apiGatewayUrl: n } = e(), i = r();
454
+ return t({
455
+ mutationFn: async (e) => (await o(`mutation TheCreateCorrectiveAction($input: TheCreateCorrectiveActionInput!) {
456
+ theCreateCorrectiveAction(input: $input) { ${y} }
457
+ }`, { input: e }, n)).theCreateCorrectiveAction,
458
+ onSuccess: () => {
459
+ i.invalidateQueries({ queryKey: s.correctiveActions }), i.invalidateQueries({ queryKey: s.safetyDashboard });
460
+ }
461
+ });
462
+ }, Q = () => {
463
+ let { apiGatewayUrl: n } = e(), i = r();
464
+ return t({
465
+ mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionCorrectiveAction($id: ID!, $status: TheCorrectiveActionStatus!) {
466
+ theTransitionCorrectiveAction(id: $id, status: $status) { ${y} }
467
+ }`, {
468
+ id: e,
469
+ status: t
470
+ }, n)).theTransitionCorrectiveAction,
471
+ onSuccess: () => {
472
+ i.invalidateQueries({ queryKey: s.correctiveActions }), i.invalidateQueries({ queryKey: s.safetyDashboard });
473
+ }
474
+ });
475
+ }, $ = () => {
476
+ let { apiGatewayUrl: t } = e();
477
+ return n({
478
+ queryKey: s.safetyDashboard,
479
+ queryFn: async () => (await o("query TheSafetyDashboard {\n theSafetyDashboard {\n openIncidents\n byCategory { category count }\n bySeverity { severity count }\n openCorrectiveActions\n overdueCorrectiveActions\n }\n }", {}, t)).theSafetyDashboard
480
+ });
481
+ }, te = (t = {}) => {
482
+ let { apiGatewayUrl: r } = e();
483
+ return n({
484
+ queryKey: [...s.esgDisclosures, t],
485
+ queryFn: async () => (await o(`query TheListEsgDisclosures($framework: TheEsgFramework, $pagination: PaginationInput) {
486
+ theListEsgDisclosures(framework: $framework, pagination: $pagination) {
487
+ items { ${_} }
488
+ pageInfo { cursor hasMore }
489
+ }
490
+ }`, {
491
+ framework: t.framework,
492
+ pagination: t.pagination ?? c
493
+ }, r)).theListEsgDisclosures
494
+ });
495
+ }, ne = () => {
496
+ let { apiGatewayUrl: n } = e(), i = r();
497
+ return t({
498
+ mutationFn: async (e) => (await o(`mutation TheGenerateEsgDisclosure($input: TheGenerateEsgDisclosureInput!) {
499
+ theGenerateEsgDisclosure(input: $input) { ${_} }
500
+ }`, { input: e }, n)).theGenerateEsgDisclosure,
501
+ onSuccess: () => i.invalidateQueries({ queryKey: s.esgDisclosures })
502
+ });
503
+ }, re = () => {
504
+ let { apiGatewayUrl: n } = e(), i = r();
505
+ return t({
506
+ mutationFn: async (e) => (await o(`mutation TheFinalizeEsgDisclosure($id: ID!) {
507
+ theFinalizeEsgDisclosure(id: $id) { ${_} }
508
+ }`, { id: e }, n)).theFinalizeEsgDisclosure,
509
+ onSuccess: () => i.invalidateQueries({ queryKey: s.esgDisclosures })
510
+ });
370
511
  };
371
512
  //#endregion
372
- export { v as useTheAsset, _ as useTheAssets, V as useTheComplianceCerts, D as useTheContract, E as useTheContracts, y as useTheCreateAsset, H as useTheCreateComplianceCert, O as useTheCreateContract, I as useTheCreateInventoryLot, T as useTheCreateReserveEstimate, P as useTheDeliverShipment, R as useTheEmissionRecords, F as useTheInventoryLots, S as useTheProductionRecords, z as useTheRecordEmission, C as useTheRecordProduction, w as useTheReserveEstimates, x as useTheRetireAsset, N as useTheScheduleShipment, L as useTheSetInventoryLotStatus, j as useTheShipments, b as useTheTransitionAsset, U as useTheTransitionComplianceCert, A as useTheTransitionContract, M as useTheTransitionShipment, k as useTheUpdateContract, B as useTheVerifyEmission };
513
+ export { x as useTheAsset, b as useTheAssets, U as useTheComplianceCerts, A as useTheContract, k as useTheContracts, X as useTheCorrectiveActions, S as useTheCreateAsset, W as useTheCreateComplianceCert, j as useTheCreateContract, Z as useTheCreateCorrectiveAction, R as useTheCreateInventoryLot, O as useTheCreateReserveEstimate, ee as useTheDeliverShipment, B as useTheEmissionRecords, te as useTheEsgDisclosures, re as useTheFinalizeEsgDisclosure, ne as useTheGenerateEsgDisclosure, L as useTheInventoryLots, T as useTheProductionRecords, V as useTheRecordEmission, E as useTheRecordProduction, q as useTheReportSafetyIncident, D as useTheReserveEstimates, w as useTheRetireAsset, $ as useTheSafetyDashboard, K as useTheSafetyIncidents, I as useTheScheduleShipment, z as useTheSetInventoryLotStatus, P as useTheShipments, C as useTheTransitionAsset, G as useTheTransitionComplianceCert, N as useTheTransitionContract, Q as useTheTransitionCorrectiveAction, J as useTheTransitionSafetyIncident, F as useTheTransitionShipment, M as useTheUpdateContract, Y as useTheUpdateIncidentInvestigation, H as useTheVerifyEmission };
373
514
 
374
515
  //# sourceMappingURL=useTheGlobalFuelApi.js.map
@@ -1 +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 TheUpdateShipmentInput,\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 discoveryAt area reservoirType waterDepth\n createdAt updatedAt\n`;\n\nconst PRODUCTION_FIELDS = `\n id workspaceId assetId periodStart periodEnd volume unit grade downtimeHours\n source 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 createdAt updatedAt\n`;\n\nconst SHIPMENT_FIELDS = `\n id workspaceId contractId reference mode status carrier trackingId 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 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) { ${ASSET_FIELDS} }\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 = (\n assetId?: string,\n category?: TheReserveCategory,\n pagination?: PaginationInput\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.reserves, assetId ?? null, category ?? null, pagination ?? null],\n queryFn: async () => {\n const data = await theQuery<{ theListReserveEstimates: TheConnection<TheReserveEstimate> }>(\n `query TheListReserveEstimates($assetId: ID, $category: TheReserveCategory, $pagination: PaginationInput) {\n theListReserveEstimates(assetId: $assetId, category: $category, pagination: $pagination) {\n items { ${RESERVE_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { assetId, category, pagination: pagination ?? DEFAULT_PAGE },\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) { ${CONTRACT_FIELDS} }\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 = (\n contractId?: string,\n status?: TheShipmentStatus,\n pagination?: PaginationInput\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.shipments, contractId ?? null, status ?? null, pagination ?? null],\n queryFn: async () => {\n const data = await theQuery<{ theListShipments: TheConnection<TheShipment> }>(\n `query TheListShipments($contractId: ID, $status: TheShipmentStatus, $pagination: PaginationInput) {\n theListShipments(contractId: $contractId, status: $status, pagination: $pagination) {\n items { ${SHIPMENT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { contractId, status, pagination: pagination ?? DEFAULT_PAGE },\n apiGatewayUrl\n );\n return data.theListShipments;\n },\n });\n};\n\nexport const useTheTransitionShipment = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheShipmentStatus }) => {\n const data = await theQuery<{ theTransitionShipment: TheShipment }>(\n `mutation TheTransitionShipment($id: ID!, $status: TheShipmentStatus!) {\n theTransitionShipment(id: $id, status: $status) { ${SHIPMENT_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theTransitionShipment;\n },\n onSuccess: (s) => {\n qc.invalidateQueries({ queryKey: KEY.shipments });\n qc.invalidateQueries({ queryKey: KEY.contract(s.contractId) });\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\n/**\n * Update the logistics metadata of an existing shipment (carrier, tracking\n * number, route, schedule, document, notes). Status/volume are not editable\n * here — use the transition/deliver mutations for those.\n */\nexport const useTheUpdateShipment = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, input }: { id: string; input: TheUpdateShipmentInput }) => {\n const data = await theQuery<{ theUpdateShipment: TheShipment }>(\n `mutation TheUpdateShipment($id: ID!, $input: TheUpdateShipmentInput!) {\n theUpdateShipment(id: $id, input: $input) { ${SHIPMENT_FIELDS} }\n }`,\n { id, input },\n apiGatewayUrl\n );\n return data.theUpdateShipment;\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 pagination?: PaginationInput\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [\n ...KEY.compliance,\n assetId ?? null,\n category ?? null,\n status ?? null,\n pagination ?? null,\n ],\n queryFn: async () => {\n const data = await theQuery<{ theListComplianceCerts: TheConnection<TheComplianceCert> }>(\n `query TheListComplianceCerts($assetId: ID, $category: TheComplianceCategory, $status: TheComplianceStatus, $pagination: PaginationInput) {\n theListComplianceCerts(assetId: $assetId, category: $category, status: $status, pagination: $pagination) {\n items { ${COMPLIANCE_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { assetId, category, status, pagination: pagination ?? DEFAULT_PAGE },\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":";;;;;AAqEA,IAAM,UAAqC;CACzC,IAAM,IAAI;AAGV,CAFA,EAAE,6BAA6B,OAAO,EACtC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}
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 TheEsgDisclosure,\n TheEsgFramework,\n TheGenerateEsgDisclosureInput,\n TheCreateAssetInput,\n TheUpdateAssetInput,\n TheRecordProductionInput,\n TheCreateReserveEstimateInput,\n TheCreateOfftakeContractInput,\n TheUpdateOfftakeContractInput,\n TheCreateShipmentInput,\n TheUpdateShipmentInput,\n TheCreateInventoryLotInput,\n TheRecordEmissionInput,\n TheCreateComplianceCertInput,\n TheSafetyIncident,\n TheSafetyIncidentCategory,\n TheSafetyIncidentSeverity,\n TheSafetyIncidentStatus,\n TheCorrectiveAction,\n TheCorrectiveActionStatus,\n TheSafetyDashboard,\n TheReportSafetyIncidentInput,\n TheCreateCorrectiveActionInput,\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 esgDisclosures: ['theglobalfuel', 'esg-disclosures'] as const,\n safetyIncidents: ['theglobalfuel', 'safety-incidents'] as const,\n safetyIncident: (id: string) => ['theglobalfuel', 'safety-incident', id] as const,\n correctiveActions: ['theglobalfuel', 'corrective-actions'] as const,\n safetyDashboard: ['theglobalfuel', 'safety-dashboard'] 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 discoveryAt area reservoirType waterDepth\n createdAt updatedAt\n`;\n\nconst PRODUCTION_FIELDS = `\n id workspaceId assetId periodStart periodEnd volume unit grade downtimeHours\n source 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 createdAt updatedAt\n`;\n\nconst SHIPMENT_FIELDS = `\n id workspaceId contractId reference mode status carrier trackingId 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 createdAt updatedAt\n`;\n\nconst ESG_DISCLOSURE_FIELDS = `\n id workspaceId framework status periodStart periodEnd datapoints generatedAt\n notes createdAt updatedAt\n`;\n\nconst SAFETY_INCIDENT_FIELDS = `\n id workspaceId assetId category severity status title description occurredAt\n involvedParties linkedProductionRecordId linkedComplianceCertId\n investigationNotes evidence { id } closedAt notes createdAt updatedAt\n`;\n\nconst CORRECTIVE_ACTION_FIELDS = `\n id workspaceId incidentId description status ownerId dueDate closedAt notes\n 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) { ${ASSET_FIELDS} }\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 = (\n assetId?: string,\n category?: TheReserveCategory,\n pagination?: PaginationInput\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.reserves, assetId ?? null, category ?? null, pagination ?? null],\n queryFn: async () => {\n const data = await theQuery<{ theListReserveEstimates: TheConnection<TheReserveEstimate> }>(\n `query TheListReserveEstimates($assetId: ID, $category: TheReserveCategory, $pagination: PaginationInput) {\n theListReserveEstimates(assetId: $assetId, category: $category, pagination: $pagination) {\n items { ${RESERVE_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { assetId, category, pagination: pagination ?? DEFAULT_PAGE },\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) { ${CONTRACT_FIELDS} }\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 = (\n contractId?: string,\n status?: TheShipmentStatus,\n pagination?: PaginationInput\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.shipments, contractId ?? null, status ?? null, pagination ?? null],\n queryFn: async () => {\n const data = await theQuery<{ theListShipments: TheConnection<TheShipment> }>(\n `query TheListShipments($contractId: ID, $status: TheShipmentStatus, $pagination: PaginationInput) {\n theListShipments(contractId: $contractId, status: $status, pagination: $pagination) {\n items { ${SHIPMENT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { contractId, status, pagination: pagination ?? DEFAULT_PAGE },\n apiGatewayUrl\n );\n return data.theListShipments;\n },\n });\n};\n\nexport const useTheTransitionShipment = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheShipmentStatus }) => {\n const data = await theQuery<{ theTransitionShipment: TheShipment }>(\n `mutation TheTransitionShipment($id: ID!, $status: TheShipmentStatus!) {\n theTransitionShipment(id: $id, status: $status) { ${SHIPMENT_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theTransitionShipment;\n },\n onSuccess: (s) => {\n qc.invalidateQueries({ queryKey: KEY.shipments });\n qc.invalidateQueries({ queryKey: KEY.contract(s.contractId) });\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\n/**\n * Update the logistics metadata of an existing shipment (carrier, tracking\n * number, route, schedule, document, notes). Status/volume are not editable\n * here — use the transition/deliver mutations for those.\n */\nexport const useTheUpdateShipment = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, input }: { id: string; input: TheUpdateShipmentInput }) => {\n const data = await theQuery<{ theUpdateShipment: TheShipment }>(\n `mutation TheUpdateShipment($id: ID!, $input: TheUpdateShipmentInput!) {\n theUpdateShipment(id: $id, input: $input) { ${SHIPMENT_FIELDS} }\n }`,\n { id, input },\n apiGatewayUrl\n );\n return data.theUpdateShipment;\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 pagination?: PaginationInput\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [\n ...KEY.compliance,\n assetId ?? null,\n category ?? null,\n status ?? null,\n pagination ?? null,\n ],\n queryFn: async () => {\n const data = await theQuery<{ theListComplianceCerts: TheConnection<TheComplianceCert> }>(\n `query TheListComplianceCerts($assetId: ID, $category: TheComplianceCategory, $status: TheComplianceStatus, $pagination: PaginationInput) {\n theListComplianceCerts(assetId: $assetId, category: $category, status: $status, pagination: $pagination) {\n items { ${COMPLIANCE_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { assetId, category, status, pagination: pagination ?? DEFAULT_PAGE },\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\n// ============================================================================\n// Safety — Process safety & EHS incidents (BOFF-4186)\n// ============================================================================\n\nexport interface SafetyIncidentFilters {\n assetId?: string;\n category?: TheSafetyIncidentCategory;\n severity?: TheSafetyIncidentSeverity;\n status?: TheSafetyIncidentStatus;\n pagination?: PaginationInput;\n}\n\nexport const useTheSafetyIncidents = (filters: SafetyIncidentFilters = {}) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.safetyIncidents, filters],\n queryFn: async () => {\n const data = await theQuery<{\n theListSafetyIncidents: TheConnection<TheSafetyIncident>;\n }>(\n `query TheListSafetyIncidents($assetId: ID, $category: TheSafetyIncidentCategory, $severity: TheSafetyIncidentSeverity, $status: TheSafetyIncidentStatus, $pagination: PaginationInput) {\n theListSafetyIncidents(assetId: $assetId, category: $category, severity: $severity, status: $status, pagination: $pagination) {\n items { ${SAFETY_INCIDENT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n assetId: filters.assetId,\n category: filters.category,\n severity: filters.severity,\n status: filters.status,\n pagination: filters.pagination ?? DEFAULT_PAGE,\n },\n apiGatewayUrl\n );\n return data.theListSafetyIncidents;\n },\n });\n};\n\nexport const useTheSafetyIncident = (id: string | undefined) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: KEY.safetyIncident(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const data = await theQuery<{ theSafetyIncident: TheSafetyIncident | null }>(\n `query TheSafetyIncident($id: ID!) {\n theSafetyIncident(id: $id) { ${SAFETY_INCIDENT_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.theSafetyIncident;\n },\n });\n};\n\nexport const useTheReportSafetyIncident = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheReportSafetyIncidentInput) => {\n const data = await theQuery<{ theReportSafetyIncident: TheSafetyIncident }>(\n `mutation TheReportSafetyIncident($input: TheReportSafetyIncidentInput!) {\n theReportSafetyIncident(input: $input) { ${SAFETY_INCIDENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theReportSafetyIncident;\n },\n onSuccess: () => {\n qc.invalidateQueries({ queryKey: KEY.safetyIncidents });\n qc.invalidateQueries({ queryKey: KEY.safetyDashboard });\n },\n });\n};\n\nexport const useTheTransitionSafetyIncident = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheSafetyIncidentStatus }) => {\n const data = await theQuery<{ theTransitionSafetyIncident: TheSafetyIncident }>(\n `mutation TheTransitionSafetyIncident($id: ID!, $status: TheSafetyIncidentStatus!) {\n theTransitionSafetyIncident(id: $id, status: $status) { ${SAFETY_INCIDENT_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theTransitionSafetyIncident;\n },\n onSuccess: (incident) => {\n qc.invalidateQueries({ queryKey: KEY.safetyIncidents });\n qc.invalidateQueries({ queryKey: KEY.safetyIncident(incident.id) });\n qc.invalidateQueries({ queryKey: KEY.safetyDashboard });\n },\n });\n};\n\nexport const useTheUpdateIncidentInvestigation = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, investigationNotes }: { id: string; investigationNotes: string }) => {\n const data = await theQuery<{ theUpdateIncidentInvestigation: TheSafetyIncident }>(\n `mutation TheUpdateIncidentInvestigation($id: ID!, $investigationNotes: String!) {\n theUpdateIncidentInvestigation(id: $id, investigationNotes: $investigationNotes) { ${SAFETY_INCIDENT_FIELDS} }\n }`,\n { id, investigationNotes },\n apiGatewayUrl\n );\n return data.theUpdateIncidentInvestigation;\n },\n onSuccess: (incident) => {\n qc.invalidateQueries({ queryKey: KEY.safetyIncidents });\n qc.invalidateQueries({ queryKey: KEY.safetyIncident(incident.id) });\n },\n });\n};\n\nexport const useTheCorrectiveActions = (\n incidentId?: string,\n status?: TheCorrectiveActionStatus,\n pagination?: PaginationInput\n) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.correctiveActions, incidentId ?? null, status ?? null, pagination ?? null],\n queryFn: async () => {\n const data = await theQuery<{\n theListCorrectiveActions: TheConnection<TheCorrectiveAction>;\n }>(\n `query TheListCorrectiveActions($incidentId: ID, $status: TheCorrectiveActionStatus, $pagination: PaginationInput) {\n theListCorrectiveActions(incidentId: $incidentId, status: $status, pagination: $pagination) {\n items { ${CORRECTIVE_ACTION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { incidentId, status, pagination: pagination ?? DEFAULT_PAGE },\n apiGatewayUrl\n );\n return data.theListCorrectiveActions;\n },\n });\n};\n\nexport const useTheCreateCorrectiveAction = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheCreateCorrectiveActionInput) => {\n const data = await theQuery<{ theCreateCorrectiveAction: TheCorrectiveAction }>(\n `mutation TheCreateCorrectiveAction($input: TheCreateCorrectiveActionInput!) {\n theCreateCorrectiveAction(input: $input) { ${CORRECTIVE_ACTION_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theCreateCorrectiveAction;\n },\n onSuccess: () => {\n qc.invalidateQueries({ queryKey: KEY.correctiveActions });\n qc.invalidateQueries({ queryKey: KEY.safetyDashboard });\n },\n });\n};\n\nexport const useTheTransitionCorrectiveAction = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async ({ id, status }: { id: string; status: TheCorrectiveActionStatus }) => {\n const data = await theQuery<{ theTransitionCorrectiveAction: TheCorrectiveAction }>(\n `mutation TheTransitionCorrectiveAction($id: ID!, $status: TheCorrectiveActionStatus!) {\n theTransitionCorrectiveAction(id: $id, status: $status) { ${CORRECTIVE_ACTION_FIELDS} }\n }`,\n { id, status },\n apiGatewayUrl\n );\n return data.theTransitionCorrectiveAction;\n },\n onSuccess: () => {\n qc.invalidateQueries({ queryKey: KEY.correctiveActions });\n qc.invalidateQueries({ queryKey: KEY.safetyDashboard });\n },\n });\n};\n\nexport const useTheSafetyDashboard = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: KEY.safetyDashboard,\n queryFn: async () => {\n const data = await theQuery<{ theSafetyDashboard: TheSafetyDashboard }>(\n `query TheSafetyDashboard {\n theSafetyDashboard {\n openIncidents\n byCategory { category count }\n bySeverity { severity count }\n openCorrectiveActions\n overdueCorrectiveActions\n }\n }`,\n {},\n apiGatewayUrl\n );\n return data.theSafetyDashboard;\n },\n });\n};\n\n// ============================================================================\n// Sustainability — ESG framework disclosures (BOFF-4185)\n// ============================================================================\n\nexport interface EsgDisclosureFilters {\n framework?: TheEsgFramework;\n pagination?: PaginationInput;\n}\n\nexport const useTheEsgDisclosures = (filters: EsgDisclosureFilters = {}) => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n return useQuery({\n queryKey: [...KEY.esgDisclosures, filters],\n queryFn: async () => {\n const data = await theQuery<{ theListEsgDisclosures: TheConnection<TheEsgDisclosure> }>(\n `query TheListEsgDisclosures($framework: TheEsgFramework, $pagination: PaginationInput) {\n theListEsgDisclosures(framework: $framework, pagination: $pagination) {\n items { ${ESG_DISCLOSURE_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { framework: filters.framework, pagination: filters.pagination ?? DEFAULT_PAGE },\n apiGatewayUrl\n );\n return data.theListEsgDisclosures;\n },\n });\n};\n\nexport const useTheGenerateEsgDisclosure = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: TheGenerateEsgDisclosureInput) => {\n const data = await theQuery<{ theGenerateEsgDisclosure: TheEsgDisclosure }>(\n `mutation TheGenerateEsgDisclosure($input: TheGenerateEsgDisclosureInput!) {\n theGenerateEsgDisclosure(input: $input) { ${ESG_DISCLOSURE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return data.theGenerateEsgDisclosure;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.esgDisclosures }),\n });\n};\n\nexport const useTheFinalizeEsgDisclosure = () => {\n const { apiGatewayUrl } = useTheGlobalFuel();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const data = await theQuery<{ theFinalizeEsgDisclosure: TheEsgDisclosure }>(\n `mutation TheFinalizeEsgDisclosure($id: ID!) {\n theFinalizeEsgDisclosure(id: $id) { ${ESG_DISCLOSURE_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return data.theFinalizeEsgDisclosure;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.esgDisclosures }),\n });\n};\n"],"mappings":";;;;;AAiFA,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,QAHI,iBAAiB,KAAK,EAAM,IAC9B,GAAwB,EAEnB,EAAS;GAIZ,IAAM;CACV,QAAQ,CAAC,iBAAiB,SAAS;CACnC,QAAQ,MAAe;EAAC;EAAiB;EAAS;EAAG;CACrD,YAAY,CAAC,iBAAiB,aAAa;CAC3C,UAAU,CAAC,iBAAiB,WAAW;CACvC,WAAW,CAAC,iBAAiB,YAAY;CACzC,WAAW,MAAe;EAAC;EAAiB;EAAY;EAAG;CAC3D,WAAW,CAAC,iBAAiB,YAAY;CACzC,WAAW,CAAC,iBAAiB,YAAY;CACzC,WAAW,CAAC,iBAAiB,YAAY;CACzC,YAAY,CAAC,iBA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AU,EAAI,gBAAgB,CAAC;EACxE,CAAC;GAGS,WAAoC;CAC/C,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB;gDACwC,EAAsB;YAE9D,EAAE,OAAI,EACN,EACD,EACW;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAI,gBAAgB,CAAC;EACxE,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * ESG Disclosures — framework-aligned reporting built from live records.
3
+ * @module theglobalfuel/pages/esg-disclosures
4
+ *
5
+ * Report builder over the `the*` ESG disclosure API: pick a framework
6
+ * (GRI/SASB/CSRD/SEC climate/CDP) and a reporting period, and
7
+ * `theGenerateEsgDisclosure` computes the datapoints live from this
8
+ * workspace's own emission and compliance records — a disclosure is a derived
9
+ * snapshot, never a manually-entered form. Drafts can be finalized into the
10
+ * reported-on-record snapshot; every snapshot keeps its generation/audit
11
+ * timestamps so the trail holds up. No mock data.
12
+ */
13
+ export declare function EsgDisclosuresPage(): import("react").JSX.Element;
14
+ //# sourceMappingURL=EsgDisclosuresPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EsgDisclosuresPage.d.ts","sourceRoot":"","sources":["../../../../src/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA4FH,wBAAgB,kBAAkB,gCA4djC"}