autumn-js 0.0.63 → 0.0.66
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/libraries/backend/{chunk-IWZ4KYSH.mjs → chunk-C2YFOJYP.mjs} +1 -1
- package/dist/libraries/backend/{chunk-MCSTMHRF.mjs → chunk-FRL4IWBU.mjs} +6 -6
- package/dist/libraries/backend/{chunk-R27FUM7G.mjs → chunk-NDN25XDG.mjs} +3 -2
- package/dist/libraries/backend/{chunk-NXXTBCPD.mjs → chunk-NDS3EHT3.mjs} +1 -1
- package/dist/libraries/backend/{chunk-J6BWOIM2.mjs → chunk-QXJ7YDTB.mjs} +1 -1
- package/dist/libraries/backend/{chunk-52ERHSRF.mjs → chunk-W63TY2DI.mjs} +12 -7
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/express.js +21 -18
- package/dist/libraries/backend/express.mjs +12 -15
- package/dist/libraries/backend/fastify.js +16 -12
- package/dist/libraries/backend/fastify.mjs +7 -9
- package/dist/libraries/backend/hono.js +16 -12
- package/dist/libraries/backend/hono.mjs +7 -9
- package/dist/libraries/backend/next.js +16 -12
- package/dist/libraries/backend/next.mjs +7 -9
- package/dist/libraries/backend/react-router.js +16 -12
- package/dist/libraries/backend/react-router.mjs +7 -9
- package/dist/libraries/backend/{referralTypes-CIEzOYwT.d.mts → referralTypes-BdY-EkkQ.d.mts} +2 -0
- package/dist/libraries/backend/{referralTypes-D6dBIcVj.d.ts → referralTypes-p6A_PZbz.d.ts} +2 -0
- package/dist/libraries/backend/remix_dep.js +16 -12
- package/dist/libraries/backend/remix_dep.mjs +7 -9
- package/dist/libraries/backend/routes/backendRouter.d.mts +1 -5
- package/dist/libraries/backend/routes/backendRouter.d.ts +1 -5
- package/dist/libraries/backend/routes/backendRouter.js +15 -9
- package/dist/libraries/backend/routes/backendRouter.mjs +6 -6
- package/dist/libraries/backend/routes/entityRoutes.js +12 -7
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +14 -8
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +12 -7
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +16 -12
- package/dist/libraries/backend/supabase.mjs +7 -9
- package/dist/libraries/backend/tanstack.js +16 -12
- package/dist/libraries/backend/tanstack.mjs +7 -9
- package/dist/libraries/backend/utils/backendRes.js +12 -7
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
- package/dist/libraries/backend/utils/withAuth.js +12 -7
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.js +12 -7
- package/dist/libraries/react/AutumnContext.mjs +3 -3
- package/dist/libraries/react/BaseAutumnProvider.js +12 -7
- package/dist/libraries/react/BaseAutumnProvider.mjs +6 -6
- package/dist/libraries/react/ReactAutumnProvider.js +12 -7
- package/dist/libraries/react/ReactAutumnProvider.mjs +7 -7
- package/dist/libraries/react/{chunk-UP5NZZNP.mjs → chunk-5LNSASJV.mjs} +1 -1
- package/dist/libraries/react/{chunk-ODYKGMMO.mjs → chunk-CZA5WF64.mjs} +1 -1
- package/dist/libraries/react/{chunk-TRNJQQVR.mjs → chunk-ILWLFCTA.mjs} +1 -1
- package/dist/libraries/react/{chunk-ENHBWPHN.mjs → chunk-KHU4NOQJ.mjs} +2 -2
- package/dist/libraries/react/{chunk-KKQ43XGE.mjs → chunk-O4SNGQNB.mjs} +3 -9
- package/dist/libraries/react/{chunk-H2V37JOA.mjs → chunk-OCZFV7OX.mjs} +12 -7
- package/dist/libraries/react/{chunk-2Q72AFTY.mjs → chunk-PW6WFMLB.mjs} +3 -3
- package/dist/libraries/react/{chunk-3PIWTU6F.mjs → chunk-PYM4YPRD.mjs} +1 -1
- package/dist/libraries/react/{chunk-544EFZUX.mjs → chunk-Q5SSQSDP.mjs} +1 -1
- package/dist/libraries/react/{chunk-NIZX6KAM.mjs → chunk-STABYMUY.mjs} +1 -1
- package/dist/libraries/react/{chunk-HU6NIBMZ.mjs → chunk-URAFNMTH.mjs} +1 -1
- package/dist/libraries/react/client/ReactAutumnClient.js +12 -7
- package/dist/libraries/react/client/ReactAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +2 -0
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +2 -0
- package/dist/libraries/react/hooks/useAutumn.d.mts +2 -5
- package/dist/libraries/react/hooks/useAutumn.d.ts +2 -5
- package/dist/libraries/react/hooks/useAutumn.js +14 -15
- package/dist/libraries/react/hooks/useAutumn.mjs +4 -4
- package/dist/libraries/react/hooks/useCustomer.js +12 -7
- package/dist/libraries/react/hooks/useCustomer.mjs +4 -4
- package/dist/libraries/react/hooks/useEntity.js +12 -7
- package/dist/libraries/react/hooks/useEntity.mjs +4 -4
- package/dist/libraries/react/hooks/useEntityProvider.js +12 -7
- package/dist/libraries/react/hooks/useEntityProvider.mjs +2 -2
- package/dist/libraries/react/hooks/usePricingTable.js +12 -7
- package/dist/libraries/react/hooks/usePricingTable.mjs +4 -4
- package/dist/libraries/react/hooks/usePricingTableProvider.js +12 -7
- package/dist/libraries/react/hooks/usePricingTableProvider.mjs +2 -2
- package/dist/libraries/react/index.js +14 -15
- package/dist/libraries/react/index.mjs +11 -11
- package/dist/next/client/hooks/types.d.mts +1 -0
- package/dist/next/client/hooks/types.d.ts +1 -0
- package/dist/next/client/hooks/useAutumn.d.mts +6 -4
- package/dist/next/client/hooks/useAutumn.d.ts +6 -4
- package/dist/next/client/hooks/useAutumn.js +2 -6
- package/dist/next/client/hooks/useAutumn.mjs +2 -6
- package/dist/next/index.d.mts +7 -4
- package/dist/next/index.d.ts +7 -4
- package/dist/next/server/{clientEntTypes-C_HhGHvK.d.mts → clientEntTypes-B3DRcw3U.d.mts} +2 -0
- package/dist/next/server/{clientEntTypes-ZZHurPcy.d.ts → clientEntTypes-BRUTcNUD.d.ts} +2 -0
- package/dist/next/server/cusActions.d.mts +1 -1
- package/dist/next/server/cusActions.d.ts +1 -1
- package/dist/next/server/genActions.d.mts +9 -4
- package/dist/next/server/genActions.d.ts +9 -4
- package/dist/next/server/genActions.js +7 -12
- package/dist/next/server/genActions.mjs +7 -12
- package/dist/sdk/general.d.mts +2 -0
- package/dist/sdk/general.d.ts +2 -0
- package/dist/sdk/index.js +12 -7
- package/dist/sdk/index.mjs +12 -7
- package/dist/utils/encryptUtils.js +12 -7
- package/dist/utils/encryptUtils.mjs +12 -7
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addEntityRoutes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QXJ7YDTB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
addGenRoutes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NDN25XDG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
addReferralRoutes
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NDS3EHT3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
withAuth
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-C2YFOJYP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
fetchPricingTable
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-W63TY2DI.mjs";
|
|
16
16
|
import {
|
|
17
17
|
BASE_PATH
|
|
18
18
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -55,7 +55,7 @@ var getPricingTableHandler = withAuth({
|
|
|
55
55
|
},
|
|
56
56
|
requireCustomer: false
|
|
57
57
|
});
|
|
58
|
-
var createRouterWithOptions = (
|
|
58
|
+
var createRouterWithOptions = () => {
|
|
59
59
|
const router = createRouter();
|
|
60
60
|
addRoute(router, "POST", `${BASE_PATH}/customers`, {
|
|
61
61
|
handler: createCustomerHandler
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withAuth
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C2YFOJYP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
BASE_PATH
|
|
6
6
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -46,11 +46,12 @@ var checkHandler = withAuth({
|
|
|
46
46
|
customer_data,
|
|
47
47
|
body
|
|
48
48
|
}) => {
|
|
49
|
-
|
|
49
|
+
const result = await autumn.check({
|
|
50
50
|
...sanitizeBody(body),
|
|
51
51
|
customer_id,
|
|
52
52
|
customer_data
|
|
53
53
|
});
|
|
54
|
+
return result;
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
57
|
var trackHandler = withAuth({
|
|
@@ -292,7 +292,7 @@ var Autumn = class {
|
|
|
292
292
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
293
293
|
} catch (error) {
|
|
294
294
|
}
|
|
295
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
295
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
296
296
|
throw new Error("Autumn secret key or publishable key is required");
|
|
297
297
|
}
|
|
298
298
|
this.headers = options?.headers || {
|
|
@@ -314,12 +314,17 @@ var Autumn = class {
|
|
|
314
314
|
return toContainerResult(response);
|
|
315
315
|
}
|
|
316
316
|
async post(path, body) {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
317
|
+
try {
|
|
318
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
319
|
+
method: "POST",
|
|
320
|
+
headers: this.headers,
|
|
321
|
+
body: JSON.stringify(body)
|
|
322
|
+
});
|
|
323
|
+
return toContainerResult(response);
|
|
324
|
+
} catch (error) {
|
|
325
|
+
console.error("Error sending request:", error);
|
|
326
|
+
throw error;
|
|
327
|
+
}
|
|
323
328
|
}
|
|
324
329
|
async delete(path) {
|
|
325
330
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -319,7 +319,7 @@ var Autumn = class {
|
|
|
319
319
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
320
320
|
} catch (error) {
|
|
321
321
|
}
|
|
322
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
322
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
323
323
|
throw new Error("Autumn secret key or publishable key is required");
|
|
324
324
|
}
|
|
325
325
|
this.headers = options?.headers || {
|
|
@@ -341,12 +341,17 @@ var Autumn = class {
|
|
|
341
341
|
return toContainerResult(response);
|
|
342
342
|
}
|
|
343
343
|
async post(path, body) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
344
|
+
try {
|
|
345
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
346
|
+
method: "POST",
|
|
347
|
+
headers: this.headers,
|
|
348
|
+
body: JSON.stringify(body)
|
|
349
|
+
});
|
|
350
|
+
return toContainerResult(response);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
console.error("Error sending request:", error);
|
|
353
|
+
throw error;
|
|
354
|
+
}
|
|
350
355
|
}
|
|
351
356
|
async delete(path) {
|
|
352
357
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -580,11 +585,12 @@ var checkHandler = withAuth({
|
|
|
580
585
|
customer_data,
|
|
581
586
|
body
|
|
582
587
|
}) => {
|
|
583
|
-
|
|
588
|
+
const result = await autumn.check({
|
|
584
589
|
...sanitizeBody(body),
|
|
585
590
|
customer_id,
|
|
586
591
|
customer_data
|
|
587
592
|
});
|
|
593
|
+
return result;
|
|
588
594
|
}
|
|
589
595
|
});
|
|
590
596
|
var trackHandler = withAuth({
|
|
@@ -771,7 +777,7 @@ var getPricingTableHandler = withAuth({
|
|
|
771
777
|
},
|
|
772
778
|
requireCustomer: false
|
|
773
779
|
});
|
|
774
|
-
var createRouterWithOptions = (
|
|
780
|
+
var createRouterWithOptions = () => {
|
|
775
781
|
const router = (0, import_rou34.createRouter)();
|
|
776
782
|
(0, import_rou34.addRoute)(router, "POST", `${BASE_PATH}/customers`, {
|
|
777
783
|
handler: createCustomerHandler
|
|
@@ -788,14 +794,12 @@ var createRouterWithOptions = ({ autumn }) => {
|
|
|
788
794
|
|
|
789
795
|
// src/libraries/backend/express.ts
|
|
790
796
|
var autumnHandler = (options) => {
|
|
791
|
-
const
|
|
792
|
-
url: autumnApiUrl,
|
|
793
|
-
version: options?.version
|
|
794
|
-
});
|
|
795
|
-
const router = createRouterWithOptions({
|
|
796
|
-
autumn
|
|
797
|
-
});
|
|
797
|
+
const router = createRouterWithOptions();
|
|
798
798
|
return async (req, res, next) => {
|
|
799
|
+
let autumn = typeof options?.autumn === "function" ? options.autumn(req) : options?.autumn || new Autumn({
|
|
800
|
+
url: autumnApiUrl,
|
|
801
|
+
version: options?.version
|
|
802
|
+
});
|
|
799
803
|
let path = req.path;
|
|
800
804
|
const searchParams = Object.fromEntries(new URLSearchParams(req.query));
|
|
801
805
|
if (!path.startsWith("/api/autumn")) {
|
|
@@ -813,9 +817,8 @@ var autumnHandler = (options) => {
|
|
|
813
817
|
}
|
|
814
818
|
}
|
|
815
819
|
try {
|
|
816
|
-
let autumnClient = typeof options?.autumn === "function" ? options.autumn(req) : options?.autumn || autumn;
|
|
817
820
|
let result = await handler({
|
|
818
|
-
autumn
|
|
821
|
+
autumn,
|
|
819
822
|
body,
|
|
820
823
|
path: req.path,
|
|
821
824
|
getCustomer: async () => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouterWithOptions
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FRL4IWBU.mjs";
|
|
4
|
+
import "./chunk-QXJ7YDTB.mjs";
|
|
5
|
+
import "./chunk-NDN25XDG.mjs";
|
|
6
|
+
import "./chunk-NDS3EHT3.mjs";
|
|
7
|
+
import "./chunk-C2YFOJYP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Autumn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W63TY2DI.mjs";
|
|
11
11
|
import {
|
|
12
12
|
autumnApiUrl
|
|
13
13
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -16,14 +16,12 @@ import "./chunk-6DZX6EAA.mjs";
|
|
|
16
16
|
// src/libraries/backend/express.ts
|
|
17
17
|
import { findRoute } from "rou3";
|
|
18
18
|
var autumnHandler = (options) => {
|
|
19
|
-
const
|
|
20
|
-
url: autumnApiUrl,
|
|
21
|
-
version: options?.version
|
|
22
|
-
});
|
|
23
|
-
const router = createRouterWithOptions({
|
|
24
|
-
autumn
|
|
25
|
-
});
|
|
19
|
+
const router = createRouterWithOptions();
|
|
26
20
|
return async (req, res, next) => {
|
|
21
|
+
let autumn = typeof options?.autumn === "function" ? options.autumn(req) : options?.autumn || new Autumn({
|
|
22
|
+
url: autumnApiUrl,
|
|
23
|
+
version: options?.version
|
|
24
|
+
});
|
|
27
25
|
let path = req.path;
|
|
28
26
|
const searchParams = Object.fromEntries(new URLSearchParams(req.query));
|
|
29
27
|
if (!path.startsWith("/api/autumn")) {
|
|
@@ -41,9 +39,8 @@ var autumnHandler = (options) => {
|
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
try {
|
|
44
|
-
let autumnClient = typeof options?.autumn === "function" ? options.autumn(req) : options?.autumn || autumn;
|
|
45
42
|
let result = await handler({
|
|
46
|
-
autumn
|
|
43
|
+
autumn,
|
|
47
44
|
body,
|
|
48
45
|
path: req.path,
|
|
49
46
|
getCustomer: async () => {
|
|
@@ -319,7 +319,7 @@ var Autumn = class {
|
|
|
319
319
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
320
320
|
} catch (error) {
|
|
321
321
|
}
|
|
322
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
322
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
323
323
|
throw new Error("Autumn secret key or publishable key is required");
|
|
324
324
|
}
|
|
325
325
|
this.headers = options?.headers || {
|
|
@@ -341,12 +341,17 @@ var Autumn = class {
|
|
|
341
341
|
return toContainerResult(response);
|
|
342
342
|
}
|
|
343
343
|
async post(path, body) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
344
|
+
try {
|
|
345
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
346
|
+
method: "POST",
|
|
347
|
+
headers: this.headers,
|
|
348
|
+
body: JSON.stringify(body)
|
|
349
|
+
});
|
|
350
|
+
return toContainerResult(response);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
console.error("Error sending request:", error);
|
|
353
|
+
throw error;
|
|
354
|
+
}
|
|
350
355
|
}
|
|
351
356
|
async delete(path) {
|
|
352
357
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -580,11 +585,12 @@ var checkHandler = withAuth({
|
|
|
580
585
|
customer_data,
|
|
581
586
|
body
|
|
582
587
|
}) => {
|
|
583
|
-
|
|
588
|
+
const result = await autumn.check({
|
|
584
589
|
...sanitizeBody(body),
|
|
585
590
|
customer_id,
|
|
586
591
|
customer_data
|
|
587
592
|
});
|
|
593
|
+
return result;
|
|
588
594
|
}
|
|
589
595
|
});
|
|
590
596
|
var trackHandler = withAuth({
|
|
@@ -771,7 +777,7 @@ var getPricingTableHandler = withAuth({
|
|
|
771
777
|
},
|
|
772
778
|
requireCustomer: false
|
|
773
779
|
});
|
|
774
|
-
var createRouterWithOptions = (
|
|
780
|
+
var createRouterWithOptions = () => {
|
|
775
781
|
const router = (0, import_rou34.createRouter)();
|
|
776
782
|
(0, import_rou34.addRoute)(router, "POST", `${BASE_PATH}/customers`, {
|
|
777
783
|
handler: createCustomerHandler
|
|
@@ -792,9 +798,7 @@ function autumnHandler(options) {
|
|
|
792
798
|
url: autumnApiUrl,
|
|
793
799
|
version: options.version
|
|
794
800
|
});
|
|
795
|
-
const router = createRouterWithOptions(
|
|
796
|
-
autumn
|
|
797
|
-
});
|
|
801
|
+
const router = createRouterWithOptions();
|
|
798
802
|
return async function(request, reply) {
|
|
799
803
|
try {
|
|
800
804
|
const url = new URL(request.url, `http://${request.headers.host}`);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouterWithOptions
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FRL4IWBU.mjs";
|
|
4
|
+
import "./chunk-QXJ7YDTB.mjs";
|
|
5
|
+
import "./chunk-NDN25XDG.mjs";
|
|
6
|
+
import "./chunk-NDS3EHT3.mjs";
|
|
7
|
+
import "./chunk-C2YFOJYP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Autumn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W63TY2DI.mjs";
|
|
11
11
|
import {
|
|
12
12
|
autumnApiUrl
|
|
13
13
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -20,9 +20,7 @@ function autumnHandler(options) {
|
|
|
20
20
|
url: autumnApiUrl,
|
|
21
21
|
version: options.version
|
|
22
22
|
});
|
|
23
|
-
const router = createRouterWithOptions(
|
|
24
|
-
autumn
|
|
25
|
-
});
|
|
23
|
+
const router = createRouterWithOptions();
|
|
26
24
|
return async function(request, reply) {
|
|
27
25
|
try {
|
|
28
26
|
const url = new URL(request.url, `http://${request.headers.host}`);
|
|
@@ -319,7 +319,7 @@ var Autumn = class {
|
|
|
319
319
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
320
320
|
} catch (error) {
|
|
321
321
|
}
|
|
322
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
322
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
323
323
|
throw new Error("Autumn secret key or publishable key is required");
|
|
324
324
|
}
|
|
325
325
|
this.headers = options?.headers || {
|
|
@@ -341,12 +341,17 @@ var Autumn = class {
|
|
|
341
341
|
return toContainerResult(response);
|
|
342
342
|
}
|
|
343
343
|
async post(path, body) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
344
|
+
try {
|
|
345
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
346
|
+
method: "POST",
|
|
347
|
+
headers: this.headers,
|
|
348
|
+
body: JSON.stringify(body)
|
|
349
|
+
});
|
|
350
|
+
return toContainerResult(response);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
console.error("Error sending request:", error);
|
|
353
|
+
throw error;
|
|
354
|
+
}
|
|
350
355
|
}
|
|
351
356
|
async delete(path) {
|
|
352
357
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -580,11 +585,12 @@ var checkHandler = withAuth({
|
|
|
580
585
|
customer_data,
|
|
581
586
|
body
|
|
582
587
|
}) => {
|
|
583
|
-
|
|
588
|
+
const result = await autumn.check({
|
|
584
589
|
...sanitizeBody(body),
|
|
585
590
|
customer_id,
|
|
586
591
|
customer_data
|
|
587
592
|
});
|
|
593
|
+
return result;
|
|
588
594
|
}
|
|
589
595
|
});
|
|
590
596
|
var trackHandler = withAuth({
|
|
@@ -771,7 +777,7 @@ var getPricingTableHandler = withAuth({
|
|
|
771
777
|
},
|
|
772
778
|
requireCustomer: false
|
|
773
779
|
});
|
|
774
|
-
var createRouterWithOptions = (
|
|
780
|
+
var createRouterWithOptions = () => {
|
|
775
781
|
const router = (0, import_rou34.createRouter)();
|
|
776
782
|
(0, import_rou34.addRoute)(router, "POST", `${BASE_PATH}/customers`, {
|
|
777
783
|
handler: createCustomerHandler
|
|
@@ -792,9 +798,7 @@ var autumnHandler = (options) => {
|
|
|
792
798
|
url: autumnApiUrl,
|
|
793
799
|
version: options.version
|
|
794
800
|
});
|
|
795
|
-
const router = createRouterWithOptions(
|
|
796
|
-
autumn
|
|
797
|
-
});
|
|
801
|
+
const router = createRouterWithOptions();
|
|
798
802
|
return async (c, next) => {
|
|
799
803
|
const request = new URL(c.req.url);
|
|
800
804
|
const path = request.pathname;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouterWithOptions
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FRL4IWBU.mjs";
|
|
4
|
+
import "./chunk-QXJ7YDTB.mjs";
|
|
5
|
+
import "./chunk-NDN25XDG.mjs";
|
|
6
|
+
import "./chunk-NDS3EHT3.mjs";
|
|
7
|
+
import "./chunk-C2YFOJYP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Autumn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W63TY2DI.mjs";
|
|
11
11
|
import {
|
|
12
12
|
autumnApiUrl
|
|
13
13
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -20,9 +20,7 @@ var autumnHandler = (options) => {
|
|
|
20
20
|
url: autumnApiUrl,
|
|
21
21
|
version: options.version
|
|
22
22
|
});
|
|
23
|
-
const router = createRouterWithOptions(
|
|
24
|
-
autumn
|
|
25
|
-
});
|
|
23
|
+
const router = createRouterWithOptions();
|
|
26
24
|
return async (c, next) => {
|
|
27
25
|
const request = new URL(c.req.url);
|
|
28
26
|
const path = request.pathname;
|
|
@@ -3826,7 +3826,7 @@ var Autumn = class {
|
|
|
3826
3826
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
3827
3827
|
} catch (error) {
|
|
3828
3828
|
}
|
|
3829
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
3829
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
3830
3830
|
throw new Error("Autumn secret key or publishable key is required");
|
|
3831
3831
|
}
|
|
3832
3832
|
this.headers = options?.headers || {
|
|
@@ -3848,12 +3848,17 @@ var Autumn = class {
|
|
|
3848
3848
|
return toContainerResult(response);
|
|
3849
3849
|
}
|
|
3850
3850
|
async post(path, body) {
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3851
|
+
try {
|
|
3852
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
3853
|
+
method: "POST",
|
|
3854
|
+
headers: this.headers,
|
|
3855
|
+
body: JSON.stringify(body)
|
|
3856
|
+
});
|
|
3857
|
+
return toContainerResult(response);
|
|
3858
|
+
} catch (error) {
|
|
3859
|
+
console.error("Error sending request:", error);
|
|
3860
|
+
throw error;
|
|
3861
|
+
}
|
|
3857
3862
|
}
|
|
3858
3863
|
async delete(path) {
|
|
3859
3864
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -4090,11 +4095,12 @@ var checkHandler = withAuth({
|
|
|
4090
4095
|
customer_data,
|
|
4091
4096
|
body
|
|
4092
4097
|
}) => {
|
|
4093
|
-
|
|
4098
|
+
const result = await autumn.check({
|
|
4094
4099
|
...sanitizeBody(body),
|
|
4095
4100
|
customer_id,
|
|
4096
4101
|
customer_data
|
|
4097
4102
|
});
|
|
4103
|
+
return result;
|
|
4098
4104
|
}
|
|
4099
4105
|
});
|
|
4100
4106
|
var trackHandler = withAuth({
|
|
@@ -4281,7 +4287,7 @@ var getPricingTableHandler = withAuth({
|
|
|
4281
4287
|
},
|
|
4282
4288
|
requireCustomer: false
|
|
4283
4289
|
});
|
|
4284
|
-
var createRouterWithOptions = (
|
|
4290
|
+
var createRouterWithOptions = () => {
|
|
4285
4291
|
const router = (0, import_rou34.createRouter)();
|
|
4286
4292
|
(0, import_rou34.addRoute)(router, "POST", `${BASE_PATH}/customers`, {
|
|
4287
4293
|
handler: createCustomerHandler
|
|
@@ -4302,9 +4308,7 @@ function autumnHandler(options) {
|
|
|
4302
4308
|
secretKey: options.secretKey || void 0,
|
|
4303
4309
|
url: options.url || autumnApiUrl
|
|
4304
4310
|
});
|
|
4305
|
-
const router = createRouterWithOptions(
|
|
4306
|
-
autumn
|
|
4307
|
-
});
|
|
4311
|
+
const router = createRouterWithOptions();
|
|
4308
4312
|
async function handler(request) {
|
|
4309
4313
|
const method = request.method;
|
|
4310
4314
|
const url = new URL(request.url);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouterWithOptions
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FRL4IWBU.mjs";
|
|
4
|
+
import "./chunk-QXJ7YDTB.mjs";
|
|
5
|
+
import "./chunk-NDN25XDG.mjs";
|
|
6
|
+
import "./chunk-NDS3EHT3.mjs";
|
|
7
|
+
import "./chunk-C2YFOJYP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Autumn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W63TY2DI.mjs";
|
|
11
11
|
import {
|
|
12
12
|
autumnApiUrl
|
|
13
13
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -3519,9 +3519,7 @@ function autumnHandler(options) {
|
|
|
3519
3519
|
secretKey: options.secretKey || void 0,
|
|
3520
3520
|
url: options.url || autumnApiUrl
|
|
3521
3521
|
});
|
|
3522
|
-
const router = createRouterWithOptions(
|
|
3523
|
-
autumn
|
|
3524
|
-
});
|
|
3522
|
+
const router = createRouterWithOptions();
|
|
3525
3523
|
async function handler(request) {
|
|
3526
3524
|
const method = request.method;
|
|
3527
3525
|
const url = new URL(request.url);
|
|
@@ -319,7 +319,7 @@ var Autumn = class {
|
|
|
319
319
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
320
320
|
} catch (error) {
|
|
321
321
|
}
|
|
322
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
322
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
323
323
|
throw new Error("Autumn secret key or publishable key is required");
|
|
324
324
|
}
|
|
325
325
|
this.headers = options?.headers || {
|
|
@@ -341,12 +341,17 @@ var Autumn = class {
|
|
|
341
341
|
return toContainerResult(response);
|
|
342
342
|
}
|
|
343
343
|
async post(path, body) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
344
|
+
try {
|
|
345
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
346
|
+
method: "POST",
|
|
347
|
+
headers: this.headers,
|
|
348
|
+
body: JSON.stringify(body)
|
|
349
|
+
});
|
|
350
|
+
return toContainerResult(response);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
console.error("Error sending request:", error);
|
|
353
|
+
throw error;
|
|
354
|
+
}
|
|
350
355
|
}
|
|
351
356
|
async delete(path) {
|
|
352
357
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -580,11 +585,12 @@ var checkHandler = withAuth({
|
|
|
580
585
|
customer_data,
|
|
581
586
|
body
|
|
582
587
|
}) => {
|
|
583
|
-
|
|
588
|
+
const result = await autumn.check({
|
|
584
589
|
...sanitizeBody(body),
|
|
585
590
|
customer_id,
|
|
586
591
|
customer_data
|
|
587
592
|
});
|
|
593
|
+
return result;
|
|
588
594
|
}
|
|
589
595
|
});
|
|
590
596
|
var trackHandler = withAuth({
|
|
@@ -771,7 +777,7 @@ var getPricingTableHandler = withAuth({
|
|
|
771
777
|
},
|
|
772
778
|
requireCustomer: false
|
|
773
779
|
});
|
|
774
|
-
var createRouterWithOptions = (
|
|
780
|
+
var createRouterWithOptions = () => {
|
|
775
781
|
const router = (0, import_rou34.createRouter)();
|
|
776
782
|
(0, import_rou34.addRoute)(router, "POST", `${BASE_PATH}/customers`, {
|
|
777
783
|
handler: createCustomerHandler
|
|
@@ -792,9 +798,7 @@ function autumnHandler(options) {
|
|
|
792
798
|
secretKey: options.secretKey || void 0,
|
|
793
799
|
url: autumnApiUrl
|
|
794
800
|
});
|
|
795
|
-
const router = createRouterWithOptions(
|
|
796
|
-
autumn
|
|
797
|
-
});
|
|
801
|
+
const router = createRouterWithOptions();
|
|
798
802
|
async function handleRequest(request, params = {}) {
|
|
799
803
|
const method = request.method;
|
|
800
804
|
const url = new URL(request.url);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouterWithOptions
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FRL4IWBU.mjs";
|
|
4
|
+
import "./chunk-QXJ7YDTB.mjs";
|
|
5
|
+
import "./chunk-NDN25XDG.mjs";
|
|
6
|
+
import "./chunk-NDS3EHT3.mjs";
|
|
7
|
+
import "./chunk-C2YFOJYP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Autumn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W63TY2DI.mjs";
|
|
11
11
|
import {
|
|
12
12
|
autumnApiUrl
|
|
13
13
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -20,9 +20,7 @@ function autumnHandler(options) {
|
|
|
20
20
|
secretKey: options.secretKey || void 0,
|
|
21
21
|
url: autumnApiUrl
|
|
22
22
|
});
|
|
23
|
-
const router = createRouterWithOptions(
|
|
24
|
-
autumn
|
|
25
|
-
});
|
|
23
|
+
const router = createRouterWithOptions();
|
|
26
24
|
async function handleRequest(request, params = {}) {
|
|
27
25
|
const method = request.method;
|
|
28
26
|
const url = new URL(request.url);
|
package/dist/libraries/backend/{referralTypes-CIEzOYwT.d.mts → referralTypes-BdY-EkkQ.d.mts}
RENAMED
|
@@ -251,11 +251,13 @@ interface AttachParams {
|
|
|
251
251
|
customer_data?: CustomerData;
|
|
252
252
|
entity_data?: EntityData;
|
|
253
253
|
checkout_session_params?: Record<string, any>;
|
|
254
|
+
reward?: string;
|
|
254
255
|
}
|
|
255
256
|
interface CancelParams {
|
|
256
257
|
customer_id: string;
|
|
257
258
|
product_id: string;
|
|
258
259
|
entity_id?: string;
|
|
260
|
+
cancel_immediately?: boolean;
|
|
259
261
|
}
|
|
260
262
|
interface CancelResult {
|
|
261
263
|
success: boolean;
|