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.
- package/dist/constants/authentication.constants.js +1 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/tree.constants.js +4 -0
- package/dist/models/contractor-password-length.model.js +24 -0
- package/dist/utils/{resize-image.js → image.utils.js} +5 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/socket.js +18 -8
- package/package.json +1 -1
- package/src/components/result-chart/result-chart.interface.ts +1 -0
- package/src/components/tooltip/tooltip.interface.ts +1 -0
- package/src/constants/authentication.constants.ts +1 -0
- package/src/constants/index.ts +2 -0
- package/src/constants/tree.constants.ts +5 -0
- package/src/models/contractor-password-length.model.ts +5 -0
- package/src/models/get-user-to-register.model.ts +1 -0
- package/src/models/index.d.ts +4 -3
- package/src/models/result-params.model.ts +2 -0
- package/src/models/theme-base.ts +1 -0
- package/src/repositories/authentication.repository.interface.ts +4 -4
- package/src/repositories/chat.repository.interface.ts +1 -0
- package/src/services/authentication.service.interface.ts +6 -3
- package/src/services/chat.service.interface.ts +1 -0
- package/src/services/dtos/chat.dto.ts +4 -0
- package/src/utils/{resize-image.ts → image.utils.ts} +8 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/socket.ts +21 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var DEFAULT_PASSWORD_LENGTH = 6;
|
package/dist/constants/index.js
CHANGED
|
@@ -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,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
|
+
}
|
package/dist/utils/index.js
CHANGED
|
@@ -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 "./
|
|
10
|
+
export * from "./image.utils";
|
|
11
11
|
export * from "./timer.utils";
|
|
12
12
|
export * from "./string.utils";
|
package/dist/utils/socket.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
12
|
-
|
|
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
|
|
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
|
-
|
|
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: [
|
|
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
|
@@ -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;
|
package/src/constants/index.ts
CHANGED
|
@@ -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";
|
package/src/models/index.d.ts
CHANGED
|
@@ -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
|
|
52
|
-
export * from
|
|
53
|
-
export * from
|
|
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";
|
package/src/models/theme-base.ts
CHANGED
|
@@ -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<
|
|
69
|
+
}: IValidatePasswordCode): Promise<ContractorPasswordLength>;
|
|
70
70
|
}
|
|
@@ -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<
|
|
70
|
-
updateUserSession(
|
|
70
|
+
}: IValidatePasswordCode): Promise<ContractorPasswordLength>;
|
|
71
|
+
updateUserSession(
|
|
72
|
+
data: Partial<UserSessionModel>
|
|
73
|
+
): Promise<UserSessionModel>;
|
|
71
74
|
}
|
|
@@ -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
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -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 "./
|
|
10
|
+
export * from "./image.utils";
|
|
11
11
|
export * from "./timer.utils";
|
|
12
12
|
export * from "./string.utils";
|
package/src/utils/socket.ts
CHANGED
|
@@ -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
|
-
|
|
10
|
+
const socket = SocketIO._sockets[path];
|
|
11
|
+
|
|
10
12
|
if (!socket) {
|
|
11
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
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):
|
|
39
|
-
|
|
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: [
|
|
53
|
+
reconnectionAttempts: 5,
|
|
54
|
+
transports: ["websocket", "polling"],
|
|
46
55
|
});
|
|
47
|
-
|
|
48
|
-
SocketIO._sockets[path] = socket;
|
|
49
|
-
return socket;
|
|
50
56
|
}
|
|
51
57
|
}
|