@equos/node-sdk 0.0.16 → 0.1.0

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.
@@ -0,0 +1,8 @@
1
+ import { HttpUtils } from '../utils/http.utils';
2
+ import { CreateEquosAgentRequest, EquosAgent, ListEquosAgentsResponse } from '../types/agent.type';
3
+ export declare class EquosAgentApi {
4
+ private readonly http;
5
+ constructor(http: HttpUtils);
6
+ create(data: CreateEquosAgentRequest): Promise<EquosAgent>;
7
+ list(skip?: number, take?: number): Promise<ListEquosAgentsResponse>;
8
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EquosAgentApi = void 0;
4
+ const error_utils_1 = require("../utils/error.utils");
5
+ class EquosAgentApi {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ async create(data) {
11
+ return this.http
12
+ .post('/agents', data)
13
+ .catch(error_utils_1.ErrorUtils.convertToEquosError);
14
+ }
15
+ async list(skip = 0, take = 10) {
16
+ return this.http
17
+ .get(`/agents?skip=${skip}&take=${take}`)
18
+ .catch(error_utils_1.ErrorUtils.convertToEquosError);
19
+ }
20
+ }
21
+ exports.EquosAgentApi = EquosAgentApi;
@@ -1,8 +1,8 @@
1
- import { EquosAvatarData, ListEquosAvatarsData } from '../types/avatar.type';
2
1
  import { HttpUtils } from '../utils/http.utils';
3
- export declare class EquosAvatar {
2
+ import { CreateEquosAvatarRequest, EquosAvatar, ListEquosAvatarsResponse } from '../types/avatar.type';
3
+ export declare class EquosAvatarApi {
4
4
  private readonly http;
5
5
  constructor(http: HttpUtils);
6
- create(name: string, dataUrl: string): Promise<EquosAvatarData>;
7
- list(skip?: number, take?: number): Promise<ListEquosAvatarsData>;
6
+ create(data: CreateEquosAvatarRequest): Promise<EquosAvatar>;
7
+ list(skip?: number, take?: number): Promise<ListEquosAvatarsResponse>;
8
8
  }
@@ -1,18 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EquosAvatar = void 0;
3
+ exports.EquosAvatarApi = void 0;
4
4
  const error_utils_1 = require("../utils/error.utils");
5
- class EquosAvatar {
5
+ class EquosAvatarApi {
6
6
  http;
7
7
  constructor(http) {
8
8
  this.http = http;
9
9
  }
10
- async create(name, dataUrl) {
10
+ async create(data) {
11
11
  return this.http
12
- .post('/avatars', {
13
- name,
14
- refImage: dataUrl,
15
- })
12
+ .post('/avatars', data)
16
13
  .catch(error_utils_1.ErrorUtils.convertToEquosError);
17
14
  }
18
15
  async list(skip = 0, take = 10) {
@@ -21,4 +18,4 @@ class EquosAvatar {
21
18
  .catch(error_utils_1.ErrorUtils.convertToEquosError);
22
19
  }
23
20
  }
24
- exports.EquosAvatar = EquosAvatar;
21
+ exports.EquosAvatarApi = EquosAvatarApi;
@@ -1,10 +1,10 @@
1
- import { CreateEquosSessionRequestData, CreateEquosSessionResponseData, EquosSessionData, ListEquosSessionsData } from '../types/session.type';
1
+ import { CreateEquosSessionRequest, CreateEquosSessionResponse, EquosSession, ListEquosSessionsResponse } from '../types/session.type';
2
2
  import { HttpUtils } from '../utils/http.utils';
3
- export declare class EquosSession {
3
+ export declare class EquosSessionApi {
4
4
  private readonly http;
5
5
  constructor(http: HttpUtils);
6
- get(id: string): Promise<EquosSessionData>;
7
- create(data: CreateEquosSessionRequestData): Promise<CreateEquosSessionResponseData>;
8
- list(skip?: number, take?: number): Promise<ListEquosSessionsData>;
9
- stop(id: string): Promise<EquosSessionData>;
6
+ get(id: string): Promise<EquosSession>;
7
+ create(data: CreateEquosSessionRequest): Promise<CreateEquosSessionResponse>;
8
+ list(skip?: number, take?: number): Promise<ListEquosSessionsResponse>;
9
+ stop(id: string): Promise<EquosSession>;
10
10
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EquosSession = void 0;
3
+ exports.EquosSessionApi = void 0;
4
4
  const error_utils_1 = require("../utils/error.utils");
5
- class EquosSession {
5
+ class EquosSessionApi {
6
6
  http;
7
7
  constructor(http) {
8
8
  this.http = http;
@@ -28,4 +28,4 @@ class EquosSession {
28
28
  .catch(error_utils_1.ErrorUtils.convertToEquosError);
29
29
  }
30
30
  }
31
- exports.EquosSession = EquosSession;
31
+ exports.EquosSessionApi = EquosSessionApi;
package/dist/equos.d.ts CHANGED
@@ -1,15 +1,29 @@
1
- import { EquosAvatar } from './apis/avatar';
2
- import { EquosSession } from './apis/session';
1
+ import { EquosAgentApi } from './apis/agent';
2
+ import { EquosAvatarApi } from './apis/avatar';
3
+ import { EquosSessionApi } from './apis/session';
4
+ export interface EquosOptions {
5
+ /**
6
+ * API version to use (default: v1)
7
+ */
8
+ version?: string;
9
+ /**
10
+ * API endpoint to use (default: https://api.equos.ai)
11
+ * Can leave blank to use the default endpoint.
12
+ */
13
+ endpoint?: string;
14
+ }
3
15
  export declare class Equos {
4
- private readonly env;
5
16
  private readonly apiKey;
6
- private readonly version;
17
+ readonly opts?: EquosOptions | undefined;
7
18
  private readonly http;
8
- private avatarApi;
9
- private sessionApi;
19
+ private readonly avatarApi;
20
+ private readonly sessionApi;
21
+ private readonly agentApi;
22
+ private readonly version;
23
+ private readonly endpoint;
10
24
  private constructor();
11
- get apiUrl(): string;
12
- static client(env: 'prod' | 'staging' | 'local', apiKey: string, version?: string): Equos;
13
- get avatars(): EquosAvatar;
14
- get sessions(): EquosSession;
25
+ static client(apiKey: string, opts?: EquosOptions): Equos;
26
+ get agents(): EquosAgentApi;
27
+ get avatars(): EquosAvatarApi;
28
+ get sessions(): EquosSessionApi;
15
29
  }
package/dist/equos.js CHANGED
@@ -1,39 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Equos = void 0;
4
+ const agent_1 = require("./apis/agent");
4
5
  const avatar_1 = require("./apis/avatar");
5
6
  const session_1 = require("./apis/session");
6
7
  const constants_utils_1 = require("./utils/constants.utils");
7
8
  const http_utils_1 = require("./utils/http.utils");
8
9
  class Equos {
9
- env;
10
10
  apiKey;
11
- version;
11
+ opts;
12
12
  http;
13
13
  avatarApi;
14
14
  sessionApi;
15
- constructor(env = 'prod', apiKey, version = 'v1') {
16
- this.env = env;
15
+ agentApi;
16
+ version;
17
+ endpoint;
18
+ constructor(apiKey, opts) {
17
19
  this.apiKey = apiKey;
18
- this.version = version;
19
- this.http = new http_utils_1.HttpUtils(this.apiUrl, this.version, this.apiKey);
20
- this.avatarApi = new avatar_1.EquosAvatar(this.http);
21
- this.sessionApi = new session_1.EquosSession(this.http);
20
+ this.opts = opts;
21
+ this.endpoint = opts?.endpoint || constants_utils_1.ConstantsUtils.DEFAULT_ENDPOINT;
22
+ this.version = opts?.version || constants_utils_1.ConstantsUtils.DEFAULT_VERSION;
23
+ this.http = new http_utils_1.HttpUtils(this.endpoint, this.version, this.apiKey);
24
+ this.avatarApi = new avatar_1.EquosAvatarApi(this.http);
25
+ this.sessionApi = new session_1.EquosSessionApi(this.http);
26
+ this.agentApi = new agent_1.EquosAgentApi(this.http);
22
27
  }
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
- }
28
+ static client(apiKey, opts) {
29
+ return new Equos(apiKey, opts);
34
30
  }
35
- static client(env, apiKey, version = 'v1') {
36
- return new Equos(env, apiKey, version);
31
+ get agents() {
32
+ return this.agentApi;
37
33
  }
38
34
  get avatars() {
39
35
  return this.avatarApi;
@@ -0,0 +1,59 @@
1
+ export declare enum LLMs {
2
+ gpt5 = "gpt-5",
3
+ gpt5Mini = "gpt-5-mini",
4
+ gpt5Nano = "gpt-5-nano",
5
+ gpt4oMini = "gpt-4o-mini",
6
+ gpt4_1 = "gpt-4.1"
7
+ }
8
+ export declare enum TTSs {
9
+ elevenlabsTurboV2_5 = "eleven_turbo_v2_5",
10
+ elevenlabsV3 = "eleven_v3",
11
+ elevenMultilingualV2 = "eleven_multilingual_v2",
12
+ elevenFlashV2_5 = "eleven_flash_v2_5"
13
+ }
14
+ export declare enum Voices {
15
+ Roger = "CwhRBWXzGAHq8TQ4Fs17",
16
+ Sarah = "EXAVITQu4vr4xnSDxMaL",
17
+ Jessica = "cgSgspJ2msm6clMCkdW9",
18
+ Chris = "iP95p4xoKVk53GoZ742B"
19
+ }
20
+ export interface CreateEquosAgentRequest {
21
+ instructions: string;
22
+ llm?: {
23
+ model: LLMs;
24
+ };
25
+ tts?: {
26
+ voice: Voices;
27
+ model: TTSs;
28
+ };
29
+ stt?: {
30
+ languages: string[];
31
+ customVocabulary?: string[];
32
+ };
33
+ }
34
+ export interface EquosAgentLLM {
35
+ model: LLMs;
36
+ }
37
+ export interface EquosAgentTTS {
38
+ voice: Voices;
39
+ model: TTSs;
40
+ }
41
+ export interface EquosAgentSTT {
42
+ languages: string[];
43
+ customVocabulary: string[];
44
+ }
45
+ export interface EquosAgent {
46
+ id: string;
47
+ organizationId: string;
48
+ llm?: EquosAgentLLM;
49
+ tts?: EquosAgentTTS;
50
+ stt?: EquosAgentSTT;
51
+ createdAt: Date;
52
+ updatedAt: Date;
53
+ }
54
+ export interface ListEquosAgentsResponse {
55
+ skip: number;
56
+ take: number;
57
+ total: number;
58
+ agents: EquosAgent[];
59
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Voices = exports.TTSs = exports.LLMs = void 0;
4
+ var LLMs;
5
+ (function (LLMs) {
6
+ LLMs["gpt5"] = "gpt-5";
7
+ LLMs["gpt5Mini"] = "gpt-5-mini";
8
+ LLMs["gpt5Nano"] = "gpt-5-nano";
9
+ LLMs["gpt4oMini"] = "gpt-4o-mini";
10
+ LLMs["gpt4_1"] = "gpt-4.1";
11
+ })(LLMs || (exports.LLMs = LLMs = {}));
12
+ var TTSs;
13
+ (function (TTSs) {
14
+ TTSs["elevenlabsTurboV2_5"] = "eleven_turbo_v2_5";
15
+ TTSs["elevenlabsV3"] = "eleven_v3";
16
+ TTSs["elevenMultilingualV2"] = "eleven_multilingual_v2";
17
+ TTSs["elevenFlashV2_5"] = "eleven_flash_v2_5";
18
+ })(TTSs || (exports.TTSs = TTSs = {}));
19
+ var Voices;
20
+ (function (Voices) {
21
+ Voices["Roger"] = "CwhRBWXzGAHq8TQ4Fs17";
22
+ Voices["Sarah"] = "EXAVITQu4vr4xnSDxMaL";
23
+ Voices["Jessica"] = "cgSgspJ2msm6clMCkdW9";
24
+ Voices["Chris"] = "iP95p4xoKVk53GoZ742B";
25
+ })(Voices || (exports.Voices = Voices = {}));
@@ -1,19 +1,25 @@
1
- export interface CreateEquosAvatarData {
1
+ import { CreateEquosAgentRequest, EquosAgent } from './agent.type';
2
+ export interface CreateEquosAvatarRequest {
3
+ identity: string;
2
4
  name: string;
3
5
  refImage: string;
6
+ agentId?: string;
7
+ agent?: CreateEquosAgentRequest;
4
8
  }
5
- export interface EquosAvatarData {
9
+ export interface EquosAvatar {
6
10
  id: string;
11
+ organizationId: string;
12
+ identity: string;
7
13
  name: string;
8
14
  thumbnailUrl: string;
9
- apiKeyId: string;
10
- organizationId: string;
11
15
  createdAt: Date;
12
16
  updatedAt: Date;
17
+ agentId?: string;
18
+ agent?: EquosAgent;
13
19
  }
14
- export interface ListEquosAvatarsData {
20
+ export interface ListEquosAvatarsResponse {
15
21
  skip: number;
16
22
  take: number;
17
23
  total: number;
18
- avatars: EquosAvatarData[];
24
+ avatars: EquosAvatar[];
19
25
  }
@@ -1,29 +1,10 @@
1
- export interface EquosSessionData {
2
- id: string;
1
+ import { CreateEquosAgentRequest, EquosAgent } from './agent.type';
2
+ import { CreateEquosAvatarRequest, EquosAvatar } from './avatar.type';
3
+ export interface EquosParticipantIdentity {
4
+ identity: string;
3
5
  name: string;
4
- provider: string;
5
- status: string;
6
- client?: string;
7
- host: {
8
- serverUrl: string;
9
- };
10
- avatar: {
11
- id: string;
12
- identity?: string;
13
- name?: string;
14
- thumbnailUrl?: string;
15
- createdAt: Date;
16
- updatedAt: Date;
17
- };
18
- agent?: {
19
- instructions: string;
20
- };
21
- startedAt: Date;
22
- endedAt?: Date;
23
- createdAt: Date;
24
- updatedAt: Date;
25
6
  }
26
- export interface CreateEquosSessionRequestData {
7
+ export interface CreateEquosSessionRequest {
27
8
  name: string;
28
9
  client?: string;
29
10
  host?: {
@@ -31,31 +12,42 @@ export interface CreateEquosSessionRequestData {
31
12
  accessToken: string;
32
13
  };
33
14
  agent?: {
34
- instructions: string;
35
- };
15
+ id: string;
16
+ } | CreateEquosAgentRequest;
36
17
  avatar: {
37
- id?: string;
38
- identity?: string;
39
- name?: string;
40
- refImage?: string;
41
- };
42
- remoteAgentConnectingIdentity?: {
43
- identity: string;
44
- name: string;
45
- };
46
- consumerIdentity?: {
47
- identity: string;
48
- name: string;
18
+ id: string;
19
+ } | CreateEquosAvatarRequest;
20
+ remoteAgentConnectingIdentity?: EquosParticipantIdentity;
21
+ consumerIdentity?: EquosParticipantIdentity;
22
+ }
23
+ export interface EquosSession {
24
+ id: string;
25
+ organizationId: string;
26
+ freemium: boolean;
27
+ name: string;
28
+ provider: string;
29
+ client?: string;
30
+ status: string;
31
+ host: {
32
+ serverUrl: string;
49
33
  };
34
+ avatarId?: string;
35
+ avatar: EquosAvatar;
36
+ agentId?: string;
37
+ agent?: EquosAgent;
38
+ startedAt: Date;
39
+ endedAt?: Date;
40
+ createdAt: Date;
41
+ updatedAt: Date;
50
42
  }
51
- export interface CreateEquosSessionResponseData {
52
- session: EquosSessionData;
43
+ export interface CreateEquosSessionResponse {
44
+ session: EquosSession;
53
45
  consumerAccessToken?: string;
54
46
  remoteAgentAccessToken?: string;
55
47
  }
56
- export interface ListEquosSessionsData {
48
+ export interface ListEquosSessionsResponse {
57
49
  skip: number;
58
50
  take: number;
59
51
  total: number;
60
- sessions: EquosSessionData[];
52
+ sessions: EquosSession[];
61
53
  }
@@ -1,5 +1,4 @@
1
1
  export declare class ConstantsUtils {
2
- static readonly PROD_API_BASE_URL = "https://api.equos.ai";
3
- static readonly STAGING_API_BASE_URL = "https://staging-api.equos.ai";
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 PROD_API_BASE_URL = 'https://api.equos.ai';
6
- static STAGING_API_BASE_URL = 'https://staging-api.equos.ai';
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equos/node-sdk",
3
- "version": "0.0.16",
3
+ "version": "0.1.0",
4
4
  "description": "Equos.ai node.js official SDK.",
5
5
  "keywords": [
6
6
  "ai",