@openmeter/sdk 1.0.0-beta-30b7a9c5b75f → 1.0.0-beta-b904a10a1f3d

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.
@@ -113,36 +113,152 @@ export declare class NotificationRules {
113
113
  * @param signal - An optional abort signal
114
114
  * @returns The created rule
115
115
  */
116
- create(rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<{
117
- readonly createdAt: Date;
118
- readonly updatedAt: Date;
119
- readonly deletedAt?: Date;
120
- readonly id: string;
121
- type: "entitlements.balance.threshold";
122
- name: string;
123
- disabled?: boolean;
124
- channels: import("./schemas.cjs").components["schemas"]["NotificationChannelMeta"][];
125
- thresholds: import("./schemas.cjs").components["schemas"]["NotificationRuleBalanceThresholdValue"][];
126
- features?: import("./schemas.cjs").components["schemas"]["FeatureMeta"][];
127
- }>;
116
+ create(rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
117
+ 201: {
118
+ headers: {
119
+ [name: string]: unknown;
120
+ };
121
+ content: {
122
+ "application/json": import("./schemas.cjs").components["schemas"]["NotificationRule"];
123
+ };
124
+ };
125
+ 400: {
126
+ headers: {
127
+ [name: string]: unknown;
128
+ };
129
+ content: {
130
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
131
+ };
132
+ };
133
+ 401: {
134
+ headers: {
135
+ [name: string]: unknown;
136
+ };
137
+ content: {
138
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
139
+ };
140
+ };
141
+ 403: {
142
+ headers: {
143
+ [name: string]: unknown;
144
+ };
145
+ content: {
146
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
147
+ };
148
+ };
149
+ 412: {
150
+ headers: {
151
+ [name: string]: unknown;
152
+ };
153
+ content: {
154
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
155
+ };
156
+ };
157
+ 500: {
158
+ headers: {
159
+ [name: string]: unknown;
160
+ };
161
+ content: {
162
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
163
+ };
164
+ };
165
+ 503: {
166
+ headers: {
167
+ [name: string]: unknown;
168
+ };
169
+ content: {
170
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
171
+ };
172
+ };
173
+ default: {
174
+ headers: {
175
+ [name: string]: unknown;
176
+ };
177
+ content: {
178
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
179
+ };
180
+ };
181
+ }, `${string}/${string}`>>;
128
182
  /**
129
183
  * Get a notification rule by ID
130
184
  * @param id - The ID of the notification rule
131
185
  * @param signal - An optional abort signal
132
186
  * @returns The notification rule
133
187
  */
134
- get(id: operations['getNotificationRule']['parameters']['path']['ruleId'], options?: RequestOptions): Promise<{
135
- readonly createdAt: Date;
136
- readonly updatedAt: Date;
137
- readonly deletedAt?: Date;
138
- readonly id: string;
139
- type: "entitlements.balance.threshold";
140
- name: string;
141
- disabled?: boolean;
142
- channels: import("./schemas.cjs").components["schemas"]["NotificationChannelMeta"][];
143
- thresholds: import("./schemas.cjs").components["schemas"]["NotificationRuleBalanceThresholdValue"][];
144
- features?: import("./schemas.cjs").components["schemas"]["FeatureMeta"][];
145
- }>;
188
+ get(id: operations['getNotificationRule']['parameters']['path']['ruleId'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
189
+ 200: {
190
+ headers: {
191
+ [name: string]: unknown;
192
+ };
193
+ content: {
194
+ "application/json": import("./schemas.cjs").components["schemas"]["NotificationRule"];
195
+ };
196
+ };
197
+ 400: {
198
+ headers: {
199
+ [name: string]: unknown;
200
+ };
201
+ content: {
202
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
203
+ };
204
+ };
205
+ 401: {
206
+ headers: {
207
+ [name: string]: unknown;
208
+ };
209
+ content: {
210
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
211
+ };
212
+ };
213
+ 403: {
214
+ headers: {
215
+ [name: string]: unknown;
216
+ };
217
+ content: {
218
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
219
+ };
220
+ };
221
+ 404: {
222
+ headers: {
223
+ [name: string]: unknown;
224
+ };
225
+ content: {
226
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
227
+ };
228
+ };
229
+ 412: {
230
+ headers: {
231
+ [name: string]: unknown;
232
+ };
233
+ content: {
234
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
235
+ };
236
+ };
237
+ 500: {
238
+ headers: {
239
+ [name: string]: unknown;
240
+ };
241
+ content: {
242
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
243
+ };
244
+ };
245
+ 503: {
246
+ headers: {
247
+ [name: string]: unknown;
248
+ };
249
+ content: {
250
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
251
+ };
252
+ };
253
+ default: {
254
+ headers: {
255
+ [name: string]: unknown;
256
+ };
257
+ content: {
258
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
259
+ };
260
+ };
261
+ }, `${string}/${string}`>>;
146
262
  /**
147
263
  * Update a notification rule
148
264
  * @param id - The ID of the notification rule
@@ -150,18 +266,80 @@ export declare class NotificationRules {
150
266
  * @param signal - An optional abort signal
151
267
  * @returns The updated rule
152
268
  */
153
- update(id: operations['updateNotificationRule']['parameters']['path']['ruleId'], rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<{
154
- readonly createdAt: Date;
155
- readonly updatedAt: Date;
156
- readonly deletedAt?: Date;
157
- readonly id: string;
158
- type: "entitlements.balance.threshold";
159
- name: string;
160
- disabled?: boolean;
161
- channels: import("./schemas.cjs").components["schemas"]["NotificationChannelMeta"][];
162
- thresholds: import("./schemas.cjs").components["schemas"]["NotificationRuleBalanceThresholdValue"][];
163
- features?: import("./schemas.cjs").components["schemas"]["FeatureMeta"][];
164
- }>;
269
+ update(id: operations['updateNotificationRule']['parameters']['path']['ruleId'], rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
270
+ 200: {
271
+ headers: {
272
+ [name: string]: unknown;
273
+ };
274
+ content: {
275
+ "application/json": import("./schemas.cjs").components["schemas"]["NotificationRule"];
276
+ };
277
+ };
278
+ 400: {
279
+ headers: {
280
+ [name: string]: unknown;
281
+ };
282
+ content: {
283
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
284
+ };
285
+ };
286
+ 401: {
287
+ headers: {
288
+ [name: string]: unknown;
289
+ };
290
+ content: {
291
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
292
+ };
293
+ };
294
+ 403: {
295
+ headers: {
296
+ [name: string]: unknown;
297
+ };
298
+ content: {
299
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
300
+ };
301
+ };
302
+ 404: {
303
+ headers: {
304
+ [name: string]: unknown;
305
+ };
306
+ content: {
307
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
308
+ };
309
+ };
310
+ 412: {
311
+ headers: {
312
+ [name: string]: unknown;
313
+ };
314
+ content: {
315
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
316
+ };
317
+ };
318
+ 500: {
319
+ headers: {
320
+ [name: string]: unknown;
321
+ };
322
+ content: {
323
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
324
+ };
325
+ };
326
+ 503: {
327
+ headers: {
328
+ [name: string]: unknown;
329
+ };
330
+ content: {
331
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
332
+ };
333
+ };
334
+ default: {
335
+ headers: {
336
+ [name: string]: unknown;
337
+ };
338
+ content: {
339
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnexpectedProblemResponse"];
340
+ };
341
+ };
342
+ }, `${string}/${string}`>>;
165
343
  /**
166
344
  * List notification rules
167
345
  * @param query - The query parameters
@@ -6900,11 +6900,10 @@ export interface components {
6900
6900
  */
6901
6901
  readonly id: string;
6902
6902
  /**
6903
- * Notification Event Type
6904
- * @description Type of the notification event.
6903
+ * @description Type of the notification event. (enum property replaced by openapi-typescript)
6905
6904
  * @enum {string}
6906
6905
  */
6907
- readonly type: 'entitlements.balance.threshold';
6906
+ type: 'entitlements.balance.threshold';
6908
6907
  /**
6909
6908
  * Creation Time
6910
6909
  * Format: date-time
@@ -6963,6 +6962,58 @@ export interface components {
6963
6962
  * @enum {string}
6964
6963
  */
6965
6964
  NotificationEventDeliveryStatusState: 'SUCCESS' | 'FAILED' | 'SENDING' | 'PENDING';
6965
+ /** @description Payload for notification event with `invoice.created` type. */
6966
+ NotificationEventInvoiceCreatedPayload: {
6967
+ /**
6968
+ * Notification Event Identifier
6969
+ * @description A unique identifier for the notification event the payload belongs to.
6970
+ * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
6971
+ */
6972
+ readonly id: string;
6973
+ /**
6974
+ * @description Type of the notification event. (enum property replaced by openapi-typescript)
6975
+ * @enum {string}
6976
+ */
6977
+ type: 'invoice.created';
6978
+ /**
6979
+ * Creation Time
6980
+ * Format: date-time
6981
+ * @description Timestamp when the notification event was created in RFC 3339 format.
6982
+ * @example 2023-01-01T01:01:01.001Z
6983
+ */
6984
+ readonly timestamp: Date;
6985
+ /**
6986
+ * Payload Data
6987
+ * @description The data of the payload.
6988
+ */
6989
+ readonly data: components['schemas']['Invoice'];
6990
+ };
6991
+ /** @description Payload for notification event with `invoice.updated` type. */
6992
+ NotificationEventInvoiceUpdatedPayload: {
6993
+ /**
6994
+ * Notification Event Identifier
6995
+ * @description A unique identifier for the notification event the payload belongs to.
6996
+ * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
6997
+ */
6998
+ readonly id: string;
6999
+ /**
7000
+ * @description Type of the notification event. (enum property replaced by openapi-typescript)
7001
+ * @enum {string}
7002
+ */
7003
+ type: 'invoice.updated';
7004
+ /**
7005
+ * Creation Time
7006
+ * Format: date-time
7007
+ * @description Timestamp when the notification event was created in RFC 3339 format.
7008
+ * @example 2023-01-01T01:01:01.001Z
7009
+ */
7010
+ readonly timestamp: Date;
7011
+ /**
7012
+ * Payload Data
7013
+ * @description The data of the payload.
7014
+ */
7015
+ readonly data: components['schemas']['Invoice'];
7016
+ };
6966
7017
  /**
6967
7018
  * @description Order by options for notification channels.
6968
7019
  * @enum {string}
@@ -6989,14 +7040,14 @@ export interface components {
6989
7040
  items: components['schemas']['NotificationEvent'][];
6990
7041
  };
6991
7042
  /** @description The delivery status of the notification event. */
6992
- NotificationEventPayload: components['schemas']['NotificationEventBalanceThresholdPayload'];
7043
+ NotificationEventPayload: components['schemas']['NotificationEventBalanceThresholdPayload'] | components['schemas']['NotificationEventInvoiceCreatedPayload'] | components['schemas']['NotificationEventInvoiceUpdatedPayload'];
6993
7044
  /**
6994
7045
  * @description Type of the notification event.
6995
7046
  * @enum {string}
6996
7047
  */
6997
- NotificationEventType: 'entitlements.balance.threshold';
7048
+ NotificationEventType: 'entitlements.balance.threshold' | 'invoice.created' | 'invoice.updated';
6998
7049
  /** @description Notification Rule. */
6999
- NotificationRule: components['schemas']['NotificationRuleBalanceThreshold'];
7050
+ NotificationRule: components['schemas']['NotificationRuleBalanceThreshold'] | components['schemas']['NotificationRuleInvoiceCreated'] | components['schemas']['NotificationRuleInvoiceUpdated'];
7000
7051
  /** @description Notification rule with entitlements.balance.threshold type. */
7001
7052
  NotificationRuleBalanceThreshold: {
7002
7053
  /**
@@ -7027,8 +7078,7 @@ export interface components {
7027
7078
  */
7028
7079
  readonly id: string;
7029
7080
  /**
7030
- * Rule Type
7031
- * @description Notification rule type.
7081
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7032
7082
  * @enum {string}
7033
7083
  */
7034
7084
  type: 'entitlements.balance.threshold';
@@ -7061,11 +7111,10 @@ export interface components {
7061
7111
  */
7062
7112
  features?: components['schemas']['FeatureMeta'][];
7063
7113
  };
7064
- /** @description Request with input parameters for creating new notification rule with entitlements.balance.threashold type. */
7114
+ /** @description Request with input parameters for creating new notification rule with entitlements.balance.threshold type. */
7065
7115
  NotificationRuleBalanceThresholdCreateRequest: {
7066
7116
  /**
7067
- * Rule Type
7068
- * @description Notification rule type.
7117
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7069
7118
  * @enum {string}
7070
7119
  */
7071
7120
  type: 'entitlements.balance.threshold';
@@ -7120,7 +7169,165 @@ export interface components {
7120
7169
  */
7121
7170
  NotificationRuleBalanceThresholdValueType: 'PERCENT' | 'NUMBER';
7122
7171
  /** @description Union type for requests creating new notification rule with certain type. */
7123
- NotificationRuleCreateRequest: components['schemas']['NotificationRuleBalanceThresholdCreateRequest'];
7172
+ NotificationRuleCreateRequest: components['schemas']['NotificationRuleBalanceThresholdCreateRequest'] | components['schemas']['NotificationRuleInvoiceCreatedCreateRequest'] | components['schemas']['NotificationRuleInvoiceUpdatedCreateRequest'];
7173
+ /** @description Notification rule with invoice.created type. */
7174
+ NotificationRuleInvoiceCreated: {
7175
+ /**
7176
+ * Creation Time
7177
+ * Format: date-time
7178
+ * @description Timestamp of when the resource was created.
7179
+ * @example 2024-01-01T01:01:01.001Z
7180
+ */
7181
+ readonly createdAt: Date;
7182
+ /**
7183
+ * Last Update Time
7184
+ * Format: date-time
7185
+ * @description Timestamp of when the resource was last updated.
7186
+ * @example 2024-01-01T01:01:01.001Z
7187
+ */
7188
+ readonly updatedAt: Date;
7189
+ /**
7190
+ * Deletion Time
7191
+ * Format: date-time
7192
+ * @description Timestamp of when the resource was permanently deleted.
7193
+ * @example 2024-01-01T01:01:01.001Z
7194
+ */
7195
+ readonly deletedAt?: Date;
7196
+ /**
7197
+ * Rule Unique Identifier
7198
+ * @description Identifies the notification rule.
7199
+ * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
7200
+ */
7201
+ readonly id: string;
7202
+ /**
7203
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7204
+ * @enum {string}
7205
+ */
7206
+ type: 'invoice.created';
7207
+ /**
7208
+ * Rule Name
7209
+ * @description The user friendly name of the notification rule.
7210
+ * @example Balance threshold reached
7211
+ */
7212
+ name: string;
7213
+ /**
7214
+ * Rule Disabled
7215
+ * @description Whether the rule is disabled or not.
7216
+ * @default false
7217
+ * @example true
7218
+ */
7219
+ disabled?: boolean;
7220
+ /**
7221
+ * Channels assigned to Rule
7222
+ * @description List of notification channels the rule applies to.
7223
+ */
7224
+ channels: components['schemas']['NotificationChannelMeta'][];
7225
+ };
7226
+ /** @description Request with input parameters for creating new notification rule with invoice.created type. */
7227
+ NotificationRuleInvoiceCreatedCreateRequest: {
7228
+ /**
7229
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7230
+ * @enum {string}
7231
+ */
7232
+ type: 'invoice.created';
7233
+ /**
7234
+ * Rule Name
7235
+ * @description The user friendly name of the notification rule.
7236
+ * @example Balance threshold reached
7237
+ */
7238
+ name: string;
7239
+ /**
7240
+ * Rule Disabled
7241
+ * @description Whether the rule is disabled or not.
7242
+ * @default false
7243
+ * @example true
7244
+ */
7245
+ disabled?: boolean;
7246
+ /**
7247
+ * Channels
7248
+ * @description List of notification channels the rule is applied to.
7249
+ */
7250
+ channels: string[];
7251
+ };
7252
+ /** @description Notification rule with invoice.updated type. */
7253
+ NotificationRuleInvoiceUpdated: {
7254
+ /**
7255
+ * Creation Time
7256
+ * Format: date-time
7257
+ * @description Timestamp of when the resource was created.
7258
+ * @example 2024-01-01T01:01:01.001Z
7259
+ */
7260
+ readonly createdAt: Date;
7261
+ /**
7262
+ * Last Update Time
7263
+ * Format: date-time
7264
+ * @description Timestamp of when the resource was last updated.
7265
+ * @example 2024-01-01T01:01:01.001Z
7266
+ */
7267
+ readonly updatedAt: Date;
7268
+ /**
7269
+ * Deletion Time
7270
+ * Format: date-time
7271
+ * @description Timestamp of when the resource was permanently deleted.
7272
+ * @example 2024-01-01T01:01:01.001Z
7273
+ */
7274
+ readonly deletedAt?: Date;
7275
+ /**
7276
+ * Rule Unique Identifier
7277
+ * @description Identifies the notification rule.
7278
+ * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
7279
+ */
7280
+ readonly id: string;
7281
+ /**
7282
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7283
+ * @enum {string}
7284
+ */
7285
+ type: 'invoice.updated';
7286
+ /**
7287
+ * Rule Name
7288
+ * @description The user friendly name of the notification rule.
7289
+ * @example Balance threshold reached
7290
+ */
7291
+ name: string;
7292
+ /**
7293
+ * Rule Disabled
7294
+ * @description Whether the rule is disabled or not.
7295
+ * @default false
7296
+ * @example true
7297
+ */
7298
+ disabled?: boolean;
7299
+ /**
7300
+ * Channels assigned to Rule
7301
+ * @description List of notification channels the rule applies to.
7302
+ */
7303
+ channels: components['schemas']['NotificationChannelMeta'][];
7304
+ };
7305
+ /** @description Request with input parameters for creating new notification rule with invoice.updated type. */
7306
+ NotificationRuleInvoiceUpdatedCreateRequest: {
7307
+ /**
7308
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7309
+ * @enum {string}
7310
+ */
7311
+ type: 'invoice.updated';
7312
+ /**
7313
+ * Rule Name
7314
+ * @description The user friendly name of the notification rule.
7315
+ * @example Balance threshold reached
7316
+ */
7317
+ name: string;
7318
+ /**
7319
+ * Rule Disabled
7320
+ * @description Whether the rule is disabled or not.
7321
+ * @default false
7322
+ * @example true
7323
+ */
7324
+ disabled?: boolean;
7325
+ /**
7326
+ * Channels
7327
+ * @description List of notification channels the rule is applied to.
7328
+ */
7329
+ channels: string[];
7330
+ };
7124
7331
  /**
7125
7332
  * @description Order by options for notification channels.
7126
7333
  * @enum {string}
@@ -9924,6 +10131,8 @@ export type NotificationEventBalanceThresholdPayload = components['schemas']['No
9924
10131
  export type NotificationEventBalanceThresholdPayloadData = components['schemas']['NotificationEventBalanceThresholdPayloadData'];
9925
10132
  export type NotificationEventDeliveryStatus = components['schemas']['NotificationEventDeliveryStatus'];
9926
10133
  export type NotificationEventDeliveryStatusState = components['schemas']['NotificationEventDeliveryStatusState'];
10134
+ export type NotificationEventInvoiceCreatedPayload = components['schemas']['NotificationEventInvoiceCreatedPayload'];
10135
+ export type NotificationEventInvoiceUpdatedPayload = components['schemas']['NotificationEventInvoiceUpdatedPayload'];
9927
10136
  export type NotificationEventOrderBy = components['schemas']['NotificationEventOrderBy'];
9928
10137
  export type NotificationEventPaginatedResponse = components['schemas']['NotificationEventPaginatedResponse'];
9929
10138
  export type NotificationEventPayload = components['schemas']['NotificationEventPayload'];
@@ -9934,6 +10143,10 @@ export type NotificationRuleBalanceThresholdCreateRequest = components['schemas'
9934
10143
  export type NotificationRuleBalanceThresholdValue = components['schemas']['NotificationRuleBalanceThresholdValue'];
9935
10144
  export type NotificationRuleBalanceThresholdValueType = components['schemas']['NotificationRuleBalanceThresholdValueType'];
9936
10145
  export type NotificationRuleCreateRequest = components['schemas']['NotificationRuleCreateRequest'];
10146
+ export type NotificationRuleInvoiceCreated = components['schemas']['NotificationRuleInvoiceCreated'];
10147
+ export type NotificationRuleInvoiceCreatedCreateRequest = components['schemas']['NotificationRuleInvoiceCreatedCreateRequest'];
10148
+ export type NotificationRuleInvoiceUpdated = components['schemas']['NotificationRuleInvoiceUpdated'];
10149
+ export type NotificationRuleInvoiceUpdatedCreateRequest = components['schemas']['NotificationRuleInvoiceUpdatedCreateRequest'];
9937
10150
  export type NotificationRuleOrderBy = components['schemas']['NotificationRuleOrderBy'];
9938
10151
  export type NotificationRulePaginatedResponse = components['schemas']['NotificationRulePaginatedResponse'];
9939
10152
  export type Numeric = components['schemas']['Numeric'];