@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
@@ -18,7 +18,8 @@ import { TTSProvidersApi } from "./apis/TTSProvidersApi";
18
18
  import { SubscriptionApi } from "./apis/SubscriptionApi";
19
19
  import { VoiceAgentsApi } from "./apis/VoiceAgentsApi";
20
20
  import { ToolsApi } from "./apis/ToolsApi";
21
- import type { CallCreate, CallUpdate, NotificationScope, NotificationSeverity, NotificationType, VoiceAgentCreate, VoiceAgentUpdate, ChatAgentCreate, ChatAgentUpdate, Calendar, CalendarCreate, CalendarUpdate, CalendarEventCreate, CalendarEventUpdate, InvitationAccept, InvitationCreate, RagConfigCreate, SipTrunkCreate, DispatchRuleCreate, PhoneNumberCreate, OrganizationCreate, CreateCheckoutSessionRequest, CancelSubscriptionRequest, UpdatePlanRequest, PauseSubscriptionRequest, BillingPortalRequest, UserPreferencesUpdate, AgentToolUpsert } from "./models";
21
+ import { PhonebookApi } from "./apis/PhonebookApi";
22
+ import type { CallCreate, CallUpdate, NotificationScope, NotificationSeverity, NotificationType, VoiceAgentCreate, VoiceAgentUpdate, ChatAgentCreate, ChatAgentUpdate, Calendar, CalendarCreate, CalendarUpdate, CalendarEventCreate, CalendarEventUpdate, InvitationAccept, InvitationCreate, RagConfigCreate, SipTrunkCreate, DispatchRuleCreate, PhoneNumberCreate, OrganizationCreate, CreateCheckoutSessionRequest, CancelSubscriptionRequest, UpdatePlanRequest, PauseSubscriptionRequest, BillingPortalRequest, UserPreferencesUpdate, AgentToolUpsert, PhonebookUpdate, PhonebookEntryCreate, PhonebookEntryUpdate } from "./models";
22
23
  export interface ApiClientConfig {
23
24
  baseUrl: string;
24
25
  options?: {
@@ -157,6 +158,23 @@ export declare class Api {
157
158
  upsertForAgent: (organizationId: string, voiceAgentId: string, toolName: string, agentToolUpsert: AgentToolUpsert, options?: RequestInit) => ReturnType<ToolsApi["organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut"]>;
158
159
  removeFromAgent: (organizationId: string, voiceAgentId: string, toolName: string, options?: RequestInit) => ReturnType<ToolsApi["organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete"]>;
159
160
  };
161
+ readonly phonebook: {
162
+ get: (organizationId: string, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookGet"]>;
163
+ update: (organizationId: string, phonebookUpdate: PhonebookUpdate, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookPatch"]>;
164
+ entries: {
165
+ list: (organizationId: string, params?: {
166
+ search?: string;
167
+ limit?: number;
168
+ offset?: number;
169
+ }, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookEntriesGet"]>;
170
+ get: (organizationId: string, entryId: string, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookEntriesEntryIdGet"]>;
171
+ create: (organizationId: string, phonebookEntryCreate: PhonebookEntryCreate, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookEntriesPost"]>;
172
+ update: (organizationId: string, entryId: string, phonebookEntryUpdate: PhonebookEntryUpdate, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookEntriesEntryIdPatch"]>;
173
+ delete: (organizationId: string, entryId: string, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookEntriesEntryIdDelete"]>;
174
+ import: (organizationId: string, file: Blob, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookEntriesImportPost"]>;
175
+ export: (organizationId: string, options?: RequestInit) => ReturnType<PhonebookApi["organizationsOrganizationIdPhonebookEntriesExportGet"]>;
176
+ };
177
+ };
160
178
  private readonly callsApi;
161
179
  private readonly voiceAgentsApi;
162
180
  private readonly chatAgentsApi;
@@ -177,6 +195,7 @@ export declare class Api {
177
195
  private readonly sttProvidersApi;
178
196
  private readonly ttsProvidersApi;
179
197
  private readonly toolsApi;
198
+ private readonly phonebookApi;
180
199
  private readonly _auth;
181
200
  constructor(config: ApiClientConfig);
182
201
  /**
@@ -30,6 +30,7 @@ const TTSProvidersApi_1 = require("./apis/TTSProvidersApi");
30
30
  const SubscriptionApi_1 = require("./apis/SubscriptionApi");
31
31
  const VoiceAgentsApi_1 = require("./apis/VoiceAgentsApi");
32
32
  const ToolsApi_1 = require("./apis/ToolsApi");
33
+ const PhonebookApi_1 = require("./apis/PhonebookApi");
33
34
  const runtime_1 = require("./runtime");
34
35
  class Api {
35
36
  constructor(config) {
@@ -69,6 +70,7 @@ class Api {
69
70
  this.sttProvidersApi = new STTProvidersApi_1.STTProvidersApi(configuration);
70
71
  this.ttsProvidersApi = new TTSProvidersApi_1.TTSProvidersApi(configuration);
71
72
  this.toolsApi = new ToolsApi_1.ToolsApi(configuration);
73
+ this.phonebookApi = new PhonebookApi_1.PhonebookApi(configuration);
72
74
  this.calls = {
73
75
  list: (organizationId, voiceAgentId, sandbox, options) => this.callsApi.organizationsOrganizationIdCallsGet({ organizationId, voiceAgentId, sandbox }, options),
74
76
  get: (organizationId, callId, options) => this.callsApi.organizationsOrganizationIdCallsCallIdGet({ organizationId, callId }, options),
@@ -198,6 +200,19 @@ class Api {
198
200
  upsertForAgent: (organizationId, voiceAgentId, toolName, agentToolUpsert, options) => this.toolsApi.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNamePut({ organizationId, voiceAgentId, toolName, agentToolUpsert }, options),
199
201
  removeFromAgent: (organizationId, voiceAgentId, toolName, options) => this.toolsApi.organizationsOrganizationIdVoiceAgentsVoiceAgentIdToolsToolNameDelete({ organizationId, voiceAgentId, toolName }, options),
200
202
  };
203
+ this.phonebook = {
204
+ get: (organizationId, options) => this.phonebookApi.organizationsOrganizationIdPhonebookGet({ organizationId }, options),
205
+ update: (organizationId, phonebookUpdate, options) => this.phonebookApi.organizationsOrganizationIdPhonebookPatch({ organizationId, phonebookUpdate }, options),
206
+ entries: {
207
+ list: (organizationId, params, options) => this.phonebookApi.organizationsOrganizationIdPhonebookEntriesGet({ organizationId, search: params === null || params === void 0 ? void 0 : params.search, limit: params === null || params === void 0 ? void 0 : params.limit, offset: params === null || params === void 0 ? void 0 : params.offset }, options),
208
+ get: (organizationId, entryId, options) => this.phonebookApi.organizationsOrganizationIdPhonebookEntriesEntryIdGet({ organizationId, entryId }, options),
209
+ create: (organizationId, phonebookEntryCreate, options) => this.phonebookApi.organizationsOrganizationIdPhonebookEntriesPost({ organizationId, phonebookEntryCreate }, options),
210
+ update: (organizationId, entryId, phonebookEntryUpdate, options) => this.phonebookApi.organizationsOrganizationIdPhonebookEntriesEntryIdPatch({ organizationId, entryId, phonebookEntryUpdate }, options),
211
+ delete: (organizationId, entryId, options) => this.phonebookApi.organizationsOrganizationIdPhonebookEntriesEntryIdDelete({ organizationId, entryId }, options),
212
+ import: (organizationId, file, options) => this.phonebookApi.organizationsOrganizationIdPhonebookEntriesImportPost({ organizationId, file }, options),
213
+ export: (organizationId, options) => this.phonebookApi.organizationsOrganizationIdPhonebookEntriesExportGet({ organizationId }, options),
214
+ },
215
+ };
201
216
  }
202
217
  /**
203
218
  * Set the Bearer token for Authorization header.
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Tivadar AI Backend API
3
+ * Unified REST API for Tivadar AI Voice Agents platform
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { Phonebook, PhonebookEntry, PhonebookEntryCreate, PhonebookEntryUpdate, PhonebookImportResult, PhonebookUpdate } from '../models/index';
14
+ export interface OrganizationsOrganizationIdPhonebookEntriesEntryIdDeleteRequest {
15
+ organizationId: string;
16
+ entryId: string;
17
+ }
18
+ export interface OrganizationsOrganizationIdPhonebookEntriesEntryIdGetRequest {
19
+ organizationId: string;
20
+ entryId: string;
21
+ }
22
+ export interface OrganizationsOrganizationIdPhonebookEntriesEntryIdPatchRequest {
23
+ organizationId: string;
24
+ entryId: string;
25
+ phonebookEntryUpdate: PhonebookEntryUpdate;
26
+ }
27
+ export interface OrganizationsOrganizationIdPhonebookEntriesExportGetRequest {
28
+ organizationId: string;
29
+ }
30
+ export interface OrganizationsOrganizationIdPhonebookEntriesGetRequest {
31
+ organizationId: string;
32
+ search?: string;
33
+ limit?: number;
34
+ offset?: number;
35
+ }
36
+ export interface OrganizationsOrganizationIdPhonebookEntriesImportPostRequest {
37
+ organizationId: string;
38
+ file: Blob;
39
+ }
40
+ export interface OrganizationsOrganizationIdPhonebookEntriesPostRequest {
41
+ organizationId: string;
42
+ phonebookEntryCreate: PhonebookEntryCreate;
43
+ }
44
+ export interface OrganizationsOrganizationIdPhonebookGetRequest {
45
+ organizationId: string;
46
+ }
47
+ export interface OrganizationsOrganizationIdPhonebookPatchRequest {
48
+ organizationId: string;
49
+ phonebookUpdate: PhonebookUpdate;
50
+ }
51
+ /**
52
+ *
53
+ */
54
+ export declare class PhonebookApi extends runtime.BaseAPI {
55
+ /**
56
+ * Delete a phonebook entry
57
+ */
58
+ organizationsOrganizationIdPhonebookEntriesEntryIdDeleteRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
59
+ /**
60
+ * Delete a phonebook entry
61
+ */
62
+ organizationsOrganizationIdPhonebookEntriesEntryIdDelete(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
63
+ /**
64
+ * Get a phonebook entry by ID
65
+ */
66
+ organizationsOrganizationIdPhonebookEntriesEntryIdGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookEntry>>;
67
+ /**
68
+ * Get a phonebook entry by ID
69
+ */
70
+ organizationsOrganizationIdPhonebookEntriesEntryIdGet(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookEntry>;
71
+ /**
72
+ * Update a phonebook entry
73
+ */
74
+ organizationsOrganizationIdPhonebookEntriesEntryIdPatchRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookEntry>>;
75
+ /**
76
+ * Update a phonebook entry
77
+ */
78
+ organizationsOrganizationIdPhonebookEntriesEntryIdPatch(requestParameters: OrganizationsOrganizationIdPhonebookEntriesEntryIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookEntry>;
79
+ /**
80
+ * Export phonebook entries as CSV
81
+ */
82
+ organizationsOrganizationIdPhonebookEntriesExportGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesExportGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
83
+ /**
84
+ * Export phonebook entries as CSV
85
+ */
86
+ organizationsOrganizationIdPhonebookEntriesExportGet(requestParameters: OrganizationsOrganizationIdPhonebookEntriesExportGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
87
+ /**
88
+ * List phonebook entries
89
+ */
90
+ organizationsOrganizationIdPhonebookEntriesGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PhonebookEntry>>>;
91
+ /**
92
+ * List phonebook entries
93
+ */
94
+ organizationsOrganizationIdPhonebookEntriesGet(requestParameters: OrganizationsOrganizationIdPhonebookEntriesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PhonebookEntry>>;
95
+ /**
96
+ * 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.
97
+ * Import phonebook entries from a CSV file
98
+ */
99
+ organizationsOrganizationIdPhonebookEntriesImportPostRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesImportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookImportResult>>;
100
+ /**
101
+ * 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.
102
+ * Import phonebook entries from a CSV file
103
+ */
104
+ organizationsOrganizationIdPhonebookEntriesImportPost(requestParameters: OrganizationsOrganizationIdPhonebookEntriesImportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookImportResult>;
105
+ /**
106
+ * Create a phonebook entry
107
+ */
108
+ organizationsOrganizationIdPhonebookEntriesPostRaw(requestParameters: OrganizationsOrganizationIdPhonebookEntriesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhonebookEntry>>;
109
+ /**
110
+ * Create a phonebook entry
111
+ */
112
+ organizationsOrganizationIdPhonebookEntriesPost(requestParameters: OrganizationsOrganizationIdPhonebookEntriesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhonebookEntry>;
113
+ /**
114
+ * Returns the phonebook record (lazily created on first access).
115
+ * Get the organization\'s phonebook settings
116
+ */
117
+ organizationsOrganizationIdPhonebookGetRaw(requestParameters: OrganizationsOrganizationIdPhonebookGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Phonebook>>;
118
+ /**
119
+ * Returns the phonebook record (lazily created on first access).
120
+ * Get the organization\'s phonebook settings
121
+ */
122
+ organizationsOrganizationIdPhonebookGet(requestParameters: OrganizationsOrganizationIdPhonebookGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Phonebook>;
123
+ /**
124
+ * Update phonebook settings such as the auto_populate flag.
125
+ * Update phonebook settings
126
+ */
127
+ organizationsOrganizationIdPhonebookPatchRaw(requestParameters: OrganizationsOrganizationIdPhonebookPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Phonebook>>;
128
+ /**
129
+ * Update phonebook settings such as the auto_populate flag.
130
+ * Update phonebook settings
131
+ */
132
+ organizationsOrganizationIdPhonebookPatch(requestParameters: OrganizationsOrganizationIdPhonebookPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Phonebook>;
133
+ }
@@ -0,0 +1,434 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Tivadar AI Backend API
6
+ * Unified REST API for Tivadar AI Voice Agents platform
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.PhonebookApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class PhonebookApi extends runtime.BaseAPI {
32
+ /**
33
+ * Delete a phonebook entry
34
+ */
35
+ organizationsOrganizationIdPhonebookEntriesEntryIdDeleteRaw(requestParameters, initOverrides) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['organizationId'] == null) {
38
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdDelete().');
39
+ }
40
+ if (requestParameters['entryId'] == null) {
41
+ throw new runtime.RequiredError('entryId', 'Required parameter "entryId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdDelete().');
42
+ }
43
+ const queryParameters = {};
44
+ const headerParameters = {};
45
+ if (this.configuration && this.configuration.accessToken) {
46
+ const token = this.configuration.accessToken;
47
+ const tokenString = yield token("bearerAuth", []);
48
+ if (tokenString) {
49
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
50
+ }
51
+ }
52
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/{entryId}`;
53
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
54
+ urlPath = urlPath.replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters['entryId'])));
55
+ const response = yield this.request({
56
+ path: urlPath,
57
+ method: 'DELETE',
58
+ headers: headerParameters,
59
+ query: queryParameters,
60
+ }, initOverrides);
61
+ return new runtime.VoidApiResponse(response);
62
+ });
63
+ }
64
+ /**
65
+ * Delete a phonebook entry
66
+ */
67
+ organizationsOrganizationIdPhonebookEntriesEntryIdDelete(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ yield this.organizationsOrganizationIdPhonebookEntriesEntryIdDeleteRaw(requestParameters, initOverrides);
70
+ });
71
+ }
72
+ /**
73
+ * Get a phonebook entry by ID
74
+ */
75
+ organizationsOrganizationIdPhonebookEntriesEntryIdGetRaw(requestParameters, initOverrides) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ if (requestParameters['organizationId'] == null) {
78
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdGet().');
79
+ }
80
+ if (requestParameters['entryId'] == null) {
81
+ throw new runtime.RequiredError('entryId', 'Required parameter "entryId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdGet().');
82
+ }
83
+ const queryParameters = {};
84
+ const headerParameters = {};
85
+ if (this.configuration && this.configuration.accessToken) {
86
+ const token = this.configuration.accessToken;
87
+ const tokenString = yield token("bearerAuth", []);
88
+ if (tokenString) {
89
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
90
+ }
91
+ }
92
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/{entryId}`;
93
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
94
+ urlPath = urlPath.replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters['entryId'])));
95
+ const response = yield this.request({
96
+ path: urlPath,
97
+ method: 'GET',
98
+ headers: headerParameters,
99
+ query: queryParameters,
100
+ }, initOverrides);
101
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PhonebookEntryFromJSON)(jsonValue));
102
+ });
103
+ }
104
+ /**
105
+ * Get a phonebook entry by ID
106
+ */
107
+ organizationsOrganizationIdPhonebookEntriesEntryIdGet(requestParameters, initOverrides) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ const response = yield this.organizationsOrganizationIdPhonebookEntriesEntryIdGetRaw(requestParameters, initOverrides);
110
+ return yield response.value();
111
+ });
112
+ }
113
+ /**
114
+ * Update a phonebook entry
115
+ */
116
+ organizationsOrganizationIdPhonebookEntriesEntryIdPatchRaw(requestParameters, initOverrides) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ if (requestParameters['organizationId'] == null) {
119
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdPatch().');
120
+ }
121
+ if (requestParameters['entryId'] == null) {
122
+ throw new runtime.RequiredError('entryId', 'Required parameter "entryId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdPatch().');
123
+ }
124
+ if (requestParameters['phonebookEntryUpdate'] == null) {
125
+ throw new runtime.RequiredError('phonebookEntryUpdate', 'Required parameter "phonebookEntryUpdate" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesEntryIdPatch().');
126
+ }
127
+ const queryParameters = {};
128
+ const headerParameters = {};
129
+ headerParameters['Content-Type'] = 'application/json';
130
+ if (this.configuration && this.configuration.accessToken) {
131
+ const token = this.configuration.accessToken;
132
+ const tokenString = yield token("bearerAuth", []);
133
+ if (tokenString) {
134
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
135
+ }
136
+ }
137
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/{entryId}`;
138
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
139
+ urlPath = urlPath.replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters['entryId'])));
140
+ const response = yield this.request({
141
+ path: urlPath,
142
+ method: 'PATCH',
143
+ headers: headerParameters,
144
+ query: queryParameters,
145
+ body: (0, index_1.PhonebookEntryUpdateToJSON)(requestParameters['phonebookEntryUpdate']),
146
+ }, initOverrides);
147
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PhonebookEntryFromJSON)(jsonValue));
148
+ });
149
+ }
150
+ /**
151
+ * Update a phonebook entry
152
+ */
153
+ organizationsOrganizationIdPhonebookEntriesEntryIdPatch(requestParameters, initOverrides) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ const response = yield this.organizationsOrganizationIdPhonebookEntriesEntryIdPatchRaw(requestParameters, initOverrides);
156
+ return yield response.value();
157
+ });
158
+ }
159
+ /**
160
+ * Export phonebook entries as CSV
161
+ */
162
+ organizationsOrganizationIdPhonebookEntriesExportGetRaw(requestParameters, initOverrides) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ if (requestParameters['organizationId'] == null) {
165
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesExportGet().');
166
+ }
167
+ const queryParameters = {};
168
+ const headerParameters = {};
169
+ if (this.configuration && this.configuration.accessToken) {
170
+ const token = this.configuration.accessToken;
171
+ const tokenString = yield token("bearerAuth", []);
172
+ if (tokenString) {
173
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
174
+ }
175
+ }
176
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/export`;
177
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
178
+ const response = yield this.request({
179
+ path: urlPath,
180
+ method: 'GET',
181
+ headers: headerParameters,
182
+ query: queryParameters,
183
+ }, initOverrides);
184
+ if (this.isJsonMime(response.headers.get('content-type'))) {
185
+ return new runtime.JSONApiResponse(response);
186
+ }
187
+ else {
188
+ return new runtime.TextApiResponse(response);
189
+ }
190
+ });
191
+ }
192
+ /**
193
+ * Export phonebook entries as CSV
194
+ */
195
+ organizationsOrganizationIdPhonebookEntriesExportGet(requestParameters, initOverrides) {
196
+ return __awaiter(this, void 0, void 0, function* () {
197
+ const response = yield this.organizationsOrganizationIdPhonebookEntriesExportGetRaw(requestParameters, initOverrides);
198
+ return yield response.value();
199
+ });
200
+ }
201
+ /**
202
+ * List phonebook entries
203
+ */
204
+ organizationsOrganizationIdPhonebookEntriesGetRaw(requestParameters, initOverrides) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ if (requestParameters['organizationId'] == null) {
207
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesGet().');
208
+ }
209
+ const queryParameters = {};
210
+ if (requestParameters['search'] != null) {
211
+ queryParameters['search'] = requestParameters['search'];
212
+ }
213
+ if (requestParameters['limit'] != null) {
214
+ queryParameters['limit'] = requestParameters['limit'];
215
+ }
216
+ if (requestParameters['offset'] != null) {
217
+ queryParameters['offset'] = requestParameters['offset'];
218
+ }
219
+ const headerParameters = {};
220
+ if (this.configuration && this.configuration.accessToken) {
221
+ const token = this.configuration.accessToken;
222
+ const tokenString = yield token("bearerAuth", []);
223
+ if (tokenString) {
224
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
225
+ }
226
+ }
227
+ let urlPath = `/organizations/{organizationId}/phonebook/entries`;
228
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
229
+ const response = yield this.request({
230
+ path: urlPath,
231
+ method: 'GET',
232
+ headers: headerParameters,
233
+ query: queryParameters,
234
+ }, initOverrides);
235
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.PhonebookEntryFromJSON));
236
+ });
237
+ }
238
+ /**
239
+ * List phonebook entries
240
+ */
241
+ organizationsOrganizationIdPhonebookEntriesGet(requestParameters, initOverrides) {
242
+ return __awaiter(this, void 0, void 0, function* () {
243
+ const response = yield this.organizationsOrganizationIdPhonebookEntriesGetRaw(requestParameters, initOverrides);
244
+ return yield response.value();
245
+ });
246
+ }
247
+ /**
248
+ * 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.
249
+ * Import phonebook entries from a CSV file
250
+ */
251
+ organizationsOrganizationIdPhonebookEntriesImportPostRaw(requestParameters, initOverrides) {
252
+ return __awaiter(this, void 0, void 0, function* () {
253
+ if (requestParameters['organizationId'] == null) {
254
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesImportPost().');
255
+ }
256
+ if (requestParameters['file'] == null) {
257
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesImportPost().');
258
+ }
259
+ const queryParameters = {};
260
+ const headerParameters = {};
261
+ if (this.configuration && this.configuration.accessToken) {
262
+ const token = this.configuration.accessToken;
263
+ const tokenString = yield token("bearerAuth", []);
264
+ if (tokenString) {
265
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
266
+ }
267
+ }
268
+ const consumes = [
269
+ { contentType: 'multipart/form-data' },
270
+ ];
271
+ // @ts-ignore: canConsumeForm may be unused
272
+ const canConsumeForm = runtime.canConsumeForm(consumes);
273
+ let formParams;
274
+ let useForm = false;
275
+ // use FormData to transmit files using content-type "multipart/form-data"
276
+ useForm = canConsumeForm;
277
+ if (useForm) {
278
+ formParams = new FormData();
279
+ }
280
+ else {
281
+ formParams = new URLSearchParams();
282
+ }
283
+ if (requestParameters['file'] != null) {
284
+ formParams.append('file', requestParameters['file']);
285
+ }
286
+ let urlPath = `/organizations/{organizationId}/phonebook/entries/import`;
287
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
288
+ const response = yield this.request({
289
+ path: urlPath,
290
+ method: 'POST',
291
+ headers: headerParameters,
292
+ query: queryParameters,
293
+ body: formParams,
294
+ }, initOverrides);
295
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PhonebookImportResultFromJSON)(jsonValue));
296
+ });
297
+ }
298
+ /**
299
+ * 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.
300
+ * Import phonebook entries from a CSV file
301
+ */
302
+ organizationsOrganizationIdPhonebookEntriesImportPost(requestParameters, initOverrides) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ const response = yield this.organizationsOrganizationIdPhonebookEntriesImportPostRaw(requestParameters, initOverrides);
305
+ return yield response.value();
306
+ });
307
+ }
308
+ /**
309
+ * Create a phonebook entry
310
+ */
311
+ organizationsOrganizationIdPhonebookEntriesPostRaw(requestParameters, initOverrides) {
312
+ return __awaiter(this, void 0, void 0, function* () {
313
+ if (requestParameters['organizationId'] == null) {
314
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesPost().');
315
+ }
316
+ if (requestParameters['phonebookEntryCreate'] == null) {
317
+ throw new runtime.RequiredError('phonebookEntryCreate', 'Required parameter "phonebookEntryCreate" was null or undefined when calling organizationsOrganizationIdPhonebookEntriesPost().');
318
+ }
319
+ const queryParameters = {};
320
+ const headerParameters = {};
321
+ headerParameters['Content-Type'] = 'application/json';
322
+ if (this.configuration && this.configuration.accessToken) {
323
+ const token = this.configuration.accessToken;
324
+ const tokenString = yield token("bearerAuth", []);
325
+ if (tokenString) {
326
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
327
+ }
328
+ }
329
+ let urlPath = `/organizations/{organizationId}/phonebook/entries`;
330
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
331
+ const response = yield this.request({
332
+ path: urlPath,
333
+ method: 'POST',
334
+ headers: headerParameters,
335
+ query: queryParameters,
336
+ body: (0, index_1.PhonebookEntryCreateToJSON)(requestParameters['phonebookEntryCreate']),
337
+ }, initOverrides);
338
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PhonebookEntryFromJSON)(jsonValue));
339
+ });
340
+ }
341
+ /**
342
+ * Create a phonebook entry
343
+ */
344
+ organizationsOrganizationIdPhonebookEntriesPost(requestParameters, initOverrides) {
345
+ return __awaiter(this, void 0, void 0, function* () {
346
+ const response = yield this.organizationsOrganizationIdPhonebookEntriesPostRaw(requestParameters, initOverrides);
347
+ return yield response.value();
348
+ });
349
+ }
350
+ /**
351
+ * Returns the phonebook record (lazily created on first access).
352
+ * Get the organization\'s phonebook settings
353
+ */
354
+ organizationsOrganizationIdPhonebookGetRaw(requestParameters, initOverrides) {
355
+ return __awaiter(this, void 0, void 0, function* () {
356
+ if (requestParameters['organizationId'] == null) {
357
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookGet().');
358
+ }
359
+ const queryParameters = {};
360
+ const headerParameters = {};
361
+ if (this.configuration && this.configuration.accessToken) {
362
+ const token = this.configuration.accessToken;
363
+ const tokenString = yield token("bearerAuth", []);
364
+ if (tokenString) {
365
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
366
+ }
367
+ }
368
+ let urlPath = `/organizations/{organizationId}/phonebook`;
369
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
370
+ const response = yield this.request({
371
+ path: urlPath,
372
+ method: 'GET',
373
+ headers: headerParameters,
374
+ query: queryParameters,
375
+ }, initOverrides);
376
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PhonebookFromJSON)(jsonValue));
377
+ });
378
+ }
379
+ /**
380
+ * Returns the phonebook record (lazily created on first access).
381
+ * Get the organization\'s phonebook settings
382
+ */
383
+ organizationsOrganizationIdPhonebookGet(requestParameters, initOverrides) {
384
+ return __awaiter(this, void 0, void 0, function* () {
385
+ const response = yield this.organizationsOrganizationIdPhonebookGetRaw(requestParameters, initOverrides);
386
+ return yield response.value();
387
+ });
388
+ }
389
+ /**
390
+ * Update phonebook settings such as the auto_populate flag.
391
+ * Update phonebook settings
392
+ */
393
+ organizationsOrganizationIdPhonebookPatchRaw(requestParameters, initOverrides) {
394
+ return __awaiter(this, void 0, void 0, function* () {
395
+ if (requestParameters['organizationId'] == null) {
396
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdPhonebookPatch().');
397
+ }
398
+ if (requestParameters['phonebookUpdate'] == null) {
399
+ throw new runtime.RequiredError('phonebookUpdate', 'Required parameter "phonebookUpdate" was null or undefined when calling organizationsOrganizationIdPhonebookPatch().');
400
+ }
401
+ const queryParameters = {};
402
+ const headerParameters = {};
403
+ headerParameters['Content-Type'] = 'application/json';
404
+ if (this.configuration && this.configuration.accessToken) {
405
+ const token = this.configuration.accessToken;
406
+ const tokenString = yield token("bearerAuth", []);
407
+ if (tokenString) {
408
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
409
+ }
410
+ }
411
+ let urlPath = `/organizations/{organizationId}/phonebook`;
412
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
413
+ const response = yield this.request({
414
+ path: urlPath,
415
+ method: 'PATCH',
416
+ headers: headerParameters,
417
+ query: queryParameters,
418
+ body: (0, index_1.PhonebookUpdateToJSON)(requestParameters['phonebookUpdate']),
419
+ }, initOverrides);
420
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PhonebookFromJSON)(jsonValue));
421
+ });
422
+ }
423
+ /**
424
+ * Update phonebook settings such as the auto_populate flag.
425
+ * Update phonebook settings
426
+ */
427
+ organizationsOrganizationIdPhonebookPatch(requestParameters, initOverrides) {
428
+ return __awaiter(this, void 0, void 0, function* () {
429
+ const response = yield this.organizationsOrganizationIdPhonebookPatchRaw(requestParameters, initOverrides);
430
+ return yield response.value();
431
+ });
432
+ }
433
+ }
434
+ exports.PhonebookApi = PhonebookApi;
@@ -8,6 +8,7 @@ export * from './LLMProvidersApi';
8
8
  export * from './MembersApi';
9
9
  export * from './NotificationsApi';
10
10
  export * from './OrganizationsApi';
11
+ export * from './PhonebookApi';
11
12
  export * from './PlaygroundApi';
12
13
  export * from './ProfileApi';
13
14
  export * from './RAGApi';