@equos/node-sdk 0.0.15 → 0.0.17
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.
- package/dist/equos.d.ts +15 -4
- package/dist/equos.js +10 -20
- package/dist/types/session.type.d.ts +1 -0
- package/dist/utils/constants.utils.d.ts +2 -3
- package/dist/utils/constants.utils.js +2 -3
- package/package.json +1 -1
package/dist/equos.d.ts
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { EquosAvatar } from './apis/avatar';
|
|
2
2
|
import { EquosSession } from './apis/session';
|
|
3
|
+
export interface EquosOptions {
|
|
4
|
+
/**
|
|
5
|
+
* API version to use (default: v1)
|
|
6
|
+
*/
|
|
7
|
+
version?: string;
|
|
8
|
+
/**
|
|
9
|
+
* API endpoint to use (default: https://api.equos.ai)
|
|
10
|
+
* Can leave blank to use the default endpoint.
|
|
11
|
+
*/
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
}
|
|
3
14
|
export declare class Equos {
|
|
4
|
-
private readonly env;
|
|
5
15
|
private readonly apiKey;
|
|
6
|
-
|
|
16
|
+
readonly opts?: EquosOptions | undefined;
|
|
7
17
|
private readonly http;
|
|
8
18
|
private avatarApi;
|
|
9
19
|
private sessionApi;
|
|
20
|
+
private readonly version;
|
|
21
|
+
private readonly endpoint;
|
|
10
22
|
private constructor();
|
|
11
|
-
|
|
12
|
-
static client(env: 'prod' | 'staging' | 'local', apiKey: string, version?: string): Equos;
|
|
23
|
+
static client(apiKey: string, opts?: EquosOptions): Equos;
|
|
13
24
|
get avatars(): EquosAvatar;
|
|
14
25
|
get sessions(): EquosSession;
|
|
15
26
|
}
|
package/dist/equos.js
CHANGED
|
@@ -6,34 +6,24 @@ const session_1 = require("./apis/session");
|
|
|
6
6
|
const constants_utils_1 = require("./utils/constants.utils");
|
|
7
7
|
const http_utils_1 = require("./utils/http.utils");
|
|
8
8
|
class Equos {
|
|
9
|
-
env;
|
|
10
9
|
apiKey;
|
|
11
|
-
|
|
10
|
+
opts;
|
|
12
11
|
http;
|
|
13
12
|
avatarApi;
|
|
14
13
|
sessionApi;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
version;
|
|
15
|
+
endpoint;
|
|
16
|
+
constructor(apiKey, opts) {
|
|
17
17
|
this.apiKey = apiKey;
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
18
|
+
this.opts = opts;
|
|
19
|
+
this.endpoint = opts?.endpoint || constants_utils_1.ConstantsUtils.DEFAULT_ENDPOINT;
|
|
20
|
+
this.version = opts?.version || constants_utils_1.ConstantsUtils.DEFAULT_VERSION;
|
|
21
|
+
this.http = new http_utils_1.HttpUtils(this.endpoint, this.version, this.apiKey);
|
|
20
22
|
this.avatarApi = new avatar_1.EquosAvatar(this.http);
|
|
21
23
|
this.sessionApi = new session_1.EquosSession(this.http);
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
case 'prod':
|
|
26
|
-
return constants_utils_1.ConstantsUtils.PROD_API_BASE_URL;
|
|
27
|
-
case 'staging':
|
|
28
|
-
return constants_utils_1.ConstantsUtils.STAGING_API_BASE_URL;
|
|
29
|
-
case 'local':
|
|
30
|
-
return constants_utils_1.ConstantsUtils.LOCAL_API_BASE_URL;
|
|
31
|
-
default:
|
|
32
|
-
throw new Error(`Unknown environment: ${this.env}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
static client(env, apiKey, version = 'v1') {
|
|
36
|
-
return new Equos(env, apiKey, version);
|
|
25
|
+
static client(apiKey, opts) {
|
|
26
|
+
return new Equos(apiKey, opts);
|
|
37
27
|
}
|
|
38
28
|
get avatars() {
|
|
39
29
|
return this.avatarApi;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare class ConstantsUtils {
|
|
2
|
-
static readonly
|
|
3
|
-
static readonly
|
|
4
|
-
static readonly LOCAL_API_BASE_URL = "http://localhost:3001";
|
|
2
|
+
static readonly DEFAULT_ENDPOINT = "https://api.equos.ai";
|
|
3
|
+
static readonly DEFAULT_VERSION = "v1";
|
|
5
4
|
}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConstantsUtils = void 0;
|
|
4
4
|
class ConstantsUtils {
|
|
5
|
-
static
|
|
6
|
-
static
|
|
7
|
-
static LOCAL_API_BASE_URL = 'http://localhost:3001';
|
|
5
|
+
static DEFAULT_ENDPOINT = 'https://api.equos.ai';
|
|
6
|
+
static DEFAULT_VERSION = 'v1';
|
|
8
7
|
}
|
|
9
8
|
exports.ConstantsUtils = ConstantsUtils;
|