@alexasomba/better-auth-paystack 1.1.0 → 1.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 +22 -2
- package/dist/client.d.mts +33 -1
- package/dist/client.d.mts.map +1 -1
- package/dist/client.mjs +15 -0
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +166 -89
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +539 -108
- package/dist/index.mjs.map +1 -1
- package/dist/{types-BVSLYZGY.d.mts → types-BOpjdQrr.d.mts} +63 -16
- package/dist/types-BOpjdQrr.d.mts.map +1 -0
- package/package.json +13 -13
- package/dist/types-BVSLYZGY.d.mts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as PaystackProduct, c as SubscriptionOptions, i as PaystackPlan, n as PaystackNodeClient,
|
|
1
|
+
import { a as PaystackProduct, c as SubscriptionOptions, i as PaystackPlan, n as PaystackNodeClient, r as PaystackOptions, s as Subscription, t as PaystackClientLike } from "./types-BOpjdQrr.mjs";
|
|
2
|
+
import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
|
|
2
3
|
import * as better_auth0 from "better-auth";
|
|
3
4
|
import { AuthContext, GenericEndpointContext } from "better-auth";
|
|
4
5
|
import * as _better_auth_core_db0 from "@better-auth/core/db";
|
|
@@ -6,10 +7,10 @@ import * as zod from "zod";
|
|
|
6
7
|
import * as better_call0 from "better-call";
|
|
7
8
|
|
|
8
9
|
//#region src/index.d.ts
|
|
9
|
-
declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNodeClient, TMetadata =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNodeClient, TMetadata = Record<string, unknown>, TLimits = Record<string, unknown>, O extends PaystackOptions<TPaystackClient, TMetadata, TLimits> = PaystackOptions<TPaystackClient, TMetadata, TLimits>>(options: O) => {
|
|
11
|
+
id: string;
|
|
12
|
+
endpoints: {
|
|
13
|
+
initializeTransaction: better_call0.StrictEndpoint<"/paystack/initialize-transaction", {
|
|
13
14
|
method: "POST";
|
|
14
15
|
body: zod.ZodObject<{
|
|
15
16
|
plan: zod.ZodOptional<zod.ZodString>;
|
|
@@ -21,6 +22,9 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
21
22
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
22
23
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
23
24
|
quantity: zod.ZodOptional<zod.ZodNumber>;
|
|
25
|
+
scheduleAtPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
26
|
+
cancelAtPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
27
|
+
prorateAndCharge: zod.ZodOptional<zod.ZodBoolean>;
|
|
24
28
|
}, better_auth0.$strip>;
|
|
25
29
|
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
26
30
|
referenceId: string;
|
|
@@ -47,13 +51,8 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
47
51
|
};
|
|
48
52
|
};
|
|
49
53
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
reference: string | undefined;
|
|
53
|
-
accessCode: string | undefined;
|
|
54
|
-
redirect: boolean;
|
|
55
|
-
}>;
|
|
56
|
-
readonly verifyTransaction: better_call0.StrictEndpoint<"/paystack/verify-transaction", {
|
|
54
|
+
}, any>;
|
|
55
|
+
verifyTransaction: better_call0.StrictEndpoint<"/paystack/verify-transaction", {
|
|
57
56
|
method: "POST";
|
|
58
57
|
body: zod.ZodObject<{
|
|
59
58
|
reference: zod.ZodString;
|
|
@@ -83,12 +82,8 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
83
82
|
};
|
|
84
83
|
};
|
|
85
84
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
reference: string;
|
|
89
|
-
data: Record<string, unknown>;
|
|
90
|
-
}>;
|
|
91
|
-
readonly listSubscriptions: better_call0.StrictEndpoint<"/paystack/list-subscriptions", {
|
|
85
|
+
}, any>;
|
|
86
|
+
listSubscriptions: better_call0.StrictEndpoint<"/paystack/list-subscriptions", {
|
|
92
87
|
method: "GET";
|
|
93
88
|
query: zod.ZodObject<{
|
|
94
89
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
@@ -118,10 +113,8 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
118
113
|
};
|
|
119
114
|
};
|
|
120
115
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
}>;
|
|
124
|
-
readonly paystackWebhook: better_call0.StrictEndpoint<"/paystack/webhook", {
|
|
116
|
+
}, any>;
|
|
117
|
+
paystackWebhook: better_call0.StrictEndpoint<"/paystack/webhook", {
|
|
125
118
|
method: "POST";
|
|
126
119
|
metadata: {
|
|
127
120
|
openapi: {
|
|
@@ -131,10 +124,8 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
131
124
|
};
|
|
132
125
|
cloneRequest: true;
|
|
133
126
|
disableBody: true;
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
}>;
|
|
137
|
-
readonly listTransactions: better_call0.StrictEndpoint<"/paystack/list-transactions", {
|
|
127
|
+
}, any>;
|
|
128
|
+
listTransactions: better_call0.StrictEndpoint<"/paystack/list-transactions", {
|
|
138
129
|
method: "GET";
|
|
139
130
|
query: zod.ZodObject<{
|
|
140
131
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
@@ -164,26 +155,22 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
164
155
|
};
|
|
165
156
|
};
|
|
166
157
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
}>;
|
|
170
|
-
readonly getConfig: better_call0.StrictEndpoint<"/paystack/get-config", {
|
|
158
|
+
}, any>;
|
|
159
|
+
getConfig: better_call0.StrictEndpoint<"/paystack/get-config", {
|
|
171
160
|
method: "GET";
|
|
172
161
|
metadata: {
|
|
173
162
|
openapi: {
|
|
174
163
|
operationId: string;
|
|
175
164
|
};
|
|
176
165
|
};
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
products: PaystackProduct[];
|
|
180
|
-
}>;
|
|
181
|
-
readonly disableSubscription: better_call0.StrictEndpoint<"/paystack/disable-subscription", {
|
|
166
|
+
}, any>;
|
|
167
|
+
disableSubscription: better_call0.StrictEndpoint<"/paystack/disable-subscription", {
|
|
182
168
|
method: "POST";
|
|
183
169
|
body: zod.ZodObject<{
|
|
184
170
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
185
171
|
subscriptionCode: zod.ZodString;
|
|
186
172
|
emailToken: zod.ZodOptional<zod.ZodString>;
|
|
173
|
+
atPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
187
174
|
}, better_auth0.$strip>;
|
|
188
175
|
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
189
176
|
referenceId: string;
|
|
@@ -210,15 +197,14 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
210
197
|
};
|
|
211
198
|
};
|
|
212
199
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
}>;
|
|
216
|
-
readonly enableSubscription: better_call0.StrictEndpoint<"/paystack/enable-subscription", {
|
|
200
|
+
}, any>;
|
|
201
|
+
enableSubscription: better_call0.StrictEndpoint<"/paystack/enable-subscription", {
|
|
217
202
|
method: "POST";
|
|
218
203
|
body: zod.ZodObject<{
|
|
219
204
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
220
205
|
subscriptionCode: zod.ZodString;
|
|
221
206
|
emailToken: zod.ZodOptional<zod.ZodString>;
|
|
207
|
+
atPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
222
208
|
}, better_auth0.$strip>;
|
|
223
209
|
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
224
210
|
referenceId: string;
|
|
@@ -245,10 +231,8 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
245
231
|
};
|
|
246
232
|
};
|
|
247
233
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
248
|
-
},
|
|
249
|
-
|
|
250
|
-
}>;
|
|
251
|
-
readonly getSubscriptionManageLink: better_call0.StrictEndpoint<"/paystack/get-subscription-manage-link", {
|
|
234
|
+
}, any>;
|
|
235
|
+
getSubscriptionManageLink: better_call0.StrictEndpoint<"/paystack/get-subscription-manage-link", {
|
|
252
236
|
method: "GET";
|
|
253
237
|
query: zod.ZodObject<{
|
|
254
238
|
subscriptionCode: zod.ZodString;
|
|
@@ -278,10 +262,39 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
278
262
|
};
|
|
279
263
|
};
|
|
280
264
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
}, any>;
|
|
266
|
+
subscriptionManageLink: better_call0.StrictEndpoint<"/paystack/subscription/manage-link", {
|
|
267
|
+
method: "GET";
|
|
268
|
+
query: zod.ZodObject<{
|
|
269
|
+
subscriptionCode: zod.ZodString;
|
|
270
|
+
}, better_auth0.$strip>;
|
|
271
|
+
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
272
|
+
referenceId: string;
|
|
273
|
+
}>) | ((inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
274
|
+
session: {
|
|
275
|
+
session: Record<string, any> & {
|
|
276
|
+
id: string;
|
|
277
|
+
createdAt: Date;
|
|
278
|
+
updatedAt: Date;
|
|
279
|
+
userId: string;
|
|
280
|
+
expiresAt: Date;
|
|
281
|
+
token: string;
|
|
282
|
+
ipAddress?: string | null | undefined;
|
|
283
|
+
userAgent?: string | null | undefined;
|
|
284
|
+
};
|
|
285
|
+
user: Record<string, any> & {
|
|
286
|
+
id: string;
|
|
287
|
+
createdAt: Date;
|
|
288
|
+
updatedAt: Date;
|
|
289
|
+
email: string;
|
|
290
|
+
emailVerified: boolean;
|
|
291
|
+
name: string;
|
|
292
|
+
image?: string | null | undefined;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
296
|
+
}, any>;
|
|
297
|
+
createSubscription: better_call0.StrictEndpoint<"/paystack/create-subscription", {
|
|
285
298
|
method: "POST";
|
|
286
299
|
body: zod.ZodObject<{
|
|
287
300
|
plan: zod.ZodOptional<zod.ZodString>;
|
|
@@ -293,6 +306,9 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
293
306
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
294
307
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
295
308
|
quantity: zod.ZodOptional<zod.ZodNumber>;
|
|
309
|
+
scheduleAtPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
310
|
+
cancelAtPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
311
|
+
prorateAndCharge: zod.ZodOptional<zod.ZodBoolean>;
|
|
296
312
|
}, better_auth0.$strip>;
|
|
297
313
|
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
298
314
|
referenceId: string;
|
|
@@ -319,13 +335,8 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
319
335
|
};
|
|
320
336
|
};
|
|
321
337
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
322
|
-
},
|
|
323
|
-
|
|
324
|
-
reference: string | undefined;
|
|
325
|
-
accessCode: string | undefined;
|
|
326
|
-
redirect: boolean;
|
|
327
|
-
}>;
|
|
328
|
-
readonly upgradeSubscription: better_call0.StrictEndpoint<"/paystack/upgrade-subscription", {
|
|
338
|
+
}, any>;
|
|
339
|
+
upgradeSubscription: better_call0.StrictEndpoint<"/paystack/upgrade-subscription", {
|
|
329
340
|
method: "POST";
|
|
330
341
|
body: zod.ZodObject<{
|
|
331
342
|
plan: zod.ZodOptional<zod.ZodString>;
|
|
@@ -337,6 +348,9 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
337
348
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
338
349
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
339
350
|
quantity: zod.ZodOptional<zod.ZodNumber>;
|
|
351
|
+
scheduleAtPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
352
|
+
cancelAtPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
353
|
+
prorateAndCharge: zod.ZodOptional<zod.ZodBoolean>;
|
|
340
354
|
}, better_auth0.$strip>;
|
|
341
355
|
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
342
356
|
referenceId: string;
|
|
@@ -363,18 +377,14 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
363
377
|
};
|
|
364
378
|
};
|
|
365
379
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
reference: string | undefined;
|
|
369
|
-
accessCode: string | undefined;
|
|
370
|
-
redirect: boolean;
|
|
371
|
-
}>;
|
|
372
|
-
readonly cancelSubscription: better_call0.StrictEndpoint<"/paystack/cancel-subscription", {
|
|
380
|
+
}, any>;
|
|
381
|
+
cancelSubscription: better_call0.StrictEndpoint<"/paystack/cancel-subscription", {
|
|
373
382
|
method: "POST";
|
|
374
383
|
body: zod.ZodObject<{
|
|
375
384
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
376
385
|
subscriptionCode: zod.ZodString;
|
|
377
386
|
emailToken: zod.ZodOptional<zod.ZodString>;
|
|
387
|
+
atPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
378
388
|
}, better_auth0.$strip>;
|
|
379
389
|
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
380
390
|
referenceId: string;
|
|
@@ -401,15 +411,14 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
401
411
|
};
|
|
402
412
|
};
|
|
403
413
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
404
|
-
},
|
|
405
|
-
|
|
406
|
-
}>;
|
|
407
|
-
readonly restoreSubscription: better_call0.StrictEndpoint<"/paystack/restore-subscription", {
|
|
414
|
+
}, any>;
|
|
415
|
+
restoreSubscription: better_call0.StrictEndpoint<"/paystack/restore-subscription", {
|
|
408
416
|
method: "POST";
|
|
409
417
|
body: zod.ZodObject<{
|
|
410
418
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
411
419
|
subscriptionCode: zod.ZodString;
|
|
412
420
|
emailToken: zod.ZodOptional<zod.ZodString>;
|
|
421
|
+
atPeriodEnd: zod.ZodOptional<zod.ZodBoolean>;
|
|
413
422
|
}, better_auth0.$strip>;
|
|
414
423
|
use: (((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
415
424
|
referenceId: string;
|
|
@@ -436,20 +445,53 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
436
445
|
};
|
|
437
446
|
};
|
|
438
447
|
}>) | ((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>))[];
|
|
439
|
-
},
|
|
440
|
-
|
|
441
|
-
}>;
|
|
442
|
-
readonly chargeRecurringSubscription: better_call0.StrictEndpoint<"/paystack/charge-recurring", {
|
|
448
|
+
}, any>;
|
|
449
|
+
chargeRecurringSubscription: better_call0.StrictEndpoint<"/paystack/charge-recurring", {
|
|
443
450
|
method: "POST";
|
|
444
451
|
body: zod.ZodObject<{
|
|
445
452
|
subscriptionId: zod.ZodString;
|
|
446
453
|
amount: zod.ZodOptional<zod.ZodNumber>;
|
|
447
454
|
}, better_auth0.$strip>;
|
|
448
|
-
},
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
455
|
+
}, any>;
|
|
456
|
+
syncProducts: better_call0.StrictEndpoint<"/paystack/sync-products", {
|
|
457
|
+
method: "POST";
|
|
458
|
+
metadata: {
|
|
459
|
+
scope: "server";
|
|
460
|
+
};
|
|
461
|
+
disableBody: true;
|
|
462
|
+
use: ((inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
463
|
+
session: {
|
|
464
|
+
session: Record<string, any> & {
|
|
465
|
+
id: string;
|
|
466
|
+
createdAt: Date;
|
|
467
|
+
updatedAt: Date;
|
|
468
|
+
userId: string;
|
|
469
|
+
expiresAt: Date;
|
|
470
|
+
token: string;
|
|
471
|
+
ipAddress?: string | null | undefined;
|
|
472
|
+
userAgent?: string | null | undefined;
|
|
473
|
+
};
|
|
474
|
+
user: Record<string, any> & {
|
|
475
|
+
id: string;
|
|
476
|
+
createdAt: Date;
|
|
477
|
+
updatedAt: Date;
|
|
478
|
+
email: string;
|
|
479
|
+
emailVerified: boolean;
|
|
480
|
+
name: string;
|
|
481
|
+
image?: string | null | undefined;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
}>)[];
|
|
485
|
+
}, any>;
|
|
486
|
+
listProducts: better_call0.StrictEndpoint<"/paystack/list-products", {
|
|
487
|
+
method: "GET";
|
|
488
|
+
metadata: {
|
|
489
|
+
openapi: {
|
|
490
|
+
operationId: string;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
}, any>;
|
|
494
|
+
syncPlans: better_call0.StrictEndpoint<"/paystack/sync-plans", {
|
|
453
495
|
method: "POST";
|
|
454
496
|
metadata: {
|
|
455
497
|
scope: "server";
|
|
@@ -478,13 +520,39 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
478
520
|
};
|
|
479
521
|
};
|
|
480
522
|
}>)[];
|
|
481
|
-
},
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
523
|
+
}, any>;
|
|
524
|
+
listPlans: better_call0.StrictEndpoint<"/paystack/list-plans", {
|
|
525
|
+
method: "GET";
|
|
526
|
+
metadata: {
|
|
527
|
+
scope: "server";
|
|
528
|
+
};
|
|
529
|
+
use: ((inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<{
|
|
530
|
+
session: {
|
|
531
|
+
session: Record<string, any> & {
|
|
532
|
+
id: string;
|
|
533
|
+
createdAt: Date;
|
|
534
|
+
updatedAt: Date;
|
|
535
|
+
userId: string;
|
|
536
|
+
expiresAt: Date;
|
|
537
|
+
token: string;
|
|
538
|
+
ipAddress?: string | null | undefined;
|
|
539
|
+
userAgent?: string | null | undefined;
|
|
540
|
+
};
|
|
541
|
+
user: Record<string, any> & {
|
|
542
|
+
id: string;
|
|
543
|
+
createdAt: Date;
|
|
544
|
+
updatedAt: Date;
|
|
545
|
+
email: string;
|
|
546
|
+
emailVerified: boolean;
|
|
547
|
+
name: string;
|
|
548
|
+
image?: string | null | undefined;
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
}>)[];
|
|
552
|
+
}, any>;
|
|
485
553
|
};
|
|
486
|
-
|
|
487
|
-
|
|
554
|
+
schema: _better_auth_core_db0.BetterAuthPluginDBSchema;
|
|
555
|
+
init: (ctx: AuthContext) => {
|
|
488
556
|
options: {
|
|
489
557
|
databaseHooks: {
|
|
490
558
|
user: {
|
|
@@ -511,6 +579,14 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
511
579
|
before: (member: {
|
|
512
580
|
organizationId: string;
|
|
513
581
|
}, ctx: GenericEndpointContext | null | undefined) => Promise<void>;
|
|
582
|
+
after: (member: {
|
|
583
|
+
organizationId: string | undefined;
|
|
584
|
+
}, ctx: GenericEndpointContext | null | undefined) => Promise<void>;
|
|
585
|
+
};
|
|
586
|
+
delete: {
|
|
587
|
+
after: (member: {
|
|
588
|
+
organizationId: string | undefined;
|
|
589
|
+
}, ctx: GenericEndpointContext | null | undefined) => Promise<void>;
|
|
514
590
|
};
|
|
515
591
|
};
|
|
516
592
|
invitation: {
|
|
@@ -518,6 +594,14 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
518
594
|
before: (invitation: {
|
|
519
595
|
organizationId: string;
|
|
520
596
|
}, ctx: GenericEndpointContext | null | undefined) => Promise<void>;
|
|
597
|
+
after: (invitation: {
|
|
598
|
+
organizationId: string | undefined;
|
|
599
|
+
}, ctx: GenericEndpointContext | null | undefined) => Promise<void>;
|
|
600
|
+
};
|
|
601
|
+
delete: {
|
|
602
|
+
after: (invitation: {
|
|
603
|
+
organizationId: string | undefined;
|
|
604
|
+
}, ctx: GenericEndpointContext | null | undefined) => Promise<void>;
|
|
521
605
|
};
|
|
522
606
|
};
|
|
523
607
|
team: {
|
|
@@ -529,15 +613,8 @@ declare const paystack: <TPaystackClient extends PaystackClientLike = PaystackNo
|
|
|
529
613
|
};
|
|
530
614
|
};
|
|
531
615
|
};
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
readonly SUBSCRIPTION_PLAN_NOT_FOUND: "Subscription plan not found";
|
|
535
|
-
readonly UNABLE_TO_CREATE_CUSTOMER: "Unable to create customer";
|
|
536
|
-
readonly FAILED_TO_INITIALIZE_TRANSACTION: "Failed to initialize transaction";
|
|
537
|
-
readonly FAILED_TO_VERIFY_TRANSACTION: "Failed to verify transaction";
|
|
538
|
-
readonly FAILED_TO_DISABLE_SUBSCRIPTION: "Failed to disable subscription";
|
|
539
|
-
readonly FAILED_TO_ENABLE_SUBSCRIPTION: "Failed to enable subscription";
|
|
540
|
-
readonly EMAIL_VERIFICATION_REQUIRED: "Email verification is required before you can subscribe to a plan";
|
|
616
|
+
$ERROR_CODES: {
|
|
617
|
+
[x: string]: _better_auth_core_utils_error_codes0.RawError<string>;
|
|
541
618
|
};
|
|
542
619
|
};
|
|
543
620
|
type PaystackPlugin<O extends PaystackOptions<PaystackClientLike, any, any> = PaystackOptions> = ReturnType<typeof paystack<PaystackClientLike, any, any, O>>;
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names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