@spytecgps/nova-orm 0.0.164 → 0.0.166
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.
- package/dist/index.js +1 -1
- package/dist/repositories/firmwares/index.d.ts +21 -1
- package/dist/repositories/firmwares/updateDeviceFirmware.d.ts +4 -0
- package/dist/repositories/notificationRecipients/index.d.ts +14 -1
- package/dist/repositories/notificationRecipients/updateUsersNotificationsUnsuscribedInfoStatus.d.ts +4 -0
- package/dist/types/firmwares.d.ts +18 -0
- package/dist/types/notificationRecipients.d.ts +11 -0
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeviceTypeFirmware, FirmwareUpgradeTask } from '../../entities';
|
|
2
|
-
import { CreateDeviceFirmwareParams, CreateFirmwareUpgradeTaskParams, GetDeviceFirmwaresParams, GetFirmwareUpgradeTasksCountParams, GetFirmwareUpgradeTasksParams, UpdateFirmwareUpgradeTaskParams } from '../../types/firmwares';
|
|
2
|
+
import { CreateDeviceFirmwareParams, CreateFirmwareUpgradeTaskParams, GetDeviceFirmwaresParams, GetFirmwareUpgradeTasksCountParams, GetFirmwareUpgradeTasksParams, UpdateDeviceFirmwareParams, UpdateFirmwareUpgradeTaskParams } from '../../types/firmwares';
|
|
3
3
|
import { BaseRepository } from '../baseRepository';
|
|
4
4
|
export declare class FirmwaresRepository extends BaseRepository {
|
|
5
5
|
/**
|
|
@@ -92,4 +92,24 @@ export declare class FirmwaresRepository extends BaseRepository {
|
|
|
92
92
|
* @returns {boolea} Whether the firmware upgrade task is updated or not.
|
|
93
93
|
*/
|
|
94
94
|
updateFirmwareUpgradeTasks(params: UpdateFirmwareUpgradeTaskParams): Promise<boolean>;
|
|
95
|
+
/**
|
|
96
|
+
* Update a device firmware.
|
|
97
|
+
* @param {UpdateDeviceFirmwareParams} params containing information to update a devicetype firmware.
|
|
98
|
+
* - id: The device type firmware id
|
|
99
|
+
- deviceTypeId: The device type id
|
|
100
|
+
* - description: The description of the firmware version
|
|
101
|
+
* - enabled: Whether the firmware version is enabled or not
|
|
102
|
+
* - firmwareCode: The firmware version code
|
|
103
|
+
* - firmwareVersion: The firmware version after the firmware version is upgraded
|
|
104
|
+
* - firmwareUrl: The url to download the firmware
|
|
105
|
+
* - releaseDate: The date when the firmware version is released
|
|
106
|
+
* - sourceFirmwareVersion: The source firmware version that needs to match to apply this new firmware version. It can be null, if not precise version is needed.
|
|
107
|
+
* - upgradeType: The upgrade type depending on the module type
|
|
108
|
+
* - 0: BB
|
|
109
|
+
* - 1: MCU
|
|
110
|
+
* - 2: BLE
|
|
111
|
+
* - 7: MODEM
|
|
112
|
+
* @returns {boolean} Whether the device firmware is updated or not.
|
|
113
|
+
*/
|
|
114
|
+
updateDeviceFirmware(params: UpdateDeviceFirmwareParams): Promise<boolean>;
|
|
95
115
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { UpdateDeviceFirmwareParams } from '../../types/firmwares';
|
|
3
|
+
import { Logger } from '../../types/logger';
|
|
4
|
+
export declare const updateDeviceFirmware: (novaDataSource: NovaDataSource, params: UpdateDeviceFirmwareParams, logger: Logger) => Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NotificationRecipient } from '../../entities';
|
|
2
|
-
import { CreateNotificationRecipientParams, DeleteNotificationRecipientsByEmailOrPhoneParams, DeleteNotificationRecipientsParams, GetNotificationRecipientsParams, UpdateNotificationRecipientParams, UpdateUsersNotificationsUnsuscribedStatusParams } from '../../types/notificationRecipients';
|
|
2
|
+
import { CreateNotificationRecipientParams, DeleteNotificationRecipientsByEmailOrPhoneParams, DeleteNotificationRecipientsParams, GetNotificationRecipientsParams, UpdateNotificationRecipientParams, UpdateUsersNotificationsUnsubscribedInfoStatusParams, UpdateUsersNotificationsUnsuscribedStatusParams } from '../../types/notificationRecipients';
|
|
3
3
|
import { BaseRepository } from '../baseRepository';
|
|
4
4
|
export declare class NotificationRecipientsRepository extends BaseRepository {
|
|
5
5
|
/**
|
|
@@ -38,6 +38,7 @@ export declare class NotificationRecipientsRepository extends BaseRepository {
|
|
|
38
38
|
*/
|
|
39
39
|
updateNotificationRecipient(params: UpdateNotificationRecipientParams): Promise<boolean>;
|
|
40
40
|
/**
|
|
41
|
+
* @deprecated The method should not be used, use 'updateUsersNotificationsUnsuscribedInfoStatus'
|
|
41
42
|
* Update users notifications unsubscribed status
|
|
42
43
|
* @param {UpdateUsersNotificationsUnsuscribedStatusParams} params containing information to update users notifications unsubscribed status
|
|
43
44
|
* - params.filters: Using these filters, the query will update the users notifications unsubscribed
|
|
@@ -49,6 +50,18 @@ export declare class NotificationRecipientsRepository extends BaseRepository {
|
|
|
49
50
|
* @returns Whether the users notifications unsubscribed status was updated or not
|
|
50
51
|
*/
|
|
51
52
|
updateUsersNotificationsUnsuscribedStatus(params: UpdateUsersNotificationsUnsuscribedStatusParams): Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Update users notifications unsubscribed status
|
|
55
|
+
* @param {UpdateUsersNotificationsUnsuscribedInfoParams} params containing information to update users notifications unsubscribed status
|
|
56
|
+
* - params.filters: Using these filters, the query will update the users notifications unsubscribed
|
|
57
|
+
* status for all users with the corresponding phone number.
|
|
58
|
+
* The user country code will be used to remove the country code from the phone number before comparing it with the user phone number.
|
|
59
|
+
* - params.filters.userPhone: The user phone
|
|
60
|
+
* - params.filters.userCountryCode: The user country code
|
|
61
|
+
* - params.values.unsubscribed: The unsubscribed flag, optional
|
|
62
|
+
* @returns Whether the users notifications unsubscribed status was updated or not
|
|
63
|
+
*/
|
|
64
|
+
updateUsersNotificationsUnsuscribedInfoStatus(params: UpdateUsersNotificationsUnsubscribedInfoStatusParams): Promise<boolean>;
|
|
52
65
|
/**
|
|
53
66
|
* Delete notification recipients
|
|
54
67
|
* @param {DeleteNotificationRecipientsParams} params containing information to delete notification recipients
|
package/dist/repositories/notificationRecipients/updateUsersNotificationsUnsuscribedInfoStatus.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { UpdateUsersNotificationsUnsubscribedInfoStatusParams } from '../../types/notificationRecipients';
|
|
4
|
+
export declare const updateUsersNotificationsUnsuscribedInfoStatus: (novaDataSource: NovaDataSource, params: UpdateUsersNotificationsUnsubscribedInfoStatusParams, logger: Logger) => Promise<boolean>;
|
|
@@ -97,3 +97,21 @@ export interface UpdateFirmwareUpgradeTaskParams {
|
|
|
97
97
|
commandsTaskId?: string;
|
|
98
98
|
postUpgradeCompleted?: boolean;
|
|
99
99
|
}
|
|
100
|
+
export interface UpdateDeviceFirmwareParams {
|
|
101
|
+
id: number;
|
|
102
|
+
deviceTypeId: number;
|
|
103
|
+
sourceFirmwareVersion?: string;
|
|
104
|
+
firmwareVersion: string;
|
|
105
|
+
firmwareCode: string;
|
|
106
|
+
firmwareUrl: string;
|
|
107
|
+
releaseDate: Date;
|
|
108
|
+
description: string;
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
upgradeType: UpgradeType;
|
|
111
|
+
stage?: string;
|
|
112
|
+
postUpgradeConfig?: string;
|
|
113
|
+
parentId?: number;
|
|
114
|
+
maxDeployPercentage?: number;
|
|
115
|
+
qmsRate?: number;
|
|
116
|
+
pendingTimeout?: number;
|
|
117
|
+
}
|
|
@@ -39,6 +39,17 @@ export interface UpdateUsersNotificationsUnsuscribedStatusParams {
|
|
|
39
39
|
unsubscribedInfo?: string;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
+
export interface UpdateUsersNotificationsUnsubscribedInfoStatusParams {
|
|
43
|
+
filters: {
|
|
44
|
+
recipient: string;
|
|
45
|
+
notificationType: NotificationRecipientType;
|
|
46
|
+
countryCode?: string;
|
|
47
|
+
};
|
|
48
|
+
values: {
|
|
49
|
+
unsubscribed: boolean;
|
|
50
|
+
unsubscribedInfo: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
42
53
|
export interface DeleteNotificationRecipientsParams {
|
|
43
54
|
filters: {
|
|
44
55
|
id?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spytecgps/nova-orm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.166",
|
|
4
4
|
"description": "ORM with PlanetScale",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"prepare": "npm run build",
|
|
38
|
-
"test": "yarn jest --ci --runInBand --reporters=default --reporters=jest-junit --collectCoverage=true",
|
|
38
|
+
"test": "git update-index --skip-worktree test/utils/setEnvVars.ts && yarn jest --ci --runInBand --reporters=default --reporters=jest-junit --collectCoverage=true",
|
|
39
39
|
"typeorm": "typeorm-ts-node-commonjs",
|
|
40
40
|
"lint": "eslint \"./src/**\"",
|
|
41
41
|
"lint-fix": "eslint \"./src/**\" --fix",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"build-dev": "webpack --mode=development",
|
|
44
44
|
"build": "webpack --mode=production",
|
|
45
45
|
"copydistfolder": "./scripts/copyDistFolder.sh",
|
|
46
|
-
"schema-sync": "yarn typeorm schema:drop --dataSource ./data-source.ts && yarn typeorm schema:sync --dataSource ./data-source.ts && yarn typeorm migration:run --dataSource ./data-source.ts"
|
|
46
|
+
"schema-sync": "git update-index --skip-worktree test/utils/setEnvVars.ts && yarn typeorm schema:drop --dataSource ./data-source.ts && yarn typeorm schema:sync --dataSource ./data-source.ts && yarn typeorm migration:run --dataSource ./data-source.ts"
|
|
47
47
|
},
|
|
48
48
|
"author": "Spytec",
|
|
49
49
|
"license": "ISC",
|