@alva-ai/toolkit 0.11.1 → 0.11.2
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/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.js +53 -9
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +36 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +36 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -353,6 +353,33 @@ var FeedResource = class {
|
|
|
353
353
|
this.client = client;
|
|
354
354
|
}
|
|
355
355
|
client;
|
|
356
|
+
/**
|
|
357
|
+
* Stop a feed's producer cronjob. This pauses future scheduled runs while
|
|
358
|
+
* preserving the feed and its existing data.
|
|
359
|
+
*
|
|
360
|
+
* Auth: caller must own the feed (uid match), enforced by the backend.
|
|
361
|
+
*/
|
|
362
|
+
async stop(params) {
|
|
363
|
+
this.client._requireAuth();
|
|
364
|
+
const id = requireFeedID(params.id);
|
|
365
|
+
return this.client._request(
|
|
366
|
+
"POST",
|
|
367
|
+
`/api/v1/feed/${encodeURIComponent(String(id))}/stop`
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Resume a stopped feed's producer cronjob.
|
|
372
|
+
*
|
|
373
|
+
* Auth: caller must own the feed (uid match), enforced by the backend.
|
|
374
|
+
*/
|
|
375
|
+
async resume(params) {
|
|
376
|
+
this.client._requireAuth();
|
|
377
|
+
const id = requireFeedID(params.id);
|
|
378
|
+
return this.client._request(
|
|
379
|
+
"POST",
|
|
380
|
+
`/api/v1/feed/${encodeURIComponent(String(id))}/resume`
|
|
381
|
+
);
|
|
382
|
+
}
|
|
356
383
|
/**
|
|
357
384
|
* Soft-delete a feed and all its active majors. Cascades:
|
|
358
385
|
* - all active feed_majors are soft-deleted in the same transaction
|
|
@@ -363,15 +390,19 @@ var FeedResource = class {
|
|
|
363
390
|
*/
|
|
364
391
|
async delete(params) {
|
|
365
392
|
this.client._requireAuth();
|
|
366
|
-
|
|
367
|
-
throw new Error("feed id must be a positive integer");
|
|
368
|
-
}
|
|
393
|
+
const id = requireFeedID(params.id);
|
|
369
394
|
return this.client._request(
|
|
370
395
|
"DELETE",
|
|
371
|
-
`/api/v1/feed/${encodeURIComponent(String(
|
|
396
|
+
`/api/v1/feed/${encodeURIComponent(String(id))}`
|
|
372
397
|
);
|
|
373
398
|
}
|
|
374
399
|
};
|
|
400
|
+
function requireFeedID(id) {
|
|
401
|
+
if (!Number.isInteger(id) || id <= 0) {
|
|
402
|
+
throw new Error("feed id must be a positive integer");
|
|
403
|
+
}
|
|
404
|
+
return id;
|
|
405
|
+
}
|
|
375
406
|
|
|
376
407
|
// src/resources/playbooks.ts
|
|
377
408
|
var PLAYBOOK_VISIBILITIES = [
|
|
@@ -2812,7 +2843,7 @@ var installPlaybookRuntime = (targetWindow) => {
|
|
|
2812
2843
|
};
|
|
2813
2844
|
|
|
2814
2845
|
// src/index.ts
|
|
2815
|
-
var VERSION = true ? "0.11.
|
|
2846
|
+
var VERSION = true ? "0.11.2" : "dev";
|
|
2816
2847
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2817
2848
|
0 && (module.exports = {
|
|
2818
2849
|
AlvaClient,
|