c2-desafiox 1.0.133 → 1.0.135
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/models/AdminAccessProfile.d.ts +2 -2
- package/dist/models/Chat.d.ts +46 -0
- package/dist/models/Chat.js +11 -0
- package/dist/models/ChatMessage.d.ts +191 -0
- package/dist/models/ChatMessage.js +43 -0
- package/dist/models/Contact.d.ts +53 -0
- package/dist/models/Contact.js +13 -0
- package/dist/models/IDefault.d.ts +1 -1
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
-
import {
|
|
3
|
-
export interface IAdminAccessProfile extends
|
|
2
|
+
import { IDefault } from "./IDefault";
|
|
3
|
+
export interface IAdminAccessProfile extends IDefault {
|
|
4
4
|
name: string;
|
|
5
5
|
roles: string[];
|
|
6
6
|
active: boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IContact } from "./Contact";
|
|
3
|
+
import { IFile } from "./File";
|
|
4
|
+
import { IDefault } from "./IDefault";
|
|
5
|
+
export interface IChat extends IDefault {
|
|
6
|
+
contacts: IContact[] | Types.ObjectId[];
|
|
7
|
+
icon: IFile;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ChatSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
11
|
+
timestamps: {
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
};
|
|
15
|
+
}, {} & {
|
|
16
|
+
contacts: Types.ObjectId[];
|
|
17
|
+
name?: string | null | undefined;
|
|
18
|
+
icon?: ({} & {
|
|
19
|
+
contentType: string;
|
|
20
|
+
description: string;
|
|
21
|
+
format?: string | null | undefined;
|
|
22
|
+
url?: string | null | undefined;
|
|
23
|
+
}) | null | undefined;
|
|
24
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
25
|
+
contacts: Types.ObjectId[];
|
|
26
|
+
name?: string | null | undefined;
|
|
27
|
+
icon?: ({} & {
|
|
28
|
+
contentType: string;
|
|
29
|
+
description: string;
|
|
30
|
+
format?: string | null | undefined;
|
|
31
|
+
url?: string | null | undefined;
|
|
32
|
+
}) | null | undefined;
|
|
33
|
+
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
34
|
+
contacts: Types.ObjectId[];
|
|
35
|
+
name?: string | null | undefined;
|
|
36
|
+
icon?: ({} & {
|
|
37
|
+
contentType: string;
|
|
38
|
+
description: string;
|
|
39
|
+
format?: string | null | undefined;
|
|
40
|
+
url?: string | null | undefined;
|
|
41
|
+
}) | null | undefined;
|
|
42
|
+
}> & {
|
|
43
|
+
_id: Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const File_1 = require("./File");
|
|
6
|
+
exports.ChatSchema = new mongoose_1.Schema({
|
|
7
|
+
contacts: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "contacts" }],
|
|
8
|
+
icon: { type: File_1.FileSchema },
|
|
9
|
+
name: { type: String }
|
|
10
|
+
}, { timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" } });
|
|
11
|
+
exports.ChatSchema.index({ name: 1 }, { unique: true });
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Schema, Types } from "mongoose";
|
|
2
|
+
import { IChat } from "./Chat";
|
|
3
|
+
import { IContact } from "./Contact";
|
|
4
|
+
import { IFile } from "./File";
|
|
5
|
+
import { IDefault } from "./IDefault";
|
|
6
|
+
export declare enum StatusChatMessage {
|
|
7
|
+
NOT_SENT = "NOT_SENT",
|
|
8
|
+
SENT = "SENT",
|
|
9
|
+
RECEIVED = "RECEIVED",
|
|
10
|
+
SEEN = "SEEN"
|
|
11
|
+
}
|
|
12
|
+
export declare enum TypeOfMessageNotication {
|
|
13
|
+
CHAT_MESSAGE = "CHAT_MESSAGE",
|
|
14
|
+
RECEIVED = "RECEIVED",
|
|
15
|
+
SEEN = "SEEN"
|
|
16
|
+
}
|
|
17
|
+
export interface IChatMessage extends IDefault {
|
|
18
|
+
chat: Types.ObjectId | IChat;
|
|
19
|
+
sender: Types.ObjectId | IContact;
|
|
20
|
+
category: string;
|
|
21
|
+
content: string;
|
|
22
|
+
files: IFile[];
|
|
23
|
+
status: StatusChatMessage;
|
|
24
|
+
sendDateTime: Date;
|
|
25
|
+
receivements: {
|
|
26
|
+
contact: Types.ObjectId | IContact;
|
|
27
|
+
receivedDateTime: Date;
|
|
28
|
+
}[];
|
|
29
|
+
seens: {
|
|
30
|
+
contact: Types.ObjectId | IContact;
|
|
31
|
+
seenDateTime: Date;
|
|
32
|
+
}[];
|
|
33
|
+
type: TypeOfMessageNotication;
|
|
34
|
+
}
|
|
35
|
+
export declare const ChatMessageSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
36
|
+
timestamps: {
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
};
|
|
40
|
+
}, {} & {
|
|
41
|
+
status: string;
|
|
42
|
+
chat: Types.ObjectId;
|
|
43
|
+
sender: Types.ObjectId;
|
|
44
|
+
files: Types.DocumentArray<{
|
|
45
|
+
type?: ({} & {
|
|
46
|
+
contentType: string;
|
|
47
|
+
description: string;
|
|
48
|
+
format?: string | null | undefined;
|
|
49
|
+
url?: string | null | undefined;
|
|
50
|
+
}) | null | undefined;
|
|
51
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
52
|
+
type?: ({} & {
|
|
53
|
+
contentType: string;
|
|
54
|
+
description: string;
|
|
55
|
+
format?: string | null | undefined;
|
|
56
|
+
url?: string | null | undefined;
|
|
57
|
+
}) | null | undefined;
|
|
58
|
+
}> & {
|
|
59
|
+
type?: ({} & {
|
|
60
|
+
contentType: string;
|
|
61
|
+
description: string;
|
|
62
|
+
format?: string | null | undefined;
|
|
63
|
+
url?: string | null | undefined;
|
|
64
|
+
}) | null | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
sendDateTime: NativeDate;
|
|
67
|
+
receivements: Types.DocumentArray<{
|
|
68
|
+
receivedBy?: string | null | undefined;
|
|
69
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
70
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
71
|
+
receivedBy?: string | null | undefined;
|
|
72
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
73
|
+
}> & {
|
|
74
|
+
receivedBy?: string | null | undefined;
|
|
75
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
seens: Types.DocumentArray<{
|
|
78
|
+
seenBy?: string | null | undefined;
|
|
79
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
80
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
81
|
+
seenBy?: string | null | undefined;
|
|
82
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
83
|
+
}> & {
|
|
84
|
+
seenBy?: string | null | undefined;
|
|
85
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
content?: string | null | undefined;
|
|
88
|
+
category?: string | null | undefined;
|
|
89
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
90
|
+
status: string;
|
|
91
|
+
chat: Types.ObjectId;
|
|
92
|
+
sender: Types.ObjectId;
|
|
93
|
+
files: Types.DocumentArray<{
|
|
94
|
+
type?: ({} & {
|
|
95
|
+
contentType: string;
|
|
96
|
+
description: string;
|
|
97
|
+
format?: string | null | undefined;
|
|
98
|
+
url?: string | null | undefined;
|
|
99
|
+
}) | null | undefined;
|
|
100
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
101
|
+
type?: ({} & {
|
|
102
|
+
contentType: string;
|
|
103
|
+
description: string;
|
|
104
|
+
format?: string | null | undefined;
|
|
105
|
+
url?: string | null | undefined;
|
|
106
|
+
}) | null | undefined;
|
|
107
|
+
}> & {
|
|
108
|
+
type?: ({} & {
|
|
109
|
+
contentType: string;
|
|
110
|
+
description: string;
|
|
111
|
+
format?: string | null | undefined;
|
|
112
|
+
url?: string | null | undefined;
|
|
113
|
+
}) | null | undefined;
|
|
114
|
+
}>;
|
|
115
|
+
sendDateTime: NativeDate;
|
|
116
|
+
receivements: Types.DocumentArray<{
|
|
117
|
+
receivedBy?: string | null | undefined;
|
|
118
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
119
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
120
|
+
receivedBy?: string | null | undefined;
|
|
121
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
122
|
+
}> & {
|
|
123
|
+
receivedBy?: string | null | undefined;
|
|
124
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
seens: Types.DocumentArray<{
|
|
127
|
+
seenBy?: string | null | undefined;
|
|
128
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
129
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
130
|
+
seenBy?: string | null | undefined;
|
|
131
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
132
|
+
}> & {
|
|
133
|
+
seenBy?: string | null | undefined;
|
|
134
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
content?: string | null | undefined;
|
|
137
|
+
category?: string | null | undefined;
|
|
138
|
+
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
139
|
+
status: string;
|
|
140
|
+
chat: Types.ObjectId;
|
|
141
|
+
sender: Types.ObjectId;
|
|
142
|
+
files: Types.DocumentArray<{
|
|
143
|
+
type?: ({} & {
|
|
144
|
+
contentType: string;
|
|
145
|
+
description: string;
|
|
146
|
+
format?: string | null | undefined;
|
|
147
|
+
url?: string | null | undefined;
|
|
148
|
+
}) | null | undefined;
|
|
149
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
150
|
+
type?: ({} & {
|
|
151
|
+
contentType: string;
|
|
152
|
+
description: string;
|
|
153
|
+
format?: string | null | undefined;
|
|
154
|
+
url?: string | null | undefined;
|
|
155
|
+
}) | null | undefined;
|
|
156
|
+
}> & {
|
|
157
|
+
type?: ({} & {
|
|
158
|
+
contentType: string;
|
|
159
|
+
description: string;
|
|
160
|
+
format?: string | null | undefined;
|
|
161
|
+
url?: string | null | undefined;
|
|
162
|
+
}) | null | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
sendDateTime: NativeDate;
|
|
165
|
+
receivements: Types.DocumentArray<{
|
|
166
|
+
receivedBy?: string | null | undefined;
|
|
167
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
168
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
169
|
+
receivedBy?: string | null | undefined;
|
|
170
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
171
|
+
}> & {
|
|
172
|
+
receivedBy?: string | null | undefined;
|
|
173
|
+
receivedDateTime?: NativeDate | null | undefined;
|
|
174
|
+
}>;
|
|
175
|
+
seens: Types.DocumentArray<{
|
|
176
|
+
seenBy?: string | null | undefined;
|
|
177
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
178
|
+
}, Types.Subdocument<Types.ObjectId, any, {
|
|
179
|
+
seenBy?: string | null | undefined;
|
|
180
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
181
|
+
}> & {
|
|
182
|
+
seenBy?: string | null | undefined;
|
|
183
|
+
seenDateTime?: NativeDate | null | undefined;
|
|
184
|
+
}>;
|
|
185
|
+
content?: string | null | undefined;
|
|
186
|
+
category?: string | null | undefined;
|
|
187
|
+
}> & {
|
|
188
|
+
_id: Types.ObjectId;
|
|
189
|
+
} & {
|
|
190
|
+
__v: number;
|
|
191
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatMessageSchema = exports.TypeOfMessageNotication = exports.StatusChatMessage = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const File_1 = require("./File");
|
|
6
|
+
var StatusChatMessage;
|
|
7
|
+
(function (StatusChatMessage) {
|
|
8
|
+
StatusChatMessage["NOT_SENT"] = "NOT_SENT";
|
|
9
|
+
StatusChatMessage["SENT"] = "SENT";
|
|
10
|
+
StatusChatMessage["RECEIVED"] = "RECEIVED";
|
|
11
|
+
StatusChatMessage["SEEN"] = "SEEN";
|
|
12
|
+
})(StatusChatMessage || (exports.StatusChatMessage = StatusChatMessage = {}));
|
|
13
|
+
var TypeOfMessageNotication;
|
|
14
|
+
(function (TypeOfMessageNotication) {
|
|
15
|
+
TypeOfMessageNotication["CHAT_MESSAGE"] = "CHAT_MESSAGE";
|
|
16
|
+
TypeOfMessageNotication["RECEIVED"] = "RECEIVED";
|
|
17
|
+
TypeOfMessageNotication["SEEN"] = "SEEN";
|
|
18
|
+
})(TypeOfMessageNotication || (exports.TypeOfMessageNotication = TypeOfMessageNotication = {}));
|
|
19
|
+
exports.ChatMessageSchema = new mongoose_1.Schema({
|
|
20
|
+
chat: { type: mongoose_1.Schema.Types.ObjectId, ref: "chat", required: true },
|
|
21
|
+
sender: { type: mongoose_1.Schema.Types.ObjectId, ref: "contact", required: true },
|
|
22
|
+
category: { type: String },
|
|
23
|
+
content: { type: String },
|
|
24
|
+
files: [{ type: File_1.FileSchema }],
|
|
25
|
+
status: { type: String, enum: StatusChatMessage, default: StatusChatMessage.SENT, required: true },
|
|
26
|
+
sendDateTime: { type: Date, required: true },
|
|
27
|
+
receivements: {
|
|
28
|
+
type: [{
|
|
29
|
+
receivedBy: { type: String },
|
|
30
|
+
receivedDateTime: { type: Date }
|
|
31
|
+
}]
|
|
32
|
+
},
|
|
33
|
+
seens: {
|
|
34
|
+
type: [{
|
|
35
|
+
seenBy: { type: String },
|
|
36
|
+
seenDateTime: { type: Date }
|
|
37
|
+
}]
|
|
38
|
+
}
|
|
39
|
+
}, { timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" } });
|
|
40
|
+
exports.ChatMessageSchema.index({ chat: 1 });
|
|
41
|
+
exports.ChatMessageSchema.index({ sender: 1 });
|
|
42
|
+
exports.ChatMessageSchema.index({ content: 1 });
|
|
43
|
+
exports.ChatMessageSchema.index({ status: 1 });
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
import { IAdminAccount } from "./AdminAccount";
|
|
3
|
+
import { IFile } from "./File";
|
|
4
|
+
import { IDefaultAccount } from "./IDefault";
|
|
5
|
+
export interface IContact extends IDefaultAccount {
|
|
6
|
+
adminAccount?: IAdminAccount;
|
|
7
|
+
identifier: string;
|
|
8
|
+
name: string;
|
|
9
|
+
profilePhoto: IFile;
|
|
10
|
+
}
|
|
11
|
+
export declare const ContactSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
12
|
+
timestamps: {
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
};
|
|
16
|
+
}, {} & {
|
|
17
|
+
name: string;
|
|
18
|
+
identifier: string;
|
|
19
|
+
account?: import("mongoose").Types.ObjectId | null | undefined;
|
|
20
|
+
adminAccount?: import("mongoose").Types.ObjectId | null | undefined;
|
|
21
|
+
profilePhoto?: ({} & {
|
|
22
|
+
contentType: string;
|
|
23
|
+
description: string;
|
|
24
|
+
format?: string | null | undefined;
|
|
25
|
+
url?: string | null | undefined;
|
|
26
|
+
}) | null | undefined;
|
|
27
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{} & {
|
|
28
|
+
name: string;
|
|
29
|
+
identifier: string;
|
|
30
|
+
account?: import("mongoose").Types.ObjectId | null | undefined;
|
|
31
|
+
adminAccount?: import("mongoose").Types.ObjectId | null | undefined;
|
|
32
|
+
profilePhoto?: ({} & {
|
|
33
|
+
contentType: string;
|
|
34
|
+
description: string;
|
|
35
|
+
format?: string | null | undefined;
|
|
36
|
+
url?: string | null | undefined;
|
|
37
|
+
}) | null | undefined;
|
|
38
|
+
}>, {}> & import("mongoose").FlatRecord<{} & {
|
|
39
|
+
name: string;
|
|
40
|
+
identifier: string;
|
|
41
|
+
account?: import("mongoose").Types.ObjectId | null | undefined;
|
|
42
|
+
adminAccount?: import("mongoose").Types.ObjectId | null | undefined;
|
|
43
|
+
profilePhoto?: ({} & {
|
|
44
|
+
contentType: string;
|
|
45
|
+
description: string;
|
|
46
|
+
format?: string | null | undefined;
|
|
47
|
+
url?: string | null | undefined;
|
|
48
|
+
}) | null | undefined;
|
|
49
|
+
}> & {
|
|
50
|
+
_id: import("mongoose").Types.ObjectId;
|
|
51
|
+
} & {
|
|
52
|
+
__v: number;
|
|
53
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContactSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const File_1 = require("./File");
|
|
6
|
+
exports.ContactSchema = new mongoose_1.Schema({
|
|
7
|
+
account: { type: mongoose_1.Schema.Types.ObjectId, ref: "account" },
|
|
8
|
+
adminAccount: { type: mongoose_1.Schema.Types.ObjectId, ref: "admin-account" },
|
|
9
|
+
identifier: { type: String, required: true },
|
|
10
|
+
name: { type: String, required: true },
|
|
11
|
+
profilePhoto: { type: File_1.FileSchema }
|
|
12
|
+
}, { timestamps: { createdAt: "createdAtDateTime", updatedAt: "updatedAtDateTime" } });
|
|
13
|
+
exports.ContactSchema.index({ identifier: 1 }, { unique: true });
|
|
@@ -6,7 +6,7 @@ export declare interface IDefaultAccount {
|
|
|
6
6
|
createdAtDateTime?: Date;
|
|
7
7
|
updatedAtDateTime?: Date;
|
|
8
8
|
}
|
|
9
|
-
export declare interface
|
|
9
|
+
export declare interface IDefault {
|
|
10
10
|
_id?: Types.ObjectId;
|
|
11
11
|
createdAtDateTime?: Date;
|
|
12
12
|
updatedAtDateTime?: Date;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export * from "./ChampionshipClassification";
|
|
|
14
14
|
export * from "./ChampionshipMatch";
|
|
15
15
|
export * from "./ChampionshipPhase";
|
|
16
16
|
export * from "./ChampionshipRound";
|
|
17
|
+
export * from "./Chat";
|
|
18
|
+
export * from "./ChatMessage";
|
|
19
|
+
export * from "./Contact";
|
|
17
20
|
export * from "./File";
|
|
18
21
|
export * from "./Team";
|
|
19
22
|
export * from "./Ticket";
|
package/dist/models/index.js
CHANGED
|
@@ -30,6 +30,9 @@ __exportStar(require("./ChampionshipClassification"), exports);
|
|
|
30
30
|
__exportStar(require("./ChampionshipMatch"), exports);
|
|
31
31
|
__exportStar(require("./ChampionshipPhase"), exports);
|
|
32
32
|
__exportStar(require("./ChampionshipRound"), exports);
|
|
33
|
+
__exportStar(require("./Chat"), exports);
|
|
34
|
+
__exportStar(require("./ChatMessage"), exports);
|
|
35
|
+
__exportStar(require("./Contact"), exports);
|
|
33
36
|
__exportStar(require("./File"), exports);
|
|
34
37
|
__exportStar(require("./Team"), exports);
|
|
35
38
|
__exportStar(require("./Ticket"), exports);
|
package/package.json
CHANGED