@burdenoff/microfe-movethewheels 2026.1108.3 → 2026.1108.5
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 +328 -1
- package/dist/generated/wspace-types.d.ts +8 -2
- package/dist/hooks/useCarrierIntegrations.js +30 -29
- package/dist/movethewheels/hooks/useCarrierIntegrations.d.ts +9 -3
- package/dist/movethewheels/utils/carrierIntegrations.d.ts +98 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-download.js +18 -0
- package/dist/pages/IntegrationsPage.js +608 -338
- package/dist/utils/carrierIntegrations.js +134 -30
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +374 -0
- package/src/generated/wspace-types.ts +8 -2
- package/src/movethewheels/hooks/useCarrierIntegrations.ts +19 -2
- package/src/movethewheels/pages/IntegrationsPage.tsx +347 -49
- package/src/movethewheels/utils/carrierIntegrations.ts +271 -12
|
@@ -2,282 +2,424 @@ import { Activity as e } from "../node_modules/lucide-react/dist/esm/icons/activ
|
|
|
2
2
|
import { Check as t } from "../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
3
3
|
import { ChevronDown as n } from "../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
4
4
|
import { ChevronUp as r } from "../node_modules/lucide-react/dist/esm/icons/chevron-up.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 {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
5
|
+
import { CloudDownload as i } from "../node_modules/lucide-react/dist/esm/icons/cloud-download.js";
|
|
6
|
+
import { Copy as a } from "../node_modules/lucide-react/dist/esm/icons/copy.js";
|
|
7
|
+
import { KeyRound as o } from "../node_modules/lucide-react/dist/esm/icons/key-round.js";
|
|
8
|
+
import { Pause as s } from "../node_modules/lucide-react/dist/esm/icons/pause.js";
|
|
9
|
+
import { Play as c } from "../node_modules/lucide-react/dist/esm/icons/play.js";
|
|
10
|
+
import { Plug as l } from "../node_modules/lucide-react/dist/esm/icons/plug.js";
|
|
11
|
+
import { Plus as u } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
12
|
+
import { RefreshCw as d } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
13
|
+
import { ShieldCheck as f } from "../node_modules/lucide-react/dist/esm/icons/shield-check.js";
|
|
14
|
+
import { Trash2 as p } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
15
|
+
import { useMoveTheWheels as m } from "../providers/MoveTheWheelsProvider.js";
|
|
16
|
+
import { formatDateTime as h } from "../utils/formatters.js";
|
|
17
|
+
import { Badge as g, Button as _, Card as v, CardContent as y, Checkbox as b, Input as x, Label as S, Select as C, SelectContent as ee, SelectItem as w, SelectTrigger as te, SelectValue as ne, Skeleton as T, Textarea as re } from "../components/ui.js";
|
|
18
|
+
import { PageLayout as ie } from "../components/PageLayout.js";
|
|
19
|
+
import { MetricCard as E, MetricGrid as ae } from "../components/MetricCard.js";
|
|
20
|
+
import { FormError as D } from "../components/FormError.js";
|
|
21
|
+
import { Notice as oe, useNotice as se } from "../components/Notice.js";
|
|
22
|
+
import { DEFAULT_GEOTAB_SERVER as O, DEFAULT_SAMSARA_SHIPMENT_KEY as k, GEOTAB_RULE_EVENT_TYPES as A, INTEGRATION_STATUSES as ce, MOTIVE_ACTIONS as j, MOTIVE_SIGNATURE_HEADER as le, ROADMAP_PROVIDERS as M, SAMSARA_EVENT_TYPES as ue, SAMSARA_SIGNATURE_HEADERS as N, SIGNATURE_HEADER as P, TRACKING_EVENT_TYPES as F, buildGeotabConfig as I, curlExample as L, eventStatusTone as R, examplePayload as z, externalIdKeyError as B, generateSigningSecret as V, geotabPasswordError as H, humanize as U, integrationNameError as W, integrationStatusTone as de, isPolledProvider as fe, pollResultMessage as pe, pollStatusSummary as me, pollStatusTone as he, providerLabel as ge, samsaraSecretError as _e, signingSecretError as G, statusExplanation as ve, webhookUrl as ye } from "../utils/carrierIntegrations.js";
|
|
23
|
+
import { useCarrierIntegrationActions as be, useCarrierIntegrationCounts as xe, useCarrierIntegrationEvents as Se, useCarrierIntegrations as Ce } from "../hooks/useCarrierIntegrations.js";
|
|
24
|
+
import { useEffect as we, useRef as Te, useState as K } from "react";
|
|
25
|
+
import { Fragment as Ee, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
26
|
+
import { CTAOverflowMenu as De, PagePurpose as Oe, ResponsiveDialog as Y, ResponsiveDialogContent as X, ResponsiveDialogDescription as ke, ResponsiveDialogFooter as Ae, ResponsiveDialogHeader as je, ResponsiveDialogTitle as Me } from "@burdenoff/fe-libs/ui";
|
|
26
27
|
//#region src/movethewheels/pages/IntegrationsPage.tsx
|
|
27
|
-
var
|
|
28
|
-
function
|
|
28
|
+
var Ne = 20, Z = "ALL";
|
|
29
|
+
function Q(e, t) {
|
|
29
30
|
return e instanceof Error && e.message ? e.message : t;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
let [
|
|
32
|
+
function $({ label: e, value: n, multiline: r }) {
|
|
33
|
+
let [i, o] = K(!1), s = async () => {
|
|
33
34
|
try {
|
|
34
35
|
await navigator.clipboard.writeText(n), o(!0), window.setTimeout(() => o(!1), 2e3);
|
|
35
36
|
} catch {
|
|
36
37
|
o(!1);
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ J("div", {
|
|
40
41
|
className: "space-y-1",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ J("div", {
|
|
42
43
|
className: "flex items-center justify-between gap-2",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ q("span", {
|
|
44
45
|
className: "text-xs font-medium text-text-secondary",
|
|
45
46
|
children: e
|
|
46
|
-
}), /* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ J(_, {
|
|
47
48
|
type: "button",
|
|
48
49
|
size: "sm",
|
|
49
50
|
variant: "ghost",
|
|
50
51
|
onClick: () => void s(),
|
|
51
52
|
"aria-label": `Copy ${e.toLowerCase()}`,
|
|
52
|
-
children: [
|
|
53
|
+
children: [q(i ? t : a, {
|
|
53
54
|
size: 14,
|
|
54
55
|
className: "mr-1"
|
|
55
|
-
}),
|
|
56
|
+
}), i ? "Copied" : "Copy"]
|
|
56
57
|
})]
|
|
57
|
-
}), r ? /* @__PURE__ */
|
|
58
|
+
}), r ? /* @__PURE__ */ q("pre", {
|
|
58
59
|
className: "max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-lg bg-bg-sunken px-3 py-2 font-mono text-xs text-text-primary",
|
|
59
60
|
children: n
|
|
60
|
-
}) : /* @__PURE__ */
|
|
61
|
+
}) : /* @__PURE__ */ q("code", {
|
|
61
62
|
className: "block break-all rounded-lg bg-bg-sunken px-3 py-2 font-mono text-xs text-text-primary",
|
|
62
63
|
children: n
|
|
63
64
|
})]
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
function Pe({ secret: e, integrationName: t, onClose: n }) {
|
|
68
|
+
return /* @__PURE__ */ q(Y, {
|
|
68
69
|
open: e !== null,
|
|
69
70
|
onOpenChange: (e) => !e && n(),
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
e ? /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ J(X, { children: [
|
|
72
|
+
/* @__PURE__ */ J(je, { children: [/* @__PURE__ */ J(Me, { children: ["Signing secret for ", t] }), /* @__PURE__ */ q(ke, { children: "Copy it into the sending system now. MoveTheWheels stores it to verify deliveries but will not show it again; rotate it if it is lost." })] }),
|
|
73
|
+
e ? /* @__PURE__ */ q($, {
|
|
73
74
|
label: "Signing secret",
|
|
74
75
|
value: e
|
|
75
76
|
}, e) : null,
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ q(Ae, { children: /* @__PURE__ */ q(_, {
|
|
77
78
|
onClick: n,
|
|
78
79
|
children: "I have saved it"
|
|
79
80
|
}) })
|
|
80
81
|
] })
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
let r =
|
|
85
|
-
a("GENERIC_WEBHOOK"), s(""), l(
|
|
86
|
-
},
|
|
84
|
+
function Fe({ open: e, onOpenChange: t, onCreated: n }) {
|
|
85
|
+
let r = be(), [i, a] = K("GENERIC_WEBHOOK"), [o, s] = K(""), [c, l] = K(() => V()), [u, f] = K(""), [p, m] = K(""), [h, g] = K(""), [v, y] = K(""), [T, ie] = K(""), [E, ae] = K(""), [oe, se] = K(""), [ce, j] = K(!0), [le, M] = K(null), [ue, N] = K(!1), P = i === "SAMSARA", F = i === "GEOTAB", L = i === "MOTIVE", R = () => {
|
|
86
|
+
a("GENERIC_WEBHOOK"), s(""), l(V()), f(""), m(""), g(""), y(""), ie(""), ae(""), se(""), j(!0), M(null);
|
|
87
|
+
}, z = () => {
|
|
88
|
+
let e = I({
|
|
89
|
+
server: h,
|
|
90
|
+
database: v,
|
|
91
|
+
userName: T,
|
|
92
|
+
ruleMappings: oe,
|
|
93
|
+
locationUpdates: ce
|
|
94
|
+
});
|
|
95
|
+
if (!e.ok) return {
|
|
96
|
+
error: e.error,
|
|
97
|
+
input: null
|
|
98
|
+
};
|
|
99
|
+
let t = H(E);
|
|
100
|
+
return t ? {
|
|
101
|
+
error: t,
|
|
102
|
+
input: null
|
|
103
|
+
} : {
|
|
104
|
+
error: null,
|
|
105
|
+
input: {
|
|
106
|
+
provider: "GEOTAB",
|
|
107
|
+
name: o,
|
|
108
|
+
apiSecret: E,
|
|
109
|
+
config: e.config
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}, U = async (e) => {
|
|
87
113
|
e.preventDefault();
|
|
88
|
-
let i =
|
|
89
|
-
if (
|
|
90
|
-
|
|
114
|
+
let i = F ? z() : null, a = W(o) ?? (F ? i?.error ?? null : P ? _e(u) ?? B(p) : G(c));
|
|
115
|
+
if (a) {
|
|
116
|
+
M(a);
|
|
91
117
|
return;
|
|
92
118
|
}
|
|
93
|
-
|
|
119
|
+
N(!0), M(null);
|
|
94
120
|
try {
|
|
95
121
|
let e = p.trim();
|
|
96
|
-
n(await r.create(
|
|
122
|
+
n(await r.create(i?.input ? i.input : P ? {
|
|
97
123
|
provider: "SAMSARA",
|
|
98
124
|
name: o,
|
|
99
|
-
apiSecret:
|
|
125
|
+
apiSecret: u.trim(),
|
|
100
126
|
...e ? { config: { shipmentExternalIdKey: e } } : {}
|
|
101
127
|
} : {
|
|
102
|
-
provider: "GENERIC_WEBHOOK",
|
|
128
|
+
provider: L ? "MOTIVE" : "GENERIC_WEBHOOK",
|
|
103
129
|
name: o,
|
|
104
130
|
apiSecret: c
|
|
105
|
-
}),
|
|
131
|
+
}), P || F ? null : c), R(), t(!1);
|
|
106
132
|
} catch (e) {
|
|
107
|
-
|
|
133
|
+
M(Q(e, "Could not create the integration."));
|
|
108
134
|
} finally {
|
|
109
|
-
|
|
135
|
+
N(!1);
|
|
110
136
|
}
|
|
111
137
|
};
|
|
112
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ q(Y, {
|
|
113
139
|
open: e,
|
|
114
140
|
onOpenChange: (e) => {
|
|
115
|
-
e ||
|
|
141
|
+
e || R(), t(e);
|
|
116
142
|
},
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
-
onSubmit: (e) => void
|
|
143
|
+
children: /* @__PURE__ */ q(X, { children: /* @__PURE__ */ J("form", {
|
|
144
|
+
onSubmit: (e) => void U(e),
|
|
119
145
|
className: "space-y-4",
|
|
120
146
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ J(je, { children: [/* @__PURE__ */ q(Me, { children: "Connect a tracking feed" }), /* @__PURE__ */ q(ke, { children: F ? "MoveTheWheels signs in to MyGeotab and reads new GPS positions and exception events every 5 minutes. They become tracking events on the matching shipments." : "A signed webhook from a carrier, ELD or GPS provider. Updates it sends become tracking events on the matching shipments." })] }),
|
|
148
|
+
/* @__PURE__ */ J("div", {
|
|
123
149
|
className: "space-y-1.5",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ q(S, {
|
|
125
151
|
htmlFor: "integration-name",
|
|
126
152
|
children: "Name"
|
|
127
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ q(x, {
|
|
128
154
|
id: "integration-name",
|
|
129
155
|
value: o,
|
|
130
156
|
maxLength: 120,
|
|
131
|
-
placeholder:
|
|
157
|
+
placeholder: P ? "e.g. Samsara fleet" : F ? "e.g. Geotab fleet" : L ? "e.g. Motive fleet" : "e.g. Fleet GPS feed",
|
|
132
158
|
onChange: (e) => s(e.target.value),
|
|
133
159
|
autoFocus: !0
|
|
134
160
|
})]
|
|
135
161
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ J("div", {
|
|
137
163
|
className: "space-y-1.5",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ q(S, {
|
|
139
165
|
htmlFor: "integration-type",
|
|
140
166
|
children: "Type"
|
|
141
|
-
}), /* @__PURE__ */
|
|
167
|
+
}), /* @__PURE__ */ J(C, {
|
|
142
168
|
value: i,
|
|
143
169
|
onValueChange: (e) => {
|
|
144
|
-
a(e),
|
|
170
|
+
a(e), M(null);
|
|
145
171
|
},
|
|
146
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ q(te, {
|
|
147
173
|
id: "integration-type",
|
|
148
174
|
"aria-label": "Type",
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
-
}), /* @__PURE__ */
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
175
|
+
children: /* @__PURE__ */ q(ne, {})
|
|
176
|
+
}), /* @__PURE__ */ J(ee, { children: [
|
|
177
|
+
/* @__PURE__ */ q(w, {
|
|
178
|
+
value: "GENERIC_WEBHOOK",
|
|
179
|
+
children: "Signed webhook (any system that can send HTTPS POSTs)"
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ q(w, {
|
|
182
|
+
value: "SAMSARA",
|
|
183
|
+
children: "Samsara (ELD and telematics)"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ q(w, {
|
|
186
|
+
value: "MOTIVE",
|
|
187
|
+
children: "Motive, formerly KeepTruckin (ELD and telematics)"
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ q(w, {
|
|
190
|
+
value: "GEOTAB",
|
|
191
|
+
children: "Geotab / MyGeotab (telematics, polled)"
|
|
192
|
+
})
|
|
193
|
+
] })]
|
|
157
194
|
})]
|
|
158
195
|
}),
|
|
159
|
-
|
|
196
|
+
F ? /* @__PURE__ */ J(Ee, { children: [
|
|
197
|
+
/* @__PURE__ */ J("div", {
|
|
198
|
+
className: "grid gap-4 sm:grid-cols-2",
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ J("div", {
|
|
201
|
+
className: "space-y-1.5",
|
|
202
|
+
children: [/* @__PURE__ */ q(S, {
|
|
203
|
+
htmlFor: "geotab-database",
|
|
204
|
+
children: "MyGeotab database"
|
|
205
|
+
}), /* @__PURE__ */ q(x, {
|
|
206
|
+
id: "geotab-database",
|
|
207
|
+
value: v,
|
|
208
|
+
maxLength: 255,
|
|
209
|
+
autoComplete: "off",
|
|
210
|
+
spellCheck: !1,
|
|
211
|
+
placeholder: "e.g. acme_logistics",
|
|
212
|
+
onChange: (e) => y(e.target.value)
|
|
213
|
+
})]
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ J("div", {
|
|
216
|
+
className: "space-y-1.5",
|
|
217
|
+
children: [/* @__PURE__ */ q(S, {
|
|
218
|
+
htmlFor: "geotab-server",
|
|
219
|
+
children: "Server (optional)"
|
|
220
|
+
}), /* @__PURE__ */ q(x, {
|
|
221
|
+
id: "geotab-server",
|
|
222
|
+
value: h,
|
|
223
|
+
maxLength: 255,
|
|
224
|
+
autoComplete: "off",
|
|
225
|
+
spellCheck: !1,
|
|
226
|
+
placeholder: O,
|
|
227
|
+
onChange: (e) => g(e.target.value)
|
|
228
|
+
})]
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ J("div", {
|
|
231
|
+
className: "space-y-1.5",
|
|
232
|
+
children: [/* @__PURE__ */ q(S, {
|
|
233
|
+
htmlFor: "geotab-user",
|
|
234
|
+
children: "User name"
|
|
235
|
+
}), /* @__PURE__ */ q(x, {
|
|
236
|
+
id: "geotab-user",
|
|
237
|
+
value: T,
|
|
238
|
+
maxLength: 255,
|
|
239
|
+
autoComplete: "off",
|
|
240
|
+
spellCheck: !1,
|
|
241
|
+
placeholder: "e.g. mtw-api@acme.com",
|
|
242
|
+
onChange: (e) => ie(e.target.value)
|
|
243
|
+
})]
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ J("div", {
|
|
246
|
+
className: "space-y-1.5",
|
|
247
|
+
children: [/* @__PURE__ */ q(S, {
|
|
248
|
+
htmlFor: "geotab-password",
|
|
249
|
+
children: "Password"
|
|
250
|
+
}), /* @__PURE__ */ q(x, {
|
|
251
|
+
id: "geotab-password",
|
|
252
|
+
type: "password",
|
|
253
|
+
autoComplete: "new-password",
|
|
254
|
+
spellCheck: !1,
|
|
255
|
+
value: E,
|
|
256
|
+
onChange: (e) => ae(e.target.value)
|
|
257
|
+
})]
|
|
258
|
+
})
|
|
259
|
+
]
|
|
260
|
+
}),
|
|
261
|
+
/* @__PURE__ */ q("p", {
|
|
262
|
+
className: "text-xs text-text-secondary",
|
|
263
|
+
children: "Use a dedicated MyGeotab user with read access to devices, GPS logs and exceptions. MoveTheWheels stores the password encrypted and never shows it again."
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ J("div", {
|
|
266
|
+
className: "flex items-center gap-3",
|
|
267
|
+
children: [/* @__PURE__ */ q(b, {
|
|
268
|
+
id: "geotab-locations",
|
|
269
|
+
checked: ce,
|
|
270
|
+
onCheckedChange: (e) => j(e === !0)
|
|
271
|
+
}), /* @__PURE__ */ q(S, {
|
|
272
|
+
htmlFor: "geotab-locations",
|
|
273
|
+
children: "Add each vehicle's latest GPS position as an In transit event"
|
|
274
|
+
})]
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ J("div", {
|
|
277
|
+
className: "space-y-1.5",
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ q(S, {
|
|
280
|
+
htmlFor: "geotab-rules",
|
|
281
|
+
children: "Exception rules to track (optional)"
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ q(re, {
|
|
284
|
+
id: "geotab-rules",
|
|
285
|
+
value: oe,
|
|
286
|
+
rows: 3,
|
|
287
|
+
spellCheck: !1,
|
|
288
|
+
placeholder: "RuleArriveCustomerId = ARRIVED\nRuleLeaveDepotId = DEPARTED",
|
|
289
|
+
onChange: (e) => se(e.target.value)
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ J("p", {
|
|
292
|
+
className: "text-xs text-text-secondary",
|
|
293
|
+
children: [
|
|
294
|
+
"One per line: a MyGeotab rule id (for example a zone arrival rule) and the event it becomes: ",
|
|
295
|
+
A.join(", "),
|
|
296
|
+
". Other rules are ignored."
|
|
297
|
+
]
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
})
|
|
301
|
+
] }) : P ? /* @__PURE__ */ J(Ee, { children: [/* @__PURE__ */ J("div", {
|
|
160
302
|
className: "space-y-1.5",
|
|
161
303
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ q(S, {
|
|
163
305
|
htmlFor: "samsara-secret",
|
|
164
306
|
children: "Samsara webhook secret key"
|
|
165
307
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ q(x, {
|
|
167
309
|
id: "samsara-secret",
|
|
168
310
|
type: "password",
|
|
169
311
|
autoComplete: "off",
|
|
170
312
|
spellCheck: !1,
|
|
171
|
-
value:
|
|
313
|
+
value: u,
|
|
172
314
|
placeholder: "Paste from Samsara → Settings → Webhooks",
|
|
173
315
|
onChange: (e) => f(e.target.value)
|
|
174
316
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ q("p", {
|
|
176
318
|
className: "text-xs text-text-secondary",
|
|
177
319
|
children: "Create the webhook in Samsara first; its page shows this key. MoveTheWheels stores it encrypted and never shows it again."
|
|
178
320
|
})
|
|
179
321
|
]
|
|
180
|
-
}), /* @__PURE__ */
|
|
322
|
+
}), /* @__PURE__ */ J("div", {
|
|
181
323
|
className: "space-y-1.5",
|
|
182
324
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ q(S, {
|
|
184
326
|
htmlFor: "samsara-shipment-key",
|
|
185
327
|
children: "Shipment external ID key (optional)"
|
|
186
328
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ q(x, {
|
|
188
330
|
id: "samsara-shipment-key",
|
|
189
331
|
value: p,
|
|
190
332
|
maxLength: 64,
|
|
191
|
-
placeholder:
|
|
333
|
+
placeholder: k,
|
|
192
334
|
onChange: (e) => m(e.target.value)
|
|
193
335
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ J("p", {
|
|
195
337
|
className: "text-xs text-text-secondary",
|
|
196
338
|
children: [
|
|
197
339
|
"The external ID on a Samsara route or stop that holds the MoveTheWheels tracking number. Leave blank to use",
|
|
198
340
|
" ",
|
|
199
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ q("code", {
|
|
200
342
|
className: "font-mono",
|
|
201
|
-
children:
|
|
343
|
+
children: k
|
|
202
344
|
}),
|
|
203
345
|
"."
|
|
204
346
|
]
|
|
205
347
|
})
|
|
206
348
|
]
|
|
207
|
-
})] }) : /* @__PURE__ */
|
|
349
|
+
})] }) : /* @__PURE__ */ J("div", {
|
|
208
350
|
className: "space-y-1.5",
|
|
209
351
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ J("div", {
|
|
211
353
|
className: "flex items-center justify-between",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ q(S, { children: "Signing secret" }), /* @__PURE__ */ J(_, {
|
|
213
355
|
type: "button",
|
|
214
356
|
size: "sm",
|
|
215
357
|
variant: "ghost",
|
|
216
|
-
onClick: () => l(
|
|
217
|
-
children: [/* @__PURE__ */
|
|
358
|
+
onClick: () => l(V()),
|
|
359
|
+
children: [/* @__PURE__ */ q(d, {
|
|
218
360
|
size: 14,
|
|
219
361
|
className: "mr-1"
|
|
220
362
|
}), "Generate another"]
|
|
221
363
|
})]
|
|
222
364
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ q("code", {
|
|
224
366
|
className: "block break-all rounded-lg bg-bg-sunken px-3 py-2 font-mono text-xs",
|
|
225
367
|
children: c
|
|
226
368
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ q("p", {
|
|
228
370
|
className: "text-xs text-text-secondary",
|
|
229
|
-
children: "Generated in your browser. You can copy it on the next step."
|
|
371
|
+
children: L ? "Generated in your browser. You can copy it on the next step and enter it as the secret on the Motive webhook." : "Generated in your browser. You can copy it on the next step."
|
|
230
372
|
})
|
|
231
373
|
]
|
|
232
374
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ q(D, { message: le }),
|
|
376
|
+
/* @__PURE__ */ J(Ae, { children: [/* @__PURE__ */ q(_, {
|
|
235
377
|
type: "button",
|
|
236
378
|
variant: "outline",
|
|
237
379
|
onClick: () => t(!1),
|
|
238
380
|
children: "Cancel"
|
|
239
|
-
}), /* @__PURE__ */
|
|
381
|
+
}), /* @__PURE__ */ q(_, {
|
|
240
382
|
type: "submit",
|
|
241
|
-
disabled:
|
|
242
|
-
children:
|
|
383
|
+
disabled: ue,
|
|
384
|
+
children: ue ? "Connecting…" : "Connect"
|
|
243
385
|
})] })
|
|
244
386
|
]
|
|
245
387
|
}) })
|
|
246
388
|
});
|
|
247
389
|
}
|
|
248
|
-
function
|
|
249
|
-
let [r, i] =
|
|
390
|
+
function Ie({ integration: e, onClose: t, onReplace: n }) {
|
|
391
|
+
let [r, i] = K(""), [a, o] = K(null), [s, c] = K(!1), l = e?.provider === "GEOTAB", u = () => {
|
|
250
392
|
i(""), o(null), t();
|
|
251
|
-
},
|
|
393
|
+
}, d = async (t) => {
|
|
252
394
|
if (t.preventDefault(), !e) return;
|
|
253
|
-
let i =
|
|
395
|
+
let i = l ? H(r) : _e(r);
|
|
254
396
|
if (i) {
|
|
255
397
|
o(i);
|
|
256
398
|
return;
|
|
257
399
|
}
|
|
258
400
|
c(!0), o(null);
|
|
259
401
|
try {
|
|
260
|
-
await n(e, r.trim()),
|
|
402
|
+
await n(e, l ? r : r.trim()), u();
|
|
261
403
|
} catch (e) {
|
|
262
|
-
o(
|
|
404
|
+
o(Q(e, "Could not replace the secret."));
|
|
263
405
|
} finally {
|
|
264
406
|
c(!1);
|
|
265
407
|
}
|
|
266
408
|
};
|
|
267
|
-
return /* @__PURE__ */
|
|
409
|
+
return /* @__PURE__ */ q(Y, {
|
|
268
410
|
open: e !== null,
|
|
269
|
-
onOpenChange: (e) => !e &&
|
|
270
|
-
children: /* @__PURE__ */
|
|
271
|
-
onSubmit: (e) => void
|
|
411
|
+
onOpenChange: (e) => !e && u(),
|
|
412
|
+
children: /* @__PURE__ */ q(X, { children: /* @__PURE__ */ J("form", {
|
|
413
|
+
onSubmit: (e) => void d(e),
|
|
272
414
|
className: "space-y-4",
|
|
273
415
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ J(je, { children: [/* @__PURE__ */ q(Me, { children: l ? `Update the MyGeotab password for ${e?.name ?? ""}` : `Replace the Samsara secret for ${e?.name ?? ""}` }), /* @__PURE__ */ q(ke, { children: l ? "Enter the current password of the MyGeotab user this feed signs in as. The next poll signs in with it." : "Regenerate the secret on the webhook page in Samsara, then paste the new key here. Deliveries signed with the old key are refused once you save." })] }),
|
|
417
|
+
/* @__PURE__ */ J("div", {
|
|
276
418
|
className: "space-y-1.5",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ q(S, {
|
|
278
420
|
htmlFor: "samsara-new-secret",
|
|
279
|
-
children: "New Samsara webhook secret key"
|
|
280
|
-
}), /* @__PURE__ */
|
|
421
|
+
children: l ? "New MyGeotab password" : "New Samsara webhook secret key"
|
|
422
|
+
}), /* @__PURE__ */ q(x, {
|
|
281
423
|
id: "samsara-new-secret",
|
|
282
424
|
type: "password",
|
|
283
425
|
autoComplete: "off",
|
|
@@ -287,58 +429,58 @@ function Oe({ integration: e, onClose: t, onReplace: n }) {
|
|
|
287
429
|
autoFocus: !0
|
|
288
430
|
})]
|
|
289
431
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ q(D, { message: a }),
|
|
433
|
+
/* @__PURE__ */ J(Ae, { children: [/* @__PURE__ */ q(_, {
|
|
292
434
|
type: "button",
|
|
293
435
|
variant: "outline",
|
|
294
|
-
onClick:
|
|
436
|
+
onClick: u,
|
|
295
437
|
children: "Cancel"
|
|
296
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ q(_, {
|
|
297
439
|
type: "submit",
|
|
298
440
|
disabled: s,
|
|
299
|
-
children: s ? "Saving…" : "Replace secret"
|
|
441
|
+
children: s ? "Saving…" : l ? "Update password" : "Replace secret"
|
|
300
442
|
})] })
|
|
301
443
|
]
|
|
302
444
|
}) })
|
|
303
445
|
});
|
|
304
446
|
}
|
|
305
|
-
function
|
|
306
|
-
return /* @__PURE__ */
|
|
447
|
+
function Le({ url: e }) {
|
|
448
|
+
return /* @__PURE__ */ J("div", {
|
|
307
449
|
className: "space-y-3",
|
|
308
450
|
children: [
|
|
309
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ q("p", {
|
|
310
452
|
className: "text-sm font-medium",
|
|
311
453
|
children: "How to connect Samsara"
|
|
312
454
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ q($, {
|
|
314
456
|
label: "Webhook URL",
|
|
315
457
|
value: e
|
|
316
458
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ J("ol", {
|
|
318
460
|
className: "list-decimal space-y-1 pl-5 text-xs text-text-secondary",
|
|
319
461
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ J("li", { children: [
|
|
321
463
|
"In Samsara, open Settings → Developer → Webhooks, add a webhook with the URL above and subscribe it to",
|
|
322
464
|
" ",
|
|
323
|
-
ue.map((e, t) => /* @__PURE__ */
|
|
465
|
+
ue.map((e, t) => /* @__PURE__ */ J("span", { children: [t > 0 ? ", " : "", /* @__PURE__ */ q("code", {
|
|
324
466
|
className: "font-mono",
|
|
325
467
|
children: e.type
|
|
326
468
|
})] }, e.type)),
|
|
327
469
|
"."
|
|
328
470
|
] }),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ q("li", { children: "Route stop and geofence arrivals become Arrived events; departures become Departed events." }),
|
|
472
|
+
/* @__PURE__ */ J("li", { children: [
|
|
331
473
|
"To match a shipment, put its MoveTheWheels tracking number in the route or stop external ID under the key chosen when this feed was connected (default",
|
|
332
474
|
" ",
|
|
333
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ q("code", {
|
|
334
476
|
className: "font-mono",
|
|
335
|
-
children:
|
|
477
|
+
children: k
|
|
336
478
|
}),
|
|
337
479
|
"). Without one, the Samsara vehicle name or licence plate is matched to a MoveTheWheels vehicle, and the event goes to that vehicle's single in-progress route."
|
|
338
480
|
] }),
|
|
339
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ J("li", { children: [
|
|
340
482
|
"Samsara signs every delivery (",
|
|
341
|
-
|
|
483
|
+
N.join(" and "),
|
|
342
484
|
"); deliveries with a wrong signature or more than five minutes old are refused."
|
|
343
485
|
] })
|
|
344
486
|
]
|
|
@@ -346,105 +488,203 @@ function X({ url: e }) {
|
|
|
346
488
|
]
|
|
347
489
|
});
|
|
348
490
|
}
|
|
349
|
-
function
|
|
350
|
-
|
|
351
|
-
|
|
491
|
+
function Re({ url: e }) {
|
|
492
|
+
return /* @__PURE__ */ J("div", {
|
|
493
|
+
className: "space-y-3",
|
|
494
|
+
children: [
|
|
495
|
+
/* @__PURE__ */ q("p", {
|
|
496
|
+
className: "text-sm font-medium",
|
|
497
|
+
children: "How to connect Motive"
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ q($, {
|
|
500
|
+
label: "Webhook URL",
|
|
501
|
+
value: e
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ J("ol", {
|
|
504
|
+
className: "list-decimal space-y-1 pl-5 text-xs text-text-secondary",
|
|
505
|
+
children: [
|
|
506
|
+
/* @__PURE__ */ q("li", { children: "In the Motive dashboard, open Admin → Developer → Webhooks and add a webhook with the URL above, the JSON format and the signing secret shown when this feed was connected (rotate the secret here to get a new one)." }),
|
|
507
|
+
/* @__PURE__ */ J("li", { children: [
|
|
508
|
+
"Subscribe it to",
|
|
509
|
+
" ",
|
|
510
|
+
j.map((e, t) => /* @__PURE__ */ J("span", { children: [
|
|
511
|
+
t > 0 ? " and " : "",
|
|
512
|
+
/* @__PURE__ */ q("code", {
|
|
513
|
+
className: "font-mono",
|
|
514
|
+
children: e.action
|
|
515
|
+
}),
|
|
516
|
+
" (",
|
|
517
|
+
e.becomes.toLowerCase(),
|
|
518
|
+
")"
|
|
519
|
+
] }, e.action)),
|
|
520
|
+
", then enable it. Motive sends an activation test that this feed answers automatically."
|
|
521
|
+
] }),
|
|
522
|
+
/* @__PURE__ */ q("li", { children: "Motive deliveries carry no shipment reference, so the Motive vehicle number (or VIN) is matched to a MoveTheWheels vehicle by its vehicle number or licence plate, and the event goes to that vehicle's single in-progress route. Ambiguous matches are refused, never guessed." }),
|
|
523
|
+
/* @__PURE__ */ J("li", { children: [
|
|
524
|
+
"Motive signs every delivery with an HMAC-SHA1 of the body in",
|
|
525
|
+
" ",
|
|
526
|
+
/* @__PURE__ */ q("code", {
|
|
527
|
+
className: "font-mono",
|
|
528
|
+
children: le
|
|
529
|
+
}),
|
|
530
|
+
"; deliveries with a wrong signature are refused, and a repeated Motive event is recorded once."
|
|
531
|
+
] })
|
|
532
|
+
]
|
|
533
|
+
})
|
|
534
|
+
]
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
function ze({ integration: e }) {
|
|
538
|
+
return /* @__PURE__ */ J("div", {
|
|
539
|
+
className: "space-y-3",
|
|
540
|
+
children: [
|
|
541
|
+
/* @__PURE__ */ q("p", {
|
|
542
|
+
className: "text-sm font-medium",
|
|
543
|
+
children: "How the Geotab feed works"
|
|
544
|
+
}),
|
|
545
|
+
/* @__PURE__ */ J("ol", {
|
|
546
|
+
className: "list-decimal space-y-1 pl-5 text-xs text-text-secondary",
|
|
547
|
+
children: [
|
|
548
|
+
/* @__PURE__ */ J("li", { children: [
|
|
549
|
+
"Every ",
|
|
550
|
+
5,
|
|
551
|
+
" minutes MoveTheWheels signs in to MyGeotab and reads the GPS log and exception events added since the last poll. Nothing is set up in Geotab."
|
|
552
|
+
] }),
|
|
553
|
+
/* @__PURE__ */ q("li", { children: "Each Geotab vehicle is matched to a MoveTheWheels vehicle by its name, licence plate or VIN; the event goes to that vehicle's single in-progress route. Records for vehicles that are not on a route are skipped." }),
|
|
554
|
+
/* @__PURE__ */ q("li", { children: "The newest GPS position of each vehicle becomes an In transit event with its location, when position updates are on. Mapped exception rules (typically zone arrivals and departures) become the events they are mapped to." }),
|
|
555
|
+
/* @__PURE__ */ q("li", { children: "Repeated sign-in failures slow the polling down so the MyGeotab user is not locked out; update the password, then use Poll now." })
|
|
556
|
+
]
|
|
557
|
+
}),
|
|
558
|
+
/* @__PURE__ */ q(Be, { integration: e })
|
|
559
|
+
]
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
function Be({ integration: e }) {
|
|
563
|
+
let t = e.pollStatus;
|
|
564
|
+
return /* @__PURE__ */ J("div", {
|
|
565
|
+
className: "space-y-1 rounded-lg bg-bg-sunken px-3 py-2",
|
|
566
|
+
"data-testid": "poll-status",
|
|
567
|
+
children: [
|
|
568
|
+
/* @__PURE__ */ J("div", {
|
|
569
|
+
className: "flex items-center gap-2",
|
|
570
|
+
children: [/* @__PURE__ */ q("span", {
|
|
571
|
+
className: "text-xs font-medium",
|
|
572
|
+
children: "Latest poll"
|
|
573
|
+
}), t?.lastPollStatus ? /* @__PURE__ */ q(g, {
|
|
574
|
+
variant: he(t.lastPollStatus),
|
|
575
|
+
children: U(t.lastPollStatus)
|
|
576
|
+
}) : null]
|
|
577
|
+
}),
|
|
578
|
+
/* @__PURE__ */ q("p", {
|
|
579
|
+
className: "text-xs text-text-secondary",
|
|
580
|
+
children: me(t, h)
|
|
581
|
+
}),
|
|
582
|
+
t?.lastPollError ? /* @__PURE__ */ q("p", {
|
|
583
|
+
className: "break-words text-xs text-status-error-text",
|
|
584
|
+
children: t.lastPollError
|
|
585
|
+
}) : null
|
|
586
|
+
]
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
function Ve({ integrationId: e, refreshKey: t, polled: n = !1 }) {
|
|
590
|
+
let { events: r, isLoading: i, error: a } = Se(e, t);
|
|
591
|
+
return /* @__PURE__ */ J("div", {
|
|
352
592
|
className: "space-y-2",
|
|
353
593
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ q("p", {
|
|
355
595
|
className: "text-sm font-medium",
|
|
356
|
-
children: "Recent deliveries"
|
|
596
|
+
children: n ? "Recent polls" : "Recent deliveries"
|
|
357
597
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
|
|
598
|
+
/* @__PURE__ */ q(D, { message: a?.message }),
|
|
599
|
+
i && r.length === 0 ? /* @__PURE__ */ q(T, { className: "h-12 w-full" }) : r.length === 0 ? /* @__PURE__ */ q("p", {
|
|
360
600
|
className: "text-sm text-text-secondary",
|
|
361
|
-
children: "No deliveries yet. Send a signed test update with the example below."
|
|
362
|
-
}) : /* @__PURE__ */
|
|
601
|
+
children: n ? "No polls with updates yet. Polls that find nothing to add are not listed." : "No deliveries yet. Send a signed test update with the example below."
|
|
602
|
+
}) : /* @__PURE__ */ q("ul", {
|
|
363
603
|
className: "space-y-2",
|
|
364
|
-
children:
|
|
604
|
+
children: r.map((e) => /* @__PURE__ */ J("li", {
|
|
365
605
|
className: "flex flex-wrap items-start justify-between gap-3 rounded-lg bg-bg-sunken px-3 py-2",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ J("div", {
|
|
367
607
|
className: "min-w-0",
|
|
368
608
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ J("p", {
|
|
370
610
|
className: "text-sm font-medium",
|
|
371
|
-
children: [e.eventType ?
|
|
611
|
+
children: [e.eventType ? U(e.eventType) : n ? "Poll" : "Delivery", e.externalEventId ? /* @__PURE__ */ q("span", {
|
|
372
612
|
className: "ml-2 font-mono text-xs text-text-tertiary",
|
|
373
613
|
children: e.externalEventId
|
|
374
614
|
}) : null]
|
|
375
615
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ q("p", {
|
|
377
617
|
className: "text-xs text-text-secondary",
|
|
378
|
-
children:
|
|
618
|
+
children: h(e.receivedAt)
|
|
379
619
|
}),
|
|
380
|
-
e.errorMessage ? /* @__PURE__ */
|
|
620
|
+
e.errorMessage ? /* @__PURE__ */ q("p", {
|
|
381
621
|
className: "mt-1 break-words text-xs text-status-error-text",
|
|
382
622
|
children: e.errorMessage
|
|
383
623
|
}) : null
|
|
384
624
|
]
|
|
385
|
-
}), /* @__PURE__ */
|
|
386
|
-
variant:
|
|
387
|
-
children:
|
|
625
|
+
}), /* @__PURE__ */ q(g, {
|
|
626
|
+
variant: R(e.status),
|
|
627
|
+
children: U(e.status)
|
|
388
628
|
})]
|
|
389
629
|
}, e.id))
|
|
390
630
|
})
|
|
391
631
|
]
|
|
392
632
|
});
|
|
393
633
|
}
|
|
394
|
-
function
|
|
395
|
-
return /* @__PURE__ */
|
|
634
|
+
function He({ url: e }) {
|
|
635
|
+
return /* @__PURE__ */ J("div", {
|
|
396
636
|
className: "space-y-3",
|
|
397
637
|
children: [
|
|
398
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ q("p", {
|
|
399
639
|
className: "text-sm font-medium",
|
|
400
640
|
children: "How to send updates"
|
|
401
641
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ q($, {
|
|
403
643
|
label: "Webhook URL",
|
|
404
644
|
value: e
|
|
405
645
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ J("ul", {
|
|
407
647
|
className: "list-disc space-y-1 pl-5 text-xs text-text-secondary",
|
|
408
648
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ J("li", { children: [
|
|
410
650
|
"POST JSON: one update object, or an array of up to ",
|
|
411
651
|
5,
|
|
412
652
|
"."
|
|
413
653
|
] }),
|
|
414
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ J("li", { children: [
|
|
415
655
|
"Sign the exact raw body with HMAC-SHA256 using the signing secret and send the hex digest in the ",
|
|
416
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ q("code", {
|
|
417
657
|
className: "font-mono",
|
|
418
|
-
children:
|
|
658
|
+
children: P
|
|
419
659
|
}),
|
|
420
660
|
" header (a",
|
|
421
661
|
" ",
|
|
422
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ q("code", {
|
|
423
663
|
className: "font-mono",
|
|
424
664
|
children: "sha256="
|
|
425
665
|
}),
|
|
426
666
|
" prefix is accepted)."
|
|
427
667
|
] }),
|
|
428
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ J("li", { children: [
|
|
429
669
|
"Identify the shipment with ",
|
|
430
|
-
/* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ q("code", {
|
|
431
671
|
className: "font-mono",
|
|
432
672
|
children: "trackingNumber"
|
|
433
673
|
}),
|
|
434
674
|
" or its",
|
|
435
675
|
" ",
|
|
436
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ q("code", {
|
|
437
677
|
className: "font-mono",
|
|
438
678
|
children: "shipmentId"
|
|
439
679
|
}),
|
|
440
680
|
". Event types:",
|
|
441
681
|
" ",
|
|
442
|
-
|
|
682
|
+
F.join(", "),
|
|
443
683
|
"."
|
|
444
684
|
] }),
|
|
445
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ J("li", { children: [
|
|
446
686
|
"Send a stable ",
|
|
447
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ q("code", {
|
|
448
688
|
className: "font-mono",
|
|
449
689
|
children: "externalEventId"
|
|
450
690
|
}),
|
|
@@ -452,334 +692,364 @@ function Q({ url: e }) {
|
|
|
452
692
|
] })
|
|
453
693
|
]
|
|
454
694
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ q($, {
|
|
456
696
|
label: "Example body",
|
|
457
|
-
value:
|
|
697
|
+
value: z(),
|
|
458
698
|
multiline: !0
|
|
459
699
|
}),
|
|
460
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ q($, {
|
|
461
701
|
label: "Example request",
|
|
462
|
-
value:
|
|
702
|
+
value: L(e),
|
|
463
703
|
multiline: !0
|
|
464
704
|
})
|
|
465
705
|
]
|
|
466
706
|
});
|
|
467
707
|
}
|
|
468
|
-
function
|
|
469
|
-
let
|
|
470
|
-
return /* @__PURE__ */
|
|
708
|
+
function Ue({ integration: e, url: t, expanded: a, refreshKey: l, busy: u, onToggle: d, onSetStatus: f, onRotate: m, onPoll: b, onDelete: x }) {
|
|
709
|
+
let S = e.status === "ACTIVE", C = fe(e.provider);
|
|
710
|
+
return /* @__PURE__ */ q(v, { children: /* @__PURE__ */ J(y, {
|
|
471
711
|
className: "p-5",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
712
|
+
children: [/* @__PURE__ */ J("div", {
|
|
473
713
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
474
|
-
children: [/* @__PURE__ */
|
|
714
|
+
children: [/* @__PURE__ */ J("div", {
|
|
475
715
|
className: "min-w-0 space-y-1",
|
|
476
716
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ J("div", {
|
|
478
718
|
className: "flex flex-wrap items-center gap-2",
|
|
479
|
-
children: [/* @__PURE__ */
|
|
719
|
+
children: [/* @__PURE__ */ q("p", {
|
|
480
720
|
className: "text-base font-semibold",
|
|
481
721
|
children: e.name
|
|
482
|
-
}), /* @__PURE__ */
|
|
483
|
-
variant:
|
|
484
|
-
children:
|
|
722
|
+
}), /* @__PURE__ */ q(g, {
|
|
723
|
+
variant: de(e.status),
|
|
724
|
+
children: U(e.status)
|
|
485
725
|
})]
|
|
486
726
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ J("p", {
|
|
488
728
|
className: "text-xs text-text-secondary",
|
|
489
729
|
children: [
|
|
490
730
|
ge(e.provider),
|
|
491
|
-
" ·
|
|
492
|
-
|
|
731
|
+
" ·",
|
|
732
|
+
" ",
|
|
733
|
+
ve(e.status, e.provider)
|
|
493
734
|
]
|
|
494
735
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
736
|
+
C ? /* @__PURE__ */ q("p", {
|
|
737
|
+
className: "text-xs text-text-secondary",
|
|
738
|
+
children: me(e.pollStatus, h)
|
|
739
|
+
}) : null,
|
|
740
|
+
/* @__PURE__ */ J("p", {
|
|
496
741
|
className: "text-xs text-text-secondary",
|
|
497
742
|
children: [
|
|
498
743
|
"Last accepted update:",
|
|
499
744
|
" ",
|
|
500
|
-
e.lastSyncAt ?
|
|
501
|
-
e.lastErrorAt ? ` · Last error ${
|
|
745
|
+
e.lastSyncAt ? h(e.lastSyncAt) : "none yet",
|
|
746
|
+
e.lastErrorAt ? ` · Last error ${h(e.lastErrorAt)}` : ""
|
|
502
747
|
]
|
|
503
748
|
}),
|
|
504
|
-
e.lastErrorMessage ? /* @__PURE__ */
|
|
749
|
+
e.lastErrorMessage ? /* @__PURE__ */ q("p", {
|
|
505
750
|
className: "break-words text-xs text-status-error-text",
|
|
506
751
|
children: e.lastErrorMessage
|
|
507
752
|
}) : null
|
|
508
753
|
]
|
|
509
|
-
}), /* @__PURE__ */
|
|
754
|
+
}), /* @__PURE__ */ J("div", {
|
|
510
755
|
className: "flex flex-wrap items-center gap-2",
|
|
511
756
|
children: [
|
|
512
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ J(_, {
|
|
513
758
|
size: "sm",
|
|
514
759
|
variant: "outline",
|
|
515
|
-
disabled:
|
|
516
|
-
onClick: () =>
|
|
517
|
-
children: [
|
|
760
|
+
disabled: u,
|
|
761
|
+
onClick: () => f(S ? "PAUSED" : "ACTIVE"),
|
|
762
|
+
children: [q(S ? s : c, {
|
|
518
763
|
size: 14,
|
|
519
764
|
className: "mr-1"
|
|
520
|
-
}),
|
|
765
|
+
}), S ? "Pause" : "Resume"]
|
|
521
766
|
}),
|
|
522
|
-
/* @__PURE__ */
|
|
767
|
+
C ? /* @__PURE__ */ J(_, {
|
|
523
768
|
size: "sm",
|
|
524
769
|
variant: "outline",
|
|
525
|
-
disabled:
|
|
526
|
-
onClick:
|
|
527
|
-
children: [/* @__PURE__ */
|
|
770
|
+
disabled: u || !S,
|
|
771
|
+
onClick: b,
|
|
772
|
+
children: [/* @__PURE__ */ q(i, {
|
|
528
773
|
size: 14,
|
|
529
774
|
className: "mr-1"
|
|
530
|
-
}),
|
|
775
|
+
}), "Poll now"]
|
|
776
|
+
}) : null,
|
|
777
|
+
/* @__PURE__ */ J(_, {
|
|
778
|
+
size: "sm",
|
|
779
|
+
variant: "outline",
|
|
780
|
+
disabled: u,
|
|
781
|
+
onClick: m,
|
|
782
|
+
children: [/* @__PURE__ */ q(o, {
|
|
783
|
+
size: 14,
|
|
784
|
+
className: "mr-1"
|
|
785
|
+
}), e.provider === "SAMSARA" ? "Replace secret" : C ? "Update password" : "Rotate secret"]
|
|
531
786
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ q(_, {
|
|
533
788
|
size: "sm",
|
|
534
789
|
variant: "ghost",
|
|
535
|
-
disabled:
|
|
536
|
-
onClick:
|
|
790
|
+
disabled: u,
|
|
791
|
+
onClick: x,
|
|
537
792
|
"aria-label": `Delete ${e.name}`,
|
|
538
|
-
children: /* @__PURE__ */
|
|
793
|
+
children: /* @__PURE__ */ q(p, { size: 14 })
|
|
539
794
|
}),
|
|
540
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ q(_, {
|
|
541
796
|
size: "sm",
|
|
542
797
|
variant: "ghost",
|
|
543
|
-
onClick:
|
|
544
|
-
"aria-expanded":
|
|
545
|
-
"aria-label":
|
|
546
|
-
children:
|
|
798
|
+
onClick: d,
|
|
799
|
+
"aria-expanded": a,
|
|
800
|
+
"aria-label": a ? "Hide details" : "Show details",
|
|
801
|
+
children: q(a ? r : n, { size: 16 })
|
|
547
802
|
})
|
|
548
803
|
]
|
|
549
804
|
})]
|
|
550
|
-
}),
|
|
805
|
+
}), a ? /* @__PURE__ */ J("div", {
|
|
551
806
|
className: "mt-4 grid gap-6 border-t border-border-subtle pt-4 lg:grid-cols-2",
|
|
552
|
-
children: [e.provider === "SAMSARA" ? /* @__PURE__ */
|
|
807
|
+
children: [C ? /* @__PURE__ */ q(ze, { integration: e }) : e.provider === "SAMSARA" ? /* @__PURE__ */ q(Le, { url: t }) : e.provider === "MOTIVE" ? /* @__PURE__ */ q(Re, { url: t }) : /* @__PURE__ */ q(He, { url: t }), /* @__PURE__ */ q(Ve, {
|
|
553
808
|
integrationId: e.id,
|
|
554
|
-
refreshKey:
|
|
809
|
+
refreshKey: l,
|
|
810
|
+
polled: C
|
|
555
811
|
})]
|
|
556
812
|
}) : null]
|
|
557
813
|
}) });
|
|
558
814
|
}
|
|
559
|
-
function
|
|
560
|
-
let { tenantId: e, workspaceId: t } =
|
|
561
|
-
return /* @__PURE__ */
|
|
815
|
+
function We() {
|
|
816
|
+
let { tenantId: e, workspaceId: t } = m();
|
|
817
|
+
return /* @__PURE__ */ q(Ge, {}, `${e ?? ""}:${t ?? ""}`);
|
|
562
818
|
}
|
|
563
|
-
function
|
|
564
|
-
let { apiGatewayUrl: t } =
|
|
819
|
+
function Ge() {
|
|
820
|
+
let { apiGatewayUrl: t } = m(), n = be(), { message: r, notify: i } = se(), [a, o] = K(null), [s, c] = K(Z), [p, b] = K(0), [x, S] = K(0), [re, O] = K(null), [k, A] = K(!1), [j, le] = K(null), [ue, N] = K([]), P = ue[0] ?? null, F = (e, t) => N((n) => [...n, {
|
|
565
821
|
name: e,
|
|
566
822
|
secret: t
|
|
567
|
-
}]),
|
|
568
|
-
if (!
|
|
569
|
-
|
|
823
|
+
}]), I = Te(/* @__PURE__ */ new Set()), [L, R] = K(() => /* @__PURE__ */ new Set()), z = async (e, t) => {
|
|
824
|
+
if (!I.current.has(e)) {
|
|
825
|
+
I.current.add(e), R(new Set(I.current));
|
|
570
826
|
try {
|
|
571
827
|
await t();
|
|
572
828
|
} finally {
|
|
573
|
-
|
|
829
|
+
I.current.delete(e), R(new Set(I.current));
|
|
574
830
|
}
|
|
575
831
|
}
|
|
576
|
-
}, { integrations:
|
|
577
|
-
status: s ===
|
|
578
|
-
limit:
|
|
579
|
-
offset:
|
|
580
|
-
}), { all:
|
|
581
|
-
|
|
582
|
-
!
|
|
832
|
+
}, { integrations: B, total: H, isLoading: W, error: de, refetch: me } = Ce({
|
|
833
|
+
status: s === Z ? void 0 : s,
|
|
834
|
+
limit: Ne,
|
|
835
|
+
offset: p * Ne
|
|
836
|
+
}), { all: he, active: ge, refetch: _e } = xe(), G = Math.max(1, Math.ceil(H / Ne));
|
|
837
|
+
we(() => {
|
|
838
|
+
!W && p > 0 && p >= G && b(G - 1);
|
|
583
839
|
}, [
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
840
|
+
W,
|
|
841
|
+
p,
|
|
842
|
+
G
|
|
587
843
|
]);
|
|
588
|
-
let
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
o(null), i(e),
|
|
592
|
-
},
|
|
844
|
+
let ve = B.map((e) => e.lastSyncAt).filter((e) => !!e).sort(), Se = ve.length > 0 ? ve[ve.length - 1] : void 0, Ee = (e) => ye(t, e.workspaceId, e.id, window.location.origin), Y = () => {
|
|
845
|
+
S((e) => e + 1), me(), _e();
|
|
846
|
+
}, X = (e) => {
|
|
847
|
+
o(null), i(e), Y();
|
|
848
|
+
}, ke = async (e, t) => {
|
|
593
849
|
try {
|
|
594
|
-
await n.update(e.id, { status: t }),
|
|
850
|
+
await n.update(e.id, { status: t }), X(t === "ACTIVE" ? `Resumed ${e.name}.` : `Paused ${e.name}.`);
|
|
595
851
|
} catch (e) {
|
|
596
|
-
o(
|
|
852
|
+
o(Q(e, "Could not change the integration status."));
|
|
597
853
|
}
|
|
598
|
-
},
|
|
854
|
+
}, Ae = async (e) => {
|
|
599
855
|
if (!window.confirm(`Rotate the signing secret for ${e.name}? Deliveries signed with the old secret are refused as soon as it changes.`)) return;
|
|
600
|
-
let t =
|
|
856
|
+
let t = V();
|
|
601
857
|
try {
|
|
602
|
-
await n.update(e.id, { apiSecret: t }),
|
|
858
|
+
await n.update(e.id, { apiSecret: t }), F(e.name, t), X(`Rotated the signing secret for ${e.name}.`);
|
|
603
859
|
} catch (e) {
|
|
604
|
-
o(
|
|
860
|
+
o(Q(e, "Could not rotate the signing secret."));
|
|
605
861
|
}
|
|
606
|
-
},
|
|
607
|
-
await
|
|
608
|
-
await n.update(e.id, { apiSecret: t }),
|
|
862
|
+
}, je = async (e, t) => {
|
|
863
|
+
await z(e.id, async () => {
|
|
864
|
+
await n.update(e.id, { apiSecret: t }), X(e.provider === "GEOTAB" ? `Updated the MyGeotab password for ${e.name}.` : `Replaced the Samsara secret for ${e.name}.`);
|
|
609
865
|
});
|
|
610
|
-
},
|
|
866
|
+
}, Me = async (e) => {
|
|
867
|
+
try {
|
|
868
|
+
let t = await n.pollNow(e.id);
|
|
869
|
+
if (t.status === "FAILED") {
|
|
870
|
+
o(pe(e.name, t)), Y();
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
X(pe(e.name, t));
|
|
874
|
+
} catch (t) {
|
|
875
|
+
o(Q(t, `Could not poll ${e.name}.`));
|
|
876
|
+
}
|
|
877
|
+
}, $ = async (e) => {
|
|
611
878
|
if (window.confirm(`Delete ${e.name}? Its webhook URL stops working; tracking events it already created stay on their shipments.`)) try {
|
|
612
|
-
await n.remove(e.id),
|
|
879
|
+
await n.remove(e.id), re === e.id && O(null), X(`Deleted ${e.name}.`);
|
|
613
880
|
} catch (e) {
|
|
614
|
-
o(
|
|
881
|
+
o(Q(e, "Could not delete the integration."));
|
|
615
882
|
}
|
|
616
883
|
};
|
|
617
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ J(ie, {
|
|
618
885
|
title: "Integrations",
|
|
619
886
|
subtitle: "Carrier, ELD and GPS tracking feeds",
|
|
620
|
-
icon: /* @__PURE__ */
|
|
621
|
-
headerActions: /* @__PURE__ */
|
|
887
|
+
icon: /* @__PURE__ */ q(l, { size: 24 }),
|
|
888
|
+
headerActions: /* @__PURE__ */ q(De, {
|
|
622
889
|
primary: {
|
|
623
890
|
label: "Connect feed",
|
|
624
|
-
icon: /* @__PURE__ */
|
|
625
|
-
onSelect: () =>
|
|
891
|
+
icon: /* @__PURE__ */ q(u, { size: 16 }),
|
|
892
|
+
onSelect: () => A(!0)
|
|
626
893
|
},
|
|
627
894
|
actions: [{
|
|
628
895
|
label: "Refresh",
|
|
629
|
-
icon: /* @__PURE__ */
|
|
630
|
-
onSelect:
|
|
896
|
+
icon: /* @__PURE__ */ q(d, { size: 16 }),
|
|
897
|
+
onSelect: Y
|
|
631
898
|
}]
|
|
632
899
|
}),
|
|
633
900
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
icon: /* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ q(Oe, {
|
|
902
|
+
icon: /* @__PURE__ */ q(l, { size: 18 }),
|
|
636
903
|
children: "Connect the systems that already know where your freight is. Each feed gets its own signed webhook; every update it sends becomes a tracking event on the matching shipment, so status and ETA stay current without manual entry."
|
|
637
904
|
}),
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ q(oe, { message: r }),
|
|
906
|
+
/* @__PURE__ */ q(D, { message: a }),
|
|
907
|
+
/* @__PURE__ */ J(ae, {
|
|
641
908
|
columns: 3,
|
|
642
909
|
children: [
|
|
643
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ q(E, {
|
|
644
911
|
label: "Feeds",
|
|
645
|
-
value:
|
|
646
|
-
icon: /* @__PURE__ */
|
|
912
|
+
value: he,
|
|
913
|
+
icon: /* @__PURE__ */ q(l, { size: 20 }),
|
|
647
914
|
accent: "brand"
|
|
648
915
|
}),
|
|
649
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ q(E, {
|
|
650
917
|
label: "Active",
|
|
651
|
-
value:
|
|
652
|
-
icon: /* @__PURE__ */
|
|
918
|
+
value: ge,
|
|
919
|
+
icon: /* @__PURE__ */ q(f, { size: 20 }),
|
|
653
920
|
accent: "success"
|
|
654
921
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ q(E, {
|
|
656
923
|
label: "Last accepted update (shown)",
|
|
657
|
-
value:
|
|
658
|
-
icon: /* @__PURE__ */
|
|
924
|
+
value: Se ? h(Se) : "—",
|
|
925
|
+
icon: /* @__PURE__ */ q(e, { size: 20 }),
|
|
659
926
|
accent: "blue"
|
|
660
927
|
})
|
|
661
928
|
]
|
|
662
929
|
}),
|
|
663
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ q("div", {
|
|
664
931
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
665
|
-
children: /* @__PURE__ */
|
|
932
|
+
children: /* @__PURE__ */ J(C, {
|
|
666
933
|
value: s,
|
|
667
934
|
onValueChange: (e) => {
|
|
668
|
-
|
|
935
|
+
c(e), b(0);
|
|
669
936
|
},
|
|
670
|
-
children: [/* @__PURE__ */
|
|
937
|
+
children: [/* @__PURE__ */ q(te, {
|
|
671
938
|
"aria-label": "Status",
|
|
672
939
|
className: "sm:w-56",
|
|
673
|
-
children: /* @__PURE__ */
|
|
674
|
-
}), /* @__PURE__ */
|
|
675
|
-
value:
|
|
940
|
+
children: /* @__PURE__ */ q(ne, {})
|
|
941
|
+
}), /* @__PURE__ */ J(ee, { children: [/* @__PURE__ */ q(w, {
|
|
942
|
+
value: Z,
|
|
676
943
|
children: "All statuses"
|
|
677
|
-
}),
|
|
944
|
+
}), ce.map((e) => /* @__PURE__ */ q(w, {
|
|
678
945
|
value: e,
|
|
679
|
-
children:
|
|
946
|
+
children: U(e)
|
|
680
947
|
}, e))] })]
|
|
681
948
|
})
|
|
682
949
|
}),
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
|
|
950
|
+
/* @__PURE__ */ q(D, { message: de?.message }),
|
|
951
|
+
W && B.length === 0 ? /* @__PURE__ */ J("div", {
|
|
685
952
|
className: "grid gap-4",
|
|
686
|
-
children: [/* @__PURE__ */
|
|
687
|
-
}) :
|
|
953
|
+
children: [/* @__PURE__ */ q(T, { className: "h-28 w-full" }), /* @__PURE__ */ q(T, { className: "h-28 w-full" })]
|
|
954
|
+
}) : B.length === 0 && !de ? /* @__PURE__ */ q(v, { children: /* @__PURE__ */ J(y, {
|
|
688
955
|
className: "flex flex-col items-center gap-3 p-10 text-center",
|
|
689
956
|
children: [
|
|
690
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ q(l, {
|
|
691
958
|
size: 32,
|
|
692
959
|
className: "text-text-tertiary"
|
|
693
960
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ q("p", {
|
|
695
962
|
className: "font-medium",
|
|
696
|
-
children: s ===
|
|
963
|
+
children: s === Z ? "No tracking feeds connected" : "No feeds with this status"
|
|
697
964
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ q("p", {
|
|
699
966
|
className: "max-w-md text-sm text-text-secondary",
|
|
700
|
-
children: s ===
|
|
967
|
+
children: s === Z ? "Connect a carrier portal, ELD or GPS tracker so shipment updates arrive on their own." : "Choose another status to see the rest of your feeds."
|
|
701
968
|
}),
|
|
702
|
-
s ===
|
|
703
|
-
onClick: () =>
|
|
704
|
-
children: [/* @__PURE__ */
|
|
969
|
+
s === Z ? /* @__PURE__ */ J(_, {
|
|
970
|
+
onClick: () => A(!0),
|
|
971
|
+
children: [/* @__PURE__ */ q(u, {
|
|
705
972
|
size: 16,
|
|
706
973
|
className: "mr-1.5"
|
|
707
974
|
}), "Connect feed"]
|
|
708
975
|
}) : null
|
|
709
976
|
]
|
|
710
|
-
}) }) : /* @__PURE__ */
|
|
977
|
+
}) }) : /* @__PURE__ */ q("div", {
|
|
711
978
|
className: "grid gap-4",
|
|
712
|
-
children:
|
|
979
|
+
children: B.map((e) => /* @__PURE__ */ q(Ue, {
|
|
713
980
|
integration: e,
|
|
714
|
-
url:
|
|
715
|
-
expanded:
|
|
716
|
-
refreshKey:
|
|
717
|
-
busy:
|
|
718
|
-
onToggle: () =>
|
|
719
|
-
onSetStatus: (t) => void
|
|
720
|
-
onRotate: () => e.provider === "SAMSARA" ?
|
|
721
|
-
|
|
981
|
+
url: Ee(e),
|
|
982
|
+
expanded: re === e.id,
|
|
983
|
+
refreshKey: x,
|
|
984
|
+
busy: L.has(e.id),
|
|
985
|
+
onToggle: () => O((t) => t === e.id ? null : e.id),
|
|
986
|
+
onSetStatus: (t) => void z(e.id, () => ke(e, t)),
|
|
987
|
+
onRotate: () => e.provider === "SAMSARA" || fe(e.provider) ? le(e) : void z(e.id, () => Ae(e)),
|
|
988
|
+
onPoll: () => void z(e.id, () => Me(e)),
|
|
989
|
+
onDelete: () => void z(e.id, () => $(e))
|
|
722
990
|
}, e.id))
|
|
723
991
|
}),
|
|
724
|
-
|
|
992
|
+
H > Ne ? /* @__PURE__ */ J("div", {
|
|
725
993
|
className: "flex items-center justify-between text-sm",
|
|
726
|
-
children: [/* @__PURE__ */
|
|
994
|
+
children: [/* @__PURE__ */ J("span", {
|
|
727
995
|
className: "text-text-secondary",
|
|
728
996
|
children: [
|
|
729
997
|
"Page ",
|
|
730
|
-
|
|
998
|
+
p + 1,
|
|
731
999
|
" of ",
|
|
732
|
-
|
|
1000
|
+
G,
|
|
733
1001
|
" · ",
|
|
734
|
-
|
|
1002
|
+
H,
|
|
735
1003
|
" feeds"
|
|
736
1004
|
]
|
|
737
|
-
}), /* @__PURE__ */
|
|
1005
|
+
}), /* @__PURE__ */ J("div", {
|
|
738
1006
|
className: "flex gap-2",
|
|
739
|
-
children: [/* @__PURE__ */
|
|
1007
|
+
children: [/* @__PURE__ */ q(_, {
|
|
740
1008
|
variant: "outline",
|
|
741
1009
|
size: "sm",
|
|
742
|
-
disabled:
|
|
1010
|
+
disabled: p === 0,
|
|
743
1011
|
onClick: () => b((e) => e - 1),
|
|
744
1012
|
children: "Previous"
|
|
745
|
-
}), /* @__PURE__ */
|
|
1013
|
+
}), /* @__PURE__ */ q(_, {
|
|
746
1014
|
variant: "outline",
|
|
747
1015
|
size: "sm",
|
|
748
|
-
disabled:
|
|
1016
|
+
disabled: p + 1 >= G,
|
|
749
1017
|
onClick: () => b((e) => e + 1),
|
|
750
1018
|
children: "Next"
|
|
751
1019
|
})]
|
|
752
1020
|
})]
|
|
753
1021
|
}) : null,
|
|
754
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ q(v, { children: /* @__PURE__ */ J(y, {
|
|
755
1023
|
className: "space-y-2 p-5",
|
|
756
1024
|
children: [
|
|
757
|
-
/* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ q("p", {
|
|
758
1026
|
className: "text-sm font-medium",
|
|
759
1027
|
children: "Carrier and ELD networks"
|
|
760
1028
|
}),
|
|
761
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ J("p", {
|
|
762
1030
|
className: "text-sm text-text-secondary",
|
|
763
1031
|
children: [
|
|
764
|
-
"Samsara
|
|
765
|
-
" ",
|
|
766
|
-
|
|
767
|
-
" ",
|
|
768
|
-
"are not available yet. Until they are, any carrier or telematics system that can send HTTPS webhooks connects through a signed feed above."
|
|
1032
|
+
"Samsara, Motive and Geotab connect directly: choose them when you connect a feed. Direct connections to ",
|
|
1033
|
+
M.map((e) => e.label).join(", "),
|
|
1034
|
+
" are not available yet. Until they are, any carrier or telematics system that can send HTTPS webhooks connects through a signed feed above."
|
|
769
1035
|
]
|
|
770
1036
|
}),
|
|
771
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ J("div", {
|
|
772
1038
|
className: "flex flex-wrap gap-2",
|
|
773
1039
|
children: [
|
|
774
|
-
/* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ q(g, {
|
|
775
1041
|
variant: "default",
|
|
776
1042
|
children: "Samsara · available"
|
|
777
1043
|
}),
|
|
778
|
-
|
|
779
|
-
variant: "
|
|
780
|
-
children:
|
|
781
|
-
}
|
|
782
|
-
|
|
1044
|
+
/* @__PURE__ */ q(g, {
|
|
1045
|
+
variant: "default",
|
|
1046
|
+
children: "Motive · available"
|
|
1047
|
+
}),
|
|
1048
|
+
/* @__PURE__ */ q(g, {
|
|
1049
|
+
variant: "default",
|
|
1050
|
+
children: "Geotab · available"
|
|
1051
|
+
}),
|
|
1052
|
+
M.map((e) => /* @__PURE__ */ J(g, {
|
|
783
1053
|
variant: "outline",
|
|
784
1054
|
children: [e.label, " · not available yet"]
|
|
785
1055
|
}, e.id))
|
|
@@ -787,25 +1057,25 @@ function je() {
|
|
|
787
1057
|
})
|
|
788
1058
|
]
|
|
789
1059
|
}) }),
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
open:
|
|
792
|
-
onOpenChange:
|
|
1060
|
+
/* @__PURE__ */ q(Fe, {
|
|
1061
|
+
open: k,
|
|
1062
|
+
onOpenChange: A,
|
|
793
1063
|
onCreated: (e, t) => {
|
|
794
|
-
|
|
1064
|
+
O(e.id), t && F(e.name, t), X(`Connected ${e.name}.`);
|
|
795
1065
|
}
|
|
796
1066
|
}),
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
integration:
|
|
799
|
-
onClose: () =>
|
|
800
|
-
onReplace:
|
|
1067
|
+
/* @__PURE__ */ q(Ie, {
|
|
1068
|
+
integration: j,
|
|
1069
|
+
onClose: () => le(null),
|
|
1070
|
+
onReplace: je
|
|
801
1071
|
}),
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
secret:
|
|
804
|
-
integrationName:
|
|
805
|
-
onClose: () =>
|
|
1072
|
+
/* @__PURE__ */ q(Pe, {
|
|
1073
|
+
secret: P?.secret ?? null,
|
|
1074
|
+
integrationName: P?.name ?? "",
|
|
1075
|
+
onClose: () => N((e) => e.slice(1))
|
|
806
1076
|
})
|
|
807
1077
|
]
|
|
808
1078
|
});
|
|
809
1079
|
}
|
|
810
1080
|
//#endregion
|
|
811
|
-
export {
|
|
1081
|
+
export { We as default };
|