@spytecgps/nova-orm 0.0.69 → 0.0.71
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/userAppIncidents/getUserAppIncidents.d.ts +5 -0
- package/dist/repositories/userAppIncidents/index.d.ts +50 -0
- package/dist/repositories/userAppIncidents/upsertUserAppIncident.d.ts +4 -0
- package/dist/repositories/users/getUserData.d.ts +4 -0
- package/dist/repositories/users/index.d.ts +8 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/user.d.ts +27 -0
- package/dist/types/userAppIncidents.d.ts +34 -0
- package/package.json +1 -1
|
@@ -11,9 +11,10 @@ import { NotificationRecipientsRepository } from './notificationRecipients';
|
|
|
11
11
|
import { PositionRepository } from './positions';
|
|
12
12
|
import { SecurityRepository } from './security';
|
|
13
13
|
import { UserActivationsRepository } from './userActivations';
|
|
14
|
+
import { UserAppIncidentsRepository } from './userAppIncidents';
|
|
14
15
|
import { UserConfigurationsRepository } from './userConfigurations';
|
|
15
16
|
import { UserDataDeletionRequestsRepository } from './userDataDeletionRequests';
|
|
16
17
|
import { UserInvitationsRepository } from './userInvitations';
|
|
17
18
|
import { UserRatingRequestsRepository } from './userRatingRequests';
|
|
18
19
|
import { UsersRepository } from './users';
|
|
19
|
-
export { AlertRepository, AlertTypesRepository, AssetCategoriesRepository, BoundariesRepository, ClientsRepository, CountriesRepository, DeviceBehaviorsRepository, DevicesRepository, FirmwaresRepository, NotificationRecipientsRepository, PositionRepository, SecurityRepository, UserActivationsRepository, UserConfigurationsRepository, UserDataDeletionRequestsRepository, UserInvitationsRepository, UserRatingRequestsRepository, UsersRepository, };
|
|
20
|
+
export { AlertRepository, AlertTypesRepository, AssetCategoriesRepository, BoundariesRepository, ClientsRepository, CountriesRepository, DeviceBehaviorsRepository, DevicesRepository, FirmwaresRepository, NotificationRecipientsRepository, PositionRepository, SecurityRepository, UserActivationsRepository, UserAppIncidentsRepository, UserConfigurationsRepository, UserDataDeletionRequestsRepository, UserInvitationsRepository, UserRatingRequestsRepository, UsersRepository, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UserAppIncident } from '../../entities';
|
|
2
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
import { GetUserAppIncidentsParams } from '../../types/userAppIncidents';
|
|
5
|
+
export declare const getUserAppIncidents: (novaDataSource: NovaDataSource, params: GetUserAppIncidentsParams, logger: Logger) => Promise<UserAppIncident[]>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { UserAppIncident } from '../../entities';
|
|
2
|
+
import { GetUserAppIncidentsParams, UpsertUserAppIncidentParams } from '../../types/userAppIncidents';
|
|
3
|
+
import { BaseRepository } from '../baseRepository';
|
|
4
|
+
export declare class UserAppIncidentsRepository extends BaseRepository {
|
|
5
|
+
/**
|
|
6
|
+
* Get user app incidents
|
|
7
|
+
* @param {GetUserAppIncidentsParams} params containing information to get user app incidents
|
|
8
|
+
* Filters:
|
|
9
|
+
* filters.userId: user id, required
|
|
10
|
+
* filters.createdFrom: created from date, required
|
|
11
|
+
* filters.createdTo: created to date, required
|
|
12
|
+
* @returns {Promise<UserAppIncident[]>} user app incidents
|
|
13
|
+
*/
|
|
14
|
+
getUserAppIncidents(params: GetUserAppIncidentsParams): Promise<UserAppIncident[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Upsert user app incident
|
|
17
|
+
* @param {UpsertUserAppIncidentParams} params containing information to insert or update an user app incident
|
|
18
|
+
* If no user app incident exist with the same user id and error id, a new user app incident will be inserted.
|
|
19
|
+
* Otherwise, the existing user app incident will be updated.
|
|
20
|
+
* Filters:
|
|
21
|
+
* params.id: user app incident id, optional. If not provided, a new id will be generated.
|
|
22
|
+
* params.userId: user id, required
|
|
23
|
+
* params.deviceOs: device os, required
|
|
24
|
+
* params.stage: stage, required
|
|
25
|
+
* params.appVersion: app version, required
|
|
26
|
+
* params.errorId: error id, required
|
|
27
|
+
* params.userName: user name, optional
|
|
28
|
+
* params.userEmail: user email, optional
|
|
29
|
+
* params.deviceManufacturer: device manufacturer, optional
|
|
30
|
+
* params.deviceModel: device model, optional
|
|
31
|
+
* params.appVersion: app version, optional
|
|
32
|
+
* params.errorMessage: error message, optional
|
|
33
|
+
* params.errorFirstReceivedAt: when the error was first received, optional
|
|
34
|
+
* params.errorReceivedAt: when the error was received, optional
|
|
35
|
+
* params.deviceJailbroken: whether the device is jailbroken, optional
|
|
36
|
+
* params.deviceOsVersion: device os version, optional
|
|
37
|
+
* params.deviceFreeMemory: device free memory, optional
|
|
38
|
+
* params.deviceTotalMemory: device total memory, optional
|
|
39
|
+
* params.deviceCharging: whether the device is charging, optional
|
|
40
|
+
* params.deviceBatteryLevel: device battery level, optional
|
|
41
|
+
* params.deviceNetworkAccess: device network access, optional
|
|
42
|
+
* params.appActiveScreen: app active screen, optional
|
|
43
|
+
* params.appInForeground: whether the app is in foreground, optional
|
|
44
|
+
* params.appDurationInForeground: app duration in foreground, optional
|
|
45
|
+
* params.appBundleId: app bundle id, optional
|
|
46
|
+
* params.incidentUrl: incident url, optional
|
|
47
|
+
* @returns {Promise<boolean>} true if user app incident was upserted, false otherwise
|
|
48
|
+
*/
|
|
49
|
+
upsertUserAppIncident(params: UpsertUserAppIncidentParams): Promise<boolean>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { UpsertUserAppIncidentParams } from '../../types/userAppIncidents';
|
|
4
|
+
export declare const upsertUserAppIncident: (novaDataSource: NovaDataSource, params: UpsertUserAppIncidentParams, logger: Logger) => Promise<boolean>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { GetUsersDataParams, UserData } from '../../types/user';
|
|
4
|
+
export declare const getUsersData: (novaDataSource: NovaDataSource, params: GetUsersDataParams, logger: Logger) => Promise<UserData[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User } from '../../entities/user';
|
|
2
|
-
import { CreateUserParams, DeleteUserParams, GetUserByIdParams, GetUsersConfigurationByImeiParams, GetUsersIdsByPhoneAndCountryCodeParams, GetUsersParams, GetUsersWithRolesParams, UpdateUserParams, UserWithRole } from '../../types/user';
|
|
2
|
+
import { CreateUserParams, DeleteUserParams, GetUserByIdParams, GetUsersConfigurationByImeiParams, GetUsersDataParams, GetUsersIdsByPhoneAndCountryCodeParams, GetUsersParams, GetUsersWithRolesParams, UpdateUserParams, UserData, UserWithRole } from '../../types/user';
|
|
3
3
|
import { BaseRepository } from '../baseRepository';
|
|
4
4
|
export declare class UsersRepository extends BaseRepository {
|
|
5
5
|
/**
|
|
@@ -108,4 +108,11 @@ export declare class UsersRepository extends BaseRepository {
|
|
|
108
108
|
* @returns Whether the user was updated or not
|
|
109
109
|
*/
|
|
110
110
|
updateUser(params: UpdateUserParams): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Get users data
|
|
113
|
+
* @param {GetUsersDataParams} params containing information to get users data
|
|
114
|
+
* - filters.imei: The imei of the device to obtain users configurations
|
|
115
|
+
* @returns The array of users data
|
|
116
|
+
*/
|
|
117
|
+
getUsersData(params: GetUsersDataParams): Promise<UserData[]>;
|
|
111
118
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,8 +12,9 @@ import * as Positions from './position';
|
|
|
12
12
|
import * as Security from './security';
|
|
13
13
|
import * as Users from './user';
|
|
14
14
|
import * as UserActivations from './userActivations';
|
|
15
|
+
import * as UserAppIncidents from './userAppIncidents';
|
|
15
16
|
import * as UserConfigurations from './userConfigurations';
|
|
16
17
|
import * as UserDataDeletionRequests from './userDataDeletionRequests';
|
|
17
18
|
import * as UserInvitations from './userInvitations';
|
|
18
19
|
import * as UserRatingRequests from './userRatingRequests';
|
|
19
|
-
export { Alerts, AlertTypes, Boundaries, Clients, Countries, DeviceBehaviors, Devices, Firmwares, Logger, NotificationRecipients, Positions, Security, Users, UserActivations, UserConfigurations, UserDataDeletionRequests, UserInvitations, UserRatingRequests, };
|
|
20
|
+
export { Alerts, AlertTypes, Boundaries, Clients, Countries, DeviceBehaviors, Devices, Firmwares, Logger, NotificationRecipients, Positions, Security, Users, UserActivations, UserAppIncidents, UserConfigurations, UserDataDeletionRequests, UserInvitations, UserRatingRequests, };
|
package/dist/types/user.d.ts
CHANGED
|
@@ -91,3 +91,30 @@ export interface UpdateUserParams {
|
|
|
91
91
|
lastLoginAt?: Date;
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
+
export interface GetUsersDataParams {
|
|
95
|
+
filters: {
|
|
96
|
+
imei: string;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface UserData {
|
|
100
|
+
userId: string;
|
|
101
|
+
telephone: string;
|
|
102
|
+
email: string;
|
|
103
|
+
isMetric: boolean;
|
|
104
|
+
timezone: string;
|
|
105
|
+
alertsNotificationOn: boolean;
|
|
106
|
+
speedUnits: string;
|
|
107
|
+
distanceUnits: string;
|
|
108
|
+
alertTypeId: number;
|
|
109
|
+
smsNotification: boolean;
|
|
110
|
+
emailNotification: boolean;
|
|
111
|
+
alertValue: string;
|
|
112
|
+
pushNotification: boolean;
|
|
113
|
+
appNotification: boolean;
|
|
114
|
+
alertMetadata: string;
|
|
115
|
+
deviceName: string;
|
|
116
|
+
clientId: number;
|
|
117
|
+
internationalDirectDialing: string;
|
|
118
|
+
phoneNumbers: string[];
|
|
119
|
+
emailAddresses: string[];
|
|
120
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface GetUserAppIncidentsParams {
|
|
2
|
+
filters: {
|
|
3
|
+
userId: string;
|
|
4
|
+
createdFrom: Date;
|
|
5
|
+
createdTo: Date;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface UpsertUserAppIncidentParams {
|
|
9
|
+
id?: number;
|
|
10
|
+
userId: string;
|
|
11
|
+
userName?: string;
|
|
12
|
+
userEmail?: string;
|
|
13
|
+
deviceOs: string;
|
|
14
|
+
deviceManufacturer?: string;
|
|
15
|
+
deviceModel?: string;
|
|
16
|
+
stage: string;
|
|
17
|
+
appVersion: string;
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
errorFirstReceivedAt?: Date;
|
|
20
|
+
errorReceivedAt?: Date;
|
|
21
|
+
deviceJailbroken?: boolean;
|
|
22
|
+
deviceOsVersion?: string;
|
|
23
|
+
deviceFreeMemory?: number;
|
|
24
|
+
deviceTotalMemory?: number;
|
|
25
|
+
deviceCharging?: boolean;
|
|
26
|
+
deviceBatteryLevel?: number;
|
|
27
|
+
deviceNetworkAccess?: string;
|
|
28
|
+
appActiveScreen?: string;
|
|
29
|
+
appInForeground?: boolean;
|
|
30
|
+
appDurationInForeground?: number;
|
|
31
|
+
appBundleId?: string;
|
|
32
|
+
incidentUrl?: string;
|
|
33
|
+
errorId: string;
|
|
34
|
+
}
|