@spytecgps/nova-orm 0.0.36 → 0.0.38

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,3 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { DeviceTypeModelWithDeviceCount, GetDeviceTypesModelsOrderedByDeviceCountParams } from '../../types/devices';
3
+ export declare const getDeviceTypesModelsOrderedByDeviceCount: (novaDataSource: NovaDataSource, params: GetDeviceTypesModelsOrderedByDeviceCountParams) => Promise<DeviceTypeModelWithDeviceCount[]>;
@@ -1,5 +1,5 @@
1
1
  import { ClientDeviceSetting, Device, DeviceType, ImeiIccidCarrier } from '../../entities';
2
- import { CreateClientDeviceSettingParams, CreateDeviceParams, DeleteDeviceParams, GenerateIdentifierKeyParams, GetClientDeviceSettingParams, GetClientDeviceSettingsParams, GetDeviceParams, GetDevicesParams, GetDeviceTypesParams, GetFilteredImeisWithStatusParams, GetImeiIccidCarrierParams, GetImeiIccidCarriersParams, UpdateClientDeviceSettingParams, UpdateDeviceParams, UpdateImeiIccidCarrierParams } from '../../types/devices';
2
+ import { CreateClientDeviceSettingParams, CreateDeviceParams, DeleteDeviceParams, DeviceTypeModelWithDeviceCount, GenerateIdentifierKeyParams, GetClientDeviceSettingParams, GetClientDeviceSettingsParams, GetDeviceParams, GetDevicesParams, GetDeviceTypesModelsOrderedByDeviceCountParams, GetDeviceTypesParams, GetFilteredImeisWithStatusParams, GetImeiIccidCarrierParams, GetImeiIccidCarriersParams, UpdateClientDeviceSettingParams, UpdateDeviceParams, UpdateImeiIccidCarrierParams } from '../../types/devices';
3
3
  import { BaseRepository } from './../baseRepository';
4
4
  export declare class DevicesRepository extends BaseRepository {
5
5
  /**
@@ -175,4 +175,10 @@ export declare class DevicesRepository extends BaseRepository {
175
175
  * @returns {Promise<boolean>} Whether the ClientDeviceSetting was updated
176
176
  */
177
177
  updateClientDeviceSetting(params: UpdateClientDeviceSettingParams): Promise<boolean>;
178
+ /**
179
+ * Get a list of DeviceTypeModel with the count of associated devices, ordered by device count
180
+ * @param {GetDeviceTypesModelsOrderedByDeviceCountParams} params containing information to get DeviceTypeModelWithDeviceCount
181
+ * - filters.deviceStatus: The device status to filter by, optional. If not provided, all devices will be counted
182
+ */
183
+ getDeviceTypesModelsOrderedByDeviceCount(params: GetDeviceTypesModelsOrderedByDeviceCountParams): Promise<DeviceTypeModelWithDeviceCount[]>;
178
184
  }
@@ -151,3 +151,15 @@ export interface UpdateClientDeviceSettingParams {
151
151
  externalBatteryInformation?: boolean;
152
152
  };
153
153
  }
154
+ export interface GetDeviceTypesModelsOrderedByDeviceCountParams {
155
+ filters: {
156
+ deviceStatus?: DeviceStatus;
157
+ };
158
+ }
159
+ export interface DeviceTypeModelWithDeviceCount {
160
+ id: number;
161
+ model: string;
162
+ protocol: string;
163
+ protocolMatch: string;
164
+ deviceCount: number;
165
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",