pinata 1.0.6 → 1.1.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.mjs CHANGED
@@ -1277,6 +1277,10 @@ var FilterFiles = class {
1277
1277
  this.query.cidPending = cidPending;
1278
1278
  return this;
1279
1279
  }
1280
+ pageToken(pageToken) {
1281
+ this.query.pageToken = pageToken;
1282
+ return this;
1283
+ }
1280
1284
  then(onfulfilled) {
1281
1285
  return this.fetchPage().then(onfulfilled);
1282
1286
  }
@@ -1286,7 +1290,7 @@ var FilterFiles = class {
1286
1290
  }
1287
1291
  const response = await listFiles(this.config, this.query);
1288
1292
  this.currentPageToken = response.next_page_token;
1289
- return response.files;
1293
+ return response;
1290
1294
  }
1291
1295
  // // rate limit, hopefully temporary?
1292
1296
  // private async rateLimit(): Promise<void> {
@@ -1305,7 +1309,7 @@ var FilterFiles = class {
1305
1309
  async *[Symbol.asyncIterator]() {
1306
1310
  while (true) {
1307
1311
  const items = await this.fetchPage();
1308
- for (const item of items) {
1312
+ for (const item of items.files) {
1309
1313
  yield item;
1310
1314
  }
1311
1315
  if (!this.currentPageToken) {
@@ -1522,10 +1526,14 @@ var FilterGroups = class {
1522
1526
  this.query.isPublic = isPublic;
1523
1527
  return this;
1524
1528
  }
1529
+ pageToken(pageToken) {
1530
+ this.query.pageToken = pageToken;
1531
+ return this;
1532
+ }
1525
1533
  then(onfulfilled) {
1526
1534
  return this.fetchPage().then((response) => {
1527
1535
  this.nextPageToken = response.next_page_token;
1528
- return response.groups;
1536
+ return response;
1529
1537
  }).then(onfulfilled);
1530
1538
  }
1531
1539
  async fetchPage() {