-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
41 lines (30 loc) · 984 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { Config, ModelConfig } from "./library/interfaces/Config";
import { Default } from "./library/models/Default";
export class SDK {
// Constructor
private config:Config;
constructor(baseURL:string) {
const config:Config = {
baseURL: baseURL,
version: "v1"
};
this.config = config;
}
public default():Default { return new Default(this.config); }
private getModelConfig(endpoint:string, primary_value?:string|number, primary_key:string = 'id'):ModelConfig {
return {
...this.config,
endpoint: endpoint,
primary_key: primary_key,
primary_value: primary_value
};
}
////////////
// Models //
////////////
/**
* Coming Soon, here is an example usage
public exampleModel(id?:number):ExampleModel { return new ExampleModel(this.getModelConfig('/example', id)); }
*/
}
export default SDK;