@certen.io/sdk 0.4.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +874 -185
  2. package/README.md +133 -119
  3. package/dist/client.d.ts +99 -6
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +269 -20
  6. package/dist/client.js.map +1 -1
  7. package/dist/doctor.d.ts +53 -0
  8. package/dist/doctor.d.ts.map +1 -0
  9. package/dist/doctor.js +451 -0
  10. package/dist/doctor.js.map +1 -0
  11. package/dist/error-codes.d.ts +14 -0
  12. package/dist/error-codes.d.ts.map +1 -0
  13. package/dist/error-codes.js +55 -0
  14. package/dist/error-codes.js.map +1 -0
  15. package/dist/errors.d.ts +91 -1
  16. package/dist/errors.d.ts.map +1 -1
  17. package/dist/errors.js +130 -1
  18. package/dist/errors.js.map +1 -1
  19. package/dist/funding.d.ts +43 -0
  20. package/dist/funding.d.ts.map +1 -0
  21. package/dist/funding.js +116 -0
  22. package/dist/funding.js.map +1 -0
  23. package/dist/index.d.ts +10 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +18 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/oauth.d.ts +56 -0
  28. package/dist/oauth.d.ts.map +1 -0
  29. package/dist/oauth.js +68 -0
  30. package/dist/oauth.js.map +1 -0
  31. package/dist/registration.d.ts +33 -0
  32. package/dist/registration.d.ts.map +1 -0
  33. package/dist/registration.js +49 -0
  34. package/dist/registration.js.map +1 -0
  35. package/dist/resources/admin.d.ts +52 -1
  36. package/dist/resources/admin.d.ts.map +1 -1
  37. package/dist/resources/admin.js +55 -0
  38. package/dist/resources/admin.js.map +1 -1
  39. package/dist/resources/billing.d.ts +242 -0
  40. package/dist/resources/billing.d.ts.map +1 -0
  41. package/dist/resources/billing.js +376 -0
  42. package/dist/resources/billing.js.map +1 -0
  43. package/dist/resources/chains.d.ts +38 -0
  44. package/dist/resources/chains.d.ts.map +1 -0
  45. package/dist/resources/chains.js +46 -0
  46. package/dist/resources/chains.js.map +1 -0
  47. package/dist/resources/device.d.ts +43 -0
  48. package/dist/resources/device.d.ts.map +1 -0
  49. package/dist/resources/device.js +49 -0
  50. package/dist/resources/device.js.map +1 -0
  51. package/dist/resources/execute.d.ts +39 -1
  52. package/dist/resources/execute.d.ts.map +1 -1
  53. package/dist/resources/execute.js +41 -1
  54. package/dist/resources/execute.js.map +1 -1
  55. package/dist/resources/health.d.ts +34 -0
  56. package/dist/resources/health.d.ts.map +1 -0
  57. package/dist/resources/health.js +43 -0
  58. package/dist/resources/health.js.map +1 -0
  59. package/dist/resources/identity.d.ts +83 -2
  60. package/dist/resources/identity.d.ts.map +1 -1
  61. package/dist/resources/identity.js +154 -2
  62. package/dist/resources/identity.js.map +1 -1
  63. package/dist/resources/oauth-clients.d.ts +71 -0
  64. package/dist/resources/oauth-clients.d.ts.map +1 -0
  65. package/dist/resources/oauth-clients.js +75 -0
  66. package/dist/resources/oauth-clients.js.map +1 -0
  67. package/dist/resources/pending.d.ts +13 -1
  68. package/dist/resources/pending.d.ts.map +1 -1
  69. package/dist/resources/pending.js +15 -0
  70. package/dist/resources/pending.js.map +1 -1
  71. package/dist/resources/proof.d.ts +75 -0
  72. package/dist/resources/proof.d.ts.map +1 -0
  73. package/dist/resources/proof.js +103 -0
  74. package/dist/resources/proof.js.map +1 -0
  75. package/dist/resources/registration-tokens.d.ts +51 -0
  76. package/dist/resources/registration-tokens.d.ts.map +1 -0
  77. package/dist/resources/registration-tokens.js +54 -0
  78. package/dist/resources/registration-tokens.js.map +1 -0
  79. package/dist/resources/transaction.d.ts +20 -0
  80. package/dist/resources/transaction.d.ts.map +1 -1
  81. package/dist/resources/transaction.js +28 -0
  82. package/dist/resources/transaction.js.map +1 -1
  83. package/dist/resources/transparency.d.ts +68 -0
  84. package/dist/resources/transparency.d.ts.map +1 -0
  85. package/dist/resources/transparency.js +83 -0
  86. package/dist/resources/transparency.js.map +1 -0
  87. package/dist/resources/webhooks.d.ts +97 -0
  88. package/dist/resources/webhooks.d.ts.map +1 -0
  89. package/dist/resources/webhooks.js +112 -0
  90. package/dist/resources/webhooks.js.map +1 -0
  91. package/dist/self-signup.d.ts +66 -0
  92. package/dist/self-signup.d.ts.map +1 -0
  93. package/dist/self-signup.js +76 -0
  94. package/dist/self-signup.js.map +1 -0
  95. package/dist/shared-proof.d.ts +34 -0
  96. package/dist/shared-proof.d.ts.map +1 -0
  97. package/dist/shared-proof.js +78 -0
  98. package/dist/shared-proof.js.map +1 -0
  99. package/dist/types.d.ts +901 -24
  100. package/dist/types.d.ts.map +1 -1
  101. package/dist/verify-receipt.d.ts +32 -0
  102. package/dist/verify-receipt.d.ts.map +1 -0
  103. package/dist/verify-receipt.js +176 -0
  104. package/dist/verify-receipt.js.map +1 -0
  105. package/package.json +6 -5
package/README.md CHANGED
@@ -1,119 +1,133 @@
1
- # @certen.io/sdk
2
-
3
- TypeScript client for the [CERTEN Gateway](https://gateway.kompendium.co/reference) — proof-gated
4
- cross-chain execution on Accumulate.
5
-
6
- **Docs: <https://docs.kompendium.co>** · **Get an API key: <https://gateway.kompendium.co/portal>**
7
-
8
- ```bash
9
- npm install @certen.io/sdk
10
- ```
11
-
12
- ```ts
13
- import { CertenClient } from '@certen.io/sdk';
14
-
15
- const certen = new CertenClient({ apiKey: process.env.CERTEN_API_KEY! });
16
-
17
- const { intent_id, signing_data, submit_url } = await certen.transaction.create({
18
- identity_id: identityId,
19
- intent: {
20
- fromChain: 'accumulate',
21
- toChain: 'ethereum-sepolia',
22
- fromAddress: 'acc://your-org.acme',
23
- toAddress: '0xBe00…9251',
24
- amount: '4000',
25
- tokenSymbol: 'ETH',
26
- },
27
- });
28
-
29
- // You hold the key. Sign the bytes the gateway hands you.
30
- const signature = sign(signing_data.hash_to_sign);
31
- await certen.transaction.submitSignature(intent_id, { signature, public_key: publicKey });
32
- ```
33
-
34
- **Your key never leaves your process.** The gateway computes what must be signed and you decide whether to
35
- sign it. That is the supported posture for anything carrying value — see
36
- [the external-signing guide](https://docs.kompendium.co/external-signing.html).
37
-
38
- ---
39
-
40
- ## Configuration
41
-
42
- ```ts
43
- new CertenClient({
44
- apiKey: 'ck_live_…', // required
45
- baseUrl: 'https://…', // optional — see precedence below
46
- maxRetries: 3, // default 3
47
- baseBackoffMs: 250,
48
- maxBackoffMs: 8_000,
49
- autoIdempotencyKey: true, // default: every POST gets one
50
- });
51
- ```
52
-
53
- **Base URL precedence:** `options.baseUrl` → `$CERTEN_API_URL` → `https://gateway.kompendium.co`. The env var
54
- is there so a deployment can be retargeted at staging or a self-hosted gateway without a code change.
55
-
56
- ## What it does for you
57
-
58
- **Automatic idempotency on POSTs.** Every POST gets a generated `Idempotency-Key` so a retried network error
59
- is safe to replay. This matters more than it sounds: without one, a timeout is indistinguishable from success,
60
- and a blind retry can open a second intent or burn identity quota. Opt out per-client with
61
- `autoIdempotencyKey: false`, or per-route with `noAutoIdempotencyRoutes`.
62
-
63
- **Retries with backoff, and rate-limit awareness.** Transient failures retry with exponential backoff. On a
64
- `429` the client remembers the reset window and pre-emptively waits rather than hammering.
65
-
66
- **Typed errors.** Catch the class you care about instead of matching on status codes:
67
-
68
- ```ts
69
- import { CertenAuthError, CertenRateLimitError, CertenBadRequestError, CertenServerError } from '@certen.io/sdk';
70
-
71
- try {
72
- await certen.identity.create({ … });
73
- } catch (e) {
74
- if (e instanceof CertenBadRequestError) { /* your request — fix and retry */ }
75
- if (e instanceof CertenRateLimitError) { /* back off; e carries the reset */ }
76
- if (e instanceof CertenAuthError) { /* key is wrong, revoked, or lacks the scope */ }
77
- if (e instanceof CertenServerError) { /* gateway or downstream — safe to retry */ }
78
- }
79
- ```
80
-
81
- **Pagination helpers.** `paginate` and `paginateWithTotal` iterate a paged endpoint as an async generator.
82
-
83
- ## Resources
84
-
85
- | | |
86
- |---|---|
87
- | `certen.identity` | `create` · `get` · `update` · `retire` |
88
- | `certen.transaction` | `create` · `submitSignature` · `get` · `list` |
89
- | `certen.sign` | `create` · `submitSignature` |
90
- | `certen.governance` | `create` · `submitSignature` · `get` |
91
- | `certen.pending` | `list` |
92
- | `certen.portfolio` | `get` |
93
- | `certen.admin` | `createOrg` · `createApiKey` · `listApiKeys` · `revokeApiKey` · `rotateApiKey` · `getAuditLog` · `getUsage` |
94
-
95
- The gateway serves ~80 endpoints; this covers the integration surface. For anything else, the
96
- [live spec](https://gateway.kompendium.co/docs/json) is authoritative and the client's `request` path will
97
- carry it.
98
-
99
- ## Three things to know
100
-
101
- **Identity creation is asynchronous.** `identity.create` resolves with a `202`-shaped result and provisioning
102
- continues. Poll `identity.get` until the status is terminal, and check `can_sign` before building on it.
103
-
104
- **A proof cycle takes ~60–110 seconds.** Real validator work, not a tunable delay. Do not wrap it in a 30s
105
- timeout.
106
-
107
- **`vote` is `approve` | `reject` | `abstain`** — a lowercase string, not a number, and not `accept`.
108
-
109
- ## Guides
110
-
111
- - [Onboard an identity](https://docs.kompendium.co/onboard-an-identity.html)
112
- - [Sign while holding your own key](https://docs.kompendium.co/external-signing.html)
113
- - [Proof-gate a contract call](https://docs.kompendium.co/proof-gated-contract-call.html)
114
- - [M-of-N panels](https://docs.kompendium.co/multisig-panel.html)
115
- - [Verify a proof](https://docs.kompendium.co/verify-a-proof.html)
116
-
117
- ## License
118
-
119
- MIT
1
+ # @certen.io/sdk
2
+
3
+ TypeScript client for the [CERTEN Gateway](https://gateway.kompendium.co/reference) — proof-gated
4
+ cross-chain execution on Accumulate.
5
+
6
+ **Docs: <https://docs.kompendium.co>** · **Get an API key: <https://gateway.kompendium.co/portal>**
7
+
8
+ ```bash
9
+ npm install @certen.io/sdk
10
+ ```
11
+
12
+ ```ts
13
+ import { CertenClient } from '@certen.io/sdk';
14
+
15
+ const certen = new CertenClient({ apiKey: process.env.CERTEN_API_KEY! });
16
+
17
+ // One call: opens the intent, signs what comes back, submits the signature.
18
+ const { intentId } = await certen.execute.transfer({
19
+ identityId,
20
+ adiUrl: 'acc://your-org.acme',
21
+ fromChain: 'accumulate',
22
+ toChain: 'base-sepolia',
23
+ fromAddress: abstractAccount, // the identity's account on the destination chain
24
+ toAddress: '0xBe00…9251',
25
+ amount: '0.001', // WHOLE units, as a string
26
+ sign: (hashHex) => ed25519Sign(hashHex), // YOU hold the key
27
+ });
28
+
29
+ await certen.execute.wait(intentId); // ~60-110s of real validator work
30
+ const proof = await certen.execute.proof(intentId); // hand this to your counterparty
31
+ ```
32
+
33
+ Prefer `execute.*` — it is the same flow every integration writes, with the details that are easy to
34
+ get wrong already handled. The raw resources are there when you need to drive the steps yourself:
35
+
36
+ ```ts
37
+ const opened = await certen.transaction.create({ identityId, intent });
38
+ // `signing_data` is absent in provider mode, where the gateway holds the key and there is
39
+ // nothing for you to sign.
40
+ const hash = opened.signing_data?.hash_to_sign;
41
+ if (!hash) throw new Error('provider mode: no signature required from you');
42
+ await certen.transaction.submitSignature(opened.intent_id, {
43
+ signature: ed25519Sign(hash),
44
+ publicKey,
45
+ });
46
+ ```
47
+
48
+ **Your key never leaves your process.** The gateway computes what must be signed and you decide whether to
49
+ sign it. That is the supported posture for anything carrying value — see
50
+ [the external-signing guide](https://docs.kompendium.co/external-signing.html).
51
+
52
+ ---
53
+
54
+ ## Configuration
55
+
56
+ ```ts
57
+ new CertenClient({
58
+ apiKey: 'ck_live_…', // required
59
+ baseUrl: 'https://…', // optional — see precedence below
60
+ maxRetries: 3, // default 3
61
+ baseBackoffMs: 250,
62
+ maxBackoffMs: 8_000,
63
+ autoIdempotencyKey: true, // default: every POST gets one
64
+ });
65
+ ```
66
+
67
+ **Base URL precedence:** `options.baseUrl` → `$CERTEN_API_URL` → `https://gateway.kompendium.co`. The env var
68
+ is there so a deployment can be retargeted at staging or a self-hosted gateway without a code change.
69
+
70
+ ## What it does for you
71
+
72
+ **Automatic idempotency on POSTs.** Every POST gets a generated `Idempotency-Key` so a retried network error
73
+ is safe to replay. This matters more than it sounds: without one, a timeout is indistinguishable from success,
74
+ and a blind retry can open a second intent or burn identity quota. Opt out per-client with
75
+ `autoIdempotencyKey: false`, or per-route with `noAutoIdempotencyRoutes`.
76
+
77
+ **Retries with backoff, and rate-limit awareness.** Transient failures retry with exponential backoff. On a
78
+ `429` the client remembers the reset window and pre-emptively waits rather than hammering.
79
+
80
+ **Typed errors.** Catch the class you care about instead of matching on status codes:
81
+
82
+ ```ts
83
+ import { CertenAuthError, CertenRateLimitError, CertenBadRequestError, CertenServerError } from '@certen.io/sdk';
84
+
85
+ try {
86
+ await certen.identity.create({ … });
87
+ } catch (e) {
88
+ if (e instanceof CertenBadRequestError) { /* your request — fix and retry */ }
89
+ if (e instanceof CertenRateLimitError) { /* back off; e carries the reset */ }
90
+ if (e instanceof CertenAuthError) { /* key is wrong, revoked, or lacks the scope */ }
91
+ if (e instanceof CertenServerError) { /* gateway or downstream — safe to retry */ }
92
+ }
93
+ ```
94
+
95
+ **Pagination helpers.** `paginate` and `paginateWithTotal` iterate a paged endpoint as an async generator.
96
+
97
+ ## Resources
98
+
99
+ | | |
100
+ |---|---|
101
+ | `certen.identity` | `create` · `get` · `update` · `retire` |
102
+ | `certen.transaction` | `create` · `submitSignature` · `get` · `list` |
103
+ | `certen.sign` | `create` · `submitSignature` |
104
+ | `certen.governance` | `create` · `submitSignature` · `get` |
105
+ | `certen.pending` | `list` |
106
+ | `certen.portfolio` | `get` |
107
+ | `certen.admin` | `createOrg` · `createApiKey` · `listApiKeys` · `revokeApiKey` · `rotateApiKey` · `getAuditLog` · `getUsage` |
108
+
109
+ The gateway serves ~80 endpoints; this covers the integration surface. For anything else, the
110
+ [live spec](https://gateway.kompendium.co/docs/json) is authoritative and the client's `request` path will
111
+ carry it.
112
+
113
+ ## Three things to know
114
+
115
+ **Identity creation is asynchronous.** `identity.create` resolves with a `202`-shaped result and provisioning
116
+ continues. Poll `identity.get` until the status is terminal, and check `can_sign` before building on it.
117
+
118
+ **A proof cycle takes ~60–110 seconds.** Real validator work, not a tunable delay. Do not wrap it in a 30s
119
+ timeout.
120
+
121
+ **`vote` is `approve` | `reject` | `abstain`** — a lowercase string, not a number, and not `accept`.
122
+
123
+ ## Guides
124
+
125
+ - [Onboard an identity](https://docs.kompendium.co/onboard-an-identity.html)
126
+ - [Sign while holding your own key](https://docs.kompendium.co/external-signing.html)
127
+ - [Proof-gate a contract call](https://docs.kompendium.co/proof-gated-contract-call.html)
128
+ - [M-of-N panels](https://docs.kompendium.co/multisig-panel.html)
129
+ - [Verify a proof](https://docs.kompendium.co/verify-a-proof.html)
130
+
131
+ ## License
132
+
133
+ MIT
package/dist/client.d.ts CHANGED
@@ -4,9 +4,19 @@ import { GovernanceResource } from './resources/governance.js';
4
4
  import { PendingResource } from './resources/pending.js';
5
5
  import { SignResource } from './resources/sign.js';
6
6
  import { PortfolioResource } from './resources/portfolio.js';
7
+ import { BillingResource } from './resources/billing.js';
7
8
  import { AdminResource } from './resources/admin.js';
8
9
  import { ExecuteResource } from './resources/execute.js';
9
- import type { CertenClientOptions } from './types.js';
10
+ import { ChainsResource } from './resources/chains.js';
11
+ import { TransparencyResource } from './resources/transparency.js';
12
+ import { HealthResource } from './resources/health.js';
13
+ import { WebhooksResource } from './resources/webhooks.js';
14
+ import { ProofResource } from './resources/proof.js';
15
+ import { DeviceResource } from './resources/device.js';
16
+ import { OAuthClientsResource } from './resources/oauth-clients.js';
17
+ import { RegistrationTokensResource } from './resources/registration-tokens.js';
18
+ import { type DoctorReport } from './doctor.js';
19
+ import type { CertenClientOptions, MeResponse } from './types.js';
10
20
  /**
11
21
  * The gateway this SDK talks to when the caller does not say.
12
22
  *
@@ -33,8 +43,83 @@ export declare class CertenClient {
33
43
  sign: SignResource;
34
44
  portfolio: PortfolioResource;
35
45
  admin: AdminResource;
46
+ /** Balance, commitments, and adding funds. See resources/billing.ts. */
47
+ billing: BillingResource;
36
48
  /** The proof-gated execution flow as one call: open, sign, submit, poll, prove. See resources/execute.ts. */
37
49
  execute: ExecuteResource;
50
+ /** The public contract registry — which chains CERTEN is on, and where. Needs no API key. */
51
+ chains: ChainsResource;
52
+ /**
53
+ * The public transparency log — signed tree heads, consistency proofs, published price books.
54
+ * What makes a receipt checkable rather than merely signed. Needs no API key.
55
+ */
56
+ transparency: TransparencyResource;
57
+ /**
58
+ * Whether CERTEN can serve right now, and what is wrong when it cannot. Needs no API key —
59
+ * a caller whose credential is rejected can still learn whether the platform is the problem.
60
+ */
61
+ health: HealthResource;
62
+ /**
63
+ * Webhook endpoints and their delivery history. The gateway has pushed events all along; nothing
64
+ * on this side could register an endpoint or see why a delivery failed.
65
+ */
66
+ webhooks: WebhooksResource;
67
+ /** Reading and sharing proofs. See resources/proof.ts. */
68
+ proof: ProofResource;
69
+ /** Device authorization, so a terminal can obtain its own key. Needs no API key. */
70
+ device: DeviceResource;
71
+ /**
72
+ * The OAuth2 clients your organization owns. Tokens could be obtained and revoked from code all
73
+ * along; the client that issues them could only be created by hand in the portal.
74
+ */
75
+ oauthClients: OAuthClientsResource;
76
+ /**
77
+ * Registration tokens — letting a new organization be created without a browser. Minting needs
78
+ * `org:invite`; redeeming needs nothing, and is the standalone `redeemRegistrationToken`.
79
+ */
80
+ registrationTokens: RegistrationTokensResource;
81
+ /**
82
+ * Diagnose this setup and say what is blocking it.
83
+ *
84
+ * Never throws for a failed check — a diagnosis that cannot report a broken setup is useless.
85
+ * `report.ok` is false when something failed; warnings do not clear it and do not set it.
86
+ * See doctor.ts for what each check exists to catch.
87
+ */
88
+ /**
89
+ * Who this credential is, and what it may do.
90
+ *
91
+ * One call, and the only way to learn your own organization and scopes. It accepted a portal
92
+ * session only until the gateway's 2026-08 change, so a machine holding an API key could not ask
93
+ * — clients resorted to probing endpoints and reading the 403s to guess what they were allowed
94
+ * to do.
95
+ *
96
+ * Check `scopes` before a flow rather than after: a missing scope surfaces otherwise as a 403
97
+ * partway through, when some of the work may already have happened.
98
+ */
99
+ me(): Promise<MeResponse>;
100
+ /**
101
+ * How this client authenticates. Set once at construction.
102
+ *
103
+ * Not readonly-by-type only for the minted token, which is replaced as it is refreshed.
104
+ */
105
+ private auth;
106
+ /** The current minted token and when it stops being usable. */
107
+ private minted?;
108
+ /** In-flight mint, so N concurrent requests cause ONE token request rather than N. */
109
+ private minting?;
110
+ /**
111
+ * A usable bearer token, minting or re-minting as needed.
112
+ *
113
+ * Re-mints 60 seconds BEFORE expiry rather than on the 401 that expiry would otherwise cause.
114
+ * Waiting for the rejection means at least one request fails for a reason the caller can do
115
+ * nothing about, and on a long-running agent that is a failure every hour, forever.
116
+ *
117
+ * The single-flight guard matters more than it looks: a process that fires ten concurrent calls
118
+ * on a cold client would otherwise mint ten tokens, and every one but the last is immediately
119
+ * abandoned — an invisible leak of live credentials.
120
+ */
121
+ private bearerToken;
122
+ doctor(): Promise<DoctorReport>;
38
123
  constructor(options: CertenClientOptions & {
39
124
  maxRetries?: number;
40
125
  baseBackoffMs?: number;
@@ -57,16 +142,24 @@ export declare class CertenClient {
57
142
  });
58
143
  }
59
144
  /**
60
- * Async iterator helper for paginated list endpoints. Round-2 #40:
61
- * `paginateWithTotal` exposes `{ item, index, total }` for progress UIs that
62
- * need to render "27 of 412". When the server doesn't return `total`, the
63
- * yielded object's `total` is undefined.
145
+ * Async iterator helper for paginated list endpoints.
64
146
  *
65
- * Use `paginate(...)` for the simple item-only form.
147
+ * **Prefer the `listAll()` method on the resource** — `certen.transaction.listAll()`,
148
+ * `certen.pending.listAll()`. They call this internally and need no adapter.
149
+ *
150
+ * This takes a callback returning `{ items }`, and no SDK method returns that shape: `list()`
151
+ * returns `{ transactions }`, `shares()` returns `{ shares }`. So using it directly meant writing
152
+ * the adapter that should have shipped with it. Since 0.7.0 that adapter lives on the resources,
153
+ * and this stays exported for list endpoints the SDK does not model yet, and for callers paginating
154
+ * their own API.
155
+ *
156
+ * `paginateWithTotal` exposes `{ item, index, total }` for progress UIs that need to render
157
+ * "27 of 412". When the server does not return `total`, the yielded object's `total` is undefined.
66
158
  */
67
159
  export declare function paginate<T>(fetchPage: (limit: number, offset: number) => Promise<{
68
160
  items: T[];
69
161
  total?: number;
162
+ hasMore?: boolean;
70
163
  }>, pageSize?: number): AsyncIterableIterator<T>;
71
164
  export declare function paginateWithTotal<T>(fetchPage: (limit: number, offset: number) => Promise<{
72
165
  items: T[];
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAmDhE,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAEtB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC;IACzB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,aAAa,CAAC;IAC5B,6GAA6G;IACtG,OAAO,EAAE,eAAe,CAAC;gBAEpB,OAAO,EAAE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