autumn-js 0.0.62 → 0.0.65
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-3OKYXLTN.mjs → chunk-C2YFOJYP.mjs} +1 -1
- package/dist/libraries/backend/{chunk-EJQ2IWD7.mjs → chunk-FRL4IWBU.mjs} +6 -6
- package/dist/libraries/backend/{chunk-I45FNCR5.mjs → chunk-NDN25XDG.mjs} +3 -2
- package/dist/libraries/backend/{chunk-ONFOZVN3.mjs → chunk-NDS3EHT3.mjs} +1 -1
- package/dist/libraries/backend/{chunk-EWE7GADM.mjs → chunk-QXJ7YDTB.mjs} +1 -1
- package/dist/libraries/backend/{chunk-YQVUFNOA.mjs → chunk-W63TY2DI.mjs} +13 -8
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/express.js +22 -19
- package/dist/libraries/backend/express.mjs +12 -15
- package/dist/libraries/backend/fastify.js +17 -13
- package/dist/libraries/backend/fastify.mjs +7 -9
- package/dist/libraries/backend/hono.js +17 -13
- package/dist/libraries/backend/hono.mjs +7 -9
- package/dist/libraries/backend/next.d.mts +2 -1
- package/dist/libraries/backend/next.d.ts +2 -1
- package/dist/libraries/backend/next.js +18 -14
- package/dist/libraries/backend/next.mjs +8 -10
- package/dist/libraries/backend/react-router.js +17 -13
- package/dist/libraries/backend/react-router.mjs +7 -9
- package/dist/libraries/backend/{referralTypes-CGt7XaEI.d.ts → referralTypes-CJPslVLJ.d.ts} +4 -0
- package/dist/libraries/backend/{referralTypes-B7FSGa5b.d.mts → referralTypes-DmqKXhXe.d.mts} +4 -0
- package/dist/libraries/backend/remix_dep.js +17 -13
- 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 +16 -10
- package/dist/libraries/backend/routes/backendRouter.mjs +6 -6
- package/dist/libraries/backend/routes/entityRoutes.js +13 -8
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +15 -9
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +13 -8
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +17 -13
- package/dist/libraries/backend/supabase.mjs +7 -9
- package/dist/libraries/backend/tanstack.js +17 -13
- package/dist/libraries/backend/tanstack.mjs +7 -9
- package/dist/libraries/backend/utils/backendRes.js +13 -8
- 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 +13 -8
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +4 -4
- package/dist/libraries/react/AutumnContext.d.ts +4 -4
- package/dist/libraries/react/AutumnContext.js +13 -8
- package/dist/libraries/react/AutumnContext.mjs +3 -3
- package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.js +13 -8
- package/dist/libraries/react/BaseAutumnProvider.mjs +6 -6
- package/dist/libraries/react/{ReactAutumnClient-DoXXU_vr.d.mts → ReactAutumnClient-BQtmw21U.d.mts} +3 -3
- package/dist/libraries/react/{ReactAutumnClient-BgrRcTEM.d.ts → ReactAutumnClient-DNcV0gAT.d.ts} +3 -3
- package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.js +13 -8
- package/dist/libraries/react/ReactAutumnProvider.mjs +7 -7
- package/dist/libraries/react/{chunk-BG33A3TN.mjs → chunk-4TTWSWW7.mjs} +3 -3
- package/dist/libraries/react/{chunk-6FF2Q2VD.mjs → chunk-5CBWPVSP.mjs} +1 -1
- package/dist/libraries/react/{chunk-GKHSPJB6.mjs → chunk-CZAUMPWK.mjs} +2 -2
- package/dist/libraries/react/{chunk-MRIPC6HX.mjs → chunk-DFXUEQ6D.mjs} +1 -1
- package/dist/libraries/react/{chunk-VIXAYSBW.mjs → chunk-OCZFV7OX.mjs} +13 -8
- package/dist/libraries/react/{chunk-LRYO52RU.mjs → chunk-Q5SSQSDP.mjs} +1 -1
- package/dist/libraries/react/{chunk-7PEQTAP7.mjs → chunk-RIXRUJDK.mjs} +1 -1
- package/dist/libraries/react/{chunk-PC4OCHJB.mjs → chunk-URAFNMTH.mjs} +1 -1
- package/dist/libraries/react/{chunk-E6UE2PPO.mjs → chunk-WPXLFYWT.mjs} +3 -9
- package/dist/libraries/react/{chunk-GVWF4C3N.mjs → chunk-XTEUMENO.mjs} +1 -1
- package/dist/libraries/react/{chunk-3BJR6YBL.mjs → chunk-XXOQMNM6.mjs} +1 -1
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.js +13 -8
- package/dist/libraries/react/client/ReactAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/clientCompMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientCusMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCusMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientGenMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientGenMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -4
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +1 -0
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +1 -0
- package/dist/libraries/react/{cusTypes-BTcZvjbB.d.ts → cusTypes-Cf-s9PYP.d.mts} +2 -0
- package/dist/libraries/react/{cusTypes-BTcZvjbB.d.mts → cusTypes-Cf-s9PYP.d.ts} +2 -0
- package/dist/libraries/react/{entTypes-CIjIxPas.d.ts → entTypes-BbIk0Toa.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-_9_C-00R.d.mts → entTypes-CV-165S-.d.mts} +1 -1
- package/dist/libraries/react/hooks/useAutumn.d.mts +4 -7
- package/dist/libraries/react/hooks/useAutumn.d.ts +4 -7
- package/dist/libraries/react/hooks/useAutumn.js +15 -16
- package/dist/libraries/react/hooks/useAutumn.mjs +4 -4
- package/dist/libraries/react/hooks/useCustomer.d.mts +4 -4
- package/dist/libraries/react/hooks/useCustomer.d.ts +4 -4
- package/dist/libraries/react/hooks/useCustomer.js +13 -8
- package/dist/libraries/react/hooks/useCustomer.mjs +4 -4
- package/dist/libraries/react/hooks/useCustomerProvider.d.mts +4 -4
- package/dist/libraries/react/hooks/useCustomerProvider.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntity.d.mts +2 -2
- package/dist/libraries/react/hooks/useEntity.d.ts +2 -2
- package/dist/libraries/react/hooks/useEntity.js +13 -8
- package/dist/libraries/react/hooks/useEntity.mjs +4 -4
- package/dist/libraries/react/hooks/useEntityProvider.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntityProvider.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntityProvider.js +13 -8
- package/dist/libraries/react/hooks/useEntityProvider.mjs +2 -2
- package/dist/libraries/react/hooks/usePricingTable.js +13 -8
- package/dist/libraries/react/hooks/usePricingTable.mjs +4 -4
- package/dist/libraries/react/hooks/usePricingTableProvider.d.mts +4 -4
- package/dist/libraries/react/hooks/usePricingTableProvider.d.ts +4 -4
- package/dist/libraries/react/hooks/usePricingTableProvider.js +13 -8
- package/dist/libraries/react/hooks/usePricingTableProvider.mjs +2 -2
- package/dist/libraries/react/index.d.mts +4 -4
- package/dist/libraries/react/index.d.ts +4 -4
- package/dist/libraries/react/index.js +15 -16
- package/dist/libraries/react/index.mjs +11 -11
- package/dist/libraries/react/{response-CuJBOgCX.d.ts → response-B1KyqUB9.d.ts} +1 -1
- package/dist/libraries/react/{response-BqFGIMug.d.mts → response-B5dHU3I9.d.mts} +1 -1
- package/dist/next/client/AutumnContext.d.mts +2 -2
- package/dist/next/client/AutumnContext.d.ts +2 -2
- package/dist/next/client/AutumnProvider.d.mts +1 -1
- package/dist/next/client/AutumnProvider.d.ts +1 -1
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/{cusTypes-BGfMicAw.d.ts → cusTypes-sh5_cN7N.d.mts} +2 -0
- package/dist/next/client/{cusTypes-BGfMicAw.d.mts → cusTypes-sh5_cN7N.d.ts} +2 -0
- package/dist/next/client/{entTypes-C81tVu3a.d.ts → entTypes-BDqnMLZ4.d.ts} +1 -1
- package/dist/next/client/{entTypes-Dmm2Us0w.d.mts → entTypes-C9TNWMk6.d.mts} +1 -1
- 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/client/hooks/useCustomer.d.mts +2 -2
- package/dist/next/client/hooks/useCustomer.d.ts +2 -2
- package/dist/next/client/hooks/useEntity.d.mts +2 -2
- package/dist/next/client/hooks/useEntity.d.ts +2 -2
- package/dist/next/client/hooks/usePricingTable.d.mts +2 -2
- package/dist/next/client/hooks/usePricingTable.d.ts +2 -2
- package/dist/next/client/types.d.mts +2 -2
- package/dist/next/client/types.d.ts +2 -2
- package/dist/next/index.d.mts +10 -5
- package/dist/next/index.d.ts +10 -5
- package/dist/next/server/auth/withAuth.d.mts +1 -1
- package/dist/next/server/auth/withAuth.d.ts +1 -1
- package/dist/next/server/{clientEntTypes-DX4iApM4.d.ts → clientEntTypes-CPVfO1bd.d.mts} +2 -1
- package/dist/next/server/{clientEntTypes-DCLnLdr2.d.mts → clientEntTypes-JLwH7X3l.d.ts} +2 -1
- package/dist/next/server/componentActions.d.mts +1 -1
- package/dist/next/server/componentActions.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +3 -2
- package/dist/next/server/cusActions.d.ts +3 -2
- package/dist/next/server/{cusTypes-VlsM-bzW.d.mts → cusTypes-BD42O-7Z.d.mts} +2 -0
- package/dist/next/server/{cusTypes-VlsM-bzW.d.ts → cusTypes-BD42O-7Z.d.ts} +2 -0
- package/dist/next/server/genActions.d.mts +9 -5
- package/dist/next/server/genActions.d.ts +9 -5
- package/dist/next/server/genActions.js +3 -10
- package/dist/next/server/genActions.mjs +3 -10
- package/dist/sdk/{cusTypes-D6sQTXPy.d.ts → cusTypes-BTV6ui4e.d.ts} +2 -0
- package/dist/sdk/{cusTypes-T1IdN-ez.d.mts → cusTypes-wBxbodEe.d.mts} +2 -0
- package/dist/sdk/customers.d.mts +1 -1
- package/dist/sdk/customers.d.ts +1 -1
- package/dist/sdk/{entTypes-BCt_cXXf.d.ts → entTypes-BwLV9Jn4.d.ts} +1 -1
- package/dist/sdk/{entTypes-BDv4ErLm.d.mts → entTypes-CJjjWn54.d.mts} +1 -1
- package/dist/sdk/entities.d.mts +2 -2
- package/dist/sdk/entities.d.ts +2 -2
- package/dist/sdk/general.d.mts +3 -2
- package/dist/sdk/general.d.ts +3 -2
- package/dist/sdk/index.d.mts +5 -4
- package/dist/sdk/index.d.ts +5 -4
- package/dist/sdk/index.js +13 -8
- package/dist/sdk/index.mjs +13 -8
- package/dist/utils/encryptUtils.js +13 -8
- package/dist/utils/encryptUtils.mjs +13 -8
- package/package.json +1 -1
|
@@ -319,10 +319,10 @@ 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
|
-
this.headers = {
|
|
325
|
+
this.headers = options?.headers || {
|
|
326
326
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
327
327
|
"Content-Type": "application/json"
|
|
328
328
|
};
|
|
@@ -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}`, {
|
|
@@ -578,11 +583,12 @@ var checkHandler = withAuth({
|
|
|
578
583
|
customer_data,
|
|
579
584
|
body
|
|
580
585
|
}) => {
|
|
581
|
-
|
|
586
|
+
const result = await autumn.check({
|
|
582
587
|
...sanitizeBody(body),
|
|
583
588
|
customer_id,
|
|
584
589
|
customer_data
|
|
585
590
|
});
|
|
591
|
+
return result;
|
|
586
592
|
}
|
|
587
593
|
});
|
|
588
594
|
var trackHandler = withAuth({
|
|
@@ -769,7 +775,7 @@ var getPricingTableHandler = withAuth({
|
|
|
769
775
|
},
|
|
770
776
|
requireCustomer: false
|
|
771
777
|
});
|
|
772
|
-
var createRouterWithOptions = (
|
|
778
|
+
var createRouterWithOptions = () => {
|
|
773
779
|
const router = (0, import_rou34.createRouter)();
|
|
774
780
|
(0, import_rou34.addRoute)(router, "POST", `${BASE_PATH}/customers`, {
|
|
775
781
|
handler: createCustomerHandler
|
|
@@ -885,9 +891,7 @@ var autumnHandler = (options) => {
|
|
|
885
891
|
url: autumnApiUrl,
|
|
886
892
|
version: options.version
|
|
887
893
|
});
|
|
888
|
-
const router = createRouterWithOptions(
|
|
889
|
-
autumn
|
|
890
|
-
});
|
|
894
|
+
const router = createRouterWithOptions();
|
|
891
895
|
const handleRequest = async (ctx) => {
|
|
892
896
|
const { request } = ctx;
|
|
893
897
|
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";
|
|
@@ -117,9 +117,7 @@ var autumnHandler = (options) => {
|
|
|
117
117
|
url: autumnApiUrl,
|
|
118
118
|
version: options.version
|
|
119
119
|
});
|
|
120
|
-
const router = createRouterWithOptions(
|
|
121
|
-
autumn
|
|
122
|
-
});
|
|
120
|
+
const router = createRouterWithOptions();
|
|
123
121
|
const handleRequest = async (ctx) => {
|
|
124
122
|
const { request } = ctx;
|
|
125
123
|
const url = new URL(request.url);
|
|
@@ -319,10 +319,10 @@ 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
|
-
this.headers = {
|
|
325
|
+
this.headers = options?.headers || {
|
|
326
326
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
327
327
|
"Content-Type": "application/json"
|
|
328
328
|
};
|
|
@@ -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}`, {
|
|
@@ -318,10 +318,10 @@ var Autumn = class {
|
|
|
318
318
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
319
319
|
} catch (error) {
|
|
320
320
|
}
|
|
321
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
321
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
322
322
|
throw new Error("Autumn secret key or publishable key is required");
|
|
323
323
|
}
|
|
324
|
-
this.headers = {
|
|
324
|
+
this.headers = options?.headers || {
|
|
325
325
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
326
326
|
"Content-Type": "application/json"
|
|
327
327
|
};
|
|
@@ -340,12 +340,17 @@ var Autumn = class {
|
|
|
340
340
|
return toContainerResult(response);
|
|
341
341
|
}
|
|
342
342
|
async post(path, body) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
343
|
+
try {
|
|
344
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
345
|
+
method: "POST",
|
|
346
|
+
headers: this.headers,
|
|
347
|
+
body: JSON.stringify(body)
|
|
348
|
+
});
|
|
349
|
+
return toContainerResult(response);
|
|
350
|
+
} catch (error) {
|
|
351
|
+
console.error("Error sending request:", error);
|
|
352
|
+
throw error;
|
|
353
|
+
}
|
|
349
354
|
}
|
|
350
355
|
async delete(path) {
|
|
351
356
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { A as AutumnError } from './error-CG2LXoa7.mjs';
|
|
3
|
-
import { P as PricingTableProduct, A as AutumnClient } from './ReactAutumnClient-
|
|
3
|
+
import { P as PricingTableProduct, A as AutumnClient } from './ReactAutumnClient-BQtmw21U.mjs';
|
|
4
4
|
import { EntityProvider } from './hooks/useEntityProvider.mjs';
|
|
5
5
|
import './client/types/clientReferralTypes.mjs';
|
|
6
6
|
import './client/types/clientEntTypes.mjs';
|
|
7
7
|
import './client/types/clientGenTypes.mjs';
|
|
8
|
-
import './response-
|
|
9
|
-
import './cusTypes-
|
|
10
|
-
import './entTypes-
|
|
8
|
+
import './response-B5dHU3I9.mjs';
|
|
9
|
+
import './cusTypes-Cf-s9PYP.mjs';
|
|
10
|
+
import './entTypes-CV-165S-.mjs';
|
|
11
11
|
|
|
12
12
|
interface AutumnDialogContext {
|
|
13
13
|
props: any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { A as AutumnError } from './error-CG2LXoa7.js';
|
|
3
|
-
import { P as PricingTableProduct, A as AutumnClient } from './ReactAutumnClient-
|
|
3
|
+
import { P as PricingTableProduct, A as AutumnClient } from './ReactAutumnClient-DNcV0gAT.js';
|
|
4
4
|
import { EntityProvider } from './hooks/useEntityProvider.js';
|
|
5
5
|
import './client/types/clientReferralTypes.js';
|
|
6
6
|
import './client/types/clientEntTypes.js';
|
|
7
7
|
import './client/types/clientGenTypes.js';
|
|
8
|
-
import './response-
|
|
9
|
-
import './cusTypes-
|
|
10
|
-
import './entTypes-
|
|
8
|
+
import './response-B1KyqUB9.js';
|
|
9
|
+
import './cusTypes-Cf-s9PYP.js';
|
|
10
|
+
import './entTypes-BbIk0Toa.js';
|
|
11
11
|
|
|
12
12
|
interface AutumnDialogContext {
|
|
13
13
|
props: any;
|
|
@@ -322,10 +322,10 @@ var Autumn = class {
|
|
|
322
322
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
323
323
|
} catch (error) {
|
|
324
324
|
}
|
|
325
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
325
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
326
326
|
throw new Error("Autumn secret key or publishable key is required");
|
|
327
327
|
}
|
|
328
|
-
this.headers = {
|
|
328
|
+
this.headers = options?.headers || {
|
|
329
329
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
330
330
|
"Content-Type": "application/json"
|
|
331
331
|
};
|
|
@@ -344,12 +344,17 @@ var Autumn = class {
|
|
|
344
344
|
return toContainerResult(response);
|
|
345
345
|
}
|
|
346
346
|
async post(path, body) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
347
|
+
try {
|
|
348
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
349
|
+
method: "POST",
|
|
350
|
+
headers: this.headers,
|
|
351
|
+
body: JSON.stringify(body)
|
|
352
|
+
});
|
|
353
|
+
return toContainerResult(response);
|
|
354
|
+
} catch (error) {
|
|
355
|
+
console.error("Error sending request:", error);
|
|
356
|
+
throw error;
|
|
357
|
+
}
|
|
353
358
|
}
|
|
354
359
|
async delete(path) {
|
|
355
360
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import {
|
|
4
4
|
AutumnContext,
|
|
5
5
|
useAutumnContext
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-XTEUMENO.mjs";
|
|
7
|
+
import "./chunk-XXOQMNM6.mjs";
|
|
8
|
+
import "./chunk-OCZFV7OX.mjs";
|
|
9
9
|
import "./chunk-LS3NB4DU.mjs";
|
|
10
10
|
import "./chunk-TBCLSIC2.mjs";
|
|
11
11
|
import "./chunk-NZ5PEXT2.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { A as AutumnClient } from './ReactAutumnClient-
|
|
2
|
+
import { A as AutumnClient } from './ReactAutumnClient-BQtmw21U.mjs';
|
|
3
3
|
import './client/types/clientReferralTypes.mjs';
|
|
4
4
|
import './client/types/clientEntTypes.mjs';
|
|
5
5
|
import './client/types/clientGenTypes.mjs';
|
|
6
|
-
import './response-
|
|
7
|
-
import './cusTypes-
|
|
6
|
+
import './response-B5dHU3I9.mjs';
|
|
7
|
+
import './cusTypes-Cf-s9PYP.mjs';
|
|
8
8
|
import './error-CG2LXoa7.mjs';
|
|
9
|
-
import './entTypes-
|
|
9
|
+
import './entTypes-CV-165S-.mjs';
|
|
10
10
|
|
|
11
11
|
declare function BaseAutumnProvider({ client, children, }: {
|
|
12
12
|
client: AutumnClient;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { A as AutumnClient } from './ReactAutumnClient-
|
|
2
|
+
import { A as AutumnClient } from './ReactAutumnClient-DNcV0gAT.js';
|
|
3
3
|
import './client/types/clientReferralTypes.js';
|
|
4
4
|
import './client/types/clientEntTypes.js';
|
|
5
5
|
import './client/types/clientGenTypes.js';
|
|
6
|
-
import './response-
|
|
7
|
-
import './cusTypes-
|
|
6
|
+
import './response-B1KyqUB9.js';
|
|
7
|
+
import './cusTypes-Cf-s9PYP.js';
|
|
8
8
|
import './error-CG2LXoa7.js';
|
|
9
|
-
import './entTypes-
|
|
9
|
+
import './entTypes-BbIk0Toa.js';
|
|
10
10
|
|
|
11
11
|
declare function BaseAutumnProvider({ client, children, }: {
|
|
12
12
|
client: AutumnClient;
|
|
@@ -323,10 +323,10 @@ var Autumn = class {
|
|
|
323
323
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
324
324
|
} catch (error) {
|
|
325
325
|
}
|
|
326
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
326
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
327
327
|
throw new Error("Autumn secret key or publishable key is required");
|
|
328
328
|
}
|
|
329
|
-
this.headers = {
|
|
329
|
+
this.headers = options?.headers || {
|
|
330
330
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
331
331
|
"Content-Type": "application/json"
|
|
332
332
|
};
|
|
@@ -345,12 +345,17 @@ var Autumn = class {
|
|
|
345
345
|
return toContainerResult(response);
|
|
346
346
|
}
|
|
347
347
|
async post(path, body) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
348
|
+
try {
|
|
349
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
350
|
+
method: "POST",
|
|
351
|
+
headers: this.headers,
|
|
352
|
+
body: JSON.stringify(body)
|
|
353
|
+
});
|
|
354
|
+
return toContainerResult(response);
|
|
355
|
+
} catch (error) {
|
|
356
|
+
console.error("Error sending request:", error);
|
|
357
|
+
throw error;
|
|
358
|
+
}
|
|
354
359
|
}
|
|
355
360
|
async delete(path) {
|
|
356
361
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
BaseAutumnProvider
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4TTWSWW7.mjs";
|
|
6
6
|
import "./chunk-4QPHNIQ7.mjs";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-Q5SSQSDP.mjs";
|
|
8
|
+
import "./chunk-URAFNMTH.mjs";
|
|
9
9
|
import "./chunk-PIIGEXKQ.mjs";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-XTEUMENO.mjs";
|
|
11
|
+
import "./chunk-XXOQMNM6.mjs";
|
|
12
|
+
import "./chunk-OCZFV7OX.mjs";
|
|
13
13
|
import "./chunk-LS3NB4DU.mjs";
|
|
14
14
|
import "./chunk-TBCLSIC2.mjs";
|
|
15
15
|
import "./chunk-NZ5PEXT2.mjs";
|
package/dist/libraries/react/{ReactAutumnClient-DoXXU_vr.d.mts → ReactAutumnClient-BQtmw21U.d.mts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CreateReferralCodeParams, RedeemReferralCodeParams } from './client/types/clientReferralTypes.mjs';
|
|
2
2
|
import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTypes.mjs';
|
|
3
3
|
import { AttachParams, CancelParams, CheckParams, TrackParams, OpenBillingPortalParams } from './client/types/clientGenTypes.mjs';
|
|
4
|
-
import { R as Result, A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from './response-
|
|
4
|
+
import { R as Result, A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from './response-B5dHU3I9.mjs';
|
|
5
5
|
import { A as AutumnError } from './error-CG2LXoa7.mjs';
|
|
6
|
-
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResponse } from './cusTypes-
|
|
7
|
-
import { E as Entity, D as DeleteEntityResult } from './entTypes-
|
|
6
|
+
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResponse } from './cusTypes-Cf-s9PYP.mjs';
|
|
7
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-CV-165S-.mjs';
|
|
8
8
|
|
|
9
9
|
interface PricingTableProduct {
|
|
10
10
|
id: string;
|
package/dist/libraries/react/{ReactAutumnClient-BgrRcTEM.d.ts → ReactAutumnClient-DNcV0gAT.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CreateReferralCodeParams, RedeemReferralCodeParams } from './client/types/clientReferralTypes.js';
|
|
2
2
|
import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTypes.js';
|
|
3
3
|
import { AttachParams, CancelParams, CheckParams, TrackParams, OpenBillingPortalParams } from './client/types/clientGenTypes.js';
|
|
4
|
-
import { R as Result, A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from './response-
|
|
4
|
+
import { R as Result, A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from './response-B1KyqUB9.js';
|
|
5
5
|
import { A as AutumnError } from './error-CG2LXoa7.js';
|
|
6
|
-
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResponse } from './cusTypes-
|
|
7
|
-
import { E as Entity, D as DeleteEntityResult } from './entTypes-
|
|
6
|
+
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResponse } from './cusTypes-Cf-s9PYP.js';
|
|
7
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-BbIk0Toa.js';
|
|
8
8
|
|
|
9
9
|
interface PricingTableProduct {
|
|
10
10
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
+
import { C as CustomerData } from './cusTypes-Cf-s9PYP.mjs';
|
|
3
3
|
|
|
4
4
|
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, }: {
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
+
import { C as CustomerData } from './cusTypes-Cf-s9PYP.js';
|
|
3
3
|
|
|
4
4
|
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, }: {
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -323,10 +323,10 @@ var Autumn = class {
|
|
|
323
323
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
324
324
|
} catch (error) {
|
|
325
325
|
}
|
|
326
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
326
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
327
327
|
throw new Error("Autumn secret key or publishable key is required");
|
|
328
328
|
}
|
|
329
|
-
this.headers = {
|
|
329
|
+
this.headers = options?.headers || {
|
|
330
330
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
331
331
|
"Content-Type": "application/json"
|
|
332
332
|
};
|
|
@@ -345,12 +345,17 @@ var Autumn = class {
|
|
|
345
345
|
return toContainerResult(response);
|
|
346
346
|
}
|
|
347
347
|
async post(path, body) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
348
|
+
try {
|
|
349
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
350
|
+
method: "POST",
|
|
351
|
+
headers: this.headers,
|
|
352
|
+
body: JSON.stringify(body)
|
|
353
|
+
});
|
|
354
|
+
return toContainerResult(response);
|
|
355
|
+
} catch (error) {
|
|
356
|
+
console.error("Error sending request:", error);
|
|
357
|
+
throw error;
|
|
358
|
+
}
|
|
354
359
|
}
|
|
355
360
|
async delete(path) {
|
|
356
361
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ReactAutumnProvider
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-CZAUMPWK.mjs";
|
|
6
|
+
import "./chunk-4TTWSWW7.mjs";
|
|
7
7
|
import "./chunk-4QPHNIQ7.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Q5SSQSDP.mjs";
|
|
9
|
+
import "./chunk-URAFNMTH.mjs";
|
|
10
10
|
import "./chunk-PIIGEXKQ.mjs";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-XTEUMENO.mjs";
|
|
12
|
+
import "./chunk-XXOQMNM6.mjs";
|
|
13
|
+
import "./chunk-OCZFV7OX.mjs";
|
|
14
14
|
import "./chunk-LS3NB4DU.mjs";
|
|
15
15
|
import "./chunk-TBCLSIC2.mjs";
|
|
16
16
|
import "./chunk-NZ5PEXT2.mjs";
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
} from "./chunk-4QPHNIQ7.mjs";
|
|
6
6
|
import {
|
|
7
7
|
useEntityProvider
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Q5SSQSDP.mjs";
|
|
9
9
|
import {
|
|
10
10
|
usePricingTableProvider
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-URAFNMTH.mjs";
|
|
12
12
|
import {
|
|
13
13
|
useCustomerProvider
|
|
14
14
|
} from "./chunk-PIIGEXKQ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
AutumnContext
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XTEUMENO.mjs";
|
|
18
18
|
|
|
19
19
|
// src/libraries/react/BaseAutumnProvider.tsx
|
|
20
20
|
import { useEffect, useState } from "react";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
BaseAutumnProvider
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4TTWSWW7.mjs";
|
|
6
6
|
import {
|
|
7
7
|
AutumnClient
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XXOQMNM6.mjs";
|
|
9
9
|
|
|
10
10
|
// src/libraries/react/ReactAutumnProvider.tsx
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -295,10 +295,10 @@ var Autumn = class {
|
|
|
295
295
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
296
296
|
} catch (error) {
|
|
297
297
|
}
|
|
298
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
298
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
299
299
|
throw new Error("Autumn secret key or publishable key is required");
|
|
300
300
|
}
|
|
301
|
-
this.headers = {
|
|
301
|
+
this.headers = options?.headers || {
|
|
302
302
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
303
303
|
"Content-Type": "application/json"
|
|
304
304
|
};
|
|
@@ -317,12 +317,17 @@ var Autumn = class {
|
|
|
317
317
|
return toContainerResult(response);
|
|
318
318
|
}
|
|
319
319
|
async post(path, body) {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
try {
|
|
321
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
322
|
+
method: "POST",
|
|
323
|
+
headers: this.headers,
|
|
324
|
+
body: JSON.stringify(body)
|
|
325
|
+
});
|
|
326
|
+
return toContainerResult(response);
|
|
327
|
+
} catch (error) {
|
|
328
|
+
console.error("Error sending request:", error);
|
|
329
|
+
throw error;
|
|
330
|
+
}
|
|
326
331
|
}
|
|
327
332
|
async delete(path) {
|
|
328
333
|
const response = await fetch(`${this.url}${path}`, {
|