@spytecgps/nova-orm 0.0.183 → 0.0.185

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.
@@ -0,0 +1,5 @@
1
+ import { DevicePairing } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { GetDevicePairingsByImeiParams } from '../../types/devicePairings';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getDevicePairingsByImei: (novaDataSource: NovaDataSource, params: GetDevicePairingsByImeiParams, logger: Logger) => Promise<DevicePairing[]>;
@@ -1,5 +1,5 @@
1
1
  import { DevicePairing } from '../../entities';
2
- import { CreateDevicePairingParams, DeleteDevicePairingParams, GetDevicePairingsParams, UpdateDevicePairingParams } from '../../types/devicePairings';
2
+ import { CreateDevicePairingParams, DeleteDevicePairingParams, GetDevicePairingsByImeiParams, GetDevicePairingsParams, UpdateDevicePairingParams } from '../../types/devicePairings';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class DevicePairingsRepository extends BaseRepository {
5
5
  /**
@@ -13,6 +13,13 @@ export declare class DevicePairingsRepository extends BaseRepository {
13
13
  * @returns Promise<DevicePairing[]> the device pairings
14
14
  */
15
15
  getDevicePairings(params: GetDevicePairingsParams): Promise<DevicePairing[]>;
16
+ /**
17
+ * Get device pairings by IMEI
18
+ * @param params params containing information to get device pairings by IMEI with filters
19
+ * filters.imei: the IMEI to get device pairings
20
+ * @returns Promise<DevicePairing[]> the device pairings
21
+ */
22
+ getDevicePairingsByImei(params: GetDevicePairingsByImeiParams): Promise<DevicePairing[]>;
16
23
  /**
17
24
  * Create device pairing
18
25
  * @param params params containing information to create device pairing
@@ -38,7 +38,7 @@ export declare class NotificationRecipientsRepository extends BaseRepository {
38
38
  */
39
39
  updateNotificationRecipient(params: UpdateNotificationRecipientParams): Promise<boolean>;
40
40
  /**
41
- * @deprecated The method should not be used, use 'updateUsersNotificationsUnsuscribedInfoStatus'
41
+ * @deprecated The method should not be used, use 'updateUsersNotificationsUnsubscribedInfoStatus'
42
42
  * Update users notifications unsubscribed status
43
43
  * @param {UpdateUsersNotificationsUnsuscribedStatusParams} params containing information to update users notifications unsubscribed status
44
44
  * - params.filters: Using these filters, the query will update the users notifications unsubscribed
@@ -61,7 +61,7 @@ export declare class NotificationRecipientsRepository extends BaseRepository {
61
61
  * - params.values.unsubscribed: The unsubscribed flag, optional
62
62
  * @returns array with userId of notification recipients that where updated, if no notificationRecipients where updated returns null
63
63
  */
64
- updateUsersNotificationsUnsuscribedInfoStatus(params: UpdateUsersNotificationsUnsubscribedInfoStatusParams): Promise<string[]>;
64
+ updateUsersNotificationsUnsubscribedInfoStatus(params: UpdateUsersNotificationsUnsubscribedInfoStatusParams): Promise<string[] | null>;
65
65
  /**
66
66
  * Delete notification recipients
67
67
  * @param {DeleteNotificationRecipientsParams} params containing information to delete notification recipients
@@ -1,4 +1,4 @@
1
1
  import { NovaDataSource } from '../../novaDataSource';
2
2
  import { Logger } from '../../types/logger';
3
3
  import { UpdateUsersNotificationsUnsubscribedInfoStatusParams } from '../../types/notificationRecipients';
4
- export declare const updateUsersNotificationsUnsuscribedInfoStatus: (novaDataSource: NovaDataSource, params: UpdateUsersNotificationsUnsubscribedInfoStatusParams, logger: Logger) => Promise<string[]>;
4
+ export declare const updateUsersNotificationsUnsubscribedInfoStatus: (novaDataSource: NovaDataSource, params: UpdateUsersNotificationsUnsubscribedInfoStatusParams, logger: Logger) => Promise<string[]>;
@@ -1,5 +1,5 @@
1
1
  import { TaskSchedule } from '../../entities';
2
- import { CreateTaskScheduleParams, GetTaskScheduleParams } from '../../types/tasks';
2
+ import { CreateTaskScheduleParams, GetTaskScheduleParams, UpdateTaskScheduleParams } from '../../types/tasks';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class TasksRepository extends BaseRepository {
5
5
  /**
@@ -31,4 +31,26 @@ export declare class TasksRepository extends BaseRepository {
31
31
  * @returns Promise<TaskSchedule> the task schedule
32
32
  */
33
33
  getTaskSchedule(params: GetTaskScheduleParams): Promise<TaskSchedule>;
34
+ /**
35
+ * Update an existing task schedule
36
+ * @param params params containing information to update task schedule
37
+ * params.filters.id: the ID, required
38
+ * params.values.clientId: the client ID, optional
39
+ * params.values.title: the title, optional
40
+ * params.values.description: the description, optional
41
+ * params.values.repeats: whether the task repeats, optional
42
+ * params.values.dueDate: the due date, required if repeats is false
43
+ * params.values.dueOdometer: the due odometer, required if repeats is false
44
+ * params.values.dueActiveHours: the due active hours, required if repeats is false
45
+ * params.values.intervalDays: the interval days, required if repeats is true
46
+ * params.values.intervalOdometer: the interval odometer, required if repeats is true
47
+ * params.values.intervalActiveHours: the interval active hours, required if repeats is true
48
+ * params.values.intervalStartDate: the interval start date
49
+ * params.values.intervalStartingOdometer: the interval starting odometer
50
+ * params.values.intervalStartingActiveHours: the interval starting active hours
51
+ * params.values.notes: the notes, optional
52
+ * params.values.modifiedBy: the modified by, required
53
+ * @returns Promise<boolean> whether the task schedule was updated
54
+ */
55
+ updateTaskSchedule(params: UpdateTaskScheduleParams): Promise<boolean>;
34
56
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { Logger } from '../../types/logger';
3
+ import { UpdateTaskScheduleParams } from '../../types/tasks';
4
+ export declare const updateTaskSchedule: (novaDataSource: NovaDataSource, params: UpdateTaskScheduleParams, logger: Logger) => Promise<boolean>;
@@ -15,6 +15,11 @@ export interface GetDevicePairingsParams {
15
15
  btmacSecondary?: string;
16
16
  };
17
17
  }
18
+ export interface GetDevicePairingsByImeiParams {
19
+ filters: {
20
+ imei: string;
21
+ };
22
+ }
18
23
  export interface UpdateDevicePairingParams {
19
24
  filters: {
20
25
  id: number;
@@ -21,3 +21,25 @@ export interface GetTaskScheduleParams {
21
21
  id: number;
22
22
  };
23
23
  }
24
+ export interface UpdateTaskScheduleParams {
25
+ filters: {
26
+ id: number;
27
+ };
28
+ values: {
29
+ clientId?: number;
30
+ title?: string;
31
+ description?: string;
32
+ repeats?: boolean;
33
+ dueDate?: Date;
34
+ dueOdometer?: number;
35
+ dueActiveHours?: number;
36
+ intervalDays?: number;
37
+ intervalStartDate?: Date;
38
+ intervalOdometer?: number;
39
+ intervalStartingOdometer?: number;
40
+ intervalActiveHours?: number;
41
+ intervalStartingActiveHours?: number;
42
+ notes?: string;
43
+ modifiedBy: string;
44
+ };
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.183",
3
+ "version": "0.0.185",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",