@openmeter/client 1.0.0-beta-e80707e916b7 → 1.0.0-beta-e00163c4b8a0

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.
@@ -3,7 +3,7 @@ import { unwrap } from '../lib/types.js';
3
3
  import { paginatePages } from '../lib/paginate.js';
4
4
  import { createSubscriptionAddon, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
5
5
  import { executeAppAction } from '../funcs/apps.js';
6
- import { listNotificationEvents, getNotificationEvent, resendNotificationEvent, } from '../funcs/notifications.js';
6
+ import { listNotificationRules, createNotificationRule, getNotificationRule, updateNotificationRule, deleteNotificationRule, testNotificationRule, listNotificationEvents, getNotificationEvent, resendNotificationEvent, } from '../funcs/notifications.js';
7
7
  /**
8
8
  * Operations marked internal in the API definition. They are not part of
9
9
  * the customer surface: they may require additional permissions, and they
@@ -77,6 +77,80 @@ export class InternalNotifications {
77
77
  constructor(_client) {
78
78
  this._client = _client;
79
79
  }
80
+ /**
81
+ * List notification rules
82
+ *
83
+ * List all notification rules.
84
+ *
85
+ * GET /openmeter/notification/rules
86
+ */
87
+ async listRules(request, options) {
88
+ return unwrap(await listNotificationRules(this._client, request, options));
89
+ }
90
+ /**
91
+ * List notification rules
92
+ *
93
+ * List all notification rules.
94
+ *
95
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
96
+ *
97
+ * GET /openmeter/notification/rules
98
+ */
99
+ listRulesAll(request, options) {
100
+ return paginatePages((req, opts) => listNotificationRules(this._client, req, opts), request ?? {}, options);
101
+ }
102
+ /**
103
+ * Create notification rule
104
+ *
105
+ * Create a notification rule.
106
+ *
107
+ * POST /openmeter/notification/rules
108
+ */
109
+ async createRule(request, options) {
110
+ return unwrap(await createNotificationRule(this._client, request, options));
111
+ }
112
+ /**
113
+ * Get notification rule
114
+ *
115
+ * Get a notification rule by id.
116
+ *
117
+ * GET /openmeter/notification/rules/{notificationRuleId}
118
+ */
119
+ async getRule(request, options) {
120
+ return unwrap(await getNotificationRule(this._client, request, options));
121
+ }
122
+ /**
123
+ * Update notification rule
124
+ *
125
+ * Update a notification rule by id.
126
+ *
127
+ * PUT /openmeter/notification/rules/{notificationRuleId}
128
+ */
129
+ async updateRule(request, options) {
130
+ return unwrap(await updateNotificationRule(this._client, request, options));
131
+ }
132
+ /**
133
+ * Delete notification rule
134
+ *
135
+ * Delete a notification rule by id.
136
+ *
137
+ * DELETE /openmeter/notification/rules/{notificationRuleId}
138
+ */
139
+ async deleteRule(request, options) {
140
+ return unwrap(await deleteNotificationRule(this._client, request, options));
141
+ }
142
+ /**
143
+ * Test notification rule
144
+ *
145
+ * Test a notification rule by generating an event with sample data and delivering
146
+ * it to the rule's channels. The test event is persisted and listed like any other
147
+ * event.
148
+ *
149
+ * POST /openmeter/notification/rules/{notificationRuleId}/test
150
+ */
151
+ async testRule(request, options) {
152
+ return unwrap(await testNotificationRule(this._client, request, options));
153
+ }
80
154
  /**
81
155
  * List notification events
82
156
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-e80707e916b7",
3
+ "version": "1.0.0-beta-e00163c4b8a0",
4
4
  "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
5
  "keywords": [
6
6
  "openmeter",