@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.
@@ -1,18 +1,18 @@
1
-
2
- > @mydoormot/app-types@1.7.39 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
3
- > tsup src/index.ts --format esm,cjs --dts
4
-
5
- CLI Building entry: src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v7.3.0
8
- CLI Target: es2021
9
- ESM Build start
10
- CJS Build start
11
- ESM dist/index.js 11.04 KB
12
- ESM ⚡️ Build success in 150ms
13
- CJS dist/index.cjs 13.41 KB
14
- CJS ⚡️ Build success in 159ms
15
- DTS Build start
16
- DTS ⚡️ Build success in 708ms
17
- DTS dist/index.d.ts 33.90 KB
18
- DTS dist/index.d.cts 33.90 KB
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
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v7.3.0
8
+ CLI Target: es2021
9
+ ESM Build start
10
+ CJS Build start
11
+ ESM dist/index.js 11.08 KB
12
+ ESM ⚡️ Build success in 59ms
13
+ CJS dist/index.cjs 13.45 KB
14
+ CJS ⚡️ Build success in 58ms
15
+ DTS Build start
16
+ DTS ⚡️ Build success in 618ms
17
+ DTS dist/index.d.ts 34.32 KB
18
+ DTS dist/index.d.cts 34.32 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 1.7.42
4
+
5
+ ### Patch Changes
6
+
7
+ - Added traccar position nested schema
8
+
9
+ ## 1.7.41
10
+
11
+ ### Patch Changes
12
+
13
+ - Added in business couirer links
14
+
3
15
  ## 1.7.40
4
16
 
5
17
  ### Patch Changes
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
- // src/tracker.ts
278
- var TraccarDeviceStatus = /* @__PURE__ */ ((TraccarDeviceStatus2) => {
279
- TraccarDeviceStatus2["ONLINE"] = "online";
280
- TraccarDeviceStatus2["OFFLINE"] = "offline";
281
- TraccarDeviceStatus2["UNKNOWN"] = "unknown";
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 TraccarDevice, TraccarDeviceStatus, type TraccarPosition, type TrackerDevice, 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 };
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 TraccarDevice, TraccarDeviceStatus, type TraccarPosition, type TrackerDevice, 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 };
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
- // src/tracker.ts
220
- var TraccarDeviceStatus = /* @__PURE__ */ ((TraccarDeviceStatus2) => {
221
- TraccarDeviceStatus2["ONLINE"] = "online";
222
- TraccarDeviceStatus2["OFFLINE"] = "offline";
223
- TraccarDeviceStatus2["UNKNOWN"] = "unknown";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "1.7.40",
3
+ "version": "1.7.42",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
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
@@ -36,6 +36,5 @@ export * from './commerce';
36
36
  export * from './customer';
37
37
  export * from './transaction';
38
38
  export * from './stat';
39
- export * from './tracker';
40
39
  export * from './maintenance';
41
40
  export * from './whatsapp';
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
- }