@snugdesk/core 0.2.31 → 0.2.32

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.
@@ -1121,6 +1121,7 @@ var ModelSortDirection;
1121
1121
  var ProcessingStatus;
1122
1122
  (function (ProcessingStatus) {
1123
1123
  ProcessingStatus["PENDING"] = "PENDING";
1124
+ ProcessingStatus["IN_PROGRESS"] = "IN_PROGRESS";
1124
1125
  ProcessingStatus["SUCCESS"] = "SUCCESS";
1125
1126
  ProcessingStatus["FAILED"] = "FAILED";
1126
1127
  ProcessingStatus["RETRYING"] = "RETRYING";
@@ -4499,36 +4500,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
4499
4500
  }]
4500
4501
  }], ctorParameters: () => [{ type: EntityConversationService }, { type: InteractionService }] });
4501
4502
 
4502
- const FIELDS_EMAIL_TEMPLATE = `
4503
+ const FIELDS_INTERACTION_MESSAGE_TEMPLATE = `
4503
4504
  id
4504
4505
  tenantId
4505
4506
  name
4506
4507
  subject
4507
4508
  body
4509
+ metadata
4508
4510
  variables
4509
- category
4510
- isActive
4511
- createdByUserId
4511
+ interactionChannel
4512
+ InteractionProvider
4512
4513
  createdAt
4513
4514
  updatedAt
4514
4515
  deletedAt
4516
+ updatedByUserId
4517
+ updatedByUserSessionId
4515
4518
  `;
4516
- class EmailTemplateService {
4519
+ class InteractionMessageTemplateService {
4517
4520
  appSyncHelperService;
4518
4521
  constructor(appSyncHelperService) {
4519
4522
  this.appSyncHelperService = appSyncHelperService;
4520
4523
  }
4521
- async listTemplates(tenantId, category) {
4524
+ async listTemplates(tenantId, interactionChannel) {
4522
4525
  const query = /* GraphQL */ `
4523
- query ListEmailTemplatesByTenantId(
4526
+ query ListMessageTemplatesByTenantId(
4524
4527
  $tenantId: ID!
4525
4528
  $name: ModelStringKeyConditionInput
4526
4529
  $sortDirection: ModelSortDirection
4527
- $filter: ModelEmailTemplateFilterInput
4530
+ $filter: ModelInteractionMessageTemplateFilterInput
4528
4531
  $limit: Int
4529
4532
  $nextToken: String
4530
4533
  ) {
4531
- listEmailTemplatesByTenantId(
4534
+ listMessageTemplatesByTenantId(
4532
4535
  tenantId: $tenantId
4533
4536
  name: $name
4534
4537
  sortDirection: $sortDirection
@@ -4537,33 +4540,33 @@ class EmailTemplateService {
4537
4540
  nextToken: $nextToken
4538
4541
  ) {
4539
4542
  items {
4540
- ${FIELDS_EMAIL_TEMPLATE}
4543
+ ${FIELDS_INTERACTION_MESSAGE_TEMPLATE}
4541
4544
  }
4542
4545
  nextToken
4543
4546
  }
4544
4547
  }
4545
4548
  `;
4546
- const filter = { deletedAt: { attributeExists: false }, isActive: { eq: true } };
4547
- if (category) {
4548
- filter.category = { eq: category };
4549
+ const filter = { deletedAt: { attributeExists: false } };
4550
+ if (interactionChannel) {
4551
+ filter.interactionChannel = { eq: interactionChannel };
4549
4552
  }
4550
4553
  const response = await this.appSyncHelperService.query(query, {
4551
4554
  tenantId,
4552
4555
  sortDirection: ModelSortDirection.ASC,
4553
4556
  filter,
4554
4557
  });
4555
- return response?.data?.listEmailTemplatesByTenantId || { items: [], nextToken: null };
4558
+ return response?.data?.listMessageTemplatesByTenantId || { items: [], nextToken: null };
4556
4559
  }
4557
4560
  async getTemplate(templateId) {
4558
4561
  const query = /* GraphQL */ `
4559
- query GetEmailTemplate($id: ID!) {
4560
- getEmailTemplate(id: $id) {
4561
- ${FIELDS_EMAIL_TEMPLATE}
4562
+ query GetInteractionMessageTemplate($id: ID!) {
4563
+ getInteractionMessageTemplate(id: $id) {
4564
+ ${FIELDS_INTERACTION_MESSAGE_TEMPLATE}
4562
4565
  }
4563
4566
  }
4564
4567
  `;
4565
4568
  const response = await this.appSyncHelperService.query(query, { id: templateId });
4566
- return response?.data?.getEmailTemplate || null;
4569
+ return response?.data?.getInteractionMessageTemplate || null;
4567
4570
  }
4568
4571
  renderTemplate(body, variables) {
4569
4572
  if (!body || !variables)
@@ -4575,10 +4578,10 @@ class EmailTemplateService {
4575
4578
  }
4576
4579
  return rendered;
4577
4580
  }
4578
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EmailTemplateService, deps: [{ token: AppSyncHelperService }], target: i0.ɵɵFactoryTarget.Injectable });
4579
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EmailTemplateService, providedIn: 'root' });
4581
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: InteractionMessageTemplateService, deps: [{ token: AppSyncHelperService }], target: i0.ɵɵFactoryTarget.Injectable });
4582
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: InteractionMessageTemplateService, providedIn: 'root' });
4580
4583
  }
4581
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EmailTemplateService, decorators: [{
4584
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: InteractionMessageTemplateService, decorators: [{
4582
4585
  type: Injectable,
4583
4586
  args: [{
4584
4587
  providedIn: 'root',
@@ -4593,5 +4596,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
4593
4596
  * Generated bundle index. Do not edit.
4594
4597
  */
4595
4598
 
4596
- export { AMPLIFY_CONFIG, AppSyncHelperService, CleanDeep, CommonService, CustomPipesModule, CustomValidators, DomainNamePipe, EmailConversationResolverService, EmailEntityResolverService, EmailTemplateService, EncryptedStorageService, EntityConversationService, EntityService, ErrorComponent, FIELDS_COUNTRY, FIELDS_EMAIL_TEMPLATE, FIELDS_ENTITY, FIELDS_ENTITY_CONVERSATION, FIELDS_ENTITY_CONVERSATION_EXPANDED, FIELDS_ENTITY_CONVERSATION_MINIMAL, FIELDS_ENTITY_EXPANDED, FIELDS_ENTITY_MINIMAL, FIELDS_ENTITY_TYPE, FIELDS_INTERACTION, FIELDS_INTERACTION_ATTENDEE, FIELDS_INTERACTION_ATTENDEE_EXPANDED, FIELDS_INTERACTION_ENDPOINT, FIELDS_INTERACTION_ENDPOINT_MINIMAL, FIELDS_INTERACTION_EXPANDED, FIELDS_INTERACTION_HOST, FIELDS_INTERACTION_INVITEE, FIELDS_INTERACTION_MESSAGE, FIELDS_INTERACTION_MESSAGE_ATTACHMENT, FIELDS_INTERACTION_MESSAGE_EXPANDED, FIELDS_INTERACTION_MINIMAL, FIELDS_INTERACTION_WIDGET, FIELDS_INTERACTION_WIDGET_USER_SETTING, FIELDS_LANGUAGE, FIELDS_PHONE_NUMBER, FIELDS_TEAM, FIELDS_TEAM_MEMBER, FIELDS_TENANT, FIELDS_TENANT_COMPLIANCE_DOCUMENT, FIELDS_TENANT_EXPANDED, FIELDS_TENANT_MINIMAL, FIELDS_TICKET, FIELDS_TICKET_PRIORITY, FIELDS_TICKET_STATUS, FIELDS_TICKET_TYPE, FIELDS_USER, FIELDS_USER_SESSION, FooterComponent, FormatEpochTimestampPipe, InteractionChannel, InteractionContext, InteractionDirection, InteractionEndpointService, InteractionProvider, InteractionRouteLogic, InteractionService, InteractionStatus, InteractionWidgetService, LoaderComponent, ModelAttributeTypes, ModelSortDirection, OpenSearchHelperService, ProcessingStatus, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, StorageType, TeamService, TenantComplianceDocumentStatus, TenantComplianceDocumentType, TenantSSOConfigurationProtocol, TenantService, TicketService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig, sanitizeHtmlBody };
4599
+ export { AMPLIFY_CONFIG, AppSyncHelperService, CleanDeep, CommonService, CustomPipesModule, CustomValidators, DomainNamePipe, EmailConversationResolverService, EmailEntityResolverService, EncryptedStorageService, EntityConversationService, EntityService, ErrorComponent, FIELDS_COUNTRY, FIELDS_ENTITY, FIELDS_ENTITY_CONVERSATION, FIELDS_ENTITY_CONVERSATION_EXPANDED, FIELDS_ENTITY_CONVERSATION_MINIMAL, FIELDS_ENTITY_EXPANDED, FIELDS_ENTITY_MINIMAL, FIELDS_ENTITY_TYPE, FIELDS_INTERACTION, FIELDS_INTERACTION_ATTENDEE, FIELDS_INTERACTION_ATTENDEE_EXPANDED, FIELDS_INTERACTION_ENDPOINT, FIELDS_INTERACTION_ENDPOINT_MINIMAL, FIELDS_INTERACTION_EXPANDED, FIELDS_INTERACTION_HOST, FIELDS_INTERACTION_INVITEE, FIELDS_INTERACTION_MESSAGE, FIELDS_INTERACTION_MESSAGE_ATTACHMENT, FIELDS_INTERACTION_MESSAGE_EXPANDED, FIELDS_INTERACTION_MESSAGE_TEMPLATE, FIELDS_INTERACTION_MINIMAL, FIELDS_INTERACTION_WIDGET, FIELDS_INTERACTION_WIDGET_USER_SETTING, FIELDS_LANGUAGE, FIELDS_PHONE_NUMBER, FIELDS_TEAM, FIELDS_TEAM_MEMBER, FIELDS_TENANT, FIELDS_TENANT_COMPLIANCE_DOCUMENT, FIELDS_TENANT_EXPANDED, FIELDS_TENANT_MINIMAL, FIELDS_TICKET, FIELDS_TICKET_PRIORITY, FIELDS_TICKET_STATUS, FIELDS_TICKET_TYPE, FIELDS_USER, FIELDS_USER_SESSION, FooterComponent, FormatEpochTimestampPipe, InteractionChannel, InteractionContext, InteractionDirection, InteractionEndpointService, InteractionMessageTemplateService, InteractionProvider, InteractionRouteLogic, InteractionService, InteractionStatus, InteractionWidgetService, LoaderComponent, ModelAttributeTypes, ModelSortDirection, OpenSearchHelperService, ProcessingStatus, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, StorageType, TeamService, TenantComplianceDocumentStatus, TenantComplianceDocumentType, TenantSSOConfigurationProtocol, TenantService, TicketService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig, sanitizeHtmlBody };
4597
4600
  //# sourceMappingURL=snugdesk-core.mjs.map