@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.
@@ -0,0 +1,5 @@
1
+ import { Client } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { GetClientsParams } from '../../types/clients';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getClients: (novaDataSource: NovaDataSource, params: GetClientsParams, logger: Logger) => Promise<Client[]>;
@@ -1,21 +1,26 @@
1
1
  import { Client, ClientConfiguration } from '../../entities';
2
- import { CreateClientConfigurationParams, CreateClientParams, DeleteClientParams, GetClientConfigurationParams, GetClientParams, UpdateClientConfigurationParams, UpdateClientParams } from '../../types/clients';
2
+ import { CreateClientConfigurationParams, CreateClientParams, DeleteClientParams, GetClientConfigurationParams, GetClientParams, GetClientsParams, UpdateClientConfigurationParams, UpdateClientParams } from '../../types/clients';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class ClientsRepository extends BaseRepository {
5
5
  /**
6
- * Get a client by id or email
6
+ * Get a client with filters. If multiple clients are found, the first one is returned.
7
7
  * @param {GetClientParams} params containing information to get a client
8
8
  * - filters.clientId: The client id, optional
9
9
  * - filters.email: The email, optional
10
10
  */
11
11
  getClient(params: GetClientParams): Promise<Client>;
12
+ /**
13
+ * Get clients with filters. If multiple clients are found, all are returned.
14
+ * @param {GetClientsParams} params containing information to get clients
15
+ * - filters.email: The email filter
16
+ */
17
+ getClients(params: GetClientsParams): Promise<Client[]>;
12
18
  /**
13
19
  * Create client
14
20
  * @param {CreateClientParams} params containing information to create a client
15
21
  * - name: client name
16
22
  * - email: client email
17
23
  * - uuid: client uuid
18
- * - appClientId: app client id, optional
19
24
  * - clientTypeId: client type id, optional
20
25
  * - dataSourceTypeId: data source type id, optional
21
26
  * - sievaUserName: sieva user name, optional
@@ -37,7 +42,6 @@ export declare class ClientsRepository extends BaseRepository {
37
42
  * - values.name: client name, optional
38
43
  * - values.email: client email, optional
39
44
  * - values.uuid: client uuid, optional
40
- * - values.appClientId: app client id, optional
41
45
  * - values.clientTypeId: client type id, optional
42
46
  * - values.dataSourceTypeId: data source type id, optional
43
47
  * - values.sievaUserName: sieva user name, optional
@@ -3,14 +3,17 @@ export interface GetClientParams {
3
3
  filters: {
4
4
  clientId?: number;
5
5
  email?: string;
6
- appClientId?: string;
6
+ };
7
+ }
8
+ export interface GetClientsParams {
9
+ filters: {
10
+ email: string;
7
11
  };
8
12
  }
9
13
  export interface CreateClientParams {
10
14
  name: string;
11
15
  uuid: string;
12
16
  email: string;
13
- appClientId?: string;
14
17
  clientTypeId?: HapnClientType;
15
18
  dataSourceTypeId?: number;
16
19
  sievaUserName?: string;
@@ -31,7 +34,6 @@ export interface UpdateClientParams {
31
34
  name?: string;
32
35
  uuid?: string;
33
36
  email?: string;
34
- appClientId?: string;
35
37
  clientTypeId?: HapnClientType;
36
38
  dataSourceTypeId?: number;
37
39
  sievaUserName?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -38,8 +38,10 @@
38
38
  "typeorm": "typeorm-ts-node-commonjs",
39
39
  "lint": "eslint \"./src/**\"",
40
40
  "lint-fix": "eslint \"./src/**\" --fix",
41
+ "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
41
42
  "build-dev": "webpack --mode=development",
42
43
  "build": "webpack --mode=production",
44
+ "copydistfolder": "./scripts/copyDistFolder.sh",
43
45
  "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"
44
46
  },
45
47
  "author": "Spytec",