@openmeter/client 1.0.0-beta.233 → 1.0.0-beta.234
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 +52 -14
- 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 +3 -1
- 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 +6549 -2716
- package/dist/models/schemas.js +1795 -360
- package/dist/models/types.d.ts +1175 -228
- package/dist/sdk/apps.d.ts +20 -1
- package/dist/sdk/apps.js +24 -1
- package/dist/sdk/entitlements.d.ts +1 -9
- package/dist/sdk/entitlements.js +1 -11
- package/dist/sdk/internal.d.ts +324 -22
- package/dist/sdk/internal.js +397 -25
- package/dist/sdk/notifications.d.ts +58 -0
- package/dist/sdk/notifications.js +72 -0
- package/dist/sdk/subscriptions.d.ts +1 -9
- package/dist/sdk/subscriptions.js +1 -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
|
+
in: 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
|
+
in: 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(),
|
|
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.'),
|
|
2543
2677
|
})
|
|
2544
|
-
.describe(
|
|
2545
|
-
export const
|
|
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 updateNotificationChannelRequest = 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
|
-
})
|
|
2570
|
-
.describe('CreditAdjustment create request.');
|
|
2571
|
-
export const listCreditTransactionsParamsFilter = z
|
|
2572
|
-
.object({
|
|
2573
|
-
type: creditTransactionType.optional(),
|
|
2574
|
-
currency: billingCurrencyCode.optional(),
|
|
2575
|
-
featureKey: stringFieldFilter.optional(),
|
|
2576
2770
|
})
|
|
2577
|
-
.describe(
|
|
2578
|
-
export const
|
|
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
|
|
2780
|
-
.object({
|
|
2781
|
-
behavior: taxBehavior.optional(),
|
|
2782
|
-
taxCode: taxCodeReference.optional(),
|
|
2783
|
-
})
|
|
2784
|
-
.describe('Tax configuration for a credit grant. Tax configuration should be provided to ensure correct revenue recognition, including for externally funded grants.');
|
|
2785
|
-
export const rateCardTaxConfig = z
|
|
3004
|
+
export const taxCodeConfig = z
|
|
2786
3005
|
.object({
|
|
2787
3006
|
behavior: taxBehavior.optional(),
|
|
2788
|
-
code: taxCodeReference,
|
|
3007
|
+
code: taxCodeReference.optional(),
|
|
2789
3008
|
})
|
|
2790
|
-
.describe('
|
|
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,147 @@ 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
|
+
amount: numeric,
|
|
3617
|
+
priority: z
|
|
3618
|
+
.number()
|
|
3619
|
+
.int()
|
|
3620
|
+
.nonnegative()
|
|
3621
|
+
.lte(255)
|
|
3622
|
+
.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.'),
|
|
3623
|
+
effectiveAt: dateTime,
|
|
3624
|
+
expiresAfter: iso8601Duration.optional(),
|
|
3625
|
+
expiresAt: dateTime.optional(),
|
|
3626
|
+
maxRolloverAmount: numeric,
|
|
3627
|
+
minRolloverAmount: numeric,
|
|
3628
|
+
recurrence: recurringPeriod.optional(),
|
|
3629
|
+
nextRecurrence: dateTime.optional(),
|
|
3630
|
+
voidedAt: dateTime.optional(),
|
|
3631
|
+
labels: labels.optional(),
|
|
3632
|
+
createdAt: dateTime,
|
|
3633
|
+
updatedAt: dateTime,
|
|
3634
|
+
deletedAt: dateTime.optional(),
|
|
3635
|
+
})
|
|
3636
|
+
.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.");
|
|
3637
|
+
export const workflowCollectionAlignmentAnchored = z
|
|
3638
|
+
.object({
|
|
3639
|
+
type: z.literal('anchored').describe('The type of alignment.'),
|
|
3640
|
+
recurringPeriod: recurringPeriod,
|
|
3641
|
+
})
|
|
3642
|
+
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
3217
3643
|
export const rateCardEntitlement = z
|
|
3218
3644
|
.discriminatedUnion('type', [
|
|
3219
3645
|
rateCardMeteredEntitlement,
|
|
@@ -3229,12 +3655,30 @@ export const subscriptionEditAddPhase = z
|
|
|
3229
3655
|
phase: subscriptionPhaseCreate,
|
|
3230
3656
|
})
|
|
3231
3657
|
.describe('Add a new phase to the subscription. The phase is created without items; use add-item operations to populate it.');
|
|
3232
|
-
export const
|
|
3658
|
+
export const createCreditGrantFilters = z
|
|
3233
3659
|
.object({
|
|
3234
|
-
|
|
3235
|
-
|
|
3660
|
+
features: z
|
|
3661
|
+
.array(resourceKey)
|
|
3662
|
+
.optional()
|
|
3663
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
3664
|
+
plans: z
|
|
3665
|
+
.array(createCreditGrantPlanFilter)
|
|
3666
|
+
.optional()
|
|
3667
|
+
.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
3668
|
})
|
|
3237
|
-
.describe('
|
|
3669
|
+
.describe('Filters for the credit grant.');
|
|
3670
|
+
export const creditGrantFilters = z
|
|
3671
|
+
.object({
|
|
3672
|
+
features: z
|
|
3673
|
+
.array(resourceKey)
|
|
3674
|
+
.optional()
|
|
3675
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
3676
|
+
plans: z
|
|
3677
|
+
.array(creditGrantPlanFilter)
|
|
3678
|
+
.optional()
|
|
3679
|
+
.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.'),
|
|
3680
|
+
})
|
|
3681
|
+
.describe('Filters for the credit grant.');
|
|
3238
3682
|
export const subscriptionBase = z
|
|
3239
3683
|
.object({
|
|
3240
3684
|
id: ulid,
|
|
@@ -3435,6 +3879,12 @@ export const entitlementFeatureAccess = z
|
|
|
3435
3879
|
reason: entitlementFeatureAccessReason.optional(),
|
|
3436
3880
|
})
|
|
3437
3881
|
.describe('Access status for a single feature.');
|
|
3882
|
+
export const notificationChannelPagePaginatedResponse = z
|
|
3883
|
+
.object({
|
|
3884
|
+
data: z.array(notificationChannel),
|
|
3885
|
+
meta: paginatedMeta,
|
|
3886
|
+
})
|
|
3887
|
+
.describe('Page paginated response.');
|
|
3438
3888
|
export const customerData = z
|
|
3439
3889
|
.object({
|
|
3440
3890
|
billingProfile: profileReference.optional(),
|
|
@@ -3447,18 +3897,6 @@ export const upsertCustomerBillingDataRequest = z
|
|
|
3447
3897
|
appData: appCustomerData.optional(),
|
|
3448
3898
|
})
|
|
3449
3899
|
.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
3900
|
export const chargeFlatFeeSystemIntent = z
|
|
3463
3901
|
.object({
|
|
3464
3902
|
name: z
|
|
@@ -3486,7 +3924,7 @@ export const chargeFlatFeeSystemIntent = z
|
|
|
3486
3924
|
export const listCustomerEntitlementAccessResponseData = z
|
|
3487
3925
|
.object({
|
|
3488
3926
|
data: z
|
|
3489
|
-
.array(
|
|
3927
|
+
.array(entitlementValueResult)
|
|
3490
3928
|
.describe('The list of entitlement access results.'),
|
|
3491
3929
|
})
|
|
3492
3930
|
.describe('List customer entitlement access response data.');
|
|
@@ -3605,6 +4043,18 @@ export const workflowTaxSettings = z
|
|
|
3605
4043
|
defaultTaxConfig: taxConfig.optional(),
|
|
3606
4044
|
})
|
|
3607
4045
|
.describe('Tax settings for a billing workflow.');
|
|
4046
|
+
export const creditBalances = z
|
|
4047
|
+
.object({
|
|
4048
|
+
retrievedAt: dateTime,
|
|
4049
|
+
balances: z.array(creditBalance).describe('The balances by currencies.'),
|
|
4050
|
+
})
|
|
4051
|
+
.describe('The balances of the credits of a customer.');
|
|
4052
|
+
export const creditTransactionPaginatedResponse = z
|
|
4053
|
+
.object({
|
|
4054
|
+
data: z.array(creditTransaction),
|
|
4055
|
+
meta: cursorMeta,
|
|
4056
|
+
})
|
|
4057
|
+
.describe('Cursor paginated response.');
|
|
3608
4058
|
export const planAddonPagePaginatedResponse = z
|
|
3609
4059
|
.object({
|
|
3610
4060
|
data: z.array(planAddon),
|
|
@@ -3617,6 +4067,16 @@ export const ingestedEventPaginatedResponse = z
|
|
|
3617
4067
|
meta: cursorMeta,
|
|
3618
4068
|
})
|
|
3619
4069
|
.describe('Cursor paginated response.');
|
|
4070
|
+
export const entitlementHistory = z
|
|
4071
|
+
.object({
|
|
4072
|
+
windowedHistory: z
|
|
4073
|
+
.array(entitlementHistoryWindow)
|
|
4074
|
+
.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.'),
|
|
4075
|
+
burndownHistory: z
|
|
4076
|
+
.array(entitlementBurndownSegment)
|
|
4077
|
+
.describe('Periods in which grants were consumed in a fixed order. A new segment starts whenever grant priorities change or a usage period starts.'),
|
|
4078
|
+
})
|
|
4079
|
+
.describe('Balance and usage history of a metered entitlement.');
|
|
3620
4080
|
export const chargeRealizationDetailedLine = z
|
|
3621
4081
|
.discriminatedUnion('type', [
|
|
3622
4082
|
chargeRealizationDetailedLineFlatFee,
|
|
@@ -3739,6 +4199,52 @@ export const appStripeCreateCheckoutSessionRequestOptions = z
|
|
|
3739
4199
|
taxIdCollection: appStripeCreateCheckoutSessionTaxIdCollection.optional(),
|
|
3740
4200
|
})
|
|
3741
4201
|
.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).");
|
|
4202
|
+
export const createEntitlementMeteredRequest = z
|
|
4203
|
+
.object({
|
|
4204
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
4205
|
+
feature: featureReference,
|
|
4206
|
+
labels: labels.optional(),
|
|
4207
|
+
isSoftLimit: z
|
|
4208
|
+
.boolean()
|
|
4209
|
+
.optional()
|
|
4210
|
+
.default(false)
|
|
4211
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
4212
|
+
issue: entitlementIssueAfterReset.optional(),
|
|
4213
|
+
issueAfterReset: numeric.optional(),
|
|
4214
|
+
issueAfterResetPriority: z
|
|
4215
|
+
.number()
|
|
4216
|
+
.int()
|
|
4217
|
+
.gte(1)
|
|
4218
|
+
.lte(255)
|
|
4219
|
+
.optional()
|
|
4220
|
+
.default(1)
|
|
4221
|
+
.describe('The priority of the grant created after each reset.'),
|
|
4222
|
+
preserveOverageAtReset: z
|
|
4223
|
+
.boolean()
|
|
4224
|
+
.optional()
|
|
4225
|
+
.default(false)
|
|
4226
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
4227
|
+
usagePeriod: recurringPeriodInput,
|
|
4228
|
+
measureUsageFrom: entitlementMeasureUsageFrom.optional(),
|
|
4229
|
+
grants: z
|
|
4230
|
+
.array(entitlementGrantCreateRequest)
|
|
4231
|
+
.optional()
|
|
4232
|
+
.describe('Grants created together with the entitlement. Cannot be combined with `issue`.'),
|
|
4233
|
+
})
|
|
4234
|
+
.describe('Metered entitlement create request.');
|
|
4235
|
+
export const entitlement = z
|
|
4236
|
+
.discriminatedUnion('type', [
|
|
4237
|
+
entitlementMetered,
|
|
4238
|
+
entitlementStatic,
|
|
4239
|
+
entitlementBoolean,
|
|
4240
|
+
])
|
|
4241
|
+
.describe('An entitlement grants a customer access to a feature.');
|
|
4242
|
+
export const entitlementGrantPagePaginatedResponse = z
|
|
4243
|
+
.object({
|
|
4244
|
+
data: z.array(entitlementGrant),
|
|
4245
|
+
meta: paginatedMeta,
|
|
4246
|
+
})
|
|
4247
|
+
.describe('Page paginated response.');
|
|
3742
4248
|
export const workflowCollectionAlignment = z
|
|
3743
4249
|
.discriminatedUnion('type', [
|
|
3744
4250
|
workflowCollectionAlignmentSubscription,
|
|
@@ -4068,7 +4574,7 @@ export const createCreditGrantRequest = z
|
|
|
4068
4574
|
currency: createCurrencyCode,
|
|
4069
4575
|
amount: numeric,
|
|
4070
4576
|
purchase: createCreditGrantPurchase.optional(),
|
|
4071
|
-
taxConfig:
|
|
4577
|
+
taxConfig: createTaxCodeConfig.optional(),
|
|
4072
4578
|
filters: createCreditGrantFilters.optional(),
|
|
4073
4579
|
priority: z
|
|
4074
4580
|
.number()
|
|
@@ -4104,7 +4610,7 @@ export const creditGrant = z
|
|
|
4104
4610
|
currency: billingCurrencyCode,
|
|
4105
4611
|
amount: numeric,
|
|
4106
4612
|
purchase: creditGrantPurchase.optional(),
|
|
4107
|
-
taxConfig:
|
|
4613
|
+
taxConfig: taxCodeConfig.optional(),
|
|
4108
4614
|
invoice: creditGrantInvoiceReference.optional(),
|
|
4109
4615
|
filters: creditGrantFilters.optional(),
|
|
4110
4616
|
priority: z
|
|
@@ -4167,6 +4673,19 @@ export const customerStripeCreateCheckoutSessionRequest = z
|
|
|
4167
4673
|
stripeOptions: appStripeCreateCheckoutSessionRequestOptions,
|
|
4168
4674
|
})
|
|
4169
4675
|
.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.');
|
|
4676
|
+
export const createEntitlementRequest = z
|
|
4677
|
+
.discriminatedUnion('type', [
|
|
4678
|
+
createEntitlementMeteredRequest,
|
|
4679
|
+
createEntitlementStaticRequest,
|
|
4680
|
+
createEntitlementBooleanRequest,
|
|
4681
|
+
])
|
|
4682
|
+
.describe('Entitlement create request.');
|
|
4683
|
+
export const entitlementPagePaginatedResponse = z
|
|
4684
|
+
.object({
|
|
4685
|
+
data: z.array(entitlement),
|
|
4686
|
+
meta: paginatedMeta,
|
|
4687
|
+
})
|
|
4688
|
+
.describe('Page paginated response.');
|
|
4170
4689
|
export const workflowCollectionSettings = z
|
|
4171
4690
|
.object({
|
|
4172
4691
|
alignment: workflowCollectionAlignment.optional().default({
|
|
@@ -4258,14 +4777,14 @@ export const rateCard = z
|
|
|
4258
4777
|
paymentTerm: pricePaymentTerm.optional().default('in_arrears'),
|
|
4259
4778
|
commitments: spendCommitments.optional(),
|
|
4260
4779
|
discounts: rateCardDiscounts.optional(),
|
|
4261
|
-
taxConfig:
|
|
4780
|
+
taxConfig: taxCodeConfig.optional(),
|
|
4262
4781
|
entitlement: rateCardEntitlement.optional(),
|
|
4263
4782
|
})
|
|
4264
4783
|
.describe('A rate card defines the pricing and entitlement of a feature or service.');
|
|
4265
4784
|
export const invoiceLineRateCard = z
|
|
4266
4785
|
.object({
|
|
4267
4786
|
price: price,
|
|
4268
|
-
taxConfig:
|
|
4787
|
+
taxConfig: taxCodeConfig.optional(),
|
|
4269
4788
|
featureKey: resourceKey.optional(),
|
|
4270
4789
|
discounts: rateCardDiscounts.optional(),
|
|
4271
4790
|
unitConfig: unitConfig.optional(),
|
|
@@ -4340,7 +4859,7 @@ export const featurePagePaginatedResponse = z
|
|
|
4340
4859
|
export const updateInvoiceLineRateCard = z
|
|
4341
4860
|
.object({
|
|
4342
4861
|
price: updatePrice,
|
|
4343
|
-
taxConfig:
|
|
4862
|
+
taxConfig: updateTaxCodeConfig.optional(),
|
|
4344
4863
|
featureKey: resourceKey.optional(),
|
|
4345
4864
|
discounts: updateDiscounts.optional(),
|
|
4346
4865
|
})
|
|
@@ -5290,18 +5809,182 @@ export const createCustomerStripePortalSessionResponse = appStripeCreateCustomer
|
|
|
5290
5809
|
export const listCustomerEntitlementAccessPathParams = z.object({
|
|
5291
5810
|
customerId: ulid,
|
|
5292
5811
|
});
|
|
5293
|
-
export const listCustomerEntitlementAccessResponse = listCustomerEntitlementAccessResponseData;
|
|
5294
|
-
export const getCustomerEntitlementAccessPathParams = z.object({
|
|
5812
|
+
export const listCustomerEntitlementAccessResponse = listCustomerEntitlementAccessResponseData;
|
|
5813
|
+
export const getCustomerEntitlementAccessPathParams = z.object({
|
|
5814
|
+
customerId: ulid,
|
|
5815
|
+
featureKey: resourceKey,
|
|
5816
|
+
});
|
|
5817
|
+
export const getCustomerEntitlementAccessResponse = entitlementAccessCheckResult;
|
|
5818
|
+
export const getCustomerEntitlementValueByFeatureKeyPathParams = z.object({
|
|
5819
|
+
customerId: ulid,
|
|
5820
|
+
featureKey: resourceKey,
|
|
5821
|
+
});
|
|
5822
|
+
export const getCustomerEntitlementValueByFeatureKeyQueryParams = z.object({
|
|
5823
|
+
expand: z
|
|
5824
|
+
.array(entitlementAccessExpand)
|
|
5825
|
+
.optional()
|
|
5826
|
+
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
5827
|
+
at: dateTime.optional(),
|
|
5828
|
+
});
|
|
5829
|
+
export const getCustomerEntitlementValueByFeatureKeyResponse = entitlementFeatureValueResult;
|
|
5830
|
+
export const createCustomerEntitlementPathParams = z.object({
|
|
5831
|
+
customerId: ulid,
|
|
5832
|
+
});
|
|
5833
|
+
export const createCustomerEntitlementBody = createEntitlementRequest;
|
|
5834
|
+
export const createCustomerEntitlementResponse = entitlement;
|
|
5835
|
+
export const overrideCustomerEntitlementPathParams = z.object({
|
|
5836
|
+
customerId: ulid,
|
|
5837
|
+
entitlementId: ulid,
|
|
5838
|
+
});
|
|
5839
|
+
export const overrideCustomerEntitlementBody = createEntitlementRequest;
|
|
5840
|
+
export const overrideCustomerEntitlementResponse = entitlement;
|
|
5841
|
+
export const getCustomerEntitlementHistoryPathParams = z.object({
|
|
5842
|
+
customerId: ulid,
|
|
5843
|
+
entitlementId: ulid,
|
|
5844
|
+
});
|
|
5845
|
+
export const getCustomerEntitlementHistoryQueryParams = z.object({
|
|
5846
|
+
from: dateTime.optional(),
|
|
5847
|
+
to: dateTime.optional(),
|
|
5848
|
+
windowSize: entitlementHistoryWindowSize,
|
|
5849
|
+
timeZone: z.coerce
|
|
5850
|
+
.string()
|
|
5851
|
+
.optional()
|
|
5852
|
+
.default('UTC')
|
|
5853
|
+
.describe('The IANA time zone the windows are aligned to.'),
|
|
5854
|
+
});
|
|
5855
|
+
export const getCustomerEntitlementHistoryResponse = entitlementHistory;
|
|
5856
|
+
export const getCustomerEntitlementPathParams = z.object({
|
|
5857
|
+
customerId: ulid,
|
|
5858
|
+
entitlementId: ulid,
|
|
5859
|
+
});
|
|
5860
|
+
export const getCustomerEntitlementResponse = entitlement;
|
|
5861
|
+
export const listCustomerEntitlementsPathParams = z.object({
|
|
5862
|
+
customerId: ulid,
|
|
5863
|
+
});
|
|
5864
|
+
export const listCustomerEntitlementsQueryParams = z.object({
|
|
5865
|
+
page: z
|
|
5866
|
+
.object({
|
|
5867
|
+
size: z.coerce
|
|
5868
|
+
.number()
|
|
5869
|
+
.int()
|
|
5870
|
+
.optional()
|
|
5871
|
+
.describe('The number of items to include per page.'),
|
|
5872
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5873
|
+
})
|
|
5874
|
+
.optional()
|
|
5875
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5876
|
+
sort: sortQuery.optional(),
|
|
5877
|
+
filter: listCustomerEntitlementsParamsFilter.optional(),
|
|
5878
|
+
});
|
|
5879
|
+
export const listCustomerEntitlementsResponse = z.object({
|
|
5880
|
+
data: z.array(entitlement),
|
|
5881
|
+
meta: paginatedMeta,
|
|
5882
|
+
});
|
|
5883
|
+
export const resetCustomerEntitlementUsagePathParams = z.object({
|
|
5884
|
+
customerId: ulid,
|
|
5885
|
+
entitlementId: ulid,
|
|
5886
|
+
});
|
|
5887
|
+
export const resetCustomerEntitlementUsageBody = resetCustomerEntitlementUsageRequest;
|
|
5888
|
+
export const deleteCustomerEntitlementPathParams = z.object({
|
|
5889
|
+
customerId: ulid,
|
|
5890
|
+
entitlementId: ulid,
|
|
5891
|
+
});
|
|
5892
|
+
export const listEntitlementsQueryParams = z.object({
|
|
5893
|
+
page: z
|
|
5894
|
+
.object({
|
|
5895
|
+
size: z.coerce
|
|
5896
|
+
.number()
|
|
5897
|
+
.int()
|
|
5898
|
+
.optional()
|
|
5899
|
+
.describe('The number of items to include per page.'),
|
|
5900
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5901
|
+
})
|
|
5902
|
+
.optional()
|
|
5903
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5904
|
+
sort: sortQuery.optional(),
|
|
5905
|
+
filter: listEntitlementsParamsFilter.optional(),
|
|
5906
|
+
});
|
|
5907
|
+
export const listEntitlementsResponse = z.object({
|
|
5908
|
+
data: z.array(entitlement),
|
|
5909
|
+
meta: paginatedMeta,
|
|
5910
|
+
});
|
|
5911
|
+
export const getEntitlementPathParams = z.object({
|
|
5912
|
+
entitlementId: ulid,
|
|
5913
|
+
});
|
|
5914
|
+
export const getEntitlementResponse = entitlement;
|
|
5915
|
+
export const createCustomerEntitlementGrantPathParams = z.object({
|
|
5916
|
+
customerId: ulid,
|
|
5917
|
+
entitlementId: ulid,
|
|
5918
|
+
});
|
|
5919
|
+
export const createCustomerEntitlementGrantBody = entitlementGrantCreateRequest;
|
|
5920
|
+
export const createCustomerEntitlementGrantResponse = entitlementGrant;
|
|
5921
|
+
export const listCustomerEntitlementGrantsPathParams = z.object({
|
|
5922
|
+
customerId: ulid,
|
|
5923
|
+
entitlementId: ulid,
|
|
5924
|
+
});
|
|
5925
|
+
export const listCustomerEntitlementGrantsQueryParams = z.object({
|
|
5926
|
+
page: z
|
|
5927
|
+
.object({
|
|
5928
|
+
size: z.coerce
|
|
5929
|
+
.number()
|
|
5930
|
+
.int()
|
|
5931
|
+
.optional()
|
|
5932
|
+
.describe('The number of items to include per page.'),
|
|
5933
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5934
|
+
})
|
|
5935
|
+
.optional()
|
|
5936
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5937
|
+
sort: sortQuery.optional(),
|
|
5938
|
+
includeDeleted: z.coerce
|
|
5939
|
+
.boolean()
|
|
5940
|
+
.optional()
|
|
5941
|
+
.describe('Include deleted grants in the response.'),
|
|
5942
|
+
});
|
|
5943
|
+
export const listCustomerEntitlementGrantsResponse = z.object({
|
|
5944
|
+
data: z.array(entitlementGrant),
|
|
5945
|
+
meta: paginatedMeta,
|
|
5946
|
+
});
|
|
5947
|
+
export const getCustomerEntitlementValuePathParams = z.object({
|
|
5295
5948
|
customerId: ulid,
|
|
5296
|
-
|
|
5949
|
+
entitlementId: ulid,
|
|
5297
5950
|
});
|
|
5298
|
-
export const
|
|
5951
|
+
export const getCustomerEntitlementValueQueryParams = z.object({
|
|
5299
5952
|
expand: z
|
|
5300
5953
|
.array(entitlementAccessExpand)
|
|
5301
5954
|
.optional()
|
|
5302
5955
|
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
5956
|
+
at: dateTime.optional(),
|
|
5957
|
+
});
|
|
5958
|
+
export const getCustomerEntitlementValueResponse = entitlementValueResult;
|
|
5959
|
+
export const listGrantsQueryParams = z.object({
|
|
5960
|
+
page: z
|
|
5961
|
+
.object({
|
|
5962
|
+
size: z.coerce
|
|
5963
|
+
.number()
|
|
5964
|
+
.int()
|
|
5965
|
+
.optional()
|
|
5966
|
+
.describe('The number of items to include per page.'),
|
|
5967
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5968
|
+
})
|
|
5969
|
+
.optional()
|
|
5970
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5971
|
+
sort: sortQuery.optional(),
|
|
5972
|
+
filter: listGrantsParamsFilter.optional(),
|
|
5973
|
+
includeDeleted: z.coerce
|
|
5974
|
+
.boolean()
|
|
5975
|
+
.optional()
|
|
5976
|
+
.describe('Include deleted grants in the response.'),
|
|
5977
|
+
});
|
|
5978
|
+
export const listGrantsResponse = z.object({
|
|
5979
|
+
data: z.array(entitlementGrant),
|
|
5980
|
+
meta: paginatedMeta,
|
|
5981
|
+
});
|
|
5982
|
+
export const voidGrantPathParams = z.object({
|
|
5983
|
+
grantId: ulid,
|
|
5984
|
+
});
|
|
5985
|
+
export const voidGrantQueryParams = z.object({
|
|
5986
|
+
voidedAt: dateTime.optional(),
|
|
5303
5987
|
});
|
|
5304
|
-
export const getCustomerEntitlementAccessResponse = entitlementAccessResult;
|
|
5305
5988
|
export const createCreditGrantPathParams = z.object({
|
|
5306
5989
|
customerId: ulid,
|
|
5307
5990
|
});
|
|
@@ -5956,6 +6639,39 @@ export const queryEntitlementAccessQueryParams = z.object({
|
|
|
5956
6639
|
});
|
|
5957
6640
|
export const queryEntitlementAccessBody = entitlementAccessQueryRequest;
|
|
5958
6641
|
export const queryEntitlementAccessResponse = entitlementAccessQueryResponse;
|
|
6642
|
+
export const listNotificationChannelsQueryParams = z.object({
|
|
6643
|
+
page: z
|
|
6644
|
+
.object({
|
|
6645
|
+
size: z.coerce
|
|
6646
|
+
.number()
|
|
6647
|
+
.int()
|
|
6648
|
+
.optional()
|
|
6649
|
+
.describe('The number of items to include per page.'),
|
|
6650
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
6651
|
+
})
|
|
6652
|
+
.optional()
|
|
6653
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
6654
|
+
sort: sortQuery.optional(),
|
|
6655
|
+
filter: listNotificationChannelsParamsFilter.optional(),
|
|
6656
|
+
});
|
|
6657
|
+
export const listNotificationChannelsResponse = z.object({
|
|
6658
|
+
data: z.array(notificationChannel),
|
|
6659
|
+
meta: paginatedMeta,
|
|
6660
|
+
});
|
|
6661
|
+
export const createNotificationChannelBody = createNotificationChannelRequest;
|
|
6662
|
+
export const createNotificationChannelResponse = notificationChannel;
|
|
6663
|
+
export const getNotificationChannelPathParams = z.object({
|
|
6664
|
+
notificationChannelId: ulid,
|
|
6665
|
+
});
|
|
6666
|
+
export const getNotificationChannelResponse = notificationChannel;
|
|
6667
|
+
export const updateNotificationChannelPathParams = z.object({
|
|
6668
|
+
notificationChannelId: ulid,
|
|
6669
|
+
});
|
|
6670
|
+
export const updateNotificationChannelBody = updateNotificationChannelRequest;
|
|
6671
|
+
export const updateNotificationChannelResponse = notificationChannel;
|
|
6672
|
+
export const deleteNotificationChannelPathParams = z.object({
|
|
6673
|
+
notificationChannelId: ulid,
|
|
6674
|
+
});
|
|
5959
6675
|
export const labelsWire = z
|
|
5960
6676
|
.record(z.string(), z.string())
|
|
5961
6677
|
.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 +7049,16 @@ export const entitlementTypeWire = z
|
|
|
6333
7049
|
export const entitlementAccessExpandWire = z
|
|
6334
7050
|
.enum(['value'])
|
|
6335
7051
|
.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
7052
|
export const iso8601DurationWire = z
|
|
6349
7053
|
.string()
|
|
6350
7054
|
.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
7055
|
.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.');
|
|
7056
|
+
export const entitlementMeasureUsageFromPresetWire = z
|
|
7057
|
+
.enum(['current_period_start', 'now'])
|
|
7058
|
+
.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.');
|
|
7059
|
+
export const entitlementHistoryWindowSizeWire = z
|
|
7060
|
+
.union([z.literal('PT1H'), z.literal('P1D')])
|
|
7061
|
+
.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
7062
|
export const stringFieldFilterExactWire = z
|
|
6362
7063
|
.union([
|
|
6363
7064
|
z.string(),
|
|
@@ -6377,6 +7078,89 @@ export const stringFieldFilterExactWire = z
|
|
|
6377
7078
|
}),
|
|
6378
7079
|
])
|
|
6379
7080
|
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
7081
|
+
export const createLabelsWire = z
|
|
7082
|
+
.record(z.string(), z.string())
|
|
7083
|
+
.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 "\\_".');
|
|
7084
|
+
export const creditFundingMethodWire = z
|
|
7085
|
+
.enum(['none', 'invoice', 'external'])
|
|
7086
|
+
.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)');
|
|
7087
|
+
export const creditAvailabilityPolicyWire = z
|
|
7088
|
+
.enum(['on_creation'])
|
|
7089
|
+
.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.');
|
|
7090
|
+
export const taxBehaviorWire = z
|
|
7091
|
+
.enum(['inclusive', 'exclusive'])
|
|
7092
|
+
.describe('Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.');
|
|
7093
|
+
export const createVersionFilterWire = z
|
|
7094
|
+
.strictObject({
|
|
7095
|
+
eq: z
|
|
7096
|
+
.number()
|
|
7097
|
+
.int()
|
|
7098
|
+
.gte(1)
|
|
7099
|
+
.lte(2147483647)
|
|
7100
|
+
.optional()
|
|
7101
|
+
.describe('Match this exact version.'),
|
|
7102
|
+
in: z
|
|
7103
|
+
.array(z.number().int().gte(-2147483648).lte(2147483647))
|
|
7104
|
+
.min(1)
|
|
7105
|
+
.max(100)
|
|
7106
|
+
.optional()
|
|
7107
|
+
.describe('Match one of these versions.'),
|
|
7108
|
+
gte: z
|
|
7109
|
+
.number()
|
|
7110
|
+
.int()
|
|
7111
|
+
.gte(1)
|
|
7112
|
+
.lte(2147483647)
|
|
7113
|
+
.optional()
|
|
7114
|
+
.describe('Match this version and later versions.'),
|
|
7115
|
+
lte: z
|
|
7116
|
+
.number()
|
|
7117
|
+
.int()
|
|
7118
|
+
.gte(1)
|
|
7119
|
+
.lte(2147483647)
|
|
7120
|
+
.optional()
|
|
7121
|
+
.describe('Match this version and earlier versions.'),
|
|
7122
|
+
})
|
|
7123
|
+
.describe('An integer version comparison. Exactly one operator must be provided.');
|
|
7124
|
+
export const creditPurchasePaymentSettlementStatusWire = z
|
|
7125
|
+
.enum(['pending', 'authorized', 'settled'])
|
|
7126
|
+
.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.');
|
|
7127
|
+
export const versionFilterWire = z
|
|
7128
|
+
.strictObject({
|
|
7129
|
+
eq: z
|
|
7130
|
+
.number()
|
|
7131
|
+
.int()
|
|
7132
|
+
.gte(1)
|
|
7133
|
+
.lte(2147483647)
|
|
7134
|
+
.optional()
|
|
7135
|
+
.describe('Match this exact version.'),
|
|
7136
|
+
in: z
|
|
7137
|
+
.array(z.number().int().gte(-2147483648).lte(2147483647))
|
|
7138
|
+
.min(1)
|
|
7139
|
+
.max(100)
|
|
7140
|
+
.optional()
|
|
7141
|
+
.describe('Match one of these versions.'),
|
|
7142
|
+
gte: z
|
|
7143
|
+
.number()
|
|
7144
|
+
.int()
|
|
7145
|
+
.gte(1)
|
|
7146
|
+
.lte(2147483647)
|
|
7147
|
+
.optional()
|
|
7148
|
+
.describe('Match this version and later versions.'),
|
|
7149
|
+
lte: z
|
|
7150
|
+
.number()
|
|
7151
|
+
.int()
|
|
7152
|
+
.gte(1)
|
|
7153
|
+
.lte(2147483647)
|
|
7154
|
+
.optional()
|
|
7155
|
+
.describe('Match this version and earlier versions.'),
|
|
7156
|
+
})
|
|
7157
|
+
.describe('An integer version comparison. Exactly one operator must be provided.');
|
|
7158
|
+
export const creditGrantStatusWire = z
|
|
7159
|
+
.enum(['pending', 'active', 'expired', 'voided'])
|
|
7160
|
+
.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.');
|
|
7161
|
+
export const validationIssueSeverityWire = z
|
|
7162
|
+
.enum(['critical', 'warning'])
|
|
7163
|
+
.describe('Severity level of a billing validation issue.');
|
|
6380
7164
|
export const creditGrantVoidPaymentAdjustmentWire = z
|
|
6381
7165
|
.enum(['none'])
|
|
6382
7166
|
.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 +7558,19 @@ export const entitlementFeatureAccessReasonCodeWire = z
|
|
|
6774
7558
|
export const entitlementAccessQueryErrorCodeWire = z
|
|
6775
7559
|
.enum(['unknown', 'customer_not_found'])
|
|
6776
7560
|
.describe('Error code for an entitlement access query failure.');
|
|
7561
|
+
export const booleanFieldFilterWire = z
|
|
7562
|
+
.union([
|
|
7563
|
+
z.boolean(),
|
|
7564
|
+
z.strictObject({
|
|
7565
|
+
eq: z
|
|
7566
|
+
.boolean()
|
|
7567
|
+
.describe('Value strictly equals the given boolean value.'),
|
|
7568
|
+
}),
|
|
7569
|
+
])
|
|
7570
|
+
.describe('Filter by a boolean value (true/false).');
|
|
7571
|
+
export const notificationChannelTypeWire = z
|
|
7572
|
+
.enum(['webhook'])
|
|
7573
|
+
.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
7574
|
export const queryFilterIntegerWire = z
|
|
6778
7575
|
.strictObject({
|
|
6779
7576
|
eq: z
|
|
@@ -6898,16 +7695,6 @@ export const pagePaginationQueryWire = z
|
|
|
6898
7695
|
export const publicLabelsWire = z
|
|
6899
7696
|
.record(z.string(), z.string())
|
|
6900
7697
|
.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
7698
|
export const numericFieldFilterWire = z
|
|
6912
7699
|
.union([
|
|
6913
7700
|
z.number(),
|
|
@@ -7130,7 +7917,35 @@ export const entitlementAccessValueWire = z
|
|
|
7130
7917
|
.record(z.string(), numericWire)
|
|
7131
7918
|
.describe('The remaining balance of each grant, keyed by grant ID.'),
|
|
7132
7919
|
})
|
|
7133
|
-
.describe('Balance details of a metered entitlement.');
|
|
7920
|
+
.describe('Balance details of a metered entitlement at the evaluation time, which is the `at` query parameter when given and the current time otherwise.');
|
|
7921
|
+
export const entitlementIssueAfterResetWire = z
|
|
7922
|
+
.strictObject({
|
|
7923
|
+
amount: numericWire,
|
|
7924
|
+
priority: z
|
|
7925
|
+
.number()
|
|
7926
|
+
.int()
|
|
7927
|
+
.gte(1)
|
|
7928
|
+
.lte(255)
|
|
7929
|
+
.optional()
|
|
7930
|
+
.describe('The priority of the grant created after each reset. Lower values have higher priority.'),
|
|
7931
|
+
})
|
|
7932
|
+
.describe('Usage granted automatically after each reset of a metered entitlement. The balance returns to `amount` after every reset.');
|
|
7933
|
+
export const entitlementBurndownBalanceWire = z
|
|
7934
|
+
.strictObject({
|
|
7935
|
+
start: numericWire,
|
|
7936
|
+
end: numericWire,
|
|
7937
|
+
})
|
|
7938
|
+
.describe('Entitlement balance at the boundaries of a burndown segment.');
|
|
7939
|
+
export const entitlementBurndownGrantBalancesWire = z
|
|
7940
|
+
.strictObject({
|
|
7941
|
+
start: z
|
|
7942
|
+
.record(z.string(), numericWire)
|
|
7943
|
+
.describe('The balance of each active grant at the start of the segment.'),
|
|
7944
|
+
end: z
|
|
7945
|
+
.record(z.string(), numericWire)
|
|
7946
|
+
.describe('The balance of each active grant at the end of the segment.'),
|
|
7947
|
+
})
|
|
7948
|
+
.describe('Grant balances at the boundaries of a burndown segment, keyed by grant ID.');
|
|
7134
7949
|
export const createChargeCostBasisManualWire = z
|
|
7135
7950
|
.strictObject({
|
|
7136
7951
|
type: z
|
|
@@ -7362,6 +8177,17 @@ export const profileReferenceWire = z
|
|
|
7362
8177
|
id: ulidWire,
|
|
7363
8178
|
})
|
|
7364
8179
|
.describe('Billing profile reference.');
|
|
8180
|
+
export const featureReferenceWire = z
|
|
8181
|
+
.strictObject({
|
|
8182
|
+
id: ulidWire,
|
|
8183
|
+
})
|
|
8184
|
+
.describe('Feature reference.');
|
|
8185
|
+
export const entitlementGrantUsageWire = z
|
|
8186
|
+
.strictObject({
|
|
8187
|
+
grant_id: ulidWire,
|
|
8188
|
+
usage: numericWire,
|
|
8189
|
+
})
|
|
8190
|
+
.describe('Usage taken from a single grant.');
|
|
7365
8191
|
export const createChargeCostBasisPinnedWire = z
|
|
7366
8192
|
.strictObject({
|
|
7367
8193
|
type: z
|
|
@@ -7401,6 +8227,11 @@ export const creditGrantInvoiceReferenceWire = z
|
|
|
7401
8227
|
.describe('Identifier of the invoice line associated with the grant.'),
|
|
7402
8228
|
})
|
|
7403
8229
|
.describe('Invoice references for the grant.');
|
|
8230
|
+
export const currencyCustomReferenceWire = z
|
|
8231
|
+
.strictObject({
|
|
8232
|
+
id: ulidWire,
|
|
8233
|
+
})
|
|
8234
|
+
.describe('CurrencyCustom reference.');
|
|
7404
8235
|
export const subscriptionCostBasisPinWire = z
|
|
7405
8236
|
.strictObject({
|
|
7406
8237
|
custom_currency_id: ulidWire,
|
|
@@ -7408,11 +8239,6 @@ export const subscriptionCostBasisPinWire = z
|
|
|
7408
8239
|
cost_basis_id: ulidWire,
|
|
7409
8240
|
})
|
|
7410
8241
|
.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
8242
|
export const subscriptionReferenceWire = z
|
|
7417
8243
|
.strictObject({
|
|
7418
8244
|
id: ulidWire,
|
|
@@ -7565,6 +8391,25 @@ export const appStripeCreateCustomerPortalSessionResultWire = z
|
|
|
7565
8391
|
.describe('The URL to redirect the customer to after they have completed their requested actions.'),
|
|
7566
8392
|
})
|
|
7567
8393
|
.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.');
|
|
8394
|
+
export const closedPeriodWire = z
|
|
8395
|
+
.strictObject({
|
|
8396
|
+
from: dateTimeWire,
|
|
8397
|
+
to: dateTimeWire,
|
|
8398
|
+
})
|
|
8399
|
+
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
8400
|
+
export const resetCustomerEntitlementUsageRequestWire = z
|
|
8401
|
+
.strictObject({
|
|
8402
|
+
effective_at: dateTimeWire.optional(),
|
|
8403
|
+
retain_anchor: z
|
|
8404
|
+
.boolean()
|
|
8405
|
+
.optional()
|
|
8406
|
+
.describe('Whether the usage period anchor is kept. When false, the anchor moves to `effective_at`.'),
|
|
8407
|
+
preserve_overage: z
|
|
8408
|
+
.boolean()
|
|
8409
|
+
.optional()
|
|
8410
|
+
.describe("Whether overage carries over into the new usage period. Defaults to the entitlement's own setting."),
|
|
8411
|
+
})
|
|
8412
|
+
.describe('Request body for resetting the usage of a metered entitlement.');
|
|
7568
8413
|
export const chargeResolvedCostBasisWire = z
|
|
7569
8414
|
.strictObject({
|
|
7570
8415
|
fiat_currency: currencyCodeWire,
|
|
@@ -7573,12 +8418,6 @@ export const chargeResolvedCostBasisWire = z
|
|
|
7573
8418
|
resolved_at: dateTimeWire,
|
|
7574
8419
|
})
|
|
7575
8420
|
.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
8421
|
export const subscriptionAddonTimelineSegmentWire = z
|
|
7583
8422
|
.strictObject({
|
|
7584
8423
|
active_from: dateTimeWire,
|
|
@@ -7783,22 +8622,6 @@ export const tooManyRequestsWire = baseErrorWire.describe('Too Many Requests.');
|
|
|
7783
8622
|
export const internalWire = baseErrorWire.describe('Internal Server Error.');
|
|
7784
8623
|
export const notImplementedWire = baseErrorWire.describe('Not Implemented.');
|
|
7785
8624
|
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
8625
|
export const subscriptionPlanReferenceWire = z
|
|
7803
8626
|
.strictObject({
|
|
7804
8627
|
id: ulidWire,
|
|
@@ -8087,6 +8910,30 @@ export const customerStripeCreateCustomerPortalSessionRequestWire = z
|
|
|
8087
8910
|
stripe_options: appStripeCreateCustomerPortalSessionOptionsWire,
|
|
8088
8911
|
})
|
|
8089
8912
|
.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.');
|
|
8913
|
+
export const entitlementAccessCheckResultWire = z
|
|
8914
|
+
.strictObject({
|
|
8915
|
+
has_access: z
|
|
8916
|
+
.boolean()
|
|
8917
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
8918
|
+
config: z
|
|
8919
|
+
.string()
|
|
8920
|
+
.optional()
|
|
8921
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
8922
|
+
type: entitlementTypeWire.optional(),
|
|
8923
|
+
})
|
|
8924
|
+
.describe('Entitlement access check result.');
|
|
8925
|
+
export const recurringPeriodInputWire = z
|
|
8926
|
+
.strictObject({
|
|
8927
|
+
interval: iso8601DurationWire,
|
|
8928
|
+
anchor: dateTimeWire.optional(),
|
|
8929
|
+
})
|
|
8930
|
+
.describe('Recurring period input. The anchor is optional; the owning resource defines the default, typically its creation time.');
|
|
8931
|
+
export const recurringPeriodWire = z
|
|
8932
|
+
.strictObject({
|
|
8933
|
+
anchor: dateTimeWire,
|
|
8934
|
+
interval: iso8601DurationWire,
|
|
8935
|
+
})
|
|
8936
|
+
.describe('Recurring period with an anchor and an interval.');
|
|
8090
8937
|
export const rateCardMeteredEntitlementWire = z
|
|
8091
8938
|
.strictObject({
|
|
8092
8939
|
type: z
|
|
@@ -8127,17 +8974,40 @@ export const subscriptionEditStretchPhaseWire = z
|
|
|
8127
8974
|
extend_by: iso8601DurationWire,
|
|
8128
8975
|
})
|
|
8129
8976
|
.describe('Extend the duration of a phase, shifting later phases by the same amount.');
|
|
8130
|
-
export const
|
|
8977
|
+
export const entitlementMeasureUsageFromWire = z
|
|
8978
|
+
.union([entitlementMeasureUsageFromPresetWire, dateTimeWire])
|
|
8979
|
+
.describe('The time from which usage is measured, as a preset or an explicit timestamp.');
|
|
8980
|
+
export const getCreditBalanceParamsFilterWire = z
|
|
8131
8981
|
.strictObject({
|
|
8132
|
-
|
|
8133
|
-
|
|
8982
|
+
currency: stringFieldFilterExactWire.optional(),
|
|
8983
|
+
feature_key: stringFieldFilterWire.optional(),
|
|
8134
8984
|
})
|
|
8135
|
-
.describe('
|
|
8985
|
+
.describe('Filter options for getting a credit balance.');
|
|
8986
|
+
export const listPlansParamsFilterWire = z
|
|
8987
|
+
.strictObject({
|
|
8988
|
+
key: stringFieldFilterWire.optional(),
|
|
8989
|
+
name: stringFieldFilterWire.optional(),
|
|
8990
|
+
status: stringFieldFilterExactWire.optional(),
|
|
8991
|
+
currency: stringFieldFilterExactWire.optional(),
|
|
8992
|
+
})
|
|
8993
|
+
.describe('Filter options for listing plans.');
|
|
8994
|
+
export const createCreditGrantPlanFilterWire = z
|
|
8995
|
+
.strictObject({
|
|
8996
|
+
key: resourceKeyWire,
|
|
8997
|
+
version: createVersionFilterWire.optional(),
|
|
8998
|
+
})
|
|
8999
|
+
.describe('A plan key and an optional version constraint for matching credit grants.');
|
|
8136
9000
|
export const updateCreditGrantExternalSettlementRequestWire = z
|
|
8137
9001
|
.strictObject({
|
|
8138
9002
|
status: creditPurchasePaymentSettlementStatusWire,
|
|
8139
9003
|
})
|
|
8140
|
-
.describe('Request body for updating the external payment settlement status of a credit grant.');
|
|
9004
|
+
.describe('Request body for updating the external payment settlement status of a credit grant.');
|
|
9005
|
+
export const creditGrantPlanFilterWire = z
|
|
9006
|
+
.strictObject({
|
|
9007
|
+
key: resourceKeyWire,
|
|
9008
|
+
version: versionFilterWire.optional(),
|
|
9009
|
+
})
|
|
9010
|
+
.describe('A plan key and an optional version constraint for matching credit grants.');
|
|
8141
9011
|
export const listCreditGrantsParamsFilterWire = z
|
|
8142
9012
|
.strictObject({
|
|
8143
9013
|
status: creditGrantStatusWire.optional(),
|
|
@@ -8164,20 +9034,6 @@ export const validationIssueWire = z
|
|
|
8164
9034
|
.describe('Component that reported the validation issue, if applicable.'),
|
|
8165
9035
|
})
|
|
8166
9036
|
.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
9037
|
export const voidCreditGrantRequestWire = z
|
|
8182
9038
|
.strictObject({
|
|
8183
9039
|
payment_adjustment: creditGrantVoidPaymentAdjustmentWire.optional(),
|
|
@@ -8432,6 +9288,88 @@ export const entitlementAccessQueryErrorWire = z
|
|
|
8432
9288
|
.describe('The customer identifier from the request that produced this error.'),
|
|
8433
9289
|
})
|
|
8434
9290
|
.describe('Query error within a partially successful entitlement access query response.');
|
|
9291
|
+
export const notificationChannelWire = z
|
|
9292
|
+
.strictObject({
|
|
9293
|
+
id: ulidWire,
|
|
9294
|
+
name: z
|
|
9295
|
+
.string()
|
|
9296
|
+
.min(1)
|
|
9297
|
+
.max(256)
|
|
9298
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9299
|
+
labels: labelsWire.optional(),
|
|
9300
|
+
created_at: dateTimeWire,
|
|
9301
|
+
updated_at: dateTimeWire,
|
|
9302
|
+
deleted_at: dateTimeWire.optional(),
|
|
9303
|
+
type: notificationChannelTypeWire,
|
|
9304
|
+
disabled: z
|
|
9305
|
+
.boolean()
|
|
9306
|
+
.optional()
|
|
9307
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9308
|
+
url: z
|
|
9309
|
+
.string()
|
|
9310
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9311
|
+
custom_headers: z
|
|
9312
|
+
.record(z.string(), z.string())
|
|
9313
|
+
.optional()
|
|
9314
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9315
|
+
signing_secret: z
|
|
9316
|
+
.string()
|
|
9317
|
+
.optional()
|
|
9318
|
+
.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.'),
|
|
9319
|
+
})
|
|
9320
|
+
.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.');
|
|
9321
|
+
export const createNotificationChannelRequestWire = z
|
|
9322
|
+
.strictObject({
|
|
9323
|
+
name: z
|
|
9324
|
+
.string()
|
|
9325
|
+
.min(1)
|
|
9326
|
+
.max(256)
|
|
9327
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9328
|
+
labels: labelsWire.optional(),
|
|
9329
|
+
type: notificationChannelTypeWire,
|
|
9330
|
+
disabled: z
|
|
9331
|
+
.boolean()
|
|
9332
|
+
.optional()
|
|
9333
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9334
|
+
url: z
|
|
9335
|
+
.string()
|
|
9336
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9337
|
+
custom_headers: z
|
|
9338
|
+
.record(z.string(), z.string())
|
|
9339
|
+
.optional()
|
|
9340
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9341
|
+
signing_secret: z
|
|
9342
|
+
.string()
|
|
9343
|
+
.optional()
|
|
9344
|
+
.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.'),
|
|
9345
|
+
})
|
|
9346
|
+
.describe('NotificationChannel create request.');
|
|
9347
|
+
export const updateNotificationChannelRequestWire = z
|
|
9348
|
+
.strictObject({
|
|
9349
|
+
name: z
|
|
9350
|
+
.string()
|
|
9351
|
+
.min(1)
|
|
9352
|
+
.max(256)
|
|
9353
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9354
|
+
type: notificationChannelTypeWire,
|
|
9355
|
+
url: z
|
|
9356
|
+
.string()
|
|
9357
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9358
|
+
labels: labelsWire.optional(),
|
|
9359
|
+
disabled: z
|
|
9360
|
+
.boolean()
|
|
9361
|
+
.optional()
|
|
9362
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9363
|
+
custom_headers: z
|
|
9364
|
+
.record(z.string(), z.string())
|
|
9365
|
+
.optional()
|
|
9366
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9367
|
+
signing_secret: z
|
|
9368
|
+
.string()
|
|
9369
|
+
.optional()
|
|
9370
|
+
.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.'),
|
|
9371
|
+
})
|
|
9372
|
+
.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
9373
|
export const appCustomerDataWire = z
|
|
8436
9374
|
.strictObject({
|
|
8437
9375
|
stripe: appCustomerDataStripeWire
|
|
@@ -8471,15 +9409,6 @@ export const creditAdjustmentWire = z
|
|
|
8471
9409
|
labels: labelsWire.optional(),
|
|
8472
9410
|
})
|
|
8473
9411
|
.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
9412
|
export const createCreditAdjustmentRequestWire = z
|
|
8484
9413
|
.strictObject({
|
|
8485
9414
|
name: z
|
|
@@ -8504,41 +9433,13 @@ export const listCreditTransactionsParamsFilterWire = z
|
|
|
8504
9433
|
feature_key: stringFieldFilterWire.optional(),
|
|
8505
9434
|
})
|
|
8506
9435
|
.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
9436
|
export const currencyAmountWire = z
|
|
8536
9437
|
.strictObject({
|
|
8537
9438
|
amount: numericWire,
|
|
8538
9439
|
currency: billingCurrencyCodeWire,
|
|
8539
9440
|
})
|
|
8540
9441
|
.describe('Monetary amount in a fiat or custom currency.');
|
|
8541
|
-
export const
|
|
9442
|
+
export const entitlementValueResultWire = z
|
|
8542
9443
|
.strictObject({
|
|
8543
9444
|
type: entitlementTypeWire,
|
|
8544
9445
|
feature_key: resourceKeyWire,
|
|
@@ -8551,7 +9452,21 @@ export const entitlementAccessResultWire = z
|
|
|
8551
9452
|
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
8552
9453
|
value: entitlementAccessValueWire.optional(),
|
|
8553
9454
|
})
|
|
8554
|
-
.describe('Entitlement
|
|
9455
|
+
.describe('Entitlement value result.');
|
|
9456
|
+
export const entitlementFeatureValueResultWire = z
|
|
9457
|
+
.strictObject({
|
|
9458
|
+
feature_key: resourceKeyWire,
|
|
9459
|
+
has_access: z
|
|
9460
|
+
.boolean()
|
|
9461
|
+
.describe('Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements.'),
|
|
9462
|
+
config: z
|
|
9463
|
+
.string()
|
|
9464
|
+
.optional()
|
|
9465
|
+
.describe('Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration.'),
|
|
9466
|
+
value: entitlementAccessValueWire.optional(),
|
|
9467
|
+
type: entitlementTypeWire.optional(),
|
|
9468
|
+
})
|
|
9469
|
+
.describe('Entitlement value looked up by feature key. A missing entitlement has no type and does not grant access.');
|
|
8555
9470
|
export const priceTierWire = z
|
|
8556
9471
|
.strictObject({
|
|
8557
9472
|
up_to_amount: numericWire.optional(),
|
|
@@ -8636,6 +9551,27 @@ export const listCustomersParamsFilterWire = z
|
|
|
8636
9551
|
billing_profile_id: ulidFieldFilterWire.optional(),
|
|
8637
9552
|
})
|
|
8638
9553
|
.describe('Filter options for listing customers.');
|
|
9554
|
+
export const listCustomerEntitlementsParamsFilterWire = z
|
|
9555
|
+
.strictObject({
|
|
9556
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
9557
|
+
feature_key: stringFieldFilterExactWire.optional(),
|
|
9558
|
+
type: stringFieldFilterExactWire.optional(),
|
|
9559
|
+
})
|
|
9560
|
+
.describe('Filter options for listing customer entitlements.');
|
|
9561
|
+
export const listEntitlementsParamsFilterWire = z
|
|
9562
|
+
.strictObject({
|
|
9563
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
9564
|
+
feature_key: stringFieldFilterExactWire.optional(),
|
|
9565
|
+
type: stringFieldFilterExactWire.optional(),
|
|
9566
|
+
customer_id: ulidFieldFilterWire.optional(),
|
|
9567
|
+
})
|
|
9568
|
+
.describe('Filter options for listing entitlements.');
|
|
9569
|
+
export const listGrantsParamsFilterWire = z
|
|
9570
|
+
.strictObject({
|
|
9571
|
+
customer_id: ulidFieldFilterWire.optional(),
|
|
9572
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
9573
|
+
})
|
|
9574
|
+
.describe('Filter options for listing grants.');
|
|
8639
9575
|
export const listSubscriptionsParamsFilterWire = z
|
|
8640
9576
|
.strictObject({
|
|
8641
9577
|
id: ulidFieldFilterWire.optional(),
|
|
@@ -8692,12 +9628,12 @@ export const createChargeCostBasisWire = z
|
|
|
8692
9628
|
createChargeCostBasisManualWire,
|
|
8693
9629
|
])
|
|
8694
9630
|
.describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
|
|
8695
|
-
export const
|
|
9631
|
+
export const createTaxCodeConfigWire = z
|
|
8696
9632
|
.strictObject({
|
|
8697
9633
|
behavior: taxBehaviorWire.optional(),
|
|
8698
|
-
|
|
9634
|
+
code: createResourceReferenceWire.optional(),
|
|
8699
9635
|
})
|
|
8700
|
-
.describe('Tax configuration for a
|
|
9636
|
+
.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
9637
|
export const chargeCostBasisWire = z
|
|
8702
9638
|
.discriminatedUnion('type', [
|
|
8703
9639
|
chargeCostBasisDynamicWire,
|
|
@@ -8705,18 +9641,12 @@ export const chargeCostBasisWire = z
|
|
|
8705
9641
|
chargeCostBasisManualWire,
|
|
8706
9642
|
])
|
|
8707
9643
|
.describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
|
|
8708
|
-
export const
|
|
9644
|
+
export const taxCodeConfigWire = z
|
|
8709
9645
|
.strictObject({
|
|
8710
9646
|
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,
|
|
9647
|
+
code: taxCodeReferenceWire.optional(),
|
|
8718
9648
|
})
|
|
8719
|
-
.describe('
|
|
9649
|
+
.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
9650
|
export const taxConfigWire = z
|
|
8721
9651
|
.strictObject({
|
|
8722
9652
|
behavior: taxBehaviorWire.optional(),
|
|
@@ -8740,6 +9670,43 @@ export const updateOrganizationDefaultTaxCodesRequestWire = z
|
|
|
8740
9670
|
credit_grant_tax_code: taxCodeReferenceWire.optional(),
|
|
8741
9671
|
})
|
|
8742
9672
|
.describe('OrganizationDefaultTaxCodes update request.');
|
|
9673
|
+
export const creditBalanceWire = z
|
|
9674
|
+
.strictObject({
|
|
9675
|
+
currency: billingCurrencyCodeWire,
|
|
9676
|
+
custom_currency: currencyCustomReferenceWire.optional(),
|
|
9677
|
+
live: numericWire,
|
|
9678
|
+
settled: numericWire,
|
|
9679
|
+
pending: numericWire,
|
|
9680
|
+
})
|
|
9681
|
+
.describe('The credit balance by currency.');
|
|
9682
|
+
export const creditTransactionWire = z
|
|
9683
|
+
.strictObject({
|
|
9684
|
+
id: ulidWire,
|
|
9685
|
+
name: z
|
|
9686
|
+
.string()
|
|
9687
|
+
.min(1)
|
|
9688
|
+
.max(256)
|
|
9689
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9690
|
+
description: z
|
|
9691
|
+
.string()
|
|
9692
|
+
.max(1024)
|
|
9693
|
+
.optional()
|
|
9694
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
9695
|
+
labels: labelsWire.optional(),
|
|
9696
|
+
created_at: dateTimeWire,
|
|
9697
|
+
booked_at: dateTimeWire,
|
|
9698
|
+
type: creditTransactionTypeWire,
|
|
9699
|
+
currency: billingCurrencyCodeWire,
|
|
9700
|
+
custom_currency: currencyCustomReferenceWire.optional(),
|
|
9701
|
+
amount: numericWire,
|
|
9702
|
+
available_balance: z
|
|
9703
|
+
.strictObject({
|
|
9704
|
+
before: numericWire,
|
|
9705
|
+
after: numericWire,
|
|
9706
|
+
})
|
|
9707
|
+
.describe('The available balance before and after the transaction.'),
|
|
9708
|
+
})
|
|
9709
|
+
.describe("A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable.");
|
|
8743
9710
|
export const invoiceWorkflowAppsReferencesWire = z
|
|
8744
9711
|
.strictObject({
|
|
8745
9712
|
tax: appReferenceWire,
|
|
@@ -8808,12 +9775,12 @@ export const createPlanAddonRequestWire = z
|
|
|
8808
9775
|
.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
9776
|
})
|
|
8810
9777
|
.describe('PlanAddon create request.');
|
|
8811
|
-
export const
|
|
9778
|
+
export const updateTaxCodeConfigWire = z
|
|
8812
9779
|
.strictObject({
|
|
8813
9780
|
behavior: taxBehaviorWire.optional(),
|
|
8814
|
-
code: updateResourceReferenceWire,
|
|
9781
|
+
code: updateResourceReferenceWire.optional(),
|
|
8815
9782
|
})
|
|
8816
|
-
.describe('
|
|
9783
|
+
.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
9784
|
export const listEventsParamsFilterWire = z
|
|
8818
9785
|
.strictObject({
|
|
8819
9786
|
id: stringFieldFilterWire.optional(),
|
|
@@ -8854,6 +9821,16 @@ export const listChargesParamsFilterWire = z
|
|
|
8854
9821
|
customer_id: ulidFieldFilterWire.optional(),
|
|
8855
9822
|
})
|
|
8856
9823
|
.describe('Filter options for listing charges across customers.');
|
|
9824
|
+
export const listNotificationChannelsParamsFilterWire = z
|
|
9825
|
+
.strictObject({
|
|
9826
|
+
id: ulidFieldFilterWire.optional(),
|
|
9827
|
+
name: stringFieldFilterWire.optional(),
|
|
9828
|
+
type: stringFieldFilterExactWire.optional(),
|
|
9829
|
+
disabled: booleanFieldFilterWire.optional(),
|
|
9830
|
+
created_at: dateTimeFieldFilterWire.optional(),
|
|
9831
|
+
updated_at: dateTimeFieldFilterWire.optional(),
|
|
9832
|
+
})
|
|
9833
|
+
.describe('Filter options for listing notification channels.');
|
|
8857
9834
|
export const resourceFiltersWire = z
|
|
8858
9835
|
.strictObject({
|
|
8859
9836
|
name: stringFieldFilterWire.optional(),
|
|
@@ -8896,6 +9873,25 @@ export const meterQueryResultWire = z
|
|
|
8896
9873
|
.describe('The usage data. If no data is available, an empty array is returned.'),
|
|
8897
9874
|
})
|
|
8898
9875
|
.describe('Meter query result.');
|
|
9876
|
+
export const entitlementHistoryWindowWire = z
|
|
9877
|
+
.strictObject({
|
|
9878
|
+
period: closedPeriodWire,
|
|
9879
|
+
usage: numericWire,
|
|
9880
|
+
balance_at_start: numericWire,
|
|
9881
|
+
})
|
|
9882
|
+
.describe('Usage and balance of a single history window.');
|
|
9883
|
+
export const entitlementBurndownSegmentWire = z
|
|
9884
|
+
.strictObject({
|
|
9885
|
+
period: closedPeriodWire,
|
|
9886
|
+
usage: numericWire,
|
|
9887
|
+
overage: numericWire,
|
|
9888
|
+
balance: entitlementBurndownBalanceWire,
|
|
9889
|
+
grant_balances: entitlementBurndownGrantBalancesWire,
|
|
9890
|
+
grant_usages: z
|
|
9891
|
+
.array(entitlementGrantUsageWire)
|
|
9892
|
+
.describe('The grants consumed in the segment and the usage taken from each.'),
|
|
9893
|
+
})
|
|
9894
|
+
.describe('A period in which grants were consumed in a fixed order.');
|
|
8899
9895
|
export const chargeRealizationDetailedLineFlatFeeWire = z
|
|
8900
9896
|
.strictObject({
|
|
8901
9897
|
id: ulidWire,
|
|
@@ -9117,32 +10113,170 @@ export const invoiceCustomerWire = z
|
|
|
9117
10113
|
id: ulidWire,
|
|
9118
10114
|
key: externalResourceKeyWire.optional(),
|
|
9119
10115
|
})
|
|
9120
|
-
.describe("Snapshot of the customer's information at the time the invoice was issued.");
|
|
9121
|
-
export const updateBillingPartyAddressesWire = z
|
|
10116
|
+
.describe("Snapshot of the customer's information at the time the invoice was issued.");
|
|
10117
|
+
export const updateBillingPartyAddressesWire = z
|
|
10118
|
+
.strictObject({
|
|
10119
|
+
billing_address: updateAddressWire,
|
|
10120
|
+
})
|
|
10121
|
+
.describe('A collection of addresses for the party.');
|
|
10122
|
+
export const updateInvoiceCustomerWire = z
|
|
10123
|
+
.strictObject({
|
|
10124
|
+
name: z
|
|
10125
|
+
.string()
|
|
10126
|
+
.min(1)
|
|
10127
|
+
.max(256)
|
|
10128
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10129
|
+
usage_attribution: updateCustomerUsageAttributionWire.optional(),
|
|
10130
|
+
billing_address: updateAddressWire.optional(),
|
|
10131
|
+
id: ulidWire,
|
|
10132
|
+
key: externalResourceKeyWire.optional(),
|
|
10133
|
+
})
|
|
10134
|
+
.describe("Snapshot of the customer's information at the time the invoice was issued.");
|
|
10135
|
+
export const appStripeCreateCheckoutSessionConsentCollectionWire = z
|
|
10136
|
+
.strictObject({
|
|
10137
|
+
payment_method_reuse_agreement: appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementWire.optional(),
|
|
10138
|
+
promotions: appStripeCreateCheckoutSessionConsentCollectionPromotionsWire.optional(),
|
|
10139
|
+
terms_of_service: appStripeCreateCheckoutSessionConsentCollectionTermsOfServiceWire.optional(),
|
|
10140
|
+
})
|
|
10141
|
+
.describe('Checkout Session consent collection configuration.');
|
|
10142
|
+
export const entitlementGrantCreateRequestWire = z
|
|
10143
|
+
.strictObject({
|
|
10144
|
+
amount: numericWire,
|
|
10145
|
+
priority: z
|
|
10146
|
+
.number()
|
|
10147
|
+
.int()
|
|
10148
|
+
.gte(1)
|
|
10149
|
+
.lte(255)
|
|
10150
|
+
.optional()
|
|
10151
|
+
.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.'),
|
|
10152
|
+
effective_at: dateTimeWire,
|
|
10153
|
+
expires_after: iso8601DurationWire.optional(),
|
|
10154
|
+
max_rollover_amount: numericWire.optional(),
|
|
10155
|
+
min_rollover_amount: numericWire.optional(),
|
|
10156
|
+
labels: labelsWire.optional(),
|
|
10157
|
+
recurrence: recurringPeriodInputWire.optional(),
|
|
10158
|
+
})
|
|
10159
|
+
.describe('A grant to issue for a metered entitlement.');
|
|
10160
|
+
export const createEntitlementStaticRequestWire = z
|
|
10161
|
+
.strictObject({
|
|
10162
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
10163
|
+
feature: featureReferenceWire,
|
|
10164
|
+
labels: labelsWire.optional(),
|
|
10165
|
+
config: z
|
|
10166
|
+
.unknown()
|
|
10167
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
10168
|
+
usage_period: recurringPeriodInputWire.optional(),
|
|
10169
|
+
})
|
|
10170
|
+
.describe('Static entitlement create request.');
|
|
10171
|
+
export const createEntitlementBooleanRequestWire = z
|
|
10172
|
+
.strictObject({
|
|
10173
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
10174
|
+
feature: featureReferenceWire,
|
|
10175
|
+
labels: labelsWire.optional(),
|
|
10176
|
+
usage_period: recurringPeriodInputWire.optional(),
|
|
10177
|
+
})
|
|
10178
|
+
.describe('Boolean entitlement create request.');
|
|
10179
|
+
export const entitlementMeteredWire = z
|
|
10180
|
+
.strictObject({
|
|
10181
|
+
id: ulidWire,
|
|
10182
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
10183
|
+
feature: featureReferenceWire,
|
|
10184
|
+
customer: customerReferenceWire,
|
|
10185
|
+
labels: labelsWire.optional(),
|
|
10186
|
+
active_from: dateTimeWire,
|
|
10187
|
+
active_to: dateTimeWire.optional(),
|
|
10188
|
+
created_at: dateTimeWire,
|
|
10189
|
+
updated_at: dateTimeWire,
|
|
10190
|
+
deleted_at: dateTimeWire.optional(),
|
|
10191
|
+
usage_period: recurringPeriodWire,
|
|
10192
|
+
current_usage_period: closedPeriodWire,
|
|
10193
|
+
is_soft_limit: z
|
|
10194
|
+
.boolean()
|
|
10195
|
+
.optional()
|
|
10196
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
10197
|
+
issue: entitlementIssueAfterResetWire.optional(),
|
|
10198
|
+
issue_after_reset: numericWire.optional(),
|
|
10199
|
+
issue_after_reset_priority: z
|
|
10200
|
+
.number()
|
|
10201
|
+
.int()
|
|
10202
|
+
.gte(1)
|
|
10203
|
+
.lte(255)
|
|
10204
|
+
.optional()
|
|
10205
|
+
.describe('The priority of the grant created after each reset.'),
|
|
10206
|
+
preserve_overage_at_reset: z
|
|
10207
|
+
.boolean()
|
|
10208
|
+
.optional()
|
|
10209
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
10210
|
+
measure_usage_from: dateTimeWire,
|
|
10211
|
+
last_reset: dateTimeWire,
|
|
10212
|
+
})
|
|
10213
|
+
.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.');
|
|
10214
|
+
export const entitlementStaticWire = z
|
|
10215
|
+
.strictObject({
|
|
10216
|
+
id: ulidWire,
|
|
10217
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
10218
|
+
feature: featureReferenceWire,
|
|
10219
|
+
customer: customerReferenceWire,
|
|
10220
|
+
labels: labelsWire.optional(),
|
|
10221
|
+
usage_period: recurringPeriodWire.optional(),
|
|
10222
|
+
current_usage_period: closedPeriodWire.optional(),
|
|
10223
|
+
active_from: dateTimeWire,
|
|
10224
|
+
active_to: dateTimeWire.optional(),
|
|
10225
|
+
created_at: dateTimeWire,
|
|
10226
|
+
updated_at: dateTimeWire,
|
|
10227
|
+
deleted_at: dateTimeWire.optional(),
|
|
10228
|
+
config: z
|
|
10229
|
+
.unknown()
|
|
10230
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
10231
|
+
})
|
|
10232
|
+
.describe('A static entitlement grants access to a feature together with a configuration.');
|
|
10233
|
+
export const entitlementBooleanWire = z
|
|
9122
10234
|
.strictObject({
|
|
9123
|
-
|
|
10235
|
+
id: ulidWire,
|
|
10236
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
10237
|
+
feature: featureReferenceWire,
|
|
10238
|
+
customer: customerReferenceWire,
|
|
10239
|
+
labels: labelsWire.optional(),
|
|
10240
|
+
usage_period: recurringPeriodWire.optional(),
|
|
10241
|
+
current_usage_period: closedPeriodWire.optional(),
|
|
10242
|
+
active_from: dateTimeWire,
|
|
10243
|
+
active_to: dateTimeWire.optional(),
|
|
10244
|
+
created_at: dateTimeWire,
|
|
10245
|
+
updated_at: dateTimeWire,
|
|
10246
|
+
deleted_at: dateTimeWire.optional(),
|
|
9124
10247
|
})
|
|
9125
|
-
.describe('A
|
|
9126
|
-
export const
|
|
10248
|
+
.describe('A boolean entitlement grants access to a feature.');
|
|
10249
|
+
export const entitlementGrantWire = z
|
|
9127
10250
|
.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
10251
|
id: ulidWire,
|
|
9136
|
-
|
|
10252
|
+
entitlement_id: ulidWire,
|
|
10253
|
+
amount: numericWire,
|
|
10254
|
+
priority: z
|
|
10255
|
+
.number()
|
|
10256
|
+
.int()
|
|
10257
|
+
.nonnegative()
|
|
10258
|
+
.lte(255)
|
|
10259
|
+
.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.'),
|
|
10260
|
+
effective_at: dateTimeWire,
|
|
10261
|
+
expires_after: iso8601DurationWire.optional(),
|
|
10262
|
+
expires_at: dateTimeWire.optional(),
|
|
10263
|
+
max_rollover_amount: numericWire,
|
|
10264
|
+
min_rollover_amount: numericWire,
|
|
10265
|
+
recurrence: recurringPeriodWire.optional(),
|
|
10266
|
+
next_recurrence: dateTimeWire.optional(),
|
|
10267
|
+
voided_at: dateTimeWire.optional(),
|
|
10268
|
+
labels: labelsWire.optional(),
|
|
10269
|
+
created_at: dateTimeWire,
|
|
10270
|
+
updated_at: dateTimeWire,
|
|
10271
|
+
deleted_at: dateTimeWire.optional(),
|
|
9137
10272
|
})
|
|
9138
|
-
.describe("
|
|
9139
|
-
export const
|
|
10273
|
+
.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.");
|
|
10274
|
+
export const workflowCollectionAlignmentAnchoredWire = z
|
|
9140
10275
|
.strictObject({
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
terms_of_service: appStripeCreateCheckoutSessionConsentCollectionTermsOfServiceWire.optional(),
|
|
10276
|
+
type: z.literal('anchored').describe('The type of alignment.'),
|
|
10277
|
+
recurring_period: recurringPeriodWire,
|
|
9144
10278
|
})
|
|
9145
|
-
.describe('
|
|
10279
|
+
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
9146
10280
|
export const rateCardEntitlementWire = z
|
|
9147
10281
|
.discriminatedUnion('type', [
|
|
9148
10282
|
rateCardMeteredEntitlementWire,
|
|
@@ -9158,12 +10292,30 @@ export const subscriptionEditAddPhaseWire = z
|
|
|
9158
10292
|
phase: subscriptionPhaseCreateWire,
|
|
9159
10293
|
})
|
|
9160
10294
|
.describe('Add a new phase to the subscription. The phase is created without items; use add-item operations to populate it.');
|
|
9161
|
-
export const
|
|
10295
|
+
export const createCreditGrantFiltersWire = z
|
|
9162
10296
|
.strictObject({
|
|
9163
|
-
|
|
9164
|
-
|
|
10297
|
+
features: z
|
|
10298
|
+
.array(resourceKeyWire)
|
|
10299
|
+
.optional()
|
|
10300
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
10301
|
+
plans: z
|
|
10302
|
+
.array(createCreditGrantPlanFilterWire)
|
|
10303
|
+
.optional()
|
|
10304
|
+
.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
10305
|
})
|
|
9166
|
-
.describe('
|
|
10306
|
+
.describe('Filters for the credit grant.');
|
|
10307
|
+
export const creditGrantFiltersWire = z
|
|
10308
|
+
.strictObject({
|
|
10309
|
+
features: z
|
|
10310
|
+
.array(resourceKeyWire)
|
|
10311
|
+
.optional()
|
|
10312
|
+
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
10313
|
+
plans: z
|
|
10314
|
+
.array(creditGrantPlanFilterWire)
|
|
10315
|
+
.optional()
|
|
10316
|
+
.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.'),
|
|
10317
|
+
})
|
|
10318
|
+
.describe('Filters for the credit grant.');
|
|
9167
10319
|
export const subscriptionBaseWire = z
|
|
9168
10320
|
.strictObject({
|
|
9169
10321
|
id: ulidWire,
|
|
@@ -9366,6 +10518,12 @@ export const entitlementFeatureAccessWire = z
|
|
|
9366
10518
|
reason: entitlementFeatureAccessReasonWire.optional(),
|
|
9367
10519
|
})
|
|
9368
10520
|
.describe('Access status for a single feature.');
|
|
10521
|
+
export const notificationChannelPagePaginatedResponseWire = z
|
|
10522
|
+
.strictObject({
|
|
10523
|
+
data: z.array(notificationChannelWire),
|
|
10524
|
+
meta: paginatedMetaWire,
|
|
10525
|
+
})
|
|
10526
|
+
.describe('Page paginated response.');
|
|
9369
10527
|
export const customerDataWire = z
|
|
9370
10528
|
.strictObject({
|
|
9371
10529
|
billing_profile: profileReferenceWire.optional(),
|
|
@@ -9378,20 +10536,6 @@ export const upsertCustomerBillingDataRequestWire = z
|
|
|
9378
10536
|
app_data: appCustomerDataWire.optional(),
|
|
9379
10537
|
})
|
|
9380
10538
|
.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
10539
|
export const chargeFlatFeeSystemIntentWire = z
|
|
9396
10540
|
.strictObject({
|
|
9397
10541
|
name: z
|
|
@@ -9419,7 +10563,7 @@ export const chargeFlatFeeSystemIntentWire = z
|
|
|
9419
10563
|
export const listCustomerEntitlementAccessResponseDataWire = z
|
|
9420
10564
|
.strictObject({
|
|
9421
10565
|
data: z
|
|
9422
|
-
.array(
|
|
10566
|
+
.array(entitlementValueResultWire)
|
|
9423
10567
|
.describe('The list of entitlement access results.'),
|
|
9424
10568
|
})
|
|
9425
10569
|
.describe('List customer entitlement access response data.');
|
|
@@ -9535,6 +10679,20 @@ export const workflowTaxSettingsWire = z
|
|
|
9535
10679
|
default_tax_config: taxConfigWire.optional(),
|
|
9536
10680
|
})
|
|
9537
10681
|
.describe('Tax settings for a billing workflow.');
|
|
10682
|
+
export const creditBalancesWire = z
|
|
10683
|
+
.strictObject({
|
|
10684
|
+
retrieved_at: dateTimeWire,
|
|
10685
|
+
balances: z
|
|
10686
|
+
.array(creditBalanceWire)
|
|
10687
|
+
.describe('The balances by currencies.'),
|
|
10688
|
+
})
|
|
10689
|
+
.describe('The balances of the credits of a customer.');
|
|
10690
|
+
export const creditTransactionPaginatedResponseWire = z
|
|
10691
|
+
.strictObject({
|
|
10692
|
+
data: z.array(creditTransactionWire),
|
|
10693
|
+
meta: cursorMetaWire,
|
|
10694
|
+
})
|
|
10695
|
+
.describe('Cursor paginated response.');
|
|
9538
10696
|
export const planAddonPagePaginatedResponseWire = z
|
|
9539
10697
|
.strictObject({
|
|
9540
10698
|
data: z.array(planAddonWire),
|
|
@@ -9547,6 +10705,16 @@ export const ingestedEventPaginatedResponseWire = z
|
|
|
9547
10705
|
meta: cursorMetaWire,
|
|
9548
10706
|
})
|
|
9549
10707
|
.describe('Cursor paginated response.');
|
|
10708
|
+
export const entitlementHistoryWire = z
|
|
10709
|
+
.strictObject({
|
|
10710
|
+
windowed_history: z
|
|
10711
|
+
.array(entitlementHistoryWindowWire)
|
|
10712
|
+
.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.'),
|
|
10713
|
+
burndown_history: z
|
|
10714
|
+
.array(entitlementBurndownSegmentWire)
|
|
10715
|
+
.describe('Periods in which grants were consumed in a fixed order. A new segment starts whenever grant priorities change or a usage period starts.'),
|
|
10716
|
+
})
|
|
10717
|
+
.describe('Balance and usage history of a metered entitlement.');
|
|
9550
10718
|
export const chargeRealizationDetailedLineWire = z
|
|
9551
10719
|
.discriminatedUnion('type', [
|
|
9552
10720
|
chargeRealizationDetailedLineFlatFeeWire,
|
|
@@ -9666,6 +10834,49 @@ export const appStripeCreateCheckoutSessionRequestOptionsWire = z
|
|
|
9666
10834
|
tax_id_collection: appStripeCreateCheckoutSessionTaxIdCollectionWire.optional(),
|
|
9667
10835
|
})
|
|
9668
10836
|
.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).");
|
|
10837
|
+
export const createEntitlementMeteredRequestWire = z
|
|
10838
|
+
.strictObject({
|
|
10839
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
10840
|
+
feature: featureReferenceWire,
|
|
10841
|
+
labels: labelsWire.optional(),
|
|
10842
|
+
is_soft_limit: z
|
|
10843
|
+
.boolean()
|
|
10844
|
+
.optional()
|
|
10845
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
10846
|
+
issue: entitlementIssueAfterResetWire.optional(),
|
|
10847
|
+
issue_after_reset: numericWire.optional(),
|
|
10848
|
+
issue_after_reset_priority: z
|
|
10849
|
+
.number()
|
|
10850
|
+
.int()
|
|
10851
|
+
.gte(1)
|
|
10852
|
+
.lte(255)
|
|
10853
|
+
.optional()
|
|
10854
|
+
.describe('The priority of the grant created after each reset.'),
|
|
10855
|
+
preserve_overage_at_reset: z
|
|
10856
|
+
.boolean()
|
|
10857
|
+
.optional()
|
|
10858
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
10859
|
+
usage_period: recurringPeriodInputWire,
|
|
10860
|
+
measure_usage_from: entitlementMeasureUsageFromWire.optional(),
|
|
10861
|
+
grants: z
|
|
10862
|
+
.array(entitlementGrantCreateRequestWire)
|
|
10863
|
+
.optional()
|
|
10864
|
+
.describe('Grants created together with the entitlement. Cannot be combined with `issue`.'),
|
|
10865
|
+
})
|
|
10866
|
+
.describe('Metered entitlement create request.');
|
|
10867
|
+
export const entitlementWire = z
|
|
10868
|
+
.discriminatedUnion('type', [
|
|
10869
|
+
entitlementMeteredWire,
|
|
10870
|
+
entitlementStaticWire,
|
|
10871
|
+
entitlementBooleanWire,
|
|
10872
|
+
])
|
|
10873
|
+
.describe('An entitlement grants a customer access to a feature.');
|
|
10874
|
+
export const entitlementGrantPagePaginatedResponseWire = z
|
|
10875
|
+
.strictObject({
|
|
10876
|
+
data: z.array(entitlementGrantWire),
|
|
10877
|
+
meta: paginatedMetaWire,
|
|
10878
|
+
})
|
|
10879
|
+
.describe('Page paginated response.');
|
|
9669
10880
|
export const workflowCollectionAlignmentWire = z
|
|
9670
10881
|
.discriminatedUnion('type', [
|
|
9671
10882
|
workflowCollectionAlignmentSubscriptionWire,
|
|
@@ -9999,7 +11210,7 @@ export const createCreditGrantRequestWire = z
|
|
|
9999
11210
|
currency: createCurrencyCodeWire,
|
|
10000
11211
|
amount: numericWire,
|
|
10001
11212
|
purchase: createCreditGrantPurchaseWire.optional(),
|
|
10002
|
-
tax_config:
|
|
11213
|
+
tax_config: createTaxCodeConfigWire.optional(),
|
|
10003
11214
|
filters: createCreditGrantFiltersWire.optional(),
|
|
10004
11215
|
priority: z
|
|
10005
11216
|
.number()
|
|
@@ -10034,7 +11245,7 @@ export const creditGrantWire = z
|
|
|
10034
11245
|
currency: billingCurrencyCodeWire,
|
|
10035
11246
|
amount: numericWire,
|
|
10036
11247
|
purchase: creditGrantPurchaseWire.optional(),
|
|
10037
|
-
tax_config:
|
|
11248
|
+
tax_config: taxCodeConfigWire.optional(),
|
|
10038
11249
|
invoice: creditGrantInvoiceReferenceWire.optional(),
|
|
10039
11250
|
filters: creditGrantFiltersWire.optional(),
|
|
10040
11251
|
priority: z
|
|
@@ -10096,6 +11307,19 @@ export const customerStripeCreateCheckoutSessionRequestWire = z
|
|
|
10096
11307
|
stripe_options: appStripeCreateCheckoutSessionRequestOptionsWire,
|
|
10097
11308
|
})
|
|
10098
11309
|
.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.');
|
|
11310
|
+
export const createEntitlementRequestWire = z
|
|
11311
|
+
.discriminatedUnion('type', [
|
|
11312
|
+
createEntitlementMeteredRequestWire,
|
|
11313
|
+
createEntitlementStaticRequestWire,
|
|
11314
|
+
createEntitlementBooleanRequestWire,
|
|
11315
|
+
])
|
|
11316
|
+
.describe('Entitlement create request.');
|
|
11317
|
+
export const entitlementPagePaginatedResponseWire = z
|
|
11318
|
+
.strictObject({
|
|
11319
|
+
data: z.array(entitlementWire),
|
|
11320
|
+
meta: paginatedMetaWire,
|
|
11321
|
+
})
|
|
11322
|
+
.describe('Page paginated response.');
|
|
10099
11323
|
export const workflowCollectionSettingsWire = z
|
|
10100
11324
|
.strictObject({
|
|
10101
11325
|
alignment: workflowCollectionAlignmentWire.optional(),
|
|
@@ -10188,14 +11412,14 @@ export const rateCardWire = z
|
|
|
10188
11412
|
payment_term: pricePaymentTermWire.optional(),
|
|
10189
11413
|
commitments: spendCommitmentsWire.optional(),
|
|
10190
11414
|
discounts: rateCardDiscountsWire.optional(),
|
|
10191
|
-
tax_config:
|
|
11415
|
+
tax_config: taxCodeConfigWire.optional(),
|
|
10192
11416
|
entitlement: rateCardEntitlementWire.optional(),
|
|
10193
11417
|
})
|
|
10194
11418
|
.describe('A rate card defines the pricing and entitlement of a feature or service.');
|
|
10195
11419
|
export const invoiceLineRateCardWire = z
|
|
10196
11420
|
.strictObject({
|
|
10197
11421
|
price: priceWire,
|
|
10198
|
-
tax_config:
|
|
11422
|
+
tax_config: taxCodeConfigWire.optional(),
|
|
10199
11423
|
feature_key: resourceKeyWire.optional(),
|
|
10200
11424
|
discounts: rateCardDiscountsWire.optional(),
|
|
10201
11425
|
unit_config: unitConfigWire.optional(),
|
|
@@ -10270,7 +11494,7 @@ export const featurePagePaginatedResponseWire = z
|
|
|
10270
11494
|
export const updateInvoiceLineRateCardWire = z
|
|
10271
11495
|
.strictObject({
|
|
10272
11496
|
price: updatePriceWire,
|
|
10273
|
-
tax_config:
|
|
11497
|
+
tax_config: updateTaxCodeConfigWire.optional(),
|
|
10274
11498
|
feature_key: resourceKeyWire.optional(),
|
|
10275
11499
|
discounts: updateDiscountsWire.optional(),
|
|
10276
11500
|
})
|
|
@@ -11231,13 +12455,188 @@ export const getCustomerEntitlementAccessPathParamsWire = z.object({
|
|
|
11231
12455
|
customerId: ulidWire,
|
|
11232
12456
|
featureKey: resourceKeyWire,
|
|
11233
12457
|
});
|
|
11234
|
-
export const
|
|
12458
|
+
export const getCustomerEntitlementAccessResponseWire = entitlementAccessCheckResultWire;
|
|
12459
|
+
export const getCustomerEntitlementValueByFeatureKeyPathParamsWire = z.object({
|
|
12460
|
+
customerId: ulidWire,
|
|
12461
|
+
featureKey: resourceKeyWire,
|
|
12462
|
+
});
|
|
12463
|
+
export const getCustomerEntitlementValueByFeatureKeyQueryParamsWire = z.object({
|
|
11235
12464
|
expand: z
|
|
11236
12465
|
.array(entitlementAccessExpandWire)
|
|
11237
12466
|
.optional()
|
|
11238
12467
|
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
12468
|
+
at: dateTimeWire.optional(),
|
|
12469
|
+
});
|
|
12470
|
+
export const getCustomerEntitlementValueByFeatureKeyResponseWire = entitlementFeatureValueResultWire;
|
|
12471
|
+
export const createCustomerEntitlementPathParamsWire = z.object({
|
|
12472
|
+
customerId: ulidWire,
|
|
12473
|
+
});
|
|
12474
|
+
export const createCustomerEntitlementBodyWire = createEntitlementRequestWire;
|
|
12475
|
+
export const createCustomerEntitlementResponseWire = entitlementWire;
|
|
12476
|
+
export const overrideCustomerEntitlementPathParamsWire = z.object({
|
|
12477
|
+
customerId: ulidWire,
|
|
12478
|
+
entitlementId: ulidWire,
|
|
12479
|
+
});
|
|
12480
|
+
export const overrideCustomerEntitlementBodyWire = createEntitlementRequestWire;
|
|
12481
|
+
export const overrideCustomerEntitlementResponseWire = entitlementWire;
|
|
12482
|
+
export const getCustomerEntitlementHistoryPathParamsWire = z.object({
|
|
12483
|
+
customerId: ulidWire,
|
|
12484
|
+
entitlementId: ulidWire,
|
|
12485
|
+
});
|
|
12486
|
+
export const getCustomerEntitlementHistoryQueryParamsWire = z.object({
|
|
12487
|
+
from: dateTimeWire.optional(),
|
|
12488
|
+
to: dateTimeWire.optional(),
|
|
12489
|
+
window_size: entitlementHistoryWindowSizeWire,
|
|
12490
|
+
time_zone: z.coerce
|
|
12491
|
+
.string()
|
|
12492
|
+
.optional()
|
|
12493
|
+
.describe('The IANA time zone the windows are aligned to.'),
|
|
12494
|
+
});
|
|
12495
|
+
export const getCustomerEntitlementHistoryResponseWire = entitlementHistoryWire;
|
|
12496
|
+
export const getCustomerEntitlementPathParamsWire = z.object({
|
|
12497
|
+
customerId: ulidWire,
|
|
12498
|
+
entitlementId: ulidWire,
|
|
12499
|
+
});
|
|
12500
|
+
export const getCustomerEntitlementResponseWire = entitlementWire;
|
|
12501
|
+
export const listCustomerEntitlementsPathParamsWire = z.object({
|
|
12502
|
+
customerId: ulidWire,
|
|
12503
|
+
});
|
|
12504
|
+
export const listCustomerEntitlementsQueryParamsWire = z.object({
|
|
12505
|
+
page: z
|
|
12506
|
+
.strictObject({
|
|
12507
|
+
size: z.coerce
|
|
12508
|
+
.number()
|
|
12509
|
+
.int()
|
|
12510
|
+
.optional()
|
|
12511
|
+
.describe('The number of items to include per page.'),
|
|
12512
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12513
|
+
})
|
|
12514
|
+
.optional()
|
|
12515
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12516
|
+
sort: z
|
|
12517
|
+
.string()
|
|
12518
|
+
.optional()
|
|
12519
|
+
.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.'),
|
|
12520
|
+
filter: listCustomerEntitlementsParamsFilterWire.optional(),
|
|
12521
|
+
});
|
|
12522
|
+
export const listCustomerEntitlementsResponseWire = z.strictObject({
|
|
12523
|
+
data: z.array(entitlementWire),
|
|
12524
|
+
meta: paginatedMetaWire,
|
|
12525
|
+
});
|
|
12526
|
+
export const resetCustomerEntitlementUsagePathParamsWire = z.object({
|
|
12527
|
+
customerId: ulidWire,
|
|
12528
|
+
entitlementId: ulidWire,
|
|
12529
|
+
});
|
|
12530
|
+
export const resetCustomerEntitlementUsageBodyWire = resetCustomerEntitlementUsageRequestWire;
|
|
12531
|
+
export const deleteCustomerEntitlementPathParamsWire = z.object({
|
|
12532
|
+
customerId: ulidWire,
|
|
12533
|
+
entitlementId: ulidWire,
|
|
12534
|
+
});
|
|
12535
|
+
export const listEntitlementsQueryParamsWire = z.object({
|
|
12536
|
+
page: z
|
|
12537
|
+
.strictObject({
|
|
12538
|
+
size: z.coerce
|
|
12539
|
+
.number()
|
|
12540
|
+
.int()
|
|
12541
|
+
.optional()
|
|
12542
|
+
.describe('The number of items to include per page.'),
|
|
12543
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12544
|
+
})
|
|
12545
|
+
.optional()
|
|
12546
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12547
|
+
sort: z
|
|
12548
|
+
.string()
|
|
12549
|
+
.optional()
|
|
12550
|
+
.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.'),
|
|
12551
|
+
filter: listEntitlementsParamsFilterWire.optional(),
|
|
12552
|
+
});
|
|
12553
|
+
export const listEntitlementsResponseWire = z.strictObject({
|
|
12554
|
+
data: z.array(entitlementWire),
|
|
12555
|
+
meta: paginatedMetaWire,
|
|
12556
|
+
});
|
|
12557
|
+
export const getEntitlementPathParamsWire = z.object({
|
|
12558
|
+
entitlementId: ulidWire,
|
|
12559
|
+
});
|
|
12560
|
+
export const getEntitlementResponseWire = entitlementWire;
|
|
12561
|
+
export const createCustomerEntitlementGrantPathParamsWire = z.object({
|
|
12562
|
+
customerId: ulidWire,
|
|
12563
|
+
entitlementId: ulidWire,
|
|
12564
|
+
});
|
|
12565
|
+
export const createCustomerEntitlementGrantBodyWire = entitlementGrantCreateRequestWire;
|
|
12566
|
+
export const createCustomerEntitlementGrantResponseWire = entitlementGrantWire;
|
|
12567
|
+
export const listCustomerEntitlementGrantsPathParamsWire = z.object({
|
|
12568
|
+
customerId: ulidWire,
|
|
12569
|
+
entitlementId: ulidWire,
|
|
12570
|
+
});
|
|
12571
|
+
export const listCustomerEntitlementGrantsQueryParamsWire = z.object({
|
|
12572
|
+
page: z
|
|
12573
|
+
.strictObject({
|
|
12574
|
+
size: z.coerce
|
|
12575
|
+
.number()
|
|
12576
|
+
.int()
|
|
12577
|
+
.optional()
|
|
12578
|
+
.describe('The number of items to include per page.'),
|
|
12579
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12580
|
+
})
|
|
12581
|
+
.optional()
|
|
12582
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12583
|
+
sort: z
|
|
12584
|
+
.string()
|
|
12585
|
+
.optional()
|
|
12586
|
+
.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.'),
|
|
12587
|
+
include_deleted: z.coerce
|
|
12588
|
+
.boolean()
|
|
12589
|
+
.optional()
|
|
12590
|
+
.describe('Include deleted grants in the response.'),
|
|
12591
|
+
});
|
|
12592
|
+
export const listCustomerEntitlementGrantsResponseWire = z.strictObject({
|
|
12593
|
+
data: z.array(entitlementGrantWire),
|
|
12594
|
+
meta: paginatedMetaWire,
|
|
12595
|
+
});
|
|
12596
|
+
export const getCustomerEntitlementValuePathParamsWire = z.object({
|
|
12597
|
+
customerId: ulidWire,
|
|
12598
|
+
entitlementId: ulidWire,
|
|
12599
|
+
});
|
|
12600
|
+
export const getCustomerEntitlementValueQueryParamsWire = z.object({
|
|
12601
|
+
expand: z
|
|
12602
|
+
.array(entitlementAccessExpandWire)
|
|
12603
|
+
.optional()
|
|
12604
|
+
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
12605
|
+
at: dateTimeWire.optional(),
|
|
12606
|
+
});
|
|
12607
|
+
export const getCustomerEntitlementValueResponseWire = entitlementValueResultWire;
|
|
12608
|
+
export const listGrantsQueryParamsWire = z.object({
|
|
12609
|
+
page: z
|
|
12610
|
+
.strictObject({
|
|
12611
|
+
size: z.coerce
|
|
12612
|
+
.number()
|
|
12613
|
+
.int()
|
|
12614
|
+
.optional()
|
|
12615
|
+
.describe('The number of items to include per page.'),
|
|
12616
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
12617
|
+
})
|
|
12618
|
+
.optional()
|
|
12619
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
12620
|
+
sort: z
|
|
12621
|
+
.string()
|
|
12622
|
+
.optional()
|
|
12623
|
+
.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.'),
|
|
12624
|
+
filter: listGrantsParamsFilterWire.optional(),
|
|
12625
|
+
include_deleted: z.coerce
|
|
12626
|
+
.boolean()
|
|
12627
|
+
.optional()
|
|
12628
|
+
.describe('Include deleted grants in the response.'),
|
|
12629
|
+
});
|
|
12630
|
+
export const listGrantsResponseWire = z.strictObject({
|
|
12631
|
+
data: z.array(entitlementGrantWire),
|
|
12632
|
+
meta: paginatedMetaWire,
|
|
12633
|
+
});
|
|
12634
|
+
export const voidGrantPathParamsWire = z.object({
|
|
12635
|
+
grantId: ulidWire,
|
|
12636
|
+
});
|
|
12637
|
+
export const voidGrantQueryParamsWire = z.object({
|
|
12638
|
+
voided_at: dateTimeWire.optional(),
|
|
11239
12639
|
});
|
|
11240
|
-
export const getCustomerEntitlementAccessResponseWire = entitlementAccessResultWire;
|
|
11241
12640
|
export const createCreditGrantPathParamsWire = z.object({
|
|
11242
12641
|
customerId: ulidWire,
|
|
11243
12642
|
});
|
|
@@ -11931,3 +13330,39 @@ export const queryEntitlementAccessQueryParamsWire = z.object({
|
|
|
11931
13330
|
});
|
|
11932
13331
|
export const queryEntitlementAccessBodyWire = entitlementAccessQueryRequestWire;
|
|
11933
13332
|
export const queryEntitlementAccessResponseWire = entitlementAccessQueryResponseWire;
|
|
13333
|
+
export const listNotificationChannelsQueryParamsWire = z.object({
|
|
13334
|
+
page: z
|
|
13335
|
+
.strictObject({
|
|
13336
|
+
size: z.coerce
|
|
13337
|
+
.number()
|
|
13338
|
+
.int()
|
|
13339
|
+
.optional()
|
|
13340
|
+
.describe('The number of items to include per page.'),
|
|
13341
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
13342
|
+
})
|
|
13343
|
+
.optional()
|
|
13344
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
13345
|
+
sort: z
|
|
13346
|
+
.string()
|
|
13347
|
+
.optional()
|
|
13348
|
+
.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.'),
|
|
13349
|
+
filter: listNotificationChannelsParamsFilterWire.optional(),
|
|
13350
|
+
});
|
|
13351
|
+
export const listNotificationChannelsResponseWire = z.strictObject({
|
|
13352
|
+
data: z.array(notificationChannelWire),
|
|
13353
|
+
meta: paginatedMetaWire,
|
|
13354
|
+
});
|
|
13355
|
+
export const createNotificationChannelBodyWire = createNotificationChannelRequestWire;
|
|
13356
|
+
export const createNotificationChannelResponseWire = notificationChannelWire;
|
|
13357
|
+
export const getNotificationChannelPathParamsWire = z.object({
|
|
13358
|
+
notificationChannelId: ulidWire,
|
|
13359
|
+
});
|
|
13360
|
+
export const getNotificationChannelResponseWire = notificationChannelWire;
|
|
13361
|
+
export const updateNotificationChannelPathParamsWire = z.object({
|
|
13362
|
+
notificationChannelId: ulidWire,
|
|
13363
|
+
});
|
|
13364
|
+
export const updateNotificationChannelBodyWire = updateNotificationChannelRequestWire;
|
|
13365
|
+
export const updateNotificationChannelResponseWire = notificationChannelWire;
|
|
13366
|
+
export const deleteNotificationChannelPathParamsWire = z.object({
|
|
13367
|
+
notificationChannelId: ulidWire,
|
|
13368
|
+
});
|