@mastra/client-js 1.16.0 → 1.17.0-alpha.1
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/CHANGELOG.md +56 -0
- package/dist/client.d.ts +25 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-client-js-workflows.md +50 -1
- package/dist/index.cjs +44 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +44 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/vector.d.ts +5 -5
- package/dist/resources/vector.d.ts.map +1 -1
- package/dist/types.d.ts +55 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -2007,7 +2007,7 @@ var Vector = class extends BaseResource {
|
|
|
2007
2007
|
/**
|
|
2008
2008
|
* Upserts vectors into an index
|
|
2009
2009
|
* @param params - Parameters containing vectors, metadata, and optional IDs
|
|
2010
|
-
* @returns Promise containing
|
|
2010
|
+
* @returns Promise containing the inserted vector IDs
|
|
2011
2011
|
*/
|
|
2012
2012
|
upsert(params) {
|
|
2013
2013
|
return this.request(`/vector/${encodeURIComponent(this.vectorName)}/upsert`, {
|
|
@@ -6206,6 +6206,49 @@ var MastraClient = class extends BaseResource {
|
|
|
6206
6206
|
})
|
|
6207
6207
|
);
|
|
6208
6208
|
}
|
|
6209
|
+
/**
|
|
6210
|
+
* Lists workflow schedules with optional filtering by workflowId or status.
|
|
6211
|
+
*/
|
|
6212
|
+
listSchedules(params = {}) {
|
|
6213
|
+
const searchParams = new URLSearchParams();
|
|
6214
|
+
if (params.workflowId) searchParams.set("workflowId", params.workflowId);
|
|
6215
|
+
if (params.status) searchParams.set("status", params.status);
|
|
6216
|
+
const qs = searchParams.toString();
|
|
6217
|
+
return this.request(`/schedules${qs ? `?${qs}` : ""}`);
|
|
6218
|
+
}
|
|
6219
|
+
/**
|
|
6220
|
+
* Gets a single schedule by ID.
|
|
6221
|
+
*/
|
|
6222
|
+
getSchedule(scheduleId) {
|
|
6223
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}`);
|
|
6224
|
+
}
|
|
6225
|
+
/**
|
|
6226
|
+
* Lists trigger history for a schedule, ordered by actualFireAt descending.
|
|
6227
|
+
*/
|
|
6228
|
+
listScheduleTriggers(scheduleId, params = {}) {
|
|
6229
|
+
const searchParams = new URLSearchParams();
|
|
6230
|
+
if (params.limit !== void 0) searchParams.set("limit", String(params.limit));
|
|
6231
|
+
if (params.fromActualFireAt !== void 0) searchParams.set("fromActualFireAt", String(params.fromActualFireAt));
|
|
6232
|
+
if (params.toActualFireAt !== void 0) searchParams.set("toActualFireAt", String(params.toActualFireAt));
|
|
6233
|
+
const qs = searchParams.toString();
|
|
6234
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}/triggers${qs ? `?${qs}` : ""}`);
|
|
6235
|
+
}
|
|
6236
|
+
/**
|
|
6237
|
+
* Pauses a schedule. The scheduler tick loop will skip paused schedules.
|
|
6238
|
+
* Idempotent — pausing an already-paused schedule returns the current state unchanged.
|
|
6239
|
+
* Pause status survives redeploys.
|
|
6240
|
+
*/
|
|
6241
|
+
pauseSchedule(scheduleId) {
|
|
6242
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}/pause`, { method: "POST" });
|
|
6243
|
+
}
|
|
6244
|
+
/**
|
|
6245
|
+
* Resumes a paused schedule. Recomputes nextFireAt from "now" so a long-paused schedule
|
|
6246
|
+
* does not fire a backlog. Idempotent — resuming an already-active schedule returns
|
|
6247
|
+
* the current state unchanged.
|
|
6248
|
+
*/
|
|
6249
|
+
resumeSchedule(scheduleId) {
|
|
6250
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}/resume`, { method: "POST" });
|
|
6251
|
+
}
|
|
6209
6252
|
};
|
|
6210
6253
|
|
|
6211
6254
|
// src/tools.ts
|