Skip to content

Commit b8ca168

Browse files
committed
Refactor
- Use Hydrator class separately instead of having the logic in BaseService - Register models using @RegisterModel decorator, hydrator gets model type for hydration from ModelRegistry - Update services, no longer need to declare their model in the construct
1 parent 594f5e1 commit b8ca168

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+651
-681
lines changed

dist/Client.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ClientConfigInterface } from "./ClientConfig";
22
import { RequestOptions } from "./utils/RequestOptions";
3-
import { Hydrator } from "./utils/Hydrator";
43
import { FormCategoriesService } from "./services/FormCategoriesService";
54
import { RolesService } from "./services/RolesService";
65
import { PermissionsService } from "./services/PermissionsService";
@@ -16,7 +15,6 @@ export declare class Client {
1615
readonly config: ClientConfigInterface;
1716
organisation: string;
1817
services: Record<string, any>;
19-
hydrator: Hydrator;
2018
bearerToken: string;
2119
private tokenPromise;
2220
constructor(config: ClientConfigInterface);

dist/Client.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Requests } from "./utils/Requests";
2-
import { Hydrator } from "./utils/Hydrator";
32
import { FormCategoriesService } from "./services/FormCategoriesService";
43
import { RolesService } from "./services/RolesService";
54
import { PermissionsService } from "./services/PermissionsService";
@@ -14,13 +13,11 @@ export class Client {
1413
config;
1514
organisation;
1615
services = {};
17-
hydrator;
1816
bearerToken = '';
1917
tokenPromise = null;
2018
constructor(config) {
2119
this.config = config;
2220
this.organisation = "";
23-
this.hydrator = new Hydrator(this.services);
2421
if (config.clientId && config.clientSecret && config.authDomain) {
2522
this.tokenPromise = this.getToken();
2623
}

dist/index.d.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
export { Client } from './Client';
22
export { ClientConfig } from './ClientConfig';
33
export { RequestOptions } from './utils/RequestOptions';
4-
export { ServiceAccount } from './models/ServiceAccount';
5-
export { ServiceAccountKey } from './models/ServiceAccountKey';
6-
export { Log } from './models/Log';
4+
export type { InternalResponse } from './types/Response';
5+
/**
6+
* Models
7+
*/
8+
export { Equipment } from './models/Equipment';
9+
export { Form } from './models/Form';
10+
export { FormCategory } from './models/FormCategory';
711
export { Group } from './models/Group';
12+
export { Log } from './models/Log';
813
export { Permission } from './models/Permission';
14+
export { Role } from './models/Role';
15+
export { ServiceAccount } from './models/ServiceAccount';
16+
export { ServiceAccountKey } from './models/ServiceAccountKey';
17+
export { Submission } from './models/Submission';
18+
export { SubmissionVersion } from './models/SubmissionVersion';
919
export { Vehicle } from './models/Vehicle';
10-
export type { InternalResponse } from './types/Response';

0 commit comments

Comments
 (0)