@dodopayments/better-auth 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/chunk-CRRND2EH.js +67 -0
  2. package/dist/chunk-CRRND2EH.js.map +1 -0
  3. package/dist/chunk-HHIXOUFD.js +80 -0
  4. package/dist/chunk-HHIXOUFD.js.map +1 -0
  5. package/dist/chunk-J55PDPLE.js +196 -0
  6. package/dist/chunk-J55PDPLE.js.map +1 -0
  7. package/dist/chunk-O3BTJOIO.js +177 -0
  8. package/dist/chunk-O3BTJOIO.js.map +1 -0
  9. package/dist/chunk-PXI4EHZC.js +12 -0
  10. package/dist/chunk-PXI4EHZC.js.map +1 -0
  11. package/dist/client.cjs +36 -0
  12. package/dist/client.cjs.map +1 -0
  13. package/dist/client.d.cts +7 -0
  14. package/dist/client.d.ts +7 -5
  15. package/dist/client.js +6 -5
  16. package/dist/client.js.map +1 -0
  17. package/dist/hooks/customer.cjs +92 -0
  18. package/dist/hooks/customer.cjs.map +1 -0
  19. package/dist/hooks/customer.d.cts +11 -0
  20. package/dist/hooks/customer.d.ts +11 -4
  21. package/dist/hooks/customer.js +8 -62
  22. package/dist/hooks/customer.js.map +1 -0
  23. package/dist/index.cjs +573 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.d.cts +909 -0
  26. package/dist/index.d.ts +321 -200
  27. package/dist/index.js +53 -34
  28. package/dist/index.js.map +1 -0
  29. package/dist/plugins/checkout.cjs +197 -0
  30. package/dist/plugins/checkout.cjs.map +1 -0
  31. package/dist/plugins/checkout.d.cts +6 -0
  32. package/dist/plugins/checkout.d.ts +6 -548
  33. package/dist/plugins/checkout.js +6 -170
  34. package/dist/plugins/checkout.js.map +1 -0
  35. package/dist/plugins/portal.cjs +220 -0
  36. package/dist/plugins/portal.cjs.map +1 -0
  37. package/dist/plugins/portal.d.cts +6 -0
  38. package/dist/plugins/portal.d.ts +6 -204
  39. package/dist/plugins/portal.js +6 -171
  40. package/dist/plugins/portal.js.map +1 -0
  41. package/dist/plugins/webhooks.cjs +102 -0
  42. package/dist/plugins/webhooks.cjs.map +1 -0
  43. package/dist/plugins/webhooks.d.cts +6 -0
  44. package/dist/plugins/webhooks.d.ts +6 -41
  45. package/dist/plugins/webhooks.js +6 -61
  46. package/dist/plugins/webhooks.js.map +1 -0
  47. package/dist/types-yAk7fHrK.d.cts +953 -0
  48. package/dist/types-yAk7fHrK.d.ts +953 -0
  49. package/dist/types.cjs +19 -0
  50. package/dist/types.cjs.map +1 -0
  51. package/dist/types.d.cts +6 -0
  52. package/dist/types.d.ts +6 -52
  53. package/dist/types.js +1 -1
  54. package/dist/types.js.map +1 -0
  55. package/package.json +5 -10
package/dist/types.cjs ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { DodoPayments } from \"dodopayments\";\n\nimport type { UnionToIntersection } from \"better-auth\";\nimport type { checkout } from \"./plugins/checkout\";\nimport type { portal } from \"./plugins/portal\";\nimport type { webhooks } from \"./plugins/webhooks\";\n\nexport type Product = {\n /**\n * Product Id from DodoPayments Product\n */\n productId: string;\n /**\n * Easily identifiable slug for the product\n */\n slug: string;\n};\n\nexport type DodoPaymentsPlugin =\n | ReturnType<typeof checkout>\n | ReturnType<typeof portal>\n | ReturnType<typeof webhooks>;\n\nexport type DodoPaymentsPlugins = [DodoPaymentsPlugin, ...DodoPaymentsPlugin[]];\n\nexport type DodoPaymentsEndpoints = UnionToIntersection<\n ReturnType<DodoPaymentsPlugin>\n>;\n\nexport interface DodoPaymentsOptions {\n /**\n * DodoPayments Client\n */\n client: DodoPayments;\n /**\n * Enable customer creation when a user signs up\n */\n createCustomerOnSignUp?: boolean;\n /**\n * Use DodoPayments plugins\n */\n use: DodoPaymentsPlugins;\n}\n\ntype PaymentsList = Awaited<ReturnType<DodoPayments[\"payments\"][\"list\"]>>;\ntype SubscriptionsList = Awaited<\n ReturnType<DodoPayments[\"subscriptions\"][\"list\"]>\n>;\nexport type PaymentItems = { items: PaymentsList[\"items\"] };\nexport type SubscriptionItems = { items: SubscriptionsList[\"items\"] };\nexport type CustomerPortalResponse = { url: string; redirect: boolean };\nexport type CreateCheckoutResponse = { url: string; redirect: boolean };\nexport type WebhookResponse = { received: boolean };\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,6 @@
1
+ import 'dodopayments';
2
+ import 'better-auth';
3
+ export { C as CreateCheckoutResponse, a as CustomerPortalResponse, e as DodoPaymentsEndpoints, D as DodoPaymentsOptions, c as DodoPaymentsPlugin, d as DodoPaymentsPlugins, P as PaymentItems, b as Product, S as SubscriptionItems, W as WebhookResponse } from './types-yAk7fHrK.cjs';
4
+ import 'better-call';
5
+ import 'zod/v3';
6
+ import '@dodopayments/core/webhook';
package/dist/types.d.ts CHANGED
@@ -1,52 +1,6 @@
1
- import type { DodoPayments } from "dodopayments";
2
- import type { UnionToIntersection } from "better-auth";
3
- import type { checkout } from "./plugins/checkout";
4
- import type { portal } from "./plugins/portal";
5
- import type { webhooks } from "./plugins/webhooks";
6
- export type Product = {
7
- /**
8
- * Product Id from DodoPayments Product
9
- */
10
- productId: string;
11
- /**
12
- * Easily identifiable slug for the product
13
- */
14
- slug: string;
15
- };
16
- export type DodoPaymentsPlugin = ReturnType<typeof checkout> | ReturnType<typeof portal> | ReturnType<typeof webhooks>;
17
- export type DodoPaymentsPlugins = [DodoPaymentsPlugin, ...DodoPaymentsPlugin[]];
18
- export type DodoPaymentsEndpoints = UnionToIntersection<ReturnType<DodoPaymentsPlugin>>;
19
- export interface DodoPaymentsOptions {
20
- /**
21
- * DodoPayments Client
22
- */
23
- client: DodoPayments;
24
- /**
25
- * Enable customer creation when a user signs up
26
- */
27
- createCustomerOnSignUp?: boolean;
28
- /**
29
- * Use DodoPayments plugins
30
- */
31
- use: DodoPaymentsPlugins;
32
- }
33
- type PaymentsList = Awaited<ReturnType<DodoPayments["payments"]["list"]>>;
34
- type SubscriptionsList = Awaited<ReturnType<DodoPayments["subscriptions"]["list"]>>;
35
- export type PaymentItems = {
36
- items: PaymentsList["items"];
37
- };
38
- export type SubscriptionItems = {
39
- items: SubscriptionsList["items"];
40
- };
41
- export type CustomerPortalResponse = {
42
- url: string;
43
- redirect: boolean;
44
- };
45
- export type CreateCheckoutResponse = {
46
- url: string;
47
- redirect: boolean;
48
- };
49
- export type WebhookResponse = {
50
- received: boolean;
51
- };
52
- export {};
1
+ import 'dodopayments';
2
+ import 'better-auth';
3
+ export { C as CreateCheckoutResponse, a as CustomerPortalResponse, e as DodoPaymentsEndpoints, D as DodoPaymentsOptions, c as DodoPaymentsPlugin, d as DodoPaymentsPlugins, P as PaymentItems, b as Product, S as SubscriptionItems, W as WebhookResponse } from './types-yAk7fHrK.js';
4
+ import 'better-call';
5
+ import 'zod/v3';
6
+ import '@dodopayments/core/webhook';
package/dist/types.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dodopayments/better-auth",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "scripts": {
8
- "build": "tsc",
9
- "dev": "rollup -c -w",
8
+ "build": "tsup --config tsup.config.ts",
9
+ "dev": "npm run build -- --watch",
10
10
  "check-types": "tsc --noEmit"
11
11
  },
12
12
  "exports": {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "types": "./dist/index.d.ts",
20
20
  "dependencies": {
21
- "@dodopayments/core": "^0.3.2"
21
+ "@dodopayments/core": "^0.3.4"
22
22
  },
23
23
  "engines": {
24
24
  "node": ">=16.0.0"
@@ -39,12 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@dodo/typescript-config": "*",
42
- "@rollup/plugin-commonjs": "^25.0.0",
43
- "@rollup/plugin-node-resolve": "^15.0.0",
44
- "@rollup/plugin-typescript": "^11.0.0",
45
- "rimraf": "^5.0.0",
46
- "rollup": "^4.0.0",
47
- "rollup-plugin-dts": "^6.1.0"
42
+ "rimraf": "^5.0.0"
48
43
  },
49
44
  "peerDependencies": {
50
45
  "zod": "^3.25.0 || ^4.0.0"