@l7mp/tivadar-ai-api-sdk 0.2.6 → 0.2.7

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 (56) hide show
  1. package/dist/api-client.d.ts +20 -1
  2. package/dist/api-client.js +15 -0
  3. package/dist/apis/PhonebookApi.d.ts +133 -0
  4. package/dist/apis/PhonebookApi.js +434 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/api-client.d.ts +20 -1
  8. package/dist/esm/api-client.js +15 -0
  9. package/dist/esm/apis/PhonebookApi.d.ts +133 -0
  10. package/dist/esm/apis/PhonebookApi.js +430 -0
  11. package/dist/esm/apis/index.d.ts +1 -0
  12. package/dist/esm/apis/index.js +1 -0
  13. package/dist/esm/models/Phonebook.d.ts +56 -0
  14. package/dist/esm/models/Phonebook.js +59 -0
  15. package/dist/esm/models/PhonebookEntry.d.ts +89 -0
  16. package/dist/esm/models/PhonebookEntry.js +79 -0
  17. package/dist/esm/models/PhonebookEntryCreate.d.ts +50 -0
  18. package/dist/esm/models/PhonebookEntryCreate.js +51 -0
  19. package/dist/esm/models/PhonebookEntryUpdate.d.ts +50 -0
  20. package/dist/esm/models/PhonebookEntryUpdate.js +47 -0
  21. package/dist/esm/models/PhonebookImportResult.d.ts +57 -0
  22. package/dist/esm/models/PhonebookImportResult.js +60 -0
  23. package/dist/esm/models/PhonebookImportResultErrorsInner.d.ts +38 -0
  24. package/dist/esm/models/PhonebookImportResultErrorsInner.js +47 -0
  25. package/dist/esm/models/PhonebookUpdate.d.ts +32 -0
  26. package/dist/esm/models/PhonebookUpdate.js +41 -0
  27. package/dist/esm/models/index.d.ts +7 -0
  28. package/dist/esm/models/index.js +7 -0
  29. package/dist/models/Phonebook.d.ts +56 -0
  30. package/dist/models/Phonebook.js +66 -0
  31. package/dist/models/PhonebookEntry.d.ts +89 -0
  32. package/dist/models/PhonebookEntry.js +87 -0
  33. package/dist/models/PhonebookEntryCreate.d.ts +50 -0
  34. package/dist/models/PhonebookEntryCreate.js +58 -0
  35. package/dist/models/PhonebookEntryUpdate.d.ts +50 -0
  36. package/dist/models/PhonebookEntryUpdate.js +54 -0
  37. package/dist/models/PhonebookImportResult.d.ts +57 -0
  38. package/dist/models/PhonebookImportResult.js +67 -0
  39. package/dist/models/PhonebookImportResultErrorsInner.d.ts +38 -0
  40. package/dist/models/PhonebookImportResultErrorsInner.js +54 -0
  41. package/dist/models/PhonebookUpdate.d.ts +32 -0
  42. package/dist/models/PhonebookUpdate.js +48 -0
  43. package/dist/models/index.d.ts +7 -0
  44. package/dist/models/index.js +7 -0
  45. package/package.json +1 -1
  46. package/src/api-client.ts +33 -0
  47. package/src/apis/PhonebookApi.ts +599 -0
  48. package/src/apis/index.ts +1 -0
  49. package/src/models/Phonebook.ts +102 -0
  50. package/src/models/PhonebookEntry.ts +148 -0
  51. package/src/models/PhonebookEntryCreate.ts +91 -0
  52. package/src/models/PhonebookEntryUpdate.ts +89 -0
  53. package/src/models/PhonebookImportResult.ts +110 -0
  54. package/src/models/PhonebookImportResultErrorsInner.ts +75 -0
  55. package/src/models/PhonebookUpdate.ts +65 -0
  56. package/src/models/index.ts +7 -0
@@ -0,0 +1,599 @@
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
+ Phonebook,
19
+ PhonebookEntry,
20
+ PhonebookEntryCreate,
21
+ PhonebookEntryUpdate,
22
+ PhonebookImportResult,
23
+ PhonebookUpdate,
24
+ } from '../models/index';
25
+ import {
26
+ PhonebookFromJSON,
27
+ PhonebookToJSON,
28
+ PhonebookEntryFromJSON,
29
+ PhonebookEntryToJSON,
30
+ PhonebookEntryCreateFromJSON,
31
+ PhonebookEntryCreateToJSON,
32
+ PhonebookEntryUpdateFromJSON,
33
+ PhonebookEntryUpdateToJSON,
34
+ PhonebookImportResultFromJSON,
35
+ PhonebookImportResultToJSON,
36
+ PhonebookUpdateFromJSON,
37
+ PhonebookUpdateToJSON,
38
+ } from '../models/index';
39
+
40
+ export interface OrganizationsOrganizationIdPhonebookEntriesEntryIdDeleteRequest {
41
+ organizationId: string;
42
+ entryId: string;
43
+ }
44
+
45
+ export interface OrganizationsOrganizationIdPhonebookEntriesEntryIdGetRequest {
46
+ organizationId: string;
47
+ entryId: string;
48
+ }
49
+
50
+ export interface OrganizationsOrganizationIdPhonebookEntriesEntryIdPatchRequest {
51
+ organizationId: string;
52
+ entryId: string;
53
+ phonebookEntryUpdate: PhonebookEntryUpdate;
54
+ }
55
+
56
+ export interface OrganizationsOrganizationIdPhonebookEntriesExportGetRequest {
57
+ organizationId: string;
58
+ }
59
+
60
+ export interface OrganizationsOrganizationIdPhonebookEntriesGetRequest {
61
+ organizationId: string;
62
+ search?: string;
63
+ limit?: number;
64
+ offset?: number;
65
+ }
66
+
67
+ export interface OrganizationsOrganizationIdPhonebookEntriesImportPostRequest {
68
+ organizationId: string;
69
+ file: Blob;
70
+ }
71
+
72
+ export interface OrganizationsOrganizationIdPhonebookEntriesPostRequest {
73
+ organizationId: string;
74
+ phonebookEntryCreate: PhonebookEntryCreate;
75
+ }
76
+
77
+ export interface OrganizationsOrganizationIdPhonebookGetRequest {
78
+ organizationId: string;
79
+ }
80
+
81
+ export interface OrganizationsOrganizationIdPhonebookPatchRequest {
82
+ organizationId: string;
83
+ phonebookUpdate: PhonebookUpdate;
84
+ }
85
+
86
+ /**
87
+ *
88
+ */
89
+ export class PhonebookApi extends runtime.BaseAPI {
90
+
91
+ /**
92
+ * Delete a phonebook entry
93
+ */
94
+ async organizationsOrganizationIdPhonebookEntriesEntryIdDeleteRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
95
+ if (requestParameters['organizationId'] == null) {
96
+ throw new runtime.RequiredError(
97
+ 'organizationId',
98
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdDelete().'
99
+ );
100
+ }
101
+
102
+ if (requestParameters['entryId'] == null) {
103
+ throw new runtime.RequiredError(
104
+ 'entryId',
105
+ 'Required parameter "entryId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdDelete().'
106
+ );
107
+ }
108
+
109
+ const queryParameters: any = {};
110
+
111
+ const headerParameters: runtime.HTTPHeaders = {};
112
+
113
+ if (this.configuration && this.configuration.accessToken) {
114
+ const token = this.configuration.accessToken;
115
+ const tokenString = await token("bearerAuth", []);
116
+
117
+ if (tokenString) {
118
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
119
+ }
120
+ }
121
+
122
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/{entryId}`;
123
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
124
+ urlPath = urlPath.replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters['entryId'])));
125
+
126
+ const response = await this.request({
127
+ path: urlPath,
128
+ method: 'DELETE',
129
+ headers: headerParameters,
130
+ query: queryParameters,
131
+ }, initOverrides);
132
+
133
+ return new runtime.VoidApiResponse(response);
134
+ }
135
+
136
+ /**
137
+ * Delete a phonebook entry
138
+ */
139
+ async organizationsOrganizationIdPhonebookEntriesEntryIdDelete(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
140
+ await this.organizationsOrganizationIdPhonebookEntriesEntryIdDeleteRaw(requestParameters, initOverrides);
141
+ }
142
+
143
+ /**
144
+ * Get a phonebook entry by ID
145
+ */
146
+ async organizationsOrganizationIdPhonebookEntriesEntryIdGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookEntry>> {
147
+ if (requestParameters['organizationId'] == null) {
148
+ throw new runtime.RequiredError(
149
+ 'organizationId',
150
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdGet().'
151
+ );
152
+ }
153
+
154
+ if (requestParameters['entryId'] == null) {
155
+ throw new runtime.RequiredError(
156
+ 'entryId',
157
+ 'Required parameter "entryId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdGet().'
158
+ );
159
+ }
160
+
161
+ const queryParameters: any = {};
162
+
163
+ const headerParameters: runtime.HTTPHeaders = {};
164
+
165
+ if (this.configuration && this.configuration.accessToken) {
166
+ const token = this.configuration.accessToken;
167
+ const tokenString = await token("bearerAuth", []);
168
+
169
+ if (tokenString) {
170
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
171
+ }
172
+ }
173
+
174
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/{entryId}`;
175
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
176
+ urlPath = urlPath.replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters['entryId'])));
177
+
178
+ const response = await this.request({
179
+ path: urlPath,
180
+ method: 'GET',
181
+ headers: headerParameters,
182
+ query: queryParameters,
183
+ }, initOverrides);
184
+
185
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhonebookEntryFromJSON(jsonValue));
186
+ }
187
+
188
+ /**
189
+ * Get a phonebook entry by ID
190
+ */
191
+ async organizationsOrganizationIdPhonebookEntriesEntryIdGet(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookEntry> {
192
+ const response = await this.organizationsOrganizationIdPhonebookEntriesEntryIdGetRaw(requestParameters, initOverrides);
193
+ return await response.value();
194
+ }
195
+
196
+ /**
197
+ * Update a phonebook entry
198
+ */
199
+ async organizationsOrganizationIdPhonebookEntriesEntryIdPatchRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookEntry>> {
200
+ if (requestParameters['organizationId'] == null) {
201
+ throw new runtime.RequiredError(
202
+ 'organizationId',
203
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdPatch().'
204
+ );
205
+ }
206
+
207
+ if (requestParameters['entryId'] == null) {
208
+ throw new runtime.RequiredError(
209
+ 'entryId',
210
+ 'Required parameter "entryId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdPatch().'
211
+ );
212
+ }
213
+
214
+ if (requestParameters['phonebookEntryUpdate'] == null) {
215
+ throw new runtime.RequiredError(
216
+ 'phonebookEntryUpdate',
217
+ 'Required parameter "phonebookEntryUpdate" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdPatch().'
218
+ );
219
+ }
220
+
221
+ const queryParameters: any = {};
222
+
223
+ const headerParameters: runtime.HTTPHeaders = {};
224
+
225
+ headerParameters['Content-Type'] = 'application/json';
226
+
227
+ if (this.configuration && this.configuration.accessToken) {
228
+ const token = this.configuration.accessToken;
229
+ const tokenString = await token("bearerAuth", []);
230
+
231
+ if (tokenString) {
232
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
233
+ }
234
+ }
235
+
236
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/{entryId}`;
237
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
238
+ urlPath = urlPath.replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters['entryId'])));
239
+
240
+ const response = await this.request({
241
+ path: urlPath,
242
+ method: 'PATCH',
243
+ headers: headerParameters,
244
+ query: queryParameters,
245
+ body: PhonebookEntryUpdateToJSON(requestParameters['phonebookEntryUpdate']),
246
+ }, initOverrides);
247
+
248
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhonebookEntryFromJSON(jsonValue));
249
+ }
250
+
251
+ /**
252
+ * Update a phonebook entry
253
+ */
254
+ async organizationsOrganizationIdPhonebookEntriesEntryIdPatch(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookEntry> {
255
+ const response = await this.organizationsOrganizationIdPhonebookEntriesEntryIdPatchRaw(requestParameters, initOverrides);
256
+ return await response.value();
257
+ }
258
+
259
+ /**
260
+ * Export phonebook entries as CSV
261
+ */
262
+ async organizationsOrganizationIdPhonebookEntriesExportGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesExportGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
263
+ if (requestParameters['organizationId'] == null) {
264
+ throw new runtime.RequiredError(
265
+ 'organizationId',
266
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesExportGet().'
267
+ );
268
+ }
269
+
270
+ const queryParameters: any = {};
271
+
272
+ const headerParameters: runtime.HTTPHeaders = {};
273
+
274
+ if (this.configuration && this.configuration.accessToken) {
275
+ const token = this.configuration.accessToken;
276
+ const tokenString = await token("bearerAuth", []);
277
+
278
+ if (tokenString) {
279
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
280
+ }
281
+ }
282
+
283
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/export`;
284
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
285
+
286
+ const response = await this.request({
287
+ path: urlPath,
288
+ method: 'GET',
289
+ headers: headerParameters,
290
+ query: queryParameters,
291
+ }, initOverrides);
292
+
293
+ if (this.isJsonMime(response.headers.get('content-type'))) {
294
+ return new runtime.JSONApiResponse<string>(response);
295
+ } else {
296
+ return new runtime.TextApiResponse(response) as any;
297
+ }
298
+ }
299
+
300
+ /**
301
+ * Export phonebook entries as CSV
302
+ */
303
+ async organizationsOrganizationIdPhonebookEntriesExportGet(requestParameters: OrganizationsOrganizationIdPhonebookEntriesExportGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
304
+ const response = await this.organizationsOrganizationIdPhonebookEntriesExportGetRaw(requestParameters, initOverrides);
305
+ return await response.value();
306
+ }
307
+
308
+ /**
309
+ * List phonebook entries
310
+ */
311
+ async organizationsOrganizationIdPhonebookEntriesGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PhonebookEntry>>> {
312
+ if (requestParameters['organizationId'] == null) {
313
+ throw new runtime.RequiredError(
314
+ 'organizationId',
315
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesGet().'
316
+ );
317
+ }
318
+
319
+ const queryParameters: any = {};
320
+
321
+ if (requestParameters['search'] != null) {
322
+ queryParameters['search'] = requestParameters['search'];
323
+ }
324
+
325
+ if (requestParameters['limit'] != null) {
326
+ queryParameters['limit'] = requestParameters['limit'];
327
+ }
328
+
329
+ if (requestParameters['offset'] != null) {
330
+ queryParameters['offset'] = requestParameters['offset'];
331
+ }
332
+
333
+ const headerParameters: runtime.HTTPHeaders = {};
334
+
335
+ if (this.configuration && this.configuration.accessToken) {
336
+ const token = this.configuration.accessToken;
337
+ const tokenString = await token("bearerAuth", []);
338
+
339
+ if (tokenString) {
340
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
341
+ }
342
+ }
343
+
344
+ let urlPath = `/organizations/{organizationId}/phonebook/entries`;
345
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
346
+
347
+ const response = await this.request({
348
+ path: urlPath,
349
+ method: 'GET',
350
+ headers: headerParameters,
351
+ query: queryParameters,
352
+ }, initOverrides);
353
+
354
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PhonebookEntryFromJSON));
355
+ }
356
+
357
+ /**
358
+ * List phonebook entries
359
+ */
360
+ async organizationsOrganizationIdPhonebookEntriesGet(requestParameters: OrganizationsOrganizationIdPhonebookEntriesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PhonebookEntry>> {
361
+ const response = await this.organizationsOrganizationIdPhonebookEntriesGetRaw(requestParameters, initOverrides);
362
+ return await response.value();
363
+ }
364
+
365
+ /**
366
+ * Upload a CSV file. The header row is required and must contain at least `phone` and `name` columns. Optional columns: `company`, `email`. Header aliases (case-insensitive): phone/phone_number/number, name/full_name/contact, company/organization, email/email_address. Existing entries with the same phone are updated; new ones are inserted.
367
+ * Import phonebook entries from a CSV file
368
+ */
369
+ async organizationsOrganizationIdPhonebookEntriesImportPostRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesImportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookImportResult>> {
370
+ if (requestParameters['organizationId'] == null) {
371
+ throw new runtime.RequiredError(
372
+ 'organizationId',
373
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesImportPost().'
374
+ );
375
+ }
376
+
377
+ if (requestParameters['file'] == null) {
378
+ throw new runtime.RequiredError(
379
+ 'file',
380
+ 'Required parameter "file" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesImportPost().'
381
+ );
382
+ }
383
+
384
+ const queryParameters: any = {};
385
+
386
+ const headerParameters: runtime.HTTPHeaders = {};
387
+
388
+ if (this.configuration && this.configuration.accessToken) {
389
+ const token = this.configuration.accessToken;
390
+ const tokenString = await token("bearerAuth", []);
391
+
392
+ if (tokenString) {
393
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
394
+ }
395
+ }
396
+ const consumes: runtime.Consume[] = [
397
+ { contentType: 'multipart/form-data' },
398
+ ];
399
+ // @ts-ignore: canConsumeForm may be unused
400
+ const canConsumeForm = runtime.canConsumeForm(consumes);
401
+
402
+ let formParams: { append(param: string, value: any): any };
403
+ let useForm = false;
404
+ // use FormData to transmit files using content-type "multipart/form-data"
405
+ useForm = canConsumeForm;
406
+ if (useForm) {
407
+ formParams = new FormData();
408
+ } else {
409
+ formParams = new URLSearchParams();
410
+ }
411
+
412
+ if (requestParameters['file'] != null) {
413
+ formParams.append('file', requestParameters['file'] as any);
414
+ }
415
+
416
+
417
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/import`;
418
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
419
+
420
+ const response = await this.request({
421
+ path: urlPath,
422
+ method: 'POST',
423
+ headers: headerParameters,
424
+ query: queryParameters,
425
+ body: formParams,
426
+ }, initOverrides);
427
+
428
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhonebookImportResultFromJSON(jsonValue));
429
+ }
430
+
431
+ /**
432
+ * Upload a CSV file. The header row is required and must contain at least `phone` and `name` columns. Optional columns: `company`, `email`. Header aliases (case-insensitive): phone/phone_number/number, name/full_name/contact, company/organization, email/email_address. Existing entries with the same phone are updated; new ones are inserted.
433
+ * Import phonebook entries from a CSV file
434
+ */
435
+ async organizationsOrganizationIdPhonebookEntriesImportPost(requestParameters: OrganizationsOrganizationIdPhonebookEntriesImportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookImportResult> {
436
+ const response = await this.organizationsOrganizationIdPhonebookEntriesImportPostRaw(requestParameters, initOverrides);
437
+ return await response.value();
438
+ }
439
+
440
+ /**
441
+ * Create a phonebook entry
442
+ */
443
+ async organizationsOrganizationIdPhonebookEntriesPostRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookEntry>> {
444
+ if (requestParameters['organizationId'] == null) {
445
+ throw new runtime.RequiredError(
446
+ 'organizationId',
447
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesPost().'
448
+ );
449
+ }
450
+
451
+ if (requestParameters['phonebookEntryCreate'] == null) {
452
+ throw new runtime.RequiredError(
453
+ 'phonebookEntryCreate',
454
+ 'Required parameter "phonebookEntryCreate" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesPost().'
455
+ );
456
+ }
457
+
458
+ const queryParameters: any = {};
459
+
460
+ const headerParameters: runtime.HTTPHeaders = {};
461
+
462
+ headerParameters['Content-Type'] = 'application/json';
463
+
464
+ if (this.configuration && this.configuration.accessToken) {
465
+ const token = this.configuration.accessToken;
466
+ const tokenString = await token("bearerAuth", []);
467
+
468
+ if (tokenString) {
469
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
470
+ }
471
+ }
472
+
473
+ let urlPath = `/organizations/{organizationId}/phonebook/entries`;
474
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
475
+
476
+ const response = await this.request({
477
+ path: urlPath,
478
+ method: 'POST',
479
+ headers: headerParameters,
480
+ query: queryParameters,
481
+ body: PhonebookEntryCreateToJSON(requestParameters['phonebookEntryCreate']),
482
+ }, initOverrides);
483
+
484
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhonebookEntryFromJSON(jsonValue));
485
+ }
486
+
487
+ /**
488
+ * Create a phonebook entry
489
+ */
490
+ async organizationsOrganizationIdPhonebookEntriesPost(requestParameters: OrganizationsOrganizationIdPhonebookEntriesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookEntry> {
491
+ const response = await this.organizationsOrganizationIdPhonebookEntriesPostRaw(requestParameters, initOverrides);
492
+ return await response.value();
493
+ }
494
+
495
+ /**
496
+ * Returns the phonebook record (lazily created on first access).
497
+ * Get the organization\'s phonebook settings
498
+ */
499
+ async organizationsOrganizationIdPhonebookGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Phonebook>> {
500
+ if (requestParameters['organizationId'] == null) {
501
+ throw new runtime.RequiredError(
502
+ 'organizationId',
503
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookGet().'
504
+ );
505
+ }
506
+
507
+ const queryParameters: any = {};
508
+
509
+ const headerParameters: runtime.HTTPHeaders = {};
510
+
511
+ if (this.configuration && this.configuration.accessToken) {
512
+ const token = this.configuration.accessToken;
513
+ const tokenString = await token("bearerAuth", []);
514
+
515
+ if (tokenString) {
516
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
517
+ }
518
+ }
519
+
520
+ let urlPath = `/organizations/{organizationId}/phonebook`;
521
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
522
+
523
+ const response = await this.request({
524
+ path: urlPath,
525
+ method: 'GET',
526
+ headers: headerParameters,
527
+ query: queryParameters,
528
+ }, initOverrides);
529
+
530
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhonebookFromJSON(jsonValue));
531
+ }
532
+
533
+ /**
534
+ * Returns the phonebook record (lazily created on first access).
535
+ * Get the organization\'s phonebook settings
536
+ */
537
+ async organizationsOrganizationIdPhonebookGet(requestParameters: OrganizationsOrganizationIdPhonebookGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Phonebook> {
538
+ const response = await this.organizationsOrganizationIdPhonebookGetRaw(requestParameters, initOverrides);
539
+ return await response.value();
540
+ }
541
+
542
+ /**
543
+ * Update phonebook settings such as the auto_populate flag.
544
+ * Update phonebook settings
545
+ */
546
+ async organizationsOrganizationIdPhonebookPatchRaw(requestParameters: OrganizationsOrganizationIdPhonebookPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Phonebook>> {
547
+ if (requestParameters['organizationId'] == null) {
548
+ throw new runtime.RequiredError(
549
+ 'organizationId',
550
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookPatch().'
551
+ );
552
+ }
553
+
554
+ if (requestParameters['phonebookUpdate'] == null) {
555
+ throw new runtime.RequiredError(
556
+ 'phonebookUpdate',
557
+ 'Required parameter "phonebookUpdate" was null or undefined when calling organizationsOrganizationIdPhonebookPatch().'
558
+ );
559
+ }
560
+
561
+ const queryParameters: any = {};
562
+
563
+ const headerParameters: runtime.HTTPHeaders = {};
564
+
565
+ headerParameters['Content-Type'] = 'application/json';
566
+
567
+ if (this.configuration && this.configuration.accessToken) {
568
+ const token = this.configuration.accessToken;
569
+ const tokenString = await token("bearerAuth", []);
570
+
571
+ if (tokenString) {
572
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
573
+ }
574
+ }
575
+
576
+ let urlPath = `/organizations/{organizationId}/phonebook`;
577
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
578
+
579
+ const response = await this.request({
580
+ path: urlPath,
581
+ method: 'PATCH',
582
+ headers: headerParameters,
583
+ query: queryParameters,
584
+ body: PhonebookUpdateToJSON(requestParameters['phonebookUpdate']),
585
+ }, initOverrides);
586
+
587
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhonebookFromJSON(jsonValue));
588
+ }
589
+
590
+ /**
591
+ * Update phonebook settings such as the auto_populate flag.
592
+ * Update phonebook settings
593
+ */
594
+ async organizationsOrganizationIdPhonebookPatch(requestParameters: OrganizationsOrganizationIdPhonebookPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Phonebook> {
595
+ const response = await this.organizationsOrganizationIdPhonebookPatchRaw(requestParameters, initOverrides);
596
+ return await response.value();
597
+ }
598
+
599
+ }
package/src/apis/index.ts CHANGED
@@ -10,6 +10,7 @@ export * from './LLMProvidersApi';
10
10
  export * from './MembersApi';
11
11
  export * from './NotificationsApi';
12
12
  export * from './OrganizationsApi';
13
+ export * from './PhonebookApi';
13
14
  export * from './PlaygroundApi';
14
15
  export * from './ProfileApi';
15
16
  export * from './RAGApi';