@techzunction/sdk 0.6.5 → 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/dist/index.js CHANGED
@@ -68,7 +68,7 @@ var TZPaginatedQuery = class extends TZQuery {
68
68
  /** Check if there's a next page (must await first) */
69
69
  async hasNext() {
70
70
  const result = await this.data();
71
- return this._page < result.totalPages;
71
+ return result.pagination.hasNextPage;
72
72
  }
73
73
  /** Check if there's a previous page */
74
74
  hasPrev() {
@@ -370,12 +370,18 @@ var ScopedClient = class {
370
370
  const merged = { ...params, page: p, limit: l };
371
371
  const qs = toQs(merged);
372
372
  const fp = this.fullPath(`${path}${qs}`);
373
- return new TZPaginatedQuery(
374
- (signal) => this.root.rawRequest("GET", fp, { scope, signal, sendOrgKey: this.sendOrgKey }),
375
- p,
376
- l,
377
- factory
378
- );
373
+ const executor = async (signal) => {
374
+ const rawRes = await this.root.rawRequest("GET", fp, { scope, signal, sendOrgKey: this.sendOrgKey });
375
+ const envelope = rawRes.raw;
376
+ const pagination = envelope.pagination ?? { page: p, limit: l, total: 0, totalPages: 0, hasNextPage: false, hasPrevPage: false };
377
+ return {
378
+ data: { data: rawRes.data, pagination },
379
+ raw: rawRes.raw,
380
+ status: rawRes.status,
381
+ headers: rawRes.headers
382
+ };
383
+ };
384
+ return new TZPaginatedQuery(executor, p, l, factory);
379
385
  };
380
386
  return factory(page, limit);
381
387
  }
@@ -1720,6 +1726,9 @@ function createAdmin(root, c) {
1720
1726
  },
1721
1727
  update(id, data) {
1722
1728
  return c.patch(`/support/${id}`, data);
1729
+ },
1730
+ reply(ticketId, data) {
1731
+ return c.post(`/support/${ticketId}/reply`, data);
1723
1732
  }
1724
1733
  },
1725
1734
  // ─── Content (Admin) ─────────────────────────────────────────────
@@ -2171,6 +2180,12 @@ function createAdmin(root, c) {
2171
2180
  markPaid(id) {
2172
2181
  return c.patch(`/admin/finance/payouts/${id}`, { isPaid: true });
2173
2182
  },
2183
+ createPayout(data) {
2184
+ return c.post("/admin/finance/payouts", data);
2185
+ },
2186
+ markPayoutPaid(id) {
2187
+ return c.patch(`/admin/finance/payouts/${id}`, { isPaid: true });
2188
+ },
2174
2189
  exportReport(params) {
2175
2190
  return c.post("/admin/reports/export", params);
2176
2191
  }