autumn-js 1.2.20 → 1.2.21
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 +208 -51
- package/dist/backend/adapters/express.mjs +9 -9
- package/dist/backend/adapters/fetch.js +208 -51
- package/dist/backend/adapters/fetch.mjs +9 -9
- package/dist/backend/adapters/hono.js +208 -51
- package/dist/backend/adapters/hono.mjs +9 -9
- package/dist/backend/adapters/index.js +208 -51
- package/dist/backend/adapters/index.mjs +12 -12
- package/dist/backend/adapters/next.js +208 -51
- package/dist/backend/adapters/next.mjs +9 -9
- package/dist/backend/{chunk-VQFHHLQH.mjs → chunk-5JNYI5HM.mjs} +1 -1
- package/dist/backend/{chunk-M2PFN4F6.mjs → chunk-73KXFYFC.mjs} +5 -5
- package/dist/backend/{chunk-B4WDT4SC.mjs → chunk-GKYVE5XN.mjs} +149 -11
- package/dist/backend/{chunk-XZAJX563.mjs → chunk-H6KJYTJY.mjs} +7 -7
- package/dist/backend/{chunk-HNX2UJYZ.mjs → chunk-K2JSUNJX.mjs} +1 -1
- package/dist/backend/{chunk-BHVWYX4E.mjs → chunk-NNIHXZQM.mjs} +1 -1
- package/dist/backend/{chunk-IJ2K62QI.mjs → chunk-NSHGFU5H.mjs} +59 -40
- package/dist/backend/{chunk-CMMPKYHL.mjs → chunk-TGR2RWLO.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 +208 -51
- package/dist/backend/core/handlers/coreHandler.mjs +7 -7
- 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 +4 -4
- package/dist/backend/core/handlers/handleRouteByName.js +208 -51
- package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
- 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 +208 -51
- package/dist/backend/core/handlers/index.mjs +10 -10
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +208 -51
- package/dist/backend/core/index.mjs +10 -10
- 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 +59 -40
- 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 +59 -40
- 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 +208 -51
- package/dist/backend/index.mjs +10 -10
- package/dist/backend/{routeTypes-7V_qHC8n.d.ts → routeTypes-B-Bkse9m.d.ts} +161 -1
- package/dist/backend/{routeTypes-CeXEBV-E.d.mts → routeTypes-DZFxBYSb.d.mts} +161 -1
- package/dist/better-auth/{chunk-HA7OIVY4.mjs → chunk-4OLXYKUC.mjs} +150 -12
- package/dist/better-auth/{chunk-4QQUN4SQ.mjs → chunk-R35KMMJZ.mjs} +1 -1
- package/dist/better-auth/{chunk-XXPUYN7Z.mjs → chunk-X6KOCWP3.mjs} +59 -40
- package/dist/better-auth/index.js +208 -51
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +59 -40
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +208 -51
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +208 -51
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/react/AutumnContext.d.mts +2 -2
- package/dist/react/AutumnContext.d.ts +2 -2
- package/dist/react/AutumnProvider.js +15 -15
- package/dist/react/AutumnProvider.mjs +2 -2
- package/dist/react/{chunk-7IDH4OMG.mjs → chunk-26CKSAPZ.mjs} +1 -1
- package/dist/react/{chunk-NSFHAUTD.mjs → chunk-CHU7CIWP.mjs} +1 -1
- package/dist/react/{chunk-YQFYWH7J.mjs → chunk-G7FTQLT7.mjs} +1 -1
- package/dist/react/{chunk-BDG6JHEW.mjs → chunk-HSQUB3BZ.mjs} +1 -1
- package/dist/react/{chunk-DEZBJQEG.mjs → chunk-KB72KQKN.mjs} +1 -1
- package/dist/react/{chunk-J6SLKTKE.mjs → chunk-MC2YYATT.mjs} +1 -1
- package/dist/react/{chunk-FWWIAOPU.mjs → chunk-OXQG65ZT.mjs} +1 -1
- package/dist/react/{chunk-E5ZHOMZ4.mjs → chunk-XJZH5NMZ.mjs} +23 -23
- package/dist/react/{chunk-HVBDZARN.mjs → chunk-ZGPE4R6H.mjs} +2 -2
- package/dist/react/client/AutumnClient.d.mts +2 -2
- package/dist/react/client/AutumnClient.d.ts +2 -2
- package/dist/react/client/IAutumnClient.d.mts +2 -2
- package/dist/react/client/IAutumnClient.d.ts +2 -2
- package/dist/react/client/index.d.mts +2 -2
- package/dist/react/client/index.d.ts +2 -2
- package/dist/react/{customer-SSq4WO45.d.ts → customer-CzMuZp8W.d.ts} +1 -0
- package/dist/react/{customer-BgMiezZt.d.mts → customer-DjlCjlmM.d.mts} +1 -0
- package/dist/react/hooks/index.d.mts +2 -2
- package/dist/react/hooks/index.d.ts +2 -2
- package/dist/react/hooks/index.js +16 -16
- package/dist/react/hooks/index.mjs +8 -8
- package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +1 -1
- package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +1 -1
- package/dist/react/hooks/internal/check/customerToFeatures.d.mts +1 -1
- package/dist/react/hooks/internal/check/customerToFeatures.d.ts +1 -1
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +1 -1
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +1 -1
- package/dist/react/hooks/internal/check/getCreditCost.d.mts +1 -1
- package/dist/react/hooks/internal/check/getCreditCost.d.ts +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +2 -2
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +2 -2
- package/dist/react/hooks/internal/useCustomerActions.d.mts +2 -2
- package/dist/react/hooks/internal/useCustomerActions.d.ts +2 -2
- package/dist/react/hooks/internal/useCustomerActions.js +1 -1
- package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
- package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
- package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
- package/dist/react/hooks/useAggregateEvents.js +16 -16
- package/dist/react/hooks/useAggregateEvents.mjs +2 -2
- package/dist/react/hooks/useCustomer.d.mts +2 -2
- package/dist/react/hooks/useCustomer.d.ts +2 -2
- package/dist/react/hooks/useCustomer.js +16 -16
- package/dist/react/hooks/useCustomer.mjs +3 -3
- package/dist/react/hooks/useEntity.d.mts +1 -1
- package/dist/react/hooks/useEntity.d.ts +1 -1
- package/dist/react/hooks/useEntity.js +16 -16
- package/dist/react/hooks/useEntity.mjs +2 -2
- package/dist/react/hooks/useListEvents.d.mts +1 -1
- package/dist/react/hooks/useListEvents.d.ts +1 -1
- package/dist/react/hooks/useListEvents.js +16 -16
- package/dist/react/hooks/useListEvents.mjs +2 -2
- package/dist/react/hooks/useListPlans.d.mts +1 -1
- package/dist/react/hooks/useListPlans.d.ts +1 -1
- package/dist/react/hooks/useListPlans.js +16 -16
- package/dist/react/hooks/useListPlans.mjs +2 -2
- package/dist/react/hooks/useReferrals.d.mts +1 -1
- package/dist/react/hooks/useReferrals.d.ts +1 -1
- package/dist/react/hooks/useReferrals.js +16 -16
- package/dist/react/hooks/useReferrals.mjs +2 -2
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +22 -22
- package/dist/react/index.mjs +9 -9
- package/dist/react/{params--mMxYT5w.d.mts → params-BUQLwLrI.d.mts} +52 -0
- package/dist/react/{params-DVrQcAu7.d.ts → params-dYykqsvL.d.ts} +52 -0
- package/dist/sdk/index.d.mts +214 -7
- package/dist/sdk/index.d.ts +214 -7
- package/dist/sdk/index.js +241 -16
- package/dist/sdk/index.mjs +216 -15
- package/package.json +1 -1
- package/dist/backend/{chunk-55C2WWXQ.mjs → chunk-S5HPMJ4U.mjs} +3 -3
|
@@ -4686,6 +4686,7 @@ type CreatePlanParams = {
|
|
|
4686
4686
|
* Miscellaneous plan-level configuration flags.
|
|
4687
4687
|
*/
|
|
4688
4688
|
config?: CreatePlanConfigRequest | undefined;
|
|
4689
|
+
createInStripe?: boolean | undefined;
|
|
4689
4690
|
};
|
|
4690
4691
|
/**
|
|
4691
4692
|
* Billing interval (e.g. 'month', 'year').
|
|
@@ -6151,6 +6152,7 @@ declare const CustomerRewardsType: {
|
|
|
6151
6152
|
readonly FixedDiscount: "fixed_discount";
|
|
6152
6153
|
readonly FreeProduct: "free_product";
|
|
6153
6154
|
readonly InvoiceCredits: "invoice_credits";
|
|
6155
|
+
readonly FeatureGrant: "feature_grant";
|
|
6154
6156
|
};
|
|
6155
6157
|
/**
|
|
6156
6158
|
* The type of reward
|
|
@@ -7002,6 +7004,7 @@ declare const GetCustomerRewardsType: {
|
|
|
7002
7004
|
readonly FixedDiscount: "fixed_discount";
|
|
7003
7005
|
readonly FreeProduct: "free_product";
|
|
7004
7006
|
readonly InvoiceCredits: "invoice_credits";
|
|
7007
|
+
readonly FeatureGrant: "feature_grant";
|
|
7005
7008
|
};
|
|
7006
7009
|
/**
|
|
7007
7010
|
* The type of reward
|
|
@@ -9158,6 +9161,54 @@ type EventsListParams = {
|
|
|
9158
9161
|
*/
|
|
9159
9162
|
customRange?: ListEventsCustomRange | undefined;
|
|
9160
9163
|
};
|
|
9164
|
+
declare const ListEventsIntervalEnum: {
|
|
9165
|
+
readonly OneOff: "one_off";
|
|
9166
|
+
readonly Minute: "minute";
|
|
9167
|
+
readonly Hour: "hour";
|
|
9168
|
+
readonly Day: "day";
|
|
9169
|
+
readonly Week: "week";
|
|
9170
|
+
readonly Month: "month";
|
|
9171
|
+
readonly Quarter: "quarter";
|
|
9172
|
+
readonly SemiAnnual: "semi_annual";
|
|
9173
|
+
readonly Year: "year";
|
|
9174
|
+
};
|
|
9175
|
+
type ListEventsIntervalEnum = OpenEnum<typeof ListEventsIntervalEnum>;
|
|
9176
|
+
type ListEventsReset = {
|
|
9177
|
+
/**
|
|
9178
|
+
* The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
|
|
9179
|
+
*/
|
|
9180
|
+
interval: ListEventsIntervalEnum | string;
|
|
9181
|
+
/**
|
|
9182
|
+
* Number of intervals between resets (eg. 2 for bi-monthly).
|
|
9183
|
+
*/
|
|
9184
|
+
intervalCount?: number | undefined;
|
|
9185
|
+
/**
|
|
9186
|
+
* Timestamp when the balance will next reset.
|
|
9187
|
+
*/
|
|
9188
|
+
resetsAt: number | null;
|
|
9189
|
+
};
|
|
9190
|
+
type Deductions = {
|
|
9191
|
+
/**
|
|
9192
|
+
* ID of the underlying balance row that was deducted from (customer_entitlement or rollover).
|
|
9193
|
+
*/
|
|
9194
|
+
balanceId: string;
|
|
9195
|
+
/**
|
|
9196
|
+
* The feature this balance belongs to.
|
|
9197
|
+
*/
|
|
9198
|
+
featureId: string;
|
|
9199
|
+
/**
|
|
9200
|
+
* ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
|
|
9201
|
+
*/
|
|
9202
|
+
planId: string | null;
|
|
9203
|
+
/**
|
|
9204
|
+
* Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
|
|
9205
|
+
*/
|
|
9206
|
+
reset: ListEventsReset | null;
|
|
9207
|
+
/**
|
|
9208
|
+
* Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
|
|
9209
|
+
*/
|
|
9210
|
+
value: number;
|
|
9211
|
+
};
|
|
9161
9212
|
type ListEventsList = {
|
|
9162
9213
|
/**
|
|
9163
9214
|
* Event ID (KSUID)
|
|
@@ -9185,6 +9236,10 @@ type ListEventsList = {
|
|
|
9185
9236
|
properties: {
|
|
9186
9237
|
[k: string]: any;
|
|
9187
9238
|
};
|
|
9239
|
+
/**
|
|
9240
|
+
* Per-balance breakdown of what this event deducted. Null for events ingested before deductions were tracked; an empty array means the event was accepted but no balance moved.
|
|
9241
|
+
*/
|
|
9242
|
+
deductions: Array<Deductions> | null;
|
|
9188
9243
|
};
|
|
9189
9244
|
/**
|
|
9190
9245
|
* OK
|
|
@@ -14152,6 +14207,54 @@ type TrackParams = {
|
|
|
14152
14207
|
} | undefined;
|
|
14153
14208
|
lock?: TrackLock | undefined;
|
|
14154
14209
|
};
|
|
14210
|
+
declare const TrackIntervalEnum2: {
|
|
14211
|
+
readonly OneOff: "one_off";
|
|
14212
|
+
readonly Minute: "minute";
|
|
14213
|
+
readonly Hour: "hour";
|
|
14214
|
+
readonly Day: "day";
|
|
14215
|
+
readonly Week: "week";
|
|
14216
|
+
readonly Month: "month";
|
|
14217
|
+
readonly Quarter: "quarter";
|
|
14218
|
+
readonly SemiAnnual: "semi_annual";
|
|
14219
|
+
readonly Year: "year";
|
|
14220
|
+
};
|
|
14221
|
+
type TrackIntervalEnum2 = OpenEnum<typeof TrackIntervalEnum2>;
|
|
14222
|
+
type TrackReset2 = {
|
|
14223
|
+
/**
|
|
14224
|
+
* The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
|
|
14225
|
+
*/
|
|
14226
|
+
interval: TrackIntervalEnum2 | string;
|
|
14227
|
+
/**
|
|
14228
|
+
* Number of intervals between resets (eg. 2 for bi-monthly).
|
|
14229
|
+
*/
|
|
14230
|
+
intervalCount?: number | undefined;
|
|
14231
|
+
/**
|
|
14232
|
+
* Timestamp when the balance will next reset.
|
|
14233
|
+
*/
|
|
14234
|
+
resetsAt: number | null;
|
|
14235
|
+
};
|
|
14236
|
+
type Deduction2 = {
|
|
14237
|
+
/**
|
|
14238
|
+
* ID of the underlying balance row that was deducted from (customer_entitlement or rollover).
|
|
14239
|
+
*/
|
|
14240
|
+
balanceId: string;
|
|
14241
|
+
/**
|
|
14242
|
+
* The feature this balance belongs to.
|
|
14243
|
+
*/
|
|
14244
|
+
featureId: string;
|
|
14245
|
+
/**
|
|
14246
|
+
* ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
|
|
14247
|
+
*/
|
|
14248
|
+
planId: string | null;
|
|
14249
|
+
/**
|
|
14250
|
+
* Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
|
|
14251
|
+
*/
|
|
14252
|
+
reset: TrackReset2 | null;
|
|
14253
|
+
/**
|
|
14254
|
+
* Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
|
|
14255
|
+
*/
|
|
14256
|
+
value: number;
|
|
14257
|
+
};
|
|
14155
14258
|
/**
|
|
14156
14259
|
* 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.
|
|
14157
14260
|
*/
|
|
@@ -14182,6 +14285,58 @@ type TrackResponseBody2 = {
|
|
|
14182
14285
|
balances?: {
|
|
14183
14286
|
[k: string]: Balance | null;
|
|
14184
14287
|
} | undefined;
|
|
14288
|
+
/**
|
|
14289
|
+
* Per-balance breakdown of what this event deducted. A single event can consume from multiple balance rows when credit systems or rollovers are involved; this surfaces each one so callers can build per-feature usage views without polling.
|
|
14290
|
+
*/
|
|
14291
|
+
deductions?: Array<Deduction2> | undefined;
|
|
14292
|
+
};
|
|
14293
|
+
declare const TrackIntervalEnum1: {
|
|
14294
|
+
readonly OneOff: "one_off";
|
|
14295
|
+
readonly Minute: "minute";
|
|
14296
|
+
readonly Hour: "hour";
|
|
14297
|
+
readonly Day: "day";
|
|
14298
|
+
readonly Week: "week";
|
|
14299
|
+
readonly Month: "month";
|
|
14300
|
+
readonly Quarter: "quarter";
|
|
14301
|
+
readonly SemiAnnual: "semi_annual";
|
|
14302
|
+
readonly Year: "year";
|
|
14303
|
+
};
|
|
14304
|
+
type TrackIntervalEnum1 = OpenEnum<typeof TrackIntervalEnum1>;
|
|
14305
|
+
type TrackReset1 = {
|
|
14306
|
+
/**
|
|
14307
|
+
* The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
|
|
14308
|
+
*/
|
|
14309
|
+
interval: TrackIntervalEnum1 | string;
|
|
14310
|
+
/**
|
|
14311
|
+
* Number of intervals between resets (eg. 2 for bi-monthly).
|
|
14312
|
+
*/
|
|
14313
|
+
intervalCount?: number | undefined;
|
|
14314
|
+
/**
|
|
14315
|
+
* Timestamp when the balance will next reset.
|
|
14316
|
+
*/
|
|
14317
|
+
resetsAt: number | null;
|
|
14318
|
+
};
|
|
14319
|
+
type Deduction1 = {
|
|
14320
|
+
/**
|
|
14321
|
+
* ID of the underlying balance row that was deducted from (customer_entitlement or rollover).
|
|
14322
|
+
*/
|
|
14323
|
+
balanceId: string;
|
|
14324
|
+
/**
|
|
14325
|
+
* The feature this balance belongs to.
|
|
14326
|
+
*/
|
|
14327
|
+
featureId: string;
|
|
14328
|
+
/**
|
|
14329
|
+
* ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
|
|
14330
|
+
*/
|
|
14331
|
+
planId: string | null;
|
|
14332
|
+
/**
|
|
14333
|
+
* Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
|
|
14334
|
+
*/
|
|
14335
|
+
reset: TrackReset1 | null;
|
|
14336
|
+
/**
|
|
14337
|
+
* Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
|
|
14338
|
+
*/
|
|
14339
|
+
value: number;
|
|
14185
14340
|
};
|
|
14186
14341
|
/**
|
|
14187
14342
|
* OK
|
|
@@ -14213,6 +14368,10 @@ type TrackResponseBody1 = {
|
|
|
14213
14368
|
balances?: {
|
|
14214
14369
|
[k: string]: Balance | null;
|
|
14215
14370
|
} | undefined;
|
|
14371
|
+
/**
|
|
14372
|
+
* Per-balance breakdown of what this event deducted. A single event can consume from multiple balance rows when credit systems or rollovers are involved; this surfaces each one so callers can build per-feature usage views without polling.
|
|
14373
|
+
*/
|
|
14374
|
+
deductions?: Array<Deduction1> | undefined;
|
|
14216
14375
|
};
|
|
14217
14376
|
type TrackResponse = TrackResponseBody1 | TrackResponseBody2;
|
|
14218
14377
|
|
|
@@ -15849,6 +16008,7 @@ type UpdatePlanParams = {
|
|
|
15849
16008
|
* Miscellaneous plan-level configuration flags.
|
|
15850
16009
|
*/
|
|
15851
16010
|
config?: UpdatePlanConfigRequest | undefined;
|
|
16011
|
+
createInStripe?: boolean | undefined;
|
|
15852
16012
|
version?: number | undefined;
|
|
15853
16013
|
archived?: boolean | undefined;
|
|
15854
16014
|
/**
|
|
@@ -16547,7 +16707,7 @@ declare class Billing extends ClientSDK {
|
|
|
16547
16707
|
* @example
|
|
16548
16708
|
* ```typescript
|
|
16549
16709
|
* // Schedule a transition from a trial plan to a paid plan
|
|
16550
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
16710
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1778684108513,"plans":[{"planId":"trial_plan"}]},{"startsAt":1779893708513,"plans":[{"planId":"pro_plan"}]}] });
|
|
16551
16711
|
* ```
|
|
16552
16712
|
*
|
|
16553
16713
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
@@ -4686,6 +4686,7 @@ type CreatePlanParams = {
|
|
|
4686
4686
|
* Miscellaneous plan-level configuration flags.
|
|
4687
4687
|
*/
|
|
4688
4688
|
config?: CreatePlanConfigRequest | undefined;
|
|
4689
|
+
createInStripe?: boolean | undefined;
|
|
4689
4690
|
};
|
|
4690
4691
|
/**
|
|
4691
4692
|
* Billing interval (e.g. 'month', 'year').
|
|
@@ -6151,6 +6152,7 @@ declare const CustomerRewardsType: {
|
|
|
6151
6152
|
readonly FixedDiscount: "fixed_discount";
|
|
6152
6153
|
readonly FreeProduct: "free_product";
|
|
6153
6154
|
readonly InvoiceCredits: "invoice_credits";
|
|
6155
|
+
readonly FeatureGrant: "feature_grant";
|
|
6154
6156
|
};
|
|
6155
6157
|
/**
|
|
6156
6158
|
* The type of reward
|
|
@@ -7002,6 +7004,7 @@ declare const GetCustomerRewardsType: {
|
|
|
7002
7004
|
readonly FixedDiscount: "fixed_discount";
|
|
7003
7005
|
readonly FreeProduct: "free_product";
|
|
7004
7006
|
readonly InvoiceCredits: "invoice_credits";
|
|
7007
|
+
readonly FeatureGrant: "feature_grant";
|
|
7005
7008
|
};
|
|
7006
7009
|
/**
|
|
7007
7010
|
* The type of reward
|
|
@@ -9158,6 +9161,54 @@ type EventsListParams = {
|
|
|
9158
9161
|
*/
|
|
9159
9162
|
customRange?: ListEventsCustomRange | undefined;
|
|
9160
9163
|
};
|
|
9164
|
+
declare const ListEventsIntervalEnum: {
|
|
9165
|
+
readonly OneOff: "one_off";
|
|
9166
|
+
readonly Minute: "minute";
|
|
9167
|
+
readonly Hour: "hour";
|
|
9168
|
+
readonly Day: "day";
|
|
9169
|
+
readonly Week: "week";
|
|
9170
|
+
readonly Month: "month";
|
|
9171
|
+
readonly Quarter: "quarter";
|
|
9172
|
+
readonly SemiAnnual: "semi_annual";
|
|
9173
|
+
readonly Year: "year";
|
|
9174
|
+
};
|
|
9175
|
+
type ListEventsIntervalEnum = OpenEnum<typeof ListEventsIntervalEnum>;
|
|
9176
|
+
type ListEventsReset = {
|
|
9177
|
+
/**
|
|
9178
|
+
* The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
|
|
9179
|
+
*/
|
|
9180
|
+
interval: ListEventsIntervalEnum | string;
|
|
9181
|
+
/**
|
|
9182
|
+
* Number of intervals between resets (eg. 2 for bi-monthly).
|
|
9183
|
+
*/
|
|
9184
|
+
intervalCount?: number | undefined;
|
|
9185
|
+
/**
|
|
9186
|
+
* Timestamp when the balance will next reset.
|
|
9187
|
+
*/
|
|
9188
|
+
resetsAt: number | null;
|
|
9189
|
+
};
|
|
9190
|
+
type Deductions = {
|
|
9191
|
+
/**
|
|
9192
|
+
* ID of the underlying balance row that was deducted from (customer_entitlement or rollover).
|
|
9193
|
+
*/
|
|
9194
|
+
balanceId: string;
|
|
9195
|
+
/**
|
|
9196
|
+
* The feature this balance belongs to.
|
|
9197
|
+
*/
|
|
9198
|
+
featureId: string;
|
|
9199
|
+
/**
|
|
9200
|
+
* ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
|
|
9201
|
+
*/
|
|
9202
|
+
planId: string | null;
|
|
9203
|
+
/**
|
|
9204
|
+
* Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
|
|
9205
|
+
*/
|
|
9206
|
+
reset: ListEventsReset | null;
|
|
9207
|
+
/**
|
|
9208
|
+
* Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
|
|
9209
|
+
*/
|
|
9210
|
+
value: number;
|
|
9211
|
+
};
|
|
9161
9212
|
type ListEventsList = {
|
|
9162
9213
|
/**
|
|
9163
9214
|
* Event ID (KSUID)
|
|
@@ -9185,6 +9236,10 @@ type ListEventsList = {
|
|
|
9185
9236
|
properties: {
|
|
9186
9237
|
[k: string]: any;
|
|
9187
9238
|
};
|
|
9239
|
+
/**
|
|
9240
|
+
* Per-balance breakdown of what this event deducted. Null for events ingested before deductions were tracked; an empty array means the event was accepted but no balance moved.
|
|
9241
|
+
*/
|
|
9242
|
+
deductions: Array<Deductions> | null;
|
|
9188
9243
|
};
|
|
9189
9244
|
/**
|
|
9190
9245
|
* OK
|
|
@@ -14152,6 +14207,54 @@ type TrackParams = {
|
|
|
14152
14207
|
} | undefined;
|
|
14153
14208
|
lock?: TrackLock | undefined;
|
|
14154
14209
|
};
|
|
14210
|
+
declare const TrackIntervalEnum2: {
|
|
14211
|
+
readonly OneOff: "one_off";
|
|
14212
|
+
readonly Minute: "minute";
|
|
14213
|
+
readonly Hour: "hour";
|
|
14214
|
+
readonly Day: "day";
|
|
14215
|
+
readonly Week: "week";
|
|
14216
|
+
readonly Month: "month";
|
|
14217
|
+
readonly Quarter: "quarter";
|
|
14218
|
+
readonly SemiAnnual: "semi_annual";
|
|
14219
|
+
readonly Year: "year";
|
|
14220
|
+
};
|
|
14221
|
+
type TrackIntervalEnum2 = OpenEnum<typeof TrackIntervalEnum2>;
|
|
14222
|
+
type TrackReset2 = {
|
|
14223
|
+
/**
|
|
14224
|
+
* The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
|
|
14225
|
+
*/
|
|
14226
|
+
interval: TrackIntervalEnum2 | string;
|
|
14227
|
+
/**
|
|
14228
|
+
* Number of intervals between resets (eg. 2 for bi-monthly).
|
|
14229
|
+
*/
|
|
14230
|
+
intervalCount?: number | undefined;
|
|
14231
|
+
/**
|
|
14232
|
+
* Timestamp when the balance will next reset.
|
|
14233
|
+
*/
|
|
14234
|
+
resetsAt: number | null;
|
|
14235
|
+
};
|
|
14236
|
+
type Deduction2 = {
|
|
14237
|
+
/**
|
|
14238
|
+
* ID of the underlying balance row that was deducted from (customer_entitlement or rollover).
|
|
14239
|
+
*/
|
|
14240
|
+
balanceId: string;
|
|
14241
|
+
/**
|
|
14242
|
+
* The feature this balance belongs to.
|
|
14243
|
+
*/
|
|
14244
|
+
featureId: string;
|
|
14245
|
+
/**
|
|
14246
|
+
* ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
|
|
14247
|
+
*/
|
|
14248
|
+
planId: string | null;
|
|
14249
|
+
/**
|
|
14250
|
+
* Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
|
|
14251
|
+
*/
|
|
14252
|
+
reset: TrackReset2 | null;
|
|
14253
|
+
/**
|
|
14254
|
+
* Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
|
|
14255
|
+
*/
|
|
14256
|
+
value: number;
|
|
14257
|
+
};
|
|
14155
14258
|
/**
|
|
14156
14259
|
* 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.
|
|
14157
14260
|
*/
|
|
@@ -14182,6 +14285,58 @@ type TrackResponseBody2 = {
|
|
|
14182
14285
|
balances?: {
|
|
14183
14286
|
[k: string]: Balance | null;
|
|
14184
14287
|
} | undefined;
|
|
14288
|
+
/**
|
|
14289
|
+
* Per-balance breakdown of what this event deducted. A single event can consume from multiple balance rows when credit systems or rollovers are involved; this surfaces each one so callers can build per-feature usage views without polling.
|
|
14290
|
+
*/
|
|
14291
|
+
deductions?: Array<Deduction2> | undefined;
|
|
14292
|
+
};
|
|
14293
|
+
declare const TrackIntervalEnum1: {
|
|
14294
|
+
readonly OneOff: "one_off";
|
|
14295
|
+
readonly Minute: "minute";
|
|
14296
|
+
readonly Hour: "hour";
|
|
14297
|
+
readonly Day: "day";
|
|
14298
|
+
readonly Week: "week";
|
|
14299
|
+
readonly Month: "month";
|
|
14300
|
+
readonly Quarter: "quarter";
|
|
14301
|
+
readonly SemiAnnual: "semi_annual";
|
|
14302
|
+
readonly Year: "year";
|
|
14303
|
+
};
|
|
14304
|
+
type TrackIntervalEnum1 = OpenEnum<typeof TrackIntervalEnum1>;
|
|
14305
|
+
type TrackReset1 = {
|
|
14306
|
+
/**
|
|
14307
|
+
* The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
|
|
14308
|
+
*/
|
|
14309
|
+
interval: TrackIntervalEnum1 | string;
|
|
14310
|
+
/**
|
|
14311
|
+
* Number of intervals between resets (eg. 2 for bi-monthly).
|
|
14312
|
+
*/
|
|
14313
|
+
intervalCount?: number | undefined;
|
|
14314
|
+
/**
|
|
14315
|
+
* Timestamp when the balance will next reset.
|
|
14316
|
+
*/
|
|
14317
|
+
resetsAt: number | null;
|
|
14318
|
+
};
|
|
14319
|
+
type Deduction1 = {
|
|
14320
|
+
/**
|
|
14321
|
+
* ID of the underlying balance row that was deducted from (customer_entitlement or rollover).
|
|
14322
|
+
*/
|
|
14323
|
+
balanceId: string;
|
|
14324
|
+
/**
|
|
14325
|
+
* The feature this balance belongs to.
|
|
14326
|
+
*/
|
|
14327
|
+
featureId: string;
|
|
14328
|
+
/**
|
|
14329
|
+
* ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
|
|
14330
|
+
*/
|
|
14331
|
+
planId: string | null;
|
|
14332
|
+
/**
|
|
14333
|
+
* Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
|
|
14334
|
+
*/
|
|
14335
|
+
reset: TrackReset1 | null;
|
|
14336
|
+
/**
|
|
14337
|
+
* Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
|
|
14338
|
+
*/
|
|
14339
|
+
value: number;
|
|
14185
14340
|
};
|
|
14186
14341
|
/**
|
|
14187
14342
|
* OK
|
|
@@ -14213,6 +14368,10 @@ type TrackResponseBody1 = {
|
|
|
14213
14368
|
balances?: {
|
|
14214
14369
|
[k: string]: Balance | null;
|
|
14215
14370
|
} | undefined;
|
|
14371
|
+
/**
|
|
14372
|
+
* Per-balance breakdown of what this event deducted. A single event can consume from multiple balance rows when credit systems or rollovers are involved; this surfaces each one so callers can build per-feature usage views without polling.
|
|
14373
|
+
*/
|
|
14374
|
+
deductions?: Array<Deduction1> | undefined;
|
|
14216
14375
|
};
|
|
14217
14376
|
type TrackResponse = TrackResponseBody1 | TrackResponseBody2;
|
|
14218
14377
|
|
|
@@ -15849,6 +16008,7 @@ type UpdatePlanParams = {
|
|
|
15849
16008
|
* Miscellaneous plan-level configuration flags.
|
|
15850
16009
|
*/
|
|
15851
16010
|
config?: UpdatePlanConfigRequest | undefined;
|
|
16011
|
+
createInStripe?: boolean | undefined;
|
|
15852
16012
|
version?: number | undefined;
|
|
15853
16013
|
archived?: boolean | undefined;
|
|
15854
16014
|
/**
|
|
@@ -16547,7 +16707,7 @@ declare class Billing extends ClientSDK {
|
|
|
16547
16707
|
* @example
|
|
16548
16708
|
* ```typescript
|
|
16549
16709
|
* // Schedule a transition from a trial plan to a paid plan
|
|
16550
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
16710
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1778684108513,"plans":[{"planId":"trial_plan"}]},{"startsAt":1779893708513,"plans":[{"planId":"pro_plan"}]}] });
|
|
16551
16711
|
* ```
|
|
16552
16712
|
*
|
|
16553
16713
|
* @param customerId - The ID of the customer to create the schedule for.
|