@mastra/client-js 1.55.1-alpha.0 → 1.56.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/dist/index.js CHANGED
@@ -7851,11 +7851,21 @@ var MastraClient = class extends BaseResource {
7851
7851
  * Lists all datasets with optional pagination
7852
7852
  */
7853
7853
  listDatasets(params) {
7854
+ if (params?.datasetIds?.length === 0) return Promise.resolve({
7855
+ datasets: [],
7856
+ pagination: {
7857
+ total: 0,
7858
+ page: 0,
7859
+ perPage: false,
7860
+ hasMore: false
7861
+ }
7862
+ });
7854
7863
  const searchParams = new URLSearchParams();
7855
7864
  if (params?.page !== void 0) searchParams.set("page", String(params.page));
7856
7865
  if (params?.perPage !== void 0) searchParams.set("perPage", String(params.perPage));
7857
7866
  if (params?.targetType !== void 0) searchParams.set("targetType", params.targetType);
7858
7867
  for (const id of params?.targetIds ?? []) searchParams.append("targetIds", id);
7868
+ for (const id of params?.datasetIds ?? []) searchParams.append("datasetIds", id);
7859
7869
  if (params?.orderBy) {
7860
7870
  searchParams.set("orderBy[field]", params.orderBy.field);
7861
7871
  searchParams.set("orderBy[direction]", params.orderBy.direction);