@equos/node-sdk 0.0.4 → 0.0.6

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,11 +1,10 @@
1
- import { EquosAvatarData, ListEquosAvatarsData } from '../types/avatar.type';
2
- import { CreateEquosSessionRequestData, CreateEquosSessionResponseData } from '../types/session.type';
1
+ import { CreateEquosSessionRequestData, CreateEquosSessionResponseData, EquosSessionData, ListEquosSessionsData } from '../types/session.type';
3
2
  import { HttpUtils } from '../utils/http.utils';
4
3
  export declare class EquosSession {
5
4
  private readonly http;
6
5
  constructor(http: HttpUtils);
7
- get(id: string): Promise<EquosAvatarData>;
6
+ get(id: string): Promise<EquosSessionData>;
8
7
  create(data: CreateEquosSessionRequestData): Promise<CreateEquosSessionResponseData>;
9
- list(skip?: number, take?: number): Promise<ListEquosAvatarsData>;
10
- stop(id: string): Promise<EquosAvatarData>;
8
+ list(skip?: number, take?: number): Promise<ListEquosSessionsData>;
9
+ stop(id: string): Promise<EquosSessionData>;
11
10
  }
package/dist/equos.d.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  import { EquosAvatar } from './apis/avatar';
2
2
  import { EquosSession } from './apis/session';
3
3
  export declare class Equos {
4
+ private readonly env;
4
5
  private readonly apiKey;
5
6
  private readonly version;
6
7
  private readonly http;
7
8
  private avatarApi;
8
9
  private sessionApi;
9
10
  private constructor();
10
- static client(apiKey: string): Equos;
11
+ get apiUrl(): string;
12
+ static client(env: 'prod' | 'staging' | 'local', apiKey: string, version?: string): Equos;
11
13
  get avatars(): EquosAvatar;
12
14
  get sessions(): EquosSession;
13
15
  }
package/dist/equos.js CHANGED
@@ -6,20 +6,34 @@ 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;
9
10
  apiKey;
10
11
  version;
11
12
  http;
12
13
  avatarApi;
13
14
  sessionApi;
14
- constructor(apiKey, version = 'v1') {
15
+ constructor(env = 'prod', apiKey, version = 'v1') {
16
+ this.env = env;
15
17
  this.apiKey = apiKey;
16
18
  this.version = version;
17
- this.http = new http_utils_1.HttpUtils(constants_utils_1.ConstantsUtils.API_BASE_URL, this.version, this.apiKey);
19
+ this.http = new http_utils_1.HttpUtils(this.apiUrl, this.version, this.apiKey);
18
20
  this.avatarApi = new avatar_1.EquosAvatar(this.http);
19
21
  this.sessionApi = new session_1.EquosSession(this.http);
20
22
  }
21
- static client(apiKey) {
22
- return new Equos(apiKey);
23
+ get apiUrl() {
24
+ switch (this.env) {
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);
23
37
  }
24
38
  get avatars() {
25
39
  return this.avatarApi;
@@ -1,3 +1,5 @@
1
1
  export declare class ConstantsUtils {
2
- static readonly API_BASE_URL = "https://api.equos.io/v1";
2
+ static readonly PROD_API_BASE_URL = "https://api.equos.ai/v1";
3
+ static readonly STAGING_API_BASE_URL = "https://staging-api.equos.ai/v1";
4
+ static readonly LOCAL_API_BASE_URL = "http://localhost:3000/v1";
3
5
  }
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConstantsUtils = void 0;
4
4
  class ConstantsUtils {
5
- static API_BASE_URL = 'https://api.equos.io/v1';
5
+ static PROD_API_BASE_URL = 'https://api.equos.ai/v1';
6
+ static STAGING_API_BASE_URL = 'https://staging-api.equos.ai/v1';
7
+ static LOCAL_API_BASE_URL = 'http://localhost:3000/v1';
6
8
  }
7
9
  exports.ConstantsUtils = ConstantsUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equos/node-sdk",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Equos.ai node.js official SDK.",
5
5
  "keywords": [
6
6
  "ai",