autumn-js 0.0.77 → 0.0.79
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 +3 -2
- package/dist/libraries/backend/express.d.ts +3 -2
- package/dist/libraries/backend/express.js +2 -2
- package/dist/libraries/backend/express.mjs +2 -2
- package/dist/libraries/backend/fastify.d.mts +1 -0
- package/dist/libraries/backend/fastify.d.ts +1 -0
- package/dist/libraries/backend/fastify.js +19 -0
- package/dist/libraries/backend/fastify.mjs +7 -0
- package/dist/libraries/backend/hono.d.mts +2 -0
- package/dist/libraries/backend/hono.d.ts +2 -0
- package/dist/libraries/backend/hono.js +20 -1
- package/dist/libraries/backend/hono.mjs +8 -1
- package/dist/libraries/backend/react-router.d.mts +1 -1
- package/dist/libraries/backend/react-router.d.ts +1 -1
- package/dist/libraries/backend/react-router.js +21 -0
- package/dist/libraries/backend/react-router.mjs +9 -0
- package/dist/libraries/backend/{referralTypes-DiYwS4QY.d.mts → referralTypes-DUHggPfB.d.mts} +126 -126
- package/dist/libraries/backend/{referralTypes-CSbCGBim.d.ts → referralTypes-PidjhXlJ.d.ts} +126 -126
- package/dist/libraries/backend/supabase.d.mts +1 -0
- package/dist/libraries/backend/supabase.d.ts +1 -0
- package/dist/libraries/backend/supabase.js +21 -0
- package/dist/libraries/backend/supabase.mjs +9 -0
- package/dist/libraries/backend/tanstack.d.mts +1 -0
- package/dist/libraries/backend/tanstack.d.ts +1 -0
- package/dist/libraries/backend/tanstack.js +21 -0
- package/dist/libraries/backend/tanstack.mjs +9 -0
- 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 +4 -5
- package/dist/libraries/react/AutumnContext.d.ts +4 -5
- package/dist/libraries/react/AutumnContext.mjs +7 -7
- package/dist/libraries/react/BaseAutumnProvider.css +1264 -0
- package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -5
- package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -5
- package/dist/libraries/react/BaseAutumnProvider.js +2 -1
- package/dist/libraries/react/BaseAutumnProvider.mjs +17 -16
- package/dist/libraries/react/{ReactAutumnClient-CrkFLuOn.d.mts → ReactAutumnClient-BUpLpfaT.d.mts} +3 -4
- package/dist/libraries/react/{ReactAutumnClient-A7x9envm.d.ts → ReactAutumnClient-DykUHFzU.d.ts} +3 -4
- package/dist/libraries/react/ReactAutumnProvider.css +1264 -0
- package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.js +2 -1
- package/dist/libraries/react/ReactAutumnProvider.mjs +17 -16
- package/dist/libraries/react/{chunk-XXMAVKQ4.mjs → chunk-2E22VDNL.mjs} +2 -2
- package/dist/libraries/react/{chunk-FINFVKJY.mjs → chunk-4FM7BXFT.mjs} +23 -19
- package/dist/libraries/react/{chunk-UMZA5GHL.mjs → chunk-ANT5FRPE.mjs} +1 -1
- package/dist/libraries/react/chunk-OWFX3JFF.mjs +23 -0
- package/dist/libraries/react/{chunk-WI6WFW54.mjs → chunk-QMPP4FVB.mjs} +2 -1
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -5
- package/dist/libraries/react/client/ReactAutumnClient.mjs +6 -6
- package/dist/libraries/react/client/clientCompMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientCompMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientCusMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientCusMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientGenMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientGenMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientProdMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientProdMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -5
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +1264 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +2 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +17 -16
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -2
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -2
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -2
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -2
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +2 -2
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -2
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -2
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +1264 -0
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -2
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -2
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +19 -2
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +17 -16
- package/dist/libraries/react/components/ui/button.d.mts +1 -1
- package/dist/libraries/react/components/ui/button.d.ts +1 -1
- package/dist/libraries/react/cusTypes-CrTZaKED.d.mts +225 -0
- package/dist/libraries/react/cusTypes-CrTZaKED.d.ts +225 -0
- package/dist/libraries/react/{entTypes-8gkfAi3g.d.mts → entTypes-C-4aVfR8.d.mts} +1 -1
- package/dist/libraries/react/{entTypes-C8jD10M8.d.ts → entTypes-DWKPjkGS.d.ts} +1 -1
- package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
- package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
- package/dist/libraries/react/hooks/useAutumn.css +1264 -0
- package/dist/libraries/react/hooks/useAutumn.d.mts +2 -3
- package/dist/libraries/react/hooks/useAutumn.d.ts +2 -3
- package/dist/libraries/react/hooks/useAutumn.js +2 -1
- package/dist/libraries/react/hooks/useAutumn.mjs +17 -16
- package/dist/libraries/react/hooks/useAutumnBase.css +1264 -0
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +4 -5
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +4 -5
- package/dist/libraries/react/hooks/useAutumnBase.js +2 -1
- package/dist/libraries/react/hooks/useAutumnBase.mjs +17 -16
- package/dist/libraries/react/hooks/useCustomer.css +1264 -0
- package/dist/libraries/react/hooks/useCustomer.d.mts +4 -5
- package/dist/libraries/react/hooks/useCustomer.d.ts +4 -5
- package/dist/libraries/react/hooks/useCustomer.js +2 -1
- package/dist/libraries/react/hooks/useCustomer.mjs +17 -16
- package/dist/libraries/react/hooks/useCustomerBase.css +1264 -0
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +4 -5
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +4 -5
- package/dist/libraries/react/hooks/useCustomerBase.js +2 -1
- package/dist/libraries/react/hooks/useCustomerBase.mjs +17 -16
- package/dist/libraries/react/hooks/useEntity.css +1264 -0
- package/dist/libraries/react/hooks/useEntity.d.mts +3 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +3 -4
- package/dist/libraries/react/hooks/useEntity.js +2 -1
- package/dist/libraries/react/hooks/useEntity.mjs +17 -16
- package/dist/libraries/react/hooks/useEntityBase.css +1264 -0
- package/dist/libraries/react/hooks/useEntityBase.d.mts +4 -5
- package/dist/libraries/react/hooks/useEntityBase.d.ts +4 -5
- package/dist/libraries/react/hooks/useEntityBase.js +2 -1
- package/dist/libraries/react/hooks/useEntityBase.mjs +17 -16
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -2
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -2
- package/dist/libraries/react/hooks/usePricingTable.js +1 -0
- package/dist/libraries/react/hooks/usePricingTable.mjs +9 -9
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -5
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -5
- package/dist/libraries/react/hooks/usePricingTableBase.js +1 -0
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +8 -8
- package/dist/libraries/react/hooks/useProductsBase.mjs +7 -7
- package/dist/libraries/react/index.d.ts +115 -115
- package/dist/libraries/react/index.js +44 -3
- package/dist/libraries/react/index.mjs +44 -3
- package/dist/libraries/react/{response-DLD-1iva.d.ts → response-D0CcXse-.d.ts} +2 -3
- package/dist/libraries/react/{response-BGS7hGc7.d.mts → response-DwYxo3Li.d.mts} +2 -3
- package/dist/libraries/react/utils/inject-styles.d.mts +4 -0
- package/dist/libraries/react/utils/inject-styles.d.ts +4 -0
- package/dist/libraries/react/utils/inject-styles.js +47 -0
- package/dist/libraries/react/utils/inject-styles.mjs +10 -0
- package/dist/next/{AutumnProvider-BdIwgk_j.d.mts → AutumnProvider-CGdXoZNQ.d.mts} +116 -7
- package/dist/next/{AutumnProvider-BdIwgk_j.d.ts → AutumnProvider-CGdXoZNQ.d.ts} +116 -7
- package/dist/next/AutumnProvider.d.mts +1 -1
- package/dist/next/AutumnProvider.d.ts +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +4 -4
- package/dist/next/client/NextAutumnClient.d.ts +4 -4
- package/dist/next/client/NextAutumnProvider.d.mts +1 -1
- package/dist/next/client/NextAutumnProvider.d.ts +1 -1
- package/dist/next/client/{clientGenTypes-CXkGuJ6W.d.ts → clientGenTypes-KQqk1H9-.d.mts} +2 -2
- package/dist/next/client/{clientGenTypes-Dh9BiE0s.d.mts → clientGenTypes-_eDeut4m.d.ts} +2 -2
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/cusTypes-CSbB7Wu9.d.mts +225 -0
- package/dist/next/client/cusTypes-CSbB7Wu9.d.ts +225 -0
- package/dist/next/client/{entTypes-C1-bumir.d.mts → entTypes-6xEkbn32.d.mts} +1 -1
- package/dist/next/client/{entTypes-CKc2qHBt.d.ts → entTypes-B3R2yjLW.d.ts} +1 -1
- package/dist/next/client/error-DHbclCVh.d.mts +17 -0
- package/dist/next/client/error-DHbclCVh.d.ts +17 -0
- package/dist/next/client/hooks/useAutumn.d.mts +4 -4
- package/dist/next/client/hooks/useAutumn.d.ts +4 -4
- package/dist/next/client/hooks/useCustomer.d.mts +4 -4
- package/dist/next/client/hooks/useCustomer.d.ts +4 -4
- package/dist/next/client/hooks/useEntity.d.mts +5 -5
- package/dist/next/client/hooks/useEntity.d.ts +5 -5
- 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 +2 -111
- package/dist/next/index.d.ts +2 -111
- package/dist/next/server/auth/withNextAuth.d.mts +1 -1
- package/dist/next/server/auth/withNextAuth.d.ts +1 -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 +1 -121
- package/dist/next/server/cusActions.d.ts +1 -121
- package/dist/next/server/cusTypes-ASrCF4fa.d.mts +244 -0
- package/dist/next/server/cusTypes-ASrCF4fa.d.ts +244 -0
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +130 -130
- package/dist/sdk/index.d.ts +130 -130
- package/dist/styles/global.css +50 -3
- package/package.json +3 -2
- package/scripts/css-transform-plugin.js +28 -0
- package/scripts/post-build.js +65 -15
- package/scripts/sync-registry.ts +10 -0
- package/tsup.config.ts +6 -2
- package/tsup.dev.config.ts +6 -2
- package/dist/libraries/react/checkTypes-Bz2m_2pr.d.ts +0 -112
- package/dist/libraries/react/checkTypes-Cjk7BjiU.d.mts +0 -112
- package/dist/libraries/react/cusTypes-DNx5bwlw.d.mts +0 -116
- package/dist/libraries/react/cusTypes-DNx5bwlw.d.ts +0 -116
- package/dist/next/client/checkTypes-BVlLFoUT.d.ts +0 -128
- package/dist/next/client/checkTypes-CGZpuidI.d.mts +0 -128
- package/dist/next/client/cusTypes-CV5q3GIA.d.mts +0 -116
- package/dist/next/client/cusTypes-CV5q3GIA.d.ts +0 -116
- package/dist/next/server/cusTypes-Cc8NWXXF.d.mts +0 -124
- package/dist/next/server/cusTypes-Cc8NWXXF.d.ts +0 -124
- package/dist/libraries/react/{chunk-4CRZJJPY.mjs → chunk-KGHDNAQT.mjs} +17 -17
- package/dist/libraries/react/{chunk-27OTS3Q5.mjs → chunk-QJEJ7E65.mjs} +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ErrorResponse {
|
|
2
|
+
message: string;
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
declare class AutumnError extends Error {
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly code: string;
|
|
8
|
+
constructor(response: ErrorResponse);
|
|
9
|
+
static fromError(error: any): AutumnError;
|
|
10
|
+
toString(): string;
|
|
11
|
+
toJSON(): {
|
|
12
|
+
message: string;
|
|
13
|
+
code: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { AutumnError as A };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ErrorResponse {
|
|
2
|
+
message: string;
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
declare class AutumnError extends Error {
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly code: string;
|
|
8
|
+
constructor(response: ErrorResponse);
|
|
9
|
+
static fromError(error: any): AutumnError;
|
|
10
|
+
toString(): string;
|
|
11
|
+
toJSON(): {
|
|
12
|
+
message: string;
|
|
13
|
+
code: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { AutumnError as A };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AttachParams, R as Result,
|
|
2
|
-
import { A as AutumnError } from '../
|
|
3
|
-
import { B as BillingPortalResult } from '../cusTypes-
|
|
1
|
+
import { A as AttachParams, R as Result, a as AttachResult, C as CheckResult, b as CheckParams, c as AutumnPromise, T as TrackParams, d as TrackResult, e as CancelParams, f as CancelResult, O as OpenBillingPortalParams } from '../clientGenTypes-KQqk1H9-.mjs';
|
|
2
|
+
import { A as AutumnError } from '../error-DHbclCVh.mjs';
|
|
3
|
+
import { B as BillingPortalResult } from '../cusTypes-CSbB7Wu9.mjs';
|
|
4
4
|
|
|
5
5
|
declare const useAutumn: () => {
|
|
6
|
-
attach: (params: AttachParams) => Promise<Result<
|
|
6
|
+
attach: (params: AttachParams) => Promise<Result<AttachResult | CheckResult, AutumnError>>;
|
|
7
7
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
8
8
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
9
9
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as AttachParams, R as Result,
|
|
2
|
-
import { A as AutumnError } from '../
|
|
3
|
-
import { B as BillingPortalResult } from '../cusTypes-
|
|
1
|
+
import { A as AttachParams, R as Result, a as AttachResult, C as CheckResult, b as CheckParams, c as AutumnPromise, T as TrackParams, d as TrackResult, e as CancelParams, f as CancelResult, O as OpenBillingPortalParams } from '../clientGenTypes-_eDeut4m.js';
|
|
2
|
+
import { A as AutumnError } from '../error-DHbclCVh.js';
|
|
3
|
+
import { B as BillingPortalResult } from '../cusTypes-CSbB7Wu9.js';
|
|
4
4
|
|
|
5
5
|
declare const useAutumn: () => {
|
|
6
|
-
attach: (params: AttachParams) => Promise<Result<
|
|
6
|
+
attach: (params: AttachParams) => Promise<Result<AttachResult | CheckResult, AutumnError>>;
|
|
7
7
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
8
8
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
9
9
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AutumnError } from '../
|
|
2
|
-
import { A as AttachParams, c as AutumnPromise, a as AttachResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, e as CancelParams, f as CancelResult, O as OpenBillingPortalParams, g as CreateEntityParams } from '../clientGenTypes-
|
|
3
|
-
import { b as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-
|
|
4
|
-
import { E as Entity } from '../entTypes-
|
|
1
|
+
import { A as AutumnError } from '../error-DHbclCVh.mjs';
|
|
2
|
+
import { A as AttachParams, c as AutumnPromise, a as AttachResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, e as CancelParams, f as CancelResult, O as OpenBillingPortalParams, g as CreateEntityParams } from '../clientGenTypes-KQqk1H9-.mjs';
|
|
3
|
+
import { b as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-CSbB7Wu9.mjs';
|
|
4
|
+
import { E as Entity } from '../entTypes-6xEkbn32.mjs';
|
|
5
5
|
import { C as CreateReferralCodeParams, a as CreateReferralCodeResult, R as RedeemReferralCodeParams, b as RedeemReferralCodeResult } from '../clientReferralTypes-C9JiOk2s.mjs';
|
|
6
6
|
import { A as AllowedParams } from '../handleAllowed-B8TBAzfI.mjs';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AutumnError } from '../
|
|
2
|
-
import { A as AttachParams, c as AutumnPromise, a as AttachResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, e as CancelParams, f as CancelResult, O as OpenBillingPortalParams, g as CreateEntityParams } from '../clientGenTypes-
|
|
3
|
-
import { b as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-
|
|
4
|
-
import { E as Entity } from '../entTypes-
|
|
1
|
+
import { A as AutumnError } from '../error-DHbclCVh.js';
|
|
2
|
+
import { A as AttachParams, c as AutumnPromise, a as AttachResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, e as CancelParams, f as CancelResult, O as OpenBillingPortalParams, g as CreateEntityParams } from '../clientGenTypes-_eDeut4m.js';
|
|
3
|
+
import { b as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-CSbB7Wu9.js';
|
|
4
|
+
import { E as Entity } from '../entTypes-B3R2yjLW.js';
|
|
5
5
|
import { C as CreateReferralCodeParams, a as CreateReferralCodeResult, R as RedeemReferralCodeParams, b as RedeemReferralCodeResult } from '../clientReferralTypes-C9JiOk2s.js';
|
|
6
6
|
import { A as AllowedParams } from '../handleAllowed-B8TBAzfI.js';
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as CheckParams, c as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, a as AttachResult, e as CancelParams, f as CancelResult, T as TrackParams, d as TrackResult } from '../clientGenTypes-
|
|
2
|
-
import { A as AutumnError } from '../
|
|
3
|
-
import { G as GetEntityParams, E as Entity } from '../entTypes-
|
|
1
|
+
import { b as CheckParams, c as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, a as AttachResult, e as CancelParams, f as CancelResult, T as TrackParams, d as TrackResult } from '../clientGenTypes-KQqk1H9-.mjs';
|
|
2
|
+
import { A as AutumnError } from '../error-DHbclCVh.mjs';
|
|
3
|
+
import { G as GetEntityParams, E as Entity } from '../entTypes-6xEkbn32.mjs';
|
|
4
4
|
import { A as AllowedParams } from '../handleAllowed-B8TBAzfI.mjs';
|
|
5
5
|
import * as swr from 'swr';
|
|
6
|
-
import '../cusTypes-
|
|
6
|
+
import '../cusTypes-CSbB7Wu9.mjs';
|
|
7
7
|
|
|
8
8
|
declare const useEntity: (entityId: string | null, params?: GetEntityParams) => {
|
|
9
9
|
entity: Entity | null;
|
|
@@ -12,7 +12,7 @@ declare const useEntity: (entityId: string | null, params?: GetEntityParams) =>
|
|
|
12
12
|
refetch: swr.KeyedMutator<Entity | null>;
|
|
13
13
|
allowed: (params: AllowedParams) => boolean;
|
|
14
14
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
15
|
-
attach: (params: AttachParams) => Promise<Result<
|
|
15
|
+
attach: (params: AttachParams) => Promise<Result<AttachResult | CheckResult, AutumnError>>;
|
|
16
16
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
17
17
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
18
18
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as CheckParams, c as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, a as AttachResult, e as CancelParams, f as CancelResult, T as TrackParams, d as TrackResult } from '../clientGenTypes-
|
|
2
|
-
import { A as AutumnError } from '../
|
|
3
|
-
import { G as GetEntityParams, E as Entity } from '../entTypes-
|
|
1
|
+
import { b as CheckParams, c as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, a as AttachResult, e as CancelParams, f as CancelResult, T as TrackParams, d as TrackResult } from '../clientGenTypes-_eDeut4m.js';
|
|
2
|
+
import { A as AutumnError } from '../error-DHbclCVh.js';
|
|
3
|
+
import { G as GetEntityParams, E as Entity } from '../entTypes-B3R2yjLW.js';
|
|
4
4
|
import { A as AllowedParams } from '../handleAllowed-B8TBAzfI.js';
|
|
5
5
|
import * as swr from 'swr';
|
|
6
|
-
import '../cusTypes-
|
|
6
|
+
import '../cusTypes-CSbB7Wu9.js';
|
|
7
7
|
|
|
8
8
|
declare const useEntity: (entityId: string | null, params?: GetEntityParams) => {
|
|
9
9
|
entity: Entity | null;
|
|
@@ -12,7 +12,7 @@ declare const useEntity: (entityId: string | null, params?: GetEntityParams) =>
|
|
|
12
12
|
refetch: swr.KeyedMutator<Entity | null>;
|
|
13
13
|
allowed: (params: AllowedParams) => boolean;
|
|
14
14
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
15
|
-
attach: (params: AttachParams) => Promise<Result<
|
|
15
|
+
attach: (params: AttachParams) => Promise<Result<AttachResult | CheckResult, AutumnError>>;
|
|
16
16
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
17
17
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
18
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as swr from 'swr';
|
|
2
|
-
import {
|
|
3
|
-
import '../cusTypes-
|
|
2
|
+
import { A as AutumnError } from '../error-DHbclCVh.mjs';
|
|
3
|
+
import { P as Product } from '../cusTypes-CSbB7Wu9.mjs';
|
|
4
4
|
|
|
5
5
|
interface ProductDetails {
|
|
6
6
|
id?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as swr from 'swr';
|
|
2
|
-
import {
|
|
3
|
-
import '../cusTypes-
|
|
2
|
+
import { A as AutumnError } from '../error-DHbclCVh.js';
|
|
3
|
+
import { P as Product } from '../cusTypes-CSbB7Wu9.js';
|
|
4
4
|
|
|
5
5
|
interface ProductDetails {
|
|
6
6
|
id?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CustomerData, a as Customer } from './cusTypes-
|
|
2
|
-
import { E as Entity } from './entTypes-
|
|
1
|
+
import { C as CustomerData, a as Customer } from './cusTypes-CSbB7Wu9.mjs';
|
|
2
|
+
import { E as Entity } from './entTypes-6xEkbn32.mjs';
|
|
3
3
|
|
|
4
4
|
interface ProductDetails {
|
|
5
5
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CustomerData, a as Customer } from './cusTypes-
|
|
2
|
-
import { E as Entity } from './entTypes-
|
|
1
|
+
import { C as CustomerData, a as Customer } from './cusTypes-CSbB7Wu9.js';
|
|
2
|
+
import { E as Entity } from './entTypes-B3R2yjLW.js';
|
|
3
3
|
|
|
4
4
|
interface ProductDetails {
|
|
5
5
|
id: string;
|
package/dist/next/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerProduct, a as CustomerFeature, b as CustomerInvoice,
|
|
3
|
-
export {
|
|
2
|
+
import { C as CustomerProduct, a as CustomerFeature, b as CustomerInvoice, c as CustomerData, d as CheckFeatureResult, e as CheckProductResult, P as ProductItem, f as ProductScenario, g as CreateCustomerParams, h as Customer, B as BillingPortalResult, i as Product, j as CustomerExpandOption } from './AutumnProvider-CGdXoZNQ.mjs';
|
|
3
|
+
export { A as AutumnProvider } from './AutumnProvider-CGdXoZNQ.mjs';
|
|
4
4
|
import * as swr from 'swr';
|
|
5
5
|
import * as React$1 from 'react';
|
|
6
6
|
import { NextRequest, NextResponse } from 'next/server';
|
|
@@ -40,115 +40,6 @@ interface Entity {
|
|
|
40
40
|
invoices?: CustomerInvoice[];
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
interface ProductItem {
|
|
44
|
-
feature_id?: string;
|
|
45
|
-
included_usage?: number | typeof Infinite;
|
|
46
|
-
interval?: ProductItemIntervalType;
|
|
47
|
-
usage_model?: UsageModel;
|
|
48
|
-
price?: number;
|
|
49
|
-
billing_units?: number;
|
|
50
|
-
entity_feature_id?: string;
|
|
51
|
-
reset_usage_on_billing?: boolean;
|
|
52
|
-
reset_usage_when_enabled?: boolean;
|
|
53
|
-
display?: {
|
|
54
|
-
primary_text?: string;
|
|
55
|
-
secondary_text?: string;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
interface FreeTrial {
|
|
59
|
-
duration: FreeTrialDuration;
|
|
60
|
-
length: number;
|
|
61
|
-
unique_fingerprint: boolean;
|
|
62
|
-
trial_available?: boolean;
|
|
63
|
-
}
|
|
64
|
-
interface Product {
|
|
65
|
-
id: string;
|
|
66
|
-
created_at: number;
|
|
67
|
-
name: string;
|
|
68
|
-
env: AppEnv;
|
|
69
|
-
is_add_on: boolean;
|
|
70
|
-
is_default: boolean;
|
|
71
|
-
group: string;
|
|
72
|
-
version: number;
|
|
73
|
-
items: ProductItem[];
|
|
74
|
-
free_trial: FreeTrial | null;
|
|
75
|
-
scenario?: ProductScenario;
|
|
76
|
-
base_variant_id: string | null;
|
|
77
|
-
properties?: {
|
|
78
|
-
is_free?: boolean;
|
|
79
|
-
is_one_off?: boolean;
|
|
80
|
-
interval_group?: string;
|
|
81
|
-
};
|
|
82
|
-
display?: {
|
|
83
|
-
name?: string;
|
|
84
|
-
description?: string;
|
|
85
|
-
button_text?: string;
|
|
86
|
-
recommend_text?: string;
|
|
87
|
-
everything_from?: string;
|
|
88
|
-
button_url?: string;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
type CheckFeatureScenario = "usage_limit" | "feature_flag";
|
|
93
|
-
interface CheckFeatureResult extends CoreCustomerFeature {
|
|
94
|
-
allowed: boolean;
|
|
95
|
-
feature_id: string;
|
|
96
|
-
customer_id: string;
|
|
97
|
-
entity_id?: string;
|
|
98
|
-
required_balance: number;
|
|
99
|
-
code: string;
|
|
100
|
-
preview?: CheckFeaturePreview;
|
|
101
|
-
}
|
|
102
|
-
interface CheckFeaturePreview {
|
|
103
|
-
scenario: CheckFeatureScenario;
|
|
104
|
-
title: string;
|
|
105
|
-
message: string;
|
|
106
|
-
feature_id: string;
|
|
107
|
-
feature_name: string;
|
|
108
|
-
products: Product[];
|
|
109
|
-
}
|
|
110
|
-
type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
|
|
111
|
-
interface CheckProductResult {
|
|
112
|
-
allowed: boolean;
|
|
113
|
-
customer_id: string;
|
|
114
|
-
product_id: string;
|
|
115
|
-
code: string;
|
|
116
|
-
status?: string;
|
|
117
|
-
preview?: CheckProductPreview;
|
|
118
|
-
}
|
|
119
|
-
interface CheckProductPreview {
|
|
120
|
-
scenario: ProductScenario;
|
|
121
|
-
product_id: string;
|
|
122
|
-
product_name: string;
|
|
123
|
-
recurring: boolean;
|
|
124
|
-
error_on_attach?: boolean;
|
|
125
|
-
next_cycle_at?: number;
|
|
126
|
-
current_product_name?: string;
|
|
127
|
-
items?: {
|
|
128
|
-
price: string;
|
|
129
|
-
description: string;
|
|
130
|
-
usage_model?: UsageModelType;
|
|
131
|
-
}[];
|
|
132
|
-
options?: {
|
|
133
|
-
feature_id: string;
|
|
134
|
-
feature_name: string;
|
|
135
|
-
billing_units: number;
|
|
136
|
-
price?: number;
|
|
137
|
-
tiers?: {
|
|
138
|
-
to: number | string;
|
|
139
|
-
amount: number;
|
|
140
|
-
}[];
|
|
141
|
-
}[];
|
|
142
|
-
due_today?: {
|
|
143
|
-
price: number;
|
|
144
|
-
currency: string;
|
|
145
|
-
};
|
|
146
|
-
due_next_cycle?: {
|
|
147
|
-
price: number;
|
|
148
|
-
currency: string;
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
43
|
interface CancelResult {
|
|
153
44
|
success: boolean;
|
|
154
45
|
customer_id: string;
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerProduct, a as CustomerFeature, b as CustomerInvoice,
|
|
3
|
-
export {
|
|
2
|
+
import { C as CustomerProduct, a as CustomerFeature, b as CustomerInvoice, c as CustomerData, d as CheckFeatureResult, e as CheckProductResult, P as ProductItem, f as ProductScenario, g as CreateCustomerParams, h as Customer, B as BillingPortalResult, i as Product, j as CustomerExpandOption } from './AutumnProvider-CGdXoZNQ.js';
|
|
3
|
+
export { A as AutumnProvider } from './AutumnProvider-CGdXoZNQ.js';
|
|
4
4
|
import * as swr from 'swr';
|
|
5
5
|
import * as React$1 from 'react';
|
|
6
6
|
import { NextRequest, NextResponse } from 'next/server';
|
|
@@ -40,115 +40,6 @@ interface Entity {
|
|
|
40
40
|
invoices?: CustomerInvoice[];
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
interface ProductItem {
|
|
44
|
-
feature_id?: string;
|
|
45
|
-
included_usage?: number | typeof Infinite;
|
|
46
|
-
interval?: ProductItemIntervalType;
|
|
47
|
-
usage_model?: UsageModel;
|
|
48
|
-
price?: number;
|
|
49
|
-
billing_units?: number;
|
|
50
|
-
entity_feature_id?: string;
|
|
51
|
-
reset_usage_on_billing?: boolean;
|
|
52
|
-
reset_usage_when_enabled?: boolean;
|
|
53
|
-
display?: {
|
|
54
|
-
primary_text?: string;
|
|
55
|
-
secondary_text?: string;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
interface FreeTrial {
|
|
59
|
-
duration: FreeTrialDuration;
|
|
60
|
-
length: number;
|
|
61
|
-
unique_fingerprint: boolean;
|
|
62
|
-
trial_available?: boolean;
|
|
63
|
-
}
|
|
64
|
-
interface Product {
|
|
65
|
-
id: string;
|
|
66
|
-
created_at: number;
|
|
67
|
-
name: string;
|
|
68
|
-
env: AppEnv;
|
|
69
|
-
is_add_on: boolean;
|
|
70
|
-
is_default: boolean;
|
|
71
|
-
group: string;
|
|
72
|
-
version: number;
|
|
73
|
-
items: ProductItem[];
|
|
74
|
-
free_trial: FreeTrial | null;
|
|
75
|
-
scenario?: ProductScenario;
|
|
76
|
-
base_variant_id: string | null;
|
|
77
|
-
properties?: {
|
|
78
|
-
is_free?: boolean;
|
|
79
|
-
is_one_off?: boolean;
|
|
80
|
-
interval_group?: string;
|
|
81
|
-
};
|
|
82
|
-
display?: {
|
|
83
|
-
name?: string;
|
|
84
|
-
description?: string;
|
|
85
|
-
button_text?: string;
|
|
86
|
-
recommend_text?: string;
|
|
87
|
-
everything_from?: string;
|
|
88
|
-
button_url?: string;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
type CheckFeatureScenario = "usage_limit" | "feature_flag";
|
|
93
|
-
interface CheckFeatureResult extends CoreCustomerFeature {
|
|
94
|
-
allowed: boolean;
|
|
95
|
-
feature_id: string;
|
|
96
|
-
customer_id: string;
|
|
97
|
-
entity_id?: string;
|
|
98
|
-
required_balance: number;
|
|
99
|
-
code: string;
|
|
100
|
-
preview?: CheckFeaturePreview;
|
|
101
|
-
}
|
|
102
|
-
interface CheckFeaturePreview {
|
|
103
|
-
scenario: CheckFeatureScenario;
|
|
104
|
-
title: string;
|
|
105
|
-
message: string;
|
|
106
|
-
feature_id: string;
|
|
107
|
-
feature_name: string;
|
|
108
|
-
products: Product[];
|
|
109
|
-
}
|
|
110
|
-
type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
|
|
111
|
-
interface CheckProductResult {
|
|
112
|
-
allowed: boolean;
|
|
113
|
-
customer_id: string;
|
|
114
|
-
product_id: string;
|
|
115
|
-
code: string;
|
|
116
|
-
status?: string;
|
|
117
|
-
preview?: CheckProductPreview;
|
|
118
|
-
}
|
|
119
|
-
interface CheckProductPreview {
|
|
120
|
-
scenario: ProductScenario;
|
|
121
|
-
product_id: string;
|
|
122
|
-
product_name: string;
|
|
123
|
-
recurring: boolean;
|
|
124
|
-
error_on_attach?: boolean;
|
|
125
|
-
next_cycle_at?: number;
|
|
126
|
-
current_product_name?: string;
|
|
127
|
-
items?: {
|
|
128
|
-
price: string;
|
|
129
|
-
description: string;
|
|
130
|
-
usage_model?: UsageModelType;
|
|
131
|
-
}[];
|
|
132
|
-
options?: {
|
|
133
|
-
feature_id: string;
|
|
134
|
-
feature_name: string;
|
|
135
|
-
billing_units: number;
|
|
136
|
-
price?: number;
|
|
137
|
-
tiers?: {
|
|
138
|
-
to: number | string;
|
|
139
|
-
amount: number;
|
|
140
|
-
}[];
|
|
141
|
-
}[];
|
|
142
|
-
due_today?: {
|
|
143
|
-
price: number;
|
|
144
|
-
currency: string;
|
|
145
|
-
};
|
|
146
|
-
due_next_cycle?: {
|
|
147
|
-
price: number;
|
|
148
|
-
currency: string;
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
43
|
interface CancelResult {
|
|
153
44
|
success: boolean;
|
|
154
45
|
customer_id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CustomerProduct, b as CustomerFeature, c as CustomerInvoice, C as CustomerData,
|
|
1
|
+
import { a as CustomerProduct, b as CustomerFeature, c as CustomerInvoice, C as CustomerData, d as CheckFeatureResult, e as CheckProductResult, G as GetCustomerParams, f as Customer, g as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, P as Product, h as CreateProductParams, L as ListProductsParams } from './cusTypes-ASrCF4fa.mjs';
|
|
2
2
|
import { R as Result, A as AutumnError } from './response-eH4S4sg0.mjs';
|
|
3
3
|
import { G as GetEntityParams$1, C as CreateEntityParams$1 } from './clientEntTypes-BOVTwIKv.mjs';
|
|
4
4
|
|
|
@@ -34,126 +34,6 @@ interface EntityData {
|
|
|
34
34
|
feature_id: string;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
interface ProductItem {
|
|
38
|
-
feature_id?: string;
|
|
39
|
-
included_usage?: number | typeof Infinite;
|
|
40
|
-
interval?: ProductItemIntervalType;
|
|
41
|
-
usage_model?: UsageModel;
|
|
42
|
-
price?: number;
|
|
43
|
-
billing_units?: number;
|
|
44
|
-
entity_feature_id?: string;
|
|
45
|
-
reset_usage_on_billing?: boolean;
|
|
46
|
-
reset_usage_when_enabled?: boolean;
|
|
47
|
-
display?: {
|
|
48
|
-
primary_text?: string;
|
|
49
|
-
secondary_text?: string;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
interface FreeTrial {
|
|
53
|
-
duration: FreeTrialDuration;
|
|
54
|
-
length: number;
|
|
55
|
-
unique_fingerprint: boolean;
|
|
56
|
-
trial_available?: boolean;
|
|
57
|
-
}
|
|
58
|
-
interface Product {
|
|
59
|
-
id: string;
|
|
60
|
-
created_at: number;
|
|
61
|
-
name: string;
|
|
62
|
-
env: AppEnv;
|
|
63
|
-
is_add_on: boolean;
|
|
64
|
-
is_default: boolean;
|
|
65
|
-
group: string;
|
|
66
|
-
version: number;
|
|
67
|
-
items: ProductItem[];
|
|
68
|
-
free_trial: FreeTrial | null;
|
|
69
|
-
scenario?: ProductScenario;
|
|
70
|
-
base_variant_id: string | null;
|
|
71
|
-
properties?: {
|
|
72
|
-
is_free?: boolean;
|
|
73
|
-
is_one_off?: boolean;
|
|
74
|
-
interval_group?: string;
|
|
75
|
-
};
|
|
76
|
-
display?: {
|
|
77
|
-
name?: string;
|
|
78
|
-
description?: string;
|
|
79
|
-
button_text?: string;
|
|
80
|
-
recommend_text?: string;
|
|
81
|
-
everything_from?: string;
|
|
82
|
-
button_url?: string;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
interface CreateProductParams {
|
|
86
|
-
id: string;
|
|
87
|
-
name?: string;
|
|
88
|
-
is_add_on?: boolean;
|
|
89
|
-
is_default?: boolean;
|
|
90
|
-
items?: ProductItem[];
|
|
91
|
-
free_trial?: FreeTrial;
|
|
92
|
-
}
|
|
93
|
-
interface ListProductsParams {
|
|
94
|
-
customer_id?: string;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
type CheckFeatureScenario = "usage_limit" | "feature_flag";
|
|
98
|
-
interface CheckFeatureResult extends CoreCustomerFeature {
|
|
99
|
-
allowed: boolean;
|
|
100
|
-
feature_id: string;
|
|
101
|
-
customer_id: string;
|
|
102
|
-
entity_id?: string;
|
|
103
|
-
required_balance: number;
|
|
104
|
-
code: string;
|
|
105
|
-
preview?: CheckFeaturePreview;
|
|
106
|
-
}
|
|
107
|
-
interface CheckFeaturePreview {
|
|
108
|
-
scenario: CheckFeatureScenario;
|
|
109
|
-
title: string;
|
|
110
|
-
message: string;
|
|
111
|
-
feature_id: string;
|
|
112
|
-
feature_name: string;
|
|
113
|
-
products: Product[];
|
|
114
|
-
}
|
|
115
|
-
type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
|
|
116
|
-
interface CheckProductResult {
|
|
117
|
-
allowed: boolean;
|
|
118
|
-
customer_id: string;
|
|
119
|
-
product_id: string;
|
|
120
|
-
code: string;
|
|
121
|
-
status?: string;
|
|
122
|
-
preview?: CheckProductPreview;
|
|
123
|
-
}
|
|
124
|
-
interface CheckProductPreview {
|
|
125
|
-
scenario: ProductScenario;
|
|
126
|
-
product_id: string;
|
|
127
|
-
product_name: string;
|
|
128
|
-
recurring: boolean;
|
|
129
|
-
error_on_attach?: boolean;
|
|
130
|
-
next_cycle_at?: number;
|
|
131
|
-
current_product_name?: string;
|
|
132
|
-
items?: {
|
|
133
|
-
price: string;
|
|
134
|
-
description: string;
|
|
135
|
-
usage_model?: UsageModelType;
|
|
136
|
-
}[];
|
|
137
|
-
options?: {
|
|
138
|
-
feature_id: string;
|
|
139
|
-
feature_name: string;
|
|
140
|
-
billing_units: number;
|
|
141
|
-
price?: number;
|
|
142
|
-
tiers?: {
|
|
143
|
-
to: number | string;
|
|
144
|
-
amount: number;
|
|
145
|
-
}[];
|
|
146
|
-
}[];
|
|
147
|
-
due_today?: {
|
|
148
|
-
price: number;
|
|
149
|
-
currency: string;
|
|
150
|
-
};
|
|
151
|
-
due_next_cycle?: {
|
|
152
|
-
price: number;
|
|
153
|
-
currency: string;
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
37
|
interface AttachFeatureOptions {
|
|
158
38
|
feature_id: string;
|
|
159
39
|
quantity: number;
|