autumn-js 1.2.13 → 1.2.14
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/backend/adapters/express.js +419 -69
- package/dist/backend/adapters/express.mjs +5 -5
- package/dist/backend/adapters/fetch.js +419 -69
- package/dist/backend/adapters/fetch.mjs +5 -5
- package/dist/backend/adapters/hono.js +419 -69
- package/dist/backend/adapters/hono.mjs +5 -5
- package/dist/backend/adapters/index.js +419 -69
- package/dist/backend/adapters/index.mjs +8 -8
- package/dist/backend/adapters/next.js +419 -69
- package/dist/backend/adapters/next.mjs +5 -5
- package/dist/backend/{chunk-YSQQKZBU.mjs → chunk-5XWZK7Q6.mjs} +1 -1
- package/dist/backend/{chunk-OUDB34Y7.mjs → chunk-BVJU43R5.mjs} +1 -1
- package/dist/backend/{chunk-T42RZEUZ.mjs → chunk-GE5VY4YO.mjs} +419 -69
- package/dist/backend/{chunk-DNNJOZAT.mjs → chunk-JDJMZQCY.mjs} +1 -1
- package/dist/backend/{chunk-7BVATYGA.mjs → chunk-N2OJ347N.mjs} +1 -1
- package/dist/backend/{chunk-EJGHP7KT.mjs → chunk-QAFNIIBW.mjs} +1 -1
- package/dist/backend/{chunk-RPH5L44S.mjs → chunk-ZOOAE7OJ.mjs} +1 -1
- package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
- package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
- package/dist/backend/core/handlers/coreHandler.js +419 -69
- package/dist/backend/core/handlers/coreHandler.mjs +3 -3
- package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
- package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
- package/dist/backend/core/handlers/executeRoute.mjs +1 -1
- package/dist/backend/core/handlers/handleRouteByName.js +419 -69
- package/dist/backend/core/handlers/handleRouteByName.mjs +3 -3
- package/dist/backend/core/handlers/index.d.mts +1 -1
- package/dist/backend/core/handlers/index.d.ts +1 -1
- package/dist/backend/core/handlers/index.js +419 -69
- package/dist/backend/core/handlers/index.mjs +4 -4
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +419 -69
- package/dist/backend/core/index.mjs +6 -6
- package/dist/backend/core/routes/index.d.mts +1 -1
- package/dist/backend/core/routes/index.d.ts +1 -1
- package/dist/backend/core/routes/index.mjs +1 -1
- package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
- package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.mjs +1 -1
- package/dist/backend/core/types/handlerTypes.d.mts +1 -1
- package/dist/backend/core/types/handlerTypes.d.ts +1 -1
- package/dist/backend/core/types/index.d.mts +1 -1
- package/dist/backend/core/types/index.d.ts +1 -1
- package/dist/backend/core/types/routeTypes.d.mts +1 -1
- package/dist/backend/core/types/routeTypes.d.ts +1 -1
- package/dist/backend/core/utils/index.mjs +3 -3
- package/dist/backend/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/index.js +419 -69
- package/dist/backend/index.mjs +6 -6
- package/dist/backend/{routeTypes-DVwngaBn.d.mts → routeTypes-B-X-zb1q.d.mts} +558 -68
- package/dist/backend/{routeTypes-B94_Mq2J.d.ts → routeTypes-bGaZQm24.d.ts} +558 -68
- package/dist/better-auth/{chunk-ZZGFPTHO.mjs → chunk-DNNKTBFL.mjs} +419 -69
- package/dist/better-auth/client.d.mts +2 -4
- package/dist/better-auth/client.d.ts +2 -4
- package/dist/better-auth/{createAutumnEndpoint-CvXRCg-M.d.mts → createAutumnEndpoint-Clm1sxhQ.d.mts} +4 -8
- package/dist/better-auth/{createAutumnEndpoint-CvXRCg-M.d.ts → createAutumnEndpoint-Clm1sxhQ.d.ts} +4 -8
- package/dist/better-auth/index.d.mts +2 -4
- package/dist/better-auth/index.d.ts +2 -4
- package/dist/better-auth/index.js +419 -69
- package/dist/better-auth/index.mjs +1 -1
- package/dist/better-auth/utils/createAutumnEndpoint.d.mts +2 -4
- package/dist/better-auth/utils/createAutumnEndpoint.d.ts +2 -4
- package/dist/better-auth/utils/handleBetterAuthRoute.d.mts +2 -4
- package/dist/better-auth/utils/handleBetterAuthRoute.d.ts +2 -4
- package/dist/better-auth/utils/handleBetterAuthRoute.js +419 -69
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +1 -1
- package/dist/better-auth/utils/index.d.mts +3 -4
- package/dist/better-auth/utils/index.d.ts +3 -4
- package/dist/better-auth/utils/index.js +419 -69
- package/dist/better-auth/utils/index.mjs +1 -1
- package/dist/react/AutumnContext.d.mts +1 -1
- package/dist/react/AutumnContext.d.ts +1 -1
- package/dist/react/client/AutumnClient.d.mts +1 -1
- package/dist/react/client/AutumnClient.d.ts +1 -1
- package/dist/react/client/IAutumnClient.d.mts +1 -1
- package/dist/react/client/IAutumnClient.d.ts +1 -1
- package/dist/react/client/index.d.mts +1 -1
- package/dist/react/client/index.d.ts +1 -1
- package/dist/react/hooks/index.d.mts +1 -1
- package/dist/react/hooks/index.d.ts +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
- package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
- package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
- package/dist/react/hooks/useCustomer.d.mts +1 -1
- package/dist/react/hooks/useCustomer.d.ts +1 -1
- package/dist/react/hooks/useEntity.d.mts +1 -1
- package/dist/react/hooks/useEntity.d.ts +1 -1
- package/dist/react/hooks/useListEvents.d.mts +1 -1
- package/dist/react/hooks/useListEvents.d.ts +1 -1
- package/dist/react/hooks/useListPlans.d.mts +1 -1
- package/dist/react/hooks/useListPlans.d.ts +1 -1
- package/dist/react/hooks/useReferrals.d.mts +1 -1
- package/dist/react/hooks/useReferrals.d.ts +1 -1
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/{params-B5l9vHfZ.d.ts → params-CTiHT2EX.d.ts} +515 -64
- package/dist/react/{params-BVglT8vT.d.mts → params-ZvrBzzFE.d.mts} +515 -64
- package/dist/sdk/index.d.mts +683 -109
- package/dist/sdk/index.d.ts +683 -109
- package/dist/sdk/index.js +3436 -2889
- package/dist/sdk/index.mjs +3320 -2837
- package/package.json +1 -1
|
@@ -1629,7 +1629,7 @@ type CheckParams = {
|
|
|
1629
1629
|
/**
|
|
1630
1630
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1631
1631
|
*/
|
|
1632
|
-
declare const
|
|
1632
|
+
declare const FlagType2: {
|
|
1633
1633
|
readonly Boolean: "boolean";
|
|
1634
1634
|
readonly Metered: "metered";
|
|
1635
1635
|
readonly CreditSystem: "credit_system";
|
|
@@ -1637,8 +1637,8 @@ declare const FlagType: {
|
|
|
1637
1637
|
/**
|
|
1638
1638
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1639
1639
|
*/
|
|
1640
|
-
type
|
|
1641
|
-
type
|
|
1640
|
+
type FlagType2 = OpenEnum<typeof FlagType2>;
|
|
1641
|
+
type CheckCreditSchema2 = {
|
|
1642
1642
|
/**
|
|
1643
1643
|
* ID of the metered feature that draws from this credit system.
|
|
1644
1644
|
*/
|
|
@@ -1651,7 +1651,7 @@ type CheckCreditSchema = {
|
|
|
1651
1651
|
/**
|
|
1652
1652
|
* Display names for the feature in billing UI and customer-facing components.
|
|
1653
1653
|
*/
|
|
1654
|
-
type
|
|
1654
|
+
type FlagDisplay2 = {
|
|
1655
1655
|
/**
|
|
1656
1656
|
* Singular form for UI display (e.g., 'API call', 'seat').
|
|
1657
1657
|
*/
|
|
@@ -1664,7 +1664,7 @@ type FlagDisplay = {
|
|
|
1664
1664
|
/**
|
|
1665
1665
|
* The full feature object if expanded.
|
|
1666
1666
|
*/
|
|
1667
|
-
type
|
|
1667
|
+
type CheckFeature2 = {
|
|
1668
1668
|
/**
|
|
1669
1669
|
* The unique identifier for this feature, used in /check and /track calls.
|
|
1670
1670
|
*/
|
|
@@ -1676,7 +1676,7 @@ type CheckFeature = {
|
|
|
1676
1676
|
/**
|
|
1677
1677
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1678
1678
|
*/
|
|
1679
|
-
type:
|
|
1679
|
+
type: FlagType2;
|
|
1680
1680
|
/**
|
|
1681
1681
|
* For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
|
|
1682
1682
|
*/
|
|
@@ -1688,17 +1688,17 @@ type CheckFeature = {
|
|
|
1688
1688
|
/**
|
|
1689
1689
|
* For credit_system features: maps metered features to their credit costs.
|
|
1690
1690
|
*/
|
|
1691
|
-
creditSchema?: Array<
|
|
1691
|
+
creditSchema?: Array<CheckCreditSchema2> | undefined;
|
|
1692
1692
|
/**
|
|
1693
1693
|
* Display names for the feature in billing UI and customer-facing components.
|
|
1694
1694
|
*/
|
|
1695
|
-
display?:
|
|
1695
|
+
display?: FlagDisplay2 | undefined;
|
|
1696
1696
|
/**
|
|
1697
1697
|
* Whether the feature is archived and hidden from the dashboard.
|
|
1698
1698
|
*/
|
|
1699
1699
|
archived: boolean;
|
|
1700
1700
|
};
|
|
1701
|
-
type
|
|
1701
|
+
type Flag2 = {
|
|
1702
1702
|
/**
|
|
1703
1703
|
* The unique identifier for this flag.
|
|
1704
1704
|
*/
|
|
@@ -1718,44 +1718,44 @@ type Flag = {
|
|
|
1718
1718
|
/**
|
|
1719
1719
|
* The full feature object if expanded.
|
|
1720
1720
|
*/
|
|
1721
|
-
feature?:
|
|
1721
|
+
feature?: CheckFeature2 | undefined;
|
|
1722
1722
|
};
|
|
1723
1723
|
/**
|
|
1724
1724
|
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1725
1725
|
*/
|
|
1726
|
-
declare const
|
|
1726
|
+
declare const Scenario2: {
|
|
1727
1727
|
readonly UsageLimit: "usage_limit";
|
|
1728
1728
|
readonly FeatureFlag: "feature_flag";
|
|
1729
1729
|
};
|
|
1730
1730
|
/**
|
|
1731
1731
|
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1732
1732
|
*/
|
|
1733
|
-
type
|
|
1733
|
+
type Scenario2 = OpenEnum<typeof Scenario2>;
|
|
1734
1734
|
/**
|
|
1735
1735
|
* The environment of the product
|
|
1736
1736
|
*/
|
|
1737
|
-
declare const
|
|
1737
|
+
declare const CheckEnv2: {
|
|
1738
1738
|
readonly Sandbox: "sandbox";
|
|
1739
1739
|
readonly Live: "live";
|
|
1740
1740
|
};
|
|
1741
1741
|
/**
|
|
1742
1742
|
* The environment of the product
|
|
1743
1743
|
*/
|
|
1744
|
-
type
|
|
1745
|
-
declare const
|
|
1744
|
+
type CheckEnv2 = OpenEnum<typeof CheckEnv2>;
|
|
1745
|
+
declare const ProductType2: {
|
|
1746
1746
|
readonly Feature: "feature";
|
|
1747
1747
|
readonly PricedFeature: "priced_feature";
|
|
1748
1748
|
readonly Price: "price";
|
|
1749
1749
|
};
|
|
1750
|
-
type
|
|
1751
|
-
declare const
|
|
1750
|
+
type ProductType2 = OpenEnum<typeof ProductType2>;
|
|
1751
|
+
declare const FeatureType2: {
|
|
1752
1752
|
readonly SingleUse: "single_use";
|
|
1753
1753
|
readonly ContinuousUse: "continuous_use";
|
|
1754
1754
|
readonly Boolean: "boolean";
|
|
1755
1755
|
readonly Static: "static";
|
|
1756
1756
|
};
|
|
1757
|
-
type
|
|
1758
|
-
declare const
|
|
1757
|
+
type FeatureType2 = OpenEnum<typeof FeatureType2>;
|
|
1758
|
+
declare const CheckInterval2: {
|
|
1759
1759
|
readonly Minute: "minute";
|
|
1760
1760
|
readonly Hour: "hour";
|
|
1761
1761
|
readonly Day: "day";
|
|
@@ -1765,60 +1765,60 @@ declare const CheckInterval: {
|
|
|
1765
1765
|
readonly SemiAnnual: "semi_annual";
|
|
1766
1766
|
readonly Year: "year";
|
|
1767
1767
|
};
|
|
1768
|
-
type
|
|
1769
|
-
declare const
|
|
1768
|
+
type CheckInterval2 = OpenEnum<typeof CheckInterval2>;
|
|
1769
|
+
declare const CheckTierBehavior2: {
|
|
1770
1770
|
readonly Graduated: "graduated";
|
|
1771
1771
|
readonly Volume: "volume";
|
|
1772
1772
|
};
|
|
1773
|
-
type
|
|
1774
|
-
declare const
|
|
1773
|
+
type CheckTierBehavior2 = OpenEnum<typeof CheckTierBehavior2>;
|
|
1774
|
+
declare const UsageModel2: {
|
|
1775
1775
|
readonly Prepaid: "prepaid";
|
|
1776
1776
|
readonly PayPerUse: "pay_per_use";
|
|
1777
1777
|
};
|
|
1778
|
-
type
|
|
1779
|
-
type
|
|
1778
|
+
type UsageModel2 = OpenEnum<typeof UsageModel2>;
|
|
1779
|
+
type ProductDisplay2 = {
|
|
1780
1780
|
primaryText: string;
|
|
1781
1781
|
secondaryText?: string | null | undefined;
|
|
1782
1782
|
};
|
|
1783
|
-
declare const
|
|
1783
|
+
declare const ConfigDuration2: {
|
|
1784
1784
|
readonly Month: "month";
|
|
1785
1785
|
readonly Forever: "forever";
|
|
1786
1786
|
};
|
|
1787
|
-
type
|
|
1788
|
-
type
|
|
1787
|
+
type ConfigDuration2 = OpenEnum<typeof ConfigDuration2>;
|
|
1788
|
+
type CheckRollover2 = {
|
|
1789
1789
|
max?: number | null | undefined;
|
|
1790
1790
|
maxPercentage?: number | null | undefined;
|
|
1791
|
-
duration:
|
|
1791
|
+
duration: ConfigDuration2;
|
|
1792
1792
|
length: number;
|
|
1793
1793
|
};
|
|
1794
|
-
declare const
|
|
1794
|
+
declare const CheckOnIncrease2: {
|
|
1795
1795
|
readonly BillImmediately: "bill_immediately";
|
|
1796
1796
|
readonly ProrateImmediately: "prorate_immediately";
|
|
1797
1797
|
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1798
1798
|
readonly BillNextCycle: "bill_next_cycle";
|
|
1799
1799
|
};
|
|
1800
|
-
type
|
|
1801
|
-
declare const
|
|
1800
|
+
type CheckOnIncrease2 = OpenEnum<typeof CheckOnIncrease2>;
|
|
1801
|
+
declare const CheckOnDecrease2: {
|
|
1802
1802
|
readonly Prorate: "prorate";
|
|
1803
1803
|
readonly ProrateImmediately: "prorate_immediately";
|
|
1804
1804
|
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1805
1805
|
readonly None: "none";
|
|
1806
1806
|
readonly NoProrations: "no_prorations";
|
|
1807
1807
|
};
|
|
1808
|
-
type
|
|
1809
|
-
type
|
|
1810
|
-
rollover?:
|
|
1811
|
-
onIncrease?:
|
|
1812
|
-
onDecrease?:
|
|
1808
|
+
type CheckOnDecrease2 = OpenEnum<typeof CheckOnDecrease2>;
|
|
1809
|
+
type CheckConfig2 = {
|
|
1810
|
+
rollover?: CheckRollover2 | null | undefined;
|
|
1811
|
+
onIncrease?: CheckOnIncrease2 | null | undefined;
|
|
1812
|
+
onDecrease?: CheckOnDecrease2 | null | undefined;
|
|
1813
1813
|
};
|
|
1814
1814
|
/**
|
|
1815
1815
|
* Product item defining features and pricing within a product
|
|
1816
1816
|
*/
|
|
1817
|
-
type
|
|
1817
|
+
type CheckItem2 = {
|
|
1818
1818
|
/**
|
|
1819
1819
|
* The type of the product item
|
|
1820
1820
|
*/
|
|
1821
|
-
type?:
|
|
1821
|
+
type?: ProductType2 | null | undefined;
|
|
1822
1822
|
/**
|
|
1823
1823
|
* The feature ID of the product item. If the item is a fixed price, should be `null`
|
|
1824
1824
|
*/
|
|
@@ -1826,7 +1826,7 @@ type CheckItem = {
|
|
|
1826
1826
|
/**
|
|
1827
1827
|
* Single use features are used once and then depleted, like API calls or credits. Continuous use features are those being used on an ongoing-basis, like storage or seats.
|
|
1828
1828
|
*/
|
|
1829
|
-
featureType?:
|
|
1829
|
+
featureType?: FeatureType2 | null | undefined;
|
|
1830
1830
|
/**
|
|
1831
1831
|
* The amount of usage included for this feature.
|
|
1832
1832
|
*/
|
|
@@ -1834,7 +1834,7 @@ type CheckItem = {
|
|
|
1834
1834
|
/**
|
|
1835
1835
|
* The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off.
|
|
1836
1836
|
*/
|
|
1837
|
-
interval?:
|
|
1837
|
+
interval?: CheckInterval2 | null | undefined;
|
|
1838
1838
|
/**
|
|
1839
1839
|
* The interval count of the product item.
|
|
1840
1840
|
*/
|
|
@@ -1850,11 +1850,11 @@ type CheckItem = {
|
|
|
1850
1850
|
/**
|
|
1851
1851
|
* How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier). Defaults to graduated.
|
|
1852
1852
|
*/
|
|
1853
|
-
tierBehavior?:
|
|
1853
|
+
tierBehavior?: CheckTierBehavior2 | null | undefined;
|
|
1854
1854
|
/**
|
|
1855
1855
|
* Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
|
|
1856
1856
|
*/
|
|
1857
|
-
usageModel?:
|
|
1857
|
+
usageModel?: UsageModel2 | null | undefined;
|
|
1858
1858
|
/**
|
|
1859
1859
|
* The amount per billing unit (eg. $9 / 250 units)
|
|
1860
1860
|
*/
|
|
@@ -1870,7 +1870,7 @@ type CheckItem = {
|
|
|
1870
1870
|
/**
|
|
1871
1871
|
* The display of the product item.
|
|
1872
1872
|
*/
|
|
1873
|
-
display?:
|
|
1873
|
+
display?: ProductDisplay2 | null | undefined;
|
|
1874
1874
|
/**
|
|
1875
1875
|
* Used in customer context. Quantity of the feature the customer has prepaid for.
|
|
1876
1876
|
*/
|
|
@@ -1882,12 +1882,12 @@ type CheckItem = {
|
|
|
1882
1882
|
/**
|
|
1883
1883
|
* Configuration for rollover and proration behavior of the feature.
|
|
1884
1884
|
*/
|
|
1885
|
-
config?:
|
|
1885
|
+
config?: CheckConfig2 | null | undefined;
|
|
1886
1886
|
};
|
|
1887
1887
|
/**
|
|
1888
1888
|
* The duration type of the free trial
|
|
1889
1889
|
*/
|
|
1890
|
-
declare const
|
|
1890
|
+
declare const FreeTrialDuration2: {
|
|
1891
1891
|
readonly Day: "day";
|
|
1892
1892
|
readonly Month: "month";
|
|
1893
1893
|
readonly Year: "year";
|
|
@@ -1895,12 +1895,12 @@ declare const FreeTrialDuration: {
|
|
|
1895
1895
|
/**
|
|
1896
1896
|
* The duration type of the free trial
|
|
1897
1897
|
*/
|
|
1898
|
-
type
|
|
1899
|
-
type
|
|
1898
|
+
type FreeTrialDuration2 = OpenEnum<typeof FreeTrialDuration2>;
|
|
1899
|
+
type CheckFreeTrial2 = {
|
|
1900
1900
|
/**
|
|
1901
1901
|
* The duration type of the free trial
|
|
1902
1902
|
*/
|
|
1903
|
-
duration:
|
|
1903
|
+
duration: FreeTrialDuration2;
|
|
1904
1904
|
/**
|
|
1905
1905
|
* The length of the duration type specified
|
|
1906
1906
|
*/
|
|
@@ -1921,7 +1921,7 @@ type CheckFreeTrial = {
|
|
|
1921
1921
|
/**
|
|
1922
1922
|
* Scenario for when this product is used in attach flows
|
|
1923
1923
|
*/
|
|
1924
|
-
declare const
|
|
1924
|
+
declare const ProductScenario2: {
|
|
1925
1925
|
readonly Scheduled: "scheduled";
|
|
1926
1926
|
readonly Active: "active";
|
|
1927
1927
|
readonly New: "new";
|
|
@@ -1936,8 +1936,8 @@ declare const ProductScenario: {
|
|
|
1936
1936
|
/**
|
|
1937
1937
|
* Scenario for when this product is used in attach flows
|
|
1938
1938
|
*/
|
|
1939
|
-
type
|
|
1940
|
-
type
|
|
1939
|
+
type ProductScenario2 = OpenEnum<typeof ProductScenario2>;
|
|
1940
|
+
type Properties2 = {
|
|
1941
1941
|
/**
|
|
1942
1942
|
* True if the product has no base price or usage prices
|
|
1943
1943
|
*/
|
|
@@ -1959,7 +1959,7 @@ type Properties = {
|
|
|
1959
1959
|
*/
|
|
1960
1960
|
updateable?: boolean | null | undefined;
|
|
1961
1961
|
};
|
|
1962
|
-
type
|
|
1962
|
+
type Product2 = {
|
|
1963
1963
|
/**
|
|
1964
1964
|
* The ID of the product you set when creating the product
|
|
1965
1965
|
*/
|
|
@@ -1975,7 +1975,7 @@ type Product = {
|
|
|
1975
1975
|
/**
|
|
1976
1976
|
* The environment of the product
|
|
1977
1977
|
*/
|
|
1978
|
-
env:
|
|
1978
|
+
env: CheckEnv2;
|
|
1979
1979
|
/**
|
|
1980
1980
|
* Whether the product is an add-on and can be purchased alongside other products
|
|
1981
1981
|
*/
|
|
@@ -1999,11 +1999,11 @@ type Product = {
|
|
|
1999
1999
|
/**
|
|
2000
2000
|
* Array of product items that define the product's features and pricing
|
|
2001
2001
|
*/
|
|
2002
|
-
items: Array<
|
|
2002
|
+
items: Array<CheckItem2>;
|
|
2003
2003
|
/**
|
|
2004
2004
|
* Free trial configuration for this product, if available
|
|
2005
2005
|
*/
|
|
2006
|
-
freeTrial:
|
|
2006
|
+
freeTrial: CheckFreeTrial2 | null;
|
|
2007
2007
|
/**
|
|
2008
2008
|
* ID of the base variant this product is derived from
|
|
2009
2009
|
*/
|
|
@@ -2011,17 +2011,17 @@ type Product = {
|
|
|
2011
2011
|
/**
|
|
2012
2012
|
* Scenario for when this product is used in attach flows
|
|
2013
2013
|
*/
|
|
2014
|
-
scenario?:
|
|
2015
|
-
properties?:
|
|
2014
|
+
scenario?: ProductScenario2 | undefined;
|
|
2015
|
+
properties?: Properties2 | undefined;
|
|
2016
2016
|
};
|
|
2017
2017
|
/**
|
|
2018
2018
|
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
2019
2019
|
*/
|
|
2020
|
-
type
|
|
2020
|
+
type Preview2 = {
|
|
2021
2021
|
/**
|
|
2022
2022
|
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
2023
2023
|
*/
|
|
2024
|
-
scenario:
|
|
2024
|
+
scenario: Scenario2;
|
|
2025
2025
|
/**
|
|
2026
2026
|
* A title suitable for displaying in a paywall or upgrade modal.
|
|
2027
2027
|
*/
|
|
@@ -2041,12 +2041,462 @@ type Preview = {
|
|
|
2041
2041
|
/**
|
|
2042
2042
|
* Products that would grant access to this feature. Use to display upgrade options.
|
|
2043
2043
|
*/
|
|
2044
|
-
products: Array<
|
|
2044
|
+
products: Array<Product2>;
|
|
2045
|
+
};
|
|
2046
|
+
/**
|
|
2047
|
+
* Accepted. Autumn is experiencing degraded service from a downstream provider, so access was allowed fail-open.
|
|
2048
|
+
*/
|
|
2049
|
+
type CheckResponseBody2 = {
|
|
2050
|
+
/**
|
|
2051
|
+
* Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
|
|
2052
|
+
*/
|
|
2053
|
+
allowed: boolean;
|
|
2054
|
+
/**
|
|
2055
|
+
* The ID of the customer that was checked.
|
|
2056
|
+
*/
|
|
2057
|
+
customerId: string;
|
|
2058
|
+
/**
|
|
2059
|
+
* The ID of the entity, if an entity-scoped check was performed.
|
|
2060
|
+
*/
|
|
2061
|
+
entityId?: string | null | undefined;
|
|
2062
|
+
/**
|
|
2063
|
+
* The required balance that was checked against.
|
|
2064
|
+
*/
|
|
2065
|
+
requiredBalance?: number | undefined;
|
|
2066
|
+
/**
|
|
2067
|
+
* The customer's balance for this feature. Null if the customer has no balance for this feature.
|
|
2068
|
+
*/
|
|
2069
|
+
balance: Balance | null;
|
|
2070
|
+
/**
|
|
2071
|
+
* The flag associated with this check, if any.
|
|
2072
|
+
*/
|
|
2073
|
+
flag: Flag2 | null;
|
|
2074
|
+
/**
|
|
2075
|
+
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
2076
|
+
*/
|
|
2077
|
+
preview?: Preview2 | undefined;
|
|
2078
|
+
};
|
|
2079
|
+
/**
|
|
2080
|
+
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
2081
|
+
*/
|
|
2082
|
+
declare const FlagType1: {
|
|
2083
|
+
readonly Boolean: "boolean";
|
|
2084
|
+
readonly Metered: "metered";
|
|
2085
|
+
readonly CreditSystem: "credit_system";
|
|
2086
|
+
};
|
|
2087
|
+
/**
|
|
2088
|
+
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
2089
|
+
*/
|
|
2090
|
+
type FlagType1 = OpenEnum<typeof FlagType1>;
|
|
2091
|
+
type CheckCreditSchema1 = {
|
|
2092
|
+
/**
|
|
2093
|
+
* ID of the metered feature that draws from this credit system.
|
|
2094
|
+
*/
|
|
2095
|
+
meteredFeatureId: string;
|
|
2096
|
+
/**
|
|
2097
|
+
* Credits consumed per unit of the metered feature.
|
|
2098
|
+
*/
|
|
2099
|
+
creditCost: number;
|
|
2100
|
+
};
|
|
2101
|
+
/**
|
|
2102
|
+
* Display names for the feature in billing UI and customer-facing components.
|
|
2103
|
+
*/
|
|
2104
|
+
type FlagDisplay1 = {
|
|
2105
|
+
/**
|
|
2106
|
+
* Singular form for UI display (e.g., 'API call', 'seat').
|
|
2107
|
+
*/
|
|
2108
|
+
singular?: string | null | undefined;
|
|
2109
|
+
/**
|
|
2110
|
+
* Plural form for UI display (e.g., 'API calls', 'seats').
|
|
2111
|
+
*/
|
|
2112
|
+
plural?: string | null | undefined;
|
|
2113
|
+
};
|
|
2114
|
+
/**
|
|
2115
|
+
* The full feature object if expanded.
|
|
2116
|
+
*/
|
|
2117
|
+
type CheckFeature1 = {
|
|
2118
|
+
/**
|
|
2119
|
+
* The unique identifier for this feature, used in /check and /track calls.
|
|
2120
|
+
*/
|
|
2121
|
+
id: string;
|
|
2122
|
+
/**
|
|
2123
|
+
* Human-readable name displayed in the dashboard and billing UI.
|
|
2124
|
+
*/
|
|
2125
|
+
name: string;
|
|
2126
|
+
/**
|
|
2127
|
+
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
2128
|
+
*/
|
|
2129
|
+
type: FlagType1;
|
|
2130
|
+
/**
|
|
2131
|
+
* For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
|
|
2132
|
+
*/
|
|
2133
|
+
consumable: boolean;
|
|
2134
|
+
/**
|
|
2135
|
+
* Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
|
|
2136
|
+
*/
|
|
2137
|
+
eventNames?: Array<string> | undefined;
|
|
2138
|
+
/**
|
|
2139
|
+
* For credit_system features: maps metered features to their credit costs.
|
|
2140
|
+
*/
|
|
2141
|
+
creditSchema?: Array<CheckCreditSchema1> | undefined;
|
|
2142
|
+
/**
|
|
2143
|
+
* Display names for the feature in billing UI and customer-facing components.
|
|
2144
|
+
*/
|
|
2145
|
+
display?: FlagDisplay1 | undefined;
|
|
2146
|
+
/**
|
|
2147
|
+
* Whether the feature is archived and hidden from the dashboard.
|
|
2148
|
+
*/
|
|
2149
|
+
archived: boolean;
|
|
2150
|
+
};
|
|
2151
|
+
type Flag1 = {
|
|
2152
|
+
/**
|
|
2153
|
+
* The unique identifier for this flag.
|
|
2154
|
+
*/
|
|
2155
|
+
id: string;
|
|
2156
|
+
/**
|
|
2157
|
+
* The plan ID this flag originates from, or null for standalone flags.
|
|
2158
|
+
*/
|
|
2159
|
+
planId: string | null;
|
|
2160
|
+
/**
|
|
2161
|
+
* Timestamp when this flag expires, or null for no expiration.
|
|
2162
|
+
*/
|
|
2163
|
+
expiresAt: number | null;
|
|
2164
|
+
/**
|
|
2165
|
+
* The feature ID this flag is for.
|
|
2166
|
+
*/
|
|
2167
|
+
featureId: string;
|
|
2168
|
+
/**
|
|
2169
|
+
* The full feature object if expanded.
|
|
2170
|
+
*/
|
|
2171
|
+
feature?: CheckFeature1 | undefined;
|
|
2172
|
+
};
|
|
2173
|
+
/**
|
|
2174
|
+
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
2175
|
+
*/
|
|
2176
|
+
declare const Scenario1: {
|
|
2177
|
+
readonly UsageLimit: "usage_limit";
|
|
2178
|
+
readonly FeatureFlag: "feature_flag";
|
|
2179
|
+
};
|
|
2180
|
+
/**
|
|
2181
|
+
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
2182
|
+
*/
|
|
2183
|
+
type Scenario1 = OpenEnum<typeof Scenario1>;
|
|
2184
|
+
/**
|
|
2185
|
+
* The environment of the product
|
|
2186
|
+
*/
|
|
2187
|
+
declare const CheckEnv1: {
|
|
2188
|
+
readonly Sandbox: "sandbox";
|
|
2189
|
+
readonly Live: "live";
|
|
2190
|
+
};
|
|
2191
|
+
/**
|
|
2192
|
+
* The environment of the product
|
|
2193
|
+
*/
|
|
2194
|
+
type CheckEnv1 = OpenEnum<typeof CheckEnv1>;
|
|
2195
|
+
declare const ProductType1: {
|
|
2196
|
+
readonly Feature: "feature";
|
|
2197
|
+
readonly PricedFeature: "priced_feature";
|
|
2198
|
+
readonly Price: "price";
|
|
2199
|
+
};
|
|
2200
|
+
type ProductType1 = OpenEnum<typeof ProductType1>;
|
|
2201
|
+
declare const FeatureType1: {
|
|
2202
|
+
readonly SingleUse: "single_use";
|
|
2203
|
+
readonly ContinuousUse: "continuous_use";
|
|
2204
|
+
readonly Boolean: "boolean";
|
|
2205
|
+
readonly Static: "static";
|
|
2206
|
+
};
|
|
2207
|
+
type FeatureType1 = OpenEnum<typeof FeatureType1>;
|
|
2208
|
+
declare const CheckInterval1: {
|
|
2209
|
+
readonly Minute: "minute";
|
|
2210
|
+
readonly Hour: "hour";
|
|
2211
|
+
readonly Day: "day";
|
|
2212
|
+
readonly Week: "week";
|
|
2213
|
+
readonly Month: "month";
|
|
2214
|
+
readonly Quarter: "quarter";
|
|
2215
|
+
readonly SemiAnnual: "semi_annual";
|
|
2216
|
+
readonly Year: "year";
|
|
2217
|
+
};
|
|
2218
|
+
type CheckInterval1 = OpenEnum<typeof CheckInterval1>;
|
|
2219
|
+
declare const CheckTierBehavior1: {
|
|
2220
|
+
readonly Graduated: "graduated";
|
|
2221
|
+
readonly Volume: "volume";
|
|
2222
|
+
};
|
|
2223
|
+
type CheckTierBehavior1 = OpenEnum<typeof CheckTierBehavior1>;
|
|
2224
|
+
declare const UsageModel1: {
|
|
2225
|
+
readonly Prepaid: "prepaid";
|
|
2226
|
+
readonly PayPerUse: "pay_per_use";
|
|
2227
|
+
};
|
|
2228
|
+
type UsageModel1 = OpenEnum<typeof UsageModel1>;
|
|
2229
|
+
type ProductDisplay1 = {
|
|
2230
|
+
primaryText: string;
|
|
2231
|
+
secondaryText?: string | null | undefined;
|
|
2232
|
+
};
|
|
2233
|
+
declare const ConfigDuration1: {
|
|
2234
|
+
readonly Month: "month";
|
|
2235
|
+
readonly Forever: "forever";
|
|
2236
|
+
};
|
|
2237
|
+
type ConfigDuration1 = OpenEnum<typeof ConfigDuration1>;
|
|
2238
|
+
type CheckRollover1 = {
|
|
2239
|
+
max?: number | null | undefined;
|
|
2240
|
+
maxPercentage?: number | null | undefined;
|
|
2241
|
+
duration: ConfigDuration1;
|
|
2242
|
+
length: number;
|
|
2243
|
+
};
|
|
2244
|
+
declare const CheckOnIncrease1: {
|
|
2245
|
+
readonly BillImmediately: "bill_immediately";
|
|
2246
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
2247
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
2248
|
+
readonly BillNextCycle: "bill_next_cycle";
|
|
2249
|
+
};
|
|
2250
|
+
type CheckOnIncrease1 = OpenEnum<typeof CheckOnIncrease1>;
|
|
2251
|
+
declare const CheckOnDecrease1: {
|
|
2252
|
+
readonly Prorate: "prorate";
|
|
2253
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
2254
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
2255
|
+
readonly None: "none";
|
|
2256
|
+
readonly NoProrations: "no_prorations";
|
|
2257
|
+
};
|
|
2258
|
+
type CheckOnDecrease1 = OpenEnum<typeof CheckOnDecrease1>;
|
|
2259
|
+
type CheckConfig1 = {
|
|
2260
|
+
rollover?: CheckRollover1 | null | undefined;
|
|
2261
|
+
onIncrease?: CheckOnIncrease1 | null | undefined;
|
|
2262
|
+
onDecrease?: CheckOnDecrease1 | null | undefined;
|
|
2263
|
+
};
|
|
2264
|
+
/**
|
|
2265
|
+
* Product item defining features and pricing within a product
|
|
2266
|
+
*/
|
|
2267
|
+
type CheckItem1 = {
|
|
2268
|
+
/**
|
|
2269
|
+
* The type of the product item
|
|
2270
|
+
*/
|
|
2271
|
+
type?: ProductType1 | null | undefined;
|
|
2272
|
+
/**
|
|
2273
|
+
* The feature ID of the product item. If the item is a fixed price, should be `null`
|
|
2274
|
+
*/
|
|
2275
|
+
featureId?: string | null | undefined;
|
|
2276
|
+
/**
|
|
2277
|
+
* Single use features are used once and then depleted, like API calls or credits. Continuous use features are those being used on an ongoing-basis, like storage or seats.
|
|
2278
|
+
*/
|
|
2279
|
+
featureType?: FeatureType1 | null | undefined;
|
|
2280
|
+
/**
|
|
2281
|
+
* The amount of usage included for this feature.
|
|
2282
|
+
*/
|
|
2283
|
+
includedUsage?: number | string | null | undefined;
|
|
2284
|
+
/**
|
|
2285
|
+
* The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off.
|
|
2286
|
+
*/
|
|
2287
|
+
interval?: CheckInterval1 | null | undefined;
|
|
2288
|
+
/**
|
|
2289
|
+
* The interval count of the product item.
|
|
2290
|
+
*/
|
|
2291
|
+
intervalCount?: number | null | undefined;
|
|
2292
|
+
/**
|
|
2293
|
+
* The price of the product item. Should be `null` if tiered pricing is set.
|
|
2294
|
+
*/
|
|
2295
|
+
price?: number | null | undefined;
|
|
2296
|
+
/**
|
|
2297
|
+
* Tiered pricing for the product item. Not applicable for fixed price items.
|
|
2298
|
+
*/
|
|
2299
|
+
tiers?: Array<any | null> | null | undefined;
|
|
2300
|
+
/**
|
|
2301
|
+
* How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier). Defaults to graduated.
|
|
2302
|
+
*/
|
|
2303
|
+
tierBehavior?: CheckTierBehavior1 | null | undefined;
|
|
2304
|
+
/**
|
|
2305
|
+
* Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
|
|
2306
|
+
*/
|
|
2307
|
+
usageModel?: UsageModel1 | null | undefined;
|
|
2308
|
+
/**
|
|
2309
|
+
* The amount per billing unit (eg. $9 / 250 units)
|
|
2310
|
+
*/
|
|
2311
|
+
billingUnits?: number | null | undefined;
|
|
2312
|
+
/**
|
|
2313
|
+
* Whether the usage should be reset when the product is enabled.
|
|
2314
|
+
*/
|
|
2315
|
+
resetUsageWhenEnabled?: boolean | null | undefined;
|
|
2316
|
+
/**
|
|
2317
|
+
* The entity feature ID of the product item if applicable.
|
|
2318
|
+
*/
|
|
2319
|
+
entityFeatureId?: string | null | undefined;
|
|
2320
|
+
/**
|
|
2321
|
+
* The display of the product item.
|
|
2322
|
+
*/
|
|
2323
|
+
display?: ProductDisplay1 | null | undefined;
|
|
2324
|
+
/**
|
|
2325
|
+
* Used in customer context. Quantity of the feature the customer has prepaid for.
|
|
2326
|
+
*/
|
|
2327
|
+
quantity?: number | null | undefined;
|
|
2328
|
+
/**
|
|
2329
|
+
* Used in customer context. Quantity of the feature the customer will prepay for in the next cycle.
|
|
2330
|
+
*/
|
|
2331
|
+
nextCycleQuantity?: number | null | undefined;
|
|
2332
|
+
/**
|
|
2333
|
+
* Configuration for rollover and proration behavior of the feature.
|
|
2334
|
+
*/
|
|
2335
|
+
config?: CheckConfig1 | null | undefined;
|
|
2336
|
+
};
|
|
2337
|
+
/**
|
|
2338
|
+
* The duration type of the free trial
|
|
2339
|
+
*/
|
|
2340
|
+
declare const FreeTrialDuration1: {
|
|
2341
|
+
readonly Day: "day";
|
|
2342
|
+
readonly Month: "month";
|
|
2343
|
+
readonly Year: "year";
|
|
2344
|
+
};
|
|
2345
|
+
/**
|
|
2346
|
+
* The duration type of the free trial
|
|
2347
|
+
*/
|
|
2348
|
+
type FreeTrialDuration1 = OpenEnum<typeof FreeTrialDuration1>;
|
|
2349
|
+
type CheckFreeTrial1 = {
|
|
2350
|
+
/**
|
|
2351
|
+
* The duration type of the free trial
|
|
2352
|
+
*/
|
|
2353
|
+
duration: FreeTrialDuration1;
|
|
2354
|
+
/**
|
|
2355
|
+
* The length of the duration type specified
|
|
2356
|
+
*/
|
|
2357
|
+
length: number;
|
|
2358
|
+
/**
|
|
2359
|
+
* Whether the free trial is limited to one per customer fingerprint
|
|
2360
|
+
*/
|
|
2361
|
+
uniqueFingerprint: boolean;
|
|
2362
|
+
/**
|
|
2363
|
+
* Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file.
|
|
2364
|
+
*/
|
|
2365
|
+
cardRequired: boolean;
|
|
2366
|
+
/**
|
|
2367
|
+
* Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
|
|
2368
|
+
*/
|
|
2369
|
+
trialAvailable: boolean | null;
|
|
2370
|
+
};
|
|
2371
|
+
/**
|
|
2372
|
+
* Scenario for when this product is used in attach flows
|
|
2373
|
+
*/
|
|
2374
|
+
declare const ProductScenario1: {
|
|
2375
|
+
readonly Scheduled: "scheduled";
|
|
2376
|
+
readonly Active: "active";
|
|
2377
|
+
readonly New: "new";
|
|
2378
|
+
readonly Renew: "renew";
|
|
2379
|
+
readonly Upgrade: "upgrade";
|
|
2380
|
+
readonly UpdatePrepaidQuantity: "update_prepaid_quantity";
|
|
2381
|
+
readonly Downgrade: "downgrade";
|
|
2382
|
+
readonly Cancel: "cancel";
|
|
2383
|
+
readonly Expired: "expired";
|
|
2384
|
+
readonly PastDue: "past_due";
|
|
2385
|
+
};
|
|
2386
|
+
/**
|
|
2387
|
+
* Scenario for when this product is used in attach flows
|
|
2388
|
+
*/
|
|
2389
|
+
type ProductScenario1 = OpenEnum<typeof ProductScenario1>;
|
|
2390
|
+
type Properties1 = {
|
|
2391
|
+
/**
|
|
2392
|
+
* True if the product has no base price or usage prices
|
|
2393
|
+
*/
|
|
2394
|
+
isFree: boolean;
|
|
2395
|
+
/**
|
|
2396
|
+
* True if the product only contains a one-time price
|
|
2397
|
+
*/
|
|
2398
|
+
isOneOff: boolean;
|
|
2399
|
+
/**
|
|
2400
|
+
* The billing interval group for recurring products (e.g., 'monthly', 'yearly')
|
|
2401
|
+
*/
|
|
2402
|
+
intervalGroup?: string | null | undefined;
|
|
2403
|
+
/**
|
|
2404
|
+
* True if the product includes a free trial
|
|
2405
|
+
*/
|
|
2406
|
+
hasTrial?: boolean | null | undefined;
|
|
2407
|
+
/**
|
|
2408
|
+
* True if the product can be updated after creation (only applicable if there are prepaid recurring prices)
|
|
2409
|
+
*/
|
|
2410
|
+
updateable?: boolean | null | undefined;
|
|
2411
|
+
};
|
|
2412
|
+
type Product1 = {
|
|
2413
|
+
/**
|
|
2414
|
+
* The ID of the product you set when creating the product
|
|
2415
|
+
*/
|
|
2416
|
+
id: string;
|
|
2417
|
+
/**
|
|
2418
|
+
* The name of the product
|
|
2419
|
+
*/
|
|
2420
|
+
name: string;
|
|
2421
|
+
/**
|
|
2422
|
+
* Product group which this product belongs to
|
|
2423
|
+
*/
|
|
2424
|
+
group: string | null;
|
|
2425
|
+
/**
|
|
2426
|
+
* The environment of the product
|
|
2427
|
+
*/
|
|
2428
|
+
env: CheckEnv1;
|
|
2429
|
+
/**
|
|
2430
|
+
* Whether the product is an add-on and can be purchased alongside other products
|
|
2431
|
+
*/
|
|
2432
|
+
isAddOn: boolean;
|
|
2433
|
+
/**
|
|
2434
|
+
* Whether the product is the default product
|
|
2435
|
+
*/
|
|
2436
|
+
isDefault: boolean;
|
|
2437
|
+
/**
|
|
2438
|
+
* Whether this product has been archived and is no longer available
|
|
2439
|
+
*/
|
|
2440
|
+
archived: boolean;
|
|
2441
|
+
/**
|
|
2442
|
+
* The current version of the product
|
|
2443
|
+
*/
|
|
2444
|
+
version: number;
|
|
2445
|
+
/**
|
|
2446
|
+
* The timestamp of when the product was created in milliseconds since epoch
|
|
2447
|
+
*/
|
|
2448
|
+
createdAt: number;
|
|
2449
|
+
/**
|
|
2450
|
+
* Array of product items that define the product's features and pricing
|
|
2451
|
+
*/
|
|
2452
|
+
items: Array<CheckItem1>;
|
|
2453
|
+
/**
|
|
2454
|
+
* Free trial configuration for this product, if available
|
|
2455
|
+
*/
|
|
2456
|
+
freeTrial: CheckFreeTrial1 | null;
|
|
2457
|
+
/**
|
|
2458
|
+
* ID of the base variant this product is derived from
|
|
2459
|
+
*/
|
|
2460
|
+
baseVariantId: string | null;
|
|
2461
|
+
/**
|
|
2462
|
+
* Scenario for when this product is used in attach flows
|
|
2463
|
+
*/
|
|
2464
|
+
scenario?: ProductScenario1 | undefined;
|
|
2465
|
+
properties?: Properties1 | undefined;
|
|
2466
|
+
};
|
|
2467
|
+
/**
|
|
2468
|
+
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
2469
|
+
*/
|
|
2470
|
+
type Preview1 = {
|
|
2471
|
+
/**
|
|
2472
|
+
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
2473
|
+
*/
|
|
2474
|
+
scenario: Scenario1;
|
|
2475
|
+
/**
|
|
2476
|
+
* A title suitable for displaying in a paywall or upgrade modal.
|
|
2477
|
+
*/
|
|
2478
|
+
title: string;
|
|
2479
|
+
/**
|
|
2480
|
+
* A message explaining why access was denied.
|
|
2481
|
+
*/
|
|
2482
|
+
message: string;
|
|
2483
|
+
/**
|
|
2484
|
+
* The ID of the feature that was checked.
|
|
2485
|
+
*/
|
|
2486
|
+
featureId: string;
|
|
2487
|
+
/**
|
|
2488
|
+
* The display name of the feature.
|
|
2489
|
+
*/
|
|
2490
|
+
featureName: string;
|
|
2491
|
+
/**
|
|
2492
|
+
* Products that would grant access to this feature. Use to display upgrade options.
|
|
2493
|
+
*/
|
|
2494
|
+
products: Array<Product1>;
|
|
2045
2495
|
};
|
|
2046
2496
|
/**
|
|
2047
2497
|
* OK
|
|
2048
2498
|
*/
|
|
2049
|
-
type
|
|
2499
|
+
type CheckResponseBody1 = {
|
|
2050
2500
|
/**
|
|
2051
2501
|
* Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
|
|
2052
2502
|
*/
|
|
@@ -2070,12 +2520,13 @@ type CheckResponse = {
|
|
|
2070
2520
|
/**
|
|
2071
2521
|
* The flag associated with this check, if any.
|
|
2072
2522
|
*/
|
|
2073
|
-
flag:
|
|
2523
|
+
flag: Flag1 | null;
|
|
2074
2524
|
/**
|
|
2075
2525
|
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
2076
2526
|
*/
|
|
2077
|
-
preview?:
|
|
2527
|
+
preview?: Preview1 | undefined;
|
|
2078
2528
|
};
|
|
2529
|
+
type CheckResponse = CheckResponseBody1 | CheckResponseBody2;
|
|
2079
2530
|
|
|
2080
2531
|
/**
|
|
2081
2532
|
* The interval at which the balance resets (e.g., 'month', 'day', 'year').
|
|
@@ -4886,12 +5337,19 @@ type FinalizeBalanceParams = {
|
|
|
4886
5337
|
[k: string]: any;
|
|
4887
5338
|
} | undefined;
|
|
4888
5339
|
};
|
|
5340
|
+
/**
|
|
5341
|
+
* Accepted. Autumn is experiencing degraded service from a downstream provider, so the finalize request was allowed fail-open.
|
|
5342
|
+
*/
|
|
5343
|
+
type FinalizeLockResponseBody2 = {
|
|
5344
|
+
success: boolean;
|
|
5345
|
+
};
|
|
4889
5346
|
/**
|
|
4890
5347
|
* OK
|
|
4891
5348
|
*/
|
|
4892
|
-
type
|
|
5349
|
+
type FinalizeLockResponseBody1 = {
|
|
4893
5350
|
success: boolean;
|
|
4894
5351
|
};
|
|
5352
|
+
type FinalizeLockResponse = FinalizeLockResponseBody1 | FinalizeLockResponseBody2;
|
|
4895
5353
|
|
|
4896
5354
|
type GetEntityParams = {
|
|
4897
5355
|
/**
|
|
@@ -10362,10 +10820,41 @@ type TrackParams = {
|
|
|
10362
10820
|
} | undefined;
|
|
10363
10821
|
lock?: TrackLock | undefined;
|
|
10364
10822
|
};
|
|
10823
|
+
/**
|
|
10824
|
+
* Accepted. Autumn is experiencing degraded service from a downstream provider, so the event was accepted for replay and will be tracked as soon as the service is restored.
|
|
10825
|
+
*/
|
|
10826
|
+
type TrackResponseBody2 = {
|
|
10827
|
+
/**
|
|
10828
|
+
* The ID of the customer whose usage was tracked.
|
|
10829
|
+
*/
|
|
10830
|
+
customerId: string;
|
|
10831
|
+
/**
|
|
10832
|
+
* The ID of the entity, if entity-scoped tracking was performed.
|
|
10833
|
+
*/
|
|
10834
|
+
entityId?: string | undefined;
|
|
10835
|
+
/**
|
|
10836
|
+
* The event name that was tracked, if event_name was used instead of feature_id.
|
|
10837
|
+
*/
|
|
10838
|
+
eventName?: string | undefined;
|
|
10839
|
+
/**
|
|
10840
|
+
* The amount of usage that was recorded.
|
|
10841
|
+
*/
|
|
10842
|
+
value: number;
|
|
10843
|
+
/**
|
|
10844
|
+
* The updated balance for the tracked feature. Null if tracking by event_name that affects multiple features.
|
|
10845
|
+
*/
|
|
10846
|
+
balance: Balance | null;
|
|
10847
|
+
/**
|
|
10848
|
+
* Map of feature_id to updated balance when tracking by event_name affects multiple features.
|
|
10849
|
+
*/
|
|
10850
|
+
balances?: {
|
|
10851
|
+
[k: string]: Balance;
|
|
10852
|
+
} | undefined;
|
|
10853
|
+
};
|
|
10365
10854
|
/**
|
|
10366
10855
|
* OK
|
|
10367
10856
|
*/
|
|
10368
|
-
type
|
|
10857
|
+
type TrackResponseBody1 = {
|
|
10369
10858
|
/**
|
|
10370
10859
|
* The ID of the customer whose usage was tracked.
|
|
10371
10860
|
*/
|
|
@@ -10393,6 +10882,7 @@ type TrackResponse = {
|
|
|
10393
10882
|
[k: string]: Balance;
|
|
10394
10883
|
} | undefined;
|
|
10395
10884
|
};
|
|
10885
|
+
type TrackResponse = TrackResponseBody1 | TrackResponseBody2;
|
|
10396
10886
|
|
|
10397
10887
|
/**
|
|
10398
10888
|
* Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.
|
|
@@ -13307,7 +13797,7 @@ declare class Autumn extends ClientSDK {
|
|
|
13307
13797
|
* @param lock - Reserve units of a feature upfront by passing a lock_id, then call balances.finalize to confirm or release the hold. (optional)
|
|
13308
13798
|
* @param withPreview - If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls. (optional)
|
|
13309
13799
|
*
|
|
13310
|
-
* @returns Whether access is allowed, plus the current balance for that feature.
|
|
13800
|
+
* @returns Whether access is allowed, plus the current balance for that feature. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 and allow access fail-open.
|
|
13311
13801
|
*/
|
|
13312
13802
|
check(request: CheckParams, options?: RequestOptions): Promise<CheckResponse>;
|
|
13313
13803
|
/**
|
|
@@ -13334,7 +13824,7 @@ declare class Autumn extends ClientSDK {
|
|
|
13334
13824
|
* @param value - The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat). (optional)
|
|
13335
13825
|
* @param properties - Additional properties to attach to this usage event. (optional)
|
|
13336
13826
|
*
|
|
13337
|
-
* @returns The usage value recorded, with either a single updated balance or a map of updated balances.
|
|
13827
|
+
* @returns The usage value recorded, with either a single updated balance or a map of updated balances. If Autumn is experiencing degraded service from a downstream provider, the API may return 202 after accepting the event for replay so it can be tracked as soon as the service is restored.
|
|
13338
13828
|
*/
|
|
13339
13829
|
track(request: TrackParams, options?: RequestOptions): Promise<TrackResponse>;
|
|
13340
13830
|
}
|