@openmeter/sdk 1.0.0-beta.23 → 1.0.0-beta.231

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 (165) hide show
  1. package/README.md +234 -146
  2. package/dist/cjs/index.cjs +18 -0
  3. package/dist/cjs/index.cjs.map +1 -0
  4. package/dist/cjs/index.d.cts +1 -0
  5. package/dist/cjs/src/client/addons.cjs +105 -0
  6. package/dist/cjs/src/client/addons.cjs.map +1 -0
  7. package/dist/cjs/src/client/addons.d.cts +152 -0
  8. package/dist/cjs/src/client/apps.cjs +247 -0
  9. package/dist/cjs/src/client/apps.cjs.map +1 -0
  10. package/dist/cjs/src/client/apps.d.cts +327 -0
  11. package/dist/cjs/src/client/billing.cjs +375 -0
  12. package/dist/cjs/src/client/billing.cjs.map +1 -0
  13. package/dist/cjs/src/client/billing.d.cts +563 -0
  14. package/dist/cjs/src/client/common.cjs +47 -0
  15. package/dist/cjs/src/client/common.cjs.map +1 -0
  16. package/dist/cjs/src/client/common.d.cts +30 -0
  17. package/dist/cjs/src/client/customers.cjs +469 -0
  18. package/dist/cjs/src/client/customers.cjs.map +1 -0
  19. package/dist/cjs/src/client/customers.d.cts +620 -0
  20. package/dist/cjs/src/client/debug.cjs +27 -0
  21. package/dist/cjs/src/client/debug.cjs.map +1 -0
  22. package/dist/cjs/src/client/debug.d.cts +17 -0
  23. package/dist/cjs/src/client/entitlements.cjs +372 -0
  24. package/dist/cjs/src/client/entitlements.cjs.map +1 -0
  25. package/dist/cjs/src/client/entitlements.d.cts +670 -0
  26. package/dist/cjs/src/client/events.cjs +113 -0
  27. package/dist/cjs/src/client/events.cjs.map +1 -0
  28. package/dist/cjs/src/client/events.d.cts +48 -0
  29. package/dist/cjs/src/client/features.cjs +78 -0
  30. package/dist/cjs/src/client/features.cjs.map +1 -0
  31. package/dist/cjs/src/client/features.d.cts +90 -0
  32. package/dist/cjs/src/client/index.cjs +122 -0
  33. package/dist/cjs/src/client/index.cjs.map +1 -0
  34. package/dist/cjs/src/client/index.d.cts +54 -0
  35. package/dist/cjs/src/client/info.cjs +42 -0
  36. package/dist/cjs/src/client/info.cjs.map +1 -0
  37. package/dist/cjs/src/client/info.d.cts +34 -0
  38. package/dist/cjs/src/client/meters.cjs +160 -0
  39. package/dist/cjs/src/client/meters.cjs.map +1 -0
  40. package/dist/cjs/src/client/meters.d.cts +220 -0
  41. package/dist/cjs/src/client/notifications.cjs +269 -0
  42. package/dist/cjs/src/client/notifications.cjs.map +1 -0
  43. package/dist/cjs/src/client/notifications.d.cts +412 -0
  44. package/dist/cjs/src/client/plans.cjs +204 -0
  45. package/dist/cjs/src/client/plans.cjs.map +1 -0
  46. package/dist/cjs/src/client/plans.d.cts +252 -0
  47. package/dist/cjs/src/client/portal.cjs +55 -0
  48. package/dist/cjs/src/client/portal.cjs.map +1 -0
  49. package/dist/cjs/src/client/portal.d.cts +48 -0
  50. package/dist/cjs/src/client/schemas.cjs +3 -0
  51. package/dist/cjs/src/client/schemas.cjs.map +1 -0
  52. package/dist/cjs/src/client/schemas.d.cts +28002 -0
  53. package/dist/cjs/src/client/subjects.cjs +76 -0
  54. package/dist/cjs/src/client/subjects.cjs.map +1 -0
  55. package/dist/cjs/src/client/subjects.d.cts +79 -0
  56. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  57. package/dist/cjs/src/client/subscription-addons.cjs.map +1 -0
  58. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  59. package/dist/cjs/src/client/subscriptions.cjs +132 -0
  60. package/dist/cjs/src/client/subscriptions.cjs.map +1 -0
  61. package/dist/cjs/src/client/subscriptions.d.cts +180 -0
  62. package/dist/cjs/src/client/utils.cjs +67 -0
  63. package/dist/cjs/src/client/utils.cjs.map +1 -0
  64. package/dist/cjs/src/client/utils.d.cts +12 -0
  65. package/dist/cjs/src/portal/index.cjs +89 -0
  66. package/dist/cjs/src/portal/index.cjs.map +1 -0
  67. package/dist/cjs/src/portal/index.d.cts +43 -0
  68. package/dist/cjs/src/react/context.cjs +35 -0
  69. package/dist/cjs/src/react/context.cjs.map +1 -0
  70. package/dist/cjs/src/react/context.d.cts +9 -0
  71. package/dist/cjs/src/zod/index.cjs +13679 -0
  72. package/dist/cjs/src/zod/index.cjs.map +1 -0
  73. package/dist/cjs/src/zod/index.d.cts +6360 -0
  74. package/dist/index.d.ts +1 -14
  75. package/dist/index.js +2 -15
  76. package/dist/index.js.map +1 -0
  77. package/dist/src/client/addons.d.ts +152 -0
  78. package/dist/src/client/addons.js +101 -0
  79. package/dist/src/client/addons.js.map +1 -0
  80. package/dist/src/client/apps.d.ts +327 -0
  81. package/dist/src/client/apps.js +240 -0
  82. package/dist/src/client/apps.js.map +1 -0
  83. package/dist/src/client/billing.d.ts +563 -0
  84. package/dist/src/client/billing.js +368 -0
  85. package/dist/src/client/billing.js.map +1 -0
  86. package/dist/src/client/common.d.ts +30 -0
  87. package/dist/src/client/common.js +42 -0
  88. package/dist/src/client/common.js.map +1 -0
  89. package/dist/src/client/customers.d.ts +620 -0
  90. package/dist/src/client/customers.js +461 -0
  91. package/dist/src/client/customers.js.map +1 -0
  92. package/dist/src/client/debug.d.ts +17 -0
  93. package/dist/src/client/debug.js +23 -0
  94. package/dist/src/client/debug.js.map +1 -0
  95. package/dist/src/client/entitlements.d.ts +670 -0
  96. package/dist/src/client/entitlements.js +365 -0
  97. package/dist/src/client/entitlements.js.map +1 -0
  98. package/dist/src/client/events.d.ts +48 -0
  99. package/dist/src/client/events.js +108 -0
  100. package/dist/src/client/events.js.map +1 -0
  101. package/dist/src/client/features.d.ts +90 -0
  102. package/dist/src/client/features.js +74 -0
  103. package/dist/src/client/features.js.map +1 -0
  104. package/dist/src/client/index.d.ts +54 -0
  105. package/dist/src/client/index.js +82 -0
  106. package/dist/src/client/index.js.map +1 -0
  107. package/dist/src/client/info.d.ts +34 -0
  108. package/dist/src/client/info.js +38 -0
  109. package/dist/src/client/info.js.map +1 -0
  110. package/dist/src/client/meters.d.ts +220 -0
  111. package/dist/src/client/meters.js +156 -0
  112. package/dist/src/client/meters.js.map +1 -0
  113. package/dist/src/client/notifications.d.ts +412 -0
  114. package/dist/src/client/notifications.js +262 -0
  115. package/dist/src/client/notifications.js.map +1 -0
  116. package/dist/src/client/plans.d.ts +252 -0
  117. package/dist/src/client/plans.js +199 -0
  118. package/dist/src/client/plans.js.map +1 -0
  119. package/dist/src/client/portal.d.ts +48 -0
  120. package/dist/src/client/portal.js +51 -0
  121. package/dist/src/client/portal.js.map +1 -0
  122. package/dist/src/client/schemas.d.ts +28002 -0
  123. package/dist/src/client/schemas.js +2 -0
  124. package/dist/src/client/schemas.js.map +1 -0
  125. package/dist/src/client/subjects.d.ts +79 -0
  126. package/dist/src/client/subjects.js +72 -0
  127. package/dist/src/client/subjects.js.map +1 -0
  128. package/dist/src/client/subscription-addons.d.ts +123 -0
  129. package/dist/src/client/subscription-addons.js +66 -0
  130. package/dist/src/client/subscription-addons.js.map +1 -0
  131. package/dist/src/client/subscriptions.d.ts +180 -0
  132. package/dist/src/client/subscriptions.js +128 -0
  133. package/dist/src/client/subscriptions.js.map +1 -0
  134. package/dist/src/client/utils.d.ts +12 -0
  135. package/dist/src/client/utils.js +61 -0
  136. package/dist/src/client/utils.js.map +1 -0
  137. package/dist/src/portal/index.d.ts +43 -0
  138. package/dist/src/portal/index.js +52 -0
  139. package/dist/src/portal/index.js.map +1 -0
  140. package/dist/src/react/context.d.ts +9 -0
  141. package/dist/src/react/context.js +16 -0
  142. package/dist/src/react/context.js.map +1 -0
  143. package/dist/src/zod/index.d.ts +6360 -0
  144. package/dist/src/zod/index.js +13615 -0
  145. package/dist/src/zod/index.js.map +1 -0
  146. package/dist/tsconfig.tsbuildinfo +1 -1
  147. package/package.json +82 -40
  148. package/dist/clients/client.d.ts +0 -40
  149. package/dist/clients/client.js +0 -104
  150. package/dist/clients/event.d.ts +0 -79
  151. package/dist/clients/event.js +0 -53
  152. package/dist/clients/meter.d.ts +0 -71
  153. package/dist/clients/meter.js +0 -64
  154. package/dist/clients/portal.d.ts +0 -23
  155. package/dist/clients/portal.js +0 -37
  156. package/dist/next.d.ts +0 -15
  157. package/dist/next.js +0 -46
  158. package/dist/schemas/openapi.d.ts +0 -460
  159. package/dist/schemas/openapi.js +0 -5
  160. package/dist/test/agent.d.ts +0 -2
  161. package/dist/test/agent.js +0 -178
  162. package/dist/test/mocks.d.ts +0 -12
  163. package/dist/test/mocks.js +0 -32
  164. package/index.ts +0 -22
  165. package/next.ts +0 -76
@@ -0,0 +1,412 @@
1
+ import type { Client } from 'openapi-fetch';
2
+ import type { RequestOptions } from './common.cjs';
3
+ import type { NotificationChannel, NotificationRuleCreateRequest, operations, paths } from './schemas.cjs';
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.cjs").components["schemas"]["Annotations"];
37
+ metadata?: import("./schemas.cjs").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.cjs").components["schemas"]["Annotations"];
59
+ metadata?: import("./schemas.cjs").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.cjs").components["schemas"]["Annotations"];
82
+ metadata?: import("./schemas.cjs").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.cjs").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.cjs").components["schemas"]["NotificationRule"];
129
+ };
130
+ };
131
+ 400: {
132
+ headers: {
133
+ [name: string]: unknown;
134
+ };
135
+ content: {
136
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
137
+ };
138
+ };
139
+ 401: {
140
+ headers: {
141
+ [name: string]: unknown;
142
+ };
143
+ content: {
144
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
145
+ };
146
+ };
147
+ 403: {
148
+ headers: {
149
+ [name: string]: unknown;
150
+ };
151
+ content: {
152
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
153
+ };
154
+ };
155
+ 412: {
156
+ headers: {
157
+ [name: string]: unknown;
158
+ };
159
+ content: {
160
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
161
+ };
162
+ };
163
+ 500: {
164
+ headers: {
165
+ [name: string]: unknown;
166
+ };
167
+ content: {
168
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
169
+ };
170
+ };
171
+ 503: {
172
+ headers: {
173
+ [name: string]: unknown;
174
+ };
175
+ content: {
176
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
177
+ };
178
+ };
179
+ default: {
180
+ headers: {
181
+ [name: string]: unknown;
182
+ };
183
+ content: {
184
+ "application/problem+json": import("./schemas.cjs").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.cjs").components["schemas"]["NotificationRule"];
201
+ };
202
+ };
203
+ 400: {
204
+ headers: {
205
+ [name: string]: unknown;
206
+ };
207
+ content: {
208
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
209
+ };
210
+ };
211
+ 401: {
212
+ headers: {
213
+ [name: string]: unknown;
214
+ };
215
+ content: {
216
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
217
+ };
218
+ };
219
+ 403: {
220
+ headers: {
221
+ [name: string]: unknown;
222
+ };
223
+ content: {
224
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
225
+ };
226
+ };
227
+ 404: {
228
+ headers: {
229
+ [name: string]: unknown;
230
+ };
231
+ content: {
232
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
233
+ };
234
+ };
235
+ 412: {
236
+ headers: {
237
+ [name: string]: unknown;
238
+ };
239
+ content: {
240
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
241
+ };
242
+ };
243
+ 500: {
244
+ headers: {
245
+ [name: string]: unknown;
246
+ };
247
+ content: {
248
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
249
+ };
250
+ };
251
+ 503: {
252
+ headers: {
253
+ [name: string]: unknown;
254
+ };
255
+ content: {
256
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
257
+ };
258
+ };
259
+ default: {
260
+ headers: {
261
+ [name: string]: unknown;
262
+ };
263
+ content: {
264
+ "application/problem+json": import("./schemas.cjs").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.cjs").components["schemas"]["NotificationRule"];
282
+ };
283
+ };
284
+ 400: {
285
+ headers: {
286
+ [name: string]: unknown;
287
+ };
288
+ content: {
289
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["BadRequestProblemResponse"];
290
+ };
291
+ };
292
+ 401: {
293
+ headers: {
294
+ [name: string]: unknown;
295
+ };
296
+ content: {
297
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["UnauthorizedProblemResponse"];
298
+ };
299
+ };
300
+ 403: {
301
+ headers: {
302
+ [name: string]: unknown;
303
+ };
304
+ content: {
305
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ForbiddenProblemResponse"];
306
+ };
307
+ };
308
+ 404: {
309
+ headers: {
310
+ [name: string]: unknown;
311
+ };
312
+ content: {
313
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["NotFoundProblemResponse"];
314
+ };
315
+ };
316
+ 412: {
317
+ headers: {
318
+ [name: string]: unknown;
319
+ };
320
+ content: {
321
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["PreconditionFailedProblemResponse"];
322
+ };
323
+ };
324
+ 500: {
325
+ headers: {
326
+ [name: string]: unknown;
327
+ };
328
+ content: {
329
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["InternalServerErrorProblemResponse"];
330
+ };
331
+ };
332
+ 503: {
333
+ headers: {
334
+ [name: string]: unknown;
335
+ };
336
+ content: {
337
+ "application/problem+json": import("./schemas.cjs").components["schemas"]["ServiceUnavailableProblemResponse"];
338
+ };
339
+ };
340
+ default: {
341
+ headers: {
342
+ [name: string]: unknown;
343
+ };
344
+ content: {
345
+ "application/problem+json": import("./schemas.cjs").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.cjs").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.cjs").components["schemas"]["NotificationEventType"];
385
+ readonly createdAt: Date;
386
+ readonly rule: import("./schemas.cjs").components["schemas"]["NotificationRule"];
387
+ readonly deliveryStatus: import("./schemas.cjs").components["schemas"]["NotificationEventDeliveryStatus"][];
388
+ readonly payload: import("./schemas.cjs").components["schemas"]["NotificationEventPayload"];
389
+ readonly annotations?: import("./schemas.cjs").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.cjs").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,204 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlanAddons = exports.Plans = void 0;
4
+ const utils_js_1 = require("./utils.cjs");
5
+ /**
6
+ * Plans
7
+ * Manage customer subscription plans and addon assignments.
8
+ */
9
+ class Plans {
10
+ client;
11
+ addons;
12
+ constructor(client) {
13
+ this.client = client;
14
+ this.addons = new PlanAddons(this.client);
15
+ }
16
+ /**
17
+ * Create a plan
18
+ * @param plan - The plan to create
19
+ * @param options - Optional request options
20
+ * @returns The created plan
21
+ */
22
+ async create(plan, options) {
23
+ const resp = await this.client.POST('/api/v1/plans', {
24
+ body: plan,
25
+ ...options,
26
+ });
27
+ return (0, utils_js_1.transformResponse)(resp);
28
+ }
29
+ /**
30
+ * Get a plan by ID
31
+ * @param planId - The ID of the plan to retrieve
32
+ * @param params - Optional query parameters
33
+ * @param options - Optional request options
34
+ * @returns The plan
35
+ */
36
+ async get(planId, params, options) {
37
+ const resp = await this.client.GET('/api/v1/plans/{planId}', {
38
+ params: {
39
+ path: { planId },
40
+ query: params,
41
+ },
42
+ ...options,
43
+ });
44
+ return (0, utils_js_1.transformResponse)(resp);
45
+ }
46
+ /**
47
+ * List plans
48
+ * @param params - Optional parameters for listing plans
49
+ * @param options - Optional request options
50
+ * @returns A list of plans
51
+ */
52
+ async list(params, options) {
53
+ const resp = await this.client.GET('/api/v1/plans', {
54
+ params: { query: params },
55
+ ...options,
56
+ });
57
+ return (0, utils_js_1.transformResponse)(resp);
58
+ }
59
+ /**
60
+ * Update a plan
61
+ * @param planId - The ID of the plan to update
62
+ * @param plan - The plan data to update
63
+ * @param options - Optional request options
64
+ * @returns The updated plan
65
+ */
66
+ async update(planId, plan, options) {
67
+ const resp = await this.client.PUT('/api/v1/plans/{planId}', {
68
+ body: plan,
69
+ params: { path: { planId } },
70
+ ...options,
71
+ });
72
+ return (0, utils_js_1.transformResponse)(resp);
73
+ }
74
+ /**
75
+ * Delete a plan by ID
76
+ * @param planId - The ID of the plan to delete
77
+ * @param options - Optional request options
78
+ * @returns void or standard error response structure
79
+ */
80
+ async delete(planId, options) {
81
+ const resp = await this.client.DELETE('/api/v1/plans/{planId}', {
82
+ params: { path: { planId } },
83
+ ...options,
84
+ });
85
+ return (0, utils_js_1.transformResponse)(resp);
86
+ }
87
+ /**
88
+ * Archive a plan
89
+ * @param planId - The ID of the plan to archive
90
+ * @param options - Optional request options
91
+ * @returns The archived plan
92
+ */
93
+ async archive(planId, options) {
94
+ const resp = await this.client.POST('/api/v1/plans/{planId}/archive', {
95
+ params: { path: { planId } },
96
+ ...options,
97
+ });
98
+ return (0, utils_js_1.transformResponse)(resp);
99
+ }
100
+ /**
101
+ * Publish a plan
102
+ * @param planId - The ID of the plan to publish
103
+ * @param options - Optional request options
104
+ * @returns The published plan
105
+ */
106
+ async publish(planId, options) {
107
+ const resp = await this.client.POST('/api/v1/plans/{planId}/publish', {
108
+ params: { path: { planId } },
109
+ ...options,
110
+ });
111
+ return (0, utils_js_1.transformResponse)(resp);
112
+ }
113
+ }
114
+ exports.Plans = Plans;
115
+ /**
116
+ * Plan Addons
117
+ * Manage addon assignments for plans.
118
+ */
119
+ class PlanAddons {
120
+ client;
121
+ constructor(client) {
122
+ this.client = client;
123
+ }
124
+ /**
125
+ * List plan addons
126
+ * @param planId - The ID of the plan
127
+ * @param params - Optional query parameters
128
+ * @param options - Optional request options
129
+ * @returns A list of plan addons
130
+ */
131
+ async list(planId, params, options) {
132
+ const resp = await this.client.GET('/api/v1/plans/{planId}/addons', {
133
+ params: {
134
+ path: { planId },
135
+ query: params,
136
+ },
137
+ ...options,
138
+ });
139
+ return (0, utils_js_1.transformResponse)(resp);
140
+ }
141
+ /**
142
+ * Create a plan addon
143
+ * @param planId - The ID of the plan
144
+ * @param planAddon - The plan addon to create
145
+ * @param options - Optional request options
146
+ * @returns The created plan addon
147
+ */
148
+ async create(planId, planAddon, options) {
149
+ const resp = await this.client.POST('/api/v1/plans/{planId}/addons', {
150
+ body: planAddon,
151
+ params: { path: { planId } },
152
+ ...options,
153
+ });
154
+ return (0, utils_js_1.transformResponse)(resp);
155
+ }
156
+ /**
157
+ * Get a plan addon by ID
158
+ * @param planId - The ID of the plan
159
+ * @param planAddonId - The ID of the plan addon
160
+ * @param options - Optional request options
161
+ * @returns The plan addon
162
+ */
163
+ async get(planId, planAddonId, options) {
164
+ const resp = await this.client.GET('/api/v1/plans/{planId}/addons/{planAddonId}', {
165
+ params: {
166
+ path: { planAddonId, planId },
167
+ },
168
+ ...options,
169
+ });
170
+ return (0, utils_js_1.transformResponse)(resp);
171
+ }
172
+ /**
173
+ * Update a plan addon
174
+ * @param planId - The ID of the plan
175
+ * @param planAddonId - The ID of the plan addon to update
176
+ * @param planAddon - The plan addon data to update
177
+ * @param options - Optional request options
178
+ * @returns The updated plan addon
179
+ */
180
+ async update(planId, planAddonId, planAddon, options) {
181
+ const resp = await this.client.PUT('/api/v1/plans/{planId}/addons/{planAddonId}', {
182
+ body: planAddon,
183
+ params: { path: { planAddonId, planId } },
184
+ ...options,
185
+ });
186
+ return (0, utils_js_1.transformResponse)(resp);
187
+ }
188
+ /**
189
+ * Delete a plan addon by ID
190
+ * @param planId - The ID of the plan
191
+ * @param planAddonId - The ID of the plan addon to delete
192
+ * @param options - Optional request options
193
+ * @returns void or standard error response structure
194
+ */
195
+ async delete(planId, planAddonId, options) {
196
+ const resp = await this.client.DELETE('/api/v1/plans/{planId}/addons/{planAddonId}', {
197
+ params: { path: { planAddonId, planId } },
198
+ ...options,
199
+ });
200
+ return (0, utils_js_1.transformResponse)(resp);
201
+ }
202
+ }
203
+ exports.PlanAddons = PlanAddons;
204
+ //# sourceMappingURL=plans.cjs.map