@spytecgps/nova-orm 0.0.186 → 0.0.188

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 { FirmwareAutoUpgradeBlacklist } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { CreateFirmwareAutoUpgradeBlacklistParams } from '../../types/firmwares';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const createFirmwareAutoUpgradeBlacklist: (novaDataSource: NovaDataSource, params: CreateFirmwareAutoUpgradeBlacklistParams, logger: Logger) => Promise<FirmwareAutoUpgradeBlacklist>;
@@ -0,0 +1,5 @@
1
+ import { FirmwareAutoUpgradeBlacklist } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { GetFirmwareAutoUpgradeBlacklistParams } from '../../types/firmwares';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getFirmwareAutoUpgradeBlacklist: (novaDataSource: NovaDataSource, params: GetFirmwareAutoUpgradeBlacklistParams, logger: Logger) => Promise<FirmwareAutoUpgradeBlacklist[]>;
@@ -1,5 +1,5 @@
1
- import { DeviceTypeFirmware, FirmwareUpgradeTask } from '../../entities';
2
- import { CreateDeviceFirmwareParams, CreateFirmwareUpgradeTaskParams, GetDeviceFirmwaresParams, GetFirmwareUpgradeTasksCountParams, GetFirmwareUpgradeTasksParams, UpdateDeviceFirmwareParams, UpdateFirmwareUpgradeTaskParams } from '../../types/firmwares';
1
+ import { DeviceTypeFirmware, FirmwareAutoUpgradeBlacklist, FirmwareUpgradeTask } from '../../entities';
2
+ import { CreateDeviceFirmwareParams, CreateFirmwareAutoUpgradeBlacklistParams, CreateFirmwareUpgradeTaskParams, GetDeviceFirmwaresParams, GetFirmwareAutoUpgradeBlacklistParams, GetFirmwareUpgradeTasksCountParams, GetFirmwareUpgradeTasksParams, UpdateDeviceFirmwareParams, UpdateFirmwareUpgradeTaskParams } from '../../types/firmwares';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class FirmwaresRepository extends BaseRepository {
5
5
  /**
@@ -112,4 +112,21 @@ export declare class FirmwaresRepository extends BaseRepository {
112
112
  * @returns {boolean} Whether the device firmware is updated or not.
113
113
  */
114
114
  updateDeviceFirmware(params: UpdateDeviceFirmwareParams): Promise<boolean>;
115
+ /**
116
+ * Create a new firmware auto upgrade blacklist.
117
+ * @param params containing information to create a firmware auto upgrade blacklist.
118
+ * - clientId: The client id
119
+ * - deviceTypeId: The device type id
120
+ * @returns The newly created entity.
121
+ */
122
+ createFirmwareAutoUpgradeBlacklist(params: CreateFirmwareAutoUpgradeBlacklistParams): Promise<FirmwareAutoUpgradeBlacklist>;
123
+ /**
124
+ * Get firmware auto upgrade blacklist based on the filters.
125
+ * @param params containing information to get a firmware auto upgrade blacklist with filters.
126
+ * - filters.clientId: The client id. It's required
127
+ * - pagingOptions.limit: The limit of the number of firmware auto upgrade blacklist to get. By default 100.
128
+ * - pagingOptions.offset: The offset of the number of firmware auto upgrade blacklist to get. By default 0.
129
+ * @returns A list of firmware auto upgrade blacklist.
130
+ */
131
+ getFirmwareAutoUpgradeBlacklist(params: GetFirmwareAutoUpgradeBlacklistParams): Promise<FirmwareAutoUpgradeBlacklist[]>;
115
132
  }
@@ -0,0 +1,5 @@
1
+ import { TaskSchedule } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { Logger } from '../../types/logger';
4
+ import { GetTaskSchedulesParams } from '../../types/tasks';
5
+ export declare const getTaskSchedules: (novaDataSource: NovaDataSource, params: GetTaskSchedulesParams, logger: Logger) => Promise<TaskSchedule[]>;
@@ -1,5 +1,5 @@
1
1
  import { TaskSchedule } from '../../entities';
2
- import { CreateTaskScheduleParams, DeleteTaskScheduleParams, GetTaskScheduleParams, UpdateTaskScheduleParams } from '../../types/tasks';
2
+ import { CreateTaskScheduleParams, DeleteTaskScheduleParams, GetTaskScheduleParams, GetTaskSchedulesParams, UpdateTaskScheduleParams } from '../../types/tasks';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class TasksRepository extends BaseRepository {
5
5
  /**
@@ -61,4 +61,45 @@ export declare class TasksRepository extends BaseRepository {
61
61
  * @returns Promise<boolean> whether the task schedule was deleted
62
62
  */
63
63
  deleteTaskSchedule(params: DeleteTaskScheduleParams): Promise<boolean>;
64
+ /**
65
+ * Get task schedules with filters
66
+ * @param params params containing information to get task schedules
67
+ * At least one of the following filters is required:
68
+ * params.filters.imei: the IMEI, if provided, will return task schedules associated to the device
69
+ * params.filters.clientId: the client ID
70
+ * params.filters.title: the title for partial match search
71
+ * params.filters.description: the description for partial match search
72
+ * params.filters.repeats: filter for tasks that repeat or not
73
+ * params.filters.minDueDate: the minimum due date
74
+ * params.filters.maxDueDate: the maximum due date
75
+ * params.filters.minDueOdometer: the minimum due odometer
76
+ * params.filters.maxDueOdometer: the maximum due odometer
77
+ * params.filters.minDueActiveHours: the minimum due active hours
78
+ * params.filters.maxDueActiveHours: the maximum due active hours
79
+ * params.filters.minIntervalDays: the minimum interval days
80
+ * params.filters.maxIntervalDays: the maximum interval days
81
+ * params.filters.minIntervalStartDate: the minimum interval start date
82
+ * params.filters.maxIntervalStartDate: the maximum interval start date
83
+ * params.filters.minIntervalOdometer: the minimum interval odometer
84
+ * params.filters.maxIntervalOdometer: the maximum interval odometer
85
+ * params.filters.minIntervalActiveHours: the minimum interval active hours
86
+ * params.filters.maxIntervalActiveHours: the maximum interval active hours
87
+ * params.filters.minIntervalStartingOdometer: the minimum interval starting odometer
88
+ * params.filters.maxIntervalStartingOdometer: the maximum interval starting odometer
89
+ * params.filters.minIntervalStartingActiveHours: the minimum interval starting active hours
90
+ * params.filters.maxIntervalStartingActiveHours: the maximum interval starting active hours
91
+ * params.filters.notes: the notes for partial match search
92
+ * params.filters.createdBy: the created by, exact match search
93
+ * params.filters.minCreatedAt: the minimum created at
94
+ * params.filters.maxCreatedAt: the maximum created at
95
+ * params.filters.modifiedBy: the modified by, exact match search
96
+ * params.filters.minModifiedAt: the minimum modified at
97
+ * params.filters.maxModifiedAt: the maximum modified at
98
+ * params.filters.deletedBy: the deleted by, exact match search
99
+ * params.filters.minDeletedAt: the minimum deleted at
100
+ * params.filters.maxDeletedAt: the maximum deleted at
101
+ * params.filters.status: the status (active or deleted)
102
+ * @returns Promise<TaskSchedule[]> the task schedules corresponding to the filters
103
+ */
104
+ getTaskSchedules(params: GetTaskSchedulesParams): Promise<TaskSchedule[]>;
64
105
  }
@@ -29,6 +29,15 @@ export interface GetFirmwareUpgradeTasksParams {
29
29
  offset?: number;
30
30
  };
31
31
  }
32
+ export interface GetFirmwareAutoUpgradeBlacklistParams {
33
+ filters: {
34
+ clientId: number;
35
+ };
36
+ pagingOptions?: {
37
+ limit?: number;
38
+ offset?: number;
39
+ };
40
+ }
32
41
  export interface GetFirmwareUpgradeTasksCountParams {
33
42
  filters: {
34
43
  deviceId?: number;
@@ -62,6 +71,10 @@ export interface CreateDeviceFirmwareParams {
62
71
  qmsRate?: number;
63
72
  pendingTimeout?: number;
64
73
  }
74
+ export interface CreateFirmwareAutoUpgradeBlacklistParams {
75
+ clientId: number;
76
+ deviceTypeId?: number;
77
+ }
65
78
  export declare enum FirmwareUpgradeTaskStatus {
66
79
  Queued = "Queued",
67
80
  QueuedWaitingForConfig = "QueuedWaitingForConfig",
@@ -47,3 +47,34 @@ export interface DeleteTaskScheduleParams {
47
47
  id: number;
48
48
  deletedBy: string;
49
49
  }
50
+ export interface RangeFilter<T> {
51
+ minValue?: T;
52
+ maxValue?: T;
53
+ }
54
+ export interface GetTaskSchedulesFilters {
55
+ imei?: string;
56
+ clientId?: number;
57
+ title?: string;
58
+ description?: string;
59
+ repeats?: boolean;
60
+ dueDateFilter: RangeFilter<Date>;
61
+ dueOdometerFilter: RangeFilter<number>;
62
+ dueActiveHoursFilter: RangeFilter<number>;
63
+ intervalDaysFilter: RangeFilter<number>;
64
+ intervalStartDateFilter: RangeFilter<Date>;
65
+ intervalOdometerFilter: RangeFilter<number>;
66
+ intervalStartingOdometerFilter: RangeFilter<number>;
67
+ intervalActiveHoursFilter: RangeFilter<number>;
68
+ intervalStartingActiveHoursFilter: RangeFilter<number>;
69
+ notes?: string;
70
+ createdBy?: string;
71
+ createdAtFilter?: RangeFilter<Date>;
72
+ modifiedBy?: string;
73
+ modifiedAtFilter?: RangeFilter<Date>;
74
+ deletedBy?: string;
75
+ deletedAtFilter?: RangeFilter<Date>;
76
+ status?: 'active' | 'deleted';
77
+ }
78
+ export interface GetTaskSchedulesParams {
79
+ filters: GetTaskSchedulesFilters;
80
+ }
@@ -0,0 +1 @@
1
+ export declare const anyAttributeHasValue: <T>(obj: T) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.186",
3
+ "version": "0.0.188",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",