@equos/node-sdk 2.2.3 → 3.0.2-rc.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.
- package/README.md +390 -66
- package/dist/api/apis/AgentApi.d.ts +86 -0
- package/dist/api/apis/AgentApi.js +223 -0
- package/dist/api/apis/AvatarApi.d.ts +86 -0
- package/dist/api/apis/AvatarApi.js +223 -0
- package/dist/api/apis/BrainApi.d.ts +64 -0
- package/dist/api/apis/BrainApi.js +179 -0
- package/dist/api/apis/CharacterApi.d.ts +76 -0
- package/dist/api/apis/CharacterApi.js +213 -0
- package/dist/api/apis/FaceApi.d.ts +64 -0
- package/dist/api/apis/FaceApi.js +179 -0
- package/dist/api/apis/HealthApi.d.ts +26 -0
- package/dist/api/apis/HealthApi.js +79 -0
- package/dist/api/apis/KnowledgeBaseApi.d.ts +84 -0
- package/dist/api/apis/KnowledgeBaseApi.js +260 -0
- package/dist/api/apis/LimitsApi.d.ts +26 -0
- package/dist/api/apis/LimitsApi.js +82 -0
- package/dist/api/apis/SessionPassesApi.d.ts +44 -0
- package/dist/api/apis/SessionPassesApi.js +128 -0
- package/dist/api/apis/SessionsApi.d.ts +72 -0
- package/dist/api/apis/SessionsApi.js +187 -0
- package/dist/api/apis/VoiceApi.d.ts +64 -0
- package/dist/api/apis/VoiceApi.js +179 -0
- package/dist/api/apis/index.d.ts +11 -0
- package/dist/api/apis/index.js +29 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +21 -0
- package/dist/api/models/CreateEquosAgentRequest.d.ts +144 -0
- package/dist/api/models/CreateEquosAgentRequest.js +120 -0
- package/dist/api/models/CreateEquosAvatarRequest.d.ts +56 -0
- package/dist/api/models/CreateEquosAvatarRequest.js +64 -0
- package/dist/api/models/CreateEquosBrainRequest.d.ts +56 -0
- package/dist/api/models/CreateEquosBrainRequest.js +64 -0
- package/dist/api/models/CreateEquosCharacterRequest.d.ts +80 -0
- package/dist/api/models/CreateEquosCharacterRequest.js +68 -0
- package/dist/api/models/CreateEquosFaceRequest.d.ts +46 -0
- package/dist/api/models/CreateEquosFaceRequest.js +60 -0
- package/dist/api/models/CreateEquosSessionRequest.d.ts +90 -0
- package/dist/api/models/CreateEquosSessionRequest.js +74 -0
- package/dist/api/models/CreateEquosSessionRequestAgent.d.ts +23 -0
- package/dist/api/models/CreateEquosSessionRequestAgent.js +57 -0
- package/dist/api/models/CreateEquosSessionRequestAvatar.d.ts +23 -0
- package/dist/api/models/CreateEquosSessionRequestAvatar.js +57 -0
- package/dist/api/models/CreateEquosSessionResponse.d.ts +45 -0
- package/dist/api/models/CreateEquosSessionResponse.js +55 -0
- package/dist/api/models/CreateEquosVoiceRequest.d.ts +56 -0
- package/dist/api/models/CreateEquosVoiceRequest.js +64 -0
- package/dist/api/models/CreateSessionPassRequest.d.ts +76 -0
- package/dist/api/models/CreateSessionPassRequest.js +72 -0
- package/dist/api/models/EquosAgent.d.ts +180 -0
- package/dist/api/models/EquosAgent.js +154 -0
- package/dist/api/models/EquosAvatar.d.ts +92 -0
- package/dist/api/models/EquosAvatar.js +84 -0
- package/dist/api/models/EquosBrain.d.ts +74 -0
- package/dist/api/models/EquosBrain.js +76 -0
- package/dist/api/models/EquosCharacter.d.ts +132 -0
- package/dist/api/models/EquosCharacter.js +98 -0
- package/dist/api/models/EquosDocument.d.ts +74 -0
- package/dist/api/models/EquosDocument.js +78 -0
- package/dist/api/models/EquosFace.d.ts +107 -0
- package/dist/api/models/EquosFace.js +89 -0
- package/dist/api/models/EquosKnowledgeBase.d.ts +75 -0
- package/dist/api/models/EquosKnowledgeBase.js +77 -0
- package/dist/api/models/EquosLimitResponse.d.ts +68 -0
- package/dist/api/models/EquosLimitResponse.js +72 -0
- package/dist/api/models/EquosParticipantIdentity.d.ts +38 -0
- package/dist/api/models/EquosParticipantIdentity.js +54 -0
- package/dist/api/models/EquosResourceReference.d.ts +32 -0
- package/dist/api/models/EquosResourceReference.js +50 -0
- package/dist/api/models/EquosSession.d.ts +168 -0
- package/dist/api/models/EquosSession.js +118 -0
- package/dist/api/models/EquosSessionHost.d.ts +38 -0
- package/dist/api/models/EquosSessionHost.js +54 -0
- package/dist/api/models/EquosSessionServer.d.ts +32 -0
- package/dist/api/models/EquosSessionServer.js +50 -0
- package/dist/api/models/EquosVoice.d.ts +80 -0
- package/dist/api/models/EquosVoice.js +80 -0
- package/dist/api/models/HealthResponse.d.ts +38 -0
- package/dist/api/models/HealthResponse.js +54 -0
- package/dist/api/models/ListEquosAgentsResponse.d.ts +51 -0
- package/dist/api/models/ListEquosAgentsResponse.js +63 -0
- package/dist/api/models/ListEquosAvatarsResponse.d.ts +51 -0
- package/dist/api/models/ListEquosAvatarsResponse.js +63 -0
- package/dist/api/models/ListEquosBrainsResponse.d.ts +51 -0
- package/dist/api/models/ListEquosBrainsResponse.js +63 -0
- package/dist/api/models/ListEquosCharactersResponse.d.ts +51 -0
- package/dist/api/models/ListEquosCharactersResponse.js +63 -0
- package/dist/api/models/ListEquosFacesResponse.d.ts +51 -0
- package/dist/api/models/ListEquosFacesResponse.js +63 -0
- package/dist/api/models/ListEquosSessionsResponse.d.ts +51 -0
- package/dist/api/models/ListEquosSessionsResponse.js +63 -0
- package/dist/api/models/ListEquosVoicesResponse.d.ts +51 -0
- package/dist/api/models/ListEquosVoicesResponse.js +63 -0
- package/dist/api/models/UpdateEquosAgentRequest.d.ts +156 -0
- package/dist/api/models/UpdateEquosAgentRequest.js +128 -0
- package/dist/api/models/UpdateEquosAvatarRequest.d.ts +68 -0
- package/dist/api/models/UpdateEquosAvatarRequest.js +72 -0
- package/dist/api/models/UpdateEquosCharacterRequest.d.ts +68 -0
- package/dist/api/models/UpdateEquosCharacterRequest.js +60 -0
- package/dist/api/models/index.d.ts +36 -0
- package/dist/api/models/index.js +54 -0
- package/dist/api/runtime.d.ts +184 -0
- package/dist/api/runtime.js +349 -0
- package/dist/client.d.ts +38 -0
- package/dist/client.js +62 -0
- package/dist/index.d.ts +3 -10
- package/dist/index.js +7 -10
- package/dist/options.d.ts +7 -0
- package/package.json +4 -2
- package/dist/apis/agent.d.ts +0 -11
- package/dist/apis/agent.js +0 -40
- package/dist/apis/avatar.d.ts +0 -11
- package/dist/apis/avatar.js +0 -40
- package/dist/apis/knowledge-base.d.ts +0 -13
- package/dist/apis/knowledge-base.js +0 -50
- package/dist/apis/session.d.ts +0 -10
- package/dist/apis/session.js +0 -35
- package/dist/equos.d.ts +0 -32
- package/dist/equos.js +0 -47
- package/dist/types/agent.type.d.ts +0 -96
- package/dist/types/agent.type.js +0 -64
- package/dist/types/avatar.type.d.ts +0 -31
- package/dist/types/error.type.d.ts +0 -5
- package/dist/types/error.type.js +0 -14
- package/dist/types/knowledge-base.type.d.ts +0 -41
- package/dist/types/knowledge-base.type.js +0 -2
- package/dist/types/session.type.d.ts +0 -73
- package/dist/types/session.type.js +0 -2
- package/dist/utils/constants.utils.d.ts +0 -4
- package/dist/utils/constants.utils.js +0 -8
- package/dist/utils/error.utils.d.ts +0 -5
- package/dist/utils/error.utils.js +0 -11
- package/dist/utils/http.utils.d.ts +0 -12
- package/dist/utils/http.utils.js +0 -126
- /package/dist/{types/avatar.type.js → options.js} +0 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Equos.ai API
|
|
6
|
+
* API documentation for Equos.ai live platform.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 3.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
|
|
17
|
+
exports.querystring = querystring;
|
|
18
|
+
exports.exists = exists;
|
|
19
|
+
exports.mapValues = mapValues;
|
|
20
|
+
exports.canConsumeForm = canConsumeForm;
|
|
21
|
+
exports.BASE_PATH = "http://localhost:3001".replace(/\/+$/, "");
|
|
22
|
+
class Configuration {
|
|
23
|
+
configuration;
|
|
24
|
+
constructor(configuration = {}) {
|
|
25
|
+
this.configuration = configuration;
|
|
26
|
+
}
|
|
27
|
+
set config(configuration) {
|
|
28
|
+
this.configuration = configuration;
|
|
29
|
+
}
|
|
30
|
+
get basePath() {
|
|
31
|
+
return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
|
|
32
|
+
}
|
|
33
|
+
get fetchApi() {
|
|
34
|
+
return this.configuration.fetchApi;
|
|
35
|
+
}
|
|
36
|
+
get middleware() {
|
|
37
|
+
return this.configuration.middleware || [];
|
|
38
|
+
}
|
|
39
|
+
get queryParamsStringify() {
|
|
40
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
41
|
+
}
|
|
42
|
+
get username() {
|
|
43
|
+
return this.configuration.username;
|
|
44
|
+
}
|
|
45
|
+
get password() {
|
|
46
|
+
return this.configuration.password;
|
|
47
|
+
}
|
|
48
|
+
get apiKey() {
|
|
49
|
+
const apiKey = this.configuration.apiKey;
|
|
50
|
+
if (apiKey) {
|
|
51
|
+
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
get accessToken() {
|
|
56
|
+
const accessToken = this.configuration.accessToken;
|
|
57
|
+
if (accessToken) {
|
|
58
|
+
return typeof accessToken === 'function' ? accessToken : async () => accessToken;
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
get headers() {
|
|
63
|
+
return this.configuration.headers;
|
|
64
|
+
}
|
|
65
|
+
get credentials() {
|
|
66
|
+
return this.configuration.credentials;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.Configuration = Configuration;
|
|
70
|
+
exports.DefaultConfig = new Configuration();
|
|
71
|
+
/**
|
|
72
|
+
* This is the base class for all generated API classes.
|
|
73
|
+
*/
|
|
74
|
+
class BaseAPI {
|
|
75
|
+
configuration;
|
|
76
|
+
static jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
|
|
77
|
+
middleware;
|
|
78
|
+
constructor(configuration = exports.DefaultConfig) {
|
|
79
|
+
this.configuration = configuration;
|
|
80
|
+
this.middleware = configuration.middleware;
|
|
81
|
+
}
|
|
82
|
+
withMiddleware(...middlewares) {
|
|
83
|
+
const next = this.clone();
|
|
84
|
+
next.middleware = next.middleware.concat(...middlewares);
|
|
85
|
+
return next;
|
|
86
|
+
}
|
|
87
|
+
withPreMiddleware(...preMiddlewares) {
|
|
88
|
+
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
89
|
+
return this.withMiddleware(...middlewares);
|
|
90
|
+
}
|
|
91
|
+
withPostMiddleware(...postMiddlewares) {
|
|
92
|
+
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
93
|
+
return this.withMiddleware(...middlewares);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Check if the given MIME is a JSON MIME.
|
|
97
|
+
* JSON MIME examples:
|
|
98
|
+
* application/json
|
|
99
|
+
* application/json; charset=UTF8
|
|
100
|
+
* APPLICATION/JSON
|
|
101
|
+
* application/vnd.company+json
|
|
102
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
103
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
104
|
+
*/
|
|
105
|
+
isJsonMime(mime) {
|
|
106
|
+
if (!mime) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return BaseAPI.jsonRegex.test(mime);
|
|
110
|
+
}
|
|
111
|
+
async request(context, initOverrides) {
|
|
112
|
+
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
113
|
+
const response = await this.fetchApi(url, init);
|
|
114
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
115
|
+
return response;
|
|
116
|
+
}
|
|
117
|
+
throw new ResponseError(response, 'Response returned an error code');
|
|
118
|
+
}
|
|
119
|
+
async createFetchParams(context, initOverrides) {
|
|
120
|
+
let url = this.configuration.basePath + context.path;
|
|
121
|
+
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
122
|
+
// only add the querystring to the URL if there are query parameters.
|
|
123
|
+
// this is done to avoid urls ending with a "?" character which buggy webservers
|
|
124
|
+
// do not handle correctly sometimes.
|
|
125
|
+
url += '?' + this.configuration.queryParamsStringify(context.query);
|
|
126
|
+
}
|
|
127
|
+
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
128
|
+
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
|
|
129
|
+
const initOverrideFn = typeof initOverrides === "function"
|
|
130
|
+
? initOverrides
|
|
131
|
+
: async () => initOverrides;
|
|
132
|
+
const initParams = {
|
|
133
|
+
method: context.method,
|
|
134
|
+
headers,
|
|
135
|
+
body: context.body,
|
|
136
|
+
credentials: this.configuration.credentials,
|
|
137
|
+
};
|
|
138
|
+
const overriddenInit = {
|
|
139
|
+
...initParams,
|
|
140
|
+
...(await initOverrideFn({
|
|
141
|
+
init: initParams,
|
|
142
|
+
context,
|
|
143
|
+
}))
|
|
144
|
+
};
|
|
145
|
+
let body;
|
|
146
|
+
if (isFormData(overriddenInit.body)
|
|
147
|
+
|| (overriddenInit.body instanceof URLSearchParams)
|
|
148
|
+
|| isBlob(overriddenInit.body)) {
|
|
149
|
+
body = overriddenInit.body;
|
|
150
|
+
}
|
|
151
|
+
else if (this.isJsonMime(headers['Content-Type'])) {
|
|
152
|
+
body = JSON.stringify(overriddenInit.body);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
body = overriddenInit.body;
|
|
156
|
+
}
|
|
157
|
+
const init = {
|
|
158
|
+
...overriddenInit,
|
|
159
|
+
body
|
|
160
|
+
};
|
|
161
|
+
return { url, init };
|
|
162
|
+
}
|
|
163
|
+
fetchApi = async (url, init) => {
|
|
164
|
+
let fetchParams = { url, init };
|
|
165
|
+
for (const middleware of this.middleware) {
|
|
166
|
+
if (middleware.pre) {
|
|
167
|
+
fetchParams = await middleware.pre({
|
|
168
|
+
fetch: this.fetchApi,
|
|
169
|
+
...fetchParams,
|
|
170
|
+
}) || fetchParams;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
let response = undefined;
|
|
174
|
+
try {
|
|
175
|
+
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
176
|
+
}
|
|
177
|
+
catch (e) {
|
|
178
|
+
for (const middleware of this.middleware) {
|
|
179
|
+
if (middleware.onError) {
|
|
180
|
+
response = await middleware.onError({
|
|
181
|
+
fetch: this.fetchApi,
|
|
182
|
+
url: fetchParams.url,
|
|
183
|
+
init: fetchParams.init,
|
|
184
|
+
error: e,
|
|
185
|
+
response: response ? response.clone() : undefined,
|
|
186
|
+
}) || response;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (response === undefined) {
|
|
190
|
+
if (e instanceof Error) {
|
|
191
|
+
throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
throw e;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
for (const middleware of this.middleware) {
|
|
199
|
+
if (middleware.post) {
|
|
200
|
+
response = await middleware.post({
|
|
201
|
+
fetch: this.fetchApi,
|
|
202
|
+
url: fetchParams.url,
|
|
203
|
+
init: fetchParams.init,
|
|
204
|
+
response: response.clone(),
|
|
205
|
+
}) || response;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return response;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
212
|
+
* and then shallow cloning data members.
|
|
213
|
+
*/
|
|
214
|
+
clone() {
|
|
215
|
+
const constructor = this.constructor;
|
|
216
|
+
const next = new constructor(this.configuration);
|
|
217
|
+
next.middleware = this.middleware.slice();
|
|
218
|
+
return next;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.BaseAPI = BaseAPI;
|
|
222
|
+
;
|
|
223
|
+
function isBlob(value) {
|
|
224
|
+
return typeof Blob !== 'undefined' && value instanceof Blob;
|
|
225
|
+
}
|
|
226
|
+
function isFormData(value) {
|
|
227
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
228
|
+
}
|
|
229
|
+
class ResponseError extends Error {
|
|
230
|
+
response;
|
|
231
|
+
name = "ResponseError";
|
|
232
|
+
constructor(response, msg) {
|
|
233
|
+
super(msg);
|
|
234
|
+
this.response = response;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.ResponseError = ResponseError;
|
|
238
|
+
class FetchError extends Error {
|
|
239
|
+
cause;
|
|
240
|
+
name = "FetchError";
|
|
241
|
+
constructor(cause, msg) {
|
|
242
|
+
super(msg);
|
|
243
|
+
this.cause = cause;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
exports.FetchError = FetchError;
|
|
247
|
+
class RequiredError extends Error {
|
|
248
|
+
field;
|
|
249
|
+
name = "RequiredError";
|
|
250
|
+
constructor(field, msg) {
|
|
251
|
+
super(msg);
|
|
252
|
+
this.field = field;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
exports.RequiredError = RequiredError;
|
|
256
|
+
exports.COLLECTION_FORMATS = {
|
|
257
|
+
csv: ",",
|
|
258
|
+
ssv: " ",
|
|
259
|
+
tsv: "\t",
|
|
260
|
+
pipes: "|",
|
|
261
|
+
};
|
|
262
|
+
function querystring(params, prefix = '') {
|
|
263
|
+
return Object.keys(params)
|
|
264
|
+
.map(key => querystringSingleKey(key, params[key], prefix))
|
|
265
|
+
.filter(part => part.length > 0)
|
|
266
|
+
.join('&');
|
|
267
|
+
}
|
|
268
|
+
function querystringSingleKey(key, value, keyPrefix = '') {
|
|
269
|
+
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
270
|
+
if (value instanceof Array) {
|
|
271
|
+
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
|
|
272
|
+
.join(`&${encodeURIComponent(fullKey)}=`);
|
|
273
|
+
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
274
|
+
}
|
|
275
|
+
if (value instanceof Set) {
|
|
276
|
+
const valueAsArray = Array.from(value);
|
|
277
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
278
|
+
}
|
|
279
|
+
if (value instanceof Date) {
|
|
280
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
281
|
+
}
|
|
282
|
+
if (value instanceof Object) {
|
|
283
|
+
return querystring(value, fullKey);
|
|
284
|
+
}
|
|
285
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
286
|
+
}
|
|
287
|
+
function exists(json, key) {
|
|
288
|
+
const value = json[key];
|
|
289
|
+
return value !== null && value !== undefined;
|
|
290
|
+
}
|
|
291
|
+
function mapValues(data, fn) {
|
|
292
|
+
const result = {};
|
|
293
|
+
for (const key of Object.keys(data)) {
|
|
294
|
+
result[key] = fn(data[key]);
|
|
295
|
+
}
|
|
296
|
+
return result;
|
|
297
|
+
}
|
|
298
|
+
function canConsumeForm(consumes) {
|
|
299
|
+
for (const consume of consumes) {
|
|
300
|
+
if ('multipart/form-data' === consume.contentType) {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
class JSONApiResponse {
|
|
307
|
+
raw;
|
|
308
|
+
transformer;
|
|
309
|
+
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
310
|
+
this.raw = raw;
|
|
311
|
+
this.transformer = transformer;
|
|
312
|
+
}
|
|
313
|
+
async value() {
|
|
314
|
+
return this.transformer(await this.raw.json());
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
exports.JSONApiResponse = JSONApiResponse;
|
|
318
|
+
class VoidApiResponse {
|
|
319
|
+
raw;
|
|
320
|
+
constructor(raw) {
|
|
321
|
+
this.raw = raw;
|
|
322
|
+
}
|
|
323
|
+
async value() {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.VoidApiResponse = VoidApiResponse;
|
|
328
|
+
class BlobApiResponse {
|
|
329
|
+
raw;
|
|
330
|
+
constructor(raw) {
|
|
331
|
+
this.raw = raw;
|
|
332
|
+
}
|
|
333
|
+
async value() {
|
|
334
|
+
return await this.raw.blob();
|
|
335
|
+
}
|
|
336
|
+
;
|
|
337
|
+
}
|
|
338
|
+
exports.BlobApiResponse = BlobApiResponse;
|
|
339
|
+
class TextApiResponse {
|
|
340
|
+
raw;
|
|
341
|
+
constructor(raw) {
|
|
342
|
+
this.raw = raw;
|
|
343
|
+
}
|
|
344
|
+
async value() {
|
|
345
|
+
return await this.raw.text();
|
|
346
|
+
}
|
|
347
|
+
;
|
|
348
|
+
}
|
|
349
|
+
exports.TextApiResponse = TextApiResponse;
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AgentApi, AvatarApi, BrainApi, CharacterApi, FaceApi, HealthApi, KnowledgeBaseApi, LimitsApi, SessionPassesApi, SessionsApi, VoiceApi } from './api/apis';
|
|
2
|
+
export interface EquosOptions {
|
|
3
|
+
/**
|
|
4
|
+
* API endpoint to use (default: https://api.equos.ai)
|
|
5
|
+
* Can leave blank to use the default endpoint.
|
|
6
|
+
*/
|
|
7
|
+
endpoint?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Main Equos SDK client
|
|
11
|
+
*/
|
|
12
|
+
export declare class EquosClient {
|
|
13
|
+
private readonly configuration;
|
|
14
|
+
private readonly basePath;
|
|
15
|
+
readonly agents: AgentApi;
|
|
16
|
+
readonly avatars: AvatarApi;
|
|
17
|
+
readonly brains: BrainApi;
|
|
18
|
+
readonly characters: CharacterApi;
|
|
19
|
+
readonly faces: FaceApi;
|
|
20
|
+
readonly health: HealthApi;
|
|
21
|
+
readonly knowledgeBases: KnowledgeBaseApi;
|
|
22
|
+
readonly limits: LimitsApi;
|
|
23
|
+
readonly sessionPasses: SessionPassesApi;
|
|
24
|
+
readonly sessions: SessionsApi;
|
|
25
|
+
readonly voices: VoiceApi;
|
|
26
|
+
private constructor();
|
|
27
|
+
/**
|
|
28
|
+
* Create a new Equos client instance
|
|
29
|
+
* @param apiKey - Your Equos API key
|
|
30
|
+
* @param options - Optional configuration
|
|
31
|
+
* @returns EquosClient instance
|
|
32
|
+
*/
|
|
33
|
+
static create(apiKey: string, options?: EquosOptions): EquosClient;
|
|
34
|
+
/**
|
|
35
|
+
* Get the base path being used by this client
|
|
36
|
+
*/
|
|
37
|
+
getBasePath(): string;
|
|
38
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EquosClient = void 0;
|
|
4
|
+
const runtime_1 = require("./api/runtime");
|
|
5
|
+
const apis_1 = require("./api/apis");
|
|
6
|
+
/**
|
|
7
|
+
* Main Equos SDK client
|
|
8
|
+
*/
|
|
9
|
+
class EquosClient {
|
|
10
|
+
configuration;
|
|
11
|
+
basePath;
|
|
12
|
+
// API instances
|
|
13
|
+
agents;
|
|
14
|
+
avatars;
|
|
15
|
+
brains;
|
|
16
|
+
characters;
|
|
17
|
+
faces;
|
|
18
|
+
health;
|
|
19
|
+
knowledgeBases;
|
|
20
|
+
limits;
|
|
21
|
+
sessionPasses;
|
|
22
|
+
sessions;
|
|
23
|
+
voices;
|
|
24
|
+
constructor(apiKey, options) {
|
|
25
|
+
const endpoint = options?.endpoint || 'https://api.equos.ai';
|
|
26
|
+
// Construct the base path
|
|
27
|
+
this.basePath = `${endpoint}`;
|
|
28
|
+
// Create configuration with API key
|
|
29
|
+
this.configuration = new runtime_1.Configuration({
|
|
30
|
+
basePath: this.basePath,
|
|
31
|
+
apiKey: apiKey, // This will be added to x-api-key header automatically
|
|
32
|
+
});
|
|
33
|
+
// Initialize all API instances
|
|
34
|
+
this.agents = new apis_1.AgentApi(this.configuration);
|
|
35
|
+
this.avatars = new apis_1.AvatarApi(this.configuration);
|
|
36
|
+
this.brains = new apis_1.BrainApi(this.configuration);
|
|
37
|
+
this.characters = new apis_1.CharacterApi(this.configuration);
|
|
38
|
+
this.faces = new apis_1.FaceApi(this.configuration);
|
|
39
|
+
this.health = new apis_1.HealthApi(this.configuration);
|
|
40
|
+
this.knowledgeBases = new apis_1.KnowledgeBaseApi(this.configuration);
|
|
41
|
+
this.limits = new apis_1.LimitsApi(this.configuration);
|
|
42
|
+
this.sessionPasses = new apis_1.SessionPassesApi(this.configuration);
|
|
43
|
+
this.sessions = new apis_1.SessionsApi(this.configuration);
|
|
44
|
+
this.voices = new apis_1.VoiceApi(this.configuration);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a new Equos client instance
|
|
48
|
+
* @param apiKey - Your Equos API key
|
|
49
|
+
* @param options - Optional configuration
|
|
50
|
+
* @returns EquosClient instance
|
|
51
|
+
*/
|
|
52
|
+
static create(apiKey, options) {
|
|
53
|
+
return new EquosClient(apiKey, options);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the base path being used by this client
|
|
57
|
+
*/
|
|
58
|
+
getBasePath() {
|
|
59
|
+
return this.basePath;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.EquosClient = EquosClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './types/avatar.type';
|
|
5
|
-
export * from './types/session.type';
|
|
6
|
-
export * from './types/knowledge-base.type';
|
|
7
|
-
export * from './apis/agent';
|
|
8
|
-
export * from './apis/avatar';
|
|
9
|
-
export * from './apis/session';
|
|
10
|
-
export * from './apis/knowledge-base';
|
|
1
|
+
export { EquosClient, EquosOptions } from './client';
|
|
2
|
+
export * from './api/models';
|
|
3
|
+
export * from './api/apis';
|
package/dist/index.js
CHANGED
|
@@ -14,13 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./apis
|
|
24
|
-
__exportStar(require("./apis/avatar"), exports);
|
|
25
|
-
__exportStar(require("./apis/session"), exports);
|
|
26
|
-
__exportStar(require("./apis/knowledge-base"), exports);
|
|
17
|
+
exports.EquosClient = void 0;
|
|
18
|
+
// New client (recommended)
|
|
19
|
+
var client_1 = require("./client");
|
|
20
|
+
Object.defineProperty(exports, "EquosClient", { enumerable: true, get: function () { return client_1.EquosClient; } });
|
|
21
|
+
// Generated API exports (models and API classes)
|
|
22
|
+
__exportStar(require("./api/models"), exports);
|
|
23
|
+
__exportStar(require("./api/apis"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equos/node-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.2-rc.0",
|
|
4
4
|
"description": "Equos.ai node.js official SDK.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -39,12 +39,14 @@
|
|
|
39
39
|
"dev": "ts-node src/index.ts",
|
|
40
40
|
"test": "jest",
|
|
41
41
|
"lint": "eslint . --ext .ts",
|
|
42
|
-
"prepare": "npm run build"
|
|
42
|
+
"prepare": "npm run build",
|
|
43
|
+
"generate": "ts-node scripts/generate-client.ts"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"axios": "^1.11.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
49
|
+
"@openapitools/openapi-generator-cli": "^2.25.2",
|
|
48
50
|
"@types/jest": "^30.0.0",
|
|
49
51
|
"@types/node": "^24.3.0",
|
|
50
52
|
"eslint": "^9.33.0",
|
package/dist/apis/agent.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HttpUtils } from '../utils/http.utils';
|
|
2
|
-
import { CreateEquosAgentRequest, EquosAgent, ListEquosAgentsResponse, UpdateEquosAgentRequest } 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, client?: string): Promise<ListEquosAgentsResponse>;
|
|
8
|
-
get(agentId: string): Promise<EquosAgent | null>;
|
|
9
|
-
delete(agentId: string): Promise<EquosAgent | null>;
|
|
10
|
-
update(agentId: string, data: UpdateEquosAgentRequest): Promise<EquosAgent>;
|
|
11
|
-
}
|
package/dist/apis/agent.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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, client) {
|
|
16
|
-
let path = `/agents?skip=${skip}&take=${take}`;
|
|
17
|
-
if (client) {
|
|
18
|
-
path += `&client=${client}`;
|
|
19
|
-
}
|
|
20
|
-
return this.http
|
|
21
|
-
.get(path)
|
|
22
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
23
|
-
}
|
|
24
|
-
async get(agentId) {
|
|
25
|
-
return this.http
|
|
26
|
-
.get(`/agents/${agentId}`)
|
|
27
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
28
|
-
}
|
|
29
|
-
async delete(agentId) {
|
|
30
|
-
return this.http
|
|
31
|
-
.delete(`/agents/${agentId}`)
|
|
32
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
33
|
-
}
|
|
34
|
-
async update(agentId, data) {
|
|
35
|
-
return this.http
|
|
36
|
-
.put(`/agents/${agentId}`, data)
|
|
37
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.EquosAgentApi = EquosAgentApi;
|
package/dist/apis/avatar.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HttpUtils } from '../utils/http.utils';
|
|
2
|
-
import { CreateEquosAvatarRequest, EquosAvatar, ListEquosAvatarsResponse, UpdateEquosAvatarRequest } from '../types/avatar.type';
|
|
3
|
-
export declare class EquosAvatarApi {
|
|
4
|
-
private readonly http;
|
|
5
|
-
constructor(http: HttpUtils);
|
|
6
|
-
create(data: CreateEquosAvatarRequest): Promise<EquosAvatar>;
|
|
7
|
-
list(skip?: number, take?: number, client?: string): Promise<ListEquosAvatarsResponse>;
|
|
8
|
-
get(avatarId: string): Promise<EquosAvatar | null>;
|
|
9
|
-
delete(agentId: string): Promise<EquosAvatar | null>;
|
|
10
|
-
update(agentId: string, data: UpdateEquosAvatarRequest): Promise<EquosAvatar>;
|
|
11
|
-
}
|
package/dist/apis/avatar.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EquosAvatarApi = void 0;
|
|
4
|
-
const error_utils_1 = require("../utils/error.utils");
|
|
5
|
-
class EquosAvatarApi {
|
|
6
|
-
http;
|
|
7
|
-
constructor(http) {
|
|
8
|
-
this.http = http;
|
|
9
|
-
}
|
|
10
|
-
async create(data) {
|
|
11
|
-
return this.http
|
|
12
|
-
.post('/avatars', data)
|
|
13
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
14
|
-
}
|
|
15
|
-
async list(skip = 0, take = 10, client) {
|
|
16
|
-
let path = `/avatars?skip=${skip}&take=${take}`;
|
|
17
|
-
if (client) {
|
|
18
|
-
path += `&client=${client}`;
|
|
19
|
-
}
|
|
20
|
-
return this.http
|
|
21
|
-
.get(path)
|
|
22
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
23
|
-
}
|
|
24
|
-
async get(avatarId) {
|
|
25
|
-
return this.http
|
|
26
|
-
.get(`/avatars/${avatarId}`)
|
|
27
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
28
|
-
}
|
|
29
|
-
async delete(agentId) {
|
|
30
|
-
return this.http
|
|
31
|
-
.delete(`/avatars/${agentId}`)
|
|
32
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
33
|
-
}
|
|
34
|
-
async update(agentId, data) {
|
|
35
|
-
return this.http
|
|
36
|
-
.put(`/avatars/${agentId}`, data)
|
|
37
|
-
.catch(error_utils_1.ErrorUtils.convertToEquosError);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.EquosAvatarApi = EquosAvatarApi;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HttpUtils } from '../utils/http.utils';
|
|
2
|
-
import { CreateDocumentRequest, CreateDocumentResponse, CreateKnowledgeBaseRequest, EquosDocument, EquosKnowledgeBase, ListEquosKnowledgeBasesResponse } from '../types/knowledge-base.type';
|
|
3
|
-
export declare class EquosKnowledgeBaseApi {
|
|
4
|
-
private readonly http;
|
|
5
|
-
constructor(http: HttpUtils);
|
|
6
|
-
create(data: CreateKnowledgeBaseRequest): Promise<EquosKnowledgeBase>;
|
|
7
|
-
list(skip?: number, take?: number, client?: string): Promise<ListEquosKnowledgeBasesResponse>;
|
|
8
|
-
get(knowledgeBaseId: string): Promise<EquosKnowledgeBase | null>;
|
|
9
|
-
delete(knowledgeBaseId: string): Promise<EquosKnowledgeBase | null>;
|
|
10
|
-
createDocument(knowledgeBaseId: string, data: CreateDocumentRequest): Promise<CreateDocumentResponse>;
|
|
11
|
-
indexDocument(knowledgeBaseId: string, documentId: string): Promise<EquosDocument>;
|
|
12
|
-
deleteDocument(knowledgeBaseId: string, documentId: string): Promise<EquosDocument | null>;
|
|
13
|
-
}
|