@mydoormot/app-types 1.7.40 → 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 +12 -0
- package/dist/index.cjs +8 -10
- package/dist/index.d.cts +54 -56
- package/dist/index.d.ts +54 -56
- package/dist/index.js +7 -9
- package/package.json +1 -1
- package/src/business.ts +23 -0
- 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
|
@@ -23,6 +23,7 @@ __export(src_exports, {
|
|
|
23
23
|
AddressTypes: () => AddressTypes,
|
|
24
24
|
AuthType: () => AuthType,
|
|
25
25
|
BusinessCapability: () => BusinessCapability,
|
|
26
|
+
BusinessCourierLinkStatus: () => BusinessCourierLinkStatus,
|
|
26
27
|
BusinessRole: () => BusinessRole,
|
|
27
28
|
BusinessStatus: () => BusinessStatus,
|
|
28
29
|
DEFAULT_BUSINESS_MODULES: () => DEFAULT_BUSINESS_MODULES,
|
|
@@ -43,7 +44,6 @@ __export(src_exports, {
|
|
|
43
44
|
RemittanceStatus: () => RemittanceStatus,
|
|
44
45
|
RoleType: () => RoleType,
|
|
45
46
|
SettlementType: () => SettlementType,
|
|
46
|
-
TraccarDeviceStatus: () => TraccarDeviceStatus,
|
|
47
47
|
VehicleLogType: () => VehicleLogType,
|
|
48
48
|
VehicleType: () => VehicleType,
|
|
49
49
|
WhatsappButtonType: () => WhatsappButtonType,
|
|
@@ -273,14 +273,12 @@ var DEFAULT_BUSINESS_SETTINGS = {
|
|
|
273
273
|
},
|
|
274
274
|
modules: DEFAULT_BUSINESS_MODULES
|
|
275
275
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return TraccarDeviceStatus2;
|
|
283
|
-
})(TraccarDeviceStatus || {});
|
|
276
|
+
var BusinessCourierLinkStatus = /* @__PURE__ */ ((BusinessCourierLinkStatus2) => {
|
|
277
|
+
BusinessCourierLinkStatus2["ACTIVE"] = "active";
|
|
278
|
+
BusinessCourierLinkStatus2["SUSPENDED"] = "suspended";
|
|
279
|
+
BusinessCourierLinkStatus2["REVOKED"] = "revoked";
|
|
280
|
+
return BusinessCourierLinkStatus2;
|
|
281
|
+
})(BusinessCourierLinkStatus || {});
|
|
284
282
|
|
|
285
283
|
// src/whatsapp.ts
|
|
286
284
|
var WhatsappEvent = /* @__PURE__ */ ((WhatsappEvent2) => {
|
|
@@ -341,6 +339,7 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
|
341
339
|
AddressTypes,
|
|
342
340
|
AuthType,
|
|
343
341
|
BusinessCapability,
|
|
342
|
+
BusinessCourierLinkStatus,
|
|
344
343
|
BusinessRole,
|
|
345
344
|
BusinessStatus,
|
|
346
345
|
DEFAULT_BUSINESS_MODULES,
|
|
@@ -361,7 +360,6 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
|
361
360
|
RemittanceStatus,
|
|
362
361
|
RoleType,
|
|
363
362
|
SettlementType,
|
|
364
|
-
TraccarDeviceStatus,
|
|
365
363
|
VehicleLogType,
|
|
366
364
|
VehicleType,
|
|
367
365
|
WhatsappButtonType,
|
package/dist/index.d.cts
CHANGED
|
@@ -308,11 +308,58 @@ interface BusinessMember {
|
|
|
308
308
|
createdAt: string;
|
|
309
309
|
updatedAt: string | NullOrUndefined;
|
|
310
310
|
}
|
|
311
|
+
declare enum BusinessCourierLinkStatus {
|
|
312
|
+
ACTIVE = "active",
|
|
313
|
+
SUSPENDED = "suspended",
|
|
314
|
+
REVOKED = "revoked"
|
|
315
|
+
}
|
|
316
|
+
interface BusinessCourierLink {
|
|
317
|
+
id: string;
|
|
318
|
+
fromBusinessId: string;
|
|
319
|
+
toBusinessId: string;
|
|
320
|
+
status: BusinessCourierLinkStatus | `${BusinessCourierLinkStatus}`;
|
|
321
|
+
createdBy: string | NullOrUndefined;
|
|
322
|
+
revokedAt: string | NullOrUndefined;
|
|
323
|
+
revokedBy: string | NullOrUndefined;
|
|
324
|
+
revokeReason: string | NullOrUndefined;
|
|
325
|
+
createdAt: string;
|
|
326
|
+
updatedAt: string | NullOrUndefined;
|
|
327
|
+
fromBusinessDetails: Business | NullOrUndefined;
|
|
328
|
+
toBusinessDetails: Business | NullOrUndefined;
|
|
329
|
+
}
|
|
311
330
|
|
|
312
331
|
declare enum VehicleType {
|
|
313
332
|
Bike = "bike",
|
|
314
333
|
Shuttle = "shuttle"
|
|
315
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
|
+
};
|
|
316
363
|
type Vehicle = {
|
|
317
364
|
id: string;
|
|
318
365
|
vehicleNumber: string;
|
|
@@ -323,6 +370,12 @@ type Vehicle = {
|
|
|
323
370
|
businessId: string;
|
|
324
371
|
shortName?: string;
|
|
325
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;
|
|
326
379
|
};
|
|
327
380
|
type VehicleWithRider = Vehicle & {
|
|
328
381
|
riders: RiderWithUserDetails[];
|
|
@@ -1039,61 +1092,6 @@ interface VehicleLogStatsSummary {
|
|
|
1039
1092
|
}[];
|
|
1040
1093
|
}
|
|
1041
1094
|
|
|
1042
|
-
declare enum TraccarDeviceStatus {
|
|
1043
|
-
ONLINE = "online",
|
|
1044
|
-
OFFLINE = "offline",
|
|
1045
|
-
UNKNOWN = "unknown"
|
|
1046
|
-
}
|
|
1047
|
-
interface TraccarDevice {
|
|
1048
|
-
id: number;
|
|
1049
|
-
attributes: Record<string, any>;
|
|
1050
|
-
groupId: number;
|
|
1051
|
-
calendarId: number;
|
|
1052
|
-
name: string;
|
|
1053
|
-
uniqueId: string;
|
|
1054
|
-
status: TraccarDeviceStatus | `${TraccarDeviceStatus}`;
|
|
1055
|
-
lastUpdate: string | Date;
|
|
1056
|
-
positionId: number;
|
|
1057
|
-
phone: string | NullOrUndefined;
|
|
1058
|
-
model: string | NullOrUndefined;
|
|
1059
|
-
contact: string | NullOrUndefined;
|
|
1060
|
-
category: string | NullOrUndefined;
|
|
1061
|
-
disabled: boolean;
|
|
1062
|
-
expirationTime: string | Date | NullOrUndefined;
|
|
1063
|
-
}
|
|
1064
|
-
interface TraccarPosition {
|
|
1065
|
-
id: number;
|
|
1066
|
-
attributes: Record<string, any>;
|
|
1067
|
-
deviceId: number;
|
|
1068
|
-
protocol: string;
|
|
1069
|
-
serverTime: string | Date;
|
|
1070
|
-
deviceTime: string | Date;
|
|
1071
|
-
fixTime: string | Date;
|
|
1072
|
-
valid: boolean;
|
|
1073
|
-
latitude: number;
|
|
1074
|
-
longitude: number;
|
|
1075
|
-
altitude: number;
|
|
1076
|
-
speed: number;
|
|
1077
|
-
course: number;
|
|
1078
|
-
address: string | NullOrUndefined;
|
|
1079
|
-
accuracy: number;
|
|
1080
|
-
network: Record<string, any> | NullOrUndefined;
|
|
1081
|
-
geofenceIds: number[] | NullOrUndefined;
|
|
1082
|
-
}
|
|
1083
|
-
interface TrackerDevice {
|
|
1084
|
-
id: string;
|
|
1085
|
-
name: string;
|
|
1086
|
-
traccarDeviceId: number;
|
|
1087
|
-
uniqueId: string;
|
|
1088
|
-
slug: string;
|
|
1089
|
-
businessId?: string | NullOrUndefined;
|
|
1090
|
-
vehicleId?: string | NullOrUndefined;
|
|
1091
|
-
createdAt: string | Date;
|
|
1092
|
-
updatedAt: string | Date;
|
|
1093
|
-
traccarDetails?: TraccarDevice | NullOrUndefined;
|
|
1094
|
-
lastPosition?: TraccarPosition | NullOrUndefined;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
1095
|
/**
|
|
1098
1096
|
* Maintenance Item - catalog of parts/services used in maintenance
|
|
1099
1097
|
*/
|
|
@@ -1283,4 +1281,4 @@ declare enum LinkDestination {
|
|
|
1283
1281
|
}
|
|
1284
1282
|
type NullOrUndefined = null | undefined;
|
|
1285
1283
|
|
|
1286
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, 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
|
@@ -308,11 +308,58 @@ interface BusinessMember {
|
|
|
308
308
|
createdAt: string;
|
|
309
309
|
updatedAt: string | NullOrUndefined;
|
|
310
310
|
}
|
|
311
|
+
declare enum BusinessCourierLinkStatus {
|
|
312
|
+
ACTIVE = "active",
|
|
313
|
+
SUSPENDED = "suspended",
|
|
314
|
+
REVOKED = "revoked"
|
|
315
|
+
}
|
|
316
|
+
interface BusinessCourierLink {
|
|
317
|
+
id: string;
|
|
318
|
+
fromBusinessId: string;
|
|
319
|
+
toBusinessId: string;
|
|
320
|
+
status: BusinessCourierLinkStatus | `${BusinessCourierLinkStatus}`;
|
|
321
|
+
createdBy: string | NullOrUndefined;
|
|
322
|
+
revokedAt: string | NullOrUndefined;
|
|
323
|
+
revokedBy: string | NullOrUndefined;
|
|
324
|
+
revokeReason: string | NullOrUndefined;
|
|
325
|
+
createdAt: string;
|
|
326
|
+
updatedAt: string | NullOrUndefined;
|
|
327
|
+
fromBusinessDetails: Business | NullOrUndefined;
|
|
328
|
+
toBusinessDetails: Business | NullOrUndefined;
|
|
329
|
+
}
|
|
311
330
|
|
|
312
331
|
declare enum VehicleType {
|
|
313
332
|
Bike = "bike",
|
|
314
333
|
Shuttle = "shuttle"
|
|
315
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
|
+
};
|
|
316
363
|
type Vehicle = {
|
|
317
364
|
id: string;
|
|
318
365
|
vehicleNumber: string;
|
|
@@ -323,6 +370,12 @@ type Vehicle = {
|
|
|
323
370
|
businessId: string;
|
|
324
371
|
shortName?: string;
|
|
325
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;
|
|
326
379
|
};
|
|
327
380
|
type VehicleWithRider = Vehicle & {
|
|
328
381
|
riders: RiderWithUserDetails[];
|
|
@@ -1039,61 +1092,6 @@ interface VehicleLogStatsSummary {
|
|
|
1039
1092
|
}[];
|
|
1040
1093
|
}
|
|
1041
1094
|
|
|
1042
|
-
declare enum TraccarDeviceStatus {
|
|
1043
|
-
ONLINE = "online",
|
|
1044
|
-
OFFLINE = "offline",
|
|
1045
|
-
UNKNOWN = "unknown"
|
|
1046
|
-
}
|
|
1047
|
-
interface TraccarDevice {
|
|
1048
|
-
id: number;
|
|
1049
|
-
attributes: Record<string, any>;
|
|
1050
|
-
groupId: number;
|
|
1051
|
-
calendarId: number;
|
|
1052
|
-
name: string;
|
|
1053
|
-
uniqueId: string;
|
|
1054
|
-
status: TraccarDeviceStatus | `${TraccarDeviceStatus}`;
|
|
1055
|
-
lastUpdate: string | Date;
|
|
1056
|
-
positionId: number;
|
|
1057
|
-
phone: string | NullOrUndefined;
|
|
1058
|
-
model: string | NullOrUndefined;
|
|
1059
|
-
contact: string | NullOrUndefined;
|
|
1060
|
-
category: string | NullOrUndefined;
|
|
1061
|
-
disabled: boolean;
|
|
1062
|
-
expirationTime: string | Date | NullOrUndefined;
|
|
1063
|
-
}
|
|
1064
|
-
interface TraccarPosition {
|
|
1065
|
-
id: number;
|
|
1066
|
-
attributes: Record<string, any>;
|
|
1067
|
-
deviceId: number;
|
|
1068
|
-
protocol: string;
|
|
1069
|
-
serverTime: string | Date;
|
|
1070
|
-
deviceTime: string | Date;
|
|
1071
|
-
fixTime: string | Date;
|
|
1072
|
-
valid: boolean;
|
|
1073
|
-
latitude: number;
|
|
1074
|
-
longitude: number;
|
|
1075
|
-
altitude: number;
|
|
1076
|
-
speed: number;
|
|
1077
|
-
course: number;
|
|
1078
|
-
address: string | NullOrUndefined;
|
|
1079
|
-
accuracy: number;
|
|
1080
|
-
network: Record<string, any> | NullOrUndefined;
|
|
1081
|
-
geofenceIds: number[] | NullOrUndefined;
|
|
1082
|
-
}
|
|
1083
|
-
interface TrackerDevice {
|
|
1084
|
-
id: string;
|
|
1085
|
-
name: string;
|
|
1086
|
-
traccarDeviceId: number;
|
|
1087
|
-
uniqueId: string;
|
|
1088
|
-
slug: string;
|
|
1089
|
-
businessId?: string | NullOrUndefined;
|
|
1090
|
-
vehicleId?: string | NullOrUndefined;
|
|
1091
|
-
createdAt: string | Date;
|
|
1092
|
-
updatedAt: string | Date;
|
|
1093
|
-
traccarDetails?: TraccarDevice | NullOrUndefined;
|
|
1094
|
-
lastPosition?: TraccarPosition | NullOrUndefined;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
1095
|
/**
|
|
1098
1096
|
* Maintenance Item - catalog of parts/services used in maintenance
|
|
1099
1097
|
*/
|
|
@@ -1283,4 +1281,4 @@ declare enum LinkDestination {
|
|
|
1283
1281
|
}
|
|
1284
1282
|
type NullOrUndefined = null | undefined;
|
|
1285
1283
|
|
|
1286
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, 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
|
@@ -215,14 +215,12 @@ var DEFAULT_BUSINESS_SETTINGS = {
|
|
|
215
215
|
},
|
|
216
216
|
modules: DEFAULT_BUSINESS_MODULES
|
|
217
217
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return TraccarDeviceStatus2;
|
|
225
|
-
})(TraccarDeviceStatus || {});
|
|
218
|
+
var BusinessCourierLinkStatus = /* @__PURE__ */ ((BusinessCourierLinkStatus2) => {
|
|
219
|
+
BusinessCourierLinkStatus2["ACTIVE"] = "active";
|
|
220
|
+
BusinessCourierLinkStatus2["SUSPENDED"] = "suspended";
|
|
221
|
+
BusinessCourierLinkStatus2["REVOKED"] = "revoked";
|
|
222
|
+
return BusinessCourierLinkStatus2;
|
|
223
|
+
})(BusinessCourierLinkStatus || {});
|
|
226
224
|
|
|
227
225
|
// src/whatsapp.ts
|
|
228
226
|
var WhatsappEvent = /* @__PURE__ */ ((WhatsappEvent2) => {
|
|
@@ -282,6 +280,7 @@ export {
|
|
|
282
280
|
AddressTypes,
|
|
283
281
|
AuthType,
|
|
284
282
|
BusinessCapability,
|
|
283
|
+
BusinessCourierLinkStatus,
|
|
285
284
|
BusinessRole,
|
|
286
285
|
BusinessStatus,
|
|
287
286
|
DEFAULT_BUSINESS_MODULES,
|
|
@@ -302,7 +301,6 @@ export {
|
|
|
302
301
|
RemittanceStatus,
|
|
303
302
|
RoleType,
|
|
304
303
|
SettlementType,
|
|
305
|
-
TraccarDeviceStatus,
|
|
306
304
|
VehicleLogType,
|
|
307
305
|
VehicleType,
|
|
308
306
|
WhatsappButtonType,
|
package/package.json
CHANGED
package/src/business.ts
CHANGED
|
@@ -182,3 +182,26 @@ export interface BusinessMember {
|
|
|
182
182
|
createdAt: string;
|
|
183
183
|
updatedAt: string | NullOrUndefined;
|
|
184
184
|
}
|
|
185
|
+
|
|
186
|
+
export enum BusinessCourierLinkStatus {
|
|
187
|
+
ACTIVE = 'active',
|
|
188
|
+
SUSPENDED = 'suspended',
|
|
189
|
+
REVOKED = 'revoked',
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface BusinessCourierLink {
|
|
193
|
+
id: string;
|
|
194
|
+
fromBusinessId: string;
|
|
195
|
+
toBusinessId: string;
|
|
196
|
+
status: BusinessCourierLinkStatus | `${BusinessCourierLinkStatus}`;
|
|
197
|
+
createdBy: string | NullOrUndefined;
|
|
198
|
+
revokedAt: string | NullOrUndefined;
|
|
199
|
+
revokedBy: string | NullOrUndefined;
|
|
200
|
+
revokeReason: string | NullOrUndefined;
|
|
201
|
+
createdAt: string;
|
|
202
|
+
updatedAt: string | NullOrUndefined;
|
|
203
|
+
|
|
204
|
+
// Populated via Mongoose virtuals — present when the API populates them.
|
|
205
|
+
fromBusinessDetails: Business | NullOrUndefined;
|
|
206
|
+
toBusinessDetails: Business | NullOrUndefined;
|
|
207
|
+
}
|
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
|
-
}
|