@spytecgps/nova-orm 1.0.13 → 1.0.14

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.
@@ -37,6 +37,9 @@ export const getDeviceStatuses = async (novaDataSource, params, logger) => {
37
37
  if (params.projectionOptions?.withClientDeviceSettings) {
38
38
  queryBuilder = queryBuilder.leftJoinAndMapOne('deviceStatus.clientDeviceSetting', ClientDeviceSetting, 'clientDeviceSetting', 'deviceStatus.imei = clientDeviceSetting.imei and deviceStatus.clientId = clientDeviceSetting.clientId');
39
39
  }
40
+ queryBuilder = queryBuilder
41
+ .limit(params.pagingOptions?.limit ?? 100)
42
+ .offset(params.pagingOptions?.offset ?? 0);
40
43
  const deviceStatuses = await queryBuilder.getMany();
41
44
  return deviceStatuses;
42
45
  }, 'DeviceStatusRepository::getDevice');
@@ -22,6 +22,10 @@ export interface GetDeviceStatusesParams {
22
22
  withClientDeviceSettings?: boolean;
23
23
  clientDeviceSettingsProperties?: (keyof ClientDeviceSetting)[];
24
24
  };
25
+ pagingOptions?: {
26
+ limit?: number;
27
+ offset?: number;
28
+ };
25
29
  }
26
30
  export interface UpsertDeviceStatusesParams {
27
31
  items: DeviceStatusEntity[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",