@techzunction/sdk 0.9.0 → 0.9.1

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.d.cts CHANGED
@@ -2963,7 +2963,7 @@ declare class ScopedClient {
2963
2963
  page?: number;
2964
2964
  limit?: number;
2965
2965
  [key: string]: unknown;
2966
- }): TZPaginatedQuery<T>;
2966
+ }, scope?: AuthScope): TZPaginatedQuery<T>;
2967
2967
  postDirect<T>(path: string, body?: unknown, scope?: AuthScope): Promise<T>;
2968
2968
  getDirect<T>(path: string, scope?: AuthScope): Promise<T>;
2969
2969
  patchDirect<T>(path: string, body?: unknown, scope?: AuthScope): Promise<T>;
package/dist/index.d.ts CHANGED
@@ -2963,7 +2963,7 @@ declare class ScopedClient {
2963
2963
  page?: number;
2964
2964
  limit?: number;
2965
2965
  [key: string]: unknown;
2966
- }): TZPaginatedQuery<T>;
2966
+ }, scope?: AuthScope): TZPaginatedQuery<T>;
2967
2967
  postDirect<T>(path: string, body?: unknown, scope?: AuthScope): Promise<T>;
2968
2968
  getDirect<T>(path: string, scope?: AuthScope): Promise<T>;
2969
2969
  patchDirect<T>(path: string, body?: unknown, scope?: AuthScope): Promise<T>;
package/dist/index.js CHANGED
@@ -374,16 +374,16 @@ var ScopedClient = class {
374
374
  return new TZQuery((signal) => this.root.rawRequest("POST", fp, { body: formData, scope: s, signal, sendOrgKey: this.sendOrgKey }));
375
375
  }
376
376
  /** Paginated GET → TZPaginatedQuery<T> with .next(), .prev(), .goTo() */
377
- paginated(path, params = {}) {
377
+ paginated(path, params = {}, scope) {
378
378
  const page = params.page ?? 1;
379
379
  const limit = params.limit ?? 20;
380
- const scope = this.defaultScope;
380
+ const resolvedScope = scope ?? this.defaultScope;
381
381
  const factory = (p, l) => {
382
382
  const merged = { ...params, page: p, limit: l };
383
383
  const qs = toQs(merged);
384
384
  const fp = this.fullPath(`${path}${qs}`);
385
385
  const executor = async (signal) => {
386
- const rawRes = await this.root.rawRequest("GET", fp, { scope, signal, sendOrgKey: this.sendOrgKey });
386
+ const rawRes = await this.root.rawRequest("GET", fp, { scope: resolvedScope, signal, sendOrgKey: this.sendOrgKey });
387
387
  const envelope = rawRes.raw;
388
388
  const pagination = envelope["pagination"] ?? { page: p, limit: l, total: 0, totalPages: 0, hasNextPage: false, hasPrevPage: false };
389
389
  return {
@@ -1109,7 +1109,7 @@ function createStorefrontBanking(c) {
1109
1109
  return c.patch(`/banking/accounts/${id}/auto-sweep`, data, "enduser");
1110
1110
  },
1111
1111
  getStatement(id, params) {
1112
- return c.paginated(`/banking/accounts/${id}/statement`, params);
1112
+ return c.paginated(`/banking/accounts/${id}/statement`, params, "enduser");
1113
1113
  }
1114
1114
  },
1115
1115
  // ─── Fixed Deposits ─────────────────────────────────────────────
@@ -1163,7 +1163,7 @@ function createStorefrontBanking(c) {
1163
1163
  return c.post("/banking/transfers/bills", data, "enduser");
1164
1164
  },
1165
1165
  list(params) {
1166
- return c.paginated("/banking/transfers/bills", params);
1166
+ return c.paginated("/banking/transfers/bills", params, "enduser");
1167
1167
  }
1168
1168
  },
1169
1169
  // ─── Cards ──────────────────────────────────────────────────────
@@ -1229,7 +1229,7 @@ function createStorefrontBanking(c) {
1229
1229
  // ─── Anomaly Alerts ─────────────────────────────────────────────
1230
1230
  alerts: {
1231
1231
  list(params) {
1232
- return c.paginated("/banking/analytics/alerts", params);
1232
+ return c.paginated("/banking/analytics/alerts", params, "enduser");
1233
1233
  },
1234
1234
  markRead(id) {
1235
1235
  return c.post(`/banking/analytics/alerts/${id}/read`, {}, "enduser");