@openmeter/sdk 1.0.0-beta.99 → 1.0.0-beta-9958c9245841

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.
Files changed (203) hide show
  1. package/Makefile +43 -0
  2. package/README.md +232 -137
  3. package/biome.json +67 -0
  4. package/dist/cjs/index.cjs +15 -21
  5. package/dist/cjs/index.d.cts +1 -15
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/cjs/src/client/addons.cjs +105 -0
  8. package/dist/cjs/src/client/addons.d.cts +152 -0
  9. package/dist/cjs/src/client/addons.js.map +1 -0
  10. package/dist/cjs/src/client/apps.cjs +247 -0
  11. package/dist/cjs/src/client/apps.d.cts +327 -0
  12. package/dist/cjs/src/client/apps.js.map +1 -0
  13. package/dist/cjs/src/client/billing.cjs +375 -0
  14. package/dist/cjs/src/client/billing.d.cts +563 -0
  15. package/dist/cjs/src/client/billing.js.map +1 -0
  16. package/dist/cjs/src/client/common.cjs +47 -0
  17. package/dist/cjs/src/client/common.d.cts +30 -0
  18. package/dist/cjs/src/client/common.js.map +1 -0
  19. package/dist/cjs/src/client/customers.cjs +469 -0
  20. package/dist/cjs/src/client/customers.d.cts +617 -0
  21. package/dist/cjs/src/client/customers.js.map +1 -0
  22. package/dist/cjs/src/client/debug.cjs +27 -0
  23. package/dist/cjs/src/client/debug.d.cts +17 -0
  24. package/dist/cjs/src/client/debug.js.map +1 -0
  25. package/dist/cjs/src/client/entitlements.cjs +372 -0
  26. package/dist/cjs/src/client/entitlements.d.cts +670 -0
  27. package/dist/cjs/src/client/entitlements.js.map +1 -0
  28. package/dist/cjs/src/client/events.cjs +113 -0
  29. package/dist/cjs/src/client/events.d.cts +48 -0
  30. package/dist/cjs/src/client/events.js.map +1 -0
  31. package/dist/cjs/src/client/features.cjs +78 -0
  32. package/dist/cjs/src/client/features.d.cts +87 -0
  33. package/dist/cjs/src/client/features.js.map +1 -0
  34. package/dist/cjs/src/client/index.cjs +122 -0
  35. package/dist/cjs/src/client/index.d.cts +54 -0
  36. package/dist/cjs/src/client/index.js.map +1 -0
  37. package/dist/cjs/src/client/info.cjs +42 -0
  38. package/dist/cjs/src/client/info.d.cts +34 -0
  39. package/dist/cjs/src/client/info.js.map +1 -0
  40. package/dist/cjs/src/client/meters.cjs +160 -0
  41. package/dist/cjs/src/client/meters.d.cts +151 -0
  42. package/dist/cjs/src/client/meters.js.map +1 -0
  43. package/dist/cjs/src/client/notifications.cjs +269 -0
  44. package/dist/cjs/src/client/notifications.d.cts +412 -0
  45. package/dist/cjs/src/client/notifications.js.map +1 -0
  46. package/dist/cjs/src/client/plans.cjs +204 -0
  47. package/dist/cjs/src/client/plans.d.cts +247 -0
  48. package/dist/cjs/src/client/plans.js.map +1 -0
  49. package/dist/cjs/src/client/portal.cjs +55 -0
  50. package/dist/cjs/src/client/portal.d.cts +48 -0
  51. package/dist/cjs/src/client/portal.js.map +1 -0
  52. package/dist/cjs/src/client/schemas.cjs +3 -0
  53. package/dist/cjs/src/client/schemas.d.cts +27081 -0
  54. package/dist/cjs/src/client/schemas.js.map +1 -0
  55. package/dist/cjs/src/client/subjects.cjs +76 -0
  56. package/dist/cjs/src/client/subjects.d.cts +79 -0
  57. package/dist/cjs/src/client/subjects.js.map +1 -0
  58. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  59. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  60. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  61. package/dist/cjs/src/client/subscriptions.cjs +132 -0
  62. package/dist/cjs/src/client/subscriptions.d.cts +175 -0
  63. package/dist/cjs/src/client/subscriptions.js.map +1 -0
  64. package/dist/cjs/src/client/utils.cjs +67 -0
  65. package/dist/cjs/src/client/utils.d.cts +12 -0
  66. package/dist/cjs/src/client/utils.js.map +1 -0
  67. package/dist/cjs/src/portal/index.cjs +89 -0
  68. package/dist/cjs/src/portal/index.d.cts +43 -0
  69. package/dist/cjs/src/portal/index.js.map +1 -0
  70. package/dist/cjs/src/react/context.cjs +35 -0
  71. package/dist/cjs/src/react/context.d.cts +9 -0
  72. package/dist/cjs/src/react/context.js.map +1 -0
  73. package/dist/cjs/src/zod/index.cjs +13102 -0
  74. package/dist/cjs/src/zod/index.d.cts +20044 -0
  75. package/dist/cjs/src/zod/index.js.map +1 -0
  76. package/dist/cjs/tsconfig.0781fa96.tsbuildinfo +1 -0
  77. package/dist/cjs/tsconfig.6c95ff08.tsbuildinfo +1 -0
  78. package/dist/index.d.ts +1 -15
  79. package/dist/index.js +1 -17
  80. package/dist/index.js.map +1 -1
  81. package/dist/src/client/addons.d.ts +152 -0
  82. package/dist/src/client/addons.js +101 -0
  83. package/dist/src/client/addons.js.map +1 -0
  84. package/dist/src/client/apps.d.ts +327 -0
  85. package/dist/src/client/apps.js +240 -0
  86. package/dist/src/client/apps.js.map +1 -0
  87. package/dist/src/client/billing.d.ts +563 -0
  88. package/dist/src/client/billing.js +368 -0
  89. package/dist/src/client/billing.js.map +1 -0
  90. package/dist/src/client/common.d.ts +30 -0
  91. package/dist/src/client/common.js +42 -0
  92. package/dist/src/client/common.js.map +1 -0
  93. package/dist/src/client/customers.d.ts +617 -0
  94. package/dist/src/client/customers.js +461 -0
  95. package/dist/src/client/customers.js.map +1 -0
  96. package/dist/src/client/debug.d.ts +17 -0
  97. package/dist/src/client/debug.js +23 -0
  98. package/dist/src/client/debug.js.map +1 -0
  99. package/dist/src/client/entitlements.d.ts +670 -0
  100. package/dist/src/client/entitlements.js +365 -0
  101. package/dist/src/client/entitlements.js.map +1 -0
  102. package/dist/src/client/events.d.ts +48 -0
  103. package/dist/src/client/events.js +108 -0
  104. package/dist/src/client/events.js.map +1 -0
  105. package/dist/src/client/features.d.ts +87 -0
  106. package/dist/src/client/features.js +74 -0
  107. package/dist/src/client/features.js.map +1 -0
  108. package/dist/src/client/index.d.ts +54 -0
  109. package/dist/src/client/index.js +82 -0
  110. package/dist/src/client/index.js.map +1 -0
  111. package/dist/src/client/info.d.ts +34 -0
  112. package/dist/src/client/info.js +38 -0
  113. package/dist/src/client/info.js.map +1 -0
  114. package/dist/src/client/meters.d.ts +151 -0
  115. package/dist/src/client/meters.js +156 -0
  116. package/dist/src/client/meters.js.map +1 -0
  117. package/dist/src/client/notifications.d.ts +412 -0
  118. package/dist/src/client/notifications.js +262 -0
  119. package/dist/src/client/notifications.js.map +1 -0
  120. package/dist/src/client/plans.d.ts +247 -0
  121. package/dist/src/client/plans.js +199 -0
  122. package/dist/src/client/plans.js.map +1 -0
  123. package/dist/src/client/portal.d.ts +48 -0
  124. package/dist/src/client/portal.js +51 -0
  125. package/dist/src/client/portal.js.map +1 -0
  126. package/dist/src/client/schemas.d.ts +27081 -0
  127. package/dist/src/client/schemas.js +2 -0
  128. package/dist/src/client/schemas.js.map +1 -0
  129. package/dist/src/client/subjects.d.ts +79 -0
  130. package/dist/src/client/subjects.js +72 -0
  131. package/dist/src/client/subjects.js.map +1 -0
  132. package/dist/src/client/subscription-addons.d.ts +123 -0
  133. package/dist/src/client/subscription-addons.js +66 -0
  134. package/dist/src/client/subscription-addons.js.map +1 -0
  135. package/dist/src/client/subscriptions.d.ts +175 -0
  136. package/dist/src/client/subscriptions.js +128 -0
  137. package/dist/src/client/subscriptions.js.map +1 -0
  138. package/dist/src/client/utils.d.ts +12 -0
  139. package/dist/src/client/utils.js +61 -0
  140. package/dist/src/client/utils.js.map +1 -0
  141. package/dist/src/portal/index.d.ts +43 -0
  142. package/dist/src/portal/index.js +52 -0
  143. package/dist/src/portal/index.js.map +1 -0
  144. package/dist/src/react/context.d.ts +9 -0
  145. package/dist/src/react/context.js +16 -0
  146. package/dist/src/react/context.js.map +1 -0
  147. package/dist/src/zod/index.d.ts +20044 -0
  148. package/dist/src/zod/index.js +13071 -0
  149. package/dist/src/zod/index.js.map +1 -0
  150. package/dist/tsconfig.tsbuildinfo +1 -1
  151. package/orval.config.ts +38 -0
  152. package/package.json +62 -32
  153. package/patches/openapi-typescript.patch +6194 -0
  154. package/dist/cjs/clients/client.cjs +0 -117
  155. package/dist/cjs/clients/client.d.cts +0 -40
  156. package/dist/cjs/clients/client.js.map +0 -1
  157. package/dist/cjs/clients/event.cjs +0 -71
  158. package/dist/cjs/clients/event.d.cts +0 -79
  159. package/dist/cjs/clients/event.js.map +0 -1
  160. package/dist/cjs/clients/meter.cjs +0 -69
  161. package/dist/cjs/clients/meter.d.cts +0 -75
  162. package/dist/cjs/clients/meter.js.map +0 -1
  163. package/dist/cjs/clients/portal.cjs +0 -41
  164. package/dist/cjs/clients/portal.d.cts +0 -22
  165. package/dist/cjs/clients/portal.js.map +0 -1
  166. package/dist/cjs/clients/subject.cjs +0 -60
  167. package/dist/cjs/clients/subject.d.cts +0 -27
  168. package/dist/cjs/clients/subject.js.map +0 -1
  169. package/dist/cjs/schemas/openapi.cjs +0 -7
  170. package/dist/cjs/schemas/openapi.d.cts +0 -2078
  171. package/dist/cjs/schemas/openapi.js.map +0 -1
  172. package/dist/cjs/test/agent.cjs +0 -266
  173. package/dist/cjs/test/agent.d.cts +0 -2
  174. package/dist/cjs/test/agent.js.map +0 -1
  175. package/dist/cjs/test/mocks.cjs +0 -44
  176. package/dist/cjs/test/mocks.d.cts +0 -14
  177. package/dist/cjs/test/mocks.js.map +0 -1
  178. package/dist/cjs/tsconfig.8be50ffd.tsbuildinfo +0 -1
  179. package/dist/cjs/tsconfig.9c9b19d3.tsbuildinfo +0 -1
  180. package/dist/clients/client.d.ts +0 -40
  181. package/dist/clients/client.js +0 -112
  182. package/dist/clients/client.js.map +0 -1
  183. package/dist/clients/event.d.ts +0 -79
  184. package/dist/clients/event.js +0 -64
  185. package/dist/clients/event.js.map +0 -1
  186. package/dist/clients/meter.d.ts +0 -75
  187. package/dist/clients/meter.js +0 -65
  188. package/dist/clients/meter.js.map +0 -1
  189. package/dist/clients/portal.d.ts +0 -22
  190. package/dist/clients/portal.js +0 -37
  191. package/dist/clients/portal.js.map +0 -1
  192. package/dist/clients/subject.d.ts +0 -27
  193. package/dist/clients/subject.js +0 -56
  194. package/dist/clients/subject.js.map +0 -1
  195. package/dist/schemas/openapi.d.ts +0 -2078
  196. package/dist/schemas/openapi.js +0 -6
  197. package/dist/schemas/openapi.js.map +0 -1
  198. package/dist/test/agent.d.ts +0 -2
  199. package/dist/test/agent.js +0 -263
  200. package/dist/test/agent.js.map +0 -1
  201. package/dist/test/mocks.d.ts +0 -14
  202. package/dist/test/mocks.js +0 -41
  203. package/dist/test/mocks.js.map +0 -1
@@ -0,0 +1,412 @@
1
+ import type { Client } from 'openapi-fetch';
2
+ import type { RequestOptions } from './common.js';
3
+ import type { NotificationChannel, NotificationRuleCreateRequest, operations, paths } from './schemas.js';
4
+ /**
5
+ * Notifications
6
+ * @description Notifications provide automated triggers when specific entitlement balances and usage thresholds are reached, ensuring that your customers and sales teams are always informed. Notify customers and internal teams when specific conditions are met, like reaching 75%, 100%, and 150% of their monthly usage allowance.
7
+ */
8
+ export declare class Notifications {
9
+ private client;
10
+ channels: NotificationChannels;
11
+ rules: NotificationRules;
12
+ events: NotificationEvents;
13
+ constructor(client: Client<paths, `${string}/${string}`>);
14
+ }
15
+ /**
16
+ * Notification Channels
17
+ * @description Notification channels are the destinations for notifications.
18
+ */
19
+ export declare class NotificationChannels {
20
+ private client;
21
+ constructor(client: Client<paths, `${string}/${string}`>);
22
+ /**
23
+ * Create a notification channel
24
+ * @param notification - The notification to create
25
+ * @param signal - An optional abort signal
26
+ * @returns The created notification
27
+ */
28
+ create(notification: NotificationChannel, options?: RequestOptions): Promise<{
29
+ readonly createdAt: Date;
30
+ readonly updatedAt: Date;
31
+ readonly deletedAt?: Date;
32
+ readonly id: string;
33
+ type: "WEBHOOK";
34
+ name: string;
35
+ disabled?: boolean;
36
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
37
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
38
+ url: string;
39
+ customHeaders?: {
40
+ [key: string]: string;
41
+ };
42
+ signingSecret?: string;
43
+ } | undefined>;
44
+ /**
45
+ * Get a notification channel by ID
46
+ * @param id - The ID of the notification channel
47
+ * @param signal - An optional abort signal
48
+ * @returns The notification channel
49
+ */
50
+ get(id: operations['getNotificationChannel']['parameters']['path']['channelId'], options?: RequestOptions): Promise<{
51
+ readonly createdAt: Date;
52
+ readonly updatedAt: Date;
53
+ readonly deletedAt?: Date;
54
+ readonly id: string;
55
+ type: "WEBHOOK";
56
+ name: string;
57
+ disabled?: boolean;
58
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
59
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
60
+ url: string;
61
+ customHeaders?: {
62
+ [key: string]: string;
63
+ };
64
+ signingSecret?: string;
65
+ } | undefined>;
66
+ /**
67
+ * Update a notification channel
68
+ * @param id - The ID of the notification channel
69
+ * @param notification - The notification to update
70
+ * @param signal - An optional abort signal
71
+ * @returns The updated notification
72
+ */
73
+ update(id: operations['updateNotificationChannel']['parameters']['path']['channelId'], notification: NotificationChannel, options?: RequestOptions): Promise<{
74
+ readonly createdAt: Date;
75
+ readonly updatedAt: Date;
76
+ readonly deletedAt?: Date;
77
+ readonly id: string;
78
+ type: "WEBHOOK";
79
+ name: string;
80
+ disabled?: boolean;
81
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
82
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
83
+ url: string;
84
+ customHeaders?: {
85
+ [key: string]: string;
86
+ };
87
+ signingSecret?: string;
88
+ } | undefined>;
89
+ /**
90
+ * List notification channels
91
+ * @param query - The query parameters
92
+ * @param signal - An optional abort signal
93
+ * @returns The list of notification channels
94
+ */
95
+ list(query?: operations['listNotificationChannels']['parameters']['query'], options?: RequestOptions): Promise<{
96
+ totalCount: number;
97
+ page: number;
98
+ pageSize: number;
99
+ items: import("./schemas.js").components["schemas"]["NotificationChannel"][];
100
+ } | undefined>;
101
+ /**
102
+ * Delete a notification channel
103
+ * @param id - The ID of the notification channel
104
+ * @param signal - An optional abort signal
105
+ * @returns The deleted notification
106
+ */
107
+ delete(id: operations['deleteNotificationChannel']['parameters']['path']['channelId'], options?: RequestOptions): Promise<undefined>;
108
+ }
109
+ /**
110
+ * Notification Rules
111
+ * @description Notification rules are the conditions that trigger notifications.
112
+ */
113
+ export declare class NotificationRules {
114
+ private client;
115
+ constructor(client: Client<paths, `${string}/${string}`>);
116
+ /**
117
+ * Create a notification rule
118
+ * @param rule - The rule to create
119
+ * @param signal - An optional abort signal
120
+ * @returns The created rule
121
+ */
122
+ create(rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
123
+ 201: {
124
+ headers: {
125
+ [name: string]: unknown;
126
+ };
127
+ content: {
128
+ "application/json": import("./schemas.js").components["schemas"]["NotificationRule"];
129
+ };
130
+ };
131
+ 400: {
132
+ headers: {
133
+ [name: string]: unknown;
134
+ };
135
+ content: {
136
+ "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
137
+ };
138
+ };
139
+ 401: {
140
+ headers: {
141
+ [name: string]: unknown;
142
+ };
143
+ content: {
144
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
145
+ };
146
+ };
147
+ 403: {
148
+ headers: {
149
+ [name: string]: unknown;
150
+ };
151
+ content: {
152
+ "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
153
+ };
154
+ };
155
+ 412: {
156
+ headers: {
157
+ [name: string]: unknown;
158
+ };
159
+ content: {
160
+ "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
161
+ };
162
+ };
163
+ 500: {
164
+ headers: {
165
+ [name: string]: unknown;
166
+ };
167
+ content: {
168
+ "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
169
+ };
170
+ };
171
+ 503: {
172
+ headers: {
173
+ [name: string]: unknown;
174
+ };
175
+ content: {
176
+ "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
177
+ };
178
+ };
179
+ default: {
180
+ headers: {
181
+ [name: string]: unknown;
182
+ };
183
+ content: {
184
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
185
+ };
186
+ };
187
+ }, `${string}/${string}`> | undefined>;
188
+ /**
189
+ * Get a notification rule by ID
190
+ * @param id - The ID of the notification rule
191
+ * @param signal - An optional abort signal
192
+ * @returns The notification rule
193
+ */
194
+ get(id: operations['getNotificationRule']['parameters']['path']['ruleId'], options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
195
+ 200: {
196
+ headers: {
197
+ [name: string]: unknown;
198
+ };
199
+ content: {
200
+ "application/json": import("./schemas.js").components["schemas"]["NotificationRule"];
201
+ };
202
+ };
203
+ 400: {
204
+ headers: {
205
+ [name: string]: unknown;
206
+ };
207
+ content: {
208
+ "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
209
+ };
210
+ };
211
+ 401: {
212
+ headers: {
213
+ [name: string]: unknown;
214
+ };
215
+ content: {
216
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
217
+ };
218
+ };
219
+ 403: {
220
+ headers: {
221
+ [name: string]: unknown;
222
+ };
223
+ content: {
224
+ "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
225
+ };
226
+ };
227
+ 404: {
228
+ headers: {
229
+ [name: string]: unknown;
230
+ };
231
+ content: {
232
+ "application/problem+json": import("./schemas.js").components["schemas"]["NotFoundProblemResponse"];
233
+ };
234
+ };
235
+ 412: {
236
+ headers: {
237
+ [name: string]: unknown;
238
+ };
239
+ content: {
240
+ "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
241
+ };
242
+ };
243
+ 500: {
244
+ headers: {
245
+ [name: string]: unknown;
246
+ };
247
+ content: {
248
+ "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
249
+ };
250
+ };
251
+ 503: {
252
+ headers: {
253
+ [name: string]: unknown;
254
+ };
255
+ content: {
256
+ "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
257
+ };
258
+ };
259
+ default: {
260
+ headers: {
261
+ [name: string]: unknown;
262
+ };
263
+ content: {
264
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
265
+ };
266
+ };
267
+ }, `${string}/${string}`> | undefined>;
268
+ /**
269
+ * Update a notification rule
270
+ * @param id - The ID of the notification rule
271
+ * @param rule - The rule to update
272
+ * @param signal - An optional abort signal
273
+ * @returns The updated rule
274
+ */
275
+ update(id: operations['updateNotificationRule']['parameters']['path']['ruleId'], rule: NotificationRuleCreateRequest, options?: RequestOptions): Promise<import("openapi-typescript-helpers").SuccessResponse<{
276
+ 200: {
277
+ headers: {
278
+ [name: string]: unknown;
279
+ };
280
+ content: {
281
+ "application/json": import("./schemas.js").components["schemas"]["NotificationRule"];
282
+ };
283
+ };
284
+ 400: {
285
+ headers: {
286
+ [name: string]: unknown;
287
+ };
288
+ content: {
289
+ "application/problem+json": import("./schemas.js").components["schemas"]["BadRequestProblemResponse"];
290
+ };
291
+ };
292
+ 401: {
293
+ headers: {
294
+ [name: string]: unknown;
295
+ };
296
+ content: {
297
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnauthorizedProblemResponse"];
298
+ };
299
+ };
300
+ 403: {
301
+ headers: {
302
+ [name: string]: unknown;
303
+ };
304
+ content: {
305
+ "application/problem+json": import("./schemas.js").components["schemas"]["ForbiddenProblemResponse"];
306
+ };
307
+ };
308
+ 404: {
309
+ headers: {
310
+ [name: string]: unknown;
311
+ };
312
+ content: {
313
+ "application/problem+json": import("./schemas.js").components["schemas"]["NotFoundProblemResponse"];
314
+ };
315
+ };
316
+ 412: {
317
+ headers: {
318
+ [name: string]: unknown;
319
+ };
320
+ content: {
321
+ "application/problem+json": import("./schemas.js").components["schemas"]["PreconditionFailedProblemResponse"];
322
+ };
323
+ };
324
+ 500: {
325
+ headers: {
326
+ [name: string]: unknown;
327
+ };
328
+ content: {
329
+ "application/problem+json": import("./schemas.js").components["schemas"]["InternalServerErrorProblemResponse"];
330
+ };
331
+ };
332
+ 503: {
333
+ headers: {
334
+ [name: string]: unknown;
335
+ };
336
+ content: {
337
+ "application/problem+json": import("./schemas.js").components["schemas"]["ServiceUnavailableProblemResponse"];
338
+ };
339
+ };
340
+ default: {
341
+ headers: {
342
+ [name: string]: unknown;
343
+ };
344
+ content: {
345
+ "application/problem+json": import("./schemas.js").components["schemas"]["UnexpectedProblemResponse"];
346
+ };
347
+ };
348
+ }, `${string}/${string}`> | undefined>;
349
+ /**
350
+ * List notification rules
351
+ * @param query - The query parameters
352
+ * @param signal - An optional abort signal
353
+ * @returns The list of notification rules
354
+ */
355
+ list(query?: operations['listNotificationRules']['parameters']['query'], options?: RequestOptions): Promise<{
356
+ totalCount: number;
357
+ page: number;
358
+ pageSize: number;
359
+ items: import("./schemas.js").components["schemas"]["NotificationRule"][];
360
+ } | undefined>;
361
+ /**
362
+ * Delete a notification rule
363
+ * @param id - The ID of the notification rule
364
+ * @param signal - An optional abort signal
365
+ * @returns The deleted notification
366
+ */
367
+ delete(id: operations['deleteNotificationRule']['parameters']['path']['ruleId'], options?: RequestOptions): Promise<undefined>;
368
+ }
369
+ /**
370
+ * Notification Events
371
+ * @description Notification events are the events that trigger notifications.
372
+ */
373
+ export declare class NotificationEvents {
374
+ private client;
375
+ constructor(client: Client<paths, `${string}/${string}`>);
376
+ /**
377
+ * Get a notification event by ID
378
+ * @param id - The ID of the notification event
379
+ * @param signal - An optional abort signal
380
+ * @returns The notification event
381
+ */
382
+ get(id: operations['getNotificationEvent']['parameters']['path']['eventId'], options?: RequestOptions): Promise<{
383
+ readonly id: string;
384
+ readonly type: import("./schemas.js").components["schemas"]["NotificationEventType"];
385
+ readonly createdAt: Date;
386
+ readonly rule: import("./schemas.js").components["schemas"]["NotificationRule"];
387
+ readonly deliveryStatus: import("./schemas.js").components["schemas"]["NotificationEventDeliveryStatus"][];
388
+ readonly payload: import("./schemas.js").components["schemas"]["NotificationEventPayload"];
389
+ readonly annotations?: import("./schemas.js").components["schemas"]["Annotations"];
390
+ } | undefined>;
391
+ /**
392
+ * List notification events
393
+ * @param query - The query parameters
394
+ * @param signal - An optional abort signal
395
+ * @returns The list of notification events
396
+ */
397
+ list(query?: operations['listNotificationEvents']['parameters']['query'], options?: RequestOptions): Promise<{
398
+ totalCount: number;
399
+ page: number;
400
+ pageSize: number;
401
+ items: import("./schemas.js").components["schemas"]["NotificationEvent"][];
402
+ } | undefined>;
403
+ /**
404
+ * Resend a notification event
405
+ * @description Resend a notification event that has already been sent.
406
+ * @param id - The ID of the notification event
407
+ * @param channels - The channels to resend the notification event to, if not provided it will resend to all channels
408
+ * @param signal - An optional abort signal
409
+ * @returns The resent notification event
410
+ */
411
+ resend(id: operations['resendNotificationEvent']['parameters']['path']['eventId'], body?: operations['resendNotificationEvent']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<undefined>;
412
+ }
@@ -0,0 +1,262 @@
1
+ import { transformResponse } from './utils.js';
2
+ /**
3
+ * Notifications
4
+ * @description Notifications provide automated triggers when specific entitlement balances and usage thresholds are reached, ensuring that your customers and sales teams are always informed. Notify customers and internal teams when specific conditions are met, like reaching 75%, 100%, and 150% of their monthly usage allowance.
5
+ */
6
+ export class Notifications {
7
+ client;
8
+ channels;
9
+ rules;
10
+ events;
11
+ constructor(client) {
12
+ this.client = client;
13
+ this.channels = new NotificationChannels(this.client);
14
+ this.rules = new NotificationRules(this.client);
15
+ this.events = new NotificationEvents(this.client);
16
+ }
17
+ }
18
+ /**
19
+ * Notification Channels
20
+ * @description Notification channels are the destinations for notifications.
21
+ */
22
+ export class NotificationChannels {
23
+ client;
24
+ constructor(client) {
25
+ this.client = client;
26
+ }
27
+ /**
28
+ * Create a notification channel
29
+ * @param notification - The notification to create
30
+ * @param signal - An optional abort signal
31
+ * @returns The created notification
32
+ */
33
+ async create(notification, options) {
34
+ const resp = await this.client.POST('/api/v1/notification/channels', {
35
+ body: notification,
36
+ ...options,
37
+ });
38
+ return transformResponse(resp);
39
+ }
40
+ /**
41
+ * Get a notification channel by ID
42
+ * @param id - The ID of the notification channel
43
+ * @param signal - An optional abort signal
44
+ * @returns The notification channel
45
+ */
46
+ async get(id, options) {
47
+ const resp = await this.client.GET('/api/v1/notification/channels/{channelId}', {
48
+ params: {
49
+ path: {
50
+ channelId: id,
51
+ },
52
+ },
53
+ ...options,
54
+ });
55
+ return transformResponse(resp);
56
+ }
57
+ /**
58
+ * Update a notification channel
59
+ * @param id - The ID of the notification channel
60
+ * @param notification - The notification to update
61
+ * @param signal - An optional abort signal
62
+ * @returns The updated notification
63
+ */
64
+ async update(id, notification, options) {
65
+ const resp = await this.client.PUT('/api/v1/notification/channels/{channelId}', {
66
+ body: notification,
67
+ params: {
68
+ path: {
69
+ channelId: id,
70
+ },
71
+ },
72
+ ...options,
73
+ });
74
+ return transformResponse(resp);
75
+ }
76
+ /**
77
+ * List notification channels
78
+ * @param query - The query parameters
79
+ * @param signal - An optional abort signal
80
+ * @returns The list of notification channels
81
+ */
82
+ async list(query, options) {
83
+ const resp = await this.client.GET('/api/v1/notification/channels', {
84
+ params: {
85
+ query,
86
+ },
87
+ ...options,
88
+ });
89
+ return transformResponse(resp);
90
+ }
91
+ /**
92
+ * Delete a notification channel
93
+ * @param id - The ID of the notification channel
94
+ * @param signal - An optional abort signal
95
+ * @returns The deleted notification
96
+ */
97
+ async delete(id, options) {
98
+ const resp = await this.client.DELETE('/api/v1/notification/channels/{channelId}', {
99
+ params: {
100
+ path: {
101
+ channelId: id,
102
+ },
103
+ },
104
+ ...options,
105
+ });
106
+ return transformResponse(resp);
107
+ }
108
+ }
109
+ /**
110
+ * Notification Rules
111
+ * @description Notification rules are the conditions that trigger notifications.
112
+ */
113
+ export class NotificationRules {
114
+ client;
115
+ constructor(client) {
116
+ this.client = client;
117
+ }
118
+ /**
119
+ * Create a notification rule
120
+ * @param rule - The rule to create
121
+ * @param signal - An optional abort signal
122
+ * @returns The created rule
123
+ */
124
+ async create(rule, options) {
125
+ const resp = await this.client.POST('/api/v1/notification/rules', {
126
+ body: rule,
127
+ ...options,
128
+ });
129
+ return transformResponse(resp);
130
+ }
131
+ /**
132
+ * Get a notification rule by ID
133
+ * @param id - The ID of the notification rule
134
+ * @param signal - An optional abort signal
135
+ * @returns The notification rule
136
+ */
137
+ async get(id, options) {
138
+ const resp = await this.client.GET('/api/v1/notification/rules/{ruleId}', {
139
+ params: {
140
+ path: {
141
+ ruleId: id,
142
+ },
143
+ },
144
+ ...options,
145
+ });
146
+ return transformResponse(resp);
147
+ }
148
+ /**
149
+ * Update a notification rule
150
+ * @param id - The ID of the notification rule
151
+ * @param rule - The rule to update
152
+ * @param signal - An optional abort signal
153
+ * @returns The updated rule
154
+ */
155
+ async update(id, rule, options) {
156
+ const resp = await this.client.PUT('/api/v1/notification/rules/{ruleId}', {
157
+ body: rule,
158
+ params: {
159
+ path: {
160
+ ruleId: id,
161
+ },
162
+ },
163
+ ...options,
164
+ });
165
+ return transformResponse(resp);
166
+ }
167
+ /**
168
+ * List notification rules
169
+ * @param query - The query parameters
170
+ * @param signal - An optional abort signal
171
+ * @returns The list of notification rules
172
+ */
173
+ async list(query, options) {
174
+ const resp = await this.client.GET('/api/v1/notification/rules', {
175
+ params: {
176
+ query,
177
+ },
178
+ ...options,
179
+ });
180
+ return transformResponse(resp);
181
+ }
182
+ /**
183
+ * Delete a notification rule
184
+ * @param id - The ID of the notification rule
185
+ * @param signal - An optional abort signal
186
+ * @returns The deleted notification
187
+ */
188
+ async delete(id, options) {
189
+ const resp = await this.client.DELETE('/api/v1/notification/rules/{ruleId}', {
190
+ params: {
191
+ path: {
192
+ ruleId: id,
193
+ },
194
+ },
195
+ ...options,
196
+ });
197
+ return transformResponse(resp);
198
+ }
199
+ }
200
+ /**
201
+ * Notification Events
202
+ * @description Notification events are the events that trigger notifications.
203
+ */
204
+ export class NotificationEvents {
205
+ client;
206
+ constructor(client) {
207
+ this.client = client;
208
+ }
209
+ /**
210
+ * Get a notification event by ID
211
+ * @param id - The ID of the notification event
212
+ * @param signal - An optional abort signal
213
+ * @returns The notification event
214
+ */
215
+ async get(id, options) {
216
+ const resp = await this.client.GET('/api/v1/notification/events/{eventId}', {
217
+ params: {
218
+ path: {
219
+ eventId: id,
220
+ },
221
+ },
222
+ ...options,
223
+ });
224
+ return transformResponse(resp);
225
+ }
226
+ /**
227
+ * List notification events
228
+ * @param query - The query parameters
229
+ * @param signal - An optional abort signal
230
+ * @returns The list of notification events
231
+ */
232
+ async list(query, options) {
233
+ const resp = await this.client.GET('/api/v1/notification/events', {
234
+ params: {
235
+ query,
236
+ },
237
+ ...options,
238
+ });
239
+ return transformResponse(resp);
240
+ }
241
+ /**
242
+ * Resend a notification event
243
+ * @description Resend a notification event that has already been sent.
244
+ * @param id - The ID of the notification event
245
+ * @param channels - The channels to resend the notification event to, if not provided it will resend to all channels
246
+ * @param signal - An optional abort signal
247
+ * @returns The resent notification event
248
+ */
249
+ async resend(id, body = {}, options) {
250
+ const resp = await this.client.POST('/api/v1/notification/events/{eventId}/resend', {
251
+ body,
252
+ params: {
253
+ path: {
254
+ eventId: id,
255
+ },
256
+ },
257
+ ...options,
258
+ });
259
+ return transformResponse(resp);
260
+ }
261
+ }
262
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/client/notifications.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C;;;GAGG;AACH,MAAM,OAAO,aAAa;IAKJ;IAJb,QAAQ,CAAsB;IAC9B,KAAK,CAAmB;IACxB,MAAM,CAAoB;IAEjC,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;QAC9D,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrD,IAAI,CAAC,KAAK,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