@l7mp/tivadar-ai-api-sdk 0.1.9 → 0.2.1

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 (66) hide show
  1. package/dist/api-client.d.ts +16 -1
  2. package/dist/api-client.js +9 -0
  3. package/dist/apis/NotificationsApi.d.ts +133 -0
  4. package/dist/apis/NotificationsApi.js +360 -0
  5. package/dist/apis/SIPApi.d.ts +13 -0
  6. package/dist/apis/SIPApi.js +39 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/api-client.d.ts +16 -1
  10. package/dist/esm/api-client.js +9 -0
  11. package/dist/esm/apis/NotificationsApi.d.ts +133 -0
  12. package/dist/esm/apis/NotificationsApi.js +356 -0
  13. package/dist/esm/apis/SIPApi.d.ts +13 -0
  14. package/dist/esm/apis/SIPApi.js +39 -0
  15. package/dist/esm/apis/index.d.ts +1 -0
  16. package/dist/esm/apis/index.js +1 -0
  17. package/dist/esm/models/Notification.d.ts +120 -0
  18. package/dist/esm/models/Notification.js +91 -0
  19. package/dist/esm/models/NotificationChannel.d.ts +26 -0
  20. package/dist/esm/models/NotificationChannel.js +44 -0
  21. package/dist/esm/models/NotificationCreate.d.ts +78 -0
  22. package/dist/esm/models/NotificationCreate.js +63 -0
  23. package/dist/esm/models/NotificationScope.d.ts +26 -0
  24. package/dist/esm/models/NotificationScope.js +44 -0
  25. package/dist/esm/models/NotificationSeverity.d.ts +27 -0
  26. package/dist/esm/models/NotificationSeverity.js +45 -0
  27. package/dist/esm/models/NotificationType.d.ts +25 -0
  28. package/dist/esm/models/NotificationType.js +43 -0
  29. package/dist/esm/models/NotificationUpdate.d.ts +58 -0
  30. package/dist/esm/models/NotificationUpdate.js +51 -0
  31. package/dist/esm/models/OrganizationsOrganizationIdNotificationsGet200Response.d.ts +39 -0
  32. package/dist/esm/models/OrganizationsOrganizationIdNotificationsGet200Response.js +44 -0
  33. package/dist/esm/models/index.d.ts +8 -0
  34. package/dist/esm/models/index.js +8 -0
  35. package/dist/models/Notification.d.ts +120 -0
  36. package/dist/models/Notification.js +98 -0
  37. package/dist/models/NotificationChannel.d.ts +26 -0
  38. package/dist/models/NotificationChannel.js +52 -0
  39. package/dist/models/NotificationCreate.d.ts +78 -0
  40. package/dist/models/NotificationCreate.js +70 -0
  41. package/dist/models/NotificationScope.d.ts +26 -0
  42. package/dist/models/NotificationScope.js +52 -0
  43. package/dist/models/NotificationSeverity.d.ts +27 -0
  44. package/dist/models/NotificationSeverity.js +53 -0
  45. package/dist/models/NotificationType.d.ts +25 -0
  46. package/dist/models/NotificationType.js +51 -0
  47. package/dist/models/NotificationUpdate.d.ts +58 -0
  48. package/dist/models/NotificationUpdate.js +58 -0
  49. package/dist/models/OrganizationsOrganizationIdNotificationsGet200Response.d.ts +39 -0
  50. package/dist/models/OrganizationsOrganizationIdNotificationsGet200Response.js +51 -0
  51. package/dist/models/index.d.ts +8 -0
  52. package/dist/models/index.js +8 -0
  53. package/package.json +1 -1
  54. package/src/api-client.ts +23 -0
  55. package/src/apis/NotificationsApi.ts +509 -0
  56. package/src/apis/SIPApi.ts +51 -0
  57. package/src/apis/index.ts +1 -0
  58. package/src/models/Notification.ts +217 -0
  59. package/src/models/NotificationChannel.ts +54 -0
  60. package/src/models/NotificationCreate.ts +154 -0
  61. package/src/models/NotificationScope.ts +54 -0
  62. package/src/models/NotificationSeverity.ts +55 -0
  63. package/src/models/NotificationType.ts +53 -0
  64. package/src/models/NotificationUpdate.ts +114 -0
  65. package/src/models/OrganizationsOrganizationIdNotificationsGet200Response.ts +81 -0
  66. package/src/models/index.ts +8 -0
package/src/api-client.ts CHANGED
@@ -4,6 +4,7 @@ import { ChatAgentsApi } from "./apis/ChatAgentsApi";
4
4
  import { HistoryApi } from "./apis/HistoryApi";
5
5
  import { InvitationsApi } from "./apis/InvitationsApi";
6
6
  import { MembersApi } from "./apis/MembersApi";
7
+ import { NotificationsApi, type OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum, type OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum } from "./apis/NotificationsApi";
7
8
  import { OrganizationsApi } from "./apis/OrganizationsApi";
8
9
  import { PlaygroundApi } from "./apis/PlaygroundApi";
9
10
  import { RAGApi, type OrganizationsOrganizationIdRagRagConfigNameDocumentsGetStatusEnum } from "./apis/RAGApi";
@@ -20,6 +21,10 @@ import { Configuration } from "./runtime";
20
21
  import type {
21
22
  CallCreate,
22
23
  CallUpdate,
24
+ Notification,
25
+ NotificationScope,
26
+ NotificationSeverity,
27
+ NotificationType,
23
28
  VoiceAgentCreate,
24
29
  VoiceAgentUpdate,
25
30
  ChatAgentCreate,
@@ -41,6 +46,7 @@ import type {
41
46
  UpdatePlanRequest,
42
47
  PauseSubscriptionRequest,
43
48
  BillingPortalRequest,
49
+ OrganizationsOrganizationIdNotificationsGet200Response,
44
50
  } from "./models";
45
51
 
46
52
  export interface ApiClientConfig {
@@ -127,6 +133,7 @@ export class Api {
127
133
  listTrunks: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksGet"]>;
128
134
  createTrunk: (organizationId: string, sipTrunkCreate: SipTrunkCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksPost"]>;
129
135
  deleteTrunk: (organizationId: string, trunkId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksTrunkIdDelete"]>;
136
+ assignPhoneNumber: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipPhoneNumbersAssignPost"]>;
130
137
  createDispatchRule: (organizationId: string, dispatchRuleCreate: DispatchRuleCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesPost"]>;
131
138
  deleteDispatchRule: (organizationId: string, dispatchId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesDispatchIdDelete"]>;
132
139
  listPhoneNumbers: (includeAssigned?: boolean, options?: RequestInit) => ReturnType<SIPApi["phoneNumbersGet"]>;
@@ -156,6 +163,12 @@ export class Api {
156
163
  public readonly ttsProviders: {
157
164
  list: (organizationId: string, options?: RequestInit) => ReturnType<TTSProvidersApi["organizationsOrganizationIdTtsProvidersGet"]>;
158
165
  };
166
+ public readonly notifications: {
167
+ list: (organizationId: string, filters?: { type?: NotificationType; severity?: NotificationSeverity; scope?: NotificationScope; include_dismissed?: OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum; include_expired?: OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum }, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsGet"]>;
168
+ get: (organizationId: string, notificationId: string, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsNotificationIdGet"]>;
169
+ read: (organizationId: string, notificationId: string, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsNotificationIdReadPost"]>;
170
+ dismiss: (organizationId: string, notificationId: string, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsNotificationIdDismissPost"]>;
171
+ };
159
172
  public readonly embeddingProviders: {
160
173
  list: (organizationId: string, options?: RequestInit) => ReturnType<EmbeddingProvidersApi["organizationsOrganizationIdEmbeddingProvidersGet"]>;
161
174
  };
@@ -172,6 +185,7 @@ export class Api {
172
185
  private readonly ragApi: RAGApi;
173
186
  private readonly recordingsApi: RecordingsApi;
174
187
  private readonly sipApi: SIPApi;
188
+ private readonly notificationsApi: NotificationsApi;
175
189
  private readonly subscriptionApi: SubscriptionApi;
176
190
  private readonly embeddingProvidersApi: EmbeddingProvidersApi;
177
191
  private readonly llmProvidersApi: LLMProvidersApi;
@@ -209,6 +223,7 @@ export class Api {
209
223
  this.ragApi = new RAGApi(configuration);
210
224
  this.recordingsApi = new RecordingsApi(configuration);
211
225
  this.sipApi = new SIPApi(configuration);
226
+ this.notificationsApi = new NotificationsApi(configuration);
212
227
  this.subscriptionApi = new SubscriptionApi(configuration);
213
228
  this.embeddingProvidersApi = new EmbeddingProvidersApi(configuration);
214
229
  this.llmProvidersApi = new LLMProvidersApi(configuration);
@@ -305,6 +320,7 @@ export class Api {
305
320
  listTrunks: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipTrunksGet({ organizationId }, options),
306
321
  createTrunk: (organizationId, sipTrunkCreate, options) => this.sipApi.organizationsOrganizationIdSipTrunksPost({ organizationId, sipTrunkCreate }, options),
307
322
  deleteTrunk: (organizationId, trunkId, options) => this.sipApi.organizationsOrganizationIdSipTrunksTrunkIdDelete({ organizationId, trunkId }, options),
323
+ assignPhoneNumber: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipPhoneNumbersAssignPost({ organizationId }, options),
308
324
  createDispatchRule: (organizationId, dispatchRuleCreate, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesPost({ organizationId, dispatchRuleCreate }, options),
309
325
  deleteDispatchRule: (organizationId, dispatchId, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesDispatchIdDelete({ organizationId, dispatchId }, options),
310
326
  listPhoneNumbers: (includeAssigned, options) => this.sipApi.phoneNumbersGet({ includeAssigned }, options),
@@ -312,6 +328,13 @@ export class Api {
312
328
  deletePhoneNumber: (phoneNumberId, options) => this.sipApi.phoneNumbersPhoneNumberIdDelete({ phoneNumberId }, options),
313
329
  };
314
330
 
331
+ this.notifications = {
332
+ list: (organizationId, filters, options) => this.notificationsApi.organizationsOrganizationIdNotificationsGet({ organizationId, type: filters?.type, severity: filters?.severity, scope: filters?.scope, includeDismissed: filters?.include_dismissed, includeExpired: filters?.include_expired }, options),
333
+ get: (organizationId, notificationId, options) => this.notificationsApi.organizationsOrganizationIdNotificationsNotificationIdGet({ organizationId, notificationId }, options),
334
+ read: (organizationId, notificationId, options) => this.notificationsApi.organizationsOrganizationIdNotificationsNotificationIdReadPost({ organizationId, notificationId }, options),
335
+ dismiss: (organizationId, notificationId, options) => this.notificationsApi.organizationsOrganizationIdNotificationsNotificationIdDismissPost({ organizationId, notificationId }, options),
336
+ };
337
+
315
338
  this.subscription = {
316
339
  getStatus: (organizationId, options) => this.subscriptionApi.organizationsOrganizationIdSubscriptionGet({ organizationId }, options),
317
340
  getDetails: (organizationId, options) => this.subscriptionApi.organizationsOrganizationIdSubscriptionDetailsGet({ organizationId }, options),
@@ -0,0 +1,509 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Tivadar AI Backend API
5
+ * Unified REST API for Tivadar AI Voice Agents platform
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ Notification,
19
+ NotificationCreate,
20
+ NotificationScope,
21
+ NotificationSeverity,
22
+ NotificationType,
23
+ NotificationUpdate,
24
+ OrganizationsOrganizationIdNotificationsGet200Response,
25
+ } from '../models/index';
26
+ import {
27
+ NotificationFromJSON,
28
+ NotificationToJSON,
29
+ NotificationCreateFromJSON,
30
+ NotificationCreateToJSON,
31
+ NotificationScopeFromJSON,
32
+ NotificationScopeToJSON,
33
+ NotificationSeverityFromJSON,
34
+ NotificationSeverityToJSON,
35
+ NotificationTypeFromJSON,
36
+ NotificationTypeToJSON,
37
+ NotificationUpdateFromJSON,
38
+ NotificationUpdateToJSON,
39
+ OrganizationsOrganizationIdNotificationsGet200ResponseFromJSON,
40
+ OrganizationsOrganizationIdNotificationsGet200ResponseToJSON,
41
+ } from '../models/index';
42
+
43
+ export interface OrganizationsOrganizationIdNotificationsGetRequest {
44
+ organizationId: string;
45
+ type?: NotificationType;
46
+ severity?: NotificationSeverity;
47
+ scope?: NotificationScope;
48
+ includeDismissed?: OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum;
49
+ includeExpired?: OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum;
50
+ }
51
+
52
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdDeleteRequest {
53
+ organizationId: string;
54
+ notificationId: string;
55
+ }
56
+
57
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdDismissPostRequest {
58
+ organizationId: string;
59
+ notificationId: string;
60
+ }
61
+
62
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdGetRequest {
63
+ organizationId: string;
64
+ notificationId: string;
65
+ }
66
+
67
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdPutRequest {
68
+ organizationId: string;
69
+ notificationId: string;
70
+ notificationUpdate: NotificationUpdate;
71
+ }
72
+
73
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdReadPostRequest {
74
+ organizationId: string;
75
+ notificationId: string;
76
+ }
77
+
78
+ export interface OrganizationsOrganizationIdNotificationsPostRequest {
79
+ organizationId: string;
80
+ notificationCreate: NotificationCreate;
81
+ }
82
+
83
+ /**
84
+ *
85
+ */
86
+ export class NotificationsApi extends runtime.BaseAPI {
87
+
88
+ /**
89
+ * Returns all notifications relevant to the current user within the organization context. Includes global announcements, organization-scoped notifications, and user-specific notifications. Dismissed and expired notifications are excluded by default. Content supports markdown formatting and embedded links.
90
+ * List notifications for the current user
91
+ */
92
+ async organizationsOrganizationIdNotificationsGetRaw(requestParameters: OrganizationsOrganizationIdNotificationsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrganizationsOrganizationIdNotificationsGet200Response>> {
93
+ if (requestParameters['organizationId'] == null) {
94
+ throw new runtime.RequiredError(
95
+ 'organizationId',
96
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsGet().'
97
+ );
98
+ }
99
+
100
+ const queryParameters: any = {};
101
+
102
+ if (requestParameters['type'] != null) {
103
+ queryParameters['type'] = requestParameters['type'];
104
+ }
105
+
106
+ if (requestParameters['severity'] != null) {
107
+ queryParameters['severity'] = requestParameters['severity'];
108
+ }
109
+
110
+ if (requestParameters['scope'] != null) {
111
+ queryParameters['scope'] = requestParameters['scope'];
112
+ }
113
+
114
+ if (requestParameters['includeDismissed'] != null) {
115
+ queryParameters['include_dismissed'] = requestParameters['includeDismissed'];
116
+ }
117
+
118
+ if (requestParameters['includeExpired'] != null) {
119
+ queryParameters['include_expired'] = requestParameters['includeExpired'];
120
+ }
121
+
122
+ const headerParameters: runtime.HTTPHeaders = {};
123
+
124
+ if (this.configuration && this.configuration.accessToken) {
125
+ const token = this.configuration.accessToken;
126
+ const tokenString = await token("bearerAuth", []);
127
+
128
+ if (tokenString) {
129
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
130
+ }
131
+ }
132
+
133
+ let urlPath = `/organizations/{organizationId}/notifications`;
134
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
135
+
136
+ const response = await this.request({
137
+ path: urlPath,
138
+ method: 'GET',
139
+ headers: headerParameters,
140
+ query: queryParameters,
141
+ }, initOverrides);
142
+
143
+ return new runtime.JSONApiResponse(response, (jsonValue) => OrganizationsOrganizationIdNotificationsGet200ResponseFromJSON(jsonValue));
144
+ }
145
+
146
+ /**
147
+ * Returns all notifications relevant to the current user within the organization context. Includes global announcements, organization-scoped notifications, and user-specific notifications. Dismissed and expired notifications are excluded by default. Content supports markdown formatting and embedded links.
148
+ * List notifications for the current user
149
+ */
150
+ async organizationsOrganizationIdNotificationsGet(requestParameters: OrganizationsOrganizationIdNotificationsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrganizationsOrganizationIdNotificationsGet200Response> {
151
+ const response = await this.organizationsOrganizationIdNotificationsGetRaw(requestParameters, initOverrides);
152
+ return await response.value();
153
+ }
154
+
155
+ /**
156
+ * Delete a notification (admin only)
157
+ */
158
+ async organizationsOrganizationIdNotificationsNotificationIdDeleteRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
159
+ if (requestParameters['organizationId'] == null) {
160
+ throw new runtime.RequiredError(
161
+ 'organizationId',
162
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDelete().'
163
+ );
164
+ }
165
+
166
+ if (requestParameters['notificationId'] == null) {
167
+ throw new runtime.RequiredError(
168
+ 'notificationId',
169
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDelete().'
170
+ );
171
+ }
172
+
173
+ const queryParameters: any = {};
174
+
175
+ const headerParameters: runtime.HTTPHeaders = {};
176
+
177
+ if (this.configuration && this.configuration.accessToken) {
178
+ const token = this.configuration.accessToken;
179
+ const tokenString = await token("bearerAuth", []);
180
+
181
+ if (tokenString) {
182
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
183
+ }
184
+ }
185
+
186
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}`;
187
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
188
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
189
+
190
+ const response = await this.request({
191
+ path: urlPath,
192
+ method: 'DELETE',
193
+ headers: headerParameters,
194
+ query: queryParameters,
195
+ }, initOverrides);
196
+
197
+ return new runtime.VoidApiResponse(response);
198
+ }
199
+
200
+ /**
201
+ * Delete a notification (admin only)
202
+ */
203
+ async organizationsOrganizationIdNotificationsNotificationIdDelete(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
204
+ await this.organizationsOrganizationIdNotificationsNotificationIdDeleteRaw(requestParameters, initOverrides);
205
+ }
206
+
207
+ /**
208
+ * Dismisses the notification for the current user. Dismissed notifications are hidden by default.
209
+ * Dismiss a notification
210
+ */
211
+ async organizationsOrganizationIdNotificationsNotificationIdDismissPostRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDismissPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
212
+ if (requestParameters['organizationId'] == null) {
213
+ throw new runtime.RequiredError(
214
+ 'organizationId',
215
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDismissPost().'
216
+ );
217
+ }
218
+
219
+ if (requestParameters['notificationId'] == null) {
220
+ throw new runtime.RequiredError(
221
+ 'notificationId',
222
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDismissPost().'
223
+ );
224
+ }
225
+
226
+ const queryParameters: any = {};
227
+
228
+ const headerParameters: runtime.HTTPHeaders = {};
229
+
230
+ if (this.configuration && this.configuration.accessToken) {
231
+ const token = this.configuration.accessToken;
232
+ const tokenString = await token("bearerAuth", []);
233
+
234
+ if (tokenString) {
235
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
236
+ }
237
+ }
238
+
239
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}/dismiss`;
240
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
241
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
242
+
243
+ const response = await this.request({
244
+ path: urlPath,
245
+ method: 'POST',
246
+ headers: headerParameters,
247
+ query: queryParameters,
248
+ }, initOverrides);
249
+
250
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
251
+ }
252
+
253
+ /**
254
+ * Dismisses the notification for the current user. Dismissed notifications are hidden by default.
255
+ * Dismiss a notification
256
+ */
257
+ async organizationsOrganizationIdNotificationsNotificationIdDismissPost(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDismissPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
258
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdDismissPostRaw(requestParameters, initOverrides);
259
+ return await response.value();
260
+ }
261
+
262
+ /**
263
+ * Get a notification by ID
264
+ */
265
+ async organizationsOrganizationIdNotificationsNotificationIdGetRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
266
+ if (requestParameters['organizationId'] == null) {
267
+ throw new runtime.RequiredError(
268
+ 'organizationId',
269
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdGet().'
270
+ );
271
+ }
272
+
273
+ if (requestParameters['notificationId'] == null) {
274
+ throw new runtime.RequiredError(
275
+ 'notificationId',
276
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdGet().'
277
+ );
278
+ }
279
+
280
+ const queryParameters: any = {};
281
+
282
+ const headerParameters: runtime.HTTPHeaders = {};
283
+
284
+ if (this.configuration && this.configuration.accessToken) {
285
+ const token = this.configuration.accessToken;
286
+ const tokenString = await token("bearerAuth", []);
287
+
288
+ if (tokenString) {
289
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
290
+ }
291
+ }
292
+
293
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}`;
294
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
295
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
296
+
297
+ const response = await this.request({
298
+ path: urlPath,
299
+ method: 'GET',
300
+ headers: headerParameters,
301
+ query: queryParameters,
302
+ }, initOverrides);
303
+
304
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
305
+ }
306
+
307
+ /**
308
+ * Get a notification by ID
309
+ */
310
+ async organizationsOrganizationIdNotificationsNotificationIdGet(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
311
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdGetRaw(requestParameters, initOverrides);
312
+ return await response.value();
313
+ }
314
+
315
+ /**
316
+ * Partial update — only provided fields are modified. Content supports markdown.
317
+ * Update a notification (admin only)
318
+ */
319
+ async organizationsOrganizationIdNotificationsNotificationIdPutRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
320
+ if (requestParameters['organizationId'] == null) {
321
+ throw new runtime.RequiredError(
322
+ 'organizationId',
323
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdPut().'
324
+ );
325
+ }
326
+
327
+ if (requestParameters['notificationId'] == null) {
328
+ throw new runtime.RequiredError(
329
+ 'notificationId',
330
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdPut().'
331
+ );
332
+ }
333
+
334
+ if (requestParameters['notificationUpdate'] == null) {
335
+ throw new runtime.RequiredError(
336
+ 'notificationUpdate',
337
+ 'Required parameter "notificationUpdate" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdPut().'
338
+ );
339
+ }
340
+
341
+ const queryParameters: any = {};
342
+
343
+ const headerParameters: runtime.HTTPHeaders = {};
344
+
345
+ headerParameters['Content-Type'] = 'application/json';
346
+
347
+ if (this.configuration && this.configuration.accessToken) {
348
+ const token = this.configuration.accessToken;
349
+ const tokenString = await token("bearerAuth", []);
350
+
351
+ if (tokenString) {
352
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
353
+ }
354
+ }
355
+
356
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}`;
357
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
358
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
359
+
360
+ const response = await this.request({
361
+ path: urlPath,
362
+ method: 'PUT',
363
+ headers: headerParameters,
364
+ query: queryParameters,
365
+ body: NotificationUpdateToJSON(requestParameters['notificationUpdate']),
366
+ }, initOverrides);
367
+
368
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
369
+ }
370
+
371
+ /**
372
+ * Partial update — only provided fields are modified. Content supports markdown.
373
+ * Update a notification (admin only)
374
+ */
375
+ async organizationsOrganizationIdNotificationsNotificationIdPut(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
376
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdPutRaw(requestParameters, initOverrides);
377
+ return await response.value();
378
+ }
379
+
380
+ /**
381
+ * Marks the notification as read for the current user. Idempotent.
382
+ * Mark a notification as read
383
+ */
384
+ async organizationsOrganizationIdNotificationsNotificationIdReadPostRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdReadPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
385
+ if (requestParameters['organizationId'] == null) {
386
+ throw new runtime.RequiredError(
387
+ 'organizationId',
388
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdReadPost().'
389
+ );
390
+ }
391
+
392
+ if (requestParameters['notificationId'] == null) {
393
+ throw new runtime.RequiredError(
394
+ 'notificationId',
395
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdReadPost().'
396
+ );
397
+ }
398
+
399
+ const queryParameters: any = {};
400
+
401
+ const headerParameters: runtime.HTTPHeaders = {};
402
+
403
+ if (this.configuration && this.configuration.accessToken) {
404
+ const token = this.configuration.accessToken;
405
+ const tokenString = await token("bearerAuth", []);
406
+
407
+ if (tokenString) {
408
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
409
+ }
410
+ }
411
+
412
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}/read`;
413
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
414
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
415
+
416
+ const response = await this.request({
417
+ path: urlPath,
418
+ method: 'POST',
419
+ headers: headerParameters,
420
+ query: queryParameters,
421
+ }, initOverrides);
422
+
423
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
424
+ }
425
+
426
+ /**
427
+ * Marks the notification as read for the current user. Idempotent.
428
+ * Mark a notification as read
429
+ */
430
+ async organizationsOrganizationIdNotificationsNotificationIdReadPost(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdReadPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
431
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdReadPostRaw(requestParameters, initOverrides);
432
+ return await response.value();
433
+ }
434
+
435
+ /**
436
+ * Create a new notification or announcement. Only organization admins can create notifications. Content supports markdown formatting and embedded links. Set scope to \'global\' for announcements visible to all users, \'organization\' for org members only, or \'user\' for a specific user.
437
+ * Create a notification (admin only)
438
+ */
439
+ async organizationsOrganizationIdNotificationsPostRaw(requestParameters: OrganizationsOrganizationIdNotificationsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
440
+ if (requestParameters['organizationId'] == null) {
441
+ throw new runtime.RequiredError(
442
+ 'organizationId',
443
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsPost().'
444
+ );
445
+ }
446
+
447
+ if (requestParameters['notificationCreate'] == null) {
448
+ throw new runtime.RequiredError(
449
+ 'notificationCreate',
450
+ 'Required parameter "notificationCreate" was null or undefined when calling organizationsOrganizationIdNotificationsPost().'
451
+ );
452
+ }
453
+
454
+ const queryParameters: any = {};
455
+
456
+ const headerParameters: runtime.HTTPHeaders = {};
457
+
458
+ headerParameters['Content-Type'] = 'application/json';
459
+
460
+ if (this.configuration && this.configuration.accessToken) {
461
+ const token = this.configuration.accessToken;
462
+ const tokenString = await token("bearerAuth", []);
463
+
464
+ if (tokenString) {
465
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
466
+ }
467
+ }
468
+
469
+ let urlPath = `/organizations/{organizationId}/notifications`;
470
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
471
+
472
+ const response = await this.request({
473
+ path: urlPath,
474
+ method: 'POST',
475
+ headers: headerParameters,
476
+ query: queryParameters,
477
+ body: NotificationCreateToJSON(requestParameters['notificationCreate']),
478
+ }, initOverrides);
479
+
480
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
481
+ }
482
+
483
+ /**
484
+ * Create a new notification or announcement. Only organization admins can create notifications. Content supports markdown formatting and embedded links. Set scope to \'global\' for announcements visible to all users, \'organization\' for org members only, or \'user\' for a specific user.
485
+ * Create a notification (admin only)
486
+ */
487
+ async organizationsOrganizationIdNotificationsPost(requestParameters: OrganizationsOrganizationIdNotificationsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
488
+ const response = await this.organizationsOrganizationIdNotificationsPostRaw(requestParameters, initOverrides);
489
+ return await response.value();
490
+ }
491
+
492
+ }
493
+
494
+ /**
495
+ * @export
496
+ */
497
+ export const OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum = {
498
+ True: 'true',
499
+ False: 'false'
500
+ } as const;
501
+ export type OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum = typeof OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum[keyof typeof OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum];
502
+ /**
503
+ * @export
504
+ */
505
+ export const OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum = {
506
+ True: 'true',
507
+ False: 'false'
508
+ } as const;
509
+ export type OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum = typeof OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum[keyof typeof OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum];
@@ -47,6 +47,10 @@ export interface OrganizationsOrganizationIdSipDispatchRulesPostRequest {
47
47
  dispatchRuleCreate: DispatchRuleCreate;
48
48
  }
49
49
 
50
+ export interface OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest {
51
+ organizationId: string;
52
+ }
53
+
50
54
  export interface OrganizationsOrganizationIdSipTrunksGetRequest {
51
55
  organizationId: string;
52
56
  }
@@ -185,6 +189,53 @@ export class SIPApi extends runtime.BaseAPI {
185
189
  return await response.value();
186
190
  }
187
191
 
192
+ /**
193
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
194
+ * Assign an available phone number to the organization
195
+ */
196
+ async organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SipTrunkWithAgent>> {
197
+ if (requestParameters['organizationId'] == null) {
198
+ throw new runtime.RequiredError(
199
+ 'organizationId',
200
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersAssignPost().'
201
+ );
202
+ }
203
+
204
+ const queryParameters: any = {};
205
+
206
+ const headerParameters: runtime.HTTPHeaders = {};
207
+
208
+ if (this.configuration && this.configuration.accessToken) {
209
+ const token = this.configuration.accessToken;
210
+ const tokenString = await token("bearerAuth", []);
211
+
212
+ if (tokenString) {
213
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
214
+ }
215
+ }
216
+
217
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/assign`;
218
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
219
+
220
+ const response = await this.request({
221
+ path: urlPath,
222
+ method: 'POST',
223
+ headers: headerParameters,
224
+ query: queryParameters,
225
+ }, initOverrides);
226
+
227
+ return new runtime.JSONApiResponse(response, (jsonValue) => SipTrunkWithAgentFromJSON(jsonValue));
228
+ }
229
+
230
+ /**
231
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
232
+ * Assign an available phone number to the organization
233
+ */
234
+ async organizationsOrganizationIdSipPhoneNumbersAssignPost(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SipTrunkWithAgent> {
235
+ const response = await this.organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters, initOverrides);
236
+ return await response.value();
237
+ }
238
+
188
239
  /**
189
240
  * List all SIP trunks for an organization
190
241
  */
package/src/apis/index.ts CHANGED
@@ -8,6 +8,7 @@ export * from './HistoryApi';
8
8
  export * from './InvitationsApi';
9
9
  export * from './LLMProvidersApi';
10
10
  export * from './MembersApi';
11
+ export * from './NotificationsApi';
11
12
  export * from './OrganizationsApi';
12
13
  export * from './PlaygroundApi';
13
14
  export * from './RAGApi';