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