dl-commons 0.0.1-testing.1 → 0.0.1-testing.2
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/dl-commons.module.d.ts +8 -0
- package/dist/dl-commons.module.js +16 -1
- package/dist/dl-commons.module.js.map +1 -1
- package/dist/guards/permission.guard.d.ts +2 -2
- package/dist/guards/permission.guard.js +24 -5
- package/dist/guards/permission.guard.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/models/consts/env-vars.const.d.ts +1 -0
- package/dist/models/consts/env-vars.const.js +2 -1
- package/dist/models/consts/env-vars.const.js.map +1 -1
- package/dist/models/interfaces/session-user.interface.d.ts +11 -0
- package/dist/models/interfaces/session-user.interface.js +3 -0
- package/dist/models/interfaces/session-user.interface.js.map +1 -0
- package/dist/models/interfaces/session.interface.d.ts +8 -0
- package/dist/models/interfaces/session.interface.js +3 -0
- package/dist/models/interfaces/session.interface.js.map +1 -0
- package/dist/models/interfaces/user.interface.d.ts +14 -0
- package/dist/models/interfaces/user.interface.js +3 -0
- package/dist/models/interfaces/user.interface.js.map +1 -0
- package/dist/models/schemas/embedded/session-user.schema.d.ts +23 -0
- package/dist/models/schemas/embedded/session-user.schema.js +48 -0
- package/dist/models/schemas/embedded/session-user.schema.js.map +1 -0
- package/dist/models/schemas/session.schema.d.ts +20 -0
- package/dist/models/schemas/session.schema.js +39 -0
- package/dist/models/schemas/session.schema.js.map +1 -0
- package/dist/services/sessions.service.d.ts +12 -1
- package/dist/services/sessions.service.js +48 -2
- package/dist/services/sessions.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -32
- package/src/dl-commons.module.ts +26 -2
- package/src/guards/permission.guard.ts +27 -30
- package/src/index.ts +14 -0
- package/src/models/consts/env-vars.const.ts +2 -0
- package/src/models/interfaces/session-user.interface.ts +12 -0
- package/src/models/interfaces/session.interface.ts +9 -0
- package/src/models/interfaces/user.interface.ts +15 -0
- package/src/models/schemas/embedded/session-user.schema.ts +32 -0
- package/src/models/schemas/session.schema.ts +24 -0
- package/src/services/sessions.service.ts +57 -2
|
@@ -10,12 +10,27 @@ exports.DLCommonsModule = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const config_1 = require("@nestjs/config");
|
|
12
12
|
const sessions_service_1 = require("./services/sessions.service");
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const env_vars_const_1 = require("./models/consts/env-vars.const");
|
|
15
|
+
const session_schema_1 = require("./models/schemas/session.schema");
|
|
16
|
+
const axios_1 = require("@nestjs/axios");
|
|
13
17
|
let DLCommonsModule = class DLCommonsModule {
|
|
14
18
|
};
|
|
15
19
|
exports.DLCommonsModule = DLCommonsModule;
|
|
16
20
|
exports.DLCommonsModule = DLCommonsModule = __decorate([
|
|
17
21
|
(0, common_1.Module)({
|
|
18
|
-
imports: [
|
|
22
|
+
imports: [
|
|
23
|
+
config_1.ConfigModule,
|
|
24
|
+
axios_1.HttpModule,
|
|
25
|
+
mongoose_1.MongooseModule.forRootAsync({
|
|
26
|
+
connectionName: 'sessions-store',
|
|
27
|
+
useFactory: async (configService) => ({
|
|
28
|
+
uri: configService.get(env_vars_const_1.DL_SESSIONS__MONGO__CS),
|
|
29
|
+
}),
|
|
30
|
+
inject: [config_1.ConfigService],
|
|
31
|
+
}),
|
|
32
|
+
mongoose_1.MongooseModule.forFeature([{ name: session_schema_1.Session.name, schema: session_schema_1.SessionSchema }], 'sessions-store'),
|
|
33
|
+
],
|
|
19
34
|
controllers: [],
|
|
20
35
|
providers: [sessions_service_1.SessionsService],
|
|
21
36
|
exports: [sessions_service_1.SessionsService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dl-commons.module.js","sourceRoot":"","sources":["../src/dl-commons.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"dl-commons.module.js","sourceRoot":"","sources":["../src/dl-commons.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA6D;AAC7D,kEAA8D;AAC9D,+CAAkD;AAClD,mEAAwE;AACxE,oEAAyE;AACzE,yCAA2C;AA4BpC,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAjB3B,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY;YACZ,kBAAU;YACV,yBAAc,CAAC,YAAY,CAAC;gBACxB,cAAc,EAAE,gBAAgB;gBAChC,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,CAAC;oBACjD,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,uCAAsB,CAAC;iBACjD,CAAC;gBACF,MAAM,EAAE,CAAC,sBAAa,CAAC;aAC1B,CAAC;YACF,yBAAc,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,wBAAO,CAAC,IAAI,EAAE,MAAM,EAAE,8BAAa,EAAE,CAAC,EAAE,gBAAgB,CAAC;SAC/F;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC7B,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
2
|
import { Reflector } from '@nestjs/core';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
3
|
import { SessionsService } from '../services/sessions.service';
|
|
5
4
|
export declare class PermissionGuardArgs {
|
|
6
5
|
keywords?: string[] | null | undefined;
|
|
@@ -11,6 +10,7 @@ export declare class PermissionGuard implements CanActivate {
|
|
|
11
10
|
private readonly _sessionsService;
|
|
12
11
|
private readonly _reflector;
|
|
13
12
|
constructor(_sessionsService: SessionsService, _reflector: Reflector);
|
|
14
|
-
canActivate(context: ExecutionContext):
|
|
13
|
+
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
15
14
|
private _getToken;
|
|
15
|
+
private _checkPermission;
|
|
16
16
|
}
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.PermissionGuard = exports.AllowPermissions = exports.PermissionGuardArgs = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const core_1 = require("@nestjs/core");
|
|
15
|
-
const rxjs_1 = require("rxjs");
|
|
16
15
|
const sessions_service_1 = require("../services/sessions.service");
|
|
17
16
|
class PermissionGuardArgs {
|
|
18
17
|
}
|
|
@@ -23,15 +22,32 @@ let PermissionGuard = class PermissionGuard {
|
|
|
23
22
|
this._sessionsService = _sessionsService;
|
|
24
23
|
this._reflector = _reflector;
|
|
25
24
|
}
|
|
26
|
-
canActivate(context) {
|
|
27
|
-
const args = this._reflector.get(
|
|
25
|
+
async canActivate(context) {
|
|
26
|
+
const args = this._reflector.get(exports.AllowPermissions, context.getHandler());
|
|
28
27
|
const request = context.switchToHttp().getRequest();
|
|
29
28
|
const token = this._getToken(request);
|
|
30
29
|
if (!token) {
|
|
31
30
|
throw new common_1.UnauthorizedException();
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const session = await this._sessionsService.read(token);
|
|
33
|
+
if (!session) {
|
|
34
|
+
throw new common_1.UnauthorizedException();
|
|
35
|
+
}
|
|
36
|
+
let isPermissionsOk = true;
|
|
37
|
+
if (args && args.keywords) {
|
|
38
|
+
isPermissionsOk = false;
|
|
39
|
+
for (let keyword of args.keywords) {
|
|
40
|
+
isPermissionsOk = this._checkPermission(session.user.permissions, keyword);
|
|
41
|
+
if (isPermissionsOk) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!isPermissionsOk) {
|
|
47
|
+
throw new common_1.ForbiddenException();
|
|
48
|
+
}
|
|
49
|
+
request.session = session;
|
|
50
|
+
return true;
|
|
35
51
|
}
|
|
36
52
|
_getToken(request) {
|
|
37
53
|
var _a;
|
|
@@ -43,6 +59,9 @@ let PermissionGuard = class PermissionGuard {
|
|
|
43
59
|
token = token.replace('Bearer ', '');
|
|
44
60
|
return token;
|
|
45
61
|
}
|
|
62
|
+
_checkPermission(userPermissions, allowedPermission) {
|
|
63
|
+
return userPermissions.some((keyword) => keyword === allowedPermission);
|
|
64
|
+
}
|
|
46
65
|
};
|
|
47
66
|
exports.PermissionGuard = PermissionGuard;
|
|
48
67
|
exports.PermissionGuard = PermissionGuard = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.guard.js","sourceRoot":"","sources":["../../src/guards/permission.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"permission.guard.js","sourceRoot":"","sources":["../../src/guards/permission.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAsH;AACtH,uCAAyC;AACzC,mEAA+D;AAE/D,MAAa,mBAAmB;CAG/B;AAHD,kDAGC;AAEY,QAAA,gBAAgB,GAAG,gBAAS,CAAC,eAAe,EAAuB,CAAC;AAG1E,IAAM,eAAe,GAArB,MAAM,eAAe;IACxB,YAA6B,gBAAiC,EAAmB,UAAqB;QAAzE,qBAAgB,GAAhB,gBAAgB,CAAiB;QAAmB,eAAU,GAAV,UAAU,CAAW;IAAG,CAAC;IAE1G,KAAK,CAAC,WAAW,CAAC,OAAyB;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAsB,wBAAgB,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAE9F,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,KAAK,GAAW,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,KAAK,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AAC,OAAO,KAAK,iBAAiB,CAAC,CAAC;IAC5E,CAAC;CACJ,CAAA;AArDY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAEsC,kCAAe,EAA+B,gBAAS;GAD7F,eAAe,CAqD3B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ import { IPerson } from './models/interfaces/person.interface';
|
|
|
21
21
|
import { IRecord } from './models/interfaces/record.interface';
|
|
22
22
|
import { IResidence } from './models/interfaces/residence.interface';
|
|
23
23
|
import { IRole } from './models/interfaces/role.interface';
|
|
24
|
+
import { ISession } from './models/interfaces/session.interface';
|
|
25
|
+
import { ISessionUser } from './models/interfaces/session-user.interface';
|
|
24
26
|
import { Base, BaseDocument, BaseSchema } from './models/schemas/base.schema';
|
|
25
27
|
import { Contact, ContactDocument, ContactSchema } from './models/schemas/embedded/contact.schema';
|
|
26
28
|
import { DictionaryEmbedded, DictionaryEmbeddedDocument, DictionaryEmbeddedSchema } from './models/schemas/embedded/dictionary-embedded.schema';
|
|
@@ -33,4 +35,7 @@ import { MongoIdPipe } from './pipes/mongo-id.pipe';
|
|
|
33
35
|
import { MongoIdsPipe } from './pipes/mongo-ids.pipe';
|
|
34
36
|
import { SessionsService } from './services/sessions.service';
|
|
35
37
|
import { transformers } from './transformers/common.transformer';
|
|
36
|
-
|
|
38
|
+
import { IUser } from './models/interfaces/user.interface';
|
|
39
|
+
import { SessionUser, SessionUserDocument, SessionUserSchema } from './models/schemas/embedded/session-user.schema';
|
|
40
|
+
import { Session, SessionDocument, SessionSchema } from './models/schemas/session.schema';
|
|
41
|
+
export { SessionsService, RESTError, RESTPage, RESTPaging, RESTQueryParams, RESTRequestBody, RESTResponseBody, RESTResult, RESTSort, SortDirection, IMongoPage, AccessTokenGuard, PermissionGuard, AllowPermissions, APP__PORT, APP__DEBUG, APP__ACCESS_TOKEN, MONGO__CS, REDIS__CS, KAFKA__BROKERS, RecordState, ContactType, UserVerificationLevel, I18nDTO, IIdentifable, IBase, IRecord, II18n, IDictionary, IPermission, IRole, IContact, IPerson, IResidence, ISessionUser, ISession, IUser, 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, BaseExceptionsFilter, validationExceptionFactory, HandledException, IsMapOfStrings, transformers, MongoIdPipe, MongoIdsPipe, DLCommonsModule, };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MongoIdsPipe = exports.MongoIdPipe = exports.transformers = exports.IsMapOfStrings = exports.HandledException = exports.validationExceptionFactory = exports.BaseExceptionsFilter = 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.UserVerificationLevel = exports.ContactType = exports.RecordState = exports.KAFKA__BROKERS = exports.REDIS__CS = exports.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.SessionsService = void 0;
|
|
4
|
+
exports.DLCommonsModule = void 0;
|
|
4
5
|
const is_map_of_strings_decorator_1 = require("./decorators/is-map-of-strings.decorator");
|
|
5
6
|
Object.defineProperty(exports, "IsMapOfStrings", { enumerable: true, get: function () { return is_map_of_strings_decorator_1.IsMapOfStrings; } });
|
|
6
7
|
const dl_commons_module_1 = require("./dl-commons.module");
|
|
@@ -73,4 +74,10 @@ const sessions_service_1 = require("./services/sessions.service");
|
|
|
73
74
|
Object.defineProperty(exports, "SessionsService", { enumerable: true, get: function () { return sessions_service_1.SessionsService; } });
|
|
74
75
|
const common_transformer_1 = require("./transformers/common.transformer");
|
|
75
76
|
Object.defineProperty(exports, "transformers", { enumerable: true, get: function () { return common_transformer_1.transformers; } });
|
|
77
|
+
const session_user_schema_1 = require("./models/schemas/embedded/session-user.schema");
|
|
78
|
+
Object.defineProperty(exports, "SessionUser", { enumerable: true, get: function () { return session_user_schema_1.SessionUser; } });
|
|
79
|
+
Object.defineProperty(exports, "SessionUserSchema", { enumerable: true, get: function () { return session_user_schema_1.SessionUserSchema; } });
|
|
80
|
+
const session_schema_1 = require("./models/schemas/session.schema");
|
|
81
|
+
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return session_schema_1.Session; } });
|
|
82
|
+
Object.defineProperty(exports, "SessionSchema", { enumerable: true, get: function () { return session_schema_1.SessionSchema; } });
|
|
76
83
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,0FAA0E;AA0KtE,+FA1KK,4CAAc,OA0KL;AAzKlB,2DAAsD;AAyLlD,gGAzLK,mCAAe,OAyLL;AAxLnB,oEAAiE;AAmK7D,iGAnKK,mCAAgB,OAmKL;AAlKpB,qEAA2E;AA6JvE,2GA7JK,8CAA0B,OA6JL;AA5J9B,2EAAuE;AAuJnE,qGAvJ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,wBAAM,OAsFL;AACN,6FAvFa,8BAAY,OAuFb;AAtFhB,iFAA2G;AA2FvG,0FA3FK,4BAAS,OA2FL;AACT,gGA5FmC,kCAAe,OA4FnC;AA3FnB,4EAA0G;AA8EtG,4FA9EK,gCAAW,OA8EL;AACX,kGA/EuC,sCAAiB,OA+EvC;AA9ErB,yDAAoD;AAwIhD,4FAxIK,2BAAW,OAwIL;AAvIf,2DAAsD;AAwIlD,6FAxIK,6BAAY,OAwIL;AAvIhB,kEAA8D;AAU1D,gGAVK,kCAAe,OAUL;AATnB,0EAAiE;AAgI7D,6FAhIK,iCAAY,OAgIL;AA9HhB,uFAAoH;AAgGhH,4FAhGK,iCAAW,OAgGL;AACX,kGAjGuC,uCAAiB,OAiGvC;AAhGrB,oEAA0F;AAkGtF,wFAlGK,wBAAO,OAkGL;AACP,8FAnG+B,8BAAa,OAmG/B"}
|
|
@@ -4,3 +4,4 @@ export declare const APP__ACCESS_TOKEN = "APP__ACCESS_TOKEN";
|
|
|
4
4
|
export declare const MONGO__CS = "MONGO__CS";
|
|
5
5
|
export declare const REDIS__CS = "REDIS__CS";
|
|
6
6
|
export declare const KAFKA__BROKERS = "KAFKA__BROKERS";
|
|
7
|
+
export declare const DL_SESSIONS__MONGO__CS = "DL_SESSIONS__MONGO__CS";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KAFKA__BROKERS = exports.REDIS__CS = exports.MONGO__CS = exports.APP__ACCESS_TOKEN = exports.APP__DEBUG = exports.APP__PORT = void 0;
|
|
3
|
+
exports.DL_SESSIONS__MONGO__CS = exports.KAFKA__BROKERS = exports.REDIS__CS = exports.MONGO__CS = exports.APP__ACCESS_TOKEN = exports.APP__DEBUG = exports.APP__PORT = void 0;
|
|
4
4
|
exports.APP__PORT = 'APP__PORT';
|
|
5
5
|
exports.APP__DEBUG = 'APP__DEBUG';
|
|
6
6
|
exports.APP__ACCESS_TOKEN = 'APP__ACCESS_TOKEN';
|
|
7
7
|
exports.MONGO__CS = 'MONGO__CS';
|
|
8
8
|
exports.REDIS__CS = 'REDIS__CS';
|
|
9
9
|
exports.KAFKA__BROKERS = 'KAFKA__BROKERS';
|
|
10
|
+
exports.DL_SESSIONS__MONGO__CS = 'DL_SESSIONS__MONGO__CS';
|
|
10
11
|
//# sourceMappingURL=env-vars.const.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-vars.const.js","sourceRoot":"","sources":["../../../src/models/consts/env-vars.const.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,cAAc,GAAG,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"env-vars.const.js","sourceRoot":"","sources":["../../../src/models/consts/env-vars.const.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAElC,QAAA,sBAAsB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UserVerificationLevel } from '../enums/user-verifiation-level.enum';
|
|
2
|
+
import { IContact } from './contact.interface';
|
|
3
|
+
import { IPerson } from './person.interface';
|
|
4
|
+
export interface ISessionUser {
|
|
5
|
+
_id: string;
|
|
6
|
+
username: string;
|
|
7
|
+
person: IPerson;
|
|
8
|
+
contacts: IContact[];
|
|
9
|
+
permissions: string[];
|
|
10
|
+
verificationLevel: UserVerificationLevel;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-user.interface.js","sourceRoot":"","sources":["../../../src/models/interfaces/session-user.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.interface.js","sourceRoot":"","sources":["../../../src/models/interfaces/session.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UserVerificationLevel } from '../enums/user-verifiation-level.enum';
|
|
2
|
+
import { IBase } from './base.interface';
|
|
3
|
+
import { IContact } from './contact.interface';
|
|
4
|
+
import { IPerson } from './person.interface';
|
|
5
|
+
import { IRole } from './role.interface';
|
|
6
|
+
export interface IUser extends IBase {
|
|
7
|
+
username: string;
|
|
8
|
+
password: string;
|
|
9
|
+
salt: string;
|
|
10
|
+
person: IPerson;
|
|
11
|
+
contacts: IContact[];
|
|
12
|
+
roles: IRole[];
|
|
13
|
+
verificationLevel: UserVerificationLevel;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.interface.js","sourceRoot":"","sources":["../../../src/models/interfaces/user.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HydratedDocument } from 'mongoose';
|
|
2
|
+
import { UserVerificationLevel } from '../../enums/user-verifiation-level.enum';
|
|
3
|
+
import { IContact } from '../../interfaces/contact.interface';
|
|
4
|
+
import { IPerson } from '../../interfaces/person.interface';
|
|
5
|
+
import { ISessionUser } from '../../interfaces/session-user.interface';
|
|
6
|
+
export declare class SessionUser implements ISessionUser {
|
|
7
|
+
_id: string;
|
|
8
|
+
username: string;
|
|
9
|
+
person: IPerson;
|
|
10
|
+
contacts: IContact[];
|
|
11
|
+
permissions: string[];
|
|
12
|
+
verificationLevel: UserVerificationLevel;
|
|
13
|
+
}
|
|
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
|
+
_id: string;
|
|
16
|
+
}> & {
|
|
17
|
+
__v?: number;
|
|
18
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, SessionUser, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<SessionUser>> & import("mongoose").FlatRecord<SessionUser> & Required<{
|
|
19
|
+
_id: string;
|
|
20
|
+
}> & {
|
|
21
|
+
__v?: number;
|
|
22
|
+
}>;
|
|
23
|
+
export type SessionUserDocument = HydratedDocument<SessionUser>;
|
|
@@ -0,0 +1,48 @@
|
|
|
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.SessionUserSchema = exports.SessionUser = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const user_verifiation_level_enum_1 = require("../../enums/user-verifiation-level.enum");
|
|
15
|
+
const contact_schema_1 = require("./contact.schema");
|
|
16
|
+
const person_schema_1 = require("./person.schema");
|
|
17
|
+
let SessionUser = class SessionUser {
|
|
18
|
+
};
|
|
19
|
+
exports.SessionUser = SessionUser;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, mongoose_1.Prop)({ required: true, type: String }),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], SessionUser.prototype, "_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ required: true, type: String }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], SessionUser.prototype, "username", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, mongoose_1.Prop)({ type: person_schema_1.PersonSchema, required: true }),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], SessionUser.prototype, "person", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, mongoose_1.Prop)({ type: [contact_schema_1.ContactSchema], required: true, default: [] }),
|
|
34
|
+
__metadata("design:type", Array)
|
|
35
|
+
], SessionUser.prototype, "contacts", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, mongoose_1.Prop)({ type: [String], required: true, default: [] }),
|
|
38
|
+
__metadata("design:type", Array)
|
|
39
|
+
], SessionUser.prototype, "permissions", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ type: String, enum: user_verifiation_level_enum_1.UserVerificationLevel, required: true, default: user_verifiation_level_enum_1.UserVerificationLevel.None }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], SessionUser.prototype, "verificationLevel", void 0);
|
|
44
|
+
exports.SessionUser = SessionUser = __decorate([
|
|
45
|
+
(0, mongoose_1.Schema)({ id: false })
|
|
46
|
+
], SessionUser);
|
|
47
|
+
exports.SessionUserSchema = mongoose_1.SchemaFactory.createForClass(SessionUser);
|
|
48
|
+
//# sourceMappingURL=session-user.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-user.schema.js","sourceRoot":"","sources":["../../../../src/models/schemas/embedded/session-user.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,yFAAgF;AAIhF,qDAAiD;AACjD,mDAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAkBvB,CAAA;AAlBY,kCAAW;AAEpB;IADC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCAC3B;AAGZ;IADC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACtB;AAGjB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,4BAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAGhB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,CAAC,8BAAa,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;6CACxC;AAGrB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gDAChC;AAGtB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mDAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,mDAAqB,CAAC,IAAI,EAAE,CAAC;;sDAChE;sBAjBhC,WAAW;IADvB,IAAA,iBAAM,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;GACT,WAAW,CAkBvB;AAEY,QAAA,iBAAiB,GAAG,wBAAa,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HydratedDocument } from 'mongoose';
|
|
2
|
+
import { ISessionUser } from '../interfaces/session-user.interface';
|
|
3
|
+
import { ISession } from '../interfaces/session.interface';
|
|
4
|
+
import { Identifable } from './identifable.schema';
|
|
5
|
+
export declare class Session extends Identifable implements ISession {
|
|
6
|
+
token: string;
|
|
7
|
+
user: ISessionUser;
|
|
8
|
+
expiresAt: Date;
|
|
9
|
+
userAgent: string;
|
|
10
|
+
}
|
|
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
|
+
_id: import("mongoose").Types.ObjectId;
|
|
13
|
+
}> & {
|
|
14
|
+
__v?: number;
|
|
15
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Session, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Session>> & import("mongoose").FlatRecord<Session> & Required<{
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
}> & {
|
|
18
|
+
__v?: number;
|
|
19
|
+
}>;
|
|
20
|
+
export type SessionDocument = HydratedDocument<Session>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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.SessionSchema = exports.Session = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const session_user_schema_1 = require("./embedded/session-user.schema");
|
|
15
|
+
const identifable_schema_1 = require("./identifable.schema");
|
|
16
|
+
let Session = class Session extends identifable_schema_1.Identifable {
|
|
17
|
+
};
|
|
18
|
+
exports.Session = Session;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, mongoose_1.Prop)({ type: String, unique: true, required: true }),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], Session.prototype, "token", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, mongoose_1.Prop)({ type: session_user_schema_1.SessionUserSchema, required: true }),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], Session.prototype, "user", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
29
|
+
__metadata("design:type", Date)
|
|
30
|
+
], Session.prototype, "expiresAt", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Session.prototype, "userAgent", void 0);
|
|
35
|
+
exports.Session = Session = __decorate([
|
|
36
|
+
(0, mongoose_1.Schema)()
|
|
37
|
+
], Session);
|
|
38
|
+
exports.SessionSchema = mongoose_1.SchemaFactory.createForClass(Session);
|
|
39
|
+
//# sourceMappingURL=session.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.schema.js","sourceRoot":"","sources":["../../../src/models/schemas/session.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAI/D,wEAAmE;AACnE,6DAAmD;AAG5C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,gCAAW;CAYvC,CAAA;AAZY,0BAAO;AAEhB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACvC;AAGd;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,uCAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCAC/B;AAGnB;IADC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACd,IAAI;0CAAC;AAGhB;IADC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACP;kBAXT,OAAO;IADnB,IAAA,iBAAM,GAAE;GACI,OAAO,CAYnB;AAEY,QAAA,aAAa,GAAG,wBAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import { ISession } from '../models/interfaces/session.interface';
|
|
4
|
+
import { Model } from 'mongoose';
|
|
5
|
+
import { SessionDocument } from '../models/schemas/session.schema';
|
|
1
6
|
export declare class SessionsService {
|
|
2
|
-
|
|
7
|
+
private readonly _sessionModel;
|
|
8
|
+
private readonly _httpService;
|
|
9
|
+
private readonly _configService;
|
|
10
|
+
private _baseUrl;
|
|
11
|
+
constructor(_sessionModel: Model<SessionDocument>, _httpService: HttpService, _configService: ConfigService);
|
|
12
|
+
create(userId: string, userAgent: string, ip: string): Promise<ISession>;
|
|
13
|
+
read(token: string): Promise<ISession>;
|
|
3
14
|
}
|
|
@@ -8,15 +8,61 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.SessionsService = void 0;
|
|
16
|
+
const axios_1 = require("@nestjs/axios");
|
|
13
17
|
const common_1 = require("@nestjs/common");
|
|
18
|
+
const config_1 = require("@nestjs/config");
|
|
19
|
+
const rest_wrapper_class_1 = require("../models/dtos/wrappers/rest-wrapper.class");
|
|
20
|
+
const rxjs_1 = require("rxjs");
|
|
21
|
+
const mongoose_1 = require("mongoose");
|
|
22
|
+
const session_schema_1 = require("../models/schemas/session.schema");
|
|
23
|
+
const mongoose_2 = require("@nestjs/mongoose");
|
|
14
24
|
let SessionsService = class SessionsService {
|
|
15
|
-
constructor() {
|
|
25
|
+
constructor(_sessionModel, _httpService, _configService) {
|
|
26
|
+
this._sessionModel = _sessionModel;
|
|
27
|
+
this._httpService = _httpService;
|
|
28
|
+
this._configService = _configService;
|
|
29
|
+
this._baseUrl = this._configService.getOrThrow('DL_SESSIONS__REST__BASE_URL');
|
|
30
|
+
}
|
|
31
|
+
async create(userId, userAgent, ip) {
|
|
32
|
+
try {
|
|
33
|
+
const endpoint = `${this._baseUrl}/v1/sessions/${userId}`;
|
|
34
|
+
const headers = { 'user-agent': userAgent, 'x-ip': ip };
|
|
35
|
+
const response$ = this._httpService.post(endpoint, null, { headers });
|
|
36
|
+
const response = await (0, rxjs_1.firstValueFrom)(response$);
|
|
37
|
+
if (response.data.errors) {
|
|
38
|
+
throw new rest_wrapper_class_1.RESTError('sessions_api_error', response.data.errors);
|
|
39
|
+
}
|
|
40
|
+
if (!response.data || !response.data.result) {
|
|
41
|
+
throw new rest_wrapper_class_1.RESTError('sessions_api_error', 'empty response');
|
|
42
|
+
}
|
|
43
|
+
return response.data.result.data;
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
throw rest_wrapper_class_1.RESTError.createFromCatch(e, { keyword: 'unknown', debug: e });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async read(token) {
|
|
50
|
+
if (!token) {
|
|
51
|
+
throw new common_1.UnauthorizedException();
|
|
52
|
+
}
|
|
53
|
+
const session = await this._sessionModel.findOne({ token });
|
|
54
|
+
if (!session) {
|
|
55
|
+
throw new common_1.UnauthorizedException();
|
|
56
|
+
}
|
|
57
|
+
return session;
|
|
58
|
+
}
|
|
16
59
|
};
|
|
17
60
|
exports.SessionsService = SessionsService;
|
|
18
61
|
exports.SessionsService = SessionsService = __decorate([
|
|
19
62
|
(0, common_1.Injectable)(),
|
|
20
|
-
|
|
63
|
+
__param(0, (0, mongoose_2.InjectModel)(session_schema_1.Session.name, 'sessions-store')),
|
|
64
|
+
__metadata("design:paramtypes", [mongoose_1.Model,
|
|
65
|
+
axios_1.HttpService,
|
|
66
|
+
config_1.ConfigService])
|
|
21
67
|
], SessionsService);
|
|
22
68
|
//# sourceMappingURL=sessions.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.service.js","sourceRoot":"","sources":["../../src/services/sessions.service.ts"],"names":[],"mappings":"
|
|
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;AAGxC,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,MAAc,EAAE,SAAiB,EAAE,EAAU;QAC7D,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,QAAQ,gBAAgB,MAAM,EAAE,CAAC;YAC1D,MAAM,OAAO,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM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