@spytecgps/nova-orm 0.0.137 → 0.0.139

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 { Logger } from '../../types/logger';
3
+ import { DeleteAccountParams } from '../../types/user';
4
+ export declare const deleteAccount: (novaDataSource: NovaDataSource, params: DeleteAccountParams, logger: Logger) => Promise<boolean>;
@@ -1,5 +1,5 @@
1
1
  import { User } from '../../entities/user';
2
- import { CreateUserParams, DeleteUserParams, GetUserByIdParams, GetUsersConfigurationByImeiParams, GetUsersDataParams, GetUsersIdsByPhoneAndCountryCodeParams, GetUsersParams, GetUsersWithRolesParams, UpdateUserParams, UserData, UserWithRole } from '../../types/user';
2
+ import { CreateUserParams, DeleteAccountParams, DeleteUserParams, GetUserByIdParams, GetUsersConfigurationByImeiParams, GetUsersDataParams, GetUsersIdsByPhoneAndCountryCodeParams, GetUsersParams, GetUsersWithRolesParams, UpdateUserParams, UserData, UserWithRole } from '../../types/user';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class UsersRepository extends BaseRepository {
5
5
  /**
@@ -115,4 +115,12 @@ export declare class UsersRepository extends BaseRepository {
115
115
  * @returns The array of users data
116
116
  */
117
117
  getUsersData(params: GetUsersDataParams): Promise<UserData[]>;
118
+ /**
119
+ * Delete an account
120
+ * @param {DeleteAccountParams} params containing information to delete an account
121
+ * - filters.userId: The user id to delete the account
122
+ * - filters.clientId: The client id to delete the account
123
+ * @returns Whether the account was deleted or not
124
+ */
125
+ deleteAccount(params: DeleteAccountParams): Promise<boolean>;
118
126
  }
@@ -119,3 +119,10 @@ export interface UserData {
119
119
  phoneNumbers: string[];
120
120
  emailAddresses: string[];
121
121
  }
122
+ export interface DeleteAccountParams {
123
+ filters: {
124
+ userId?: string;
125
+ clientId?: number;
126
+ email?: string;
127
+ };
128
+ }
@@ -55,6 +55,7 @@ export interface GetDeviceAlertTimeWindowsParams {
55
55
  filters: {
56
56
  imei?: string;
57
57
  clientId?: number;
58
+ userId?: string;
58
59
  };
59
60
  }
60
61
  export interface CreateUserAlertConfigurationParams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.137",
3
+ "version": "0.0.139",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",