@spytecgps/nova-orm 0.0.59 → 0.0.61
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/index.js +1 -1
- package/dist/repositories/index.d.ts +2 -1
- package/dist/repositories/positions/createPosition.d.ts +2 -1
- package/dist/repositories/positions/index.d.ts +2 -1
- package/dist/repositories/userConfigurations/bulkCreateUserAlertConfigurations.d.ts +4 -0
- package/dist/repositories/userConfigurations/createUserConfiguration.d.ts +5 -0
- package/dist/repositories/userConfigurations/deleteUserAlertConfigurations.d.ts +4 -0
- package/dist/repositories/userConfigurations/deleteUserConfiguration.d.ts +4 -0
- package/dist/repositories/userConfigurations/getUserAlertConfigurations.d.ts +5 -0
- package/dist/repositories/userConfigurations/getUserConfigurations.d.ts +5 -0
- package/dist/repositories/userConfigurations/index.d.ts +104 -0
- package/dist/repositories/userConfigurations/updateUserAlertConfigurations.d.ts +4 -0
- package/dist/repositories/userConfigurations/updateUserConfiguration.d.ts +4 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/userConfigurations.d.ts +78 -0
- package/package.json +1 -1
|
@@ -7,8 +7,9 @@ import { DevicesRepository } from './devices';
|
|
|
7
7
|
import { FirmwaresRepository } from './firmwares';
|
|
8
8
|
import { PositionRepository } from './positions';
|
|
9
9
|
import { SecurityRepository } from './security';
|
|
10
|
+
import { UserConfigurationsRepository } from './userConfigurations';
|
|
10
11
|
import { UserDataDeletionRequestsRepository } from './userDataDeletionRequests';
|
|
11
12
|
import { UserInvitationsRepository } from './userInvitations';
|
|
12
13
|
import { UserRatingRequestsRepository } from './userRatingRequests';
|
|
13
14
|
import { UsersRepository } from './users';
|
|
14
|
-
export {
|
|
15
|
+
export { AlertRepository, BoundariesRepository, ClientsRepository, CountriesRepository, DeviceBehaviorsRepository, DevicesRepository, FirmwaresRepository, PositionRepository, SecurityRepository, UserConfigurationsRepository, UserDataDeletionRequestsRepository, UserInvitationsRepository, UserRatingRequestsRepository, UsersRepository, };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { InsertResult } from 'typeorm';
|
|
1
2
|
import { Position } from '../../entities';
|
|
2
3
|
import { NovaDataSource } from '../../novaDataSource';
|
|
3
4
|
import { Logger } from '../../types/logger';
|
|
4
5
|
import { CreatePositionParams } from '../../types/position';
|
|
5
6
|
export declare const createPosition: (novaDataSource: NovaDataSource, params: CreatePositionParams, logger: Logger) => Promise<Position>;
|
|
6
|
-
export declare const upsertPositions: (novaDataSource: NovaDataSource, params: CreatePositionParams[], logger: Logger) => Promise<
|
|
7
|
+
export declare const upsertPositions: (novaDataSource: NovaDataSource, params: CreatePositionParams[], logger: Logger) => Promise<InsertResult>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InsertResult } from 'typeorm';
|
|
1
2
|
import { Position } from '../../entities';
|
|
2
3
|
import { CreatePositionParams, GetPositionsByImeiParams, GetPositionsReportByClientParams, PositionReport } from '../../types/position';
|
|
3
4
|
import { BaseRepository } from '../baseRepository';
|
|
@@ -39,7 +40,7 @@ export declare class PositionRepository extends BaseRepository {
|
|
|
39
40
|
* - gpsUtcTime: the time the gps was set
|
|
40
41
|
* - externalBatteryPercentage: the external battery percentage reported by the device
|
|
41
42
|
*/
|
|
42
|
-
upsertPositions(params: CreatePositionParams[]): Promise<
|
|
43
|
+
upsertPositions(params: CreatePositionParams[]): Promise<InsertResult>;
|
|
43
44
|
/**
|
|
44
45
|
* Get positions by imei
|
|
45
46
|
* @param {GetPositionsByImeiParams} params containing information to get positions
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { BulkCreateUserAlertConfigurationsParams } from '../../types/userConfigurations';
|
|
4
|
+
export declare const bulkCreateUserAlertConfigurations: (novaDataSource: NovaDataSource, params: BulkCreateUserAlertConfigurationsParams, logger: Logger) => Promise<boolean>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UserConfiguration } from '../../entities/userConfiguration';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
import { CreateUserConfigurationParams } from '../../types/userConfigurations';
|
|
5
|
+
export declare const createUserConfiguration: (novaDataSource: NovaDataSource, params: CreateUserConfigurationParams, logger: Logger) => Promise<UserConfiguration>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { DeleteUserAlertConfigurationsParams } from '../../types/userConfigurations';
|
|
4
|
+
export declare const deleteUserAlertConfigurations: (novaDataSource: NovaDataSource, params: DeleteUserAlertConfigurationsParams, logger: Logger) => Promise<boolean>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { DeleteUserConfigurationParams } from '../../types/userConfigurations';
|
|
4
|
+
export declare const deleteUserConfiguration: (novaDataSource: NovaDataSource, params: DeleteUserConfigurationParams, logger: Logger) => Promise<boolean>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UserAlertConfiguration } from '../../entities';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
import { GetUserAlertConfigurationsParams } from '../../types/userConfigurations';
|
|
5
|
+
export declare const getUserAlertConfigurations: (novaDataSource: NovaDataSource, params: GetUserAlertConfigurationsParams, logger: Logger) => Promise<UserAlertConfiguration[]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UserConfiguration } from '../../entities';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
import { GetUserConfigurationsParams } from '../../types/userConfigurations';
|
|
5
|
+
export declare const getUserConfigurations: (novaDataSource: NovaDataSource, params: GetUserConfigurationsParams, logger: Logger) => Promise<UserConfiguration[]>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { UserAlertConfiguration, UserConfiguration } from '../../entities';
|
|
2
|
+
import { BulkCreateUserAlertConfigurationsParams, CreateUserConfigurationParams, DeleteUserAlertConfigurationsParams, DeleteUserConfigurationParams, GetUserAlertConfigurationsParams, GetUserConfigurationsParams, UpdateUserAlertConfigurationsParams, UpdateUserConfigurationParams } from '../../types/userConfigurations';
|
|
3
|
+
import { BaseRepository } from '../baseRepository';
|
|
4
|
+
export declare class UserConfigurationsRepository extends BaseRepository {
|
|
5
|
+
/**
|
|
6
|
+
* Get user configurations
|
|
7
|
+
* @param {GetUserConfigurationsParams} params containing information to get user configurations
|
|
8
|
+
* - filters.clientId: The client id to obtain all user configurations from that client
|
|
9
|
+
* - filters.userId: The user id to obtain all user configurations from that user
|
|
10
|
+
* @returns The user configurations
|
|
11
|
+
*/
|
|
12
|
+
getUserConfigurations(params: GetUserConfigurationsParams): Promise<UserConfiguration[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Create user configuration
|
|
15
|
+
* @param {CreateUserConfigurationParams} params containing information to create a user configuration
|
|
16
|
+
* - id: The user configuration id, optional. If not provided, it will be generated
|
|
17
|
+
* - userId: The user id, required
|
|
18
|
+
* - isMetric: Whether is metric, required
|
|
19
|
+
* - timezone: The user timezone, optional
|
|
20
|
+
* - defaultMapLayer: The user default map layer, optional
|
|
21
|
+
* - speedUnits: The user speed units, optional
|
|
22
|
+
* - distanceUnits: The user distance units, optional
|
|
23
|
+
* - alertsNotificationsOn: The user alerts notifications on, optional. If not provided, it will be true
|
|
24
|
+
* - dataSourceTypeId: The user data source type id, optional
|
|
25
|
+
* - homepage: The user homepage, optional
|
|
26
|
+
* - temperatureUnits: The user temperature units, optional
|
|
27
|
+
* @returns The created user configuration
|
|
28
|
+
*/
|
|
29
|
+
createUserConfiguration(params: CreateUserConfigurationParams): Promise<UserConfiguration>;
|
|
30
|
+
/**
|
|
31
|
+
* Update user configuration
|
|
32
|
+
* @param {UpdateUserConfigurationParams} params containing information to update a user configuration
|
|
33
|
+
* Filters:
|
|
34
|
+
* - filters.userId: The user id to update the user configuration, required
|
|
35
|
+
* Values:
|
|
36
|
+
* One of the following values is required
|
|
37
|
+
* - values.timezone: The user timezone, optional
|
|
38
|
+
* - values.defaultMapLayer: The user default map layer, optional
|
|
39
|
+
* - values.speedUnits: The user speed units, optional
|
|
40
|
+
* - values.distanceUnits: The user distance units, optional
|
|
41
|
+
* - values.alertsNotificationsOn: The user alerts notifications on, optional
|
|
42
|
+
* - values.dataSourceTypeId: The user data source type id, optional
|
|
43
|
+
* - values.homepage: The user homepage, optional
|
|
44
|
+
* - values.temperatureUnits: The user temperature units, optional
|
|
45
|
+
* @returns Whether the user configuration was updated
|
|
46
|
+
*/
|
|
47
|
+
updateUserConfiguration(params: UpdateUserConfigurationParams): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete user configuration
|
|
50
|
+
* @param {DeleteUserConfigurationParams} params containing information to delete a user configuration
|
|
51
|
+
* - filters.userId: The user id to delete the user configuration, required
|
|
52
|
+
* @returns Whether the user configuration was deleted
|
|
53
|
+
*/
|
|
54
|
+
deleteUserConfiguration(params: DeleteUserConfigurationParams): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Get user alert configurations
|
|
57
|
+
* @param {GetUserAlertConfigurationsParams} params containing information to get user alert configurations
|
|
58
|
+
* - filters.userId: The user id to obtain all user alert configurations from that user, required
|
|
59
|
+
* - filters.includeBeta: Whether to include beta alert types, required
|
|
60
|
+
* @returns The user alert configurations
|
|
61
|
+
*/
|
|
62
|
+
getUserAlertConfigurations(params: GetUserAlertConfigurationsParams): Promise<UserAlertConfiguration[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Bulk create user alert configurations
|
|
65
|
+
* @param {BulkCreateUserAlertConfigurationsParams} params containing information to bulk create user alert configurations
|
|
66
|
+
* - alertConfigurations: The user alert configurations to create, required
|
|
67
|
+
* Each user alert configuration should contain:
|
|
68
|
+
* - id: The user alert configuration id, optional. If not provided, it will be generated
|
|
69
|
+
* - userId: The user id, required
|
|
70
|
+
* - alertTypeId: The alert type id, required
|
|
71
|
+
* - smsNotification: The user sms notification, optional
|
|
72
|
+
* - emailNotification: The user email notification, optional
|
|
73
|
+
* - appNotification: The user app notification, optional. If not provided, it will be true
|
|
74
|
+
* - pushNotification: The user push notification, optional. If not provided, it will be true
|
|
75
|
+
* - alertValue: The user alert value, optional
|
|
76
|
+
* - alertMetadata: The user alert metadata, optional
|
|
77
|
+
* @returns Whether the user alert configurations were created
|
|
78
|
+
*/
|
|
79
|
+
bulkCreateUserAlertConfigurations(params: BulkCreateUserAlertConfigurationsParams): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Update user alert configurations
|
|
82
|
+
* @param {UpdateUserAlertConfigurationsParams} params containing information to update user alert configurations
|
|
83
|
+
* Filters:
|
|
84
|
+
* - filters.userId: The user id to update the user alert configurations, required
|
|
85
|
+
* - filters.alertTypeId: The alert type id to update the user alert configurations, optional
|
|
86
|
+
* Values:
|
|
87
|
+
* One of the following values is required
|
|
88
|
+
* - values.smsNotification: The user sms notification, optional
|
|
89
|
+
* - values.emailNotification: The user email notification, optional
|
|
90
|
+
* - values.appNotification: The user app notification, optional
|
|
91
|
+
* - values.pushNotification: The user push notification, optional
|
|
92
|
+
* - values.alertValue: The user alert value, optional
|
|
93
|
+
* - values.alertMetadata: The user alert metadata, optional
|
|
94
|
+
* @returns Whether the user alert configurations were updated
|
|
95
|
+
*/
|
|
96
|
+
updateUserAlertConfigurations(params: UpdateUserAlertConfigurationsParams): Promise<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* Delete user alert configurations
|
|
99
|
+
* @param {DeleteUserAlertConfigurationsParams} params containing information to delete user alert configurations
|
|
100
|
+
* - filters.userId: The user id to delete the user alert configurations, required
|
|
101
|
+
* @returns Whether the user alert configurations were deleted
|
|
102
|
+
*/
|
|
103
|
+
deleteUserAlertConfigurations(params: DeleteUserAlertConfigurationsParams): Promise<boolean>;
|
|
104
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { UpdateUserAlertConfigurationsParams } from '../../types/userConfigurations';
|
|
4
|
+
export declare const updateUserAlertConfigurations: (novaDataSource: NovaDataSource, params: UpdateUserAlertConfigurationsParams, logger: Logger) => Promise<boolean>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { UpdateUserConfigurationParams } from '../../types/userConfigurations';
|
|
4
|
+
export declare const updateUserConfiguration: (novaDataSource: NovaDataSource, params: UpdateUserConfigurationParams, logger: Logger) => Promise<boolean>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import * as Firmwares from './firmwares';
|
|
|
6
6
|
import * as Logger from './logger';
|
|
7
7
|
import * as Security from './security';
|
|
8
8
|
import * as Users from './user';
|
|
9
|
+
import * as UserConfigurations from './userConfigurations';
|
|
9
10
|
import * as UserDataDeletionRequests from './userDataDeletionRequests';
|
|
10
11
|
import * as UserInvitations from './userInvitations';
|
|
11
12
|
import * as UserRatingRequests from './userRatingRequests';
|
|
12
|
-
export {
|
|
13
|
+
export { Boundaries, Clients, DeviceBehaviors, Devices, Firmwares, Logger, Security, Users, UserConfigurations, UserDataDeletionRequests, UserInvitations, UserRatingRequests, };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface GetUserConfigurationsParams {
|
|
2
|
+
filters: {
|
|
3
|
+
clientId?: number;
|
|
4
|
+
userId?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface CreateUserConfigurationParams {
|
|
8
|
+
id?: number;
|
|
9
|
+
userId: string;
|
|
10
|
+
isMetric: boolean;
|
|
11
|
+
timezone?: string;
|
|
12
|
+
defaultMapLayer?: string;
|
|
13
|
+
speedUnits?: string;
|
|
14
|
+
distanceUnits?: string;
|
|
15
|
+
alertsNotificationsOn?: boolean;
|
|
16
|
+
dataSourceTypeId?: number;
|
|
17
|
+
homepage?: string;
|
|
18
|
+
temperatureUnits?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateUserConfigurationParams {
|
|
21
|
+
filters: {
|
|
22
|
+
userId: string;
|
|
23
|
+
};
|
|
24
|
+
values: {
|
|
25
|
+
timezone?: string;
|
|
26
|
+
defaultMapLayer?: string;
|
|
27
|
+
speedUnits?: string;
|
|
28
|
+
distanceUnits?: string;
|
|
29
|
+
alertsNotificationsOn?: boolean;
|
|
30
|
+
dataSourceTypeId?: number;
|
|
31
|
+
homepage?: string;
|
|
32
|
+
temperatureUnits?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface DeleteUserConfigurationParams {
|
|
36
|
+
filters: {
|
|
37
|
+
userId: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface GetUserAlertConfigurationsParams {
|
|
41
|
+
filters: {
|
|
42
|
+
userId: string;
|
|
43
|
+
includeBeta: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface CreateUserAlertConfigurationParams {
|
|
47
|
+
id?: number;
|
|
48
|
+
userId: string;
|
|
49
|
+
alertTypeId: number;
|
|
50
|
+
smsNotification?: boolean;
|
|
51
|
+
emailNotification?: boolean;
|
|
52
|
+
appNotification?: boolean;
|
|
53
|
+
pushNotification?: boolean;
|
|
54
|
+
alertValue?: string;
|
|
55
|
+
alertMetadata?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface BulkCreateUserAlertConfigurationsParams {
|
|
58
|
+
alertConfigurations: CreateUserAlertConfigurationParams[];
|
|
59
|
+
}
|
|
60
|
+
export interface UpdateUserAlertConfigurationsParams {
|
|
61
|
+
filters: {
|
|
62
|
+
userId: string;
|
|
63
|
+
alertTypeId?: number;
|
|
64
|
+
};
|
|
65
|
+
values: {
|
|
66
|
+
smsNotification?: boolean;
|
|
67
|
+
emailNotification?: boolean;
|
|
68
|
+
appNotification?: boolean;
|
|
69
|
+
pushNotification?: boolean;
|
|
70
|
+
alertValue?: string;
|
|
71
|
+
alertMetadata?: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface DeleteUserAlertConfigurationsParams {
|
|
75
|
+
filters: {
|
|
76
|
+
userId: string;
|
|
77
|
+
};
|
|
78
|
+
}
|