autumn-js 1.2.13 → 1.2.15
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 +623 -108
- package/dist/backend/adapters/express.mjs +8 -8
- package/dist/backend/adapters/fetch.js +623 -108
- package/dist/backend/adapters/fetch.mjs +8 -8
- package/dist/backend/adapters/hono.js +623 -108
- package/dist/backend/adapters/hono.mjs +8 -8
- package/dist/backend/adapters/index.js +623 -108
- package/dist/backend/adapters/index.mjs +11 -11
- package/dist/backend/adapters/next.js +623 -108
- package/dist/backend/adapters/next.mjs +8 -8
- package/dist/backend/{chunk-DNNJOZAT.mjs → chunk-BQVZ6GCE.mjs} +1 -1
- package/dist/backend/{chunk-YSQQKZBU.mjs → chunk-IEOQUAJY.mjs} +7 -7
- package/dist/backend/{chunk-MANTLPDT.mjs → chunk-IQS3LQVP.mjs} +36 -8
- package/dist/backend/{chunk-7BVATYGA.mjs → chunk-NDB3VKT4.mjs} +1 -1
- package/dist/backend/{chunk-RPH5L44S.mjs → chunk-NRTK5YZK.mjs} +1 -1
- package/dist/backend/{chunk-T42RZEUZ.mjs → chunk-OXCQHLZX.mjs} +587 -100
- package/dist/backend/{chunk-EJGHP7KT.mjs → chunk-RSIOYTRW.mjs} +5 -5
- package/dist/backend/{chunk-OUDB34Y7.mjs → chunk-X7LDYBKC.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 +623 -108
- package/dist/backend/core/handlers/coreHandler.mjs +6 -6
- 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 +3 -3
- package/dist/backend/core/handlers/handleRouteByName.js +623 -108
- package/dist/backend/core/handlers/handleRouteByName.mjs +6 -6
- 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 +623 -108
- 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 +623 -108
- 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 +36 -8
- 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.js +36 -8
- 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/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/index.js +623 -108
- package/dist/backend/index.mjs +7 -7
- package/dist/backend/{routeTypes-DVwngaBn.d.mts → routeTypes-CIspXIZ4.d.mts} +841 -169
- package/dist/backend/{routeTypes-B94_Mq2J.d.ts → routeTypes-COwIJFNS.d.ts} +841 -169
- package/dist/better-auth/{chunk-4OWECHZC.mjs → chunk-L6XX4ONM.mjs} +1 -1
- package/dist/better-auth/{chunk-ZZGFPTHO.mjs → chunk-QT6R3AXQ.mjs} +588 -101
- package/dist/better-auth/{chunk-JIFD4TSN.mjs → chunk-ZO3KGM5W.mjs} +36 -8
- 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.ts → createAutumnEndpoint-Clm1sxhQ.d.mts} +4 -8
- package/dist/better-auth/{createAutumnEndpoint-CvXRCg-M.d.mts → 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 +623 -108
- package/dist/better-auth/index.mjs +3 -3
- 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/createAutumnEndpoint.js +36 -8
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- 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 +623 -108
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- 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 +623 -108
- 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/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-DB8vL_m7.d.mts → customer-BDxW2bu6.d.mts} +35 -9
- package/dist/react/{customer-CaGJEN5J.d.ts → customer-BPUObmME.d.ts} +35 -9
- package/dist/react/hooks/index.d.mts +2 -2
- package/dist/react/hooks/index.d.ts +2 -2
- 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/useAggregateEvents.d.mts +1 -1
- package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
- package/dist/react/hooks/useCustomer.d.mts +2 -2
- package/dist/react/hooks/useCustomer.d.ts +2 -2
- 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 +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/{params-B5l9vHfZ.d.ts → params-D4cEukOJ.d.ts} +615 -64
- package/dist/react/{params-BVglT8vT.d.mts → params-DzbSUS8O.d.mts} +615 -64
- package/dist/sdk/index.d.mts +980 -173
- package/dist/sdk/index.d.ts +980 -173
- package/dist/sdk/index.js +978 -212
- package/dist/sdk/index.mjs +825 -149
- package/package.json +1 -1
- package/dist/backend/{chunk-S5HPMJ4U.mjs → chunk-55C2WWXQ.mjs} +3 -3
|
@@ -615,6 +615,10 @@ type AttachParams = {
|
|
|
615
615
|
* If true, skips any billing changes for the attach operation.
|
|
616
616
|
*/
|
|
617
617
|
noBillingChanges?: boolean | undefined;
|
|
618
|
+
/**
|
|
619
|
+
* If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer_product is inserted before the customer completes the hosted form.
|
|
620
|
+
*/
|
|
621
|
+
enablePlanImmediately?: boolean | undefined;
|
|
618
622
|
};
|
|
619
623
|
/**
|
|
620
624
|
* Invoice details if an invoice was created. Only present when a charge was made.
|
|
@@ -1261,7 +1265,457 @@ type CheckParams = {
|
|
|
1261
1265
|
/**
|
|
1262
1266
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1263
1267
|
*/
|
|
1264
|
-
declare const
|
|
1268
|
+
declare const FlagType2: {
|
|
1269
|
+
readonly Boolean: "boolean";
|
|
1270
|
+
readonly Metered: "metered";
|
|
1271
|
+
readonly CreditSystem: "credit_system";
|
|
1272
|
+
};
|
|
1273
|
+
/**
|
|
1274
|
+
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1275
|
+
*/
|
|
1276
|
+
type FlagType2 = OpenEnum<typeof FlagType2>;
|
|
1277
|
+
type CheckCreditSchema2 = {
|
|
1278
|
+
/**
|
|
1279
|
+
* ID of the metered feature that draws from this credit system.
|
|
1280
|
+
*/
|
|
1281
|
+
meteredFeatureId: string;
|
|
1282
|
+
/**
|
|
1283
|
+
* Credits consumed per unit of the metered feature.
|
|
1284
|
+
*/
|
|
1285
|
+
creditCost: number;
|
|
1286
|
+
};
|
|
1287
|
+
/**
|
|
1288
|
+
* Display names for the feature in billing UI and customer-facing components.
|
|
1289
|
+
*/
|
|
1290
|
+
type FlagDisplay2 = {
|
|
1291
|
+
/**
|
|
1292
|
+
* Singular form for UI display (e.g., 'API call', 'seat').
|
|
1293
|
+
*/
|
|
1294
|
+
singular?: string | null | undefined;
|
|
1295
|
+
/**
|
|
1296
|
+
* Plural form for UI display (e.g., 'API calls', 'seats').
|
|
1297
|
+
*/
|
|
1298
|
+
plural?: string | null | undefined;
|
|
1299
|
+
};
|
|
1300
|
+
/**
|
|
1301
|
+
* The full feature object if expanded.
|
|
1302
|
+
*/
|
|
1303
|
+
type CheckFeature2 = {
|
|
1304
|
+
/**
|
|
1305
|
+
* The unique identifier for this feature, used in /check and /track calls.
|
|
1306
|
+
*/
|
|
1307
|
+
id: string;
|
|
1308
|
+
/**
|
|
1309
|
+
* Human-readable name displayed in the dashboard and billing UI.
|
|
1310
|
+
*/
|
|
1311
|
+
name: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1314
|
+
*/
|
|
1315
|
+
type: FlagType2;
|
|
1316
|
+
/**
|
|
1317
|
+
* For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
|
|
1318
|
+
*/
|
|
1319
|
+
consumable: boolean;
|
|
1320
|
+
/**
|
|
1321
|
+
* Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
|
|
1322
|
+
*/
|
|
1323
|
+
eventNames?: Array<string> | undefined;
|
|
1324
|
+
/**
|
|
1325
|
+
* For credit_system features: maps metered features to their credit costs.
|
|
1326
|
+
*/
|
|
1327
|
+
creditSchema?: Array<CheckCreditSchema2> | undefined;
|
|
1328
|
+
/**
|
|
1329
|
+
* Display names for the feature in billing UI and customer-facing components.
|
|
1330
|
+
*/
|
|
1331
|
+
display?: FlagDisplay2 | undefined;
|
|
1332
|
+
/**
|
|
1333
|
+
* Whether the feature is archived and hidden from the dashboard.
|
|
1334
|
+
*/
|
|
1335
|
+
archived: boolean;
|
|
1336
|
+
};
|
|
1337
|
+
type Flag2 = {
|
|
1338
|
+
/**
|
|
1339
|
+
* The unique identifier for this flag.
|
|
1340
|
+
*/
|
|
1341
|
+
id: string;
|
|
1342
|
+
/**
|
|
1343
|
+
* The plan ID this flag originates from, or null for standalone flags.
|
|
1344
|
+
*/
|
|
1345
|
+
planId: string | null;
|
|
1346
|
+
/**
|
|
1347
|
+
* Timestamp when this flag expires, or null for no expiration.
|
|
1348
|
+
*/
|
|
1349
|
+
expiresAt: number | null;
|
|
1350
|
+
/**
|
|
1351
|
+
* The feature ID this flag is for.
|
|
1352
|
+
*/
|
|
1353
|
+
featureId: string;
|
|
1354
|
+
/**
|
|
1355
|
+
* The full feature object if expanded.
|
|
1356
|
+
*/
|
|
1357
|
+
feature?: CheckFeature2 | undefined;
|
|
1358
|
+
};
|
|
1359
|
+
/**
|
|
1360
|
+
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1361
|
+
*/
|
|
1362
|
+
declare const Scenario2: {
|
|
1363
|
+
readonly UsageLimit: "usage_limit";
|
|
1364
|
+
readonly FeatureFlag: "feature_flag";
|
|
1365
|
+
};
|
|
1366
|
+
/**
|
|
1367
|
+
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1368
|
+
*/
|
|
1369
|
+
type Scenario2 = OpenEnum<typeof Scenario2>;
|
|
1370
|
+
/**
|
|
1371
|
+
* The environment of the product
|
|
1372
|
+
*/
|
|
1373
|
+
declare const CheckEnv2: {
|
|
1374
|
+
readonly Sandbox: "sandbox";
|
|
1375
|
+
readonly Live: "live";
|
|
1376
|
+
};
|
|
1377
|
+
/**
|
|
1378
|
+
* The environment of the product
|
|
1379
|
+
*/
|
|
1380
|
+
type CheckEnv2 = OpenEnum<typeof CheckEnv2>;
|
|
1381
|
+
declare const ProductType2: {
|
|
1382
|
+
readonly Feature: "feature";
|
|
1383
|
+
readonly PricedFeature: "priced_feature";
|
|
1384
|
+
readonly Price: "price";
|
|
1385
|
+
};
|
|
1386
|
+
type ProductType2 = OpenEnum<typeof ProductType2>;
|
|
1387
|
+
declare const FeatureType2: {
|
|
1388
|
+
readonly SingleUse: "single_use";
|
|
1389
|
+
readonly ContinuousUse: "continuous_use";
|
|
1390
|
+
readonly Boolean: "boolean";
|
|
1391
|
+
readonly Static: "static";
|
|
1392
|
+
};
|
|
1393
|
+
type FeatureType2 = OpenEnum<typeof FeatureType2>;
|
|
1394
|
+
declare const CheckInterval2: {
|
|
1395
|
+
readonly Minute: "minute";
|
|
1396
|
+
readonly Hour: "hour";
|
|
1397
|
+
readonly Day: "day";
|
|
1398
|
+
readonly Week: "week";
|
|
1399
|
+
readonly Month: "month";
|
|
1400
|
+
readonly Quarter: "quarter";
|
|
1401
|
+
readonly SemiAnnual: "semi_annual";
|
|
1402
|
+
readonly Year: "year";
|
|
1403
|
+
};
|
|
1404
|
+
type CheckInterval2 = OpenEnum<typeof CheckInterval2>;
|
|
1405
|
+
declare const CheckTierBehavior2: {
|
|
1406
|
+
readonly Graduated: "graduated";
|
|
1407
|
+
readonly Volume: "volume";
|
|
1408
|
+
};
|
|
1409
|
+
type CheckTierBehavior2 = OpenEnum<typeof CheckTierBehavior2>;
|
|
1410
|
+
declare const UsageModel2: {
|
|
1411
|
+
readonly Prepaid: "prepaid";
|
|
1412
|
+
readonly PayPerUse: "pay_per_use";
|
|
1413
|
+
};
|
|
1414
|
+
type UsageModel2 = OpenEnum<typeof UsageModel2>;
|
|
1415
|
+
type ProductDisplay2 = {
|
|
1416
|
+
primaryText: string;
|
|
1417
|
+
secondaryText?: string | null | undefined;
|
|
1418
|
+
};
|
|
1419
|
+
declare const ConfigDuration2: {
|
|
1420
|
+
readonly Month: "month";
|
|
1421
|
+
readonly Forever: "forever";
|
|
1422
|
+
};
|
|
1423
|
+
type ConfigDuration2 = OpenEnum<typeof ConfigDuration2>;
|
|
1424
|
+
type CheckRollover2 = {
|
|
1425
|
+
max?: number | null | undefined;
|
|
1426
|
+
maxPercentage?: number | null | undefined;
|
|
1427
|
+
duration: ConfigDuration2;
|
|
1428
|
+
length: number;
|
|
1429
|
+
};
|
|
1430
|
+
declare const CheckOnIncrease2: {
|
|
1431
|
+
readonly BillImmediately: "bill_immediately";
|
|
1432
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
1433
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1434
|
+
readonly BillNextCycle: "bill_next_cycle";
|
|
1435
|
+
};
|
|
1436
|
+
type CheckOnIncrease2 = OpenEnum<typeof CheckOnIncrease2>;
|
|
1437
|
+
declare const CheckOnDecrease2: {
|
|
1438
|
+
readonly Prorate: "prorate";
|
|
1439
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
1440
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1441
|
+
readonly None: "none";
|
|
1442
|
+
readonly NoProrations: "no_prorations";
|
|
1443
|
+
};
|
|
1444
|
+
type CheckOnDecrease2 = OpenEnum<typeof CheckOnDecrease2>;
|
|
1445
|
+
type CheckConfig2 = {
|
|
1446
|
+
rollover?: CheckRollover2 | null | undefined;
|
|
1447
|
+
onIncrease?: CheckOnIncrease2 | null | undefined;
|
|
1448
|
+
onDecrease?: CheckOnDecrease2 | null | undefined;
|
|
1449
|
+
};
|
|
1450
|
+
/**
|
|
1451
|
+
* Product item defining features and pricing within a product
|
|
1452
|
+
*/
|
|
1453
|
+
type CheckItem2 = {
|
|
1454
|
+
/**
|
|
1455
|
+
* The type of the product item
|
|
1456
|
+
*/
|
|
1457
|
+
type?: ProductType2 | null | undefined;
|
|
1458
|
+
/**
|
|
1459
|
+
* The feature ID of the product item. If the item is a fixed price, should be `null`
|
|
1460
|
+
*/
|
|
1461
|
+
featureId?: string | null | undefined;
|
|
1462
|
+
/**
|
|
1463
|
+
* 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.
|
|
1464
|
+
*/
|
|
1465
|
+
featureType?: FeatureType2 | null | undefined;
|
|
1466
|
+
/**
|
|
1467
|
+
* The amount of usage included for this feature.
|
|
1468
|
+
*/
|
|
1469
|
+
includedUsage?: number | string | null | undefined;
|
|
1470
|
+
/**
|
|
1471
|
+
* 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.
|
|
1472
|
+
*/
|
|
1473
|
+
interval?: CheckInterval2 | null | undefined;
|
|
1474
|
+
/**
|
|
1475
|
+
* The interval count of the product item.
|
|
1476
|
+
*/
|
|
1477
|
+
intervalCount?: number | null | undefined;
|
|
1478
|
+
/**
|
|
1479
|
+
* The price of the product item. Should be `null` if tiered pricing is set.
|
|
1480
|
+
*/
|
|
1481
|
+
price?: number | null | undefined;
|
|
1482
|
+
/**
|
|
1483
|
+
* Tiered pricing for the product item. Not applicable for fixed price items.
|
|
1484
|
+
*/
|
|
1485
|
+
tiers?: Array<any | null> | null | undefined;
|
|
1486
|
+
/**
|
|
1487
|
+
* How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier). Defaults to graduated.
|
|
1488
|
+
*/
|
|
1489
|
+
tierBehavior?: CheckTierBehavior2 | null | undefined;
|
|
1490
|
+
/**
|
|
1491
|
+
* Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
|
|
1492
|
+
*/
|
|
1493
|
+
usageModel?: UsageModel2 | null | undefined;
|
|
1494
|
+
/**
|
|
1495
|
+
* The amount per billing unit (eg. $9 / 250 units)
|
|
1496
|
+
*/
|
|
1497
|
+
billingUnits?: number | null | undefined;
|
|
1498
|
+
/**
|
|
1499
|
+
* Whether the usage should be reset when the product is enabled.
|
|
1500
|
+
*/
|
|
1501
|
+
resetUsageWhenEnabled?: boolean | null | undefined;
|
|
1502
|
+
/**
|
|
1503
|
+
* The entity feature ID of the product item if applicable.
|
|
1504
|
+
*/
|
|
1505
|
+
entityFeatureId?: string | null | undefined;
|
|
1506
|
+
/**
|
|
1507
|
+
* The display of the product item.
|
|
1508
|
+
*/
|
|
1509
|
+
display?: ProductDisplay2 | null | undefined;
|
|
1510
|
+
/**
|
|
1511
|
+
* Used in customer context. Quantity of the feature the customer has prepaid for.
|
|
1512
|
+
*/
|
|
1513
|
+
quantity?: number | null | undefined;
|
|
1514
|
+
/**
|
|
1515
|
+
* Used in customer context. Quantity of the feature the customer will prepay for in the next cycle.
|
|
1516
|
+
*/
|
|
1517
|
+
nextCycleQuantity?: number | null | undefined;
|
|
1518
|
+
/**
|
|
1519
|
+
* Configuration for rollover and proration behavior of the feature.
|
|
1520
|
+
*/
|
|
1521
|
+
config?: CheckConfig2 | null | undefined;
|
|
1522
|
+
};
|
|
1523
|
+
/**
|
|
1524
|
+
* The duration type of the free trial
|
|
1525
|
+
*/
|
|
1526
|
+
declare const FreeTrialDuration2: {
|
|
1527
|
+
readonly Day: "day";
|
|
1528
|
+
readonly Month: "month";
|
|
1529
|
+
readonly Year: "year";
|
|
1530
|
+
};
|
|
1531
|
+
/**
|
|
1532
|
+
* The duration type of the free trial
|
|
1533
|
+
*/
|
|
1534
|
+
type FreeTrialDuration2 = OpenEnum<typeof FreeTrialDuration2>;
|
|
1535
|
+
type CheckFreeTrial2 = {
|
|
1536
|
+
/**
|
|
1537
|
+
* The duration type of the free trial
|
|
1538
|
+
*/
|
|
1539
|
+
duration: FreeTrialDuration2;
|
|
1540
|
+
/**
|
|
1541
|
+
* The length of the duration type specified
|
|
1542
|
+
*/
|
|
1543
|
+
length: number;
|
|
1544
|
+
/**
|
|
1545
|
+
* Whether the free trial is limited to one per customer fingerprint
|
|
1546
|
+
*/
|
|
1547
|
+
uniqueFingerprint: boolean;
|
|
1548
|
+
/**
|
|
1549
|
+
* 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.
|
|
1550
|
+
*/
|
|
1551
|
+
cardRequired: boolean;
|
|
1552
|
+
/**
|
|
1553
|
+
* Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
|
|
1554
|
+
*/
|
|
1555
|
+
trialAvailable: boolean | null;
|
|
1556
|
+
};
|
|
1557
|
+
/**
|
|
1558
|
+
* Scenario for when this product is used in attach flows
|
|
1559
|
+
*/
|
|
1560
|
+
declare const ProductScenario2: {
|
|
1561
|
+
readonly Scheduled: "scheduled";
|
|
1562
|
+
readonly Active: "active";
|
|
1563
|
+
readonly New: "new";
|
|
1564
|
+
readonly Renew: "renew";
|
|
1565
|
+
readonly Upgrade: "upgrade";
|
|
1566
|
+
readonly UpdatePrepaidQuantity: "update_prepaid_quantity";
|
|
1567
|
+
readonly Downgrade: "downgrade";
|
|
1568
|
+
readonly Cancel: "cancel";
|
|
1569
|
+
readonly Expired: "expired";
|
|
1570
|
+
readonly PastDue: "past_due";
|
|
1571
|
+
};
|
|
1572
|
+
/**
|
|
1573
|
+
* Scenario for when this product is used in attach flows
|
|
1574
|
+
*/
|
|
1575
|
+
type ProductScenario2 = OpenEnum<typeof ProductScenario2>;
|
|
1576
|
+
type Properties2 = {
|
|
1577
|
+
/**
|
|
1578
|
+
* True if the product has no base price or usage prices
|
|
1579
|
+
*/
|
|
1580
|
+
isFree: boolean;
|
|
1581
|
+
/**
|
|
1582
|
+
* True if the product only contains a one-time price
|
|
1583
|
+
*/
|
|
1584
|
+
isOneOff: boolean;
|
|
1585
|
+
/**
|
|
1586
|
+
* The billing interval group for recurring products (e.g., 'monthly', 'yearly')
|
|
1587
|
+
*/
|
|
1588
|
+
intervalGroup?: string | null | undefined;
|
|
1589
|
+
/**
|
|
1590
|
+
* True if the product includes a free trial
|
|
1591
|
+
*/
|
|
1592
|
+
hasTrial?: boolean | null | undefined;
|
|
1593
|
+
/**
|
|
1594
|
+
* True if the product can be updated after creation (only applicable if there are prepaid recurring prices)
|
|
1595
|
+
*/
|
|
1596
|
+
updateable?: boolean | null | undefined;
|
|
1597
|
+
};
|
|
1598
|
+
type Product2 = {
|
|
1599
|
+
/**
|
|
1600
|
+
* The ID of the product you set when creating the product
|
|
1601
|
+
*/
|
|
1602
|
+
id: string;
|
|
1603
|
+
/**
|
|
1604
|
+
* The name of the product
|
|
1605
|
+
*/
|
|
1606
|
+
name: string;
|
|
1607
|
+
/**
|
|
1608
|
+
* Product group which this product belongs to
|
|
1609
|
+
*/
|
|
1610
|
+
group: string | null;
|
|
1611
|
+
/**
|
|
1612
|
+
* The environment of the product
|
|
1613
|
+
*/
|
|
1614
|
+
env: CheckEnv2;
|
|
1615
|
+
/**
|
|
1616
|
+
* Whether the product is an add-on and can be purchased alongside other products
|
|
1617
|
+
*/
|
|
1618
|
+
isAddOn: boolean;
|
|
1619
|
+
/**
|
|
1620
|
+
* Whether the product is the default product
|
|
1621
|
+
*/
|
|
1622
|
+
isDefault: boolean;
|
|
1623
|
+
/**
|
|
1624
|
+
* Whether this product has been archived and is no longer available
|
|
1625
|
+
*/
|
|
1626
|
+
archived: boolean;
|
|
1627
|
+
/**
|
|
1628
|
+
* The current version of the product
|
|
1629
|
+
*/
|
|
1630
|
+
version: number;
|
|
1631
|
+
/**
|
|
1632
|
+
* The timestamp of when the product was created in milliseconds since epoch
|
|
1633
|
+
*/
|
|
1634
|
+
createdAt: number;
|
|
1635
|
+
/**
|
|
1636
|
+
* Array of product items that define the product's features and pricing
|
|
1637
|
+
*/
|
|
1638
|
+
items: Array<CheckItem2>;
|
|
1639
|
+
/**
|
|
1640
|
+
* Free trial configuration for this product, if available
|
|
1641
|
+
*/
|
|
1642
|
+
freeTrial: CheckFreeTrial2 | null;
|
|
1643
|
+
/**
|
|
1644
|
+
* ID of the base variant this product is derived from
|
|
1645
|
+
*/
|
|
1646
|
+
baseVariantId: string | null;
|
|
1647
|
+
/**
|
|
1648
|
+
* Scenario for when this product is used in attach flows
|
|
1649
|
+
*/
|
|
1650
|
+
scenario?: ProductScenario2 | undefined;
|
|
1651
|
+
properties?: Properties2 | undefined;
|
|
1652
|
+
};
|
|
1653
|
+
/**
|
|
1654
|
+
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
1655
|
+
*/
|
|
1656
|
+
type Preview2 = {
|
|
1657
|
+
/**
|
|
1658
|
+
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1659
|
+
*/
|
|
1660
|
+
scenario: Scenario2;
|
|
1661
|
+
/**
|
|
1662
|
+
* A title suitable for displaying in a paywall or upgrade modal.
|
|
1663
|
+
*/
|
|
1664
|
+
title: string;
|
|
1665
|
+
/**
|
|
1666
|
+
* A message explaining why access was denied.
|
|
1667
|
+
*/
|
|
1668
|
+
message: string;
|
|
1669
|
+
/**
|
|
1670
|
+
* The ID of the feature that was checked.
|
|
1671
|
+
*/
|
|
1672
|
+
featureId: string;
|
|
1673
|
+
/**
|
|
1674
|
+
* The display name of the feature.
|
|
1675
|
+
*/
|
|
1676
|
+
featureName: string;
|
|
1677
|
+
/**
|
|
1678
|
+
* Products that would grant access to this feature. Use to display upgrade options.
|
|
1679
|
+
*/
|
|
1680
|
+
products: Array<Product2>;
|
|
1681
|
+
};
|
|
1682
|
+
/**
|
|
1683
|
+
* Accepted. Autumn is experiencing degraded service from a downstream provider, so access was allowed fail-open.
|
|
1684
|
+
*/
|
|
1685
|
+
type CheckResponseBody2 = {
|
|
1686
|
+
/**
|
|
1687
|
+
* Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
|
|
1688
|
+
*/
|
|
1689
|
+
allowed: boolean;
|
|
1690
|
+
/**
|
|
1691
|
+
* The ID of the customer that was checked.
|
|
1692
|
+
*/
|
|
1693
|
+
customerId: string;
|
|
1694
|
+
/**
|
|
1695
|
+
* The ID of the entity, if an entity-scoped check was performed.
|
|
1696
|
+
*/
|
|
1697
|
+
entityId?: string | null | undefined;
|
|
1698
|
+
/**
|
|
1699
|
+
* The required balance that was checked against.
|
|
1700
|
+
*/
|
|
1701
|
+
requiredBalance?: number | undefined;
|
|
1702
|
+
/**
|
|
1703
|
+
* The customer's balance for this feature. Null if the customer has no balance for this feature.
|
|
1704
|
+
*/
|
|
1705
|
+
balance: Balance | null;
|
|
1706
|
+
/**
|
|
1707
|
+
* The flag associated with this check, if any.
|
|
1708
|
+
*/
|
|
1709
|
+
flag: Flag2 | null;
|
|
1710
|
+
/**
|
|
1711
|
+
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
1712
|
+
*/
|
|
1713
|
+
preview?: Preview2 | undefined;
|
|
1714
|
+
};
|
|
1715
|
+
/**
|
|
1716
|
+
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1717
|
+
*/
|
|
1718
|
+
declare const FlagType1: {
|
|
1265
1719
|
readonly Boolean: "boolean";
|
|
1266
1720
|
readonly Metered: "metered";
|
|
1267
1721
|
readonly CreditSystem: "credit_system";
|
|
@@ -1269,8 +1723,8 @@ declare const FlagType: {
|
|
|
1269
1723
|
/**
|
|
1270
1724
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1271
1725
|
*/
|
|
1272
|
-
type
|
|
1273
|
-
type
|
|
1726
|
+
type FlagType1 = OpenEnum<typeof FlagType1>;
|
|
1727
|
+
type CheckCreditSchema1 = {
|
|
1274
1728
|
/**
|
|
1275
1729
|
* ID of the metered feature that draws from this credit system.
|
|
1276
1730
|
*/
|
|
@@ -1283,7 +1737,7 @@ type CheckCreditSchema = {
|
|
|
1283
1737
|
/**
|
|
1284
1738
|
* Display names for the feature in billing UI and customer-facing components.
|
|
1285
1739
|
*/
|
|
1286
|
-
type
|
|
1740
|
+
type FlagDisplay1 = {
|
|
1287
1741
|
/**
|
|
1288
1742
|
* Singular form for UI display (e.g., 'API call', 'seat').
|
|
1289
1743
|
*/
|
|
@@ -1296,7 +1750,7 @@ type FlagDisplay = {
|
|
|
1296
1750
|
/**
|
|
1297
1751
|
* The full feature object if expanded.
|
|
1298
1752
|
*/
|
|
1299
|
-
type
|
|
1753
|
+
type CheckFeature1 = {
|
|
1300
1754
|
/**
|
|
1301
1755
|
* The unique identifier for this feature, used in /check and /track calls.
|
|
1302
1756
|
*/
|
|
@@ -1308,7 +1762,7 @@ type CheckFeature = {
|
|
|
1308
1762
|
/**
|
|
1309
1763
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools.
|
|
1310
1764
|
*/
|
|
1311
|
-
type:
|
|
1765
|
+
type: FlagType1;
|
|
1312
1766
|
/**
|
|
1313
1767
|
* For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
|
|
1314
1768
|
*/
|
|
@@ -1320,17 +1774,17 @@ type CheckFeature = {
|
|
|
1320
1774
|
/**
|
|
1321
1775
|
* For credit_system features: maps metered features to their credit costs.
|
|
1322
1776
|
*/
|
|
1323
|
-
creditSchema?: Array<
|
|
1777
|
+
creditSchema?: Array<CheckCreditSchema1> | undefined;
|
|
1324
1778
|
/**
|
|
1325
1779
|
* Display names for the feature in billing UI and customer-facing components.
|
|
1326
1780
|
*/
|
|
1327
|
-
display?:
|
|
1781
|
+
display?: FlagDisplay1 | undefined;
|
|
1328
1782
|
/**
|
|
1329
1783
|
* Whether the feature is archived and hidden from the dashboard.
|
|
1330
1784
|
*/
|
|
1331
1785
|
archived: boolean;
|
|
1332
1786
|
};
|
|
1333
|
-
type
|
|
1787
|
+
type Flag1 = {
|
|
1334
1788
|
/**
|
|
1335
1789
|
* The unique identifier for this flag.
|
|
1336
1790
|
*/
|
|
@@ -1350,44 +1804,44 @@ type Flag = {
|
|
|
1350
1804
|
/**
|
|
1351
1805
|
* The full feature object if expanded.
|
|
1352
1806
|
*/
|
|
1353
|
-
feature?:
|
|
1807
|
+
feature?: CheckFeature1 | undefined;
|
|
1354
1808
|
};
|
|
1355
1809
|
/**
|
|
1356
1810
|
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1357
1811
|
*/
|
|
1358
|
-
declare const
|
|
1812
|
+
declare const Scenario1: {
|
|
1359
1813
|
readonly UsageLimit: "usage_limit";
|
|
1360
1814
|
readonly FeatureFlag: "feature_flag";
|
|
1361
1815
|
};
|
|
1362
1816
|
/**
|
|
1363
1817
|
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1364
1818
|
*/
|
|
1365
|
-
type
|
|
1819
|
+
type Scenario1 = OpenEnum<typeof Scenario1>;
|
|
1366
1820
|
/**
|
|
1367
1821
|
* The environment of the product
|
|
1368
1822
|
*/
|
|
1369
|
-
declare const
|
|
1823
|
+
declare const CheckEnv1: {
|
|
1370
1824
|
readonly Sandbox: "sandbox";
|
|
1371
1825
|
readonly Live: "live";
|
|
1372
1826
|
};
|
|
1373
1827
|
/**
|
|
1374
1828
|
* The environment of the product
|
|
1375
1829
|
*/
|
|
1376
|
-
type
|
|
1377
|
-
declare const
|
|
1830
|
+
type CheckEnv1 = OpenEnum<typeof CheckEnv1>;
|
|
1831
|
+
declare const ProductType1: {
|
|
1378
1832
|
readonly Feature: "feature";
|
|
1379
1833
|
readonly PricedFeature: "priced_feature";
|
|
1380
1834
|
readonly Price: "price";
|
|
1381
1835
|
};
|
|
1382
|
-
type
|
|
1383
|
-
declare const
|
|
1836
|
+
type ProductType1 = OpenEnum<typeof ProductType1>;
|
|
1837
|
+
declare const FeatureType1: {
|
|
1384
1838
|
readonly SingleUse: "single_use";
|
|
1385
1839
|
readonly ContinuousUse: "continuous_use";
|
|
1386
1840
|
readonly Boolean: "boolean";
|
|
1387
1841
|
readonly Static: "static";
|
|
1388
1842
|
};
|
|
1389
|
-
type
|
|
1390
|
-
declare const
|
|
1843
|
+
type FeatureType1 = OpenEnum<typeof FeatureType1>;
|
|
1844
|
+
declare const CheckInterval1: {
|
|
1391
1845
|
readonly Minute: "minute";
|
|
1392
1846
|
readonly Hour: "hour";
|
|
1393
1847
|
readonly Day: "day";
|
|
@@ -1397,60 +1851,60 @@ declare const CheckInterval: {
|
|
|
1397
1851
|
readonly SemiAnnual: "semi_annual";
|
|
1398
1852
|
readonly Year: "year";
|
|
1399
1853
|
};
|
|
1400
|
-
type
|
|
1401
|
-
declare const
|
|
1854
|
+
type CheckInterval1 = OpenEnum<typeof CheckInterval1>;
|
|
1855
|
+
declare const CheckTierBehavior1: {
|
|
1402
1856
|
readonly Graduated: "graduated";
|
|
1403
1857
|
readonly Volume: "volume";
|
|
1404
1858
|
};
|
|
1405
|
-
type
|
|
1406
|
-
declare const
|
|
1859
|
+
type CheckTierBehavior1 = OpenEnum<typeof CheckTierBehavior1>;
|
|
1860
|
+
declare const UsageModel1: {
|
|
1407
1861
|
readonly Prepaid: "prepaid";
|
|
1408
1862
|
readonly PayPerUse: "pay_per_use";
|
|
1409
1863
|
};
|
|
1410
|
-
type
|
|
1411
|
-
type
|
|
1864
|
+
type UsageModel1 = OpenEnum<typeof UsageModel1>;
|
|
1865
|
+
type ProductDisplay1 = {
|
|
1412
1866
|
primaryText: string;
|
|
1413
1867
|
secondaryText?: string | null | undefined;
|
|
1414
1868
|
};
|
|
1415
|
-
declare const
|
|
1869
|
+
declare const ConfigDuration1: {
|
|
1416
1870
|
readonly Month: "month";
|
|
1417
1871
|
readonly Forever: "forever";
|
|
1418
1872
|
};
|
|
1419
|
-
type
|
|
1420
|
-
type
|
|
1873
|
+
type ConfigDuration1 = OpenEnum<typeof ConfigDuration1>;
|
|
1874
|
+
type CheckRollover1 = {
|
|
1421
1875
|
max?: number | null | undefined;
|
|
1422
1876
|
maxPercentage?: number | null | undefined;
|
|
1423
|
-
duration:
|
|
1877
|
+
duration: ConfigDuration1;
|
|
1424
1878
|
length: number;
|
|
1425
1879
|
};
|
|
1426
|
-
declare const
|
|
1880
|
+
declare const CheckOnIncrease1: {
|
|
1427
1881
|
readonly BillImmediately: "bill_immediately";
|
|
1428
1882
|
readonly ProrateImmediately: "prorate_immediately";
|
|
1429
1883
|
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1430
1884
|
readonly BillNextCycle: "bill_next_cycle";
|
|
1431
1885
|
};
|
|
1432
|
-
type
|
|
1433
|
-
declare const
|
|
1886
|
+
type CheckOnIncrease1 = OpenEnum<typeof CheckOnIncrease1>;
|
|
1887
|
+
declare const CheckOnDecrease1: {
|
|
1434
1888
|
readonly Prorate: "prorate";
|
|
1435
1889
|
readonly ProrateImmediately: "prorate_immediately";
|
|
1436
1890
|
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1437
1891
|
readonly None: "none";
|
|
1438
1892
|
readonly NoProrations: "no_prorations";
|
|
1439
1893
|
};
|
|
1440
|
-
type
|
|
1441
|
-
type
|
|
1442
|
-
rollover?:
|
|
1443
|
-
onIncrease?:
|
|
1444
|
-
onDecrease?:
|
|
1894
|
+
type CheckOnDecrease1 = OpenEnum<typeof CheckOnDecrease1>;
|
|
1895
|
+
type CheckConfig1 = {
|
|
1896
|
+
rollover?: CheckRollover1 | null | undefined;
|
|
1897
|
+
onIncrease?: CheckOnIncrease1 | null | undefined;
|
|
1898
|
+
onDecrease?: CheckOnDecrease1 | null | undefined;
|
|
1445
1899
|
};
|
|
1446
1900
|
/**
|
|
1447
1901
|
* Product item defining features and pricing within a product
|
|
1448
1902
|
*/
|
|
1449
|
-
type
|
|
1903
|
+
type CheckItem1 = {
|
|
1450
1904
|
/**
|
|
1451
1905
|
* The type of the product item
|
|
1452
1906
|
*/
|
|
1453
|
-
type?:
|
|
1907
|
+
type?: ProductType1 | null | undefined;
|
|
1454
1908
|
/**
|
|
1455
1909
|
* The feature ID of the product item. If the item is a fixed price, should be `null`
|
|
1456
1910
|
*/
|
|
@@ -1458,7 +1912,7 @@ type CheckItem = {
|
|
|
1458
1912
|
/**
|
|
1459
1913
|
* 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.
|
|
1460
1914
|
*/
|
|
1461
|
-
featureType?:
|
|
1915
|
+
featureType?: FeatureType1 | null | undefined;
|
|
1462
1916
|
/**
|
|
1463
1917
|
* The amount of usage included for this feature.
|
|
1464
1918
|
*/
|
|
@@ -1466,7 +1920,7 @@ type CheckItem = {
|
|
|
1466
1920
|
/**
|
|
1467
1921
|
* 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.
|
|
1468
1922
|
*/
|
|
1469
|
-
interval?:
|
|
1923
|
+
interval?: CheckInterval1 | null | undefined;
|
|
1470
1924
|
/**
|
|
1471
1925
|
* The interval count of the product item.
|
|
1472
1926
|
*/
|
|
@@ -1482,11 +1936,11 @@ type CheckItem = {
|
|
|
1482
1936
|
/**
|
|
1483
1937
|
* How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier). Defaults to graduated.
|
|
1484
1938
|
*/
|
|
1485
|
-
tierBehavior?:
|
|
1939
|
+
tierBehavior?: CheckTierBehavior1 | null | undefined;
|
|
1486
1940
|
/**
|
|
1487
1941
|
* Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
|
|
1488
1942
|
*/
|
|
1489
|
-
usageModel?:
|
|
1943
|
+
usageModel?: UsageModel1 | null | undefined;
|
|
1490
1944
|
/**
|
|
1491
1945
|
* The amount per billing unit (eg. $9 / 250 units)
|
|
1492
1946
|
*/
|
|
@@ -1502,7 +1956,7 @@ type CheckItem = {
|
|
|
1502
1956
|
/**
|
|
1503
1957
|
* The display of the product item.
|
|
1504
1958
|
*/
|
|
1505
|
-
display?:
|
|
1959
|
+
display?: ProductDisplay1 | null | undefined;
|
|
1506
1960
|
/**
|
|
1507
1961
|
* Used in customer context. Quantity of the feature the customer has prepaid for.
|
|
1508
1962
|
*/
|
|
@@ -1514,12 +1968,12 @@ type CheckItem = {
|
|
|
1514
1968
|
/**
|
|
1515
1969
|
* Configuration for rollover and proration behavior of the feature.
|
|
1516
1970
|
*/
|
|
1517
|
-
config?:
|
|
1971
|
+
config?: CheckConfig1 | null | undefined;
|
|
1518
1972
|
};
|
|
1519
1973
|
/**
|
|
1520
1974
|
* The duration type of the free trial
|
|
1521
1975
|
*/
|
|
1522
|
-
declare const
|
|
1976
|
+
declare const FreeTrialDuration1: {
|
|
1523
1977
|
readonly Day: "day";
|
|
1524
1978
|
readonly Month: "month";
|
|
1525
1979
|
readonly Year: "year";
|
|
@@ -1527,12 +1981,12 @@ declare const FreeTrialDuration: {
|
|
|
1527
1981
|
/**
|
|
1528
1982
|
* The duration type of the free trial
|
|
1529
1983
|
*/
|
|
1530
|
-
type
|
|
1531
|
-
type
|
|
1984
|
+
type FreeTrialDuration1 = OpenEnum<typeof FreeTrialDuration1>;
|
|
1985
|
+
type CheckFreeTrial1 = {
|
|
1532
1986
|
/**
|
|
1533
1987
|
* The duration type of the free trial
|
|
1534
1988
|
*/
|
|
1535
|
-
duration:
|
|
1989
|
+
duration: FreeTrialDuration1;
|
|
1536
1990
|
/**
|
|
1537
1991
|
* The length of the duration type specified
|
|
1538
1992
|
*/
|
|
@@ -1553,7 +2007,7 @@ type CheckFreeTrial = {
|
|
|
1553
2007
|
/**
|
|
1554
2008
|
* Scenario for when this product is used in attach flows
|
|
1555
2009
|
*/
|
|
1556
|
-
declare const
|
|
2010
|
+
declare const ProductScenario1: {
|
|
1557
2011
|
readonly Scheduled: "scheduled";
|
|
1558
2012
|
readonly Active: "active";
|
|
1559
2013
|
readonly New: "new";
|
|
@@ -1568,8 +2022,8 @@ declare const ProductScenario: {
|
|
|
1568
2022
|
/**
|
|
1569
2023
|
* Scenario for when this product is used in attach flows
|
|
1570
2024
|
*/
|
|
1571
|
-
type
|
|
1572
|
-
type
|
|
2025
|
+
type ProductScenario1 = OpenEnum<typeof ProductScenario1>;
|
|
2026
|
+
type Properties1 = {
|
|
1573
2027
|
/**
|
|
1574
2028
|
* True if the product has no base price or usage prices
|
|
1575
2029
|
*/
|
|
@@ -1591,7 +2045,7 @@ type Properties = {
|
|
|
1591
2045
|
*/
|
|
1592
2046
|
updateable?: boolean | null | undefined;
|
|
1593
2047
|
};
|
|
1594
|
-
type
|
|
2048
|
+
type Product1 = {
|
|
1595
2049
|
/**
|
|
1596
2050
|
* The ID of the product you set when creating the product
|
|
1597
2051
|
*/
|
|
@@ -1607,7 +2061,7 @@ type Product = {
|
|
|
1607
2061
|
/**
|
|
1608
2062
|
* The environment of the product
|
|
1609
2063
|
*/
|
|
1610
|
-
env:
|
|
2064
|
+
env: CheckEnv1;
|
|
1611
2065
|
/**
|
|
1612
2066
|
* Whether the product is an add-on and can be purchased alongside other products
|
|
1613
2067
|
*/
|
|
@@ -1631,11 +2085,11 @@ type Product = {
|
|
|
1631
2085
|
/**
|
|
1632
2086
|
* Array of product items that define the product's features and pricing
|
|
1633
2087
|
*/
|
|
1634
|
-
items: Array<
|
|
2088
|
+
items: Array<CheckItem1>;
|
|
1635
2089
|
/**
|
|
1636
2090
|
* Free trial configuration for this product, if available
|
|
1637
2091
|
*/
|
|
1638
|
-
freeTrial:
|
|
2092
|
+
freeTrial: CheckFreeTrial1 | null;
|
|
1639
2093
|
/**
|
|
1640
2094
|
* ID of the base variant this product is derived from
|
|
1641
2095
|
*/
|
|
@@ -1643,17 +2097,17 @@ type Product = {
|
|
|
1643
2097
|
/**
|
|
1644
2098
|
* Scenario for when this product is used in attach flows
|
|
1645
2099
|
*/
|
|
1646
|
-
scenario?:
|
|
1647
|
-
properties?:
|
|
2100
|
+
scenario?: ProductScenario1 | undefined;
|
|
2101
|
+
properties?: Properties1 | undefined;
|
|
1648
2102
|
};
|
|
1649
2103
|
/**
|
|
1650
2104
|
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
1651
2105
|
*/
|
|
1652
|
-
type
|
|
2106
|
+
type Preview1 = {
|
|
1653
2107
|
/**
|
|
1654
2108
|
* The reason access was denied. 'usage_limit' means the customer exceeded their balance, 'feature_flag' means the feature is not included in their plan.
|
|
1655
2109
|
*/
|
|
1656
|
-
scenario:
|
|
2110
|
+
scenario: Scenario1;
|
|
1657
2111
|
/**
|
|
1658
2112
|
* A title suitable for displaying in a paywall or upgrade modal.
|
|
1659
2113
|
*/
|
|
@@ -1673,12 +2127,12 @@ type Preview = {
|
|
|
1673
2127
|
/**
|
|
1674
2128
|
* Products that would grant access to this feature. Use to display upgrade options.
|
|
1675
2129
|
*/
|
|
1676
|
-
products: Array<
|
|
2130
|
+
products: Array<Product1>;
|
|
1677
2131
|
};
|
|
1678
2132
|
/**
|
|
1679
2133
|
* OK
|
|
1680
2134
|
*/
|
|
1681
|
-
type
|
|
2135
|
+
type CheckResponseBody1 = {
|
|
1682
2136
|
/**
|
|
1683
2137
|
* Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
|
|
1684
2138
|
*/
|
|
@@ -1702,12 +2156,13 @@ type CheckResponse = {
|
|
|
1702
2156
|
/**
|
|
1703
2157
|
* The flag associated with this check, if any.
|
|
1704
2158
|
*/
|
|
1705
|
-
flag:
|
|
2159
|
+
flag: Flag1 | null;
|
|
1706
2160
|
/**
|
|
1707
2161
|
* Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.
|
|
1708
2162
|
*/
|
|
1709
|
-
preview?:
|
|
2163
|
+
preview?: Preview1 | undefined;
|
|
1710
2164
|
};
|
|
2165
|
+
type CheckResponse = CheckResponseBody1 | CheckResponseBody2;
|
|
1711
2166
|
|
|
1712
2167
|
/**
|
|
1713
2168
|
* The time interval for the purchase limit window.
|
|
@@ -2869,6 +3324,10 @@ type MultiAttachParams = {
|
|
|
2869
3324
|
* Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
|
|
2870
3325
|
*/
|
|
2871
3326
|
newBillingSubscription?: boolean | undefined;
|
|
3327
|
+
/**
|
|
3328
|
+
* If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.
|
|
3329
|
+
*/
|
|
3330
|
+
enablePlanImmediately?: boolean | undefined;
|
|
2872
3331
|
/**
|
|
2873
3332
|
* Customer details to set when creating a customer
|
|
2874
3333
|
*/
|
|
@@ -3473,6 +3932,10 @@ type PreviewAttachParams = {
|
|
|
3473
3932
|
* If true, skips any billing changes for the attach operation.
|
|
3474
3933
|
*/
|
|
3475
3934
|
noBillingChanges?: boolean | undefined;
|
|
3935
|
+
/**
|
|
3936
|
+
* If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer_product is inserted before the customer completes the hosted form.
|
|
3937
|
+
*/
|
|
3938
|
+
enablePlanImmediately?: boolean | undefined;
|
|
3476
3939
|
};
|
|
3477
3940
|
type PreviewAttachDiscount = {
|
|
3478
3941
|
amountOff: number;
|
|
@@ -3715,6 +4178,42 @@ declare const PreviewAttachCheckoutType: {
|
|
|
3715
4178
|
readonly AutumnCheckout: "autumn_checkout";
|
|
3716
4179
|
};
|
|
3717
4180
|
type PreviewAttachCheckoutType = OpenEnum<typeof PreviewAttachCheckoutType>;
|
|
4181
|
+
/**
|
|
4182
|
+
* Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
|
|
4183
|
+
*/
|
|
4184
|
+
declare const PreviewAttachStatus: {
|
|
4185
|
+
readonly Complete: "complete";
|
|
4186
|
+
readonly Incomplete: "incomplete";
|
|
4187
|
+
};
|
|
4188
|
+
/**
|
|
4189
|
+
* Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
|
|
4190
|
+
*/
|
|
4191
|
+
type PreviewAttachStatus = OpenEnum<typeof PreviewAttachStatus>;
|
|
4192
|
+
/**
|
|
4193
|
+
* Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
|
|
4194
|
+
*/
|
|
4195
|
+
type PreviewAttachTax = {
|
|
4196
|
+
/**
|
|
4197
|
+
* Total tax amount in major currency units.
|
|
4198
|
+
*/
|
|
4199
|
+
total: number;
|
|
4200
|
+
/**
|
|
4201
|
+
* Tax included in line item subtotals.
|
|
4202
|
+
*/
|
|
4203
|
+
amountInclusive: number;
|
|
4204
|
+
/**
|
|
4205
|
+
* Tax added on top of subtotals.
|
|
4206
|
+
*/
|
|
4207
|
+
amountExclusive: number;
|
|
4208
|
+
/**
|
|
4209
|
+
* Three-letter currency code.
|
|
4210
|
+
*/
|
|
4211
|
+
currency: string;
|
|
4212
|
+
/**
|
|
4213
|
+
* Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
|
|
4214
|
+
*/
|
|
4215
|
+
status: PreviewAttachStatus;
|
|
4216
|
+
};
|
|
3718
4217
|
/**
|
|
3719
4218
|
* OK
|
|
3720
4219
|
*/
|
|
@@ -3760,6 +4259,10 @@ type PreviewAttachResponse = {
|
|
|
3760
4259
|
* The type of checkout that will be used if the customer is redirected to a checkout page.
|
|
3761
4260
|
*/
|
|
3762
4261
|
checkoutType: PreviewAttachCheckoutType | null;
|
|
4262
|
+
/**
|
|
4263
|
+
* Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
|
|
4264
|
+
*/
|
|
4265
|
+
tax?: PreviewAttachTax | undefined;
|
|
3763
4266
|
};
|
|
3764
4267
|
|
|
3765
4268
|
/**
|
|
@@ -4256,6 +4759,10 @@ type PreviewMultiAttachParams = {
|
|
|
4256
4759
|
* Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
|
|
4257
4760
|
*/
|
|
4258
4761
|
newBillingSubscription?: boolean | undefined;
|
|
4762
|
+
/**
|
|
4763
|
+
* If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.
|
|
4764
|
+
*/
|
|
4765
|
+
enablePlanImmediately?: boolean | undefined;
|
|
4259
4766
|
/**
|
|
4260
4767
|
* Customer details to set when creating a customer
|
|
4261
4768
|
*/
|
|
@@ -4503,6 +5010,42 @@ declare const PreviewMultiAttachCheckoutType: {
|
|
|
4503
5010
|
readonly AutumnCheckout: "autumn_checkout";
|
|
4504
5011
|
};
|
|
4505
5012
|
type PreviewMultiAttachCheckoutType = OpenEnum<typeof PreviewMultiAttachCheckoutType>;
|
|
5013
|
+
/**
|
|
5014
|
+
* Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
|
|
5015
|
+
*/
|
|
5016
|
+
declare const PreviewMultiAttachStatus: {
|
|
5017
|
+
readonly Complete: "complete";
|
|
5018
|
+
readonly Incomplete: "incomplete";
|
|
5019
|
+
};
|
|
5020
|
+
/**
|
|
5021
|
+
* Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
|
|
5022
|
+
*/
|
|
5023
|
+
type PreviewMultiAttachStatus = OpenEnum<typeof PreviewMultiAttachStatus>;
|
|
5024
|
+
/**
|
|
5025
|
+
* Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
|
|
5026
|
+
*/
|
|
5027
|
+
type PreviewMultiAttachTax = {
|
|
5028
|
+
/**
|
|
5029
|
+
* Total tax amount in major currency units.
|
|
5030
|
+
*/
|
|
5031
|
+
total: number;
|
|
5032
|
+
/**
|
|
5033
|
+
* Tax included in line item subtotals.
|
|
5034
|
+
*/
|
|
5035
|
+
amountInclusive: number;
|
|
5036
|
+
/**
|
|
5037
|
+
* Tax added on top of subtotals.
|
|
5038
|
+
*/
|
|
5039
|
+
amountExclusive: number;
|
|
5040
|
+
/**
|
|
5041
|
+
* Three-letter currency code.
|
|
5042
|
+
*/
|
|
5043
|
+
currency: string;
|
|
5044
|
+
/**
|
|
5045
|
+
* Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
|
|
5046
|
+
*/
|
|
5047
|
+
status: PreviewMultiAttachStatus;
|
|
5048
|
+
};
|
|
4506
5049
|
/**
|
|
4507
5050
|
* OK
|
|
4508
5051
|
*/
|
|
@@ -4548,6 +5091,10 @@ type PreviewMultiAttachResponse = {
|
|
|
4548
5091
|
* The type of checkout that will be used if the customer is redirected to a checkout page.
|
|
4549
5092
|
*/
|
|
4550
5093
|
checkoutType: PreviewMultiAttachCheckoutType | null;
|
|
5094
|
+
/**
|
|
5095
|
+
* Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
|
|
5096
|
+
*/
|
|
5097
|
+
tax?: PreviewMultiAttachTax | undefined;
|
|
4551
5098
|
};
|
|
4552
5099
|
|
|
4553
5100
|
/**
|
|
@@ -5741,6 +6288,10 @@ type SetupPaymentParams = {
|
|
|
5741
6288
|
* If true, skips any billing changes for the attach operation.
|
|
5742
6289
|
*/
|
|
5743
6290
|
noBillingChanges?: boolean | undefined;
|
|
6291
|
+
/**
|
|
6292
|
+
* If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer_product is inserted before the customer completes the hosted form.
|
|
6293
|
+
*/
|
|
6294
|
+
enablePlanImmediately?: boolean | undefined;
|
|
5744
6295
|
};
|
|
5745
6296
|
/**
|
|
5746
6297
|
* OK
|