@spytecgps/nova-orm 0.0.197 → 0.0.198

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.
@@ -1,5 +1,5 @@
1
1
  import { DeviceTask, Task, TaskSchedule } from '../../entities';
2
- import { AddTaskScheduleDevicesParams, CreateTaskParams, CreateTaskScheduleParams, DeleteTaskScheduleDevicesParams, DeleteTaskScheduleParams, GetDeviceTasksParams, GetTaskScheduleParams, GetTaskSchedulesParams, GetTasksParams, SetTaskScheduleDevicesParams, UpdateTaskScheduleParams } from '../../types/tasks';
2
+ import { AddTaskScheduleDevicesParams, CreateTaskParams, CreateTaskScheduleParams, DeleteTaskScheduleDevicesParams, DeleteTaskScheduleParams, GetDeviceTasksParams, GetTaskScheduleParams, GetTaskSchedulesParams, GetTasksParams, SetTaskScheduleDevicesParams, UpdateTaskParams, UpdateTaskScheduleParams } from '../../types/tasks';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class TasksRepository extends BaseRepository {
5
5
  /**
@@ -189,4 +189,21 @@ export declare class TasksRepository extends BaseRepository {
189
189
  * @returns Promise<Task[]> the tasks corresponding to the filters
190
190
  */
191
191
  getTasks(params: GetTasksParams): Promise<Task[]>;
192
+ /**
193
+ * Update an existing task
194
+ * @param params params containing information to update task
195
+ * params.filters.id: the ID, required
196
+ * params.values.modifiedBy: the modified by, required
197
+ * One of dueDate, dueOdometer, or dueActiveHours is required:
198
+ * params.values.dueDate: the due date, optional
199
+ * params.values.dueOdometer: the due odometer, optional
200
+ * params.values.dueActiveHours: the due active hours, optional
201
+ * params.values.startDate: the starting date, optional
202
+ * params.values.startingOdometer: the starting odometer, optional
203
+ * params.values.startingActiveHours: the starting active hours, optional
204
+ * params.values.predictedDueDate: the predicted due date, optional
205
+ * params.values.queuedAt: the queued at, optional
206
+ * @returns Promise<boolean> whether the task was updated
207
+ */
208
+ updateTask(params: UpdateTaskParams): Promise<boolean>;
192
209
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { Logger } from '../../types/logger';
3
+ import { UpdateTaskParams } from '../../types/tasks';
4
+ export declare const updateTask: (novaDataSource: NovaDataSource, params: UpdateTaskParams, logger: Logger) => Promise<boolean>;
@@ -138,3 +138,19 @@ export interface GetTasksFilters {
138
138
  export interface GetTasksParams {
139
139
  filters: GetTasksFilters;
140
140
  }
141
+ export interface UpdateTaskParams {
142
+ filters: {
143
+ id: number;
144
+ };
145
+ values: {
146
+ dueDate?: Date;
147
+ dueOdometer?: number;
148
+ dueActiveHours?: number;
149
+ modifiedBy: string;
150
+ startDate?: Date;
151
+ startingOdometer?: number;
152
+ startingActiveHours?: number;
153
+ predictedDueDate?: Date;
154
+ queuedAt?: Date;
155
+ };
156
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.197",
3
+ "version": "0.0.198",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",