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
|
@@ -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,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useEntity
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-RIXRUJDK.mjs";
|
|
6
6
|
import "../chunk-VN4AVW2V.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-XTEUMENO.mjs";
|
|
8
|
+
import "../chunk-XXOQMNM6.mjs";
|
|
9
|
+
import "../chunk-OCZFV7OX.mjs";
|
|
10
10
|
import "../chunk-LS3NB4DU.mjs";
|
|
11
11
|
import "../chunk-TBCLSIC2.mjs";
|
|
12
12
|
import "../chunk-NZ5PEXT2.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as AutumnError } from '../error-CG2LXoa7.mjs';
|
|
2
|
-
import { E as Entity } from '../entTypes-
|
|
2
|
+
import { E as Entity } from '../entTypes-CV-165S-.mjs';
|
|
3
3
|
import { GetEntityParams } from '../client/types/clientEntTypes.mjs';
|
|
4
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
5
|
-
import '../cusTypes-
|
|
4
|
+
import { A as AutumnClient } from '../ReactAutumnClient-BQtmw21U.mjs';
|
|
5
|
+
import '../cusTypes-Cf-s9PYP.mjs';
|
|
6
6
|
import '../client/types/clientReferralTypes.mjs';
|
|
7
7
|
import '../client/types/clientGenTypes.mjs';
|
|
8
|
-
import '../response-
|
|
8
|
+
import '../response-B5dHU3I9.mjs';
|
|
9
9
|
|
|
10
10
|
interface EntityProvider {
|
|
11
11
|
entity: Entity | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as AutumnError } from '../error-CG2LXoa7.js';
|
|
2
|
-
import { E as Entity } from '../entTypes-
|
|
2
|
+
import { E as Entity } from '../entTypes-BbIk0Toa.js';
|
|
3
3
|
import { GetEntityParams } from '../client/types/clientEntTypes.js';
|
|
4
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
5
|
-
import '../cusTypes-
|
|
4
|
+
import { A as AutumnClient } from '../ReactAutumnClient-DNcV0gAT.js';
|
|
5
|
+
import '../cusTypes-Cf-s9PYP.js';
|
|
6
6
|
import '../client/types/clientReferralTypes.js';
|
|
7
7
|
import '../client/types/clientGenTypes.js';
|
|
8
|
-
import '../response-
|
|
8
|
+
import '../response-B1KyqUB9.js';
|
|
9
9
|
|
|
10
10
|
interface EntityProvider {
|
|
11
11
|
entity: Entity | null;
|
|
@@ -321,10 +321,10 @@ var Autumn = class {
|
|
|
321
321
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
322
322
|
} catch (error) {
|
|
323
323
|
}
|
|
324
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
324
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
325
325
|
throw new Error("Autumn secret key or publishable key is required");
|
|
326
326
|
}
|
|
327
|
-
this.headers = {
|
|
327
|
+
this.headers = options?.headers || {
|
|
328
328
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
329
329
|
"Content-Type": "application/json"
|
|
330
330
|
};
|
|
@@ -343,12 +343,17 @@ var Autumn = class {
|
|
|
343
343
|
return toContainerResult(response);
|
|
344
344
|
}
|
|
345
345
|
async post(path, body) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
346
|
+
try {
|
|
347
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
348
|
+
method: "POST",
|
|
349
|
+
headers: this.headers,
|
|
350
|
+
body: JSON.stringify(body)
|
|
351
|
+
});
|
|
352
|
+
return toContainerResult(response);
|
|
353
|
+
} catch (error) {
|
|
354
|
+
console.error("Error sending request:", error);
|
|
355
|
+
throw error;
|
|
356
|
+
}
|
|
352
357
|
}
|
|
353
358
|
async delete(path) {
|
|
354
359
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -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,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
usePricingTable
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-5CBWPVSP.mjs";
|
|
6
|
+
import "../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,11 +1,11 @@
|
|
|
1
|
-
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-BQtmw21U.mjs';
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.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-
|
|
8
|
-
import '../entTypes-
|
|
6
|
+
import '../response-B5dHU3I9.mjs';
|
|
7
|
+
import '../cusTypes-Cf-s9PYP.mjs';
|
|
8
|
+
import '../entTypes-CV-165S-.mjs';
|
|
9
9
|
|
|
10
10
|
declare const usePricingTableProvider: ({ client, }: {
|
|
11
11
|
client: AutumnClient;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-DNcV0gAT.js';
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.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-
|
|
8
|
-
import '../entTypes-
|
|
6
|
+
import '../response-B1KyqUB9.js';
|
|
7
|
+
import '../cusTypes-Cf-s9PYP.js';
|
|
8
|
+
import '../entTypes-BbIk0Toa.js';
|
|
9
9
|
|
|
10
10
|
declare const usePricingTableProvider: ({ client, }: {
|
|
11
11
|
client: AutumnClient;
|
|
@@ -321,10 +321,10 @@ var Autumn = class {
|
|
|
321
321
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
322
322
|
} catch (error) {
|
|
323
323
|
}
|
|
324
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
324
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
325
325
|
throw new Error("Autumn secret key or publishable key is required");
|
|
326
326
|
}
|
|
327
|
-
this.headers = {
|
|
327
|
+
this.headers = options?.headers || {
|
|
328
328
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
329
329
|
"Content-Type": "application/json"
|
|
330
330
|
};
|
|
@@ -343,12 +343,17 @@ var Autumn = class {
|
|
|
343
343
|
return toContainerResult(response);
|
|
344
344
|
}
|
|
345
345
|
async post(path, body) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
346
|
+
try {
|
|
347
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
348
|
+
method: "POST",
|
|
349
|
+
headers: this.headers,
|
|
350
|
+
body: JSON.stringify(body)
|
|
351
|
+
});
|
|
352
|
+
return toContainerResult(response);
|
|
353
|
+
} catch (error) {
|
|
354
|
+
console.error("Error sending request:", error);
|
|
355
|
+
throw error;
|
|
356
|
+
}
|
|
352
357
|
}
|
|
353
358
|
async delete(path) {
|
|
354
359
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -4,13 +4,13 @@ export { useAutumn } from './hooks/useAutumn.mjs';
|
|
|
4
4
|
export { usePricingTable } from './hooks/usePricingTable.mjs';
|
|
5
5
|
export { useEntity } from './hooks/useEntity.mjs';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
|
-
import './cusTypes-
|
|
7
|
+
import './cusTypes-Cf-s9PYP.mjs';
|
|
8
8
|
import './hooks/useCustomerProvider.mjs';
|
|
9
|
-
import './ReactAutumnClient-
|
|
9
|
+
import './ReactAutumnClient-BQtmw21U.mjs';
|
|
10
10
|
import './client/types/clientReferralTypes.mjs';
|
|
11
11
|
import './client/types/clientEntTypes.mjs';
|
|
12
12
|
import './client/types/clientGenTypes.mjs';
|
|
13
|
-
import './response-
|
|
13
|
+
import './response-B5dHU3I9.mjs';
|
|
14
14
|
import './error-CG2LXoa7.mjs';
|
|
15
|
-
import './entTypes-
|
|
15
|
+
import './entTypes-CV-165S-.mjs';
|
|
16
16
|
import './client/types/clientPricingTableTypes.mjs';
|
|
@@ -4,13 +4,13 @@ export { useAutumn } from './hooks/useAutumn.js';
|
|
|
4
4
|
export { usePricingTable } from './hooks/usePricingTable.js';
|
|
5
5
|
export { useEntity } from './hooks/useEntity.js';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
|
-
import './cusTypes-
|
|
7
|
+
import './cusTypes-Cf-s9PYP.js';
|
|
8
8
|
import './hooks/useCustomerProvider.js';
|
|
9
|
-
import './ReactAutumnClient-
|
|
9
|
+
import './ReactAutumnClient-DNcV0gAT.js';
|
|
10
10
|
import './client/types/clientReferralTypes.js';
|
|
11
11
|
import './client/types/clientEntTypes.js';
|
|
12
12
|
import './client/types/clientGenTypes.js';
|
|
13
|
-
import './response-
|
|
13
|
+
import './response-B1KyqUB9.js';
|
|
14
14
|
import './error-CG2LXoa7.js';
|
|
15
|
-
import './entTypes-
|
|
15
|
+
import './entTypes-BbIk0Toa.js';
|
|
16
16
|
import './client/types/clientPricingTableTypes.js';
|
|
@@ -327,10 +327,10 @@ var Autumn = class {
|
|
|
327
327
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
328
328
|
} catch (error) {
|
|
329
329
|
}
|
|
330
|
-
if (!this.secretKey && !this.publishableKey) {
|
|
330
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
331
331
|
throw new Error("Autumn secret key or publishable key is required");
|
|
332
332
|
}
|
|
333
|
-
this.headers = {
|
|
333
|
+
this.headers = options?.headers || {
|
|
334
334
|
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
335
335
|
"Content-Type": "application/json"
|
|
336
336
|
};
|
|
@@ -349,12 +349,17 @@ var Autumn = class {
|
|
|
349
349
|
return toContainerResult(response);
|
|
350
350
|
}
|
|
351
351
|
async post(path, body) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
try {
|
|
353
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
354
|
+
method: "POST",
|
|
355
|
+
headers: this.headers,
|
|
356
|
+
body: JSON.stringify(body)
|
|
357
|
+
});
|
|
358
|
+
return toContainerResult(response);
|
|
359
|
+
} catch (error) {
|
|
360
|
+
console.error("Error sending request:", error);
|
|
361
|
+
throw error;
|
|
362
|
+
}
|
|
358
363
|
}
|
|
359
364
|
async delete(path) {
|
|
360
365
|
const response = await fetch(`${this.url}${path}`, {
|
|
@@ -1053,14 +1058,8 @@ var useAutumn = () => {
|
|
|
1053
1058
|
}
|
|
1054
1059
|
return result;
|
|
1055
1060
|
};
|
|
1056
|
-
const cancel = async ({
|
|
1057
|
-
|
|
1058
|
-
entityId
|
|
1059
|
-
}) => {
|
|
1060
|
-
const res = await client.cancel({
|
|
1061
|
-
productId,
|
|
1062
|
-
entityId
|
|
1063
|
-
});
|
|
1061
|
+
const cancel = async (params) => {
|
|
1062
|
+
const res = await client.cancel(params);
|
|
1064
1063
|
if (res.error) {
|
|
1065
1064
|
return res;
|
|
1066
1065
|
}
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useEntity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RIXRUJDK.mjs";
|
|
6
6
|
import {
|
|
7
7
|
usePricingTable
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5CBWPVSP.mjs";
|
|
9
9
|
import "./chunk-VN4AVW2V.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useAutumn
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WPXLFYWT.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useCustomer
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DFXUEQ6D.mjs";
|
|
16
16
|
import {
|
|
17
17
|
ReactAutumnProvider
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-CZAUMPWK.mjs";
|
|
19
|
+
import "./chunk-4TTWSWW7.mjs";
|
|
20
20
|
import "./chunk-4QPHNIQ7.mjs";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-Q5SSQSDP.mjs";
|
|
22
|
+
import "./chunk-URAFNMTH.mjs";
|
|
23
23
|
import "./chunk-PIIGEXKQ.mjs";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-XTEUMENO.mjs";
|
|
25
|
+
import "./chunk-XXOQMNM6.mjs";
|
|
26
|
+
import "./chunk-OCZFV7OX.mjs";
|
|
27
27
|
import "./chunk-LS3NB4DU.mjs";
|
|
28
28
|
import "./chunk-TBCLSIC2.mjs";
|
|
29
29
|
import "./chunk-NZ5PEXT2.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AppEnv, I as Infinite, P as ProductItemIntervalType, U as UsageModel, F as FreeTrialDuration, g as UsageModelType, C as CustomerData } from './cusTypes-
|
|
1
|
+
import { A as AppEnv, I as Infinite, P as ProductItemIntervalType, U as UsageModel, F as FreeTrialDuration, g as UsageModelType, C as CustomerData } from './cusTypes-Cf-s9PYP.js';
|
|
2
2
|
import { A as AutumnError } from './error-CG2LXoa7.js';
|
|
3
3
|
|
|
4
4
|
interface ProductItem {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AppEnv, I as Infinite, P as ProductItemIntervalType, U as UsageModel, F as FreeTrialDuration, g as UsageModelType, C as CustomerData } from './cusTypes-
|
|
1
|
+
import { A as AppEnv, I as Infinite, P as ProductItemIntervalType, U as UsageModel, F as FreeTrialDuration, g as UsageModelType, C as CustomerData } from './cusTypes-Cf-s9PYP.mjs';
|
|
2
2
|
import { A as AutumnError } from './error-CG2LXoa7.mjs';
|
|
3
3
|
|
|
4
4
|
interface ProductItem {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { AutumnContextParams } from './types.mjs';
|
|
3
|
-
import './cusTypes-
|
|
4
|
-
import './entTypes-
|
|
3
|
+
import './cusTypes-sh5_cN7N.mjs';
|
|
4
|
+
import './entTypes-C9TNWMk6.mjs';
|
|
5
5
|
|
|
6
6
|
declare const AutumnContext: react.Context<AutumnContextParams>;
|
|
7
7
|
declare const useAutumnContext: () => AutumnContextParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { AutumnContextParams } from './types.js';
|
|
3
|
-
import './cusTypes-
|
|
4
|
-
import './entTypes-
|
|
3
|
+
import './cusTypes-sh5_cN7N.js';
|
|
4
|
+
import './entTypes-BDqnMLZ4.js';
|
|
5
5
|
|
|
6
6
|
declare const AutumnContext: react.Context<AutumnContextParams>;
|
|
7
7
|
declare const useAutumnContext: () => AutumnContextParams;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AutumnClientError, PricingTableProduct } from './types.mjs';
|
|
2
|
-
import './cusTypes-
|
|
3
|
-
import './entTypes-
|
|
2
|
+
import './cusTypes-sh5_cN7N.mjs';
|
|
3
|
+
import './entTypes-C9TNWMk6.mjs';
|
|
4
4
|
|
|
5
5
|
declare const toClientErrorResponse: (error: any) => {
|
|
6
6
|
data: null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AutumnClientError, PricingTableProduct } from './types.js';
|
|
2
|
-
import './cusTypes-
|
|
3
|
-
import './entTypes-
|
|
2
|
+
import './cusTypes-sh5_cN7N.js';
|
|
3
|
+
import './entTypes-BDqnMLZ4.js';
|
|
4
4
|
|
|
5
5
|
declare const toClientErrorResponse: (error: any) => {
|
|
6
6
|
data: null;
|
|
@@ -2,6 +2,11 @@ import { AttachParams } from './types.mjs';
|
|
|
2
2
|
import { E as EntityDataParams } from '../clientEntTypes-pqnB95m3.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
|
+
interface CancelParams {
|
|
6
|
+
productId: string;
|
|
7
|
+
entityId?: string;
|
|
8
|
+
cancelImmediately?: boolean;
|
|
9
|
+
}
|
|
5
10
|
interface TrackParams {
|
|
6
11
|
featureId?: string;
|
|
7
12
|
eventName?: string;
|
|
@@ -24,10 +29,7 @@ declare const useAutumn: () => {
|
|
|
24
29
|
entityData?: EntityDataParams;
|
|
25
30
|
}) => Promise<any>;
|
|
26
31
|
track: (params: TrackParams) => Promise<any>;
|
|
27
|
-
cancel: (
|
|
28
|
-
productId: string;
|
|
29
|
-
entityId?: string;
|
|
30
|
-
}) => Promise<any>;
|
|
32
|
+
cancel: (params: CancelParams) => Promise<any>;
|
|
31
33
|
openBillingPortal: (options?: {
|
|
32
34
|
returnUrl?: string;
|
|
33
35
|
}) => Promise<any>;
|
|
@@ -2,6 +2,11 @@ import { AttachParams } from './types.js';
|
|
|
2
2
|
import { E as EntityDataParams } from '../clientEntTypes-pqnB95m3.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
|
+
interface CancelParams {
|
|
6
|
+
productId: string;
|
|
7
|
+
entityId?: string;
|
|
8
|
+
cancelImmediately?: boolean;
|
|
9
|
+
}
|
|
5
10
|
interface TrackParams {
|
|
6
11
|
featureId?: string;
|
|
7
12
|
eventName?: string;
|
|
@@ -24,10 +29,7 @@ declare const useAutumn: () => {
|
|
|
24
29
|
entityData?: EntityDataParams;
|
|
25
30
|
}) => Promise<any>;
|
|
26
31
|
track: (params: TrackParams) => Promise<any>;
|
|
27
|
-
cancel: (
|
|
28
|
-
productId: string;
|
|
29
|
-
entityId?: string;
|
|
30
|
-
}) => Promise<any>;
|
|
32
|
+
cancel: (params: CancelParams) => Promise<any>;
|
|
31
33
|
openBillingPortal: (options?: {
|
|
32
34
|
returnUrl?: string;
|
|
33
35
|
}) => Promise<any>;
|
|
@@ -143,14 +143,10 @@ const useAutumn = () => {
|
|
|
143
143
|
}
|
|
144
144
|
return result;
|
|
145
145
|
};
|
|
146
|
-
const cancel = async ({
|
|
147
|
-
productId,
|
|
148
|
-
entityId
|
|
149
|
-
}) => {
|
|
146
|
+
const cancel = async (params) => {
|
|
150
147
|
const res = await cancelAction({
|
|
151
148
|
encryptedCustomerId,
|
|
152
|
-
|
|
153
|
-
entityId
|
|
149
|
+
...params
|
|
154
150
|
});
|
|
155
151
|
if (res.error) {
|
|
156
152
|
return toClientErrorResponse(res.error);
|
|
@@ -143,14 +143,10 @@ const useAutumn = () => {
|
|
|
143
143
|
}
|
|
144
144
|
return result;
|
|
145
145
|
};
|
|
146
|
-
const cancel = async ({
|
|
147
|
-
productId,
|
|
148
|
-
entityId
|
|
149
|
-
}) => {
|
|
146
|
+
const cancel = async (params) => {
|
|
150
147
|
const res = await cancelAction({
|
|
151
148
|
encryptedCustomerId,
|
|
152
|
-
|
|
153
|
-
entityId
|
|
149
|
+
...params
|
|
154
150
|
});
|
|
155
151
|
if (res.error) {
|
|
156
152
|
return toClientErrorResponse(res.error);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as CustomerExpandOption, C as CustomerData, b as Customer } from '../cusTypes-
|
|
1
|
+
import { a as CustomerExpandOption, C as CustomerData, b as Customer } from '../cusTypes-sh5_cN7N.mjs';
|
|
2
2
|
import { CreateEntityParams } from './types.mjs';
|
|
3
3
|
import { AutumnClientError } from '../types.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../clientEntTypes-pqnB95m3.mjs';
|
|
6
|
-
import '../entTypes-
|
|
6
|
+
import '../entTypes-C9TNWMk6.mjs';
|
|
7
7
|
|
|
8
8
|
interface UseCustomerProps {
|
|
9
9
|
expand?: CustomerExpandOption[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as CustomerExpandOption, C as CustomerData, b as Customer } from '../cusTypes-
|
|
1
|
+
import { a as CustomerExpandOption, C as CustomerData, b as Customer } from '../cusTypes-sh5_cN7N.js';
|
|
2
2
|
import { CreateEntityParams } from './types.js';
|
|
3
3
|
import { AutumnClientError } from '../types.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../clientEntTypes-pqnB95m3.js';
|
|
6
|
-
import '../entTypes-
|
|
6
|
+
import '../entTypes-BDqnMLZ4.js';
|
|
7
7
|
|
|
8
8
|
interface UseCustomerProps {
|
|
9
9
|
expand?: CustomerExpandOption[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as swr from 'swr';
|
|
2
|
-
import { G as GetEntityParams } from '../entTypes-
|
|
3
|
-
import '../cusTypes-
|
|
2
|
+
import { G as GetEntityParams } from '../entTypes-C9TNWMk6.mjs';
|
|
3
|
+
import '../cusTypes-sh5_cN7N.mjs';
|
|
4
4
|
|
|
5
5
|
declare const useEntity: (entityId?: string, params?: GetEntityParams) => {
|
|
6
6
|
entity: any;
|