simplex-ts 1.0.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/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/simplex.d.ts +32 -0
- package/dist/simplex.js +399 -0
- package/package.json +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Simplex } from './simplex';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
interface SimplexOptions {
|
|
2
|
+
apiKey?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare class Simplex {
|
|
5
|
+
private api_key;
|
|
6
|
+
private session_id;
|
|
7
|
+
constructor(apiKeyOrOptions?: string | SimplexOptions);
|
|
8
|
+
private makeRequest;
|
|
9
|
+
closeSession(): Promise<void>;
|
|
10
|
+
createSession(options?: {
|
|
11
|
+
showInConsole?: boolean;
|
|
12
|
+
proxies?: boolean;
|
|
13
|
+
sessionData?: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
goto(url: string, cdpUrl?: string): Promise<void>;
|
|
16
|
+
click(elementDescription: string, cdpUrl?: string): Promise<string>;
|
|
17
|
+
type(text: string, cdpUrl?: string): Promise<void>;
|
|
18
|
+
pressEnter(cdpUrl?: string): Promise<void>;
|
|
19
|
+
pressTab(cdpUrl?: string): Promise<void>;
|
|
20
|
+
deleteText(cdpUrl?: string): Promise<void>;
|
|
21
|
+
extractBbox(elementDescription: string, cdpUrl?: string): Promise<any>;
|
|
22
|
+
extractText(elementDescription: string, cdpUrl?: string): Promise<string>;
|
|
23
|
+
extractImage(elementDescription: string, cdpUrl?: string): Promise<string>;
|
|
24
|
+
scroll(pixels: number, cdpUrl?: string): Promise<void>;
|
|
25
|
+
wait(milliseconds: number, cdpUrl?: string): Promise<void>;
|
|
26
|
+
createLoginSession(url: string, proxies?: boolean): Promise<string>;
|
|
27
|
+
restoreLoginSession(sessionData: string, cdpUrl?: string): Promise<void>;
|
|
28
|
+
clickAndUpload(elementDescription: string, filePath: string): Promise<void>;
|
|
29
|
+
clickAndDownload(elementDescription: string): Promise<[string, string]>;
|
|
30
|
+
exists(elementDescription: string, cdpUrl?: string): Promise<[boolean, string]>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
package/dist/simplex.js
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Simplex = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const form_data_1 = __importDefault(require("form-data"));
|
|
10
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
11
|
+
// Load environment variables
|
|
12
|
+
dotenv_1.default.config();
|
|
13
|
+
const BASE_URL = "https://api.simplex.sh";
|
|
14
|
+
class Simplex {
|
|
15
|
+
constructor(apiKeyOrOptions) {
|
|
16
|
+
this.session_id = null;
|
|
17
|
+
// Handle different ways of passing the API key
|
|
18
|
+
if (typeof apiKeyOrOptions === 'string') {
|
|
19
|
+
this.api_key = apiKeyOrOptions;
|
|
20
|
+
}
|
|
21
|
+
else if (typeof apiKeyOrOptions === 'object') {
|
|
22
|
+
this.api_key = apiKeyOrOptions.apiKey || '';
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.api_key = '';
|
|
26
|
+
}
|
|
27
|
+
// Fallback to environment variable if no API key provided
|
|
28
|
+
if (!this.api_key) {
|
|
29
|
+
this.api_key = process.env.SIMPLEX_API_KEY || '';
|
|
30
|
+
}
|
|
31
|
+
if (!this.api_key) {
|
|
32
|
+
throw new Error('API key must be provided either through constructor or SIMPLEX_API_KEY environment variable');
|
|
33
|
+
}
|
|
34
|
+
// Register cleanup on process exit
|
|
35
|
+
process.on('exit', () => this.closeSession());
|
|
36
|
+
}
|
|
37
|
+
async makeRequest(endpoint, method, data, params, files) {
|
|
38
|
+
try {
|
|
39
|
+
const headers = {
|
|
40
|
+
'x-api-key': this.api_key
|
|
41
|
+
};
|
|
42
|
+
const config = {
|
|
43
|
+
method,
|
|
44
|
+
url: `${BASE_URL}/${endpoint}`,
|
|
45
|
+
headers
|
|
46
|
+
};
|
|
47
|
+
if (method === 'GET') {
|
|
48
|
+
config.params = params;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if (files) {
|
|
52
|
+
const formData = new form_data_1.default();
|
|
53
|
+
// Add regular data to form
|
|
54
|
+
if (data) {
|
|
55
|
+
for (const [key, value] of Object.entries(data)) {
|
|
56
|
+
formData.append(key, String(value));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Add files to form
|
|
60
|
+
for (const [key, fileStream] of Object.entries(files)) {
|
|
61
|
+
formData.append(key, fileStream);
|
|
62
|
+
}
|
|
63
|
+
config.data = formData;
|
|
64
|
+
// Add form headers
|
|
65
|
+
Object.assign(config.headers, formData.getHeaders());
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
config.data = data;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const response = await (0, axios_1.default)(config);
|
|
72
|
+
console.log('response', response.data);
|
|
73
|
+
if (endpoint !== 'create_session' && !response.data.hasOwnProperty('succeeded')) {
|
|
74
|
+
throw new Error(`It looks like the ${endpoint} action failed to return a response. Did you set your api_key when creating the Simplex class?`);
|
|
75
|
+
}
|
|
76
|
+
if (endpoint === 'create_session' && !response.data.hasOwnProperty('session_id')) {
|
|
77
|
+
throw new Error('Create session failed to return a session_id. Did you set your api_key when creating the Simplex class?');
|
|
78
|
+
}
|
|
79
|
+
return response.data;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (error.response) {
|
|
83
|
+
throw new Error(`Request failed with status ${error.response.status}: ${JSON.stringify(error.response.data)}`);
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async closeSession() {
|
|
89
|
+
if (!this.session_id)
|
|
90
|
+
return;
|
|
91
|
+
const formData = new form_data_1.default();
|
|
92
|
+
formData.append('session_id', this.session_id);
|
|
93
|
+
const response = await this.makeRequest('close_session', 'POST', formData);
|
|
94
|
+
this.session_id = null;
|
|
95
|
+
if (!response.succeeded) {
|
|
96
|
+
throw new Error(`Failed to close session: ${response.error}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async createSession(options = {}) {
|
|
100
|
+
const { showInConsole = true, proxies = true, sessionData } = options;
|
|
101
|
+
const formData = new form_data_1.default();
|
|
102
|
+
formData.append('proxies', String(proxies));
|
|
103
|
+
if (sessionData) {
|
|
104
|
+
formData.append('session_data', sessionData);
|
|
105
|
+
}
|
|
106
|
+
const response = await this.makeRequest('create_session', 'POST', formData);
|
|
107
|
+
if (!response.session_id) {
|
|
108
|
+
throw new Error("Create session failed to return a session_id. Did you set your api_key when creating the Simplex class?");
|
|
109
|
+
}
|
|
110
|
+
this.session_id = response.session_id;
|
|
111
|
+
const livestreamUrl = response.livestream_url;
|
|
112
|
+
if (showInConsole) {
|
|
113
|
+
console.log(`Livestream URL: ${livestreamUrl}`);
|
|
114
|
+
}
|
|
115
|
+
return livestreamUrl;
|
|
116
|
+
}
|
|
117
|
+
async goto(url, cdpUrl) {
|
|
118
|
+
if (!url) {
|
|
119
|
+
throw new Error('URL is required for goto action');
|
|
120
|
+
}
|
|
121
|
+
if (!cdpUrl && !this.session_id) {
|
|
122
|
+
throw new Error(`Must call createSession before calling action goto with url='${url}'`);
|
|
123
|
+
}
|
|
124
|
+
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
|
125
|
+
url = 'https://' + url;
|
|
126
|
+
}
|
|
127
|
+
const formData = new form_data_1.default();
|
|
128
|
+
formData.append('url', url);
|
|
129
|
+
if (cdpUrl) {
|
|
130
|
+
formData.append('cdp_url', cdpUrl);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
formData.append('session_id', this.session_id);
|
|
134
|
+
}
|
|
135
|
+
const response = await this.makeRequest('goto', 'POST', formData);
|
|
136
|
+
if (!response.succeeded) {
|
|
137
|
+
throw new Error(`Failed to goto url: ${response.error}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async click(elementDescription, cdpUrl) {
|
|
141
|
+
if (!cdpUrl && !this.session_id) {
|
|
142
|
+
throw new Error(`Must call createSession before calling action click with element_description='${elementDescription}'`);
|
|
143
|
+
}
|
|
144
|
+
const formData = new form_data_1.default();
|
|
145
|
+
formData.append('element_description', elementDescription);
|
|
146
|
+
if (cdpUrl) {
|
|
147
|
+
formData.append('cdp_url', cdpUrl);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
formData.append('session_id', this.session_id);
|
|
151
|
+
}
|
|
152
|
+
const response = await this.makeRequest('click', 'POST', formData);
|
|
153
|
+
if (!response.succeeded) {
|
|
154
|
+
throw new Error(`Failed to click element: ${response.error}`);
|
|
155
|
+
}
|
|
156
|
+
return response.element_clicked;
|
|
157
|
+
}
|
|
158
|
+
async type(text, cdpUrl) {
|
|
159
|
+
if (!cdpUrl && !this.session_id) {
|
|
160
|
+
throw new Error(`Must call createSession before calling action type with text='${text}'`);
|
|
161
|
+
}
|
|
162
|
+
const formData = new form_data_1.default();
|
|
163
|
+
formData.append('text', text);
|
|
164
|
+
if (cdpUrl) {
|
|
165
|
+
formData.append('cdp_url', cdpUrl);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
formData.append('session_id', this.session_id);
|
|
169
|
+
}
|
|
170
|
+
const response = await this.makeRequest('type', 'POST', formData);
|
|
171
|
+
if (!response.succeeded) {
|
|
172
|
+
throw new Error(`Failed to type text: ${response.error}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async pressEnter(cdpUrl) {
|
|
176
|
+
if (!cdpUrl && !this.session_id) {
|
|
177
|
+
throw new Error('Must call createSession before calling action press_enter');
|
|
178
|
+
}
|
|
179
|
+
const formData = new form_data_1.default();
|
|
180
|
+
if (cdpUrl) {
|
|
181
|
+
formData.append('cdp_url', cdpUrl);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
formData.append('session_id', this.session_id);
|
|
185
|
+
}
|
|
186
|
+
const response = await this.makeRequest('press_enter', 'POST', formData);
|
|
187
|
+
if (!response.succeeded) {
|
|
188
|
+
throw new Error(`Failed to press enter: ${response.error}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async pressTab(cdpUrl) {
|
|
192
|
+
if (!cdpUrl && !this.session_id) {
|
|
193
|
+
throw new Error('Must call createSession before calling action press_tab');
|
|
194
|
+
}
|
|
195
|
+
const formData = new form_data_1.default();
|
|
196
|
+
if (cdpUrl) {
|
|
197
|
+
formData.append('cdp_url', cdpUrl);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
formData.append('session_id', this.session_id);
|
|
201
|
+
}
|
|
202
|
+
const response = await this.makeRequest('press_tab', 'POST', formData);
|
|
203
|
+
if (!response.succeeded) {
|
|
204
|
+
throw new Error(`Failed to press tab: ${response.error}`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async deleteText(cdpUrl) {
|
|
208
|
+
if (!cdpUrl && !this.session_id) {
|
|
209
|
+
throw new Error('Must call createSession before calling action delete_text');
|
|
210
|
+
}
|
|
211
|
+
const formData = new form_data_1.default();
|
|
212
|
+
if (cdpUrl) {
|
|
213
|
+
formData.append('cdp_url', cdpUrl);
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
formData.append('session_id', this.session_id);
|
|
217
|
+
}
|
|
218
|
+
const response = await this.makeRequest('delete_text', 'POST', formData);
|
|
219
|
+
if (!response.succeeded) {
|
|
220
|
+
throw new Error(`Failed to delete text: ${response.error}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
async extractBbox(elementDescription, cdpUrl) {
|
|
224
|
+
if (!cdpUrl && !this.session_id) {
|
|
225
|
+
throw new Error(`Must call createSession before calling action extract_bbox with element_description='${elementDescription}'`);
|
|
226
|
+
}
|
|
227
|
+
const formData = new form_data_1.default();
|
|
228
|
+
formData.append('element_description', elementDescription);
|
|
229
|
+
if (cdpUrl) {
|
|
230
|
+
formData.append('cdp_url', cdpUrl);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
formData.append('session_id', this.session_id);
|
|
234
|
+
}
|
|
235
|
+
const response = await this.makeRequest('extract-bbox', 'GET', undefined, formData);
|
|
236
|
+
if (!response.succeeded) {
|
|
237
|
+
throw new Error(`Failed to extract bbox: ${response.error}`);
|
|
238
|
+
}
|
|
239
|
+
return response.bbox;
|
|
240
|
+
}
|
|
241
|
+
async extractText(elementDescription, cdpUrl) {
|
|
242
|
+
if (!cdpUrl && !this.session_id) {
|
|
243
|
+
throw new Error(`Must call createSession before calling action extract_text with element_description='${elementDescription}'`);
|
|
244
|
+
}
|
|
245
|
+
const params = {
|
|
246
|
+
element_description: elementDescription
|
|
247
|
+
};
|
|
248
|
+
if (cdpUrl) {
|
|
249
|
+
params.cdp_url = cdpUrl;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
params.session_id = this.session_id;
|
|
253
|
+
}
|
|
254
|
+
const response = await this.makeRequest('extract-text', 'GET', undefined, params);
|
|
255
|
+
if (!response.succeeded) {
|
|
256
|
+
throw new Error(`Failed to extract text: ${response.error}`);
|
|
257
|
+
}
|
|
258
|
+
return response.text;
|
|
259
|
+
}
|
|
260
|
+
async extractImage(elementDescription, cdpUrl) {
|
|
261
|
+
if (!cdpUrl && !this.session_id) {
|
|
262
|
+
throw new Error(`Must call createSession before calling action extract_image with element_description='${elementDescription}'`);
|
|
263
|
+
}
|
|
264
|
+
const formData = new form_data_1.default();
|
|
265
|
+
formData.append('element_description', elementDescription);
|
|
266
|
+
if (cdpUrl) {
|
|
267
|
+
formData.append('cdp_url', cdpUrl);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
formData.append('session_id', this.session_id);
|
|
271
|
+
}
|
|
272
|
+
const response = await this.makeRequest('extract-image', 'GET', undefined, formData);
|
|
273
|
+
if (!response.succeeded) {
|
|
274
|
+
throw new Error(`Failed to extract image: ${response.error}`);
|
|
275
|
+
}
|
|
276
|
+
return response.image;
|
|
277
|
+
}
|
|
278
|
+
async scroll(pixels, cdpUrl) {
|
|
279
|
+
if (!cdpUrl && !this.session_id) {
|
|
280
|
+
throw new Error(`Must call createSession before calling action scroll with pixels=${pixels}`);
|
|
281
|
+
}
|
|
282
|
+
const formData = new form_data_1.default();
|
|
283
|
+
formData.append('pixels', String(pixels));
|
|
284
|
+
if (cdpUrl) {
|
|
285
|
+
formData.append('cdp_url', cdpUrl);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
formData.append('session_id', this.session_id);
|
|
289
|
+
}
|
|
290
|
+
const response = await this.makeRequest('scroll', 'POST', formData);
|
|
291
|
+
if (!response.succeeded) {
|
|
292
|
+
throw new Error(`Failed to scroll: ${response.error}`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
async wait(milliseconds, cdpUrl) {
|
|
296
|
+
if (!cdpUrl && !this.session_id) {
|
|
297
|
+
throw new Error(`Must call createSession before calling action wait with milliseconds=${milliseconds}`);
|
|
298
|
+
}
|
|
299
|
+
const formData = new form_data_1.default();
|
|
300
|
+
formData.append('milliseconds', String(milliseconds));
|
|
301
|
+
if (cdpUrl) {
|
|
302
|
+
formData.append('cdp_url', cdpUrl);
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
formData.append('session_id', this.session_id);
|
|
306
|
+
}
|
|
307
|
+
const response = await this.makeRequest('wait', 'POST', formData);
|
|
308
|
+
if (!response.succeeded) {
|
|
309
|
+
throw new Error(`Failed to wait: ${response.error}`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async createLoginSession(url, proxies = true) {
|
|
313
|
+
const formData = new form_data_1.default();
|
|
314
|
+
formData.append('url', url);
|
|
315
|
+
formData.append('proxies', String(proxies));
|
|
316
|
+
const response = await this.makeRequest('create_login_session', 'POST', formData);
|
|
317
|
+
if (!response.succeeded) {
|
|
318
|
+
throw new Error(`Failed to create login session: ${response.error}`);
|
|
319
|
+
}
|
|
320
|
+
return response.login_session_url;
|
|
321
|
+
}
|
|
322
|
+
async restoreLoginSession(sessionData, cdpUrl) {
|
|
323
|
+
let sessionDataObj;
|
|
324
|
+
try {
|
|
325
|
+
sessionDataObj = JSON.parse(sessionData);
|
|
326
|
+
}
|
|
327
|
+
catch (_a) {
|
|
328
|
+
try {
|
|
329
|
+
sessionDataObj = JSON.parse(await fs_1.default.promises.readFile(sessionData, 'utf-8'));
|
|
330
|
+
}
|
|
331
|
+
catch (e) {
|
|
332
|
+
throw new Error(`Failed to load session data. Input must be valid JSON string or path to JSON file. Error: ${e}`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const formData = new form_data_1.default();
|
|
336
|
+
formData.append('session_data', JSON.stringify(sessionDataObj));
|
|
337
|
+
if (cdpUrl) {
|
|
338
|
+
formData.append('cdp_url', cdpUrl);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
formData.append('session_id', this.session_id);
|
|
342
|
+
}
|
|
343
|
+
const response = await this.makeRequest('restore_login_session', 'POST', formData);
|
|
344
|
+
if (!response.succeeded) {
|
|
345
|
+
throw new Error(`Failed to restore login session: ${response.error}`);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
async clickAndUpload(elementDescription, filePath) {
|
|
349
|
+
if (!this.session_id) {
|
|
350
|
+
throw new Error(`Must call createSession before calling action click_and_upload with element_description='${elementDescription}'`);
|
|
351
|
+
}
|
|
352
|
+
const fileStream = fs_1.default.createReadStream(filePath);
|
|
353
|
+
const formData = new form_data_1.default();
|
|
354
|
+
formData.append('element_description', elementDescription);
|
|
355
|
+
formData.append('session_id', this.session_id);
|
|
356
|
+
formData.append('file', fileStream);
|
|
357
|
+
try {
|
|
358
|
+
const response = await this.makeRequest('click_and_upload', 'POST', formData);
|
|
359
|
+
if (!response.succeeded) {
|
|
360
|
+
throw new Error(`Failed to click and upload: ${response.error}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
finally {
|
|
364
|
+
fileStream.destroy(); // Clean up the file stream
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
async clickAndDownload(elementDescription) {
|
|
368
|
+
if (!this.session_id) {
|
|
369
|
+
throw new Error(`Must call createSession before calling action click_and_download with element_description='${elementDescription}'`);
|
|
370
|
+
}
|
|
371
|
+
const formData = new form_data_1.default();
|
|
372
|
+
formData.append('element_description', elementDescription);
|
|
373
|
+
formData.append('session_id', this.session_id);
|
|
374
|
+
const response = await this.makeRequest('click_and_download', 'POST', formData);
|
|
375
|
+
if (!response.succeeded) {
|
|
376
|
+
throw new Error(`Failed to click and download: ${response.error}`);
|
|
377
|
+
}
|
|
378
|
+
return [response.b64, response.filename];
|
|
379
|
+
}
|
|
380
|
+
async exists(elementDescription, cdpUrl) {
|
|
381
|
+
if (!cdpUrl && !this.session_id) {
|
|
382
|
+
throw new Error(`Must call createSession before calling action exists with element_description='${elementDescription}'`);
|
|
383
|
+
}
|
|
384
|
+
const formData = new form_data_1.default();
|
|
385
|
+
formData.append('element_description', elementDescription);
|
|
386
|
+
if (cdpUrl) {
|
|
387
|
+
formData.append('cdp_url', cdpUrl);
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
formData.append('session_id', this.session_id);
|
|
391
|
+
}
|
|
392
|
+
const response = await this.makeRequest('exists', 'POST', formData);
|
|
393
|
+
if (!response.succeeded) {
|
|
394
|
+
throw new Error(`Failed to check if element exists: ${response.error}`);
|
|
395
|
+
}
|
|
396
|
+
return [response.exists, response.reasoning];
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
exports.Simplex = Simplex;
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "simplex-ts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript client for the Simplex API.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"test:unit": "jest tests/simplex.unit.test.ts",
|
|
11
|
+
"test:integration": "jest tests/simplex.integration.test.ts",
|
|
12
|
+
"test:coverage": "jest --coverage",
|
|
13
|
+
"prepare": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"axios": "^1.6.0",
|
|
17
|
+
"dotenv": "^16.4.7",
|
|
18
|
+
"form-data": "^4.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/jest": "^29.5.0",
|
|
22
|
+
"@types/node": "^20.8.0",
|
|
23
|
+
"jest": "^29.7.0",
|
|
24
|
+
"ts-jest": "^29.1.0",
|
|
25
|
+
"typescript": "^5.2.0"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"keywords": [
|
|
32
|
+
"simplex",
|
|
33
|
+
"api",
|
|
34
|
+
"client"
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT"
|
|
37
|
+
}
|