@mydoormot/app-types 1.7.41 → 1.7.42
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/.turbo/turbo-build.log +18 -18
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +0 -10
- package/dist/index.d.cts +35 -56
- package/dist/index.d.ts +35 -56
- package/dist/index.js +0 -9
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/vehicle.ts +36 -0
- package/src/tracker.ts +0 -59
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
> @mydoormot/app-types@1.7.
|
|
3
|
-
> tsup src/index.ts --format esm,cjs --dts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
|
|
2
|
+
> @mydoormot/app-types@1.7.42 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
|
|
3
|
+
> tsup src/index.ts --format esm,cjs --dts
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v7.3.0
|
|
8
|
+
[34mCLI[39m Target: es2021
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m11.08 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 59ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m13.45 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 58ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 618ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m34.32 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m34.32 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -44,7 +44,6 @@ __export(src_exports, {
|
|
|
44
44
|
RemittanceStatus: () => RemittanceStatus,
|
|
45
45
|
RoleType: () => RoleType,
|
|
46
46
|
SettlementType: () => SettlementType,
|
|
47
|
-
TraccarDeviceStatus: () => TraccarDeviceStatus,
|
|
48
47
|
VehicleLogType: () => VehicleLogType,
|
|
49
48
|
VehicleType: () => VehicleType,
|
|
50
49
|
WhatsappButtonType: () => WhatsappButtonType,
|
|
@@ -281,14 +280,6 @@ var BusinessCourierLinkStatus = /* @__PURE__ */ ((BusinessCourierLinkStatus2) =>
|
|
|
281
280
|
return BusinessCourierLinkStatus2;
|
|
282
281
|
})(BusinessCourierLinkStatus || {});
|
|
283
282
|
|
|
284
|
-
// src/tracker.ts
|
|
285
|
-
var TraccarDeviceStatus = /* @__PURE__ */ ((TraccarDeviceStatus2) => {
|
|
286
|
-
TraccarDeviceStatus2["ONLINE"] = "online";
|
|
287
|
-
TraccarDeviceStatus2["OFFLINE"] = "offline";
|
|
288
|
-
TraccarDeviceStatus2["UNKNOWN"] = "unknown";
|
|
289
|
-
return TraccarDeviceStatus2;
|
|
290
|
-
})(TraccarDeviceStatus || {});
|
|
291
|
-
|
|
292
283
|
// src/whatsapp.ts
|
|
293
284
|
var WhatsappEvent = /* @__PURE__ */ ((WhatsappEvent2) => {
|
|
294
285
|
WhatsappEvent2["ERRAND_CREATED"] = "errand.created";
|
|
@@ -369,7 +360,6 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
|
369
360
|
RemittanceStatus,
|
|
370
361
|
RoleType,
|
|
371
362
|
SettlementType,
|
|
372
|
-
TraccarDeviceStatus,
|
|
373
363
|
VehicleLogType,
|
|
374
364
|
VehicleType,
|
|
375
365
|
WhatsappButtonType,
|
package/dist/index.d.cts
CHANGED
|
@@ -332,6 +332,34 @@ declare enum VehicleType {
|
|
|
332
332
|
Bike = "bike",
|
|
333
333
|
Shuttle = "shuttle"
|
|
334
334
|
}
|
|
335
|
+
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
336
|
+
type GeoPoint = {
|
|
337
|
+
type: 'Point';
|
|
338
|
+
coordinates: [number, number];
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* A trimmed-down Traccar position kept as the vehicle's latest fix. Carries the
|
|
342
|
+
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
343
|
+
* (moving vs. idle, heading), `recordedAt` gauges staleness.
|
|
344
|
+
*/
|
|
345
|
+
type TrackerPosition = {
|
|
346
|
+
latitude: number;
|
|
347
|
+
longitude: number;
|
|
348
|
+
speed?: number;
|
|
349
|
+
course?: number;
|
|
350
|
+
accuracy?: number;
|
|
351
|
+
valid?: boolean;
|
|
352
|
+
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
353
|
+
motion?: boolean;
|
|
354
|
+
/** Engine on/off, when the device reports it. */
|
|
355
|
+
ignition?: boolean;
|
|
356
|
+
/** ISO time the GPS computed the position — the truest "when". */
|
|
357
|
+
fixTime?: string;
|
|
358
|
+
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
359
|
+
deviceTime?: string;
|
|
360
|
+
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
361
|
+
serverTime?: string;
|
|
362
|
+
};
|
|
335
363
|
type Vehicle = {
|
|
336
364
|
id: string;
|
|
337
365
|
vehicleNumber: string;
|
|
@@ -342,6 +370,12 @@ type Vehicle = {
|
|
|
342
370
|
businessId: string;
|
|
343
371
|
shortName?: string;
|
|
344
372
|
userId?: string;
|
|
373
|
+
/** External GPS device uniqueId bound to this vehicle. */
|
|
374
|
+
trackerId?: string;
|
|
375
|
+
/** Latest known tracker position, as a GeoPoint for proximity queries. */
|
|
376
|
+
location?: GeoPoint;
|
|
377
|
+
/** Latest tracker fix with richer scalar fields (speed, course, …). */
|
|
378
|
+
position?: TrackerPosition;
|
|
345
379
|
};
|
|
346
380
|
type VehicleWithRider = Vehicle & {
|
|
347
381
|
riders: RiderWithUserDetails[];
|
|
@@ -1058,61 +1092,6 @@ interface VehicleLogStatsSummary {
|
|
|
1058
1092
|
}[];
|
|
1059
1093
|
}
|
|
1060
1094
|
|
|
1061
|
-
declare enum TraccarDeviceStatus {
|
|
1062
|
-
ONLINE = "online",
|
|
1063
|
-
OFFLINE = "offline",
|
|
1064
|
-
UNKNOWN = "unknown"
|
|
1065
|
-
}
|
|
1066
|
-
interface TraccarDevice {
|
|
1067
|
-
id: number;
|
|
1068
|
-
attributes: Record<string, any>;
|
|
1069
|
-
groupId: number;
|
|
1070
|
-
calendarId: number;
|
|
1071
|
-
name: string;
|
|
1072
|
-
uniqueId: string;
|
|
1073
|
-
status: TraccarDeviceStatus | `${TraccarDeviceStatus}`;
|
|
1074
|
-
lastUpdate: string | Date;
|
|
1075
|
-
positionId: number;
|
|
1076
|
-
phone: string | NullOrUndefined;
|
|
1077
|
-
model: string | NullOrUndefined;
|
|
1078
|
-
contact: string | NullOrUndefined;
|
|
1079
|
-
category: string | NullOrUndefined;
|
|
1080
|
-
disabled: boolean;
|
|
1081
|
-
expirationTime: string | Date | NullOrUndefined;
|
|
1082
|
-
}
|
|
1083
|
-
interface TraccarPosition {
|
|
1084
|
-
id: number;
|
|
1085
|
-
attributes: Record<string, any>;
|
|
1086
|
-
deviceId: number;
|
|
1087
|
-
protocol: string;
|
|
1088
|
-
serverTime: string | Date;
|
|
1089
|
-
deviceTime: string | Date;
|
|
1090
|
-
fixTime: string | Date;
|
|
1091
|
-
valid: boolean;
|
|
1092
|
-
latitude: number;
|
|
1093
|
-
longitude: number;
|
|
1094
|
-
altitude: number;
|
|
1095
|
-
speed: number;
|
|
1096
|
-
course: number;
|
|
1097
|
-
address: string | NullOrUndefined;
|
|
1098
|
-
accuracy: number;
|
|
1099
|
-
network: Record<string, any> | NullOrUndefined;
|
|
1100
|
-
geofenceIds: number[] | NullOrUndefined;
|
|
1101
|
-
}
|
|
1102
|
-
interface TrackerDevice {
|
|
1103
|
-
id: string;
|
|
1104
|
-
name: string;
|
|
1105
|
-
traccarDeviceId: number;
|
|
1106
|
-
uniqueId: string;
|
|
1107
|
-
slug: string;
|
|
1108
|
-
businessId?: string | NullOrUndefined;
|
|
1109
|
-
vehicleId?: string | NullOrUndefined;
|
|
1110
|
-
createdAt: string | Date;
|
|
1111
|
-
updatedAt: string | Date;
|
|
1112
|
-
traccarDetails?: TraccarDevice | NullOrUndefined;
|
|
1113
|
-
lastPosition?: TraccarPosition | NullOrUndefined;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
1095
|
/**
|
|
1117
1096
|
* Maintenance Item - catalog of parts/services used in maintenance
|
|
1118
1097
|
*/
|
|
@@ -1302,4 +1281,4 @@ declare enum LinkDestination {
|
|
|
1302
1281
|
}
|
|
1303
1282
|
type NullOrUndefined = null | undefined;
|
|
1304
1283
|
|
|
1305
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type
|
|
1284
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type GeoPoint, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -332,6 +332,34 @@ declare enum VehicleType {
|
|
|
332
332
|
Bike = "bike",
|
|
333
333
|
Shuttle = "shuttle"
|
|
334
334
|
}
|
|
335
|
+
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
336
|
+
type GeoPoint = {
|
|
337
|
+
type: 'Point';
|
|
338
|
+
coordinates: [number, number];
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* A trimmed-down Traccar position kept as the vehicle's latest fix. Carries the
|
|
342
|
+
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
343
|
+
* (moving vs. idle, heading), `recordedAt` gauges staleness.
|
|
344
|
+
*/
|
|
345
|
+
type TrackerPosition = {
|
|
346
|
+
latitude: number;
|
|
347
|
+
longitude: number;
|
|
348
|
+
speed?: number;
|
|
349
|
+
course?: number;
|
|
350
|
+
accuracy?: number;
|
|
351
|
+
valid?: boolean;
|
|
352
|
+
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
353
|
+
motion?: boolean;
|
|
354
|
+
/** Engine on/off, when the device reports it. */
|
|
355
|
+
ignition?: boolean;
|
|
356
|
+
/** ISO time the GPS computed the position — the truest "when". */
|
|
357
|
+
fixTime?: string;
|
|
358
|
+
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
359
|
+
deviceTime?: string;
|
|
360
|
+
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
361
|
+
serverTime?: string;
|
|
362
|
+
};
|
|
335
363
|
type Vehicle = {
|
|
336
364
|
id: string;
|
|
337
365
|
vehicleNumber: string;
|
|
@@ -342,6 +370,12 @@ type Vehicle = {
|
|
|
342
370
|
businessId: string;
|
|
343
371
|
shortName?: string;
|
|
344
372
|
userId?: string;
|
|
373
|
+
/** External GPS device uniqueId bound to this vehicle. */
|
|
374
|
+
trackerId?: string;
|
|
375
|
+
/** Latest known tracker position, as a GeoPoint for proximity queries. */
|
|
376
|
+
location?: GeoPoint;
|
|
377
|
+
/** Latest tracker fix with richer scalar fields (speed, course, …). */
|
|
378
|
+
position?: TrackerPosition;
|
|
345
379
|
};
|
|
346
380
|
type VehicleWithRider = Vehicle & {
|
|
347
381
|
riders: RiderWithUserDetails[];
|
|
@@ -1058,61 +1092,6 @@ interface VehicleLogStatsSummary {
|
|
|
1058
1092
|
}[];
|
|
1059
1093
|
}
|
|
1060
1094
|
|
|
1061
|
-
declare enum TraccarDeviceStatus {
|
|
1062
|
-
ONLINE = "online",
|
|
1063
|
-
OFFLINE = "offline",
|
|
1064
|
-
UNKNOWN = "unknown"
|
|
1065
|
-
}
|
|
1066
|
-
interface TraccarDevice {
|
|
1067
|
-
id: number;
|
|
1068
|
-
attributes: Record<string, any>;
|
|
1069
|
-
groupId: number;
|
|
1070
|
-
calendarId: number;
|
|
1071
|
-
name: string;
|
|
1072
|
-
uniqueId: string;
|
|
1073
|
-
status: TraccarDeviceStatus | `${TraccarDeviceStatus}`;
|
|
1074
|
-
lastUpdate: string | Date;
|
|
1075
|
-
positionId: number;
|
|
1076
|
-
phone: string | NullOrUndefined;
|
|
1077
|
-
model: string | NullOrUndefined;
|
|
1078
|
-
contact: string | NullOrUndefined;
|
|
1079
|
-
category: string | NullOrUndefined;
|
|
1080
|
-
disabled: boolean;
|
|
1081
|
-
expirationTime: string | Date | NullOrUndefined;
|
|
1082
|
-
}
|
|
1083
|
-
interface TraccarPosition {
|
|
1084
|
-
id: number;
|
|
1085
|
-
attributes: Record<string, any>;
|
|
1086
|
-
deviceId: number;
|
|
1087
|
-
protocol: string;
|
|
1088
|
-
serverTime: string | Date;
|
|
1089
|
-
deviceTime: string | Date;
|
|
1090
|
-
fixTime: string | Date;
|
|
1091
|
-
valid: boolean;
|
|
1092
|
-
latitude: number;
|
|
1093
|
-
longitude: number;
|
|
1094
|
-
altitude: number;
|
|
1095
|
-
speed: number;
|
|
1096
|
-
course: number;
|
|
1097
|
-
address: string | NullOrUndefined;
|
|
1098
|
-
accuracy: number;
|
|
1099
|
-
network: Record<string, any> | NullOrUndefined;
|
|
1100
|
-
geofenceIds: number[] | NullOrUndefined;
|
|
1101
|
-
}
|
|
1102
|
-
interface TrackerDevice {
|
|
1103
|
-
id: string;
|
|
1104
|
-
name: string;
|
|
1105
|
-
traccarDeviceId: number;
|
|
1106
|
-
uniqueId: string;
|
|
1107
|
-
slug: string;
|
|
1108
|
-
businessId?: string | NullOrUndefined;
|
|
1109
|
-
vehicleId?: string | NullOrUndefined;
|
|
1110
|
-
createdAt: string | Date;
|
|
1111
|
-
updatedAt: string | Date;
|
|
1112
|
-
traccarDetails?: TraccarDevice | NullOrUndefined;
|
|
1113
|
-
lastPosition?: TraccarPosition | NullOrUndefined;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
1095
|
/**
|
|
1117
1096
|
* Maintenance Item - catalog of parts/services used in maintenance
|
|
1118
1097
|
*/
|
|
@@ -1302,4 +1281,4 @@ declare enum LinkDestination {
|
|
|
1302
1281
|
}
|
|
1303
1282
|
type NullOrUndefined = null | undefined;
|
|
1304
1283
|
|
|
1305
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type
|
|
1284
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessMember, type BusinessModules, type BusinessPg, BusinessRole, type BusinessSettings, BusinessStatus, type BusinessWhatsappConfig, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DEFAULT_BUSINESS_MODULES, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type GeoPoint, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
package/dist/index.js
CHANGED
|
@@ -222,14 +222,6 @@ var BusinessCourierLinkStatus = /* @__PURE__ */ ((BusinessCourierLinkStatus2) =>
|
|
|
222
222
|
return BusinessCourierLinkStatus2;
|
|
223
223
|
})(BusinessCourierLinkStatus || {});
|
|
224
224
|
|
|
225
|
-
// src/tracker.ts
|
|
226
|
-
var TraccarDeviceStatus = /* @__PURE__ */ ((TraccarDeviceStatus2) => {
|
|
227
|
-
TraccarDeviceStatus2["ONLINE"] = "online";
|
|
228
|
-
TraccarDeviceStatus2["OFFLINE"] = "offline";
|
|
229
|
-
TraccarDeviceStatus2["UNKNOWN"] = "unknown";
|
|
230
|
-
return TraccarDeviceStatus2;
|
|
231
|
-
})(TraccarDeviceStatus || {});
|
|
232
|
-
|
|
233
225
|
// src/whatsapp.ts
|
|
234
226
|
var WhatsappEvent = /* @__PURE__ */ ((WhatsappEvent2) => {
|
|
235
227
|
WhatsappEvent2["ERRAND_CREATED"] = "errand.created";
|
|
@@ -309,7 +301,6 @@ export {
|
|
|
309
301
|
RemittanceStatus,
|
|
310
302
|
RoleType,
|
|
311
303
|
SettlementType,
|
|
312
|
-
TraccarDeviceStatus,
|
|
313
304
|
VehicleLogType,
|
|
314
305
|
VehicleType,
|
|
315
306
|
WhatsappButtonType,
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/vehicle.ts
CHANGED
|
@@ -5,6 +5,36 @@ export enum VehicleType {
|
|
|
5
5
|
Shuttle = 'shuttle',
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
9
|
+
export type GeoPoint = {
|
|
10
|
+
type: 'Point';
|
|
11
|
+
coordinates: [number, number];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A trimmed-down Traccar position kept as the vehicle's latest fix. Carries the
|
|
16
|
+
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
17
|
+
* (moving vs. idle, heading), `recordedAt` gauges staleness.
|
|
18
|
+
*/
|
|
19
|
+
export type TrackerPosition = {
|
|
20
|
+
latitude: number;
|
|
21
|
+
longitude: number;
|
|
22
|
+
speed?: number;
|
|
23
|
+
course?: number;
|
|
24
|
+
accuracy?: number;
|
|
25
|
+
valid?: boolean;
|
|
26
|
+
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
27
|
+
motion?: boolean;
|
|
28
|
+
/** Engine on/off, when the device reports it. */
|
|
29
|
+
ignition?: boolean;
|
|
30
|
+
/** ISO time the GPS computed the position — the truest "when". */
|
|
31
|
+
fixTime?: string;
|
|
32
|
+
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
33
|
+
deviceTime?: string;
|
|
34
|
+
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
35
|
+
serverTime?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
8
38
|
export type Vehicle = {
|
|
9
39
|
id: string;
|
|
10
40
|
vehicleNumber: string;
|
|
@@ -16,6 +46,12 @@ export type Vehicle = {
|
|
|
16
46
|
|
|
17
47
|
shortName?: string;
|
|
18
48
|
userId?: string;
|
|
49
|
+
/** External GPS device uniqueId bound to this vehicle. */
|
|
50
|
+
trackerId?: string;
|
|
51
|
+
/** Latest known tracker position, as a GeoPoint for proximity queries. */
|
|
52
|
+
location?: GeoPoint;
|
|
53
|
+
/** Latest tracker fix with richer scalar fields (speed, course, …). */
|
|
54
|
+
position?: TrackerPosition;
|
|
19
55
|
};
|
|
20
56
|
|
|
21
57
|
export type VehicleWithRider = Vehicle & {
|
package/src/tracker.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { NullOrUndefined } from '.';
|
|
2
|
-
|
|
3
|
-
export enum TraccarDeviceStatus {
|
|
4
|
-
ONLINE = 'online',
|
|
5
|
-
OFFLINE = 'offline',
|
|
6
|
-
UNKNOWN = 'unknown',
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface TraccarDevice {
|
|
10
|
-
id: number;
|
|
11
|
-
attributes: Record<string, any>;
|
|
12
|
-
groupId: number;
|
|
13
|
-
calendarId: number;
|
|
14
|
-
name: string;
|
|
15
|
-
uniqueId: string;
|
|
16
|
-
status: TraccarDeviceStatus | `${TraccarDeviceStatus}`;
|
|
17
|
-
lastUpdate: string | Date;
|
|
18
|
-
positionId: number;
|
|
19
|
-
phone: string | NullOrUndefined;
|
|
20
|
-
model: string | NullOrUndefined;
|
|
21
|
-
contact: string | NullOrUndefined;
|
|
22
|
-
category: string | NullOrUndefined;
|
|
23
|
-
disabled: boolean;
|
|
24
|
-
expirationTime: string | Date | NullOrUndefined;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface TraccarPosition {
|
|
28
|
-
id: number;
|
|
29
|
-
attributes: Record<string, any>;
|
|
30
|
-
deviceId: number;
|
|
31
|
-
protocol: string;
|
|
32
|
-
serverTime: string | Date;
|
|
33
|
-
deviceTime: string | Date;
|
|
34
|
-
fixTime: string | Date;
|
|
35
|
-
valid: boolean;
|
|
36
|
-
latitude: number;
|
|
37
|
-
longitude: number;
|
|
38
|
-
altitude: number;
|
|
39
|
-
speed: number;
|
|
40
|
-
course: number;
|
|
41
|
-
address: string | NullOrUndefined;
|
|
42
|
-
accuracy: number;
|
|
43
|
-
network: Record<string, any> | NullOrUndefined;
|
|
44
|
-
geofenceIds: number[] | NullOrUndefined;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface TrackerDevice {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
traccarDeviceId: number;
|
|
51
|
-
uniqueId: string;
|
|
52
|
-
slug: string;
|
|
53
|
-
businessId?: string | NullOrUndefined;
|
|
54
|
-
vehicleId?: string | NullOrUndefined;
|
|
55
|
-
createdAt: string | Date;
|
|
56
|
-
updatedAt: string | Date;
|
|
57
|
-
traccarDetails?: TraccarDevice | NullOrUndefined;
|
|
58
|
-
lastPosition?: TraccarPosition | NullOrUndefined;
|
|
59
|
-
}
|