@circle-vibe/shared 1.1.18 → 1.1.20
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/build/index.js +1 -1
- package/build/src/enums/index.d.ts +4 -1
- package/build/src/enums/index.js +4 -1
- package/build/src/enums/index.js.map +1 -1
- package/build/src/enums/message-file-entity-type.d.ts +5 -0
- package/build/src/enums/message-file-entity-type.js +10 -0
- package/build/src/enums/message-file-entity-type.js.map +1 -0
- package/build/src/enums/message-file-type.d.ts +8 -0
- package/build/src/enums/message-file-type.js +13 -0
- package/build/src/enums/message-file-type.js.map +1 -0
- package/build/src/enums/user-chat-role.d.ts +7 -0
- package/build/src/enums/user-chat-role.js +12 -0
- package/build/src/enums/user-chat-role.js.map +1 -0
- package/build/src/enums/user-role.d.ts +4 -0
- package/build/src/enums/user-role.js +9 -0
- package/build/src/enums/user-role.js.map +1 -0
- package/build/src/models/chat.d.ts +10 -13
- package/build/src/models/file.d.ts +6 -4
- package/build/src/models/index.d.ts +2 -1
- package/build/src/models/index.js +2 -1
- package/build/src/models/index.js.map +1 -1
- package/build/src/models/message.d.ts +11 -11
- package/build/src/models/thread-participant.d.ts +9 -0
- package/build/src/models/thread-participant.js +3 -0
- package/build/src/models/thread-participant.js.map +1 -0
- package/build/src/models/thread.d.ts +5 -0
- package/build/src/models/{admin.js → thread.js} +1 -1
- package/build/src/models/thread.js.map +1 -0
- package/build/src/models/user.d.ts +11 -8
- package/build/src/utils/index.d.ts +1 -0
- package/build/src/utils/index.js +1 -0
- package/build/src/utils/index.js.map +1 -1
- package/build/src/utils/is-token-expired/index.d.ts +1 -0
- package/build/src/utils/is-token-expired/index.js +18 -0
- package/build/src/utils/is-token-expired/index.js.map +1 -0
- package/build/src/utils/is-token-expired/is-token-expired.d.ts +1 -0
- package/build/src/utils/is-token-expired/is-token-expired.js +8 -0
- package/build/src/utils/is-token-expired/is-token-expired.js.map +1 -0
- package/package.json +1 -1
- package/build/src/enums/file-type.d.ts +0 -6
- package/build/src/enums/file-type.js +0 -12
- package/build/src/enums/file-type.js.map +0 -1
- package/build/src/models/admin.d.ts +0 -16
- package/build/src/models/admin.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './file-type';
|
|
1
|
+
export * from './message-file-type';
|
|
2
2
|
export * from './chat-type';
|
|
3
3
|
export * from './message-status';
|
|
4
4
|
export * from './message-type';
|
|
@@ -6,3 +6,6 @@ export * from './user-type';
|
|
|
6
6
|
export * from './chat-socket-keys';
|
|
7
7
|
export * from './nationality-code';
|
|
8
8
|
export * from './country-code';
|
|
9
|
+
export * from './user-role';
|
|
10
|
+
export * from './user-chat-role';
|
|
11
|
+
export * from './message-file-entity-type';
|
package/build/src/enums/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./file-type"), exports);
|
|
17
|
+
__exportStar(require("./message-file-type"), exports);
|
|
18
18
|
__exportStar(require("./chat-type"), exports);
|
|
19
19
|
__exportStar(require("./message-status"), exports);
|
|
20
20
|
__exportStar(require("./message-type"), exports);
|
|
@@ -22,4 +22,7 @@ __exportStar(require("./user-type"), exports);
|
|
|
22
22
|
__exportStar(require("./chat-socket-keys"), exports);
|
|
23
23
|
__exportStar(require("./nationality-code"), exports);
|
|
24
24
|
__exportStar(require("./country-code"), exports);
|
|
25
|
+
__exportStar(require("./user-role"), exports);
|
|
26
|
+
__exportStar(require("./user-chat-role"), exports);
|
|
27
|
+
__exportStar(require("./message-file-entity-type"), exports);
|
|
25
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,8CAA4B;AAC5B,mDAAiC;AACjC,iDAA+B;AAC/B,8CAA4B;AAC5B,qDAAmC;AACnC,qDAAmC;AACnC,iDAA+B;AAC/B,8CAA4B;AAC5B,mDAAiC;AACjC,6DAA0C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageFileEntityType = void 0;
|
|
4
|
+
var MessageFileEntityType;
|
|
5
|
+
(function (MessageFileEntityType) {
|
|
6
|
+
MessageFileEntityType["IMAGE"] = "IMAGE";
|
|
7
|
+
MessageFileEntityType["VIDEO"] = "VIDEO";
|
|
8
|
+
MessageFileEntityType["FILE"] = "FILE";
|
|
9
|
+
})(MessageFileEntityType = exports.MessageFileEntityType || (exports.MessageFileEntityType = {}));
|
|
10
|
+
//# sourceMappingURL=message-file-entity-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-file-entity-type.js","sourceRoot":"","sources":["../../../src/enums/message-file-entity-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,wCAAe,CAAA;IACf,sCAAa,CAAA;AACf,CAAC,EAJW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAIhC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageFileType = void 0;
|
|
4
|
+
var MessageFileType;
|
|
5
|
+
(function (MessageFileType) {
|
|
6
|
+
MessageFileType["MP4"] = "video/mp4";
|
|
7
|
+
MessageFileType["OGG"] = "video/ogg";
|
|
8
|
+
MessageFileType["WEBM"] = "video/webm";
|
|
9
|
+
MessageFileType["AVI"] = "video/avi";
|
|
10
|
+
MessageFileType["DOCUMENT"] = "document";
|
|
11
|
+
MessageFileType["MS_DOCUMENT"] = "ms_document";
|
|
12
|
+
})(MessageFileType = exports.MessageFileType || (exports.MessageFileType = {}));
|
|
13
|
+
//# sourceMappingURL=message-file-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-file-type.js","sourceRoot":"","sources":["../../../src/enums/message-file-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB,8CAA2B,CAAA;AAC7B,CAAC,EAPW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAO1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserChatRole = void 0;
|
|
4
|
+
var UserChatRole;
|
|
5
|
+
(function (UserChatRole) {
|
|
6
|
+
UserChatRole["ADMIN"] = "ADMIN";
|
|
7
|
+
UserChatRole["MODERATOR"] = "MODERATOR";
|
|
8
|
+
UserChatRole["BOT"] = "BOT";
|
|
9
|
+
UserChatRole["MEMBER"] = "MEMBER";
|
|
10
|
+
UserChatRole["TECH_SUPPORT"] = "TECH_SUPPORT";
|
|
11
|
+
})(UserChatRole = exports.UserChatRole || (exports.UserChatRole = {}));
|
|
12
|
+
//# sourceMappingURL=user-chat-role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-chat-role.js","sourceRoot":"","sources":["../../../src/enums/user-chat-role.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,6CAA6B,CAAA;AAC/B,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserRole = void 0;
|
|
4
|
+
var UserRole;
|
|
5
|
+
(function (UserRole) {
|
|
6
|
+
UserRole["USER"] = "USER";
|
|
7
|
+
UserRole["ADMIN"] = "ADMIN";
|
|
8
|
+
})(UserRole = exports.UserRole || (exports.UserRole = {}));
|
|
9
|
+
//# sourceMappingURL=user-role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-role.js","sourceRoot":"","sources":["../../../src/enums/user-role.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB"}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import { ChatType } from "src/enums";
|
|
2
|
-
import { User } from "./user";
|
|
3
2
|
import { Message } from "./message";
|
|
4
|
-
import { File } from "./file";
|
|
5
3
|
export interface Chat {
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
id: number;
|
|
5
|
+
avatarUrl?: string;
|
|
6
|
+
hidden: boolean;
|
|
7
|
+
isActive: boolean;
|
|
8
8
|
name: string;
|
|
9
|
-
description: string;
|
|
10
9
|
readableName: string;
|
|
10
|
+
description?: string;
|
|
11
11
|
type: ChatType;
|
|
12
12
|
isGroupChat: boolean;
|
|
13
13
|
createdAt: Date;
|
|
14
14
|
updatedAt: Date;
|
|
15
|
-
hasUnreadMessages
|
|
16
|
-
empty
|
|
17
|
-
|
|
18
|
-
lastMessage: Message | null;
|
|
15
|
+
hasUnreadMessages?: boolean;
|
|
16
|
+
empty?: boolean;
|
|
17
|
+
unreadMessagesCount: number;
|
|
19
18
|
usersLimit: number;
|
|
20
19
|
removed: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
isArchive: boolean;
|
|
24
|
-
avatar: File;
|
|
20
|
+
lastMessageId: number;
|
|
21
|
+
lastMessage: Message;
|
|
25
22
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
1
|
+
import { MessageFileEntityType, MessageFileType } from "src/enums";
|
|
2
|
+
export interface MessageFile {
|
|
3
|
+
id: number;
|
|
3
4
|
fileName: string;
|
|
5
|
+
description: string;
|
|
4
6
|
url: string;
|
|
5
|
-
type:
|
|
6
|
-
|
|
7
|
+
type: MessageFileType;
|
|
8
|
+
entityType: MessageFileEntityType;
|
|
7
9
|
}
|
|
@@ -18,5 +18,6 @@ __exportStar(require("./user"), exports);
|
|
|
18
18
|
__exportStar(require("./file"), exports);
|
|
19
19
|
__exportStar(require("./message"), exports);
|
|
20
20
|
__exportStar(require("./chat"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./thread"), exports);
|
|
22
|
+
__exportStar(require("./thread-participant"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,yCAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB;AACzB,uDAAqC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { MessageStatus, MessageType } from "src/enums";
|
|
2
|
-
import {
|
|
2
|
+
import { MessageFile } from "./file";
|
|
3
3
|
import { User } from "./user";
|
|
4
|
+
import { Thread } from "./thread";
|
|
4
5
|
export interface Message {
|
|
5
|
-
|
|
6
|
+
id: number;
|
|
6
7
|
content: string;
|
|
7
|
-
|
|
8
|
-
videos: File[];
|
|
9
|
-
files: File[];
|
|
8
|
+
files: MessageFile[];
|
|
10
9
|
status: MessageStatus;
|
|
11
|
-
chatId:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
updatedDate: Date;
|
|
10
|
+
chatId: number;
|
|
11
|
+
senderId: number;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
16
14
|
messageType: MessageType;
|
|
17
|
-
|
|
15
|
+
threadId: number;
|
|
18
16
|
removed: boolean;
|
|
19
17
|
hidden: boolean;
|
|
18
|
+
sender: User;
|
|
19
|
+
thread?: Thread;
|
|
20
20
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-participant.js","sourceRoot":"","sources":["../../../src/models/thread-participant.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread.js","sourceRoot":"","sources":["../../../src/models/thread.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { UserType } from "src/enums";
|
|
2
|
-
import { File } from "./file";
|
|
1
|
+
import { UserChatRole, UserRole, UserType } from "src/enums";
|
|
3
2
|
export interface User {
|
|
4
|
-
|
|
3
|
+
id: number;
|
|
5
4
|
username: string;
|
|
6
5
|
surname: string;
|
|
7
|
-
birthDate
|
|
6
|
+
birthDate: Date;
|
|
8
7
|
password: string;
|
|
9
|
-
|
|
8
|
+
avatarUrl: string;
|
|
10
9
|
isHiddenContactInfo: boolean;
|
|
11
|
-
country
|
|
12
|
-
city
|
|
10
|
+
country: string;
|
|
11
|
+
city: string;
|
|
13
12
|
email: string;
|
|
14
13
|
privateKey: string;
|
|
15
14
|
privateToken: string;
|
|
16
|
-
primaryPhone
|
|
15
|
+
primaryPhone: string;
|
|
17
16
|
type: UserType;
|
|
17
|
+
role: UserRole;
|
|
18
|
+
chatRole: UserChatRole;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
18
21
|
}
|
package/build/src/utils/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./get-formik-form-control-value"), exports);
|
|
18
18
|
__exportStar(require("./is-formik-field-required"), exports);
|
|
19
19
|
__exportStar(require("./get-formik-form-control-error"), exports);
|
|
20
|
+
__exportStar(require("./is-token-expired"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,6DAA2C;AAC3C,kEAAgD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,6DAA2C;AAC3C,kEAAgD;AAChD,qDAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './is-token-expired';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./is-token-expired"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/is-token-expired/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isTokenExpired: (exp: number) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTokenExpired = void 0;
|
|
4
|
+
const isTokenExpired = (exp) => {
|
|
5
|
+
return exp < new Date().getTime();
|
|
6
|
+
};
|
|
7
|
+
exports.isTokenExpired = isTokenExpired;
|
|
8
|
+
//# sourceMappingURL=is-token-expired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-token-expired.js","sourceRoot":"","sources":["../../../../src/utils/is-token-expired/is-token-expired.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAC,GAAW,EAAW,EAAE;IACrD,OAAO,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AACpC,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB"}
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileType = void 0;
|
|
4
|
-
var FileType;
|
|
5
|
-
(function (FileType) {
|
|
6
|
-
FileType["MP4"] = "video/mp4";
|
|
7
|
-
FileType["OGG"] = "video/ogg";
|
|
8
|
-
FileType["WEBM"] = "video/webm";
|
|
9
|
-
FileType["AVI"] = "video/avi";
|
|
10
|
-
// extends to documents
|
|
11
|
-
})(FileType = exports.FileType || (exports.FileType = {}));
|
|
12
|
-
//# sourceMappingURL=file-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-type.js","sourceRoot":"","sources":["../../../src/enums/file-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;IACjB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,uBAAuB;AACzB,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { UserType } from "src/enums";
|
|
2
|
-
import { File } from "./file";
|
|
3
|
-
export interface Admin {
|
|
4
|
-
_id: string;
|
|
5
|
-
username: string;
|
|
6
|
-
surname: string;
|
|
7
|
-
password: string;
|
|
8
|
-
avatar: File;
|
|
9
|
-
city: string;
|
|
10
|
-
country: string;
|
|
11
|
-
privateKey: string;
|
|
12
|
-
privateToken: string;
|
|
13
|
-
email: string;
|
|
14
|
-
primaryPhone: string;
|
|
15
|
-
type: UserType;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../../src/models/admin.ts"],"names":[],"mappings":""}
|