@spytecgps/nova-orm 0.0.106 → 0.0.108

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,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { CanceledDeviceWithActiveSimCard, GetCanceledDevicesWithActiveSimCardsParams } from '../../types/devices';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const getCanceledDevicesWithActiveSimCards: (novaDataSource: NovaDataSource, params: GetCanceledDevicesWithActiveSimCardsParams, logger: Logger) => Promise<CanceledDeviceWithActiveSimCard[]>;
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { CarrierStatus, GetCarrierStatusUpdatedBeforeParams } from '../../types/devices';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const getCarrierStatusUpdatedBefore: (novaDataSource: NovaDataSource, params: GetCarrierStatusUpdatedBeforeParams, logger: Logger) => Promise<CarrierStatus[]>;
@@ -0,0 +1,5 @@
1
+ import { IccidStatus } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { GetIccidStatusParams } from '../../types/devices';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getIccidStatus: (novaDataSource: NovaDataSource, params: GetIccidStatusParams, logger: Logger) => Promise<IccidStatus>;
@@ -1,5 +1,5 @@
1
- import { ClientDeviceSetting, Device, DeviceCustomConfiguration, DeviceReplacement, DeviceType, ImeiIccidCarrier } from '../../entities';
2
- import { CreateClientDeviceSettingParams, CreateDeviceParams, CreateDeviceReplacementParams, DeleteDeviceParams, DeviceTypeModelWithDeviceCount, GenerateIdentifierKeyParams, GetClientDeviceSettingParams, GetClientDeviceSettingsParams, GetDeviceCustomConfigParams, GetDeviceParams, GetDevicesParams, GetDeviceTypesModelsOrderedByDeviceCountParams, GetDeviceTypesParams, GetFilteredImeisWithStatusParams, GetImeiIccidCarrierParams, GetImeiIccidCarriersParams, UpdateClientDeviceSettingParams, UpdateDeviceParams, UpdateImeiIccidCarrierParams } from '../../types/devices';
1
+ import { ClientDeviceSetting, Device, DeviceCustomConfiguration, DeviceReplacement, DeviceType, IccidStatus, ImeiIccidCarrier } from '../../entities';
2
+ import { CanceledDeviceWithActiveSimCard, CarrierStatus, CreateClientDeviceSettingParams, CreateDeviceParams, CreateDeviceReplacementParams, DeleteDeviceParams, DeviceTypeModelWithDeviceCount, GenerateIdentifierKeyParams, GetCanceledDevicesWithActiveSimCardsParams, GetCarrierStatusUpdatedBeforeParams, GetClientDeviceSettingParams, GetClientDeviceSettingsParams, GetDeviceCustomConfigParams, GetDeviceParams, GetDevicesParams, GetDeviceTypesModelsOrderedByDeviceCountParams, GetDeviceTypesParams, GetFilteredImeisWithStatusParams, GetIccidStatusParams, GetImeiIccidCarrierParams, GetImeiIccidCarriersParams, UpdateClientDeviceSettingParams, UpdateDeviceParams, UpdateIccidStatusParams, UpdateImeiIccidCarrierParams, UpsertIccidStatusParams } from '../../types/devices';
3
3
  import { BaseRepository } from './../baseRepository';
4
4
  export declare class DevicesRepository extends BaseRepository {
5
5
  /**
@@ -202,4 +202,46 @@ export declare class DevicesRepository extends BaseRepository {
202
202
  * @returns {Promise<DeviceReplacement>} The created device replacement
203
203
  */
204
204
  createDeviceReplacement(params: CreateDeviceReplacementParams): Promise<DeviceReplacement>;
205
+ /**
206
+ * Get the iccid status for a given iccid
207
+ * @param {GetIccidStatusParams} params containing information to get the iccid status
208
+ * - filters.iccid: The iccid of the device
209
+ * @returns The iccid status
210
+ */
211
+ getIccidStatus(params: GetIccidStatusParams): Promise<IccidStatus>;
212
+ /**
213
+ * Update the iccid status for a given iccid
214
+ * @param {UpdateIccidStatusParams} params containing information to update the iccid status
215
+ * - filters.iccid: The iccid of the device
216
+ * - values.status: The status of the iccid
217
+ * - values.processing: Whether the iccid is processing
218
+ * - values.carrierFound: Whether the carrier was found
219
+ * @returns Whether the iccid status was updated
220
+ */
221
+ updateIccidStatus(params: UpdateIccidStatusParams): Promise<boolean>;
222
+ /**
223
+ * Get the canceled devices with active sim cards
224
+ * @param {GetCanceledDevicesWithActiveSimCardsParams} params containing information to get the canceled devices with active sim cards
225
+ * - filters.lastAnalyzedDeviceId: The last analyzed device id
226
+ * - pagingOptions.limit: The amount of devices to get
227
+ * @returns The canceled devices with active sim cards
228
+ */
229
+ getCanceledDevicesWithActiveSimCards(params: GetCanceledDevicesWithActiveSimCardsParams): Promise<CanceledDeviceWithActiveSimCard[]>;
230
+ /**
231
+ * Get the carrier status for all devices updated before a given date
232
+ * @param {GetCarrierStatusUpdatedBeforeParams} params containing information to get the carrier status
233
+ * - filters.beforeDate: The date to compare
234
+ * - pagingOptions.limit: The amount of devices to get
235
+ * @returns The carrier status for devices updated before a given date
236
+ */
237
+ getCarrierStatusUpdatedBefore(params: GetCarrierStatusUpdatedBeforeParams): Promise<CarrierStatus[]>;
238
+ /**
239
+ * Upsert the iccid status for a given iccid
240
+ * @param {UpsertIccidStatusParams} params containing information to upsert the iccid status
241
+ * - iccid: The iccid of the device
242
+ * - status: The status of the iccid
243
+ * - carrierFound: The carrier found
244
+ * @returns Whether the iccid status was upserted
245
+ */
246
+ upsertIccidStatus(params: UpsertIccidStatusParams): Promise<boolean>;
205
247
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { UpdateIccidStatusParams } from '../../types/devices';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const updateIccidStatus: (novaDataSource: NovaDataSource, params: UpdateIccidStatusParams, logger: Logger) => Promise<boolean>;
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { UpsertIccidStatusParams } from '../../types/devices';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const upsertIccidStatus: (novaDataSource: NovaDataSource, params: UpsertIccidStatusParams, logger: Logger) => Promise<boolean>;
@@ -180,3 +180,59 @@ export interface CreateDeviceReplacementParams {
180
180
  userId: string;
181
181
  clientId: number;
182
182
  }
183
+ export interface GetIccidStatusParams {
184
+ filters: {
185
+ iccid: string;
186
+ };
187
+ }
188
+ export interface UpdateIccidStatusParams {
189
+ filters: {
190
+ iccid: string;
191
+ };
192
+ values: {
193
+ status?: string;
194
+ processing?: boolean;
195
+ carrierFound?: number;
196
+ };
197
+ }
198
+ export interface GetCanceledDevicesWithActiveSimCardsParams {
199
+ filters: {
200
+ lastAnalyzedDeviceId: number;
201
+ };
202
+ pagingOptions: {
203
+ limit: number;
204
+ };
205
+ }
206
+ export interface CanceledDeviceWithActiveSimCard {
207
+ imei: string;
208
+ iccid: string;
209
+ clientId: number;
210
+ carrier: string;
211
+ deviceId: number;
212
+ }
213
+ export interface GetCarrierStatusUpdatedBeforeParams {
214
+ filters: {
215
+ beforeDate: Date;
216
+ };
217
+ pagingOptions: {
218
+ limit: number;
219
+ };
220
+ }
221
+ export interface CarrierStatus {
222
+ iccid: string;
223
+ status?: string;
224
+ processing?: boolean;
225
+ carrierFound?: number;
226
+ modifiedAt?: Date;
227
+ carrier?: number;
228
+ }
229
+ export interface UpsertIccidStatusParams {
230
+ values: {
231
+ iccid: string;
232
+ status?: string | null;
233
+ carrierFound?: number | null;
234
+ };
235
+ options?: {
236
+ updateProcessing: boolean;
237
+ };
238
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",