@delopay/sdk 0.178.0 → 0.179.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.cjs CHANGED
@@ -4647,6 +4647,49 @@ var Analytics = class {
4647
4647
  query: params
4648
4648
  });
4649
4649
  }
4650
+ /**
4651
+ * Every analytics exclusion of the merchant, with the payments each one
4652
+ * matched in the lookback window (todos#184).
4653
+ *
4654
+ * These rules change what the merchant's own dashboards count. Financial
4655
+ * records and transaction lists are never filtered by them.
4656
+ *
4657
+ * ⚠️ `matched_payments` **overlaps between rules and must not be summed**:
4658
+ * a payment matched by three rules is counted once by each. The envelope's
4659
+ * `best_effort` and `lookback_days` qualify every row — matching runs on
4660
+ * client signals that may be absent or expired, within that window.
4661
+ * `GET /analytics/exclusions`
4662
+ */
4663
+ async listExclusions() {
4664
+ return this.request("GET", "/analytics/exclusions");
4665
+ }
4666
+ /**
4667
+ * Write a new exclusion. A shop-scoped user must name their own shop in
4668
+ * `profile_id`; omitting it applies the rule to every shop of the merchant.
4669
+ * Omitting `surfaces` means **all five**, not none.
4670
+ * `POST /analytics/exclusions`
4671
+ */
4672
+ async createExclusion(rule) {
4673
+ return this.request("POST", "/analytics/exclusions", { body: rule });
4674
+ }
4675
+ /**
4676
+ * Replace a stored exclusion **completely**. This is not a patch: every
4677
+ * field you leave out reverts to its default rather than keeping its stored
4678
+ * value, so send the whole rule — including an explicit `null` for a
4679
+ * `profile_id`, `value`, `valid_from`, `valid_until` or `note` you mean to
4680
+ * clear, and the full `surfaces` list you mean to keep.
4681
+ * `PUT /analytics/exclusions/{id}`
4682
+ */
4683
+ async updateExclusion(id, rule) {
4684
+ return this.request("PUT", `/analytics/exclusions/${encodeURIComponent(id)}`, { body: rule });
4685
+ }
4686
+ /**
4687
+ * Delete a stored exclusion. Returns the rule as it was, so a caller can
4688
+ * say what it removed. `DELETE /analytics/exclusions/{id}`
4689
+ */
4690
+ async deleteExclusion(id) {
4691
+ return this.request("DELETE", `/analytics/exclusions/${encodeURIComponent(id)}`);
4692
+ }
4650
4693
  /** Global search. `POST /analytics/search` */
4651
4694
  async search(params) {
4652
4695
  return this.request("POST", "/analytics/search", { body: params });