autumn-js 1.2.53 → 1.2.55
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 +4928 -1731
- package/dist/backend/adapters/express.mjs +6 -6
- package/dist/backend/adapters/fetch.js +4928 -1731
- package/dist/backend/adapters/fetch.mjs +6 -6
- package/dist/backend/adapters/hono.js +4928 -1731
- package/dist/backend/adapters/hono.mjs +6 -6
- package/dist/backend/adapters/index.js +4928 -1731
- package/dist/backend/adapters/index.mjs +9 -9
- package/dist/backend/adapters/next.js +4928 -1731
- package/dist/backend/adapters/next.mjs +6 -6
- package/dist/backend/{chunk-QZGNWKGU.mjs → chunk-4SLVJJQ3.mjs} +415 -149
- package/dist/backend/{chunk-UO2U5YHG.mjs → chunk-6O2BRQQG.mjs} +1 -1
- package/dist/backend/{chunk-BZJMZLRO.mjs → chunk-CTDUPQOB.mjs} +2 -2
- package/dist/backend/{chunk-DUWBM6AP.mjs → chunk-HBCBE5EZ.mjs} +2 -2
- package/dist/backend/{chunk-G5BNVBAL.mjs → chunk-QP3VSL4U.mjs} +1 -1
- package/dist/backend/{chunk-6HGIR6SI.mjs → chunk-V6O5INQW.mjs} +1 -1
- package/dist/backend/{chunk-QEMMOYX7.mjs → chunk-W4YHYDGM.mjs} +1 -1
- package/dist/backend/{chunk-AKZ3LI43.mjs → chunk-Z3CFUICE.mjs} +4513 -1582
- 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 +4928 -1731
- package/dist/backend/core/handlers/coreHandler.mjs +4 -4
- 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 +4928 -1731
- package/dist/backend/core/handlers/handleRouteByName.mjs +4 -4
- 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 +4928 -1731
- package/dist/backend/core/handlers/index.mjs +5 -5
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +4928 -1731
- package/dist/backend/core/index.mjs +7 -7
- 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.js +415 -149
- package/dist/backend/core/routes/index.mjs +2 -2
- 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.js +415 -149
- package/dist/backend/core/routes/routeConfigs.mjs +2 -2
- 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 +4928 -1731
- package/dist/backend/index.mjs +7 -7
- package/dist/backend/{routeTypes-jEkjrH2F.d.mts → routeTypes-BDnJulPJ.d.mts} +4748 -1657
- package/dist/backend/{routeTypes-C9oAOQtZ.d.ts → routeTypes-Cx-p8x5O.d.ts} +4748 -1657
- package/dist/better-auth/{chunk-56PNBTLH.mjs → chunk-EVKS2OKA.mjs} +1 -1
- package/dist/better-auth/{chunk-AI73OSOF.mjs → chunk-JQU4W6BA.mjs} +4514 -1583
- package/dist/better-auth/{chunk-IIOL3QPN.mjs → chunk-ODDA4I3O.mjs} +415 -149
- package/dist/better-auth/index.js +4928 -1731
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +415 -149
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +4928 -1731
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +4928 -1731
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/react/AutumnContext.d.mts +4 -4
- package/dist/react/AutumnContext.d.ts +4 -4
- package/dist/react/{chunk-CQF3ER2L.mjs → chunk-JV4GHJ4W.mjs} +1 -1
- package/dist/react/{chunk-D6DFRS3U.mjs → chunk-NDHIXCZM.mjs} +2 -1
- package/dist/react/{chunk-BWKG32GC.mjs → chunk-Q7HVHWDK.mjs} +1 -1
- package/dist/react/{chunk-LUBYNTYC.mjs → chunk-VKY4SZNZ.mjs} +1 -1
- package/dist/react/client/AutumnClient.d.mts +4 -4
- package/dist/react/client/AutumnClient.d.ts +4 -4
- package/dist/react/client/IAutumnClient.d.mts +4 -4
- package/dist/react/client/IAutumnClient.d.ts +4 -4
- package/dist/react/client/index.d.mts +4 -4
- package/dist/react/client/index.d.ts +4 -4
- package/dist/react/{customer-4XLHVIIG.d.mts → customer-DyNLAM-_.d.ts} +74 -9
- package/dist/react/{customer-CPv9i8iR.d.ts → customer-Dz1Fr6nJ.d.mts} +74 -9
- package/dist/react/hooks/index.d.mts +4 -4
- package/dist/react/hooks/index.d.ts +4 -4
- package/dist/react/hooks/index.js +2 -1
- package/dist/react/hooks/index.mjs +4 -4
- package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
- package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
- package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
- package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.js +2 -1
- package/dist/react/hooks/internal/check/getCreditCost.mjs +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
- package/dist/react/hooks/internal/getLocalCheckResponse.js +2 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.mjs +2 -2
- package/dist/react/hooks/internal/useCustomerActions.d.mts +4 -4
- package/dist/react/hooks/internal/useCustomerActions.d.ts +4 -4
- package/dist/react/hooks/internal/useCustomerActions.js +2 -1
- package/dist/react/hooks/internal/useCustomerActions.mjs +3 -3
- package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
- package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
- package/dist/react/hooks/useCustomer.d.mts +3 -3
- package/dist/react/hooks/useCustomer.d.ts +3 -3
- package/dist/react/hooks/useCustomer.js +2 -1
- package/dist/react/hooks/useCustomer.mjs +4 -4
- package/dist/react/hooks/useEntity.d.mts +2 -2
- package/dist/react/hooks/useEntity.d.ts +2 -2
- package/dist/react/hooks/useListEvents.d.mts +2 -2
- package/dist/react/hooks/useListEvents.d.ts +2 -2
- package/dist/react/hooks/useListPlans.d.mts +3 -3
- package/dist/react/hooks/useListPlans.d.ts +3 -3
- package/dist/react/hooks/useReferrals.d.mts +2 -2
- package/dist/react/hooks/useReferrals.d.ts +2 -2
- package/dist/react/index.d.mts +4 -4
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +2 -1
- package/dist/react/index.mjs +4 -4
- package/dist/react/{list-plans-op-Dsryi9lT.d.mts → list-plans-op-DTkteoH6.d.ts} +656 -468
- package/dist/react/{list-plans-op-jsAtkFHJ.d.ts → list-plans-op-ZRs2lBAB.d.mts} +656 -468
- package/dist/react/{params-BGfGRnue.d.ts → params-BiUwODRL.d.mts} +628 -86
- package/dist/react/{params-DPSGMHHa.d.mts → params-DIglFpGj.d.ts} +628 -86
- package/dist/react/{plan-DEGPMYmh.d.mts → plan-C96AilzT.d.mts} +798 -374
- package/dist/react/{plan-DEGPMYmh.d.ts → plan-C96AilzT.d.ts} +798 -374
- package/dist/sdk/index.d.mts +6891 -2819
- package/dist/sdk/index.d.ts +6891 -2819
- package/dist/sdk/index.js +6582 -1771
- package/dist/sdk/index.mjs +5949 -1670
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "../chunk-HIWOK3G6.mjs";
|
|
2
2
|
import {
|
|
3
3
|
createAutumnEndpoint
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-EVKS2OKA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createHandleBetterAuthRoute
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-JQU4W6BA.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveIdentityFromScope
|
|
10
10
|
} from "../chunk-J2WYVGHS.mjs";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ODDA4I3O.mjs";
|
|
12
12
|
import {
|
|
13
13
|
getActiveOrganization
|
|
14
14
|
} from "../chunk-BT3EAYVW.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { IAutumnClient } from './client/IAutumnClient.mjs';
|
|
3
|
-
import './params-
|
|
4
|
-
import './plan-
|
|
5
|
-
import './customer-
|
|
6
|
-
import './list-plans-op-
|
|
3
|
+
import './params-BiUwODRL.mjs';
|
|
4
|
+
import './plan-C96AilzT.mjs';
|
|
5
|
+
import './customer-Dz1Fr6nJ.mjs';
|
|
6
|
+
import './list-plans-op-ZRs2lBAB.mjs';
|
|
7
7
|
|
|
8
8
|
type AutumnContextValue = {
|
|
9
9
|
client: IAutumnClient;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { IAutumnClient } from './client/IAutumnClient.js';
|
|
3
|
-
import './params-
|
|
4
|
-
import './plan-
|
|
5
|
-
import './customer-
|
|
6
|
-
import './list-plans-op-
|
|
3
|
+
import './params-DIglFpGj.js';
|
|
4
|
+
import './plan-C96AilzT.js';
|
|
5
|
+
import './customer-DyNLAM-_.js';
|
|
6
|
+
import './list-plans-op-DTkteoH6.js';
|
|
7
7
|
|
|
8
8
|
type AutumnContextValue = {
|
|
9
9
|
client: IAutumnClient;
|
|
@@ -12,7 +12,8 @@ var getCreditCost = ({
|
|
|
12
12
|
const schemaItem = creditSystem.creditSchema?.find(
|
|
13
13
|
(schema) => schema.meteredFeatureId === featureId
|
|
14
14
|
);
|
|
15
|
-
|
|
15
|
+
const creditCost = schemaItem && "creditCost" in schemaItem ? schemaItem.creditCost : 1;
|
|
16
|
+
return amount * (creditCost ?? 1);
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IAutumnClient } from './IAutumnClient.mjs';
|
|
2
|
-
import '../params-
|
|
3
|
-
import '../plan-
|
|
4
|
-
import '../customer-
|
|
5
|
-
import '../list-plans-op-
|
|
2
|
+
import '../params-BiUwODRL.mjs';
|
|
3
|
+
import '../plan-C96AilzT.mjs';
|
|
4
|
+
import '../customer-Dz1Fr6nJ.mjs';
|
|
5
|
+
import '../list-plans-op-ZRs2lBAB.mjs';
|
|
6
6
|
|
|
7
7
|
/** Configuration for Autumn client */
|
|
8
8
|
type AutumnClientConfig = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IAutumnClient } from './IAutumnClient.js';
|
|
2
|
-
import '../params-
|
|
3
|
-
import '../plan-
|
|
4
|
-
import '../customer-
|
|
5
|
-
import '../list-plans-op-
|
|
2
|
+
import '../params-DIglFpGj.js';
|
|
3
|
+
import '../plan-C96AilzT.js';
|
|
4
|
+
import '../customer-DyNLAM-_.js';
|
|
5
|
+
import '../list-plans-op-DTkteoH6.js';
|
|
6
6
|
|
|
7
7
|
/** Configuration for Autumn client */
|
|
8
8
|
type AutumnClientConfig = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-
|
|
2
|
-
import { C as Customer } from '../customer-
|
|
3
|
-
import { L as ListPlansResponse } from '../list-plans-op-
|
|
4
|
-
import '../plan-
|
|
1
|
+
import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-BiUwODRL.mjs';
|
|
2
|
+
import { C as Customer } from '../customer-Dz1Fr6nJ.mjs';
|
|
3
|
+
import { L as ListPlansResponse } from '../list-plans-op-ZRs2lBAB.mjs';
|
|
4
|
+
import '../plan-C96AilzT.mjs';
|
|
5
5
|
|
|
6
6
|
/** Client interface matching backend RPC routes */
|
|
7
7
|
interface IAutumnClient {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-
|
|
2
|
-
import { C as Customer } from '../customer-
|
|
3
|
-
import { L as ListPlansResponse } from '../list-plans-op-
|
|
4
|
-
import '../plan-
|
|
1
|
+
import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-DIglFpGj.js';
|
|
2
|
+
import { C as Customer } from '../customer-DyNLAM-_.js';
|
|
3
|
+
import { L as ListPlansResponse } from '../list-plans-op-DTkteoH6.js';
|
|
4
|
+
import '../plan-C96AilzT.js';
|
|
5
5
|
|
|
6
6
|
/** Client interface matching backend RPC routes */
|
|
7
7
|
interface IAutumnClient {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AutumnClientConfig, createAutumnClient } from './AutumnClient.mjs';
|
|
2
2
|
export { AutumnClientError } from './AutumnClientError.mjs';
|
|
3
3
|
export { IAutumnClient } from './IAutumnClient.mjs';
|
|
4
|
-
import '../params-
|
|
5
|
-
import '../plan-
|
|
6
|
-
import '../customer-
|
|
7
|
-
import '../list-plans-op-
|
|
4
|
+
import '../params-BiUwODRL.mjs';
|
|
5
|
+
import '../plan-C96AilzT.mjs';
|
|
6
|
+
import '../customer-Dz1Fr6nJ.mjs';
|
|
7
|
+
import '../list-plans-op-ZRs2lBAB.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AutumnClientConfig, createAutumnClient } from './AutumnClient.js';
|
|
2
2
|
export { AutumnClientError } from './AutumnClientError.js';
|
|
3
3
|
export { IAutumnClient } from './IAutumnClient.js';
|
|
4
|
-
import '../params-
|
|
5
|
-
import '../plan-
|
|
6
|
-
import '../customer-
|
|
7
|
-
import '../list-plans-op-
|
|
4
|
+
import '../params-DIglFpGj.js';
|
|
5
|
+
import '../plan-C96AilzT.js';
|
|
6
|
+
import '../customer-DyNLAM-_.js';
|
|
7
|
+
import '../list-plans-op-DTkteoH6.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OpenEnum, P as Plan, a as Balance } from './plan-
|
|
1
|
+
import { O as OpenEnum, P as Plan, a as Balance, C as ClosedEnum } from './plan-C96AilzT.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The environment this customer was created in.
|
|
@@ -491,16 +491,57 @@ declare const CustomerFlagsType: {
|
|
|
491
491
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools, 'ai_credit_system' for model-based token pricing.
|
|
492
492
|
*/
|
|
493
493
|
type CustomerFlagsType = OpenEnum<typeof CustomerFlagsType>;
|
|
494
|
-
type
|
|
494
|
+
type CustomerCreditSchema3 = {
|
|
495
|
+
meteredFeatureId: "";
|
|
496
|
+
/**
|
|
497
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
498
|
+
*/
|
|
499
|
+
billingUnits?: number | undefined;
|
|
500
|
+
/**
|
|
501
|
+
* Credits consumed per billing-unit group.
|
|
502
|
+
*/
|
|
503
|
+
creditCost: number;
|
|
504
|
+
};
|
|
505
|
+
type CustomerCreditSchema2 = {
|
|
495
506
|
/**
|
|
496
507
|
* ID of the metered feature that draws from this credit system.
|
|
497
508
|
*/
|
|
498
509
|
meteredFeatureId: string;
|
|
499
510
|
/**
|
|
500
|
-
*
|
|
511
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
512
|
+
*/
|
|
513
|
+
billingUnits?: number | undefined;
|
|
514
|
+
/**
|
|
515
|
+
* Credits consumed per billing-unit group.
|
|
501
516
|
*/
|
|
502
517
|
creditCost: number;
|
|
503
518
|
};
|
|
519
|
+
declare const CustomerToEnum: {
|
|
520
|
+
readonly Inf: "inf";
|
|
521
|
+
};
|
|
522
|
+
type CustomerToEnum = ClosedEnum<typeof CustomerToEnum>;
|
|
523
|
+
type CustomerTier = {
|
|
524
|
+
/**
|
|
525
|
+
* Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
|
|
526
|
+
*/
|
|
527
|
+
to: number | CustomerToEnum;
|
|
528
|
+
/**
|
|
529
|
+
* Credits consumed per billing-unit group within this tier.
|
|
530
|
+
*/
|
|
531
|
+
creditCost: number;
|
|
532
|
+
};
|
|
533
|
+
type CustomerCreditSchema1 = {
|
|
534
|
+
/**
|
|
535
|
+
* ID of the metered feature that draws from this credit system.
|
|
536
|
+
*/
|
|
537
|
+
meteredFeatureId: string;
|
|
538
|
+
/**
|
|
539
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
540
|
+
*/
|
|
541
|
+
billingUnits?: number | undefined;
|
|
542
|
+
tierBehavior: "graduated";
|
|
543
|
+
tiers: Array<CustomerTier>;
|
|
544
|
+
};
|
|
504
545
|
type CustomerModelMarkups = {
|
|
505
546
|
markup?: number | undefined;
|
|
506
547
|
inputCost?: number | undefined;
|
|
@@ -522,6 +563,22 @@ type CustomerDisplay = {
|
|
|
522
563
|
*/
|
|
523
564
|
plural?: string | null | undefined;
|
|
524
565
|
};
|
|
566
|
+
type CustomerFlagsStripe = {
|
|
567
|
+
/**
|
|
568
|
+
* Stripe product ID this feature's usage prices bill under.
|
|
569
|
+
*/
|
|
570
|
+
productId?: string | undefined;
|
|
571
|
+
/**
|
|
572
|
+
* Stripe meter ID used to create this feature's metered price.
|
|
573
|
+
*/
|
|
574
|
+
meterId?: string | undefined;
|
|
575
|
+
};
|
|
576
|
+
/**
|
|
577
|
+
* Processor mappings for this feature. Present when a Stripe product or meter is set.
|
|
578
|
+
*/
|
|
579
|
+
type CustomerFlagsProcessors = {
|
|
580
|
+
stripe?: CustomerFlagsStripe | undefined;
|
|
581
|
+
};
|
|
525
582
|
/**
|
|
526
583
|
* The full feature object if expanded.
|
|
527
584
|
*/
|
|
@@ -547,9 +604,13 @@ type CustomerFeature = {
|
|
|
547
604
|
*/
|
|
548
605
|
eventNames?: Array<string> | undefined;
|
|
549
606
|
/**
|
|
550
|
-
* For
|
|
607
|
+
* For classic credit systems: maps metered features to flat or graduated credit costs.
|
|
551
608
|
*/
|
|
552
|
-
creditSchema?: Array<
|
|
609
|
+
creditSchema?: Array<CustomerCreditSchema1 | CustomerCreditSchema2 | CustomerCreditSchema3> | undefined;
|
|
610
|
+
/**
|
|
611
|
+
* Whether usage of this classic credit system should be itemized as invoice credits.
|
|
612
|
+
*/
|
|
613
|
+
invoiceCredit?: boolean | undefined;
|
|
553
614
|
/**
|
|
554
615
|
* Per-model markup overrides for AI credit systems.
|
|
555
616
|
*/
|
|
@@ -574,6 +635,10 @@ type CustomerFeature = {
|
|
|
574
635
|
* Whether the feature is archived and hidden from the dashboard.
|
|
575
636
|
*/
|
|
576
637
|
archived: boolean;
|
|
638
|
+
/**
|
|
639
|
+
* Processor mappings for this feature. Present when a Stripe product or meter is set.
|
|
640
|
+
*/
|
|
641
|
+
processors?: CustomerFlagsProcessors | undefined;
|
|
577
642
|
};
|
|
578
643
|
type Flags = {
|
|
579
644
|
/**
|
|
@@ -613,7 +678,7 @@ type CustomerConfig = {
|
|
|
613
678
|
/**
|
|
614
679
|
* Stripe processor connection for the customer.
|
|
615
680
|
*/
|
|
616
|
-
type
|
|
681
|
+
type CustomerStripe = {
|
|
617
682
|
/**
|
|
618
683
|
* Stripe customer ID.
|
|
619
684
|
*/
|
|
@@ -644,11 +709,11 @@ type Revenuecat = {
|
|
|
644
709
|
/**
|
|
645
710
|
* Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
|
|
646
711
|
*/
|
|
647
|
-
type
|
|
712
|
+
type CustomerProcessors = {
|
|
648
713
|
/**
|
|
649
714
|
* Stripe processor connection for the customer.
|
|
650
715
|
*/
|
|
651
|
-
stripe?:
|
|
716
|
+
stripe?: CustomerStripe | undefined;
|
|
652
717
|
/**
|
|
653
718
|
* Vercel processor connection for the customer (public-safe subset).
|
|
654
719
|
*/
|
|
@@ -991,7 +1056,7 @@ type Customer = {
|
|
|
991
1056
|
/**
|
|
992
1057
|
* Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
|
|
993
1058
|
*/
|
|
994
|
-
processors?:
|
|
1059
|
+
processors?: CustomerProcessors | undefined;
|
|
995
1060
|
/**
|
|
996
1061
|
* Invoices for this customer.
|
|
997
1062
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OpenEnum, P as Plan, a as Balance } from './plan-
|
|
1
|
+
import { O as OpenEnum, P as Plan, a as Balance, C as ClosedEnum } from './plan-C96AilzT.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The environment this customer was created in.
|
|
@@ -491,16 +491,57 @@ declare const CustomerFlagsType: {
|
|
|
491
491
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools, 'ai_credit_system' for model-based token pricing.
|
|
492
492
|
*/
|
|
493
493
|
type CustomerFlagsType = OpenEnum<typeof CustomerFlagsType>;
|
|
494
|
-
type
|
|
494
|
+
type CustomerCreditSchema3 = {
|
|
495
|
+
meteredFeatureId: "";
|
|
496
|
+
/**
|
|
497
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
498
|
+
*/
|
|
499
|
+
billingUnits?: number | undefined;
|
|
500
|
+
/**
|
|
501
|
+
* Credits consumed per billing-unit group.
|
|
502
|
+
*/
|
|
503
|
+
creditCost: number;
|
|
504
|
+
};
|
|
505
|
+
type CustomerCreditSchema2 = {
|
|
495
506
|
/**
|
|
496
507
|
* ID of the metered feature that draws from this credit system.
|
|
497
508
|
*/
|
|
498
509
|
meteredFeatureId: string;
|
|
499
510
|
/**
|
|
500
|
-
*
|
|
511
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
512
|
+
*/
|
|
513
|
+
billingUnits?: number | undefined;
|
|
514
|
+
/**
|
|
515
|
+
* Credits consumed per billing-unit group.
|
|
501
516
|
*/
|
|
502
517
|
creditCost: number;
|
|
503
518
|
};
|
|
519
|
+
declare const CustomerToEnum: {
|
|
520
|
+
readonly Inf: "inf";
|
|
521
|
+
};
|
|
522
|
+
type CustomerToEnum = ClosedEnum<typeof CustomerToEnum>;
|
|
523
|
+
type CustomerTier = {
|
|
524
|
+
/**
|
|
525
|
+
* Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
|
|
526
|
+
*/
|
|
527
|
+
to: number | CustomerToEnum;
|
|
528
|
+
/**
|
|
529
|
+
* Credits consumed per billing-unit group within this tier.
|
|
530
|
+
*/
|
|
531
|
+
creditCost: number;
|
|
532
|
+
};
|
|
533
|
+
type CustomerCreditSchema1 = {
|
|
534
|
+
/**
|
|
535
|
+
* ID of the metered feature that draws from this credit system.
|
|
536
|
+
*/
|
|
537
|
+
meteredFeatureId: string;
|
|
538
|
+
/**
|
|
539
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
540
|
+
*/
|
|
541
|
+
billingUnits?: number | undefined;
|
|
542
|
+
tierBehavior: "graduated";
|
|
543
|
+
tiers: Array<CustomerTier>;
|
|
544
|
+
};
|
|
504
545
|
type CustomerModelMarkups = {
|
|
505
546
|
markup?: number | undefined;
|
|
506
547
|
inputCost?: number | undefined;
|
|
@@ -522,6 +563,22 @@ type CustomerDisplay = {
|
|
|
522
563
|
*/
|
|
523
564
|
plural?: string | null | undefined;
|
|
524
565
|
};
|
|
566
|
+
type CustomerFlagsStripe = {
|
|
567
|
+
/**
|
|
568
|
+
* Stripe product ID this feature's usage prices bill under.
|
|
569
|
+
*/
|
|
570
|
+
productId?: string | undefined;
|
|
571
|
+
/**
|
|
572
|
+
* Stripe meter ID used to create this feature's metered price.
|
|
573
|
+
*/
|
|
574
|
+
meterId?: string | undefined;
|
|
575
|
+
};
|
|
576
|
+
/**
|
|
577
|
+
* Processor mappings for this feature. Present when a Stripe product or meter is set.
|
|
578
|
+
*/
|
|
579
|
+
type CustomerFlagsProcessors = {
|
|
580
|
+
stripe?: CustomerFlagsStripe | undefined;
|
|
581
|
+
};
|
|
525
582
|
/**
|
|
526
583
|
* The full feature object if expanded.
|
|
527
584
|
*/
|
|
@@ -547,9 +604,13 @@ type CustomerFeature = {
|
|
|
547
604
|
*/
|
|
548
605
|
eventNames?: Array<string> | undefined;
|
|
549
606
|
/**
|
|
550
|
-
* For
|
|
607
|
+
* For classic credit systems: maps metered features to flat or graduated credit costs.
|
|
551
608
|
*/
|
|
552
|
-
creditSchema?: Array<
|
|
609
|
+
creditSchema?: Array<CustomerCreditSchema1 | CustomerCreditSchema2 | CustomerCreditSchema3> | undefined;
|
|
610
|
+
/**
|
|
611
|
+
* Whether usage of this classic credit system should be itemized as invoice credits.
|
|
612
|
+
*/
|
|
613
|
+
invoiceCredit?: boolean | undefined;
|
|
553
614
|
/**
|
|
554
615
|
* Per-model markup overrides for AI credit systems.
|
|
555
616
|
*/
|
|
@@ -574,6 +635,10 @@ type CustomerFeature = {
|
|
|
574
635
|
* Whether the feature is archived and hidden from the dashboard.
|
|
575
636
|
*/
|
|
576
637
|
archived: boolean;
|
|
638
|
+
/**
|
|
639
|
+
* Processor mappings for this feature. Present when a Stripe product or meter is set.
|
|
640
|
+
*/
|
|
641
|
+
processors?: CustomerFlagsProcessors | undefined;
|
|
577
642
|
};
|
|
578
643
|
type Flags = {
|
|
579
644
|
/**
|
|
@@ -613,7 +678,7 @@ type CustomerConfig = {
|
|
|
613
678
|
/**
|
|
614
679
|
* Stripe processor connection for the customer.
|
|
615
680
|
*/
|
|
616
|
-
type
|
|
681
|
+
type CustomerStripe = {
|
|
617
682
|
/**
|
|
618
683
|
* Stripe customer ID.
|
|
619
684
|
*/
|
|
@@ -644,11 +709,11 @@ type Revenuecat = {
|
|
|
644
709
|
/**
|
|
645
710
|
* Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
|
|
646
711
|
*/
|
|
647
|
-
type
|
|
712
|
+
type CustomerProcessors = {
|
|
648
713
|
/**
|
|
649
714
|
* Stripe processor connection for the customer.
|
|
650
715
|
*/
|
|
651
|
-
stripe?:
|
|
716
|
+
stripe?: CustomerStripe | undefined;
|
|
652
717
|
/**
|
|
653
718
|
* Vercel processor connection for the customer (public-safe subset).
|
|
654
719
|
*/
|
|
@@ -991,7 +1056,7 @@ type Customer = {
|
|
|
991
1056
|
/**
|
|
992
1057
|
* Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
|
|
993
1058
|
*/
|
|
994
|
-
processors?:
|
|
1059
|
+
processors?: CustomerProcessors | undefined;
|
|
995
1060
|
/**
|
|
996
1061
|
* Invoices for this customer.
|
|
997
1062
|
*/
|
|
@@ -7,7 +7,7 @@ export { UseListPlansParams, useListPlans } from './useListPlans.mjs';
|
|
|
7
7
|
export { UseReferralsParams, UseReferralsResult, useReferrals } from './useReferrals.mjs';
|
|
8
8
|
import '@tanstack/react-query';
|
|
9
9
|
import '../client/AutumnClientError.mjs';
|
|
10
|
-
import '../params-
|
|
11
|
-
import '../plan-
|
|
12
|
-
import '../customer-
|
|
13
|
-
import '../list-plans-op-
|
|
10
|
+
import '../params-BiUwODRL.mjs';
|
|
11
|
+
import '../plan-C96AilzT.mjs';
|
|
12
|
+
import '../customer-Dz1Fr6nJ.mjs';
|
|
13
|
+
import '../list-plans-op-ZRs2lBAB.mjs';
|
|
@@ -7,7 +7,7 @@ export { UseListPlansParams, useListPlans } from './useListPlans.js';
|
|
|
7
7
|
export { UseReferralsParams, UseReferralsResult, useReferrals } from './useReferrals.js';
|
|
8
8
|
import '@tanstack/react-query';
|
|
9
9
|
import '../client/AutumnClientError.js';
|
|
10
|
-
import '../params-
|
|
11
|
-
import '../plan-
|
|
12
|
-
import '../customer-
|
|
13
|
-
import '../list-plans-op-
|
|
10
|
+
import '../params-DIglFpGj.js';
|
|
11
|
+
import '../plan-C96AilzT.js';
|
|
12
|
+
import '../customer-DyNLAM-_.js';
|
|
13
|
+
import '../list-plans-op-DTkteoH6.js';
|
|
@@ -1282,7 +1282,8 @@ var getCreditCost = ({
|
|
|
1282
1282
|
const schemaItem = creditSystem.creditSchema?.find(
|
|
1283
1283
|
(schema) => schema.meteredFeatureId === featureId
|
|
1284
1284
|
);
|
|
1285
|
-
|
|
1285
|
+
const creditCost = schemaItem && "creditCost" in schemaItem ? schemaItem.creditCost : 1;
|
|
1286
|
+
return amount * (creditCost ?? 1);
|
|
1286
1287
|
};
|
|
1287
1288
|
|
|
1288
1289
|
// src/react/hooks/internal/getLocalCheckResponse.ts
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "../chunk-RTZAB46K.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useCustomer
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-JV4GHJ4W.mjs";
|
|
8
|
+
import "../chunk-VKY4SZNZ.mjs";
|
|
9
|
+
import "../chunk-Q7HVHWDK.mjs";
|
|
10
10
|
import "../chunk-GSJF6P3Q.mjs";
|
|
11
11
|
import "../chunk-SEQHNPTF.mjs";
|
|
12
12
|
import "../chunk-4TON573W.mjs";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-NDHIXCZM.mjs";
|
|
14
14
|
import {
|
|
15
15
|
useEntity
|
|
16
16
|
} from "../chunk-7SRCZYRC.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Customer } from '../../../customer-
|
|
2
|
-
import '../../../plan-
|
|
1
|
+
import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
|
|
2
|
+
import '../../../plan-C96AilzT.mjs';
|
|
3
3
|
|
|
4
4
|
type CustomerBalance = Customer["balances"][string];
|
|
5
5
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Customer } from '../../../customer-
|
|
2
|
-
import '../../../plan-
|
|
1
|
+
import { C as Customer } from '../../../customer-DyNLAM-_.js';
|
|
2
|
+
import '../../../plan-C96AilzT.js';
|
|
3
3
|
|
|
4
4
|
type CustomerBalance = Customer["balances"][string];
|
|
5
5
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Customer } from '../../../customer-
|
|
2
|
-
import '../../../plan-
|
|
1
|
+
import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
|
|
2
|
+
import '../../../plan-C96AilzT.mjs';
|
|
3
3
|
|
|
4
4
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
5
5
|
declare const customerToFeatures: ({ customer, }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Customer } from '../../../customer-
|
|
2
|
-
import '../../../plan-
|
|
1
|
+
import { C as Customer } from '../../../customer-DyNLAM-_.js';
|
|
2
|
+
import '../../../plan-C96AilzT.js';
|
|
3
3
|
|
|
4
4
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
5
5
|
declare const customerToFeatures: ({ customer, }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BalanceFeature } from '../../../plan-
|
|
2
|
-
import { C as Customer } from '../../../customer-
|
|
1
|
+
import { B as BalanceFeature } from '../../../plan-C96AilzT.mjs';
|
|
2
|
+
import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
|
|
3
3
|
|
|
4
4
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
5
5
|
declare const findCreditSystemsByFeature: ({ featureId, features, }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BalanceFeature } from '../../../plan-
|
|
2
|
-
import { C as Customer } from '../../../customer-
|
|
1
|
+
import { B as BalanceFeature } from '../../../plan-C96AilzT.js';
|
|
2
|
+
import { C as Customer } from '../../../customer-DyNLAM-_.js';
|
|
3
3
|
|
|
4
4
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
5
5
|
declare const findCreditSystemsByFeature: ({ featureId, features, }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Customer } from '../../../customer-
|
|
2
|
-
import '../../../plan-
|
|
1
|
+
import { C as Customer } from '../../../customer-Dz1Fr6nJ.mjs';
|
|
2
|
+
import '../../../plan-C96AilzT.mjs';
|
|
3
3
|
|
|
4
4
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
5
5
|
declare const getCreditCost: ({ featureId, creditSystem, amount, }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Customer } from '../../../customer-
|
|
2
|
-
import '../../../plan-
|
|
1
|
+
import { C as Customer } from '../../../customer-DyNLAM-_.js';
|
|
2
|
+
import '../../../plan-C96AilzT.js';
|
|
3
3
|
|
|
4
4
|
type CustomerFeature = NonNullable<Customer["balances"][string]["feature"]>;
|
|
5
5
|
declare const getCreditCost: ({ featureId, creditSystem, amount, }: {
|
|
@@ -35,7 +35,8 @@ var getCreditCost = ({
|
|
|
35
35
|
const schemaItem = creditSystem.creditSchema?.find(
|
|
36
36
|
(schema) => schema.meteredFeatureId === featureId
|
|
37
37
|
);
|
|
38
|
-
|
|
38
|
+
const creditCost = schemaItem && "creditCost" in schemaItem ? schemaItem.creditCost : 1;
|
|
39
|
+
return amount * (creditCost ?? 1);
|
|
39
40
|
};
|
|
40
41
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
42
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as ClientCheckParams, o as CheckResponse } from '../../params-
|
|
2
|
-
import { C as Customer } from '../../customer-
|
|
3
|
-
import '../../plan-
|
|
1
|
+
import { n as ClientCheckParams, o as CheckResponse } from '../../params-BiUwODRL.mjs';
|
|
2
|
+
import { C as Customer } from '../../customer-Dz1Fr6nJ.mjs';
|
|
3
|
+
import '../../plan-C96AilzT.mjs';
|
|
4
4
|
|
|
5
5
|
declare const getLocalCheckResponse: ({ customer, params, }: {
|
|
6
6
|
customer: Customer | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as ClientCheckParams, o as CheckResponse } from '../../params-
|
|
2
|
-
import { C as Customer } from '../../customer-
|
|
3
|
-
import '../../plan-
|
|
1
|
+
import { n as ClientCheckParams, o as CheckResponse } from '../../params-DIglFpGj.js';
|
|
2
|
+
import { C as Customer } from '../../customer-DyNLAM-_.js';
|
|
3
|
+
import '../../plan-C96AilzT.js';
|
|
4
4
|
|
|
5
5
|
declare const getLocalCheckResponse: ({ customer, params, }: {
|
|
6
6
|
customer: Customer | null;
|