@burdenoff/microfe-movethewheels 2026.1107.3 → 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/generated/tracking-quality-operations.d.ts +1 -1
- package/dist/generated/wspace-types.d.ts +448 -8
- package/dist/movethewheels/hooks/useCarrierIntegrations.d.ts +2 -0
- package/dist/movethewheels/utils/carrierIntegrations.d.ts +38 -4
- package/dist/pages/IntegrationsPage.js +324 -129
- package/dist/utils/carrierIntegrations.js +62 -23
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +1 -0
- package/src/generated/wspace-types.ts +518 -8
- package/src/movethewheels/hooks/useCarrierIntegrations.ts +2 -0
- package/src/movethewheels/pages/IntegrationsPage.tsx +266 -44
- package/src/movethewheels/utils/carrierIntegrations.ts +76 -8
|
@@ -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