@burdenoff/microfe-theglobalfuel 2026.804.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.
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoot.js +65 -57
- package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js +31 -27
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
- package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -1
- package/dist/theglobalfuel/components/StatusBadge.js +2 -1
- package/dist/theglobalfuel/components/StatusBadge.js.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +8 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +57 -26
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.d.ts +14 -0
- package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.js +496 -0
- package/dist/theglobalfuel/pages/esg-disclosures/EsgDisclosuresPage.js.map +1 -0
- package/dist/theglobalfuel/types/index.d.ts +48 -0
- package/dist/theglobalfuel/types/index.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.js +1 -0
- package/dist/theglobalfuel/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ var a = () => {
|
|
|
41
41
|
"compliance",
|
|
42
42
|
e
|
|
43
43
|
],
|
|
44
|
+
esgDisclosures: ["theglobalfuel", "esg-disclosures"],
|
|
44
45
|
safetyIncidents: ["theglobalfuel", "safety-incidents"],
|
|
45
46
|
safetyIncident: (e) => [
|
|
46
47
|
"theglobalfuel",
|
|
@@ -49,7 +50,7 @@ var a = () => {
|
|
|
49
50
|
],
|
|
50
51
|
correctiveActions: ["theglobalfuel", "corrective-actions"],
|
|
51
52
|
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",
|
|
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 = {}) => {
|
|
53
54
|
let { apiGatewayUrl: r } = e();
|
|
54
55
|
return n({
|
|
55
56
|
queryKey: [...s.assets, t],
|
|
@@ -65,7 +66,7 @@ var a = () => {
|
|
|
65
66
|
pagination: t.pagination ?? c
|
|
66
67
|
}, r)).theListAssets
|
|
67
68
|
});
|
|
68
|
-
},
|
|
69
|
+
}, x = (t) => {
|
|
69
70
|
let { apiGatewayUrl: r } = e();
|
|
70
71
|
return n({
|
|
71
72
|
queryKey: s.asset(t ?? ""),
|
|
@@ -74,7 +75,7 @@ var a = () => {
|
|
|
74
75
|
theAsset(id: $id) { ${l} }
|
|
75
76
|
}`, { id: t }, r)).theAsset
|
|
76
77
|
});
|
|
77
|
-
},
|
|
78
|
+
}, S = () => {
|
|
78
79
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
79
80
|
return t({
|
|
80
81
|
mutationFn: async (e) => (await o(`mutation TheCreateAsset($input: TheCreateAssetInput!) {
|
|
@@ -82,7 +83,7 @@ var a = () => {
|
|
|
82
83
|
}`, { input: e }, n)).theCreateAsset,
|
|
83
84
|
onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
|
|
84
85
|
});
|
|
85
|
-
},
|
|
86
|
+
}, C = () => {
|
|
86
87
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
87
88
|
return t({
|
|
88
89
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionAsset($id: ID!, $status: TheAssetStatus!) {
|
|
@@ -95,13 +96,13 @@ var a = () => {
|
|
|
95
96
|
i.invalidateQueries({ queryKey: s.assets }), i.invalidateQueries({ queryKey: s.asset(e.id) });
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
|
-
},
|
|
99
|
+
}, w = () => {
|
|
99
100
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
100
101
|
return t({
|
|
101
102
|
mutationFn: async (e) => (await o("mutation TheRetireAsset($id: ID!) { theRetireAsset(id: $id) }", { id: e }, n)).theRetireAsset,
|
|
102
103
|
onSuccess: () => i.invalidateQueries({ queryKey: s.assets })
|
|
103
104
|
});
|
|
104
|
-
},
|
|
105
|
+
}, T = (t = {}) => {
|
|
105
106
|
let { apiGatewayUrl: r } = e();
|
|
106
107
|
return n({
|
|
107
108
|
queryKey: [...s.production, t],
|
|
@@ -115,7 +116,7 @@ var a = () => {
|
|
|
115
116
|
pagination: t.pagination ?? c
|
|
116
117
|
}, r)).theListProductionRecords
|
|
117
118
|
});
|
|
118
|
-
},
|
|
119
|
+
}, E = () => {
|
|
119
120
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
120
121
|
return t({
|
|
121
122
|
mutationFn: async (e) => (await o(`mutation TheRecordProduction($input: TheRecordProductionInput!) {
|
|
@@ -125,7 +126,7 @@ var a = () => {
|
|
|
125
126
|
i.invalidateQueries({ queryKey: s.production }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
|
|
126
127
|
}
|
|
127
128
|
});
|
|
128
|
-
},
|
|
129
|
+
}, D = (t, r, i) => {
|
|
129
130
|
let { apiGatewayUrl: a } = e();
|
|
130
131
|
return n({
|
|
131
132
|
queryKey: [
|
|
@@ -145,7 +146,7 @@ var a = () => {
|
|
|
145
146
|
pagination: i ?? c
|
|
146
147
|
}, a)).theListReserveEstimates
|
|
147
148
|
});
|
|
148
|
-
},
|
|
149
|
+
}, O = () => {
|
|
149
150
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
150
151
|
return t({
|
|
151
152
|
mutationFn: async (e) => (await o(`mutation TheCreateReserveEstimate($input: TheCreateReserveEstimateInput!) {
|
|
@@ -155,7 +156,7 @@ var a = () => {
|
|
|
155
156
|
i.invalidateQueries({ queryKey: s.reserves }), i.invalidateQueries({ queryKey: s.asset(e.assetId) });
|
|
156
157
|
}
|
|
157
158
|
});
|
|
158
|
-
},
|
|
159
|
+
}, k = (t = {}) => {
|
|
159
160
|
let { apiGatewayUrl: r } = e();
|
|
160
161
|
return n({
|
|
161
162
|
queryKey: [...s.contracts, t],
|
|
@@ -171,7 +172,7 @@ var a = () => {
|
|
|
171
172
|
pagination: t.pagination ?? c
|
|
172
173
|
}, r)).theListContracts
|
|
173
174
|
});
|
|
174
|
-
},
|
|
175
|
+
}, A = (t) => {
|
|
175
176
|
let { apiGatewayUrl: r } = e();
|
|
176
177
|
return n({
|
|
177
178
|
queryKey: s.contract(t ?? ""),
|
|
@@ -180,7 +181,7 @@ var a = () => {
|
|
|
180
181
|
theContract(id: $id) { ${f} }
|
|
181
182
|
}`, { id: t }, r)).theContract
|
|
182
183
|
});
|
|
183
|
-
},
|
|
184
|
+
}, j = () => {
|
|
184
185
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
185
186
|
return t({
|
|
186
187
|
mutationFn: async (e) => (await o(`mutation TheCreateContract($input: TheCreateOfftakeContractInput!) {
|
|
@@ -188,7 +189,7 @@ var a = () => {
|
|
|
188
189
|
}`, { input: e }, n)).theCreateContract,
|
|
189
190
|
onSuccess: () => i.invalidateQueries({ queryKey: s.contracts })
|
|
190
191
|
});
|
|
191
|
-
},
|
|
192
|
+
}, M = () => {
|
|
192
193
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
193
194
|
return t({
|
|
194
195
|
mutationFn: async ({ id: e, input: t }) => (await o(`mutation TheUpdateContract($id: ID!, $input: TheUpdateOfftakeContractInput!) {
|
|
@@ -201,7 +202,7 @@ var a = () => {
|
|
|
201
202
|
i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
|
|
202
203
|
}
|
|
203
204
|
});
|
|
204
|
-
},
|
|
205
|
+
}, N = () => {
|
|
205
206
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
206
207
|
return t({
|
|
207
208
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionContract($id: ID!, $status: TheContractStatus!) {
|
|
@@ -214,7 +215,7 @@ var a = () => {
|
|
|
214
215
|
i.invalidateQueries({ queryKey: s.contracts }), i.invalidateQueries({ queryKey: s.contract(e.id) });
|
|
215
216
|
}
|
|
216
217
|
});
|
|
217
|
-
},
|
|
218
|
+
}, P = (t, r, i) => {
|
|
218
219
|
let { apiGatewayUrl: a } = e();
|
|
219
220
|
return n({
|
|
220
221
|
queryKey: [
|
|
@@ -234,7 +235,7 @@ var a = () => {
|
|
|
234
235
|
pagination: i ?? c
|
|
235
236
|
}, a)).theListShipments
|
|
236
237
|
});
|
|
237
|
-
},
|
|
238
|
+
}, F = () => {
|
|
238
239
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
239
240
|
return t({
|
|
240
241
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionShipment($id: ID!, $status: TheShipmentStatus!) {
|
|
@@ -247,7 +248,7 @@ var a = () => {
|
|
|
247
248
|
i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
|
|
248
249
|
}
|
|
249
250
|
});
|
|
250
|
-
},
|
|
251
|
+
}, I = () => {
|
|
251
252
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
252
253
|
return t({
|
|
253
254
|
mutationFn: async (e) => (await o(`mutation TheScheduleShipment($input: TheCreateShipmentInput!) {
|
|
@@ -257,7 +258,7 @@ var a = () => {
|
|
|
257
258
|
i.invalidateQueries({ queryKey: s.shipments }), i.invalidateQueries({ queryKey: s.contract(e.contractId) });
|
|
258
259
|
}
|
|
259
260
|
});
|
|
260
|
-
},
|
|
261
|
+
}, ee = () => {
|
|
261
262
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
262
263
|
return t({
|
|
263
264
|
mutationFn: async (e) => (await o(`mutation TheDeliverShipment($id: ID!) {
|
|
@@ -381,7 +382,7 @@ var a = () => {
|
|
|
381
382
|
queryKey: [...s.safetyIncidents, t],
|
|
382
383
|
queryFn: async () => (await o(`query TheListSafetyIncidents($assetId: ID, $category: TheSafetyIncidentCategory, $severity: TheSafetyIncidentSeverity, $status: TheSafetyIncidentStatus, $pagination: PaginationInput) {
|
|
383
384
|
theListSafetyIncidents(assetId: $assetId, category: $category, severity: $severity, status: $status, pagination: $pagination) {
|
|
384
|
-
items { ${
|
|
385
|
+
items { ${v} }
|
|
385
386
|
pageInfo { cursor hasMore }
|
|
386
387
|
}
|
|
387
388
|
}`, {
|
|
@@ -396,7 +397,7 @@ var a = () => {
|
|
|
396
397
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
397
398
|
return t({
|
|
398
399
|
mutationFn: async (e) => (await o(`mutation TheReportSafetyIncident($input: TheReportSafetyIncidentInput!) {
|
|
399
|
-
theReportSafetyIncident(input: $input) { ${
|
|
400
|
+
theReportSafetyIncident(input: $input) { ${v} }
|
|
400
401
|
}`, { input: e }, n)).theReportSafetyIncident,
|
|
401
402
|
onSuccess: () => {
|
|
402
403
|
i.invalidateQueries({ queryKey: s.safetyIncidents }), i.invalidateQueries({ queryKey: s.safetyDashboard });
|
|
@@ -406,7 +407,7 @@ var a = () => {
|
|
|
406
407
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
407
408
|
return t({
|
|
408
409
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionSafetyIncident($id: ID!, $status: TheSafetyIncidentStatus!) {
|
|
409
|
-
theTransitionSafetyIncident(id: $id, status: $status) { ${
|
|
410
|
+
theTransitionSafetyIncident(id: $id, status: $status) { ${v} }
|
|
410
411
|
}`, {
|
|
411
412
|
id: e,
|
|
412
413
|
status: t
|
|
@@ -419,7 +420,7 @@ var a = () => {
|
|
|
419
420
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
420
421
|
return t({
|
|
421
422
|
mutationFn: async ({ id: e, investigationNotes: t }) => (await o(`mutation TheUpdateIncidentInvestigation($id: ID!, $investigationNotes: String!) {
|
|
422
|
-
theUpdateIncidentInvestigation(id: $id, investigationNotes: $investigationNotes) { ${
|
|
423
|
+
theUpdateIncidentInvestigation(id: $id, investigationNotes: $investigationNotes) { ${v} }
|
|
423
424
|
}`, {
|
|
424
425
|
id: e,
|
|
425
426
|
investigationNotes: t
|
|
@@ -439,7 +440,7 @@ var a = () => {
|
|
|
439
440
|
],
|
|
440
441
|
queryFn: async () => (await o(`query TheListCorrectiveActions($incidentId: ID, $status: TheCorrectiveActionStatus, $pagination: PaginationInput) {
|
|
441
442
|
theListCorrectiveActions(incidentId: $incidentId, status: $status, pagination: $pagination) {
|
|
442
|
-
items { ${
|
|
443
|
+
items { ${y} }
|
|
443
444
|
pageInfo { cursor hasMore }
|
|
444
445
|
}
|
|
445
446
|
}`, {
|
|
@@ -452,7 +453,7 @@ var a = () => {
|
|
|
452
453
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
453
454
|
return t({
|
|
454
455
|
mutationFn: async (e) => (await o(`mutation TheCreateCorrectiveAction($input: TheCreateCorrectiveActionInput!) {
|
|
455
|
-
theCreateCorrectiveAction(input: $input) { ${
|
|
456
|
+
theCreateCorrectiveAction(input: $input) { ${y} }
|
|
456
457
|
}`, { input: e }, n)).theCreateCorrectiveAction,
|
|
457
458
|
onSuccess: () => {
|
|
458
459
|
i.invalidateQueries({ queryKey: s.correctiveActions }), i.invalidateQueries({ queryKey: s.safetyDashboard });
|
|
@@ -462,7 +463,7 @@ var a = () => {
|
|
|
462
463
|
let { apiGatewayUrl: n } = e(), i = r();
|
|
463
464
|
return t({
|
|
464
465
|
mutationFn: async ({ id: e, status: t }) => (await o(`mutation TheTransitionCorrectiveAction($id: ID!, $status: TheCorrectiveActionStatus!) {
|
|
465
|
-
theTransitionCorrectiveAction(id: $id, status: $status) { ${
|
|
466
|
+
theTransitionCorrectiveAction(id: $id, status: $status) { ${y} }
|
|
466
467
|
}`, {
|
|
467
468
|
id: e,
|
|
468
469
|
status: t
|
|
@@ -477,8 +478,38 @@ var a = () => {
|
|
|
477
478
|
queryKey: s.safetyDashboard,
|
|
478
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
|
|
479
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
|
+
});
|
|
480
511
|
};
|
|
481
512
|
//#endregion
|
|
482
|
-
export {
|
|
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 };
|
|
483
514
|
|
|
484
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 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,qB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AAkB,EAAE,UAAU,EAAI,iBAAiB,CAAC;;EAE1D,CAAC;GAGS,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"}
|
|
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;AA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ACd,SAAS,aACM,MAAM,EACjB,gRASA,EAAE,EACF,EACD,EACW;EAEf,CAAC;GAYS,MAAwB,IAAgC,EAAE,KAAK;CAC1E,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU,CAAC,GAAG,EAAI,gBAAgB,EAAQ;EAC1C,SAAS,aACM,MAAM,EACjB;;sBAEc,EAAsB;;;YAIpC;GAAE,WAAW,EAAQ;GAAW,YAAY,EAAQ,cAAc;GAAc,EAChF,EACD,EACW;EAEf,CAAC;GAGS,WAAoC;CAC/C,IAAM,EAAE,qBAAkB,GAAkB,EACtC,IAAK,GAAgB;AAC3B,QAAO,EAAY;EACjB,YAAY,OAAO,OACJ,MAAM,EACjB;sDAC8C,EAAsB;YAEpE,EAAE,UAAO,EACT,EACD,EACW;EAEd,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,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"}
|