@dodopayments/better-auth 1.6.1 → 1.6.3
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 +2 -2
- package/dist/{chunk-65YIVTFE.js → chunk-6VDYFSNJ.js} +6 -6
- package/dist/chunk-6VDYFSNJ.js.map +1 -0
- package/dist/{chunk-TOPOAYYO.js → chunk-EGRIWRWP.js} +6 -3
- package/dist/chunk-EGRIWRWP.js.map +1 -0
- package/dist/{chunk-HHIXOUFD.js → chunk-XXIDSJPK.js} +4 -4
- package/dist/chunk-XXIDSJPK.js.map +1 -0
- package/dist/{chunk-DTOB4IQZ.js → chunk-YCUWFLKK.js} +15 -12
- package/dist/chunk-YCUWFLKK.js.map +1 -0
- package/dist/{chunk-ARA27DRZ.js → chunk-ZA3TNX5K.js} +11 -9
- package/dist/chunk-ZA3TNX5K.js.map +1 -0
- package/dist/client.d.cts +1 -2
- package/dist/client.d.ts +1 -2
- package/dist/hooks/customer.d.cts +1 -2
- package/dist/hooks/customer.d.ts +1 -2
- package/dist/index.cjs +36 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -6
- package/dist/index.d.ts +40 -6
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/plugins/checkout.cjs +5 -5
- package/dist/plugins/checkout.cjs.map +1 -1
- package/dist/plugins/checkout.d.cts +2 -3
- package/dist/plugins/checkout.d.ts +2 -3
- package/dist/plugins/checkout.js +1 -1
- package/dist/plugins/portal.cjs +18 -12
- package/dist/plugins/portal.cjs.map +1 -1
- package/dist/plugins/portal.d.cts +2 -3
- package/dist/plugins/portal.d.ts +2 -3
- package/dist/plugins/portal.js +2 -2
- package/dist/plugins/usage.cjs +14 -9
- package/dist/plugins/usage.cjs.map +1 -1
- package/dist/plugins/usage.d.cts +6 -107
- package/dist/plugins/usage.d.ts +6 -107
- package/dist/plugins/usage.js +2 -2
- package/dist/plugins/webhooks.cjs +3 -3
- package/dist/plugins/webhooks.cjs.map +1 -1
- package/dist/plugins/webhooks.d.cts +2 -3
- package/dist/plugins/webhooks.d.ts +2 -3
- package/dist/plugins/webhooks.js +1 -1
- package/dist/{types-3pb2RGTM.d.cts → types-nGEm2vCL.d.cts} +148 -12
- package/dist/{types-DygjjcRn.d.ts → types-nGEm2vCL.d.ts} +148 -12
- package/dist/types.d.cts +1 -2
- package/dist/types.d.ts +1 -2
- package/dist/utils.cjs +5 -2
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +8 -1
- package/dist/utils.d.ts +8 -1
- package/dist/utils.js +1 -1
- package/package.json +6 -1
- package/dist/chunk-65YIVTFE.js.map +0 -1
- package/dist/chunk-ARA27DRZ.js.map +0 -1
- package/dist/chunk-DTOB4IQZ.js.map +0 -1
- package/dist/chunk-HHIXOUFD.js.map +0 -1
- package/dist/chunk-TOPOAYYO.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/webhooks.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/webhooks.ts"],"sourcesContent":["import type { DodoPaymentsOptions } from \"../types\";\nimport {\n handleWebhookPayload,\n WebhookHandlerConfig,\n} from \"@dodopayments/core/webhook\";\nimport { APIError, createAuthEndpoint } from \"better-auth/api\";\nimport { WebhookPayload } from \"@dodopayments/core/schemas\";\nimport { verifyWebhookPayload } from \"@dodopayments/core/webhook\";\nimport type { WebhookResponse } from \"../types\";\n\nexport const webhooks =\n (webhookOptions: WebhookHandlerConfig) => (_options: DodoPaymentsOptions) => {\n return {\n dodopaymentsWebhooks: createAuthEndpoint(\n \"/dodopayments/webhooks\",\n {\n method: \"POST\",\n metadata: {\n isAction: false,\n },\n cloneRequest: true,\n },\n async (ctx): Promise<WebhookResponse> => {\n const { webhookKey } = webhookOptions;\n\n if (!ctx.request?.body) {\n throw new APIError(\"INTERNAL_SERVER_ERROR\");\n }\n const buf = await ctx.request.text();\n let event: WebhookPayload;\n try {\n if (!webhookKey) {\n throw new APIError(\"INTERNAL_SERVER_ERROR\", {\n message: \"DodoPayments webhook webhookKey not found\",\n });\n }\n\n const headers = {\n \"webhook-id\": ctx.request.headers.get(\"webhook-id\") as string,\n \"webhook-timestamp\": ctx.request.headers.get(\n \"webhook-timestamp\",\n ) as string,\n \"webhook-signature\": ctx.request.headers.get(\n \"webhook-signature\",\n ) as string,\n };\n\n event = await verifyWebhookPayload({\n webhookKey,\n headers,\n body: buf,\n });\n } catch (err: unknown) {\n if (err instanceof Error) {\n ctx.context.logger.error(`Webhook Error: ${err.message}`);\n throw new APIError(\"BAD_REQUEST\", {\n message: `Webhook Error: ${err.message}`,\n });\n }\n\n throw new APIError(\"BAD_REQUEST\", {\n message: `Webhook Error: ${err}`,\n });\n }\n\n try {\n await handleWebhookPayload(event, webhookOptions);\n } catch (e: unknown) {\n if (e instanceof Error) {\n ctx.context.logger.error(\n `DodoPayments webhook failed. Error: ${e.message}`,\n );\n }\n\n ctx.context.logger.error(\n `DodoPayments webhook failed. Error: ${e}`,\n );\n\n throw new APIError(\"BAD_REQUEST\", {\n message: \"Webhook error: See server logs for more information.\",\n });\n }\n\n return ctx.json({ received: true });\n },\n ),\n };\n };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAGO;AACP,iBAA6C;AAE7C,IAAAA,kBAAqC;AAG9B,IAAM,WACX,CAAC,mBAAyC,CAAC,aAAkC;AAC3E,SAAO;AAAA,IACL,0BAAsB;AAAA,MACpB;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,UAAU;AAAA,UACR,UAAU;AAAA,QACZ;AAAA,QACA,cAAc;AAAA,MAChB;AAAA,MACA,OAAO,QAAkC;AACvC,cAAM,EAAE,WAAW,IAAI;AAEvB,YAAI,CAAC,IAAI,SAAS,MAAM;AACtB,gBAAM,IAAI,oBAAS,uBAAuB;AAAA,QAC5C;AACA,cAAM,MAAM,MAAM,IAAI,QAAQ,KAAK;AACnC,YAAI;AACJ,YAAI;AACF,cAAI,CAAC,YAAY;AACf,kBAAM,IAAI,oBAAS,yBAAyB;AAAA,cAC1C,SAAS;AAAA,YACX,CAAC;AAAA,UACH;AAEA,gBAAM,UAAU;AAAA,YACd,cAAc,IAAI,QAAQ,QAAQ,IAAI,YAAY;AAAA,YAClD,qBAAqB,IAAI,QAAQ,QAAQ;AAAA,cACvC;AAAA,YACF;AAAA,YACA,qBAAqB,IAAI,QAAQ,QAAQ;AAAA,cACvC;AAAA,YACF;AAAA,UACF;AAEA,kBAAQ,UAAM,sCAAqB;AAAA,YACjC;AAAA,YACA;AAAA,YACA,MAAM;AAAA,UACR,CAAC;AAAA,QACH,SAAS,KAAc;AACrB,cAAI,eAAe,OAAO;AACxB,gBAAI,QAAQ,OAAO,MAAM,kBAAkB,IAAI,OAAO,EAAE;AACxD,kBAAM,IAAI,oBAAS,eAAe;AAAA,cAChC,SAAS,kBAAkB,IAAI,OAAO;AAAA,YACxC,CAAC;AAAA,UACH;AAEA,gBAAM,IAAI,oBAAS,eAAe;AAAA,YAChC,SAAS,kBAAkB,GAAG;AAAA,UAChC,CAAC;AAAA,QACH;AAEA,YAAI;AACF,oBAAM,qCAAqB,OAAO,cAAc;AAAA,QAClD,SAAS,GAAY;AACnB,cAAI,aAAa,OAAO;AACtB,gBAAI,QAAQ,OAAO;AAAA,cACjB,uCAAuC,EAAE,OAAO;AAAA,YAClD;AAAA,UACF;AAEA,cAAI,QAAQ,OAAO;AAAA,YACjB,uCAAuC,CAAC;AAAA,UAC1C;AAEA,gBAAM,IAAI,oBAAS,eAAe;AAAA,YAChC,SAAS;AAAA,UACX,CAAC;AAAA,QACH;AAEA,eAAO,IAAI,KAAK,EAAE,UAAU,KAAK,CAAC;AAAA,MACpC;AAAA,IACF;AAAA,EACF;AACF;","names":["import_webhook"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'better-auth';
|
|
2
|
-
|
|
2
|
+
export { w as webhooks } from '../types-nGEm2vCL.cjs';
|
|
3
3
|
import '@dodopayments/core/webhook';
|
|
4
|
-
|
|
4
|
+
import 'dodopayments';
|
|
5
5
|
import 'zod/v3';
|
|
6
|
-
import './usage.cjs';
|
|
7
6
|
import 'dodopayments/resources/usage-events.mjs';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'better-auth';
|
|
2
|
-
|
|
2
|
+
export { w as webhooks } from '../types-nGEm2vCL.js';
|
|
3
3
|
import '@dodopayments/core/webhook';
|
|
4
|
-
|
|
4
|
+
import 'dodopayments';
|
|
5
5
|
import 'zod/v3';
|
|
6
|
-
import './usage.js';
|
|
7
6
|
import 'dodopayments/resources/usage-events.mjs';
|
package/dist/plugins/webhooks.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DodoPayments } from 'dodopayments';
|
|
2
2
|
import * as better_auth from 'better-auth';
|
|
3
3
|
import { User, UnionToIntersection } from 'better-auth';
|
|
4
4
|
import { z } from 'zod/v3';
|
|
5
5
|
import { WebhookHandlerConfig } from '@dodopayments/core/webhook';
|
|
6
|
-
import {
|
|
6
|
+
import { Event } from 'dodopayments/resources/usage-events.mjs';
|
|
7
7
|
|
|
8
8
|
interface CheckoutOptions {
|
|
9
9
|
/**
|
|
@@ -19,7 +19,7 @@ interface CheckoutOptions {
|
|
|
19
19
|
*/
|
|
20
20
|
authenticatedUsersOnly?: boolean;
|
|
21
21
|
}
|
|
22
|
-
declare const checkout: (checkoutOptions?: CheckoutOptions) => (
|
|
22
|
+
declare const checkout: (checkoutOptions?: CheckoutOptions) => (options: DodoPaymentsOptions) => {
|
|
23
23
|
/**
|
|
24
24
|
* @deprecated
|
|
25
25
|
*/
|
|
@@ -83,6 +83,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
83
83
|
}>, "many">>;
|
|
84
84
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
85
85
|
currency: z.ZodOptional<z.ZodString>;
|
|
86
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
87
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
86
88
|
} & {
|
|
87
89
|
slug: z.ZodOptional<z.ZodString>;
|
|
88
90
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
@@ -144,6 +146,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
144
146
|
}>, "many">>;
|
|
145
147
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
146
148
|
currency: z.ZodOptional<z.ZodString>;
|
|
149
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
150
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
147
151
|
} & {
|
|
148
152
|
slug: z.ZodOptional<z.ZodString>;
|
|
149
153
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
@@ -205,6 +209,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
205
209
|
}>, "many">>;
|
|
206
210
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
207
211
|
currency: z.ZodOptional<z.ZodString>;
|
|
212
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
213
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
208
214
|
} & {
|
|
209
215
|
slug: z.ZodOptional<z.ZodString>;
|
|
210
216
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
@@ -230,6 +236,16 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
230
236
|
addon_id: string;
|
|
231
237
|
}>, "many">>;
|
|
232
238
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
credit_entitlements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
|
+
credit_entitlement_id: z.ZodString;
|
|
241
|
+
credits_amount: z.ZodString;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
credit_entitlement_id: string;
|
|
244
|
+
credits_amount: string;
|
|
245
|
+
}, {
|
|
246
|
+
credit_entitlement_id: string;
|
|
247
|
+
credits_amount: string;
|
|
248
|
+
}>, "many">>;
|
|
233
249
|
}, "strip", z.ZodTypeAny, {
|
|
234
250
|
quantity: number;
|
|
235
251
|
product_id: string;
|
|
@@ -238,6 +254,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
238
254
|
addon_id: string;
|
|
239
255
|
}[] | undefined;
|
|
240
256
|
amount?: number | undefined;
|
|
257
|
+
credit_entitlements?: {
|
|
258
|
+
credit_entitlement_id: string;
|
|
259
|
+
credits_amount: string;
|
|
260
|
+
}[] | undefined;
|
|
241
261
|
}, {
|
|
242
262
|
quantity: number;
|
|
243
263
|
product_id: string;
|
|
@@ -246,6 +266,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
246
266
|
addon_id: string;
|
|
247
267
|
}[] | undefined;
|
|
248
268
|
amount?: number | undefined;
|
|
269
|
+
credit_entitlements?: {
|
|
270
|
+
credit_entitlement_id: string;
|
|
271
|
+
credits_amount: string;
|
|
272
|
+
}[] | undefined;
|
|
249
273
|
}>, "many">>;
|
|
250
274
|
customer: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
251
275
|
email: z.ZodString;
|
|
@@ -267,6 +291,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
267
291
|
customer_id: string;
|
|
268
292
|
}>]>>;
|
|
269
293
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
294
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
295
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
270
296
|
slug: z.ZodOptional<z.ZodString>;
|
|
271
297
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
272
298
|
billing_address: z.ZodOptional<z.ZodObject<{
|
|
@@ -293,7 +319,6 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
293
319
|
billing_currency: z.ZodOptional<z.ZodString>;
|
|
294
320
|
show_saved_payment_methods: z.ZodOptional<z.ZodBoolean>;
|
|
295
321
|
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
296
|
-
discount_code: z.ZodOptional<z.ZodString>;
|
|
297
322
|
customization: z.ZodOptional<z.ZodObject<{
|
|
298
323
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark", "system"]>>;
|
|
299
324
|
show_order_details: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -400,6 +425,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
400
425
|
addon_id: string;
|
|
401
426
|
}[] | undefined;
|
|
402
427
|
amount?: number | undefined;
|
|
428
|
+
credit_entitlements?: {
|
|
429
|
+
credit_entitlement_id: string;
|
|
430
|
+
credits_amount: string;
|
|
431
|
+
}[] | undefined;
|
|
403
432
|
}[] | undefined;
|
|
404
433
|
customer?: {
|
|
405
434
|
email: string;
|
|
@@ -409,6 +438,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
409
438
|
customer_id: string;
|
|
410
439
|
} | undefined;
|
|
411
440
|
metadata?: Record<string, string> | undefined;
|
|
441
|
+
discount_code?: string | undefined;
|
|
442
|
+
discount_codes?: string[] | undefined;
|
|
412
443
|
slug?: string | undefined;
|
|
413
444
|
referenceId?: string | undefined;
|
|
414
445
|
billing_address?: {
|
|
@@ -423,7 +454,6 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
423
454
|
billing_currency?: string | undefined;
|
|
424
455
|
show_saved_payment_methods?: boolean | undefined;
|
|
425
456
|
confirm?: boolean | undefined;
|
|
426
|
-
discount_code?: string | undefined;
|
|
427
457
|
customization?: {
|
|
428
458
|
theme?: "light" | "dark" | "system" | undefined;
|
|
429
459
|
show_order_details?: boolean | undefined;
|
|
@@ -464,6 +494,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
464
494
|
addon_id: string;
|
|
465
495
|
}[] | undefined;
|
|
466
496
|
amount?: number | undefined;
|
|
497
|
+
credit_entitlements?: {
|
|
498
|
+
credit_entitlement_id: string;
|
|
499
|
+
credits_amount: string;
|
|
500
|
+
}[] | undefined;
|
|
467
501
|
}[] | undefined;
|
|
468
502
|
customer?: {
|
|
469
503
|
email: string;
|
|
@@ -473,6 +507,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
473
507
|
customer_id: string;
|
|
474
508
|
} | undefined;
|
|
475
509
|
metadata?: Record<string, string> | undefined;
|
|
510
|
+
discount_code?: string | undefined;
|
|
511
|
+
discount_codes?: string[] | undefined;
|
|
476
512
|
slug?: string | undefined;
|
|
477
513
|
referenceId?: string | undefined;
|
|
478
514
|
billing_address?: {
|
|
@@ -487,7 +523,6 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
487
523
|
billing_currency?: string | undefined;
|
|
488
524
|
show_saved_payment_methods?: boolean | undefined;
|
|
489
525
|
confirm?: boolean | undefined;
|
|
490
|
-
discount_code?: string | undefined;
|
|
491
526
|
customization?: {
|
|
492
527
|
theme?: "light" | "dark" | "system" | undefined;
|
|
493
528
|
show_order_details?: boolean | undefined;
|
|
@@ -526,7 +561,7 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
526
561
|
}, CreateCheckoutResponse>;
|
|
527
562
|
};
|
|
528
563
|
|
|
529
|
-
declare const portal: () => (
|
|
564
|
+
declare const portal: () => (options: DodoPaymentsOptions) => {
|
|
530
565
|
dodoPortal: better_auth.StrictEndpoint<"/dodopayments/customer/portal", {
|
|
531
566
|
method: "GET";
|
|
532
567
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
@@ -639,7 +674,7 @@ declare const portal: () => (dodopayments: DodoPayments$1) => {
|
|
|
639
674
|
}, PaymentItems>;
|
|
640
675
|
};
|
|
641
676
|
|
|
642
|
-
declare const webhooks: (
|
|
677
|
+
declare const webhooks: (webhookOptions: WebhookHandlerConfig) => (_options: DodoPaymentsOptions) => {
|
|
643
678
|
dodopaymentsWebhooks: better_auth.StrictEndpoint<"/dodopayments/webhooks", {
|
|
644
679
|
method: "POST";
|
|
645
680
|
metadata: {
|
|
@@ -651,6 +686,107 @@ declare const webhooks: (options: WebhookHandlerConfig) => (_dodopayments: DodoP
|
|
|
651
686
|
}, WebhookResponse>;
|
|
652
687
|
};
|
|
653
688
|
|
|
689
|
+
declare const usage: () => (options: DodoPaymentsOptions) => {
|
|
690
|
+
dodoUsageIngest: better_auth.StrictEndpoint<"/dodopayments/usage/ingest", {
|
|
691
|
+
method: "POST";
|
|
692
|
+
body: z.ZodObject<{
|
|
693
|
+
event_id: z.ZodString;
|
|
694
|
+
event_name: z.ZodString;
|
|
695
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
|
|
696
|
+
timestamp: z.ZodOptional<z.ZodEffects<z.ZodDate, string, Date>>;
|
|
697
|
+
}, "strip", z.ZodTypeAny, {
|
|
698
|
+
event_id: string;
|
|
699
|
+
event_name: string;
|
|
700
|
+
metadata?: Record<string, string | number | boolean> | null | undefined;
|
|
701
|
+
timestamp?: string | undefined;
|
|
702
|
+
}, {
|
|
703
|
+
event_id: string;
|
|
704
|
+
event_name: string;
|
|
705
|
+
metadata?: Record<string, string | number | boolean> | null | undefined;
|
|
706
|
+
timestamp?: Date | undefined;
|
|
707
|
+
}>;
|
|
708
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
709
|
+
session: {
|
|
710
|
+
session: Record<string, any> & {
|
|
711
|
+
id: string;
|
|
712
|
+
createdAt: Date;
|
|
713
|
+
updatedAt: Date;
|
|
714
|
+
userId: string;
|
|
715
|
+
expiresAt: Date;
|
|
716
|
+
token: string;
|
|
717
|
+
ipAddress?: string | null | undefined;
|
|
718
|
+
userAgent?: string | null | undefined;
|
|
719
|
+
};
|
|
720
|
+
user: Record<string, any> & {
|
|
721
|
+
id: string;
|
|
722
|
+
createdAt: Date;
|
|
723
|
+
updatedAt: Date;
|
|
724
|
+
email: string;
|
|
725
|
+
emailVerified: boolean;
|
|
726
|
+
name: string;
|
|
727
|
+
image?: string | null | undefined;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
}>)[];
|
|
731
|
+
} & {
|
|
732
|
+
use: any[];
|
|
733
|
+
}, {
|
|
734
|
+
ingested_count: number;
|
|
735
|
+
}>;
|
|
736
|
+
dodoUsageMetersList: better_auth.StrictEndpoint<"/dodopayments/usage/meters/list", {
|
|
737
|
+
method: "GET";
|
|
738
|
+
query: z.ZodOptional<z.ZodObject<{
|
|
739
|
+
page_number: z.ZodOptional<z.ZodNumber>;
|
|
740
|
+
page_size: z.ZodOptional<z.ZodNumber>;
|
|
741
|
+
event_name: z.ZodOptional<z.ZodString>;
|
|
742
|
+
meter_id: z.ZodOptional<z.ZodString>;
|
|
743
|
+
start: z.ZodOptional<z.ZodString>;
|
|
744
|
+
end: z.ZodOptional<z.ZodString>;
|
|
745
|
+
}, "strip", z.ZodTypeAny, {
|
|
746
|
+
event_name?: string | undefined;
|
|
747
|
+
page_number?: number | undefined;
|
|
748
|
+
page_size?: number | undefined;
|
|
749
|
+
meter_id?: string | undefined;
|
|
750
|
+
start?: string | undefined;
|
|
751
|
+
end?: string | undefined;
|
|
752
|
+
}, {
|
|
753
|
+
event_name?: string | undefined;
|
|
754
|
+
page_number?: number | undefined;
|
|
755
|
+
page_size?: number | undefined;
|
|
756
|
+
meter_id?: string | undefined;
|
|
757
|
+
start?: string | undefined;
|
|
758
|
+
end?: string | undefined;
|
|
759
|
+
}>>;
|
|
760
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
761
|
+
session: {
|
|
762
|
+
session: Record<string, any> & {
|
|
763
|
+
id: string;
|
|
764
|
+
createdAt: Date;
|
|
765
|
+
updatedAt: Date;
|
|
766
|
+
userId: string;
|
|
767
|
+
expiresAt: Date;
|
|
768
|
+
token: string;
|
|
769
|
+
ipAddress?: string | null | undefined;
|
|
770
|
+
userAgent?: string | null | undefined;
|
|
771
|
+
};
|
|
772
|
+
user: Record<string, any> & {
|
|
773
|
+
id: string;
|
|
774
|
+
createdAt: Date;
|
|
775
|
+
updatedAt: Date;
|
|
776
|
+
email: string;
|
|
777
|
+
emailVerified: boolean;
|
|
778
|
+
name: string;
|
|
779
|
+
image?: string | null | undefined;
|
|
780
|
+
};
|
|
781
|
+
};
|
|
782
|
+
}>)[];
|
|
783
|
+
} & {
|
|
784
|
+
use: any[];
|
|
785
|
+
}, {
|
|
786
|
+
items: Event[];
|
|
787
|
+
}>;
|
|
788
|
+
};
|
|
789
|
+
|
|
654
790
|
type Product = {
|
|
655
791
|
/**
|
|
656
792
|
* Product Id from DodoPayments Product
|
|
@@ -668,7 +804,7 @@ interface DodoPaymentsOptions {
|
|
|
668
804
|
/**
|
|
669
805
|
* DodoPayments Client
|
|
670
806
|
*/
|
|
671
|
-
client: DodoPayments
|
|
807
|
+
client: DodoPayments;
|
|
672
808
|
/**
|
|
673
809
|
* Enable customer creation when a user signs up
|
|
674
810
|
*/
|
|
@@ -689,8 +825,8 @@ interface DodoPaymentsOptions {
|
|
|
689
825
|
phone_number?: string | null;
|
|
690
826
|
}>;
|
|
691
827
|
}
|
|
692
|
-
type PaymentsList = Awaited<ReturnType<DodoPayments
|
|
693
|
-
type SubscriptionsList = Awaited<ReturnType<DodoPayments
|
|
828
|
+
type PaymentsList = Awaited<ReturnType<DodoPayments["payments"]["list"]>>;
|
|
829
|
+
type SubscriptionsList = Awaited<ReturnType<DodoPayments["subscriptions"]["list"]>>;
|
|
694
830
|
type PaymentItems = {
|
|
695
831
|
items: PaymentsList["items"];
|
|
696
832
|
};
|
|
@@ -709,4 +845,4 @@ type WebhookResponse = {
|
|
|
709
845
|
received: boolean;
|
|
710
846
|
};
|
|
711
847
|
|
|
712
|
-
export { type CreateCheckoutResponse as C, type DodoPaymentsOptions as D, type PaymentItems as P, type SubscriptionItems as S, type WebhookResponse as W, type CustomerPortalResponse as a, type Product as b, type DodoPaymentsPlugin as c, type DodoPaymentsPlugins as d, type DodoPaymentsEndpoints as e, checkout as f, type CheckoutOptions as g, portal as p, webhooks as w };
|
|
848
|
+
export { type CreateCheckoutResponse as C, type DodoPaymentsOptions as D, type PaymentItems as P, type SubscriptionItems as S, type WebhookResponse as W, type CustomerPortalResponse as a, type Product as b, type DodoPaymentsPlugin as c, type DodoPaymentsPlugins as d, type DodoPaymentsEndpoints as e, checkout as f, type CheckoutOptions as g, portal as p, usage as u, webhooks as w };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DodoPayments } from 'dodopayments';
|
|
2
2
|
import * as better_auth from 'better-auth';
|
|
3
3
|
import { User, UnionToIntersection } from 'better-auth';
|
|
4
4
|
import { z } from 'zod/v3';
|
|
5
5
|
import { WebhookHandlerConfig } from '@dodopayments/core/webhook';
|
|
6
|
-
import {
|
|
6
|
+
import { Event } from 'dodopayments/resources/usage-events.mjs';
|
|
7
7
|
|
|
8
8
|
interface CheckoutOptions {
|
|
9
9
|
/**
|
|
@@ -19,7 +19,7 @@ interface CheckoutOptions {
|
|
|
19
19
|
*/
|
|
20
20
|
authenticatedUsersOnly?: boolean;
|
|
21
21
|
}
|
|
22
|
-
declare const checkout: (checkoutOptions?: CheckoutOptions) => (
|
|
22
|
+
declare const checkout: (checkoutOptions?: CheckoutOptions) => (options: DodoPaymentsOptions) => {
|
|
23
23
|
/**
|
|
24
24
|
* @deprecated
|
|
25
25
|
*/
|
|
@@ -83,6 +83,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
83
83
|
}>, "many">>;
|
|
84
84
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
85
85
|
currency: z.ZodOptional<z.ZodString>;
|
|
86
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
87
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
86
88
|
} & {
|
|
87
89
|
slug: z.ZodOptional<z.ZodString>;
|
|
88
90
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
@@ -144,6 +146,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
144
146
|
}>, "many">>;
|
|
145
147
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
146
148
|
currency: z.ZodOptional<z.ZodString>;
|
|
149
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
150
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
147
151
|
} & {
|
|
148
152
|
slug: z.ZodOptional<z.ZodString>;
|
|
149
153
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
@@ -205,6 +209,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
205
209
|
}>, "many">>;
|
|
206
210
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
207
211
|
currency: z.ZodOptional<z.ZodString>;
|
|
212
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
213
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
208
214
|
} & {
|
|
209
215
|
slug: z.ZodOptional<z.ZodString>;
|
|
210
216
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
@@ -230,6 +236,16 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
230
236
|
addon_id: string;
|
|
231
237
|
}>, "many">>;
|
|
232
238
|
amount: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
credit_entitlements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
|
+
credit_entitlement_id: z.ZodString;
|
|
241
|
+
credits_amount: z.ZodString;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
credit_entitlement_id: string;
|
|
244
|
+
credits_amount: string;
|
|
245
|
+
}, {
|
|
246
|
+
credit_entitlement_id: string;
|
|
247
|
+
credits_amount: string;
|
|
248
|
+
}>, "many">>;
|
|
233
249
|
}, "strip", z.ZodTypeAny, {
|
|
234
250
|
quantity: number;
|
|
235
251
|
product_id: string;
|
|
@@ -238,6 +254,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
238
254
|
addon_id: string;
|
|
239
255
|
}[] | undefined;
|
|
240
256
|
amount?: number | undefined;
|
|
257
|
+
credit_entitlements?: {
|
|
258
|
+
credit_entitlement_id: string;
|
|
259
|
+
credits_amount: string;
|
|
260
|
+
}[] | undefined;
|
|
241
261
|
}, {
|
|
242
262
|
quantity: number;
|
|
243
263
|
product_id: string;
|
|
@@ -246,6 +266,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
246
266
|
addon_id: string;
|
|
247
267
|
}[] | undefined;
|
|
248
268
|
amount?: number | undefined;
|
|
269
|
+
credit_entitlements?: {
|
|
270
|
+
credit_entitlement_id: string;
|
|
271
|
+
credits_amount: string;
|
|
272
|
+
}[] | undefined;
|
|
249
273
|
}>, "many">>;
|
|
250
274
|
customer: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
251
275
|
email: z.ZodString;
|
|
@@ -267,6 +291,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
267
291
|
customer_id: string;
|
|
268
292
|
}>]>>;
|
|
269
293
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
294
|
+
discount_code: z.ZodOptional<z.ZodString>;
|
|
295
|
+
discount_codes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
270
296
|
slug: z.ZodOptional<z.ZodString>;
|
|
271
297
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
272
298
|
billing_address: z.ZodOptional<z.ZodObject<{
|
|
@@ -293,7 +319,6 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
293
319
|
billing_currency: z.ZodOptional<z.ZodString>;
|
|
294
320
|
show_saved_payment_methods: z.ZodOptional<z.ZodBoolean>;
|
|
295
321
|
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
296
|
-
discount_code: z.ZodOptional<z.ZodString>;
|
|
297
322
|
customization: z.ZodOptional<z.ZodObject<{
|
|
298
323
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark", "system"]>>;
|
|
299
324
|
show_order_details: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -400,6 +425,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
400
425
|
addon_id: string;
|
|
401
426
|
}[] | undefined;
|
|
402
427
|
amount?: number | undefined;
|
|
428
|
+
credit_entitlements?: {
|
|
429
|
+
credit_entitlement_id: string;
|
|
430
|
+
credits_amount: string;
|
|
431
|
+
}[] | undefined;
|
|
403
432
|
}[] | undefined;
|
|
404
433
|
customer?: {
|
|
405
434
|
email: string;
|
|
@@ -409,6 +438,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
409
438
|
customer_id: string;
|
|
410
439
|
} | undefined;
|
|
411
440
|
metadata?: Record<string, string> | undefined;
|
|
441
|
+
discount_code?: string | undefined;
|
|
442
|
+
discount_codes?: string[] | undefined;
|
|
412
443
|
slug?: string | undefined;
|
|
413
444
|
referenceId?: string | undefined;
|
|
414
445
|
billing_address?: {
|
|
@@ -423,7 +454,6 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
423
454
|
billing_currency?: string | undefined;
|
|
424
455
|
show_saved_payment_methods?: boolean | undefined;
|
|
425
456
|
confirm?: boolean | undefined;
|
|
426
|
-
discount_code?: string | undefined;
|
|
427
457
|
customization?: {
|
|
428
458
|
theme?: "light" | "dark" | "system" | undefined;
|
|
429
459
|
show_order_details?: boolean | undefined;
|
|
@@ -464,6 +494,10 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
464
494
|
addon_id: string;
|
|
465
495
|
}[] | undefined;
|
|
466
496
|
amount?: number | undefined;
|
|
497
|
+
credit_entitlements?: {
|
|
498
|
+
credit_entitlement_id: string;
|
|
499
|
+
credits_amount: string;
|
|
500
|
+
}[] | undefined;
|
|
467
501
|
}[] | undefined;
|
|
468
502
|
customer?: {
|
|
469
503
|
email: string;
|
|
@@ -473,6 +507,8 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
473
507
|
customer_id: string;
|
|
474
508
|
} | undefined;
|
|
475
509
|
metadata?: Record<string, string> | undefined;
|
|
510
|
+
discount_code?: string | undefined;
|
|
511
|
+
discount_codes?: string[] | undefined;
|
|
476
512
|
slug?: string | undefined;
|
|
477
513
|
referenceId?: string | undefined;
|
|
478
514
|
billing_address?: {
|
|
@@ -487,7 +523,6 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
487
523
|
billing_currency?: string | undefined;
|
|
488
524
|
show_saved_payment_methods?: boolean | undefined;
|
|
489
525
|
confirm?: boolean | undefined;
|
|
490
|
-
discount_code?: string | undefined;
|
|
491
526
|
customization?: {
|
|
492
527
|
theme?: "light" | "dark" | "system" | undefined;
|
|
493
528
|
show_order_details?: boolean | undefined;
|
|
@@ -526,7 +561,7 @@ declare const checkout: (checkoutOptions?: CheckoutOptions) => (dodopayments: Do
|
|
|
526
561
|
}, CreateCheckoutResponse>;
|
|
527
562
|
};
|
|
528
563
|
|
|
529
|
-
declare const portal: () => (
|
|
564
|
+
declare const portal: () => (options: DodoPaymentsOptions) => {
|
|
530
565
|
dodoPortal: better_auth.StrictEndpoint<"/dodopayments/customer/portal", {
|
|
531
566
|
method: "GET";
|
|
532
567
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
@@ -639,7 +674,7 @@ declare const portal: () => (dodopayments: DodoPayments$1) => {
|
|
|
639
674
|
}, PaymentItems>;
|
|
640
675
|
};
|
|
641
676
|
|
|
642
|
-
declare const webhooks: (
|
|
677
|
+
declare const webhooks: (webhookOptions: WebhookHandlerConfig) => (_options: DodoPaymentsOptions) => {
|
|
643
678
|
dodopaymentsWebhooks: better_auth.StrictEndpoint<"/dodopayments/webhooks", {
|
|
644
679
|
method: "POST";
|
|
645
680
|
metadata: {
|
|
@@ -651,6 +686,107 @@ declare const webhooks: (options: WebhookHandlerConfig) => (_dodopayments: DodoP
|
|
|
651
686
|
}, WebhookResponse>;
|
|
652
687
|
};
|
|
653
688
|
|
|
689
|
+
declare const usage: () => (options: DodoPaymentsOptions) => {
|
|
690
|
+
dodoUsageIngest: better_auth.StrictEndpoint<"/dodopayments/usage/ingest", {
|
|
691
|
+
method: "POST";
|
|
692
|
+
body: z.ZodObject<{
|
|
693
|
+
event_id: z.ZodString;
|
|
694
|
+
event_name: z.ZodString;
|
|
695
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
|
|
696
|
+
timestamp: z.ZodOptional<z.ZodEffects<z.ZodDate, string, Date>>;
|
|
697
|
+
}, "strip", z.ZodTypeAny, {
|
|
698
|
+
event_id: string;
|
|
699
|
+
event_name: string;
|
|
700
|
+
metadata?: Record<string, string | number | boolean> | null | undefined;
|
|
701
|
+
timestamp?: string | undefined;
|
|
702
|
+
}, {
|
|
703
|
+
event_id: string;
|
|
704
|
+
event_name: string;
|
|
705
|
+
metadata?: Record<string, string | number | boolean> | null | undefined;
|
|
706
|
+
timestamp?: Date | undefined;
|
|
707
|
+
}>;
|
|
708
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
709
|
+
session: {
|
|
710
|
+
session: Record<string, any> & {
|
|
711
|
+
id: string;
|
|
712
|
+
createdAt: Date;
|
|
713
|
+
updatedAt: Date;
|
|
714
|
+
userId: string;
|
|
715
|
+
expiresAt: Date;
|
|
716
|
+
token: string;
|
|
717
|
+
ipAddress?: string | null | undefined;
|
|
718
|
+
userAgent?: string | null | undefined;
|
|
719
|
+
};
|
|
720
|
+
user: Record<string, any> & {
|
|
721
|
+
id: string;
|
|
722
|
+
createdAt: Date;
|
|
723
|
+
updatedAt: Date;
|
|
724
|
+
email: string;
|
|
725
|
+
emailVerified: boolean;
|
|
726
|
+
name: string;
|
|
727
|
+
image?: string | null | undefined;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
}>)[];
|
|
731
|
+
} & {
|
|
732
|
+
use: any[];
|
|
733
|
+
}, {
|
|
734
|
+
ingested_count: number;
|
|
735
|
+
}>;
|
|
736
|
+
dodoUsageMetersList: better_auth.StrictEndpoint<"/dodopayments/usage/meters/list", {
|
|
737
|
+
method: "GET";
|
|
738
|
+
query: z.ZodOptional<z.ZodObject<{
|
|
739
|
+
page_number: z.ZodOptional<z.ZodNumber>;
|
|
740
|
+
page_size: z.ZodOptional<z.ZodNumber>;
|
|
741
|
+
event_name: z.ZodOptional<z.ZodString>;
|
|
742
|
+
meter_id: z.ZodOptional<z.ZodString>;
|
|
743
|
+
start: z.ZodOptional<z.ZodString>;
|
|
744
|
+
end: z.ZodOptional<z.ZodString>;
|
|
745
|
+
}, "strip", z.ZodTypeAny, {
|
|
746
|
+
event_name?: string | undefined;
|
|
747
|
+
page_number?: number | undefined;
|
|
748
|
+
page_size?: number | undefined;
|
|
749
|
+
meter_id?: string | undefined;
|
|
750
|
+
start?: string | undefined;
|
|
751
|
+
end?: string | undefined;
|
|
752
|
+
}, {
|
|
753
|
+
event_name?: string | undefined;
|
|
754
|
+
page_number?: number | undefined;
|
|
755
|
+
page_size?: number | undefined;
|
|
756
|
+
meter_id?: string | undefined;
|
|
757
|
+
start?: string | undefined;
|
|
758
|
+
end?: string | undefined;
|
|
759
|
+
}>>;
|
|
760
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
761
|
+
session: {
|
|
762
|
+
session: Record<string, any> & {
|
|
763
|
+
id: string;
|
|
764
|
+
createdAt: Date;
|
|
765
|
+
updatedAt: Date;
|
|
766
|
+
userId: string;
|
|
767
|
+
expiresAt: Date;
|
|
768
|
+
token: string;
|
|
769
|
+
ipAddress?: string | null | undefined;
|
|
770
|
+
userAgent?: string | null | undefined;
|
|
771
|
+
};
|
|
772
|
+
user: Record<string, any> & {
|
|
773
|
+
id: string;
|
|
774
|
+
createdAt: Date;
|
|
775
|
+
updatedAt: Date;
|
|
776
|
+
email: string;
|
|
777
|
+
emailVerified: boolean;
|
|
778
|
+
name: string;
|
|
779
|
+
image?: string | null | undefined;
|
|
780
|
+
};
|
|
781
|
+
};
|
|
782
|
+
}>)[];
|
|
783
|
+
} & {
|
|
784
|
+
use: any[];
|
|
785
|
+
}, {
|
|
786
|
+
items: Event[];
|
|
787
|
+
}>;
|
|
788
|
+
};
|
|
789
|
+
|
|
654
790
|
type Product = {
|
|
655
791
|
/**
|
|
656
792
|
* Product Id from DodoPayments Product
|
|
@@ -668,7 +804,7 @@ interface DodoPaymentsOptions {
|
|
|
668
804
|
/**
|
|
669
805
|
* DodoPayments Client
|
|
670
806
|
*/
|
|
671
|
-
client: DodoPayments
|
|
807
|
+
client: DodoPayments;
|
|
672
808
|
/**
|
|
673
809
|
* Enable customer creation when a user signs up
|
|
674
810
|
*/
|
|
@@ -689,8 +825,8 @@ interface DodoPaymentsOptions {
|
|
|
689
825
|
phone_number?: string | null;
|
|
690
826
|
}>;
|
|
691
827
|
}
|
|
692
|
-
type PaymentsList = Awaited<ReturnType<DodoPayments
|
|
693
|
-
type SubscriptionsList = Awaited<ReturnType<DodoPayments
|
|
828
|
+
type PaymentsList = Awaited<ReturnType<DodoPayments["payments"]["list"]>>;
|
|
829
|
+
type SubscriptionsList = Awaited<ReturnType<DodoPayments["subscriptions"]["list"]>>;
|
|
694
830
|
type PaymentItems = {
|
|
695
831
|
items: PaymentsList["items"];
|
|
696
832
|
};
|
|
@@ -709,4 +845,4 @@ type WebhookResponse = {
|
|
|
709
845
|
received: boolean;
|
|
710
846
|
};
|
|
711
847
|
|
|
712
|
-
export { type CreateCheckoutResponse as C, type DodoPaymentsOptions as D, type PaymentItems as P, type SubscriptionItems as S, type WebhookResponse as W, type CustomerPortalResponse as a, type Product as b, type DodoPaymentsPlugin as c, type DodoPaymentsPlugins as d, type DodoPaymentsEndpoints as e, checkout as f, type CheckoutOptions as g, portal as p, webhooks as w };
|
|
848
|
+
export { type CreateCheckoutResponse as C, type DodoPaymentsOptions as D, type PaymentItems as P, type SubscriptionItems as S, type WebhookResponse as W, type CustomerPortalResponse as a, type Product as b, type DodoPaymentsPlugin as c, type DodoPaymentsPlugins as d, type DodoPaymentsEndpoints as e, checkout as f, type CheckoutOptions as g, portal as p, usage as u, webhooks as w };
|