@spytecgps/nova-orm 0.0.82 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/index.d.ts +2 -1
- package/dist/entities/latestPosition.d.ts +19 -0
- package/dist/index.js +1 -1
- package/dist/repositories/positions/createPosition.d.ts +1 -2
- package/dist/repositories/positions/getLatestPositionByImei.d.ts +5 -0
- package/dist/repositories/positions/index.d.ts +11 -6
- package/dist/repositories/positions/upsertLatestPosition.d.ts +3 -0
- package/dist/types/alert.d.ts +1 -1
- package/dist/types/position.d.ts +12 -1
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { InsertResult } from 'typeorm';
|
|
2
1
|
import { Position } from '../../entities';
|
|
3
2
|
import { NovaDataSource } from '../../novaDataSource';
|
|
4
3
|
import { Logger } from '../../types/logger';
|
|
5
4
|
import { CreatePositionParams } from '../../types/position';
|
|
6
5
|
export declare const createPosition: (novaDataSource: NovaDataSource, params: CreatePositionParams, logger: Logger) => Promise<Position>;
|
|
7
|
-
export declare const upsertPositions: (novaDataSource: NovaDataSource, params: CreatePositionParams[], logger: Logger) => Promise<
|
|
6
|
+
export declare const upsertPositions: (novaDataSource: NovaDataSource, params: CreatePositionParams[], logger: Logger) => Promise<Position[]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LatestPosition } from '../../entities';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
import { GetLatestPositionByImeiParams } from '../../types/position';
|
|
5
|
+
export declare const getLatestPositionByImei: (novaDataSource: NovaDataSource, params: GetLatestPositionByImeiParams, logger: Logger) => Promise<LatestPosition>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CreatePositionParams, GetPositionsByImeiParams, GetPositionsReportByClientParams, PositionReport } from '../../types/position';
|
|
1
|
+
import { LatestPosition, Position } from '../../entities';
|
|
2
|
+
import { CreatePositionParams, GetLatestPositionByImeiParams, GetPositionsByImeiParams, GetPositionsReportByClientParams, PositionReport } from '../../types/position';
|
|
4
3
|
import { BaseRepository } from '../baseRepository';
|
|
5
4
|
export declare class PositionRepository extends BaseRepository {
|
|
6
5
|
/**
|
|
@@ -39,8 +38,9 @@ export declare class PositionRepository extends BaseRepository {
|
|
|
39
38
|
* - sendTime: the time the message was sent
|
|
40
39
|
* - gpsUtcTime: the time the gps was set
|
|
41
40
|
* - externalBatteryPercentage: the external battery percentage reported by the device
|
|
41
|
+
* @returns {Position[]} the created positions
|
|
42
42
|
*/
|
|
43
|
-
upsertPositions(params: CreatePositionParams[]): Promise<
|
|
43
|
+
upsertPositions(params: CreatePositionParams[]): Promise<Position[]>;
|
|
44
44
|
/**
|
|
45
45
|
* Get positions by imei
|
|
46
46
|
* @param {GetPositionsByImeiParams} params containing information to get positions
|
|
@@ -56,8 +56,13 @@ export declare class PositionRepository extends BaseRepository {
|
|
|
56
56
|
* - filters.actualDateTo: filters by actual date to to get positions
|
|
57
57
|
* - filters.speedMin: filters by speed min to get positions
|
|
58
58
|
* - filters.speedMax: filters by speed max to get positions
|
|
59
|
-
* -
|
|
60
|
-
* -
|
|
59
|
+
* - filters.odometerMin: filters by odometer min to get positions
|
|
60
|
+
* - filters.odometerMax: filters by odometer max to get positions
|
|
61
|
+
* - pagingOptions.pageSize: the page size
|
|
62
|
+
* - pagingOptions.pageIndex: the page index
|
|
63
|
+
* - sortOptions.sortField: the sort field
|
|
64
|
+
* - sortOptions.sortOrder: the sort order
|
|
61
65
|
*/
|
|
62
66
|
getPositionsReportByClient(params: GetPositionsReportByClientParams): Promise<PositionReport[]>;
|
|
67
|
+
getLatestPositionByImei(params: GetLatestPositionByImeiParams): Promise<LatestPosition>;
|
|
63
68
|
}
|
package/dist/types/alert.d.ts
CHANGED
package/dist/types/position.d.ts
CHANGED
|
@@ -29,10 +29,16 @@ export interface GetPositionsReportByClientParams {
|
|
|
29
29
|
actualDateTo?: Date | null;
|
|
30
30
|
speedMin?: number | null;
|
|
31
31
|
speedMax?: number | null;
|
|
32
|
+
odometerMin?: number | null;
|
|
33
|
+
odometerMax?: number | null;
|
|
32
34
|
};
|
|
33
35
|
pagingOptions: {
|
|
34
36
|
pageSize: number | 25;
|
|
35
|
-
pageIndex: number |
|
|
37
|
+
pageIndex: number | 0;
|
|
38
|
+
};
|
|
39
|
+
sortOptions?: {
|
|
40
|
+
sortField: string;
|
|
41
|
+
sortOrder: 'ASC' | 'DESC';
|
|
36
42
|
};
|
|
37
43
|
}
|
|
38
44
|
export interface PositionReport {
|
|
@@ -49,3 +55,8 @@ export interface PositionReport {
|
|
|
49
55
|
externalBatteryPercentage: number;
|
|
50
56
|
totalCount: number;
|
|
51
57
|
}
|
|
58
|
+
export interface GetLatestPositionByImeiParams {
|
|
59
|
+
filters: {
|
|
60
|
+
imei: string;
|
|
61
|
+
};
|
|
62
|
+
}
|