autumn-js 1.2.27 → 1.2.28

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 (125) hide show
  1. package/dist/backend/adapters/express.js +4292 -3538
  2. package/dist/backend/adapters/express.mjs +9 -9
  3. package/dist/backend/adapters/fetch.js +4292 -3538
  4. package/dist/backend/adapters/fetch.mjs +9 -9
  5. package/dist/backend/adapters/hono.js +4292 -3538
  6. package/dist/backend/adapters/hono.mjs +9 -9
  7. package/dist/backend/adapters/index.js +4292 -3538
  8. package/dist/backend/adapters/index.mjs +12 -12
  9. package/dist/backend/adapters/next.js +4292 -3538
  10. package/dist/backend/adapters/next.mjs +9 -9
  11. package/dist/backend/{chunk-DBMOXEHI.mjs → chunk-66OVIMBS.mjs} +5 -5
  12. package/dist/backend/{chunk-QMO6VPQ3.mjs → chunk-GTZJYVV6.mjs} +4244 -3520
  13. package/dist/backend/chunk-I7CD6EB6.mjs +28 -0
  14. package/dist/backend/{chunk-55C2WWXQ.mjs → chunk-IXUCY7AU.mjs} +7 -6
  15. package/dist/backend/{chunk-R6QKB5RX.mjs → chunk-JNHJR2RN.mjs} +1 -1
  16. package/dist/backend/{chunk-QOX2POZP.mjs → chunk-N5DL6VA7.mjs} +1 -1
  17. package/dist/backend/{chunk-LTHZJCGX.mjs → chunk-PG3VMMBU.mjs} +1 -1
  18. package/dist/backend/{chunk-65JYBYIK.mjs → chunk-RBV55GF7.mjs} +7 -7
  19. package/dist/backend/{chunk-MAU6WWTL.mjs → chunk-W6NPZLA5.mjs} +40 -14
  20. package/dist/backend/{chunk-LFEAY3XJ.mjs → chunk-WK4VK7MP.mjs} +1 -1
  21. package/dist/backend/core/handlers/coreHandler.d.mts +2 -1
  22. package/dist/backend/core/handlers/coreHandler.d.ts +2 -1
  23. package/dist/backend/core/handlers/coreHandler.js +4292 -3538
  24. package/dist/backend/core/handlers/coreHandler.mjs +7 -7
  25. package/dist/backend/core/handlers/executeRoute.d.mts +2 -1
  26. package/dist/backend/core/handlers/executeRoute.d.ts +2 -1
  27. package/dist/backend/core/handlers/executeRoute.js +12 -7
  28. package/dist/backend/core/handlers/executeRoute.mjs +4 -4
  29. package/dist/backend/core/handlers/handleRouteByName.js +4292 -3538
  30. package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
  31. package/dist/backend/core/handlers/index.d.mts +2 -1
  32. package/dist/backend/core/handlers/index.d.ts +2 -1
  33. package/dist/backend/core/handlers/index.js +4292 -3538
  34. package/dist/backend/core/handlers/index.mjs +10 -10
  35. package/dist/backend/core/index.d.mts +1 -1
  36. package/dist/backend/core/index.d.ts +1 -1
  37. package/dist/backend/core/index.js +4292 -3538
  38. package/dist/backend/core/index.mjs +10 -10
  39. package/dist/backend/core/routes/index.d.mts +2 -1
  40. package/dist/backend/core/routes/index.d.ts +2 -1
  41. package/dist/backend/core/routes/index.js +46 -17
  42. package/dist/backend/core/routes/index.mjs +2 -2
  43. package/dist/backend/core/routes/routeBuilder.d.mts +2 -1
  44. package/dist/backend/core/routes/routeBuilder.d.ts +2 -1
  45. package/dist/backend/core/routes/routeConfigs.d.mts +2 -1
  46. package/dist/backend/core/routes/routeConfigs.d.ts +2 -1
  47. package/dist/backend/core/routes/routeConfigs.js +46 -17
  48. package/dist/backend/core/routes/routeConfigs.mjs +2 -2
  49. package/dist/backend/core/types/handlerTypes.d.mts +2 -1
  50. package/dist/backend/core/types/handlerTypes.d.ts +2 -1
  51. package/dist/backend/core/types/index.d.mts +2 -1
  52. package/dist/backend/core/types/index.d.ts +2 -1
  53. package/dist/backend/core/types/routeTypes.d.mts +2 -1
  54. package/dist/backend/core/types/routeTypes.d.ts +2 -1
  55. package/dist/backend/core/utils/index.d.mts +1 -1
  56. package/dist/backend/core/utils/index.d.ts +1 -1
  57. package/dist/backend/core/utils/index.js +12 -4
  58. package/dist/backend/core/utils/index.mjs +7 -3
  59. package/dist/backend/core/utils/sanitizeBody.d.mts +6 -2
  60. package/dist/backend/core/utils/sanitizeBody.d.ts +6 -2
  61. package/dist/backend/core/utils/sanitizeBody.js +12 -4
  62. package/dist/backend/core/utils/sanitizeBody.mjs +5 -1
  63. package/dist/backend/index.d.mts +2 -2
  64. package/dist/backend/index.d.ts +2 -2
  65. package/dist/backend/index.js +4292 -3538
  66. package/dist/backend/index.mjs +10 -10
  67. package/dist/backend/{routeTypes-CJUeRXwp.d.mts → routeTypes-924R85Bn.d.mts} +550 -13
  68. package/dist/backend/{routeTypes-Dt3mcOiI.d.ts → routeTypes-Db2ZFQC4.d.ts} +550 -13
  69. package/dist/better-auth/{chunk-SJGCFMIB.mjs → chunk-4ZDXHHF4.mjs} +4249 -3524
  70. package/dist/better-auth/{chunk-RHJSAAZY.mjs → chunk-NKH2QR2X.mjs} +46 -17
  71. package/dist/better-auth/{chunk-3TLQJLI4.mjs → chunk-ONM42KFR.mjs} +1 -1
  72. package/dist/better-auth/index.js +4290 -3536
  73. package/dist/better-auth/index.mjs +3 -3
  74. package/dist/better-auth/utils/createAutumnEndpoint.js +46 -17
  75. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  76. package/dist/better-auth/utils/handleBetterAuthRoute.js +4292 -3538
  77. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  78. package/dist/better-auth/utils/index.js +4290 -3536
  79. package/dist/better-auth/utils/index.mjs +3 -3
  80. package/dist/react/AutumnContext.d.mts +2 -2
  81. package/dist/react/AutumnContext.d.ts +2 -2
  82. package/dist/react/client/AutumnClient.d.mts +2 -2
  83. package/dist/react/client/AutumnClient.d.ts +2 -2
  84. package/dist/react/client/IAutumnClient.d.mts +2 -2
  85. package/dist/react/client/IAutumnClient.d.ts +2 -2
  86. package/dist/react/client/index.d.mts +2 -2
  87. package/dist/react/client/index.d.ts +2 -2
  88. package/dist/react/{customer-BR2cYBBM.d.mts → customer-DPMyc3yN.d.mts} +30 -0
  89. package/dist/react/{customer-BI_KaaNd.d.ts → customer-Dr6WZsA2.d.ts} +30 -0
  90. package/dist/react/hooks/index.d.mts +2 -2
  91. package/dist/react/hooks/index.d.ts +2 -2
  92. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +1 -1
  93. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +1 -1
  94. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +1 -1
  95. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +1 -1
  96. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +1 -1
  97. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +1 -1
  98. package/dist/react/hooks/internal/check/getCreditCost.d.mts +1 -1
  99. package/dist/react/hooks/internal/check/getCreditCost.d.ts +1 -1
  100. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +2 -2
  101. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +2 -2
  102. package/dist/react/hooks/internal/useCustomerActions.d.mts +2 -2
  103. package/dist/react/hooks/internal/useCustomerActions.d.ts +2 -2
  104. package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
  105. package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
  106. package/dist/react/hooks/useCustomer.d.mts +2 -2
  107. package/dist/react/hooks/useCustomer.d.ts +2 -2
  108. package/dist/react/hooks/useEntity.d.mts +1 -1
  109. package/dist/react/hooks/useEntity.d.ts +1 -1
  110. package/dist/react/hooks/useListEvents.d.mts +1 -1
  111. package/dist/react/hooks/useListEvents.d.ts +1 -1
  112. package/dist/react/hooks/useListPlans.d.mts +1 -1
  113. package/dist/react/hooks/useListPlans.d.ts +1 -1
  114. package/dist/react/hooks/useReferrals.d.mts +1 -1
  115. package/dist/react/hooks/useReferrals.d.ts +1 -1
  116. package/dist/react/index.d.mts +2 -2
  117. package/dist/react/index.d.ts +2 -2
  118. package/dist/react/{params-Bvc4DjLZ.d.mts → params-CeTb8jcT.d.mts} +87 -9
  119. package/dist/react/{params-BF_KxGYE.d.ts → params-Dl_h1rsu.d.ts} +87 -9
  120. package/dist/sdk/index.d.mts +1069 -378
  121. package/dist/sdk/index.d.ts +1069 -378
  122. package/dist/sdk/index.js +4661 -3806
  123. package/dist/sdk/index.mjs +4583 -3802
  124. package/package.json +142 -142
  125. package/dist/backend/chunk-Z6QP3YEA.mjs +0 -22
package/package.json CHANGED
@@ -1,144 +1,144 @@
1
1
  {
2
- "name": "autumn-js",
3
- "description": "Autumn JS Library",
4
- "version": "1.2.27",
5
- "repository": "github:useautumn/autumn",
6
- "homepage": "https://docs.useautumn.com",
7
- "main": "./dist/sdk/index.js",
8
- "module": "./dist/sdk/index.mjs",
9
- "types": "./dist/sdk/index.d.ts",
10
- "files": [
11
- "dist",
12
- "README.md",
13
- "LICENSE.md"
14
- ],
15
- "scripts": {
16
- "ts": "tsgo --noEmit --skipLibCheck",
17
- "build": "rm -rf dist && tsup",
18
- "prepublishOnly": "bun run build"
19
- },
20
- "exports": {
21
- ".": {
22
- "types": "./dist/sdk/index.d.ts",
23
- "require": "./dist/sdk/index.js",
24
- "import": "./dist/sdk/index.mjs"
25
- },
26
- "./react": {
27
- "types": "./dist/react/index.d.ts",
28
- "require": "./dist/react/index.js",
29
- "import": "./dist/react/index.mjs"
30
- },
31
- "./backend": {
32
- "types": "./dist/backend/index.d.ts",
33
- "require": "./dist/backend/index.js",
34
- "import": "./dist/backend/index.mjs"
35
- },
36
- "./express": {
37
- "types": "./dist/backend/adapters/express.d.ts",
38
- "require": "./dist/backend/adapters/express.js",
39
- "import": "./dist/backend/adapters/express.mjs"
40
- },
41
- "./fetch": {
42
- "types": "./dist/backend/adapters/fetch.d.ts",
43
- "require": "./dist/backend/adapters/fetch.js",
44
- "import": "./dist/backend/adapters/fetch.mjs"
45
- },
46
- "./hono": {
47
- "types": "./dist/backend/adapters/hono.d.ts",
48
- "require": "./dist/backend/adapters/hono.js",
49
- "import": "./dist/backend/adapters/hono.mjs"
50
- },
51
- "./next": {
52
- "types": "./dist/backend/adapters/next.d.ts",
53
- "require": "./dist/backend/adapters/next.js",
54
- "import": "./dist/backend/adapters/next.mjs"
55
- },
56
- "./better-auth": {
57
- "types": "./dist/better-auth/index.d.ts",
58
- "require": "./dist/better-auth/index.js",
59
- "import": "./dist/better-auth/index.mjs"
60
- }
61
- },
62
- "typesVersions": {
63
- "*": {
64
- "react": [
65
- "./dist/react/index.d.ts"
66
- ],
67
- "backend": [
68
- "./dist/backend/index.d.ts"
69
- ],
70
- "hono": [
71
- "./dist/backend/adapters/hono.d.ts"
72
- ],
73
- "next": [
74
- "./dist/backend/adapters/next.d.ts"
75
- ],
76
- "better-auth": [
77
- "./dist/better-auth/index.d.ts"
78
- ],
79
- "express": [
80
- "./dist/backend/adapters/express.d.ts"
81
- ],
82
- "fetch": [
83
- "./dist/backend/adapters/fetch.d.ts"
84
- ]
85
- }
86
- },
87
- "keywords": [
88
- "pricing",
89
- "autumn",
90
- "js-sdk"
91
- ],
92
- "author": "John Yeo",
93
- "license": "MIT",
94
- "publishConfig": {
95
- "access": "public"
96
- },
97
- "dependencies": {
98
- "query-string": "^9.2.2",
99
- "rou3": "^0.6.1",
100
- "zod": "^4.0.0"
101
- },
102
- "devDependencies": {
103
- "@tanstack/react-query": "catalog:",
104
- "@types/express": "^5.0.6",
105
- "@types/node": "^22.15.32",
106
- "@types/react": "^19",
107
- "@typescript/native-preview": "catalog:",
108
- "@useautumn/sdk": "workspace:*",
109
- "esbuild-plugin-path-alias": "^1.0.7",
110
- "hono": "^4.7.9",
111
- "next": "^15.2.3",
112
- "react-dom": "^19.1.0",
113
- "tsup": "^8.4.0",
114
- "typescript": "^5.8.3"
115
- },
116
- "peerDependencies": {
117
- "better-auth": "^1.6.0",
118
- "better-call": "^1.0.12",
119
- "express": "^5.2.1",
120
- "hono": "^4.0.0",
121
- "next": "^14.0.0 || ^15.0.0 || ^16.0.0",
122
- "react": "^18.0.0 || ^19.0.0"
123
- },
124
- "peerDependenciesMeta": {
125
- "react": {
126
- "optional": true
127
- },
128
- "better-auth": {
129
- "optional": true
130
- },
131
- "better-call": {
132
- "optional": true
133
- },
134
- "hono": {
135
- "optional": true
136
- },
137
- "next": {
138
- "optional": true
139
- },
140
- "express": {
141
- "optional": true
142
- }
143
- }
2
+ "name": "autumn-js",
3
+ "description": "Autumn JS Library",
4
+ "version": "1.2.28",
5
+ "repository": "github:useautumn/autumn",
6
+ "homepage": "https://docs.useautumn.com",
7
+ "main": "./dist/sdk/index.js",
8
+ "module": "./dist/sdk/index.mjs",
9
+ "types": "./dist/sdk/index.d.ts",
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE.md"
14
+ ],
15
+ "scripts": {
16
+ "ts": "tsgo --noEmit --skipLibCheck",
17
+ "build": "rm -rf dist && tsup",
18
+ "prepublishOnly": "bun run build"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/sdk/index.d.ts",
23
+ "require": "./dist/sdk/index.js",
24
+ "import": "./dist/sdk/index.mjs"
25
+ },
26
+ "./react": {
27
+ "types": "./dist/react/index.d.ts",
28
+ "require": "./dist/react/index.js",
29
+ "import": "./dist/react/index.mjs"
30
+ },
31
+ "./backend": {
32
+ "types": "./dist/backend/index.d.ts",
33
+ "require": "./dist/backend/index.js",
34
+ "import": "./dist/backend/index.mjs"
35
+ },
36
+ "./express": {
37
+ "types": "./dist/backend/adapters/express.d.ts",
38
+ "require": "./dist/backend/adapters/express.js",
39
+ "import": "./dist/backend/adapters/express.mjs"
40
+ },
41
+ "./fetch": {
42
+ "types": "./dist/backend/adapters/fetch.d.ts",
43
+ "require": "./dist/backend/adapters/fetch.js",
44
+ "import": "./dist/backend/adapters/fetch.mjs"
45
+ },
46
+ "./hono": {
47
+ "types": "./dist/backend/adapters/hono.d.ts",
48
+ "require": "./dist/backend/adapters/hono.js",
49
+ "import": "./dist/backend/adapters/hono.mjs"
50
+ },
51
+ "./next": {
52
+ "types": "./dist/backend/adapters/next.d.ts",
53
+ "require": "./dist/backend/adapters/next.js",
54
+ "import": "./dist/backend/adapters/next.mjs"
55
+ },
56
+ "./better-auth": {
57
+ "types": "./dist/better-auth/index.d.ts",
58
+ "require": "./dist/better-auth/index.js",
59
+ "import": "./dist/better-auth/index.mjs"
60
+ }
61
+ },
62
+ "typesVersions": {
63
+ "*": {
64
+ "react": [
65
+ "./dist/react/index.d.ts"
66
+ ],
67
+ "backend": [
68
+ "./dist/backend/index.d.ts"
69
+ ],
70
+ "hono": [
71
+ "./dist/backend/adapters/hono.d.ts"
72
+ ],
73
+ "next": [
74
+ "./dist/backend/adapters/next.d.ts"
75
+ ],
76
+ "better-auth": [
77
+ "./dist/better-auth/index.d.ts"
78
+ ],
79
+ "express": [
80
+ "./dist/backend/adapters/express.d.ts"
81
+ ],
82
+ "fetch": [
83
+ "./dist/backend/adapters/fetch.d.ts"
84
+ ]
85
+ }
86
+ },
87
+ "keywords": [
88
+ "pricing",
89
+ "autumn",
90
+ "js-sdk"
91
+ ],
92
+ "author": "John Yeo",
93
+ "license": "MIT",
94
+ "publishConfig": {
95
+ "access": "public"
96
+ },
97
+ "dependencies": {
98
+ "query-string": "^9.2.2",
99
+ "rou3": "^0.6.1",
100
+ "zod": "^4.0.0"
101
+ },
102
+ "devDependencies": {
103
+ "@tanstack/react-query": "5.85.6",
104
+ "@types/express": "^5.0.6",
105
+ "@types/node": "^22.15.32",
106
+ "@types/react": "^19",
107
+ "@typescript/native-preview": "7.0.0-dev.20260220.1",
108
+ "@useautumn/sdk": "0.10.17",
109
+ "esbuild-plugin-path-alias": "^1.0.7",
110
+ "hono": "4.12.7",
111
+ "next": "^15.2.3",
112
+ "react-dom": "^19.1.0",
113
+ "tsup": "^8.4.0",
114
+ "typescript": "^5.8.3"
115
+ },
116
+ "peerDependencies": {
117
+ "better-auth": "^1.6.0",
118
+ "better-call": "^1.0.12",
119
+ "express": "^5.2.1",
120
+ "hono": "^4.0.0",
121
+ "next": "^14.0.0 || ^15.0.0 || ^16.0.0",
122
+ "react": "^18.0.0 || ^19.0.0"
123
+ },
124
+ "peerDependenciesMeta": {
125
+ "react": {
126
+ "optional": true
127
+ },
128
+ "better-auth": {
129
+ "optional": true
130
+ },
131
+ "better-call": {
132
+ "optional": true
133
+ },
134
+ "hono": {
135
+ "optional": true
136
+ },
137
+ "next": {
138
+ "optional": true
139
+ },
140
+ "express": {
141
+ "optional": true
142
+ }
143
+ }
144
144
  }
@@ -1,22 +0,0 @@
1
- // src/backend/core/utils/sanitizeBody.ts
2
- var PROTECTED_FIELDS = [
3
- "customerId",
4
- "name",
5
- "email",
6
- "metadata",
7
- "stripeId"
8
- ];
9
- var sanitizeBody = (body) => {
10
- const rawBody = body || {};
11
- const sanitized = {};
12
- for (const [key, value] of Object.entries(rawBody)) {
13
- if (!PROTECTED_FIELDS.includes(key)) {
14
- sanitized[key] = value;
15
- }
16
- }
17
- return sanitized;
18
- };
19
-
20
- export {
21
- sanitizeBody
22
- };