@burdenoff/microfe-theglobalfuel 2026.731.1 → 2026.804.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.
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoot.js +67 -51
- package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js +34 -26
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
- package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -1
- package/dist/theglobalfuel/components/StatusBadge.js +18 -1
- package/dist/theglobalfuel/components/StatusBadge.js.map +1 -1
- package/dist/theglobalfuel/context/TheGlobalFuelContext.js +1 -1
- package/dist/theglobalfuel/context/TheGlobalFuelContext.js.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +26 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +139 -29
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +1 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/safety/IncidentsPage.d.ts +15 -0
- package/dist/theglobalfuel/pages/safety/IncidentsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/safety/IncidentsPage.js +611 -0
- package/dist/theglobalfuel/pages/safety/IncidentsPage.js.map +1 -0
- package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.d.ts +12 -0
- package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.js +175 -0
- package/dist/theglobalfuel/pages/safety/SafetyDashboardPage.js.map +1 -0
- package/dist/theglobalfuel/types/index.d.ts +74 -0
- package/dist/theglobalfuel/types/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -40,8 +40,16 @@ var a = () => {
|
|
|
40
40
|
"theglobalfuel",
|
|
41
41
|
"compliance",
|
|
42
42
|
e
|
|
43
|
-
]
|
|
44
|
-
|
|
43
|
+
],
|
|
44
|
+
safetyIncidents: ["theglobalfuel", "safety-incidents"],
|
|
45
|
+
safetyIncident: (e) => [
|
|
46
|
+
"theglobalfuel",
|
|
47
|
+
"safety-incident",
|
|
48
|
+
e
|
|
49
|
+
],
|
|
50
|
+
correctiveActions: ["theglobalfuel", "corrective-actions"],
|
|
51
|
+
safetyDashboard: ["theglobalfuel", "safety-dashboard"]
|
|
52
|
+
}, 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 assetId category severity status title description occurredAt\n involvedParties linkedProductionRecordId linkedComplianceCertId\n investigationNotes evidence { id } closedAt notes createdAt updatedAt\n", v = "\n id workspaceId incidentId description status ownerId dueDate closedAt notes\n createdAt updatedAt\n", y = (t = {}) => {
|
|
45
53
|
let { apiGatewayUrl: r } = e();
|
|
46
54
|
return n({
|
|
47
55
|
queryKey: [...s.assets, t],
|
|
@@ -57,7 +65,7 @@ var a = () => {
|
|
|
57
65
|
pagination: t.pagination ?? c
|
|
58
66
|
}, r)).theListAssets
|
|
59
67
|
});
|
|
60
|
-
},
|
|
68
|
+
}, b = (t) => {
|
|
61
69
|
let { apiGatewayUrl: r } = e();
|
|
62
70
|
return n({
|
|
63
71
|
queryKey: s.asset(t ?? ""),
|
|
@@ -66,7 +74,7 @@ var a = () => {
|
|
|
66
74
|
theAsset(id: $id) { ${l} }
|
|
67
75
|
}`, { id: t }, r)).theAsset
|
|
68
76
|
});
|
|
69
|
-
},
|
|
77
|
+
}, x = () => {
|
|
70
78
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
71
79
|
return t({
|
|
72
80
|
mutationFn: async (e) => (await o(`mutation TheCreateAsset($input: TheCreateAssetInput!) {
|
|
@@ -74,7 +82,7 @@ var a = () => {
|
|
|
74
82
|
}`, { input: e }, n)).theCreateAsset,
|
|
75
83
|
onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
|
|
76
84
|
});
|
|
77
|
-
},
|
|
85
|
+
}, S = () => {
|
|
78
86
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
79
87
|
return t({
|
|
80
88
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionAsset($id: ID!, $status: TheAssetStatus!) {
|
|
@@ -87,13 +95,13 @@ var a = () => {
|
|
|
87
95
|
i.invalidateQueries({ queryKey: s.assets }), i.invalidateQueries({ queryKey: s.asset(e.id) });
|
|
88
96
|
}
|
|
89
97
|
});
|
|
90
|
-
},
|
|
98
|
+
}, C = () => {
|
|
91
99
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
92
100
|
return t({
|
|
93
101
|
mutationFn: async (e) => (await o("mutation TheRetireAsset($id: ID!) { theRetireAsset(id: $id) }", { id: e }, n)).theRetireAsset,
|
|
94
102
|
onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
|
|
95
103
|
});
|
|
96
|
-
},
|
|
104
|
+
}, w = (t = {}) => {
|
|
97
105
|
let { apiGatewayUrl: r } = e();
|
|
98
106
|
return n({
|
|
99
107
|
queryKey: [...s.production, t],
|
|
@@ -107,7 +115,7 @@ var a = () => {
|
|
|
107
115
|
pagination: t.pagination ?? c
|
|
108
116
|
}, r)).theListProductionRecords
|
|
109
117
|
});
|
|
110
|
-
},
|
|
118
|
+
}, T = () => {
|
|
111
119
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
112
120
|
return t({
|
|
113
121
|
mutationFn: async (e) => (await o(`mutation TheRecordProduction($input: TheRecordProductionInput!) {
|
|
@@ -117,7 +125,7 @@ var a = () => {
|
|
|
117
125
|
i.invalidateQueries({ queryKey: s.production }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
|
|
118
126
|
}
|
|
119
127
|
});
|
|
120
|
-
},
|
|
128
|
+
}, E = (t, r, i) => {
|
|
121
129
|
let { apiGatewayUrl: a } = e();
|
|
122
130
|
return n({
|
|
123
131
|
queryKey: [
|
|
@@ -137,7 +145,7 @@ var a = () => {
|
|
|
137
145
|
pagination: i ?? c
|
|
138
146
|
}, a)).theListReserveEstimates
|
|
139
147
|
});
|
|
140
|
-
},
|
|
148
|
+
}, D = () => {
|
|
141
149
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
142
150
|
return t({
|
|
143
151
|
mutationFn: async (e) => (await o(`mutation TheCreateReserveEstimate($input: TheCreateReserveEstimateInput!) {
|
|
@@ -147,7 +155,7 @@ var a = () => {
|
|
|
147
155
|
i.invalidateQueries({ queryKey: s.reserves }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
|
|
148
156
|
}
|
|
149
157
|
});
|
|
150
|
-
},
|
|
158
|
+
}, O = (t = {}) => {
|
|
151
159
|
let { apiGatewayUrl: r } = e();
|
|
152
160
|
return n({
|
|
153
161
|
queryKey: [...s.contracts, t],
|
|
@@ -163,7 +171,7 @@ var a = () => {
|
|
|
163
171
|
pagination: t.pagination ?? c
|
|
164
172
|
}, r)).theListContracts
|
|
165
173
|
});
|
|
166
|
-
},
|
|
174
|
+
}, k = (t) => {
|
|
167
175
|
let { apiGatewayUrl: r } = e();
|
|
168
176
|
return n({
|
|
169
177
|
queryKey: s.contract(t ?? ""),
|
|
@@ -172,7 +180,7 @@ var a = () => {
|
|
|
172
180
|
theContract(id: $id) { ${f} }
|
|
173
181
|
}`, { id: t }, r)).theContract
|
|
174
182
|
});
|
|
175
|
-
},
|
|
183
|
+
}, A = () => {
|
|
176
184
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
177
185
|
return t({
|
|
178
186
|
mutationFn: async (e) => (await o(`mutation TheCreateContract($input: TheCreateOfftakeContractInput!) {
|
|
@@ -180,7 +188,7 @@ var a = () => {
|
|
|
180
188
|
}`, { input: e }, n)).theCreateContract,
|
|
181
189
|
onSuccess: () => i.invalidateQueries({ queryKey: s.contracts })
|
|
182
190
|
});
|
|
183
|
-
},
|
|
191
|
+
}, j = () => {
|
|
184
192
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
185
193
|
return t({
|
|
186
194
|
mutationFn: async ({ id: e, input: t }) => (await o(`mutation TheUpdateContract($id: ID!, $input: TheUpdateOfftakeContractInput!) {
|
|
@@ -193,7 +201,7 @@ var a = () => {
|
|
|
193
201
|
i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
|
|
194
202
|
}
|
|
195
203
|
});
|
|
196
|
-
},
|
|
204
|
+
}, M = () => {
|
|
197
205
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
198
206
|
return t({
|
|
199
207
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionContract($id: ID!, $status: TheContractStatus!) {
|
|
@@ -206,7 +214,7 @@ var a = () => {
|
|
|
206
214
|
i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
|
|
207
215
|
}
|
|
208
216
|
});
|
|
209
|
-
},
|
|
217
|
+
}, N = (t, r, i) => {
|
|
210
218
|
let { apiGatewayUrl: a } = e();
|
|
211
219
|
return n({
|
|
212
220
|
queryKey: [
|
|
@@ -226,7 +234,7 @@ var a = () => {
|
|
|
226
234
|
pagination: i ?? c
|
|
227
235
|
}, a)).theListShipments
|
|
228
236
|
});
|
|
229
|
-
},
|
|
237
|
+
}, P = () => {
|
|
230
238
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
231
239
|
return t({
|
|
232
240
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionShipment($id: ID!, $status: TheShipmentStatus!) {
|
|
@@ -239,7 +247,7 @@ var a = () => {
|
|
|
239
247
|
i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
|
|
240
248
|
}
|
|
241
249
|
});
|
|
242
|
-
},
|
|
250
|
+
}, F = () => {
|
|
243
251
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
244
252
|
return t({
|
|
245
253
|
mutationFn: async (e) => (await o(`mutation TheScheduleShipment($input: TheCreateShipmentInput!) {
|
|
@@ -249,7 +257,7 @@ var a = () => {
|
|
|
249
257
|
i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
|
|
250
258
|
}
|
|
251
259
|
});
|
|
252
|
-
},
|
|
260
|
+
}, I = () => {
|
|
253
261
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
254
262
|
return t({
|
|
255
263
|
mutationFn: async (e) => (await o(`mutation TheDeliverShipment($id: ID!) {
|
|
@@ -259,7 +267,7 @@ var a = () => {
|
|
|
259
267
|
i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
|
|
260
268
|
}
|
|
261
269
|
});
|
|
262
|
-
},
|
|
270
|
+
}, L = (t = {}) => {
|
|
263
271
|
let { apiGatewayUrl: r } = e();
|
|
264
272
|
return n({
|
|
265
273
|
queryKey: [...s.inventory, t],
|
|
@@ -274,7 +282,7 @@ var a = () => {
|
|
|
274
282
|
pagination: t.pagination ?? c
|
|
275
283
|
}, r)).theListInventoryLots
|
|
276
284
|
});
|
|
277
|
-
},
|
|
285
|
+
}, R = () => {
|
|
278
286
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
279
287
|
return t({
|
|
280
288
|
mutationFn: async (e) => (await o(`mutation TheCreateInventoryLot($input: TheCreateInventoryLotInput!) {
|
|
@@ -282,7 +290,7 @@ var a = () => {
|
|
|
282
290
|
}`, { input: e }, n)).theCreateInventoryLot,
|
|
283
291
|
onSuccess: () => i.invalidateQueries({ queryKey: s.inventory })
|
|
284
292
|
});
|
|
285
|
-
},
|
|
293
|
+
}, z = () => {
|
|
286
294
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
287
295
|
return t({
|
|
288
296
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheSetInventoryLotStatus($id: ID!, $status: TheInventoryStatus!) {
|
|
@@ -293,7 +301,7 @@ var a = () => {
|
|
|
293
301
|
}, n)).theSetInventoryLotStatus,
|
|
294
302
|
onSuccess: () => i.invalidateQueries({ queryKey: s.inventory })
|
|
295
303
|
});
|
|
296
|
-
},
|
|
304
|
+
}, B = (t = {}) => {
|
|
297
305
|
let { apiGatewayUrl: r } = e();
|
|
298
306
|
return n({
|
|
299
307
|
queryKey: [...s.emissions, t],
|
|
@@ -308,7 +316,7 @@ var a = () => {
|
|
|
308
316
|
pagination: t.pagination ?? c
|
|
309
317
|
}, r)).theListEmissionRecords
|
|
310
318
|
});
|
|
311
|
-
},
|
|
319
|
+
}, V = () => {
|
|
312
320
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
313
321
|
return t({
|
|
314
322
|
mutationFn: async (e) => (await o(`mutation TheRecordEmission($input: TheRecordEmissionInput!) {
|
|
@@ -316,7 +324,7 @@ var a = () => {
|
|
|
316
324
|
}`, { input: e }, n)).theRecordEmission,
|
|
317
325
|
onSuccess: () => i.invalidateQueries({ queryKey: s.emissions })
|
|
318
326
|
});
|
|
319
|
-
},
|
|
327
|
+
}, H = () => {
|
|
320
328
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
321
329
|
return t({
|
|
322
330
|
mutationFn: async (e) => (await o(`mutation TheVerifyEmission($id: ID!) {
|
|
@@ -324,7 +332,7 @@ var a = () => {
|
|
|
324
332
|
}`, { id: e }, n)).theVerifyEmission,
|
|
325
333
|
onSuccess: () => i.invalidateQueries({ queryKey: s.emissions })
|
|
326
334
|
});
|
|
327
|
-
},
|
|
335
|
+
}, U = (t, r, i, a) => {
|
|
328
336
|
let { apiGatewayUrl: l } = e();
|
|
329
337
|
return n({
|
|
330
338
|
queryKey: [
|
|
@@ -346,7 +354,7 @@ var a = () => {
|
|
|
346
354
|
pagination: a ?? c
|
|
347
355
|
}, l)).theListComplianceCerts
|
|
348
356
|
});
|
|
349
|
-
},
|
|
357
|
+
}, W = () => {
|
|
350
358
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
351
359
|
return t({
|
|
352
360
|
mutationFn: async (e) => (await o(`mutation TheCreateComplianceCert($input: TheCreateComplianceCertInput!) {
|
|
@@ -354,7 +362,7 @@ var a = () => {
|
|
|
354
362
|
}`, { input: e }, n)).theCreateComplianceCert,
|
|
355
363
|
onSuccess: () => i.invalidateQueries({ queryKey: s.compliance })
|
|
356
364
|
});
|
|
357
|
-
},
|
|
365
|
+
}, G = () => {
|
|
358
366
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
359
367
|
return t({
|
|
360
368
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionComplianceCert($id: ID!, $status: TheComplianceStatus!) {
|
|
@@ -367,8 +375,110 @@ var a = () => {
|
|
|
367
375
|
i.invalidateQueries({ queryKey: s.compliance }), i.invalidateQueries({ queryKey: s.complianceCert(e.id) });
|
|
368
376
|
}
|
|
369
377
|
});
|
|
378
|
+
}, K = (t = {}) => {
|
|
379
|
+
let { apiGatewayUrl: r } = e();
|
|
380
|
+
return n({
|
|
381
|
+
queryKey: [...s.safetyIncidents, t],
|
|
382
|
+
queryFn: async () => (await o(`query TheListSafetyIncidents($assetId: ID, $category: TheSafetyIncidentCategory, $severity: TheSafetyIncidentSeverity, $status: TheSafetyIncidentStatus, $pagination: PaginationInput) {
|
|
383
|
+
theListSafetyIncidents(assetId: $assetId, category: $category, severity: $severity, status: $status, pagination: $pagination) {
|
|
384
|
+
items { ${_} }
|
|
385
|
+
pageInfo { cursor hasMore }
|
|
386
|
+
}
|
|
387
|
+
}`, {
|
|
388
|
+
assetId: t.assetId,
|
|
389
|
+
category: t.category,
|
|
390
|
+
severity: t.severity,
|
|
391
|
+
status: t.status,
|
|
392
|
+
pagination: t.pagination ?? c
|
|
393
|
+
}, r)).theListSafetyIncidents
|
|
394
|
+
});
|
|
395
|
+
}, q = () => {
|
|
396
|
+
let { apiGatewayUrl: n } = e(), i = r();
|
|
397
|
+
return t({
|
|
398
|
+
mutationFn: async (e) => (await o(`mutation TheReportSafetyIncident($input: TheReportSafetyIncidentInput!) {
|
|
399
|
+
theReportSafetyIncident(input: $input) { ${_} }
|
|
400
|
+
}`, { input: e }, n)).theReportSafetyIncident,
|
|
401
|
+
onSuccess: () => {
|
|
402
|
+
i.invalidateQueries({ queryKey: s.safetyIncidents }), i.invalidateQueries({ queryKey: s.safetyDashboard });
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}, J = () => {
|
|
406
|
+
let { apiGatewayUrl: n } = e(), i = r();
|
|
407
|
+
return t({
|
|
408
|
+
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionSafetyIncident($id: ID!, $status: TheSafetyIncidentStatus!) {
|
|
409
|
+
theTransitionSafetyIncident(id: $id, status: $status) { ${_} }
|
|
410
|
+
}`, {
|
|
411
|
+
id: e,
|
|
412
|
+
status: t
|
|
413
|
+
}, n)).theTransitionSafetyIncident,
|
|
414
|
+
onSuccess: (e) => {
|
|
415
|
+
i.invalidateQueries({ queryKey: s.safetyIncidents }), i.invalidateQueries({ queryKey: s.safetyIncident(e.id) }), i.invalidateQueries({ queryKey: s.safetyDashboard });
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
}, Y = () => {
|
|
419
|
+
let { apiGatewayUrl: n } = e(), i = r();
|
|
420
|
+
return t({
|
|
421
|
+
mutationFn: async ({ id: e, investigationNotes: t }) => (await o(`mutation TheUpdateIncidentInvestigation($id: ID!, $investigationNotes: String!) {
|
|
422
|
+
theUpdateIncidentInvestigation(id: $id, investigationNotes: $investigationNotes) { ${_} }
|
|
423
|
+
}`, {
|
|
424
|
+
id: e,
|
|
425
|
+
investigationNotes: t
|
|
426
|
+
}, n)).theUpdateIncidentInvestigation,
|
|
427
|
+
onSuccess: (e) => {
|
|
428
|
+
i.invalidateQueries({ queryKey: s.safetyIncidents }), i.invalidateQueries({ queryKey: s.safetyIncident(e.id) });
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}, X = (t, r, i) => {
|
|
432
|
+
let { apiGatewayUrl: a } = e();
|
|
433
|
+
return n({
|
|
434
|
+
queryKey: [
|
|
435
|
+
...s.correctiveActions,
|
|
436
|
+
t ?? null,
|
|
437
|
+
r ?? null,
|
|
438
|
+
i ?? null
|
|
439
|
+
],
|
|
440
|
+
queryFn: async () => (await o(`query TheListCorrectiveActions($incidentId: ID, $status: TheCorrectiveActionStatus, $pagination: PaginationInput) {
|
|
441
|
+
theListCorrectiveActions(incidentId: $incidentId, status: $status, pagination: $pagination) {
|
|
442
|
+
items { ${v} }
|
|
443
|
+
pageInfo { cursor hasMore }
|
|
444
|
+
}
|
|
445
|
+
}`, {
|
|
446
|
+
incidentId: t,
|
|
447
|
+
status: r,
|
|
448
|
+
pagination: i ?? c
|
|
449
|
+
}, a)).theListCorrectiveActions
|
|
450
|
+
});
|
|
451
|
+
}, Z = () => {
|
|
452
|
+
let { apiGatewayUrl: n } = e(), i = r();
|
|
453
|
+
return t({
|
|
454
|
+
mutationFn: async (e) => (await o(`mutation TheCreateCorrectiveAction($input: TheCreateCorrectiveActionInput!) {
|
|
455
|
+
theCreateCorrectiveAction(input: $input) { ${v} }
|
|
456
|
+
}`, { input: e }, n)).theCreateCorrectiveAction,
|
|
457
|
+
onSuccess: () => {
|
|
458
|
+
i.invalidateQueries({ queryKey: s.correctiveActions }), i.invalidateQueries({ queryKey: s.safetyDashboard });
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}, Q = () => {
|
|
462
|
+
let { apiGatewayUrl: n } = e(), i = r();
|
|
463
|
+
return t({
|
|
464
|
+
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionCorrectiveAction($id: ID!, $status: TheCorrectiveActionStatus!) {
|
|
465
|
+
theTransitionCorrectiveAction(id: $id, status: $status) { ${v} }
|
|
466
|
+
}`, {
|
|
467
|
+
id: e,
|
|
468
|
+
status: t
|
|
469
|
+
}, n)).theTransitionCorrectiveAction,
|
|
470
|
+
onSuccess: () => {
|
|
471
|
+
i.invalidateQueries({ queryKey: s.correctiveActions }), i.invalidateQueries({ queryKey: s.safetyDashboard });
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
}, $ = () => {
|
|
475
|
+
let { apiGatewayUrl: t } = e();
|
|
476
|
+
return n({
|
|
477
|
+
queryKey: s.safetyDashboard,
|
|
478
|
+
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
|
|
479
|
+
});
|
|
370
480
|
};
|
|
371
481
|
//#endregion
|
|
372
|
-
export {
|
|
482
|
+
export { b as useTheAsset, y as useTheAssets, U as useTheComplianceCerts, k as useTheContract, O as useTheContracts, X as useTheCorrectiveActions, x as useTheCreateAsset, W as useTheCreateComplianceCert, A as useTheCreateContract, Z as useTheCreateCorrectiveAction, R as useTheCreateInventoryLot, D as useTheCreateReserveEstimate, I as useTheDeliverShipment, B as useTheEmissionRecords, L as useTheInventoryLots, w as useTheProductionRecords, V as useTheRecordEmission, T as useTheRecordProduction, q as useTheReportSafetyIncident, E as useTheReserveEstimates, C as useTheRetireAsset, $ as useTheSafetyDashboard, K as useTheSafetyIncidents, F as useTheScheduleShipment, z as useTheSetInventoryLotStatus, N as useTheShipments, S as useTheTransitionAsset, G as useTheTransitionComplianceCert, M as useTheTransitionContract, Q as useTheTransitionCorrectiveAction, J as useTheTransitionSafetyIncident, P as useTheTransitionShipment, j as useTheUpdateContract, Y as useTheUpdateIncidentInvestigation, H as useTheVerifyEmission };
|
|
373
483
|
|
|
374
484
|
//# 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,EAAE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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 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 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 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"],"mappings":";;;;;AA8EA,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,iBAAiB,aAAa;CAC3C,iBAAiB,MAAe;EAAC;EAAiB;EAAc;EAAG;CACnE,iBAAiB,CAAC,iBAAiB,mBAAmB;CACtD,iBAAiB,MAAe;EAAC;EAAiB;EAAmB;EAAG;CACxE,mBAAmB,CAAC,iBAAiB,qBAAqB;CAC1D,iBAAiB,CAAC,iBAAiB,mBAAmB;CACvD,EAEK,IA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UAAyC;CACpD,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,EAAE,OAAI,iBACV,MAAM,EACjB;sEAC8D,EAAyB;YAEvF;GAAE;GAAI;GAAQ,EACd,EACD,EACW;EAEd,iBAAiB;AAEf,GADA,EAAG,kBAAkB,EAAE,UAAU,EAAI,mBAAmB,CAAC,EACzD,EAAG,kBAAkB,EAAE,UAAU,EAAI,iBAAiB,CAAC;;EAE1D,CAAC;GAGS,UAA8B;CACzC,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU,EAAI;EACd,SAAS,aACM,MAAM,EACjB,gRASA,EAAE,EACF,EACD,EACW;EAEf,CAAC"}
|
|
@@ -23,7 +23,7 @@ import { WorldMap as xe } from "../../components/WorldMap.js";
|
|
|
23
23
|
import "../../components/index.js";
|
|
24
24
|
import { useState as g } from "react";
|
|
25
25
|
import { Activity as Se, Archive as Ce, ArrowLeft as we, CalendarClock as Te, Factory as Ee, Fuel as De, Gauge as Oe, Layers as ke, MapPin as Ae, MessageSquare as je, Percent as Me, Plus as _, Tag as Ne } from "lucide-react";
|
|
26
|
-
import { useParams as Pe } from "react-router
|
|
26
|
+
import { useParams as Pe } from "react-router";
|
|
27
27
|
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
28
28
|
import { Button as x, GlassCard as S, Input as C, Label as w, ResponsiveDialog as Fe, ResponsiveDialogContent as Ie, ResponsiveDialogDescription as Le, ResponsiveDialogFooter as Re, ResponsiveDialogHeader as ze, ResponsiveDialogTitle as Be, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as Ve } from "@burdenoff/fe-libs/ui";
|
|
29
29
|
//#region src/theglobalfuel/pages/assets/AssetDetailPage.tsx
|