@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.
@@ -1,10 +1,14 @@
1
- import { CarrierIntegration, CarrierIntegrationEvent, IntegrationStatus, SupportedProvider } from '../utils/carrierIntegrations';
1
+ import { CarrierIntegration, CarrierIntegrationEvent, GeotabConfig, IntegrationPollResult, IntegrationStatus, SupportedProvider } from '../utils/carrierIntegrations';
2
2
  export interface CreateCarrierIntegrationInput {
3
3
  provider: SupportedProvider;
4
4
  name: string;
5
5
  apiSecret: string;
6
- /** Provider mapping settings (e.g. Samsara's shipment external id key). Never secrets. */
7
- config?: Record<string, string>;
6
+ /**
7
+ * Provider settings (Samsara's shipment external id key, Geotab's server,
8
+ * database, user and rule mappings). Never secrets: a Geotab password goes
9
+ * in `apiSecret`, which the service stores encrypted.
10
+ */
11
+ config?: Record<string, string> | GeotabConfig;
8
12
  }
9
13
  export interface UpdateCarrierIntegrationInput {
10
14
  name?: string;
@@ -37,5 +41,7 @@ export declare function useCarrierIntegrationEvents(integrationId: string | null
37
41
  export declare function useCarrierIntegrationActions(): {
38
42
  create: (input: CreateCarrierIntegrationInput) => Promise<CarrierIntegration>;
39
43
  update: (id: string, input: UpdateCarrierIntegrationInput) => Promise<CarrierIntegration>;
44
+ /** Polls a pulled feed (Geotab) now, outside its schedule. */
45
+ pollNow: (id: string) => Promise<IntegrationPollResult>;
40
46
  remove: (id: string) => Promise<boolean>;
41
47
  };
@@ -2,8 +2,11 @@
2
2
  * Providers this page can connect. The service also ingests SHIPROCKET, which
3
3
  * is set up from the Shiprocket carrier flow rather than here.
4
4
  */
5
- export declare const SUPPORTED_PROVIDERS: readonly ["GENERIC_WEBHOOK", "SAMSARA"];
5
+ export declare const SUPPORTED_PROVIDERS: readonly ["GENERIC_WEBHOOK", "SAMSARA", "MOTIVE", "GEOTAB"];
6
6
  export type SupportedProvider = (typeof SUPPORTED_PROVIDERS)[number];
7
+ /** Providers the service pulls on a schedule instead of receiving webhooks. */
8
+ export declare const POLLED_PROVIDERS: ReadonlySet<string>;
9
+ export declare function isPolledProvider(provider: string): boolean;
7
10
  /** Named networks without an adapter yet; the service refuses the reserved ones. */
8
11
  export declare const ROADMAP_PROVIDERS: readonly [{
9
12
  readonly id: "PROJECT44";
@@ -15,11 +18,9 @@ export declare const ROADMAP_PROVIDERS: readonly [{
15
18
  readonly id: "DESCARTES";
16
19
  readonly label: "Descartes";
17
20
  }];
18
- /** ELD networks planned after Samsara (BOFF-10703 follow-ups); not in the schema yet. */
19
- export declare const PLANNED_ELD_PROVIDERS: readonly ["Motive", "Geotab"];
20
21
  export declare const INTEGRATION_STATUSES: readonly ["ACTIVE", "PAUSED", "DISABLED"];
21
22
  export type IntegrationStatus = (typeof INTEGRATION_STATUSES)[number];
22
- export type IntegrationProvider = 'GENERIC_WEBHOOK' | 'SAMSARA' | 'SHIPROCKET' | 'PROJECT44' | 'FOURKITES' | 'DESCARTES';
23
+ export type IntegrationProvider = 'GENERIC_WEBHOOK' | 'SAMSARA' | 'MOTIVE' | 'GEOTAB' | 'SHIPROCKET' | 'PROJECT44' | 'FOURKITES' | 'DESCARTES';
23
24
  /** How each provider is named on the page. */
24
25
  export declare function providerLabel(provider: IntegrationProvider): string;
25
26
  /** Samsara webhook event types the service turns into tracking events. */
@@ -36,6 +37,16 @@ export declare const SAMSARA_EVENT_TYPES: readonly [{
36
37
  readonly type: "GeofenceExit";
37
38
  readonly becomes: "DEPARTED";
38
39
  }];
40
+ /** Motive webhook actions the service turns into tracking events. */
41
+ export declare const MOTIVE_ACTIONS: readonly [{
42
+ readonly action: "vehicle_geofence_event";
43
+ readonly becomes: "Arrived on geofence entry, Departed on exit";
44
+ }, {
45
+ readonly action: "vehicle_location_updated";
46
+ readonly becomes: "In transit, with the reported position";
47
+ }];
48
+ /** Header Motive signs each delivery with (hex HMAC-SHA1 of the raw body); the gateway forwards it. */
49
+ export declare const MOTIVE_SIGNATURE_HEADER = "X-KT-Webhook-Signature";
39
50
  /** Route or stop external id key the service reads the shipment reference from by default. */
40
51
  export declare const DEFAULT_SAMSARA_SHIPMENT_KEY = "mtwShipment";
41
52
  /** The service refuses Samsara secrets that decode to fewer bytes than this. */
@@ -47,6 +58,55 @@ export declare const MIN_SAMSARA_SECRET_BYTES = 16;
47
58
  export declare function samsaraSecretError(secret: string): string | null;
48
59
  /** Returns an error message for an unusable external id key, or null. */
49
60
  export declare function externalIdKeyError(key: string): string | null;
61
+ /** MyGeotab host used when the server field is left blank. */
62
+ export declare const DEFAULT_GEOTAB_SERVER = "my.geotab.com";
63
+ /** How often the service polls each Geotab feed. */
64
+ export declare const GEOTAB_POLL_INTERVAL_MINUTES = 5;
65
+ /** Tracking events a Geotab exception rule may be mapped to. */
66
+ export declare const GEOTAB_RULE_EVENT_TYPES: readonly ["PICKED_UP", "IN_TRANSIT", "ARRIVED", "DEPARTED", "OUT_FOR_DELIVERY", "DELIVERED", "FAILED", "RETURNED"];
67
+ export type GeotabRuleEventType = (typeof GEOTAB_RULE_EVENT_TYPES)[number];
68
+ /** The service accepts at most this many rule mappings per Geotab feed. */
69
+ export declare const MAX_GEOTAB_RULE_MAPPINGS = 50;
70
+ /** The service refuses MyGeotab passwords longer than this. */
71
+ export declare const MAX_GEOTAB_PASSWORD_LENGTH = 255;
72
+ export interface GeotabConnectionInput {
73
+ server: string;
74
+ database: string;
75
+ userName: string;
76
+ /** One `<rule id> = <EVENT_TYPE>` per line. */
77
+ ruleMappings: string;
78
+ locationUpdates: boolean;
79
+ }
80
+ export interface GeotabConfig {
81
+ server: string;
82
+ database: string;
83
+ userName: string;
84
+ ruleEvents: Record<string, GeotabRuleEventType>;
85
+ locationUpdates: boolean;
86
+ }
87
+ /** The MyGeotab host the service will contact, or null when it is not a geotab.com host. */
88
+ export declare function normalizeGeotabServer(value: string): string | null;
89
+ /**
90
+ * Parses rule mappings typed one per line as `<rule id> = <EVENT_TYPE>` (a
91
+ * colon works too; blank lines and `#` comments are ignored).
92
+ */
93
+ export declare function parseGeotabRuleMappings(text: string): {
94
+ ok: true;
95
+ ruleEvents: Record<string, GeotabRuleEventType>;
96
+ } | {
97
+ ok: false;
98
+ error: string;
99
+ };
100
+ /** Validates the Geotab connection fields and builds the config the service stores. */
101
+ export declare function buildGeotabConfig(input: GeotabConnectionInput): {
102
+ ok: true;
103
+ config: GeotabConfig;
104
+ } | {
105
+ ok: false;
106
+ error: string;
107
+ };
108
+ /** Returns an error message for an unusable MyGeotab password, or null. */
109
+ export declare function geotabPasswordError(password: string): string | null;
50
110
  /** Headers Samsara signs each delivery with; the workspace gateway forwards both. */
51
111
  export declare const SAMSARA_SIGNATURE_HEADERS: readonly ["X-Samsara-Signature", "X-Samsara-Timestamp"];
52
112
  export type IntegrationEventStatus = 'RECEIVED' | 'ACCEPTED' | 'PARTIAL' | 'REJECTED' | 'DUPLICATE' | 'CONFLICT';
@@ -58,6 +118,28 @@ export declare const MIN_SECRET_LENGTH = 32;
58
118
  export declare const SIGNATURE_HEADER = "x-webhook-signature";
59
119
  /** Updates accepted in one delivery (a JSON array of at most this many objects). */
60
120
  export declare const MAX_UPDATES_PER_DELIVERY = 5;
121
+ export type PollStatus = 'OK' | 'PARTIAL' | 'FAILED';
122
+ export type PollResultStatus = PollStatus | 'SKIPPED';
123
+ /** Latest poll of a pulled feed (Geotab); null for webhook feeds. */
124
+ export interface IntegrationPollStatus {
125
+ lastPollAt: string | null;
126
+ lastSuccessAt: string | null;
127
+ lastPollStatus: PollStatus | null;
128
+ lastPollError: string | null;
129
+ consecutiveFailures: number;
130
+ lastRecordsFetched: number;
131
+ lastUpdatesAccepted: number;
132
+ lastUpdatesSkipped: number;
133
+ }
134
+ export interface IntegrationPollResult {
135
+ integrationId: string;
136
+ status: PollResultStatus;
137
+ skippedReason: string | null;
138
+ recordsFetched: number;
139
+ updatesAccepted: number;
140
+ updatesSkipped: number;
141
+ error: string | null;
142
+ }
61
143
  export interface CarrierIntegration {
62
144
  id: string;
63
145
  workspaceId: string;
@@ -69,6 +151,7 @@ export interface CarrierIntegration {
69
151
  lastErrorMessage: string | null;
70
152
  createdAt: string;
71
153
  updatedAt: string;
154
+ pollStatus: IntegrationPollStatus | null;
72
155
  }
73
156
  export interface CarrierIntegrationEvent {
74
157
  id: string;
@@ -81,11 +164,12 @@ export interface CarrierIntegrationEvent {
81
164
  receivedAt: string;
82
165
  processedAt: string | null;
83
166
  }
84
- export declare const LIST_INTEGRATIONS_QUERY = "\n query MtwCarrierIntegrations($filter: IntegrationFilterInput, $pagination: PaginationInput) {\n integrations(filter: $filter, pagination: $pagination) {\n \n id\n workspaceId\n provider\n name\n status\n lastSyncAt\n lastErrorAt\n lastErrorMessage\n createdAt\n updatedAt\n\n }\n integrationsCount(filter: $filter)\n }\n";
167
+ export declare const LIST_INTEGRATIONS_QUERY = "\n query MtwCarrierIntegrations($filter: IntegrationFilterInput, $pagination: PaginationInput) {\n integrations(filter: $filter, pagination: $pagination) {\n \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\n }\n integrationsCount(filter: $filter)\n }\n";
85
168
  export declare const INTEGRATION_COUNTS_QUERY = "\n query MtwCarrierIntegrationCounts {\n all: integrationsCount\n active: integrationsCount(filter: { status: ACTIVE })\n }\n";
86
169
  export declare const INTEGRATION_EVENTS_QUERY = "\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";
87
- export declare const CREATE_INTEGRATION_MUTATION = "\n mutation CreateMtwCarrierIntegration($input: CreateIntegrationInput!) {\n createIntegration(input: $input) {\n \n id\n workspaceId\n provider\n name\n status\n lastSyncAt\n lastErrorAt\n lastErrorMessage\n createdAt\n updatedAt\n\n }\n }\n";
88
- export declare const UPDATE_INTEGRATION_MUTATION = "\n mutation UpdateMtwCarrierIntegration($id: ID!, $input: UpdateIntegrationInput!) {\n updateIntegration(id: $id, input: $input) {\n \n id\n workspaceId\n provider\n name\n status\n lastSyncAt\n lastErrorAt\n lastErrorMessage\n createdAt\n updatedAt\n\n }\n }\n";
170
+ export declare const CREATE_INTEGRATION_MUTATION = "\n mutation CreateMtwCarrierIntegration($input: CreateIntegrationInput!) {\n createIntegration(input: $input) {\n \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\n }\n }\n";
171
+ export declare const UPDATE_INTEGRATION_MUTATION = "\n mutation UpdateMtwCarrierIntegration($id: ID!, $input: UpdateIntegrationInput!) {\n updateIntegration(id: $id, input: $input) {\n \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\n }\n }\n";
172
+ export declare const POLL_INTEGRATION_NOW_MUTATION = "\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";
89
173
  export declare const DELETE_INTEGRATION_MUTATION = "\n mutation DeleteMtwCarrierIntegration($id: ID!) {\n deleteIntegration(id: $id)\n }\n";
90
174
  /** Minimal source of randomness, so tests can supply a deterministic one. */
91
175
  export interface RandomSource {
@@ -117,6 +201,11 @@ export declare function curlExample(url: string): string;
117
201
  export declare function humanize(value: string): string;
118
202
  export type BadgeTone = 'default' | 'secondary' | 'outline' | 'destructive';
119
203
  export declare function integrationStatusTone(status: IntegrationStatus): BadgeTone;
204
+ export declare function pollStatusTone(status: PollStatus | null): BadgeTone;
205
+ /** One line describing the latest poll, for the integration card. */
206
+ export declare function pollStatusSummary(pollStatus: IntegrationPollStatus | null, format: (iso: string) => string): string;
207
+ /** The notice shown after "Poll now". */
208
+ export declare function pollResultMessage(name: string, result: IntegrationPollResult): string;
120
209
  export declare function eventStatusTone(status: IntegrationEventStatus): BadgeTone;
121
- /** What a webhook sender sees for each status, shown next to the status control. */
122
- export declare function statusExplanation(status: IntegrationStatus): string;
210
+ /** What each status means for a feed, shown next to the status control. */
211
+ export declare function statusExplanation(status: IntegrationStatus, provider?: IntegrationProvider): string;
@@ -0,0 +1,18 @@
1
+ import { createLucideIcon as e } from "../createLucideIcon.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/cloud-download.js
3
+ var t = e("CloudDownload", [
4
+ ["path", {
5
+ d: "M12 13v8l-4-4",
6
+ key: "1f5nwf"
7
+ }],
8
+ ["path", {
9
+ d: "m12 21 4-4",
10
+ key: "1lfcce"
11
+ }],
12
+ ["path", {
13
+ d: "M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",
14
+ key: "ui1hmy"
15
+ }]
16
+ ]);
17
+ //#endregion
18
+ export { t as CloudDownload };