robbyson-frontend-library 1.0.64 → 1.0.66

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.
@@ -0,0 +1 @@
1
+ export var DEFAULT_PASSWORD_LENGTH = 6;
@@ -3,6 +3,8 @@ export * from "./hierarchy.constants";
3
3
  export * from "./layout-dimensions.constants";
4
4
  export * from "./market.constants";
5
5
  export * from "./user-metadata.constants";
6
+ export * from "./tree.constants";
6
7
  export * as UploadConstants from "./upload.constants";
7
8
  export * as CampaignConstants from "./campaign.constants";
8
9
  export * as ResultsConstants from "./result-level.constants";
10
+ export * as AuthenticationConstants from "./authentication.constants";
@@ -0,0 +1,4 @@
1
+ var DEFAULT_TREE_VISUALIZATION_MONTHS = 3;
2
+ export var TreeConstants = {
3
+ DEFAULT_TREE_VISUALIZATION_MONTHS: DEFAULT_TREE_VISUALIZATION_MONTHS,
4
+ };
@@ -0,0 +1,24 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { BaseRepositoryModel } from "./base.repository.model";
17
+ var ContractorPasswordLength = /** @class */ (function (_super) {
18
+ __extends(ContractorPasswordLength, _super);
19
+ function ContractorPasswordLength() {
20
+ return _super !== null && _super.apply(this, arguments) || this;
21
+ }
22
+ return ContractorPasswordLength;
23
+ }(BaseRepositoryModel));
24
+ export { ContractorPasswordLength };
@@ -96,3 +96,8 @@ export function getCroppedImg(imageSrc, pixelCrop, flip, type) {
96
96
  });
97
97
  });
98
98
  }
99
+ export function checkExpiresPublicUrl(publicUrl) {
100
+ var expiresIn = parseInt(publicUrl.split("Expires=")[1].split("&")[0]);
101
+ var currentTime = Math.floor(new Date().getTime() / 1000);
102
+ return currentTime > expiresIn;
103
+ }
@@ -7,6 +7,6 @@ export * from "./robbyson-navigate";
7
7
  export * from "./socket";
8
8
  export * from "./layout.utils";
9
9
  export * from "./date.utils";
10
- export * from "./resize-image";
10
+ export * from "./image.utils";
11
11
  export * from "./timer.utils";
12
12
  export * from "./string.utils";
@@ -3,15 +3,26 @@ var SocketIO = /** @class */ (function () {
3
3
  function SocketIO() {
4
4
  }
5
5
  SocketIO.findOrCreate = function (baseUrl, path) {
6
+ var _this = this;
6
7
  var socket = SocketIO._sockets[path];
7
8
  if (!socket) {
8
- socket = SocketIO.connect(baseUrl, path);
9
+ this._connecting[path] = true;
10
+ SocketIO.connect(baseUrl, path);
11
+ setTimeout(function () {
12
+ _this._connecting[path] = false;
13
+ }, 5000);
9
14
  }
10
15
  else if (socket.disconnected) {
11
- // wait for a long period to avoid duplicated connections.
12
- setTimeout(function () { return socket.disconnected && SocketIO.connect(baseUrl, path); }, 5000);
16
+ if (this._connecting[path]) {
17
+ return SocketIO._sockets[path];
18
+ }
19
+ this._connecting[path] = true;
20
+ SocketIO.connect(baseUrl, path);
21
+ setTimeout(function () {
22
+ _this._connecting[path] = false;
23
+ }, 5000);
13
24
  }
14
- return socket;
25
+ return SocketIO._sockets[path];
15
26
  };
16
27
  SocketIO.close = function (name) {
17
28
  var socket = SocketIO._sockets[name];
@@ -27,18 +38,17 @@ var SocketIO = /** @class */ (function () {
27
38
  SocketIO._sockets = {};
28
39
  };
29
40
  SocketIO.connect = function (baseUrl, path) {
30
- var socket = connect(baseUrl, {
41
+ SocketIO._sockets[path] = connect(baseUrl, {
31
42
  path: path,
32
43
  reconnection: true,
33
44
  reconnectionDelay: 10000,
34
45
  reconnectionDelayMax: 50000,
35
46
  reconnectionAttempts: 5,
36
- transports: ['websocket', 'polling']
47
+ transports: ["websocket", "polling"],
37
48
  });
38
- SocketIO._sockets[path] = socket;
39
- return socket;
40
49
  };
41
50
  SocketIO._sockets = {};
51
+ SocketIO._connecting = {};
42
52
  return SocketIO;
43
53
  }());
44
54
  export { SocketIO };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robbyson-frontend-library",
3
- "version": "1.0.64",
3
+ "version": "1.0.66",
4
4
  "description": "Robbyson frontend Library",
5
5
  "main": "./dist/index.js",
6
6
  "license": "MIT",
@@ -21,6 +21,7 @@ export interface IResultChartProps extends IBaseComponentProp {
21
21
  tabIndex?: number;
22
22
  node_id?: string;
23
23
  dailyAriaLabel?: string;
24
+ hideShowDaysButton?: boolean
24
25
  }
25
26
 
26
27
  export interface IResultChartState {
@@ -10,6 +10,7 @@ export interface ITooltipProps extends IBaseComponentProp {
10
10
  startDirection?: TooltipPosition;
11
11
  disabled?: boolean;
12
12
  width?: number;
13
+ localeArgs?: string[];
13
14
  /**
14
15
  * @description
15
16
  * Use `virtualizedId` to re-render dynamically texts, like: `states update`.
@@ -0,0 +1 @@
1
+ export const DEFAULT_PASSWORD_LENGTH = 6;
@@ -3,6 +3,8 @@ export * from "./hierarchy.constants";
3
3
  export * from "./layout-dimensions.constants";
4
4
  export * from "./market.constants";
5
5
  export * from "./user-metadata.constants";
6
+ export * from "./tree.constants";
6
7
  export * as UploadConstants from "./upload.constants";
7
8
  export * as CampaignConstants from "./campaign.constants";
8
9
  export * as ResultsConstants from "./result-level.constants";
10
+ export * as AuthenticationConstants from "./authentication.constants";
@@ -0,0 +1,5 @@
1
+ const DEFAULT_TREE_VISUALIZATION_MONTHS = 3;
2
+
3
+ export const TreeConstants = {
4
+ DEFAULT_TREE_VISUALIZATION_MONTHS,
5
+ };
@@ -0,0 +1,5 @@
1
+ import { BaseRepositoryModel } from "./base.repository.model";
2
+
3
+ export class ContractorPasswordLength extends BaseRepositoryModel {
4
+ passwordLength: number;
5
+ }
@@ -17,6 +17,7 @@ export class GetUserToRegisterModel extends BaseRepositoryModel {
17
17
  login: string;
18
18
  matricula: string;
19
19
  nickname: string;
20
+ passwordLength: number;
20
21
  eula: {
21
22
  _id: string;
22
23
  texto: string;
@@ -48,9 +48,9 @@ export * from "./attributes-response.model";
48
48
  export * from "./results-recurrence.model";
49
49
  export * from "./result-projection.model";
50
50
  export * from "./friendship-team-list.model";
51
- export * from './profile-info.model';
52
- export * from './update-password.model'
53
- export * from './profile-info.model';
51
+ export * from "./profile-info.model";
52
+ export * from "./update-password.model";
53
+ export * from "./profile-info.model";
54
54
  export * from "./learning-team-progress.model";
55
55
  export * from "./learning-courses.model";
56
56
  export * from "./learning-user-progress.model";
@@ -75,3 +75,4 @@ export * from "./user-list-filter.model";
75
75
  export * from "./portal-dashboard.model";
76
76
  export * from "./portal-dashboard-embedded.model";
77
77
  export * from "./locale.model";
78
+ export * from "./contractor-password-length.model";
@@ -10,4 +10,6 @@ export class ResultsParams extends BaseRepositoryModel {
10
10
  restrinctVisibilityIndicator:string;
11
11
  showDays?: boolean;
12
12
  limitIndicators?:number;
13
+ startDate?: string;
14
+ endDate?:string;
13
15
  }
@@ -398,6 +398,7 @@ class Typography {
398
398
  h4: ThemeTypography;
399
399
  h5: ThemeTypography;
400
400
  h6: ThemeTypography;
401
+ i: ThemeTypography;
401
402
  h6Bold: ThemeTypography;
402
403
  subtitle2: ThemeTypography;
403
404
  subtitle1: ThemeTypography;
@@ -3,10 +3,10 @@ import {
3
3
  SendUserToAuthModel,
4
4
  GetUserToRegisterModel,
5
5
  SendUserToRegisterModel,
6
- UpdatePasswordModel
6
+ UpdatePasswordModel,
7
+ ContractorPasswordLength,
7
8
  } from "../models";
8
9
 
9
-
10
10
  export interface IGenerateNewAcessCodeRepository {
11
11
  identification: string;
12
12
  recaptchaResponse: string | null | undefined;
@@ -58,7 +58,7 @@ export interface IAuthenticationRepository {
58
58
  recaptchaResponse,
59
59
  system_id,
60
60
  }: IUpdatePasswordRepository): Promise<boolean>;
61
-
61
+
62
62
  changePassword(data: UpdatePasswordModel): Promise<UserSessionModel>;
63
63
 
64
64
  validatePasswordCode({
@@ -66,5 +66,5 @@ export interface IAuthenticationRepository {
66
66
  code,
67
67
  recaptchaResponse,
68
68
  system_id,
69
- }: IValidatePasswordCode): Promise<boolean>;
69
+ }: IValidatePasswordCode): Promise<ContractorPasswordLength>;
70
70
  }
@@ -57,4 +57,5 @@ export interface IChatRepository {
57
57
  classification?: any;
58
58
  }): any;
59
59
  getGroupImage(): Promise<string>;
60
+ updateMessage(payload: MessageModel): Promise<MessageModel>;
60
61
  }
@@ -4,6 +4,7 @@ import {
4
4
  SendUserToRegisterModel,
5
5
  GetUserToRegisterModel,
6
6
  UpdatePasswordModel,
7
+ ContractorPasswordLength,
7
8
  } from "../models";
8
9
 
9
10
  export interface IGenerateNewAcessCodeService {
@@ -46,7 +47,7 @@ export interface IAuthenticationService {
46
47
  confirmPassword,
47
48
  recaptchaResponse,
48
49
  system_id,
49
- }:IUpdatePasswordService): Promise<boolean>;
50
+ }: IUpdatePasswordService): Promise<boolean>;
50
51
  getLoggedUser(): UserSessionModel;
51
52
  getUserSession(): UserSessionModel | undefined;
52
53
  ipWhiteList(): boolean;
@@ -66,6 +67,8 @@ export interface IAuthenticationService {
66
67
  code,
67
68
  recaptchaResponse,
68
69
  system_id,
69
- }:IValidatePasswordCode): Promise<boolean>;
70
- updateUserSession(data: Partial<UserSessionModel>): Promise<UserSessionModel>
70
+ }: IValidatePasswordCode): Promise<ContractorPasswordLength>;
71
+ updateUserSession(
72
+ data: Partial<UserSessionModel>
73
+ ): Promise<UserSessionModel>;
71
74
  }
@@ -95,4 +95,5 @@ export interface IChatService {
95
95
  conversationId: string,
96
96
  avoidCheckUserInCall?: boolean
97
97
  ): Promise<void>;
98
+ updateMessage(payload: MessageModel): Promise<MessageModel>;
98
99
  }
@@ -75,6 +75,8 @@ export interface IGetMessagesDTO {
75
75
  classification?: string;
76
76
  favorite?: boolean;
77
77
  type?: TypeChat;
78
+ append?: boolean;
79
+ direction?: string;
78
80
  }
79
81
 
80
82
  export type MessageBotType =
@@ -129,6 +131,7 @@ export interface IChatFormattedMessage extends MessageModel {
129
131
  seen: boolean;
130
132
  name?: string;
131
133
  userPicture?: string;
134
+ sending?: boolean;
132
135
  }
133
136
 
134
137
  export interface IChatBotFields {
@@ -176,6 +179,7 @@ export interface ISubscribeMessage {
176
179
  text?: string;
177
180
  sender: string;
178
181
  receivedAt: string;
182
+ sentAt?: string;
179
183
  receiver: string;
180
184
  conversation?: ChatModel;
181
185
  }
@@ -72,3 +72,11 @@ export async function getCroppedImg(
72
72
 
73
73
  return croppedCanvas.toDataURL("image/png");
74
74
  }
75
+
76
+ export function checkExpiresPublicUrl(publicUrl: string): boolean {
77
+ const expiresIn = parseInt(publicUrl.split("Expires=")[1].split("&")[0]);
78
+
79
+ const currentTime = Math.floor(new Date().getTime() / 1000);
80
+
81
+ return currentTime > expiresIn;
82
+ }
@@ -7,6 +7,6 @@ export * from "./robbyson-navigate";
7
7
  export * from "./socket";
8
8
  export * from "./layout.utils";
9
9
  export * from "./date.utils";
10
- export * from "./resize-image";
10
+ export * from "./image.utils";
11
11
  export * from "./timer.utils";
12
12
  export * from "./string.utils";
@@ -4,20 +4,29 @@ export type { Socket };
4
4
 
5
5
  export class SocketIO {
6
6
  private static _sockets: { [key: string]: Socket } = {};
7
+ private static _connecting: { [key: string]: boolean } = {};
7
8
 
8
9
  public static findOrCreate(baseUrl: string, path: string): Socket {
9
- let socket = SocketIO._sockets[path];
10
+ const socket = SocketIO._sockets[path];
11
+
10
12
  if (!socket) {
11
- socket = SocketIO.connect(baseUrl, path);
13
+ this._connecting[path] = true;
14
+ SocketIO.connect(baseUrl, path);
15
+ setTimeout(() => {
16
+ this._connecting[path] = false;
17
+ }, 5000);
12
18
  } else if (socket.disconnected) {
13
- // wait for a long period to avoid duplicated connections.
14
- setTimeout(
15
- () => socket.disconnected && SocketIO.connect(baseUrl, path),
16
- 5000
17
- );
19
+ if (this._connecting[path]) {
20
+ return SocketIO._sockets[path];
21
+ }
22
+ this._connecting[path] = true;
23
+ SocketIO.connect(baseUrl, path);
24
+ setTimeout(() => {
25
+ this._connecting[path] = false;
26
+ }, 5000);
18
27
  }
19
28
 
20
- return socket;
29
+ return SocketIO._sockets[path];
21
30
  }
22
31
 
23
32
  public static close(name: string): void {
@@ -35,17 +44,14 @@ export class SocketIO {
35
44
  SocketIO._sockets = {};
36
45
  }
37
46
 
38
- static connect(baseUrl: string, path: string): Socket {
39
- const socket = connect(baseUrl, {
47
+ static connect(baseUrl: string, path: string): void {
48
+ SocketIO._sockets[path] = connect(baseUrl, {
40
49
  path,
41
50
  reconnection: true,
42
51
  reconnectionDelay: 10000,
43
52
  reconnectionDelayMax: 50000,
44
- reconnectionAttempts: 5,
45
- transports: ['websocket', 'polling']
53
+ reconnectionAttempts: 5,
54
+ transports: ["websocket", "polling"],
46
55
  });
47
-
48
- SocketIO._sockets[path] = socket;
49
- return socket;
50
56
  }
51
57
  }