better-auth-flutterwave 0.4.2 → 1.0.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/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # Better Auth Flutterwave
2
2
 
3
- A TypeScript-first [Better Auth](https://www.better-auth.com) plugin for Flutterwave v3 payments.
4
- It supports Flutterwave Standard checkout, verified one-time payments, native payment-plan
5
- subscriptions, locally managed subscriptions, organization billing, marketplace split payments,
6
- webhooks, refunds, and reconciliation.
3
+ [English](README.md) · [Español](README.es-ES.md) · [Français](README.fr-FR.md)
4
+
5
+ Add Flutterwave Standard Checkout, subscriptions, organization billing, and verified webhooks to Better Auth.
7
6
 
8
7
  ## Install
9
8
 
@@ -11,134 +10,49 @@ webhooks, refunds, and reconciliation.
11
10
  npm install better-auth better-auth-flutterwave
12
11
  ```
13
12
 
14
- Node.js 22.22.2 or newer is required. Development and CI use Node 22.23.3, pinned in `.node-version`, and pnpm 12.11.2. The current jsdom test environment sets the minimum Node 22 patch level.
13
+ Requires Node.js 22 or newer and Better Auth `>=1.4.22 <2`. Tested with Better Auth 1.4.22, 1.5.6,
14
+ 1.6.35, 1.7.7, and 1.7.28.
15
+
16
+ See the [API and compatibility policy](COMPATIBILITY.md).
15
17
 
16
18
  ## Configure
17
19
 
18
- ```env
19
- FLUTTERWAVE_PUBLIC_KEY=FLWPUBK_TEST-...
20
- FLUTTERWAVE_SECRET_KEY=FLWSECK_TEST-...
21
- FLUTTERWAVE_SECRET_HASH=your-dashboard-webhook-secret-hash
22
- BETTER_AUTH_SECRET=...
23
- BETTER_AUTH_URL=http://localhost:3000
24
- ```
20
+ Add the server plugin to your Better Auth instance and keep these credentials in your server
21
+ environment. Set `FLUTTERWAVE_SECRET_HASH` to the separately configured webhook secret hash.
25
22
 
26
23
  ```ts
27
- import { betterAuth } from "better-auth";
28
- import { organization } from "better-auth/plugins";
29
24
  import { flutterwave } from "better-auth-flutterwave";
30
25
 
31
- export const auth = betterAuth({
32
- plugins: [
33
- organization(),
34
- flutterwave({
35
- publicKey: process.env.FLUTTERWAVE_PUBLIC_KEY!,
36
- secretKey: process.env.FLUTTERWAVE_SECRET_KEY!,
37
- secretHash: process.env.FLUTTERWAVE_SECRET_HASH!,
38
- subscription: {
39
- enabled: true,
40
- plans: [
41
- {
42
- name: "pro",
43
- paymentPlanId: 12345,
44
- amount: 5_000,
45
- currency: "NGN",
46
- interval: "monthly",
47
- },
48
- {
49
- name: "starter",
50
- amount: 2_000,
51
- currency: "NGN",
52
- interval: "monthly",
53
- },
54
- ],
55
- },
56
- organization: { enabled: true },
57
- marketplace: {
58
- allowedSubaccountIds: ["RS_1234567890"],
59
- },
60
- }),
61
- ],
62
- });
63
- ```
64
-
65
- The plugin calls Flutterwave's v3 API with Node's built-in `fetch`; you do not need a separate
66
- Flutterwave SDK dependency. Inject `flutterwaveClient` for a custom provider boundary or `fetch` for
67
- tests and controlled transports.
68
-
69
- ### Flutterwave v4 server API
70
-
71
- For new direct-charge integrations, the server entry point also exports
72
- `createFlutterwaveV4Adapter`. It uses OAuth client credentials, refreshes its cached token at least
73
- 60 seconds before expiry, and exposes customer, encrypted card payment-method, charge, charge
74
- authorization, charge retrieval, and refund operations. Configure the sandbox base URL explicitly
75
- as `https://developersandbox-api.flutterwave.com`; the default base URL is production.
76
- These operations follow Flutterwave's [v4 authentication](https://developer.flutterwave.com/v4.0.0/docs/authentication),
77
- [card](https://developer.flutterwave.com/v4.0.0/docs/card),
78
- [charge](https://developer.flutterwave.com/v4/reference/charges_post), and
79
- [refund](https://developer.flutterwave.com/v4/reference/refunds_post) APIs.
80
-
81
- ```ts
82
- import { createFlutterwaveV4Adapter } from "better-auth-flutterwave";
83
-
84
- const flutterwaveV4 = createFlutterwaveV4Adapter({
85
- clientId: process.env.FLW_V4_CLIENT_ID!,
86
- clientSecret: process.env.FLW_V4_CLIENT_SECRET!,
87
- apiBaseUrl:
88
- process.env.NODE_ENV === "production"
89
- ? "https://f4bexperience.flutterwave.com"
90
- : "https://developersandbox-api.flutterwave.com",
26
+ const payments = flutterwave({
27
+ publicKey: process.env.FLUTTERWAVE_PUBLIC_KEY!,
28
+ secretKey: process.env.FLUTTERWAVE_SECRET_KEY!,
29
+ secretHash: process.env.FLUTTERWAVE_SECRET_HASH!,
91
30
  });
92
31
  ```
93
32
 
94
- Supply a stable, unique idempotency key for every write and reuse it when retrying. Card methods
95
- accept only Flutterwave-encrypted card fields and a nonce; never send raw PAN or CVV to this server
96
- adapter. The v4 adapter is a provider transport for trusted server routes. It does not create local
97
- Better Auth billing rows or fulfill a v4 charge automatically; verify the charge and match its
98
- reference, amount, currency, and customer to your own pending order before granting value. Existing
99
- Better Auth checkout and subscription routes continue to use v3 Standard Checkout and payment plans.
100
-
101
- Configure the client plugin:
33
+ Include `payments` in your server's `plugins` array. Generate the schema with the CLI for your
34
+ installed Better Auth version and apply it through your database's migration workflow.
35
+ [Better Auth CLI guide](https://better-auth.com/docs/concepts/cli)
102
36
 
103
37
  ```ts
104
38
  import { createAuthClient } from "better-auth/client";
105
39
  import { flutterwaveClient } from "better-auth-flutterwave/client";
106
40
 
107
- export const authClient = createAuthClient({
108
- plugins: [flutterwaveClient({ subscription: true })],
109
- });
110
- ```
111
-
112
- Then generate the Better Auth schema and apply it with your database migration workflow:
113
-
114
- ```bash
115
- npx @better-auth/cli generate
116
- ```
117
-
118
- For supported direct-migration setups, you can instead run:
119
-
120
- ```bash
121
- npx @better-auth/cli migrate
41
+ export const authClient = createAuthClient({ plugins: [flutterwaveClient()] });
122
42
  ```
123
43
 
124
- ## Checkout and verification
44
+ ## Checkout
125
45
 
126
- Flutterwave Standard checkout requires an amount, currency, redirect URL, and billing email. The
127
- browser supplies the amount and currency directly or selects a configured plan/product; the server
128
- resolves billing email from the authenticated user or authorized organization owner. The plugin
129
- generates a unique `txRef`.
130
-
131
- For a configured plan or product, its server-side currency and price always take precedence over
132
- browser overrides. A plan's base amount includes the first seat; each additional seat adds
133
- `seatAmount`. Product prices are multiplied by `quantity`. Explicit browser amount/currency values
134
- apply only to a payment without a configured plan or product.
46
+ A signed-in user can start checkout with an amount and currency or a configured plan or product.
47
+ Configure server-priced plans and products for fixed-price purchases. The server resolves the
48
+ billing email and uses the configured price and currency for catalog purchases.
135
49
 
136
50
  ```ts
137
51
  const checkout = await authClient.flutterwave.transaction.initialize(
138
52
  {
139
53
  amount: 5_000,
140
54
  currency: "NGN",
141
- redirectUrl: `${window.location.origin}/billing/flutterwave/callback`,
55
+ redirectUrl: new URL("/billing/flutterwave/callback", window.location.origin).href,
142
56
  },
143
57
  { throw: true },
144
58
  );
@@ -146,269 +60,83 @@ const checkout = await authClient.flutterwave.transaction.initialize(
146
60
  window.location.assign(checkout.url);
147
61
  ```
148
62
 
149
- After redirect, send exactly one transaction locator to the verification action:
150
-
151
- ```ts
152
- await authClient.flutterwave.transaction.verify({
153
- transactionId: Number(searchParams.get("transaction_id")),
154
- });
155
- ```
156
-
157
- Fulfillment only happens after server-side verification confirms the transaction status, `txRef`,
158
- amount, and currency. A redirect or webhook payload alone is never proof of payment.
159
-
160
- The typed browser surface is intentionally limited to:
161
-
162
- - `authClient.flutterwave.transaction.initialize`, `verify`, and `list`
163
- - `authClient.subscription.create`, `upgrade`, `cancel`, `restore`, and `list`
164
- - Read-only provider configuration and local catalog actions under `authClient.flutterwave`
165
-
166
- Reconciliation, renewals, remote plan synchronization, refunds, and subaccount administration are
167
- trusted-server operations and are not exposed to browser clients.
168
-
169
- ## Subscription models
170
-
171
- ### Flutterwave-native plans
172
-
173
- Set a numeric `paymentPlanId` on a configured plan. Enrollment starts with a card checkout carrying
174
- that plan ID. After verification, the plugin resolves the Flutterwave subscription using the
175
- verified transaction, immutable billing email, and payment plan.
176
-
177
- Flutterwave has no separate “create subscription” endpoint for this flow. Provider-native plans do
178
- not pretend to support provider-side trials or prorated mutations.
179
-
180
- ### Locally managed plans
181
-
182
- Omit `paymentPlanId` for a locally renewed subscription. The plugin stores the subscription,
183
- group, seat count, and entitlement configuration locally. Automated trial transitions, scheduled
184
- plan mutations, and proration orchestration are not part of the initial release.
185
-
186
- Trusted-server renewal prefers that encrypted token. If no token is available, renewal creates a
187
- hosted checkout and remains pending until the resulting payment is verified.
188
-
189
- ## Organization and marketplace billing
190
-
191
- Organization billing controls local ownership and authorization. Flutterwave billing identity is
192
- an email; the plugin does not create or persist a fictional Flutterwave customer record on users or
193
- organizations.
194
-
195
- Marketplace split payments are a separate concern. Configure existing, KYC-approved Flutterwave
196
- subaccount IDs in `marketplace.allowedSubaccountIds`. Per-checkout overrides must be authorized and
197
- must reference the allowlist. The plugin does not provision subaccounts or automatically equate an
198
- organization with a Flutterwave subaccount.
63
+ On return, pass exactly one locator to
64
+ `authClient.flutterwave.transaction.verify({ transactionId })` or
65
+ `authClient.flutterwave.transaction.verify({ txRef })`. Fulfill after server verification matches
66
+ the successful payment to the pending reference, amount, and currency.
67
+
68
+ ## Billing options
69
+
70
+ - **Subscriptions.** Set a numeric `paymentPlanId` for Flutterwave-managed card renewals. Omit it for a
71
+ locally managed plan. The first seat is included in the base amount and additional seats use
72
+ `seatAmount`.
73
+ - **Organizations and splits.** Enable organization billing with the Better Auth organization plugin
74
+ and pass an authorized organization ID as `referenceId`. Allowlist existing Flutterwave subaccounts
75
+ separately for split payments.
76
+ - **Server operations.** The server export includes `chargeSubscriptionRenewal`,
77
+ `processScheduledFlutterwaveCancellations`, `refundFlutterwaveTransaction`,
78
+ `reconcileFlutterwaveTransaction`, `reconcileFlutterwaveRefunds`, and `syncFlutterwavePlans`.
79
+ Call them from independently authorized server routes or jobs. Reuse the same `renewalId` for
80
+ retries of a renewal. A period-end cancellation requires a known paid-period end and a scheduler.
81
+ - **Flutterwave v4.** `createFlutterwaveV4Adapter` supports separate server-side direct-charge
82
+ integrations. Use Flutterwave-encrypted card fields for card inputs. Set the sandbox API URL
83
+ during testing, reuse idempotency keys on retries, and verify charges against pending orders
84
+ before fulfillment.
85
+ [Flutterwave v4 API](https://developer.flutterwave.com/v4.0.0/docs/authentication)
199
86
 
200
87
  ## Webhooks
201
88
 
202
- Point Flutterwave at your Better Auth Flutterwave webhook endpoint. The plugin verifies v4
203
- `flutterwave-signature` values as base64 HMAC-SHA256 digests of the exact raw request body, and
204
- accepts the v3 `verif-hash` header for legacy v3 deliveries, as described in the
205
- [v4](https://developer.flutterwave.com/v4.0.0/docs/webhooks) and
206
- [v3](https://developer.flutterwave.com/docs/webhooks) webhook guides. Both comparisons are constant-time and
207
- use the separately configured `secretHash`. It records idempotency state and re-verifies v3 payment
208
- transactions before granting value. V4 event payloads are delivered to `onEvent` after signature
209
- verification and deduplication; retrieve the v4 charge and match it to a pending order before
210
- granting value. Keep custom `onEvent` work short so the endpoint can acknowledge within Flutterwave's
211
- timeout.
212
-
213
- Callback and reconciliation failures return a retryable HTTP 503. Webhook processing uses a
214
- database claim to prevent simultaneous callbacks for the same event, and an abandoned claim can
215
- be retried after five minutes. Payment, subscription lifecycle, and `onEvent` callbacks must be
216
- idempotent: a crash after external work but before recording completion can cause a later retry to
217
- execute a callback again. A provider cancellation notification preserves access through a future
218
- scheduled paid-period end; immediate cancellations end access when processed.
219
-
220
- Verified-payment lifecycle hooks share a durable fulfillment record across browser verification,
221
- webhooks, and reconciliation. The record retains initial subscription intent before activation and
222
- checkpoints each successful hook. A failed initial hook is retried even after the subscription becomes
223
- active; successful earlier hooks are skipped. Fulfillment records use the existing event table and
224
- five-minute leases, so concurrent requests retry instead of dispatching the same hooks simultaneously.
225
- Handlers must still be idempotent if external work succeeds before its checkpoint is stored.
226
-
227
- Do not parse and reserialize the request before signature verification. Do not use the API
228
- `secretKey` as the webhook secret hash.
229
-
230
- Polling and reconciliation are provided for pending v3 transactions and refunds. Native v3
231
- subscription state is updated from verified payment events and uniquely matched provider
232
- cancellation events; local subscription reconciliation is not currently exposed.
233
-
234
- ## Trusted server operations
235
-
236
- Privileged operations are exported from the server entry point:
237
-
238
- ```ts
239
- import {
240
- chargeSubscriptionRenewal,
241
- processScheduledFlutterwaveCancellations,
242
- reconcileFlutterwaveRefunds,
243
- reconcileFlutterwaveTransaction,
244
- refundFlutterwaveTransaction,
245
- syncFlutterwavePlans,
246
- } from "better-auth-flutterwave";
247
- ```
248
-
249
- They require a trusted Better Auth endpoint context plus the same Flutterwave options used by the
250
- plugin. Call them only from independently authorized server routes, queue consumers, or scheduled
251
- jobs:
252
-
253
- - `syncFlutterwavePlans` imports remote Flutterwave payment plans into namespaced local records.
254
- - `chargeSubscriptionRenewal` uses an encrypted reusable token when available, otherwise returns a
255
- hosted-checkout URL and leaves renewal pending.
256
- - `refundFlutterwaveTransaction` starts a full or partial asynchronous refund.
257
- - `reconcileFlutterwaveTransaction` polls and verifies a pending transaction.
258
- - `reconcileFlutterwaveRefunds` refreshes pending refund records.
259
- - `processScheduledFlutterwaveCancellations` executes due cancellation requests, canceling native
260
- subscriptions through Flutterwave if needed and ending local subscriptions. New native
261
- cancellation requests stop provider billing immediately while preserving access until the paid
262
- period ends; withdrawing that request reactivates provider billing. Run the processor from your
263
- scheduler at period end, inspect returned `failed` IDs, and retry failures. Each
264
- invocation processes up to 100 requests by default (maximum 1,000); `hasMore` indicates that
265
- another batch may be needed. Scheduling requires a known paid `periodEnd`; legacy records must
266
- be reconciled first or canceled immediately.
267
-
268
- Renewal jobs should supply a stable `renewalId` and reuse it for every retry of the same billing
269
- intent. Without one, the plugin reserves the current paid-period end (or the initial period).
270
- New renewal intents are rejected before a future paid period ends. A pending transaction and dispatch intent are saved
271
- before charging. Once dispatch starts, retries verify that same reference and never initiate another
272
- charge, even if the provider response or subsequent verification was lost. A provider rejection or
273
- an unverifiable reference requires reconciliation or operator investigation; it does not authorize a
274
- new charge. Hosted-checkout retries return the saved URL. No provider-side idempotency guarantee is
275
- assumed. Completed `renewalId` retries return the original verified payment.
276
-
277
- For v3 refunds, `completed` means initiated and awaiting disbursement. Reconciliation also polls
278
- `processing`, `pending-momo`, and `pending`, and accepts only successful fetch responses with the
279
- expected refund ID. Method-specific terminal statuses such as `completed-mpgs` and
280
- `completed-bank-transfer` indicate successful disbursement. See the
281
- [Flutterwave v3 refund lifecycle](https://developer.flutterwave.com/docs/refunds).
282
-
283
- Cancellation and restoration accept either the local subscription `id` or a numeric Flutterwave
284
- `subscriptionId`. A scheduled local cancellation can be withdrawn while its paid period is still
285
- active. A local subscription that has already ended requires a new checkout. Renewal calculates
286
- the same seat price as checkout and rejects canceled or provider-managed subscriptions.
287
-
288
- ## Release and downstream updates
289
-
290
- Release Please opens the version/change-log PR after reviewed changes reach `main`. Merging that
291
- release PR creates the version tag and triggers the tag-pinned npm trusted-publishing workflow.
292
- The npm trusted publisher must reference this repository and `.github/workflows/release-please.yml`.
293
- The workflow requires Node 22.23.3, the locked pnpm version, library tests, a package build, package/type
294
- lint, and the downstream example/schema checks. A branch push or ordinary application build does
295
- not publish this package.
296
-
297
- Consumers must use a release containing the new scheduled-cancellation export before importing
298
- it; the previously published 0.2.1 release does not include these changes. The example uses
299
- `workspace:*` and therefore follows the library in this checkout. External consumers must update
300
- their dependency and lockfile after publication, review billing schema constraints, and wire the
301
- processor into their authorized scheduler. See [the persistent example setup](examples/tanstack/README.md)
302
- for the D1 migration and Cron Trigger configuration. This repository does not automatically
303
- upgrade or deploy external applications.
304
-
305
- ## Packaged agent skills
306
-
307
- The npm package ships version-matched coding-agent skills in its `skills/` directory. They help an
308
- agent implement the supported Flutterwave API, data model, security rules, and examples without
309
- guessing provider behavior.
310
-
311
- Install the skill linker in your application and run its one-time setup:
312
-
313
- ```bash
314
- npm install --save-dev skills-npm
315
- npx skills-npm setup
316
- ```
89
+ Configure `/api/auth/flutterwave/webhook` under your Better Auth base path. The plugin verifies
90
+ `flutterwave-signature` against the exact raw body using base64 HMAC-SHA256 and the webhook secret
91
+ hash. Legacy v3 deliveries use `verif-hash`. Keep callbacks idempotent and preserve the unique
92
+ webhook event constraint when migrating. A verified v4 event still requires retrieving the charge
93
+ and matching the pending order before fulfillment.
317
94
 
318
- `skills-npm setup` adds a `prepare` hook and links skills from installed npm packages into the
319
- locations detected for Codex, Claude Code, Cursor, and other supported agents. To select only this
320
- package, create:
95
+ ## Examples
321
96
 
322
- ```ts
323
- // skills-npm.config.ts
324
- import { defineConfig } from "skills-npm";
97
+ Use the [TanStack Start](examples/tanstack/README.md), [Next.js](examples/nextjs/README.md), or
98
+ [Hono](examples/hono/README.md) example to try authentication and Flutterwave billing.
325
99
 
326
- export default defineConfig({
327
- include: ["better-auth-flutterwave"],
328
- });
100
+ ```sh
101
+ npm create better-auth-flutterwave@latest my-app -- --template nextjs
329
102
  ```
330
103
 
331
- Refresh the links with `npx skills-npm --force`, or preview changes with
332
- `npx skills-npm --dry-run`.
333
-
334
- | Skill | Use it for |
335
- | ----------------------------------- | -------------------------------------------------------- |
336
- | `$better-auth-flutterwave-setup` | Initial server/client setup, credentials, and migrations |
337
- | `$flutterwave-billing-flows` | Checkout, verification, and subscription flows |
338
- | `$flutterwave-client-api` | Typed browser actions and client/server boundaries |
339
- | `$flutterwave-local-subscriptions` | Encrypted token renewal and hosted-checkout fallback |
340
- | `$flutterwave-organization-billing` | Organization ownership, roles, and split payments |
341
- | `$flutterwave-catalog-limits` | Plans, local products, inventory, seats, and limits |
342
- | `$flutterwave-webhooks-events` | Webhook signatures, idempotency, and re-verification |
343
- | `$flutterwave-schema-migrations` | Namespaced schema generation and migrations |
344
- | `$flutterwave-testing-fixtures` | Unit, sandbox, webhook, and reconciliation tests |
345
- | `$flutterwave-tanstack-start` | TanStack Start integration |
346
-
347
- Invoke a skill explicitly in your agent prompt:
348
-
349
- ```text
350
- Use $better-auth-flutterwave-setup to add Better Auth Flutterwave to this application.
351
- ```
104
+ Choose `tanstack`, `nextjs`, or `hono`. TanStack Start is the default. The creator package becomes
105
+ available on npm after its first publication. The [GitHub Release](https://github.com/alexasomba/better-auth-flutterwave/releases)
106
+ also provides starter archives.
352
107
 
353
- ```text
354
- Use $flutterwave-webhooks-events to review my webhook route and add signature tests.
355
- ```
108
+ To export directly from the repository after installing its dependencies:
356
109
 
357
- ```text
358
- Use $flutterwave-organization-billing to implement organization checkout with allowlisted splits.
110
+ ```sh
111
+ pnpm starter:export tanstack ./flutterwave-starter
359
112
  ```
360
113
 
361
- Including the `$skill-name` in the prompt is the most portable explicit invocation form.
362
-
363
- ## Data model
364
-
365
- Provider-owned records are namespaced so this plugin can coexist with other billing providers:
114
+ The export uses this repository’s plugin version from npm. For an unpublished build, run
115
+ `vp pack` and `pnpm pack --pack-destination ./starter-pack`, then pass
116
+ `--tarball ./starter-pack/<package>.tgz` to the export command.
366
117
 
367
- - `flutterwaveTransaction`
368
- - `flutterwaveSubscription`
369
- - `flutterwaveProduct` (local catalog only)
370
- - `flutterwavePlan`
371
- - `flutterwaveWebhookEvent`
372
- - `flutterwaveRefund`
118
+ ## Agent skills
373
119
 
374
- The Paystack plugin is being aligned incrementally with this provider-namespaced approach. Its
375
- transaction, catalog, and webhook records are provider-namespaced today; its legacy generic
376
- subscription table remains compatibility-sensitive until the planned migration is released. The
377
- two existing plugins can still be installed together because Flutterwave's subscription and other
378
- provider records are namespaced separately. Shared application behavior should rely on each
379
- provider's normalized lifecycle fields and reference authorization rather than assuming that either
380
- provider exposes the other's customer or subscription identifiers.
120
+ The package ships [ten agent skills](skills/) alongside its code.
381
121
 
382
- Public identifiers use Flutterwave-native names: `txRef`, `transactionId`, `flwRef`,
383
- `paymentPlanId`, `subscriptionId`, `secretHash`, and `subaccountId`.
122
+ - With [pnpm 12.11 or newer](https://pnpm.io/agent-skills), install the package directly in your
123
+ project and run `pnpm approve` to review its skills. pnpm links approved skills into your
124
+ configured agent directories.
125
+ - With [TanStack Intent](https://tanstack.com/intent/latest/docs/getting-started/quick-start-consumers)
126
+ installed in your project, use `pnpm exec intent list` and load a skill by its package and name.
384
127
 
385
- ## Provider transport
386
-
387
- Provider requests use Flutterwave's v3 HTTP API with bearer authentication and validate response
388
- envelopes before returning data to the plugin. The adapter accepts injected `fetch` and
389
- `flutterwaveClient` implementations for tests and custom transports.
128
+ ```sh
129
+ pnpm exec intent load better-auth-flutterwave#better-auth-flutterwave-setup
130
+ ```
390
131
 
391
132
  ## Development
392
133
 
393
- This repository uses [Vite+](https://viteplus.dev). `vp check` uses its native TypeScript checker. Declaration builds still require the compiler API provided by the maintained `@typescript/typescript6` compatibility package; Vite+ 1.1.0 explicitly rejects the TypeScript 7 compiler API for this mode.
394
-
395
- Commands:
396
-
397
- ```bash
134
+ ```sh
398
135
  vp install
136
+ vp pack
399
137
  vp check
400
138
  vp test
401
- vp pack
402
- pnpm run lint:types
403
- pnpm run lint:package
404
- ```
405
-
406
- Integration tests require Flutterwave sandbox credentials and are opt-in:
407
-
408
- ```bash
409
- RUN_INTEGRATION_TESTS=true vp test
139
+ pnpm exec intent validate skills --check
410
140
  ```
411
141
 
412
- ## License
413
-
414
142
  MIT
package/dist/client.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import { B as FlutterwaveInitializeResult, C as FlutterwaveMetadata, H as FlutterwavePlan, J as FlutterwaveTransaction, U as FlutterwaveProduct, Y as FlutterwaveTransactionResponse, it as Subscription, j as parseFlutterwaveMetadata, t as flutterwave } from "./index-YHYXcci3.mjs";
2
- import { BetterFetch, BetterFetchOption, BetterFetchResponse } from "@better-fetch/fetch";
1
+ import { C as FlutterwaveMetadata, N as PACKAGE_VERSION, U as FlutterwavePlan, V as FlutterwaveInitializeResult, W as FlutterwaveProduct, X as FlutterwaveTransactionResponse, Y as FlutterwaveTransaction, at as Subscription, j as parseFlutterwaveMetadata, t as flutterwave } from "./index-DpejOhTY.mjs";
2
+ import { BetterFetchOption, BetterFetchResponse } from "@better-fetch/fetch";
3
3
  import { BetterAuthClientPlugin } from "better-auth/client";
4
- //#region src/client.d.ts
5
4
  export type FetchResult<T, O extends BetterFetchOption | undefined> = O extends {
6
5
  throw: true;
7
6
  } ? T : BetterFetchResponse<T>;
@@ -84,14 +83,14 @@ declare module "better-auth/client" {
84
83
  subscription: FlutterwaveProviderActions["subscription"];
85
84
  }
86
85
  }
87
- type FlutterwaveClientPluginInstance = Omit<BetterAuthClientPlugin, "id" | "$InferServerPlugin" | "getActions"> & {
86
+ type FlutterwaveClientPluginInstance = Omit<BetterAuthClientPlugin, "id" | "version" | "$InferServerPlugin" | "getActions"> & {
88
87
  id: "flutterwave-client";
88
+ version: typeof PACKAGE_VERSION;
89
89
  $InferServerPlugin: ReturnType<typeof flutterwave>;
90
- getActions: ($fetch: BetterFetch) => FlutterwaveClientActions;
90
+ getActions: ($fetch: Parameters<NonNullable<BetterAuthClientPlugin["getActions"]>>[0]) => FlutterwaveClientActions;
91
91
  };
92
92
  export declare const flutterwaveClient: (_options?: {
93
93
  subscription?: boolean;
94
94
  }) => FlutterwaveClientPluginInstance;
95
- //#endregion
96
95
  export { type FlutterwaveMetadata, parseFlutterwaveMetadata };
97
96
  //# sourceMappingURL=client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.mts","names":["flutterwaveServer"],"sources":["../src/client.ts"],"mappings":";;;;YAgBY,YAAY,GAAG,UAAU,iCAAiC;EAAY;IAC9E,IACA,oBAAoB;iBAEP;EACf;IACE,aAAa,UAAU,2CACrB;MACE;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;QACE;QACA;QACA;QACA;;OAGJ,UAAU,MACP,QAAQ,YAAY,6BAA6B;IACtD,SAAS,UAAU,2CACjB;MAAQ;MAAiC;MAAgB;OACzD,UAAU,MACP,QACH;MAAc;MAAgB;MAAe,MAAM;OAAkC;IAEvF,OAAO,UAAU,2CACf;MAAS;QAAU;;OACnB,UAAU,MACP,QAAQ;MAAc,cAAc;OAA4B;;EAEvE;IACE,QAAQ;IACR,SAAS;IACT,SAAS,UAAU,2CACjB;MAAQ;MAAiC;OACzC,UAAU,MACP,QAAQ;MAAc;OAAkB;IAC7C,UAAU,UAAU,2CAClB;MAAQ;OACR,UAAU,MACP,QAAQ;MAAc;OAAkB;IAC7C,OAAO,UAAU,2CACf;MAAS;QAAU;;OACnB,UAAU,MACP,QAAQ;MAAc,eAAe;OAAkB;;EAE9D,cAAc,QACZ;IAAsB,OAAO;IAAmB,UAAU;;EAE5D,iBAAiB,QAAQ;IAAsB,OAAO;;EACtD,oBAAoB,QAAQ;IAAsB,UAAU;;;iBAG7C;EACf,aAAa;EACb,cAAc;;;YAIJ;IACR,aAAa;IACb,cAAc;;;KAIb,kCAAkC,KACrC;EAGA;EACA,oBAAoB,kBAAkBA;EACtC,aAAa,QAAQ,gBAAgB;;qBAG1B,oBAAqB;EAChC;MACE"}
1
+ {"version":3,"file":"client.d.mts","names":["flutterwaveServer"],"sources":["../src/client.ts"],"mappings":";;;YAgBY,YAAY,GAAG,UAAU,iCAAiC;EAAY;IAC9E,IACA,oBAAoB;iBAEP;EACf;IACE,aAAa,UAAU,2CACrB;MACE;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;QACE;QACA;QACA;QACA;;OAGJ,UAAU,MACP,QAAQ,YAAY,6BAA6B;IACtD,SAAS,UAAU,2CACjB;MAAQ;MAAiC;MAAgB;OACzD,UAAU,MACP,QACH;MAAc;MAAgB;MAAe,MAAM;OAAkC;IAEvF,OAAO,UAAU,2CACf;MAAS;QAAU;;OACnB,UAAU,MACP,QAAQ;MAAc,cAAc;OAA4B;;EAEvE;IACE,QAAQ;IACR,SAAS;IACT,SAAS,UAAU,2CACjB;MAAQ;MAAiC;OACzC,UAAU,MACP,QAAQ;MAAc;OAAkB;IAC7C,UAAU,UAAU,2CAClB;MAAQ;OACR,UAAU,MACP,QAAQ;MAAc;OAAkB;IAC7C,OAAO,UAAU,2CACf;MAAS;QAAU;;OACnB,UAAU,MACP,QAAQ;MAAc,eAAe;OAAkB;;EAE9D,cAAc,QACZ;IAAsB,OAAO;IAAmB,UAAU;;EAE5D,iBAAiB,QAAQ;IAAsB,OAAO;;EACtD,oBAAoB,QAAQ;IAAsB,UAAU;;;iBAG7C;EACf,aAAa;EACb,cAAc;;;YAIJ;IACR,aAAa;IACb,cAAc;;;KAIb,kCAAkC,KACrC;EAGA;EACA,gBAAgB;EAChB,oBAAoB,kBAAkBA;EACtC,aACE,QAAQ,WAAW,YAAY,8CAC5B;;qBAGM,oBAAiB;EAC5B;MACE"}
package/dist/client.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { l as parseFlutterwaveMetadata, t as PACKAGE_VERSION } from "./version-WC4th7kC.mjs";
2
- //#region src/client.ts
1
+ import { l as parseFlutterwaveMetadata, t as PACKAGE_VERSION } from "./version-DfR5E0nB.mjs";
2
+ // src/client.ts
3
3
  const flutterwaveClient = (_options) => ({
4
4
  id: "flutterwave-client",
5
5
  version: PACKAGE_VERSION,
@@ -69,7 +69,6 @@ const flutterwaveClient = (_options) => ({
69
69
  };
70
70
  }
71
71
  });
72
- //#endregion
73
72
  export { flutterwaveClient, parseFlutterwaveMetadata };
74
73
 
75
74
  //# sourceMappingURL=client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterFetch, BetterFetchOption, BetterFetchResponse } from \"@better-fetch/fetch\";\nimport type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport type {\n FlutterwaveInitializeResult,\n FlutterwavePlan,\n FlutterwaveProduct,\n FlutterwaveTransaction,\n FlutterwaveTransactionResponse,\n Subscription,\n} from \"./types.ts\";\nimport type { flutterwave as flutterwaveServer } from \"./index.ts\";\nimport { PACKAGE_VERSION } from \"./version.ts\";\n\nexport { parseFlutterwaveMetadata } from \"./metadata.ts\";\nexport type { FlutterwaveMetadata } from \"./metadata.ts\";\n\nexport type FetchResult<T, O extends BetterFetchOption | undefined> = O extends { throw: true }\n ? T\n : BetterFetchResponse<T>;\n\nexport interface FlutterwaveProviderActions {\n transaction: {\n initialize: <O extends BetterFetchOption | undefined = undefined>(\n data: {\n amount?: number;\n currency?: string;\n redirectUrl: string;\n txRef?: string;\n referenceId?: string;\n plan?: string;\n product?: string;\n quantity?: number;\n paymentOptions?: string;\n subaccounts?: {\n id: string;\n transactionSplitRatio?: number;\n transactionChargeType?: \"flat\" | \"percentage\" | \"flat_subaccount\";\n transactionCharge?: number;\n }[];\n },\n options?: O,\n ) => Promise<FetchResult<FlutterwaveInitializeResult, O>>;\n verify: <O extends BetterFetchOption | undefined = undefined>(\n data: { transactionId?: string | number; txRef?: string; referenceId?: string },\n options?: O,\n ) => Promise<\n FetchResult<{ status: string; txRef: string; data: FlutterwaveTransactionResponse }, O>\n >;\n list: <O extends BetterFetchOption | undefined = undefined>(\n data?: { query?: { referenceId?: string } },\n options?: O,\n ) => Promise<FetchResult<{ transactions: FlutterwaveTransaction[] }, O>>;\n };\n subscription: {\n create: FlutterwaveProviderActions[\"transaction\"][\"initialize\"];\n upgrade: FlutterwaveProviderActions[\"transaction\"][\"initialize\"];\n cancel: <O extends BetterFetchOption | undefined = undefined>(\n data: { subscriptionId: string | number; atPeriodEnd?: boolean },\n options?: O,\n ) => Promise<FetchResult<{ status: string }, O>>;\n restore: <O extends BetterFetchOption | undefined = undefined>(\n data: { subscriptionId: string | number },\n options?: O,\n ) => Promise<FetchResult<{ status: string }, O>>;\n list: <O extends BetterFetchOption | undefined = undefined>(\n data?: { query?: { referenceId?: string } },\n options?: O,\n ) => Promise<FetchResult<{ subscriptions: Subscription[] }, O>>;\n };\n config: () => Promise<\n BetterFetchResponse<{ plans: FlutterwavePlan[]; products: FlutterwaveProduct[] }>\n >;\n listPlans: () => Promise<BetterFetchResponse<{ plans: FlutterwavePlan[] }>>;\n listProducts: () => Promise<BetterFetchResponse<{ products: FlutterwaveProduct[] }>>;\n}\n\nexport interface FlutterwaveClientActions {\n flutterwave: FlutterwaveProviderActions;\n subscription: FlutterwaveProviderActions[\"subscription\"];\n}\n\ndeclare module \"better-auth/client\" {\n interface BetterAuthClient {\n flutterwave: FlutterwaveProviderActions;\n subscription: FlutterwaveProviderActions[\"subscription\"];\n }\n}\n\ntype FlutterwaveClientPluginInstance = Omit<\n BetterAuthClientPlugin,\n \"id\" | \"$InferServerPlugin\" | \"getActions\"\n> & {\n id: \"flutterwave-client\";\n $InferServerPlugin: ReturnType<typeof flutterwaveServer>;\n getActions: ($fetch: BetterFetch) => FlutterwaveClientActions;\n};\n\nexport const flutterwaveClient = (_options?: {\n subscription?: boolean;\n}): FlutterwaveClientPluginInstance => ({\n id: \"flutterwave-client\",\n version: PACKAGE_VERSION,\n $InferServerPlugin: {} as ReturnType<typeof flutterwaveServer>,\n pathMethods: {\n \"/flutterwave/transaction/initialize\": \"POST\",\n \"/flutterwave/transaction/verify\": \"POST\",\n \"/flutterwave/subscription/create\": \"POST\",\n \"/flutterwave/subscription/upgrade\": \"POST\",\n \"/flutterwave/subscription/cancel\": \"POST\",\n \"/flutterwave/subscription/restore\": \"POST\",\n },\n getActions: ($fetch) => {\n const transaction: FlutterwaveProviderActions[\"transaction\"] = {\n initialize: (data, options) =>\n $fetch(\"/flutterwave/transaction/initialize\", { ...options, method: \"POST\", body: data }),\n verify: (data, options) =>\n $fetch(\"/flutterwave/transaction/verify\", { ...options, method: \"POST\", body: data }),\n list: (data, options) =>\n $fetch(\"/flutterwave/transaction/list\", {\n query: data?.query,\n ...options,\n method: \"GET\",\n }),\n };\n const subscription: FlutterwaveProviderActions[\"subscription\"] = {\n create: (data, options) =>\n $fetch(\"/flutterwave/subscription/create\", { ...options, method: \"POST\", body: data }),\n upgrade: (data, options) =>\n $fetch(\"/flutterwave/subscription/upgrade\", { ...options, method: \"POST\", body: data }),\n cancel: (data, options) =>\n $fetch(\"/flutterwave/subscription/cancel\", { ...options, method: \"POST\", body: data }),\n restore: (data, options) =>\n $fetch(\"/flutterwave/subscription/restore\", { ...options, method: \"POST\", body: data }),\n list: (data, options) =>\n $fetch(\"/flutterwave/subscription/list\", {\n query: data?.query,\n ...options,\n method: \"GET\",\n }),\n };\n const provider: FlutterwaveProviderActions = {\n transaction,\n subscription,\n config: () => $fetch(\"/flutterwave/config\", { method: \"GET\" }),\n listPlans: () => $fetch(\"/flutterwave/plan/list\", { method: \"GET\" }),\n listProducts: () => $fetch(\"/flutterwave/product/list\", { method: \"GET\" }),\n };\n return { flutterwave: provider, subscription };\n },\n});\n"],"mappings":";;AAiGA,MAAa,qBAAqB,cAEM;CACtC,IAAI;CACJ,SAAS;CACT,oBAAoB,CAAC;CACrB,aAAa;EACX,uCAAuC;EACvC,mCAAmC;EACnC,oCAAoC;EACpC,qCAAqC;EACrC,oCAAoC;EACpC,qCAAqC;CACvC;CACA,aAAa,WAAW;EACtB,MAAM,cAAyD;GAC7D,aAAa,MAAM,YACjB,OAAO,uCAAuC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GAC1F,SAAS,MAAM,YACb,OAAO,mCAAmC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACtF,OAAO,MAAM,YACX,OAAO,iCAAiC;IACtC,OAAO,MAAM;IACb,GAAG;IACH,QAAQ;GACV,CAAC;EACL;EACA,MAAM,eAA2D;GAC/D,SAAS,MAAM,YACb,OAAO,oCAAoC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACvF,UAAU,MAAM,YACd,OAAO,qCAAqC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACxF,SAAS,MAAM,YACb,OAAO,oCAAoC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACvF,UAAU,MAAM,YACd,OAAO,qCAAqC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACxF,OAAO,MAAM,YACX,OAAO,kCAAkC;IACvC,OAAO,MAAM;IACb,GAAG;IACH,QAAQ;GACV,CAAC;EACL;EAQA,OAAO;GAAE,aAAa;IANpB;IACA;IACA,cAAc,OAAO,uBAAuB,EAAE,QAAQ,MAAM,CAAC;IAC7D,iBAAiB,OAAO,0BAA0B,EAAE,QAAQ,MAAM,CAAC;IACnE,oBAAoB,OAAO,6BAA6B,EAAE,QAAQ,MAAM,CAAC;GAE9C;GAAG;EAAa;CAC/C;AACF"}
1
+ {"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterFetchOption, BetterFetchResponse } from \"@better-fetch/fetch\";\nimport type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport type {\n FlutterwaveInitializeResult,\n FlutterwavePlan,\n FlutterwaveProduct,\n FlutterwaveTransaction,\n FlutterwaveTransactionResponse,\n Subscription,\n} from \"./types.ts\";\nimport type { flutterwave as flutterwaveServer } from \"./index.ts\";\nimport { PACKAGE_VERSION } from \"./version.ts\";\n\nexport { parseFlutterwaveMetadata } from \"./metadata.ts\";\nexport type { FlutterwaveMetadata } from \"./metadata.ts\";\n\nexport type FetchResult<T, O extends BetterFetchOption | undefined> = O extends { throw: true }\n ? T\n : BetterFetchResponse<T>;\n\nexport interface FlutterwaveProviderActions {\n transaction: {\n initialize: <O extends BetterFetchOption | undefined = undefined>(\n data: {\n amount?: number;\n currency?: string;\n redirectUrl: string;\n txRef?: string;\n referenceId?: string;\n plan?: string;\n product?: string;\n quantity?: number;\n paymentOptions?: string;\n subaccounts?: {\n id: string;\n transactionSplitRatio?: number;\n transactionChargeType?: \"flat\" | \"percentage\" | \"flat_subaccount\";\n transactionCharge?: number;\n }[];\n },\n options?: O,\n ) => Promise<FetchResult<FlutterwaveInitializeResult, O>>;\n verify: <O extends BetterFetchOption | undefined = undefined>(\n data: { transactionId?: string | number; txRef?: string; referenceId?: string },\n options?: O,\n ) => Promise<\n FetchResult<{ status: string; txRef: string; data: FlutterwaveTransactionResponse }, O>\n >;\n list: <O extends BetterFetchOption | undefined = undefined>(\n data?: { query?: { referenceId?: string } },\n options?: O,\n ) => Promise<FetchResult<{ transactions: FlutterwaveTransaction[] }, O>>;\n };\n subscription: {\n create: FlutterwaveProviderActions[\"transaction\"][\"initialize\"];\n upgrade: FlutterwaveProviderActions[\"transaction\"][\"initialize\"];\n cancel: <O extends BetterFetchOption | undefined = undefined>(\n data: { subscriptionId: string | number; atPeriodEnd?: boolean },\n options?: O,\n ) => Promise<FetchResult<{ status: string }, O>>;\n restore: <O extends BetterFetchOption | undefined = undefined>(\n data: { subscriptionId: string | number },\n options?: O,\n ) => Promise<FetchResult<{ status: string }, O>>;\n list: <O extends BetterFetchOption | undefined = undefined>(\n data?: { query?: { referenceId?: string } },\n options?: O,\n ) => Promise<FetchResult<{ subscriptions: Subscription[] }, O>>;\n };\n config: () => Promise<\n BetterFetchResponse<{ plans: FlutterwavePlan[]; products: FlutterwaveProduct[] }>\n >;\n listPlans: () => Promise<BetterFetchResponse<{ plans: FlutterwavePlan[] }>>;\n listProducts: () => Promise<BetterFetchResponse<{ products: FlutterwaveProduct[] }>>;\n}\n\nexport interface FlutterwaveClientActions {\n flutterwave: FlutterwaveProviderActions;\n subscription: FlutterwaveProviderActions[\"subscription\"];\n}\n\ndeclare module \"better-auth/client\" {\n interface BetterAuthClient {\n flutterwave: FlutterwaveProviderActions;\n subscription: FlutterwaveProviderActions[\"subscription\"];\n }\n}\n\ntype FlutterwaveClientPluginInstance = Omit<\n BetterAuthClientPlugin,\n \"id\" | \"version\" | \"$InferServerPlugin\" | \"getActions\"\n> & {\n id: \"flutterwave-client\";\n version: typeof PACKAGE_VERSION;\n $InferServerPlugin: ReturnType<typeof flutterwaveServer>;\n getActions: (\n $fetch: Parameters<NonNullable<BetterAuthClientPlugin[\"getActions\"]>>[0],\n ) => FlutterwaveClientActions;\n};\n\nexport const flutterwaveClient = (_options?: {\n subscription?: boolean;\n}): FlutterwaveClientPluginInstance => ({\n id: \"flutterwave-client\",\n version: PACKAGE_VERSION,\n $InferServerPlugin: {} as ReturnType<typeof flutterwaveServer>,\n pathMethods: {\n \"/flutterwave/transaction/initialize\": \"POST\",\n \"/flutterwave/transaction/verify\": \"POST\",\n \"/flutterwave/subscription/create\": \"POST\",\n \"/flutterwave/subscription/upgrade\": \"POST\",\n \"/flutterwave/subscription/cancel\": \"POST\",\n \"/flutterwave/subscription/restore\": \"POST\",\n },\n getActions: ($fetch) => {\n const transaction: FlutterwaveProviderActions[\"transaction\"] = {\n initialize: (data, options) =>\n $fetch(\"/flutterwave/transaction/initialize\", { ...options, method: \"POST\", body: data }),\n verify: (data, options) =>\n $fetch(\"/flutterwave/transaction/verify\", { ...options, method: \"POST\", body: data }),\n list: (data, options) =>\n $fetch(\"/flutterwave/transaction/list\", {\n query: data?.query,\n ...options,\n method: \"GET\",\n }),\n };\n const subscription: FlutterwaveProviderActions[\"subscription\"] = {\n create: (data, options) =>\n $fetch(\"/flutterwave/subscription/create\", { ...options, method: \"POST\", body: data }),\n upgrade: (data, options) =>\n $fetch(\"/flutterwave/subscription/upgrade\", { ...options, method: \"POST\", body: data }),\n cancel: (data, options) =>\n $fetch(\"/flutterwave/subscription/cancel\", { ...options, method: \"POST\", body: data }),\n restore: (data, options) =>\n $fetch(\"/flutterwave/subscription/restore\", { ...options, method: \"POST\", body: data }),\n list: (data, options) =>\n $fetch(\"/flutterwave/subscription/list\", {\n query: data?.query,\n ...options,\n method: \"GET\",\n }),\n };\n const provider: FlutterwaveProviderActions = {\n transaction,\n subscription,\n config: () => $fetch(\"/flutterwave/config\", { method: \"GET\" }),\n listPlans: () => $fetch(\"/flutterwave/plan/list\", { method: \"GET\" }),\n listProducts: () => $fetch(\"/flutterwave/product/list\", { method: \"GET\" }),\n };\n return { flutterwave: provider, subscription };\n },\n});\n"],"mappings":";;AAoGA,MAAa,qBAAqB,cAEM;CACtC,IAAI;CACJ,SAAS;CACT,oBAAoB,CAAC;CACrB,aAAa;EACX,uCAAuC;EACvC,mCAAmC;EACnC,oCAAoC;EACpC,qCAAqC;EACrC,oCAAoC;EACpC,qCAAqC;CACvC;CACA,aAAa,WAAW;EACtB,MAAM,cAAyD;GAC7D,aAAa,MAAM,YACjB,OAAO,uCAAuC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GAC1F,SAAS,MAAM,YACb,OAAO,mCAAmC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACtF,OAAO,MAAM,YACX,OAAO,iCAAiC;IACtC,OAAO,MAAM;IACb,GAAG;IACH,QAAQ;GACV,CAAC;EACL;EACA,MAAM,eAA2D;GAC/D,SAAS,MAAM,YACb,OAAO,oCAAoC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACvF,UAAU,MAAM,YACd,OAAO,qCAAqC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACxF,SAAS,MAAM,YACb,OAAO,oCAAoC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACvF,UAAU,MAAM,YACd,OAAO,qCAAqC;IAAE,GAAG;IAAS,QAAQ;IAAQ,MAAM;GAAK,CAAC;GACxF,OAAO,MAAM,YACX,OAAO,kCAAkC;IACvC,OAAO,MAAM;IACb,GAAG;IACH,QAAQ;GACV,CAAC;EACL;EAQA,OAAO;GAAE,aAAa;IANpB;IACA;IACA,cAAc,OAAO,uBAAuB,EAAE,QAAQ,MAAM,CAAC;IAC7D,iBAAiB,OAAO,0BAA0B,EAAE,QAAQ,MAAM,CAAC;IACnE,oBAAoB,OAAO,6BAA6B,EAAE,QAAQ,MAAM,CAAC;GAE9C;GAAG;EAAa;CAC/C;AACF"}