@openmeter/client 1.0.0-beta-ff701a7f5839 → 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.
- package/README.md +6 -0
- package/dist/funcs/notifications.d.ts +51 -1
- package/dist/funcs/notifications.js +194 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/notifications.d.ts +51 -1
- package/dist/models/schemas.d.ts +1855 -26
- package/dist/models/schemas.js +599 -18
- package/dist/models/types.d.ts +490 -10
- package/dist/sdk/internal.d.ts +62 -2
- package/dist/sdk/internal.js +75 -1
- package/package.json +1 -1
package/dist/sdk/internal.js
CHANGED
|
@@ -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
|
*
|