@burdenoff/microfe-movethewheels 2026.1108.4 → 2026.1109.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,15 +17,16 @@ var r = [
17
17
  id: "DESCARTES",
18
18
  label: "Descartes"
19
19
  }
20
- ], i = ["Motive"], a = [
20
+ ], i = [
21
21
  "ACTIVE",
22
22
  "PAUSED",
23
23
  "DISABLED"
24
24
  ];
25
- function o(e) {
25
+ function a(e) {
26
26
  switch (e) {
27
27
  case "GENERIC_WEBHOOK": return "Signed webhook";
28
28
  case "SAMSARA": return "Samsara";
29
+ case "MOTIVE": return "Motive";
29
30
  case "GEOTAB": return "Geotab";
30
31
  case "SHIPROCKET": return "Shiprocket";
31
32
  case "PROJECT44": return "project44";
@@ -33,7 +34,7 @@ function o(e) {
33
34
  case "DESCARTES": return "Descartes";
34
35
  }
35
36
  }
36
- var s = [
37
+ var o = [
37
38
  {
38
39
  type: "RouteStopArrival",
39
40
  becomes: "ARRIVED"
@@ -50,18 +51,24 @@ var s = [
50
51
  type: "GeofenceExit",
51
52
  becomes: "DEPARTED"
52
53
  }
53
- ], c = "mtwShipment";
54
- function l(e) {
54
+ ], s = [{
55
+ action: "vehicle_geofence_event",
56
+ becomes: "Arrived on geofence entry, Departed on exit"
57
+ }, {
58
+ action: "vehicle_location_updated",
59
+ becomes: "In transit, with the reported position"
60
+ }], c = "X-KT-Webhook-Signature", l = "mtwShipment";
61
+ function u(e) {
55
62
  let t = e.trim(), n = "Paste the secret key exactly as Samsara shows it on the webhook page.";
56
63
  if (!t || t.length % 4 != 0 || !/^[A-Za-z0-9+/]+={0,2}$/.test(t)) return n;
57
64
  let r = t.endsWith("==") ? 2 : +!!t.endsWith("=");
58
65
  return t.length / 4 * 3 - r < 16 ? n : null;
59
66
  }
60
- function u(e) {
67
+ function d(e) {
61
68
  let t = e.trim();
62
69
  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;
63
70
  }
64
- var d = "my.geotab.com", f = [
71
+ var f = "my.geotab.com", p = [
65
72
  "PICKED_UP",
66
73
  "IN_TRANSIT",
67
74
  "ARRIVED",
@@ -70,26 +77,26 @@ var d = "my.geotab.com", f = [
70
77
  "DELIVERED",
71
78
  "FAILED",
72
79
  "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) {
80
+ ], m = /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.geotab\.com$/, h = /^[A-Za-z0-9_.-]{1,64}$/;
81
+ function g(e) {
75
82
  let t = e.trim().toLowerCase();
76
- if (!t) return d;
83
+ if (!t) return f;
77
84
  let n = t.replace(/^https:\/\//, "").replace(/\/(apiv1\/?)?$/, "");
78
- return p.test(n) ? n : null;
85
+ return m.test(n) ? n : null;
79
86
  }
80
- function g(e) {
87
+ function _(e) {
81
88
  let t = {}, n = e.split(/\r?\n/);
82
89
  for (let [e, r] of n.entries()) {
83
90
  let n = r.trim();
84
91
  if (!n || n.startsWith("#")) continue;
85
92
  let i = /^([^=:]+)[=:](.+)$/.exec(n), a = i?.[1]?.trim() ?? "", o = (i?.[2]?.trim() ?? "").toUpperCase().replace(/[\s-]+/g, "_");
86
- if (!i || !m.test(a)) return {
93
+ if (!i || !h.test(a)) return {
87
94
  ok: !1,
88
95
  error: `Line ${e + 1}: write each mapping as <rule id> = <event>, e.g. RuleArriveId = ARRIVED.`
89
96
  };
90
- if (!f.includes(o)) return {
97
+ if (!p.includes(o)) return {
91
98
  ok: !1,
92
- error: `Line ${e + 1}: use one of ${f.join(", ")}.`
99
+ error: `Line ${e + 1}: use one of ${p.join(", ")}.`
93
100
  };
94
101
  t[a] = o;
95
102
  }
@@ -101,8 +108,8 @@ function g(e) {
101
108
  ruleEvents: t
102
109
  };
103
110
  }
104
- function _(e) {
105
- let t = h(e.server);
111
+ function v(e) {
112
+ let t = g(e.server);
106
113
  if (!t) return {
107
114
  ok: !1,
108
115
  error: "Use your MyGeotab server, e.g. my.geotab.com."
@@ -117,7 +124,7 @@ function _(e) {
117
124
  ok: !1,
118
125
  error: "Enter the MyGeotab user name."
119
126
  };
120
- let i = g(e.ruleMappings);
127
+ let i = _(e.ruleMappings);
121
128
  return i.ok ? !e.locationUpdates && Object.keys(i.ruleEvents).length === 0 ? {
122
129
  ok: !1,
123
130
  error: "Turn on GPS position updates or map at least one exception rule, or nothing is read."
@@ -132,10 +139,10 @@ function _(e) {
132
139
  }
133
140
  } : i;
134
141
  }
135
- function v(e) {
142
+ function y(e) {
136
143
  return e ? e.length > 255 ? "The password can be at most 255 characters." : null : "Enter the MyGeotab password.";
137
144
  }
138
- var y = ["X-Samsara-Signature", "X-Samsara-Timestamp"], b = [
145
+ var b = ["X-Samsara-Signature", "X-Samsara-Timestamp"], x = [
139
146
  "CREATED",
140
147
  "PICKED_UP",
141
148
  "IN_TRANSIT",
@@ -145,41 +152,41 @@ var y = ["X-Samsara-Signature", "X-Samsara-Timestamp"], b = [
145
152
  "DELIVERED",
146
153
  "FAILED",
147
154
  "RETURNED"
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 = `
155
+ ], S = "x-webhook-signature", C = "\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", w = `
149
156
  query MtwCarrierIntegrations($filter: IntegrationFilterInput, $pagination: PaginationInput) {
150
157
  integrations(filter: $filter, pagination: $pagination) {
151
- ${S}
158
+ ${C}
152
159
  }
153
160
  integrationsCount(filter: $filter)
154
161
  }
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 = `
162
+ `, T = "\n query MtwCarrierIntegrationCounts {\n all: integrationsCount\n active: integrationsCount(filter: { status: ACTIVE })\n }\n", E = "\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", D = `
156
163
  mutation CreateMtwCarrierIntegration($input: CreateIntegrationInput!) {
157
164
  createIntegration(input: $input) {
158
- ${S}
165
+ ${C}
159
166
  }
160
167
  }
161
- `, D = `
168
+ `, O = `
162
169
  mutation UpdateMtwCarrierIntegration($id: ID!, $input: UpdateIntegrationInput!) {
163
170
  updateIntegration(id: $id, input: $input) {
164
- ${S}
171
+ ${C}
165
172
  }
166
173
  }
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) {
174
+ `, k = "\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", A = "\n mutation DeleteMtwCarrierIntegration($id: ID!) {\n deleteIntegration(id: $id)\n }\n";
175
+ function j(e = globalThis.crypto) {
169
176
  let t = e.getRandomValues(new Uint8Array(32));
170
177
  return Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
171
178
  }
172
- function j(e) {
179
+ function M(e) {
173
180
  return e.trim().length < 32 ? "Use a signing secret of at least 32 characters." : null;
174
181
  }
175
- function M(e) {
182
+ function N(e) {
176
183
  let t = e.trim();
177
184
  return t ? t.length > 120 ? "Keep the name under 120 characters." : null : "Give the integration a name.";
178
185
  }
179
- function N(t, n, r, i) {
186
+ function P(t, n, r, i) {
180
187
  return `${new URL(e(t), i).origin}/api/integrations/webhook/${n}/${r}`;
181
188
  }
182
- function P(e = /* @__PURE__ */ new Date()) {
189
+ function F(e = /* @__PURE__ */ new Date()) {
183
190
  return JSON.stringify({
184
191
  externalEventId: "evt_0001",
185
192
  trackingNumber: "YOUR-TRACKING-NUMBER",
@@ -193,30 +200,30 @@ function P(e = /* @__PURE__ */ new Date()) {
193
200
  details: "Departed origin hub"
194
201
  }, null, 2);
195
202
  }
196
- function F(e) {
203
+ function I(e) {
197
204
  return `'${e.split("'").join("'\\''")}'`;
198
205
  }
199
- function I(e) {
206
+ function L(e) {
200
207
  return [
201
208
  "BODY='{\"externalEventId\":\"evt_0001\",\"trackingNumber\":\"YOUR-TRACKING-NUMBER\",\"eventType\":\"IN_TRANSIT\"}'",
202
209
  "SIG=$(printf '%s' \"$BODY\" | openssl dgst -sha256 -hmac \"$MTW_WEBHOOK_SECRET\" -hex | sed 's/^.* //')",
203
- `curl -X POST ${F(e)} \\`,
210
+ `curl -X POST ${I(e)} \\`,
204
211
  " -H 'Content-Type: application/json' \\",
205
- ` -H "${x}: sha256=$SIG" \\`,
212
+ ` -H "${S}: sha256=$SIG" \\`,
206
213
  " --data \"$BODY\""
207
214
  ].join("\n");
208
215
  }
209
- function L(e) {
216
+ function R(e) {
210
217
  let t = e.toLowerCase().split("_").join(" ");
211
218
  return t.charAt(0).toUpperCase() + t.slice(1);
212
219
  }
213
- function R(e) {
220
+ function z(e) {
214
221
  return e === "ACTIVE" ? "default" : e === "PAUSED" ? "secondary" : "outline";
215
222
  }
216
- function z(e) {
223
+ function B(e) {
217
224
  return e === "OK" ? "default" : e === "PARTIAL" ? "secondary" : e === "FAILED" ? "destructive" : "outline";
218
225
  }
219
- function B(e, t) {
226
+ function V(e, t) {
220
227
  if (!e?.lastPollAt) return "Not polled yet; the first poll runs within a few minutes.";
221
228
  let n = t(e.lastPollAt);
222
229
  if (e.lastPollStatus === "FAILED") {
@@ -225,17 +232,17 @@ function B(e, t) {
225
232
  }
226
233
  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
234
  }
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")}).`;
235
+ function H(e, t) {
236
+ if (t.status === "SKIPPED") return t.skippedReason === "POLL_IN_PROGRESS" ? `${e} is being polled right now; refresh in a moment.` : `${e} was not polled (${R(t.skippedReason ?? "skipped")}).`;
230
237
  if (t.status === "FAILED") return `Polling ${e} failed: ${t.error ?? "unknown error"}`;
231
238
  let n = t.status === "PARTIAL" ? " Some updates were refused; see the log." : "";
232
239
  return `Polled ${e}: ${t.recordsFetched} records read, ${t.updatesAccepted} tracking events added.${n}`;
233
240
  }
234
- function H(e) {
241
+ function U(e) {
235
242
  return e === "ACCEPTED" ? "default" : e === "DUPLICATE" || e === "PARTIAL" || e === "RECEIVED" ? "secondary" : "destructive";
236
243
  }
237
- function U(e, t = "GENERIC_WEBHOOK") {
244
+ function W(e, t = "GENERIC_WEBHOOK") {
238
245
  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.";
239
246
  }
240
247
  //#endregion
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 };
248
+ export { D as CREATE_INTEGRATION_MUTATION, f as DEFAULT_GEOTAB_SERVER, l as DEFAULT_SAMSARA_SHIPMENT_KEY, A as DELETE_INTEGRATION_MUTATION, p as GEOTAB_RULE_EVENT_TYPES, T as INTEGRATION_COUNTS_QUERY, E as INTEGRATION_EVENTS_QUERY, i as INTEGRATION_STATUSES, w as LIST_INTEGRATIONS_QUERY, s as MOTIVE_ACTIONS, c as MOTIVE_SIGNATURE_HEADER, k as POLL_INTEGRATION_NOW_MUTATION, r as ROADMAP_PROVIDERS, o as SAMSARA_EVENT_TYPES, b as SAMSARA_SIGNATURE_HEADERS, S as SIGNATURE_HEADER, x as TRACKING_EVENT_TYPES, O as UPDATE_INTEGRATION_MUTATION, v as buildGeotabConfig, L as curlExample, U as eventStatusTone, F as examplePayload, d as externalIdKeyError, j as generateSigningSecret, y as geotabPasswordError, R as humanize, N as integrationNameError, z as integrationStatusTone, n as isPolledProvider, H as pollResultMessage, V as pollStatusSummary, B as pollStatusTone, a as providerLabel, u as samsaraSecretError, M as signingSecretError, W as statusExplanation, P as webhookUrl };
@@ -94,7 +94,12 @@ function m(t) {
94
94
  return Math.abs(t) < 1 ? `${Math.round(t * 1e3)} m` : `${f.format(t)} km`;
95
95
  }
96
96
  function h(e) {
97
+ if (e < 60) return `${e} min`;
98
+ let t = Math.floor(e / 60), n = e % 60;
99
+ return n === 0 ? `${t} ${t === 1 ? "hour" : "hours"}` : `${t}h ${n}m`;
100
+ }
101
+ function g(e) {
97
102
  return e.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2);
98
103
  }
99
104
  //#endregion
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 };
105
+ export { a as formatAddress, o as formatCurrency, s as formatDate, c as formatDateTime, m as formatDistance, h as formatDuration, l as formatTime, p as formatWeight, g as getInitials, t as setFormatPreferences };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-movethewheels",
3
- "version": "2026.1108.4",
3
+ "version": "2026.1109.1",
4
4
  "description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
5
5
  "type": "module",
6
6
  "files": [
@@ -3280,6 +3280,7 @@ export type MtwIntegrationProvider =
3280
3280
  | 'FOURKITES'
3281
3281
  | 'GENERIC_WEBHOOK'
3282
3282
  | 'GEOTAB'
3283
+ | 'MOTIVE'
3283
3284
  | 'PROJECT44'
3284
3285
  | 'SAMSARA'
3285
3286
  | 'SHIPROCKET';