@burdenoff/microfe-movethewheels 2026.1107.2 → 2026.1107.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.
- package/dist/MoveTheWheelsRoutes.js +9 -5
- package/dist/components/DispatchDecisionCard.js +203 -0
- package/dist/generated/tracking-quality-operations.d.ts +138 -1
- package/dist/generated/wspace-types.d.ts +448 -8
- package/dist/hooks/useDispatchPlan.js +88 -0
- package/dist/movethewheels/components/DispatchDecisionCard.d.ts +16 -0
- package/dist/movethewheels/hooks/useCarrierIntegrations.d.ts +2 -0
- package/dist/movethewheels/hooks/useDispatchPlan.d.ts +79 -0
- package/dist/movethewheels/pages/DispatchPlanPage.d.ts +14 -0
- package/dist/movethewheels/utils/carrierIntegrations.d.ts +38 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/wand-sparkles.js +38 -0
- package/dist/pages/DispatchPlanPage.js +374 -0
- package/dist/pages/IntegrationsPage.js +324 -129
- package/dist/pages/RoutesPage.js +85 -80
- package/dist/utils/carrierIntegrations.js +62 -23
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +157 -0
- package/src/generated/wspace-types.ts +518 -8
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
- package/src/movethewheels/components/DispatchDecisionCard.tsx +243 -0
- package/src/movethewheels/hooks/useCarrierIntegrations.ts +2 -0
- package/src/movethewheels/hooks/useDispatchPlan.ts +286 -0
- package/src/movethewheels/pages/DispatchPlanPage.tsx +505 -0
- package/src/movethewheels/pages/IntegrationsPage.tsx +266 -44
- package/src/movethewheels/pages/RoutesPage.tsx +9 -2
- package/src/movethewheels/utils/carrierIntegrations.ts +76 -8
package/dist/pages/RoutesPage.js
CHANGED
|
@@ -2,21 +2,22 @@ import { Filter as e } from "../node_modules/lucide-react/dist/esm/icons/filter.
|
|
|
2
2
|
import { Navigation as t } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
|
|
3
3
|
import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
4
4
|
import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
5
|
+
import { WandSparkles as i } from "../node_modules/lucide-react/dist/esm/icons/wand-sparkles.js";
|
|
6
|
+
import { joinPath as a } from "../utils/navigation.js";
|
|
7
|
+
import { useMoveTheWheels as o } from "../providers/MoveTheWheelsProvider.js";
|
|
8
|
+
import { formatDate as s, formatDistance as c } from "../utils/formatters.js";
|
|
9
|
+
import { useRouteStats as l, useRoutes as u } from "../hooks/useRoutes.js";
|
|
10
|
+
import { Badge as d, Button as f, Card as p, CardContent as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "../components/ui.js";
|
|
11
|
+
import { PageLayout as b } from "../components/PageLayout.js";
|
|
12
|
+
import { ROUTE_STATUS_COLORS as x } from "../constants/index.js";
|
|
13
|
+
import { StatusBadge as S } from "../components/StatusBadge.js";
|
|
14
|
+
import { DataTable as C } from "../components/DataTable.js";
|
|
15
|
+
import { useDebouncedValue as w } from "../hooks/useDebouncedValue.js";
|
|
16
|
+
import { useState as T } from "react";
|
|
17
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
18
|
+
import { CTAOverflowMenu as O, EmphasisPanel as k, PagePurpose as A } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
//#region src/movethewheels/pages/RoutesPage.tsx
|
|
19
|
-
var
|
|
20
|
+
var j = [
|
|
20
21
|
{
|
|
21
22
|
value: "all",
|
|
22
23
|
label: "All statuses"
|
|
@@ -38,110 +39,114 @@ var A = [
|
|
|
38
39
|
label: "Cancelled"
|
|
39
40
|
}
|
|
40
41
|
];
|
|
41
|
-
function
|
|
42
|
-
let { basePath:
|
|
43
|
-
limit:
|
|
44
|
-
offset:
|
|
45
|
-
search:
|
|
46
|
-
status:
|
|
47
|
-
}),
|
|
48
|
-
return /* @__PURE__ */
|
|
42
|
+
function M() {
|
|
43
|
+
let { basePath: M, navigate: N } = o(), [P, F] = T(0), [I, L] = T(25), [R, z] = T(""), [B, V] = T("all"), H = w(R), { routes: U, totalRoutes: W, hasMore: G, isLoading: K, error: q, refetch: J } = u({
|
|
44
|
+
limit: I,
|
|
45
|
+
offset: P * I,
|
|
46
|
+
search: H || void 0,
|
|
47
|
+
status: B === "all" ? void 0 : B
|
|
48
|
+
}), Y = B !== "all" || R.length > 0, { stats: X } = l(), Z = (e) => N?.(a(M, e));
|
|
49
|
+
return /* @__PURE__ */ D(b, {
|
|
49
50
|
title: "Routes",
|
|
50
|
-
subtitle: `${
|
|
51
|
-
icon: /* @__PURE__ */
|
|
52
|
-
headerActions: /* @__PURE__ */
|
|
51
|
+
subtitle: `${X.totalRoutes} routes`,
|
|
52
|
+
icon: /* @__PURE__ */ E(t, { size: 24 }),
|
|
53
|
+
headerActions: /* @__PURE__ */ E(O, {
|
|
53
54
|
primary: {
|
|
54
55
|
label: "Create Route",
|
|
55
|
-
icon: /* @__PURE__ */
|
|
56
|
-
onSelect: () =>
|
|
56
|
+
icon: /* @__PURE__ */ E(n, { size: 16 }),
|
|
57
|
+
onSelect: () => Z("routes/new")
|
|
57
58
|
},
|
|
58
59
|
actions: [{
|
|
60
|
+
label: "Plan dispatch",
|
|
61
|
+
icon: /* @__PURE__ */ E(i, { size: 16 }),
|
|
62
|
+
onSelect: () => Z("routes/dispatch-plan")
|
|
63
|
+
}, {
|
|
59
64
|
label: "Refresh",
|
|
60
|
-
icon: /* @__PURE__ */
|
|
61
|
-
onSelect: () =>
|
|
65
|
+
icon: /* @__PURE__ */ E(r, { size: 16 }),
|
|
66
|
+
onSelect: () => J()
|
|
62
67
|
}]
|
|
63
68
|
}),
|
|
64
69
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
icon: /* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ E(A, {
|
|
71
|
+
icon: /* @__PURE__ */ E(t, { size: 18 }),
|
|
67
72
|
children: "Routes group multiple delivery stops into an optimized driving plan. Build a route to batch nearby drop-offs, cut distance and fuel, and give drivers a single ordered itinerary — then open one to review stops, distance and optimization status."
|
|
68
73
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ D(k, { children: [/* @__PURE__ */ E("p", {
|
|
70
75
|
className: "text-sm font-medium text-text-secondary",
|
|
71
76
|
children: "Routes at a glance"
|
|
72
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ D("div", {
|
|
73
78
|
className: "mt-3 grid grid-cols-3 gap-4",
|
|
74
79
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
76
81
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
77
|
-
children:
|
|
78
|
-
}), /* @__PURE__ */
|
|
82
|
+
children: X.totalRoutes
|
|
83
|
+
}), /* @__PURE__ */ E("p", {
|
|
79
84
|
className: "text-xs text-text-secondary",
|
|
80
85
|
children: "Total routes"
|
|
81
86
|
})] }),
|
|
82
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
83
88
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
84
|
-
children:
|
|
85
|
-
}), /* @__PURE__ */
|
|
89
|
+
children: X.inProgressRoutes
|
|
90
|
+
}), /* @__PURE__ */ E("p", {
|
|
86
91
|
className: "text-xs text-text-secondary",
|
|
87
92
|
children: "In progress"
|
|
88
93
|
})] }),
|
|
89
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
90
95
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
91
|
-
children:
|
|
92
|
-
}), /* @__PURE__ */
|
|
96
|
+
children: X.optimizedRoutes
|
|
97
|
+
}), /* @__PURE__ */ E("p", {
|
|
93
98
|
className: "text-xs text-text-secondary",
|
|
94
99
|
children: "Optimized"
|
|
95
100
|
})] })
|
|
96
101
|
]
|
|
97
102
|
})] }),
|
|
98
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ E(p, { children: /* @__PURE__ */ E(m, {
|
|
99
104
|
className: "p-4",
|
|
100
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ D("div", {
|
|
101
106
|
className: "flex flex-wrap items-center gap-4",
|
|
102
107
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ D("div", {
|
|
104
109
|
className: "flex items-center gap-2",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ E(e, {
|
|
106
111
|
size: 16,
|
|
107
112
|
className: "text-text-secondary"
|
|
108
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ E("span", {
|
|
109
114
|
className: "text-sm font-medium",
|
|
110
115
|
children: "Filters:"
|
|
111
116
|
})]
|
|
112
117
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
value:
|
|
118
|
+
/* @__PURE__ */ D(h, {
|
|
119
|
+
value: B,
|
|
115
120
|
onValueChange: (e) => {
|
|
116
|
-
|
|
121
|
+
V(e), F(0);
|
|
117
122
|
},
|
|
118
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ E(v, {
|
|
119
124
|
className: "w-[180px]",
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
}), /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ E(y, { placeholder: "Status" })
|
|
126
|
+
}), /* @__PURE__ */ E(g, { children: j.map((e) => /* @__PURE__ */ E(_, {
|
|
122
127
|
value: e.value,
|
|
123
128
|
children: e.label
|
|
124
129
|
}, e.value)) })]
|
|
125
130
|
}),
|
|
126
|
-
|
|
131
|
+
Y && /* @__PURE__ */ E(f, {
|
|
127
132
|
variant: "ghost",
|
|
128
133
|
size: "sm",
|
|
129
134
|
onClick: () => {
|
|
130
|
-
|
|
135
|
+
V("all"), z(""), F(0);
|
|
131
136
|
},
|
|
132
137
|
children: "Clear filters"
|
|
133
138
|
})
|
|
134
139
|
]
|
|
135
140
|
})
|
|
136
141
|
}) }),
|
|
137
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ E(C, {
|
|
138
143
|
columns: [
|
|
139
144
|
{
|
|
140
145
|
id: "name",
|
|
141
146
|
header: "Route Name",
|
|
142
147
|
accessorKey: "name",
|
|
143
148
|
sortable: !0,
|
|
144
|
-
cell: (e) => /* @__PURE__ */
|
|
149
|
+
cell: (e) => /* @__PURE__ */ E("span", {
|
|
145
150
|
className: "font-medium",
|
|
146
151
|
children: e.name
|
|
147
152
|
})
|
|
@@ -151,15 +156,15 @@ function j() {
|
|
|
151
156
|
header: "Status",
|
|
152
157
|
accessorKey: "status",
|
|
153
158
|
sortable: !0,
|
|
154
|
-
cell: (e) => /* @__PURE__ */
|
|
159
|
+
cell: (e) => /* @__PURE__ */ E(S, {
|
|
155
160
|
status: e.status,
|
|
156
|
-
customColors:
|
|
161
|
+
customColors: x[e.status]
|
|
157
162
|
})
|
|
158
163
|
},
|
|
159
164
|
{
|
|
160
165
|
id: "stops",
|
|
161
166
|
header: "Stops",
|
|
162
|
-
cell: (e) => /* @__PURE__ */
|
|
167
|
+
cell: (e) => /* @__PURE__ */ D(d, {
|
|
163
168
|
variant: "secondary",
|
|
164
169
|
children: [e.stops.length, " stops"]
|
|
165
170
|
})
|
|
@@ -169,7 +174,7 @@ function j() {
|
|
|
169
174
|
header: "Distance",
|
|
170
175
|
accessorKey: "distance",
|
|
171
176
|
sortable: !0,
|
|
172
|
-
cell: (e) =>
|
|
177
|
+
cell: (e) => c(e.distance)
|
|
173
178
|
},
|
|
174
179
|
{
|
|
175
180
|
id: "duration",
|
|
@@ -179,7 +184,7 @@ function j() {
|
|
|
179
184
|
{
|
|
180
185
|
id: "optimized",
|
|
181
186
|
header: "Optimized",
|
|
182
|
-
cell: (e) => /* @__PURE__ */
|
|
187
|
+
cell: (e) => /* @__PURE__ */ E(d, {
|
|
183
188
|
variant: e.optimized === void 0 ? "outline" : e.optimized ? "default" : "outline",
|
|
184
189
|
children: e.optimized === void 0 ? "Unknown" : e.optimized ? "Yes" : "No"
|
|
185
190
|
})
|
|
@@ -189,36 +194,36 @@ function j() {
|
|
|
189
194
|
header: "Created",
|
|
190
195
|
accessorKey: "createdAt",
|
|
191
196
|
sortable: !0,
|
|
192
|
-
cell: (e) =>
|
|
197
|
+
cell: (e) => s(e.createdAt, "short")
|
|
193
198
|
}
|
|
194
199
|
],
|
|
195
|
-
data:
|
|
196
|
-
isLoading:
|
|
197
|
-
error:
|
|
198
|
-
onRetry:
|
|
200
|
+
data: U,
|
|
201
|
+
isLoading: K,
|
|
202
|
+
error: q,
|
|
203
|
+
onRetry: J,
|
|
199
204
|
searchable: !0,
|
|
200
205
|
searchPlaceholder: "Search routes...",
|
|
201
206
|
searchFields: ["name"],
|
|
202
|
-
searchQuery:
|
|
207
|
+
searchQuery: R,
|
|
203
208
|
onSearchQueryChange: (e) => {
|
|
204
|
-
|
|
209
|
+
z(e), F(0);
|
|
205
210
|
},
|
|
206
|
-
onRowClick: (e) =>
|
|
211
|
+
onRowClick: (e) => Z(`routes/${e.id}`),
|
|
207
212
|
getRowId: (e) => e.id,
|
|
208
|
-
pageIndex:
|
|
209
|
-
pageSize:
|
|
210
|
-
onPageChange:
|
|
213
|
+
pageIndex: P,
|
|
214
|
+
pageSize: I,
|
|
215
|
+
onPageChange: F,
|
|
211
216
|
onPageSizeChange: (e) => {
|
|
212
|
-
|
|
217
|
+
L(e), F(0);
|
|
213
218
|
},
|
|
214
|
-
totalItems:
|
|
215
|
-
hasNextPage:
|
|
219
|
+
totalItems: W,
|
|
220
|
+
hasNextPage: G,
|
|
216
221
|
emptyIllustration: "empty-data",
|
|
217
222
|
emptyTitle: "No routes yet",
|
|
218
223
|
emptyDescription: "Create a route to batch deliveries into an optimized driving plan.",
|
|
219
|
-
emptyAction: /* @__PURE__ */
|
|
220
|
-
onClick: () =>
|
|
221
|
-
children: [/* @__PURE__ */
|
|
224
|
+
emptyAction: /* @__PURE__ */ D(f, {
|
|
225
|
+
onClick: () => Z("routes/new"),
|
|
226
|
+
children: [/* @__PURE__ */ E(n, {
|
|
222
227
|
size: 16,
|
|
223
228
|
className: "mr-1.5"
|
|
224
229
|
}), "Create Route"]
|
|
@@ -228,4 +233,4 @@ function j() {
|
|
|
228
233
|
});
|
|
229
234
|
}
|
|
230
235
|
//#endregion
|
|
231
|
-
export {
|
|
236
|
+
export { M as default };
|
|
@@ -13,11 +13,50 @@ var t = [
|
|
|
13
13
|
id: "DESCARTES",
|
|
14
14
|
label: "Descartes"
|
|
15
15
|
}
|
|
16
|
-
], n = [
|
|
16
|
+
], n = ["Motive", "Geotab"], r = [
|
|
17
17
|
"ACTIVE",
|
|
18
18
|
"PAUSED",
|
|
19
19
|
"DISABLED"
|
|
20
|
-
]
|
|
20
|
+
];
|
|
21
|
+
function i(e) {
|
|
22
|
+
switch (e) {
|
|
23
|
+
case "GENERIC_WEBHOOK": return "Signed webhook";
|
|
24
|
+
case "SAMSARA": return "Samsara";
|
|
25
|
+
case "SHIPROCKET": return "Shiprocket";
|
|
26
|
+
case "PROJECT44": return "project44";
|
|
27
|
+
case "FOURKITES": return "FourKites";
|
|
28
|
+
case "DESCARTES": return "Descartes";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var a = [
|
|
32
|
+
{
|
|
33
|
+
type: "RouteStopArrival",
|
|
34
|
+
becomes: "ARRIVED"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: "RouteStopDeparture",
|
|
38
|
+
becomes: "DEPARTED"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: "GeofenceEntry",
|
|
42
|
+
becomes: "ARRIVED"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: "GeofenceExit",
|
|
46
|
+
becomes: "DEPARTED"
|
|
47
|
+
}
|
|
48
|
+
], o = "mtwShipment";
|
|
49
|
+
function s(e) {
|
|
50
|
+
let t = e.trim(), n = "Paste the secret key exactly as Samsara shows it on the webhook page.";
|
|
51
|
+
if (!t || t.length % 4 != 0 || !/^[A-Za-z0-9+/]+={0,2}$/.test(t)) return n;
|
|
52
|
+
let r = t.endsWith("==") ? 2 : +!!t.endsWith("=");
|
|
53
|
+
return t.length / 4 * 3 - r < 16 ? n : null;
|
|
54
|
+
}
|
|
55
|
+
function c(e) {
|
|
56
|
+
let t = e.trim();
|
|
57
|
+
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
|
+
}
|
|
59
|
+
var l = ["X-Samsara-Signature", "X-Samsara-Timestamp"], u = [
|
|
21
60
|
"CREATED",
|
|
22
61
|
"PICKED_UP",
|
|
23
62
|
"IN_TRANSIT",
|
|
@@ -27,41 +66,41 @@ var t = [
|
|
|
27
66
|
"DELIVERED",
|
|
28
67
|
"FAILED",
|
|
29
68
|
"RETURNED"
|
|
30
|
-
],
|
|
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 = `
|
|
31
70
|
query MtwCarrierIntegrations($filter: IntegrationFilterInput, $pagination: PaginationInput) {
|
|
32
71
|
integrations(filter: $filter, pagination: $pagination) {
|
|
33
|
-
${
|
|
72
|
+
${f}
|
|
34
73
|
}
|
|
35
74
|
integrationsCount(filter: $filter)
|
|
36
75
|
}
|
|
37
|
-
`,
|
|
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 = `
|
|
38
77
|
mutation CreateMtwCarrierIntegration($input: CreateIntegrationInput!) {
|
|
39
78
|
createIntegration(input: $input) {
|
|
40
|
-
${
|
|
79
|
+
${f}
|
|
41
80
|
}
|
|
42
81
|
}
|
|
43
|
-
`,
|
|
82
|
+
`, _ = `
|
|
44
83
|
mutation UpdateMtwCarrierIntegration($id: ID!, $input: UpdateIntegrationInput!) {
|
|
45
84
|
updateIntegration(id: $id, input: $input) {
|
|
46
|
-
${
|
|
85
|
+
${f}
|
|
47
86
|
}
|
|
48
87
|
}
|
|
49
|
-
`,
|
|
50
|
-
function
|
|
88
|
+
`, v = "\n mutation DeleteMtwCarrierIntegration($id: ID!) {\n deleteIntegration(id: $id)\n }\n";
|
|
89
|
+
function y(e = globalThis.crypto) {
|
|
51
90
|
let t = e.getRandomValues(new Uint8Array(32));
|
|
52
91
|
return Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
53
92
|
}
|
|
54
|
-
function
|
|
93
|
+
function b(e) {
|
|
55
94
|
return e.trim().length < 32 ? "Use a signing secret of at least 32 characters." : null;
|
|
56
95
|
}
|
|
57
|
-
function
|
|
96
|
+
function x(e) {
|
|
58
97
|
let t = e.trim();
|
|
59
98
|
return t ? t.length > 120 ? "Keep the name under 120 characters." : null : "Give the integration a name.";
|
|
60
99
|
}
|
|
61
|
-
function
|
|
100
|
+
function S(t, n, r, i) {
|
|
62
101
|
return `${new URL(e(t), i).origin}/api/integrations/webhook/${n}/${r}`;
|
|
63
102
|
}
|
|
64
|
-
function
|
|
103
|
+
function C(e = /* @__PURE__ */ new Date()) {
|
|
65
104
|
return JSON.stringify({
|
|
66
105
|
externalEventId: "evt_0001",
|
|
67
106
|
trackingNumber: "YOUR-TRACKING-NUMBER",
|
|
@@ -75,31 +114,31 @@ function g(e = /* @__PURE__ */ new Date()) {
|
|
|
75
114
|
details: "Departed origin hub"
|
|
76
115
|
}, null, 2);
|
|
77
116
|
}
|
|
78
|
-
function
|
|
117
|
+
function w(e) {
|
|
79
118
|
return `'${e.split("'").join("'\\''")}'`;
|
|
80
119
|
}
|
|
81
|
-
function
|
|
120
|
+
function T(e) {
|
|
82
121
|
return [
|
|
83
122
|
"BODY='{\"externalEventId\":\"evt_0001\",\"trackingNumber\":\"YOUR-TRACKING-NUMBER\",\"eventType\":\"IN_TRANSIT\"}'",
|
|
84
123
|
"SIG=$(printf '%s' \"$BODY\" | openssl dgst -sha256 -hmac \"$MTW_WEBHOOK_SECRET\" -hex | sed 's/^.* //')",
|
|
85
|
-
`curl -X POST ${
|
|
124
|
+
`curl -X POST ${w(e)} \\`,
|
|
86
125
|
" -H 'Content-Type: application/json' \\",
|
|
87
|
-
` -H "${
|
|
126
|
+
` -H "${d}: sha256=$SIG" \\`,
|
|
88
127
|
" --data \"$BODY\""
|
|
89
128
|
].join("\n");
|
|
90
129
|
}
|
|
91
|
-
function
|
|
130
|
+
function E(e) {
|
|
92
131
|
let t = e.toLowerCase().split("_").join(" ");
|
|
93
132
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
94
133
|
}
|
|
95
|
-
function
|
|
134
|
+
function D(e) {
|
|
96
135
|
return e === "ACTIVE" ? "default" : e === "PAUSED" ? "secondary" : "outline";
|
|
97
136
|
}
|
|
98
|
-
function
|
|
137
|
+
function O(e) {
|
|
99
138
|
return e === "ACCEPTED" ? "default" : e === "DUPLICATE" || e === "PARTIAL" || e === "RECEIVED" ? "secondary" : "destructive";
|
|
100
139
|
}
|
|
101
|
-
function
|
|
140
|
+
function k(e) {
|
|
102
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.";
|
|
103
142
|
}
|
|
104
143
|
//#endregion
|
|
105
|
-
export {
|
|
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 };
|
package/package.json
CHANGED