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.
- package/dist/backend/adapters/express.js +4292 -3538
- package/dist/backend/adapters/express.mjs +9 -9
- package/dist/backend/adapters/fetch.js +4292 -3538
- package/dist/backend/adapters/fetch.mjs +9 -9
- package/dist/backend/adapters/hono.js +4292 -3538
- package/dist/backend/adapters/hono.mjs +9 -9
- package/dist/backend/adapters/index.js +4292 -3538
- package/dist/backend/adapters/index.mjs +12 -12
- package/dist/backend/adapters/next.js +4292 -3538
- package/dist/backend/adapters/next.mjs +9 -9
- package/dist/backend/{chunk-DBMOXEHI.mjs → chunk-66OVIMBS.mjs} +5 -5
- package/dist/backend/{chunk-QMO6VPQ3.mjs → chunk-GTZJYVV6.mjs} +4244 -3520
- package/dist/backend/chunk-I7CD6EB6.mjs +28 -0
- package/dist/backend/{chunk-55C2WWXQ.mjs → chunk-IXUCY7AU.mjs} +7 -6
- package/dist/backend/{chunk-R6QKB5RX.mjs → chunk-JNHJR2RN.mjs} +1 -1
- package/dist/backend/{chunk-QOX2POZP.mjs → chunk-N5DL6VA7.mjs} +1 -1
- package/dist/backend/{chunk-LTHZJCGX.mjs → chunk-PG3VMMBU.mjs} +1 -1
- package/dist/backend/{chunk-65JYBYIK.mjs → chunk-RBV55GF7.mjs} +7 -7
- package/dist/backend/{chunk-MAU6WWTL.mjs → chunk-W6NPZLA5.mjs} +40 -14
- package/dist/backend/{chunk-LFEAY3XJ.mjs → chunk-WK4VK7MP.mjs} +1 -1
- package/dist/backend/core/handlers/coreHandler.d.mts +2 -1
- package/dist/backend/core/handlers/coreHandler.d.ts +2 -1
- package/dist/backend/core/handlers/coreHandler.js +4292 -3538
- package/dist/backend/core/handlers/coreHandler.mjs +7 -7
- package/dist/backend/core/handlers/executeRoute.d.mts +2 -1
- package/dist/backend/core/handlers/executeRoute.d.ts +2 -1
- package/dist/backend/core/handlers/executeRoute.js +12 -7
- package/dist/backend/core/handlers/executeRoute.mjs +4 -4
- package/dist/backend/core/handlers/handleRouteByName.js +4292 -3538
- package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
- package/dist/backend/core/handlers/index.d.mts +2 -1
- package/dist/backend/core/handlers/index.d.ts +2 -1
- package/dist/backend/core/handlers/index.js +4292 -3538
- package/dist/backend/core/handlers/index.mjs +10 -10
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +4292 -3538
- package/dist/backend/core/index.mjs +10 -10
- package/dist/backend/core/routes/index.d.mts +2 -1
- package/dist/backend/core/routes/index.d.ts +2 -1
- package/dist/backend/core/routes/index.js +46 -17
- package/dist/backend/core/routes/index.mjs +2 -2
- package/dist/backend/core/routes/routeBuilder.d.mts +2 -1
- package/dist/backend/core/routes/routeBuilder.d.ts +2 -1
- package/dist/backend/core/routes/routeConfigs.d.mts +2 -1
- package/dist/backend/core/routes/routeConfigs.d.ts +2 -1
- package/dist/backend/core/routes/routeConfigs.js +46 -17
- package/dist/backend/core/routes/routeConfigs.mjs +2 -2
- package/dist/backend/core/types/handlerTypes.d.mts +2 -1
- package/dist/backend/core/types/handlerTypes.d.ts +2 -1
- package/dist/backend/core/types/index.d.mts +2 -1
- package/dist/backend/core/types/index.d.ts +2 -1
- package/dist/backend/core/types/routeTypes.d.mts +2 -1
- package/dist/backend/core/types/routeTypes.d.ts +2 -1
- package/dist/backend/core/utils/index.d.mts +1 -1
- package/dist/backend/core/utils/index.d.ts +1 -1
- package/dist/backend/core/utils/index.js +12 -4
- package/dist/backend/core/utils/index.mjs +7 -3
- package/dist/backend/core/utils/sanitizeBody.d.mts +6 -2
- package/dist/backend/core/utils/sanitizeBody.d.ts +6 -2
- package/dist/backend/core/utils/sanitizeBody.js +12 -4
- package/dist/backend/core/utils/sanitizeBody.mjs +5 -1
- package/dist/backend/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/index.js +4292 -3538
- package/dist/backend/index.mjs +10 -10
- package/dist/backend/{routeTypes-CJUeRXwp.d.mts → routeTypes-924R85Bn.d.mts} +550 -13
- package/dist/backend/{routeTypes-Dt3mcOiI.d.ts → routeTypes-Db2ZFQC4.d.ts} +550 -13
- package/dist/better-auth/{chunk-SJGCFMIB.mjs → chunk-4ZDXHHF4.mjs} +4249 -3524
- package/dist/better-auth/{chunk-RHJSAAZY.mjs → chunk-NKH2QR2X.mjs} +46 -17
- package/dist/better-auth/{chunk-3TLQJLI4.mjs → chunk-ONM42KFR.mjs} +1 -1
- package/dist/better-auth/index.js +4290 -3536
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +46 -17
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +4292 -3538
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +4290 -3536
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/react/AutumnContext.d.mts +2 -2
- package/dist/react/AutumnContext.d.ts +2 -2
- package/dist/react/client/AutumnClient.d.mts +2 -2
- package/dist/react/client/AutumnClient.d.ts +2 -2
- package/dist/react/client/IAutumnClient.d.mts +2 -2
- package/dist/react/client/IAutumnClient.d.ts +2 -2
- package/dist/react/client/index.d.mts +2 -2
- package/dist/react/client/index.d.ts +2 -2
- package/dist/react/{customer-BR2cYBBM.d.mts → customer-DPMyc3yN.d.mts} +30 -0
- package/dist/react/{customer-BI_KaaNd.d.ts → customer-Dr6WZsA2.d.ts} +30 -0
- package/dist/react/hooks/index.d.mts +2 -2
- package/dist/react/hooks/index.d.ts +2 -2
- package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +1 -1
- package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +1 -1
- package/dist/react/hooks/internal/check/customerToFeatures.d.mts +1 -1
- package/dist/react/hooks/internal/check/customerToFeatures.d.ts +1 -1
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +1 -1
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +1 -1
- package/dist/react/hooks/internal/check/getCreditCost.d.mts +1 -1
- package/dist/react/hooks/internal/check/getCreditCost.d.ts +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +2 -2
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +2 -2
- package/dist/react/hooks/internal/useCustomerActions.d.mts +2 -2
- package/dist/react/hooks/internal/useCustomerActions.d.ts +2 -2
- package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
- package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
- package/dist/react/hooks/useCustomer.d.mts +2 -2
- package/dist/react/hooks/useCustomer.d.ts +2 -2
- package/dist/react/hooks/useEntity.d.mts +1 -1
- package/dist/react/hooks/useEntity.d.ts +1 -1
- package/dist/react/hooks/useListEvents.d.mts +1 -1
- package/dist/react/hooks/useListEvents.d.ts +1 -1
- package/dist/react/hooks/useListPlans.d.mts +1 -1
- package/dist/react/hooks/useListPlans.d.ts +1 -1
- package/dist/react/hooks/useReferrals.d.mts +1 -1
- package/dist/react/hooks/useReferrals.d.ts +1 -1
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/{params-Bvc4DjLZ.d.mts → params-CeTb8jcT.d.mts} +87 -9
- package/dist/react/{params-BF_KxGYE.d.ts → params-Dl_h1rsu.d.ts} +87 -9
- package/dist/sdk/index.d.mts +1069 -378
- package/dist/sdk/index.d.ts +1069 -378
- package/dist/sdk/index.js +4661 -3806
- package/dist/sdk/index.mjs +4583 -3802
- package/package.json +142 -142
- package/dist/backend/chunk-Z6QP3YEA.mjs +0 -22
package/package.json
CHANGED
|
@@ -1,144 +1,144 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
};
|