@openmeter/client 1.0.0-beta-ba497d78b3b6 → 1.0.0-beta-9b0450f0db89
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 +11 -0
- package/dist/funcs/index.d.ts +1 -0
- package/dist/funcs/index.js +1 -0
- package/dist/funcs/notifications.d.ts +43 -0
- package/dist/funcs/notifications.js +163 -0
- package/dist/index.d.ts +2 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/notifications.d.ts +46 -0
- package/dist/models/operations/notifications.js +2 -0
- package/dist/models/schemas.d.ts +515 -6
- package/dist/models/schemas.js +294 -20
- package/dist/models/types.d.ts +252 -3
- package/dist/sdk/internal.d.ts +58 -1
- package/dist/sdk/internal.js +73 -0
- package/dist/sdk/notifications.d.ts +58 -0
- package/dist/sdk/notifications.js +72 -0
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -893,6 +893,19 @@ export const entitlementFeatureAccessReasonCode = z
|
|
|
893
893
|
export const entitlementAccessQueryErrorCode = z
|
|
894
894
|
.enum(['unknown', 'customer_not_found'])
|
|
895
895
|
.describe('Error code for an entitlement access query failure.');
|
|
896
|
+
export const booleanFieldFilter = z
|
|
897
|
+
.union([
|
|
898
|
+
z.boolean(),
|
|
899
|
+
z.object({
|
|
900
|
+
eq: z
|
|
901
|
+
.boolean()
|
|
902
|
+
.describe('Value strictly equals the given boolean value.'),
|
|
903
|
+
}),
|
|
904
|
+
])
|
|
905
|
+
.describe('Filter by a boolean value (true/false).');
|
|
906
|
+
export const notificationChannelType = z
|
|
907
|
+
.enum(['webhook'])
|
|
908
|
+
.describe('The type of a notification channel. Currently the only supported channel type is `webhook`; the domain model anticipates additional channel types (e.g. email, Slack) in the future, so this is modeled as an enum rather than a boolean/constant even though it has a single member today.');
|
|
896
909
|
export const queryFilterInteger = z
|
|
897
910
|
.object({
|
|
898
911
|
eq: z
|
|
@@ -1017,16 +1030,6 @@ export const pagePaginationQuery = z
|
|
|
1017
1030
|
export const publicLabels = z
|
|
1018
1031
|
.record(z.string(), z.string())
|
|
1019
1032
|
.describe('Public labels store information about an entity that can be used for filtering a list of objects.');
|
|
1020
|
-
export const booleanFieldFilter = z
|
|
1021
|
-
.union([
|
|
1022
|
-
z.boolean(),
|
|
1023
|
-
z.object({
|
|
1024
|
-
eq: z
|
|
1025
|
-
.boolean()
|
|
1026
|
-
.describe('Value strictly equals the given boolean value.'),
|
|
1027
|
-
}),
|
|
1028
|
-
])
|
|
1029
|
-
.describe('Filter by a boolean value (true/false).');
|
|
1030
1033
|
export const numericFieldFilter = z
|
|
1031
1034
|
.union([
|
|
1032
1035
|
z.number(),
|
|
@@ -2630,6 +2633,91 @@ export const entitlementAccessQueryError = z
|
|
|
2630
2633
|
.describe('The customer identifier from the request that produced this error.'),
|
|
2631
2634
|
})
|
|
2632
2635
|
.describe('Query error within a partially successful entitlement access query response.');
|
|
2636
|
+
export const notificationChannel = z
|
|
2637
|
+
.object({
|
|
2638
|
+
id: ulid,
|
|
2639
|
+
name: z
|
|
2640
|
+
.string()
|
|
2641
|
+
.min(1)
|
|
2642
|
+
.max(256)
|
|
2643
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2644
|
+
labels: labels.optional(),
|
|
2645
|
+
createdAt: dateTime,
|
|
2646
|
+
updatedAt: dateTime,
|
|
2647
|
+
deletedAt: dateTime.optional(),
|
|
2648
|
+
type: notificationChannelType,
|
|
2649
|
+
disabled: z
|
|
2650
|
+
.boolean()
|
|
2651
|
+
.optional()
|
|
2652
|
+
.default(false)
|
|
2653
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
2654
|
+
url: z
|
|
2655
|
+
.string()
|
|
2656
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
2657
|
+
customHeaders: z
|
|
2658
|
+
.record(z.string(), z.string())
|
|
2659
|
+
.optional()
|
|
2660
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
2661
|
+
signingSecret: z
|
|
2662
|
+
.string()
|
|
2663
|
+
.optional()
|
|
2664
|
+
.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.'),
|
|
2665
|
+
})
|
|
2666
|
+
.describe('A notification channel delivers notification events, such as entitlement balance threshold crossings, to an external system. Today the only supported channel type is a webhook delivered via Svix.');
|
|
2667
|
+
export const createNotificationChannelRequest = z
|
|
2668
|
+
.object({
|
|
2669
|
+
name: z
|
|
2670
|
+
.string()
|
|
2671
|
+
.min(1)
|
|
2672
|
+
.max(256)
|
|
2673
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2674
|
+
labels: labels.optional(),
|
|
2675
|
+
type: notificationChannelType,
|
|
2676
|
+
disabled: z
|
|
2677
|
+
.boolean()
|
|
2678
|
+
.optional()
|
|
2679
|
+
.default(false)
|
|
2680
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
2681
|
+
url: z
|
|
2682
|
+
.string()
|
|
2683
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
2684
|
+
customHeaders: z
|
|
2685
|
+
.record(z.string(), z.string())
|
|
2686
|
+
.optional()
|
|
2687
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
2688
|
+
signingSecret: z
|
|
2689
|
+
.string()
|
|
2690
|
+
.optional()
|
|
2691
|
+
.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.'),
|
|
2692
|
+
})
|
|
2693
|
+
.describe('NotificationChannel create request.');
|
|
2694
|
+
export const updateNotificationChannelRequest = z
|
|
2695
|
+
.object({
|
|
2696
|
+
name: z
|
|
2697
|
+
.string()
|
|
2698
|
+
.min(1)
|
|
2699
|
+
.max(256)
|
|
2700
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2701
|
+
type: notificationChannelType,
|
|
2702
|
+
url: z
|
|
2703
|
+
.string()
|
|
2704
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
2705
|
+
labels: labels.optional(),
|
|
2706
|
+
disabled: z
|
|
2707
|
+
.boolean()
|
|
2708
|
+
.optional()
|
|
2709
|
+
.default(false)
|
|
2710
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
2711
|
+
customHeaders: z
|
|
2712
|
+
.record(z.string(), z.string())
|
|
2713
|
+
.optional()
|
|
2714
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
2715
|
+
signingSecret: z
|
|
2716
|
+
.string()
|
|
2717
|
+
.optional()
|
|
2718
|
+
.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.'),
|
|
2719
|
+
})
|
|
2720
|
+
.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.");
|
|
2633
2721
|
export const appCustomerData = z
|
|
2634
2722
|
.object({
|
|
2635
2723
|
stripe: appCustomerDataStripe
|
|
@@ -3061,6 +3149,16 @@ export const listChargesParamsFilter = z
|
|
|
3061
3149
|
customerId: ulidFieldFilter.optional(),
|
|
3062
3150
|
})
|
|
3063
3151
|
.describe('Filter options for listing charges across customers.');
|
|
3152
|
+
export const listNotificationChannelsParamsFilter = z
|
|
3153
|
+
.object({
|
|
3154
|
+
id: ulidFieldFilter.optional(),
|
|
3155
|
+
name: stringFieldFilter.optional(),
|
|
3156
|
+
type: stringFieldFilterExact.optional(),
|
|
3157
|
+
disabled: booleanFieldFilter.optional(),
|
|
3158
|
+
createdAt: dateTimeFieldFilter.optional(),
|
|
3159
|
+
updatedAt: dateTimeFieldFilter.optional(),
|
|
3160
|
+
})
|
|
3161
|
+
.describe('Filter options for listing notification channels.');
|
|
3064
3162
|
export const resourceFilters = z
|
|
3065
3163
|
.object({
|
|
3066
3164
|
name: stringFieldFilter.optional(),
|
|
@@ -3724,6 +3822,12 @@ export const entitlementFeatureAccess = z
|
|
|
3724
3822
|
reason: entitlementFeatureAccessReason.optional(),
|
|
3725
3823
|
})
|
|
3726
3824
|
.describe('Access status for a single feature.');
|
|
3825
|
+
export const notificationChannelPagePaginatedResponse = z
|
|
3826
|
+
.object({
|
|
3827
|
+
data: z.array(notificationChannel),
|
|
3828
|
+
meta: paginatedMeta,
|
|
3829
|
+
})
|
|
3830
|
+
.describe('Page paginated response.');
|
|
3727
3831
|
export const customerData = z
|
|
3728
3832
|
.object({
|
|
3729
3833
|
billingProfile: profileReference.optional(),
|
|
@@ -6387,6 +6491,39 @@ export const queryEntitlementAccessQueryParams = z.object({
|
|
|
6387
6491
|
});
|
|
6388
6492
|
export const queryEntitlementAccessBody = entitlementAccessQueryRequest;
|
|
6389
6493
|
export const queryEntitlementAccessResponse = entitlementAccessQueryResponse;
|
|
6494
|
+
export const listNotificationChannelsQueryParams = z.object({
|
|
6495
|
+
page: z
|
|
6496
|
+
.object({
|
|
6497
|
+
size: z.coerce
|
|
6498
|
+
.number()
|
|
6499
|
+
.int()
|
|
6500
|
+
.optional()
|
|
6501
|
+
.describe('The number of items to include per page.'),
|
|
6502
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
6503
|
+
})
|
|
6504
|
+
.optional()
|
|
6505
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
6506
|
+
sort: sortQuery.optional(),
|
|
6507
|
+
filter: listNotificationChannelsParamsFilter.optional(),
|
|
6508
|
+
});
|
|
6509
|
+
export const listNotificationChannelsResponse = z.object({
|
|
6510
|
+
data: z.array(notificationChannel),
|
|
6511
|
+
meta: paginatedMeta,
|
|
6512
|
+
});
|
|
6513
|
+
export const createNotificationChannelBody = createNotificationChannelRequest;
|
|
6514
|
+
export const createNotificationChannelResponse = notificationChannel;
|
|
6515
|
+
export const getNotificationChannelPathParams = z.object({
|
|
6516
|
+
notificationChannelId: ulid,
|
|
6517
|
+
});
|
|
6518
|
+
export const getNotificationChannelResponse = notificationChannel;
|
|
6519
|
+
export const updateNotificationChannelPathParams = z.object({
|
|
6520
|
+
notificationChannelId: ulid,
|
|
6521
|
+
});
|
|
6522
|
+
export const updateNotificationChannelBody = updateNotificationChannelRequest;
|
|
6523
|
+
export const updateNotificationChannelResponse = notificationChannel;
|
|
6524
|
+
export const deleteNotificationChannelPathParams = z.object({
|
|
6525
|
+
notificationChannelId: ulid,
|
|
6526
|
+
});
|
|
6390
6527
|
export const labelsWire = z
|
|
6391
6528
|
.record(z.string(), z.string())
|
|
6392
6529
|
.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 "\\_".');
|
|
@@ -7273,6 +7410,19 @@ export const entitlementFeatureAccessReasonCodeWire = z
|
|
|
7273
7410
|
export const entitlementAccessQueryErrorCodeWire = z
|
|
7274
7411
|
.enum(['unknown', 'customer_not_found'])
|
|
7275
7412
|
.describe('Error code for an entitlement access query failure.');
|
|
7413
|
+
export const booleanFieldFilterWire = z
|
|
7414
|
+
.union([
|
|
7415
|
+
z.boolean(),
|
|
7416
|
+
z.strictObject({
|
|
7417
|
+
eq: z
|
|
7418
|
+
.boolean()
|
|
7419
|
+
.describe('Value strictly equals the given boolean value.'),
|
|
7420
|
+
}),
|
|
7421
|
+
])
|
|
7422
|
+
.describe('Filter by a boolean value (true/false).');
|
|
7423
|
+
export const notificationChannelTypeWire = z
|
|
7424
|
+
.enum(['webhook'])
|
|
7425
|
+
.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.');
|
|
7276
7426
|
export const queryFilterIntegerWire = z
|
|
7277
7427
|
.strictObject({
|
|
7278
7428
|
eq: z
|
|
@@ -7397,16 +7547,6 @@ export const pagePaginationQueryWire = z
|
|
|
7397
7547
|
export const publicLabelsWire = z
|
|
7398
7548
|
.record(z.string(), z.string())
|
|
7399
7549
|
.describe('Public labels store information about an entity that can be used for filtering a list of objects.');
|
|
7400
|
-
export const booleanFieldFilterWire = z
|
|
7401
|
-
.union([
|
|
7402
|
-
z.boolean(),
|
|
7403
|
-
z.strictObject({
|
|
7404
|
-
eq: z
|
|
7405
|
-
.boolean()
|
|
7406
|
-
.describe('Value strictly equals the given boolean value.'),
|
|
7407
|
-
}),
|
|
7408
|
-
])
|
|
7409
|
-
.describe('Filter by a boolean value (true/false).');
|
|
7410
7550
|
export const numericFieldFilterWire = z
|
|
7411
7551
|
.union([
|
|
7412
7552
|
z.number(),
|
|
@@ -8988,6 +9128,88 @@ export const entitlementAccessQueryErrorWire = z
|
|
|
8988
9128
|
.describe('The customer identifier from the request that produced this error.'),
|
|
8989
9129
|
})
|
|
8990
9130
|
.describe('Query error within a partially successful entitlement access query response.');
|
|
9131
|
+
export const notificationChannelWire = z
|
|
9132
|
+
.strictObject({
|
|
9133
|
+
id: ulidWire,
|
|
9134
|
+
name: z
|
|
9135
|
+
.string()
|
|
9136
|
+
.min(1)
|
|
9137
|
+
.max(256)
|
|
9138
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9139
|
+
labels: labelsWire.optional(),
|
|
9140
|
+
created_at: dateTimeWire,
|
|
9141
|
+
updated_at: dateTimeWire,
|
|
9142
|
+
deleted_at: dateTimeWire.optional(),
|
|
9143
|
+
type: notificationChannelTypeWire,
|
|
9144
|
+
disabled: z
|
|
9145
|
+
.boolean()
|
|
9146
|
+
.optional()
|
|
9147
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9148
|
+
url: z
|
|
9149
|
+
.string()
|
|
9150
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9151
|
+
custom_headers: z
|
|
9152
|
+
.record(z.string(), z.string())
|
|
9153
|
+
.optional()
|
|
9154
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9155
|
+
signing_secret: z
|
|
9156
|
+
.string()
|
|
9157
|
+
.optional()
|
|
9158
|
+
.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.'),
|
|
9159
|
+
})
|
|
9160
|
+
.describe('A notification channel delivers notification events, such as entitlement balance threshold crossings, to an external system. Today the only supported channel type is a webhook delivered via Svix.');
|
|
9161
|
+
export const createNotificationChannelRequestWire = z
|
|
9162
|
+
.strictObject({
|
|
9163
|
+
name: z
|
|
9164
|
+
.string()
|
|
9165
|
+
.min(1)
|
|
9166
|
+
.max(256)
|
|
9167
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9168
|
+
labels: labelsWire.optional(),
|
|
9169
|
+
type: notificationChannelTypeWire,
|
|
9170
|
+
disabled: z
|
|
9171
|
+
.boolean()
|
|
9172
|
+
.optional()
|
|
9173
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9174
|
+
url: z
|
|
9175
|
+
.string()
|
|
9176
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9177
|
+
custom_headers: z
|
|
9178
|
+
.record(z.string(), z.string())
|
|
9179
|
+
.optional()
|
|
9180
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9181
|
+
signing_secret: z
|
|
9182
|
+
.string()
|
|
9183
|
+
.optional()
|
|
9184
|
+
.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.'),
|
|
9185
|
+
})
|
|
9186
|
+
.describe('NotificationChannel create request.');
|
|
9187
|
+
export const updateNotificationChannelRequestWire = z
|
|
9188
|
+
.strictObject({
|
|
9189
|
+
name: z
|
|
9190
|
+
.string()
|
|
9191
|
+
.min(1)
|
|
9192
|
+
.max(256)
|
|
9193
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9194
|
+
type: notificationChannelTypeWire,
|
|
9195
|
+
url: z
|
|
9196
|
+
.string()
|
|
9197
|
+
.describe('The URL that webhook notification events are delivered to.'),
|
|
9198
|
+
labels: labelsWire.optional(),
|
|
9199
|
+
disabled: z
|
|
9200
|
+
.boolean()
|
|
9201
|
+
.optional()
|
|
9202
|
+
.describe('Whether the channel is disabled. Disabled channels do not receive notification events.'),
|
|
9203
|
+
custom_headers: z
|
|
9204
|
+
.record(z.string(), z.string())
|
|
9205
|
+
.optional()
|
|
9206
|
+
.describe('Custom HTTP headers to include on every webhook delivery request, keyed by header name.'),
|
|
9207
|
+
signing_secret: z
|
|
9208
|
+
.string()
|
|
9209
|
+
.optional()
|
|
9210
|
+
.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.'),
|
|
9211
|
+
})
|
|
9212
|
+
.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.");
|
|
8991
9213
|
export const appCustomerDataWire = z
|
|
8992
9214
|
.strictObject({
|
|
8993
9215
|
stripe: appCustomerDataStripeWire
|
|
@@ -9419,6 +9641,16 @@ export const listChargesParamsFilterWire = z
|
|
|
9419
9641
|
customer_id: ulidFieldFilterWire.optional(),
|
|
9420
9642
|
})
|
|
9421
9643
|
.describe('Filter options for listing charges across customers.');
|
|
9644
|
+
export const listNotificationChannelsParamsFilterWire = z
|
|
9645
|
+
.strictObject({
|
|
9646
|
+
id: ulidFieldFilterWire.optional(),
|
|
9647
|
+
name: stringFieldFilterWire.optional(),
|
|
9648
|
+
type: stringFieldFilterExactWire.optional(),
|
|
9649
|
+
disabled: booleanFieldFilterWire.optional(),
|
|
9650
|
+
created_at: dateTimeFieldFilterWire.optional(),
|
|
9651
|
+
updated_at: dateTimeFieldFilterWire.optional(),
|
|
9652
|
+
})
|
|
9653
|
+
.describe('Filter options for listing notification channels.');
|
|
9422
9654
|
export const resourceFiltersWire = z
|
|
9423
9655
|
.strictObject({
|
|
9424
9656
|
name: stringFieldFilterWire.optional(),
|
|
@@ -10081,6 +10313,12 @@ export const entitlementFeatureAccessWire = z
|
|
|
10081
10313
|
reason: entitlementFeatureAccessReasonWire.optional(),
|
|
10082
10314
|
})
|
|
10083
10315
|
.describe('Access status for a single feature.');
|
|
10316
|
+
export const notificationChannelPagePaginatedResponseWire = z
|
|
10317
|
+
.strictObject({
|
|
10318
|
+
data: z.array(notificationChannelWire),
|
|
10319
|
+
meta: paginatedMetaWire,
|
|
10320
|
+
})
|
|
10321
|
+
.describe('Page paginated response.');
|
|
10084
10322
|
export const customerDataWire = z
|
|
10085
10323
|
.strictObject({
|
|
10086
10324
|
billing_profile: profileReferenceWire.optional(),
|
|
@@ -12790,3 +13028,39 @@ export const queryEntitlementAccessQueryParamsWire = z.object({
|
|
|
12790
13028
|
});
|
|
12791
13029
|
export const queryEntitlementAccessBodyWire = entitlementAccessQueryRequestWire;
|
|
12792
13030
|
export const queryEntitlementAccessResponseWire = entitlementAccessQueryResponseWire;
|
|
13031
|
+
export const listNotificationChannelsQueryParamsWire = z.object({
|
|
13032
|
+
page: z
|
|
13033
|
+
.strictObject({
|
|
13034
|
+
size: z.coerce
|
|
13035
|
+
.number()
|
|
13036
|
+
.int()
|
|
13037
|
+
.optional()
|
|
13038
|
+
.describe('The number of items to include per page.'),
|
|
13039
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
13040
|
+
})
|
|
13041
|
+
.optional()
|
|
13042
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
13043
|
+
sort: z
|
|
13044
|
+
.string()
|
|
13045
|
+
.optional()
|
|
13046
|
+
.describe('Sort notification channels returned in the response. Supported sort attributes are: - `id` (default) - `type` - `created_at` - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
13047
|
+
filter: listNotificationChannelsParamsFilterWire.optional(),
|
|
13048
|
+
});
|
|
13049
|
+
export const listNotificationChannelsResponseWire = z.strictObject({
|
|
13050
|
+
data: z.array(notificationChannelWire),
|
|
13051
|
+
meta: paginatedMetaWire,
|
|
13052
|
+
});
|
|
13053
|
+
export const createNotificationChannelBodyWire = createNotificationChannelRequestWire;
|
|
13054
|
+
export const createNotificationChannelResponseWire = notificationChannelWire;
|
|
13055
|
+
export const getNotificationChannelPathParamsWire = z.object({
|
|
13056
|
+
notificationChannelId: ulidWire,
|
|
13057
|
+
});
|
|
13058
|
+
export const getNotificationChannelResponseWire = notificationChannelWire;
|
|
13059
|
+
export const updateNotificationChannelPathParamsWire = z.object({
|
|
13060
|
+
notificationChannelId: ulidWire,
|
|
13061
|
+
});
|
|
13062
|
+
export const updateNotificationChannelBodyWire = updateNotificationChannelRequestWire;
|
|
13063
|
+
export const updateNotificationChannelResponseWire = notificationChannelWire;
|
|
13064
|
+
export const deleteNotificationChannelPathParamsWire = z.object({
|
|
13065
|
+
notificationChannelId: ulidWire,
|
|
13066
|
+
});
|
package/dist/models/types.d.ts
CHANGED
|
@@ -2283,6 +2283,120 @@ export interface EntitlementAccessQueryError {
|
|
|
2283
2283
|
/** The customer identifier from the request that produced this error. */
|
|
2284
2284
|
customer?: string;
|
|
2285
2285
|
}
|
|
2286
|
+
/**
|
|
2287
|
+
* A notification channel delivers notification events, such as entitlement balance
|
|
2288
|
+
* threshold crossings, to an external system. Today the only supported channel
|
|
2289
|
+
* type is a webhook delivered via Svix.
|
|
2290
|
+
*/
|
|
2291
|
+
export interface NotificationChannel {
|
|
2292
|
+
id: string;
|
|
2293
|
+
/**
|
|
2294
|
+
* Display name of the resource.
|
|
2295
|
+
*
|
|
2296
|
+
* Between 1 and 256 characters.
|
|
2297
|
+
*/
|
|
2298
|
+
name: string;
|
|
2299
|
+
labels?: Labels;
|
|
2300
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2301
|
+
createdAt: Date;
|
|
2302
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2303
|
+
updatedAt: Date;
|
|
2304
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2305
|
+
deletedAt?: Date;
|
|
2306
|
+
/** The type of the channel. Immutable after creation. */
|
|
2307
|
+
type: 'webhook';
|
|
2308
|
+
/**
|
|
2309
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2310
|
+
* events.
|
|
2311
|
+
*/
|
|
2312
|
+
disabled: boolean;
|
|
2313
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2314
|
+
url: string;
|
|
2315
|
+
/**
|
|
2316
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2317
|
+
* header name.
|
|
2318
|
+
*/
|
|
2319
|
+
customHeaders?: Record<string, string>;
|
|
2320
|
+
/**
|
|
2321
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2322
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2323
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2324
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2325
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2326
|
+
*/
|
|
2327
|
+
signingSecret?: string;
|
|
2328
|
+
}
|
|
2329
|
+
/** NotificationChannel create request. */
|
|
2330
|
+
export interface CreateNotificationChannelRequest {
|
|
2331
|
+
/**
|
|
2332
|
+
* Display name of the resource.
|
|
2333
|
+
*
|
|
2334
|
+
* Between 1 and 256 characters.
|
|
2335
|
+
*/
|
|
2336
|
+
name: string;
|
|
2337
|
+
labels?: Labels;
|
|
2338
|
+
/** The type of the channel. Immutable after creation. */
|
|
2339
|
+
type: 'webhook';
|
|
2340
|
+
/**
|
|
2341
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2342
|
+
* events.
|
|
2343
|
+
*/
|
|
2344
|
+
disabled: boolean;
|
|
2345
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2346
|
+
url: string;
|
|
2347
|
+
/**
|
|
2348
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2349
|
+
* header name.
|
|
2350
|
+
*/
|
|
2351
|
+
customHeaders?: Record<string, string>;
|
|
2352
|
+
/**
|
|
2353
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2354
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2355
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2356
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2357
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2358
|
+
*/
|
|
2359
|
+
signingSecret?: string;
|
|
2360
|
+
}
|
|
2361
|
+
/**
|
|
2362
|
+
* Request body for updating a notification channel. Updates replace the channel's
|
|
2363
|
+
* mutable state rather than merging it: `type`, `name`, and `url` must always be
|
|
2364
|
+
* provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to
|
|
2365
|
+
* their defaults (enabled, no labels, no custom headers). `signing_secret` is the
|
|
2366
|
+
* one exception: omitting it keeps the channel's current signing secret instead of
|
|
2367
|
+
* clearing the credential.
|
|
2368
|
+
*/
|
|
2369
|
+
export interface UpdateNotificationChannelRequest {
|
|
2370
|
+
/**
|
|
2371
|
+
* Display name of the resource.
|
|
2372
|
+
*
|
|
2373
|
+
* Between 1 and 256 characters.
|
|
2374
|
+
*/
|
|
2375
|
+
name: string;
|
|
2376
|
+
/** The type of the channel. Immutable after creation. */
|
|
2377
|
+
type: 'webhook';
|
|
2378
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2379
|
+
url: string;
|
|
2380
|
+
labels?: Labels;
|
|
2381
|
+
/**
|
|
2382
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2383
|
+
* events.
|
|
2384
|
+
*/
|
|
2385
|
+
disabled: boolean;
|
|
2386
|
+
/**
|
|
2387
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2388
|
+
* header name.
|
|
2389
|
+
*/
|
|
2390
|
+
customHeaders?: Record<string, string>;
|
|
2391
|
+
/**
|
|
2392
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2393
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2394
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2395
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2396
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2397
|
+
*/
|
|
2398
|
+
signingSecret?: string;
|
|
2399
|
+
}
|
|
2286
2400
|
/** App customer data. */
|
|
2287
2401
|
export interface AppCustomerData {
|
|
2288
2402
|
/**
|
|
@@ -2960,6 +3074,15 @@ export interface ListChargesParamsFilter {
|
|
|
2960
3074
|
/** Filter charges by the ID of their customer. */
|
|
2961
3075
|
customerId?: UlidFieldFilter;
|
|
2962
3076
|
}
|
|
3077
|
+
/** Filter options for listing notification channels. */
|
|
3078
|
+
export interface ListNotificationChannelsParamsFilter {
|
|
3079
|
+
id?: UlidFieldFilter;
|
|
3080
|
+
name?: StringFieldFilter;
|
|
3081
|
+
type?: StringFieldFilterExact;
|
|
3082
|
+
disabled?: BooleanFieldFilter;
|
|
3083
|
+
createdAt?: DateTimeFieldFilter;
|
|
3084
|
+
updatedAt?: DateTimeFieldFilter;
|
|
3085
|
+
}
|
|
2963
3086
|
/** Resource filters. */
|
|
2964
3087
|
export interface ResourceFilters {
|
|
2965
3088
|
name?: StringFieldFilter;
|
|
@@ -2971,9 +3094,7 @@ export interface ResourceFilters {
|
|
|
2971
3094
|
}
|
|
2972
3095
|
/** Field filters with all supported types. */
|
|
2973
3096
|
export interface FieldFilters {
|
|
2974
|
-
boolean?:
|
|
2975
|
-
eq: boolean;
|
|
2976
|
-
};
|
|
3097
|
+
boolean?: BooleanFieldFilter;
|
|
2977
3098
|
numeric?: number | {
|
|
2978
3099
|
eq?: number;
|
|
2979
3100
|
neq?: number;
|
|
@@ -3834,6 +3955,11 @@ export interface EntitlementFeatureAccess {
|
|
|
3834
3955
|
*/
|
|
3835
3956
|
reason?: EntitlementFeatureAccessReason;
|
|
3836
3957
|
}
|
|
3958
|
+
/** Page paginated response. */
|
|
3959
|
+
export interface NotificationChannelPagePaginatedResponse {
|
|
3960
|
+
data: NotificationChannel[];
|
|
3961
|
+
meta: PaginatedMeta;
|
|
3962
|
+
}
|
|
3837
3963
|
/** Billing customer data. */
|
|
3838
3964
|
export interface CustomerData {
|
|
3839
3965
|
/**
|
|
@@ -6748,6 +6874,10 @@ export type StringFieldFilterExact = string | {
|
|
|
6748
6874
|
};
|
|
6749
6875
|
/** The payment term of a flat price. */
|
|
6750
6876
|
export type PricePaymentTerm = 'in_advance' | 'in_arrears';
|
|
6877
|
+
/** Filter by a boolean value (true/false). */
|
|
6878
|
+
export type BooleanFieldFilter = boolean | {
|
|
6879
|
+
eq: boolean;
|
|
6880
|
+
};
|
|
6751
6881
|
/** Fiat or custom currency code. */
|
|
6752
6882
|
export type BillingCurrencyCode = string | string;
|
|
6753
6883
|
/** Fiat or custom currency code. */
|
|
@@ -7227,6 +7357,120 @@ export interface EntitlementAccessQueryRequestInput {
|
|
|
7227
7357
|
customer: EntitlementAccessQueryRequestCustomers;
|
|
7228
7358
|
feature?: EntitlementAccessQueryRequestFeatures;
|
|
7229
7359
|
}
|
|
7360
|
+
/**
|
|
7361
|
+
* A notification channel delivers notification events, such as entitlement balance
|
|
7362
|
+
* threshold crossings, to an external system. Today the only supported channel
|
|
7363
|
+
* type is a webhook delivered via Svix.
|
|
7364
|
+
*/
|
|
7365
|
+
export interface NotificationChannelInput {
|
|
7366
|
+
id: string;
|
|
7367
|
+
/**
|
|
7368
|
+
* Display name of the resource.
|
|
7369
|
+
*
|
|
7370
|
+
* Between 1 and 256 characters.
|
|
7371
|
+
*/
|
|
7372
|
+
name: string;
|
|
7373
|
+
labels?: Labels;
|
|
7374
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
7375
|
+
createdAt: Date;
|
|
7376
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
7377
|
+
updatedAt: Date;
|
|
7378
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
7379
|
+
deletedAt?: Date;
|
|
7380
|
+
/** The type of the channel. Immutable after creation. */
|
|
7381
|
+
type: 'webhook';
|
|
7382
|
+
/**
|
|
7383
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7384
|
+
* events.
|
|
7385
|
+
*/
|
|
7386
|
+
disabled?: boolean;
|
|
7387
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7388
|
+
url: string;
|
|
7389
|
+
/**
|
|
7390
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7391
|
+
* header name.
|
|
7392
|
+
*/
|
|
7393
|
+
customHeaders?: Record<string, string>;
|
|
7394
|
+
/**
|
|
7395
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7396
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7397
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7398
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7399
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7400
|
+
*/
|
|
7401
|
+
signingSecret?: string;
|
|
7402
|
+
}
|
|
7403
|
+
/** NotificationChannel create request. */
|
|
7404
|
+
export interface CreateNotificationChannelRequestInput {
|
|
7405
|
+
/**
|
|
7406
|
+
* Display name of the resource.
|
|
7407
|
+
*
|
|
7408
|
+
* Between 1 and 256 characters.
|
|
7409
|
+
*/
|
|
7410
|
+
name: string;
|
|
7411
|
+
labels?: Labels;
|
|
7412
|
+
/** The type of the channel. Immutable after creation. */
|
|
7413
|
+
type: 'webhook';
|
|
7414
|
+
/**
|
|
7415
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7416
|
+
* events.
|
|
7417
|
+
*/
|
|
7418
|
+
disabled?: boolean;
|
|
7419
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7420
|
+
url: string;
|
|
7421
|
+
/**
|
|
7422
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7423
|
+
* header name.
|
|
7424
|
+
*/
|
|
7425
|
+
customHeaders?: Record<string, string>;
|
|
7426
|
+
/**
|
|
7427
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7428
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7429
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7430
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7431
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7432
|
+
*/
|
|
7433
|
+
signingSecret?: string;
|
|
7434
|
+
}
|
|
7435
|
+
/**
|
|
7436
|
+
* Request body for updating a notification channel. Updates replace the channel's
|
|
7437
|
+
* mutable state rather than merging it: `type`, `name`, and `url` must always be
|
|
7438
|
+
* provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to
|
|
7439
|
+
* their defaults (enabled, no labels, no custom headers). `signing_secret` is the
|
|
7440
|
+
* one exception: omitting it keeps the channel's current signing secret instead of
|
|
7441
|
+
* clearing the credential.
|
|
7442
|
+
*/
|
|
7443
|
+
export interface UpdateNotificationChannelRequestInput {
|
|
7444
|
+
/**
|
|
7445
|
+
* Display name of the resource.
|
|
7446
|
+
*
|
|
7447
|
+
* Between 1 and 256 characters.
|
|
7448
|
+
*/
|
|
7449
|
+
name: string;
|
|
7450
|
+
/** The type of the channel. Immutable after creation. */
|
|
7451
|
+
type: 'webhook';
|
|
7452
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7453
|
+
url: string;
|
|
7454
|
+
labels?: Labels;
|
|
7455
|
+
/**
|
|
7456
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7457
|
+
* events.
|
|
7458
|
+
*/
|
|
7459
|
+
disabled?: boolean;
|
|
7460
|
+
/**
|
|
7461
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7462
|
+
* header name.
|
|
7463
|
+
*/
|
|
7464
|
+
customHeaders?: Record<string, string>;
|
|
7465
|
+
/**
|
|
7466
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7467
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7468
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7469
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7470
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7471
|
+
*/
|
|
7472
|
+
signingSecret?: string;
|
|
7473
|
+
}
|
|
7230
7474
|
/** An ingested metering event with ingestion metadata. */
|
|
7231
7475
|
export interface IngestedEventInput {
|
|
7232
7476
|
/** The original event ingested. */
|
|
@@ -7423,6 +7667,11 @@ export interface UpdateBillingInvoiceWorkflowInput {
|
|
|
7423
7667
|
/** Payment settings for this invoice. */
|
|
7424
7668
|
payment?: UpdateBillingWorkflowPaymentSettingsInput;
|
|
7425
7669
|
}
|
|
7670
|
+
/** Page paginated response. */
|
|
7671
|
+
export interface NotificationChannelPagePaginatedResponseInput {
|
|
7672
|
+
data: NotificationChannelInput[];
|
|
7673
|
+
meta: PaginatedMeta;
|
|
7674
|
+
}
|
|
7426
7675
|
/** Purchase and payment terms of the grant. */
|
|
7427
7676
|
export interface CreateCreditGrantPurchaseInput {
|
|
7428
7677
|
/**
|