@burdenoff/microfe-movethewheels 2026.1108.2 → 2026.1108.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/components/DocumentsCard.js +183 -55
  2. package/dist/generated/tracking-quality-operations.d.ts +328 -1
  3. package/dist/generated/wspace-types.d.ts +1479 -10
  4. package/dist/hooks/useCarrierIntegrations.js +30 -29
  5. package/dist/hooks/useDocumentExtractions.js +100 -0
  6. package/dist/movethewheels/hooks/useCarrierIntegrations.d.ts +9 -3
  7. package/dist/movethewheels/hooks/useDocumentExtractions.d.ts +49 -0
  8. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +5 -5
  9. package/dist/movethewheels/utils/carrierIntegrations.d.ts +90 -9
  10. package/dist/node_modules/lucide-react/dist/esm/icons/cloud-download.js +18 -0
  11. package/dist/node_modules/lucide-react/dist/esm/icons/file-search.js +24 -0
  12. package/dist/pages/IntegrationsPage.js +551 -329
  13. package/dist/pages/MultiModalShipmentPage.js +125 -121
  14. package/dist/pages/RouteDetailsPage.js +212 -207
  15. package/dist/utils/carrierIntegrations.js +127 -30
  16. package/package.json +1 -1
  17. package/src/generated/tracking-quality-operations.ts +373 -0
  18. package/src/generated/wspace-types.ts +1672 -10
  19. package/src/movethewheels/components/DocumentsCard.tsx +174 -29
  20. package/src/movethewheels/hooks/useCarrierIntegrations.ts +19 -2
  21. package/src/movethewheels/hooks/useDocumentExtractions.ts +246 -0
  22. package/src/movethewheels/hooks/useEntityDocuments.ts +5 -5
  23. package/src/movethewheels/pages/IntegrationsPage.tsx +292 -36
  24. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +2 -0
  25. package/src/movethewheels/pages/RouteDetailsPage.tsx +2 -0
  26. package/src/movethewheels/utils/carrierIntegrations.ts +252 -10
@@ -1,6 +1,10 @@
1
1
  import { resolveGraphqlUrl as e } from "./graphqlClient.js";
2
2
  //#region src/movethewheels/utils/carrierIntegrations.ts
3
- var t = [
3
+ var t = new Set(["GEOTAB"]);
4
+ function n(e) {
5
+ return t.has(e);
6
+ }
7
+ var r = [
4
8
  {
5
9
  id: "PROJECT44",
6
10
  label: "project44"
@@ -13,22 +17,23 @@ var t = [
13
17
  id: "DESCARTES",
14
18
  label: "Descartes"
15
19
  }
16
- ], n = ["Motive", "Geotab"], r = [
20
+ ], i = ["Motive"], a = [
17
21
  "ACTIVE",
18
22
  "PAUSED",
19
23
  "DISABLED"
20
24
  ];
21
- function i(e) {
25
+ function o(e) {
22
26
  switch (e) {
23
27
  case "GENERIC_WEBHOOK": return "Signed webhook";
24
28
  case "SAMSARA": return "Samsara";
29
+ case "GEOTAB": return "Geotab";
25
30
  case "SHIPROCKET": return "Shiprocket";
26
31
  case "PROJECT44": return "project44";
27
32
  case "FOURKITES": return "FourKites";
28
33
  case "DESCARTES": return "Descartes";
29
34
  }
30
35
  }
31
- var a = [
36
+ var s = [
32
37
  {
33
38
  type: "RouteStopArrival",
34
39
  becomes: "ARRIVED"
@@ -45,18 +50,92 @@ var a = [
45
50
  type: "GeofenceExit",
46
51
  becomes: "DEPARTED"
47
52
  }
48
- ], o = "mtwShipment";
49
- function s(e) {
53
+ ], c = "mtwShipment";
54
+ function l(e) {
50
55
  let t = e.trim(), n = "Paste the secret key exactly as Samsara shows it on the webhook page.";
51
56
  if (!t || t.length % 4 != 0 || !/^[A-Za-z0-9+/]+={0,2}$/.test(t)) return n;
52
57
  let r = t.endsWith("==") ? 2 : +!!t.endsWith("=");
53
58
  return t.length / 4 * 3 - r < 16 ? n : null;
54
59
  }
55
- function c(e) {
60
+ function u(e) {
56
61
  let t = e.trim();
57
62
  return t && (t.length > 64 || !/^[A-Za-z0-9_.-]+$/.test(t)) ? "Use letters, numbers, dots, dashes or underscores (up to 64) for the external ID key." : null;
58
63
  }
59
- var l = ["X-Samsara-Signature", "X-Samsara-Timestamp"], u = [
64
+ var d = "my.geotab.com", f = [
65
+ "PICKED_UP",
66
+ "IN_TRANSIT",
67
+ "ARRIVED",
68
+ "DEPARTED",
69
+ "OUT_FOR_DELIVERY",
70
+ "DELIVERED",
71
+ "FAILED",
72
+ "RETURNED"
73
+ ], p = /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.geotab\.com$/, m = /^[A-Za-z0-9_.-]{1,64}$/;
74
+ function h(e) {
75
+ let t = e.trim().toLowerCase();
76
+ if (!t) return d;
77
+ let n = t.replace(/^https:\/\//, "").replace(/\/(apiv1\/?)?$/, "");
78
+ return p.test(n) ? n : null;
79
+ }
80
+ function g(e) {
81
+ let t = {}, n = e.split(/\r?\n/);
82
+ for (let [e, r] of n.entries()) {
83
+ let n = r.trim();
84
+ if (!n || n.startsWith("#")) continue;
85
+ let i = /^([^=:]+)[=:](.+)$/.exec(n), a = i?.[1]?.trim() ?? "", o = (i?.[2]?.trim() ?? "").toUpperCase().replace(/[\s-]+/g, "_");
86
+ if (!i || !m.test(a)) return {
87
+ ok: !1,
88
+ error: `Line ${e + 1}: write each mapping as <rule id> = <event>, e.g. RuleArriveId = ARRIVED.`
89
+ };
90
+ if (!f.includes(o)) return {
91
+ ok: !1,
92
+ error: `Line ${e + 1}: use one of ${f.join(", ")}.`
93
+ };
94
+ t[a] = o;
95
+ }
96
+ return Object.keys(t).length > 50 ? {
97
+ ok: !1,
98
+ error: "Map at most 50 rules."
99
+ } : {
100
+ ok: !0,
101
+ ruleEvents: t
102
+ };
103
+ }
104
+ function _(e) {
105
+ let t = h(e.server);
106
+ if (!t) return {
107
+ ok: !1,
108
+ error: "Use your MyGeotab server, e.g. my.geotab.com."
109
+ };
110
+ let n = e.database.trim();
111
+ if (!n || n.length > 255) return {
112
+ ok: !1,
113
+ error: "Enter the MyGeotab database name."
114
+ };
115
+ let r = e.userName.trim();
116
+ if (!r || r.length > 255) return {
117
+ ok: !1,
118
+ error: "Enter the MyGeotab user name."
119
+ };
120
+ let i = g(e.ruleMappings);
121
+ return i.ok ? !e.locationUpdates && Object.keys(i.ruleEvents).length === 0 ? {
122
+ ok: !1,
123
+ error: "Turn on GPS position updates or map at least one exception rule, or nothing is read."
124
+ } : {
125
+ ok: !0,
126
+ config: {
127
+ server: t,
128
+ database: n,
129
+ userName: r,
130
+ ruleEvents: i.ruleEvents,
131
+ locationUpdates: e.locationUpdates
132
+ }
133
+ } : i;
134
+ }
135
+ function v(e) {
136
+ return e ? e.length > 255 ? "The password can be at most 255 characters." : null : "Enter the MyGeotab password.";
137
+ }
138
+ var y = ["X-Samsara-Signature", "X-Samsara-Timestamp"], b = [
60
139
  "CREATED",
61
140
  "PICKED_UP",
62
141
  "IN_TRANSIT",
@@ -66,41 +145,41 @@ var l = ["X-Samsara-Signature", "X-Samsara-Timestamp"], u = [
66
145
  "DELIVERED",
67
146
  "FAILED",
68
147
  "RETURNED"
69
- ], d = "x-webhook-signature", f = "\n id\n workspaceId\n provider\n name\n status\n lastSyncAt\n lastErrorAt\n lastErrorMessage\n createdAt\n updatedAt\n", p = `
148
+ ], x = "x-webhook-signature", S = "\n id\n workspaceId\n provider\n name\n status\n lastSyncAt\n lastErrorAt\n lastErrorMessage\n createdAt\n updatedAt\n pollStatus {\n lastPollAt\n lastSuccessAt\n lastPollStatus\n lastPollError\n consecutiveFailures\n lastRecordsFetched\n lastUpdatesAccepted\n lastUpdatesSkipped\n }\n", C = `
70
149
  query MtwCarrierIntegrations($filter: IntegrationFilterInput, $pagination: PaginationInput) {
71
150
  integrations(filter: $filter, pagination: $pagination) {
72
- ${f}
151
+ ${S}
73
152
  }
74
153
  integrationsCount(filter: $filter)
75
154
  }
76
- `, m = "\n query MtwCarrierIntegrationCounts {\n all: integrationsCount\n active: integrationsCount(filter: { status: ACTIVE })\n }\n", h = "\n query MtwCarrierIntegrationEvents($integrationId: ID, $pagination: PaginationInput) {\n integrationEvents(integrationId: $integrationId, pagination: $pagination) {\n id\n integrationId\n externalEventId\n shipmentId\n eventType\n status\n errorMessage\n receivedAt\n processedAt\n }\n }\n", g = `
155
+ `, w = "\n query MtwCarrierIntegrationCounts {\n all: integrationsCount\n active: integrationsCount(filter: { status: ACTIVE })\n }\n", T = "\n query MtwCarrierIntegrationEvents($integrationId: ID, $pagination: PaginationInput) {\n integrationEvents(integrationId: $integrationId, pagination: $pagination) {\n id\n integrationId\n externalEventId\n shipmentId\n eventType\n status\n errorMessage\n receivedAt\n processedAt\n }\n }\n", E = `
77
156
  mutation CreateMtwCarrierIntegration($input: CreateIntegrationInput!) {
78
157
  createIntegration(input: $input) {
79
- ${f}
158
+ ${S}
80
159
  }
81
160
  }
82
- `, _ = `
161
+ `, D = `
83
162
  mutation UpdateMtwCarrierIntegration($id: ID!, $input: UpdateIntegrationInput!) {
84
163
  updateIntegration(id: $id, input: $input) {
85
- ${f}
164
+ ${S}
86
165
  }
87
166
  }
88
- `, v = "\n mutation DeleteMtwCarrierIntegration($id: ID!) {\n deleteIntegration(id: $id)\n }\n";
89
- function y(e = globalThis.crypto) {
167
+ `, O = "\n mutation PollMtwCarrierIntegrationNow($id: ID!) {\n pollIntegrationNow(id: $id) {\n integrationId\n status\n skippedReason\n recordsFetched\n updatesAccepted\n updatesSkipped\n error\n }\n }\n", k = "\n mutation DeleteMtwCarrierIntegration($id: ID!) {\n deleteIntegration(id: $id)\n }\n";
168
+ function A(e = globalThis.crypto) {
90
169
  let t = e.getRandomValues(new Uint8Array(32));
91
170
  return Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
92
171
  }
93
- function b(e) {
172
+ function j(e) {
94
173
  return e.trim().length < 32 ? "Use a signing secret of at least 32 characters." : null;
95
174
  }
96
- function x(e) {
175
+ function M(e) {
97
176
  let t = e.trim();
98
177
  return t ? t.length > 120 ? "Keep the name under 120 characters." : null : "Give the integration a name.";
99
178
  }
100
- function S(t, n, r, i) {
179
+ function N(t, n, r, i) {
101
180
  return `${new URL(e(t), i).origin}/api/integrations/webhook/${n}/${r}`;
102
181
  }
103
- function C(e = /* @__PURE__ */ new Date()) {
182
+ function P(e = /* @__PURE__ */ new Date()) {
104
183
  return JSON.stringify({
105
184
  externalEventId: "evt_0001",
106
185
  trackingNumber: "YOUR-TRACKING-NUMBER",
@@ -114,31 +193,49 @@ function C(e = /* @__PURE__ */ new Date()) {
114
193
  details: "Departed origin hub"
115
194
  }, null, 2);
116
195
  }
117
- function w(e) {
196
+ function F(e) {
118
197
  return `'${e.split("'").join("'\\''")}'`;
119
198
  }
120
- function T(e) {
199
+ function I(e) {
121
200
  return [
122
201
  "BODY='{\"externalEventId\":\"evt_0001\",\"trackingNumber\":\"YOUR-TRACKING-NUMBER\",\"eventType\":\"IN_TRANSIT\"}'",
123
202
  "SIG=$(printf '%s' \"$BODY\" | openssl dgst -sha256 -hmac \"$MTW_WEBHOOK_SECRET\" -hex | sed 's/^.* //')",
124
- `curl -X POST ${w(e)} \\`,
203
+ `curl -X POST ${F(e)} \\`,
125
204
  " -H 'Content-Type: application/json' \\",
126
- ` -H "${d}: sha256=$SIG" \\`,
205
+ ` -H "${x}: sha256=$SIG" \\`,
127
206
  " --data \"$BODY\""
128
207
  ].join("\n");
129
208
  }
130
- function E(e) {
209
+ function L(e) {
131
210
  let t = e.toLowerCase().split("_").join(" ");
132
211
  return t.charAt(0).toUpperCase() + t.slice(1);
133
212
  }
134
- function D(e) {
213
+ function R(e) {
135
214
  return e === "ACTIVE" ? "default" : e === "PAUSED" ? "secondary" : "outline";
136
215
  }
137
- function O(e) {
216
+ function z(e) {
217
+ return e === "OK" ? "default" : e === "PARTIAL" ? "secondary" : e === "FAILED" ? "destructive" : "outline";
218
+ }
219
+ function B(e, t) {
220
+ if (!e?.lastPollAt) return "Not polled yet; the first poll runs within a few minutes.";
221
+ let n = t(e.lastPollAt);
222
+ if (e.lastPollStatus === "FAILED") {
223
+ let r = e.lastSuccessAt ? ` Last successful poll ${t(e.lastSuccessAt)}.` : "";
224
+ return `Last poll ${n} failed.${e.consecutiveFailures > 1 ? ` ${e.consecutiveFailures} failures in a row.` : ""}${r}`;
225
+ }
226
+ return `Last poll ${n}: ${e.lastRecordsFetched} records read, ${e.lastUpdatesAccepted} tracking events added, ${e.lastUpdatesSkipped} skipped (vehicle not matched or not on an in-progress route).`;
227
+ }
228
+ function V(e, t) {
229
+ if (t.status === "SKIPPED") return t.skippedReason === "POLL_IN_PROGRESS" ? `${e} is being polled right now; refresh in a moment.` : `${e} was not polled (${L(t.skippedReason ?? "skipped")}).`;
230
+ if (t.status === "FAILED") return `Polling ${e} failed: ${t.error ?? "unknown error"}`;
231
+ let n = t.status === "PARTIAL" ? " Some updates were refused; see the log." : "";
232
+ return `Polled ${e}: ${t.recordsFetched} records read, ${t.updatesAccepted} tracking events added.${n}`;
233
+ }
234
+ function H(e) {
138
235
  return e === "ACCEPTED" ? "default" : e === "DUPLICATE" || e === "PARTIAL" || e === "RECEIVED" ? "secondary" : "destructive";
139
236
  }
140
- function k(e) {
141
- return e === "ACTIVE" ? "Signed deliveries are accepted and become tracking events." : e === "PAUSED" ? "Deliveries are refused with HTTP 423 so the sender can retry after you resume." : "Deliveries are refused with HTTP 410. Resume to accept them again.";
237
+ function U(e, t = "GENERIC_WEBHOOK") {
238
+ return n(t) ? e === "ACTIVE" ? "Polled every 5 minutes; new records become tracking events." : "Not polled. Resume to start reading the feed again from where it stopped." : e === "ACTIVE" ? "Signed deliveries are accepted and become tracking events." : e === "PAUSED" ? "Deliveries are refused with HTTP 423 so the sender can retry after you resume." : "Deliveries are refused with HTTP 410. Resume to accept them again.";
142
239
  }
143
240
  //#endregion
144
- export { g as CREATE_INTEGRATION_MUTATION, o as DEFAULT_SAMSARA_SHIPMENT_KEY, v as DELETE_INTEGRATION_MUTATION, m as INTEGRATION_COUNTS_QUERY, h as INTEGRATION_EVENTS_QUERY, r as INTEGRATION_STATUSES, p as LIST_INTEGRATIONS_QUERY, n as PLANNED_ELD_PROVIDERS, t as ROADMAP_PROVIDERS, a as SAMSARA_EVENT_TYPES, l as SAMSARA_SIGNATURE_HEADERS, d as SIGNATURE_HEADER, u as TRACKING_EVENT_TYPES, _ as UPDATE_INTEGRATION_MUTATION, T as curlExample, O as eventStatusTone, C as examplePayload, c as externalIdKeyError, y as generateSigningSecret, E as humanize, x as integrationNameError, D as integrationStatusTone, i as providerLabel, s as samsaraSecretError, b as signingSecretError, k as statusExplanation, S as webhookUrl };
241
+ export { E as CREATE_INTEGRATION_MUTATION, d as DEFAULT_GEOTAB_SERVER, c as DEFAULT_SAMSARA_SHIPMENT_KEY, k as DELETE_INTEGRATION_MUTATION, f as GEOTAB_RULE_EVENT_TYPES, w as INTEGRATION_COUNTS_QUERY, T as INTEGRATION_EVENTS_QUERY, a as INTEGRATION_STATUSES, C as LIST_INTEGRATIONS_QUERY, i as PLANNED_ELD_PROVIDERS, O as POLL_INTEGRATION_NOW_MUTATION, r as ROADMAP_PROVIDERS, s as SAMSARA_EVENT_TYPES, y as SAMSARA_SIGNATURE_HEADERS, x as SIGNATURE_HEADER, b as TRACKING_EVENT_TYPES, D as UPDATE_INTEGRATION_MUTATION, _ as buildGeotabConfig, I as curlExample, H as eventStatusTone, P as examplePayload, u as externalIdKeyError, A as generateSigningSecret, v as geotabPasswordError, L as humanize, M as integrationNameError, R as integrationStatusTone, n as isPolledProvider, V as pollResultMessage, B as pollStatusSummary, z as pollStatusTone, o as providerLabel, l as samsaraSecretError, j as signingSecretError, U as statusExplanation, N as webhookUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-movethewheels",
3
- "version": "2026.1108.2",
3
+ "version": "2026.1108.4",
4
4
  "description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
5
5
  "type": "module",
6
6
  "files": [