dl-commons 0.0.2-testing.1 → 0.0.2-testing.3
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/index.d.ts +5 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/models/interfaces/group-session.interface.d.ts +6 -2
- package/dist/models/interfaces/smtp-api-config.interface.d.ts +5 -0
- package/dist/models/interfaces/smtp-api-config.interface.js +3 -0
- package/dist/models/interfaces/smtp-api-config.interface.js.map +1 -0
- package/dist/models/interfaces/smtp.interface.d.ts +5 -0
- package/dist/models/interfaces/smtp.interface.js +3 -0
- package/dist/models/interfaces/smtp.interface.js.map +1 -0
- package/dist/models/interfaces/user.interface.d.ts +1 -0
- package/dist/models/schemas/base.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/contact.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/dictionary-embedded.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/group-session.schema.d.ts +4 -5
- package/dist/models/schemas/embedded/group-session.schema.js +3 -6
- package/dist/models/schemas/embedded/group-session.schema.js.map +1 -1
- package/dist/models/schemas/embedded/i18n.embedded.d.ts +2 -2
- package/dist/models/schemas/embedded/person.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/record.embedded.d.ts +2 -2
- package/dist/models/schemas/embedded/residence.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/session-user.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/student-embedded.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/teacher.schema.d.ts +2 -2
- package/dist/models/schemas/embedded/time.schema.d.ts +17 -0
- package/dist/models/schemas/embedded/time.schema.js +33 -0
- package/dist/models/schemas/embedded/time.schema.js.map +1 -0
- package/dist/models/schemas/identifable.schema.d.ts +2 -2
- package/dist/models/schemas/parent.schema.d.ts +2 -2
- package/dist/models/schemas/session.schema.d.ts +2 -2
- package/dist/services/sessions.service.d.ts +2 -1
- package/dist/services/sessions.service.js.map +1 -1
- package/dist/services/smtp.service.d.ts +11 -0
- package/dist/services/smtp.service.js +71 -0
- package/dist/services/smtp.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +20 -2
- package/src/models/interfaces/group-session.interface.ts +7 -2
- package/src/models/interfaces/smtp-api-config.interface.ts +5 -0
- package/src/models/interfaces/smtp.interface.ts +5 -0
- package/src/models/interfaces/user.interface.ts +1 -0
- package/src/models/schemas/embedded/group-session.schema.ts +4 -6
- package/src/models/schemas/embedded/time.schema.ts +18 -0
- package/src/services/sessions.service.ts +2 -1
- package/src/services/smtp.service.ts +71 -0
package/dist/index.d.ts
CHANGED
|
@@ -45,8 +45,11 @@ import { IStudentEmbedded } from './models/interfaces/student-embedded.interface
|
|
|
45
45
|
import { StudentEmbedded, StudentEmbeddedDocument, StudentEmbeddedSchema } from './models/schemas/embedded/student-embedded.schema';
|
|
46
46
|
import { ITeacher } from './models/interfaces/teacher.interface';
|
|
47
47
|
import { WeekDay } from './models/enums/week-day.enum';
|
|
48
|
-
import { IGroupSession } from './models/interfaces/group-session.interface';
|
|
48
|
+
import { IGroupSession, ITime } from './models/interfaces/group-session.interface';
|
|
49
49
|
import { GroupState } from './models/enums/group-state.enum';
|
|
50
50
|
import { GroupSessionSchema, GroupSessionDocument, GroupSession } from './models/schemas/embedded/group-session.schema';
|
|
51
51
|
import { TeacherSchema, TeacherDocument, Teacher } from './models/schemas/embedded/teacher.schema';
|
|
52
|
-
|
|
52
|
+
import { ISMTPAPIConfig } from './models/interfaces/smtp-api-config.interface';
|
|
53
|
+
import { SMTPService } from './services/smtp.service';
|
|
54
|
+
import { Time, TimeDocument, TimeSchema } from './models/schemas/embedded/time.schema';
|
|
55
|
+
export { SessionsService, DictionariesService, SMTPService, RESTError, RESTPage, RESTPaging, RESTQueryParams, RESTRequestBody, RESTResponseBody, RESTResult, RESTSort, SortDirection, IMongoPage, AccessTokenGuard, PermissionGuard, AllowPermissions, APP__PORT, APP__DEBUG, APP__ACCESS_TOKEN, APP__MONGO__CS, DL_SESSIONS__MONGO__CS, MONGO__CS, REDIS__CS, KAFKA__BROKERS, RecordState, ContactType, UserVerificationLevel, WeekDay, GroupState, I18nDTO, IIdentifable, IBase, IRecord, II18n, IDictionary, IPermission, IRole, IContact, IPerson, IResidence, ISessionUser, ISession, IUser, IParent, IGroupEmbedded, IStudentEmbedded, ITeacher, IGroupSession, ITime, ISMTPAPIConfig, Identifable, IdentifableSchema, IdentifableDocument, Base, BaseSchema, BaseDocument, Record, RecordSchema, RecordDocument, I18n, I18nSchema, I18nDocument, Residence, ResidenceSchema, ResidenceDocument, Contact, ContactSchema, ContactDocument, Person, PersonSchema, PersonDocument, DictionaryEmbedded, DictionaryEmbeddedSchema, DictionaryEmbeddedDocument, SessionUser, SessionUserSchema, SessionUserDocument, Session, SessionSchema, SessionDocument, GroupSessionSchema, GroupSessionDocument, GroupSession, TeacherSchema, TeacherDocument, Teacher, StudentEmbeddedSchema, StudentEmbeddedDocument, StudentEmbedded, TimeSchema, TimeDocument, Time, BaseExceptionsFilter, validationExceptionFactory, HandledException, IsMapOfStrings, transformers, MongoIdPipe, MongoIdsPipe, DLCommonsModule, };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.DLCommonsModule = exports.MongoIdsPipe = exports.MongoIdPipe = exports.transformers = exports.IsMapOfStrings = exports.HandledException = exports.validationExceptionFactory = exports.BaseExceptionsFilter = exports.StudentEmbedded = exports.StudentEmbeddedSchema = exports.Teacher = exports.TeacherSchema = void 0;
|
|
3
|
+
exports.GroupSessionSchema = exports.SessionSchema = exports.Session = exports.SessionUserSchema = exports.SessionUser = exports.DictionaryEmbeddedSchema = exports.DictionaryEmbedded = exports.PersonSchema = exports.Person = exports.ContactSchema = exports.Contact = exports.ResidenceSchema = exports.Residence = exports.I18nSchema = exports.I18n = exports.RecordSchema = exports.Record = exports.BaseSchema = exports.Base = exports.IdentifableSchema = exports.Identifable = exports.I18nDTO = exports.GroupState = exports.WeekDay = exports.UserVerificationLevel = exports.ContactType = exports.RecordState = exports.KAFKA__BROKERS = exports.REDIS__CS = exports.MONGO__CS = exports.DL_SESSIONS__MONGO__CS = exports.APP__MONGO__CS = exports.APP__ACCESS_TOKEN = exports.APP__DEBUG = exports.APP__PORT = exports.AllowPermissions = exports.PermissionGuard = exports.AccessTokenGuard = exports.SortDirection = exports.RESTSort = exports.RESTResult = exports.RESTResponseBody = exports.RESTRequestBody = exports.RESTQueryParams = exports.RESTPaging = exports.RESTPage = exports.RESTError = exports.SMTPService = exports.DictionariesService = exports.SessionsService = void 0;
|
|
4
|
+
exports.DLCommonsModule = exports.MongoIdsPipe = exports.MongoIdPipe = exports.transformers = exports.IsMapOfStrings = exports.HandledException = exports.validationExceptionFactory = exports.BaseExceptionsFilter = exports.Time = exports.TimeSchema = exports.StudentEmbedded = exports.StudentEmbeddedSchema = exports.Teacher = exports.TeacherSchema = exports.GroupSession = void 0;
|
|
5
5
|
const is_map_of_strings_decorator_1 = require("./decorators/is-map-of-strings.decorator");
|
|
6
6
|
Object.defineProperty(exports, "IsMapOfStrings", { enumerable: true, get: function () { return is_map_of_strings_decorator_1.IsMapOfStrings; } });
|
|
7
7
|
const dl_commons_module_1 = require("./dl-commons.module");
|
|
@@ -97,4 +97,9 @@ Object.defineProperty(exports, "GroupSession", { enumerable: true, get: function
|
|
|
97
97
|
const teacher_schema_1 = require("./models/schemas/embedded/teacher.schema");
|
|
98
98
|
Object.defineProperty(exports, "TeacherSchema", { enumerable: true, get: function () { return teacher_schema_1.TeacherSchema; } });
|
|
99
99
|
Object.defineProperty(exports, "Teacher", { enumerable: true, get: function () { return teacher_schema_1.Teacher; } });
|
|
100
|
+
const smtp_service_1 = require("./services/smtp.service");
|
|
101
|
+
Object.defineProperty(exports, "SMTPService", { enumerable: true, get: function () { return smtp_service_1.SMTPService; } });
|
|
102
|
+
const time_schema_1 = require("./models/schemas/embedded/time.schema");
|
|
103
|
+
Object.defineProperty(exports, "Time", { enumerable: true, get: function () { return time_schema_1.Time; } });
|
|
104
|
+
Object.defineProperty(exports, "TimeSchema", { enumerable: true, get: function () { return time_schema_1.TimeSchema; } });
|
|
100
105
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,0FAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,0FAA0E;AA0NtE,+FA1NK,4CAAc,OA0NL;AAzNlB,2DAAsD;AAyOlD,gGAzOK,mCAAe,OAyOL;AAxOnB,oEAAiE;AAmN7D,iGAnNK,mCAAgB,OAmNL;AAlNpB,qEAA2E;AA6MvE,2GA7MK,8CAA0B,OA6ML;AA5M9B,2EAAuE;AAuMnE,qGAvMK,4CAAoB,OAuML;AAtMxB,oEAA+D;AA+F3D,iGA/FK,qCAAgB,OA+FL;AA9FpB,gEAA8E;AAgG1E,iGAhGK,mCAAgB,OAgGL;AADhB,gGA/FuB,kCAAe,OA+FvB;AA9FnB,mEASwC;AA2FpC,0FAnGA,0BAAS,OAmGA;AACT,2FAnGA,2BAAU,OAmGA;AACV,kGAnGA,kCAAiB,OAmGA;AAGjB,0FArGA,0BAAS,OAqGA;AACT,0FArGA,0BAAS,OAqGA;AACT,+FArGA,+BAAc,OAqGA;AAJd,+FAhGA,+BAAc,OAgGA;AACd,uGAhGA,uCAAsB,OAgGA;AA9F1B,6DAAyD;AA+GrD,wFA/GK,kBAAO,OA+GL;AA9GX,kFAWmD;AAyD/C,0FAlEA,8BAAS,OAkEA;AACT,yFAlEA,6BAAQ,OAkEA;AACR,2FAlEA,+BAAU,OAkEA;AACV,gGAlEA,oCAAe,OAkE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ACP,8FA9H+B,8BAAa,OA8H/B;AA7HjB,0EAAsE;AAoBlE,oGApBK,0CAAmB,OAoBL;AAhBvB,+FAAoI;AAmIhI,gGAnIK,yCAAe,OAmIL;AAFf,sGAjI+C,+CAAqB,OAiI/C;AA/HzB,gEAAuD;AAwDnD,wFAxDK,uBAAO,OAwDL;AAtDX,sEAA6D;AAuDzD,2FAvDK,6BAAU,OAuDL;AAtDd,yFAAwH;AAsHpH,mGAtHK,yCAAkB,OAsHL;AAElB,6FAxH+C,mCAAY,OAwH/C;AAvHhB,6EAAmG;AAwH/F,8FAxHK,8BAAa,OAwHL;AAEb,wFA1HqC,wBAAO,OA0HrC;AAxHX,0DAAsD;AASlD,4FATK,0BAAW,OASL;AARf,uEAAuF;AA6HnF,qFA7HK,kBAAI,OA6HL;AAFJ,2FA3HyB,wBAAU,OA2HzB"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { WeekDay } from '../enums/week-day.enum';
|
|
2
2
|
import { II18n } from './i18n.interface';
|
|
3
3
|
import { IIdentifable } from './identifable.interface';
|
|
4
|
+
export interface ITime {
|
|
5
|
+
inString: string;
|
|
6
|
+
inNumber: number;
|
|
7
|
+
zone: string;
|
|
8
|
+
}
|
|
4
9
|
export interface IGroupSession extends IIdentifable {
|
|
5
10
|
description: II18n;
|
|
6
11
|
day: WeekDay;
|
|
7
|
-
time:
|
|
8
|
-
timeZone: string;
|
|
12
|
+
time: ITime;
|
|
9
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smtp-api-config.interface.js","sourceRoot":"","sources":["../../../src/models/interfaces/smtp-api-config.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smtp.interface.js","sourceRoot":"","sources":["../../../src/models/interfaces/smtp.interface.ts"],"names":[],"mappings":""}
|
|
@@ -8,10 +8,10 @@ export declare class Base extends Identifable implements IBase {
|
|
|
8
8
|
export declare const BaseSchema: import("mongoose").Schema<Base, import("mongoose").Model<Base, any, any, any, import("mongoose").Document<unknown, any, Base> & Base & Required<{
|
|
9
9
|
_id: import("mongoose").Types.ObjectId;
|
|
10
10
|
}> & {
|
|
11
|
-
__v
|
|
11
|
+
__v: number;
|
|
12
12
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Base, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Base>> & import("mongoose").FlatRecord<Base> & Required<{
|
|
13
13
|
_id: import("mongoose").Types.ObjectId;
|
|
14
14
|
}> & {
|
|
15
|
-
__v
|
|
15
|
+
__v: number;
|
|
16
16
|
}>;
|
|
17
17
|
export type BaseDocument = HydratedDocument<Base>;
|
|
@@ -11,10 +11,10 @@ export declare class Contact extends Identifable implements IContact {
|
|
|
11
11
|
export declare const ContactSchema: import("mongoose").Schema<Contact, import("mongoose").Model<Contact, any, any, any, import("mongoose").Document<unknown, any, Contact> & Contact & Required<{
|
|
12
12
|
_id: import("mongoose").Types.ObjectId;
|
|
13
13
|
}> & {
|
|
14
|
-
__v
|
|
14
|
+
__v: number;
|
|
15
15
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Contact, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Contact>> & import("mongoose").FlatRecord<Contact> & Required<{
|
|
16
16
|
_id: import("mongoose").Types.ObjectId;
|
|
17
17
|
}> & {
|
|
18
|
-
__v
|
|
18
|
+
__v: number;
|
|
19
19
|
}>;
|
|
20
20
|
export type ContactDocument = HydratedDocument<Contact>;
|
|
@@ -11,10 +11,10 @@ export declare class DictionaryEmbedded extends Base implements IDictionary {
|
|
|
11
11
|
export declare const DictionaryEmbeddedSchema: MongooseSchema<DictionaryEmbedded, import("mongoose").Model<DictionaryEmbedded, any, any, any, import("mongoose").Document<unknown, any, DictionaryEmbedded> & DictionaryEmbedded & Required<{
|
|
12
12
|
_id: Types.ObjectId;
|
|
13
13
|
}> & {
|
|
14
|
-
__v
|
|
14
|
+
__v: number;
|
|
15
15
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DictionaryEmbedded, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<DictionaryEmbedded>> & import("mongoose").FlatRecord<DictionaryEmbedded> & Required<{
|
|
16
16
|
_id: Types.ObjectId;
|
|
17
17
|
}> & {
|
|
18
|
-
__v
|
|
18
|
+
__v: number;
|
|
19
19
|
}>;
|
|
20
20
|
export type DictionaryEmbeddedDocument = HydratedDocument<DictionaryEmbedded>;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { HydratedDocument } from 'mongoose';
|
|
2
2
|
import { Identifable } from '../identifable.schema';
|
|
3
|
-
import { IGroupSession } from '../../interfaces/group-session.interface';
|
|
3
|
+
import { IGroupSession, ITime } from '../../interfaces/group-session.interface';
|
|
4
4
|
import { WeekDay } from '../../enums/week-day.enum';
|
|
5
5
|
import { II18n } from '../../interfaces/i18n.interface';
|
|
6
6
|
export declare class GroupSession extends Identifable implements IGroupSession {
|
|
7
7
|
description: II18n;
|
|
8
8
|
day: WeekDay;
|
|
9
|
-
time:
|
|
10
|
-
timeZone: string;
|
|
9
|
+
time: ITime;
|
|
11
10
|
}
|
|
12
11
|
export declare const GroupSessionSchema: import("mongoose").Schema<GroupSession, import("mongoose").Model<GroupSession, any, any, any, import("mongoose").Document<unknown, any, GroupSession> & GroupSession & Required<{
|
|
13
12
|
_id: import("mongoose").Types.ObjectId;
|
|
14
13
|
}> & {
|
|
15
|
-
__v
|
|
14
|
+
__v: number;
|
|
16
15
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, GroupSession, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<GroupSession>> & import("mongoose").FlatRecord<GroupSession> & Required<{
|
|
17
16
|
_id: import("mongoose").Types.ObjectId;
|
|
18
17
|
}> & {
|
|
19
|
-
__v
|
|
18
|
+
__v: number;
|
|
20
19
|
}>;
|
|
21
20
|
export type GroupSessionDocument = HydratedDocument<GroupSession>;
|
|
@@ -14,6 +14,7 @@ const mongoose_1 = require("@nestjs/mongoose");
|
|
|
14
14
|
const identifable_schema_1 = require("../identifable.schema");
|
|
15
15
|
const week_day_enum_1 = require("../../enums/week-day.enum");
|
|
16
16
|
const i18n_embedded_1 = require("./i18n.embedded");
|
|
17
|
+
const time_schema_1 = require("./time.schema");
|
|
17
18
|
let GroupSession = class GroupSession extends identifable_schema_1.Identifable {
|
|
18
19
|
};
|
|
19
20
|
exports.GroupSession = GroupSession;
|
|
@@ -26,13 +27,9 @@ __decorate([
|
|
|
26
27
|
__metadata("design:type", Number)
|
|
27
28
|
], GroupSession.prototype, "day", void 0);
|
|
28
29
|
__decorate([
|
|
29
|
-
(0, mongoose_1.Prop)({ type:
|
|
30
|
-
__metadata("design:type",
|
|
30
|
+
(0, mongoose_1.Prop)({ type: time_schema_1.Time, required: true }),
|
|
31
|
+
__metadata("design:type", Object)
|
|
31
32
|
], GroupSession.prototype, "time", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
34
|
-
__metadata("design:type", String)
|
|
35
|
-
], GroupSession.prototype, "timeZone", void 0);
|
|
36
33
|
exports.GroupSession = GroupSession = __decorate([
|
|
37
34
|
(0, mongoose_1.Schema)()
|
|
38
35
|
], GroupSession);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-session.schema.js","sourceRoot":"","sources":["../../../../src/models/schemas/embedded/group-session.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,8DAAoD;AAEpD,6DAAoD;AACpD,mDAA6C;
|
|
1
|
+
{"version":3,"file":"group-session.schema.js","sourceRoot":"","sources":["../../../../src/models/schemas/embedded/group-session.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,8DAAoD;AAEpD,6DAAoD;AACpD,mDAA6C;AAE7C,+CAAqC;AAG9B,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,gCAAW;CAS5C,CAAA;AATY,oCAAY;AAErB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,0BAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;iDACzB;AAGnB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACzC;AAGb;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,kBAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACzB;uBARH,YAAY;IADxB,IAAA,iBAAM,GAAE;GACI,YAAY,CASxB;AAEY,QAAA,kBAAkB,GAAG,wBAAa,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -8,10 +8,10 @@ export declare class I18n implements II18n {
|
|
|
8
8
|
export declare const I18nSchema: import("mongoose").Schema<I18n, import("mongoose").Model<I18n, any, any, any, import("mongoose").Document<unknown, any, I18n> & I18n & {
|
|
9
9
|
_id: import("mongoose").Types.ObjectId;
|
|
10
10
|
} & {
|
|
11
|
-
__v
|
|
11
|
+
__v: number;
|
|
12
12
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, I18n, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<I18n>> & import("mongoose").FlatRecord<I18n> & {
|
|
13
13
|
_id: import("mongoose").Types.ObjectId;
|
|
14
14
|
} & {
|
|
15
|
-
__v
|
|
15
|
+
__v: number;
|
|
16
16
|
}>;
|
|
17
17
|
export type I18nDocument = HydratedDocument<I18n>;
|
|
@@ -13,10 +13,10 @@ export declare class Person implements IPerson {
|
|
|
13
13
|
export declare const PersonSchema: import("mongoose").Schema<Person, import("mongoose").Model<Person, any, any, any, import("mongoose").Document<unknown, any, Person> & Person & {
|
|
14
14
|
_id: import("mongoose").Types.ObjectId;
|
|
15
15
|
} & {
|
|
16
|
-
__v
|
|
16
|
+
__v: number;
|
|
17
17
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Person, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Person>> & import("mongoose").FlatRecord<Person> & {
|
|
18
18
|
_id: import("mongoose").Types.ObjectId;
|
|
19
19
|
} & {
|
|
20
|
-
__v
|
|
20
|
+
__v: number;
|
|
21
21
|
}>;
|
|
22
22
|
export type PersonDocument = HydratedDocument<Person>;
|
|
@@ -11,10 +11,10 @@ export declare class Record implements IRecord {
|
|
|
11
11
|
export declare const RecordSchema: import("mongoose").Schema<Record, import("mongoose").Model<Record, any, any, any, import("mongoose").Document<unknown, any, Record> & Record & {
|
|
12
12
|
_id: import("mongoose").Types.ObjectId;
|
|
13
13
|
} & {
|
|
14
|
-
__v
|
|
14
|
+
__v: number;
|
|
15
15
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Record, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Record>> & import("mongoose").FlatRecord<Record> & {
|
|
16
16
|
_id: import("mongoose").Types.ObjectId;
|
|
17
17
|
} & {
|
|
18
|
-
__v
|
|
18
|
+
__v: number;
|
|
19
19
|
}>;
|
|
20
20
|
export type RecordDocument = HydratedDocument<Record>;
|
|
@@ -10,10 +10,10 @@ export declare class Residence implements IResidence {
|
|
|
10
10
|
export declare const ResidenceSchema: import("mongoose").Schema<Residence, import("mongoose").Model<Residence, any, any, any, import("mongoose").Document<unknown, any, Residence> & Residence & {
|
|
11
11
|
_id: import("mongoose").Types.ObjectId;
|
|
12
12
|
} & {
|
|
13
|
-
__v
|
|
13
|
+
__v: number;
|
|
14
14
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Residence, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Residence>> & import("mongoose").FlatRecord<Residence> & {
|
|
15
15
|
_id: import("mongoose").Types.ObjectId;
|
|
16
16
|
} & {
|
|
17
|
-
__v
|
|
17
|
+
__v: number;
|
|
18
18
|
}>;
|
|
19
19
|
export type ResidenceDocument = HydratedDocument<Residence>;
|
|
@@ -14,10 +14,10 @@ export declare class SessionUser implements ISessionUser {
|
|
|
14
14
|
export declare const SessionUserSchema: import("mongoose").Schema<SessionUser, import("mongoose").Model<SessionUser, any, any, any, import("mongoose").Document<unknown, any, SessionUser> & SessionUser & Required<{
|
|
15
15
|
_id: string;
|
|
16
16
|
}> & {
|
|
17
|
-
__v
|
|
17
|
+
__v: number;
|
|
18
18
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, SessionUser, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<SessionUser>> & import("mongoose").FlatRecord<SessionUser> & Required<{
|
|
19
19
|
_id: string;
|
|
20
20
|
}> & {
|
|
21
|
-
__v
|
|
21
|
+
__v: number;
|
|
22
22
|
}>;
|
|
23
23
|
export type SessionUserDocument = HydratedDocument<SessionUser>;
|
|
@@ -13,10 +13,10 @@ export declare class StudentEmbedded extends Identifable implements IStudentEmbe
|
|
|
13
13
|
export declare const StudentEmbeddedSchema: import("mongoose").Schema<StudentEmbedded, import("mongoose").Model<StudentEmbedded, any, any, any, import("mongoose").Document<unknown, any, StudentEmbedded> & StudentEmbedded & Required<{
|
|
14
14
|
_id: import("mongoose").Types.ObjectId;
|
|
15
15
|
}> & {
|
|
16
|
-
__v
|
|
16
|
+
__v: number;
|
|
17
17
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StudentEmbedded, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StudentEmbedded>> & import("mongoose").FlatRecord<StudentEmbedded> & Required<{
|
|
18
18
|
_id: import("mongoose").Types.ObjectId;
|
|
19
19
|
}> & {
|
|
20
|
-
__v
|
|
20
|
+
__v: number;
|
|
21
21
|
}>;
|
|
22
22
|
export type StudentEmbeddedDocument = HydratedDocument<StudentEmbedded>;
|
|
@@ -8,10 +8,10 @@ export declare class Teacher implements ITeacher {
|
|
|
8
8
|
export declare const TeacherSchema: MongooseSchema<Teacher, import("mongoose").Model<Teacher, any, any, any, import("mongoose").Document<unknown, any, Teacher> & Teacher & {
|
|
9
9
|
_id: Types.ObjectId;
|
|
10
10
|
} & {
|
|
11
|
-
__v
|
|
11
|
+
__v: number;
|
|
12
12
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Teacher, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Teacher>> & import("mongoose").FlatRecord<Teacher> & {
|
|
13
13
|
_id: Types.ObjectId;
|
|
14
14
|
} & {
|
|
15
|
-
__v
|
|
15
|
+
__v: number;
|
|
16
16
|
}>;
|
|
17
17
|
export type TeacherDocument = HydratedDocument<Teacher>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HydratedDocument } from 'mongoose';
|
|
2
|
+
import { ITime } from '../../interfaces/group-session.interface';
|
|
3
|
+
export declare class Time implements ITime {
|
|
4
|
+
inString: string;
|
|
5
|
+
inNumber: number;
|
|
6
|
+
zone: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TimeSchema: import("mongoose").Schema<Time, import("mongoose").Model<Time, any, any, any, import("mongoose").Document<unknown, any, Time> & Time & {
|
|
9
|
+
_id: import("mongoose").Types.ObjectId;
|
|
10
|
+
} & {
|
|
11
|
+
__v: number;
|
|
12
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Time, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Time>> & import("mongoose").FlatRecord<Time> & {
|
|
13
|
+
_id: import("mongoose").Types.ObjectId;
|
|
14
|
+
} & {
|
|
15
|
+
__v: number;
|
|
16
|
+
}>;
|
|
17
|
+
export type TimeDocument = HydratedDocument<Time>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TimeSchema = exports.Time = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
let Time = class Time {
|
|
15
|
+
};
|
|
16
|
+
exports.Time = Time;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], Time.prototype, "inString", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], Time.prototype, "inNumber", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], Time.prototype, "zone", void 0);
|
|
29
|
+
exports.Time = Time = __decorate([
|
|
30
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
31
|
+
], Time);
|
|
32
|
+
exports.TimeSchema = mongoose_1.SchemaFactory.createForClass(Time);
|
|
33
|
+
//# sourceMappingURL=time.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.schema.js","sourceRoot":"","sources":["../../../../src/models/schemas/embedded/time.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAKxD,IAAM,IAAI,GAAV,MAAM,IAAI;CAShB,CAAA;AATY,oBAAI;AAEb;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACtB;AAGjB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACtB;AAGjB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kCAC1B;eARJ,IAAI;IADhB,IAAA,iBAAM,EAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;GACV,IAAI,CAShB;AAEY,QAAA,UAAU,GAAG,wBAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -6,10 +6,10 @@ export declare class Identifable implements IIdentifable {
|
|
|
6
6
|
export declare const IdentifableSchema: MongooseSchema<Identifable, import("mongoose").Model<Identifable, any, any, any, import("mongoose").Document<unknown, any, Identifable> & Identifable & Required<{
|
|
7
7
|
_id: Types.ObjectId;
|
|
8
8
|
}> & {
|
|
9
|
-
__v
|
|
9
|
+
__v: number;
|
|
10
10
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Identifable, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Identifable>> & import("mongoose").FlatRecord<Identifable> & Required<{
|
|
11
11
|
_id: Types.ObjectId;
|
|
12
12
|
}> & {
|
|
13
|
-
__v
|
|
13
|
+
__v: number;
|
|
14
14
|
}>;
|
|
15
15
|
export type IdentifableDocument = HydratedDocument<Identifable>;
|
|
@@ -10,10 +10,10 @@ export declare class Parent implements IParent {
|
|
|
10
10
|
export declare const ParentSchema: MongooseSchema<Parent, import("mongoose").Model<Parent, any, any, any, import("mongoose").Document<unknown, any, Parent> & Parent & {
|
|
11
11
|
_id: Types.ObjectId;
|
|
12
12
|
} & {
|
|
13
|
-
__v
|
|
13
|
+
__v: number;
|
|
14
14
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Parent, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Parent>> & import("mongoose").FlatRecord<Parent> & {
|
|
15
15
|
_id: Types.ObjectId;
|
|
16
16
|
} & {
|
|
17
|
-
__v
|
|
17
|
+
__v: number;
|
|
18
18
|
}>;
|
|
19
19
|
export type ParentDocument = HydratedDocument<Parent>;
|
|
@@ -11,10 +11,10 @@ export declare class Session extends Identifable implements ISession {
|
|
|
11
11
|
export declare const SessionSchema: import("mongoose").Schema<Session, import("mongoose").Model<Session, any, any, any, import("mongoose").Document<unknown, any, Session> & Session & Required<{
|
|
12
12
|
_id: import("mongoose").Types.ObjectId;
|
|
13
13
|
}> & {
|
|
14
|
-
__v
|
|
14
|
+
__v: number;
|
|
15
15
|
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Session, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Session>> & import("mongoose").FlatRecord<Session> & Required<{
|
|
16
16
|
_id: import("mongoose").Types.ObjectId;
|
|
17
17
|
}> & {
|
|
18
|
-
__v
|
|
18
|
+
__v: number;
|
|
19
19
|
}>;
|
|
20
20
|
export type SessionDocument = HydratedDocument<Session>;
|
|
@@ -3,12 +3,13 @@ import { ConfigService } from '@nestjs/config';
|
|
|
3
3
|
import { ISession } from '../models/interfaces/session.interface';
|
|
4
4
|
import { Model } from 'mongoose';
|
|
5
5
|
import { SessionDocument } from '../models/schemas/session.schema';
|
|
6
|
+
import { Types } from 'mongoose';
|
|
6
7
|
export declare class SessionsService {
|
|
7
8
|
private readonly _sessionModel;
|
|
8
9
|
private readonly _httpService;
|
|
9
10
|
private readonly _configService;
|
|
10
11
|
private _baseUrl;
|
|
11
12
|
constructor(_sessionModel: Model<SessionDocument>, _httpService: HttpService, _configService: ConfigService);
|
|
12
|
-
create(userId: string, userAgent: string, ip: string): Promise<ISession>;
|
|
13
|
+
create(userId: string | Types.ObjectId, userAgent: string, ip: string): Promise<ISession>;
|
|
13
14
|
read(token: string): Promise<ISession>;
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.service.js","sourceRoot":"","sources":["../../src/services/sessions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAAmE;AACnE,2CAA+C;AAC/C,mFAAyF;AAEzF,+BAAsC;AACtC,uCAAiC;AACjC,qEAA4E;AAC5E,+CAA+C;
|
|
1
|
+
{"version":3,"file":"sessions.service.js","sourceRoot":"","sources":["../../src/services/sessions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAAmE;AACnE,2CAA+C;AAC/C,mFAAyF;AAEzF,+BAAsC;AACtC,uCAAiC;AACjC,qEAA4E;AAC5E,+CAA+C;AAIxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAMxB,YAEqB,aAAqC,EACrC,YAAyB,EACzB,cAA6B;QAF7B,kBAAa,GAAb,aAAa,CAAwB;QACrC,iBAAY,GAAZ,YAAY,CAAa;QACzB,mBAAc,GAAd,cAAc,CAAe;QAE9C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;IAClF,CAAC;IAIM,KAAK,CAAC,MAAM,CAAC,MAA+B,EAAE,SAAiB,EAAE,EAAU;QAC9E,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,QAAQ,gBAAgB,MAAM,EAAE,CAAC;YAC1D,MAAM,OAAO,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;YACxD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAA6B,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YAClG,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAc,EAAC,SAAS,C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|
+
import { ISMTP } from '../models/interfaces/smtp.interface';
|
|
4
|
+
export declare class SMTPService {
|
|
5
|
+
private readonly _httpService;
|
|
6
|
+
private readonly _configService;
|
|
7
|
+
private _baseUrl;
|
|
8
|
+
constructor(_httpService: HttpService, _configService: ConfigService);
|
|
9
|
+
send(subject: string, from: string, to: string, html: string, profileId: string): Promise<ISMTP>;
|
|
10
|
+
send$(subject: string, from: string, to: string, html: string, profileId: string): import("rxjs").Observable<ISMTP>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SMTPService = void 0;
|
|
13
|
+
const axios_1 = require("@nestjs/axios");
|
|
14
|
+
const config_1 = require("@nestjs/config");
|
|
15
|
+
const rxjs_1 = require("rxjs");
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const rest_wrapper_class_1 = require("../models/dtos/wrappers/rest-wrapper.class");
|
|
18
|
+
let SMTPService = class SMTPService {
|
|
19
|
+
constructor(_httpService, _configService) {
|
|
20
|
+
this._httpService = _httpService;
|
|
21
|
+
this._configService = _configService;
|
|
22
|
+
this._baseUrl = this._configService.getOrThrow('DL_SMTP__REST__BASE_URL');
|
|
23
|
+
}
|
|
24
|
+
async send(subject, from, to, html, profileId) {
|
|
25
|
+
const requestBody = {
|
|
26
|
+
data: {
|
|
27
|
+
from,
|
|
28
|
+
to: [to],
|
|
29
|
+
subject,
|
|
30
|
+
html,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const response$ = this._httpService.post(`${this._baseUrl}/v1/emails/send`, requestBody, { params: { profileId } });
|
|
34
|
+
const response = await (0, rxjs_1.firstValueFrom)(response$);
|
|
35
|
+
if (response.data.errors) {
|
|
36
|
+
throw new rest_wrapper_class_1.RESTError('smtp_api_error', response.data.errors);
|
|
37
|
+
}
|
|
38
|
+
if (!response.data || !response.data.result) {
|
|
39
|
+
throw new rest_wrapper_class_1.RESTError('smtp_api_error', 'empty response');
|
|
40
|
+
}
|
|
41
|
+
return response.data.result.data;
|
|
42
|
+
}
|
|
43
|
+
send$(subject, from, to, html, profileId) {
|
|
44
|
+
const requestBody = {
|
|
45
|
+
data: {
|
|
46
|
+
from,
|
|
47
|
+
to: [to],
|
|
48
|
+
subject,
|
|
49
|
+
html,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const response$ = this._httpService.post(`${this._baseUrl}/v1/emails/send`, requestBody, { params: { profileId } });
|
|
53
|
+
return response$.pipe((0, rxjs_1.map)((response) => {
|
|
54
|
+
if (response.data.errors) {
|
|
55
|
+
throw new rest_wrapper_class_1.RESTError('smtp_api_error', response.data.errors);
|
|
56
|
+
}
|
|
57
|
+
if (!response.data || !response.data.result) {
|
|
58
|
+
throw new rest_wrapper_class_1.RESTError('smtp_api_error', 'empty response');
|
|
59
|
+
}
|
|
60
|
+
return response.data.result.data;
|
|
61
|
+
}), (0, rxjs_1.catchError)((e) => {
|
|
62
|
+
throw new rest_wrapper_class_1.RESTError('smtp_api_error', e);
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.SMTPService = SMTPService;
|
|
67
|
+
exports.SMTPService = SMTPService = __decorate([
|
|
68
|
+
(0, common_1.Injectable)(),
|
|
69
|
+
__metadata("design:paramtypes", [axios_1.HttpService, config_1.ConfigService])
|
|
70
|
+
], SMTPService);
|
|
71
|
+
//# sourceMappingURL=smtp.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smtp.service.js","sourceRoot":"","sources":["../../src/services/smtp.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA+C;AAC/C,+BAAuD;AACvD,2CAA4C;AAC5C,mFAAyF;AAIlF,IAAM,WAAW,GAAjB,MAAM,WAAW;IAMpB,YAA6B,YAAyB,EAAmB,cAA6B;QAAzE,iBAAY,GAAZ,YAAY,CAAa;QAAmB,mBAAc,GAAd,cAAc,CAAe;QAClG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAC9E,CAAC;IAIM,KAAK,CAAC,IAAI,CAAC,OAAe,EAAE,IAAY,EAAE,EAAU,EAAE,IAAY,EAAE,SAAiB;QACxF,MAAM,WAAW,GAAG;YAChB,IAAI,EAAE;gBACF,IAAI;gBACJ,EAAE,EAAE,CAAC,EAAE,CAAC;gBACR,OAAO;gBACP,IAAI;aACP;SACJ,CAAC;QAEF,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAA0B,GAAG,IAAI,CAAC,QAAQ,iBAAiB,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAC7I,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAc,EAAC,SAAS,CAAC,CAAC;QAEjD,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACvB,MAAM,IAAI,8BAAS,CAAC,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChE,C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