@spytecgps/nova-orm 0.0.21 → 0.0.23
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/README.md +40 -1
- package/dist/entities/client.d.ts +5 -5
- package/dist/entities/device.d.ts +4 -2
- package/dist/entities/user.d.ts +8 -4
- package/dist/entities/userAlertConfiguration.d.ts +6 -2
- package/dist/entities/userConfiguration.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/repositories/clients/getClients.d.ts +5 -0
- package/dist/repositories/clients/index.d.ts +8 -4
- package/dist/types/clients.d.ts +5 -3
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -2,8 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
This package contains repositories and entities to connect to Planet Scale database using typeorm
|
|
4
4
|
|
|
5
|
+
## How to use?
|
|
6
|
+
|
|
7
|
+
### Installing
|
|
8
|
+
|
|
9
|
+
Clone the project locally with `git clone` to the desired folder and run `npm i` to install all the dependencies
|
|
10
|
+
|
|
11
|
+
### Linting and Formatting
|
|
12
|
+
|
|
13
|
+
Linting allows to run few code checks
|
|
14
|
+
|
|
15
|
+
Run `npm run lint`
|
|
16
|
+
_for any strict rule that can be followed, go to `tslint.json` and modify_
|
|
17
|
+
|
|
18
|
+
Run `npm run format` to update the code formatting
|
|
19
|
+
|
|
20
|
+
### Building
|
|
21
|
+
|
|
22
|
+
Building will generate a new folder with the source code and the type definitions
|
|
23
|
+
ready to be consumed as a package
|
|
24
|
+
|
|
25
|
+
Run `npm run build` to build all the content into the distribution folder ( `dist` in our case, although in can be changed to any other folder )
|
|
26
|
+
|
|
5
27
|
# SYNC the entities definition with Planet Scale schema:
|
|
6
28
|
|
|
7
29
|
1- Modify the url value for the data source in the file data-source.ts to use the dev branch connection string
|
|
8
30
|
|
|
9
|
-
2- Run the command npm run schema-sync
|
|
31
|
+
2- Run the command npm run schema-sync
|
|
32
|
+
|
|
33
|
+
### Usage
|
|
34
|
+
|
|
35
|
+
Go to the project you want to use the new package and either remove the package reference in dependencies from `package.json` or just update the version number matching the latest version just published to npm
|
|
36
|
+
|
|
37
|
+
Delete the @spytecgps/nova-orm folder from the node_modules folder to make sure the package will be using the lastest code
|
|
38
|
+
|
|
39
|
+
After that run `npm i @spytecgps/nova-orm` if you removed the dependency completely and this will bring the latest package, or run `npm i` if you just updated the version
|
|
40
|
+
|
|
41
|
+
### Copy Distribution folder to local project ((local testing))
|
|
42
|
+
|
|
43
|
+
when making changes and would like to avoid commiting and publishing changes.
|
|
44
|
+
|
|
45
|
+
1. Run `npm run build-prod` to build all the content into the distribution folder
|
|
46
|
+
2. Run `npm run copydistfolder -- {destPath}` to copy distribution folder to local project
|
|
47
|
+
ex: `npm run copydistfolder -- ../api-reports` copies dist folder to folder -> `api-reports/node_modules/@spytecgps/nova-orm/dist`
|
|
48
|
+
3. In order for VSCode to reload and get udpated nova-orm copied to node_modules dist folder -> On PC you can do Ctrl + Shift + P (mac: Cmd + Shift + P) then type "Reload Window"git
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Relation } from 'typeorm';
|
|
2
3
|
import { ClientType } from './clientType';
|
|
3
4
|
import { Device } from './device';
|
|
4
5
|
import { Organization } from './organization';
|
|
@@ -6,7 +7,6 @@ import { User } from './user';
|
|
|
6
7
|
export declare class Client {
|
|
7
8
|
id: number;
|
|
8
9
|
name: string | null;
|
|
9
|
-
appClientId: string | null;
|
|
10
10
|
createdAt: Date | null;
|
|
11
11
|
modifiedAt: Date | null;
|
|
12
12
|
uuid: Buffer | null;
|
|
@@ -17,7 +17,7 @@ export declare class Client {
|
|
|
17
17
|
sievaUserName: string | null;
|
|
18
18
|
sievaBatchId: number | null;
|
|
19
19
|
clientTypeId: number;
|
|
20
|
-
clientType: ClientType
|
|
20
|
+
clientType: Relation<ClientType>;
|
|
21
21
|
salesforceId: string | null;
|
|
22
22
|
accumaticaId: string | null;
|
|
23
23
|
expirationDate: Date | null;
|
|
@@ -25,7 +25,7 @@ export declare class Client {
|
|
|
25
25
|
btCustomerId: string | null;
|
|
26
26
|
activationCampaign: string | null;
|
|
27
27
|
organizationId: number | null;
|
|
28
|
-
organization: Organization
|
|
29
|
-
users: User[];
|
|
30
|
-
devices: Device[];
|
|
28
|
+
organization: Relation<Organization>;
|
|
29
|
+
users: Relation<User>[];
|
|
30
|
+
devices: Relation<Device>[];
|
|
31
31
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Relation } from 'typeorm';
|
|
2
3
|
import { Client } from './client';
|
|
3
4
|
import { DeviceType } from './deviceType';
|
|
4
5
|
import { ImeiIccidCarrier } from './imeiIccidCarrier';
|
|
@@ -7,8 +8,10 @@ export declare class Device {
|
|
|
7
8
|
identifier: string;
|
|
8
9
|
identifierKey: string;
|
|
9
10
|
deviceTypeId: number;
|
|
11
|
+
deviceType?: Relation<DeviceType>;
|
|
10
12
|
imei: string;
|
|
11
|
-
|
|
13
|
+
clientId: number;
|
|
14
|
+
client: Relation<Client>;
|
|
12
15
|
createdAt: Date | null;
|
|
13
16
|
brand: string | null;
|
|
14
17
|
model: string | null;
|
|
@@ -27,6 +30,5 @@ export declare class Device {
|
|
|
27
30
|
sievaBatchId: number | null;
|
|
28
31
|
assetCategoryId: number | null;
|
|
29
32
|
usageRegion: string | null;
|
|
30
|
-
deviceType?: DeviceType;
|
|
31
33
|
iccidCarrier?: ImeiIccidCarrier;
|
|
32
34
|
}
|
package/dist/entities/user.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Relation } from 'typeorm';
|
|
2
3
|
import { Client } from './client';
|
|
3
4
|
import { Country } from './country';
|
|
5
|
+
import { UserAlertConfiguration } from './userAlertConfiguration';
|
|
4
6
|
import { UserConfiguration } from './userConfiguration';
|
|
5
7
|
export declare class User {
|
|
6
8
|
id: Buffer;
|
|
@@ -17,16 +19,18 @@ export declare class User {
|
|
|
17
19
|
createdAt: Date | null;
|
|
18
20
|
modifiedAt: Date | null;
|
|
19
21
|
status: string | null;
|
|
20
|
-
|
|
22
|
+
clientId: number;
|
|
23
|
+
client: Relation<Client>;
|
|
21
24
|
pincode: string | null;
|
|
22
25
|
isAdmin: boolean;
|
|
23
|
-
|
|
26
|
+
countryId: number | null;
|
|
27
|
+
country: Relation<Country>;
|
|
24
28
|
dataSourceTypeId: number | null;
|
|
25
29
|
preferredUserName: string | null;
|
|
26
30
|
lastLoginAt: Date | null;
|
|
27
31
|
emailVerified: boolean;
|
|
28
32
|
lat: number | null;
|
|
29
33
|
lon: number | null;
|
|
30
|
-
userConfiguration: UserConfiguration
|
|
31
|
-
userAlertConfiguration:
|
|
34
|
+
userConfiguration: Relation<UserConfiguration>;
|
|
35
|
+
userAlertConfiguration: Relation<UserAlertConfiguration>[];
|
|
32
36
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Relation } from 'typeorm';
|
|
1
3
|
import { AlertType } from './alertType';
|
|
2
4
|
import { User } from './user';
|
|
3
5
|
export declare class UserAlertConfiguration {
|
|
4
6
|
id: number;
|
|
5
|
-
|
|
7
|
+
userId: Buffer;
|
|
8
|
+
user: Relation<User>;
|
|
6
9
|
smsNotification: boolean | null;
|
|
7
10
|
emailNotification: boolean | null;
|
|
8
|
-
|
|
11
|
+
alertTypeId: number;
|
|
12
|
+
alertType: Relation<AlertType>;
|
|
9
13
|
alertValue: string | null;
|
|
10
14
|
appNotification: boolean | null;
|
|
11
15
|
dataSourceTypeId: number | null;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Relation } from 'typeorm';
|
|
1
3
|
import { User } from './user';
|
|
2
4
|
export declare class UserConfiguration {
|
|
3
5
|
id: number;
|
|
4
|
-
|
|
6
|
+
userId: Buffer;
|
|
7
|
+
user: Relation<User>;
|
|
5
8
|
isMetric: boolean;
|
|
6
9
|
timezone: string | null;
|
|
7
10
|
createdAt: Date | null;
|