@openmeter/client 1.0.0-beta-6d41ced5d8d3 → 1.0.0-beta-89ad46498d71
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 +1 -0
- package/dist/funcs/customers.d.ts +13 -1
- package/dist/funcs/customers.js +43 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +6 -1
- package/dist/models/schemas.d.ts +938 -38
- package/dist/models/schemas.js +421 -54
- package/dist/models/types.d.ts +384 -36
- package/dist/sdk/internal.d.ts +19 -1
- package/dist/sdk/internal.js +25 -1
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -378,6 +378,13 @@ 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 iso8601Duration = z
|
|
382
|
+
.string()
|
|
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)?)?$'))
|
|
384
|
+
.describe('[ISO 8601 Duration](https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm) string.');
|
|
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.');
|
|
381
388
|
export const createLabels = z
|
|
382
389
|
.record(z.string(), z.string())
|
|
383
390
|
.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 "\\_".');
|
|
@@ -390,10 +397,6 @@ export const creditAvailabilityPolicy = z
|
|
|
390
397
|
export const taxBehavior = z
|
|
391
398
|
.enum(['inclusive', 'exclusive'])
|
|
392
399
|
.describe('Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.');
|
|
393
|
-
export const iso8601Duration = z
|
|
394
|
-
.string()
|
|
395
|
-
.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
|
-
.describe('[ISO 8601 Duration](https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm) string.');
|
|
397
400
|
export const creditPurchasePaymentSettlementStatus = z
|
|
398
401
|
.enum(['pending', 'authorized', 'settled'])
|
|
399
402
|
.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.');
|
|
@@ -1182,6 +1185,19 @@ export const entitlementAccessValue = z
|
|
|
1182
1185
|
.describe('The remaining balance of each grant, keyed by grant ID.'),
|
|
1183
1186
|
})
|
|
1184
1187
|
.describe('Balance details of a metered entitlement.');
|
|
1188
|
+
export const entitlementIssueAfterReset = z
|
|
1189
|
+
.object({
|
|
1190
|
+
amount: numeric,
|
|
1191
|
+
priority: z
|
|
1192
|
+
.number()
|
|
1193
|
+
.int()
|
|
1194
|
+
.gte(1)
|
|
1195
|
+
.lte(255)
|
|
1196
|
+
.optional()
|
|
1197
|
+
.default(1)
|
|
1198
|
+
.describe('The priority of the grant created after each reset. Lower values have higher priority.'),
|
|
1199
|
+
})
|
|
1200
|
+
.describe('Usage granted automatically after each reset of a metered entitlement. The balance returns to `amount` after every reset.');
|
|
1185
1201
|
export const createChargeCostBasisManual = z
|
|
1186
1202
|
.object({
|
|
1187
1203
|
type: z
|
|
@@ -1413,6 +1429,11 @@ export const profileReference = z
|
|
|
1413
1429
|
id: ulid,
|
|
1414
1430
|
})
|
|
1415
1431
|
.describe('Billing profile reference.');
|
|
1432
|
+
export const featureReference = z
|
|
1433
|
+
.object({
|
|
1434
|
+
id: ulid,
|
|
1435
|
+
})
|
|
1436
|
+
.describe('Feature reference.');
|
|
1416
1437
|
export const createChargeCostBasisPinned = z
|
|
1417
1438
|
.object({
|
|
1418
1439
|
type: z
|
|
@@ -1464,11 +1485,6 @@ export const subscriptionCostBasisPin = z
|
|
|
1464
1485
|
costBasisId: ulid,
|
|
1465
1486
|
})
|
|
1466
1487
|
.describe('A cost basis pinned to a custom-currency pair for the subscription.');
|
|
1467
|
-
export const featureReference = z
|
|
1468
|
-
.object({
|
|
1469
|
-
id: ulid,
|
|
1470
|
-
})
|
|
1471
|
-
.describe('Feature reference.');
|
|
1472
1488
|
export const subscriptionReference = z
|
|
1473
1489
|
.object({
|
|
1474
1490
|
id: ulid,
|
|
@@ -1622,6 +1638,12 @@ export const appStripeCreateCustomerPortalSessionResult = z
|
|
|
1622
1638
|
.describe('The URL to redirect the customer to after they have completed their requested actions.'),
|
|
1623
1639
|
})
|
|
1624
1640
|
.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.');
|
|
1641
|
+
export const closedPeriod = z
|
|
1642
|
+
.object({
|
|
1643
|
+
from: dateTime,
|
|
1644
|
+
to: dateTime,
|
|
1645
|
+
})
|
|
1646
|
+
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
1625
1647
|
export const chargeResolvedCostBasis = z
|
|
1626
1648
|
.object({
|
|
1627
1649
|
fiatCurrency: currencyCode,
|
|
@@ -1630,12 +1652,6 @@ export const chargeResolvedCostBasis = z
|
|
|
1630
1652
|
resolvedAt: dateTime,
|
|
1631
1653
|
})
|
|
1632
1654
|
.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.');
|
|
1633
|
-
export const closedPeriod = z
|
|
1634
|
-
.object({
|
|
1635
|
-
from: dateTime,
|
|
1636
|
-
to: dateTime,
|
|
1637
|
-
})
|
|
1638
|
-
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
1639
1655
|
export const subscriptionAddonTimelineSegment = z
|
|
1640
1656
|
.object({
|
|
1641
1657
|
activeFrom: dateTime,
|
|
@@ -2153,6 +2169,18 @@ export const customerStripeCreateCustomerPortalSessionRequest = z
|
|
|
2153
2169
|
stripeOptions: appStripeCreateCustomerPortalSessionOptions,
|
|
2154
2170
|
})
|
|
2155
2171
|
.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.');
|
|
2172
|
+
export const recurringPeriodInput = z
|
|
2173
|
+
.object({
|
|
2174
|
+
interval: iso8601Duration,
|
|
2175
|
+
anchor: dateTime.optional(),
|
|
2176
|
+
})
|
|
2177
|
+
.describe('Recurring period input. The anchor is optional; the owning resource defines the default, typically its creation time.');
|
|
2178
|
+
export const recurringPeriod = z
|
|
2179
|
+
.object({
|
|
2180
|
+
anchor: dateTime,
|
|
2181
|
+
interval: iso8601Duration,
|
|
2182
|
+
})
|
|
2183
|
+
.describe('Recurring period with an anchor and an interval.');
|
|
2156
2184
|
export const rateCardMeteredEntitlement = z
|
|
2157
2185
|
.object({
|
|
2158
2186
|
type: z
|
|
@@ -2194,12 +2222,9 @@ export const subscriptionEditStretchPhase = z
|
|
|
2194
2222
|
extendBy: iso8601Duration,
|
|
2195
2223
|
})
|
|
2196
2224
|
.describe('Extend the duration of a phase, shifting later phases by the same amount.');
|
|
2197
|
-
export const
|
|
2198
|
-
.
|
|
2199
|
-
|
|
2200
|
-
interval: iso8601Duration,
|
|
2201
|
-
})
|
|
2202
|
-
.describe('Recurring period with an anchor and an interval.');
|
|
2225
|
+
export const entitlementMeasureUsageFrom = z
|
|
2226
|
+
.union([entitlementMeasureUsageFromPreset, dateTime])
|
|
2227
|
+
.describe('The time from which usage is measured, as a preset or an explicit timestamp.');
|
|
2203
2228
|
export const updateCreditGrantExternalSettlementRequest = z
|
|
2204
2229
|
.object({
|
|
2205
2230
|
status: creditPurchasePaymentSettlementStatus,
|
|
@@ -3213,6 +3238,122 @@ export const appStripeCreateCheckoutSessionConsentCollection = z
|
|
|
3213
3238
|
termsOfService: appStripeCreateCheckoutSessionConsentCollectionTermsOfService.optional(),
|
|
3214
3239
|
})
|
|
3215
3240
|
.describe('Checkout Session consent collection configuration.');
|
|
3241
|
+
export const entitlementGrantCreateRequest = z
|
|
3242
|
+
.object({
|
|
3243
|
+
amount: numeric,
|
|
3244
|
+
priority: z
|
|
3245
|
+
.number()
|
|
3246
|
+
.int()
|
|
3247
|
+
.gte(1)
|
|
3248
|
+
.lte(255)
|
|
3249
|
+
.optional()
|
|
3250
|
+
.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.'),
|
|
3251
|
+
effectiveAt: dateTime,
|
|
3252
|
+
expiresAfter: iso8601Duration.optional(),
|
|
3253
|
+
maxRolloverAmount: numeric.optional(),
|
|
3254
|
+
minRolloverAmount: numeric.optional(),
|
|
3255
|
+
labels: labels.optional(),
|
|
3256
|
+
recurrence: recurringPeriodInput.optional(),
|
|
3257
|
+
})
|
|
3258
|
+
.describe('A grant created together with a metered entitlement.');
|
|
3259
|
+
export const createEntitlementStaticRequest = z
|
|
3260
|
+
.object({
|
|
3261
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
3262
|
+
feature: featureReference,
|
|
3263
|
+
labels: labels.optional(),
|
|
3264
|
+
config: z
|
|
3265
|
+
.unknown()
|
|
3266
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
3267
|
+
usagePeriod: recurringPeriodInput.optional(),
|
|
3268
|
+
})
|
|
3269
|
+
.describe('Static entitlement create request.');
|
|
3270
|
+
export const createEntitlementBooleanRequest = z
|
|
3271
|
+
.object({
|
|
3272
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
3273
|
+
feature: featureReference,
|
|
3274
|
+
labels: labels.optional(),
|
|
3275
|
+
usagePeriod: recurringPeriodInput.optional(),
|
|
3276
|
+
})
|
|
3277
|
+
.describe('Boolean entitlement create request.');
|
|
3278
|
+
export const entitlementMetered = z
|
|
3279
|
+
.object({
|
|
3280
|
+
id: ulid,
|
|
3281
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
3282
|
+
feature: featureReference,
|
|
3283
|
+
customer: customerReference,
|
|
3284
|
+
labels: labels.optional(),
|
|
3285
|
+
activeFrom: dateTime,
|
|
3286
|
+
activeTo: dateTime.optional(),
|
|
3287
|
+
createdAt: dateTime,
|
|
3288
|
+
updatedAt: dateTime,
|
|
3289
|
+
deletedAt: dateTime.optional(),
|
|
3290
|
+
usagePeriod: recurringPeriod,
|
|
3291
|
+
currentUsagePeriod: closedPeriod,
|
|
3292
|
+
isSoftLimit: z
|
|
3293
|
+
.boolean()
|
|
3294
|
+
.optional()
|
|
3295
|
+
.default(false)
|
|
3296
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
3297
|
+
issue: entitlementIssueAfterReset.optional(),
|
|
3298
|
+
issueAfterReset: numeric.optional(),
|
|
3299
|
+
issueAfterResetPriority: z
|
|
3300
|
+
.number()
|
|
3301
|
+
.int()
|
|
3302
|
+
.gte(1)
|
|
3303
|
+
.lte(255)
|
|
3304
|
+
.optional()
|
|
3305
|
+
.default(1)
|
|
3306
|
+
.describe('The priority of the grant created after each reset.'),
|
|
3307
|
+
preserveOverageAtReset: z
|
|
3308
|
+
.boolean()
|
|
3309
|
+
.optional()
|
|
3310
|
+
.default(false)
|
|
3311
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
3312
|
+
measureUsageFrom: dateTime,
|
|
3313
|
+
lastReset: dateTime,
|
|
3314
|
+
})
|
|
3315
|
+
.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.');
|
|
3316
|
+
export const entitlementStatic = z
|
|
3317
|
+
.object({
|
|
3318
|
+
id: ulid,
|
|
3319
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
3320
|
+
feature: featureReference,
|
|
3321
|
+
customer: customerReference,
|
|
3322
|
+
labels: labels.optional(),
|
|
3323
|
+
usagePeriod: recurringPeriod.optional(),
|
|
3324
|
+
currentUsagePeriod: closedPeriod.optional(),
|
|
3325
|
+
activeFrom: dateTime,
|
|
3326
|
+
activeTo: dateTime.optional(),
|
|
3327
|
+
createdAt: dateTime,
|
|
3328
|
+
updatedAt: dateTime,
|
|
3329
|
+
deletedAt: dateTime.optional(),
|
|
3330
|
+
config: z
|
|
3331
|
+
.unknown()
|
|
3332
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
3333
|
+
})
|
|
3334
|
+
.describe('A static entitlement grants access to a feature together with a configuration.');
|
|
3335
|
+
export const entitlementBoolean = z
|
|
3336
|
+
.object({
|
|
3337
|
+
id: ulid,
|
|
3338
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
3339
|
+
feature: featureReference,
|
|
3340
|
+
customer: customerReference,
|
|
3341
|
+
labels: labels.optional(),
|
|
3342
|
+
usagePeriod: recurringPeriod.optional(),
|
|
3343
|
+
currentUsagePeriod: closedPeriod.optional(),
|
|
3344
|
+
activeFrom: dateTime,
|
|
3345
|
+
activeTo: dateTime.optional(),
|
|
3346
|
+
createdAt: dateTime,
|
|
3347
|
+
updatedAt: dateTime,
|
|
3348
|
+
deletedAt: dateTime.optional(),
|
|
3349
|
+
})
|
|
3350
|
+
.describe('A boolean entitlement grants access to a feature.');
|
|
3351
|
+
export const workflowCollectionAlignmentAnchored = z
|
|
3352
|
+
.object({
|
|
3353
|
+
type: z.literal('anchored').describe('The type of alignment.'),
|
|
3354
|
+
recurringPeriod: recurringPeriod,
|
|
3355
|
+
})
|
|
3356
|
+
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
3216
3357
|
export const rateCardEntitlement = z
|
|
3217
3358
|
.discriminatedUnion('type', [
|
|
3218
3359
|
rateCardMeteredEntitlement,
|
|
@@ -3228,12 +3369,6 @@ export const subscriptionEditAddPhase = z
|
|
|
3228
3369
|
phase: subscriptionPhaseCreate,
|
|
3229
3370
|
})
|
|
3230
3371
|
.describe('Add a new phase to the subscription. The phase is created without items; use add-item operations to populate it.');
|
|
3231
|
-
export const workflowCollectionAlignmentAnchored = z
|
|
3232
|
-
.object({
|
|
3233
|
-
type: z.literal('anchored').describe('The type of alignment.'),
|
|
3234
|
-
recurringPeriod: recurringPeriod,
|
|
3235
|
-
})
|
|
3236
|
-
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
3237
3372
|
export const subscriptionBase = z
|
|
3238
3373
|
.object({
|
|
3239
3374
|
id: ulid,
|
|
@@ -3738,6 +3873,46 @@ export const appStripeCreateCheckoutSessionRequestOptions = z
|
|
|
3738
3873
|
taxIdCollection: appStripeCreateCheckoutSessionTaxIdCollection.optional(),
|
|
3739
3874
|
})
|
|
3740
3875
|
.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).");
|
|
3876
|
+
export const createEntitlementMeteredRequest = z
|
|
3877
|
+
.object({
|
|
3878
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
3879
|
+
feature: featureReference,
|
|
3880
|
+
labels: labels.optional(),
|
|
3881
|
+
isSoftLimit: z
|
|
3882
|
+
.boolean()
|
|
3883
|
+
.optional()
|
|
3884
|
+
.default(false)
|
|
3885
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
3886
|
+
issue: entitlementIssueAfterReset.optional(),
|
|
3887
|
+
issueAfterReset: numeric.optional(),
|
|
3888
|
+
issueAfterResetPriority: z
|
|
3889
|
+
.number()
|
|
3890
|
+
.int()
|
|
3891
|
+
.gte(1)
|
|
3892
|
+
.lte(255)
|
|
3893
|
+
.optional()
|
|
3894
|
+
.default(1)
|
|
3895
|
+
.describe('The priority of the grant created after each reset.'),
|
|
3896
|
+
preserveOverageAtReset: z
|
|
3897
|
+
.boolean()
|
|
3898
|
+
.optional()
|
|
3899
|
+
.default(false)
|
|
3900
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
3901
|
+
usagePeriod: recurringPeriodInput,
|
|
3902
|
+
measureUsageFrom: entitlementMeasureUsageFrom.optional(),
|
|
3903
|
+
grants: z
|
|
3904
|
+
.array(entitlementGrantCreateRequest)
|
|
3905
|
+
.optional()
|
|
3906
|
+
.describe('Grants created together with the entitlement. Cannot be combined with `issue`.'),
|
|
3907
|
+
})
|
|
3908
|
+
.describe('Metered entitlement create request.');
|
|
3909
|
+
export const entitlement = z
|
|
3910
|
+
.discriminatedUnion('type', [
|
|
3911
|
+
entitlementMetered,
|
|
3912
|
+
entitlementStatic,
|
|
3913
|
+
entitlementBoolean,
|
|
3914
|
+
])
|
|
3915
|
+
.describe('An entitlement grants a customer access to a feature.');
|
|
3741
3916
|
export const workflowCollectionAlignment = z
|
|
3742
3917
|
.discriminatedUnion('type', [
|
|
3743
3918
|
workflowCollectionAlignmentSubscription,
|
|
@@ -4166,6 +4341,13 @@ export const customerStripeCreateCheckoutSessionRequest = z
|
|
|
4166
4341
|
stripeOptions: appStripeCreateCheckoutSessionRequestOptions,
|
|
4167
4342
|
})
|
|
4168
4343
|
.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.');
|
|
4344
|
+
export const createEntitlementRequest = z
|
|
4345
|
+
.discriminatedUnion('type', [
|
|
4346
|
+
createEntitlementMeteredRequest,
|
|
4347
|
+
createEntitlementStaticRequest,
|
|
4348
|
+
createEntitlementBooleanRequest,
|
|
4349
|
+
])
|
|
4350
|
+
.describe('Entitlement create request.');
|
|
4169
4351
|
export const workflowCollectionSettings = z
|
|
4170
4352
|
.object({
|
|
4171
4353
|
alignment: workflowCollectionAlignment.optional().default({
|
|
@@ -5301,6 +5483,11 @@ export const getCustomerEntitlementAccessQueryParams = z.object({
|
|
|
5301
5483
|
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
5302
5484
|
});
|
|
5303
5485
|
export const getCustomerEntitlementAccessResponse = entitlementAccessResult;
|
|
5486
|
+
export const createCustomerEntitlementPathParams = z.object({
|
|
5487
|
+
customerId: ulid,
|
|
5488
|
+
});
|
|
5489
|
+
export const createCustomerEntitlementBody = createEntitlementRequest;
|
|
5490
|
+
export const createCustomerEntitlementResponse = entitlement;
|
|
5304
5491
|
export const createCreditGrantPathParams = z.object({
|
|
5305
5492
|
customerId: ulid,
|
|
5306
5493
|
});
|
|
@@ -6332,6 +6519,13 @@ export const entitlementTypeWire = z
|
|
|
6332
6519
|
export const entitlementAccessExpandWire = z
|
|
6333
6520
|
.enum(['value'])
|
|
6334
6521
|
.describe('Expands for customer entitlement access. Values: - `value`: The balance details of a metered entitlement; it sets the `value` field.');
|
|
6522
|
+
export const iso8601DurationWire = z
|
|
6523
|
+
.string()
|
|
6524
|
+
.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)?)?$'))
|
|
6525
|
+
.describe('[ISO 8601 Duration](https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm) string.');
|
|
6526
|
+
export const entitlementMeasureUsageFromPresetWire = z
|
|
6527
|
+
.enum(['current_period_start', 'now'])
|
|
6528
|
+
.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.');
|
|
6335
6529
|
export const createLabelsWire = z
|
|
6336
6530
|
.record(z.string(), z.string())
|
|
6337
6531
|
.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 "\\_".');
|
|
@@ -6344,10 +6538,6 @@ export const creditAvailabilityPolicyWire = z
|
|
|
6344
6538
|
export const taxBehaviorWire = z
|
|
6345
6539
|
.enum(['inclusive', 'exclusive'])
|
|
6346
6540
|
.describe('Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.');
|
|
6347
|
-
export const iso8601DurationWire = z
|
|
6348
|
-
.string()
|
|
6349
|
-
.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)?)?$'))
|
|
6350
|
-
.describe('[ISO 8601 Duration](https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm) string.');
|
|
6351
6541
|
export const creditPurchasePaymentSettlementStatusWire = z
|
|
6352
6542
|
.enum(['pending', 'authorized', 'settled'])
|
|
6353
6543
|
.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.');
|
|
@@ -7130,6 +7320,18 @@ export const entitlementAccessValueWire = z
|
|
|
7130
7320
|
.describe('The remaining balance of each grant, keyed by grant ID.'),
|
|
7131
7321
|
})
|
|
7132
7322
|
.describe('Balance details of a metered entitlement.');
|
|
7323
|
+
export const entitlementIssueAfterResetWire = z
|
|
7324
|
+
.strictObject({
|
|
7325
|
+
amount: numericWire,
|
|
7326
|
+
priority: z
|
|
7327
|
+
.number()
|
|
7328
|
+
.int()
|
|
7329
|
+
.gte(1)
|
|
7330
|
+
.lte(255)
|
|
7331
|
+
.optional()
|
|
7332
|
+
.describe('The priority of the grant created after each reset. Lower values have higher priority.'),
|
|
7333
|
+
})
|
|
7334
|
+
.describe('Usage granted automatically after each reset of a metered entitlement. The balance returns to `amount` after every reset.');
|
|
7133
7335
|
export const createChargeCostBasisManualWire = z
|
|
7134
7336
|
.strictObject({
|
|
7135
7337
|
type: z
|
|
@@ -7361,6 +7563,11 @@ export const profileReferenceWire = z
|
|
|
7361
7563
|
id: ulidWire,
|
|
7362
7564
|
})
|
|
7363
7565
|
.describe('Billing profile reference.');
|
|
7566
|
+
export const featureReferenceWire = z
|
|
7567
|
+
.strictObject({
|
|
7568
|
+
id: ulidWire,
|
|
7569
|
+
})
|
|
7570
|
+
.describe('Feature reference.');
|
|
7364
7571
|
export const createChargeCostBasisPinnedWire = z
|
|
7365
7572
|
.strictObject({
|
|
7366
7573
|
type: z
|
|
@@ -7412,11 +7619,6 @@ export const subscriptionCostBasisPinWire = z
|
|
|
7412
7619
|
cost_basis_id: ulidWire,
|
|
7413
7620
|
})
|
|
7414
7621
|
.describe('A cost basis pinned to a custom-currency pair for the subscription.');
|
|
7415
|
-
export const featureReferenceWire = z
|
|
7416
|
-
.strictObject({
|
|
7417
|
-
id: ulidWire,
|
|
7418
|
-
})
|
|
7419
|
-
.describe('Feature reference.');
|
|
7420
7622
|
export const subscriptionReferenceWire = z
|
|
7421
7623
|
.strictObject({
|
|
7422
7624
|
id: ulidWire,
|
|
@@ -7569,6 +7771,12 @@ export const appStripeCreateCustomerPortalSessionResultWire = z
|
|
|
7569
7771
|
.describe('The URL to redirect the customer to after they have completed their requested actions.'),
|
|
7570
7772
|
})
|
|
7571
7773
|
.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.');
|
|
7774
|
+
export const closedPeriodWire = z
|
|
7775
|
+
.strictObject({
|
|
7776
|
+
from: dateTimeWire,
|
|
7777
|
+
to: dateTimeWire,
|
|
7778
|
+
})
|
|
7779
|
+
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
7572
7780
|
export const chargeResolvedCostBasisWire = z
|
|
7573
7781
|
.strictObject({
|
|
7574
7782
|
fiat_currency: currencyCodeWire,
|
|
@@ -7577,12 +7785,6 @@ export const chargeResolvedCostBasisWire = z
|
|
|
7577
7785
|
resolved_at: dateTimeWire,
|
|
7578
7786
|
})
|
|
7579
7787
|
.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.');
|
|
7580
|
-
export const closedPeriodWire = z
|
|
7581
|
-
.strictObject({
|
|
7582
|
-
from: dateTimeWire,
|
|
7583
|
-
to: dateTimeWire,
|
|
7584
|
-
})
|
|
7585
|
-
.describe('A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.');
|
|
7586
7788
|
export const subscriptionAddonTimelineSegmentWire = z
|
|
7587
7789
|
.strictObject({
|
|
7588
7790
|
active_from: dateTimeWire,
|
|
@@ -8091,6 +8293,18 @@ export const customerStripeCreateCustomerPortalSessionRequestWire = z
|
|
|
8091
8293
|
stripe_options: appStripeCreateCustomerPortalSessionOptionsWire,
|
|
8092
8294
|
})
|
|
8093
8295
|
.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.');
|
|
8296
|
+
export const recurringPeriodInputWire = z
|
|
8297
|
+
.strictObject({
|
|
8298
|
+
interval: iso8601DurationWire,
|
|
8299
|
+
anchor: dateTimeWire.optional(),
|
|
8300
|
+
})
|
|
8301
|
+
.describe('Recurring period input. The anchor is optional; the owning resource defines the default, typically its creation time.');
|
|
8302
|
+
export const recurringPeriodWire = z
|
|
8303
|
+
.strictObject({
|
|
8304
|
+
anchor: dateTimeWire,
|
|
8305
|
+
interval: iso8601DurationWire,
|
|
8306
|
+
})
|
|
8307
|
+
.describe('Recurring period with an anchor and an interval.');
|
|
8094
8308
|
export const rateCardMeteredEntitlementWire = z
|
|
8095
8309
|
.strictObject({
|
|
8096
8310
|
type: z
|
|
@@ -8131,12 +8345,9 @@ export const subscriptionEditStretchPhaseWire = z
|
|
|
8131
8345
|
extend_by: iso8601DurationWire,
|
|
8132
8346
|
})
|
|
8133
8347
|
.describe('Extend the duration of a phase, shifting later phases by the same amount.');
|
|
8134
|
-
export const
|
|
8135
|
-
.
|
|
8136
|
-
|
|
8137
|
-
interval: iso8601DurationWire,
|
|
8138
|
-
})
|
|
8139
|
-
.describe('Recurring period with an anchor and an interval.');
|
|
8348
|
+
export const entitlementMeasureUsageFromWire = z
|
|
8349
|
+
.union([entitlementMeasureUsageFromPresetWire, dateTimeWire])
|
|
8350
|
+
.describe('The time from which usage is measured, as a preset or an explicit timestamp.');
|
|
8140
8351
|
export const updateCreditGrantExternalSettlementRequestWire = z
|
|
8141
8352
|
.strictObject({
|
|
8142
8353
|
status: creditPurchasePaymentSettlementStatusWire,
|
|
@@ -9141,6 +9352,119 @@ export const appStripeCreateCheckoutSessionConsentCollectionWire = z
|
|
|
9141
9352
|
terms_of_service: appStripeCreateCheckoutSessionConsentCollectionTermsOfServiceWire.optional(),
|
|
9142
9353
|
})
|
|
9143
9354
|
.describe('Checkout Session consent collection configuration.');
|
|
9355
|
+
export const entitlementGrantCreateRequestWire = z
|
|
9356
|
+
.strictObject({
|
|
9357
|
+
amount: numericWire,
|
|
9358
|
+
priority: z
|
|
9359
|
+
.number()
|
|
9360
|
+
.int()
|
|
9361
|
+
.gte(1)
|
|
9362
|
+
.lte(255)
|
|
9363
|
+
.optional()
|
|
9364
|
+
.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.'),
|
|
9365
|
+
effective_at: dateTimeWire,
|
|
9366
|
+
expires_after: iso8601DurationWire.optional(),
|
|
9367
|
+
max_rollover_amount: numericWire.optional(),
|
|
9368
|
+
min_rollover_amount: numericWire.optional(),
|
|
9369
|
+
labels: labelsWire.optional(),
|
|
9370
|
+
recurrence: recurringPeriodInputWire.optional(),
|
|
9371
|
+
})
|
|
9372
|
+
.describe('A grant created together with a metered entitlement.');
|
|
9373
|
+
export const createEntitlementStaticRequestWire = z
|
|
9374
|
+
.strictObject({
|
|
9375
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
9376
|
+
feature: featureReferenceWire,
|
|
9377
|
+
labels: labelsWire.optional(),
|
|
9378
|
+
config: z
|
|
9379
|
+
.unknown()
|
|
9380
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
9381
|
+
usage_period: recurringPeriodInputWire.optional(),
|
|
9382
|
+
})
|
|
9383
|
+
.describe('Static entitlement create request.');
|
|
9384
|
+
export const createEntitlementBooleanRequestWire = z
|
|
9385
|
+
.strictObject({
|
|
9386
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
9387
|
+
feature: featureReferenceWire,
|
|
9388
|
+
labels: labelsWire.optional(),
|
|
9389
|
+
usage_period: recurringPeriodInputWire.optional(),
|
|
9390
|
+
})
|
|
9391
|
+
.describe('Boolean entitlement create request.');
|
|
9392
|
+
export const entitlementMeteredWire = z
|
|
9393
|
+
.strictObject({
|
|
9394
|
+
id: ulidWire,
|
|
9395
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
9396
|
+
feature: featureReferenceWire,
|
|
9397
|
+
customer: customerReferenceWire,
|
|
9398
|
+
labels: labelsWire.optional(),
|
|
9399
|
+
active_from: dateTimeWire,
|
|
9400
|
+
active_to: dateTimeWire.optional(),
|
|
9401
|
+
created_at: dateTimeWire,
|
|
9402
|
+
updated_at: dateTimeWire,
|
|
9403
|
+
deleted_at: dateTimeWire.optional(),
|
|
9404
|
+
usage_period: recurringPeriodWire,
|
|
9405
|
+
current_usage_period: closedPeriodWire,
|
|
9406
|
+
is_soft_limit: z
|
|
9407
|
+
.boolean()
|
|
9408
|
+
.optional()
|
|
9409
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
9410
|
+
issue: entitlementIssueAfterResetWire.optional(),
|
|
9411
|
+
issue_after_reset: numericWire.optional(),
|
|
9412
|
+
issue_after_reset_priority: z
|
|
9413
|
+
.number()
|
|
9414
|
+
.int()
|
|
9415
|
+
.gte(1)
|
|
9416
|
+
.lte(255)
|
|
9417
|
+
.optional()
|
|
9418
|
+
.describe('The priority of the grant created after each reset.'),
|
|
9419
|
+
preserve_overage_at_reset: z
|
|
9420
|
+
.boolean()
|
|
9421
|
+
.optional()
|
|
9422
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
9423
|
+
measure_usage_from: dateTimeWire,
|
|
9424
|
+
last_reset: dateTimeWire,
|
|
9425
|
+
})
|
|
9426
|
+
.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.');
|
|
9427
|
+
export const entitlementStaticWire = z
|
|
9428
|
+
.strictObject({
|
|
9429
|
+
id: ulidWire,
|
|
9430
|
+
type: z.literal('static').describe('The type of the entitlement.'),
|
|
9431
|
+
feature: featureReferenceWire,
|
|
9432
|
+
customer: customerReferenceWire,
|
|
9433
|
+
labels: labelsWire.optional(),
|
|
9434
|
+
usage_period: recurringPeriodWire.optional(),
|
|
9435
|
+
current_usage_period: closedPeriodWire.optional(),
|
|
9436
|
+
active_from: dateTimeWire,
|
|
9437
|
+
active_to: dateTimeWire.optional(),
|
|
9438
|
+
created_at: dateTimeWire,
|
|
9439
|
+
updated_at: dateTimeWire,
|
|
9440
|
+
deleted_at: dateTimeWire.optional(),
|
|
9441
|
+
config: z
|
|
9442
|
+
.unknown()
|
|
9443
|
+
.describe('The entitlement configuration as a JSON value. Returned when checking entitlement access.'),
|
|
9444
|
+
})
|
|
9445
|
+
.describe('A static entitlement grants access to a feature together with a configuration.');
|
|
9446
|
+
export const entitlementBooleanWire = z
|
|
9447
|
+
.strictObject({
|
|
9448
|
+
id: ulidWire,
|
|
9449
|
+
type: z.literal('boolean').describe('The type of the entitlement.'),
|
|
9450
|
+
feature: featureReferenceWire,
|
|
9451
|
+
customer: customerReferenceWire,
|
|
9452
|
+
labels: labelsWire.optional(),
|
|
9453
|
+
usage_period: recurringPeriodWire.optional(),
|
|
9454
|
+
current_usage_period: closedPeriodWire.optional(),
|
|
9455
|
+
active_from: dateTimeWire,
|
|
9456
|
+
active_to: dateTimeWire.optional(),
|
|
9457
|
+
created_at: dateTimeWire,
|
|
9458
|
+
updated_at: dateTimeWire,
|
|
9459
|
+
deleted_at: dateTimeWire.optional(),
|
|
9460
|
+
})
|
|
9461
|
+
.describe('A boolean entitlement grants access to a feature.');
|
|
9462
|
+
export const workflowCollectionAlignmentAnchoredWire = z
|
|
9463
|
+
.strictObject({
|
|
9464
|
+
type: z.literal('anchored').describe('The type of alignment.'),
|
|
9465
|
+
recurring_period: recurringPeriodWire,
|
|
9466
|
+
})
|
|
9467
|
+
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
9144
9468
|
export const rateCardEntitlementWire = z
|
|
9145
9469
|
.discriminatedUnion('type', [
|
|
9146
9470
|
rateCardMeteredEntitlementWire,
|
|
@@ -9156,12 +9480,6 @@ export const subscriptionEditAddPhaseWire = z
|
|
|
9156
9480
|
phase: subscriptionPhaseCreateWire,
|
|
9157
9481
|
})
|
|
9158
9482
|
.describe('Add a new phase to the subscription. The phase is created without items; use add-item operations to populate it.');
|
|
9159
|
-
export const workflowCollectionAlignmentAnchoredWire = z
|
|
9160
|
-
.strictObject({
|
|
9161
|
-
type: z.literal('anchored').describe('The type of alignment.'),
|
|
9162
|
-
recurring_period: recurringPeriodWire,
|
|
9163
|
-
})
|
|
9164
|
-
.describe('BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.');
|
|
9165
9483
|
export const subscriptionBaseWire = z
|
|
9166
9484
|
.strictObject({
|
|
9167
9485
|
id: ulidWire,
|
|
@@ -9664,6 +9982,43 @@ export const appStripeCreateCheckoutSessionRequestOptionsWire = z
|
|
|
9664
9982
|
tax_id_collection: appStripeCreateCheckoutSessionTaxIdCollectionWire.optional(),
|
|
9665
9983
|
})
|
|
9666
9984
|
.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).");
|
|
9985
|
+
export const createEntitlementMeteredRequestWire = z
|
|
9986
|
+
.strictObject({
|
|
9987
|
+
type: z.literal('metered').describe('The type of the entitlement.'),
|
|
9988
|
+
feature: featureReferenceWire,
|
|
9989
|
+
labels: labelsWire.optional(),
|
|
9990
|
+
is_soft_limit: z
|
|
9991
|
+
.boolean()
|
|
9992
|
+
.optional()
|
|
9993
|
+
.describe('If true, the customer keeps access to the feature after the balance is exhausted.'),
|
|
9994
|
+
issue: entitlementIssueAfterResetWire.optional(),
|
|
9995
|
+
issue_after_reset: numericWire.optional(),
|
|
9996
|
+
issue_after_reset_priority: z
|
|
9997
|
+
.number()
|
|
9998
|
+
.int()
|
|
9999
|
+
.gte(1)
|
|
10000
|
+
.lte(255)
|
|
10001
|
+
.optional()
|
|
10002
|
+
.describe('The priority of the grant created after each reset.'),
|
|
10003
|
+
preserve_overage_at_reset: z
|
|
10004
|
+
.boolean()
|
|
10005
|
+
.optional()
|
|
10006
|
+
.describe('If true, the overage is preserved at reset. If false, the usage is reset to 0.'),
|
|
10007
|
+
usage_period: recurringPeriodInputWire,
|
|
10008
|
+
measure_usage_from: entitlementMeasureUsageFromWire.optional(),
|
|
10009
|
+
grants: z
|
|
10010
|
+
.array(entitlementGrantCreateRequestWire)
|
|
10011
|
+
.optional()
|
|
10012
|
+
.describe('Grants created together with the entitlement. Cannot be combined with `issue`.'),
|
|
10013
|
+
})
|
|
10014
|
+
.describe('Metered entitlement create request.');
|
|
10015
|
+
export const entitlementWire = z
|
|
10016
|
+
.discriminatedUnion('type', [
|
|
10017
|
+
entitlementMeteredWire,
|
|
10018
|
+
entitlementStaticWire,
|
|
10019
|
+
entitlementBooleanWire,
|
|
10020
|
+
])
|
|
10021
|
+
.describe('An entitlement grants a customer access to a feature.');
|
|
9667
10022
|
export const workflowCollectionAlignmentWire = z
|
|
9668
10023
|
.discriminatedUnion('type', [
|
|
9669
10024
|
workflowCollectionAlignmentSubscriptionWire,
|
|
@@ -10094,6 +10449,13 @@ export const customerStripeCreateCheckoutSessionRequestWire = z
|
|
|
10094
10449
|
stripe_options: appStripeCreateCheckoutSessionRequestOptionsWire,
|
|
10095
10450
|
})
|
|
10096
10451
|
.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.');
|
|
10452
|
+
export const createEntitlementRequestWire = z
|
|
10453
|
+
.discriminatedUnion('type', [
|
|
10454
|
+
createEntitlementMeteredRequestWire,
|
|
10455
|
+
createEntitlementStaticRequestWire,
|
|
10456
|
+
createEntitlementBooleanRequestWire,
|
|
10457
|
+
])
|
|
10458
|
+
.describe('Entitlement create request.');
|
|
10097
10459
|
export const workflowCollectionSettingsWire = z
|
|
10098
10460
|
.strictObject({
|
|
10099
10461
|
alignment: workflowCollectionAlignmentWire.optional(),
|
|
@@ -11236,6 +11598,11 @@ export const getCustomerEntitlementAccessQueryParamsWire = z.object({
|
|
|
11236
11598
|
.describe('Expand computed fields. Supported values are: - `value`: Expand the balance details of a metered entitlement; it sets the `value` field.'),
|
|
11237
11599
|
});
|
|
11238
11600
|
export const getCustomerEntitlementAccessResponseWire = entitlementAccessResultWire;
|
|
11601
|
+
export const createCustomerEntitlementPathParamsWire = z.object({
|
|
11602
|
+
customerId: ulidWire,
|
|
11603
|
+
});
|
|
11604
|
+
export const createCustomerEntitlementBodyWire = createEntitlementRequestWire;
|
|
11605
|
+
export const createCustomerEntitlementResponseWire = entitlementWire;
|
|
11239
11606
|
export const createCreditGrantPathParamsWire = z.object({
|
|
11240
11607
|
customerId: ulidWire,
|
|
11241
11608
|
});
|