@burdenoff/microfe-movethewheels 2026.1031.6 → 2026.1101.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/MoveTheWheelsRoot.js +141 -133
  2. package/dist/MoveTheWheelsRoutes.js +29 -25
  3. package/dist/components/EpodCaptureForm.js +256 -0
  4. package/dist/generated/wspace-types.d.ts +9012 -132
  5. package/dist/hooks/index.js +1 -0
  6. package/dist/hooks/useCarrierIntegrations.js +141 -0
  7. package/dist/hooks/useDriverDay.js +153 -0
  8. package/dist/hooks/useOrders.js +1 -1
  9. package/dist/index.js +27 -26
  10. package/dist/movethewheels/components/EpodCaptureForm.d.ts +12 -0
  11. package/dist/movethewheels/hooks/index.d.ts +1 -0
  12. package/dist/movethewheels/hooks/useCarrierIntegrations.d.ts +39 -0
  13. package/dist/movethewheels/hooks/useDriverDay.d.ts +53 -0
  14. package/dist/movethewheels/pages/IntegrationsPage.d.ts +6 -0
  15. package/dist/movethewheels/utils/carrierIntegrations.d.ts +88 -0
  16. package/dist/movethewheels/utils/driverNavigation.d.ts +31 -0
  17. package/dist/node_modules/lucide-react/dist/esm/icons/calendar-days.js +50 -0
  18. package/dist/node_modules/lucide-react/dist/esm/icons/copy.js +16 -0
  19. package/dist/node_modules/lucide-react/dist/esm/icons/pause.js +19 -0
  20. package/dist/node_modules/lucide-react/dist/esm/icons/play.js +8 -0
  21. package/dist/node_modules/lucide-react/dist/esm/icons/wifi-off.js +34 -0
  22. package/dist/pages/DeliveryCapturePage.js +450 -321
  23. package/dist/pages/IntegrationsPage.js +616 -0
  24. package/dist/pages/SettingsPage.js +168 -150
  25. package/dist/utils/carrierIntegrations.js +105 -0
  26. package/dist/utils/driverNavigation.js +51 -0
  27. package/dist/utils/formatters.js +18 -9
  28. package/package.json +4 -2
  29. package/src/generated/wspace-types.ts +10266 -142
  30. package/src/movethewheels/MoveTheWheelsRoot.tsx +8 -0
  31. package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -0
  32. package/src/movethewheels/components/EpodCaptureForm.tsx +343 -0
  33. package/src/movethewheels/hooks/index.ts +9 -0
  34. package/src/movethewheels/hooks/useCarrierIntegrations.ts +221 -0
  35. package/src/movethewheels/hooks/useDriverDay.ts +289 -0
  36. package/src/movethewheels/pages/DeliveryCapturePage.tsx +478 -392
  37. package/src/movethewheels/pages/IntegrationsPage.tsx +752 -0
  38. package/src/movethewheels/pages/SettingsPage.tsx +19 -3
  39. package/src/movethewheels/utils/carrierIntegrations.ts +252 -0
  40. package/src/movethewheels/utils/driverNavigation.ts +103 -0
@@ -0,0 +1,105 @@
1
+ import { resolveGraphqlUrl as e } from "./graphqlClient.js";
2
+ //#region src/movethewheels/utils/carrierIntegrations.ts
3
+ var t = [
4
+ {
5
+ id: "PROJECT44",
6
+ label: "project44"
7
+ },
8
+ {
9
+ id: "FOURKITES",
10
+ label: "FourKites"
11
+ },
12
+ {
13
+ id: "DESCARTES",
14
+ label: "Descartes"
15
+ }
16
+ ], n = [
17
+ "ACTIVE",
18
+ "PAUSED",
19
+ "DISABLED"
20
+ ], r = [
21
+ "CREATED",
22
+ "PICKED_UP",
23
+ "IN_TRANSIT",
24
+ "ARRIVED",
25
+ "DEPARTED",
26
+ "OUT_FOR_DELIVERY",
27
+ "DELIVERED",
28
+ "FAILED",
29
+ "RETURNED"
30
+ ], i = "x-webhook-signature", a = "\n id\n workspaceId\n provider\n name\n status\n lastSyncAt\n lastErrorAt\n lastErrorMessage\n createdAt\n updatedAt\n", o = `
31
+ query MtwCarrierIntegrations($filter: IntegrationFilterInput, $pagination: PaginationInput) {
32
+ integrations(filter: $filter, pagination: $pagination) {
33
+ ${a}
34
+ }
35
+ integrationsCount(filter: $filter)
36
+ }
37
+ `, s = "\n query MtwCarrierIntegrationCounts {\n all: integrationsCount\n active: integrationsCount(filter: { status: ACTIVE })\n }\n", c = "\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", l = `
38
+ mutation CreateMtwCarrierIntegration($input: CreateIntegrationInput!) {
39
+ createIntegration(input: $input) {
40
+ ${a}
41
+ }
42
+ }
43
+ `, u = `
44
+ mutation UpdateMtwCarrierIntegration($id: ID!, $input: UpdateIntegrationInput!) {
45
+ updateIntegration(id: $id, input: $input) {
46
+ ${a}
47
+ }
48
+ }
49
+ `, d = "\n mutation DeleteMtwCarrierIntegration($id: ID!) {\n deleteIntegration(id: $id)\n }\n";
50
+ function f(e = globalThis.crypto) {
51
+ let t = e.getRandomValues(new Uint8Array(32));
52
+ return Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
53
+ }
54
+ function p(e) {
55
+ return e.trim().length < 32 ? "Use a signing secret of at least 32 characters." : null;
56
+ }
57
+ function m(e) {
58
+ let t = e.trim();
59
+ return t ? t.length > 120 ? "Keep the name under 120 characters." : null : "Give the integration a name.";
60
+ }
61
+ function h(t, n, r, i) {
62
+ return `${new URL(e(t), i).origin}/api/integrations/webhook/${n}/${r}`;
63
+ }
64
+ function g(e = /* @__PURE__ */ new Date()) {
65
+ return JSON.stringify({
66
+ externalEventId: "evt_0001",
67
+ trackingNumber: "YOUR-TRACKING-NUMBER",
68
+ eventType: "IN_TRANSIT",
69
+ timestamp: e.toISOString().replace(/\.\d{3}Z$/, "Z"),
70
+ location: {
71
+ lat: 12.9716,
72
+ lng: 77.5946,
73
+ address: "Bengaluru hub"
74
+ },
75
+ details: "Departed origin hub"
76
+ }, null, 2);
77
+ }
78
+ function _(e) {
79
+ return `'${e.split("'").join("'\\''")}'`;
80
+ }
81
+ function v(e) {
82
+ return [
83
+ "BODY='{\"externalEventId\":\"evt_0001\",\"trackingNumber\":\"YOUR-TRACKING-NUMBER\",\"eventType\":\"IN_TRANSIT\"}'",
84
+ "SIG=$(printf '%s' \"$BODY\" | openssl dgst -sha256 -hmac \"$MTW_WEBHOOK_SECRET\" -hex | sed 's/^.* //')",
85
+ `curl -X POST ${_(e)} \\`,
86
+ " -H 'Content-Type: application/json' \\",
87
+ ` -H "${i}: sha256=$SIG" \\`,
88
+ " --data \"$BODY\""
89
+ ].join("\n");
90
+ }
91
+ function y(e) {
92
+ let t = e.toLowerCase().split("_").join(" ");
93
+ return t.charAt(0).toUpperCase() + t.slice(1);
94
+ }
95
+ function b(e) {
96
+ return e === "ACTIVE" ? "default" : e === "PAUSED" ? "secondary" : "outline";
97
+ }
98
+ function x(e) {
99
+ return e === "ACCEPTED" ? "default" : e === "DUPLICATE" || e === "PARTIAL" || e === "RECEIVED" ? "secondary" : "destructive";
100
+ }
101
+ function S(e) {
102
+ 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.";
103
+ }
104
+ //#endregion
105
+ export { l as CREATE_INTEGRATION_MUTATION, d as DELETE_INTEGRATION_MUTATION, s as INTEGRATION_COUNTS_QUERY, c as INTEGRATION_EVENTS_QUERY, n as INTEGRATION_STATUSES, o as LIST_INTEGRATIONS_QUERY, t as ROADMAP_PROVIDERS, i as SIGNATURE_HEADER, r as TRACKING_EVENT_TYPES, u as UPDATE_INTEGRATION_MUTATION, v as curlExample, x as eventStatusTone, g as examplePayload, f as generateSigningSecret, y as humanize, m as integrationNameError, b as integrationStatusTone, p as signingSecretError, S as statusExplanation, h as webhookUrl };
@@ -0,0 +1,51 @@
1
+ import { formatAddress as e } from "./formatters.js";
2
+ //#region src/movethewheels/utils/driverNavigation.ts
3
+ var t = "https://www.google.com/maps/dir/?api=1";
4
+ function n(t) {
5
+ if (!t) return null;
6
+ if (typeof t.latitude == "number" && typeof t.longitude == "number" && Number.isFinite(t.latitude) && Number.isFinite(t.longitude)) return `${t.latitude},${t.longitude}`;
7
+ let n = e(t).trim();
8
+ return n.length > 0 ? n : null;
9
+ }
10
+ function r(e) {
11
+ let r = n(e);
12
+ return r ? `${t}&${new URLSearchParams({
13
+ destination: r,
14
+ travelmode: "driving"
15
+ }).toString()}` : null;
16
+ }
17
+ function i(e) {
18
+ let r = e.map((e) => n(e)).filter((e) => e !== null).slice(0, 10);
19
+ if (r.length === 0) return null;
20
+ let i = r[r.length - 1], a = r.slice(0, -1), o = new URLSearchParams({
21
+ destination: i,
22
+ travelmode: "driving"
23
+ });
24
+ return a.length > 0 && o.set("waypoints", a.join("|")), `${t}&${o.toString()}`;
25
+ }
26
+ function a(e) {
27
+ if (!e) return null;
28
+ let t = e.replace(/[^\d+]/g, "");
29
+ return t.length >= 3 ? `tel:${t}` : null;
30
+ }
31
+ function o(e) {
32
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
33
+ }
34
+ function s(e, t) {
35
+ let [n, r, i] = e.split("-").map(Number);
36
+ return o(new Date(n, r - 1, i + t));
37
+ }
38
+ function c(e) {
39
+ let [t, n, r] = e.split("-").map(Number);
40
+ return new Date(t, n - 1, r).getTimezoneOffset();
41
+ }
42
+ function l() {
43
+ try {
44
+ let e = Intl.DateTimeFormat().resolvedOptions().timeZone;
45
+ return typeof e == "string" && e.length > 0 ? e : null;
46
+ } catch {
47
+ return null;
48
+ }
49
+ }
50
+ //#endregion
51
+ export { l as deviceTimeZone, o as localDateString, a as phoneHref, i as routeNavigationUrl, s as shiftLocalDate, r as stopNavigationUrl, c as timezoneOffsetFor };
@@ -30,7 +30,7 @@ function o(t, n) {
30
30
  }
31
31
  function s(e, t = "short") {
32
32
  let r = typeof e == "string" ? new Date(e) : e;
33
- return t === "relative" ? l(r) : t === "time" ? new Intl.DateTimeFormat("en-US", {
33
+ return t === "relative" ? u(r) : t === "time" ? new Intl.DateTimeFormat("en-US", {
34
34
  hour: "numeric",
35
35
  minute: "2-digit",
36
36
  hour12: !0,
@@ -64,6 +64,15 @@ function c(e) {
64
64
  }).format(t);
65
65
  }
66
66
  function l(e) {
67
+ let t = typeof e == "string" ? new Date(e) : e;
68
+ return new Intl.DateTimeFormat("en-US", {
69
+ hour: "numeric",
70
+ minute: "2-digit",
71
+ hour12: !0,
72
+ ...n()
73
+ }).format(t);
74
+ }
75
+ function u(e) {
67
76
  let t = typeof e == "string" ? new Date(e) : e, n = Math.floor(((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / 1e3);
68
77
  if (n < 60) return "Just now";
69
78
  let r = Math.floor(n / 60);
@@ -73,19 +82,19 @@ function l(e) {
73
82
  let a = Math.floor(i / 24);
74
83
  return a < 7 ? `${a} ${a === 1 ? "day" : "days"} ago` : s(t);
75
84
  }
76
- var u = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 }), d = new Intl.NumberFormat("en-US", { maximumFractionDigits: 1 });
77
- function f(t) {
78
- return e.weightUnit === "LB" ? `${u.format(t / i)} lb` : Math.abs(t) >= 1e3 ? `${u.format(t / 1e3)} tonnes` : `${u.format(t)} kg`;
79
- }
85
+ var d = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 }), f = new Intl.NumberFormat("en-US", { maximumFractionDigits: 1 });
80
86
  function p(t) {
87
+ return e.weightUnit === "LB" ? `${d.format(t / i)} lb` : Math.abs(t) >= 1e3 ? `${d.format(t / 1e3)} tonnes` : `${d.format(t)} kg`;
88
+ }
89
+ function m(t) {
81
90
  if (e.distanceUnit === "MI") {
82
91
  let e = t / r;
83
- return Math.abs(e) < .1 ? `${Math.round(e * 5280)} ft` : `${d.format(e)} mi`;
92
+ return Math.abs(e) < .1 ? `${Math.round(e * 5280)} ft` : `${f.format(e)} mi`;
84
93
  }
85
- return Math.abs(t) < 1 ? `${Math.round(t * 1e3)} m` : `${d.format(t)} km`;
94
+ return Math.abs(t) < 1 ? `${Math.round(t * 1e3)} m` : `${f.format(t)} km`;
86
95
  }
87
- function m(e) {
96
+ function h(e) {
88
97
  return e.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2);
89
98
  }
90
99
  //#endregion
91
- export { a as formatAddress, o as formatCurrency, s as formatDate, c as formatDateTime, p as formatDistance, f as formatWeight, m as getInitials, t as setFormatPreferences };
100
+ export { a as formatAddress, o as formatCurrency, s as formatDate, c as formatDateTime, m as formatDistance, l as formatTime, p as formatWeight, h as getInitials, t as setFormatPreferences };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-movethewheels",
3
- "version": "2026.1031.6",
3
+ "version": "2026.1101.2",
4
4
  "description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
5
5
  "type": "module",
6
6
  "files": [
@@ -37,7 +37,7 @@
37
37
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
38
38
  "type:check": "bash scripts/build-limits.sh tsc --noEmit",
39
39
  "validate:schema-drift": "graphql-schema-drift",
40
- "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run verify:live-logistics-contract && bun run verify:empty-reuse-retry && bun run verify:empty-reuse-recovery && bun run verify:trip-utilization-input && bun run verify:trip-draft-context && bun run verify:stock-binding-input && bun run verify:stock-observation-input && bun run verify:pending-pick-input && bun run verify:pick-review-ack && bun run verify:driver-license-expiry && bun run verify:tracking-alerts && bun run verify:freight-input && bun run verify:freight-recovery && bun run verify:freight-commercial && bun run verify:freight-invoice && bun run verify:procedure-input && bun run verify:consolidation && bun run verify:multimodal-single-attempt && bun run verify:workspace-predispatch && bun run verify:tracking-quality-outcomes && bun run verify:shipment-status-authority && bun run verify:free-time-permissions && bun run verify:core-codegen && bun run verify:order-vehicle-hold && bun run verify:pallet-preview && bun run verify:entity-export && bun run verify:entity-import && bun run verify:module-settings && bun run verify:consumed-fuel-preview && bun run build && bun run build-storybook'",
40
+ "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run verify:live-logistics-contract && bun run verify:empty-reuse-retry && bun run verify:empty-reuse-recovery && bun run verify:trip-utilization-input && bun run verify:trip-draft-context && bun run verify:stock-binding-input && bun run verify:stock-observation-input && bun run verify:pending-pick-input && bun run verify:pick-review-ack && bun run verify:driver-license-expiry && bun run verify:tracking-alerts && bun run verify:freight-input && bun run verify:freight-recovery && bun run verify:freight-commercial && bun run verify:freight-invoice && bun run verify:procedure-input && bun run verify:consolidation && bun run verify:multimodal-single-attempt && bun run verify:workspace-predispatch && bun run verify:tracking-quality-outcomes && bun run verify:shipment-status-authority && bun run verify:free-time-permissions && bun run verify:core-codegen && bun run verify:order-vehicle-hold && bun run verify:pallet-preview && bun run verify:entity-export && bun run verify:entity-import && bun run verify:module-settings && bun run verify:carrier-integrations && bun run verify:driver-day && bun run verify:consumed-fuel-preview && bun run build && bun run build-storybook'",
41
41
  "storybook": "storybook dev -p 6006",
42
42
  "build-storybook": "storybook build",
43
43
  "test:storybook": "vitest run --project=storybook",
@@ -75,6 +75,8 @@
75
75
  "verify:entity-export": "bun test scripts/check-entity-export.test.ts",
76
76
  "verify:entity-import": "bun test scripts/check-entity-import.test.ts",
77
77
  "verify:module-settings": "bun test scripts/check-module-settings.test.ts",
78
+ "verify:driver-day": "bun test scripts/verify-driver-day.test.ts && bun scripts/verify-acknowledged-pending-delivery.mjs",
79
+ "verify:carrier-integrations": "bun test scripts/check-carrier-integrations.test.ts",
78
80
  "verify:pallet-preview": "bun test scripts/check-pallet-preview.test.ts && bun scripts/verify-pallet-preview-hook.mjs",
79
81
  "verify:consumed-fuel-preview": "bun test scripts/check-consumed-fuel-preview.test.ts && bun scripts/verify-consumed-fuel-preview-hook.mjs && bun scripts/verify-consumed-fuel-preview-component.mjs"
80
82
  },