exa-js 1.8.1 → 1.8.4
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.mts +198 -150
- package/dist/index.d.ts +198 -150
- package/dist/index.js +137 -98
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +129 -96
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,13 +32,19 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
CreateEnrichmentParametersFormat: () => CreateEnrichmentParametersFormat,
|
|
34
34
|
EventType: () => EventType,
|
|
35
|
+
EventsClient: () => EventsClient,
|
|
35
36
|
Exa: () => Exa2,
|
|
36
37
|
ExaError: () => ExaError,
|
|
37
38
|
HttpStatusCode: () => HttpStatusCode,
|
|
39
|
+
MonitorObject: () => MonitorObject,
|
|
40
|
+
MonitorRunObject: () => MonitorRunObject,
|
|
41
|
+
MonitorRunStatus: () => MonitorRunStatus,
|
|
42
|
+
MonitorRunType: () => MonitorRunType,
|
|
43
|
+
MonitorStatus: () => MonitorStatus,
|
|
38
44
|
ResearchClient: () => ResearchClient,
|
|
39
45
|
ResearchModel: () => ResearchCreateTaskRequestDtoModel,
|
|
40
46
|
ResearchStatus: () => ResearchTaskDtoStatus,
|
|
41
|
-
|
|
47
|
+
UpdateMonitorStatus: () => UpdateMonitorStatus,
|
|
42
48
|
WebhookStatus: () => WebhookStatus,
|
|
43
49
|
WebsetEnrichmentFormat: () => WebsetEnrichmentFormat,
|
|
44
50
|
WebsetEnrichmentStatus: () => WebsetEnrichmentStatus,
|
|
@@ -46,12 +52,12 @@ __export(index_exports, {
|
|
|
46
52
|
WebsetItemEvaluationSatisfied: () => WebsetItemEvaluationSatisfied,
|
|
47
53
|
WebsetItemSource: () => WebsetItemSource,
|
|
48
54
|
WebsetItemsClient: () => WebsetItemsClient,
|
|
55
|
+
WebsetMonitorsClient: () => WebsetMonitorsClient,
|
|
49
56
|
WebsetSearchBehavior: () => WebsetSearchBehavior,
|
|
50
57
|
WebsetSearchCanceledReason: () => WebsetSearchCanceledReason,
|
|
51
58
|
WebsetSearchStatus: () => WebsetSearchStatus,
|
|
52
59
|
WebsetSearchesClient: () => WebsetSearchesClient,
|
|
53
60
|
WebsetStatus: () => WebsetStatus,
|
|
54
|
-
WebsetStreamsClient: () => WebsetStreamsClient,
|
|
55
61
|
WebsetWebhooksClient: () => WebsetWebhooksClient,
|
|
56
62
|
WebsetsClient: () => WebsetsClient,
|
|
57
63
|
default: () => index_default
|
|
@@ -290,6 +296,94 @@ var WebsetItemsClient = class extends WebsetsBaseClient {
|
|
|
290
296
|
}
|
|
291
297
|
};
|
|
292
298
|
|
|
299
|
+
// src/websets/monitors.ts
|
|
300
|
+
var WebsetMonitorRunsClient = class extends WebsetsBaseClient {
|
|
301
|
+
/**
|
|
302
|
+
* List all runs for a Monitor
|
|
303
|
+
* @param monitorId The ID of the Monitor
|
|
304
|
+
* @param options Pagination options
|
|
305
|
+
* @returns The list of Monitor runs
|
|
306
|
+
*/
|
|
307
|
+
async list(monitorId, options) {
|
|
308
|
+
const params = this.buildPaginationParams(options);
|
|
309
|
+
return this.request(
|
|
310
|
+
`/v0/monitors/${monitorId}/runs`,
|
|
311
|
+
"GET",
|
|
312
|
+
void 0,
|
|
313
|
+
params
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Get a specific Monitor run
|
|
318
|
+
* @param monitorId The ID of the Monitor
|
|
319
|
+
* @param runId The ID of the Monitor run
|
|
320
|
+
* @returns The Monitor run
|
|
321
|
+
*/
|
|
322
|
+
async get(monitorId, runId) {
|
|
323
|
+
return this.request(
|
|
324
|
+
`/v0/monitors/${monitorId}/runs/${runId}`,
|
|
325
|
+
"GET"
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
var WebsetMonitorsClient = class extends WebsetsBaseClient {
|
|
330
|
+
constructor(client) {
|
|
331
|
+
super(client);
|
|
332
|
+
this.runs = new WebsetMonitorRunsClient(client);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Create a Monitor
|
|
336
|
+
* @param params The monitor parameters
|
|
337
|
+
* @returns The created Monitor
|
|
338
|
+
*/
|
|
339
|
+
async create(params) {
|
|
340
|
+
return this.request("/v0/monitors", "POST", params);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Get a Monitor by ID
|
|
344
|
+
* @param id The ID of the Monitor
|
|
345
|
+
* @returns The Monitor
|
|
346
|
+
*/
|
|
347
|
+
async get(id) {
|
|
348
|
+
return this.request(`/v0/monitors/${id}`, "GET");
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* List all Monitors
|
|
352
|
+
* @param options Pagination and filtering options
|
|
353
|
+
* @returns The list of Monitors
|
|
354
|
+
*/
|
|
355
|
+
async list(options) {
|
|
356
|
+
const params = {
|
|
357
|
+
cursor: options?.cursor,
|
|
358
|
+
limit: options?.limit,
|
|
359
|
+
websetId: options?.websetId
|
|
360
|
+
};
|
|
361
|
+
return this.request(
|
|
362
|
+
"/v0/monitors",
|
|
363
|
+
"GET",
|
|
364
|
+
void 0,
|
|
365
|
+
params
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Update a Monitor
|
|
370
|
+
* @param id The ID of the Monitor
|
|
371
|
+
* @param params The monitor update parameters (status, metadata)
|
|
372
|
+
* @returns The updated Monitor
|
|
373
|
+
*/
|
|
374
|
+
async update(id, params) {
|
|
375
|
+
return this.request(`/v0/monitors/${id}`, "PATCH", params);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Delete a Monitor
|
|
379
|
+
* @param id The ID of the Monitor
|
|
380
|
+
* @returns The deleted Monitor
|
|
381
|
+
*/
|
|
382
|
+
async delete(id) {
|
|
383
|
+
return this.request(`/v0/monitors/${id}`, "DELETE");
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
|
|
293
387
|
// src/websets/openapi.ts
|
|
294
388
|
var CreateEnrichmentParametersFormat = /* @__PURE__ */ ((CreateEnrichmentParametersFormat2) => {
|
|
295
389
|
CreateEnrichmentParametersFormat2["text"] = "text";
|
|
@@ -315,11 +409,36 @@ var EventType = /* @__PURE__ */ ((EventType2) => {
|
|
|
315
409
|
EventType2["webset_item_enriched"] = "webset.item.enriched";
|
|
316
410
|
return EventType2;
|
|
317
411
|
})(EventType || {});
|
|
318
|
-
var
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
412
|
+
var MonitorObject = /* @__PURE__ */ ((MonitorObject2) => {
|
|
413
|
+
MonitorObject2["monitor"] = "monitor";
|
|
414
|
+
return MonitorObject2;
|
|
415
|
+
})(MonitorObject || {});
|
|
416
|
+
var MonitorStatus = /* @__PURE__ */ ((MonitorStatus2) => {
|
|
417
|
+
MonitorStatus2["enabled"] = "enabled";
|
|
418
|
+
MonitorStatus2["disabled"] = "disabled";
|
|
419
|
+
return MonitorStatus2;
|
|
420
|
+
})(MonitorStatus || {});
|
|
421
|
+
var MonitorRunObject = /* @__PURE__ */ ((MonitorRunObject2) => {
|
|
422
|
+
MonitorRunObject2["monitor_run"] = "monitor_run";
|
|
423
|
+
return MonitorRunObject2;
|
|
424
|
+
})(MonitorRunObject || {});
|
|
425
|
+
var MonitorRunStatus = /* @__PURE__ */ ((MonitorRunStatus2) => {
|
|
426
|
+
MonitorRunStatus2["created"] = "created";
|
|
427
|
+
MonitorRunStatus2["running"] = "running";
|
|
428
|
+
MonitorRunStatus2["completed"] = "completed";
|
|
429
|
+
MonitorRunStatus2["canceled"] = "canceled";
|
|
430
|
+
return MonitorRunStatus2;
|
|
431
|
+
})(MonitorRunStatus || {});
|
|
432
|
+
var MonitorRunType = /* @__PURE__ */ ((MonitorRunType2) => {
|
|
433
|
+
MonitorRunType2["search"] = "search";
|
|
434
|
+
MonitorRunType2["refresh"] = "refresh";
|
|
435
|
+
return MonitorRunType2;
|
|
436
|
+
})(MonitorRunType || {});
|
|
437
|
+
var UpdateMonitorStatus = /* @__PURE__ */ ((UpdateMonitorStatus2) => {
|
|
438
|
+
UpdateMonitorStatus2["enabled"] = "enabled";
|
|
439
|
+
UpdateMonitorStatus2["disabled"] = "disabled";
|
|
440
|
+
return UpdateMonitorStatus2;
|
|
441
|
+
})(UpdateMonitorStatus || {});
|
|
323
442
|
var WebhookStatus = /* @__PURE__ */ ((WebhookStatus2) => {
|
|
324
443
|
WebhookStatus2["active"] = "active";
|
|
325
444
|
WebhookStatus2["inactive"] = "inactive";
|
|
@@ -416,94 +535,6 @@ var WebsetSearchesClient = class extends WebsetsBaseClient {
|
|
|
416
535
|
}
|
|
417
536
|
};
|
|
418
537
|
|
|
419
|
-
// src/websets/streams.ts
|
|
420
|
-
var WebsetStreamRunsClient = class extends WebsetsBaseClient {
|
|
421
|
-
/**
|
|
422
|
-
* List all runs for a Stream
|
|
423
|
-
* @param streamId The ID of the Stream
|
|
424
|
-
* @param options Pagination options
|
|
425
|
-
* @returns The list of Stream runs
|
|
426
|
-
*/
|
|
427
|
-
async list(streamId, options) {
|
|
428
|
-
const params = this.buildPaginationParams(options);
|
|
429
|
-
return this.request(
|
|
430
|
-
`/v0/streams/${streamId}/runs`,
|
|
431
|
-
"GET",
|
|
432
|
-
void 0,
|
|
433
|
-
params
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* Get a specific Stream run
|
|
438
|
-
* @param streamId The ID of the Stream
|
|
439
|
-
* @param runId The ID of the Stream run
|
|
440
|
-
* @returns The Stream run
|
|
441
|
-
*/
|
|
442
|
-
async get(streamId, runId) {
|
|
443
|
-
return this.request(
|
|
444
|
-
`/v0/streams/${streamId}/runs/${runId}`,
|
|
445
|
-
"GET"
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
var WebsetStreamsClient = class extends WebsetsBaseClient {
|
|
450
|
-
constructor(client) {
|
|
451
|
-
super(client);
|
|
452
|
-
this.runs = new WebsetStreamRunsClient(client);
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Create a Stream
|
|
456
|
-
* @param params The stream parameters
|
|
457
|
-
* @returns The created Stream
|
|
458
|
-
*/
|
|
459
|
-
async create(params) {
|
|
460
|
-
return this.request("/v0/streams", "POST", params);
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* Get a Stream by ID
|
|
464
|
-
* @param id The ID of the Stream
|
|
465
|
-
* @returns The Stream
|
|
466
|
-
*/
|
|
467
|
-
async get(id) {
|
|
468
|
-
return this.request(`/v0/streams/${id}`, "GET");
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* List all Streams
|
|
472
|
-
* @param options Pagination and filtering options
|
|
473
|
-
* @returns The list of Streams
|
|
474
|
-
*/
|
|
475
|
-
async list(options) {
|
|
476
|
-
const params = {
|
|
477
|
-
cursor: options?.cursor,
|
|
478
|
-
limit: options?.limit,
|
|
479
|
-
websetId: options?.websetId
|
|
480
|
-
};
|
|
481
|
-
return this.request(
|
|
482
|
-
"/v0/streams",
|
|
483
|
-
"GET",
|
|
484
|
-
void 0,
|
|
485
|
-
params
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Update a Stream
|
|
490
|
-
* @param id The ID of the Stream
|
|
491
|
-
* @param params The stream update parameters (status, metadata)
|
|
492
|
-
* @returns The updated Stream
|
|
493
|
-
*/
|
|
494
|
-
async update(id, params) {
|
|
495
|
-
return this.request(`/v0/streams/${id}`, "PATCH", params);
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
|
-
* Delete a Stream
|
|
499
|
-
* @param id The ID of the Stream
|
|
500
|
-
* @returns The deleted Stream
|
|
501
|
-
*/
|
|
502
|
-
async delete(id) {
|
|
503
|
-
return this.request(`/v0/streams/${id}`, "DELETE");
|
|
504
|
-
}
|
|
505
|
-
};
|
|
506
|
-
|
|
507
538
|
// src/websets/webhooks.ts
|
|
508
539
|
var WebsetWebhooksClient = class extends WebsetsBaseClient {
|
|
509
540
|
/**
|
|
@@ -652,7 +683,7 @@ var WebsetsClient = class extends WebsetsBaseClient {
|
|
|
652
683
|
this.items = new WebsetItemsClient(client);
|
|
653
684
|
this.searches = new WebsetSearchesClient(client);
|
|
654
685
|
this.enrichments = new WebsetEnrichmentsClient(client);
|
|
655
|
-
this.
|
|
686
|
+
this.monitors = new WebsetMonitorsClient(client);
|
|
656
687
|
this.webhooks = new WebsetWebhooksClient(client);
|
|
657
688
|
}
|
|
658
689
|
/**
|
|
@@ -946,6 +977,7 @@ var Exa2 = class {
|
|
|
946
977
|
extras,
|
|
947
978
|
livecrawl,
|
|
948
979
|
livecrawlTimeout,
|
|
980
|
+
context,
|
|
949
981
|
...rest
|
|
950
982
|
} = options;
|
|
951
983
|
const contentsOptions = {};
|
|
@@ -962,6 +994,7 @@ var Exa2 = class {
|
|
|
962
994
|
if (livecrawl !== void 0) contentsOptions.livecrawl = livecrawl;
|
|
963
995
|
if (livecrawlTimeout !== void 0)
|
|
964
996
|
contentsOptions.livecrawlTimeout = livecrawlTimeout;
|
|
997
|
+
if (context !== void 0) contentsOptions.context = context;
|
|
965
998
|
return {
|
|
966
999
|
contentsOptions,
|
|
967
1000
|
restOptions: rest
|
|
@@ -1346,13 +1379,19 @@ var index_default = Exa2;
|
|
|
1346
1379
|
0 && (module.exports = {
|
|
1347
1380
|
CreateEnrichmentParametersFormat,
|
|
1348
1381
|
EventType,
|
|
1382
|
+
EventsClient,
|
|
1349
1383
|
Exa,
|
|
1350
1384
|
ExaError,
|
|
1351
1385
|
HttpStatusCode,
|
|
1386
|
+
MonitorObject,
|
|
1387
|
+
MonitorRunObject,
|
|
1388
|
+
MonitorRunStatus,
|
|
1389
|
+
MonitorRunType,
|
|
1390
|
+
MonitorStatus,
|
|
1352
1391
|
ResearchClient,
|
|
1353
1392
|
ResearchModel,
|
|
1354
1393
|
ResearchStatus,
|
|
1355
|
-
|
|
1394
|
+
UpdateMonitorStatus,
|
|
1356
1395
|
WebhookStatus,
|
|
1357
1396
|
WebsetEnrichmentFormat,
|
|
1358
1397
|
WebsetEnrichmentStatus,
|
|
@@ -1360,12 +1399,12 @@ var index_default = Exa2;
|
|
|
1360
1399
|
WebsetItemEvaluationSatisfied,
|
|
1361
1400
|
WebsetItemSource,
|
|
1362
1401
|
WebsetItemsClient,
|
|
1402
|
+
WebsetMonitorsClient,
|
|
1363
1403
|
WebsetSearchBehavior,
|
|
1364
1404
|
WebsetSearchCanceledReason,
|
|
1365
1405
|
WebsetSearchStatus,
|
|
1366
1406
|
WebsetSearchesClient,
|
|
1367
1407
|
WebsetStatus,
|
|
1368
|
-
WebsetStreamsClient,
|
|
1369
1408
|
WebsetWebhooksClient,
|
|
1370
1409
|
WebsetsClient
|
|
1371
1410
|
});
|