@vendasta/ai-assistants 0.3.0 → 0.5.0

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.
@@ -182,13 +182,19 @@ function enumStringToValue$7(enumRef, value) {
182
182
  }
183
183
  return enumRef[value];
184
184
  }
185
- class Connection {
185
+ class Assistant {
186
186
  static fromProto(proto) {
187
- let m = new Connection();
187
+ let m = new Assistant();
188
188
  m = Object.assign(m, proto);
189
189
  if (proto.namespace) {
190
190
  m.namespace = Namespace.fromProto(proto.namespace);
191
191
  }
192
+ if (proto.type) {
193
+ m.type = enumStringToValue$7(AssistantType, proto.type);
194
+ }
195
+ if (proto.config) {
196
+ m.config = Config.fromProto(proto.config);
197
+ }
192
198
  return m;
193
199
  }
194
200
  constructor(kwargs) {
@@ -208,24 +214,21 @@ class Connection {
208
214
  if (typeof this.name !== 'undefined') {
209
215
  toReturn['name'] = this.name;
210
216
  }
211
- if (typeof this.configurationUrl !== 'undefined') {
212
- toReturn['configurationUrl'] = this.configurationUrl;
213
- }
214
- if (typeof this.connectionType !== 'undefined') {
215
- toReturn['connectionType'] = this.connectionType;
217
+ if (typeof this.type !== 'undefined') {
218
+ toReturn['type'] = this.type;
216
219
  }
217
- if (typeof this.connectionTypeName !== 'undefined') {
218
- toReturn['connectionTypeName'] = this.connectionTypeName;
220
+ if (typeof this.avatarUrl !== 'undefined') {
221
+ toReturn['avatarUrl'] = this.avatarUrl;
219
222
  }
220
- if (typeof this.iconUrl !== 'undefined') {
221
- toReturn['iconUrl'] = this.iconUrl;
223
+ if (typeof this.config !== 'undefined' && this.config !== null) {
224
+ toReturn['config'] = 'toApiJson' in this.config ? this.config.toApiJson() : this.config;
222
225
  }
223
226
  return toReturn;
224
227
  }
225
228
  }
226
- class ConnectionKey {
229
+ class AssistantKey {
227
230
  static fromProto(proto) {
228
- let m = new ConnectionKey();
231
+ let m = new AssistantKey();
229
232
  m = Object.assign(m, proto);
230
233
  if (proto.namespace) {
231
234
  m.namespace = Namespace.fromProto(proto.namespace);
@@ -246,8 +249,51 @@ class ConnectionKey {
246
249
  if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
247
250
  toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
248
251
  }
249
- if (typeof this.connectionType !== 'undefined') {
250
- toReturn['connectionType'] = this.connectionType;
252
+ return toReturn;
253
+ }
254
+ }
255
+ class Config {
256
+ static fromProto(proto) {
257
+ let m = new Config();
258
+ m = Object.assign(m, proto);
259
+ if (proto.inboxConfig) {
260
+ m.inboxConfig = ConfigInboxConfig.fromProto(proto.inboxConfig);
261
+ }
262
+ return m;
263
+ }
264
+ constructor(kwargs) {
265
+ if (!kwargs) {
266
+ return;
267
+ }
268
+ Object.assign(this, kwargs);
269
+ }
270
+ toApiJson() {
271
+ const toReturn = {};
272
+ if (typeof this.inboxConfig !== 'undefined' && this.inboxConfig !== null) {
273
+ toReturn['inboxConfig'] = 'toApiJson' in this.inboxConfig ? this.inboxConfig.toApiJson() : this.inboxConfig;
274
+ }
275
+ return toReturn;
276
+ }
277
+ }
278
+ class ConfigInboxConfig {
279
+ static fromProto(proto) {
280
+ let m = new ConfigInboxConfig();
281
+ m = Object.assign(m, proto);
282
+ return m;
283
+ }
284
+ constructor(kwargs) {
285
+ if (!kwargs) {
286
+ return;
287
+ }
288
+ Object.assign(this, kwargs);
289
+ }
290
+ toApiJson() {
291
+ const toReturn = {};
292
+ if (typeof this.leadCaptureEnabled !== 'undefined') {
293
+ toReturn['leadCaptureEnabled'] = this.leadCaptureEnabled;
294
+ }
295
+ if (typeof this.additionalInstructions !== 'undefined') {
296
+ toReturn['additionalInstructions'] = this.additionalInstructions;
251
297
  }
252
298
  return toReturn;
253
299
  }
@@ -259,18 +305,15 @@ function enumStringToValue$6(enumRef, value) {
259
305
  }
260
306
  return enumRef[value];
261
307
  }
262
- class Assistant {
308
+ class Connection {
263
309
  static fromProto(proto) {
264
- let m = new Assistant();
310
+ let m = new Connection();
265
311
  m = Object.assign(m, proto);
266
312
  if (proto.namespace) {
267
313
  m.namespace = Namespace.fromProto(proto.namespace);
268
314
  }
269
- if (proto.type) {
270
- m.type = enumStringToValue$6(AssistantType, proto.type);
271
- }
272
- if (proto.config) {
273
- m.config = Config.fromProto(proto.config);
315
+ if (proto.assistantKeys) {
316
+ m.assistantKeys = proto.assistantKeys.map(AssistantKey.fromProto);
274
317
  }
275
318
  return m;
276
319
  }
@@ -291,45 +334,34 @@ class Assistant {
291
334
  if (typeof this.name !== 'undefined') {
292
335
  toReturn['name'] = this.name;
293
336
  }
294
- if (typeof this.type !== 'undefined') {
295
- toReturn['type'] = this.type;
337
+ if (typeof this.configurationUrl !== 'undefined') {
338
+ toReturn['configurationUrl'] = this.configurationUrl;
296
339
  }
297
- if (typeof this.avatarUrl !== 'undefined') {
298
- toReturn['avatarUrl'] = this.avatarUrl;
340
+ if (typeof this.assistantKeys !== 'undefined' && this.assistantKeys !== null) {
341
+ toReturn['assistantKeys'] = 'toApiJson' in this.assistantKeys ? this.assistantKeys.toApiJson() : this.assistantKeys;
299
342
  }
300
- if (typeof this.config !== 'undefined' && this.config !== null) {
301
- toReturn['config'] = 'toApiJson' in this.config ? this.config.toApiJson() : this.config;
343
+ if (typeof this.connectionType !== 'undefined') {
344
+ toReturn['connectionType'] = this.connectionType;
302
345
  }
303
- return toReturn;
304
- }
305
- }
306
- class Config {
307
- static fromProto(proto) {
308
- let m = new Config();
309
- m = Object.assign(m, proto);
310
- if (proto.inboxConfig) {
311
- m.inboxConfig = ConfigInboxConfig.fromProto(proto.inboxConfig);
346
+ if (typeof this.connectionTypeName !== 'undefined') {
347
+ toReturn['connectionTypeName'] = this.connectionTypeName;
312
348
  }
313
- return m;
314
- }
315
- constructor(kwargs) {
316
- if (!kwargs) {
317
- return;
349
+ if (typeof this.iconUrl !== 'undefined') {
350
+ toReturn['iconUrl'] = this.iconUrl;
318
351
  }
319
- Object.assign(this, kwargs);
320
- }
321
- toApiJson() {
322
- const toReturn = {};
323
- if (typeof this.inboxConfig !== 'undefined' && this.inboxConfig !== null) {
324
- toReturn['inboxConfig'] = 'toApiJson' in this.inboxConfig ? this.inboxConfig.toApiJson() : this.inboxConfig;
352
+ if (typeof this.isConnectionLocked !== 'undefined') {
353
+ toReturn['isConnectionLocked'] = this.isConnectionLocked;
325
354
  }
326
355
  return toReturn;
327
356
  }
328
357
  }
329
- class ConfigInboxConfig {
358
+ class ConnectionKey {
330
359
  static fromProto(proto) {
331
- let m = new ConfigInboxConfig();
360
+ let m = new ConnectionKey();
332
361
  m = Object.assign(m, proto);
362
+ if (proto.namespace) {
363
+ m.namespace = Namespace.fromProto(proto.namespace);
364
+ }
333
365
  return m;
334
366
  }
335
367
  constructor(kwargs) {
@@ -340,11 +372,14 @@ class ConfigInboxConfig {
340
372
  }
341
373
  toApiJson() {
342
374
  const toReturn = {};
343
- if (typeof this.leadCaptureEnabled !== 'undefined') {
344
- toReturn['leadCaptureEnabled'] = this.leadCaptureEnabled;
375
+ if (typeof this.id !== 'undefined') {
376
+ toReturn['id'] = this.id;
345
377
  }
346
- if (typeof this.additionalInstructions !== 'undefined') {
347
- toReturn['additionalInstructions'] = this.additionalInstructions;
378
+ if (typeof this.namespace !== 'undefined' && this.namespace !== null) {
379
+ toReturn['namespace'] = 'toApiJson' in this.namespace ? this.namespace.toApiJson() : this.namespace;
380
+ }
381
+ if (typeof this.connectionType !== 'undefined') {
382
+ toReturn['connectionType'] = this.connectionType;
348
383
  }
349
384
  return toReturn;
350
385
  }
@@ -840,6 +875,29 @@ class ListAssistantRequestFilters {
840
875
  return toReturn;
841
876
  }
842
877
  }
878
+ class ListAllAssistantsAssociatedToConnectionRequestFilters {
879
+ static fromProto(proto) {
880
+ let m = new ListAllAssistantsAssociatedToConnectionRequestFilters();
881
+ m = Object.assign(m, proto);
882
+ if (proto.type) {
883
+ m.type = enumStringToValue(AssistantType, proto.type);
884
+ }
885
+ return m;
886
+ }
887
+ constructor(kwargs) {
888
+ if (!kwargs) {
889
+ return;
890
+ }
891
+ Object.assign(this, kwargs);
892
+ }
893
+ toApiJson() {
894
+ const toReturn = {};
895
+ if (typeof this.type !== 'undefined') {
896
+ toReturn['type'] = this.type;
897
+ }
898
+ return toReturn;
899
+ }
900
+ }
843
901
  class ListConnectionsRequestFilters {
844
902
  static fromProto(proto) {
845
903
  let m = new ListConnectionsRequestFilters();
@@ -1135,6 +1193,55 @@ class GetDeployedPromptVersionResponse {
1135
1193
  return toReturn;
1136
1194
  }
1137
1195
  }
1196
+ class GetMultiDeployedPromptVersionRequest {
1197
+ static fromProto(proto) {
1198
+ let m = new GetMultiDeployedPromptVersionRequest();
1199
+ m = Object.assign(m, proto);
1200
+ return m;
1201
+ }
1202
+ constructor(kwargs) {
1203
+ if (!kwargs) {
1204
+ return;
1205
+ }
1206
+ Object.assign(this, kwargs);
1207
+ }
1208
+ toApiJson() {
1209
+ const toReturn = {};
1210
+ if (typeof this.ids !== 'undefined') {
1211
+ toReturn['ids'] = this.ids;
1212
+ }
1213
+ return toReturn;
1214
+ }
1215
+ }
1216
+ class GetMultiDeployedPromptVersionResponse {
1217
+ static fromProto(proto) {
1218
+ let m = new GetMultiDeployedPromptVersionResponse();
1219
+ m = Object.assign(m, proto);
1220
+ if (proto.prompts) {
1221
+ m.prompts = proto.prompts.map(Prompt.fromProto);
1222
+ }
1223
+ if (proto.deployedPromptVersions) {
1224
+ m.deployedPromptVersions = proto.deployedPromptVersions.map(PromptVersion.fromProto);
1225
+ }
1226
+ return m;
1227
+ }
1228
+ constructor(kwargs) {
1229
+ if (!kwargs) {
1230
+ return;
1231
+ }
1232
+ Object.assign(this, kwargs);
1233
+ }
1234
+ toApiJson() {
1235
+ const toReturn = {};
1236
+ if (typeof this.prompts !== 'undefined' && this.prompts !== null) {
1237
+ toReturn['prompts'] = 'toApiJson' in this.prompts ? this.prompts.toApiJson() : this.prompts;
1238
+ }
1239
+ if (typeof this.deployedPromptVersions !== 'undefined' && this.deployedPromptVersions !== null) {
1240
+ toReturn['deployedPromptVersions'] = 'toApiJson' in this.deployedPromptVersions ? this.deployedPromptVersions.toApiJson() : this.deployedPromptVersions;
1241
+ }
1242
+ return toReturn;
1243
+ }
1244
+ }
1138
1245
  class GetPromptRequest {
1139
1246
  static fromProto(proto) {
1140
1247
  let m = new GetPromptRequest();
@@ -1224,6 +1331,58 @@ class GetPromptVersionResponse {
1224
1331
  return toReturn;
1225
1332
  }
1226
1333
  }
1334
+ class ListAllAssistantsAssociatedToConnectionRequest {
1335
+ static fromProto(proto) {
1336
+ let m = new ListAllAssistantsAssociatedToConnectionRequest();
1337
+ m = Object.assign(m, proto);
1338
+ if (proto.connectionKey) {
1339
+ m.connectionKey = ConnectionKey.fromProto(proto.connectionKey);
1340
+ }
1341
+ if (proto.filters) {
1342
+ m.filters = ListAllAssistantsAssociatedToConnectionRequestFilters.fromProto(proto.filters);
1343
+ }
1344
+ return m;
1345
+ }
1346
+ constructor(kwargs) {
1347
+ if (!kwargs) {
1348
+ return;
1349
+ }
1350
+ Object.assign(this, kwargs);
1351
+ }
1352
+ toApiJson() {
1353
+ const toReturn = {};
1354
+ if (typeof this.connectionKey !== 'undefined' && this.connectionKey !== null) {
1355
+ toReturn['connectionKey'] = 'toApiJson' in this.connectionKey ? this.connectionKey.toApiJson() : this.connectionKey;
1356
+ }
1357
+ if (typeof this.filters !== 'undefined' && this.filters !== null) {
1358
+ toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;
1359
+ }
1360
+ return toReturn;
1361
+ }
1362
+ }
1363
+ class ListAllAssistantsAssociatedToConnectionResponse {
1364
+ static fromProto(proto) {
1365
+ let m = new ListAllAssistantsAssociatedToConnectionResponse();
1366
+ m = Object.assign(m, proto);
1367
+ if (proto.assistants) {
1368
+ m.assistants = proto.assistants.map(Assistant.fromProto);
1369
+ }
1370
+ return m;
1371
+ }
1372
+ constructor(kwargs) {
1373
+ if (!kwargs) {
1374
+ return;
1375
+ }
1376
+ Object.assign(this, kwargs);
1377
+ }
1378
+ toApiJson() {
1379
+ const toReturn = {};
1380
+ if (typeof this.assistants !== 'undefined' && this.assistants !== null) {
1381
+ toReturn['assistants'] = 'toApiJson' in this.assistants ? this.assistants.toApiJson() : this.assistants;
1382
+ }
1383
+ return toReturn;
1384
+ }
1385
+ }
1227
1386
  class ListAssistantRequest {
1228
1387
  static fromProto(proto) {
1229
1388
  let m = new ListAssistantRequest();
@@ -1618,6 +1777,11 @@ class AssistantApiService {
1618
1777
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/ListAssistant", request.toApiJson(), this.apiOptions())
1619
1778
  .pipe(map(resp => ListAssistantResponse.fromProto(resp)));
1620
1779
  }
1780
+ listAllAssistantsAssociatedToConnection(r) {
1781
+ const request = (r.toApiJson) ? r : new ListAllAssistantsAssociatedToConnectionRequest(r);
1782
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/ListAllAssistantsAssociatedToConnection", request.toApiJson(), this.apiOptions())
1783
+ .pipe(map(resp => ListAllAssistantsAssociatedToConnectionResponse.fromProto(resp)));
1784
+ }
1621
1785
  generateChatAnswer(r) {
1622
1786
  const request = (r.toApiJson) ? r : new GenerateChatAnswerRequest(r);
1623
1787
  return this.http.post(this._host + "/ai_assistants.v1alpha1.AssistantService/GenerateChatAnswer", request.toApiJson(), this.apiOptions())
@@ -1721,6 +1885,11 @@ class PromptApiService {
1721
1885
  return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/GetDeployedVersion", request.toApiJson(), this.apiOptions())
1722
1886
  .pipe(map(resp => GetDeployedPromptVersionResponse.fromProto(resp)));
1723
1887
  }
1888
+ getMultiDeployedVersion(r) {
1889
+ const request = (r.toApiJson) ? r : new GetMultiDeployedPromptVersionRequest(r);
1890
+ return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/GetMultiDeployedVersion", request.toApiJson(), this.apiOptions())
1891
+ .pipe(map(resp => GetMultiDeployedPromptVersionResponse.fromProto(resp)));
1892
+ }
1724
1893
  update(r) {
1725
1894
  const request = (r.toApiJson) ? r : new UpdatePromptRequest(r);
1726
1895
  return this.http.post(this._host + "/ai_assistants.v1alpha1.PromptService/Update", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
@@ -1762,5 +1931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1762
1931
  * Generated bundle index. Do not edit.
1763
1932
  */
1764
1933
 
1765
- export { Access, Assistant, AssistantApiService, AssistantType, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, Connection, ConnectionApiService, ConnectionKey, CreatePromptRequest, DeleteAssistantRequest, DeleteConnectionRequest, DeletePromptRequest, DeployPromptRequest, GenerateChatAnswerRequest, GenerateChatAnswerRequestOptions, GenerateChatAnswerResponse, GetAssistantRequest, GetAssistantResponse, GetChatAnswerFunctionExecutionJobRequest, GetChatAnswerFunctionExecutionJobResponse, GetConnectionRequest, GetConnectionResponse, GetDeployedPromptVersionRequest, GetDeployedPromptVersionResponse, GetPromptRequest, GetPromptResponse, GetPromptVersionRequest, GetPromptVersionResponse, HostService, KeyValuePair, ListAssistantRequest, ListAssistantRequestFilters, ListAssistantResponse, ListConnectionsRequest, ListConnectionsRequestFilters, ListConnectionsResponse, ListPromptRequest, ListPromptResponse, ListPromptVersionsRequest, ListPromptVersionsResponse, Namespace, NamespaceAccountGroupNamespace, NamespacePartnerNamespace, NamespaceSystemNamespace, PagedRequestOptions, PagedResponseMetadata, Prompt, PromptApiService, PromptVersion, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantResponse, UpsertConnectionRequest };
1934
+ export { Access, Assistant, AssistantApiService, AssistantKey, AssistantType, ChatAnswerFunctionExecutionJob, ChatAnswerFunctionExecutionJobResult, ChatAnswerFunctionExecutionJobStatus, ChatChannel, ChatMessage, ChatMessageRole, ChatUserInfo, Config, ConfigInboxConfig, Connection, ConnectionApiService, ConnectionKey, CreatePromptRequest, DeleteAssistantRequest, DeleteConnectionRequest, DeletePromptRequest, DeployPromptRequest, GenerateChatAnswerRequest, GenerateChatAnswerRequestOptions, GenerateChatAnswerResponse, GetAssistantRequest, GetAssistantResponse, GetChatAnswerFunctionExecutionJobRequest, GetChatAnswerFunctionExecutionJobResponse, GetConnectionRequest, GetConnectionResponse, GetDeployedPromptVersionRequest, GetDeployedPromptVersionResponse, GetMultiDeployedPromptVersionRequest, GetMultiDeployedPromptVersionResponse, GetPromptRequest, GetPromptResponse, GetPromptVersionRequest, GetPromptVersionResponse, HostService, KeyValuePair, ListAllAssistantsAssociatedToConnectionRequest, ListAllAssistantsAssociatedToConnectionRequestFilters, ListAllAssistantsAssociatedToConnectionResponse, ListAssistantRequest, ListAssistantRequestFilters, ListAssistantResponse, ListConnectionsRequest, ListConnectionsRequestFilters, ListConnectionsResponse, ListPromptRequest, ListPromptResponse, ListPromptVersionsRequest, ListPromptVersionsResponse, Namespace, NamespaceAccountGroupNamespace, NamespacePartnerNamespace, NamespaceSystemNamespace, PagedRequestOptions, PagedResponseMetadata, Prompt, PromptApiService, PromptVersion, UpdatePromptRequest, UpsertAssistantRequest, UpsertAssistantResponse, UpsertConnectionRequest };
1766
1935
  //# sourceMappingURL=vendasta-ai-assistants.mjs.map