@wokuapp/sdk 0.5.0 → 0.7.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/README.md CHANGED
@@ -397,6 +397,11 @@ const pdf: Uint8Array = await woku.folders.pdf(folder.id, { lang: 'en' });
397
397
  // 0 for the whole history), with the daily sums and the histogram of scores.
398
398
  // Every type keeps its own scale: NPS -100..100, CSAT %, CES and stars 1-5.
399
399
  const metrics = await woku.folders.metrics(folder.id, { days: 30 });
400
+ // Or a custom range of UTC days (both inclusive), as the admin custom period.
401
+ const september = await woku.folders.metrics(folder.id, {
402
+ from: '2026-09-01',
403
+ to: '2026-09-30',
404
+ });
400
405
  for (const tool of metrics.tools) {
401
406
  console.log(
402
407
  tool.name,
@@ -406,9 +411,13 @@ for (const tool of metrics.tools) {
406
411
  }
407
412
 
408
413
  // WhatsApp numbers alerted when a comment on any tool of the folder is an
409
- // improvement (wokus, NPS, CSAT and CES). The list replaces the previous one.
414
+ // improvement (wokus, NPS, CSAT and CES). `allReviews: true` alerts every
415
+ // review, recognitions too. The list replaces the previous one.
410
416
  await woku.folders.update(folder.id, {
411
- whatsappAlertRecipients: [{ whatsappId: '56912345678', name: 'Ana' }],
417
+ whatsappAlertRecipients: [
418
+ { whatsappId: '56912345678', name: 'Ana' },
419
+ { whatsappId: '56987654321', name: 'Luis', allReviews: true },
420
+ ],
412
421
  });
413
422
 
414
423
  // Deleting a folder never deletes its content: it moves up to the parent.
@@ -493,8 +502,8 @@ await woku.npsTools.create(body, { idempotencyKey: 'my-key' });
493
502
 
494
503
  `trackers`, `npsTools` / `csatTools` / `cesTools`, `nps` / `csat` / `ces`,
495
504
  `wokus`, `forms`, `flows`, `actionPlans`, `actionPlanGroups`, `tickets`,
496
- `ticketDestinations`, `dispatches`, `reports`, `company`, `quarantines`,
497
- `journeys`, `folders`, `tools`, `journeyFolders`.
505
+ `ticketDestinations`, `dispatches`, `reports`, `company`, `journeys`,
506
+ `folders`, `tools`, `journeyFolders`.
498
507
 
499
508
  ## License
500
509
 
package/dist/index.cjs CHANGED
@@ -38,7 +38,7 @@ var FollowUps = class {
38
38
  };
39
39
 
40
40
  // package.json
41
- var version = "0.5.0";
41
+ var version = "0.7.0";
42
42
 
43
43
  // src/core/errors.ts
44
44
  var WokuError = class extends Error {
@@ -1577,20 +1577,6 @@ var Journeys = class {
1577
1577
  }
1578
1578
  };
1579
1579
 
1580
- // src/resources/quarantines.ts
1581
- var Quarantines = class {
1582
- constructor(client) {
1583
- this.client = client;
1584
- }
1585
- /** Check whether a contact is quarantined. */
1586
- check(params, opts) {
1587
- return this.client.request("get", "/v1/quarantines/check", {
1588
- ...opts,
1589
- query: { ...params, ...opts?.query }
1590
- });
1591
- }
1592
- };
1593
-
1594
1580
  // src/resources/folders.ts
1595
1581
  var Folders = class {
1596
1582
  constructor(client) {
@@ -1666,8 +1652,9 @@ var Folders = class {
1666
1652
  * subfolders for a period against the one before it, with the daily sums and
1667
1653
  * the histogram of scores. `days` is 7, 30 (default) or 90, or 0 for the whole
1668
1654
  * history (every `previous` window is then empty). The period is the last
1669
- * `days` calendar days in UTC, today included. Scales are never mixed across
1670
- * types.
1655
+ * `days` calendar days in UTC, today included. Or a custom range with `from`
1656
+ * and `to` (`YYYY-MM-DD` UTC days, both inclusive, up to 731 days), which
1657
+ * replaces `days`. Scales are never mixed across types.
1671
1658
  */
1672
1659
  metrics(id, params, opts) {
1673
1660
  return this.client.request(
@@ -1853,7 +1840,6 @@ var Woku = class {
1853
1840
  this.folders = new Folders(this.client);
1854
1841
  this.tools = new Tools(this.client);
1855
1842
  this.journeyFolders = new JourneyFolders(this.client);
1856
- this.quarantines = new Quarantines(this.client);
1857
1843
  }
1858
1844
  };
1859
1845