@spytecgps/nova-orm 0.0.22 → 0.0.24

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.
@@ -1,5 +1,5 @@
1
- import { Geofence } from '../../entities';
1
+ import { Boundary } from '../../entities';
2
2
  import { NovaDataSource } from '../../novaDataSource';
3
3
  import { CreateBoundaryParams } from '../../types/boundaries';
4
4
  import { Logger } from '../../types/logger';
5
- export declare const createBoundary: (novaDataSource: NovaDataSource, params: CreateBoundaryParams, logger: Logger) => Promise<Geofence>;
5
+ export declare const createBoundary: (novaDataSource: NovaDataSource, params: CreateBoundaryParams, logger: Logger) => Promise<Boundary>;
@@ -1,5 +1,5 @@
1
- import { Geofence } from '../../entities';
1
+ import { Boundary } from '../../entities';
2
2
  import { NovaDataSource } from '../../novaDataSource';
3
3
  import { GetBoundariesByClientIdParams } from '../../types/boundaries';
4
4
  import { Logger } from '../../types/logger';
5
- export declare const getBoundariesByClientId: (novaDataSource: NovaDataSource, params: GetBoundariesByClientIdParams, logger: Logger) => Promise<Geofence[]>;
5
+ export declare const getBoundariesByClientId: (novaDataSource: NovaDataSource, params: GetBoundariesByClientIdParams, logger: Logger) => Promise<Boundary[]>;
@@ -1,5 +1,5 @@
1
- import { Geofence } from '../../entities';
1
+ import { Boundary } from '../../entities';
2
2
  import { NovaDataSource } from '../../novaDataSource';
3
3
  import { GetBoundaryByIdParams } from '../../types/boundaries';
4
4
  import { Logger } from '../../types/logger';
5
- export declare const getBoundaryById: (novaDataSource: NovaDataSource, params: GetBoundaryByIdParams, logger: Logger) => Promise<Geofence>;
5
+ export declare const getBoundaryById: (novaDataSource: NovaDataSource, params: GetBoundaryByIdParams, logger: Logger) => Promise<Boundary>;
@@ -1,4 +1,4 @@
1
- import { Geofence } from '../../entities';
1
+ import { Boundary } from '../../entities';
2
2
  import { CreateBoundaryParams, DeleteBoundaryParams, GetBoundariesByClientIdParams, GetBoundaryByIdParams, UpdateBoundaryParams } from '../../types/boundaries';
3
3
  import { BaseRepository } from '../baseRepository';
4
4
  export declare class BoundariesRepository extends BaseRepository {
@@ -8,7 +8,7 @@ export declare class BoundariesRepository extends BaseRepository {
8
8
  * - filters.clientId: The client id
9
9
  * - filters.status: The status to only obtain boundaries with that status, optional
10
10
  */
11
- getBoundariesByClientId(params: GetBoundariesByClientIdParams): Promise<Geofence[]>;
11
+ getBoundariesByClientId(params: GetBoundariesByClientIdParams): Promise<Boundary[]>;
12
12
  /**
13
13
  * Get all boundaries ids by client id
14
14
  * @param {GetBoundariesByClientIdParams} params containing information to get boundaries ids by clientId
@@ -21,7 +21,7 @@ export declare class BoundariesRepository extends BaseRepository {
21
21
  * @param {GetBoundaryByIdParams} params containing information to get a boundary by id
22
22
  * - filters.boundaryId: The boundary id
23
23
  */
24
- getBoundaryById(params: GetBoundaryByIdParams): Promise<Geofence>;
24
+ getBoundaryById(params: GetBoundaryByIdParams): Promise<Boundary>;
25
25
  /**
26
26
  * Create a boundary
27
27
  * @param {CreateBoundaryParams} params containing information to create a boundary
@@ -39,7 +39,7 @@ export declare class BoundariesRepository extends BaseRepository {
39
39
  * - isUserCreated: if the boundary was created by a user, optional
40
40
  * - area: area of the boundary, optional
41
41
  */
42
- createBoundary(params: CreateBoundaryParams): Promise<Geofence>;
42
+ createBoundary(params: CreateBoundaryParams): Promise<Boundary>;
43
43
  /**
44
44
  * Update a boundary
45
45
  * @param {UpdateBoundaryParams} params containing information to update a boundary
@@ -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.24",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",