@spytecgps/nova-orm 0.0.22 → 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,14 +1,20 @@
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
@@ -5,6 +5,11 @@ export interface GetClientParams {
5
5
  email?: string;
6
6
  };
7
7
  }
8
+ export interface GetClientsParams {
9
+ filters: {
10
+ email: string;
11
+ };
12
+ }
8
13
  export interface CreateClientParams {
9
14
  name: string;
10
15
  uuid: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",