@snugdesk/core 0.0.12 → 0.0.13

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.
package/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnChanges, ChangeDetectorRef, SimpleChanges, PipeTransform } from '@angular/core';
2
+ import { OnChanges, ChangeDetectorRef, SimpleChanges, PipeTransform, InjectionToken, ValueProvider } from '@angular/core';
3
3
  import * as i7 from '@angular/common';
4
4
  import * as i5 from '@angular/forms';
5
5
  import { ValidatorFn, FormGroup } from '@angular/forms';
6
6
  import { DomSanitizer } from '@angular/platform-browser';
7
+ import { BehaviorSubject, Subscription, Observable } from 'rxjs';
7
8
  import { HttpClient } from '@angular/common/http';
8
- import { BehaviorSubject, Subscription } from 'rxjs';
9
+ import { GraphQLResult } from '@aws-amplify/api-graphql';
9
10
 
10
11
  declare class ErrorComponent implements OnChanges {
11
12
  private cdr;
@@ -85,6 +86,113 @@ declare class SnugdeskCoreModule {
85
86
  static ɵinj: i0.ɵɵInjectorDeclaration<SnugdeskCoreModule>;
86
87
  }
87
88
 
89
+ declare class SnugdeskIPRegistryService {
90
+ private http;
91
+ private readonly IP_REGISTRY_API;
92
+ private readonly SESSION_KEY;
93
+ constructor(http: HttpClient);
94
+ private get cachedIPDetails();
95
+ private set cachedIPDetails(value);
96
+ getIPDetails(): Promise<any>;
97
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnugdeskIPRegistryService, never>;
98
+ static ɵprov: i0.ɵɵInjectableDeclaration<SnugdeskIPRegistryService>;
99
+ }
100
+
101
+ declare class SnugdeskAuthenticationHelperService {
102
+ private httpClient;
103
+ private ipRegistryService;
104
+ private readonly headers;
105
+ private readonly authEndpointURL;
106
+ constructor(httpClient: HttpClient, ipRegistryService: SnugdeskIPRegistryService);
107
+ getSessionToken(tenantId: string, userId: string): Promise<any>;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnugdeskAuthenticationHelperService, never>;
109
+ static ɵprov: i0.ɵɵInjectableDeclaration<SnugdeskAuthenticationHelperService>;
110
+ }
111
+
112
+ declare class SnugdeskAuthenticationService {
113
+ private authenticationHelperService;
114
+ isAuthenticated$: BehaviorSubject<boolean>;
115
+ tenant$: BehaviorSubject<any>;
116
+ user$: BehaviorSubject<any>;
117
+ userSession$: BehaviorSubject<any>;
118
+ tenantSubscription: Subscription;
119
+ userSubscription: Subscription;
120
+ userSessionSubscription: Subscription;
121
+ private readonly jwtHelper;
122
+ private readonly TOKEN_KEY;
123
+ constructor(authenticationHelperService: SnugdeskAuthenticationHelperService);
124
+ getToken(): string | null;
125
+ setToken(token: string): void;
126
+ checkToken(token: string): boolean;
127
+ getDecodedToken(): any;
128
+ getTenantId(): string;
129
+ getUserId(): string;
130
+ getUserSessionId(): string;
131
+ getUserPreferences(): any;
132
+ isAuthenticated(): boolean;
133
+ authenticate(token?: string, tenantId?: string, userId?: string): Promise<boolean>;
134
+ login(tenantId: string, userId: string): Promise<Boolean>;
135
+ logout(userSessionId?: string): Promise<void>;
136
+ endUserSession(userSessionId?: string): Promise<void>;
137
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnugdeskAuthenticationService, never>;
138
+ static ɵprov: i0.ɵɵInjectableDeclaration<SnugdeskAuthenticationService>;
139
+ }
140
+
141
+ interface AmplifyConfig {
142
+ aws_project_region: string;
143
+ aws_appsync_graphqlEndpoint: string;
144
+ aws_appsync_region: string;
145
+ aws_appsync_authenticationType: string;
146
+ aws_appsync_apiKey?: string;
147
+ }
148
+ declare const AMPLIFY_CONFIG: InjectionToken<AmplifyConfig>;
149
+ declare function provideAmplifyConfig(config: AmplifyConfig): ValueProvider;
150
+ declare class AppSyncHelperService {
151
+ private readonly authenticationService;
152
+ private configured;
153
+ private authMode;
154
+ private readonly amplifyConfig?;
155
+ constructor(amplifyConfig: AmplifyConfig | null, authenticationService: SnugdeskAuthenticationService);
156
+ query<T>(statement: string, variables?: Record<string, unknown>): Promise<GraphQLResult<T>>;
157
+ mutate<T>(statement: string, variables?: Record<string, unknown>): Promise<GraphQLResult<T>>;
158
+ subscribe<T>(statement: string, variables?: Record<string, unknown>): Observable<GraphQLResult<T>>;
159
+ private ensureConfigured;
160
+ private getHostConfig;
161
+ private normalizeAuthMode;
162
+ private getAuthModeFromConfig;
163
+ private buildAuthHeaders;
164
+ private getToken;
165
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppSyncHelperService, [{ optional: true; }, null]>;
166
+ static ɵprov: i0.ɵɵInjectableDeclaration<AppSyncHelperService>;
167
+ }
168
+
169
+ interface S3Credentials {
170
+ accessKeyId: string;
171
+ secretAccessKey: string;
172
+ }
173
+ interface S3Config {
174
+ region: string;
175
+ credentials: S3Credentials;
176
+ }
177
+ declare class S3HelperService {
178
+ private http;
179
+ private readonly API_BASE;
180
+ private readonly jwt;
181
+ constructor(http: HttpClient);
182
+ getS3Config(token: string, region: string): Promise<S3Config>;
183
+ /**
184
+ * Validates and decodes the JWT token.
185
+ * @throws Error if the token is empty, expired, or invalid.
186
+ * @returns The decoded JWT payload.
187
+ */
188
+ private parseToken;
189
+ private fetchEncryptedCredentials;
190
+ private base64ToBytes;
191
+ private decryptCredentials;
192
+ static ɵfac: i0.ɵɵFactoryDeclaration<S3HelperService, never>;
193
+ static ɵprov: i0.ɵɵInjectableDeclaration<S3HelperService>;
194
+ }
195
+
88
196
  declare enum ModelAttributeTypes {
89
197
  binary = "binary",
90
198
  binarySet = "binarySet",
@@ -183,6 +291,28 @@ type ModelStringKeyConditionInput = {
183
291
  between?: Array<string | null> | null;
184
292
  beginsWith?: string | null;
185
293
  };
294
+ interface SubscriptionResponse<T> {
295
+ value: GraphQLResult<T>;
296
+ }
297
+ type Country = {
298
+ code: string;
299
+ nameEn: string;
300
+ nameLocal?: string | null;
301
+ currency?: CountryCurrency | null;
302
+ officialLanguage?: CountryLanguage | null;
303
+ callingCode?: string | null;
304
+ region?: string | null;
305
+ flag?: string | null;
306
+ };
307
+ type CountryCurrency = {
308
+ code: string;
309
+ nameEn: string;
310
+ };
311
+ type CountryLanguage = {
312
+ code: string;
313
+ nameEn: string;
314
+ nameLocal?: string | null;
315
+ };
186
316
  type Language = {
187
317
  code: string;
188
318
  nameEn: string;
@@ -202,146 +332,287 @@ type S3Object = {
202
332
  location: string;
203
333
  };
204
334
 
205
- declare class SnugdeskIPRegistryService {
206
- private http;
207
- private readonly IP_REGISTRY_API;
208
- private readonly SESSION_KEY;
209
- constructor(http: HttpClient);
210
- private get cachedIPDetails();
211
- private set cachedIPDetails(value);
212
- getIPDetails(): Promise<any>;
213
- static ɵfac: i0.ɵɵFactoryDeclaration<SnugdeskIPRegistryService, never>;
214
- static ɵprov: i0.ɵɵInjectableDeclaration<SnugdeskIPRegistryService>;
215
- }
216
-
217
- declare class SnugdeskAuthenticationHelperService {
218
- private httpClient;
219
- private ipRegistryService;
220
- private readonly headers;
221
- private readonly authEndpointURL;
222
- constructor(httpClient: HttpClient, ipRegistryService: SnugdeskIPRegistryService);
223
- getSessionToken(tenantId: string, userId: string): Promise<any>;
224
- static ɵfac: i0.ɵɵFactoryDeclaration<SnugdeskAuthenticationHelperService, never>;
225
- static ɵprov: i0.ɵɵInjectableDeclaration<SnugdeskAuthenticationHelperService>;
226
- }
227
-
228
- declare class SnugdeskAuthenticationService {
229
- private authHelperService;
230
- isAuthenticated$: BehaviorSubject<boolean>;
231
- tenant$: BehaviorSubject<any>;
232
- user$: BehaviorSubject<any>;
233
- userSession$: BehaviorSubject<any>;
234
- tenantSubscription: Subscription;
235
- userSubscription: Subscription;
236
- userSessionSubscription: Subscription;
237
- private readonly jwtHelper;
238
- private readonly TOKEN_KEY;
239
- constructor(authHelperService: SnugdeskAuthenticationHelperService);
240
- getToken(): string | null;
241
- setToken(token: string): void;
242
- checkToken(token: string): boolean;
243
- getDecodedToken(): any;
244
- getTenantId(): string;
245
- getUserId(): string;
246
- getUserSessionId(): string;
247
- getUserPreferences(): any;
248
- isAuthenticated(): boolean;
249
- authenticate(token?: string, tenantId?: string, userId?: string): Promise<boolean>;
250
- login(tenantId: string, userId: string): Promise<Boolean>;
251
- logout(userSessionId?: string): Promise<void>;
252
- endUserSession(userSessionId?: string): Promise<void>;
253
- static ɵfac: i0.ɵɵFactoryDeclaration<SnugdeskAuthenticationService, never>;
254
- static ɵprov: i0.ɵɵInjectableDeclaration<SnugdeskAuthenticationService>;
255
- }
256
-
257
- declare class GraphQLHelperService {
258
- private http;
259
- private authenticationService;
260
- private readonly GRAPHQL_API;
261
- constructor(http: HttpClient, authenticationService: SnugdeskAuthenticationService);
262
- /**
263
- * Executes a GraphQL query with the provided variables.
264
- * @param query The GraphQL query string.
265
- * @param variables Optional variables for the query.
266
- * @returns A promise that resolves with the response data.
267
- */
268
- executeQuery(query: string, variables?: any): Promise<any>;
269
- static ɵfac: i0.ɵɵFactoryDeclaration<GraphQLHelperService, never>;
270
- static ɵprov: i0.ɵɵInjectableDeclaration<GraphQLHelperService>;
271
- }
272
-
273
- interface S3Credentials {
274
- accessKeyId: string;
275
- secretAccessKey: string;
276
- }
277
- interface S3Config {
278
- region: string;
279
- credentials: S3Credentials;
280
- }
281
- declare class S3HelperService {
282
- private http;
283
- private readonly API_BASE;
284
- private readonly jwt;
285
- constructor(http: HttpClient);
286
- getS3Config(token: string, region: string): Promise<S3Config>;
287
- /**
288
- * Validates and decodes the JWT token.
289
- * @throws Error if the token is empty, expired, or invalid.
290
- * @returns The decoded JWT payload.
291
- */
292
- private parseToken;
293
- private fetchEncryptedCredentials;
294
- private base64ToBytes;
295
- private decryptCredentials;
296
- static ɵfac: i0.ɵɵFactoryDeclaration<S3HelperService, never>;
297
- static ɵprov: i0.ɵɵInjectableDeclaration<S3HelperService>;
335
+ type Entity = {
336
+ id: string;
337
+ externalId?: string | null;
338
+ tenantId: string;
339
+ name: string;
340
+ image?: S3Object | null;
341
+ email?: string | null;
342
+ phoneNumber?: PhoneNumber | null;
343
+ phoneNumberE164?: string | null;
344
+ preferences?: EntityPreferences | null;
345
+ contactPreferences?: EntityContactPreferences | null;
346
+ createdAt: number;
347
+ updatedAt: number;
348
+ blockedAt?: number | null;
349
+ deletedAt?: number | null;
350
+ };
351
+ type EntityPreferences = {
352
+ timezoneName?: string | null;
353
+ language?: Language | null;
354
+ };
355
+ type EntityContactPreferences = {
356
+ allowCall?: boolean | null;
357
+ allowEmail?: boolean | null;
358
+ allowSMS?: boolean | null;
359
+ allowWhatsApp?: boolean | null;
360
+ };
361
+ type CreateEntityInput = {
362
+ id?: string | null;
363
+ externalId?: string | null;
364
+ tenantId: string;
365
+ name: string;
366
+ image?: S3Object | null;
367
+ email?: string | null;
368
+ phoneNumber?: PhoneNumber | null;
369
+ phoneNumberE164?: string | null;
370
+ isOrganization: boolean;
371
+ createdAt: number;
372
+ updatedAt: number;
373
+ blockedAt?: number | null;
374
+ deletedAt?: number | null;
375
+ updatedByUserId: string;
376
+ updatedByUserSessionId?: string | null;
377
+ };
378
+ type UpdateEntityInput = {
379
+ id: string;
380
+ externalId?: string | null;
381
+ tenantId?: string | null;
382
+ name?: string | null;
383
+ image?: S3Object | null;
384
+ email?: string | null;
385
+ phoneNumber?: PhoneNumber | null;
386
+ phoneNumberE164?: string | null;
387
+ isOrganization?: boolean | null;
388
+ createdAt?: number | null;
389
+ updatedAt: number;
390
+ blockedAt?: number | null;
391
+ deletedAt?: number | null;
392
+ updatedByUserId?: string | null;
393
+ updatedByUserSessionId?: string | null;
394
+ };
395
+ type ModelEntityConditionInput = {
396
+ externalId?: ModelStringInput | null;
397
+ tenantId?: ModelIDInput | null;
398
+ entityTypeId?: ModelIDInput | null;
399
+ parentId?: ModelIDInput | null;
400
+ name?: ModelStringInput | null;
401
+ email?: ModelStringInput | null;
402
+ phoneNumberE164?: ModelStringInput | null;
403
+ isOrganization?: ModelBooleanInput | null;
404
+ createdAt?: ModelIntInput | null;
405
+ updatedAt?: ModelIntInput | null;
406
+ blockedAt?: ModelIntInput | null;
407
+ deletedAt?: ModelIntInput | null;
408
+ and?: Array<ModelEntityConditionInput | null> | null;
409
+ or?: Array<ModelEntityConditionInput | null> | null;
410
+ not?: ModelEntityConditionInput | null;
411
+ };
412
+ type ModelEntityFilterInput = {
413
+ id?: ModelIDInput | null;
414
+ externalId?: ModelStringInput | null;
415
+ tenantId?: ModelIDInput | null;
416
+ entityTypeId?: ModelIDInput | null;
417
+ parentId?: ModelIDInput | null;
418
+ name?: ModelStringInput | null;
419
+ email?: ModelStringInput | null;
420
+ phoneNumberE164?: ModelStringInput | null;
421
+ isOrganization?: ModelBooleanInput | null;
422
+ createdAt?: ModelIntInput | null;
423
+ updatedAt?: ModelIntInput | null;
424
+ blockedAt?: ModelIntInput | null;
425
+ deletedAt?: ModelIntInput | null;
426
+ and?: Array<ModelEntityFilterInput | null> | null;
427
+ or?: Array<ModelEntityFilterInput | null> | null;
428
+ not?: ModelEntityFilterInput | null;
429
+ };
430
+ type ListEntities = {
431
+ items: Array<Entity | null>;
432
+ nextToken?: string | null;
433
+ };
434
+ declare class EntityService {
435
+ private readonly appSyncService;
436
+ constructor(appSyncService: AppSyncHelperService);
437
+ GetEntity(id: string): Promise<Entity>;
438
+ CreateEntity(input: CreateEntityInput, condition?: ModelEntityConditionInput): Promise<Entity>;
439
+ UpdateEntity(input: UpdateEntityInput, condition?: ModelEntityConditionInput): Promise<Entity>;
440
+ ListEntitiesByTenantId(tenantId: string, name?: ModelStringKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelEntityFilterInput, limit?: number, nextToken?: string): Promise<ListEntities>;
441
+ ListEntitiesByTenantIdAndPhoneNumberE164(tenantId: string, phoneNumberE164?: ModelStringKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelEntityFilterInput, limit?: number, nextToken?: string): Promise<ListEntities>;
442
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityService, never>;
443
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityService>;
298
444
  }
299
445
 
446
+ type TenantPreferences = {
447
+ timezoneName?: string | null;
448
+ language?: Language | null;
449
+ allowUserToChangePreferences?: boolean | null;
450
+ };
451
+ type TenantSecurity = {
452
+ domainValidationTokenExpiry?: number | null;
453
+ userValidationTokenExpiry?: number | null;
454
+ secretTokenExpiry?: number | null;
455
+ sessionTokenExpiry?: number | null;
456
+ sessionIdleTimeout?: number | null;
457
+ };
300
458
  type Tenant = {
301
459
  id: string;
460
+ externalId?: string | null;
302
461
  tenantDomain: string;
303
462
  organizationName: string;
304
463
  websiteURL?: string | null;
305
- image?: {
306
- key: string;
307
- bucket: string;
308
- location: string;
309
- } | null;
310
- preferences?: {
311
- timezoneName?: string | null;
312
- language?: Language | null;
313
- allowUserToChangePreferences?: boolean | null;
314
- } | null;
315
- security?: {
316
- domainValidationTokenExpiry?: number | null;
317
- userValidationTokenExpiry?: number | null;
318
- secretTokenExpiry?: number | null;
319
- sessionTokenExpiry?: number | null;
320
- sessionIdleTimeout?: number | null;
321
- } | null;
464
+ image?: S3Object | null;
465
+ preferences?: TenantPreferences | null;
466
+ security?: TenantSecurity | null;
322
467
  activatedAt?: number | null;
323
468
  blockedAt?: number | null;
324
469
  createdAt: number;
325
470
  updatedAt: number;
326
471
  deletedAt?: number | null;
327
- interactionWidgets?: {
328
- nextToken?: string | null;
329
- } | null;
472
+ };
473
+ type __SubscriptionContainer$4 = {
474
+ OnTenantById: Tenant;
330
475
  };
331
476
  declare class TenantService {
332
- private graphQLHelperService;
333
- constructor(graphQLHelperService: GraphQLHelperService);
477
+ private readonly appSyncService;
478
+ constructor(appSyncService: AppSyncHelperService);
334
479
  getTenantById(id: string): Promise<Tenant>;
335
480
  private GetTenant;
481
+ OnTenantByIdListener(id: string): Observable<SubscriptionResponse<Pick<__SubscriptionContainer$4, 'OnTenantById'>>>;
336
482
  static ɵfac: i0.ɵɵFactoryDeclaration<TenantService, never>;
337
483
  static ɵprov: i0.ɵɵInjectableDeclaration<TenantService>;
338
484
  }
339
485
 
340
- declare enum UserType {
341
- AGENT = "AGENT",
342
- SUPERVISOR = "SUPERVISOR",
343
- ADMINISTRATOR = "ADMINISTRATOR"
486
+ type InteractionWidget = {
487
+ id: string;
488
+ tenantId: string;
489
+ tenant?: Tenant | null;
490
+ channel: InteractionChannel;
491
+ provider: InteractionProvider;
492
+ providerAccountId?: string | null;
493
+ name: string;
494
+ description?: string | null;
495
+ configuration?: string | null;
496
+ isRecordingEnabledByDefault: boolean;
497
+ isRecordingEnabledOnDemand: boolean;
498
+ isTranscriptionEnabledByDefault: boolean;
499
+ isTranscriptionEnabledOnDemand: boolean;
500
+ routeConfiguration?: InteractionRouteConfiguration | null;
501
+ createdAt: number;
502
+ updatedAt: number;
503
+ deletedAt?: number | null;
504
+ };
505
+ type ListInteractionWidgets = {
506
+ items: Array<InteractionWidget | null>;
507
+ nextToken?: string | null;
508
+ };
509
+ type ModelInteractionWidgetConditionInput = {
510
+ tenantId?: ModelIDInput | null;
511
+ channel?: ModelInteractionChannelInput | null;
512
+ provider?: ModelInteractionProviderInput | null;
513
+ providerAccountId?: ModelStringInput | null;
514
+ name?: ModelStringInput | null;
515
+ description?: ModelStringInput | null;
516
+ configuration?: ModelStringInput | null;
517
+ isRecordingEnabledByDefault?: ModelBooleanInput | null;
518
+ isRecordingEnabledOnDemand?: ModelBooleanInput | null;
519
+ isTranscriptionEnabledByDefault?: ModelBooleanInput | null;
520
+ isTranscriptionEnabledOnDemand?: ModelBooleanInput | null;
521
+ createdAt?: ModelIntInput | null;
522
+ updatedAt?: ModelIntInput | null;
523
+ updatedByUserId?: ModelIDInput | null;
524
+ updatedByUserSessionId?: ModelIDInput | null;
525
+ deletedAt?: ModelIntInput | null;
526
+ and?: Array<ModelInteractionWidgetConditionInput | null> | null;
527
+ or?: Array<ModelInteractionWidgetConditionInput | null> | null;
528
+ not?: ModelInteractionWidgetConditionInput | null;
529
+ };
530
+ type ModelInteractionWidgetFilterInput = {
531
+ id?: ModelIDInput | null;
532
+ tenantId?: ModelIDInput | null;
533
+ channel?: ModelInteractionChannelInput | null;
534
+ provider?: ModelInteractionProviderInput | null;
535
+ providerAccountId?: ModelStringInput | null;
536
+ name?: ModelStringInput | null;
537
+ description?: ModelStringInput | null;
538
+ configuration?: ModelStringInput | null;
539
+ isRecordingEnabledByDefault?: ModelBooleanInput | null;
540
+ isRecordingEnabledOnDemand?: ModelBooleanInput | null;
541
+ isTranscriptionEnabledByDefault?: ModelBooleanInput | null;
542
+ isTranscriptionEnabledOnDemand?: ModelBooleanInput | null;
543
+ createdAt?: ModelIntInput | null;
544
+ updatedAt?: ModelIntInput | null;
545
+ updatedByUserId?: ModelIDInput | null;
546
+ updatedByUserSessionId?: ModelIDInput | null;
547
+ deletedAt?: ModelIntInput | null;
548
+ and?: Array<ModelInteractionWidgetFilterInput | null> | null;
549
+ or?: Array<ModelInteractionWidgetFilterInput | null> | null;
550
+ not?: ModelInteractionWidgetFilterInput | null;
551
+ };
552
+ declare const FIELDS_INTERACTION_WIDGET = "\n id\n tenantId\n channel\n provider\n providerAccountId\n name\n description\n configuration\n isRecordingEnabledByDefault\n isRecordingEnabledOnDemand\n isTranscriptionEnabledByDefault\n isTranscriptionEnabledOnDemand\n routeConfiguration {\n teamId\n routingLogic\n maxWaitTimeoutSeconds\n }\n createdAt\n updatedAt\n deletedAt\n";
553
+ declare class InteractionWidgetService {
554
+ private readonly appSyncService;
555
+ constructor(appSyncService: AppSyncHelperService);
556
+ GetInteractionWidget(id: string): Promise<InteractionWidget>;
557
+ ListInteractionWidgetsByTenantId(tenantId: string, name?: ModelStringKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionWidgetFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionWidgets>;
558
+ static ɵfac: i0.ɵɵFactoryDeclaration<InteractionWidgetService, never>;
559
+ static ɵprov: i0.ɵɵInjectableDeclaration<InteractionWidgetService>;
344
560
  }
561
+
562
+ type InteractionEndpoint = {
563
+ id: string;
564
+ externalId: string;
565
+ tenantId: string;
566
+ widgetId: string;
567
+ widget?: InteractionWidget | null;
568
+ address: string;
569
+ configuration?: string | null;
570
+ sellPrice?: InteractionEndpointPriceDetails | null;
571
+ documents?: Array<InteractionEndpointRegulatoryComplianceDocument | null> | null;
572
+ createdAt: number;
573
+ updatedAt: number;
574
+ deletedAt?: number | null;
575
+ };
576
+ type InteractionEndpointPriceDetails = {
577
+ currency: string;
578
+ upfrontCost: number;
579
+ monthlyCost: number;
580
+ inboundCost: number;
581
+ outboundCost: number;
582
+ };
583
+ type InteractionEndpointRegulatoryComplianceDocument = {
584
+ fileName: string;
585
+ documentType?: string | null;
586
+ contentType?: string | null;
587
+ file?: S3Object | null;
588
+ };
589
+ declare class InteractionEndpointService {
590
+ static ɵfac: i0.ɵɵFactoryDeclaration<InteractionEndpointService, never>;
591
+ static ɵprov: i0.ɵɵInjectableDeclaration<InteractionEndpointService>;
592
+ }
593
+
594
+ type Team = {
595
+ id: string;
596
+ tenantId: string;
597
+ name: string;
598
+ description?: string | null;
599
+ image?: S3Object | null;
600
+ ticketFields?: Array<string | null> | null;
601
+ createdAt: number;
602
+ updatedAt: number;
603
+ deletedAt?: number | null;
604
+ };
605
+
606
+ type UserPreferences = {
607
+ timezoneName?: string | null;
608
+ language?: Language | null;
609
+ };
610
+ type UserNotificationSettings = {
611
+ allowPush?: boolean | null;
612
+ allowEmail?: boolean | null;
613
+ allowSMS?: boolean | null;
614
+ allowWhatsApp?: boolean | null;
615
+ };
345
616
  declare enum UserStatus {
346
617
  READY = "READY",
347
618
  NOT_READY = "NOT_READY",
@@ -349,34 +620,21 @@ declare enum UserStatus {
349
620
  BUSY = "BUSY",
350
621
  AFTER_CALL_WORK = "AFTER_CALL_WORK"
351
622
  }
623
+ declare enum UserType {
624
+ AGENT = "AGENT",
625
+ SUPERVISOR = "SUPERVISOR",
626
+ ADMINISTRATOR = "ADMINISTRATOR"
627
+ }
352
628
  type User = {
353
629
  id: string;
630
+ externalId?: string | null;
354
631
  tenantId: string;
355
632
  email: string;
356
633
  name?: string | null;
357
- image?: {
358
- key: string;
359
- bucket: string;
360
- location: string;
361
- } | null;
362
- phoneNumber?: {
363
- countryCode?: string | null;
364
- dialCode?: string | null;
365
- e164Number?: string | null;
366
- internationalNumber?: string | null;
367
- nationalNumber?: string | null;
368
- number?: string | null;
369
- } | null;
370
- preferences?: {
371
- timezoneName?: string | null;
372
- language?: Language | null;
373
- } | null;
374
- notificationSettings?: {
375
- allowPush?: boolean | null;
376
- allowEmail?: boolean | null;
377
- allowSMS?: boolean | null;
378
- allowWhatsApp?: boolean | null;
379
- } | null;
634
+ image?: S3Object | null;
635
+ phoneNumber?: PhoneNumber | null;
636
+ preferences?: UserPreferences | null;
637
+ notificationSettings?: UserNotificationSettings | null;
380
638
  type?: UserType | null;
381
639
  activatedAt?: number | null;
382
640
  blockedAt?: number | null;
@@ -384,15 +642,740 @@ type User = {
384
642
  updatedAt: number;
385
643
  deletedAt?: number | null;
386
644
  };
645
+ type ModelUserStatusInput = {
646
+ eq?: UserStatus | null;
647
+ ne?: UserStatus | null;
648
+ };
649
+ type __SubscriptionContainer$3 = {
650
+ OnUserById: User;
651
+ };
387
652
  declare class UserService {
388
- private graphQLHelperService;
389
- constructor(graphQLHelperService: GraphQLHelperService);
653
+ private readonly appSyncService;
654
+ constructor(appSyncService: AppSyncHelperService);
390
655
  getUserById(id: string): Promise<User>;
391
656
  GetUser(id: string): Promise<User>;
657
+ OnUserByIdListener(id: string): Observable<SubscriptionResponse<Pick<__SubscriptionContainer$3, 'OnUserById'>>>;
392
658
  static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
393
659
  static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
394
660
  }
395
661
 
662
+ type UserSession = {
663
+ id: string;
664
+ tenantId: string;
665
+ userId: string;
666
+ user?: User | null;
667
+ ipDetails?: string | null;
668
+ status?: UserStatus | null;
669
+ teamIds?: Array<string | null> | null;
670
+ temp_isLocked?: boolean | null;
671
+ temp_isAvailableTenantIdUnion?: string | null;
672
+ createdAt: number;
673
+ updatedAt: number;
674
+ expiryAt: number;
675
+ loggedOutAt?: number | null;
676
+ blockedAt?: number | null;
677
+ };
678
+ type ListUserSessions = {
679
+ items: Array<UserSession | null>;
680
+ nextToken?: string | null;
681
+ };
682
+ type UpdateUserSessionInput = {
683
+ id: string;
684
+ tenantId?: string | null;
685
+ userId?: string | null;
686
+ ipDetails?: string | null;
687
+ status?: UserStatus | null;
688
+ teamIds?: Array<string | null> | null;
689
+ temp_isLocked?: boolean | null;
690
+ temp_isAvailableTenantIdUnion?: string | null;
691
+ createdAt?: number | null;
692
+ updatedAt?: number | null;
693
+ expiryAt?: number | null;
694
+ loggedOutAt?: number | null;
695
+ blockedAt?: number | null;
696
+ };
697
+ type ModelUserSessionConditionInput = {
698
+ tenantId?: ModelIDInput | null;
699
+ userId?: ModelIDInput | null;
700
+ ipDetails?: ModelStringInput | null;
701
+ status?: ModelUserStatusInput | null;
702
+ teamIds?: ModelStringInput | null;
703
+ temp_isLocked?: ModelBooleanInput | null;
704
+ temp_isAvailableTenantIdUnion?: ModelStringInput | null;
705
+ createdAt?: ModelIntInput | null;
706
+ updatedAt?: ModelIntInput | null;
707
+ expiryAt?: ModelIntInput | null;
708
+ loggedOutAt?: ModelIntInput | null;
709
+ blockedAt?: ModelIntInput | null;
710
+ and?: Array<ModelUserSessionConditionInput | null> | null;
711
+ or?: Array<ModelUserSessionConditionInput | null> | null;
712
+ not?: ModelUserSessionConditionInput | null;
713
+ };
714
+ type ModelUserSessionFilterInput = {
715
+ id?: ModelIDInput | null;
716
+ tenantId?: ModelIDInput | null;
717
+ userId?: ModelIDInput | null;
718
+ ipDetails?: ModelStringInput | null;
719
+ status?: ModelUserStatusInput | null;
720
+ teamIds?: ModelStringInput | null;
721
+ temp_isLocked?: ModelBooleanInput | null;
722
+ temp_isAvailableTenantIdUnion?: ModelStringInput | null;
723
+ createdAt?: ModelIntInput | null;
724
+ updatedAt?: ModelIntInput | null;
725
+ expiryAt?: ModelIntInput | null;
726
+ loggedOutAt?: ModelIntInput | null;
727
+ blockedAt?: ModelIntInput | null;
728
+ and?: Array<ModelUserSessionFilterInput | null> | null;
729
+ or?: Array<ModelUserSessionFilterInput | null> | null;
730
+ not?: ModelUserSessionFilterInput | null;
731
+ };
732
+ type __SubscriptionContainer$2 = {
733
+ OnUserSessionById: UserSession;
734
+ };
735
+ declare class UserSessionService {
736
+ private readonly appSyncService;
737
+ constructor(appSyncService: AppSyncHelperService);
738
+ getUserSessionById(id: string): Promise<UserSession>;
739
+ GetUserSession(id: string): Promise<UserSession>;
740
+ ListUserSessionsByUserId(userId: string, createdAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelUserSessionFilterInput, limit?: number, nextToken?: string): Promise<ListUserSessions>;
741
+ UpdateUserSession(input: UpdateUserSessionInput, condition?: ModelUserSessionConditionInput): Promise<UserSession>;
742
+ OnUserSessionByIdListener(id: string): Observable<SubscriptionResponse<Pick<__SubscriptionContainer$2, 'OnUserSessionById'>>>;
743
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserSessionService, never>;
744
+ static ɵprov: i0.ɵɵInjectableDeclaration<UserSessionService>;
745
+ }
746
+
747
+ declare enum InteractionChannel {
748
+ EMAIL = "EMAIL",
749
+ PHONE = "PHONE",
750
+ SMS = "SMS",
751
+ WEB_CHAT = "WEB_CHAT",
752
+ SOCIAL_CHAT = "SOCIAL_CHAT"
753
+ }
754
+ declare enum InteractionContext {
755
+ INTERNAL = "INTERNAL",
756
+ EXTERNAL = "EXTERNAL"
757
+ }
758
+ declare enum InteractionDirection {
759
+ IN = "IN",
760
+ OUT = "OUT"
761
+ }
762
+ declare enum InteractionStatus {
763
+ INITIATED = "INITIATED",
764
+ QUEUED = "QUEUED",
765
+ RINGING = "RINGING",
766
+ CONNECTED_TO_AGENT = "CONNECTED_TO_AGENT",
767
+ CONNECTED_TO_BOT = "CONNECTED_TO_BOT",
768
+ HELD = "HELD",
769
+ DISCONNECTED = "DISCONNECTED",
770
+ CANCELLED = "CANCELLED",
771
+ REJECTED = "REJECTED",
772
+ NO_ANSWER = "NO_ANSWER",
773
+ MISSED = "MISSED",
774
+ FAILED = "FAILED"
775
+ }
776
+ declare enum InteractionProvider {
777
+ AVAYA_IPO = "AVAYA_IPO",
778
+ TELNYX = "TELNYX",
779
+ WHATSAPP = "WHATSAPP",
780
+ TELEGRAM = "TELEGRAM",
781
+ SNUGDESK = "SNUGDESK"
782
+ }
783
+ type InteractionRouteConfiguration = {
784
+ teamId?: string | null;
785
+ routingLogic?: InteractionRouteLogic | null;
786
+ maxWaitTimeoutSeconds?: number | null;
787
+ };
788
+ declare enum InteractionRouteLogic {
789
+ MOST_IDLE_AGENT = "MOST_IDLE_AGENT",
790
+ PARALLEL = "PARALLEL"
791
+ }
792
+ type Interaction = {
793
+ id: string;
794
+ tenantId: string;
795
+ widgetId: string;
796
+ widget?: InteractionWidget | null;
797
+ endpointId: string;
798
+ endpoint?: InteractionEndpoint | null;
799
+ entityConversationId?: string | null;
800
+ entityConversation?: EntityConversation | null;
801
+ entityId?: string | null;
802
+ entity?: Entity | null;
803
+ teamId?: string | null;
804
+ team?: Team | null;
805
+ hostId?: string | null;
806
+ host?: InteractionHost | null;
807
+ providerInteractionId?: string | null;
808
+ channel: InteractionChannel;
809
+ provider: InteractionProvider;
810
+ context: InteractionContext;
811
+ direction: InteractionDirection;
812
+ status?: InteractionStatus | null;
813
+ last_status?: InteractionStatus | null;
814
+ metadata?: string | null;
815
+ subject?: string | null;
816
+ routeConfiguration?: InteractionRouteConfiguration | null;
817
+ startedAt?: number | null;
818
+ completedAt?: number | null;
819
+ duration?: number | null;
820
+ summary?: string | null;
821
+ createdAt: number;
822
+ updatedAt: number;
823
+ deletedAt?: number | null;
824
+ };
825
+ type InteractionHost = {
826
+ id: string;
827
+ interactionId: string;
828
+ interaction?: Interaction | null;
829
+ entityId?: string | null;
830
+ entity?: Entity | null;
831
+ teamId?: string | null;
832
+ team?: Team | null;
833
+ userId?: string | null;
834
+ user?: User | null;
835
+ createdAt: number;
836
+ updatedAt: number;
837
+ deletedAt?: number | null;
838
+ };
839
+ type InteractionInvitee = {
840
+ id: string;
841
+ interactionId: string;
842
+ interaction?: Interaction | null;
843
+ entityId?: string | null;
844
+ entity?: Entity | null;
845
+ teamId?: string | null;
846
+ team?: Team | null;
847
+ userId?: string | null;
848
+ user?: User | null;
849
+ isAdministrator: boolean;
850
+ temp_expiringAt?: number | null;
851
+ expiredAt?: number | null;
852
+ createdAt: number;
853
+ updatedAt: number;
854
+ deletedAt?: number | null;
855
+ };
856
+ type InteractionAttendee = {
857
+ id: string;
858
+ interactionId: string;
859
+ interaction?: Interaction | null;
860
+ entityId?: string | null;
861
+ entity?: Entity | null;
862
+ interactionWidgetSessionId?: string | null;
863
+ teamId?: string | null;
864
+ team?: Team | null;
865
+ userId?: string | null;
866
+ user?: User | null;
867
+ userSessionId?: string | null;
868
+ userSession?: UserSession | null;
869
+ name: string;
870
+ metadata?: string | null;
871
+ customFields?: Array<string | null> | null;
872
+ isAdministrator: boolean;
873
+ joinedAt?: number | null;
874
+ exitedAt?: number | null;
875
+ createdAt: number;
876
+ updatedAt: number;
877
+ deletedAt?: number | null;
878
+ };
879
+ type InteractionMessage = {
880
+ id: string;
881
+ externalId?: string | null;
882
+ endpointId?: string | null;
883
+ endpoint?: InteractionEndpoint | null;
884
+ campaignId?: string | null;
885
+ campaignFlowNodeId?: string | null;
886
+ entityConversationId: string;
887
+ entityConversation?: EntityConversation | null;
888
+ interactionId: string;
889
+ interaction?: Interaction | null;
890
+ interactionAttendeeId?: string | null;
891
+ interactionAttendee?: InteractionAttendee | null;
892
+ referenceMessageId?: string | null;
893
+ body?: string | null;
894
+ metadata?: string | null;
895
+ createdAt: number;
896
+ updatedAt: number;
897
+ deletedAt?: number | null;
898
+ messageAttachments?: ListInteractionMessageAttachments | null;
899
+ temp_isSending?: boolean | null;
900
+ };
901
+ type InteractionMessageAttachment = {
902
+ id: string;
903
+ externalId?: string | null;
904
+ interactionId: string;
905
+ interactionMessageId: string;
906
+ name: string;
907
+ size?: number | null;
908
+ type?: string | null;
909
+ file: S3Object;
910
+ createdAt: number;
911
+ updatedAt: number;
912
+ deletedAt?: number | null;
913
+ };
914
+ type ListInteractionInvitees = {
915
+ items: Array<InteractionInvitee | null>;
916
+ nextToken?: string | null;
917
+ };
918
+ type ListInteractionAttendees = {
919
+ items: Array<InteractionAttendee | null>;
920
+ nextToken?: string | null;
921
+ };
922
+ type ListInteractionMessages = {
923
+ items: Array<InteractionMessage | null>;
924
+ nextToken?: string | null;
925
+ };
926
+ type ListInteractionMessageAttachments = {
927
+ items: Array<InteractionMessageAttachment | null>;
928
+ nextToken?: string | null;
929
+ };
930
+ type CreateInteractionInput = {
931
+ id?: string | null;
932
+ tenantId: string;
933
+ widgetId: string;
934
+ endpointId: string;
935
+ entityConversationId?: string | null;
936
+ entityId?: string | null;
937
+ teamId?: string | null;
938
+ hostId?: string | null;
939
+ providerInteractionId?: string | null;
940
+ channel: InteractionChannel;
941
+ provider: InteractionProvider;
942
+ context: InteractionContext;
943
+ direction: InteractionDirection;
944
+ status?: InteractionStatus | null;
945
+ last_status?: InteractionStatus | null;
946
+ metadata?: string | null;
947
+ subject?: string | null;
948
+ routeConfiguration?: InteractionRouteConfigurationInput | null;
949
+ startedAt?: number | null;
950
+ completedAt?: number | null;
951
+ duration?: number | null;
952
+ summary?: string | null;
953
+ temp_isLocked?: boolean | null;
954
+ temp_isAvailableTenantIdUnion?: string | null;
955
+ createdAt: number;
956
+ updatedAt: number;
957
+ deletedAt?: number | null;
958
+ };
959
+ type UpdateInteractionInput = {
960
+ id: string;
961
+ tenantId?: string | null;
962
+ widgetId?: string | null;
963
+ endpointId?: string | null;
964
+ entityConversationId?: string | null;
965
+ entityId?: string | null;
966
+ teamId?: string | null;
967
+ hostId?: string | null;
968
+ providerInteractionId?: string | null;
969
+ channel?: InteractionChannel | null;
970
+ provider?: InteractionProvider | null;
971
+ context?: InteractionContext | null;
972
+ direction?: InteractionDirection | null;
973
+ status?: InteractionStatus | null;
974
+ last_status?: InteractionStatus | null;
975
+ metadata?: string | null;
976
+ subject?: string | null;
977
+ routeConfiguration?: InteractionRouteConfigurationInput | null;
978
+ startedAt?: number | null;
979
+ completedAt?: number | null;
980
+ duration?: number | null;
981
+ summary?: string | null;
982
+ temp_isLocked?: boolean | null;
983
+ temp_isAvailableTenantIdUnion?: string | null;
984
+ createdAt?: number | null;
985
+ updatedAt?: number | null;
986
+ deletedAt?: number | null;
987
+ };
988
+ type CreateInteractionAttendeeInput = {
989
+ id?: string | null;
990
+ interactionId: string;
991
+ entityId?: string | null;
992
+ interactionWidgetSessionId?: string | null;
993
+ teamId?: string | null;
994
+ userId?: string | null;
995
+ userSessionId?: string | null;
996
+ name: string;
997
+ metadata?: string | null;
998
+ customFields?: Array<string | null> | null;
999
+ isAdministrator: boolean;
1000
+ joinedAt?: number | null;
1001
+ exitedAt?: number | null;
1002
+ createdAt: number;
1003
+ updatedAt: number;
1004
+ deletedAt?: number | null;
1005
+ };
1006
+ type CreateInteractionMessageInput = {
1007
+ id?: string | null;
1008
+ externalId?: string | null;
1009
+ endpointId?: string | null;
1010
+ campaignId?: string | null;
1011
+ campaignFlowNodeId?: string | null;
1012
+ entityConversationId: string;
1013
+ interactionId: string;
1014
+ interactionAttendeeId?: string | null;
1015
+ referenceMessageId?: string | null;
1016
+ body?: string | null;
1017
+ metadata?: string | null;
1018
+ createdAt: number;
1019
+ updatedAt: number;
1020
+ deletedAt?: number | null;
1021
+ };
1022
+ type CreateInteractionMessageAttachmentInput = {
1023
+ id?: string | null;
1024
+ externalId?: string | null;
1025
+ interactionId: string;
1026
+ interactionMessageId: string;
1027
+ name: string;
1028
+ size?: number | null;
1029
+ type?: string | null;
1030
+ file: S3Object;
1031
+ createdAt: number;
1032
+ updatedAt: number;
1033
+ deletedAt?: number | null;
1034
+ };
1035
+ type ModelInteractionConditionInput = {
1036
+ tenantId?: ModelIDInput | null;
1037
+ widgetId?: ModelIDInput | null;
1038
+ endpointId?: ModelIDInput | null;
1039
+ entityConversationId?: ModelIDInput | null;
1040
+ entityId?: ModelIDInput | null;
1041
+ teamId?: ModelIDInput | null;
1042
+ hostId?: ModelIDInput | null;
1043
+ providerInteractionId?: ModelStringInput | null;
1044
+ channel?: ModelInteractionChannelInput | null;
1045
+ provider?: ModelInteractionProviderInput | null;
1046
+ context?: ModelInteractionContextInput | null;
1047
+ direction?: ModelInteractionDirectionInput | null;
1048
+ status?: ModelInteractionStatusInput | null;
1049
+ last_status?: ModelInteractionStatusInput | null;
1050
+ metadata?: ModelStringInput | null;
1051
+ subject?: ModelStringInput | null;
1052
+ startedAt?: ModelIntInput | null;
1053
+ completedAt?: ModelIntInput | null;
1054
+ duration?: ModelIntInput | null;
1055
+ summary?: ModelStringInput | null;
1056
+ temp_isLocked?: ModelBooleanInput | null;
1057
+ temp_isAvailableTenantIdUnion?: ModelStringInput | null;
1058
+ createdAt?: ModelIntInput | null;
1059
+ updatedAt?: ModelIntInput | null;
1060
+ deletedAt?: ModelIntInput | null;
1061
+ and?: Array<ModelInteractionConditionInput | null> | null;
1062
+ or?: Array<ModelInteractionConditionInput | null> | null;
1063
+ not?: ModelInteractionConditionInput | null;
1064
+ };
1065
+ type ModelInteractionInviteeFilterInput = {
1066
+ id?: ModelIDInput | null;
1067
+ interactionId?: ModelIDInput | null;
1068
+ entityId?: ModelIDInput | null;
1069
+ teamId?: ModelIDInput | null;
1070
+ userId?: ModelIDInput | null;
1071
+ isAdministrator?: ModelBooleanInput | null;
1072
+ temp_expiringAt?: ModelIntInput | null;
1073
+ expiredAt?: ModelIntInput | null;
1074
+ createdAt?: ModelIntInput | null;
1075
+ updatedAt?: ModelIntInput | null;
1076
+ deletedAt?: ModelIntInput | null;
1077
+ and?: Array<ModelInteractionInviteeFilterInput | null> | null;
1078
+ or?: Array<ModelInteractionInviteeFilterInput | null> | null;
1079
+ not?: ModelInteractionInviteeFilterInput | null;
1080
+ };
1081
+ type ModelInteractionAttendeeConditionInput = {
1082
+ interactionId?: ModelIDInput | null;
1083
+ entityId?: ModelIDInput | null;
1084
+ interactionWidgetSessionId?: ModelIDInput | null;
1085
+ teamId?: ModelIDInput | null;
1086
+ userId?: ModelIDInput | null;
1087
+ userSessionId?: ModelIDInput | null;
1088
+ name?: ModelStringInput | null;
1089
+ metadata?: ModelStringInput | null;
1090
+ customFields?: ModelStringInput | null;
1091
+ isAdministrator?: ModelBooleanInput | null;
1092
+ joinedAt?: ModelIntInput | null;
1093
+ exitedAt?: ModelIntInput | null;
1094
+ createdAt?: ModelIntInput | null;
1095
+ updatedAt?: ModelIntInput | null;
1096
+ deletedAt?: ModelIntInput | null;
1097
+ and?: Array<ModelInteractionAttendeeConditionInput | null> | null;
1098
+ or?: Array<ModelInteractionAttendeeConditionInput | null> | null;
1099
+ not?: ModelInteractionAttendeeConditionInput | null;
1100
+ };
1101
+ type ModelInteractionAttendeeFilterInput = {
1102
+ id?: ModelIDInput | null;
1103
+ interactionId?: ModelIDInput | null;
1104
+ entityId?: ModelIDInput | null;
1105
+ interactionWidgetSessionId?: ModelIDInput | null;
1106
+ teamId?: ModelIDInput | null;
1107
+ userId?: ModelIDInput | null;
1108
+ userSessionId?: ModelIDInput | null;
1109
+ name?: ModelStringInput | null;
1110
+ metadata?: ModelStringInput | null;
1111
+ customFields?: ModelStringInput | null;
1112
+ isAdministrator?: ModelBooleanInput | null;
1113
+ joinedAt?: ModelIntInput | null;
1114
+ exitedAt?: ModelIntInput | null;
1115
+ createdAt?: ModelIntInput | null;
1116
+ updatedAt?: ModelIntInput | null;
1117
+ deletedAt?: ModelIntInput | null;
1118
+ and?: Array<ModelInteractionAttendeeFilterInput | null> | null;
1119
+ or?: Array<ModelInteractionAttendeeFilterInput | null> | null;
1120
+ not?: ModelInteractionAttendeeFilterInput | null;
1121
+ };
1122
+ type ModelInteractionMessageConditionInput = {
1123
+ externalId?: ModelStringInput | null;
1124
+ endpointId?: ModelIDInput | null;
1125
+ campaignId?: ModelIDInput | null;
1126
+ campaignFlowNodeId?: ModelIDInput | null;
1127
+ entityConversationId?: ModelIDInput | null;
1128
+ interactionId?: ModelIDInput | null;
1129
+ interactionAttendeeId?: ModelIDInput | null;
1130
+ referenceMessageId?: ModelIDInput | null;
1131
+ body?: ModelStringInput | null;
1132
+ metadata?: ModelStringInput | null;
1133
+ createdAt?: ModelIntInput | null;
1134
+ updatedAt?: ModelIntInput | null;
1135
+ deletedAt?: ModelIntInput | null;
1136
+ and?: Array<ModelInteractionMessageConditionInput | null> | null;
1137
+ or?: Array<ModelInteractionMessageConditionInput | null> | null;
1138
+ not?: ModelInteractionMessageConditionInput | null;
1139
+ };
1140
+ type ModelInteractionMessageFilterInput = {
1141
+ id?: ModelIDInput | null;
1142
+ externalId?: ModelStringInput | null;
1143
+ endpointId?: ModelIDInput | null;
1144
+ campaignId?: ModelIDInput | null;
1145
+ campaignFlowNodeId?: ModelIDInput | null;
1146
+ entityConversationId?: ModelIDInput | null;
1147
+ interactionId?: ModelIDInput | null;
1148
+ interactionAttendeeId?: ModelIDInput | null;
1149
+ referenceMessageId?: ModelIDInput | null;
1150
+ body?: ModelStringInput | null;
1151
+ metadata?: ModelStringInput | null;
1152
+ createdAt?: ModelIntInput | null;
1153
+ updatedAt?: ModelIntInput | null;
1154
+ deletedAt?: ModelIntInput | null;
1155
+ and?: Array<ModelInteractionMessageFilterInput | null> | null;
1156
+ or?: Array<ModelInteractionMessageFilterInput | null> | null;
1157
+ not?: ModelInteractionMessageFilterInput | null;
1158
+ };
1159
+ type ModelInteractionMessageAttachmentConditionInput = {
1160
+ externalId?: ModelStringInput | null;
1161
+ interactionId?: ModelIDInput | null;
1162
+ interactionMessageId?: ModelIDInput | null;
1163
+ name?: ModelStringInput | null;
1164
+ size?: ModelIntInput | null;
1165
+ type?: ModelStringInput | null;
1166
+ createdAt?: ModelIntInput | null;
1167
+ updatedAt?: ModelIntInput | null;
1168
+ deletedAt?: ModelIntInput | null;
1169
+ and?: Array<ModelInteractionMessageAttachmentConditionInput | null> | null;
1170
+ or?: Array<ModelInteractionMessageAttachmentConditionInput | null> | null;
1171
+ not?: ModelInteractionMessageAttachmentConditionInput | null;
1172
+ };
1173
+ type ModelInteractionMessageAttachmentFilterInput = {
1174
+ id?: ModelIDInput | null;
1175
+ externalId?: ModelStringInput | null;
1176
+ interactionId?: ModelIDInput | null;
1177
+ interactionMessageId?: ModelIDInput | null;
1178
+ name?: ModelStringInput | null;
1179
+ size?: ModelIntInput | null;
1180
+ type?: ModelStringInput | null;
1181
+ createdAt?: ModelIntInput | null;
1182
+ updatedAt?: ModelIntInput | null;
1183
+ deletedAt?: ModelIntInput | null;
1184
+ and?: Array<ModelInteractionMessageAttachmentFilterInput | null> | null;
1185
+ or?: Array<ModelInteractionMessageAttachmentFilterInput | null> | null;
1186
+ not?: ModelInteractionMessageAttachmentFilterInput | null;
1187
+ };
1188
+ type ModelInteractionChannelInput = {
1189
+ eq?: InteractionChannel | null;
1190
+ ne?: InteractionChannel | null;
1191
+ };
1192
+ type ModelInteractionContextInput = {
1193
+ eq?: InteractionContext | null;
1194
+ ne?: InteractionContext | null;
1195
+ };
1196
+ type ModelInteractionDirectionInput = {
1197
+ eq?: InteractionDirection | null;
1198
+ ne?: InteractionDirection | null;
1199
+ };
1200
+ type ModelInteractionProviderInput = {
1201
+ eq?: InteractionProvider | null;
1202
+ ne?: InteractionProvider | null;
1203
+ };
1204
+ type ModelInteractionStatusInput = {
1205
+ eq?: InteractionStatus | null;
1206
+ ne?: InteractionStatus | null;
1207
+ };
1208
+ type InteractionRouteConfigurationInput = {
1209
+ teamId?: string | null;
1210
+ routingLogic?: InteractionRouteLogic | null;
1211
+ maxWaitTimeoutSeconds?: number | null;
1212
+ };
1213
+ type __SubscriptionContainer$1 = {
1214
+ OnInteractionInviteeByUserId: InteractionInvitee;
1215
+ OnInteractionMessageByEntityConversationId: InteractionMessage;
1216
+ };
1217
+ declare class InteractionService {
1218
+ private readonly appSyncService;
1219
+ newInteractionInviteObservable$: BehaviorSubject<any>;
1220
+ constructor(appSyncService: AppSyncHelperService);
1221
+ GetInteraction(id: string): Promise<Interaction>;
1222
+ GetInteractionAttendee(id: string): Promise<InteractionAttendee>;
1223
+ GetInteractionMessage(id: string): Promise<InteractionMessage>;
1224
+ CreateInteraction(input: CreateInteractionInput, condition?: ModelInteractionConditionInput): Promise<Interaction>;
1225
+ UpdateInteraction(input: UpdateInteractionInput, condition?: ModelInteractionConditionInput): Promise<Interaction>;
1226
+ CreateInteractionAttendee(input: CreateInteractionAttendeeInput, condition?: ModelInteractionAttendeeConditionInput): Promise<InteractionAttendee>;
1227
+ CreateInteractionMessage(input: CreateInteractionMessageInput, condition?: ModelInteractionMessageConditionInput): Promise<InteractionMessage>;
1228
+ CreateInteractionMessageAttachment(input: CreateInteractionMessageAttachmentInput, condition?: ModelInteractionMessageAttachmentConditionInput): Promise<InteractionMessageAttachment>;
1229
+ ListInteractionInviteesByUserId(userId: string, createdAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionInviteeFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionInvitees>;
1230
+ ListInteractionAttendeesByInteractionIdAndEntityId(interactionId: string, entityId?: ModelIDKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionAttendeeFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionAttendees>;
1231
+ ListInteractionAttendeesByInteractionIdAndUserId(interactionId: string, userId?: ModelIDKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionAttendeeFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionAttendees>;
1232
+ ListInteractionMessagesByEntityConversationId(entityConversationId: string, createdAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionMessageFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionMessages>;
1233
+ ListInteractionMessagesByExternalMessageId(externalMessageId: string, createdAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionMessageFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionMessages>;
1234
+ ListInteractionMessagesByInteractionAttendeeId(interactionAttendeeId: string, createdAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionMessageFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionMessages>;
1235
+ ListInteractionMessageAttachmentsByInteractionMessageId(interactionMessageId: string, createdAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelInteractionMessageAttachmentFilterInput, limit?: number, nextToken?: string): Promise<ListInteractionMessageAttachments>;
1236
+ OnInteractionInviteeByUserIdListener(userId: string): Observable<SubscriptionResponse<Pick<__SubscriptionContainer$1, 'OnInteractionInviteeByUserId'>>>;
1237
+ OnInteractionMessageByEntityConversationIdListener(entityConversationId: string): Observable<SubscriptionResponse<Pick<__SubscriptionContainer$1, 'OnInteractionMessageByEntityConversationId'>>>;
1238
+ static ɵfac: i0.ɵɵFactoryDeclaration<InteractionService, never>;
1239
+ static ɵprov: i0.ɵɵInjectableDeclaration<InteractionService>;
1240
+ }
1241
+
1242
+ type EntityConversation = {
1243
+ id: string;
1244
+ tenantId: string;
1245
+ entityId?: string | null;
1246
+ entity?: Entity | null;
1247
+ entityAddress: string;
1248
+ interactionChannel: InteractionChannel;
1249
+ interactionProvider: InteractionProvider;
1250
+ isCampaignEngaged: boolean;
1251
+ campaignId?: string | null;
1252
+ lastCampaignFlowNodeId?: string | null;
1253
+ lastInteractionMessageId?: string | null;
1254
+ metadata?: string | null;
1255
+ lastActivityAt?: number | null;
1256
+ lastMessageAt?: number | null;
1257
+ archivedAt?: number | null;
1258
+ blockedAt?: number | null;
1259
+ createdAt: number;
1260
+ updatedAt: number;
1261
+ deletedAt?: number | null;
1262
+ interactions?: {
1263
+ items: Array<Interaction | null>;
1264
+ nextToken?: string | null;
1265
+ } | null;
1266
+ messages?: {
1267
+ items: Array<InteractionMessage | null>;
1268
+ nextToken?: string | null;
1269
+ } | null;
1270
+ };
1271
+ type ListEntityConversations = {
1272
+ items: Array<EntityConversation | null>;
1273
+ nextToken?: string | null;
1274
+ };
1275
+ type CreateEntityConversationInput = {
1276
+ id?: string | null;
1277
+ tenantId: string;
1278
+ entityId?: string | null;
1279
+ entityAddress: string;
1280
+ interactionChannel: InteractionChannel;
1281
+ interactionProvider: InteractionProvider;
1282
+ isCampaignEngaged: boolean;
1283
+ campaignId?: string | null;
1284
+ lastCampaignFlowNodeId?: string | null;
1285
+ lastInteractionMessageId?: string | null;
1286
+ metadata?: string | null;
1287
+ lastActivityAt?: number | null;
1288
+ lastMessageAt?: number | null;
1289
+ archivedAt?: number | null;
1290
+ blockedAt?: number | null;
1291
+ createdAt: number;
1292
+ updatedAt: number;
1293
+ deletedAt?: number | null;
1294
+ };
1295
+ type UpdateEntityConversationInput = {
1296
+ id: string;
1297
+ tenantId?: string | null;
1298
+ entityId?: string | null;
1299
+ entityAddress?: string | null;
1300
+ interactionChannel?: InteractionChannel | null;
1301
+ interactionProvider?: InteractionProvider | null;
1302
+ isCampaignEngaged?: boolean | null;
1303
+ campaignId?: string | null;
1304
+ lastCampaignFlowNodeId?: string | null;
1305
+ lastInteractionMessageId?: string | null;
1306
+ metadata?: string | null;
1307
+ lastActivityAt?: number | null;
1308
+ lastMessageAt?: number | null;
1309
+ archivedAt?: number | null;
1310
+ blockedAt?: number | null;
1311
+ createdAt?: number | null;
1312
+ updatedAt?: number | null;
1313
+ deletedAt?: number | null;
1314
+ };
1315
+ type ModelEntityConversationConditionInput = {
1316
+ tenantId?: ModelIDInput | null;
1317
+ entityId?: ModelIDInput | null;
1318
+ entityAddress?: ModelStringInput | null;
1319
+ interactionChannel?: ModelInteractionChannelInput | null;
1320
+ interactionProvider?: ModelInteractionProviderInput | null;
1321
+ isCampaignEngaged?: ModelBooleanInput | null;
1322
+ campaignId?: ModelIDInput | null;
1323
+ lastCampaignFlowNodeId?: ModelIDInput | null;
1324
+ lastInteractionMessageId?: ModelIDInput | null;
1325
+ metadata?: ModelStringInput | null;
1326
+ lastActivityAt?: ModelIntInput | null;
1327
+ lastMessageAt?: ModelIntInput | null;
1328
+ archivedAt?: ModelIntInput | null;
1329
+ blockedAt?: ModelIntInput | null;
1330
+ createdAt?: ModelIntInput | null;
1331
+ updatedAt?: ModelIntInput | null;
1332
+ deletedAt?: ModelIntInput | null;
1333
+ and?: Array<ModelEntityConversationConditionInput | null> | null;
1334
+ or?: Array<ModelEntityConversationConditionInput | null> | null;
1335
+ not?: ModelEntityConversationConditionInput | null;
1336
+ };
1337
+ type ModelEntityConversationFilterInput = {
1338
+ id?: ModelIDInput | null;
1339
+ tenantId?: ModelIDInput | null;
1340
+ entityId?: ModelIDInput | null;
1341
+ entityAddress?: ModelStringInput | null;
1342
+ interactionChannel?: ModelInteractionChannelInput | null;
1343
+ interactionProvider?: ModelInteractionProviderInput | null;
1344
+ isCampaignEngaged?: ModelBooleanInput | null;
1345
+ campaignId?: ModelIDInput | null;
1346
+ lastCampaignFlowNodeId?: ModelIDInput | null;
1347
+ lastInteractionMessageId?: ModelIDInput | null;
1348
+ metadata?: ModelStringInput | null;
1349
+ lastActivityAt?: ModelIntInput | null;
1350
+ lastMessageAt?: ModelIntInput | null;
1351
+ archivedAt?: ModelIntInput | null;
1352
+ blockedAt?: ModelIntInput | null;
1353
+ createdAt?: ModelIntInput | null;
1354
+ updatedAt?: ModelIntInput | null;
1355
+ deletedAt?: ModelIntInput | null;
1356
+ and?: Array<ModelEntityConversationFilterInput | null> | null;
1357
+ or?: Array<ModelEntityConversationFilterInput | null> | null;
1358
+ not?: ModelEntityConversationFilterInput | null;
1359
+ };
1360
+ type __SubscriptionContainer = {
1361
+ OnEntityConversationByTenantId: EntityConversation;
1362
+ };
1363
+ declare const FIELDS_ENTITY_CONVERSATION: string;
1364
+ declare const FIELDS_ENTITY_CONVERSATION_EXPANDED = "\n id\n tenantId\n entityId\n entity {\n id\n externalId\n tenantId\n entityTypeId\n parentId\n name\n image {\n key\n bucket\n location\n }\n isOrganization\n email\n phoneNumber {\n countryCode\n dialCode\n e164Number\n internationalNumber\n nationalNumber\n number\n }\n notes\n customFields\n preferences {\n timezoneName\n language {\n code\n nameEn\n nameLocal\n }\n }\n contactPreferences {\n allowCall\n allowEmail\n allowSMS\n allowWhatsApp\n }\n createdAt\n updatedAt\n blockedAt\n deletedAt\n }\n entityAddress\n interactionChannel\n interactionProvider\n isCampaignEngaged\n campaignId\n lastCampaignFlowNodeId\n lastInteractionMessageId\n metadata\n lastActivityAt\n lastMessageAt\n archivedAt\n blockedAt\n createdAt\n updatedAt\n deletedAt\n interactions (limit: 1, sortDirection: DESC) {\n items {\n id\n tenantId\n entityId\n entityConversationId\n teamId\n widgetId\n metadata\n subject\n direction\n status\n last_status\n hostId\n startedAt\n completedAt\n createdAt\n updatedAt\n deletedAt\n }\n nextToken\n }\n messages (limit: 1, sortDirection: DESC) {\n items {\n id\n externalId\n endpointId\n entityConversationId\n interactionId\n interactionAttendeeId\n referenceMessageId\n body\n metadata\n createdAt\n updatedAt\n deletedAt\n messageAttachments {\n items {\n id\n externalId\n interactionId\n interactionMessageId\n interactionId\n name\n size\n type\n file {\n key\n bucket\n location\n }\n createdAt\n updatedAt\n deletedAt\n }\n nextToken\n }\n }\n nextToken\n }\n";
1365
+ declare class EntityConversationService {
1366
+ private readonly appSyncService;
1367
+ constructor(appSyncService: AppSyncHelperService);
1368
+ GetEntityConversation(id: string): Promise<EntityConversation>;
1369
+ CreateEntityConversation(input: CreateEntityConversationInput, condition?: ModelEntityConversationConditionInput): Promise<EntityConversation>;
1370
+ UpdateEntityConversation(input: UpdateEntityConversationInput, condition?: ModelEntityConversationConditionInput): Promise<EntityConversation>;
1371
+ ListEntityConversationsByTenantIdAndEntityAddress(tenantId: string, entityAddress?: ModelStringKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelEntityConversationFilterInput, limit?: number, nextToken?: string): Promise<ListEntityConversations>;
1372
+ ListEntityConversationsByTenantIdAndArchivedAt(tenantId: string, archivedAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelEntityConversationFilterInput, limit?: number, nextToken?: string): Promise<ListEntityConversations>;
1373
+ ListEntityConversationsByTenantIdAndLastMessageAt(tenantId: string, lastMessageAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelEntityConversationFilterInput, limit?: number, nextToken?: string): Promise<ListEntityConversations>;
1374
+ OnEntityConversationByTenantIdListener(tenantId: string): Observable<SubscriptionResponse<Pick<__SubscriptionContainer, 'OnEntityConversationByTenantId'>>>;
1375
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityConversationService, never>;
1376
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityConversationService>;
1377
+ }
1378
+
396
1379
  declare class CustomValidators {
397
1380
  #private;
398
1381
  /**
@@ -422,5 +1405,5 @@ declare class CleanDeep {
422
1405
  static clean(obj: any): typeof obj;
423
1406
  }
424
1407
 
425
- export { CleanDeep, CustomPipesModule, CustomValidators, DomainNamePipe, ErrorComponent, FooterComponent, FormatEpochTimestampPipe, GraphQLHelperService, LoaderComponent, ModelAttributeTypes, ModelSortDirection, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, TenantService, UserService, UserStatus, UserType };
426
- export type { Language, ModelBooleanInput, ModelIDInput, ModelIDKeyConditionInput, ModelIntInput, ModelIntKeyConditionInput, ModelSizeInput, ModelStringInput, ModelStringKeyConditionInput, PhoneNumber, S3Config, S3Credentials, S3Object, Tenant, User };
1408
+ export { AMPLIFY_CONFIG, AppSyncHelperService, CleanDeep, CustomPipesModule, CustomValidators, DomainNamePipe, EntityConversationService, EntityService, ErrorComponent, FIELDS_ENTITY_CONVERSATION, FIELDS_ENTITY_CONVERSATION_EXPANDED, FIELDS_INTERACTION_WIDGET, FooterComponent, FormatEpochTimestampPipe, InteractionChannel, InteractionContext, InteractionDirection, InteractionEndpointService, InteractionProvider, InteractionRouteLogic, InteractionService, InteractionStatus, InteractionWidgetService, LoaderComponent, ModelAttributeTypes, ModelSortDirection, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, TenantService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig };
1409
+ export type { AmplifyConfig, Country, CountryCurrency, CountryLanguage, CreateEntityConversationInput, CreateEntityInput, CreateInteractionAttendeeInput, CreateInteractionInput, CreateInteractionMessageAttachmentInput, CreateInteractionMessageInput, Entity, EntityContactPreferences, EntityConversation, EntityPreferences, Interaction, InteractionAttendee, InteractionEndpoint, InteractionEndpointPriceDetails, InteractionEndpointRegulatoryComplianceDocument, InteractionHost, InteractionInvitee, InteractionMessage, InteractionMessageAttachment, InteractionRouteConfiguration, InteractionRouteConfigurationInput, InteractionWidget, Language, ListEntities, ListEntityConversations, ListInteractionAttendees, ListInteractionInvitees, ListInteractionMessageAttachments, ListInteractionMessages, ListInteractionWidgets, ListUserSessions, ModelBooleanInput, ModelEntityConditionInput, ModelEntityConversationConditionInput, ModelEntityConversationFilterInput, ModelEntityFilterInput, ModelIDInput, ModelIDKeyConditionInput, ModelIntInput, ModelIntKeyConditionInput, ModelInteractionAttendeeConditionInput, ModelInteractionAttendeeFilterInput, ModelInteractionChannelInput, ModelInteractionConditionInput, ModelInteractionContextInput, ModelInteractionDirectionInput, ModelInteractionInviteeFilterInput, ModelInteractionMessageAttachmentConditionInput, ModelInteractionMessageAttachmentFilterInput, ModelInteractionMessageConditionInput, ModelInteractionMessageFilterInput, ModelInteractionProviderInput, ModelInteractionStatusInput, ModelInteractionWidgetConditionInput, ModelInteractionWidgetFilterInput, ModelSizeInput, ModelStringInput, ModelStringKeyConditionInput, ModelUserSessionConditionInput, ModelUserSessionFilterInput, ModelUserStatusInput, PhoneNumber, S3Config, S3Credentials, S3Object, SubscriptionResponse, Team, Tenant, TenantPreferences, TenantSecurity, UpdateEntityConversationInput, UpdateEntityInput, UpdateInteractionInput, UpdateUserSessionInput, User, UserNotificationSettings, UserPreferences, UserSession };