@spytecgps/nova-orm 0.0.78 → 0.0.80

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,5 @@
1
+ import { User } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { GetUserByBraintreeCustomerIdParams } from '../../types/billing';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getUserByBraintreeCustomerId: (novaDataSource: NovaDataSource, params: GetUserByBraintreeCustomerIdParams, logger: Logger) => Promise<User>;
@@ -1,5 +1,5 @@
1
- import { Billing, BillingCustomerBraintree, BillingDeviceHistory, BillingStatusHistoryBraintree } from '../../entities';
2
- import { CreateBillingDeviceHistoryParams, CreateBillingParams, CreateBillingStatusHistoryBraintreeParams, GetBillingCustomerBraintreeByIdParams, GetBillingsParams, GetClientIdFromBraintreeCustomerParams, UpdateBillingCustomerBraintreeParams, UpdateBillingParams, UpsertBillingCustomerBraintreeParams } from '../../types/billing';
1
+ import { Billing, BillingCustomerBraintree, BillingDeviceHistory, BillingStatusHistoryBraintree, User } from '../../entities';
2
+ import { CreateBillingDeviceHistoryParams, CreateBillingParams, CreateBillingStatusHistoryBraintreeParams, GetBillingCustomerBraintreeByIdParams, GetBillingsParams, GetClientIdFromBraintreeCustomerParams, GetUserByBraintreeCustomerIdParams, UpdateBillingCustomerBraintreeParams, UpdateBillingParams, UpsertBillingCustomerBraintreeParams } from '../../types/billing';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class BillingRepository extends BaseRepository {
5
5
  /**
@@ -112,4 +112,11 @@ export declare class BillingRepository extends BaseRepository {
112
112
  * @returns The created billing device history information
113
113
  */
114
114
  createBillingDeviceHistory(params: CreateBillingDeviceHistoryParams): Promise<BillingDeviceHistory>;
115
+ /**
116
+ * Get user by braintree customer id
117
+ * @param {GetUserByBraintreeCustomerIdParams} params containing information to get user by braintree customer id
118
+ * - params.filters.customerId: The braintree customer id
119
+ * @returns The user information
120
+ */
121
+ getUserByBraintreeCustomerId(params: GetUserByBraintreeCustomerIdParams): Promise<User>;
115
122
  }
@@ -33,11 +33,15 @@ export interface GetAlertReportByUserParams extends ReportPagination {
33
33
  filters: {
34
34
  userId: string;
35
35
  imeis: string[];
36
+ clientId?: number | null;
36
37
  isTestEnvironment?: boolean | false;
37
38
  alertTypeIds?: number[] | null;
39
+ alertTypeNames?: string[] | null;
38
40
  boundaryId?: number | null;
39
41
  sendTimeFrom?: Date | null;
40
42
  sendTimeTo?: Date | null;
43
+ createdFrom?: Date | null;
44
+ createdTo?: Date | null;
41
45
  };
42
46
  }
43
47
  export interface GetAlertReportByClientParams extends ReportPagination {
@@ -52,9 +56,11 @@ export interface GetAlertReportByClientParams extends ReportPagination {
52
56
  export interface AlertReport {
53
57
  id: number;
54
58
  alertTypeId: number;
59
+ alertTypeName: string;
55
60
  value?: string | null;
56
61
  createdAt: Date;
57
62
  userId: Buffer;
63
+ clientId: number;
58
64
  messageId: Buffer;
59
65
  imei: string;
60
66
  sendTime: Date;
@@ -92,3 +92,8 @@ export interface CreateBillingDeviceHistoryParams {
92
92
  platform?: string;
93
93
  status?: string;
94
94
  }
95
+ export interface GetUserByBraintreeCustomerIdParams {
96
+ filters: {
97
+ customerId: string;
98
+ };
99
+ }
@@ -2,3 +2,4 @@ export declare const getRandomBoolean: () => boolean;
2
2
  export declare const getRandomInteger: (max: number) => number;
3
3
  export declare const getRandomString: (length: number) => string;
4
4
  export declare const getRandomImei: (length?: number) => string;
5
+ export declare const getRandomDateInRange: (rangeInDays: number) => Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",