@spytecgps/nova-orm 0.0.16 → 0.0.18
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/alert.d.ts +0 -1
- package/dist/entities/device.d.ts +2 -1
- package/dist/entities/deviceBehavior.d.ts +2 -0
- package/dist/entities/deviceTypeFirmware.d.ts +1 -0
- package/dist/entities/position.d.ts +1 -0
- package/dist/entities/user.d.ts +2 -0
- package/dist/entities/userAlertConfiguration.d.ts +4 -3
- package/dist/entities/userConfiguration.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/repositories/boundaries/createBoundary.d.ts +5 -0
- package/dist/repositories/boundaries/deleteBoundary.d.ts +4 -0
- package/dist/repositories/boundaries/getBoundariesByClientId.d.ts +5 -0
- package/dist/repositories/boundaries/getBoundariesIdsByClientId.d.ts +4 -0
- package/dist/repositories/boundaries/getBoundaryById.d.ts +5 -0
- package/dist/repositories/boundaries/index.d.ts +67 -0
- package/dist/repositories/boundaries/updateBoundary.d.ts +4 -0
- package/dist/repositories/index.d.ts +2 -1
- package/dist/types/boundaries.d.ts +56 -0
- package/dist/types/enums.d.ts +5 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/uuidHelpers.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Geofence } from '../../entities';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { CreateBoundaryParams } from '../../types/boundaries';
|
|
4
|
+
import { Logger } from '../../types/logger';
|
|
5
|
+
export declare const createBoundary: (novaDataSource: NovaDataSource, params: CreateBoundaryParams, logger: Logger) => Promise<Geofence>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { DeleteBoundaryParams } from '../../types/boundaries';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
export declare const deleteBoundary: (novaDataSource: NovaDataSource, params: DeleteBoundaryParams, logger: Logger) => Promise<boolean>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Geofence } from '../../entities';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { GetBoundariesByClientIdParams } from '../../types/boundaries';
|
|
4
|
+
import { Logger } from '../../types/logger';
|
|
5
|
+
export declare const getBoundariesByClientId: (novaDataSource: NovaDataSource, params: GetBoundariesByClientIdParams, logger: Logger) => Promise<Geofence[]>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { GetBoundariesByClientIdParams } from '../../types/boundaries';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
export declare const getBoundariesIdsByClientId: (novaDataSource: NovaDataSource, params: GetBoundariesByClientIdParams, logger: Logger) => Promise<number[]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Geofence } from '../../entities';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { GetBoundaryByIdParams } from '../../types/boundaries';
|
|
4
|
+
import { Logger } from '../../types/logger';
|
|
5
|
+
export declare const getBoundaryById: (novaDataSource: NovaDataSource, params: GetBoundaryByIdParams, logger: Logger) => Promise<Geofence>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Geofence } from '../../entities';
|
|
2
|
+
import { CreateBoundaryParams, DeleteBoundaryParams, GetBoundariesByClientIdParams, GetBoundaryByIdParams, UpdateBoundaryParams } from '../../types/boundaries';
|
|
3
|
+
import { BaseRepository } from '../baseRepository';
|
|
4
|
+
export declare class BoundariesRepository extends BaseRepository {
|
|
5
|
+
/**
|
|
6
|
+
* Get all boundaries by client id
|
|
7
|
+
* @param {GetBoundariesByClientIdParams} params containing information to get boundaries by clientId
|
|
8
|
+
* - filters.clientId: The client id
|
|
9
|
+
* - filters.status: The status to only obtain boundaries with that status, optional
|
|
10
|
+
*/
|
|
11
|
+
getBoundariesByClientId(params: GetBoundariesByClientIdParams): Promise<Geofence[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Get all boundaries ids by client id
|
|
14
|
+
* @param {GetBoundariesByClientIdParams} params containing information to get boundaries ids by clientId
|
|
15
|
+
* - filters.clientId: The client id
|
|
16
|
+
* - filters.status: The status to only obtain boundaries with that status, optional
|
|
17
|
+
*/
|
|
18
|
+
getBoundariesIdsByClientId(params: GetBoundariesByClientIdParams): Promise<number[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a boundary by id
|
|
21
|
+
* @param {GetBoundaryByIdParams} params containing information to get a boundary by id
|
|
22
|
+
* - filters.boundaryId: The boundary id
|
|
23
|
+
*/
|
|
24
|
+
getBoundaryById(params: GetBoundaryByIdParams): Promise<Geofence>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a boundary
|
|
27
|
+
* @param {CreateBoundaryParams} params containing information to create a boundary
|
|
28
|
+
* - name: boundary name
|
|
29
|
+
* - type: boundary type
|
|
30
|
+
* - clientId: id of the client that owns the boundary
|
|
31
|
+
* - createdBy: id of the user that created the boundary
|
|
32
|
+
* - location: location of the boundary
|
|
33
|
+
* - buffer: buffer of the boundary
|
|
34
|
+
* - radiusDisplayUnit: radius display unit of the boundary
|
|
35
|
+
* - color: color of the boundary
|
|
36
|
+
* - geometry: geometry of the boundary
|
|
37
|
+
* - status: status of the boundary
|
|
38
|
+
* - dataSourceTypeId: data source type id of the boundary, optional
|
|
39
|
+
* - isUserCreated: if the boundary was created by a user, optional
|
|
40
|
+
* - area: area of the boundary, optional
|
|
41
|
+
*/
|
|
42
|
+
createBoundary(params: CreateBoundaryParams): Promise<Geofence>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a boundary
|
|
45
|
+
* @param {UpdateBoundaryParams} params containing information to update a boundary
|
|
46
|
+
* - filters.boundaryId: The id of the boundary to update
|
|
47
|
+
* - values.name: The name of the boundary. Optional, if undefined, the name will not be updated.
|
|
48
|
+
* - values.type: The type of the boundary. Optional, if undefined, the type will not be updated.
|
|
49
|
+
* - values.modifiedBy: The user id of the user that modified the boundary. Optional, if undefined, the modifiedBy will not be updated.
|
|
50
|
+
* - values.location: The location of the boundary. Optional, if undefined, the location will not be updated.
|
|
51
|
+
* - values.geometry: The geometry of the boundary. Optional, if undefined, the geometry will not be updated.
|
|
52
|
+
* - values.status: The status of the boundary. Optional, if undefined, the status will not be updated.
|
|
53
|
+
* - values.buffer: The buffer of the boundary. Optional, if undefined, the buffer will not be updated.
|
|
54
|
+
* - values.radiusDisplayUnit: The radius display unit of the boundary. Optional, if undefined, the radius display unit will not be updated.
|
|
55
|
+
* - values.color: The color of the boundary. Optional, if undefined, the color will not be updated.
|
|
56
|
+
* - values.area: The area of the boundary. Optional, if undefined, the area will not be updated.
|
|
57
|
+
*/
|
|
58
|
+
updateBoundary(params: UpdateBoundaryParams): Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete a boundary
|
|
61
|
+
* @param {DeleteBoundaryParams} params containing information to delete a boundary
|
|
62
|
+
* The boundary will not be removed from the database, it will only be marked as deleted
|
|
63
|
+
* - filters.boundaryId: The id of the boundary to delete
|
|
64
|
+
* - values.modifiedBy: The user id of the user that deleted the boundary
|
|
65
|
+
*/
|
|
66
|
+
deleteBoundary(params: DeleteBoundaryParams): Promise<boolean>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { UpdateBoundaryParams } from '../../types/boundaries';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
export declare const updateBoundary: (novaDataSource: NovaDataSource, params: UpdateBoundaryParams, logger: Logger) => Promise<boolean>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BoundariesRepository } from './boundaries';
|
|
1
2
|
import { DevicesRepository } from './devices';
|
|
2
3
|
import { SecurityRepository } from './security';
|
|
3
|
-
export { SecurityRepository, DevicesRepository };
|
|
4
|
+
export { SecurityRepository, DevicesRepository, BoundariesRepository };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BoundaryStatus } from './enums';
|
|
2
|
+
export interface GetBoundariesByClientIdParams {
|
|
3
|
+
filters: {
|
|
4
|
+
clientId: number;
|
|
5
|
+
status?: BoundaryStatus;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface GetBoundaryByIdParams {
|
|
9
|
+
filters: {
|
|
10
|
+
boundaryId: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface CreateBoundaryParams {
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
clientId: number;
|
|
17
|
+
createdBy: string;
|
|
18
|
+
location: string;
|
|
19
|
+
buffer: string;
|
|
20
|
+
radiusDisplayUnit: string;
|
|
21
|
+
color: string;
|
|
22
|
+
geometry: string;
|
|
23
|
+
status: BoundaryStatus;
|
|
24
|
+
dataSourceTypeId?: number;
|
|
25
|
+
isUserCreated?: boolean;
|
|
26
|
+
area?: number;
|
|
27
|
+
centerLat?: number;
|
|
28
|
+
centerLon?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface UpdateBoundaryParams {
|
|
31
|
+
filters: {
|
|
32
|
+
boundaryId: number;
|
|
33
|
+
};
|
|
34
|
+
values: {
|
|
35
|
+
name?: string;
|
|
36
|
+
type?: string;
|
|
37
|
+
modifiedBy?: string;
|
|
38
|
+
location?: string;
|
|
39
|
+
buffer?: string;
|
|
40
|
+
radiusDisplayUnit?: string;
|
|
41
|
+
color?: string;
|
|
42
|
+
geometry?: string;
|
|
43
|
+
status?: BoundaryStatus;
|
|
44
|
+
area?: number;
|
|
45
|
+
centerLat?: number;
|
|
46
|
+
centerLon?: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface DeleteBoundaryParams {
|
|
50
|
+
filters: {
|
|
51
|
+
boundaryId: number;
|
|
52
|
+
};
|
|
53
|
+
values: {
|
|
54
|
+
modifiedBy: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
package/dist/types/enums.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED