@alexasomba/better-auth-paystack 2.1.0 → 2.2.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
@@ -21,9 +21,10 @@ A TypeScript-first plugin that integrates Paystack into [Better Auth](https://ww
21
21
  - [x] **Auto Customer Creation**: Optional Paystack customer creation on user sign up or organization creation.
22
22
  - [x] **Trial Management**: Configurable trial periods with built-in abuse prevention logic.
23
23
  - [x] **Organization Billing**: Associate subscriptions with organizations and authorize access via roles.
24
+ - [x] **Subscription Channel Controls**: Restrict subscription checkout to specific Paystack payment channels such as card-only.
24
25
  - [x] **Enforced Limits & Seats**: Automatic enforcement of member seat upgrades and resource limits (teams).
25
26
  - [x] **Scheduled Changes**: Defer subscription updates or cancellations to the end of the billing cycle.
26
- - [x] **Proration**: Immediate mid-cycle prorated charges for seat and plan upgrades.
27
+ - [x] **Proration**: Immediate mid-cycle prorated upgrades for local plans, using saved-card charges when possible and checkout fallback when interactive payment is required.
27
28
  - [x] **Popup Modal Flow**: Optional support for Paystack's inline checkout experience via `@alexasomba/paystack-inline`.
28
29
  - [x] **Webhook Security**: Pre-configured signature verification (HMAC-SHA512) and optional IP whitelisting.
29
30
  - [x] **Transaction History**: Built-in support for listing and viewing local transaction records.
@@ -64,6 +65,7 @@ BETTER_AUTH_URL=http://localhost:8787
64
65
  import { betterAuth } from "better-auth";
65
66
  import { paystack } from "@alexasomba/better-auth-paystack";
66
67
  import { createPaystack } from "@alexasomba/paystack-node";
68
+ import { admin } from "better-auth/plugins";
67
69
 
68
70
  const paystackClient = createPaystack({
69
71
  secretKey: process.env.PAYSTACK_SECRET_KEY!,
@@ -71,12 +73,14 @@ const paystackClient = createPaystack({
71
73
 
72
74
  export const auth = betterAuth({
73
75
  plugins: [
76
+ admin(),
74
77
  paystack({
75
78
  paystackClient,
76
79
  webhook: { secret: process.env.PAYSTACK_WEBHOOK_SECRET! },
77
80
  createCustomerOnSignUp: true,
78
81
  subscription: {
79
82
  enabled: true,
83
+ allowedPaymentChannels: ["card"], // Optional: enforce card-only subscriptions
80
84
  plans: [
81
85
  {
82
86
  name: "pro",
@@ -100,14 +104,21 @@ export const auth = betterAuth({
100
104
  });
101
105
  ```
102
106
 
107
+ `webhook.secret` is the preferred webhook-signing config.
108
+ If you still have older code using top-level `paystackWebhookSecret`, it is treated as a deprecated alias and falls back to the same signature check.
109
+
103
110
  ### 4. Configure Client Plugin
104
111
 
105
112
  ```ts title="client.ts"
106
113
  import { createAuthClient } from "better-auth/client";
107
114
  import { paystackClient } from "@alexasomba/better-auth-paystack/client";
115
+ import { adminClient } from "better-auth/client/plugins";
108
116
 
109
117
  export const client = createAuthClient({
110
- plugins: [paystackClient({ subscription: true })],
118
+ plugins: [
119
+ adminClient(),
120
+ paystackClient({ subscription: true })
121
+ ],
111
122
  });
112
123
  ```
113
124
 
@@ -153,6 +164,8 @@ import {
153
164
  chargeSubscriptionRenewal,
154
165
  syncPaystackPlans,
155
166
  syncPaystackProducts,
167
+ type ChargeRecurringSubscriptionResult,
168
+ type PaystackSyncResult,
156
169
  } from "@alexasomba/better-auth-paystack";
157
170
 
158
171
  const ctx = { context: await auth.$context } as any;
@@ -283,21 +296,44 @@ if (data?.accessCode) {
283
296
  Defer changes to the end of the current billing cycle:
284
297
 
285
298
  - **Upgrades**: Pass `scheduleAtPeriodEnd: true` in `initializeTransaction()`.
286
- - **Cancellations**: Use `authClient.subscription.cancel({ atPeriodEnd: true })` to keep the subscription active until the period ends.
299
+ - **Cancellations**: Use `authClient.subscription.cancel({ subscriptionCode, atPeriodEnd: true })` to keep the subscription active until the period ends.
287
300
 
288
301
  ### Mid-Cycle Proration (`prorateAndCharge`)
289
302
 
290
303
  The plugin can dynamically calculate the cost difference for immediate mid-cycle upgrades (like adding more seats).
291
- If the user has a saved Paystack authorization code, the plugin will execute a prorated charge for the remaining cycle days and immediately sync the new amount/seats.
304
+ For locally managed plans:
305
+
306
+ - If the subscription already has a reusable Paystack authorization code, the plugin charges the prorated delta off-session, records a local `paystackTransaction`, and immediately updates the subscription.
307
+ - If there is no reusable authorization code available (for example, transfer-based payments), the plugin initializes a new checkout for the prorated delta instead of silently upgrading without payment.
308
+ - If the prorated amount is below Paystack's minimum charge for the currency, the request is rejected so you can schedule the change for period end instead of undercharging.
292
309
 
293
310
  ```ts
294
311
  await authClient.paystack.transaction.initialize({
295
312
  plan: "pro",
296
313
  quantity: 5, // Upgrading seats
297
- prorateAndCharge: true, // Will calculate and charge the prorated amount instantly
314
+ prorateAndCharge: true, // Charges saved authorization or returns a checkout redirect for the delta
315
+ });
316
+ ```
317
+
318
+ When the flow falls back to checkout, verify the returned transaction reference after payment. The plugin uses the stored proration metadata to apply the pending plan/seat change only after successful verification.
319
+
320
+ ### Restricting Subscription Payment Channels
321
+
322
+ Use `subscription.allowedPaymentChannels` to constrain which Paystack checkout channels can be used for subscription flows.
323
+ This applies to standard subscription checkout, trial authorization flows, and interactive proration checkout fallbacks.
324
+
325
+ ```ts
326
+ paystack({
327
+ subscription: {
328
+ enabled: true,
329
+ allowedPaymentChannels: ["card"],
330
+ plans: [{ name: "starter", amount: 50000, currency: "NGN", interval: "monthly" }],
331
+ },
298
332
  });
299
333
  ```
300
334
 
335
+ If a subscription payment is later verified with a disallowed channel, the plugin rejects activation instead of silently creating the subscription.
336
+
301
337
  ### Webhook Security
302
338
 
303
339
  The plugin automatically verifies the `x-paystack-signature` header to ensure events are authentic. For an extra layer of security, you can enable **IP Whitelisting** to restrict processing to Paystack's official servers.
@@ -312,6 +348,9 @@ paystack({
312
348
  });
313
349
  ```
314
350
 
351
+ Resolution order for webhook signature verification is:
352
+ `webhook.secret` -> `paystackWebhookSecret` (deprecated) -> `secretKey`.
353
+
315
354
  ### Trial Abuse Prevention
316
355
 
317
356
  The plugin checks the `referenceId` history. If a trial was ever used (active, expired, or trialing), it will not be granted again, preventing resubscribe-abuse.
@@ -423,7 +462,7 @@ type upgradeSubscription = {
423
462
  /**
424
463
  * Additional metadata to store with the transaction.
425
464
  */
426
- metadata?: Record<string, any>;
465
+ metadata?: Record<string, unknown>;
427
466
  /**
428
467
  * Reference ID for the subscription owner (User ID or Org ID).
429
468
  * Defaults to the current user's ID.
@@ -454,6 +493,11 @@ type initializeTransaction = {
454
493
  * Amount to charge (if sending raw amount).
455
494
  */
456
495
  amount?: number;
496
+ /**
497
+ * For existing locally managed subscriptions, calculate a mid-cycle delta and either
498
+ * charge the saved authorization or return a checkout redirect for interactive payment.
499
+ */
500
+ prorateAndCharge?: boolean;
457
501
  // ... same as upgradeSubscription
458
502
  };
459
503
  ```
@@ -482,6 +526,10 @@ Cancel or restore a subscription.
482
526
 
483
527
  ```ts
484
528
  type cancelSubscription = {
529
+ /**
530
+ * Optional reference owner (user ID or org ID) when managing another billing entity.
531
+ */
532
+ referenceId?: string;
485
533
  /**
486
534
  * The Paystack subscription code (e.g. SUB_...)
487
535
  */
@@ -491,6 +539,10 @@ type cancelSubscription = {
491
539
  * Optional: The server will try to fetch it if omitted.
492
540
  */
493
541
  emailToken?: string;
542
+ /**
543
+ * When true, keep the subscription active until the current period ends.
544
+ */
545
+ atPeriodEnd?: boolean;
494
546
  };
495
547
  ```
496
548
 
@@ -583,22 +635,34 @@ The following fields are indexed:
583
635
  - **`user` & `organization`**: `paystackCustomerCode`.
584
636
  - **`paystackProduct`**: `slug` (unique), `paystackId` (unique).
585
637
 
638
+ Proration upgrades and trusted renewal charges also persist `paystackTransaction` rows, so local transaction history stays aligned with successful off-session charges.
639
+
586
640
  ### Syncing Products
587
641
 
588
- The plugin provides two ways to keep your product inventory in sync with Paystack:
642
+ The plugin provides two ways to keep your product inventory aligned with Paystack:
589
643
 
590
- #### 1. Automated Inventory Sync (New)
644
+ #### 1. Automated Inventory Sync
591
645
 
592
646
  Whenever a successful one-time payment is made (via webhook or manual verification), the plugin automatically calls **`syncProductQuantityFromPaystack`**. This fetches the real-time remaining quantity from the Paystack API and updates your local database record, ensuring your inventory is always accurate.
593
647
 
594
- #### 2. Manual Bulk Sync
648
+ #### 2. Trusted Manual Bulk Sync
595
649
 
596
- You can synchronize all products with your local database using the `/paystack/sync-products` endpoint.
650
+ The public `/paystack/sync-products` endpoint was removed in `2.0.0`.
651
+ Run the trusted server operation from backend code instead:
597
652
 
598
- ```bash
599
- POST /api/auth/paystack/sync-products
653
+ ```ts
654
+ import { syncPaystackProducts } from "@alexasomba/better-auth-paystack";
655
+
656
+ const ctx = { context: await auth.$context } as any;
657
+
658
+ await syncPaystackProducts(ctx, paystackOptions);
600
659
  ```
601
660
 
661
+ ### SDK Compatibility Note
662
+
663
+ The plugin now targets the official `@alexasomba/paystack-node` grouped client surface directly.
664
+ If you inject a custom client, it should match the real SDK methods used by the plugin such as `transaction.initialize`, `transaction.verify`, `transaction.chargeAuthorization`, `subscription.create`, `subscription.disable`, and `subscription.enable`.
665
+
602
666
  ---
603
667
 
604
668
  ## 🏗️ Development & Contributing
package/dist/client.d.mts CHANGED
@@ -1,164 +1,139 @@
1
- import { d as PaystackTransaction, f as Subscription, l as PaystackPlan, n as paystack, o as AnyPaystackOptions, s as PaystackClientLike, u as PaystackProduct } from "./index-Dwbeddkr.mjs";
1
+ import { d as Subscription, l as PaystackTransaction, o as PaystackPlan, s as PaystackProduct, u as PaystackTransactionResponse } from "./types-B5ZnlFrq.mjs";
2
+ import { BetterAuthClientPlugin } from "better-auth";
2
3
  import { BetterFetch, BetterFetchOption, BetterFetchResponse } from "@better-fetch/fetch";
3
4
 
4
5
  //#region src/client.d.ts
5
- declare const paystackClient: <O extends {
6
- subscription?: boolean;
7
- }>(_options?: O) => {
8
- id: "paystack";
9
- version: string;
10
- $InferServerPlugin: ReturnType<typeof paystack<PaystackClientLike, AnyPaystackOptions>>;
11
- getActions: ($fetch: BetterFetch, _$store: unknown, _options: unknown) => {
12
- transaction: {
13
- initialize: (data: Record<string, unknown> & {
14
- callbackUrl?: string;
15
- callbackURL?: string;
16
- product?: string;
17
- referenceId?: string;
18
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
19
- url: string;
20
- reference: string;
21
- accessCode: string;
22
- redirect: boolean;
23
- }>>;
24
- verify: (data: {
25
- reference: string;
26
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
27
- status: string;
28
- reference: string;
29
- data: unknown;
30
- }>>;
31
- list: (data?: {
32
- query?: Record<string, unknown>;
33
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
34
- transactions: PaystackTransaction[];
35
- }>>;
36
- };
37
- subscription: {
38
- /**
39
- * Initialize a transaction to upgrade or creating a subscription.
40
- */
41
- upgrade: (data: Record<string, unknown> & {
42
- callbackUrl?: string;
43
- callbackURL?: string;
44
- product?: string;
45
- referenceId?: string;
46
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
47
- url: string;
48
- reference: string;
49
- accessCode: string;
50
- redirect: boolean;
51
- }>>;
52
- /**
53
- * Initialize a payment to create a subscription.
54
- */
55
- create: (data: Record<string, unknown> & {
56
- callbackUrl?: string;
57
- callbackURL?: string;
58
- product?: string;
59
- referenceId?: string;
60
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
61
- url: string;
62
- reference: string;
63
- accessCode: string;
64
- redirect: boolean;
65
- }>>;
66
- /**
67
- * Disable a subscription.
68
- */
69
- cancel: (data: {
70
- subscriptionCode: string;
71
- emailToken?: string;
72
- atPeriodEnd?: boolean;
73
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
74
- status: string;
75
- }>>;
76
- /**
77
- * Enable a subscription.
78
- */
79
- restore: (data: {
80
- subscriptionCode: string;
81
- emailToken?: string;
82
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
83
- status: string;
84
- }>>;
85
- /**
86
- * List subscriptions for the user.
87
- */
88
- list: (data?: {
89
- query?: Record<string, unknown>;
90
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
91
- subscriptions: Subscription[];
92
- }>>;
93
- /**
94
- * Get a link to manage the subscription on Paystack.
95
- */
96
- billingPortal: (data: {
97
- subscriptionCode: string;
98
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
99
- link: string;
100
- }>>;
101
- manageLink: (data: {
102
- subscriptionCode: string;
103
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
104
- link: string;
105
- }>>;
106
- disable: (data: {
107
- subscriptionCode: string;
108
- emailToken?: string;
109
- atPeriodEnd?: boolean;
110
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
111
- status: string;
112
- }>>;
113
- enable: (data: {
114
- subscriptionCode: string;
115
- emailToken?: string;
116
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
117
- status: string;
118
- }>>;
119
- };
120
- initializeTransaction: (data: Record<string, unknown> & {
121
- callbackUrl?: string;
122
- callbackURL?: string;
123
- product?: string;
124
- referenceId?: string;
125
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
126
- url: string;
127
- reference: string;
128
- accessCode: string;
129
- redirect: boolean;
130
- }>>;
131
- verifyTransaction: (data: {
132
- reference: string;
133
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
6
+ /**
7
+ * Helper type to handle the conditional return type based on 'throw' option.
8
+ */
9
+ type FetchResult<T, O extends BetterFetchOption | undefined> = O extends {
10
+ throw: true;
11
+ } ? T : BetterFetchResponse<T>;
12
+ /**
13
+ * Paystack Client Action Definitions
14
+ */
15
+ interface PaystackActions {
16
+ /**
17
+ * Initialize a transaction.
18
+ */
19
+ initializeTransaction: <O extends BetterFetchOption | undefined = undefined>(data: Record<string, unknown> & {
20
+ callbackUrl?: string;
21
+ callbackURL?: string;
22
+ product?: string;
23
+ referenceId?: string;
24
+ }, options?: O) => Promise<FetchResult<{
25
+ url: string;
26
+ reference: string;
27
+ accessCode: string;
28
+ redirect: boolean;
29
+ }, O>>;
30
+ /**
31
+ * Verify a transaction by reference.
32
+ */
33
+ verifyTransaction: <O extends BetterFetchOption | undefined = undefined>(data: {
34
+ reference: string;
35
+ }, options?: O) => Promise<FetchResult<{
36
+ status: string;
37
+ reference: string;
38
+ data: PaystackTransactionResponse;
39
+ }, O>>;
40
+ /**
41
+ * List transactions for the current user/reference.
42
+ */
43
+ listTransactions: <O extends BetterFetchOption | undefined = undefined>(data?: {
44
+ query?: Record<string, unknown>;
45
+ }, options?: O) => Promise<FetchResult<{
46
+ transactions: PaystackTransaction[];
47
+ }, O>>;
48
+ /**
49
+ * List subscriptions for the current user/reference.
50
+ */
51
+ listSubscriptions: <O extends BetterFetchOption | undefined = undefined>(data?: {
52
+ query?: Record<string, unknown>;
53
+ }, options?: O) => Promise<FetchResult<{
54
+ subscriptions: Subscription[];
55
+ }, O>>;
56
+ /**
57
+ * Get a manage link/billing portal link for a subscription.
58
+ */
59
+ getSubscriptionManageLink: <O extends BetterFetchOption | undefined = undefined>(data: {
60
+ subscriptionCode: string;
61
+ }, options?: O) => Promise<FetchResult<{
62
+ link: string;
63
+ }, O>>;
64
+ /**
65
+ * Get the plugin configuration (plans and products).
66
+ */
67
+ config: () => Promise<BetterFetchResponse<Record<string, unknown>>>;
68
+ /**
69
+ * List available products.
70
+ */
71
+ listProducts: <O extends BetterFetchOption | undefined = undefined>(options?: O) => Promise<FetchResult<{
72
+ products: PaystackProduct[];
73
+ }, O>>;
74
+ /**
75
+ * List available plans.
76
+ */
77
+ listPlans: <O extends BetterFetchOption | undefined = undefined>(options?: O) => Promise<FetchResult<{
78
+ plans: PaystackPlan[];
79
+ }, O>>;
80
+ }
81
+ /**
82
+ * Paystack Client Plugin Actions including namespaces
83
+ */
84
+ interface PaystackClientActions extends PaystackActions {
85
+ transaction: {
86
+ initialize: PaystackActions["initializeTransaction"];
87
+ verify: PaystackActions["verifyTransaction"];
88
+ list: PaystackActions["listTransactions"];
89
+ };
90
+ subscription: {
91
+ upgrade: PaystackActions["initializeTransaction"];
92
+ create: PaystackActions["initializeTransaction"];
93
+ cancel: <O extends BetterFetchOption | undefined = undefined>(data: {
94
+ subscriptionCode: string;
95
+ emailToken?: string;
96
+ atPeriodEnd?: boolean;
97
+ }, options?: O) => Promise<FetchResult<{
134
98
  status: string;
135
- reference: string;
136
- data: unknown;
137
- }>>;
138
- listTransactions: (data?: {
139
- query?: Record<string, unknown>;
140
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
141
- transactions: PaystackTransaction[];
142
- }>>;
143
- listSubscriptions: (data?: {
144
- query?: Record<string, unknown>;
145
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
146
- subscriptions: Subscription[];
147
- }>>;
148
- getSubscriptionManageLink: (data: {
99
+ }, O>>;
100
+ restore: <O extends BetterFetchOption | undefined = undefined>(data: {
149
101
  subscriptionCode: string;
150
- }, options?: BetterFetchOption) => Promise<BetterFetchResponse<{
151
- link: string;
152
- }>>;
153
- config: () => Promise<BetterFetchResponse<Record<string, unknown>>>;
154
- listProducts: (options?: BetterFetchOption) => Promise<BetterFetchResponse<{
155
- products: PaystackProduct[];
156
- }>>;
157
- listPlans: (options?: BetterFetchOption) => Promise<BetterFetchResponse<{
158
- plans: PaystackPlan[];
159
- }>>;
102
+ emailToken?: string;
103
+ }, options?: O) => Promise<FetchResult<{
104
+ status: string;
105
+ }, O>>;
106
+ list: PaystackActions["listSubscriptions"];
107
+ billingPortal: PaystackActions["getSubscriptionManageLink"];
108
+ manageLink: PaystackActions["getSubscriptionManageLink"];
109
+ disable: PaystackClientActions["subscription"]["cancel"];
110
+ enable: PaystackClientActions["subscription"]["restore"];
160
111
  };
112
+ paystack: PaystackClientActions;
113
+ }
114
+ declare module "better-auth/client" {
115
+ interface BetterAuthClient {
116
+ paystack: PaystackClientActions;
117
+ subscription: PaystackClientActions["subscription"];
118
+ transaction: PaystackClientActions["transaction"];
119
+ }
120
+ }
121
+ declare module "better-auth" {
122
+ interface BetterAuthClientPlugins {
123
+ paystack: ReturnType<typeof paystackClient>;
124
+ }
125
+ }
126
+ /**
127
+ * Better Auth Paystack Client Plugin
128
+ */
129
+ declare const paystackClient: <O extends {
130
+ subscription?: boolean;
131
+ } = {
132
+ subscription?: boolean;
133
+ }>(_options?: O) => BetterAuthClientPlugin & {
134
+ getActions: ($fetch: BetterFetch, $store: unknown, options: unknown) => PaystackClientActions;
161
135
  };
136
+ declare const paystack: typeof paystackClient;
162
137
  //#endregion
163
- export { paystackClient };
138
+ export { FetchResult, PaystackActions, PaystackClientActions, paystack, paystackClient };
164
139
  //# sourceMappingURL=client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":";;;;cAaa,cAAA;EAET,YAAA;AAAA,GAGF,QAAA,GAAW,CAAA;EAEX,EAAA;EACA,OAAA;EACA,kBAAA,EAAoB,UAAA,QAAkB,QAAA,CAAS,kBAAA,EAAoB,kBAAA;EACnE,UAAA,GACE,MAAA,EAAQ,WAAA,EACR,OAAA,WACA,QAAA;IAEA,WAAA;MACE,UAAA,GACE,IAAA,EAAM,MAAA;QACJ,WAAA;QACA,WAAA;QACA,OAAA;QACA,WAAA;MAAA,GAEF,OAAA,GAAU,iBAAA,KACP,OAAA,CACH,mBAAA;QACE,GAAA;QACA,SAAA;QACA,UAAA;QACA,QAAA;MAAA;MAGJ,MAAA,GACE,IAAA;QAAQ,SAAA;MAAA,GACR,OAAA,GAAU,iBAAA,KACP,OAAA,CACH,mBAAA;QACE,MAAA;QACA,SAAA;QACA,IAAA;MAAA;MAGJ,IAAA,GACE,IAAA;QAAS,KAAA,GAAQ,MAAA;MAAA,GACjB,OAAA,GAAU,iBAAA,KACP,OAAA,CACH,mBAAA;QACE,YAAA,EAAc,mBAAA;MAAA;IAAA;IAIpB,YAAA;MA8Dc;;;MA1DZ,OAAA,GACE,IAAA,EAAM,MAAA;QACJ,WAAA;QACA,WAAA;QACA,OAAA;QACA,WAAA;MAAA,GAEF,OAAA,GAAU,iBAAA,KACP,OAAA,CACH,mBAAA;QACE,GAAA;QACA,SAAA;QACA,UAAA;QACA,QAAA;MAAA;MAuFQ;;;MAjFZ,MAAA,GACE,IAAA,EAAM,MAAA;QACJ,WA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