@openmeter/client 1.0.0-beta.235 → 1.0.0-beta.236
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 +22 -0
- package/dist/funcs/apps.d.ts +10 -1
- package/dist/funcs/apps.js +40 -0
- package/dist/funcs/notifications.d.ts +79 -1
- package/dist/funcs/notifications.js +296 -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/apps.d.ts +6 -1
- package/dist/models/operations/notifications.d.ts +92 -1
- package/dist/models/schemas.d.ts +5907 -1137
- package/dist/models/schemas.js +1147 -9
- package/dist/models/types.d.ts +770 -3
- package/dist/sdk/internal.d.ts +122 -0
- package/dist/sdk/internal.js +154 -0
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -723,9 +723,19 @@ export const appInstallMethods = z
|
|
|
723
723
|
export const appStatus = z
|
|
724
724
|
.enum(['ready', 'unauthorized'])
|
|
725
725
|
.describe('Connection status of an installed app.');
|
|
726
|
+
export const appActionType = z
|
|
727
|
+
.enum(['reconcile_webhook_events'])
|
|
728
|
+
.describe('App action type.');
|
|
726
729
|
export const updateLabels = z
|
|
727
730
|
.record(z.string(), z.string())
|
|
728
731
|
.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 "\\_".');
|
|
732
|
+
export const appReconcileWebhookEventsActionRequest = z
|
|
733
|
+
.object({
|
|
734
|
+
actionType: z
|
|
735
|
+
.literal('reconcile_webhook_events')
|
|
736
|
+
.describe('The action to execute.'),
|
|
737
|
+
})
|
|
738
|
+
.describe("Request to reconcile the app's webhook events with the latest supported event set.");
|
|
729
739
|
export const installAppStripeWithApiKey = z
|
|
730
740
|
.object({
|
|
731
741
|
type: z.literal('stripe').describe('Type of the app.'),
|
|
@@ -751,9 +761,9 @@ export const installAppExternalInvoicing = z
|
|
|
751
761
|
name: z.string().describe('Name of the app.'),
|
|
752
762
|
createBillingProfile: z
|
|
753
763
|
.boolean()
|
|
754
|
-
.describe('If true,
|
|
764
|
+
.describe('If true, creates the Auto Collection preset with an OpenMeter supplier in the US (postal code 94114), without replacing the default profile.'),
|
|
755
765
|
})
|
|
756
|
-
.describe('
|
|
766
|
+
.describe('Model for installing an External Invoicing app from the catalog.');
|
|
757
767
|
export const workflowCollectionAlignmentSubscription = z
|
|
758
768
|
.object({
|
|
759
769
|
type: z.literal('subscription').describe('The type of alignment.'),
|
|
@@ -906,6 +916,43 @@ export const booleanFieldFilter = z
|
|
|
906
916
|
export const notificationChannelType = z
|
|
907
917
|
.enum(['webhook'])
|
|
908
918
|
.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.');
|
|
919
|
+
export const notificationBalanceThresholdType = z
|
|
920
|
+
.enum(['balance_value', 'usage_percentage', 'usage_value'])
|
|
921
|
+
.describe('What a balance threshold is measured against.');
|
|
922
|
+
export const notificationEventType = z
|
|
923
|
+
.enum([
|
|
924
|
+
'entitlements.balance.threshold',
|
|
925
|
+
'entitlements.reset',
|
|
926
|
+
'invoice.created',
|
|
927
|
+
'invoice.updated',
|
|
928
|
+
])
|
|
929
|
+
.describe('The type of a notification event. It determines which payload variant the event carries.');
|
|
930
|
+
export const notificationEventDeliveryState = z
|
|
931
|
+
.enum(['success', 'failed', 'sending', 'pending', 'resending'])
|
|
932
|
+
.describe('The delivery state of a notification event for a single channel.');
|
|
933
|
+
export const notificationEventDeliveryAttemptResponse = z
|
|
934
|
+
.object({
|
|
935
|
+
statusCode: z
|
|
936
|
+
.number()
|
|
937
|
+
.int()
|
|
938
|
+
.gte(-2147483648)
|
|
939
|
+
.lte(2147483647)
|
|
940
|
+
.optional()
|
|
941
|
+
.describe('The HTTP status code returned by the recipient. Absent when no response was received.'),
|
|
942
|
+
body: z
|
|
943
|
+
.string()
|
|
944
|
+
.describe('The response body returned by the recipient. Empty when no body was received.'),
|
|
945
|
+
durationMs: z.coerce
|
|
946
|
+
.bigint()
|
|
947
|
+
.gte(-9223372036854775808n)
|
|
948
|
+
.lte(9223372036854775807n)
|
|
949
|
+
.describe('How long the delivery attempt took, in milliseconds.'),
|
|
950
|
+
url: z
|
|
951
|
+
.string()
|
|
952
|
+
.optional()
|
|
953
|
+
.describe('The URL the event was delivered to. Only set for webhook channels.'),
|
|
954
|
+
})
|
|
955
|
+
.describe('The response the recipient returned for a delivery attempt. For webhook channels this is the HTTP response.');
|
|
909
956
|
export const queryFilterInteger = z
|
|
910
957
|
.object({
|
|
911
958
|
eq: z
|
|
@@ -1619,6 +1666,31 @@ export const updateResourceReference = z
|
|
|
1619
1666
|
id: ulid,
|
|
1620
1667
|
})
|
|
1621
1668
|
.describe('TaxCode reference.');
|
|
1669
|
+
export const notificationChannelReference = z
|
|
1670
|
+
.object({
|
|
1671
|
+
id: ulid,
|
|
1672
|
+
})
|
|
1673
|
+
.describe('NotificationChannel reference.');
|
|
1674
|
+
export const notificationEventFeatureReference = z
|
|
1675
|
+
.object({
|
|
1676
|
+
id: ulid,
|
|
1677
|
+
key: z.string().describe('The immutable key of the feature.'),
|
|
1678
|
+
})
|
|
1679
|
+
.describe('A reference to the feature of an entitlement notification event.');
|
|
1680
|
+
export const notificationEventInvoiceReference = z
|
|
1681
|
+
.object({
|
|
1682
|
+
id: ulid,
|
|
1683
|
+
number: z.string().describe('The human-readable invoice number.'),
|
|
1684
|
+
})
|
|
1685
|
+
.describe('A reference to the invoice of an invoice notification event.');
|
|
1686
|
+
export const resendBillingNotificationEventRequest = z
|
|
1687
|
+
.object({
|
|
1688
|
+
channels: z
|
|
1689
|
+
.array(ulid)
|
|
1690
|
+
.optional()
|
|
1691
|
+
.describe('The channels to resend the event to. When omitted or empty, the event is resent to every enabled channel of the rule. Channels not targeted by the rule or disabled are rejected.'),
|
|
1692
|
+
})
|
|
1693
|
+
.describe('Request body for resending a notification event.');
|
|
1622
1694
|
export const billingCustomerReference = z
|
|
1623
1695
|
.object({
|
|
1624
1696
|
id: ulid,
|
|
@@ -2476,6 +2548,14 @@ export const appCapability = z
|
|
|
2476
2548
|
description: z.string().describe('Description of the capability.'),
|
|
2477
2549
|
})
|
|
2478
2550
|
.describe('App capability describes a function that an App can perform.');
|
|
2551
|
+
export const appAction = z
|
|
2552
|
+
.object({
|
|
2553
|
+
type: appActionType,
|
|
2554
|
+
description: z
|
|
2555
|
+
.string()
|
|
2556
|
+
.describe('Human readable explanation of why the action is needed.'),
|
|
2557
|
+
})
|
|
2558
|
+
.describe('An action the operator should take on an installed app.');
|
|
2479
2559
|
export const updateAppStripeRequest = z
|
|
2480
2560
|
.object({
|
|
2481
2561
|
name: z
|
|
@@ -2534,6 +2614,9 @@ export const updateAppExternalInvoicingRequest = z
|
|
|
2534
2614
|
.describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
|
|
2535
2615
|
})
|
|
2536
2616
|
.describe('AppExternalInvoicing update request.');
|
|
2617
|
+
export const appActionRequest = z
|
|
2618
|
+
.discriminatedUnion('actionType', [appReconcileWebhookEventsActionRequest])
|
|
2619
|
+
.describe('Request to execute an operator action on an installed app.');
|
|
2537
2620
|
export const installAppRequest = z
|
|
2538
2621
|
.discriminatedUnion('type', [
|
|
2539
2622
|
installAppStripeWithApiKey,
|
|
@@ -2730,6 +2813,26 @@ export const updateBillingNotificationChannelRequest = z
|
|
|
2730
2813
|
.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
2814
|
})
|
|
2732
2815
|
.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.");
|
|
2816
|
+
export const notificationBalanceThreshold = z
|
|
2817
|
+
.object({
|
|
2818
|
+
type: notificationBalanceThresholdType,
|
|
2819
|
+
value: z.number().describe('The threshold value.'),
|
|
2820
|
+
})
|
|
2821
|
+
.describe('A balance threshold of a notification rule. Crossing it generates an `entitlements.balance.threshold` event.');
|
|
2822
|
+
export const notificationRuleReference = z
|
|
2823
|
+
.object({
|
|
2824
|
+
id: ulid,
|
|
2825
|
+
type: notificationEventType,
|
|
2826
|
+
name: z.string().describe('The user-provided name of the rule.'),
|
|
2827
|
+
})
|
|
2828
|
+
.describe('A reference to the notification rule that generated an event.');
|
|
2829
|
+
export const notificationEventDeliveryAttempt = z
|
|
2830
|
+
.object({
|
|
2831
|
+
state: notificationEventDeliveryState,
|
|
2832
|
+
response: notificationEventDeliveryAttemptResponse,
|
|
2833
|
+
timestamp: dateTime,
|
|
2834
|
+
})
|
|
2835
|
+
.describe('A single delivery attempt to a channel.');
|
|
2733
2836
|
export const appCustomerData = z
|
|
2734
2837
|
.object({
|
|
2735
2838
|
stripe: appCustomerDataStripe
|
|
@@ -3141,6 +3244,169 @@ export const updateTaxCodeConfig = z
|
|
|
3141
3244
|
code: updateResourceReference.optional(),
|
|
3142
3245
|
})
|
|
3143
3246
|
.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.');
|
|
3247
|
+
export const notificationRuleEntitlementReset = z
|
|
3248
|
+
.object({
|
|
3249
|
+
id: ulid,
|
|
3250
|
+
name: z
|
|
3251
|
+
.string()
|
|
3252
|
+
.min(1)
|
|
3253
|
+
.max(256)
|
|
3254
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3255
|
+
labels: labels.optional(),
|
|
3256
|
+
createdAt: dateTime,
|
|
3257
|
+
updatedAt: dateTime,
|
|
3258
|
+
deletedAt: dateTime.optional(),
|
|
3259
|
+
type: z
|
|
3260
|
+
.literal('entitlements.reset')
|
|
3261
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
3262
|
+
disabled: z
|
|
3263
|
+
.boolean()
|
|
3264
|
+
.optional()
|
|
3265
|
+
.default(false)
|
|
3266
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
3267
|
+
channels: z
|
|
3268
|
+
.array(notificationChannelReference)
|
|
3269
|
+
.max(5)
|
|
3270
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
3271
|
+
features: z
|
|
3272
|
+
.array(featureReference)
|
|
3273
|
+
.optional()
|
|
3274
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
3275
|
+
})
|
|
3276
|
+
.describe('A rule that generates an event when an entitlement usage period is reset.');
|
|
3277
|
+
export const notificationRuleInvoiceCreated = z
|
|
3278
|
+
.object({
|
|
3279
|
+
id: ulid,
|
|
3280
|
+
name: z
|
|
3281
|
+
.string()
|
|
3282
|
+
.min(1)
|
|
3283
|
+
.max(256)
|
|
3284
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3285
|
+
labels: labels.optional(),
|
|
3286
|
+
createdAt: dateTime,
|
|
3287
|
+
updatedAt: dateTime,
|
|
3288
|
+
deletedAt: dateTime.optional(),
|
|
3289
|
+
type: z
|
|
3290
|
+
.literal('invoice.created')
|
|
3291
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
3292
|
+
disabled: z
|
|
3293
|
+
.boolean()
|
|
3294
|
+
.optional()
|
|
3295
|
+
.default(false)
|
|
3296
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
3297
|
+
channels: z
|
|
3298
|
+
.array(notificationChannelReference)
|
|
3299
|
+
.max(5)
|
|
3300
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
3301
|
+
})
|
|
3302
|
+
.describe('A rule that generates an event when an invoice is created.');
|
|
3303
|
+
export const notificationRuleInvoiceUpdated = z
|
|
3304
|
+
.object({
|
|
3305
|
+
id: ulid,
|
|
3306
|
+
name: z
|
|
3307
|
+
.string()
|
|
3308
|
+
.min(1)
|
|
3309
|
+
.max(256)
|
|
3310
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3311
|
+
labels: labels.optional(),
|
|
3312
|
+
createdAt: dateTime,
|
|
3313
|
+
updatedAt: dateTime,
|
|
3314
|
+
deletedAt: dateTime.optional(),
|
|
3315
|
+
type: z
|
|
3316
|
+
.literal('invoice.updated')
|
|
3317
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
3318
|
+
disabled: z
|
|
3319
|
+
.boolean()
|
|
3320
|
+
.optional()
|
|
3321
|
+
.default(false)
|
|
3322
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
3323
|
+
channels: z
|
|
3324
|
+
.array(notificationChannelReference)
|
|
3325
|
+
.max(5)
|
|
3326
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
3327
|
+
})
|
|
3328
|
+
.describe('A rule that generates an event when an invoice is updated.');
|
|
3329
|
+
export const notificationRuleEntitlementResetRequest = z
|
|
3330
|
+
.object({
|
|
3331
|
+
name: z
|
|
3332
|
+
.string()
|
|
3333
|
+
.min(1)
|
|
3334
|
+
.max(256)
|
|
3335
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3336
|
+
labels: labels.optional(),
|
|
3337
|
+
type: z
|
|
3338
|
+
.literal('entitlements.reset')
|
|
3339
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
3340
|
+
disabled: z
|
|
3341
|
+
.boolean()
|
|
3342
|
+
.optional()
|
|
3343
|
+
.default(false)
|
|
3344
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
3345
|
+
channels: z
|
|
3346
|
+
.array(notificationChannelReference)
|
|
3347
|
+
.max(5)
|
|
3348
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
3349
|
+
features: z
|
|
3350
|
+
.array(featureReference)
|
|
3351
|
+
.optional()
|
|
3352
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
3353
|
+
})
|
|
3354
|
+
.describe('Request body for an entitlement reset rule.');
|
|
3355
|
+
export const notificationRuleInvoiceCreatedRequest = z
|
|
3356
|
+
.object({
|
|
3357
|
+
name: z
|
|
3358
|
+
.string()
|
|
3359
|
+
.min(1)
|
|
3360
|
+
.max(256)
|
|
3361
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3362
|
+
labels: labels.optional(),
|
|
3363
|
+
type: z
|
|
3364
|
+
.literal('invoice.created')
|
|
3365
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
3366
|
+
disabled: z
|
|
3367
|
+
.boolean()
|
|
3368
|
+
.optional()
|
|
3369
|
+
.default(false)
|
|
3370
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
3371
|
+
channels: z
|
|
3372
|
+
.array(notificationChannelReference)
|
|
3373
|
+
.max(5)
|
|
3374
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
3375
|
+
})
|
|
3376
|
+
.describe('Request body for an invoice created rule.');
|
|
3377
|
+
export const notificationRuleInvoiceUpdatedRequest = z
|
|
3378
|
+
.object({
|
|
3379
|
+
name: z
|
|
3380
|
+
.string()
|
|
3381
|
+
.min(1)
|
|
3382
|
+
.max(256)
|
|
3383
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3384
|
+
labels: labels.optional(),
|
|
3385
|
+
type: z
|
|
3386
|
+
.literal('invoice.updated')
|
|
3387
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
3388
|
+
disabled: z
|
|
3389
|
+
.boolean()
|
|
3390
|
+
.optional()
|
|
3391
|
+
.default(false)
|
|
3392
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
3393
|
+
channels: z
|
|
3394
|
+
.array(notificationChannelReference)
|
|
3395
|
+
.max(5)
|
|
3396
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
3397
|
+
})
|
|
3398
|
+
.describe('Request body for an invoice updated rule.');
|
|
3399
|
+
export const notificationEventInvoiceData = z
|
|
3400
|
+
.object({
|
|
3401
|
+
invoice: notificationEventInvoiceReference,
|
|
3402
|
+
customerId: ulid.optional(),
|
|
3403
|
+
currency: currencyCode,
|
|
3404
|
+
status: z
|
|
3405
|
+
.string()
|
|
3406
|
+
.describe('The status of the invoice at the time the event was generated.'),
|
|
3407
|
+
total: numeric,
|
|
3408
|
+
})
|
|
3409
|
+
.describe('The invoice an invoice notification event refers to.');
|
|
3144
3410
|
export const listEventsParamsFilter = z
|
|
3145
3411
|
.object({
|
|
3146
3412
|
id: stringFieldFilter.optional(),
|
|
@@ -3191,6 +3457,31 @@ export const listNotificationChannelsParamsFilter = z
|
|
|
3191
3457
|
updatedAt: dateTimeFieldFilter.optional(),
|
|
3192
3458
|
})
|
|
3193
3459
|
.describe('Filter options for listing notification channels.');
|
|
3460
|
+
export const listNotificationRulesParamsFilter = z
|
|
3461
|
+
.object({
|
|
3462
|
+
id: ulidFieldFilter.optional(),
|
|
3463
|
+
name: stringFieldFilter.optional(),
|
|
3464
|
+
type: stringFieldFilterExact.optional(),
|
|
3465
|
+
disabled: booleanFieldFilter.optional(),
|
|
3466
|
+
createdAt: dateTimeFieldFilter.optional(),
|
|
3467
|
+
updatedAt: dateTimeFieldFilter.optional(),
|
|
3468
|
+
channelId: ulidFieldFilter.optional(),
|
|
3469
|
+
})
|
|
3470
|
+
.describe('Filter options for listing notification rules.');
|
|
3471
|
+
export const listNotificationEventsParamsFilter = z
|
|
3472
|
+
.object({
|
|
3473
|
+
id: ulidFieldFilter.optional(),
|
|
3474
|
+
type: stringFieldFilterExact.optional(),
|
|
3475
|
+
createdAt: dateTimeFieldFilter.optional(),
|
|
3476
|
+
ruleId: ulidFieldFilter.optional(),
|
|
3477
|
+
channelId: ulidFieldFilter.optional(),
|
|
3478
|
+
deliveryStatus: stringFieldFilterExact.optional(),
|
|
3479
|
+
subjectKey: stringFieldFilterExact.optional(),
|
|
3480
|
+
subjectId: ulidFieldFilter.optional(),
|
|
3481
|
+
featureKey: stringFieldFilterExact.optional(),
|
|
3482
|
+
featureId: ulidFieldFilter.optional(),
|
|
3483
|
+
})
|
|
3484
|
+
.describe('Filter options for listing notification events.');
|
|
3194
3485
|
export const resourceFilters = z
|
|
3195
3486
|
.object({
|
|
3196
3487
|
name: stringFieldFilter.optional(),
|
|
@@ -3886,6 +4177,86 @@ export const notificationChannelPagePaginatedResponse = z
|
|
|
3886
4177
|
meta: paginatedMeta,
|
|
3887
4178
|
})
|
|
3888
4179
|
.describe('Page paginated response.');
|
|
4180
|
+
export const notificationRuleBalanceThreshold = z
|
|
4181
|
+
.object({
|
|
4182
|
+
id: ulid,
|
|
4183
|
+
name: z
|
|
4184
|
+
.string()
|
|
4185
|
+
.min(1)
|
|
4186
|
+
.max(256)
|
|
4187
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
4188
|
+
labels: labels.optional(),
|
|
4189
|
+
createdAt: dateTime,
|
|
4190
|
+
updatedAt: dateTime,
|
|
4191
|
+
deletedAt: dateTime.optional(),
|
|
4192
|
+
type: z
|
|
4193
|
+
.literal('entitlements.balance.threshold')
|
|
4194
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
4195
|
+
disabled: z
|
|
4196
|
+
.boolean()
|
|
4197
|
+
.optional()
|
|
4198
|
+
.default(false)
|
|
4199
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
4200
|
+
channels: z
|
|
4201
|
+
.array(notificationChannelReference)
|
|
4202
|
+
.max(5)
|
|
4203
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
4204
|
+
thresholds: z
|
|
4205
|
+
.array(notificationBalanceThreshold)
|
|
4206
|
+
.min(1)
|
|
4207
|
+
.max(10)
|
|
4208
|
+
.describe('The thresholds that generate an event when crossed.'),
|
|
4209
|
+
features: z
|
|
4210
|
+
.array(featureReference)
|
|
4211
|
+
.optional()
|
|
4212
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
4213
|
+
})
|
|
4214
|
+
.describe('A rule that generates an event when an entitlement balance crosses one of its thresholds.');
|
|
4215
|
+
export const notificationRuleBalanceThresholdRequest = z
|
|
4216
|
+
.object({
|
|
4217
|
+
name: z
|
|
4218
|
+
.string()
|
|
4219
|
+
.min(1)
|
|
4220
|
+
.max(256)
|
|
4221
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
4222
|
+
labels: labels.optional(),
|
|
4223
|
+
type: z
|
|
4224
|
+
.literal('entitlements.balance.threshold')
|
|
4225
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
4226
|
+
disabled: z
|
|
4227
|
+
.boolean()
|
|
4228
|
+
.optional()
|
|
4229
|
+
.default(false)
|
|
4230
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
4231
|
+
channels: z
|
|
4232
|
+
.array(notificationChannelReference)
|
|
4233
|
+
.max(5)
|
|
4234
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
4235
|
+
thresholds: z
|
|
4236
|
+
.array(notificationBalanceThreshold)
|
|
4237
|
+
.min(1)
|
|
4238
|
+
.max(10)
|
|
4239
|
+
.describe('The thresholds that generate an event when crossed.'),
|
|
4240
|
+
features: z
|
|
4241
|
+
.array(featureReference)
|
|
4242
|
+
.optional()
|
|
4243
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
4244
|
+
})
|
|
4245
|
+
.describe('Request body for a balance threshold rule.');
|
|
4246
|
+
export const notificationEventDeliveryStatus = z
|
|
4247
|
+
.object({
|
|
4248
|
+
channelId: ulid,
|
|
4249
|
+
state: notificationEventDeliveryState,
|
|
4250
|
+
reason: z
|
|
4251
|
+
.string()
|
|
4252
|
+
.describe('The reason for the last state change. Empty for successful deliveries.'),
|
|
4253
|
+
updatedAt: dateTime,
|
|
4254
|
+
nextAttempt: dateTime.optional(),
|
|
4255
|
+
attempts: z
|
|
4256
|
+
.array(notificationEventDeliveryAttempt)
|
|
4257
|
+
.describe('The delivery attempts made so far, most recent first.'),
|
|
4258
|
+
})
|
|
4259
|
+
.describe('The delivery status of a notification event for one channel of the generating rule.');
|
|
3889
4260
|
export const customerData = z
|
|
3890
4261
|
.object({
|
|
3891
4262
|
billingProfile: profileReference.optional(),
|
|
@@ -3929,6 +4300,29 @@ export const listCustomerEntitlementAccessResponseData = z
|
|
|
3929
4300
|
.describe('The list of entitlement access results.'),
|
|
3930
4301
|
})
|
|
3931
4302
|
.describe('List customer entitlement access response data.');
|
|
4303
|
+
export const notificationEventBalanceThresholdData = z
|
|
4304
|
+
.object({
|
|
4305
|
+
entitlementId: ulid,
|
|
4306
|
+
feature: notificationEventFeatureReference,
|
|
4307
|
+
subjectKey: z
|
|
4308
|
+
.string()
|
|
4309
|
+
.describe('The key of the subject the entitlement belongs to.'),
|
|
4310
|
+
customerId: ulid.optional(),
|
|
4311
|
+
value: entitlementValueResult,
|
|
4312
|
+
threshold: notificationBalanceThreshold,
|
|
4313
|
+
})
|
|
4314
|
+
.describe('The entities and threshold a balance threshold event refers to.');
|
|
4315
|
+
export const notificationEventEntitlementData = z
|
|
4316
|
+
.object({
|
|
4317
|
+
entitlementId: ulid,
|
|
4318
|
+
feature: notificationEventFeatureReference,
|
|
4319
|
+
subjectKey: z
|
|
4320
|
+
.string()
|
|
4321
|
+
.describe('The key of the subject the entitlement belongs to.'),
|
|
4322
|
+
customerId: ulid.optional(),
|
|
4323
|
+
value: entitlementValueResult,
|
|
4324
|
+
})
|
|
4325
|
+
.describe('The entitlement, feature, and subject an entitlement notification event refers to.');
|
|
3932
4326
|
export const priceGraduated = z
|
|
3933
4327
|
.object({
|
|
3934
4328
|
type: z.literal('graduated').describe('The type of the price.'),
|
|
@@ -4062,6 +4456,22 @@ export const planAddonPagePaginatedResponse = z
|
|
|
4062
4456
|
meta: paginatedMeta,
|
|
4063
4457
|
})
|
|
4064
4458
|
.describe('Page paginated response.');
|
|
4459
|
+
export const notificationEventInvoiceCreatedPayload = z
|
|
4460
|
+
.object({
|
|
4461
|
+
id: ulid,
|
|
4462
|
+
type: z.literal('invoice.created').describe('The type of the event.'),
|
|
4463
|
+
timestamp: dateTime,
|
|
4464
|
+
data: notificationEventInvoiceData,
|
|
4465
|
+
})
|
|
4466
|
+
.describe('An invoice created notification event payload.');
|
|
4467
|
+
export const notificationEventInvoiceUpdatedPayload = z
|
|
4468
|
+
.object({
|
|
4469
|
+
id: ulid,
|
|
4470
|
+
type: z.literal('invoice.updated').describe('The type of the event.'),
|
|
4471
|
+
timestamp: dateTime,
|
|
4472
|
+
data: notificationEventInvoiceData,
|
|
4473
|
+
})
|
|
4474
|
+
.describe('An invoice updated notification event payload.');
|
|
4065
4475
|
export const ingestedEventPaginatedResponse = z
|
|
4066
4476
|
.object({
|
|
4067
4477
|
data: z.array(ingestedEvent),
|
|
@@ -4285,6 +4695,10 @@ export const appStripe = z
|
|
|
4285
4695
|
type: z.literal('stripe').describe('The app type.'),
|
|
4286
4696
|
definition: appCatalogItem,
|
|
4287
4697
|
status: appStatus,
|
|
4698
|
+
actions: z
|
|
4699
|
+
.array(appAction)
|
|
4700
|
+
.optional()
|
|
4701
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
4288
4702
|
accountId: z
|
|
4289
4703
|
.string()
|
|
4290
4704
|
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
@@ -4316,6 +4730,10 @@ export const appSandbox = z
|
|
|
4316
4730
|
type: z.literal('sandbox').describe('The app type.'),
|
|
4317
4731
|
definition: appCatalogItem,
|
|
4318
4732
|
status: appStatus,
|
|
4733
|
+
actions: z
|
|
4734
|
+
.array(appAction)
|
|
4735
|
+
.optional()
|
|
4736
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
4319
4737
|
})
|
|
4320
4738
|
.describe('Sandbox app can be used for testing billing features.');
|
|
4321
4739
|
export const appExternalInvoicing = z
|
|
@@ -4338,6 +4756,10 @@ export const appExternalInvoicing = z
|
|
|
4338
4756
|
type: z.literal('external_invoicing').describe('The app type.'),
|
|
4339
4757
|
definition: appCatalogItem,
|
|
4340
4758
|
status: appStatus,
|
|
4759
|
+
actions: z
|
|
4760
|
+
.array(appAction)
|
|
4761
|
+
.optional()
|
|
4762
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
4341
4763
|
enableDraftSyncHook: z
|
|
4342
4764
|
.boolean()
|
|
4343
4765
|
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
@@ -4372,6 +4794,10 @@ export const installedAppStripe = z
|
|
|
4372
4794
|
type: z.literal('stripe').describe('The app type.'),
|
|
4373
4795
|
definition: appCatalogItem,
|
|
4374
4796
|
status: appStatus,
|
|
4797
|
+
actions: z
|
|
4798
|
+
.array(appAction)
|
|
4799
|
+
.optional()
|
|
4800
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
4375
4801
|
accountId: z
|
|
4376
4802
|
.string()
|
|
4377
4803
|
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
@@ -4406,6 +4832,10 @@ export const installedAppSandbox = z
|
|
|
4406
4832
|
type: z.literal('sandbox').describe('The app type.'),
|
|
4407
4833
|
definition: appCatalogItem,
|
|
4408
4834
|
status: appStatus,
|
|
4835
|
+
actions: z
|
|
4836
|
+
.array(appAction)
|
|
4837
|
+
.optional()
|
|
4838
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
4409
4839
|
defaultForCapabilityTypes: z
|
|
4410
4840
|
.array(appCapabilityType)
|
|
4411
4841
|
.describe('Default capabilities of the installed app.'),
|
|
@@ -4431,6 +4861,10 @@ export const installedAppExternalInvoicing = z
|
|
|
4431
4861
|
type: z.literal('external_invoicing').describe('The app type.'),
|
|
4432
4862
|
definition: appCatalogItem,
|
|
4433
4863
|
status: appStatus,
|
|
4864
|
+
actions: z
|
|
4865
|
+
.array(appAction)
|
|
4866
|
+
.optional()
|
|
4867
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
4434
4868
|
enableDraftSyncHook: z
|
|
4435
4869
|
.boolean()
|
|
4436
4870
|
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
@@ -4489,6 +4923,40 @@ export const entitlementAccessQueryResult = z
|
|
|
4489
4923
|
updatedAt: dateTime,
|
|
4490
4924
|
})
|
|
4491
4925
|
.describe('Access evaluation result for a single resolved customer.');
|
|
4926
|
+
export const notificationRule = z
|
|
4927
|
+
.discriminatedUnion('type', [
|
|
4928
|
+
notificationRuleBalanceThreshold,
|
|
4929
|
+
notificationRuleEntitlementReset,
|
|
4930
|
+
notificationRuleInvoiceCreated,
|
|
4931
|
+
notificationRuleInvoiceUpdated,
|
|
4932
|
+
])
|
|
4933
|
+
.describe('A notification rule selects the type of event to generate, the conditions specific to that type, and the channels to deliver the events to.');
|
|
4934
|
+
export const notificationRuleRequest = z
|
|
4935
|
+
.discriminatedUnion('type', [
|
|
4936
|
+
notificationRuleBalanceThresholdRequest,
|
|
4937
|
+
notificationRuleEntitlementResetRequest,
|
|
4938
|
+
notificationRuleInvoiceCreatedRequest,
|
|
4939
|
+
notificationRuleInvoiceUpdatedRequest,
|
|
4940
|
+
])
|
|
4941
|
+
.describe("Request body for creating or updating a notification rule. Updates replace the rule's mutable state: omitting `disabled`, `labels`, or `features` resets them to their defaults. The `type` must match the existing rule on update.");
|
|
4942
|
+
export const notificationEventBalanceThresholdPayload = z
|
|
4943
|
+
.object({
|
|
4944
|
+
id: ulid,
|
|
4945
|
+
type: z
|
|
4946
|
+
.literal('entitlements.balance.threshold')
|
|
4947
|
+
.describe('The type of the event.'),
|
|
4948
|
+
timestamp: dateTime,
|
|
4949
|
+
data: notificationEventBalanceThresholdData,
|
|
4950
|
+
})
|
|
4951
|
+
.describe('A balance threshold notification event payload.');
|
|
4952
|
+
export const notificationEventResetPayload = z
|
|
4953
|
+
.object({
|
|
4954
|
+
id: ulid,
|
|
4955
|
+
type: z.literal('entitlements.reset').describe('The type of the event.'),
|
|
4956
|
+
timestamp: dateTime,
|
|
4957
|
+
data: notificationEventEntitlementData,
|
|
4958
|
+
})
|
|
4959
|
+
.describe('An entitlement reset notification event payload.');
|
|
4492
4960
|
export const price = z
|
|
4493
4961
|
.discriminatedUnion('type', [
|
|
4494
4962
|
priceFree,
|
|
@@ -4756,6 +5224,20 @@ export const entitlementAccessQueryResponse = z
|
|
|
4756
5224
|
meta: cursorMeta,
|
|
4757
5225
|
})
|
|
4758
5226
|
.describe('Response of the entitlement access query.');
|
|
5227
|
+
export const notificationRulePagePaginatedResponse = z
|
|
5228
|
+
.object({
|
|
5229
|
+
data: z.array(notificationRule),
|
|
5230
|
+
meta: paginatedMeta,
|
|
5231
|
+
})
|
|
5232
|
+
.describe('Page paginated response.');
|
|
5233
|
+
export const notificationEventPayload = z
|
|
5234
|
+
.discriminatedUnion('type', [
|
|
5235
|
+
notificationEventBalanceThresholdPayload,
|
|
5236
|
+
notificationEventResetPayload,
|
|
5237
|
+
notificationEventInvoiceCreatedPayload,
|
|
5238
|
+
notificationEventInvoiceUpdatedPayload,
|
|
5239
|
+
])
|
|
5240
|
+
.describe('The payload delivered to the channels, discriminated by the event type.');
|
|
4759
5241
|
export const rateCard = z
|
|
4760
5242
|
.object({
|
|
4761
5243
|
name: z
|
|
@@ -4895,6 +5377,18 @@ export const profileApps = z
|
|
|
4895
5377
|
payment: app,
|
|
4896
5378
|
})
|
|
4897
5379
|
.describe('Applications used by a billing profile.');
|
|
5380
|
+
export const notificationEvent = z
|
|
5381
|
+
.object({
|
|
5382
|
+
id: ulid,
|
|
5383
|
+
type: notificationEventType,
|
|
5384
|
+
createdAt: dateTime,
|
|
5385
|
+
rule: notificationRuleReference,
|
|
5386
|
+
deliveryStatus: z
|
|
5387
|
+
.array(notificationEventDeliveryStatus)
|
|
5388
|
+
.describe('The delivery status of the event, one entry per channel of the rule.'),
|
|
5389
|
+
payload: notificationEventPayload,
|
|
5390
|
+
})
|
|
5391
|
+
.describe('A notification event records that a notification rule fired and tracks the delivery of its payload to each channel of the rule. Events are created by the system and cannot be modified.');
|
|
4898
5392
|
export const subscriptionItem = z
|
|
4899
5393
|
.object({
|
|
4900
5394
|
id: ulid,
|
|
@@ -5157,6 +5651,12 @@ export const chargeRealization = z
|
|
|
5157
5651
|
.describe('The detailed (rated) lines produced by the realization run. Requires the `realization.detailed_lines` expand.'),
|
|
5158
5652
|
})
|
|
5159
5653
|
.describe("A realization run of a charge. `totals` and `detailed_lines` are only populated with the `realization.totals` and `realization.detailed_lines` expands, respectively, since computing them requires re-deriving the run's rated breakdown. `invoice` is an ID reference unless the `realization.invoice` expand is used, which resolves it to the invoice header of the run's booked line: the invoice entity without its `lines` and without the `customer` snapshot (the charge itself already identifies the customer).");
|
|
5654
|
+
export const notificationEventPagePaginatedResponse = z
|
|
5655
|
+
.object({
|
|
5656
|
+
data: z.array(notificationEvent),
|
|
5657
|
+
meta: paginatedMeta,
|
|
5658
|
+
})
|
|
5659
|
+
.describe('Page paginated response.');
|
|
5160
5660
|
export const subscriptionPhase = z
|
|
5161
5661
|
.object({
|
|
5162
5662
|
id: ulid,
|
|
@@ -6208,6 +6708,11 @@ export const updateAppPathParams = z.object({
|
|
|
6208
6708
|
});
|
|
6209
6709
|
export const updateAppBody = updateAppRequest;
|
|
6210
6710
|
export const updateAppResponse = app;
|
|
6711
|
+
export const executeAppActionPathParams = z.object({
|
|
6712
|
+
appId: ulid,
|
|
6713
|
+
});
|
|
6714
|
+
export const executeAppActionBody = appActionRequest;
|
|
6715
|
+
export const executeAppActionResponse = app;
|
|
6211
6716
|
export const listAppCatalogQueryParams = z.object({
|
|
6212
6717
|
page: z
|
|
6213
6718
|
.object({
|
|
@@ -6673,11 +7178,75 @@ export const updateNotificationChannelResponse = notificationChannel;
|
|
|
6673
7178
|
export const deleteNotificationChannelPathParams = z.object({
|
|
6674
7179
|
notificationChannelId: ulid,
|
|
6675
7180
|
});
|
|
6676
|
-
export const
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
7181
|
+
export const listNotificationRulesQueryParams = z.object({
|
|
7182
|
+
page: z
|
|
7183
|
+
.object({
|
|
7184
|
+
size: z.coerce
|
|
7185
|
+
.number()
|
|
7186
|
+
.int()
|
|
7187
|
+
.optional()
|
|
7188
|
+
.describe('The number of items to include per page.'),
|
|
7189
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
7190
|
+
})
|
|
7191
|
+
.optional()
|
|
7192
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
7193
|
+
sort: sortQuery.optional(),
|
|
7194
|
+
filter: listNotificationRulesParamsFilter.optional(),
|
|
7195
|
+
});
|
|
7196
|
+
export const listNotificationRulesResponse = z.object({
|
|
7197
|
+
data: z.array(notificationRule),
|
|
7198
|
+
meta: paginatedMeta,
|
|
7199
|
+
});
|
|
7200
|
+
export const createNotificationRuleBody = notificationRuleRequest;
|
|
7201
|
+
export const createNotificationRuleResponse = notificationRule;
|
|
7202
|
+
export const getNotificationRulePathParams = z.object({
|
|
7203
|
+
notificationRuleId: ulid,
|
|
7204
|
+
});
|
|
7205
|
+
export const getNotificationRuleResponse = notificationRule;
|
|
7206
|
+
export const updateNotificationRulePathParams = z.object({
|
|
7207
|
+
notificationRuleId: ulid,
|
|
7208
|
+
});
|
|
7209
|
+
export const updateNotificationRuleBody = notificationRuleRequest;
|
|
7210
|
+
export const updateNotificationRuleResponse = notificationRule;
|
|
7211
|
+
export const deleteNotificationRulePathParams = z.object({
|
|
7212
|
+
notificationRuleId: ulid,
|
|
7213
|
+
});
|
|
7214
|
+
export const testNotificationRulePathParams = z.object({
|
|
7215
|
+
notificationRuleId: ulid,
|
|
7216
|
+
});
|
|
7217
|
+
export const testNotificationRuleResponse = notificationEvent;
|
|
7218
|
+
export const listNotificationEventsQueryParams = z.object({
|
|
7219
|
+
page: z
|
|
7220
|
+
.object({
|
|
7221
|
+
size: z.coerce
|
|
7222
|
+
.number()
|
|
7223
|
+
.int()
|
|
7224
|
+
.optional()
|
|
7225
|
+
.describe('The number of items to include per page.'),
|
|
7226
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
7227
|
+
})
|
|
7228
|
+
.optional()
|
|
7229
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
7230
|
+
sort: sortQuery.optional(),
|
|
7231
|
+
filter: listNotificationEventsParamsFilter.optional(),
|
|
7232
|
+
});
|
|
7233
|
+
export const listNotificationEventsResponse = z.object({
|
|
7234
|
+
data: z.array(notificationEvent),
|
|
7235
|
+
meta: paginatedMeta,
|
|
7236
|
+
});
|
|
7237
|
+
export const getNotificationEventPathParams = z.object({
|
|
7238
|
+
notificationEventId: ulid,
|
|
7239
|
+
});
|
|
7240
|
+
export const getNotificationEventResponse = notificationEvent;
|
|
7241
|
+
export const resendNotificationEventPathParams = z.object({
|
|
7242
|
+
notificationEventId: ulid,
|
|
7243
|
+
});
|
|
7244
|
+
export const resendNotificationEventBody = resendBillingNotificationEventRequest;
|
|
7245
|
+
export const labelsWire = z
|
|
7246
|
+
.record(z.string(), z.string())
|
|
7247
|
+
.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 "\\_".');
|
|
7248
|
+
export const currencyCodeWire = z
|
|
7249
|
+
.string()
|
|
6681
7250
|
.min(3)
|
|
6682
7251
|
.max(3)
|
|
6683
7252
|
.regex(new RegExp('^[A-Z]{3}$'))
|
|
@@ -7392,9 +7961,19 @@ export const appInstallMethodsWire = z
|
|
|
7392
7961
|
export const appStatusWire = z
|
|
7393
7962
|
.enum(['ready', 'unauthorized'])
|
|
7394
7963
|
.describe('Connection status of an installed app.');
|
|
7964
|
+
export const appActionTypeWire = z
|
|
7965
|
+
.enum(['reconcile_webhook_events'])
|
|
7966
|
+
.describe('App action type.');
|
|
7395
7967
|
export const updateLabelsWire = z
|
|
7396
7968
|
.record(z.string(), z.string())
|
|
7397
7969
|
.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 "\\_".');
|
|
7970
|
+
export const appReconcileWebhookEventsActionRequestWire = z
|
|
7971
|
+
.strictObject({
|
|
7972
|
+
action_type: z
|
|
7973
|
+
.literal('reconcile_webhook_events')
|
|
7974
|
+
.describe('The action to execute.'),
|
|
7975
|
+
})
|
|
7976
|
+
.describe("Request to reconcile the app's webhook events with the latest supported event set.");
|
|
7398
7977
|
export const installAppStripeWithApiKeyWire = z
|
|
7399
7978
|
.strictObject({
|
|
7400
7979
|
type: z.literal('stripe').describe('Type of the app.'),
|
|
@@ -7420,9 +7999,9 @@ export const installAppExternalInvoicingWire = z
|
|
|
7420
7999
|
name: z.string().describe('Name of the app.'),
|
|
7421
8000
|
create_billing_profile: z
|
|
7422
8001
|
.boolean()
|
|
7423
|
-
.describe('If true,
|
|
8002
|
+
.describe('If true, creates the Auto Collection preset with an OpenMeter supplier in the US (postal code 94114), without replacing the default profile.'),
|
|
7424
8003
|
})
|
|
7425
|
-
.describe('
|
|
8004
|
+
.describe('Model for installing an External Invoicing app from the catalog.');
|
|
7426
8005
|
export const workflowCollectionAlignmentSubscriptionWire = z
|
|
7427
8006
|
.strictObject({
|
|
7428
8007
|
type: z.literal('subscription').describe('The type of alignment.'),
|
|
@@ -7572,6 +8151,43 @@ export const booleanFieldFilterWire = z
|
|
|
7572
8151
|
export const notificationChannelTypeWire = z
|
|
7573
8152
|
.enum(['webhook'])
|
|
7574
8153
|
.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.');
|
|
8154
|
+
export const notificationBalanceThresholdTypeWire = z
|
|
8155
|
+
.enum(['balance_value', 'usage_percentage', 'usage_value'])
|
|
8156
|
+
.describe('What a balance threshold is measured against.');
|
|
8157
|
+
export const notificationEventTypeWire = z
|
|
8158
|
+
.enum([
|
|
8159
|
+
'entitlements.balance.threshold',
|
|
8160
|
+
'entitlements.reset',
|
|
8161
|
+
'invoice.created',
|
|
8162
|
+
'invoice.updated',
|
|
8163
|
+
])
|
|
8164
|
+
.describe('The type of a notification event. It determines which payload variant the event carries.');
|
|
8165
|
+
export const notificationEventDeliveryStateWire = z
|
|
8166
|
+
.enum(['success', 'failed', 'sending', 'pending', 'resending'])
|
|
8167
|
+
.describe('The delivery state of a notification event for a single channel.');
|
|
8168
|
+
export const notificationEventDeliveryAttemptResponseWire = z
|
|
8169
|
+
.strictObject({
|
|
8170
|
+
status_code: z
|
|
8171
|
+
.number()
|
|
8172
|
+
.int()
|
|
8173
|
+
.gte(-2147483648)
|
|
8174
|
+
.lte(2147483647)
|
|
8175
|
+
.optional()
|
|
8176
|
+
.describe('The HTTP status code returned by the recipient. Absent when no response was received.'),
|
|
8177
|
+
body: z
|
|
8178
|
+
.string()
|
|
8179
|
+
.describe('The response body returned by the recipient. Empty when no body was received.'),
|
|
8180
|
+
duration_ms: z.coerce
|
|
8181
|
+
.bigint()
|
|
8182
|
+
.gte(-9223372036854775808n)
|
|
8183
|
+
.lte(9223372036854775807n)
|
|
8184
|
+
.describe('How long the delivery attempt took, in milliseconds.'),
|
|
8185
|
+
url: z
|
|
8186
|
+
.string()
|
|
8187
|
+
.optional()
|
|
8188
|
+
.describe('The URL the event was delivered to. Only set for webhook channels.'),
|
|
8189
|
+
})
|
|
8190
|
+
.describe('The response the recipient returned for a delivery attempt. For webhook channels this is the HTTP response.');
|
|
7575
8191
|
export const queryFilterIntegerWire = z
|
|
7576
8192
|
.strictObject({
|
|
7577
8193
|
eq: z
|
|
@@ -8284,6 +8900,31 @@ export const updateResourceReferenceWire = z
|
|
|
8284
8900
|
id: ulidWire,
|
|
8285
8901
|
})
|
|
8286
8902
|
.describe('TaxCode reference.');
|
|
8903
|
+
export const notificationChannelReferenceWire = z
|
|
8904
|
+
.strictObject({
|
|
8905
|
+
id: ulidWire,
|
|
8906
|
+
})
|
|
8907
|
+
.describe('NotificationChannel reference.');
|
|
8908
|
+
export const notificationEventFeatureReferenceWire = z
|
|
8909
|
+
.strictObject({
|
|
8910
|
+
id: ulidWire,
|
|
8911
|
+
key: z.string().describe('The immutable key of the feature.'),
|
|
8912
|
+
})
|
|
8913
|
+
.describe('A reference to the feature of an entitlement notification event.');
|
|
8914
|
+
export const notificationEventInvoiceReferenceWire = z
|
|
8915
|
+
.strictObject({
|
|
8916
|
+
id: ulidWire,
|
|
8917
|
+
number: z.string().describe('The human-readable invoice number.'),
|
|
8918
|
+
})
|
|
8919
|
+
.describe('A reference to the invoice of an invoice notification event.');
|
|
8920
|
+
export const resendBillingNotificationEventRequestWire = z
|
|
8921
|
+
.strictObject({
|
|
8922
|
+
channels: z
|
|
8923
|
+
.array(ulidWire)
|
|
8924
|
+
.optional()
|
|
8925
|
+
.describe('The channels to resend the event to. When omitted or empty, the event is resent to every enabled channel of the rule. Channels not targeted by the rule or disabled are rejected.'),
|
|
8926
|
+
})
|
|
8927
|
+
.describe('Request body for resending a notification event.');
|
|
8287
8928
|
export const billingCustomerReferenceWire = z
|
|
8288
8929
|
.strictObject({
|
|
8289
8930
|
id: ulidWire,
|
|
@@ -9126,6 +9767,14 @@ export const appCapabilityWire = z
|
|
|
9126
9767
|
description: z.string().describe('Description of the capability.'),
|
|
9127
9768
|
})
|
|
9128
9769
|
.describe('App capability describes a function that an App can perform.');
|
|
9770
|
+
export const appActionWire = z
|
|
9771
|
+
.strictObject({
|
|
9772
|
+
type: appActionTypeWire,
|
|
9773
|
+
description: z
|
|
9774
|
+
.string()
|
|
9775
|
+
.describe('Human readable explanation of why the action is needed.'),
|
|
9776
|
+
})
|
|
9777
|
+
.describe('An action the operator should take on an installed app.');
|
|
9129
9778
|
export const updateAppStripeRequestWire = z
|
|
9130
9779
|
.strictObject({
|
|
9131
9780
|
name: z
|
|
@@ -9184,6 +9833,11 @@ export const updateAppExternalInvoicingRequestWire = z
|
|
|
9184
9833
|
.describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
|
|
9185
9834
|
})
|
|
9186
9835
|
.describe('AppExternalInvoicing update request.');
|
|
9836
|
+
export const appActionRequestWire = z
|
|
9837
|
+
.discriminatedUnion('action_type', [
|
|
9838
|
+
appReconcileWebhookEventsActionRequestWire,
|
|
9839
|
+
])
|
|
9840
|
+
.describe('Request to execute an operator action on an installed app.');
|
|
9187
9841
|
export const installAppRequestWire = z
|
|
9188
9842
|
.discriminatedUnion('type', [
|
|
9189
9843
|
installAppStripeWithApiKeyWire,
|
|
@@ -9371,6 +10025,26 @@ export const updateBillingNotificationChannelRequestWire = z
|
|
|
9371
10025
|
.describe('Secret used to sign outgoing webhook payloads so recipients can verify their authenticity. If omitted on create, a secret is generated automatically by the delivery provider. This is a sensitive credential returned in responses (unlike most secrets) specifically so clients can retrieve a server-generated value and verify webhook signatures; handle it with the same care as any other credential.'),
|
|
9372
10026
|
})
|
|
9373
10027
|
.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.");
|
|
10028
|
+
export const notificationBalanceThresholdWire = z
|
|
10029
|
+
.strictObject({
|
|
10030
|
+
type: notificationBalanceThresholdTypeWire,
|
|
10031
|
+
value: z.number().describe('The threshold value.'),
|
|
10032
|
+
})
|
|
10033
|
+
.describe('A balance threshold of a notification rule. Crossing it generates an `entitlements.balance.threshold` event.');
|
|
10034
|
+
export const notificationRuleReferenceWire = z
|
|
10035
|
+
.strictObject({
|
|
10036
|
+
id: ulidWire,
|
|
10037
|
+
type: notificationEventTypeWire,
|
|
10038
|
+
name: z.string().describe('The user-provided name of the rule.'),
|
|
10039
|
+
})
|
|
10040
|
+
.describe('A reference to the notification rule that generated an event.');
|
|
10041
|
+
export const notificationEventDeliveryAttemptWire = z
|
|
10042
|
+
.strictObject({
|
|
10043
|
+
state: notificationEventDeliveryStateWire,
|
|
10044
|
+
response: notificationEventDeliveryAttemptResponseWire,
|
|
10045
|
+
timestamp: dateTimeWire,
|
|
10046
|
+
})
|
|
10047
|
+
.describe('A single delivery attempt to a channel.');
|
|
9374
10048
|
export const appCustomerDataWire = z
|
|
9375
10049
|
.strictObject({
|
|
9376
10050
|
stripe: appCustomerDataStripeWire
|
|
@@ -9782,6 +10456,163 @@ export const updateTaxCodeConfigWire = z
|
|
|
9782
10456
|
code: updateResourceReferenceWire.optional(),
|
|
9783
10457
|
})
|
|
9784
10458
|
.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.');
|
|
10459
|
+
export const notificationRuleEntitlementResetWire = z
|
|
10460
|
+
.strictObject({
|
|
10461
|
+
id: ulidWire,
|
|
10462
|
+
name: z
|
|
10463
|
+
.string()
|
|
10464
|
+
.min(1)
|
|
10465
|
+
.max(256)
|
|
10466
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10467
|
+
labels: labelsWire.optional(),
|
|
10468
|
+
created_at: dateTimeWire,
|
|
10469
|
+
updated_at: dateTimeWire,
|
|
10470
|
+
deleted_at: dateTimeWire.optional(),
|
|
10471
|
+
type: z
|
|
10472
|
+
.literal('entitlements.reset')
|
|
10473
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
10474
|
+
disabled: z
|
|
10475
|
+
.boolean()
|
|
10476
|
+
.optional()
|
|
10477
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
10478
|
+
channels: z
|
|
10479
|
+
.array(notificationChannelReferenceWire)
|
|
10480
|
+
.max(5)
|
|
10481
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
10482
|
+
features: z
|
|
10483
|
+
.array(featureReferenceWire)
|
|
10484
|
+
.optional()
|
|
10485
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
10486
|
+
})
|
|
10487
|
+
.describe('A rule that generates an event when an entitlement usage period is reset.');
|
|
10488
|
+
export const notificationRuleInvoiceCreatedWire = z
|
|
10489
|
+
.strictObject({
|
|
10490
|
+
id: ulidWire,
|
|
10491
|
+
name: z
|
|
10492
|
+
.string()
|
|
10493
|
+
.min(1)
|
|
10494
|
+
.max(256)
|
|
10495
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10496
|
+
labels: labelsWire.optional(),
|
|
10497
|
+
created_at: dateTimeWire,
|
|
10498
|
+
updated_at: dateTimeWire,
|
|
10499
|
+
deleted_at: dateTimeWire.optional(),
|
|
10500
|
+
type: z
|
|
10501
|
+
.literal('invoice.created')
|
|
10502
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
10503
|
+
disabled: z
|
|
10504
|
+
.boolean()
|
|
10505
|
+
.optional()
|
|
10506
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
10507
|
+
channels: z
|
|
10508
|
+
.array(notificationChannelReferenceWire)
|
|
10509
|
+
.max(5)
|
|
10510
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
10511
|
+
})
|
|
10512
|
+
.describe('A rule that generates an event when an invoice is created.');
|
|
10513
|
+
export const notificationRuleInvoiceUpdatedWire = z
|
|
10514
|
+
.strictObject({
|
|
10515
|
+
id: ulidWire,
|
|
10516
|
+
name: z
|
|
10517
|
+
.string()
|
|
10518
|
+
.min(1)
|
|
10519
|
+
.max(256)
|
|
10520
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10521
|
+
labels: labelsWire.optional(),
|
|
10522
|
+
created_at: dateTimeWire,
|
|
10523
|
+
updated_at: dateTimeWire,
|
|
10524
|
+
deleted_at: dateTimeWire.optional(),
|
|
10525
|
+
type: z
|
|
10526
|
+
.literal('invoice.updated')
|
|
10527
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
10528
|
+
disabled: z
|
|
10529
|
+
.boolean()
|
|
10530
|
+
.optional()
|
|
10531
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
10532
|
+
channels: z
|
|
10533
|
+
.array(notificationChannelReferenceWire)
|
|
10534
|
+
.max(5)
|
|
10535
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
10536
|
+
})
|
|
10537
|
+
.describe('A rule that generates an event when an invoice is updated.');
|
|
10538
|
+
export const notificationRuleEntitlementResetRequestWire = z
|
|
10539
|
+
.strictObject({
|
|
10540
|
+
name: z
|
|
10541
|
+
.string()
|
|
10542
|
+
.min(1)
|
|
10543
|
+
.max(256)
|
|
10544
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10545
|
+
labels: labelsWire.optional(),
|
|
10546
|
+
type: z
|
|
10547
|
+
.literal('entitlements.reset')
|
|
10548
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
10549
|
+
disabled: z
|
|
10550
|
+
.boolean()
|
|
10551
|
+
.optional()
|
|
10552
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
10553
|
+
channels: z
|
|
10554
|
+
.array(notificationChannelReferenceWire)
|
|
10555
|
+
.max(5)
|
|
10556
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
10557
|
+
features: z
|
|
10558
|
+
.array(featureReferenceWire)
|
|
10559
|
+
.optional()
|
|
10560
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
10561
|
+
})
|
|
10562
|
+
.describe('Request body for an entitlement reset rule.');
|
|
10563
|
+
export const notificationRuleInvoiceCreatedRequestWire = z
|
|
10564
|
+
.strictObject({
|
|
10565
|
+
name: z
|
|
10566
|
+
.string()
|
|
10567
|
+
.min(1)
|
|
10568
|
+
.max(256)
|
|
10569
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10570
|
+
labels: labelsWire.optional(),
|
|
10571
|
+
type: z
|
|
10572
|
+
.literal('invoice.created')
|
|
10573
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
10574
|
+
disabled: z
|
|
10575
|
+
.boolean()
|
|
10576
|
+
.optional()
|
|
10577
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
10578
|
+
channels: z
|
|
10579
|
+
.array(notificationChannelReferenceWire)
|
|
10580
|
+
.max(5)
|
|
10581
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
10582
|
+
})
|
|
10583
|
+
.describe('Request body for an invoice created rule.');
|
|
10584
|
+
export const notificationRuleInvoiceUpdatedRequestWire = z
|
|
10585
|
+
.strictObject({
|
|
10586
|
+
name: z
|
|
10587
|
+
.string()
|
|
10588
|
+
.min(1)
|
|
10589
|
+
.max(256)
|
|
10590
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
10591
|
+
labels: labelsWire.optional(),
|
|
10592
|
+
type: z
|
|
10593
|
+
.literal('invoice.updated')
|
|
10594
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
10595
|
+
disabled: z
|
|
10596
|
+
.boolean()
|
|
10597
|
+
.optional()
|
|
10598
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
10599
|
+
channels: z
|
|
10600
|
+
.array(notificationChannelReferenceWire)
|
|
10601
|
+
.max(5)
|
|
10602
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
10603
|
+
})
|
|
10604
|
+
.describe('Request body for an invoice updated rule.');
|
|
10605
|
+
export const notificationEventInvoiceDataWire = z
|
|
10606
|
+
.strictObject({
|
|
10607
|
+
invoice: notificationEventInvoiceReferenceWire,
|
|
10608
|
+
customer_id: ulidWire.optional(),
|
|
10609
|
+
currency: currencyCodeWire,
|
|
10610
|
+
status: z
|
|
10611
|
+
.string()
|
|
10612
|
+
.describe('The status of the invoice at the time the event was generated.'),
|
|
10613
|
+
total: numericWire,
|
|
10614
|
+
})
|
|
10615
|
+
.describe('The invoice an invoice notification event refers to.');
|
|
9785
10616
|
export const listEventsParamsFilterWire = z
|
|
9786
10617
|
.strictObject({
|
|
9787
10618
|
id: stringFieldFilterWire.optional(),
|
|
@@ -9832,6 +10663,31 @@ export const listNotificationChannelsParamsFilterWire = z
|
|
|
9832
10663
|
updated_at: dateTimeFieldFilterWire.optional(),
|
|
9833
10664
|
})
|
|
9834
10665
|
.describe('Filter options for listing notification channels.');
|
|
10666
|
+
export const listNotificationRulesParamsFilterWire = z
|
|
10667
|
+
.strictObject({
|
|
10668
|
+
id: ulidFieldFilterWire.optional(),
|
|
10669
|
+
name: stringFieldFilterWire.optional(),
|
|
10670
|
+
type: stringFieldFilterExactWire.optional(),
|
|
10671
|
+
disabled: booleanFieldFilterWire.optional(),
|
|
10672
|
+
created_at: dateTimeFieldFilterWire.optional(),
|
|
10673
|
+
updated_at: dateTimeFieldFilterWire.optional(),
|
|
10674
|
+
channel_id: ulidFieldFilterWire.optional(),
|
|
10675
|
+
})
|
|
10676
|
+
.describe('Filter options for listing notification rules.');
|
|
10677
|
+
export const listNotificationEventsParamsFilterWire = z
|
|
10678
|
+
.strictObject({
|
|
10679
|
+
id: ulidFieldFilterWire.optional(),
|
|
10680
|
+
type: stringFieldFilterExactWire.optional(),
|
|
10681
|
+
created_at: dateTimeFieldFilterWire.optional(),
|
|
10682
|
+
rule_id: ulidFieldFilterWire.optional(),
|
|
10683
|
+
channel_id: ulidFieldFilterWire.optional(),
|
|
10684
|
+
delivery_status: stringFieldFilterExactWire.optional(),
|
|
10685
|
+
subject_key: stringFieldFilterExactWire.optional(),
|
|
10686
|
+
subject_id: ulidFieldFilterWire.optional(),
|
|
10687
|
+
feature_key: stringFieldFilterExactWire.optional(),
|
|
10688
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
10689
|
+
})
|
|
10690
|
+
.describe('Filter options for listing notification events.');
|
|
9835
10691
|
export const resourceFiltersWire = z
|
|
9836
10692
|
.strictObject({
|
|
9837
10693
|
name: stringFieldFilterWire.optional(),
|
|
@@ -10526,6 +11382,84 @@ export const notificationChannelPagePaginatedResponseWire = z
|
|
|
10526
11382
|
meta: paginatedMetaWire,
|
|
10527
11383
|
})
|
|
10528
11384
|
.describe('Page paginated response.');
|
|
11385
|
+
export const notificationRuleBalanceThresholdWire = z
|
|
11386
|
+
.strictObject({
|
|
11387
|
+
id: ulidWire,
|
|
11388
|
+
name: z
|
|
11389
|
+
.string()
|
|
11390
|
+
.min(1)
|
|
11391
|
+
.max(256)
|
|
11392
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
11393
|
+
labels: labelsWire.optional(),
|
|
11394
|
+
created_at: dateTimeWire,
|
|
11395
|
+
updated_at: dateTimeWire,
|
|
11396
|
+
deleted_at: dateTimeWire.optional(),
|
|
11397
|
+
type: z
|
|
11398
|
+
.literal('entitlements.balance.threshold')
|
|
11399
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
11400
|
+
disabled: z
|
|
11401
|
+
.boolean()
|
|
11402
|
+
.optional()
|
|
11403
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
11404
|
+
channels: z
|
|
11405
|
+
.array(notificationChannelReferenceWire)
|
|
11406
|
+
.max(5)
|
|
11407
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
11408
|
+
thresholds: z
|
|
11409
|
+
.array(notificationBalanceThresholdWire)
|
|
11410
|
+
.min(1)
|
|
11411
|
+
.max(10)
|
|
11412
|
+
.describe('The thresholds that generate an event when crossed.'),
|
|
11413
|
+
features: z
|
|
11414
|
+
.array(featureReferenceWire)
|
|
11415
|
+
.optional()
|
|
11416
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
11417
|
+
})
|
|
11418
|
+
.describe('A rule that generates an event when an entitlement balance crosses one of its thresholds.');
|
|
11419
|
+
export const notificationRuleBalanceThresholdRequestWire = z
|
|
11420
|
+
.strictObject({
|
|
11421
|
+
name: z
|
|
11422
|
+
.string()
|
|
11423
|
+
.min(1)
|
|
11424
|
+
.max(256)
|
|
11425
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
11426
|
+
labels: labelsWire.optional(),
|
|
11427
|
+
type: z
|
|
11428
|
+
.literal('entitlements.balance.threshold')
|
|
11429
|
+
.describe('The type of event the rule generates. Immutable after creation.'),
|
|
11430
|
+
disabled: z
|
|
11431
|
+
.boolean()
|
|
11432
|
+
.optional()
|
|
11433
|
+
.describe('Whether the rule is disabled. Disabled rules do not generate events.'),
|
|
11434
|
+
channels: z
|
|
11435
|
+
.array(notificationChannelReferenceWire)
|
|
11436
|
+
.max(5)
|
|
11437
|
+
.describe('The channels the rule delivers its events to. At least one and at most five channels are required. Responses omit channels that have since been disabled or deleted.'),
|
|
11438
|
+
thresholds: z
|
|
11439
|
+
.array(notificationBalanceThresholdWire)
|
|
11440
|
+
.min(1)
|
|
11441
|
+
.max(10)
|
|
11442
|
+
.describe('The thresholds that generate an event when crossed.'),
|
|
11443
|
+
features: z
|
|
11444
|
+
.array(featureReferenceWire)
|
|
11445
|
+
.optional()
|
|
11446
|
+
.describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
|
|
11447
|
+
})
|
|
11448
|
+
.describe('Request body for a balance threshold rule.');
|
|
11449
|
+
export const notificationEventDeliveryStatusWire = z
|
|
11450
|
+
.strictObject({
|
|
11451
|
+
channel_id: ulidWire,
|
|
11452
|
+
state: notificationEventDeliveryStateWire,
|
|
11453
|
+
reason: z
|
|
11454
|
+
.string()
|
|
11455
|
+
.describe('The reason for the last state change. Empty for successful deliveries.'),
|
|
11456
|
+
updated_at: dateTimeWire,
|
|
11457
|
+
next_attempt: dateTimeWire.optional(),
|
|
11458
|
+
attempts: z
|
|
11459
|
+
.array(notificationEventDeliveryAttemptWire)
|
|
11460
|
+
.describe('The delivery attempts made so far, most recent first.'),
|
|
11461
|
+
})
|
|
11462
|
+
.describe('The delivery status of a notification event for one channel of the generating rule.');
|
|
10529
11463
|
export const customerDataWire = z
|
|
10530
11464
|
.strictObject({
|
|
10531
11465
|
billing_profile: profileReferenceWire.optional(),
|
|
@@ -10569,6 +11503,29 @@ export const listCustomerEntitlementAccessResponseDataWire = z
|
|
|
10569
11503
|
.describe('The list of entitlement access results.'),
|
|
10570
11504
|
})
|
|
10571
11505
|
.describe('List customer entitlement access response data.');
|
|
11506
|
+
export const notificationEventBalanceThresholdDataWire = z
|
|
11507
|
+
.strictObject({
|
|
11508
|
+
entitlement_id: ulidWire,
|
|
11509
|
+
feature: notificationEventFeatureReferenceWire,
|
|
11510
|
+
subject_key: z
|
|
11511
|
+
.string()
|
|
11512
|
+
.describe('The key of the subject the entitlement belongs to.'),
|
|
11513
|
+
customer_id: ulidWire.optional(),
|
|
11514
|
+
value: entitlementValueResultWire,
|
|
11515
|
+
threshold: notificationBalanceThresholdWire,
|
|
11516
|
+
})
|
|
11517
|
+
.describe('The entities and threshold a balance threshold event refers to.');
|
|
11518
|
+
export const notificationEventEntitlementDataWire = z
|
|
11519
|
+
.strictObject({
|
|
11520
|
+
entitlement_id: ulidWire,
|
|
11521
|
+
feature: notificationEventFeatureReferenceWire,
|
|
11522
|
+
subject_key: z
|
|
11523
|
+
.string()
|
|
11524
|
+
.describe('The key of the subject the entitlement belongs to.'),
|
|
11525
|
+
customer_id: ulidWire.optional(),
|
|
11526
|
+
value: entitlementValueResultWire,
|
|
11527
|
+
})
|
|
11528
|
+
.describe('The entitlement, feature, and subject an entitlement notification event refers to.');
|
|
10572
11529
|
export const priceGraduatedWire = z
|
|
10573
11530
|
.strictObject({
|
|
10574
11531
|
type: z.literal('graduated').describe('The type of the price.'),
|
|
@@ -10701,6 +11658,22 @@ export const planAddonPagePaginatedResponseWire = z
|
|
|
10701
11658
|
meta: paginatedMetaWire,
|
|
10702
11659
|
})
|
|
10703
11660
|
.describe('Page paginated response.');
|
|
11661
|
+
export const notificationEventInvoiceCreatedPayloadWire = z
|
|
11662
|
+
.strictObject({
|
|
11663
|
+
id: ulidWire,
|
|
11664
|
+
type: z.literal('invoice.created').describe('The type of the event.'),
|
|
11665
|
+
timestamp: dateTimeWire,
|
|
11666
|
+
data: notificationEventInvoiceDataWire,
|
|
11667
|
+
})
|
|
11668
|
+
.describe('An invoice created notification event payload.');
|
|
11669
|
+
export const notificationEventInvoiceUpdatedPayloadWire = z
|
|
11670
|
+
.strictObject({
|
|
11671
|
+
id: ulidWire,
|
|
11672
|
+
type: z.literal('invoice.updated').describe('The type of the event.'),
|
|
11673
|
+
timestamp: dateTimeWire,
|
|
11674
|
+
data: notificationEventInvoiceDataWire,
|
|
11675
|
+
})
|
|
11676
|
+
.describe('An invoice updated notification event payload.');
|
|
10704
11677
|
export const ingestedEventPaginatedResponseWire = z
|
|
10705
11678
|
.strictObject({
|
|
10706
11679
|
data: z.array(ingestedEventWire),
|
|
@@ -10918,6 +11891,10 @@ export const appStripeWire = z
|
|
|
10918
11891
|
type: z.literal('stripe').describe('The app type.'),
|
|
10919
11892
|
definition: appCatalogItemWire,
|
|
10920
11893
|
status: appStatusWire,
|
|
11894
|
+
actions: z
|
|
11895
|
+
.array(appActionWire)
|
|
11896
|
+
.optional()
|
|
11897
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
10921
11898
|
account_id: z
|
|
10922
11899
|
.string()
|
|
10923
11900
|
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
@@ -10949,6 +11926,10 @@ export const appSandboxWire = z
|
|
|
10949
11926
|
type: z.literal('sandbox').describe('The app type.'),
|
|
10950
11927
|
definition: appCatalogItemWire,
|
|
10951
11928
|
status: appStatusWire,
|
|
11929
|
+
actions: z
|
|
11930
|
+
.array(appActionWire)
|
|
11931
|
+
.optional()
|
|
11932
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
10952
11933
|
})
|
|
10953
11934
|
.describe('Sandbox app can be used for testing billing features.');
|
|
10954
11935
|
export const appExternalInvoicingWire = z
|
|
@@ -10971,6 +11952,10 @@ export const appExternalInvoicingWire = z
|
|
|
10971
11952
|
type: z.literal('external_invoicing').describe('The app type.'),
|
|
10972
11953
|
definition: appCatalogItemWire,
|
|
10973
11954
|
status: appStatusWire,
|
|
11955
|
+
actions: z
|
|
11956
|
+
.array(appActionWire)
|
|
11957
|
+
.optional()
|
|
11958
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
10974
11959
|
enable_draft_sync_hook: z
|
|
10975
11960
|
.boolean()
|
|
10976
11961
|
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
@@ -11005,6 +11990,10 @@ export const installedAppStripeWire = z
|
|
|
11005
11990
|
type: z.literal('stripe').describe('The app type.'),
|
|
11006
11991
|
definition: appCatalogItemWire,
|
|
11007
11992
|
status: appStatusWire,
|
|
11993
|
+
actions: z
|
|
11994
|
+
.array(appActionWire)
|
|
11995
|
+
.optional()
|
|
11996
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
11008
11997
|
account_id: z
|
|
11009
11998
|
.string()
|
|
11010
11999
|
.describe('The Stripe account ID associated with the connected Stripe account.'),
|
|
@@ -11039,6 +12028,10 @@ export const installedAppSandboxWire = z
|
|
|
11039
12028
|
type: z.literal('sandbox').describe('The app type.'),
|
|
11040
12029
|
definition: appCatalogItemWire,
|
|
11041
12030
|
status: appStatusWire,
|
|
12031
|
+
actions: z
|
|
12032
|
+
.array(appActionWire)
|
|
12033
|
+
.optional()
|
|
12034
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
11042
12035
|
default_for_capability_types: z
|
|
11043
12036
|
.array(appCapabilityTypeWire)
|
|
11044
12037
|
.describe('Default capabilities of the installed app.'),
|
|
@@ -11064,6 +12057,10 @@ export const installedAppExternalInvoicingWire = z
|
|
|
11064
12057
|
type: z.literal('external_invoicing').describe('The app type.'),
|
|
11065
12058
|
definition: appCatalogItemWire,
|
|
11066
12059
|
status: appStatusWire,
|
|
12060
|
+
actions: z
|
|
12061
|
+
.array(appActionWire)
|
|
12062
|
+
.optional()
|
|
12063
|
+
.describe('Actions the operator should take to bring the app up to date. Omitted when no action is required.'),
|
|
11067
12064
|
enable_draft_sync_hook: z
|
|
11068
12065
|
.boolean()
|
|
11069
12066
|
.describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
|
|
@@ -11122,6 +12119,40 @@ export const entitlementAccessQueryResultWire = z
|
|
|
11122
12119
|
updated_at: dateTimeWire,
|
|
11123
12120
|
})
|
|
11124
12121
|
.describe('Access evaluation result for a single resolved customer.');
|
|
12122
|
+
export const notificationRuleWire = z
|
|
12123
|
+
.discriminatedUnion('type', [
|
|
12124
|
+
notificationRuleBalanceThresholdWire,
|
|
12125
|
+
notificationRuleEntitlementResetWire,
|
|
12126
|
+
notificationRuleInvoiceCreatedWire,
|
|
12127
|
+
notificationRuleInvoiceUpdatedWire,
|
|
12128
|
+
])
|
|
12129
|
+
.describe('A notification rule selects the type of event to generate, the conditions specific to that type, and the channels to deliver the events to.');
|
|
12130
|
+
export const notificationRuleRequestWire = z
|
|
12131
|
+
.discriminatedUnion('type', [
|
|
12132
|
+
notificationRuleBalanceThresholdRequestWire,
|
|
12133
|
+
notificationRuleEntitlementResetRequestWire,
|
|
12134
|
+
notificationRuleInvoiceCreatedRequestWire,
|
|
12135
|
+
notificationRuleInvoiceUpdatedRequestWire,
|
|
12136
|
+
])
|
|
12137
|
+
.describe("Request body for creating or updating a notification rule. Updates replace the rule's mutable state: omitting `disabled`, `labels`, or `features` resets them to their defaults. The `type` must match the existing rule on update.");
|
|
12138
|
+
export const notificationEventBalanceThresholdPayloadWire = z
|
|
12139
|
+
.strictObject({
|
|
12140
|
+
id: ulidWire,
|
|
12141
|
+
type: z
|
|
12142
|
+
.literal('entitlements.balance.threshold')
|
|
12143
|
+
.describe('The type of the event.'),
|
|
12144
|
+
timestamp: dateTimeWire,
|
|
12145
|
+
data: notificationEventBalanceThresholdDataWire,
|
|
12146
|
+
})
|
|
12147
|
+
.describe('A balance threshold notification event payload.');
|
|
12148
|
+
export const notificationEventResetPayloadWire = z
|
|
12149
|
+
.strictObject({
|
|
12150
|
+
id: ulidWire,
|
|
12151
|
+
type: z.literal('entitlements.reset').describe('The type of the event.'),
|
|
12152
|
+
timestamp: dateTimeWire,
|
|
12153
|
+
data: notificationEventEntitlementDataWire,
|
|
12154
|
+
})
|
|
12155
|
+
.describe('An entitlement reset notification event payload.');
|
|
11125
12156
|
export const priceWire = z
|
|
11126
12157
|
.discriminatedUnion('type', [
|
|
11127
12158
|
priceFreeWire,
|
|
@@ -11392,6 +12423,20 @@ export const entitlementAccessQueryResponseWire = z
|
|
|
11392
12423
|
meta: cursorMetaWire,
|
|
11393
12424
|
})
|
|
11394
12425
|
.describe('Response of the entitlement access query.');
|
|
12426
|
+
export const notificationRulePagePaginatedResponseWire = z
|
|
12427
|
+
.strictObject({
|
|
12428
|
+
data: z.array(notificationRuleWire),
|
|
12429
|
+
meta: paginatedMetaWire,
|
|
12430
|
+
})
|
|
12431
|
+
.describe('Page paginated response.');
|
|
12432
|
+
export const notificationEventPayloadWire = z
|
|
12433
|
+
.discriminatedUnion('type', [
|
|
12434
|
+
notificationEventBalanceThresholdPayloadWire,
|
|
12435
|
+
notificationEventResetPayloadWire,
|
|
12436
|
+
notificationEventInvoiceCreatedPayloadWire,
|
|
12437
|
+
notificationEventInvoiceUpdatedPayloadWire,
|
|
12438
|
+
])
|
|
12439
|
+
.describe('The payload delivered to the channels, discriminated by the event type.');
|
|
11395
12440
|
export const rateCardWire = z
|
|
11396
12441
|
.strictObject({
|
|
11397
12442
|
name: z
|
|
@@ -11531,6 +12576,18 @@ export const profileAppsWire = z
|
|
|
11531
12576
|
payment: appWire,
|
|
11532
12577
|
})
|
|
11533
12578
|
.describe('Applications used by a billing profile.');
|
|
12579
|
+
export const notificationEventWire = z
|
|
12580
|
+
.strictObject({
|
|
12581
|
+
id: ulidWire,
|
|
12582
|
+
type: notificationEventTypeWire,
|
|
12583
|
+
created_at: dateTimeWire,
|
|
12584
|
+
rule: notificationRuleReferenceWire,
|
|
12585
|
+
delivery_status: z
|
|
12586
|
+
.array(notificationEventDeliveryStatusWire)
|
|
12587
|
+
.describe('The delivery status of the event, one entry per channel of the rule.'),
|
|
12588
|
+
payload: notificationEventPayloadWire,
|
|
12589
|
+
})
|
|
12590
|
+
.describe('A notification event records that a notification rule fired and tracks the delivery of its payload to each channel of the rule. Events are created by the system and cannot be modified.');
|
|
11534
12591
|
export const subscriptionItemWire = z
|
|
11535
12592
|
.strictObject({
|
|
11536
12593
|
id: ulidWire,
|
|
@@ -11792,6 +12849,12 @@ export const chargeRealizationWire = z
|
|
|
11792
12849
|
.describe('The detailed (rated) lines produced by the realization run. Requires the `realization.detailed_lines` expand.'),
|
|
11793
12850
|
})
|
|
11794
12851
|
.describe("A realization run of a charge. `totals` and `detailed_lines` are only populated with the `realization.totals` and `realization.detailed_lines` expands, respectively, since computing them requires re-deriving the run's rated breakdown. `invoice` is an ID reference unless the `realization.invoice` expand is used, which resolves it to the invoice header of the run's booked line: the invoice entity without its `lines` and without the `customer` snapshot (the charge itself already identifies the customer).");
|
|
12852
|
+
export const notificationEventPagePaginatedResponseWire = z
|
|
12853
|
+
.strictObject({
|
|
12854
|
+
data: z.array(notificationEventWire),
|
|
12855
|
+
meta: paginatedMetaWire,
|
|
12856
|
+
})
|
|
12857
|
+
.describe('Page paginated response.');
|
|
11795
12858
|
export const subscriptionPhaseWire = z
|
|
11796
12859
|
.strictObject({
|
|
11797
12860
|
id: ulidWire,
|
|
@@ -12873,6 +13936,11 @@ export const updateAppPathParamsWire = z.object({
|
|
|
12873
13936
|
});
|
|
12874
13937
|
export const updateAppBodyWire = updateAppRequestWire;
|
|
12875
13938
|
export const updateAppResponseWire = appWire;
|
|
13939
|
+
export const executeAppActionPathParamsWire = z.object({
|
|
13940
|
+
appId: ulidWire,
|
|
13941
|
+
});
|
|
13942
|
+
export const executeAppActionBodyWire = appActionRequestWire;
|
|
13943
|
+
export const executeAppActionResponseWire = appWire;
|
|
12876
13944
|
export const listAppCatalogQueryParamsWire = z.object({
|
|
12877
13945
|
page: z
|
|
12878
13946
|
.strictObject({
|
|
@@ -13368,3 +14436,73 @@ export const updateNotificationChannelResponseWire = notificationChannelWire;
|
|
|
13368
14436
|
export const deleteNotificationChannelPathParamsWire = z.object({
|
|
13369
14437
|
notificationChannelId: ulidWire,
|
|
13370
14438
|
});
|
|
14439
|
+
export const listNotificationRulesQueryParamsWire = z.object({
|
|
14440
|
+
page: z
|
|
14441
|
+
.strictObject({
|
|
14442
|
+
size: z.coerce
|
|
14443
|
+
.number()
|
|
14444
|
+
.int()
|
|
14445
|
+
.optional()
|
|
14446
|
+
.describe('The number of items to include per page.'),
|
|
14447
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
14448
|
+
})
|
|
14449
|
+
.optional()
|
|
14450
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
14451
|
+
sort: z
|
|
14452
|
+
.string()
|
|
14453
|
+
.optional()
|
|
14454
|
+
.describe('Sort notification rules 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.'),
|
|
14455
|
+
filter: listNotificationRulesParamsFilterWire.optional(),
|
|
14456
|
+
});
|
|
14457
|
+
export const listNotificationRulesResponseWire = z.strictObject({
|
|
14458
|
+
data: z.array(notificationRuleWire),
|
|
14459
|
+
meta: paginatedMetaWire,
|
|
14460
|
+
});
|
|
14461
|
+
export const createNotificationRuleBodyWire = notificationRuleRequestWire;
|
|
14462
|
+
export const createNotificationRuleResponseWire = notificationRuleWire;
|
|
14463
|
+
export const getNotificationRulePathParamsWire = z.object({
|
|
14464
|
+
notificationRuleId: ulidWire,
|
|
14465
|
+
});
|
|
14466
|
+
export const getNotificationRuleResponseWire = notificationRuleWire;
|
|
14467
|
+
export const updateNotificationRulePathParamsWire = z.object({
|
|
14468
|
+
notificationRuleId: ulidWire,
|
|
14469
|
+
});
|
|
14470
|
+
export const updateNotificationRuleBodyWire = notificationRuleRequestWire;
|
|
14471
|
+
export const updateNotificationRuleResponseWire = notificationRuleWire;
|
|
14472
|
+
export const deleteNotificationRulePathParamsWire = z.object({
|
|
14473
|
+
notificationRuleId: ulidWire,
|
|
14474
|
+
});
|
|
14475
|
+
export const testNotificationRulePathParamsWire = z.object({
|
|
14476
|
+
notificationRuleId: ulidWire,
|
|
14477
|
+
});
|
|
14478
|
+
export const testNotificationRuleResponseWire = notificationEventWire;
|
|
14479
|
+
export const listNotificationEventsQueryParamsWire = z.object({
|
|
14480
|
+
page: z
|
|
14481
|
+
.strictObject({
|
|
14482
|
+
size: z.coerce
|
|
14483
|
+
.number()
|
|
14484
|
+
.int()
|
|
14485
|
+
.optional()
|
|
14486
|
+
.describe('The number of items to include per page.'),
|
|
14487
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
14488
|
+
})
|
|
14489
|
+
.optional()
|
|
14490
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
14491
|
+
sort: z
|
|
14492
|
+
.string()
|
|
14493
|
+
.optional()
|
|
14494
|
+
.describe('Sort notification events returned in the response. Supported sort attributes are: - `created_at` (default) - `id` - `type` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order. Without a `sort` parameter, events are returned newest first.'),
|
|
14495
|
+
filter: listNotificationEventsParamsFilterWire.optional(),
|
|
14496
|
+
});
|
|
14497
|
+
export const listNotificationEventsResponseWire = z.strictObject({
|
|
14498
|
+
data: z.array(notificationEventWire),
|
|
14499
|
+
meta: paginatedMetaWire,
|
|
14500
|
+
});
|
|
14501
|
+
export const getNotificationEventPathParamsWire = z.object({
|
|
14502
|
+
notificationEventId: ulidWire,
|
|
14503
|
+
});
|
|
14504
|
+
export const getNotificationEventResponseWire = notificationEventWire;
|
|
14505
|
+
export const resendNotificationEventPathParamsWire = z.object({
|
|
14506
|
+
notificationEventId: ulidWire,
|
|
14507
|
+
});
|
|
14508
|
+
export const resendNotificationEventBodyWire = resendBillingNotificationEventRequestWire;
|