taxtank-core 0.17.13 → 0.17.16

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.
@@ -7209,6 +7209,9 @@
7209
7209
  __decorate([
7210
7210
  classTransformer.Type(function () { return User; })
7211
7211
  ], Chat.prototype, "client", void 0);
7212
+ __decorate([
7213
+ classTransformer.Type(function () { return Date; })
7214
+ ], Chat.prototype, "updatedAt", void 0);
7212
7215
 
7213
7216
  exports.ChatViewTypeEnum = void 0;
7214
7217
  (function (ChatViewTypeEnum) {
@@ -10958,6 +10961,7 @@
10958
10961
  _this.url = 'chats';
10959
10962
  _this.isHydra = true;
10960
10963
  _this.listenChats();
10964
+ _this.listenMessages();
10961
10965
  return _this;
10962
10966
  }
10963
10967
  /**
@@ -10994,6 +10998,20 @@
10994
10998
  _this.updateCache();
10995
10999
  });
10996
11000
  };
11001
+ /**
11002
+ * Update chat's 'updatedAt' field with the last chat's message date for chat list sorting
11003
+ */
11004
+ ChatService.prototype.listenMessages = function () {
11005
+ var _this = this;
11006
+ this.eventDispatcherService.on(exports.AppEventTypeEnum.MESSAGE_CREATED).subscribe(function (message) {
11007
+ var cache = cloneDeep__default["default"](_this.cache);
11008
+ var updatedChat = cache.find(function (chat) { return chat.id === message.chat.id; });
11009
+ updatedChat.updatedAt = message.createdAt;
11010
+ replace(cache, updatedChat);
11011
+ _this.cache = cache;
11012
+ _this.updateCache();
11013
+ });
11014
+ };
10997
11015
  return ChatService;
10998
11016
  }(RestService));
10999
11017
  ChatService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: ChatService, deps: [{ token: i1__namespace.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }, { token: SseService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
@@ -13901,10 +13919,23 @@
13901
13919
  };
13902
13920
  }
13903
13921
 
13904
- var passwordPattern = /^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})./;
13922
+ /**
13923
+ * Regular expressions that are used to check password strength and valid values
13924
+ */
13925
+ var PASSWORD_REGEXPS = {
13926
+ medium: /(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})/,
13927
+ strong: /(((?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]))|((?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*]))|((?=.*[A-Z])(?=.*[0-9]))(?=.*[!@#$%^&*]))(?=.{8,})/,
13928
+ format: /^[0-9a-zA-Z!@$!%*?&#]*$/
13929
+ };
13905
13930
  function passwordValidator() {
13906
13931
  return function (control) {
13907
- return passwordPattern.test(control.value) ? null : { passwordInvalid: true };
13932
+ if (!PASSWORD_REGEXPS.format.test(control.value)) {
13933
+ return { passwordInvalid: true };
13934
+ }
13935
+ if (!PASSWORD_REGEXPS.medium.test(control.value)) {
13936
+ return { passwordWeak: true };
13937
+ }
13938
+ return null;
13908
13939
  };
13909
13940
  }
13910
13941
 
@@ -14301,6 +14332,7 @@
14301
14332
  exports.Notification = Notification;
14302
14333
  exports.Occupation = Occupation;
14303
14334
  exports.OccupationService = OccupationService;
14335
+ exports.PASSWORD_REGEXPS = PASSWORD_REGEXPS;
14304
14336
  exports.PasswordForm = PasswordForm;
14305
14337
  exports.PdfService = PdfService;
14306
14338
  exports.PdfSettings = PdfSettings;