@openmeter/client 1.0.0-beta.233 → 1.0.0-beta.235
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/README.md +125 -111
- package/dist/funcs/customers.d.ts +112 -1
- package/dist/funcs/customers.js +430 -0
- package/dist/funcs/entitlements.d.ts +38 -1
- package/dist/funcs/entitlements.js +169 -6
- package/dist/funcs/grants.d.ts +24 -0
- package/dist/funcs/grants.js +78 -0
- package/dist/funcs/index.d.ts +2 -0
- package/dist/funcs/index.js +2 -0
- package/dist/funcs/notifications.d.ts +43 -0
- package/dist/funcs/notifications.js +163 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +6 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +109 -1
- package/dist/models/operations/entitlements.d.ts +59 -4
- package/dist/models/operations/grants.d.ts +43 -0
- package/dist/models/operations/grants.js +2 -0
- package/dist/models/operations/notifications.d.ts +46 -0
- package/dist/models/operations/notifications.js +2 -0
- package/dist/models/schemas.d.ts +6556 -2713
- package/dist/models/schemas.js +1802 -365
- package/dist/models/types.d.ts +1177 -228
- package/dist/sdk/apps.d.ts +70 -1
- package/dist/sdk/apps.js +86 -1
- package/dist/sdk/charges.d.ts +32 -0
- package/dist/sdk/charges.js +38 -0
- package/dist/sdk/currencies.d.ts +71 -0
- package/dist/sdk/currencies.js +87 -0
- package/dist/sdk/customers.d.ts +205 -2
- package/dist/sdk/customers.js +246 -1
- package/dist/sdk/entitlementAccess.d.ts +22 -0
- package/dist/sdk/entitlementAccess.js +26 -0
- package/dist/sdk/entitlements.d.ts +51 -1
- package/dist/sdk/entitlements.js +61 -1
- package/dist/sdk/grants.d.ts +43 -0
- package/dist/sdk/grants.js +51 -0
- package/dist/sdk/internal.d.ts +5 -458
- package/dist/sdk/internal.js +6 -569
- package/dist/sdk/notifications.d.ts +58 -0
- package/dist/sdk/notifications.js +72 -0
- package/dist/sdk/planAddons.d.ts +20 -1
- package/dist/sdk/planAddons.js +24 -1
- package/dist/sdk/sdk.d.ts +18 -0
- package/dist/sdk/sdk.js +30 -0
- package/dist/sdk/subscriptions.d.ts +39 -9
- package/dist/sdk/subscriptions.js +45 -11
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -378,31 +378,16 @@ export const entitlementType = z
|
|
|
378
378
|
export const entitlementAccessExpand = z
|
|
379
379
|
.enum(['value'])
|
|
380
380
|
.describe('Expands for customer entitlement access. Values: - `value`: The balance details of a metered entitlement; it sets the `value` field.');
|
|
381
|
-
export const createLabels = z
|
|
382
|
-
.record(z.string(), z.string())
|
|
383
|
-
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
384
|
-
export const creditFundingMethod = z
|
|
385
|
-
.enum(['none', 'invoice', 'external'])
|
|
386
|
-
.describe('The funding method describes how the grant is funded. - `none`: No funding workflow applies, for example promotional grants - `invoice`: The grant is funded by an in-system invoice flow - `external`: The grant is funded outside the system (e.g., wire transfer, external invoice, or manual reconciliation)');
|
|
387
|
-
export const creditAvailabilityPolicy = z
|
|
388
|
-
.enum(['on_creation'])
|
|
389
|
-
.describe('When credits become available for consumption. - `on_creation`: Credits are available as soon as the grant is created. - `on_authorization`: Credits are available once the payment is authorized. - `on_settlement`: Credits are available once the payment is settled.');
|
|
390
|
-
export const taxBehavior = z
|
|
391
|
-
.enum(['inclusive', 'exclusive'])
|
|
392
|
-
.describe('Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.');
|
|
393
381
|
export const iso8601Duration = z
|
|
394
382
|
.string()
|
|
395
383
|
.regex(new RegExp('^P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$'))
|
|
396
384
|
.describe('[ISO 8601 Duration](https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm) string.');
|
|
397
|
-
export const
|
|
398
|
-
.enum(['
|
|
399
|
-
.describe('
|
|
400
|
-
export const
|
|
401
|
-
.
|
|
402
|
-
.describe('
|
|
403
|
-
export const validationIssueSeverity = z
|
|
404
|
-
.enum(['critical', 'warning'])
|
|
405
|
-
.describe('Severity level of a billing validation issue.');
|
|
385
|
+
export const entitlementMeasureUsageFromPreset = z
|
|
386
|
+
.enum(['current_period_start', 'now'])
|
|
387
|
+
.describe('Preset for the time from which usage is measured. - `current_period_start`: the start of the current usage period. - `now`: the entitlement creation time.');
|
|
388
|
+
export const entitlementHistoryWindowSize = z
|
|
389
|
+
.union([z.literal('PT1H'), z.literal('P1D')])
|
|
390
|
+
.describe('The meter query granularities the usage history can be grouped into. Sub-hour windows are too expensive to compute and monthly windows are not supported.');
|
|
406
391
|
export const stringFieldFilterExact = z
|
|
407
392
|
.union([
|
|
408
393
|
z.string(),
|
|
@@ -422,6 +407,89 @@ export const stringFieldFilterExact = z
|
|
|
422
407
|
}),
|
|
423
408
|
])
|
|
424
409
|
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
410
|
+
export const createLabels = z
|
|
411
|
+
.record(z.string(), z.string())
|
|
412
|
+
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
413
|
+
export const creditFundingMethod = z
|
|
414
|
+
.enum(['none', 'invoice', 'external'])
|
|
415
|
+
.describe('The funding method describes how the grant is funded. - `none`: No funding workflow applies, for example promotional grants - `invoice`: The grant is funded by an in-system invoice flow - `external`: The grant is funded outside the system (e.g., wire transfer, external invoice, or manual reconciliation)');
|
|
416
|
+
export const creditAvailabilityPolicy = z
|
|
417
|
+
.enum(['on_creation'])
|
|
418
|
+
.describe('When credits become available for consumption. - `on_creation`: Credits are available as soon as the grant is created. - `on_authorization`: Credits are available once the payment is authorized. - `on_settlement`: Credits are available once the payment is settled.');
|
|
419
|
+
export const taxBehavior = z
|
|
420
|
+
.enum(['inclusive', 'exclusive'])
|
|
421
|
+
.describe('Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.');
|
|
422
|
+
export const createVersionFilter = z
|
|
423
|
+
.object({
|
|
424
|
+
eq: z
|
|
425
|
+
.number()
|
|
426
|
+
.int()
|
|
427
|
+
.gte(1)
|
|
428
|
+
.lte(2147483647)
|
|
429
|
+
.optional()
|
|
430
|
+
.describe('Match this exact version.'),
|
|
431
|
+
oeq: z
|
|
432
|
+
.array(z.number().int().gte(-2147483648).lte(2147483647))
|
|
433
|
+
.min(1)
|
|
434
|
+
.max(100)
|
|
435
|
+
.optional()
|
|
436
|
+
.describe('Match one of these versions.'),
|
|
437
|
+
gte: z
|
|
438
|
+
.number()
|
|
439
|
+
.int()
|
|
440
|
+
.gte(1)
|
|
441
|
+
.lte(2147483647)
|
|
442
|
+
.optional()
|
|
443
|
+
.describe('Match this version and later versions.'),
|
|
444
|
+
lte: z
|
|
445
|
+
.number()
|
|
446
|
+
.int()
|
|
447
|
+
.gte(1)
|
|
448
|
+
.lte(2147483647)
|
|
449
|
+
.optional()
|
|
450
|
+
.describe('Match this version and earlier versions.'),
|
|
451
|
+
})
|
|
452
|
+
.describe('An integer version comparison. Exactly one operator must be provided.');
|
|
453
|
+
export const creditPurchasePaymentSettlementStatus = z
|
|
454
|
+
.enum(['pending', 'authorized', 'settled'])
|
|
455
|
+
.describe('Credit purchase payment settlement status. - `pending`: Payment has been initiated and is not yet authorized. - `authorized`: Payment has been authorized. - `settled`: Payment has been settled.');
|
|
456
|
+
export const versionFilter = z
|
|
457
|
+
.object({
|
|
458
|
+
eq: z
|
|
459
|
+
.number()
|
|
460
|
+
.int()
|
|
461
|
+
.gte(1)
|
|
462
|
+
.lte(2147483647)
|
|
463
|
+
.optional()
|
|
464
|
+
.describe('Match this exact version.'),
|
|
465
|
+
oeq: z
|
|
466
|
+
.array(z.number().int().gte(-2147483648).lte(2147483647))
|
|
467
|
+
.min(1)
|
|
468
|
+
.max(100)
|
|
469
|
+
.optional()
|
|
470
|
+
.describe('Match one of these versions.'),
|
|
471
|
+
gte: z
|
|
472
|
+
.number()
|
|
473
|
+
.int()
|
|
474
|
+
.gte(1)
|
|
475
|
+
.lte(2147483647)
|
|
476
|
+
.optional()
|
|
477
|
+
.describe('Match this version and later versions.'),
|
|
478
|
+
lte: z
|
|
479
|
+
.number()
|
|
480
|
+
.int()
|
|
481
|
+
.gte(1)
|
|
482
|
+
.lte(2147483647)
|
|
483
|
+
.optional()
|
|
484
|
+
.describe('Match this version and earlier versions.'),
|
|
485
|
+
})
|
|
486
|
+
.describe('An integer version comparison. Exactly one operator must be provided.');
|
|
487
|
+
export const creditGrantStatus = z
|
|
488
|
+
.enum(['pending', 'active', 'expired', 'voided'])
|
|
489
|
+
.describe('Credit grant lifecycle status. - `pending`: The credit block has been created but is not yet valid. (`effective_at` is in the future or availability_policy is not met) - `active`: The credit block is currently valid and eligible for consumption. (`effective_at` is in the past, `expires_at` is in the future and availability_policy is met) - `expired`: The credit block expired with remaining unused balance, `expires_at` time has passed. - `voided`: The credit block was voided. Remaining balance is forfeited.');
|
|
490
|
+
export const validationIssueSeverity = z
|
|
491
|
+
.enum(['critical', 'warning'])
|
|
492
|
+
.describe('Severity level of a billing validation issue.');
|
|
425
493
|
export const creditGrantVoidPaymentAdjustment = z
|
|
426
494
|
.enum(['none'])
|
|
427
495
|
.describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
|
|
@@ -825,6 +893,19 @@ export const entitlementFeatureAccessReasonCode = z
|
|
|
825
893
|
export const entitlementAccessQueryErrorCode = z
|
|
826
894
|
.enum(['unknown', 'customer_not_found'])
|
|
827
895
|
.describe('Error code for an entitlement access query failure.');
|
|
896
|
+
export const booleanFieldFilter = z
|
|
897
|
+
.union([
|
|
898
|
+
z.boolean(),
|
|
899
|
+
z.object({
|
|
900
|
+
eq: z
|
|
901
|
+
.boolean()
|
|
902
|
+
.describe('Value strictly equals the given boolean value.'),
|
|
903
|
+
}),
|
|
904
|
+
])
|
|
905
|
+
.describe('Filter by a boolean value (true/false).');
|
|
906
|
+
export const notificationChannelType = z
|
|
907
|
+
.enum(['webhook'])
|
|
908
|
+
.describe('The type of a notification channel. Currently the only supported channel type is `webhook`; the domain model anticipates additional channel types (e.g. email, Slack) in the future, so this is modeled as an enum rather than a boolean/constant even though it has a single member today.');
|
|
828
909
|
export const queryFilterInteger = z
|
|
829
910
|
.object({
|
|
830
911
|
eq: z
|
|
@@ -949,16 +1030,6 @@ export const pagePaginationQuery = z
|
|
|
949
1030
|
export const publicLabels = z
|
|
950
1031
|
.record(z.string(), z.string())
|
|
951
1032
|
.describe('Public labels store information about an entity that can be used for filtering a list of objects.');
|
|
952
|
-
export const booleanFieldFilter = z
|
|
953
|
-
.union([
|
|
954
|
-
z.boolean(),
|
|
955
|
-
z.object({
|
|
956
|
-
eq: z
|
|
957
|
-
.boolean()
|
|
958
|
-
.describe('Value strictly equals the given boolean value.'),
|
|
959
|
-
}),
|
|
960
|
-
])
|
|
961
|
-
.describe('Filter by a boolean value (true/false).');
|
|
962
1033
|
export const numericFieldFilter = z
|
|
963
1034
|
.union([
|
|
964
1035
|
z.number(),
|
|
@@ -1181,7 +1252,36 @@ export const entitlementAccessValue = z
|
|
|
1181
1252
|
.record(z.string(), numeric)
|
|
1182
1253
|
.describe('The remaining balance of each grant, keyed by grant ID.'),
|
|
1183
1254
|
})
|
|
1184
|
-
.describe('Balance details of a metered entitlement.');
|
|
1255
|
+
.describe('Balance details of a metered entitlement at the evaluation time, which is the `at` query parameter when given and the current time otherwise.');
|
|
1256
|
+
export const entitlementIssueAfterReset = z
|
|
1257
|
+
.object({
|
|
1258
|
+
amount: numeric,
|
|
1259
|
+
priority: z
|
|
1260
|
+
.number()
|
|
1261
|
+
.int()
|
|
1262
|
+
.gte(1)
|
|
1263
|
+
.lte(255)
|
|
1264
|
+
.optional()
|
|
1265
|
+
.default(1)
|
|
1266
|
+
.describe('The priority of the grant created after each reset. Lower values have higher priority.'),
|
|
1267
|
+
})
|
|
1268
|
+
.describe('Usage granted automatically after each reset of a metered entitlement. The balance returns to `amount` after every reset.');
|
|
1269
|
+
export const entitlementBurndownBalance = z
|
|
1270
|
+
.object({
|
|
1271
|
+
start: numeric,
|
|
1272
|
+
end: numeric,
|
|
1273
|
+
})
|
|
1274
|
+
.describe('Entitlement balance at the boundaries of a burndown segment.');
|
|
1275
|
+
export const entitlementBurndownGrantBalances = z
|
|
1276
|
+
.object({
|
|
1277
|
+
start: z
|
|
1278
|
+
.record(z.string(), numeric)
|
|
1279
|
+
.describe('The balance of each active grant at the start of the segment.'),
|
|
1280
|
+
end: z
|
|
1281
|
+
.record(z.string(), numeric)
|
|
1282
|
+
.describe('The balance of each active grant at the end of the segment.'),
|
|
1283
|
+
})
|
|
1284
|
+
.describe('Grant balances at the boundaries of a burndown segment, keyed by grant ID.');
|
|
1185
1285
|
export const createChargeCostBasisManual = z
|
|
1186
1286
|
.object({
|
|
1187
1287
|
type: z
|
|
@@ -1413,6 +1513,17 @@ export const profileReference = z
|
|
|
1413
1513
|
id: ulid,
|
|
1414
1514
|
})
|
|
1415
1515
|
.describe('Billing profile reference.');
|
|
1516
|
+
export const featureReference = z
|
|
1517
|
+
.object({
|
|
1518
|
+
id: ulid,
|
|
1519
|
+
})
|
|
1520
|
+
.describe('Feature reference.');
|
|
1521
|
+
export const entitlementGrantUsage = z
|
|
1522
|
+
.object({
|
|
1523
|
+
grantId: ulid,
|
|
1524
|
+
usage: numeric,
|
|
1525
|
+
})
|
|
1526
|
+
.describe('Usage taken from a single grant.');
|
|
1416
1527
|
export const createChargeCostBasisPinned = z
|
|
1417
1528
|
.object({
|
|
1418
1529
|
type: z
|
|
@@ -1452,6 +1563,11 @@ export const creditGrantInvoiceReference = z
|
|
|
1452
1563
|
.describe('Identifier of the invoice line associated with the grant.'),
|
|
1453
1564
|
})
|
|
1454
1565
|
.describe('Invoice references for the grant.');
|
|
1566
|
+
export const currencyCustomReference = z
|
|
1567
|
+
.object({
|
|
1568
|
+
id: ulid,
|
|
1569
|
+
})
|
|
1570
|
+
.describe('CurrencyCustom reference.');
|
|
1455
1571
|
export const subscriptionCostBasisPin = z
|
|
1456
1572
|
.object({
|
|
1457
1573
|
customCurrencyId: ulid,
|
|
@@ -1459,11 +1575,6 @@ export const subscriptionCostBasisPin = z
|
|
|
1459
1575
|
costBasisId: ulid,
|
|
1460
1576
|
})
|
|
1461
1577
|
.describe('A cost basis pinned to a custom-currency pair for the subscription.');
|
|
1462
|
-
export const featureReference = z
|
|
1463
|
-
.object({
|
|
1464
|
-
id: ulid,
|
|
1465
|
-
})
|
|
1466
|
-
.describe('Feature reference.');
|
|
1467
1578
|
export const subscriptionReference = z
|
|
1468
1579
|
.object({
|
|
1469
1580
|
id: ulid,
|
|
@@ -1617,6 +1728,26 @@ export const appStripeCreateCustomerPortalSessionResult = z
|
|
|
1617
1728
|
.describe('The URL to redirect the customer to after they have completed their requested actions.'),
|
|
1618
1729
|
})
|
|
1619
1730
|
.describe('Result of creating a [Stripe Customer Portal Session](https://docs.stripe.com/api/customer_portal/sessions/object). Contains all the information needed to redirect the customer to the Stripe Customer Portal.');
|
|
1731
|
+
export const closedPeriod = z
|
|
1732
|
+
.object({
|
|
1733
|
+
from: dateTime,
|
|
1734
|
+
to: dateTime,
|
|
1735
|
+
})
|
|
1736
|
+
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
1737
|
+
export const resetCustomerEntitlementUsageRequest = z
|
|
1738
|
+
.object({
|
|
1739
|
+
effectiveAt: dateTime.optional(),
|
|
1740
|
+
retainAnchor: z
|
|
1741
|
+
.boolean()
|
|
1742
|
+
.optional()
|
|
1743
|
+
.default(false)
|
|
1744
|
+
.describe('Whether the usage period anchor is kept. When false, the anchor moves to `effective_at`.'),
|
|
1745
|
+
preserveOverage: z
|
|
1746
|
+
.boolean()
|
|
1747
|
+
.optional()
|
|
1748
|
+
.describe("Whether overage carries over into the new usage period. Defaults to the entitlement's own setting."),
|
|
1749
|
+
})
|
|
1750
|
+
.describe('Request body for resetting the usage of a metered entitlement.');
|
|
1620
1751
|
export const chargeResolvedCostBasis = z
|
|
1621
1752
|
.object({
|
|
1622
1753
|
fiatCurrency: currencyCode,
|
|
@@ -1625,12 +1756,6 @@ export const chargeResolvedCostBasis = z
|
|
|
1625
1756
|
resolvedAt: dateTime,
|
|
1626
1757
|
})
|
|
1627
1758
|
.describe('Fiat conversion rate a custom-currency charge is invoiced at. Present once the cost basis is resolved; dynamic cost bases are exposed only after the service period has started.');
|
|
1628
|
-
export const closedPeriod = z
|
|
1629
|
-
.object({
|
|
1630
|
-
from: dateTime,
|
|
1631
|
-
to: dateTime,
|
|
1632
|
-
})
|
|
1633
|
-
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
1634
1759
|
export const subscriptionAddonTimelineSegment = z
|
|
1635
1760
|
.object({
|
|
1636
1761
|
activeFrom: dateTime,
|
|
@@ -1835,22 +1960,6 @@ export const tooManyRequests = baseError.describe('Too Many Requests.');
|
|
|
1835
1960
|
export const internal = baseError.describe('Internal Server Error.');
|
|
1836
1961
|
export const notImplemented = baseError.describe('Not Implemented.');
|
|
1837
1962
|
export const notAvailable = baseError.describe('Not Available.');
|
|
1838
|
-
export const createCreditGrantFilters = z
|
|
1839
|
-
.object({
|
|
1840
|
-
features: z
|
|
1841
|
-
.array(resourceKey)
|
|
1842
|
-
.optional()
|
|
1843
|
-
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
1844
|
-
})
|
|
1845
|
-
.describe('Filters for the credit grant.');
|
|
1846
|
-
export const creditGrantFilters = z
|
|
1847
|
-
.object({
|
|
1848
|
-
features: z
|
|
1849
|
-
.array(resourceKey)
|
|
1850
|
-
.optional()
|
|
1851
|
-
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
1852
|
-
})
|
|
1853
|
-
.describe('Filters for the credit grant.');
|
|
1854
1963
|
export const subscriptionPlanReference = z
|
|
1855
1964
|
.object({
|
|
1856
1965
|
id: ulid,
|
|
@@ -2148,6 +2257,30 @@ export const customerStripeCreateCustomerPortalSessionRequest = z
|
|
|
2148
2257
|
stripeOptions: appStripeCreateCustomerPortalSessionOptions,
|
|
2149
2258
|
})
|
|
2150
2259
|
.describe('Request to create a Stripe Customer Portal Session for the customer. Useful to redirect the customer to the Stripe Customer Portal to manage their payment methods, change their billing address and access their invoice history. Only returns URL if the customer billing profile is linked to a stripe app and customer.');
|
|
2260
|
+
export const entitlementAccessCheckResult = z
|
|
2261
|
+
.object({
|
|
2262
|
+
hasAccess: z
|
|
2263
|
+
.boolean()
|
|
2264
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
2265
|
+
config: z
|
|
2266
|
+
.string()
|
|
2267
|
+
.optional()
|
|
2268
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
2269
|
+
type: entitlementType.optional(),
|
|
2270
|
+
})
|
|
2271
|
+
.describe('Entitlement access check result.');
|
|
2272
|
+
export const recurringPeriodInput = z
|
|
2273
|
+
.object({
|
|
2274
|
+
interval: iso8601Duration,
|
|
2275
|
+
anchor: dateTime.optional(),
|
|
2276
|
+
})
|
|
2277
|
+
.describe('Recurring period input. The anchor is optional; the owning resource defines the default, typically its creation time.');
|
|
2278
|
+
export const recurringPeriod = z
|
|
2279
|
+
.object({
|
|
2280
|
+
anchor: dateTime,
|
|
2281
|
+
interval: iso8601Duration,
|
|
2282
|
+
})
|
|
2283
|
+
.describe('Recurring period with an anchor and an interval.');
|
|
2151
2284
|
export const rateCardMeteredEntitlement = z
|
|
2152
2285
|
.object({
|
|
2153
2286
|
type: z
|
|
@@ -2189,17 +2322,40 @@ export const subscriptionEditStretchPhase = z
|
|
|
2189
2322
|
extendBy: iso8601Duration,
|
|
2190
2323
|
})
|
|
2191
2324
|
.describe('Extend the duration of a phase, shifting later phases by the same amount.');
|
|
2192
|
-
export const
|
|
2325
|
+
export const entitlementMeasureUsageFrom = z
|
|
2326
|
+
.union([entitlementMeasureUsageFromPreset, dateTime])
|
|
2327
|
+
.describe('The time from which usage is measured, as a preset or an explicit timestamp.');
|
|
2328
|
+
export const getCreditBalanceParamsFilter = z
|
|
2193
2329
|
.object({
|
|
2194
|
-
|
|
2195
|
-
|
|
2330
|
+
currency: stringFieldFilterExact.optional(),
|
|
2331
|
+
featureKey: stringFieldFilter.optional(),
|
|
2196
2332
|
})
|
|
2197
|
-
.describe('
|
|
2333
|
+
.describe('Filter options for getting a credit balance.');
|
|
2334
|
+
export const listPlansParamsFilter = z
|
|
2335
|
+
.object({
|
|
2336
|
+
key: stringFieldFilter.optional(),
|
|
2337
|
+
name: stringFieldFilter.optional(),
|
|
2338
|
+
status: stringFieldFilterExact.optional(),
|
|
2339
|
+
currency: stringFieldFilterExact.optional(),
|
|
2340
|
+
})
|
|
2341
|
+
.describe('Filter options for listing plans.');
|
|
2342
|
+
export const createCreditGrantPlanFilter = z
|
|
2343
|
+
.object({
|
|
2344
|
+
key: resourceKey,
|
|
2345
|
+
version: createVersionFilter.optional(),
|
|
2346
|
+
})
|
|
2347
|
+
.describe('A plan key and an optional version constraint for matching credit grants.');
|
|
2198
2348
|
export const updateCreditGrantExternalSettlementRequest = z
|
|
2199
2349
|
.object({
|
|
2200
2350
|
status: creditPurchasePaymentSettlementStatus,
|
|
2201
2351
|
})
|
|
2202
2352
|
.describe('Request body for updating the external payment settlement status of a credit grant.');
|
|
2353
|
+
export const creditGrantPlanFilter = z
|
|
2354
|
+
.object({
|
|
2355
|
+
key: resourceKey,
|
|
2356
|
+
version: versionFilter.optional(),
|
|
2357
|
+
})
|
|
2358
|
+
.describe('A plan key and an optional version constraint for matching credit grants.');
|
|
2203
2359
|
export const listCreditGrantsParamsFilter = z
|
|
2204
2360
|
.object({
|
|
2205
2361
|
status: creditGrantStatus.optional(),
|
|
@@ -2226,20 +2382,6 @@ export const validationIssue = z
|
|
|
2226
2382
|
.describe('Component that reported the validation issue, if applicable.'),
|
|
2227
2383
|
})
|
|
2228
2384
|
.describe('A validation issue found while processing a billing resource.');
|
|
2229
|
-
export const getCreditBalanceParamsFilter = z
|
|
2230
|
-
.object({
|
|
2231
|
-
currency: stringFieldFilterExact.optional(),
|
|
2232
|
-
featureKey: stringFieldFilter.optional(),
|
|
2233
|
-
})
|
|
2234
|
-
.describe('Filter options for getting a credit balance.');
|
|
2235
|
-
export const listPlansParamsFilter = z
|
|
2236
|
-
.object({
|
|
2237
|
-
key: stringFieldFilter.optional(),
|
|
2238
|
-
name: stringFieldFilter.optional(),
|
|
2239
|
-
status: stringFieldFilterExact.optional(),
|
|
2240
|
-
currency: stringFieldFilterExact.optional(),
|
|
2241
|
-
})
|
|
2242
|
-
.describe('Filter options for listing plans.');
|
|
2243
2385
|
export const voidCreditGrantRequest = z
|
|
2244
2386
|
.object({
|
|
2245
2387
|
paymentAdjustment: creditGrantVoidPaymentAdjustment
|
|
@@ -2503,55 +2645,116 @@ export const entitlementAccessQueryError = z
|
|
|
2503
2645
|
.describe('The customer identifier from the request that produced this error.'),
|
|
2504
2646
|
})
|
|
2505
2647
|
.describe('Query error within a partially successful entitlement access query response.');
|
|
2506
|
-
export const
|
|
2507
|
-
.object({
|
|
2508
|
-
stripe: appCustomerDataStripe
|
|
2509
|
-
.nullable()
|
|
2510
|
-
.optional()
|
|
2511
|
-
.describe('Used if the customer has a linked Stripe app. Set to `null` to remove the Stripe data of the customer; omit to leave it unchanged.'),
|
|
2512
|
-
externalInvoicing: appCustomerDataExternalInvoicing
|
|
2513
|
-
.nullable()
|
|
2514
|
-
.optional()
|
|
2515
|
-
.describe('Used if the customer has a linked external invoicing app. Set to `null` to remove the external invoicing data of the customer; omit to leave it unchanged.'),
|
|
2516
|
-
})
|
|
2517
|
-
.describe('App customer data.');
|
|
2518
|
-
export const upsertAppCustomerDataRequest = z
|
|
2519
|
-
.object({
|
|
2520
|
-
stripe: appCustomerDataStripe
|
|
2521
|
-
.nullable()
|
|
2522
|
-
.optional()
|
|
2523
|
-
.describe('Used if the customer has a linked Stripe app. Set to `null` to remove the Stripe data of the customer; omit to leave it unchanged.'),
|
|
2524
|
-
externalInvoicing: appCustomerDataExternalInvoicing
|
|
2525
|
-
.nullable()
|
|
2526
|
-
.optional()
|
|
2527
|
-
.describe('Used if the customer has a linked external invoicing app. Set to `null` to remove the external invoicing data of the customer; omit to leave it unchanged.'),
|
|
2528
|
-
})
|
|
2529
|
-
.describe('AppCustomerData upsert request.');
|
|
2530
|
-
export const creditAdjustment = z
|
|
2648
|
+
export const notificationChannel = z
|
|
2531
2649
|
.object({
|
|
2650
|
+
id: ulid,
|
|
2532
2651
|
name: z
|
|
2533
2652
|
.string()
|
|
2534
2653
|
.min(1)
|
|
2535
2654
|
.max(256)
|
|
2536
2655
|
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2537
|
-
description: z
|
|
2538
|
-
.string()
|
|
2539
|
-
.max(1024)
|
|
2540
|
-
.optional()
|
|
2541
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
2542
2656
|
labels: labels.optional(),
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2657
|
+
createdAt: dateTime,
|
|
2658
|
+
updatedAt: dateTime,
|
|
2659
|
+
deletedAt: dateTime.optional(),
|
|
2660
|
+
type: notificationChannelType,
|
|
2661
|
+
disabled: z
|
|
2662
|
+
.boolean()
|
|
2663
|
+
.optional()
|
|
2664
|
+
.default(false)
|
|
2665
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
2666
|
+
url: z
|
|
2667
|
+
.string()
|
|
2668
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
2669
|
+
customHeaders: z
|
|
2670
|
+
.record(z.string(), z.string())
|
|
2671
|
+
.optional()
|
|
2672
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
2673
|
+
signingSecret: z
|
|
2674
|
+
.string()
|
|
2675
|
+
.optional()
|
|
2676
|
+
.describe('Secret used to sign outgoing webhook payloads so recipients can verify their authenticity. If omitted on create, a secret is generated automatically by the delivery provider. This is a sensitive credential returned in responses (unlike most secrets) specifically so clients can retrieve a server-generated value and verify webhook signatures; handle it with the same care as any other credential.'),
|
|
2677
|
+
})
|
|
2678
|
+
.describe('A notification channel delivers notification events, such as entitlement balance threshold crossings, to an external system. Today the only supported channel type is a webhook delivered via Svix.');
|
|
2679
|
+
export const createNotificationChannelRequest = z
|
|
2546
2680
|
.object({
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2681
|
+
name: z
|
|
2682
|
+
.string()
|
|
2683
|
+
.min(1)
|
|
2684
|
+
.max(256)
|
|
2685
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2686
|
+
labels: labels.optional(),
|
|
2687
|
+
type: notificationChannelType,
|
|
2688
|
+
disabled: z
|
|
2689
|
+
.boolean()
|
|
2690
|
+
.optional()
|
|
2691
|
+
.default(false)
|
|
2692
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
2693
|
+
url: z
|
|
2694
|
+
.string()
|
|
2695
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
2696
|
+
customHeaders: z
|
|
2697
|
+
.record(z.string(), z.string())
|
|
2698
|
+
.optional()
|
|
2699
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
2700
|
+
signingSecret: z
|
|
2701
|
+
.string()
|
|
2702
|
+
.optional()
|
|
2703
|
+
.describe('Secret used to sign outgoing webhook payloads so recipients can verify their authenticity. If omitted on create, a secret is generated automatically by the delivery provider. This is a sensitive credential returned in responses (unlike most secrets) specifically so clients can retrieve a server-generated value and verify webhook signatures; handle it with the same care as any other credential.'),
|
|
2552
2704
|
})
|
|
2553
|
-
.describe('
|
|
2554
|
-
export const
|
|
2705
|
+
.describe('NotificationChannel create request.');
|
|
2706
|
+
export const updateBillingNotificationChannelRequest = z
|
|
2707
|
+
.object({
|
|
2708
|
+
name: z
|
|
2709
|
+
.string()
|
|
2710
|
+
.min(1)
|
|
2711
|
+
.max(256)
|
|
2712
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2713
|
+
type: notificationChannelType,
|
|
2714
|
+
url: z
|
|
2715
|
+
.string()
|
|
2716
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
2717
|
+
labels: labels.optional(),
|
|
2718
|
+
disabled: z
|
|
2719
|
+
.boolean()
|
|
2720
|
+
.optional()
|
|
2721
|
+
.default(false)
|
|
2722
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
2723
|
+
customHeaders: z
|
|
2724
|
+
.record(z.string(), z.string())
|
|
2725
|
+
.optional()
|
|
2726
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
2727
|
+
signingSecret: z
|
|
2728
|
+
.string()
|
|
2729
|
+
.optional()
|
|
2730
|
+
.describe('Secret used to sign outgoing webhook payloads so recipients can verify their authenticity. If omitted on create, a secret is generated automatically by the delivery provider. This is a sensitive credential returned in responses (unlike most secrets) specifically so clients can retrieve a server-generated value and verify webhook signatures; handle it with the same care as any other credential.'),
|
|
2731
|
+
})
|
|
2732
|
+
.describe("Request body for updating a notification channel. Updates replace the channel's mutable state rather than merging it: `type`, `name`, and `url` must always be provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to their defaults (enabled, no labels, no custom headers). `signing_secret` is the one exception: omitting it keeps the channel's current signing secret instead of clearing the credential.");
|
|
2733
|
+
export const appCustomerData = z
|
|
2734
|
+
.object({
|
|
2735
|
+
stripe: appCustomerDataStripe
|
|
2736
|
+
.nullable()
|
|
2737
|
+
.optional()
|
|
2738
|
+
.describe('Used if the customer has a linked Stripe app. Set to `null` to remove the Stripe data of the customer; omit to leave it unchanged.'),
|
|
2739
|
+
externalInvoicing: appCustomerDataExternalInvoicing
|
|
2740
|
+
.nullable()
|
|
2741
|
+
.optional()
|
|
2742
|
+
.describe('Used if the customer has a linked external invoicing app. Set to `null` to remove the external invoicing data of the customer; omit to leave it unchanged.'),
|
|
2743
|
+
})
|
|
2744
|
+
.describe('App customer data.');
|
|
2745
|
+
export const upsertAppCustomerDataRequest = z
|
|
2746
|
+
.object({
|
|
2747
|
+
stripe: appCustomerDataStripe
|
|
2748
|
+
.nullable()
|
|
2749
|
+
.optional()
|
|
2750
|
+
.describe('Used if the customer has a linked Stripe app. Set to `null` to remove the Stripe data of the customer; omit to leave it unchanged.'),
|
|
2751
|
+
externalInvoicing: appCustomerDataExternalInvoicing
|
|
2752
|
+
.nullable()
|
|
2753
|
+
.optional()
|
|
2754
|
+
.describe('Used if the customer has a linked external invoicing app. Set to `null` to remove the external invoicing data of the customer; omit to leave it unchanged.'),
|
|
2755
|
+
})
|
|
2756
|
+
.describe('AppCustomerData upsert request.');
|
|
2757
|
+
export const creditAdjustment = z
|
|
2555
2758
|
.object({
|
|
2556
2759
|
name: z
|
|
2557
2760
|
.string()
|
|
@@ -2564,20 +2767,10 @@ export const createCreditAdjustmentRequest = z
|
|
|
2564
2767
|
.optional()
|
|
2565
2768
|
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
2566
2769
|
labels: labels.optional(),
|
|
2567
|
-
currency: billingCurrencyCode,
|
|
2568
|
-
amount: numeric,
|
|
2569
2770
|
})
|
|
2570
|
-
.describe('
|
|
2571
|
-
export const
|
|
2572
|
-
.object({
|
|
2573
|
-
type: creditTransactionType.optional(),
|
|
2574
|
-
currency: billingCurrencyCode.optional(),
|
|
2575
|
-
featureKey: stringFieldFilter.optional(),
|
|
2576
|
-
})
|
|
2577
|
-
.describe('Filter options for listing credit transactions.');
|
|
2578
|
-
export const creditTransaction = z
|
|
2771
|
+
.describe("A credit adjustment can be used to make manual adjustments to a customer's credit balance. Supported use-cases: - Usage correction");
|
|
2772
|
+
export const createCreditAdjustmentRequest = z
|
|
2579
2773
|
.object({
|
|
2580
|
-
id: ulid,
|
|
2581
2774
|
name: z
|
|
2582
2775
|
.string()
|
|
2583
2776
|
.min(1)
|
|
@@ -2589,27 +2782,24 @@ export const creditTransaction = z
|
|
|
2589
2782
|
.optional()
|
|
2590
2783
|
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
2591
2784
|
labels: labels.optional(),
|
|
2592
|
-
createdAt: dateTime,
|
|
2593
|
-
bookedAt: dateTime,
|
|
2594
|
-
type: creditTransactionType,
|
|
2595
2785
|
currency: billingCurrencyCode,
|
|
2596
|
-
customCurrencyId: ulid.optional(),
|
|
2597
2786
|
amount: numeric,
|
|
2598
|
-
availableBalance: z
|
|
2599
|
-
.object({
|
|
2600
|
-
before: numeric,
|
|
2601
|
-
after: numeric,
|
|
2602
|
-
})
|
|
2603
|
-
.describe('The available balance before and after the transaction.'),
|
|
2604
2787
|
})
|
|
2605
|
-
.describe(
|
|
2788
|
+
.describe('CreditAdjustment create request.');
|
|
2789
|
+
export const listCreditTransactionsParamsFilter = z
|
|
2790
|
+
.object({
|
|
2791
|
+
type: creditTransactionType.optional(),
|
|
2792
|
+
currency: billingCurrencyCode.optional(),
|
|
2793
|
+
featureKey: stringFieldFilter.optional(),
|
|
2794
|
+
})
|
|
2795
|
+
.describe('Filter options for listing credit transactions.');
|
|
2606
2796
|
export const currencyAmount = z
|
|
2607
2797
|
.object({
|
|
2608
2798
|
amount: numeric,
|
|
2609
2799
|
currency: billingCurrencyCode,
|
|
2610
2800
|
})
|
|
2611
2801
|
.describe('Monetary amount in a fiat or custom currency.');
|
|
2612
|
-
export const
|
|
2802
|
+
export const entitlementValueResult = z
|
|
2613
2803
|
.object({
|
|
2614
2804
|
type: entitlementType,
|
|
2615
2805
|
featureKey: resourceKey,
|
|
@@ -2622,7 +2812,21 @@ export const entitlementAccessResult = z
|
|
|
2622
2812
|
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
2623
2813
|
value: entitlementAccessValue.optional(),
|
|
2624
2814
|
})
|
|
2625
|
-
.describe('Entitlement
|
|
2815
|
+
.describe('Entitlement value result.');
|
|
2816
|
+
export const entitlementFeatureValueResult = z
|
|
2817
|
+
.object({
|
|
2818
|
+
featureKey: resourceKey,
|
|
2819
|
+
hasAccess: z
|
|
2820
|
+
.boolean()
|
|
2821
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
2822
|
+
config: z
|
|
2823
|
+
.string()
|
|
2824
|
+
.optional()
|
|
2825
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
2826
|
+
value: entitlementAccessValue.optional(),
|
|
2827
|
+
type: entitlementType.optional(),
|
|
2828
|
+
})
|
|
2829
|
+
.describe('Entitlement value looked up by feature key. A missing entitlement has no type and does not grant access.');
|
|
2626
2830
|
export const priceTier = z
|
|
2627
2831
|
.object({
|
|
2628
2832
|
upToAmount: numeric.optional(),
|
|
@@ -2707,6 +2911,27 @@ export const listCustomersParamsFilter = z
|
|
|
2707
2911
|
billingProfileId: ulidFieldFilter.optional(),
|
|
2708
2912
|
})
|
|
2709
2913
|
.describe('Filter options for listing customers.');
|
|
2914
|
+
export const listCustomerEntitlementsParamsFilter = z
|
|
2915
|
+
.object({
|
|
2916
|
+
featureId: ulidFieldFilter.optional(),
|
|
2917
|
+
featureKey: stringFieldFilterExact.optional(),
|
|
2918
|
+
type: stringFieldFilterExact.optional(),
|
|
2919
|
+
})
|
|
2920
|
+
.describe('Filter options for listing customer entitlements.');
|
|
2921
|
+
export const listEntitlementsParamsFilter = z
|
|
2922
|
+
.object({
|
|
2923
|
+
featureId: ulidFieldFilter.optional(),
|
|
2924
|
+
featureKey: stringFieldFilterExact.optional(),
|
|
2925
|
+
type: stringFieldFilterExact.optional(),
|
|
2926
|
+
customerId: ulidFieldFilter.optional(),
|
|
2927
|
+
})
|
|
2928
|
+
.describe('Filter options for listing entitlements.');
|
|
2929
|
+
export const listGrantsParamsFilter = z
|
|
2930
|
+
.object({
|
|
2931
|
+
customerId: ulidFieldFilter.optional(),
|
|
2932
|
+
featureId: ulidFieldFilter.optional(),
|
|
2933
|
+
})
|
|
2934
|
+
.describe('Filter options for listing grants.');
|
|
2710
2935
|
export const listSubscriptionsParamsFilter = z
|
|
2711
2936
|
.object({
|
|
2712
2937
|
id: ulidFieldFilter.optional(),
|
|
@@ -2763,12 +2988,12 @@ export const createChargeCostBasis = z
|
|
|
2763
2988
|
createChargeCostBasisManual,
|
|
2764
2989
|
])
|
|
2765
2990
|
.describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
|
|
2766
|
-
export const
|
|
2991
|
+
export const createTaxCodeConfig = z
|
|
2767
2992
|
.object({
|
|
2768
2993
|
behavior: taxBehavior.optional(),
|
|
2769
|
-
|
|
2994
|
+
code: createResourceReference.optional(),
|
|
2770
2995
|
})
|
|
2771
|
-
.describe('Tax configuration for a
|
|
2996
|
+
.describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
|
|
2772
2997
|
export const chargeCostBasis = z
|
|
2773
2998
|
.discriminatedUnion('type', [
|
|
2774
2999
|
chargeCostBasisDynamic,
|
|
@@ -2776,18 +3001,12 @@ export const chargeCostBasis = z
|
|
|
2776
3001
|
chargeCostBasisManual,
|
|
2777
3002
|
])
|
|
2778
3003
|
.describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
|
|
2779
|
-
export const
|
|
3004
|
+
export const taxCodeConfig = z
|
|
2780
3005
|
.object({
|
|
2781
3006
|
behavior: taxBehavior.optional(),
|
|
2782
|
-
|
|
3007
|
+
code: taxCodeReference.optional(),
|
|
2783
3008
|
})
|
|
2784
|
-
.describe('Tax configuration for a
|
|
2785
|
-
export const rateCardTaxConfig = z
|
|
2786
|
-
.object({
|
|
2787
|
-
behavior: taxBehavior.optional(),
|
|
2788
|
-
code: taxCodeReference,
|
|
2789
|
-
})
|
|
2790
|
-
.describe('The tax config of the rate card.');
|
|
3009
|
+
.describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
|
|
2791
3010
|
export const taxConfig = z
|
|
2792
3011
|
.object({
|
|
2793
3012
|
behavior: taxBehavior.optional(),
|
|
@@ -2811,6 +3030,43 @@ export const updateOrganizationDefaultTaxCodesRequest = z
|
|
|
2811
3030
|
creditGrantTaxCode: taxCodeReference.optional(),
|
|
2812
3031
|
})
|
|
2813
3032
|
.describe('OrganizationDefaultTaxCodes update request.');
|
|
3033
|
+
export const creditBalance = z
|
|
3034
|
+
.object({
|
|
3035
|
+
currency: billingCurrencyCode,
|
|
3036
|
+
customCurrency: currencyCustomReference.optional(),
|
|
3037
|
+
live: numeric,
|
|
3038
|
+
settled: numeric,
|
|
3039
|
+
pending: numeric,
|
|
3040
|
+
})
|
|
3041
|
+
.describe('The credit balance by currency.');
|
|
3042
|
+
export const creditTransaction = z
|
|
3043
|
+
.object({
|
|
3044
|
+
id: ulid,
|
|
3045
|
+
name: z
|
|
3046
|
+
.string()
|
|
3047
|
+
.min(1)
|
|
3048
|
+
.max(256)
|
|
3049
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3050
|
+
description: z
|
|
3051
|
+
.string()
|
|
3052
|
+
.max(1024)
|
|
3053
|
+
.optional()
|
|
3054
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3055
|
+
labels: labels.optional(),
|
|
3056
|
+
createdAt: dateTime,
|
|
3057
|
+
bookedAt: dateTime,
|
|
3058
|
+
type: creditTransactionType,
|
|
3059
|
+
currency: billingCurrencyCode,
|
|
3060
|
+
customCurrency: currencyCustomReference.optional(),
|
|
3061
|
+
amount: numeric,
|
|
3062
|
+
availableBalance: z
|
|
3063
|
+
.object({
|
|
3064
|
+
before: numeric,
|
|
3065
|
+
after: numeric,
|
|
3066
|
+
})
|
|
3067
|
+
.describe('The available balance before and after the transaction.'),
|
|
3068
|
+
})
|
|
3069
|
+
.describe("A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable.");
|
|
2814
3070
|
export const invoiceWorkflowAppsReferences = z
|
|
2815
3071
|
.object({
|
|
2816
3072
|
tax: appReference,
|
|
@@ -2879,12 +3135,12 @@ export const createPlanAddonRequest = z
|
|
|
2879
3135
|
.describe('The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased.'),
|
|
2880
3136
|
})
|
|
2881
3137
|
.describe('PlanAddon create request.');
|
|
2882
|
-
export const
|
|
3138
|
+
export const updateTaxCodeConfig = z
|
|
2883
3139
|
.object({
|
|
2884
3140
|
behavior: taxBehavior.optional(),
|
|
2885
|
-
code: updateResourceReference,
|
|
3141
|
+
code: updateResourceReference.optional(),
|
|
2886
3142
|
})
|
|
2887
|
-
.describe('
|
|
3143
|
+
.describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
|
|
2888
3144
|
export const listEventsParamsFilter = z
|
|
2889
3145
|
.object({
|
|
2890
3146
|
id: stringFieldFilter.optional(),
|
|
@@ -2925,6 +3181,16 @@ export const listChargesParamsFilter = z
|
|
|
2925
3181
|
customerId: ulidFieldFilter.optional(),
|
|
2926
3182
|
})
|
|
2927
3183
|
.describe('Filter options for listing charges across customers.');
|
|
3184
|
+
export const listNotificationChannelsParamsFilter = z
|
|
3185
|
+
.object({
|
|
3186
|
+
id: ulidFieldFilter.optional(),
|
|
3187
|
+
name: stringFieldFilter.optional(),
|
|
3188
|
+
type: stringFieldFilterExact.optional(),
|
|
3189
|
+
disabled: booleanFieldFilter.optional(),
|
|
3190
|
+
createdAt: dateTimeFieldFilter.optional(),
|
|
3191
|
+
updatedAt: dateTimeFieldFilter.optional(),
|
|
3192
|
+
})
|
|
3193
|
+
.describe('Filter options for listing notification channels.');
|
|
2928
3194
|
export const resourceFilters = z
|
|
2929
3195
|
.object({
|
|
2930
3196
|
name: stringFieldFilter.optional(),
|
|
@@ -2967,6 +3233,25 @@ export const meterQueryResult = z
|
|
|
2967
3233
|
.describe('The usage data. If no data is available, an empty array is returned.'),
|
|
2968
3234
|
})
|
|
2969
3235
|
.describe('Meter query result.');
|
|
3236
|
+
export const entitlementHistoryWindow = z
|
|
3237
|
+
.object({
|
|
3238
|
+
period: closedPeriod,
|
|
3239
|
+
usage: numeric,
|
|
3240
|
+
balanceAtStart: numeric,
|
|
3241
|
+
})
|
|
3242
|
+
.describe('Usage and balance of a single history window.');
|
|
3243
|
+
export const entitlementBurndownSegment = z
|
|
3244
|
+
.object({
|
|
3245
|
+
period: closedPeriod,
|
|
3246
|
+
usage: numeric,
|
|
3247
|
+
overage: numeric,
|
|
3248
|
+
balance: entitlementBurndownBalance,
|
|
3249
|
+
grantBalances: entitlementBurndownGrantBalances,
|
|
3250
|
+
grantUsages: z
|
|
3251
|
+
.array(entitlementGrantUsage)
|
|
3252
|
+
.describe('The grants consumed in the segment and the usage taken from each.'),
|
|
3253
|
+
})
|
|
3254
|
+
.describe('A period in which grants were consumed in a fixed order.');
|
|
2970
3255
|
export const chargeRealizationDetailedLineFlatFee = z
|
|
2971
3256
|
.object({
|
|
2972
3257
|
id: ulid,
|
|
@@ -3214,6 +3499,148 @@ export const appStripeCreateCheckoutSessionConsentCollection = z
|
|
|
3214
3499
|
termsOfService: appStripeCreateCheckoutSessionConsentCollectionTermsOfService.optional(),
|
|
3215
3500
|
})
|
|
3216
3501
|
.describe('Checkout Session consent collection configuration.');
|
|
3502
|
+
export const entitlementGrantCreateRequest = z
|
|
3503
|
+
.object({
|
|
3504
|
+
amount: numeric,
|
|
3505
|
+
priority: z
|
|
3506
|
+
.number()
|
|
3507
|
+
.int()
|
|
3508
|
+
.gte(1)
|
|
3509
|
+
.lte(255)
|
|
3510
|
+
.optional()
|
|
3511
|
+
.describe('The priority of the grant. Lower values have higher priority. Grants are consumed in priority order, then by closest expiration, then by earliest creation.'),
|
|
3512
|
+
effectiveAt: dateTime,
|
|
3513
|
+
expiresAfter: iso8601Duration.optional(),
|
|
3514
|
+
maxRolloverAmount: numeric.optional(),
|
|
3515
|
+
minRolloverAmount: numeric.optional(),
|
|
3516
|
+
labels: labels.optional(),
|
|
3517
|
+
recurrence: recurringPeriodInput.optional(),
|
|
3518
|
+
})
|
|
3519
|
+
.describe('A grant to issue for a metered entitlement.');
|
|
3520
|
+
export const createEntitlementStaticRequest = z
|
|
3521
|
+
.object({
|
|
3522
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
3523
|
+
feature: featureReference,
|
|
3524
|
+
labels: labels.optional(),
|
|
3525
|
+
config: z
|
|
3526
|
+
.unknown()
|
|
3527
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
3528
|
+
usagePeriod: recurringPeriodInput.optional(),
|
|
3529
|
+
})
|
|
3530
|
+
.describe('Static entitlement create request.');
|
|
3531
|
+
export const createEntitlementBooleanRequest = z
|
|
3532
|
+
.object({
|
|
3533
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
3534
|
+
feature: featureReference,
|
|
3535
|
+
labels: labels.optional(),
|
|
3536
|
+
usagePeriod: recurringPeriodInput.optional(),
|
|
3537
|
+
})
|
|
3538
|
+
.describe('Boolean entitlement create request.');
|
|
3539
|
+
export const entitlementMetered = z
|
|
3540
|
+
.object({
|
|
3541
|
+
id: ulid,
|
|
3542
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
3543
|
+
feature: featureReference,
|
|
3544
|
+
customer: customerReference,
|
|
3545
|
+
labels: labels.optional(),
|
|
3546
|
+
activeFrom: dateTime,
|
|
3547
|
+
activeTo: dateTime.optional(),
|
|
3548
|
+
createdAt: dateTime,
|
|
3549
|
+
updatedAt: dateTime,
|
|
3550
|
+
deletedAt: dateTime.optional(),
|
|
3551
|
+
usagePeriod: recurringPeriod,
|
|
3552
|
+
currentUsagePeriod: closedPeriod,
|
|
3553
|
+
isSoftLimit: z
|
|
3554
|
+
.boolean()
|
|
3555
|
+
.optional()
|
|
3556
|
+
.default(false)
|
|
3557
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
3558
|
+
issue: entitlementIssueAfterReset.optional(),
|
|
3559
|
+
issueAfterReset: numeric.optional(),
|
|
3560
|
+
issueAfterResetPriority: z
|
|
3561
|
+
.number()
|
|
3562
|
+
.int()
|
|
3563
|
+
.gte(1)
|
|
3564
|
+
.lte(255)
|
|
3565
|
+
.optional()
|
|
3566
|
+
.default(1)
|
|
3567
|
+
.describe('The priority of the grant created after each reset.'),
|
|
3568
|
+
preserveOverageAtReset: z
|
|
3569
|
+
.boolean()
|
|
3570
|
+
.optional()
|
|
3571
|
+
.default(false)
|
|
3572
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
3573
|
+
measureUsageFrom: dateTime,
|
|
3574
|
+
lastReset: dateTime,
|
|
3575
|
+
})
|
|
3576
|
+
.describe('A metered entitlement grants a usage allowance for a feature. Access is determined by the balance: the allowance provided by grants is burnt down by usage.');
|
|
3577
|
+
export const entitlementStatic = z
|
|
3578
|
+
.object({
|
|
3579
|
+
id: ulid,
|
|
3580
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
3581
|
+
feature: featureReference,
|
|
3582
|
+
customer: customerReference,
|
|
3583
|
+
labels: labels.optional(),
|
|
3584
|
+
usagePeriod: recurringPeriod.optional(),
|
|
3585
|
+
currentUsagePeriod: closedPeriod.optional(),
|
|
3586
|
+
activeFrom: dateTime,
|
|
3587
|
+
activeTo: dateTime.optional(),
|
|
3588
|
+
createdAt: dateTime,
|
|
3589
|
+
updatedAt: dateTime,
|
|
3590
|
+
deletedAt: dateTime.optional(),
|
|
3591
|
+
config: z
|
|
3592
|
+
.unknown()
|
|
3593
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
3594
|
+
})
|
|
3595
|
+
.describe('A static entitlement grants access to a feature together with a configuration.');
|
|
3596
|
+
export const entitlementBoolean = z
|
|
3597
|
+
.object({
|
|
3598
|
+
id: ulid,
|
|
3599
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
3600
|
+
feature: featureReference,
|
|
3601
|
+
customer: customerReference,
|
|
3602
|
+
labels: labels.optional(),
|
|
3603
|
+
usagePeriod: recurringPeriod.optional(),
|
|
3604
|
+
currentUsagePeriod: closedPeriod.optional(),
|
|
3605
|
+
activeFrom: dateTime,
|
|
3606
|
+
activeTo: dateTime.optional(),
|
|
3607
|
+
createdAt: dateTime,
|
|
3608
|
+
updatedAt: dateTime,
|
|
3609
|
+
deletedAt: dateTime.optional(),
|
|
3610
|
+
})
|
|
3611
|
+
.describe('A boolean entitlement grants access to a feature.');
|
|
3612
|
+
export const entitlementGrant = z
|
|
3613
|
+
.object({
|
|
3614
|
+
id: ulid,
|
|
3615
|
+
entitlementId: ulid,
|
|
3616
|
+
customerId: ulid.optional(),
|
|
3617
|
+
amount: numeric,
|
|
3618
|
+
priority: z
|
|
3619
|
+
.number()
|
|
3620
|
+
.int()
|
|
3621
|
+
.nonnegative()
|
|
3622
|
+
.lte(255)
|
|
3623
|
+
.describe('The priority of the grant. Lower values are consumed first: a grant with priority 1 is consumed before one with priority 2. Among equal priorities, the grant closest to expiration is consumed first, then the earliest created.'),
|
|
3624
|
+
effectiveAt: dateTime,
|
|
3625
|
+
expiresAfter: iso8601Duration.optional(),
|
|
3626
|
+
expiresAt: dateTime.optional(),
|
|
3627
|
+
maxRolloverAmount: numeric,
|
|
3628
|
+
minRolloverAmount: numeric,
|
|
3629
|
+
recurrence: recurringPeriod.optional(),
|
|
3630
|
+
nextRecurrence: dateTime.optional(),
|
|
3631
|
+
voidedAt: dateTime.optional(),
|
|
3632
|
+
labels: labels.optional(),
|
|
3633
|
+
createdAt: dateTime,
|
|
3634
|
+
updatedAt: dateTime,
|
|
3635
|
+
deletedAt: dateTime.optional(),
|
|
3636
|
+
})
|
|
3637
|
+
.describe("A grant issued for a metered entitlement. Each grant adds its amount to the entitlement's balance from its effective time until it expires, and usage is deducted from the grants in priority order. Grants are immutable, so the balance is deterministic regardless of when it is queried. Deleting a grant ends it at the time of the deletion.");
|
|
3638
|
+
export const workflowCollectionAlignmentAnchored = z
|
|
3639
|
+
.object({
|
|
3640
|
+
type: z.literal('anchored').describe('The type of alignment.'),
|
|
3641
|
+
recurringPeriod: recurringPeriod,
|
|
3642
|
+
})
|
|
3643
|
+
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
3217
3644
|
export const rateCardEntitlement = z
|
|
3218
3645
|
.discriminatedUnion('type', [
|
|
3219
3646
|
rateCardMeteredEntitlement,
|
|
@@ -3229,12 +3656,30 @@ export const subscriptionEditAddPhase = z
|
|
|
3229
3656
|
phase: subscriptionPhaseCreate,
|
|
3230
3657
|
})
|
|
3231
3658
|
.describe('Add a new phase to the subscription. The phase is created without items; use add-item operations to populate it.');
|
|
3232
|
-
export const
|
|
3659
|
+
export const createCreditGrantFilters = z
|
|
3233
3660
|
.object({
|
|
3234
|
-
|
|
3235
|
-
|
|
3661
|
+
features: z
|
|
3662
|
+
.array(resourceKey)
|
|
3663
|
+
.optional()
|
|
3664
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
3665
|
+
plans: z
|
|
3666
|
+
.array(createCreditGrantPlanFilter)
|
|
3667
|
+
.optional()
|
|
3668
|
+
.describe('Limit credits to charges from these plans. Entries are alternatives; when features are also specified, both dimensions must match. Omission or an empty list leaves plans unrestricted.'),
|
|
3236
3669
|
})
|
|
3237
|
-
.describe('
|
|
3670
|
+
.describe('Filters for the credit grant.');
|
|
3671
|
+
export const creditGrantFilters = z
|
|
3672
|
+
.object({
|
|
3673
|
+
features: z
|
|
3674
|
+
.array(resourceKey)
|
|
3675
|
+
.optional()
|
|
3676
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
3677
|
+
plans: z
|
|
3678
|
+
.array(creditGrantPlanFilter)
|
|
3679
|
+
.optional()
|
|
3680
|
+
.describe('Limit credits to charges from these plans. Entries are alternatives; when features are also specified, both dimensions must match. Omission or an empty list leaves plans unrestricted.'),
|
|
3681
|
+
})
|
|
3682
|
+
.describe('Filters for the credit grant.');
|
|
3238
3683
|
export const subscriptionBase = z
|
|
3239
3684
|
.object({
|
|
3240
3685
|
id: ulid,
|
|
@@ -3435,6 +3880,12 @@ export const entitlementFeatureAccess = z
|
|
|
3435
3880
|
reason: entitlementFeatureAccessReason.optional(),
|
|
3436
3881
|
})
|
|
3437
3882
|
.describe('Access status for a single feature.');
|
|
3883
|
+
export const notificationChannelPagePaginatedResponse = z
|
|
3884
|
+
.object({
|
|
3885
|
+
data: z.array(notificationChannel),
|
|
3886
|
+
meta: paginatedMeta,
|
|
3887
|
+
})
|
|
3888
|
+
.describe('Page paginated response.');
|
|
3438
3889
|
export const customerData = z
|
|
3439
3890
|
.object({
|
|
3440
3891
|
billingProfile: profileReference.optional(),
|
|
@@ -3447,18 +3898,6 @@ export const upsertCustomerBillingDataRequest = z
|
|
|
3447
3898
|
appData: appCustomerData.optional(),
|
|
3448
3899
|
})
|
|
3449
3900
|
.describe('CustomerBillingData upsert request.');
|
|
3450
|
-
export const creditBalances = z
|
|
3451
|
-
.object({
|
|
3452
|
-
retrievedAt: dateTime,
|
|
3453
|
-
balances: z.array(creditBalance).describe('The balances by currencies.'),
|
|
3454
|
-
})
|
|
3455
|
-
.describe('The balances of the credits of a customer.');
|
|
3456
|
-
export const creditTransactionPaginatedResponse = z
|
|
3457
|
-
.object({
|
|
3458
|
-
data: z.array(creditTransaction),
|
|
3459
|
-
meta: cursorMeta,
|
|
3460
|
-
})
|
|
3461
|
-
.describe('Cursor paginated response.');
|
|
3462
3901
|
export const chargeFlatFeeSystemIntent = z
|
|
3463
3902
|
.object({
|
|
3464
3903
|
name: z
|
|
@@ -3486,7 +3925,7 @@ export const chargeFlatFeeSystemIntent = z
|
|
|
3486
3925
|
export const listCustomerEntitlementAccessResponseData = z
|
|
3487
3926
|
.object({
|
|
3488
3927
|
data: z
|
|
3489
|
-
.array(
|
|
3928
|
+
.array(entitlementValueResult)
|
|
3490
3929
|
.describe('The list of entitlement access results.'),
|
|
3491
3930
|
})
|
|
3492
3931
|
.describe('List customer entitlement access response data.');
|
|
@@ -3605,6 +4044,18 @@ export const workflowTaxSettings = z
|
|
|
3605
4044
|
defaultTaxConfig: taxConfig.optional(),
|
|
3606
4045
|
})
|
|
3607
4046
|
.describe('Tax settings for a billing workflow.');
|
|
4047
|
+
export const creditBalances = z
|
|
4048
|
+
.object({
|
|
4049
|
+
retrievedAt: dateTime,
|
|
4050
|
+
balances: z.array(creditBalance).describe('The balances by currencies.'),
|
|
4051
|
+
})
|
|
4052
|
+
.describe('The balances of the credits of a customer.');
|
|
4053
|
+
export const creditTransactionPaginatedResponse = z
|
|
4054
|
+
.object({
|
|
4055
|
+
data: z.array(creditTransaction),
|
|
4056
|
+
meta: cursorMeta,
|
|
4057
|
+
})
|
|
4058
|
+
.describe('Cursor paginated response.');
|
|
3608
4059
|
export const planAddonPagePaginatedResponse = z
|
|
3609
4060
|
.object({
|
|
3610
4061
|
data: z.array(planAddon),
|
|
@@ -3617,6 +4068,16 @@ export const ingestedEventPaginatedResponse = z
|
|
|
3617
4068
|
meta: cursorMeta,
|
|
3618
4069
|
})
|
|
3619
4070
|
.describe('Cursor paginated response.');
|
|
4071
|
+
export const entitlementHistory = z
|
|
4072
|
+
.object({
|
|
4073
|
+
windowedHistory: z
|
|
4074
|
+
.array(entitlementHistoryWindow)
|
|
4075
|
+
.describe('Usage in half-open windows of the requested size, aligned to the requested time zone. Empty windows are included; windows before usage measurement began are omitted.'),
|
|
4076
|
+
burndownHistory: z
|
|
4077
|
+
.array(entitlementBurndownSegment)
|
|
4078
|
+
.describe('Periods in which grants were consumed in a fixed order. A new segment starts whenever grant priorities change or a usage period starts.'),
|
|
4079
|
+
})
|
|
4080
|
+
.describe('Balance and usage history of a metered entitlement.');
|
|
3620
4081
|
export const chargeRealizationDetailedLine = z
|
|
3621
4082
|
.discriminatedUnion('type', [
|
|
3622
4083
|
chargeRealizationDetailedLineFlatFee,
|
|
@@ -3739,6 +4200,52 @@ export const appStripeCreateCheckoutSessionRequestOptions = z
|
|
|
3739
4200
|
taxIdCollection: appStripeCreateCheckoutSessionTaxIdCollection.optional(),
|
|
3740
4201
|
})
|
|
3741
4202
|
.describe("Configuration options for creating a Stripe Checkout Session. Based on Stripe's [Checkout Session API parameters](https://docs.stripe.com/api/checkout/sessions/create).");
|
|
4203
|
+
export const createEntitlementMeteredRequest = z
|
|
4204
|
+
.object({
|
|
4205
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
4206
|
+
feature: featureReference,
|
|
4207
|
+
labels: labels.optional(),
|
|
4208
|
+
isSoftLimit: z
|
|
4209
|
+
.boolean()
|
|
4210
|
+
.optional()
|
|
4211
|
+
.default(false)
|
|
4212
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
4213
|
+
issue: entitlementIssueAfterReset.optional(),
|
|
4214
|
+
issueAfterReset: numeric.optional(),
|
|
4215
|
+
issueAfterResetPriority: z
|
|
4216
|
+
.number()
|
|
4217
|
+
.int()
|
|
4218
|
+
.gte(1)
|
|
4219
|
+
.lte(255)
|
|
4220
|
+
.optional()
|
|
4221
|
+
.default(1)
|
|
4222
|
+
.describe('The priority of the grant created after each reset.'),
|
|
4223
|
+
preserveOverageAtReset: z
|
|
4224
|
+
.boolean()
|
|
4225
|
+
.optional()
|
|
4226
|
+
.default(false)
|
|
4227
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
4228
|
+
usagePeriod: recurringPeriodInput,
|
|
4229
|
+
measureUsageFrom: entitlementMeasureUsageFrom.optional(),
|
|
4230
|
+
grants: z
|
|
4231
|
+
.array(entitlementGrantCreateRequest)
|
|
4232
|
+
.optional()
|
|
4233
|
+
.describe('Grants created together with the entitlement. Cannot be combined with `issue`.'),
|
|
4234
|
+
})
|
|
4235
|
+
.describe('Metered entitlement create request.');
|
|
4236
|
+
export const entitlement = z
|
|
4237
|
+
.discriminatedUnion('type', [
|
|
4238
|
+
entitlementMetered,
|
|
4239
|
+
entitlementStatic,
|
|
4240
|
+
entitlementBoolean,
|
|
4241
|
+
])
|
|
4242
|
+
.describe('An entitlement grants a customer access to a feature.');
|
|
4243
|
+
export const entitlementGrantPagePaginatedResponse = z
|
|
4244
|
+
.object({
|
|
4245
|
+
data: z.array(entitlementGrant),
|
|
4246
|
+
meta: paginatedMeta,
|
|
4247
|
+
})
|
|
4248
|
+
.describe('Page paginated response.');
|
|
3742
4249
|
export const workflowCollectionAlignment = z
|
|
3743
4250
|
.discriminatedUnion('type', [
|
|
3744
4251
|
workflowCollectionAlignmentSubscription,
|
|
@@ -4068,7 +4575,7 @@ export const createCreditGrantRequest = z
|
|
|
4068
4575
|
currency: createCurrencyCode,
|
|
4069
4576
|
amount: numeric,
|
|
4070
4577
|
purchase: createCreditGrantPurchase.optional(),
|
|
4071
|
-
taxConfig:
|
|
4578
|
+
taxConfig: createTaxCodeConfig.optional(),
|
|
4072
4579
|
filters: createCreditGrantFilters.optional(),
|
|
4073
4580
|
priority: z
|
|
4074
4581
|
.number()
|
|
@@ -4104,7 +4611,7 @@ export const creditGrant = z
|
|
|
4104
4611
|
currency: billingCurrencyCode,
|
|
4105
4612
|
amount: numeric,
|
|
4106
4613
|
purchase: creditGrantPurchase.optional(),
|
|
4107
|
-
taxConfig:
|
|
4614
|
+
taxConfig: taxCodeConfig.optional(),
|
|
4108
4615
|
invoice: creditGrantInvoiceReference.optional(),
|
|
4109
4616
|
filters: creditGrantFilters.optional(),
|
|
4110
4617
|
priority: z
|
|
@@ -4167,6 +4674,19 @@ export const customerStripeCreateCheckoutSessionRequest = z
|
|
|
4167
4674
|
stripeOptions: appStripeCreateCheckoutSessionRequestOptions,
|
|
4168
4675
|
})
|
|
4169
4676
|
.describe('Request to create a Stripe Checkout Session for the customer. Checkout Sessions are used to collect payment method information from customers in a secure, Stripe-hosted interface. This integration uses setup mode to collect payment methods that can be charged later for subscription billing.');
|
|
4677
|
+
export const createEntitlementRequest = z
|
|
4678
|
+
.discriminatedUnion('type', [
|
|
4679
|
+
createEntitlementMeteredRequest,
|
|
4680
|
+
createEntitlementStaticRequest,
|
|
4681
|
+
createEntitlementBooleanRequest,
|
|
4682
|
+
])
|
|
4683
|
+
.describe('Entitlement create request.');
|
|
4684
|
+
export const entitlementPagePaginatedResponse = z
|
|
4685
|
+
.object({
|
|
4686
|
+
data: z.array(entitlement),
|
|
4687
|
+
meta: paginatedMeta,
|
|
4688
|
+
})
|
|
4689
|
+
.describe('Page paginated response.');
|
|
4170
4690
|
export const workflowCollectionSettings = z
|
|
4171
4691
|
.object({
|
|
4172
4692
|
alignment: workflowCollectionAlignment.optional().default({
|
|
@@ -4258,14 +4778,14 @@ export const rateCard = z
|
|
|
4258
4778
|
paymentTerm: pricePaymentTerm.optional().default('in_arrears'),
|
|
4259
4779
|
commitments: spendCommitments.optional(),
|
|
4260
4780
|
discounts: rateCardDiscounts.optional(),
|
|
4261
|
-
taxConfig:
|
|
4781
|
+
taxConfig: taxCodeConfig.optional(),
|
|
4262
4782
|
entitlement: rateCardEntitlement.optional(),
|
|
4263
4783
|
})
|
|
4264
4784
|
.describe('A rate card defines the pricing and entitlement of a feature or service.');
|
|
4265
4785
|
export const invoiceLineRateCard = z
|
|
4266
4786
|
.object({
|
|
4267
4787
|
price: price,
|
|
4268
|
-
taxConfig:
|
|
4788
|
+
taxConfig: taxCodeConfig.optional(),
|
|
4269
4789
|
featureKey: resourceKey.optional(),
|
|
4270
4790
|
discounts: rateCardDiscounts.optional(),
|
|
4271
4791
|
unitConfig: unitConfig.optional(),
|
|
@@ -4340,7 +4860,7 @@ export const featurePagePaginatedResponse = z
|
|
|
4340
4860
|
export const updateInvoiceLineRateCard = z
|
|
4341
4861
|
.object({
|
|
4342
4862
|
price: updatePrice,
|
|
4343
|
-
taxConfig:
|
|
4863
|
+
taxConfig: updateTaxCodeConfig.optional(),
|
|
4344
4864
|
featureKey: resourceKey.optional(),
|
|
4345
4865
|
discounts: updateDiscounts.optional(),
|
|
4346
4866
|
})
|
|
@@ -5285,23 +5805,187 @@ export const createCustomerStripeCheckoutSessionResponse = appStripeCreateChecko
|
|
|
5285
5805
|
export const createCustomerStripePortalSessionPathParams = z.object({
|
|
5286
5806
|
customerId: ulid,
|
|
5287
5807
|
});
|
|
5288
|
-
export const createCustomerStripePortalSessionBody = customerStripeCreateCustomerPortalSessionRequest;
|
|
5289
|
-
export const createCustomerStripePortalSessionResponse = appStripeCreateCustomerPortalSessionResult;
|
|
5290
|
-
export const listCustomerEntitlementAccessPathParams = z.object({
|
|
5291
|
-
customerId: ulid,
|
|
5808
|
+
export const createCustomerStripePortalSessionBody = customerStripeCreateCustomerPortalSessionRequest;
|
|
5809
|
+
export const createCustomerStripePortalSessionResponse = appStripeCreateCustomerPortalSessionResult;
|
|
5810
|
+
export const listCustomerEntitlementAccessPathParams = z.object({
|
|
5811
|
+
customerId: ulid,
|
|
5812
|
+
});
|
|
5813
|
+
export const listCustomerEntitlementAccessResponse = listCustomerEntitlementAccessResponseData;
|
|
5814
|
+
export const getCustomerEntitlementAccessPathParams = z.object({
|
|
5815
|
+
customerId: ulid,
|
|
5816
|
+
featureKey: resourceKey,
|
|
5817
|
+
});
|
|
5818
|
+
export const getCustomerEntitlementAccessResponse = entitlementAccessCheckResult;
|
|
5819
|
+
export const getCustomerEntitlementValueByFeatureKeyPathParams = z.object({
|
|
5820
|
+
customerId: ulid,
|
|
5821
|
+
featureKey: resourceKey,
|
|
5822
|
+
});
|
|
5823
|
+
export const getCustomerEntitlementValueByFeatureKeyQueryParams = z.object({
|
|
5824
|
+
expand: z
|
|
5825
|
+
.array(entitlementAccessExpand)
|
|
5826
|
+
.optional()
|
|
5827
|
+
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
5828
|
+
at: dateTime.optional(),
|
|
5829
|
+
});
|
|
5830
|
+
export const getCustomerEntitlementValueByFeatureKeyResponse = entitlementFeatureValueResult;
|
|
5831
|
+
export const createCustomerEntitlementPathParams = z.object({
|
|
5832
|
+
customerId: ulid,
|
|
5833
|
+
});
|
|
5834
|
+
export const createCustomerEntitlementBody = createEntitlementRequest;
|
|
5835
|
+
export const createCustomerEntitlementResponse = entitlement;
|
|
5836
|
+
export const overrideCustomerEntitlementPathParams = z.object({
|
|
5837
|
+
customerId: ulid,
|
|
5838
|
+
entitlementId: ulid,
|
|
5839
|
+
});
|
|
5840
|
+
export const overrideCustomerEntitlementBody = createEntitlementRequest;
|
|
5841
|
+
export const overrideCustomerEntitlementResponse = entitlement;
|
|
5842
|
+
export const getCustomerEntitlementHistoryPathParams = z.object({
|
|
5843
|
+
customerId: ulid,
|
|
5844
|
+
entitlementId: ulid,
|
|
5845
|
+
});
|
|
5846
|
+
export const getCustomerEntitlementHistoryQueryParams = z.object({
|
|
5847
|
+
from: dateTime.optional(),
|
|
5848
|
+
to: dateTime.optional(),
|
|
5849
|
+
windowSize: entitlementHistoryWindowSize,
|
|
5850
|
+
timeZone: z.coerce
|
|
5851
|
+
.string()
|
|
5852
|
+
.optional()
|
|
5853
|
+
.default('UTC')
|
|
5854
|
+
.describe('The IANA time zone the windows are aligned to.'),
|
|
5855
|
+
});
|
|
5856
|
+
export const getCustomerEntitlementHistoryResponse = entitlementHistory;
|
|
5857
|
+
export const getCustomerEntitlementPathParams = z.object({
|
|
5858
|
+
customerId: ulid,
|
|
5859
|
+
entitlementId: ulid,
|
|
5860
|
+
});
|
|
5861
|
+
export const getCustomerEntitlementResponse = entitlement;
|
|
5862
|
+
export const listCustomerEntitlementsPathParams = z.object({
|
|
5863
|
+
customerId: ulid,
|
|
5864
|
+
});
|
|
5865
|
+
export const listCustomerEntitlementsQueryParams = z.object({
|
|
5866
|
+
page: z
|
|
5867
|
+
.object({
|
|
5868
|
+
size: z.coerce
|
|
5869
|
+
.number()
|
|
5870
|
+
.int()
|
|
5871
|
+
.optional()
|
|
5872
|
+
.describe('The number of items to include per page.'),
|
|
5873
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5874
|
+
})
|
|
5875
|
+
.optional()
|
|
5876
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5877
|
+
sort: sortQuery.optional(),
|
|
5878
|
+
filter: listCustomerEntitlementsParamsFilter.optional(),
|
|
5879
|
+
});
|
|
5880
|
+
export const listCustomerEntitlementsResponse = z.object({
|
|
5881
|
+
data: z.array(entitlement),
|
|
5882
|
+
meta: paginatedMeta,
|
|
5883
|
+
});
|
|
5884
|
+
export const resetCustomerEntitlementUsagePathParams = z.object({
|
|
5885
|
+
customerId: ulid,
|
|
5886
|
+
entitlementId: ulid,
|
|
5887
|
+
});
|
|
5888
|
+
export const resetCustomerEntitlementUsageBody = resetCustomerEntitlementUsageRequest;
|
|
5889
|
+
export const deleteCustomerEntitlementPathParams = z.object({
|
|
5890
|
+
customerId: ulid,
|
|
5891
|
+
entitlementId: ulid,
|
|
5892
|
+
});
|
|
5893
|
+
export const listEntitlementsQueryParams = z.object({
|
|
5894
|
+
page: z
|
|
5895
|
+
.object({
|
|
5896
|
+
size: z.coerce
|
|
5897
|
+
.number()
|
|
5898
|
+
.int()
|
|
5899
|
+
.optional()
|
|
5900
|
+
.describe('The number of items to include per page.'),
|
|
5901
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5902
|
+
})
|
|
5903
|
+
.optional()
|
|
5904
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5905
|
+
sort: sortQuery.optional(),
|
|
5906
|
+
filter: listEntitlementsParamsFilter.optional(),
|
|
5907
|
+
});
|
|
5908
|
+
export const listEntitlementsResponse = z.object({
|
|
5909
|
+
data: z.array(entitlement),
|
|
5910
|
+
meta: paginatedMeta,
|
|
5911
|
+
});
|
|
5912
|
+
export const getEntitlementPathParams = z.object({
|
|
5913
|
+
entitlementId: ulid,
|
|
5914
|
+
});
|
|
5915
|
+
export const getEntitlementResponse = entitlement;
|
|
5916
|
+
export const createCustomerEntitlementGrantPathParams = z.object({
|
|
5917
|
+
customerId: ulid,
|
|
5918
|
+
entitlementId: ulid,
|
|
5919
|
+
});
|
|
5920
|
+
export const createCustomerEntitlementGrantBody = entitlementGrantCreateRequest;
|
|
5921
|
+
export const createCustomerEntitlementGrantResponse = entitlementGrant;
|
|
5922
|
+
export const listCustomerEntitlementGrantsPathParams = z.object({
|
|
5923
|
+
customerId: ulid,
|
|
5924
|
+
entitlementId: ulid,
|
|
5925
|
+
});
|
|
5926
|
+
export const listCustomerEntitlementGrantsQueryParams = z.object({
|
|
5927
|
+
page: z
|
|
5928
|
+
.object({
|
|
5929
|
+
size: z.coerce
|
|
5930
|
+
.number()
|
|
5931
|
+
.int()
|
|
5932
|
+
.optional()
|
|
5933
|
+
.describe('The number of items to include per page.'),
|
|
5934
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5935
|
+
})
|
|
5936
|
+
.optional()
|
|
5937
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5938
|
+
sort: sortQuery.optional(),
|
|
5939
|
+
includeDeleted: z.coerce
|
|
5940
|
+
.boolean()
|
|
5941
|
+
.optional()
|
|
5942
|
+
.describe('Include deleted grants in the response.'),
|
|
5943
|
+
});
|
|
5944
|
+
export const listCustomerEntitlementGrantsResponse = z.object({
|
|
5945
|
+
data: z.array(entitlementGrant),
|
|
5946
|
+
meta: paginatedMeta,
|
|
5292
5947
|
});
|
|
5293
|
-
export const
|
|
5294
|
-
export const getCustomerEntitlementAccessPathParams = z.object({
|
|
5948
|
+
export const getCustomerEntitlementValuePathParams = z.object({
|
|
5295
5949
|
customerId: ulid,
|
|
5296
|
-
|
|
5950
|
+
entitlementId: ulid,
|
|
5297
5951
|
});
|
|
5298
|
-
export const
|
|
5952
|
+
export const getCustomerEntitlementValueQueryParams = z.object({
|
|
5299
5953
|
expand: z
|
|
5300
5954
|
.array(entitlementAccessExpand)
|
|
5301
5955
|
.optional()
|
|
5302
5956
|
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
5957
|
+
at: dateTime.optional(),
|
|
5958
|
+
});
|
|
5959
|
+
export const getCustomerEntitlementValueResponse = entitlementValueResult;
|
|
5960
|
+
export const listGrantsQueryParams = z.object({
|
|
5961
|
+
page: z
|
|
5962
|
+
.object({
|
|
5963
|
+
size: z.coerce
|
|
5964
|
+
.number()
|
|
5965
|
+
.int()
|
|
5966
|
+
.optional()
|
|
5967
|
+
.describe('The number of items to include per page.'),
|
|
5968
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5969
|
+
})
|
|
5970
|
+
.optional()
|
|
5971
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5972
|
+
sort: sortQuery.optional(),
|
|
5973
|
+
filter: listGrantsParamsFilter.optional(),
|
|
5974
|
+
includeDeleted: z.coerce
|
|
5975
|
+
.boolean()
|
|
5976
|
+
.optional()
|
|
5977
|
+
.describe('Include deleted grants in the response.'),
|
|
5978
|
+
});
|
|
5979
|
+
export const listGrantsResponse = z.object({
|
|
5980
|
+
data: z.array(entitlementGrant),
|
|
5981
|
+
meta: paginatedMeta,
|
|
5982
|
+
});
|
|
5983
|
+
export const voidGrantPathParams = z.object({
|
|
5984
|
+
grantId: ulid,
|
|
5985
|
+
});
|
|
5986
|
+
export const voidGrantQueryParams = z.object({
|
|
5987
|
+
voidedAt: dateTime.optional(),
|
|
5303
5988
|
});
|
|
5304
|
-
export const getCustomerEntitlementAccessResponse = entitlementAccessResult;
|
|
5305
5989
|
export const createCreditGrantPathParams = z.object({
|
|
5306
5990
|
customerId: ulid,
|
|
5307
5991
|
});
|
|
@@ -5956,6 +6640,39 @@ export const queryEntitlementAccessQueryParams = z.object({
|
|
|
5956
6640
|
});
|
|
5957
6641
|
export const queryEntitlementAccessBody = entitlementAccessQueryRequest;
|
|
5958
6642
|
export const queryEntitlementAccessResponse = entitlementAccessQueryResponse;
|
|
6643
|
+
export const listNotificationChannelsQueryParams = z.object({
|
|
6644
|
+
page: z
|
|
6645
|
+
.object({
|
|
6646
|
+
size: z.coerce
|
|
6647
|
+
.number()
|
|
6648
|
+
.int()
|
|
6649
|
+
.optional()
|
|
6650
|
+
.describe('The number of items to include per page.'),
|
|
6651
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
6652
|
+
})
|
|
6653
|
+
.optional()
|
|
6654
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
6655
|
+
sort: sortQuery.optional(),
|
|
6656
|
+
filter: listNotificationChannelsParamsFilter.optional(),
|
|
6657
|
+
});
|
|
6658
|
+
export const listNotificationChannelsResponse = z.object({
|
|
6659
|
+
data: z.array(notificationChannel),
|
|
6660
|
+
meta: paginatedMeta,
|
|
6661
|
+
});
|
|
6662
|
+
export const createNotificationChannelBody = createNotificationChannelRequest;
|
|
6663
|
+
export const createNotificationChannelResponse = notificationChannel;
|
|
6664
|
+
export const getNotificationChannelPathParams = z.object({
|
|
6665
|
+
notificationChannelId: ulid,
|
|
6666
|
+
});
|
|
6667
|
+
export const getNotificationChannelResponse = notificationChannel;
|
|
6668
|
+
export const updateNotificationChannelPathParams = z.object({
|
|
6669
|
+
notificationChannelId: ulid,
|
|
6670
|
+
});
|
|
6671
|
+
export const updateNotificationChannelBody = updateBillingNotificationChannelRequest;
|
|
6672
|
+
export const updateNotificationChannelResponse = notificationChannel;
|
|
6673
|
+
export const deleteNotificationChannelPathParams = z.object({
|
|
6674
|
+
notificationChannelId: ulid,
|
|
6675
|
+
});
|
|
5959
6676
|
export const labelsWire = z
|
|
5960
6677
|
.record(z.string(), z.string())
|
|
5961
6678
|
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
@@ -6333,31 +7050,16 @@ export const entitlementTypeWire = z
|
|
|
6333
7050
|
export const entitlementAccessExpandWire = z
|
|
6334
7051
|
.enum(['value'])
|
|
6335
7052
|
.describe('Expands for customer entitlement access. Values: - `value`: The balance details of a metered entitlement; it sets the `value` field.');
|
|
6336
|
-
export const createLabelsWire = z
|
|
6337
|
-
.record(z.string(), z.string())
|
|
6338
|
-
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
6339
|
-
export const creditFundingMethodWire = z
|
|
6340
|
-
.enum(['none', 'invoice', 'external'])
|
|
6341
|
-
.describe('The funding method describes how the grant is funded. - `none`: No funding workflow applies, for example promotional grants - `invoice`: The grant is funded by an in-system invoice flow - `external`: The grant is funded outside the system (e.g., wire transfer, external invoice, or manual reconciliation)');
|
|
6342
|
-
export const creditAvailabilityPolicyWire = z
|
|
6343
|
-
.enum(['on_creation'])
|
|
6344
|
-
.describe('When credits become available for consumption. - `on_creation`: Credits are available as soon as the grant is created. - `on_authorization`: Credits are available once the payment is authorized. - `on_settlement`: Credits are available once the payment is settled.');
|
|
6345
|
-
export const taxBehaviorWire = z
|
|
6346
|
-
.enum(['inclusive', 'exclusive'])
|
|
6347
|
-
.describe('Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.');
|
|
6348
7053
|
export const iso8601DurationWire = z
|
|
6349
7054
|
.string()
|
|
6350
7055
|
.regex(new RegExp('^P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$'))
|
|
6351
7056
|
.describe('[ISO 8601 Duration](https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm) string.');
|
|
6352
|
-
export const
|
|
6353
|
-
.enum(['
|
|
6354
|
-
.describe('
|
|
6355
|
-
export const
|
|
6356
|
-
.
|
|
6357
|
-
.describe('
|
|
6358
|
-
export const validationIssueSeverityWire = z
|
|
6359
|
-
.enum(['critical', 'warning'])
|
|
6360
|
-
.describe('Severity level of a billing validation issue.');
|
|
7057
|
+
export const entitlementMeasureUsageFromPresetWire = z
|
|
7058
|
+
.enum(['current_period_start', 'now'])
|
|
7059
|
+
.describe('Preset for the time from which usage is measured. - `current_period_start`: the start of the current usage period. - `now`: the entitlement creation time.');
|
|
7060
|
+
export const entitlementHistoryWindowSizeWire = z
|
|
7061
|
+
.union([z.literal('PT1H'), z.literal('P1D')])
|
|
7062
|
+
.describe('The meter query granularities the usage history can be grouped into. Sub-hour windows are too expensive to compute and monthly windows are not supported.');
|
|
6361
7063
|
export const stringFieldFilterExactWire = z
|
|
6362
7064
|
.union([
|
|
6363
7065
|
z.string(),
|
|
@@ -6377,6 +7079,89 @@ export const stringFieldFilterExactWire = z
|
|
|
6377
7079
|
}),
|
|
6378
7080
|
])
|
|
6379
7081
|
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
7082
|
+
export const createLabelsWire = z
|
|
7083
|
+
.record(z.string(), z.string())
|
|
7084
|
+
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
7085
|
+
export const creditFundingMethodWire = z
|
|
7086
|
+
.enum(['none', 'invoice', 'external'])
|
|
7087
|
+
.describe('The funding method describes how the grant is funded. - `none`: No funding workflow applies, for example promotional grants - `invoice`: The grant is funded by an in-system invoice flow - `external`: The grant is funded outside the system (e.g., wire transfer, external invoice, or manual reconciliation)');
|
|
7088
|
+
export const creditAvailabilityPolicyWire = z
|
|
7089
|
+
.enum(['on_creation'])
|
|
7090
|
+
.describe('When credits become available for consumption. - `on_creation`: Credits are available as soon as the grant is created. - `on_authorization`: Credits are available once the payment is authorized. - `on_settlement`: Credits are available once the payment is settled.');
|
|
7091
|
+
export const taxBehaviorWire = z
|
|
7092
|
+
.enum(['inclusive', 'exclusive'])
|
|
7093
|
+
.describe('Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.');
|
|
7094
|
+
export const createVersionFilterWire = z
|
|
7095
|
+
.strictObject({
|
|
7096
|
+
eq: z
|
|
7097
|
+
.number()
|
|
7098
|
+
.int()
|
|
7099
|
+
.gte(1)
|
|
7100
|
+
.lte(2147483647)
|
|
7101
|
+
.optional()
|
|
7102
|
+
.describe('Match this exact version.'),
|
|
7103
|
+
oeq: z
|
|
7104
|
+
.array(z.number().int().gte(-2147483648).lte(2147483647))
|
|
7105
|
+
.min(1)
|
|
7106
|
+
.max(100)
|
|
7107
|
+
.optional()
|
|
7108
|
+
.describe('Match one of these versions.'),
|
|
7109
|
+
gte: z
|
|
7110
|
+
.number()
|
|
7111
|
+
.int()
|
|
7112
|
+
.gte(1)
|
|
7113
|
+
.lte(2147483647)
|
|
7114
|
+
.optional()
|
|
7115
|
+
.describe('Match this version and later versions.'),
|
|
7116
|
+
lte: z
|
|
7117
|
+
.number()
|
|
7118
|
+
.int()
|
|
7119
|
+
.gte(1)
|
|
7120
|
+
.lte(2147483647)
|
|
7121
|
+
.optional()
|
|
7122
|
+
.describe('Match this version and earlier versions.'),
|
|
7123
|
+
})
|
|
7124
|
+
.describe('An integer version comparison. Exactly one operator must be provided.');
|
|
7125
|
+
export const creditPurchasePaymentSettlementStatusWire = z
|
|
7126
|
+
.enum(['pending', 'authorized', 'settled'])
|
|
7127
|
+
.describe('Credit purchase payment settlement status. - `pending`: Payment has been initiated and is not yet authorized. - `authorized`: Payment has been authorized. - `settled`: Payment has been settled.');
|
|
7128
|
+
export const versionFilterWire = z
|
|
7129
|
+
.strictObject({
|
|
7130
|
+
eq: z
|
|
7131
|
+
.number()
|
|
7132
|
+
.int()
|
|
7133
|
+
.gte(1)
|
|
7134
|
+
.lte(2147483647)
|
|
7135
|
+
.optional()
|
|
7136
|
+
.describe('Match this exact version.'),
|
|
7137
|
+
oeq: z
|
|
7138
|
+
.array(z.number().int().gte(-2147483648).lte(2147483647))
|
|
7139
|
+
.min(1)
|
|
7140
|
+
.max(100)
|
|
7141
|
+
.optional()
|
|
7142
|
+
.describe('Match one of these versions.'),
|
|
7143
|
+
gte: z
|
|
7144
|
+
.number()
|
|
7145
|
+
.int()
|
|
7146
|
+
.gte(1)
|
|
7147
|
+
.lte(2147483647)
|
|
7148
|
+
.optional()
|
|
7149
|
+
.describe('Match this version and later versions.'),
|
|
7150
|
+
lte: z
|
|
7151
|
+
.number()
|
|
7152
|
+
.int()
|
|
7153
|
+
.gte(1)
|
|
7154
|
+
.lte(2147483647)
|
|
7155
|
+
.optional()
|
|
7156
|
+
.describe('Match this version and earlier versions.'),
|
|
7157
|
+
})
|
|
7158
|
+
.describe('An integer version comparison. Exactly one operator must be provided.');
|
|
7159
|
+
export const creditGrantStatusWire = z
|
|
7160
|
+
.enum(['pending', 'active', 'expired', 'voided'])
|
|
7161
|
+
.describe('Credit grant lifecycle status. - `pending`: The credit block has been created but is not yet valid. (`effective_at` is in the future or availability_policy is not met) - `active`: The credit block is currently valid and eligible for consumption. (`effective_at` is in the past, `expires_at` is in the future and availability_policy is met) - `expired`: The credit block expired with remaining unused balance, `expires_at` time has passed. - `voided`: The credit block was voided. Remaining balance is forfeited.');
|
|
7162
|
+
export const validationIssueSeverityWire = z
|
|
7163
|
+
.enum(['critical', 'warning'])
|
|
7164
|
+
.describe('Severity level of a billing validation issue.');
|
|
6380
7165
|
export const creditGrantVoidPaymentAdjustmentWire = z
|
|
6381
7166
|
.enum(['none'])
|
|
6382
7167
|
.describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
|
|
@@ -6774,6 +7559,19 @@ export const entitlementFeatureAccessReasonCodeWire = z
|
|
|
6774
7559
|
export const entitlementAccessQueryErrorCodeWire = z
|
|
6775
7560
|
.enum(['unknown', 'customer_not_found'])
|
|
6776
7561
|
.describe('Error code for an entitlement access query failure.');
|
|
7562
|
+
export const booleanFieldFilterWire = z
|
|
7563
|
+
.union([
|
|
7564
|
+
z.boolean(),
|
|
7565
|
+
z.strictObject({
|
|
7566
|
+
eq: z
|
|
7567
|
+
.boolean()
|
|
7568
|
+
.describe('Value strictly equals the given boolean value.'),
|
|
7569
|
+
}),
|
|
7570
|
+
])
|
|
7571
|
+
.describe('Filter by a boolean value (true/false).');
|
|
7572
|
+
export const notificationChannelTypeWire = z
|
|
7573
|
+
.enum(['webhook'])
|
|
7574
|
+
.describe('The type of a notification channel. Currently the only supported channel type is `webhook`; the domain model anticipates additional channel types (e.g. email, Slack) in the future, so this is modeled as an enum rather than a boolean/constant even though it has a single member today.');
|
|
6777
7575
|
export const queryFilterIntegerWire = z
|
|
6778
7576
|
.strictObject({
|
|
6779
7577
|
eq: z
|
|
@@ -6898,16 +7696,6 @@ export const pagePaginationQueryWire = z
|
|
|
6898
7696
|
export const publicLabelsWire = z
|
|
6899
7697
|
.record(z.string(), z.string())
|
|
6900
7698
|
.describe('Public labels store information about an entity that can be used for filtering a list of objects.');
|
|
6901
|
-
export const booleanFieldFilterWire = z
|
|
6902
|
-
.union([
|
|
6903
|
-
z.boolean(),
|
|
6904
|
-
z.strictObject({
|
|
6905
|
-
eq: z
|
|
6906
|
-
.boolean()
|
|
6907
|
-
.describe('Value strictly equals the given boolean value.'),
|
|
6908
|
-
}),
|
|
6909
|
-
])
|
|
6910
|
-
.describe('Filter by a boolean value (true/false).');
|
|
6911
7699
|
export const numericFieldFilterWire = z
|
|
6912
7700
|
.union([
|
|
6913
7701
|
z.number(),
|
|
@@ -7130,7 +7918,35 @@ export const entitlementAccessValueWire = z
|
|
|
7130
7918
|
.record(z.string(), numericWire)
|
|
7131
7919
|
.describe('The remaining balance of each grant, keyed by grant ID.'),
|
|
7132
7920
|
})
|
|
7133
|
-
.describe('Balance details of a metered entitlement.');
|
|
7921
|
+
.describe('Balance details of a metered entitlement at the evaluation time, which is the `at` query parameter when given and the current time otherwise.');
|
|
7922
|
+
export const entitlementIssueAfterResetWire = z
|
|
7923
|
+
.strictObject({
|
|
7924
|
+
amount: numericWire,
|
|
7925
|
+
priority: z
|
|
7926
|
+
.number()
|
|
7927
|
+
.int()
|
|
7928
|
+
.gte(1)
|
|
7929
|
+
.lte(255)
|
|
7930
|
+
.optional()
|
|
7931
|
+
.describe('The priority of the grant created after each reset. Lower values have higher priority.'),
|
|
7932
|
+
})
|
|
7933
|
+
.describe('Usage granted automatically after each reset of a metered entitlement. The balance returns to `amount` after every reset.');
|
|
7934
|
+
export const entitlementBurndownBalanceWire = z
|
|
7935
|
+
.strictObject({
|
|
7936
|
+
start: numericWire,
|
|
7937
|
+
end: numericWire,
|
|
7938
|
+
})
|
|
7939
|
+
.describe('Entitlement balance at the boundaries of a burndown segment.');
|
|
7940
|
+
export const entitlementBurndownGrantBalancesWire = z
|
|
7941
|
+
.strictObject({
|
|
7942
|
+
start: z
|
|
7943
|
+
.record(z.string(), numericWire)
|
|
7944
|
+
.describe('The balance of each active grant at the start of the segment.'),
|
|
7945
|
+
end: z
|
|
7946
|
+
.record(z.string(), numericWire)
|
|
7947
|
+
.describe('The balance of each active grant at the end of the segment.'),
|
|
7948
|
+
})
|
|
7949
|
+
.describe('Grant balances at the boundaries of a burndown segment, keyed by grant ID.');
|
|
7134
7950
|
export const createChargeCostBasisManualWire = z
|
|
7135
7951
|
.strictObject({
|
|
7136
7952
|
type: z
|
|
@@ -7362,6 +8178,17 @@ export const profileReferenceWire = z
|
|
|
7362
8178
|
id: ulidWire,
|
|
7363
8179
|
})
|
|
7364
8180
|
.describe('Billing profile reference.');
|
|
8181
|
+
export const featureReferenceWire = z
|
|
8182
|
+
.strictObject({
|
|
8183
|
+
id: ulidWire,
|
|
8184
|
+
})
|
|
8185
|
+
.describe('Feature reference.');
|
|
8186
|
+
export const entitlementGrantUsageWire = z
|
|
8187
|
+
.strictObject({
|
|
8188
|
+
grant_id: ulidWire,
|
|
8189
|
+
usage: numericWire,
|
|
8190
|
+
})
|
|
8191
|
+
.describe('Usage taken from a single grant.');
|
|
7365
8192
|
export const createChargeCostBasisPinnedWire = z
|
|
7366
8193
|
.strictObject({
|
|
7367
8194
|
type: z
|
|
@@ -7401,6 +8228,11 @@ export const creditGrantInvoiceReferenceWire = z
|
|
|
7401
8228
|
.describe('Identifier of the invoice line associated with the grant.'),
|
|
7402
8229
|
})
|
|
7403
8230
|
.describe('Invoice references for the grant.');
|
|
8231
|
+
export const currencyCustomReferenceWire = z
|
|
8232
|
+
.strictObject({
|
|
8233
|
+
id: ulidWire,
|
|
8234
|
+
})
|
|
8235
|
+
.describe('CurrencyCustom reference.');
|
|
7404
8236
|
export const subscriptionCostBasisPinWire = z
|
|
7405
8237
|
.strictObject({
|
|
7406
8238
|
custom_currency_id: ulidWire,
|
|
@@ -7408,11 +8240,6 @@ export const subscriptionCostBasisPinWire = z
|
|
|
7408
8240
|
cost_basis_id: ulidWire,
|
|
7409
8241
|
})
|
|
7410
8242
|
.describe('A cost basis pinned to a custom-currency pair for the subscription.');
|
|
7411
|
-
export const featureReferenceWire = z
|
|
7412
|
-
.strictObject({
|
|
7413
|
-
id: ulidWire,
|
|
7414
|
-
})
|
|
7415
|
-
.describe('Feature reference.');
|
|
7416
8243
|
export const subscriptionReferenceWire = z
|
|
7417
8244
|
.strictObject({
|
|
7418
8245
|
id: ulidWire,
|
|
@@ -7565,6 +8392,25 @@ export const appStripeCreateCustomerPortalSessionResultWire = z
|
|
|
7565
8392
|
.describe('The URL to redirect the customer to after they have completed their requested actions.'),
|
|
7566
8393
|
})
|
|
7567
8394
|
.describe('Result of creating a [Stripe Customer Portal Session](https://docs.stripe.com/api/customer_portal/sessions/object). Contains all the information needed to redirect the customer to the Stripe Customer Portal.');
|
|
8395
|
+
export const closedPeriodWire = z
|
|
8396
|
+
.strictObject({
|
|
8397
|
+
from: dateTimeWire,
|
|
8398
|
+
to: dateTimeWire,
|
|
8399
|
+
})
|
|
8400
|
+
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
8401
|
+
export const resetCustomerEntitlementUsageRequestWire = z
|
|
8402
|
+
.strictObject({
|
|
8403
|
+
effective_at: dateTimeWire.optional(),
|
|
8404
|
+
retain_anchor: z
|
|
8405
|
+
.boolean()
|
|
8406
|
+
.optional()
|
|
8407
|
+
.describe('Whether the usage period anchor is kept. When false, the anchor moves to `effective_at`.'),
|
|
8408
|
+
preserve_overage: z
|
|
8409
|
+
.boolean()
|
|
8410
|
+
.optional()
|
|
8411
|
+
.describe("Whether overage carries over into the new usage period. Defaults to the entitlement's own setting."),
|
|
8412
|
+
})
|
|
8413
|
+
.describe('Request body for resetting the usage of a metered entitlement.');
|
|
7568
8414
|
export const chargeResolvedCostBasisWire = z
|
|
7569
8415
|
.strictObject({
|
|
7570
8416
|
fiat_currency: currencyCodeWire,
|
|
@@ -7573,12 +8419,6 @@ export const chargeResolvedCostBasisWire = z
|
|
|
7573
8419
|
resolved_at: dateTimeWire,
|
|
7574
8420
|
})
|
|
7575
8421
|
.describe('Fiat conversion rate a custom-currency charge is invoiced at. Present once the cost basis is resolved; dynamic cost bases are exposed only after the service period has started.');
|
|
7576
|
-
export const closedPeriodWire = z
|
|
7577
|
-
.strictObject({
|
|
7578
|
-
from: dateTimeWire,
|
|
7579
|
-
to: dateTimeWire,
|
|
7580
|
-
})
|
|
7581
|
-
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
7582
8422
|
export const subscriptionAddonTimelineSegmentWire = z
|
|
7583
8423
|
.strictObject({
|
|
7584
8424
|
active_from: dateTimeWire,
|
|
@@ -7783,22 +8623,6 @@ export const tooManyRequestsWire = baseErrorWire.describe('Too Many Requests.');
|
|
|
7783
8623
|
export const internalWire = baseErrorWire.describe('Internal Server Error.');
|
|
7784
8624
|
export const notImplementedWire = baseErrorWire.describe('Not Implemented.');
|
|
7785
8625
|
export const notAvailableWire = baseErrorWire.describe('Not Available.');
|
|
7786
|
-
export const createCreditGrantFiltersWire = z
|
|
7787
|
-
.strictObject({
|
|
7788
|
-
features: z
|
|
7789
|
-
.array(resourceKeyWire)
|
|
7790
|
-
.optional()
|
|
7791
|
-
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
7792
|
-
})
|
|
7793
|
-
.describe('Filters for the credit grant.');
|
|
7794
|
-
export const creditGrantFiltersWire = z
|
|
7795
|
-
.strictObject({
|
|
7796
|
-
features: z
|
|
7797
|
-
.array(resourceKeyWire)
|
|
7798
|
-
.optional()
|
|
7799
|
-
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
7800
|
-
})
|
|
7801
|
-
.describe('Filters for the credit grant.');
|
|
7802
8626
|
export const subscriptionPlanReferenceWire = z
|
|
7803
8627
|
.strictObject({
|
|
7804
8628
|
id: ulidWire,
|
|
@@ -8087,6 +8911,30 @@ export const customerStripeCreateCustomerPortalSessionRequestWire = z
|
|
|
8087
8911
|
stripe_options: appStripeCreateCustomerPortalSessionOptionsWire,
|
|
8088
8912
|
})
|
|
8089
8913
|
.describe('Request to create a Stripe Customer Portal Session for the customer. Useful to redirect the customer to the Stripe Customer Portal to manage their payment methods, change their billing address and access their invoice history. Only returns URL if the customer billing profile is linked to a stripe app and customer.');
|
|
8914
|
+
export const entitlementAccessCheckResultWire = z
|
|
8915
|
+
.strictObject({
|
|
8916
|
+
has_access: z
|
|
8917
|
+
.boolean()
|
|
8918
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
8919
|
+
config: z
|
|
8920
|
+
.string()
|
|
8921
|
+
.optional()
|
|
8922
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
8923
|
+
type: entitlementTypeWire.optional(),
|
|
8924
|
+
})
|
|
8925
|
+
.describe('Entitlement access check result.');
|
|
8926
|
+
export const recurringPeriodInputWire = z
|
|
8927
|
+
.strictObject({
|
|
8928
|
+
interval: iso8601DurationWire,
|
|
8929
|
+
anchor: dateTimeWire.optional(),
|
|
8930
|
+
})
|
|
8931
|
+
.describe('Recurring period input. The anchor is optional; the owning resource defines the default, typically its creation time.');
|
|
8932
|
+
export const recurringPeriodWire = z
|
|
8933
|
+
.strictObject({
|
|
8934
|
+
anchor: dateTimeWire,
|
|
8935
|
+
interval: iso8601DurationWire,
|
|
8936
|
+
})
|
|
8937
|
+
.describe('Recurring period with an anchor and an interval.');
|
|
8090
8938
|
export const rateCardMeteredEntitlementWire = z
|
|
8091
8939
|
.strictObject({
|
|
8092
8940
|
type: z
|
|
@@ -8127,17 +8975,40 @@ export const subscriptionEditStretchPhaseWire = z
|
|
|
8127
8975
|
extend_by: iso8601DurationWire,
|
|
8128
8976
|
})
|
|
8129
8977
|
.describe('Extend the duration of a phase, shifting later phases by the same amount.');
|
|
8130
|
-
export const
|
|
8978
|
+
export const entitlementMeasureUsageFromWire = z
|
|
8979
|
+
.union([entitlementMeasureUsageFromPresetWire, dateTimeWire])
|
|
8980
|
+
.describe('The time from which usage is measured, as a preset or an explicit timestamp.');
|
|
8981
|
+
export const getCreditBalanceParamsFilterWire = z
|
|
8131
8982
|
.strictObject({
|
|
8132
|
-
|
|
8133
|
-
|
|
8983
|
+
currency: stringFieldFilterExactWire.optional(),
|
|
8984
|
+
feature_key: stringFieldFilterWire.optional(),
|
|
8134
8985
|
})
|
|
8135
|
-
.describe('
|
|
8986
|
+
.describe('Filter options for getting a credit balance.');
|
|
8987
|
+
export const listPlansParamsFilterWire = z
|
|
8988
|
+
.strictObject({
|
|
8989
|
+
key: stringFieldFilterWire.optional(),
|
|
8990
|
+
name: stringFieldFilterWire.optional(),
|
|
8991
|
+
status: stringFieldFilterExactWire.optional(),
|
|
8992
|
+
currency: stringFieldFilterExactWire.optional(),
|
|
8993
|
+
})
|
|
8994
|
+
.describe('Filter options for listing plans.');
|
|
8995
|
+
export const createCreditGrantPlanFilterWire = z
|
|
8996
|
+
.strictObject({
|
|
8997
|
+
key: resourceKeyWire,
|
|
8998
|
+
version: createVersionFilterWire.optional(),
|
|
8999
|
+
})
|
|
9000
|
+
.describe('A plan key and an optional version constraint for matching credit grants.');
|
|
8136
9001
|
export const updateCreditGrantExternalSettlementRequestWire = z
|
|
8137
9002
|
.strictObject({
|
|
8138
9003
|
status: creditPurchasePaymentSettlementStatusWire,
|
|
8139
9004
|
})
|
|
8140
|
-
.describe('Request body for updating the external payment settlement status of a credit grant.');
|
|
9005
|
+
.describe('Request body for updating the external payment settlement status of a credit grant.');
|
|
9006
|
+
export const creditGrantPlanFilterWire = z
|
|
9007
|
+
.strictObject({
|
|
9008
|
+
key: resourceKeyWire,
|
|
9009
|
+
version: versionFilterWire.optional(),
|
|
9010
|
+
})
|
|
9011
|
+
.describe('A plan key and an optional version constraint for matching credit grants.');
|
|
8141
9012
|
export const listCreditGrantsParamsFilterWire = z
|
|
8142
9013
|
.strictObject({
|
|
8143
9014
|
status: creditGrantStatusWire.optional(),
|
|
@@ -8164,20 +9035,6 @@ export const validationIssueWire = z
|
|
|
8164
9035
|
.describe('Component that reported the validation issue, if applicable.'),
|
|
8165
9036
|
})
|
|
8166
9037
|
.describe('A validation issue found while processing a billing resource.');
|
|
8167
|
-
export const getCreditBalanceParamsFilterWire = z
|
|
8168
|
-
.strictObject({
|
|
8169
|
-
currency: stringFieldFilterExactWire.optional(),
|
|
8170
|
-
feature_key: stringFieldFilterWire.optional(),
|
|
8171
|
-
})
|
|
8172
|
-
.describe('Filter options for getting a credit balance.');
|
|
8173
|
-
export const listPlansParamsFilterWire = z
|
|
8174
|
-
.strictObject({
|
|
8175
|
-
key: stringFieldFilterWire.optional(),
|
|
8176
|
-
name: stringFieldFilterWire.optional(),
|
|
8177
|
-
status: stringFieldFilterExactWire.optional(),
|
|
8178
|
-
currency: stringFieldFilterExactWire.optional(),
|
|
8179
|
-
})
|
|
8180
|
-
.describe('Filter options for listing plans.');
|
|
8181
9038
|
export const voidCreditGrantRequestWire = z
|
|
8182
9039
|
.strictObject({
|
|
8183
9040
|
payment_adjustment: creditGrantVoidPaymentAdjustmentWire.optional(),
|
|
@@ -8432,6 +9289,88 @@ export const entitlementAccessQueryErrorWire = z
|
|
|
8432
9289
|
.describe('The customer identifier from the request that produced this error.'),
|
|
8433
9290
|
})
|
|
8434
9291
|
.describe('Query error within a partially successful entitlement access query response.');
|
|
9292
|
+
export const notificationChannelWire = z
|
|
9293
|
+
.strictObject({
|
|
9294
|
+
id: ulidWire,
|
|
9295
|
+
name: z
|
|
9296
|
+
.string()
|
|
9297
|
+
.min(1)
|
|
9298
|
+
.max(256)
|
|
9299
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9300
|
+
labels: labelsWire.optional(),
|
|
9301
|
+
created_at: dateTimeWire,
|
|
9302
|
+
updated_at: dateTimeWire,
|
|
9303
|
+
deleted_at: dateTimeWire.optional(),
|
|
9304
|
+
type: notificationChannelTypeWire,
|
|
9305
|
+
disabled: z
|
|
9306
|
+
.boolean()
|
|
9307
|
+
.optional()
|
|
9308
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9309
|
+
url: z
|
|
9310
|
+
.string()
|
|
9311
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9312
|
+
custom_headers: z
|
|
9313
|
+
.record(z.string(), z.string())
|
|
9314
|
+
.optional()
|
|
9315
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9316
|
+
signing_secret: z
|
|
9317
|
+
.string()
|
|
9318
|
+
.optional()
|
|
9319
|
+
.describe('Secret used to sign outgoing webhook payloads so recipients can verify their authenticity. If omitted on create, a secret is generated automatically by the delivery provider. This is a sensitive credential returned in responses (unlike most secrets) specifically so clients can retrieve a server-generated value and verify webhook signatures; handle it with the same care as any other credential.'),
|
|
9320
|
+
})
|
|
9321
|
+
.describe('A notification channel delivers notification events, such as entitlement balance threshold crossings, to an external system. Today the only supported channel type is a webhook delivered via Svix.');
|
|
9322
|
+
export const createNotificationChannelRequestWire = z
|
|
9323
|
+
.strictObject({
|
|
9324
|
+
name: z
|
|
9325
|
+
.string()
|
|
9326
|
+
.min(1)
|
|
9327
|
+
.max(256)
|
|
9328
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9329
|
+
labels: labelsWire.optional(),
|
|
9330
|
+
type: notificationChannelTypeWire,
|
|
9331
|
+
disabled: z
|
|
9332
|
+
.boolean()
|
|
9333
|
+
.optional()
|
|
9334
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9335
|
+
url: z
|
|
9336
|
+
.string()
|
|
9337
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9338
|
+
custom_headers: z
|
|
9339
|
+
.record(z.string(), z.string())
|
|
9340
|
+
.optional()
|
|
9341
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9342
|
+
signing_secret: z
|
|
9343
|
+
.string()
|
|
9344
|
+
.optional()
|
|
9345
|
+
.describe('Secret used to sign outgoing webhook payloads so recipients can verify their authenticity. If omitted on create, a secret is generated automatically by the delivery provider. This is a sensitive credential returned in responses (unlike most secrets) specifically so clients can retrieve a server-generated value and verify webhook signatures; handle it with the same care as any other credential.'),
|
|
9346
|
+
})
|
|
9347
|
+
.describe('NotificationChannel create request.');
|
|
9348
|
+
export const updateBillingNotificationChannelRequestWire = z
|
|
9349
|
+
.strictObject({
|
|
9350
|
+
name: z
|
|
9351
|
+
.string()
|
|
9352
|
+
.min(1)
|
|
9353
|
+
.max(256)
|
|
9354
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9355
|
+
type: notificationChannelTypeWire,
|
|
9356
|
+
url: z
|
|
9357
|
+
.string()
|
|
9358
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9359
|
+
labels: labelsWire.optional(),
|
|
9360
|
+
disabled: z
|
|
9361
|
+
.boolean()
|
|
9362
|
+
.optional()
|
|
9363
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9364
|
+
custom_headers: z
|
|
9365
|
+
.record(z.string(), z.string())
|
|
9366
|
+
.optional()
|
|
9367
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9368
|
+
signing_secret: z
|
|
9369
|
+
.string()
|
|
9370
|
+
.optional()
|
|
9371
|
+
.describe('Secret used to sign outgoing webhook payloads so recipients can verify their authenticity. If omitted on create, a secret is generated automatically by the delivery provider. This is a sensitive credential returned in responses (unlike most secrets) specifically so clients can retrieve a server-generated value and verify webhook signatures; handle it with the same care as any other credential.'),
|
|
9372
|
+
})
|
|
9373
|
+
.describe("Request body for updating a notification channel. Updates replace the channel's mutable state rather than merging it: `type`, `name`, and `url` must always be provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to their defaults (enabled, no labels, no custom headers). `signing_secret` is the one exception: omitting it keeps the channel's current signing secret instead of clearing the credential.");
|
|
8435
9374
|
export const appCustomerDataWire = z
|
|
8436
9375
|
.strictObject({
|
|
8437
9376
|
stripe: appCustomerDataStripeWire
|
|
@@ -8471,15 +9410,6 @@ export const creditAdjustmentWire = z
|
|
|
8471
9410
|
labels: labelsWire.optional(),
|
|
8472
9411
|
})
|
|
8473
9412
|
.describe("A credit adjustment can be used to make manual adjustments to a customer's credit balance. Supported use-cases: - Usage correction");
|
|
8474
|
-
export const creditBalanceWire = z
|
|
8475
|
-
.strictObject({
|
|
8476
|
-
currency: billingCurrencyCodeWire,
|
|
8477
|
-
custom_currency_id: ulidWire.optional(),
|
|
8478
|
-
live: numericWire,
|
|
8479
|
-
settled: numericWire,
|
|
8480
|
-
pending: numericWire,
|
|
8481
|
-
})
|
|
8482
|
-
.describe('The credit balance by currency.');
|
|
8483
9413
|
export const createCreditAdjustmentRequestWire = z
|
|
8484
9414
|
.strictObject({
|
|
8485
9415
|
name: z
|
|
@@ -8504,41 +9434,13 @@ export const listCreditTransactionsParamsFilterWire = z
|
|
|
8504
9434
|
feature_key: stringFieldFilterWire.optional(),
|
|
8505
9435
|
})
|
|
8506
9436
|
.describe('Filter options for listing credit transactions.');
|
|
8507
|
-
export const creditTransactionWire = z
|
|
8508
|
-
.strictObject({
|
|
8509
|
-
id: ulidWire,
|
|
8510
|
-
name: z
|
|
8511
|
-
.string()
|
|
8512
|
-
.min(1)
|
|
8513
|
-
.max(256)
|
|
8514
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
8515
|
-
description: z
|
|
8516
|
-
.string()
|
|
8517
|
-
.max(1024)
|
|
8518
|
-
.optional()
|
|
8519
|
-
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
8520
|
-
labels: labelsWire.optional(),
|
|
8521
|
-
created_at: dateTimeWire,
|
|
8522
|
-
booked_at: dateTimeWire,
|
|
8523
|
-
type: creditTransactionTypeWire,
|
|
8524
|
-
currency: billingCurrencyCodeWire,
|
|
8525
|
-
custom_currency_id: ulidWire.optional(),
|
|
8526
|
-
amount: numericWire,
|
|
8527
|
-
available_balance: z
|
|
8528
|
-
.strictObject({
|
|
8529
|
-
before: numericWire,
|
|
8530
|
-
after: numericWire,
|
|
8531
|
-
})
|
|
8532
|
-
.describe('The available balance before and after the transaction.'),
|
|
8533
|
-
})
|
|
8534
|
-
.describe("A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable.");
|
|
8535
9437
|
export const currencyAmountWire = z
|
|
8536
9438
|
.strictObject({
|
|
8537
9439
|
amount: numericWire,
|
|
8538
9440
|
currency: billingCurrencyCodeWire,
|
|
8539
9441
|
})
|
|
8540
9442
|
.describe('Monetary amount in a fiat or custom currency.');
|
|
8541
|
-
export const
|
|
9443
|
+
export const entitlementValueResultWire = z
|
|
8542
9444
|
.strictObject({
|
|
8543
9445
|
type: entitlementTypeWire,
|
|
8544
9446
|
feature_key: resourceKeyWire,
|
|
@@ -8551,7 +9453,21 @@ export const entitlementAccessResultWire = z
|
|
|
8551
9453
|
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
8552
9454
|
value: entitlementAccessValueWire.optional(),
|
|
8553
9455
|
})
|
|
8554
|
-
.describe('Entitlement
|
|
9456
|
+
.describe('Entitlement value result.');
|
|
9457
|
+
export const entitlementFeatureValueResultWire = z
|
|
9458
|
+
.strictObject({
|
|
9459
|
+
feature_key: resourceKeyWire,
|
|
9460
|
+
has_access: z
|
|
9461
|
+
.boolean()
|
|
9462
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
9463
|
+
config: z
|
|
9464
|
+
.string()
|
|
9465
|
+
.optional()
|
|
9466
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
9467
|
+
value: entitlementAccessValueWire.optional(),
|
|
9468
|
+
type: entitlementTypeWire.optional(),
|
|
9469
|
+
})
|
|
9470
|
+
.describe('Entitlement value looked up by feature key. A missing entitlement has no type and does not grant access.');
|
|
8555
9471
|
export const priceTierWire = z
|
|
8556
9472
|
.strictObject({
|
|
8557
9473
|
up_to_amount: numericWire.optional(),
|
|
@@ -8636,6 +9552,27 @@ export const listCustomersParamsFilterWire = z
|
|
|
8636
9552
|
billing_profile_id: ulidFieldFilterWire.optional(),
|
|
8637
9553
|
})
|
|
8638
9554
|
.describe('Filter options for listing customers.');
|
|
9555
|
+
export const listCustomerEntitlementsParamsFilterWire = z
|
|
9556
|
+
.strictObject({
|
|
9557
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
9558
|
+
feature_key: stringFieldFilterExactWire.optional(),
|
|
9559
|
+
type: stringFieldFilterExactWire.optional(),
|
|
9560
|
+
})
|
|
9561
|
+
.describe('Filter options for listing customer entitlements.');
|
|
9562
|
+
export const listEntitlementsParamsFilterWire = z
|
|
9563
|
+
.strictObject({
|
|
9564
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
9565
|
+
feature_key: stringFieldFilterExactWire.optional(),
|
|
9566
|
+
type: stringFieldFilterExactWire.optional(),
|
|
9567
|
+
customer_id: ulidFieldFilterWire.optional(),
|
|
9568
|
+
})
|
|
9569
|
+
.describe('Filter options for listing entitlements.');
|
|
9570
|
+
export const listGrantsParamsFilterWire = z
|
|
9571
|
+
.strictObject({
|
|
9572
|
+
customer_id: ulidFieldFilterWire.optional(),
|
|
9573
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
9574
|
+
})
|
|
9575
|
+
.describe('Filter options for listing grants.');
|
|
8639
9576
|
export const listSubscriptionsParamsFilterWire = z
|
|
8640
9577
|
.strictObject({
|
|
8641
9578
|
id: ulidFieldFilterWire.optional(),
|
|
@@ -8692,12 +9629,12 @@ export const createChargeCostBasisWire = z
|
|
|
8692
9629
|
createChargeCostBasisManualWire,
|
|
8693
9630
|
])
|
|
8694
9631
|
.describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
|
|
8695
|
-
export const
|
|
9632
|
+
export const createTaxCodeConfigWire = z
|
|
8696
9633
|
.strictObject({
|
|
8697
9634
|
behavior: taxBehaviorWire.optional(),
|
|
8698
|
-
|
|
9635
|
+
code: createResourceReferenceWire.optional(),
|
|
8699
9636
|
})
|
|
8700
|
-
.describe('Tax configuration for a
|
|
9637
|
+
.describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
|
|
8701
9638
|
export const chargeCostBasisWire = z
|
|
8702
9639
|
.discriminatedUnion('type', [
|
|
8703
9640
|
chargeCostBasisDynamicWire,
|
|
@@ -8705,18 +9642,12 @@ export const chargeCostBasisWire = z
|
|
|
8705
9642
|
chargeCostBasisManualWire,
|
|
8706
9643
|
])
|
|
8707
9644
|
.describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
|
|
8708
|
-
export const
|
|
9645
|
+
export const taxCodeConfigWire = z
|
|
8709
9646
|
.strictObject({
|
|
8710
9647
|
behavior: taxBehaviorWire.optional(),
|
|
8711
|
-
|
|
8712
|
-
})
|
|
8713
|
-
.describe('Tax configuration for a credit grant. Tax configuration should be provided to ensure correct revenue recognition, including for externally funded grants.');
|
|
8714
|
-
export const rateCardTaxConfigWire = z
|
|
8715
|
-
.strictObject({
|
|
8716
|
-
behavior: taxBehaviorWire.optional(),
|
|
8717
|
-
code: taxCodeReferenceWire,
|
|
9648
|
+
code: taxCodeReferenceWire.optional(),
|
|
8718
9649
|
})
|
|
8719
|
-
.describe('
|
|
9650
|
+
.describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
|
|
8720
9651
|
export const taxConfigWire = z
|
|
8721
9652
|
.strictObject({
|
|
8722
9653
|
behavior: taxBehaviorWire.optional(),
|
|
@@ -8740,6 +9671,43 @@ export const updateOrganizationDefaultTaxCodesRequestWire = z
|
|
|
8740
9671
|
credit_grant_tax_code: taxCodeReferenceWire.optional(),
|
|
8741
9672
|
})
|
|
8742
9673
|
.describe('OrganizationDefaultTaxCodes update request.');
|
|
9674
|
+
export const creditBalanceWire = z
|
|
9675
|
+
.strictObject({
|
|
9676
|
+
currency: billingCurrencyCodeWire,
|
|
9677
|
+
custom_currency: currencyCustomReferenceWire.optional(),
|
|
9678
|
+
live: numericWire,
|
|
9679
|
+
settled: numericWire,
|
|
9680
|
+
pending: numericWire,
|
|
9681
|
+
})
|
|
9682
|
+
.describe('The credit balance by currency.');
|
|
9683
|
+
export const creditTransactionWire = z
|
|
9684
|
+
.strictObject({
|
|
9685
|
+
id: ulidWire,
|
|
9686
|
+
name: z
|
|
9687
|
+
.string()
|
|
9688
|
+
.min(1)
|
|
9689
|
+
.max(256)
|
|
9690
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9691
|
+
description: z
|
|
9692
|
+
.string()
|
|
9693
|
+
.max(1024)
|
|
9694
|
+
.optional()
|
|
9695
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
9696
|
+
labels: labelsWire.optional(),
|
|
9697
|
+
created_at: dateTimeWire,
|
|
9698
|
+
booked_at: dateTimeWire,
|
|
9699
|
+
type: creditTransactionTypeWire,
|
|
9700
|
+
currency: billingCurrencyCodeWire,
|
|
9701
|
+
custom_currency: currencyCustomReferenceWire.optional(),
|
|
9702
|
+
amount: numericWire,
|
|
9703
|
+
available_balance: z
|
|
9704
|
+
.strictObject({
|
|
9705
|
+
before: numericWire,
|
|
9706
|
+
after: numericWire,
|
|
9707
|
+
})
|
|
9708
|
+
.describe('The available balance before and after the transaction.'),
|
|
9709
|
+
})
|
|
9710
|
+
.describe("A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable.");
|
|
8743
9711
|
export const invoiceWorkflowAppsReferencesWire = z
|
|
8744
9712
|
.strictObject({
|
|
8745
9713
|
tax: appReferenceWire,
|
|
@@ -8808,12 +9776,12 @@ export const createPlanAddonRequestWire = z
|
|
|
8808
9776
|
.describe('The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased.'),
|
|
8809
9777
|
})
|
|
8810
9778
|
.describe('PlanAddon create request.');
|
|
8811
|
-
export const
|
|
9779
|
+
export const updateTaxCodeConfigWire = z
|
|
8812
9780
|
.strictObject({
|
|
8813
9781
|
behavior: taxBehaviorWire.optional(),
|
|
8814
|
-
code: updateResourceReferenceWire,
|
|
9782
|
+
code: updateResourceReferenceWire.optional(),
|
|
8815
9783
|
})
|
|
8816
|
-
.describe('
|
|
9784
|
+
.describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
|
|
8817
9785
|
export const listEventsParamsFilterWire = z
|
|
8818
9786
|
.strictObject({
|
|
8819
9787
|
id: stringFieldFilterWire.optional(),
|
|
@@ -8854,6 +9822,16 @@ export const listChargesParamsFilterWire = z
|
|
|
8854
9822
|
customer_id: ulidFieldFilterWire.optional(),
|
|
8855
9823
|
})
|
|
8856
9824
|
.describe('Filter options for listing charges across customers.');
|
|
9825
|
+
export const listNotificationChannelsParamsFilterWire = z
|
|
9826
|
+
.strictObject({
|
|
9827
|
+
id: ulidFieldFilterWire.optional(),
|
|
9828
|
+
name: stringFieldFilterWire.optional(),
|
|
9829
|
+
type: stringFieldFilterExactWire.optional(),
|
|
9830
|
+
disabled: booleanFieldFilterWire.optional(),
|
|
9831
|
+
created_at: dateTimeFieldFilterWire.optional(),
|
|
9832
|
+
updated_at: dateTimeFieldFilterWire.optional(),
|
|
9833
|
+
})
|
|
9834
|
+
.describe('Filter options for listing notification channels.');
|
|
8857
9835
|
export const resourceFiltersWire = z
|
|
8858
9836
|
.strictObject({
|
|
8859
9837
|
name: stringFieldFilterWire.optional(),
|
|
@@ -8896,6 +9874,25 @@ export const meterQueryResultWire = z
|
|
|
8896
9874
|
.describe('The usage data. If no data is available, an empty array is returned.'),
|
|
8897
9875
|
})
|
|
8898
9876
|
.describe('Meter query result.');
|
|
9877
|
+
export const entitlementHistoryWindowWire = z
|
|
9878
|
+
.strictObject({
|
|
9879
|
+
period: closedPeriodWire,
|
|
9880
|
+
usage: numericWire,
|
|
9881
|
+
balance_at_start: numericWire,
|
|
9882
|
+
})
|
|
9883
|
+
.describe('Usage and balance of a single history window.');
|
|
9884
|
+
export const entitlementBurndownSegmentWire = z
|
|
9885
|
+
.strictObject({
|
|
9886
|
+
period: closedPeriodWire,
|
|
9887
|
+
usage: numericWire,
|
|
9888
|
+
overage: numericWire,
|
|
9889
|
+
balance: entitlementBurndownBalanceWire,
|
|
9890
|
+
grant_balances: entitlementBurndownGrantBalancesWire,
|
|
9891
|
+
grant_usages: z
|
|
9892
|
+
.array(entitlementGrantUsageWire)
|
|
9893
|
+
.describe('The grants consumed in the segment and the usage taken from each.'),
|
|
9894
|
+
})
|
|
9895
|
+
.describe('A period in which grants were consumed in a fixed order.');
|
|
8899
9896
|
export const chargeRealizationDetailedLineFlatFeeWire = z
|
|
8900
9897
|
.strictObject({
|
|
8901
9898
|
id: ulidWire,
|
|
@@ -9117,32 +10114,171 @@ export const invoiceCustomerWire = z
|
|
|
9117
10114
|
id: ulidWire,
|
|
9118
10115
|
key: externalResourceKeyWire.optional(),
|
|
9119
10116
|
})
|
|
9120
|
-
.describe("Snapshot of the customer's information at the time the invoice was issued.");
|
|
9121
|
-
export const updateBillingPartyAddressesWire = z
|
|
10117
|
+
.describe("Snapshot of the customer's information at the time the invoice was issued.");
|
|
10118
|
+
export const updateBillingPartyAddressesWire = z
|
|
10119
|
+
.strictObject({
|
|
10120
|
+
billing_address: updateAddressWire,
|
|
10121
|
+
})
|
|
10122
|
+
.describe('A collection of addresses for the party.');
|
|
10123
|
+
export const updateInvoiceCustomerWire = z
|
|
10124
|
+
.strictObject({
|
|
10125
|
+
name: z
|
|
10126
|
+
.string()
|
|
10127
|
+
.min(1)
|
|
10128
|
+
.max(256)
|
|
10129
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10130
|
+
usage_attribution: updateCustomerUsageAttributionWire.optional(),
|
|
10131
|
+
billing_address: updateAddressWire.optional(),
|
|
10132
|
+
id: ulidWire,
|
|
10133
|
+
key: externalResourceKeyWire.optional(),
|
|
10134
|
+
})
|
|
10135
|
+
.describe("Snapshot of the customer's information at the time the invoice was issued.");
|
|
10136
|
+
export const appStripeCreateCheckoutSessionConsentCollectionWire = z
|
|
10137
|
+
.strictObject({
|
|
10138
|
+
payment_method_reuse_agreement: appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementWire.optional(),
|
|
10139
|
+
promotions: appStripeCreateCheckoutSessionConsentCollectionPromotionsWire.optional(),
|
|
10140
|
+
terms_of_service: appStripeCreateCheckoutSessionConsentCollectionTermsOfServiceWire.optional(),
|
|
10141
|
+
})
|
|
10142
|
+
.describe('Checkout Session consent collection configuration.');
|
|
10143
|
+
export const entitlementGrantCreateRequestWire = z
|
|
10144
|
+
.strictObject({
|
|
10145
|
+
amount: numericWire,
|
|
10146
|
+
priority: z
|
|
10147
|
+
.number()
|
|
10148
|
+
.int()
|
|
10149
|
+
.gte(1)
|
|
10150
|
+
.lte(255)
|
|
10151
|
+
.optional()
|
|
10152
|
+
.describe('The priority of the grant. Lower values have higher priority. Grants are consumed in priority order, then by closest expiration, then by earliest creation.'),
|
|
10153
|
+
effective_at: dateTimeWire,
|
|
10154
|
+
expires_after: iso8601DurationWire.optional(),
|
|
10155
|
+
max_rollover_amount: numericWire.optional(),
|
|
10156
|
+
min_rollover_amount: numericWire.optional(),
|
|
10157
|
+
labels: labelsWire.optional(),
|
|
10158
|
+
recurrence: recurringPeriodInputWire.optional(),
|
|
10159
|
+
})
|
|
10160
|
+
.describe('A grant to issue for a metered entitlement.');
|
|
10161
|
+
export const createEntitlementStaticRequestWire = z
|
|
10162
|
+
.strictObject({
|
|
10163
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
10164
|
+
feature: featureReferenceWire,
|
|
10165
|
+
labels: labelsWire.optional(),
|
|
10166
|
+
config: z
|
|
10167
|
+
.unknown()
|
|
10168
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
10169
|
+
usage_period: recurringPeriodInputWire.optional(),
|
|
10170
|
+
})
|
|
10171
|
+
.describe('Static entitlement create request.');
|
|
10172
|
+
export const createEntitlementBooleanRequestWire = z
|
|
10173
|
+
.strictObject({
|
|
10174
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
10175
|
+
feature: featureReferenceWire,
|
|
10176
|
+
labels: labelsWire.optional(),
|
|
10177
|
+
usage_period: recurringPeriodInputWire.optional(),
|
|
10178
|
+
})
|
|
10179
|
+
.describe('Boolean entitlement create request.');
|
|
10180
|
+
export const entitlementMeteredWire = z
|
|
10181
|
+
.strictObject({
|
|
10182
|
+
id: ulidWire,
|
|
10183
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
10184
|
+
feature: featureReferenceWire,
|
|
10185
|
+
customer: customerReferenceWire,
|
|
10186
|
+
labels: labelsWire.optional(),
|
|
10187
|
+
active_from: dateTimeWire,
|
|
10188
|
+
active_to: dateTimeWire.optional(),
|
|
10189
|
+
created_at: dateTimeWire,
|
|
10190
|
+
updated_at: dateTimeWire,
|
|
10191
|
+
deleted_at: dateTimeWire.optional(),
|
|
10192
|
+
usage_period: recurringPeriodWire,
|
|
10193
|
+
current_usage_period: closedPeriodWire,
|
|
10194
|
+
is_soft_limit: z
|
|
10195
|
+
.boolean()
|
|
10196
|
+
.optional()
|
|
10197
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
10198
|
+
issue: entitlementIssueAfterResetWire.optional(),
|
|
10199
|
+
issue_after_reset: numericWire.optional(),
|
|
10200
|
+
issue_after_reset_priority: z
|
|
10201
|
+
.number()
|
|
10202
|
+
.int()
|
|
10203
|
+
.gte(1)
|
|
10204
|
+
.lte(255)
|
|
10205
|
+
.optional()
|
|
10206
|
+
.describe('The priority of the grant created after each reset.'),
|
|
10207
|
+
preserve_overage_at_reset: z
|
|
10208
|
+
.boolean()
|
|
10209
|
+
.optional()
|
|
10210
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
10211
|
+
measure_usage_from: dateTimeWire,
|
|
10212
|
+
last_reset: dateTimeWire,
|
|
10213
|
+
})
|
|
10214
|
+
.describe('A metered entitlement grants a usage allowance for a feature. Access is determined by the balance: the allowance provided by grants is burnt down by usage.');
|
|
10215
|
+
export const entitlementStaticWire = z
|
|
10216
|
+
.strictObject({
|
|
10217
|
+
id: ulidWire,
|
|
10218
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
10219
|
+
feature: featureReferenceWire,
|
|
10220
|
+
customer: customerReferenceWire,
|
|
10221
|
+
labels: labelsWire.optional(),
|
|
10222
|
+
usage_period: recurringPeriodWire.optional(),
|
|
10223
|
+
current_usage_period: closedPeriodWire.optional(),
|
|
10224
|
+
active_from: dateTimeWire,
|
|
10225
|
+
active_to: dateTimeWire.optional(),
|
|
10226
|
+
created_at: dateTimeWire,
|
|
10227
|
+
updated_at: dateTimeWire,
|
|
10228
|
+
deleted_at: dateTimeWire.optional(),
|
|
10229
|
+
config: z
|
|
10230
|
+
.unknown()
|
|
10231
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
10232
|
+
})
|
|
10233
|
+
.describe('A static entitlement grants access to a feature together with a configuration.');
|
|
10234
|
+
export const entitlementBooleanWire = z
|
|
9122
10235
|
.strictObject({
|
|
9123
|
-
|
|
10236
|
+
id: ulidWire,
|
|
10237
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
10238
|
+
feature: featureReferenceWire,
|
|
10239
|
+
customer: customerReferenceWire,
|
|
10240
|
+
labels: labelsWire.optional(),
|
|
10241
|
+
usage_period: recurringPeriodWire.optional(),
|
|
10242
|
+
current_usage_period: closedPeriodWire.optional(),
|
|
10243
|
+
active_from: dateTimeWire,
|
|
10244
|
+
active_to: dateTimeWire.optional(),
|
|
10245
|
+
created_at: dateTimeWire,
|
|
10246
|
+
updated_at: dateTimeWire,
|
|
10247
|
+
deleted_at: dateTimeWire.optional(),
|
|
9124
10248
|
})
|
|
9125
|
-
.describe('A
|
|
9126
|
-
export const
|
|
10249
|
+
.describe('A boolean entitlement grants access to a feature.');
|
|
10250
|
+
export const entitlementGrantWire = z
|
|
9127
10251
|
.strictObject({
|
|
9128
|
-
name: z
|
|
9129
|
-
.string()
|
|
9130
|
-
.min(1)
|
|
9131
|
-
.max(256)
|
|
9132
|
-
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9133
|
-
usage_attribution: updateCustomerUsageAttributionWire.optional(),
|
|
9134
|
-
billing_address: updateAddressWire.optional(),
|
|
9135
10252
|
id: ulidWire,
|
|
9136
|
-
|
|
10253
|
+
entitlement_id: ulidWire,
|
|
10254
|
+
customer_id: ulidWire.optional(),
|
|
10255
|
+
amount: numericWire,
|
|
10256
|
+
priority: z
|
|
10257
|
+
.number()
|
|
10258
|
+
.int()
|
|
10259
|
+
.nonnegative()
|
|
10260
|
+
.lte(255)
|
|
10261
|
+
.describe('The priority of the grant. Lower values are consumed first: a grant with priority 1 is consumed before one with priority 2. Among equal priorities, the grant closest to expiration is consumed first, then the earliest created.'),
|
|
10262
|
+
effective_at: dateTimeWire,
|
|
10263
|
+
expires_after: iso8601DurationWire.optional(),
|
|
10264
|
+
expires_at: dateTimeWire.optional(),
|
|
10265
|
+
max_rollover_amount: numericWire,
|
|
10266
|
+
min_rollover_amount: numericWire,
|
|
10267
|
+
recurrence: recurringPeriodWire.optional(),
|
|
10268
|
+
next_recurrence: dateTimeWire.optional(),
|
|
10269
|
+
voided_at: dateTimeWire.optional(),
|
|
10270
|
+
labels: labelsWire.optional(),
|
|
10271
|
+
created_at: dateTimeWire,
|
|
10272
|
+
updated_at: dateTimeWire,
|
|
10273
|
+
deleted_at: dateTimeWire.optional(),
|
|
9137
10274
|
})
|
|
9138
|
-
.describe("
|
|
9139
|
-
export const
|
|
10275
|
+
.describe("A grant issued for a metered entitlement. Each grant adds its amount to the entitlement's balance from its effective time until it expires, and usage is deducted from the grants in priority order. Grants are immutable, so the balance is deterministic regardless of when it is queried. Deleting a grant ends it at the time of the deletion.");
|
|
10276
|
+
export const workflowCollectionAlignmentAnchoredWire = z
|
|
9140
10277
|
.strictObject({
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
terms_of_service: appStripeCreateCheckoutSessionConsentCollectionTermsOfServiceWire.optional(),
|
|
10278
|
+
type: z.literal('anchored').describe('The type of alignment.'),
|
|
10279
|
+
recurring_period: recurringPeriodWire,
|
|
9144
10280
|
})
|
|
9145
|
-
.describe('
|
|
10281
|
+
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
9146
10282
|
export const rateCardEntitlementWire = z
|
|
9147
10283
|
.discriminatedUnion('type', [
|
|
9148
10284
|
rateCardMeteredEntitlementWire,
|
|
@@ -9158,12 +10294,30 @@ export const subscriptionEditAddPhaseWire = z
|
|
|
9158
10294
|
phase: subscriptionPhaseCreateWire,
|
|
9159
10295
|
})
|
|
9160
10296
|
.describe('Add a new phase to the subscription. The phase is created without items; use add-item operations to populate it.');
|
|
9161
|
-
export const
|
|
10297
|
+
export const createCreditGrantFiltersWire = z
|
|
9162
10298
|
.strictObject({
|
|
9163
|
-
|
|
9164
|
-
|
|
10299
|
+
features: z
|
|
10300
|
+
.array(resourceKeyWire)
|
|
10301
|
+
.optional()
|
|
10302
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
10303
|
+
plans: z
|
|
10304
|
+
.array(createCreditGrantPlanFilterWire)
|
|
10305
|
+
.optional()
|
|
10306
|
+
.describe('Limit credits to charges from these plans. Entries are alternatives; when features are also specified, both dimensions must match. Omission or an empty list leaves plans unrestricted.'),
|
|
9165
10307
|
})
|
|
9166
|
-
.describe('
|
|
10308
|
+
.describe('Filters for the credit grant.');
|
|
10309
|
+
export const creditGrantFiltersWire = z
|
|
10310
|
+
.strictObject({
|
|
10311
|
+
features: z
|
|
10312
|
+
.array(resourceKeyWire)
|
|
10313
|
+
.optional()
|
|
10314
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
10315
|
+
plans: z
|
|
10316
|
+
.array(creditGrantPlanFilterWire)
|
|
10317
|
+
.optional()
|
|
10318
|
+
.describe('Limit credits to charges from these plans. Entries are alternatives; when features are also specified, both dimensions must match. Omission or an empty list leaves plans unrestricted.'),
|
|
10319
|
+
})
|
|
10320
|
+
.describe('Filters for the credit grant.');
|
|
9167
10321
|
export const subscriptionBaseWire = z
|
|
9168
10322
|
.strictObject({
|
|
9169
10323
|
id: ulidWire,
|
|
@@ -9366,6 +10520,12 @@ export const entitlementFeatureAccessWire = z
|
|
|
9366
10520
|
reason: entitlementFeatureAccessReasonWire.optional(),
|
|
9367
10521
|
})
|
|
9368
10522
|
.describe('Access status for a single feature.');
|
|
10523
|
+
export const notificationChannelPagePaginatedResponseWire = z
|
|
10524
|
+
.strictObject({
|
|
10525
|
+
data: z.array(notificationChannelWire),
|
|
10526
|
+
meta: paginatedMetaWire,
|
|
10527
|
+
})
|
|
10528
|
+
.describe('Page paginated response.');
|
|
9369
10529
|
export const customerDataWire = z
|
|
9370
10530
|
.strictObject({
|
|
9371
10531
|
billing_profile: profileReferenceWire.optional(),
|
|
@@ -9378,20 +10538,6 @@ export const upsertCustomerBillingDataRequestWire = z
|
|
|
9378
10538
|
app_data: appCustomerDataWire.optional(),
|
|
9379
10539
|
})
|
|
9380
10540
|
.describe('CustomerBillingData upsert request.');
|
|
9381
|
-
export const creditBalancesWire = z
|
|
9382
|
-
.strictObject({
|
|
9383
|
-
retrieved_at: dateTimeWire,
|
|
9384
|
-
balances: z
|
|
9385
|
-
.array(creditBalanceWire)
|
|
9386
|
-
.describe('The balances by currencies.'),
|
|
9387
|
-
})
|
|
9388
|
-
.describe('The balances of the credits of a customer.');
|
|
9389
|
-
export const creditTransactionPaginatedResponseWire = z
|
|
9390
|
-
.strictObject({
|
|
9391
|
-
data: z.array(creditTransactionWire),
|
|
9392
|
-
meta: cursorMetaWire,
|
|
9393
|
-
})
|
|
9394
|
-
.describe('Cursor paginated response.');
|
|
9395
10541
|
export const chargeFlatFeeSystemIntentWire = z
|
|
9396
10542
|
.strictObject({
|
|
9397
10543
|
name: z
|
|
@@ -9419,7 +10565,7 @@ export const chargeFlatFeeSystemIntentWire = z
|
|
|
9419
10565
|
export const listCustomerEntitlementAccessResponseDataWire = z
|
|
9420
10566
|
.strictObject({
|
|
9421
10567
|
data: z
|
|
9422
|
-
.array(
|
|
10568
|
+
.array(entitlementValueResultWire)
|
|
9423
10569
|
.describe('The list of entitlement access results.'),
|
|
9424
10570
|
})
|
|
9425
10571
|
.describe('List customer entitlement access response data.');
|
|
@@ -9535,6 +10681,20 @@ export const workflowTaxSettingsWire = z
|
|
|
9535
10681
|
default_tax_config: taxConfigWire.optional(),
|
|
9536
10682
|
})
|
|
9537
10683
|
.describe('Tax settings for a billing workflow.');
|
|
10684
|
+
export const creditBalancesWire = z
|
|
10685
|
+
.strictObject({
|
|
10686
|
+
retrieved_at: dateTimeWire,
|
|
10687
|
+
balances: z
|
|
10688
|
+
.array(creditBalanceWire)
|
|
10689
|
+
.describe('The balances by currencies.'),
|
|
10690
|
+
})
|
|
10691
|
+
.describe('The balances of the credits of a customer.');
|
|
10692
|
+
export const creditTransactionPaginatedResponseWire = z
|
|
10693
|
+
.strictObject({
|
|
10694
|
+
data: z.array(creditTransactionWire),
|
|
10695
|
+
meta: cursorMetaWire,
|
|
10696
|
+
})
|
|
10697
|
+
.describe('Cursor paginated response.');
|
|
9538
10698
|
export const planAddonPagePaginatedResponseWire = z
|
|
9539
10699
|
.strictObject({
|
|
9540
10700
|
data: z.array(planAddonWire),
|
|
@@ -9547,6 +10707,16 @@ export const ingestedEventPaginatedResponseWire = z
|
|
|
9547
10707
|
meta: cursorMetaWire,
|
|
9548
10708
|
})
|
|
9549
10709
|
.describe('Cursor paginated response.');
|
|
10710
|
+
export const entitlementHistoryWire = z
|
|
10711
|
+
.strictObject({
|
|
10712
|
+
windowed_history: z
|
|
10713
|
+
.array(entitlementHistoryWindowWire)
|
|
10714
|
+
.describe('Usage in half-open windows of the requested size, aligned to the requested time zone. Empty windows are included; windows before usage measurement began are omitted.'),
|
|
10715
|
+
burndown_history: z
|
|
10716
|
+
.array(entitlementBurndownSegmentWire)
|
|
10717
|
+
.describe('Periods in which grants were consumed in a fixed order. A new segment starts whenever grant priorities change or a usage period starts.'),
|
|
10718
|
+
})
|
|
10719
|
+
.describe('Balance and usage history of a metered entitlement.');
|
|
9550
10720
|
export const chargeRealizationDetailedLineWire = z
|
|
9551
10721
|
.discriminatedUnion('type', [
|
|
9552
10722
|
chargeRealizationDetailedLineFlatFeeWire,
|
|
@@ -9666,6 +10836,49 @@ export const appStripeCreateCheckoutSessionRequestOptionsWire = z
|
|
|
9666
10836
|
tax_id_collection: appStripeCreateCheckoutSessionTaxIdCollectionWire.optional(),
|
|
9667
10837
|
})
|
|
9668
10838
|
.describe("Configuration options for creating a Stripe Checkout Session. Based on Stripe's [Checkout Session API parameters](https://docs.stripe.com/api/checkout/sessions/create).");
|
|
10839
|
+
export const createEntitlementMeteredRequestWire = z
|
|
10840
|
+
.strictObject({
|
|
10841
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
10842
|
+
feature: featureReferenceWire,
|
|
10843
|
+
labels: labelsWire.optional(),
|
|
10844
|
+
is_soft_limit: z
|
|
10845
|
+
.boolean()
|
|
10846
|
+
.optional()
|
|
10847
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
10848
|
+
issue: entitlementIssueAfterResetWire.optional(),
|
|
10849
|
+
issue_after_reset: numericWire.optional(),
|
|
10850
|
+
issue_after_reset_priority: z
|
|
10851
|
+
.number()
|
|
10852
|
+
.int()
|
|
10853
|
+
.gte(1)
|
|
10854
|
+
.lte(255)
|
|
10855
|
+
.optional()
|
|
10856
|
+
.describe('The priority of the grant created after each reset.'),
|
|
10857
|
+
preserve_overage_at_reset: z
|
|
10858
|
+
.boolean()
|
|
10859
|
+
.optional()
|
|
10860
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
10861
|
+
usage_period: recurringPeriodInputWire,
|
|
10862
|
+
measure_usage_from: entitlementMeasureUsageFromWire.optional(),
|
|
10863
|
+
grants: z
|
|
10864
|
+
.array(entitlementGrantCreateRequestWire)
|
|
10865
|
+
.optional()
|
|
10866
|
+
.describe('Grants created together with the entitlement. Cannot be combined with `issue`.'),
|
|
10867
|
+
})
|
|
10868
|
+
.describe('Metered entitlement create request.');
|
|
10869
|
+
export const entitlementWire = z
|
|
10870
|
+
.discriminatedUnion('type', [
|
|
10871
|
+
entitlementMeteredWire,
|
|
10872
|
+
entitlementStaticWire,
|
|
10873
|
+
entitlementBooleanWire,
|
|
10874
|
+
])
|
|
10875
|
+
.describe('An entitlement grants a customer access to a feature.');
|
|
10876
|
+
export const entitlementGrantPagePaginatedResponseWire = z
|
|
10877
|
+
.strictObject({
|
|
10878
|
+
data: z.array(entitlementGrantWire),
|
|
10879
|
+
meta: paginatedMetaWire,
|
|
10880
|
+
})
|
|
10881
|
+
.describe('Page paginated response.');
|
|
9669
10882
|
export const workflowCollectionAlignmentWire = z
|
|
9670
10883
|
.discriminatedUnion('type', [
|
|
9671
10884
|
workflowCollectionAlignmentSubscriptionWire,
|
|
@@ -9999,7 +11212,7 @@ export const createCreditGrantRequestWire = z
|
|
|
9999
11212
|
currency: createCurrencyCodeWire,
|
|
10000
11213
|
amount: numericWire,
|
|
10001
11214
|
purchase: createCreditGrantPurchaseWire.optional(),
|
|
10002
|
-
tax_config:
|
|
11215
|
+
tax_config: createTaxCodeConfigWire.optional(),
|
|
10003
11216
|
filters: createCreditGrantFiltersWire.optional(),
|
|
10004
11217
|
priority: z
|
|
10005
11218
|
.number()
|
|
@@ -10034,7 +11247,7 @@ export const creditGrantWire = z
|
|
|
10034
11247
|
currency: billingCurrencyCodeWire,
|
|
10035
11248
|
amount: numericWire,
|
|
10036
11249
|
purchase: creditGrantPurchaseWire.optional(),
|
|
10037
|
-
tax_config:
|
|
11250
|
+
tax_config: taxCodeConfigWire.optional(),
|
|
10038
11251
|
invoice: creditGrantInvoiceReferenceWire.optional(),
|
|
10039
11252
|
filters: creditGrantFiltersWire.optional(),
|
|
10040
11253
|
priority: z
|
|
@@ -10096,6 +11309,19 @@ export const customerStripeCreateCheckoutSessionRequestWire = z
|
|
|
10096
11309
|
stripe_options: appStripeCreateCheckoutSessionRequestOptionsWire,
|
|
10097
11310
|
})
|
|
10098
11311
|
.describe('Request to create a Stripe Checkout Session for the customer. Checkout Sessions are used to collect payment method information from customers in a secure, Stripe-hosted interface. This integration uses setup mode to collect payment methods that can be charged later for subscription billing.');
|
|
11312
|
+
export const createEntitlementRequestWire = z
|
|
11313
|
+
.discriminatedUnion('type', [
|
|
11314
|
+
createEntitlementMeteredRequestWire,
|
|
11315
|
+
createEntitlementStaticRequestWire,
|
|
11316
|
+
createEntitlementBooleanRequestWire,
|
|
11317
|
+
])
|
|
11318
|
+
.describe('Entitlement create request.');
|
|
11319
|
+
export const entitlementPagePaginatedResponseWire = z
|
|
11320
|
+
.strictObject({
|
|
11321
|
+
data: z.array(entitlementWire),
|
|
11322
|
+
meta: paginatedMetaWire,
|
|
11323
|
+
})
|
|
11324
|
+
.describe('Page paginated response.');
|
|
10099
11325
|
export const workflowCollectionSettingsWire = z
|
|
10100
11326
|
.strictObject({
|
|
10101
11327
|
alignment: workflowCollectionAlignmentWire.optional(),
|
|
@@ -10188,14 +11414,14 @@ export const rateCardWire = z
|
|
|
10188
11414
|
payment_term: pricePaymentTermWire.optional(),
|
|
10189
11415
|
commitments: spendCommitmentsWire.optional(),
|
|
10190
11416
|
discounts: rateCardDiscountsWire.optional(),
|
|
10191
|
-
tax_config:
|
|
11417
|
+
tax_config: taxCodeConfigWire.optional(),
|
|
10192
11418
|
entitlement: rateCardEntitlementWire.optional(),
|
|
10193
11419
|
})
|
|
10194
11420
|
.describe('A rate card defines the pricing and entitlement of a feature or service.');
|
|
10195
11421
|
export const invoiceLineRateCardWire = z
|
|
10196
11422
|
.strictObject({
|
|
10197
11423
|
price: priceWire,
|
|
10198
|
-
tax_config:
|
|
11424
|
+
tax_config: taxCodeConfigWire.optional(),
|
|
10199
11425
|
feature_key: resourceKeyWire.optional(),
|
|
10200
11426
|
discounts: rateCardDiscountsWire.optional(),
|
|
10201
11427
|
unit_config: unitConfigWire.optional(),
|
|
@@ -10270,7 +11496,7 @@ export const featurePagePaginatedResponseWire = z
|
|
|
10270
11496
|
export const updateInvoiceLineRateCardWire = z
|
|
10271
11497
|
.strictObject({
|
|
10272
11498
|
price: updatePriceWire,
|
|
10273
|
-
tax_config:
|
|
11499
|
+
tax_config: updateTaxCodeConfigWire.optional(),
|
|
10274
11500
|
feature_key: resourceKeyWire.optional(),
|
|
10275
11501
|
discounts: updateDiscountsWire.optional(),
|
|
10276
11502
|
})
|
|
@@ -11231,13 +12457,188 @@ export const getCustomerEntitlementAccessPathParamsWire = z.object({
|
|
|
11231
12457
|
customerId: ulidWire,
|
|
11232
12458
|
featureKey: resourceKeyWire,
|
|
11233
12459
|
});
|
|
11234
|
-
export const
|
|
12460
|
+
export const getCustomerEntitlementAccessResponseWire = entitlementAccessCheckResultWire;
|
|
12461
|
+
export const getCustomerEntitlementValueByFeatureKeyPathParamsWire = z.object({
|
|
12462
|
+
customerId: ulidWire,
|
|
12463
|
+
featureKey: resourceKeyWire,
|
|
12464
|
+
});
|
|
12465
|
+
export const getCustomerEntitlementValueByFeatureKeyQueryParamsWire = z.object({
|
|
11235
12466
|
expand: z
|
|
11236
12467
|
.array(entitlementAccessExpandWire)
|
|
11237
12468
|
.optional()
|
|
11238
12469
|
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
12470
|
+
at: dateTimeWire.optional(),
|
|
12471
|
+
});
|
|
12472
|
+
export const getCustomerEntitlementValueByFeatureKeyResponseWire = entitlementFeatureValueResultWire;
|
|
12473
|
+
export const createCustomerEntitlementPathParamsWire = z.object({
|
|
12474
|
+
customerId: ulidWire,
|
|
12475
|
+
});
|
|
12476
|
+
export const createCustomerEntitlementBodyWire = createEntitlementRequestWire;
|
|
12477
|
+
export const createCustomerEntitlementResponseWire = entitlementWire;
|
|
12478
|
+
export const overrideCustomerEntitlementPathParamsWire = z.object({
|
|
12479
|
+
customerId: ulidWire,
|
|
12480
|
+
entitlementId: ulidWire,
|
|
12481
|
+
});
|
|
12482
|
+
export const overrideCustomerEntitlementBodyWire = createEntitlementRequestWire;
|
|
12483
|
+
export const overrideCustomerEntitlementResponseWire = entitlementWire;
|
|
12484
|
+
export const getCustomerEntitlementHistoryPathParamsWire = z.object({
|
|
12485
|
+
customerId: ulidWire,
|
|
12486
|
+
entitlementId: ulidWire,
|
|
12487
|
+
});
|
|
12488
|
+
export const getCustomerEntitlementHistoryQueryParamsWire = z.object({
|
|
12489
|
+
from: dateTimeWire.optional(),
|
|
12490
|
+
to: dateTimeWire.optional(),
|
|
12491
|
+
window_size: entitlementHistoryWindowSizeWire,
|
|
12492
|
+
time_zone: z.coerce
|
|
12493
|
+
.string()
|
|
12494
|
+
.optional()
|
|
12495
|
+
.describe('The IANA time zone the windows are aligned to.'),
|
|
12496
|
+
});
|
|
12497
|
+
export const getCustomerEntitlementHistoryResponseWire = entitlementHistoryWire;
|
|
12498
|
+
export const getCustomerEntitlementPathParamsWire = z.object({
|
|
12499
|
+
customerId: ulidWire,
|
|
12500
|
+
entitlementId: ulidWire,
|
|
12501
|
+
});
|
|
12502
|
+
export const getCustomerEntitlementResponseWire = entitlementWire;
|
|
12503
|
+
export const listCustomerEntitlementsPathParamsWire = z.object({
|
|
12504
|
+
customerId: ulidWire,
|
|
12505
|
+
});
|
|
12506
|
+
export const listCustomerEntitlementsQueryParamsWire = z.object({
|
|
12507
|
+
page: z
|
|
12508
|
+
.strictObject({
|
|
12509
|
+
size: z.coerce
|
|
12510
|
+
.number()
|
|
12511
|
+
.int()
|
|
12512
|
+
.optional()
|
|
12513
|
+
.describe('The number of items to include per page.'),
|
|
12514
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12515
|
+
})
|
|
12516
|
+
.optional()
|
|
12517
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12518
|
+
sort: z
|
|
12519
|
+
.string()
|
|
12520
|
+
.optional()
|
|
12521
|
+
.describe('Sort entitlements returned in the response. Supported sort attributes are: - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
12522
|
+
filter: listCustomerEntitlementsParamsFilterWire.optional(),
|
|
12523
|
+
});
|
|
12524
|
+
export const listCustomerEntitlementsResponseWire = z.strictObject({
|
|
12525
|
+
data: z.array(entitlementWire),
|
|
12526
|
+
meta: paginatedMetaWire,
|
|
12527
|
+
});
|
|
12528
|
+
export const resetCustomerEntitlementUsagePathParamsWire = z.object({
|
|
12529
|
+
customerId: ulidWire,
|
|
12530
|
+
entitlementId: ulidWire,
|
|
12531
|
+
});
|
|
12532
|
+
export const resetCustomerEntitlementUsageBodyWire = resetCustomerEntitlementUsageRequestWire;
|
|
12533
|
+
export const deleteCustomerEntitlementPathParamsWire = z.object({
|
|
12534
|
+
customerId: ulidWire,
|
|
12535
|
+
entitlementId: ulidWire,
|
|
12536
|
+
});
|
|
12537
|
+
export const listEntitlementsQueryParamsWire = z.object({
|
|
12538
|
+
page: z
|
|
12539
|
+
.strictObject({
|
|
12540
|
+
size: z.coerce
|
|
12541
|
+
.number()
|
|
12542
|
+
.int()
|
|
12543
|
+
.optional()
|
|
12544
|
+
.describe('The number of items to include per page.'),
|
|
12545
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12546
|
+
})
|
|
12547
|
+
.optional()
|
|
12548
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12549
|
+
sort: z
|
|
12550
|
+
.string()
|
|
12551
|
+
.optional()
|
|
12552
|
+
.describe('Sort entitlements returned in the response. Supported sort attributes are: - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
12553
|
+
filter: listEntitlementsParamsFilterWire.optional(),
|
|
12554
|
+
});
|
|
12555
|
+
export const listEntitlementsResponseWire = z.strictObject({
|
|
12556
|
+
data: z.array(entitlementWire),
|
|
12557
|
+
meta: paginatedMetaWire,
|
|
12558
|
+
});
|
|
12559
|
+
export const getEntitlementPathParamsWire = z.object({
|
|
12560
|
+
entitlementId: ulidWire,
|
|
12561
|
+
});
|
|
12562
|
+
export const getEntitlementResponseWire = entitlementWire;
|
|
12563
|
+
export const createCustomerEntitlementGrantPathParamsWire = z.object({
|
|
12564
|
+
customerId: ulidWire,
|
|
12565
|
+
entitlementId: ulidWire,
|
|
12566
|
+
});
|
|
12567
|
+
export const createCustomerEntitlementGrantBodyWire = entitlementGrantCreateRequestWire;
|
|
12568
|
+
export const createCustomerEntitlementGrantResponseWire = entitlementGrantWire;
|
|
12569
|
+
export const listCustomerEntitlementGrantsPathParamsWire = z.object({
|
|
12570
|
+
customerId: ulidWire,
|
|
12571
|
+
entitlementId: ulidWire,
|
|
12572
|
+
});
|
|
12573
|
+
export const listCustomerEntitlementGrantsQueryParamsWire = z.object({
|
|
12574
|
+
page: z
|
|
12575
|
+
.strictObject({
|
|
12576
|
+
size: z.coerce
|
|
12577
|
+
.number()
|
|
12578
|
+
.int()
|
|
12579
|
+
.optional()
|
|
12580
|
+
.describe('The number of items to include per page.'),
|
|
12581
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12582
|
+
})
|
|
12583
|
+
.optional()
|
|
12584
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12585
|
+
sort: z
|
|
12586
|
+
.string()
|
|
12587
|
+
.optional()
|
|
12588
|
+
.describe('Sort grants returned in the response. Supported sort attributes are: - `created_at` (default) - `updated_at` - `effective_at` - `expires_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
12589
|
+
include_deleted: z.coerce
|
|
12590
|
+
.boolean()
|
|
12591
|
+
.optional()
|
|
12592
|
+
.describe('Include deleted grants in the response.'),
|
|
12593
|
+
});
|
|
12594
|
+
export const listCustomerEntitlementGrantsResponseWire = z.strictObject({
|
|
12595
|
+
data: z.array(entitlementGrantWire),
|
|
12596
|
+
meta: paginatedMetaWire,
|
|
12597
|
+
});
|
|
12598
|
+
export const getCustomerEntitlementValuePathParamsWire = z.object({
|
|
12599
|
+
customerId: ulidWire,
|
|
12600
|
+
entitlementId: ulidWire,
|
|
12601
|
+
});
|
|
12602
|
+
export const getCustomerEntitlementValueQueryParamsWire = z.object({
|
|
12603
|
+
expand: z
|
|
12604
|
+
.array(entitlementAccessExpandWire)
|
|
12605
|
+
.optional()
|
|
12606
|
+
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
12607
|
+
at: dateTimeWire.optional(),
|
|
12608
|
+
});
|
|
12609
|
+
export const getCustomerEntitlementValueResponseWire = entitlementValueResultWire;
|
|
12610
|
+
export const listGrantsQueryParamsWire = z.object({
|
|
12611
|
+
page: z
|
|
12612
|
+
.strictObject({
|
|
12613
|
+
size: z.coerce
|
|
12614
|
+
.number()
|
|
12615
|
+
.int()
|
|
12616
|
+
.optional()
|
|
12617
|
+
.describe('The number of items to include per page.'),
|
|
12618
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12619
|
+
})
|
|
12620
|
+
.optional()
|
|
12621
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12622
|
+
sort: z
|
|
12623
|
+
.string()
|
|
12624
|
+
.optional()
|
|
12625
|
+
.describe('Sort grants returned in the response. Supported sort attributes are: - `created_at` (default) - `updated_at` - `effective_at` - `expires_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
12626
|
+
filter: listGrantsParamsFilterWire.optional(),
|
|
12627
|
+
include_deleted: z.coerce
|
|
12628
|
+
.boolean()
|
|
12629
|
+
.optional()
|
|
12630
|
+
.describe('Include deleted grants in the response.'),
|
|
12631
|
+
});
|
|
12632
|
+
export const listGrantsResponseWire = z.strictObject({
|
|
12633
|
+
data: z.array(entitlementGrantWire),
|
|
12634
|
+
meta: paginatedMetaWire,
|
|
12635
|
+
});
|
|
12636
|
+
export const voidGrantPathParamsWire = z.object({
|
|
12637
|
+
grantId: ulidWire,
|
|
12638
|
+
});
|
|
12639
|
+
export const voidGrantQueryParamsWire = z.object({
|
|
12640
|
+
voided_at: dateTimeWire.optional(),
|
|
11239
12641
|
});
|
|
11240
|
-
export const getCustomerEntitlementAccessResponseWire = entitlementAccessResultWire;
|
|
11241
12642
|
export const createCreditGrantPathParamsWire = z.object({
|
|
11242
12643
|
customerId: ulidWire,
|
|
11243
12644
|
});
|
|
@@ -11931,3 +13332,39 @@ export const queryEntitlementAccessQueryParamsWire = z.object({
|
|
|
11931
13332
|
});
|
|
11932
13333
|
export const queryEntitlementAccessBodyWire = entitlementAccessQueryRequestWire;
|
|
11933
13334
|
export const queryEntitlementAccessResponseWire = entitlementAccessQueryResponseWire;
|
|
13335
|
+
export const listNotificationChannelsQueryParamsWire = z.object({
|
|
13336
|
+
page: z
|
|
13337
|
+
.strictObject({
|
|
13338
|
+
size: z.coerce
|
|
13339
|
+
.number()
|
|
13340
|
+
.int()
|
|
13341
|
+
.optional()
|
|
13342
|
+
.describe('The number of items to include per page.'),
|
|
13343
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
13344
|
+
})
|
|
13345
|
+
.optional()
|
|
13346
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
13347
|
+
sort: z
|
|
13348
|
+
.string()
|
|
13349
|
+
.optional()
|
|
13350
|
+
.describe('Sort notification channels returned in the response. Supported sort attributes are: - `id` (default) - `type` - `created_at` - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
13351
|
+
filter: listNotificationChannelsParamsFilterWire.optional(),
|
|
13352
|
+
});
|
|
13353
|
+
export const listNotificationChannelsResponseWire = z.strictObject({
|
|
13354
|
+
data: z.array(notificationChannelWire),
|
|
13355
|
+
meta: paginatedMetaWire,
|
|
13356
|
+
});
|
|
13357
|
+
export const createNotificationChannelBodyWire = createNotificationChannelRequestWire;
|
|
13358
|
+
export const createNotificationChannelResponseWire = notificationChannelWire;
|
|
13359
|
+
export const getNotificationChannelPathParamsWire = z.object({
|
|
13360
|
+
notificationChannelId: ulidWire,
|
|
13361
|
+
});
|
|
13362
|
+
export const getNotificationChannelResponseWire = notificationChannelWire;
|
|
13363
|
+
export const updateNotificationChannelPathParamsWire = z.object({
|
|
13364
|
+
notificationChannelId: ulidWire,
|
|
13365
|
+
});
|
|
13366
|
+
export const updateNotificationChannelBodyWire = updateBillingNotificationChannelRequestWire;
|
|
13367
|
+
export const updateNotificationChannelResponseWire = notificationChannelWire;
|
|
13368
|
+
export const deleteNotificationChannelPathParamsWire = z.object({
|
|
13369
|
+
notificationChannelId: ulidWire,
|
|
13370
|
+
});
|