@spytecgps/nova-orm 0.0.52 → 0.0.53

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 { UserAlertComplain } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { CreateUserAlertComplaintParams } from '../../types/alert';
4
+ export declare const createUserAlertComplain: (novaDataSource: NovaDataSource, params: CreateUserAlertComplaintParams) => Promise<UserAlertComplain>;
@@ -1,5 +1,5 @@
1
- import { Alert } from '../../entities';
2
- import { AlertReport, CreateAlertParams, GetAlertReportByUserParams } from '../../types/alert';
1
+ import { Alert, UserAlertComplain } from '../../entities';
2
+ import { AlertReport, CreateAlertParams, CreateUserAlertComplaintParams, GetAlertReportByUserParams } from '../../types/alert';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class AlertRepository extends BaseRepository {
5
5
  /** Create an alert record
@@ -40,4 +40,16 @@ export declare class AlertRepository extends BaseRepository {
40
40
  * @returns Promise<AlertReport[]>
41
41
  */
42
42
  getAlertsReportByUser(params: GetAlertReportByUserParams): Promise<AlertReport[]>;
43
+ /**
44
+ * Insert a new user alert complain
45
+ * @param {CreateUserAlertComplaintParams} params containing information to create a user alert complain
46
+ * params.alertTypeId: The alert type id that has been disabled
47
+ * params.userId: The user id of the user associated with the alert
48
+ * params.clientId: The client id of the owner of the device generating the alert
49
+ * params.email: The email of the user
50
+ * params.reason: The reason for disabling the alert
51
+ * params.createdAt: The datetime the complaint was received, it will default to now if not provided
52
+ * @returns {Promise<UserAlertComplain>} The created user alert complain
53
+ */
54
+ createUserAlertComplain(params: CreateUserAlertComplaintParams): Promise<UserAlertComplain>;
43
55
  }
@@ -72,3 +72,11 @@ export interface AlertReport {
72
72
  stage?: string | null;
73
73
  totalCount: number;
74
74
  }
75
+ export interface CreateUserAlertComplaintParams {
76
+ userId: string;
77
+ alertTypeId: number;
78
+ clientId: number;
79
+ createdAt?: Date;
80
+ email: string;
81
+ reason: string;
82
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",