autumn-js 0.0.52 → 0.0.54
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/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/{referralTypes-d9F2CFOg.d.mts → referralTypes-BSYw6Jo-.d.mts} +2 -2
- package/dist/libraries/backend/{referralTypes-BeAYZaem.d.ts → referralTypes-CclnEklS.d.ts} +2 -2
- package/dist/libraries/backend/routes/backendRouter.d.mts +1 -1
- package/dist/libraries/backend/routes/backendRouter.d.ts +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/react/AutumnContext.d.mts +2 -2
- package/dist/libraries/react/AutumnContext.d.ts +2 -2
- package/dist/libraries/react/BaseAutumnProvider.d.mts +2 -2
- package/dist/libraries/react/BaseAutumnProvider.d.ts +2 -2
- package/dist/libraries/react/{ReactAutumnClient-CrVvYcoL.d.ts → ReactAutumnClient-U2y0dW1p.d.ts} +1 -1
- package/dist/libraries/react/{ReactAutumnClient-6_K0K8uN.d.mts → ReactAutumnClient-zXHlqOBg.d.mts} +1 -1
- package/dist/libraries/react/{chunk-CZDMG3HO.mjs → chunk-WCVQJZIX.mjs} +7 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +2 -2
- package/dist/libraries/react/client/clientCompMethods.d.mts +2 -2
- package/dist/libraries/react/client/clientCompMethods.d.ts +2 -2
- package/dist/libraries/react/client/clientCusMethods.d.mts +2 -2
- package/dist/libraries/react/client/clientCusMethods.d.ts +2 -2
- package/dist/libraries/react/client/clientEntityMethods.d.mts +2 -2
- package/dist/libraries/react/client/clientEntityMethods.d.ts +2 -2
- package/dist/libraries/react/client/clientGenMethods.d.mts +2 -2
- package/dist/libraries/react/client/clientGenMethods.d.ts +2 -2
- package/dist/libraries/react/client/clientReferralMethods.d.mts +2 -2
- package/dist/libraries/react/client/clientReferralMethods.d.ts +2 -2
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +2 -1
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +2 -1
- package/dist/libraries/react/hooks/useAutumn.d.mts +1 -1
- package/dist/libraries/react/hooks/useAutumn.d.ts +1 -1
- package/dist/libraries/react/hooks/useAutumn.js +7 -2
- package/dist/libraries/react/hooks/useAutumn.mjs +1 -1
- package/dist/libraries/react/hooks/useCustomer.d.mts +2 -2
- package/dist/libraries/react/hooks/useCustomer.d.ts +2 -2
- package/dist/libraries/react/hooks/useCustomerProvider.d.mts +2 -2
- package/dist/libraries/react/hooks/useCustomerProvider.d.ts +2 -2
- package/dist/libraries/react/hooks/useEntityProvider.d.mts +2 -2
- package/dist/libraries/react/hooks/useEntityProvider.d.ts +2 -2
- package/dist/libraries/react/hooks/usePricingTableProvider.d.mts +2 -2
- package/dist/libraries/react/hooks/usePricingTableProvider.d.ts +2 -2
- package/dist/libraries/react/index.d.mts +2 -2
- package/dist/libraries/react/index.d.ts +2 -2
- package/dist/libraries/react/index.js +7 -2
- package/dist/libraries/react/index.mjs +1 -1
- package/dist/libraries/react/{response-DWkhXkVL.d.mts → response-C_a68gs9.d.mts} +1 -1
- package/dist/libraries/react/{response-nVwSEz-O.d.ts → response-CcT2liD_.d.ts} +1 -1
- 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 +3 -3
- package/dist/next/client/hooks/useAutumn.d.ts +3 -3
- package/dist/next/client/hooks/useAutumn.js +15 -7
- package/dist/next/client/hooks/useAutumn.mjs +15 -7
- package/dist/next/index.d.mts +4 -3
- package/dist/next/index.d.ts +4 -3
- package/dist/next/server/{clientEntTypes-BUB62khr.d.mts → clientEntTypes-BmcLKJxV.d.mts} +2 -2
- package/dist/next/server/{clientEntTypes-Bk9vSoWW.d.ts → clientEntTypes-DHpBjJUt.d.ts} +2 -2
- 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 +2 -2
- package/dist/next/server/genActions.d.ts +2 -2
- package/dist/next/server/genActions.js +2 -2
- package/dist/next/server/genActions.mjs +2 -2
- package/dist/sdk/general.d.mts +2 -2
- package/dist/sdk/general.d.ts +2 -2
- package/package.json +1 -1
package/dist/libraries/backend/{referralTypes-d9F2CFOg.d.mts → referralTypes-BSYw6Jo-.d.mts}
RENAMED
|
@@ -287,7 +287,7 @@ interface CheckParams {
|
|
|
287
287
|
product_id?: string;
|
|
288
288
|
entity_id?: string;
|
|
289
289
|
customer_data?: CustomerData;
|
|
290
|
-
|
|
290
|
+
required_balance?: number;
|
|
291
291
|
send_event?: boolean;
|
|
292
292
|
with_preview?: "raw" | "formatted";
|
|
293
293
|
entity_data?: EntityData;
|
|
@@ -297,7 +297,7 @@ interface CheckResult {
|
|
|
297
297
|
allowed: boolean;
|
|
298
298
|
code: string;
|
|
299
299
|
feature_id?: string;
|
|
300
|
-
|
|
300
|
+
required_balance?: number;
|
|
301
301
|
unlimited?: boolean;
|
|
302
302
|
balance?: number | null;
|
|
303
303
|
product_id?: string;
|
|
@@ -287,7 +287,7 @@ interface CheckParams {
|
|
|
287
287
|
product_id?: string;
|
|
288
288
|
entity_id?: string;
|
|
289
289
|
customer_data?: CustomerData;
|
|
290
|
-
|
|
290
|
+
required_balance?: number;
|
|
291
291
|
send_event?: boolean;
|
|
292
292
|
with_preview?: "raw" | "formatted";
|
|
293
293
|
entity_data?: EntityData;
|
|
@@ -297,7 +297,7 @@ interface CheckResult {
|
|
|
297
297
|
allowed: boolean;
|
|
298
298
|
code: string;
|
|
299
299
|
feature_id?: string;
|
|
300
|
-
|
|
300
|
+
required_balance?: number;
|
|
301
301
|
unlimited?: boolean;
|
|
302
302
|
balance?: number | null;
|
|
303
303
|
product_id?: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
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-zXHlqOBg.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-
|
|
8
|
+
import './response-C_a68gs9.mjs';
|
|
9
9
|
import './cusTypes-Dtfv_ZQO.mjs';
|
|
10
10
|
import './entTypes-DkM1ogDb.mjs';
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
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-U2y0dW1p.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-
|
|
8
|
+
import './response-CcT2liD_.js';
|
|
9
9
|
import './cusTypes-Dtfv_ZQO.js';
|
|
10
10
|
import './entTypes-Cg52AqdY.js';
|
|
11
11
|
|
|
@@ -1,9 +1,9 @@
|
|
|
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-zXHlqOBg.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-
|
|
6
|
+
import './response-C_a68gs9.mjs';
|
|
7
7
|
import './cusTypes-Dtfv_ZQO.mjs';
|
|
8
8
|
import './error-CG2LXoa7.mjs';
|
|
9
9
|
import './entTypes-DkM1ogDb.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
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-U2y0dW1p.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-
|
|
6
|
+
import './response-CcT2liD_.js';
|
|
7
7
|
import './cusTypes-Dtfv_ZQO.js';
|
|
8
8
|
import './error-CG2LXoa7.js';
|
|
9
9
|
import './entTypes-Cg52AqdY.js';
|
package/dist/libraries/react/{ReactAutumnClient-CrVvYcoL.d.ts → ReactAutumnClient-U2y0dW1p.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
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-CcT2liD_.js';
|
|
5
5
|
import { A as AutumnError } from './error-CG2LXoa7.js';
|
|
6
6
|
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResponse } from './cusTypes-Dtfv_ZQO.js';
|
|
7
7
|
import { E as Entity, D as DeleteEntityResult } from './entTypes-Cg52AqdY.js';
|
package/dist/libraries/react/{ReactAutumnClient-6_K0K8uN.d.mts → ReactAutumnClient-zXHlqOBg.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
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-C_a68gs9.mjs';
|
|
5
5
|
import { A as AutumnError } from './error-CG2LXoa7.mjs';
|
|
6
6
|
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResponse } from './cusTypes-Dtfv_ZQO.mjs';
|
|
7
7
|
import { E as Entity, D as DeleteEntityResult } from './entTypes-DkM1ogDb.mjs';
|
|
@@ -59,7 +59,8 @@ var useAutumn = () => {
|
|
|
59
59
|
metadata,
|
|
60
60
|
dialog,
|
|
61
61
|
callback,
|
|
62
|
-
entityData
|
|
62
|
+
entityData,
|
|
63
|
+
openInNewTab
|
|
63
64
|
} = params;
|
|
64
65
|
if (dialog) {
|
|
65
66
|
setProdChangeComponent(dialog);
|
|
@@ -81,7 +82,11 @@ var useAutumn = () => {
|
|
|
81
82
|
}
|
|
82
83
|
let data = result.data;
|
|
83
84
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
84
|
-
|
|
85
|
+
if (openInNewTab) {
|
|
86
|
+
window.open(data.checkout_url, "_blank");
|
|
87
|
+
} else {
|
|
88
|
+
window.location.href = data.checkout_url;
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
91
|
try {
|
|
87
92
|
await callback?.();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './types/clientReferralTypes.mjs';
|
|
2
2
|
import './types/clientEntTypes.mjs';
|
|
3
3
|
import './types/clientGenTypes.mjs';
|
|
4
|
-
import '../response-
|
|
4
|
+
import '../response-C_a68gs9.mjs';
|
|
5
5
|
import '../error-CG2LXoa7.mjs';
|
|
6
6
|
import '../cusTypes-Dtfv_ZQO.mjs';
|
|
7
|
-
export { A as AutumnClient, E as ErrorResponse, O as OmitCustomerType } from '../ReactAutumnClient-
|
|
7
|
+
export { A as AutumnClient, E as ErrorResponse, O as OmitCustomerType } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
8
8
|
import '../entTypes-DkM1ogDb.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './types/clientReferralTypes.js';
|
|
2
2
|
import './types/clientEntTypes.js';
|
|
3
3
|
import './types/clientGenTypes.js';
|
|
4
|
-
import '../response-
|
|
4
|
+
import '../response-CcT2liD_.js';
|
|
5
5
|
import '../error-CG2LXoa7.js';
|
|
6
6
|
import '../cusTypes-Dtfv_ZQO.js';
|
|
7
|
-
export { A as AutumnClient, E as ErrorResponse, O as OmitCustomerType } from '../ReactAutumnClient-
|
|
7
|
+
export { A as AutumnClient, E as ErrorResponse, O as OmitCustomerType } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
8
8
|
import '../entTypes-Cg52AqdY.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-
|
|
2
|
-
import { A as AutumnPromise } from '../response-
|
|
1
|
+
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
2
|
+
import { A as AutumnPromise } from '../response-C_a68gs9.mjs';
|
|
3
3
|
import './types/clientReferralTypes.mjs';
|
|
4
4
|
import './types/clientEntTypes.mjs';
|
|
5
5
|
import './types/clientGenTypes.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-
|
|
2
|
-
import { A as AutumnPromise } from '../response-
|
|
1
|
+
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
2
|
+
import { A as AutumnPromise } from '../response-CcT2liD_.js';
|
|
3
3
|
import './types/clientReferralTypes.js';
|
|
4
4
|
import './types/clientEntTypes.js';
|
|
5
5
|
import './types/clientGenTypes.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AutumnClient, O as OmitCustomerType } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient, O as OmitCustomerType } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
2
2
|
import { a as CreateCustomerParams, b as Customer } from '../cusTypes-Dtfv_ZQO.mjs';
|
|
3
|
-
import { A as AutumnPromise } from '../response-
|
|
3
|
+
import { A as AutumnPromise } from '../response-C_a68gs9.mjs';
|
|
4
4
|
import './types/clientReferralTypes.mjs';
|
|
5
5
|
import './types/clientEntTypes.mjs';
|
|
6
6
|
import './types/clientGenTypes.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AutumnClient, O as OmitCustomerType } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient, O as OmitCustomerType } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
2
2
|
import { a as CreateCustomerParams, b as Customer } from '../cusTypes-Dtfv_ZQO.js';
|
|
3
|
-
import { A as AutumnPromise } from '../response-
|
|
3
|
+
import { A as AutumnPromise } from '../response-CcT2liD_.js';
|
|
4
4
|
import './types/clientReferralTypes.js';
|
|
5
5
|
import './types/clientEntTypes.js';
|
|
6
6
|
import './types/clientGenTypes.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as Entity, D as DeleteEntityResult } from '../entTypes-DkM1ogDb.mjs';
|
|
2
|
-
import { A as AutumnPromise } from '../response-
|
|
3
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
2
|
+
import { A as AutumnPromise } from '../response-C_a68gs9.mjs';
|
|
3
|
+
import { A as AutumnClient } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
4
4
|
import { CreateEntityParams, GetEntityParams } from './types/clientEntTypes.mjs';
|
|
5
5
|
import '../cusTypes-Dtfv_ZQO.mjs';
|
|
6
6
|
import '../error-CG2LXoa7.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as Entity, D as DeleteEntityResult } from '../entTypes-Cg52AqdY.js';
|
|
2
|
-
import { A as AutumnPromise } from '../response-
|
|
3
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
2
|
+
import { A as AutumnPromise } from '../response-CcT2liD_.js';
|
|
3
|
+
import { A as AutumnClient } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
4
4
|
import { CreateEntityParams, GetEntityParams } from './types/clientEntTypes.js';
|
|
5
5
|
import '../cusTypes-Dtfv_ZQO.js';
|
|
6
6
|
import '../error-CG2LXoa7.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
2
2
|
import { AttachParams, CancelParams, CheckParams, TrackParams, OpenBillingPortalParams } from './types/clientGenTypes.mjs';
|
|
3
|
-
import { A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from '../response-
|
|
3
|
+
import { A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from '../response-C_a68gs9.mjs';
|
|
4
4
|
import { B as BillingPortalResponse } from '../cusTypes-Dtfv_ZQO.mjs';
|
|
5
5
|
import './types/clientReferralTypes.mjs';
|
|
6
6
|
import './types/clientEntTypes.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
2
2
|
import { AttachParams, CancelParams, CheckParams, TrackParams, OpenBillingPortalParams } from './types/clientGenTypes.js';
|
|
3
|
-
import { A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from '../response-
|
|
3
|
+
import { A as AutumnPromise, a as AttachResult, C as CancelResult, b as CheckResult, T as TrackResult } from '../response-CcT2liD_.js';
|
|
4
4
|
import { B as BillingPortalResponse } from '../cusTypes-Dtfv_ZQO.js';
|
|
5
5
|
import './types/clientReferralTypes.js';
|
|
6
6
|
import './types/clientEntTypes.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AutumnPromise } from '../response-
|
|
2
|
-
import { A as AutumnClient, C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnPromise } from '../response-C_a68gs9.mjs';
|
|
2
|
+
import { A as AutumnClient, C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
3
3
|
import { CreateReferralCodeParams, RedeemReferralCodeParams } from './types/clientReferralTypes.mjs';
|
|
4
4
|
import '../cusTypes-Dtfv_ZQO.mjs';
|
|
5
5
|
import '../error-CG2LXoa7.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AutumnPromise } from '../response-
|
|
2
|
-
import { A as AutumnClient, C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnPromise } from '../response-CcT2liD_.js';
|
|
2
|
+
import { A as AutumnClient, C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
3
3
|
import { CreateReferralCodeParams, RedeemReferralCodeParams } from './types/clientReferralTypes.js';
|
|
4
4
|
import '../cusTypes-Dtfv_ZQO.js';
|
|
5
5
|
import '../error-CG2LXoa7.js';
|
|
@@ -16,6 +16,7 @@ interface AttachParams {
|
|
|
16
16
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
|
17
17
|
callback?: () => Promise<void> | void;
|
|
18
18
|
entityData?: EntityDataParams;
|
|
19
|
+
openInNewTab?: boolean;
|
|
19
20
|
}
|
|
20
21
|
interface CancelParams {
|
|
21
22
|
productId: string;
|
|
@@ -25,7 +26,7 @@ interface CheckParams {
|
|
|
25
26
|
featureId?: string;
|
|
26
27
|
productId?: string;
|
|
27
28
|
entityId?: string;
|
|
28
|
-
|
|
29
|
+
requiredBalance?: number;
|
|
29
30
|
sendEvent?: boolean;
|
|
30
31
|
withPreview?: "formatted" | "raw";
|
|
31
32
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
|
@@ -16,6 +16,7 @@ interface AttachParams {
|
|
|
16
16
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
|
17
17
|
callback?: () => Promise<void> | void;
|
|
18
18
|
entityData?: EntityDataParams;
|
|
19
|
+
openInNewTab?: boolean;
|
|
19
20
|
}
|
|
20
21
|
interface CancelParams {
|
|
21
22
|
productId: string;
|
|
@@ -25,7 +26,7 @@ interface CheckParams {
|
|
|
25
26
|
featureId?: string;
|
|
26
27
|
productId?: string;
|
|
27
28
|
entityId?: string;
|
|
28
|
-
|
|
29
|
+
requiredBalance?: number;
|
|
29
30
|
sendEvent?: boolean;
|
|
30
31
|
withPreview?: "formatted" | "raw";
|
|
31
32
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Result, a as AttachResult, b as CheckResult, T as TrackResult, C as CancelResult } from '../response-
|
|
1
|
+
import { R as Result, a as AttachResult, b as CheckResult, T as TrackResult, C as CancelResult } from '../response-C_a68gs9.mjs';
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.mjs';
|
|
3
3
|
import { B as BillingPortalResponse } from '../cusTypes-Dtfv_ZQO.mjs';
|
|
4
4
|
import { AttachParams, CheckParams, TrackParams, OpenBillingPortalParams } from '../client/types/clientGenTypes.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Result, a as AttachResult, b as CheckResult, T as TrackResult, C as CancelResult } from '../response-
|
|
1
|
+
import { R as Result, a as AttachResult, b as CheckResult, T as TrackResult, C as CancelResult } from '../response-CcT2liD_.js';
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.js';
|
|
3
3
|
import { B as BillingPortalResponse } from '../cusTypes-Dtfv_ZQO.js';
|
|
4
4
|
import { AttachParams, CheckParams, TrackParams, OpenBillingPortalParams } from '../client/types/clientGenTypes.js';
|
|
@@ -725,7 +725,8 @@ var useAutumn = () => {
|
|
|
725
725
|
metadata,
|
|
726
726
|
dialog,
|
|
727
727
|
callback,
|
|
728
|
-
entityData
|
|
728
|
+
entityData,
|
|
729
|
+
openInNewTab
|
|
729
730
|
} = params;
|
|
730
731
|
if (dialog) {
|
|
731
732
|
setProdChangeComponent(dialog);
|
|
@@ -747,7 +748,11 @@ var useAutumn = () => {
|
|
|
747
748
|
}
|
|
748
749
|
let data = result.data;
|
|
749
750
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
750
|
-
|
|
751
|
+
if (openInNewTab) {
|
|
752
|
+
window.open(data.checkout_url, "_blank");
|
|
753
|
+
} else {
|
|
754
|
+
window.location.href = data.checkout_url;
|
|
755
|
+
}
|
|
751
756
|
}
|
|
752
757
|
try {
|
|
753
758
|
await callback?.();
|
|
@@ -2,8 +2,8 @@ import { UseCustomerParams } from './useCustomerProvider.mjs';
|
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.mjs';
|
|
3
3
|
import { b as Customer } from '../cusTypes-Dtfv_ZQO.mjs';
|
|
4
4
|
import { E as Entity } from '../entTypes-DkM1ogDb.mjs';
|
|
5
|
-
import { A as AutumnPromise } from '../response-
|
|
6
|
-
import { C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-
|
|
5
|
+
import { A as AutumnPromise } from '../response-C_a68gs9.mjs';
|
|
6
|
+
import { C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
7
7
|
import { CreateEntityParams } from '../client/types/clientEntTypes.mjs';
|
|
8
8
|
import { CreateReferralCodeParams, RedeemReferralCodeParams } from '../client/types/clientReferralTypes.mjs';
|
|
9
9
|
import '../client/types/clientGenTypes.mjs';
|
|
@@ -2,8 +2,8 @@ import { UseCustomerParams } from './useCustomerProvider.js';
|
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.js';
|
|
3
3
|
import { b as Customer } from '../cusTypes-Dtfv_ZQO.js';
|
|
4
4
|
import { E as Entity } from '../entTypes-Cg52AqdY.js';
|
|
5
|
-
import { A as AutumnPromise } from '../response-
|
|
6
|
-
import { C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-
|
|
5
|
+
import { A as AutumnPromise } from '../response-CcT2liD_.js';
|
|
6
|
+
import { C as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
7
7
|
import { CreateEntityParams } from '../client/types/clientEntTypes.js';
|
|
8
8
|
import { CreateReferralCodeParams, RedeemReferralCodeParams } from '../client/types/clientReferralTypes.js';
|
|
9
9
|
import '../client/types/clientGenTypes.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.mjs';
|
|
3
3
|
import { c as CustomerExpandOption, b as Customer } from '../cusTypes-Dtfv_ZQO.mjs';
|
|
4
4
|
import '../client/types/clientReferralTypes.mjs';
|
|
5
5
|
import '../client/types/clientEntTypes.mjs';
|
|
6
6
|
import '../client/types/clientGenTypes.mjs';
|
|
7
|
-
import '../response-
|
|
7
|
+
import '../response-C_a68gs9.mjs';
|
|
8
8
|
import '../entTypes-DkM1ogDb.mjs';
|
|
9
9
|
|
|
10
10
|
interface UseCustomerParams {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
2
2
|
import { A as AutumnError } from '../error-CG2LXoa7.js';
|
|
3
3
|
import { c as CustomerExpandOption, b as Customer } from '../cusTypes-Dtfv_ZQO.js';
|
|
4
4
|
import '../client/types/clientReferralTypes.js';
|
|
5
5
|
import '../client/types/clientEntTypes.js';
|
|
6
6
|
import '../client/types/clientGenTypes.js';
|
|
7
|
-
import '../response-
|
|
7
|
+
import '../response-CcT2liD_.js';
|
|
8
8
|
import '../entTypes-Cg52AqdY.js';
|
|
9
9
|
|
|
10
10
|
interface UseCustomerParams {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as AutumnError } from '../error-CG2LXoa7.mjs';
|
|
2
2
|
import { E as Entity } from '../entTypes-DkM1ogDb.mjs';
|
|
3
3
|
import { GetEntityParams } from '../client/types/clientEntTypes.mjs';
|
|
4
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
4
|
+
import { A as AutumnClient } from '../ReactAutumnClient-zXHlqOBg.mjs';
|
|
5
5
|
import '../cusTypes-Dtfv_ZQO.mjs';
|
|
6
6
|
import '../client/types/clientReferralTypes.mjs';
|
|
7
7
|
import '../client/types/clientGenTypes.mjs';
|
|
8
|
-
import '../response-
|
|
8
|
+
import '../response-C_a68gs9.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
2
|
import { E as Entity } from '../entTypes-Cg52AqdY.js';
|
|
3
3
|
import { GetEntityParams } from '../client/types/clientEntTypes.js';
|
|
4
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
4
|
+
import { A as AutumnClient } from '../ReactAutumnClient-U2y0dW1p.js';
|
|
5
5
|
import '../cusTypes-Dtfv_ZQO.js';
|
|
6
6
|
import '../client/types/clientReferralTypes.js';
|
|
7
7
|
import '../client/types/clientGenTypes.js';
|
|
8
|
-
import '../response-
|
|
8
|
+
import '../response-CcT2liD_.js';
|
|
9
9
|
|
|
10
10
|
interface EntityProvider {
|
|
11
11
|
entity: Entity | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-zXHlqOBg.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-
|
|
6
|
+
import '../response-C_a68gs9.mjs';
|
|
7
7
|
import '../cusTypes-Dtfv_ZQO.mjs';
|
|
8
8
|
import '../entTypes-DkM1ogDb.mjs';
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-
|
|
1
|
+
import { A as AutumnClient, P as PricingTableProduct } from '../ReactAutumnClient-U2y0dW1p.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-
|
|
6
|
+
import '../response-CcT2liD_.js';
|
|
7
7
|
import '../cusTypes-Dtfv_ZQO.js';
|
|
8
8
|
import '../entTypes-Cg52AqdY.js';
|
|
9
9
|
|
|
@@ -6,11 +6,11 @@ export { useEntity } from './hooks/useEntity.mjs';
|
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
7
|
import './cusTypes-Dtfv_ZQO.mjs';
|
|
8
8
|
import './hooks/useCustomerProvider.mjs';
|
|
9
|
-
import './ReactAutumnClient-
|
|
9
|
+
import './ReactAutumnClient-zXHlqOBg.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-C_a68gs9.mjs';
|
|
14
14
|
import './error-CG2LXoa7.mjs';
|
|
15
15
|
import './entTypes-DkM1ogDb.mjs';
|
|
16
16
|
import './client/types/clientPricingTableTypes.mjs';
|
|
@@ -6,11 +6,11 @@ export { useEntity } from './hooks/useEntity.js';
|
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
7
|
import './cusTypes-Dtfv_ZQO.js';
|
|
8
8
|
import './hooks/useCustomerProvider.js';
|
|
9
|
-
import './ReactAutumnClient-
|
|
9
|
+
import './ReactAutumnClient-U2y0dW1p.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-CcT2liD_.js';
|
|
14
14
|
import './error-CG2LXoa7.js';
|
|
15
15
|
import './entTypes-Cg52AqdY.js';
|
|
16
16
|
import './client/types/clientPricingTableTypes.js';
|
|
@@ -1028,7 +1028,8 @@ var useAutumn = () => {
|
|
|
1028
1028
|
metadata,
|
|
1029
1029
|
dialog,
|
|
1030
1030
|
callback,
|
|
1031
|
-
entityData
|
|
1031
|
+
entityData,
|
|
1032
|
+
openInNewTab
|
|
1032
1033
|
} = params;
|
|
1033
1034
|
if (dialog) {
|
|
1034
1035
|
setProdChangeComponent(dialog);
|
|
@@ -1050,7 +1051,11 @@ var useAutumn = () => {
|
|
|
1050
1051
|
}
|
|
1051
1052
|
let data = result.data;
|
|
1052
1053
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
1053
|
-
|
|
1054
|
+
if (openInNewTab) {
|
|
1055
|
+
window.open(data.checkout_url, "_blank");
|
|
1056
|
+
} else {
|
|
1057
|
+
window.location.href = data.checkout_url;
|
|
1058
|
+
}
|
|
1054
1059
|
}
|
|
1055
1060
|
try {
|
|
1056
1061
|
await callback?.();
|
|
@@ -12,12 +12,12 @@ interface TrackParams {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
declare const useAutumn: () => {
|
|
15
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
16
|
-
check: ({ featureId, productId, entityId,
|
|
15
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
16
|
+
check: ({ featureId, productId, entityId, requiredBalance, sendEvent, withPreview, dialog, entityData, }: {
|
|
17
17
|
featureId?: string;
|
|
18
18
|
productId?: string;
|
|
19
19
|
entityId?: string;
|
|
20
|
-
|
|
20
|
+
requiredBalance?: number;
|
|
21
21
|
sendEvent?: boolean;
|
|
22
22
|
withPreview?: "formatted" | "raw";
|
|
23
23
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
|
@@ -12,12 +12,12 @@ interface TrackParams {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
declare const useAutumn: () => {
|
|
15
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
16
|
-
check: ({ featureId, productId, entityId,
|
|
15
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
16
|
+
check: ({ featureId, productId, entityId, requiredBalance, sendEvent, withPreview, dialog, entityData, }: {
|
|
17
17
|
featureId?: string;
|
|
18
18
|
productId?: string;
|
|
19
19
|
entityId?: string;
|
|
20
|
-
|
|
20
|
+
requiredBalance?: number;
|
|
21
21
|
sendEvent?: boolean;
|
|
22
22
|
withPreview?: "formatted" | "raw";
|
|
23
23
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
|
@@ -34,7 +34,8 @@ const useAutumn = () => {
|
|
|
34
34
|
forceCheckout,
|
|
35
35
|
metadata,
|
|
36
36
|
callback,
|
|
37
|
-
entityData
|
|
37
|
+
entityData,
|
|
38
|
+
openInNewTab
|
|
38
39
|
}) => {
|
|
39
40
|
const attachWithoutDialog = async (options) => {
|
|
40
41
|
try {
|
|
@@ -45,7 +46,8 @@ const useAutumn = () => {
|
|
|
45
46
|
successUrl,
|
|
46
47
|
forceCheckout,
|
|
47
48
|
metadata,
|
|
48
|
-
entityData
|
|
49
|
+
entityData,
|
|
50
|
+
openInNewTab
|
|
49
51
|
});
|
|
50
52
|
} catch (error2) {
|
|
51
53
|
return toClientErrorResponse(error2);
|
|
@@ -82,7 +84,8 @@ const useAutumn = () => {
|
|
|
82
84
|
metadata,
|
|
83
85
|
dialog,
|
|
84
86
|
callback,
|
|
85
|
-
entityData
|
|
87
|
+
entityData,
|
|
88
|
+
openInNewTab
|
|
86
89
|
}) => {
|
|
87
90
|
if (dialog) {
|
|
88
91
|
setProdChangeComponent(dialog);
|
|
@@ -93,7 +96,8 @@ const useAutumn = () => {
|
|
|
93
96
|
forceCheckout,
|
|
94
97
|
metadata,
|
|
95
98
|
callback,
|
|
96
|
-
entityData
|
|
99
|
+
entityData,
|
|
100
|
+
openInNewTab
|
|
97
101
|
});
|
|
98
102
|
}
|
|
99
103
|
let snakeOptions = options?.map((option) => ({
|
|
@@ -115,7 +119,11 @@ const useAutumn = () => {
|
|
|
115
119
|
}
|
|
116
120
|
let data = result.data;
|
|
117
121
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
118
|
-
|
|
122
|
+
if (openInNewTab) {
|
|
123
|
+
window.open(data.checkout_url, "_blank");
|
|
124
|
+
} else {
|
|
125
|
+
window.open(data.checkout_url, "_self");
|
|
126
|
+
}
|
|
119
127
|
}
|
|
120
128
|
try {
|
|
121
129
|
await callback?.();
|
|
@@ -153,7 +161,7 @@ const useAutumn = () => {
|
|
|
153
161
|
featureId,
|
|
154
162
|
productId,
|
|
155
163
|
entityId,
|
|
156
|
-
|
|
164
|
+
requiredBalance,
|
|
157
165
|
sendEvent,
|
|
158
166
|
withPreview,
|
|
159
167
|
dialog,
|
|
@@ -167,7 +175,7 @@ const useAutumn = () => {
|
|
|
167
175
|
featureId,
|
|
168
176
|
productId,
|
|
169
177
|
entityId,
|
|
170
|
-
|
|
178
|
+
requiredBalance,
|
|
171
179
|
sendEvent,
|
|
172
180
|
withPreview: dialog ? "formatted" : withPreview,
|
|
173
181
|
entityData
|
|
@@ -34,7 +34,8 @@ const useAutumn = () => {
|
|
|
34
34
|
forceCheckout,
|
|
35
35
|
metadata,
|
|
36
36
|
callback,
|
|
37
|
-
entityData
|
|
37
|
+
entityData,
|
|
38
|
+
openInNewTab
|
|
38
39
|
}) => {
|
|
39
40
|
const attachWithoutDialog = async (options) => {
|
|
40
41
|
try {
|
|
@@ -45,7 +46,8 @@ const useAutumn = () => {
|
|
|
45
46
|
successUrl,
|
|
46
47
|
forceCheckout,
|
|
47
48
|
metadata,
|
|
48
|
-
entityData
|
|
49
|
+
entityData,
|
|
50
|
+
openInNewTab
|
|
49
51
|
});
|
|
50
52
|
} catch (error2) {
|
|
51
53
|
return toClientErrorResponse(error2);
|
|
@@ -82,7 +84,8 @@ const useAutumn = () => {
|
|
|
82
84
|
metadata,
|
|
83
85
|
dialog,
|
|
84
86
|
callback,
|
|
85
|
-
entityData
|
|
87
|
+
entityData,
|
|
88
|
+
openInNewTab
|
|
86
89
|
}) => {
|
|
87
90
|
if (dialog) {
|
|
88
91
|
setProdChangeComponent(dialog);
|
|
@@ -93,7 +96,8 @@ const useAutumn = () => {
|
|
|
93
96
|
forceCheckout,
|
|
94
97
|
metadata,
|
|
95
98
|
callback,
|
|
96
|
-
entityData
|
|
99
|
+
entityData,
|
|
100
|
+
openInNewTab
|
|
97
101
|
});
|
|
98
102
|
}
|
|
99
103
|
let snakeOptions = options?.map((option) => ({
|
|
@@ -115,7 +119,11 @@ const useAutumn = () => {
|
|
|
115
119
|
}
|
|
116
120
|
let data = result.data;
|
|
117
121
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
118
|
-
|
|
122
|
+
if (openInNewTab) {
|
|
123
|
+
window.open(data.checkout_url, "_blank");
|
|
124
|
+
} else {
|
|
125
|
+
window.open(data.checkout_url, "_self");
|
|
126
|
+
}
|
|
119
127
|
}
|
|
120
128
|
try {
|
|
121
129
|
await callback?.();
|
|
@@ -153,7 +161,7 @@ const useAutumn = () => {
|
|
|
153
161
|
featureId,
|
|
154
162
|
productId,
|
|
155
163
|
entityId,
|
|
156
|
-
|
|
164
|
+
requiredBalance,
|
|
157
165
|
sendEvent,
|
|
158
166
|
withPreview,
|
|
159
167
|
dialog,
|
|
@@ -167,7 +175,7 @@ const useAutumn = () => {
|
|
|
167
175
|
featureId,
|
|
168
176
|
productId,
|
|
169
177
|
entityId,
|
|
170
|
-
|
|
178
|
+
requiredBalance,
|
|
171
179
|
sendEvent,
|
|
172
180
|
withPreview: dialog ? "formatted" : withPreview,
|
|
173
181
|
entityData
|
package/dist/next/index.d.mts
CHANGED
|
@@ -23,6 +23,7 @@ interface AttachParams {
|
|
|
23
23
|
callback?: () => Promise<void>;
|
|
24
24
|
withPreview?: "formatted" | "raw";
|
|
25
25
|
entityData?: EntityDataParams;
|
|
26
|
+
openInNewTab?: boolean;
|
|
26
27
|
}
|
|
27
28
|
interface CreateEntityParams {
|
|
28
29
|
id: string;
|
|
@@ -40,12 +41,12 @@ interface TrackParams {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
declare const useAutumn: () => {
|
|
43
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
44
|
-
check: ({ featureId, productId, entityId,
|
|
44
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
45
|
+
check: ({ featureId, productId, entityId, requiredBalance, sendEvent, withPreview, dialog, entityData, }: {
|
|
45
46
|
featureId?: string;
|
|
46
47
|
productId?: string;
|
|
47
48
|
entityId?: string;
|
|
48
|
-
|
|
49
|
+
requiredBalance?: number;
|
|
49
50
|
sendEvent?: boolean;
|
|
50
51
|
withPreview?: "formatted" | "raw";
|
|
51
52
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
package/dist/next/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ interface AttachParams {
|
|
|
23
23
|
callback?: () => Promise<void>;
|
|
24
24
|
withPreview?: "formatted" | "raw";
|
|
25
25
|
entityData?: EntityDataParams;
|
|
26
|
+
openInNewTab?: boolean;
|
|
26
27
|
}
|
|
27
28
|
interface CreateEntityParams {
|
|
28
29
|
id: string;
|
|
@@ -40,12 +41,12 @@ interface TrackParams {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
declare const useAutumn: () => {
|
|
43
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
44
|
-
check: ({ featureId, productId, entityId,
|
|
44
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
45
|
+
check: ({ featureId, productId, entityId, requiredBalance, sendEvent, withPreview, dialog, entityData, }: {
|
|
45
46
|
featureId?: string;
|
|
46
47
|
productId?: string;
|
|
47
48
|
entityId?: string;
|
|
48
|
-
|
|
49
|
+
requiredBalance?: number;
|
|
49
50
|
sendEvent?: boolean;
|
|
50
51
|
withPreview?: "formatted" | "raw";
|
|
51
52
|
dialog?: (data: any) => JSX.Element | React.ReactNode;
|
|
@@ -173,7 +173,7 @@ interface CheckParams {
|
|
|
173
173
|
product_id?: string;
|
|
174
174
|
entity_id?: string;
|
|
175
175
|
customer_data?: CustomerData;
|
|
176
|
-
|
|
176
|
+
required_balance?: number;
|
|
177
177
|
send_event?: boolean;
|
|
178
178
|
with_preview?: "raw" | "formatted";
|
|
179
179
|
entity_data?: EntityData;
|
|
@@ -183,7 +183,7 @@ interface CheckResult {
|
|
|
183
183
|
allowed: boolean;
|
|
184
184
|
code: string;
|
|
185
185
|
feature_id?: string;
|
|
186
|
-
|
|
186
|
+
required_balance?: number;
|
|
187
187
|
unlimited?: boolean;
|
|
188
188
|
balance?: number | null;
|
|
189
189
|
product_id?: string;
|
|
@@ -173,7 +173,7 @@ interface CheckParams {
|
|
|
173
173
|
product_id?: string;
|
|
174
174
|
entity_id?: string;
|
|
175
175
|
customer_data?: CustomerData;
|
|
176
|
-
|
|
176
|
+
required_balance?: number;
|
|
177
177
|
send_event?: boolean;
|
|
178
178
|
with_preview?: "raw" | "formatted";
|
|
179
179
|
entity_data?: EntityData;
|
|
@@ -183,7 +183,7 @@ interface CheckResult {
|
|
|
183
183
|
allowed: boolean;
|
|
184
184
|
code: string;
|
|
185
185
|
feature_id?: string;
|
|
186
|
-
|
|
186
|
+
required_balance?: number;
|
|
187
187
|
unlimited?: boolean;
|
|
188
188
|
balance?: number | null;
|
|
189
189
|
product_id?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Product, C as CreateProductParams, L as ListProductsParams, G as GetEntityParams, E as Entity, a as CreateEntityParams, b as CreateEntityResult, D as DeleteEntityResult, A as AttachParams, c as AttachResult, U as UsageParams, d as UsageResult, e as CancelParams, f as CancelResult, g as CheckParams, h as CheckResult, T as TrackParams, i as TrackResult, j as GetEntityParams$1 } from './clientEntTypes-
|
|
1
|
+
import { P as Product, C as CreateProductParams, L as ListProductsParams, G as GetEntityParams, E as Entity, a as CreateEntityParams, b as CreateEntityResult, D as DeleteEntityResult, A as AttachParams, c as AttachResult, U as UsageParams, d as UsageResult, e as CancelParams, f as CancelResult, g as CheckParams, h as CheckResult, T as TrackParams, i as TrackResult, j as GetEntityParams$1 } from './clientEntTypes-BmcLKJxV.mjs';
|
|
2
2
|
import { R as Result, A as AutumnError } from './response-BCg7kiiN.mjs';
|
|
3
3
|
import { G as GetCustomerParams, a as Customer, b as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, c as BillingPortalResponse, C as CustomerData } from './cusTypes-DKovOcy4.mjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Product, C as CreateProductParams, L as ListProductsParams, G as GetEntityParams, E as Entity, a as CreateEntityParams, b as CreateEntityResult, D as DeleteEntityResult, A as AttachParams, c as AttachResult, U as UsageParams, d as UsageResult, e as CancelParams, f as CancelResult, g as CheckParams, h as CheckResult, T as TrackParams, i as TrackResult, j as GetEntityParams$1 } from './clientEntTypes-
|
|
1
|
+
import { P as Product, C as CreateProductParams, L as ListProductsParams, G as GetEntityParams, E as Entity, a as CreateEntityParams, b as CreateEntityResult, D as DeleteEntityResult, A as AttachParams, c as AttachResult, U as UsageParams, d as UsageResult, e as CancelParams, f as CancelResult, g as CheckParams, h as CheckResult, T as TrackParams, i as TrackResult, j as GetEntityParams$1 } from './clientEntTypes-DHpBjJUt.js';
|
|
2
2
|
import { R as Result, A as AutumnError } from './response-BCg7kiiN.js';
|
|
3
3
|
import { G as GetCustomerParams, a as Customer, b as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, c as BillingPortalResponse, C as CustomerData } from './cusTypes-DKovOcy4.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as AttachFeatureOptions, l as EntityDataParams } from './clientEntTypes-
|
|
1
|
+
import { k as AttachFeatureOptions, l as EntityDataParams } from './clientEntTypes-BmcLKJxV.mjs';
|
|
2
2
|
import { C as CustomerData, B as BillingPortalParams } from './cusTypes-DKovOcy4.mjs';
|
|
3
3
|
|
|
4
4
|
declare const attachAction: (args: Omit<{
|
|
@@ -27,7 +27,7 @@ declare const checkAction: (args: Omit<{
|
|
|
27
27
|
featureId?: string;
|
|
28
28
|
productId?: string;
|
|
29
29
|
entityId?: string;
|
|
30
|
-
|
|
30
|
+
requiredBalance?: number;
|
|
31
31
|
sendEvent?: boolean;
|
|
32
32
|
withPreview?: "raw" | "formatted";
|
|
33
33
|
entityData?: EntityDataParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as AttachFeatureOptions, l as EntityDataParams } from './clientEntTypes-
|
|
1
|
+
import { k as AttachFeatureOptions, l as EntityDataParams } from './clientEntTypes-DHpBjJUt.js';
|
|
2
2
|
import { C as CustomerData, B as BillingPortalParams } from './cusTypes-DKovOcy4.js';
|
|
3
3
|
|
|
4
4
|
declare const attachAction: (args: Omit<{
|
|
@@ -27,7 +27,7 @@ declare const checkAction: (args: Omit<{
|
|
|
27
27
|
featureId?: string;
|
|
28
28
|
productId?: string;
|
|
29
29
|
entityId?: string;
|
|
30
|
-
|
|
30
|
+
requiredBalance?: number;
|
|
31
31
|
sendEvent?: boolean;
|
|
32
32
|
withPreview?: "raw" | "formatted";
|
|
33
33
|
entityData?: EntityDataParams;
|
|
@@ -52,7 +52,7 @@ const checkAction = withAuth({
|
|
|
52
52
|
featureId,
|
|
53
53
|
productId,
|
|
54
54
|
entityId,
|
|
55
|
-
|
|
55
|
+
requiredBalance,
|
|
56
56
|
sendEvent,
|
|
57
57
|
withPreview,
|
|
58
58
|
entityData
|
|
@@ -63,7 +63,7 @@ const checkAction = withAuth({
|
|
|
63
63
|
feature_id: featureId,
|
|
64
64
|
product_id: productId,
|
|
65
65
|
entity_id: entityId,
|
|
66
|
-
|
|
66
|
+
required_balance: requiredBalance,
|
|
67
67
|
send_event: sendEvent,
|
|
68
68
|
with_preview: withPreview,
|
|
69
69
|
customer_data: customerData,
|
|
@@ -52,7 +52,7 @@ const checkAction = withAuth({
|
|
|
52
52
|
featureId,
|
|
53
53
|
productId,
|
|
54
54
|
entityId,
|
|
55
|
-
|
|
55
|
+
requiredBalance,
|
|
56
56
|
sendEvent,
|
|
57
57
|
withPreview,
|
|
58
58
|
entityData
|
|
@@ -63,7 +63,7 @@ const checkAction = withAuth({
|
|
|
63
63
|
feature_id: featureId,
|
|
64
64
|
product_id: productId,
|
|
65
65
|
entity_id: entityId,
|
|
66
|
-
|
|
66
|
+
required_balance: requiredBalance,
|
|
67
67
|
send_event: sendEvent,
|
|
68
68
|
with_preview: withPreview,
|
|
69
69
|
customer_data: customerData,
|
package/dist/sdk/general.d.mts
CHANGED
|
@@ -62,7 +62,7 @@ interface CheckParams {
|
|
|
62
62
|
product_id?: string;
|
|
63
63
|
entity_id?: string;
|
|
64
64
|
customer_data?: CustomerData;
|
|
65
|
-
|
|
65
|
+
required_balance?: number;
|
|
66
66
|
send_event?: boolean;
|
|
67
67
|
with_preview?: "raw" | "formatted";
|
|
68
68
|
entity_data?: EntityData;
|
|
@@ -72,7 +72,7 @@ interface CheckResult {
|
|
|
72
72
|
allowed: boolean;
|
|
73
73
|
code: string;
|
|
74
74
|
feature_id?: string;
|
|
75
|
-
|
|
75
|
+
required_balance?: number;
|
|
76
76
|
unlimited?: boolean;
|
|
77
77
|
balance?: number | null;
|
|
78
78
|
product_id?: string;
|
package/dist/sdk/general.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ interface CheckParams {
|
|
|
62
62
|
product_id?: string;
|
|
63
63
|
entity_id?: string;
|
|
64
64
|
customer_data?: CustomerData;
|
|
65
|
-
|
|
65
|
+
required_balance?: number;
|
|
66
66
|
send_event?: boolean;
|
|
67
67
|
with_preview?: "raw" | "formatted";
|
|
68
68
|
entity_data?: EntityData;
|
|
@@ -72,7 +72,7 @@ interface CheckResult {
|
|
|
72
72
|
allowed: boolean;
|
|
73
73
|
code: string;
|
|
74
74
|
feature_id?: string;
|
|
75
|
-
|
|
75
|
+
required_balance?: number;
|
|
76
76
|
unlimited?: boolean;
|
|
77
77
|
balance?: number | null;
|
|
78
78
|
product_id?: string;
|