@openmeter/sdk 1.0.0-beta.2 → 1.0.0-beta.201

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 (137) hide show
  1. package/README.md +44 -65
  2. package/dist/cjs/index.cjs +18 -0
  3. package/dist/cjs/index.d.cts +1 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/src/client/apps.cjs +174 -0
  6. package/dist/cjs/src/client/apps.d.cts +259 -0
  7. package/dist/cjs/src/client/apps.js.map +1 -0
  8. package/dist/cjs/src/client/billing.cjs +309 -0
  9. package/dist/cjs/src/client/billing.d.cts +510 -0
  10. package/dist/cjs/src/client/billing.js.map +1 -0
  11. package/dist/cjs/src/client/common.cjs +47 -0
  12. package/dist/cjs/src/client/common.d.cts +30 -0
  13. package/dist/cjs/src/client/common.js.map +1 -0
  14. package/dist/cjs/src/client/customers.cjs +185 -0
  15. package/dist/cjs/src/client/customers.d.cts +163 -0
  16. package/dist/cjs/src/client/customers.js.map +1 -0
  17. package/dist/cjs/src/client/entitlements.cjs +244 -0
  18. package/dist/cjs/src/client/entitlements.d.cts +442 -0
  19. package/dist/cjs/src/client/entitlements.js.map +1 -0
  20. package/dist/cjs/src/client/events.cjs +66 -0
  21. package/dist/cjs/src/client/events.d.cts +31 -0
  22. package/dist/cjs/src/client/events.js.map +1 -0
  23. package/dist/cjs/src/client/features.cjs +78 -0
  24. package/dist/cjs/src/client/features.d.cts +78 -0
  25. package/dist/cjs/src/client/features.js.map +1 -0
  26. package/dist/cjs/src/client/index.cjs +108 -0
  27. package/dist/cjs/src/client/index.d.cts +45 -0
  28. package/dist/cjs/src/client/index.js.map +1 -0
  29. package/dist/cjs/src/client/meters.cjs +93 -0
  30. package/dist/cjs/src/client/meters.d.cts +160 -0
  31. package/dist/cjs/src/client/meters.js.map +1 -0
  32. package/dist/cjs/src/client/notifications.cjs +249 -0
  33. package/dist/cjs/src/client/notifications.d.cts +219 -0
  34. package/dist/cjs/src/client/notifications.js.map +1 -0
  35. package/dist/cjs/src/client/plans.cjs +127 -0
  36. package/dist/cjs/src/client/plans.d.cts +142 -0
  37. package/dist/cjs/src/client/plans.js.map +1 -0
  38. package/dist/cjs/src/client/portal.cjs +55 -0
  39. package/dist/cjs/src/client/portal.d.cts +48 -0
  40. package/dist/cjs/src/client/portal.js.map +1 -0
  41. package/dist/cjs/src/client/schemas.cjs +3 -0
  42. package/dist/cjs/src/client/schemas.d.cts +17628 -0
  43. package/dist/cjs/src/client/schemas.js.map +1 -0
  44. package/dist/cjs/src/client/subjects.cjs +76 -0
  45. package/dist/cjs/src/client/subjects.d.cts +70 -0
  46. package/dist/cjs/src/client/subjects.js.map +1 -0
  47. package/dist/cjs/src/client/subscriptions.cjs +116 -0
  48. package/dist/cjs/src/client/subscriptions.d.cts +147 -0
  49. package/dist/cjs/src/client/subscriptions.js.map +1 -0
  50. package/dist/cjs/src/client/utils.cjs +69 -0
  51. package/dist/cjs/src/client/utils.d.cts +12 -0
  52. package/dist/cjs/src/client/utils.js.map +1 -0
  53. package/dist/cjs/src/portal/index.cjs +57 -0
  54. package/dist/cjs/src/portal/index.d.cts +104 -0
  55. package/dist/cjs/src/portal/index.js.map +1 -0
  56. package/dist/cjs/src/react/context.cjs +35 -0
  57. package/dist/cjs/src/react/context.d.cts +9 -0
  58. package/dist/cjs/src/react/context.js.map +1 -0
  59. package/dist/cjs/tsconfig.177d1bd1.tsbuildinfo +1 -0
  60. package/dist/cjs/tsconfig.ae2c6e83.tsbuildinfo +1 -0
  61. package/dist/index.d.ts +1 -11
  62. package/dist/index.js +2 -11
  63. package/dist/index.js.map +1 -0
  64. package/dist/src/client/apps.d.ts +259 -0
  65. package/dist/src/client/apps.js +168 -0
  66. package/dist/src/client/apps.js.map +1 -0
  67. package/dist/src/client/billing.d.ts +510 -0
  68. package/dist/src/client/billing.js +302 -0
  69. package/dist/src/client/billing.js.map +1 -0
  70. package/dist/src/client/common.d.ts +30 -0
  71. package/dist/src/client/common.js +42 -0
  72. package/dist/src/client/common.js.map +1 -0
  73. package/dist/src/client/customers.d.ts +163 -0
  74. package/dist/src/client/customers.js +179 -0
  75. package/dist/src/client/customers.js.map +1 -0
  76. package/dist/src/client/entitlements.d.ts +442 -0
  77. package/dist/src/client/entitlements.js +239 -0
  78. package/dist/src/client/entitlements.js.map +1 -0
  79. package/dist/src/client/events.d.ts +31 -0
  80. package/dist/src/client/events.js +58 -0
  81. package/dist/src/client/events.js.map +1 -0
  82. package/dist/src/client/features.d.ts +78 -0
  83. package/dist/src/client/features.js +74 -0
  84. package/dist/src/client/features.js.map +1 -0
  85. package/dist/src/client/index.d.ts +45 -0
  86. package/dist/src/client/index.js +68 -0
  87. package/dist/src/client/index.js.map +1 -0
  88. package/dist/src/client/meters.d.ts +160 -0
  89. package/dist/src/client/meters.js +89 -0
  90. package/dist/src/client/meters.js.map +1 -0
  91. package/dist/src/client/notifications.d.ts +219 -0
  92. package/dist/src/client/notifications.js +242 -0
  93. package/dist/src/client/notifications.js.map +1 -0
  94. package/dist/src/client/plans.d.ts +142 -0
  95. package/dist/src/client/plans.js +123 -0
  96. package/dist/src/client/plans.js.map +1 -0
  97. package/dist/src/client/portal.d.ts +48 -0
  98. package/dist/src/client/portal.js +51 -0
  99. package/dist/src/client/portal.js.map +1 -0
  100. package/dist/src/client/schemas.d.ts +17628 -0
  101. package/dist/src/client/schemas.js +2 -0
  102. package/dist/src/client/schemas.js.map +1 -0
  103. package/dist/src/client/subjects.d.ts +70 -0
  104. package/dist/src/client/subjects.js +72 -0
  105. package/dist/src/client/subjects.js.map +1 -0
  106. package/dist/src/client/subscriptions.d.ts +147 -0
  107. package/dist/src/client/subscriptions.js +112 -0
  108. package/dist/src/client/subscriptions.js.map +1 -0
  109. package/dist/src/client/utils.d.ts +12 -0
  110. package/dist/src/client/utils.js +63 -0
  111. package/dist/src/client/utils.js.map +1 -0
  112. package/dist/src/portal/index.d.ts +104 -0
  113. package/dist/src/portal/index.js +50 -0
  114. package/dist/src/portal/index.js.map +1 -0
  115. package/dist/src/react/context.d.ts +9 -0
  116. package/dist/src/react/context.js +16 -0
  117. package/dist/src/react/context.js.map +1 -0
  118. package/dist/tsconfig.tsbuildinfo +1 -1
  119. package/package.json +93 -49
  120. package/patches/openapi-typescript.patch +73 -0
  121. package/clients/client.ts +0 -153
  122. package/clients/event.ts +0 -109
  123. package/clients/meter.ts +0 -84
  124. package/dist/clients/client.d.ts +0 -40
  125. package/dist/clients/client.js +0 -101
  126. package/dist/clients/event.d.ts +0 -65
  127. package/dist/clients/event.js +0 -38
  128. package/dist/clients/meter.d.ts +0 -52
  129. package/dist/clients/meter.js +0 -52
  130. package/dist/schemas/openapi.d.ts +0 -414
  131. package/dist/schemas/openapi.js +0 -5
  132. package/dist/test/agent.d.ts +0 -2
  133. package/dist/test/agent.js +0 -105
  134. package/dist/test/mocks.d.ts +0 -11
  135. package/dist/test/mocks.js +0 -21
  136. package/index.ts +0 -17
  137. package/schemas/openapi.ts +0 -421
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationEvents = exports.NotificationRules = exports.NotificationChannels = exports.Notifications = void 0;
4
+ const utils_js_1 = require("./utils.cjs");
5
+ /**
6
+ * Notifications
7
+ * @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.
8
+ */
9
+ class Notifications {
10
+ client;
11
+ channels;
12
+ rules;
13
+ events;
14
+ constructor(client) {
15
+ this.client = client;
16
+ this.channels = new NotificationChannels(this.client);
17
+ this.rules = new NotificationRules(this.client);
18
+ this.events = new NotificationEvents(this.client);
19
+ }
20
+ }
21
+ exports.Notifications = Notifications;
22
+ /**
23
+ * Notification Channels
24
+ * @description Notification channels are the destinations for notifications.
25
+ */
26
+ class NotificationChannels {
27
+ client;
28
+ constructor(client) {
29
+ this.client = client;
30
+ }
31
+ /**
32
+ * Create a notification channel
33
+ * @param notification - The notification to create
34
+ * @param signal - An optional abort signal
35
+ * @returns The created notification
36
+ */
37
+ async create(notification, options) {
38
+ const resp = await this.client.POST('/api/v1/notification/channels', {
39
+ body: notification,
40
+ ...options,
41
+ });
42
+ return (0, utils_js_1.transformResponse)(resp);
43
+ }
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
+ async get(id, options) {
51
+ const resp = await this.client.GET('/api/v1/notification/channels/{channelId}', {
52
+ params: {
53
+ path: {
54
+ channelId: id,
55
+ },
56
+ },
57
+ ...options,
58
+ });
59
+ return (0, utils_js_1.transformResponse)(resp);
60
+ }
61
+ /**
62
+ * Update a notification channel
63
+ * @param id - The ID of the notification channel
64
+ * @param notification - The notification to update
65
+ * @param signal - An optional abort signal
66
+ * @returns The updated notification
67
+ */
68
+ async update(id, notification, options) {
69
+ const resp = await this.client.PUT('/api/v1/notification/channels/{channelId}', {
70
+ body: notification,
71
+ params: {
72
+ path: {
73
+ channelId: id,
74
+ },
75
+ },
76
+ ...options,
77
+ });
78
+ return (0, utils_js_1.transformResponse)(resp);
79
+ }
80
+ /**
81
+ * List notification channels
82
+ * @param query - The query parameters
83
+ * @param signal - An optional abort signal
84
+ * @returns The list of notification channels
85
+ */
86
+ async list(query, options) {
87
+ const resp = await this.client.GET('/api/v1/notification/channels', {
88
+ params: {
89
+ query,
90
+ },
91
+ ...options,
92
+ });
93
+ return (0, utils_js_1.transformResponse)(resp);
94
+ }
95
+ /**
96
+ * Delete a notification channel
97
+ * @param id - The ID of the notification channel
98
+ * @param signal - An optional abort signal
99
+ * @returns The deleted notification
100
+ */
101
+ async delete(id, options) {
102
+ const resp = await this.client.DELETE('/api/v1/notification/channels/{channelId}', {
103
+ params: {
104
+ path: {
105
+ channelId: id,
106
+ },
107
+ },
108
+ ...options,
109
+ });
110
+ return (0, utils_js_1.transformResponse)(resp);
111
+ }
112
+ }
113
+ exports.NotificationChannels = NotificationChannels;
114
+ /**
115
+ * Notification Rules
116
+ * @description Notification rules are the conditions that trigger notifications.
117
+ */
118
+ class NotificationRules {
119
+ client;
120
+ constructor(client) {
121
+ this.client = client;
122
+ }
123
+ /**
124
+ * Create a notification rule
125
+ * @param rule - The rule to create
126
+ * @param signal - An optional abort signal
127
+ * @returns The created rule
128
+ */
129
+ async create(rule, options) {
130
+ const resp = await this.client.POST('/api/v1/notification/rules', {
131
+ body: rule,
132
+ ...options,
133
+ });
134
+ return (0, utils_js_1.transformResponse)(resp);
135
+ }
136
+ /**
137
+ * Get a notification rule by ID
138
+ * @param id - The ID of the notification rule
139
+ * @param signal - An optional abort signal
140
+ * @returns The notification rule
141
+ */
142
+ async get(id, options) {
143
+ const resp = await this.client.GET('/api/v1/notification/rules/{ruleId}', {
144
+ params: {
145
+ path: {
146
+ ruleId: id,
147
+ },
148
+ },
149
+ ...options,
150
+ });
151
+ return (0, utils_js_1.transformResponse)(resp);
152
+ }
153
+ /**
154
+ * Update a notification rule
155
+ * @param id - The ID of the notification rule
156
+ * @param rule - The rule to update
157
+ * @param signal - An optional abort signal
158
+ * @returns The updated rule
159
+ */
160
+ async update(id, rule, options) {
161
+ const resp = await this.client.PUT('/api/v1/notification/rules/{ruleId}', {
162
+ body: rule,
163
+ params: {
164
+ path: {
165
+ ruleId: id,
166
+ },
167
+ },
168
+ ...options,
169
+ });
170
+ return (0, utils_js_1.transformResponse)(resp);
171
+ }
172
+ /**
173
+ * List notification rules
174
+ * @param query - The query parameters
175
+ * @param signal - An optional abort signal
176
+ * @returns The list of notification rules
177
+ */
178
+ async list(query, options) {
179
+ const resp = await this.client.GET('/api/v1/notification/rules', {
180
+ params: {
181
+ query,
182
+ },
183
+ ...options,
184
+ });
185
+ return (0, utils_js_1.transformResponse)(resp);
186
+ }
187
+ /**
188
+ * Delete a notification rule
189
+ * @param id - The ID of the notification rule
190
+ * @param signal - An optional abort signal
191
+ * @returns The deleted notification
192
+ */
193
+ async delete(id, options) {
194
+ const resp = await this.client.DELETE('/api/v1/notification/rules/{ruleId}', {
195
+ params: {
196
+ path: {
197
+ ruleId: id,
198
+ },
199
+ },
200
+ ...options,
201
+ });
202
+ return (0, utils_js_1.transformResponse)(resp);
203
+ }
204
+ }
205
+ exports.NotificationRules = NotificationRules;
206
+ /**
207
+ * Notification Events
208
+ * @description Notification events are the events that trigger notifications.
209
+ */
210
+ class NotificationEvents {
211
+ client;
212
+ constructor(client) {
213
+ this.client = client;
214
+ }
215
+ /**
216
+ * Get a notification event by ID
217
+ * @param id - The ID of the notification event
218
+ * @param signal - An optional abort signal
219
+ * @returns The notification event
220
+ */
221
+ async get(id, options) {
222
+ const resp = await this.client.GET('/api/v1/notification/events/{eventId}', {
223
+ params: {
224
+ path: {
225
+ eventId: id,
226
+ },
227
+ },
228
+ ...options,
229
+ });
230
+ return (0, utils_js_1.transformResponse)(resp);
231
+ }
232
+ /**
233
+ * List notification events
234
+ * @param query - The query parameters
235
+ * @param signal - An optional abort signal
236
+ * @returns The list of notification events
237
+ */
238
+ async list(query, options) {
239
+ const resp = await this.client.GET('/api/v1/notification/events', {
240
+ params: {
241
+ query,
242
+ },
243
+ ...options,
244
+ });
245
+ return (0, utils_js_1.transformResponse)(resp);
246
+ }
247
+ }
248
+ exports.NotificationEvents = NotificationEvents;
249
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1,219 @@
1
+ import type { RequestOptions } from './common.cjs';
2
+ import type { NotificationChannel, NotificationRuleCreateRequest, operations, paths } from './schemas.cjs';
3
+ import type { Client } from 'openapi-fetch';
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
+ url: string;
37
+ customHeaders?: {
38
+ [key: string]: string;
39
+ };
40
+ signingSecret?: string;
41
+ }>;
42
+ /**
43
+ * Get a notification channel by ID
44
+ * @param id - The ID of the notification channel
45
+ * @param signal - An optional abort signal
46
+ * @returns The notification channel
47
+ */
48
+ get(id: operations['getNotificationChannel']['parameters']['path']['channelId'], options?: RequestOptions): Promise<{
49
+ readonly createdAt: Date;
50
+ readonly updatedAt: Date;
51
+ readonly deletedAt?: Date;
52
+ readonly id: string;
53
+ type: "WEBHOOK";
54
+ name: string;
55
+ disabled?: boolean;
56
+ url: string;
57
+ customHeaders?: {
58
+ [key: string]: string;
59
+ };
60
+ signingSecret?: string;
61
+ }>;
62
+ /**
63
+ * Update a notification channel
64
+ * @param id - The ID of the notification channel
65
+ * @param notification - The notification to update
66
+ * @param signal - An optional abort signal
67
+ * @returns The updated notification
68
+ */
69
+ update(id: operations['updateNotificationChannel']['parameters']['path']['channelId'], notification: NotificationChannel, options?: RequestOptions): Promise<{
70
+ readonly createdAt: Date;
71
+ readonly updatedAt: Date;
72
+ readonly deletedAt?: Date;
73
+ readonly id: string;
74
+ type: "WEBHOOK";
75
+ name: string;
76
+ disabled?: boolean;
77
+ url: string;
78
+ customHeaders?: {
79
+ [key: string]: string;
80
+ };
81
+ signingSecret?: string;
82
+ }>;
83
+ /**
84
+ * List notification channels
85
+ * @param query - The query parameters
86
+ * @param signal - An optional abort signal
87
+ * @returns The list of notification channels
88
+ */
89
+ list(query?: operations['listNotificationChannels']['parameters']['query'], options?: RequestOptions): Promise<{
90
+ totalCount: number;
91
+ page: number;
92
+ pageSize: number;
93
+ items: import("./schemas.cjs").components["schemas"]["NotificationChannel"][];
94
+ }>;
95
+ /**
96
+ * Delete a notification channel
97
+ * @param id - The ID of the notification channel
98
+ * @param signal - An optional abort signal
99
+ * @returns The deleted notification
100
+ */
101
+ delete(id: operations['deleteNotificationChannel']['parameters']['path']['channelId'], options?: RequestOptions): Promise<undefined>;
102
+ }
103
+ /**
104
+ * Notification Rules
105
+ * @description Notification rules are the conditions that trigger notifications.
106
+ */
107
+ export declare class NotificationRules {
108
+ private client;
109
+ constructor(client: Client<paths, `${string}/${string}`>);
110
+ /**
111
+ * Create a notification rule
112
+ * @param rule - The rule to create
113
+ * @param signal - An optional abort signal
114
+ * @returns The created rule
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
+ }>;
128
+ /**
129
+ * Get a notification rule by ID
130
+ * @param id - The ID of the notification rule
131
+ * @param signal - An optional abort signal
132
+ * @returns The notification rule
133
+ */
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
+ }>;
146
+ /**
147
+ * Update a notification rule
148
+ * @param id - The ID of the notification rule
149
+ * @param rule - The rule to update
150
+ * @param signal - An optional abort signal
151
+ * @returns The updated rule
152
+ */
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
+ }>;
165
+ /**
166
+ * List notification rules
167
+ * @param query - The query parameters
168
+ * @param signal - An optional abort signal
169
+ * @returns The list of notification rules
170
+ */
171
+ list(query?: operations['listNotificationRules']['parameters']['query'], options?: RequestOptions): Promise<{
172
+ totalCount: number;
173
+ page: number;
174
+ pageSize: number;
175
+ items: import("./schemas.cjs").components["schemas"]["NotificationRule"][];
176
+ }>;
177
+ /**
178
+ * Delete a notification rule
179
+ * @param id - The ID of the notification rule
180
+ * @param signal - An optional abort signal
181
+ * @returns The deleted notification
182
+ */
183
+ delete(id: operations['deleteNotificationRule']['parameters']['path']['ruleId'], options?: RequestOptions): Promise<undefined>;
184
+ }
185
+ /**
186
+ * Notification Events
187
+ * @description Notification events are the events that trigger notifications.
188
+ */
189
+ export declare class NotificationEvents {
190
+ private client;
191
+ constructor(client: Client<paths, `${string}/${string}`>);
192
+ /**
193
+ * Get a notification event by ID
194
+ * @param id - The ID of the notification event
195
+ * @param signal - An optional abort signal
196
+ * @returns The notification event
197
+ */
198
+ get(id: operations['getNotificationEvent']['parameters']['path']['eventId'], options?: RequestOptions): Promise<{
199
+ readonly id: string;
200
+ readonly type: import("./schemas.cjs").components["schemas"]["NotificationEventType"];
201
+ readonly createdAt: Date;
202
+ readonly rule: import("./schemas.cjs").components["schemas"]["NotificationRule"];
203
+ readonly deliveryStatus: import("./schemas.cjs").components["schemas"]["NotificationEventDeliveryStatus"][];
204
+ readonly payload: import("./schemas.cjs").components["schemas"]["NotificationEventPayload"];
205
+ readonly annotations?: import("./schemas.cjs").components["schemas"]["Annotations"];
206
+ }>;
207
+ /**
208
+ * List notification events
209
+ * @param query - The query parameters
210
+ * @param signal - An optional abort signal
211
+ * @returns The list of notification events
212
+ */
213
+ list(query?: operations['listNotificationEvents']['parameters']['query'], options?: RequestOptions): Promise<{
214
+ totalCount: number;
215
+ page: number;
216
+ pageSize: number;
217
+ items: import("./schemas.cjs").components["schemas"]["NotificationEvent"][];
218
+ }>;
219
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../../src/client/notifications.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAU9C;;;GAGG;AACH,MAAa,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,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACnD,CAAC;CACF;AAVD,sCAUC;AAED;;;GAGG;AACH,MAAa,oBAAoB;IACX;IAApB,YAAoB,MAA4C;QAA5C,WAAM,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ExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,6BAA6B,EAAE;YAChE,MAAM,EAAE;gBACN,KAAK;aACN;YACD,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AA/CD,gDA+CC"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Plans = void 0;
4
+ const utils_js_1 = require("./utils.cjs");
5
+ class Plans {
6
+ client;
7
+ constructor(client) {
8
+ this.client = client;
9
+ }
10
+ /**
11
+ * Create a plan
12
+ * @param plan - The plan to create
13
+ * @param signal - An optional abort signal
14
+ * @returns The created plan
15
+ */
16
+ async create(plan, options) {
17
+ const resp = await this.client.POST('/api/v1/plans', {
18
+ body: plan,
19
+ ...options,
20
+ });
21
+ return (0, utils_js_1.transformResponse)(resp);
22
+ }
23
+ /**
24
+ * Get a plan by ID or key
25
+ * @param idOrKey - The ID or key of the plan
26
+ * @param signal - An optional abort signal
27
+ * @returns The plan
28
+ */
29
+ async get(id, options) {
30
+ const resp = await this.client.GET('/api/v1/plans/{planId}', {
31
+ params: {
32
+ path: {
33
+ planId: id,
34
+ },
35
+ },
36
+ ...options,
37
+ });
38
+ return (0, utils_js_1.transformResponse)(resp);
39
+ }
40
+ /**
41
+ * List plans
42
+ * @param query - The query parameters
43
+ * @param signal - An optional abort signal
44
+ * @returns The list of plans
45
+ */
46
+ async list(query, options) {
47
+ const resp = await this.client.GET('/api/v1/plans', {
48
+ params: {
49
+ query,
50
+ },
51
+ ...options,
52
+ });
53
+ return (0, utils_js_1.transformResponse)(resp);
54
+ }
55
+ /**
56
+ * Update a plan
57
+ * @param id - The ID of the plan
58
+ * @param plan - The plan to update
59
+ * @param signal - An optional abort signal
60
+ * @returns The updated plan
61
+ */
62
+ async update(id, plan, options) {
63
+ const resp = await this.client.PUT('/api/v1/plans/{planId}', {
64
+ body: plan,
65
+ params: {
66
+ path: {
67
+ planId: id,
68
+ },
69
+ },
70
+ ...options,
71
+ });
72
+ return (0, utils_js_1.transformResponse)(resp);
73
+ }
74
+ /**
75
+ * Delete a plan
76
+ * @param id - The ID of the plan
77
+ * @param signal - An optional abort signal
78
+ * @returns The deleted plan
79
+ */
80
+ async delete(id, options) {
81
+ const resp = await this.client.DELETE('/api/v1/plans/{planId}', {
82
+ params: {
83
+ path: {
84
+ planId: id,
85
+ },
86
+ },
87
+ ...options,
88
+ });
89
+ return (0, utils_js_1.transformResponse)(resp);
90
+ }
91
+ /**
92
+ * Archive a plan
93
+ * @param id - The ID of the plan
94
+ * @param signal - An optional abort signal
95
+ * @returns The archived plan
96
+ */
97
+ async archive(id, options) {
98
+ const resp = await this.client.POST('/api/v1/plans/{planId}/archive', {
99
+ params: {
100
+ path: {
101
+ planId: id,
102
+ },
103
+ },
104
+ ...options,
105
+ });
106
+ return (0, utils_js_1.transformResponse)(resp);
107
+ }
108
+ /**
109
+ * Publish a plan
110
+ * @param id - The ID of the plan
111
+ * @param signal - An optional abort signal
112
+ * @returns The published plan
113
+ */
114
+ async publish(id, options) {
115
+ const resp = await this.client.POST('/api/v1/plans/{planId}/publish', {
116
+ params: {
117
+ path: {
118
+ planId: id,
119
+ },
120
+ },
121
+ ...options,
122
+ });
123
+ return (0, utils_js_1.transformResponse)(resp);
124
+ }
125
+ }
126
+ exports.Plans = Plans;
127
+ //# sourceMappingURL=plans.js.map