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