@aldb2b/common 1.0.838 → 1.0.840
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/db/auditTrail/interfaces/Audit-trail-input.interface.d.ts +7 -0
- package/build/entities/entities.module.d.ts +2 -0
- package/build/entities/models/common/entities/audit-trail.entity.d.ts +75 -0
- package/build/entities/models/common/entities/audit-trail.entity.js +106 -0
- package/build/entities/models/common/entities/audit-trail.entity.js.map +1 -0
- package/build/entities/models/companies/entities/company.entity.d.ts +73 -0
- package/build/entities/models/companies/entities/company.entity.js +58 -0
- package/build/entities/models/companies/entities/company.entity.js.map +1 -0
- package/build/entities/models/companies/entities/contact.entity.d.ts +70 -0
- package/build/entities/models/companies/entities/contact.entity.js +52 -0
- package/build/entities/models/companies/entities/contact.entity.js.map +1 -0
- package/build/entities/models/events/entities/event/event.entity.d.ts +89 -0
- package/build/entities/models/events/entities/event/event.entity.js +169 -0
- package/build/entities/models/events/entities/event/event.entity.js.map +1 -0
- package/build/entities/models/events/entities/eventProfile/event-profile.entity.d.ts +66 -0
- package/build/entities/models/events/entities/eventProfile/event-profile.entity.js +59 -0
- package/build/entities/models/events/entities/eventProfile/event-profile.entity.js.map +1 -0
- package/build/entities/models/events/entities/eventType/event-type.entity.d.ts +64 -0
- package/build/entities/models/events/entities/eventType/event-type.entity.js +57 -0
- package/build/entities/models/events/entities/eventType/event-type.entity.js.map +1 -0
- package/build/entities/models/meetings/entities/meetingRequests/meeting-request.entity.d.ts +96 -0
- package/build/entities/models/meetings/entities/meetingRequests/meeting-request.entity.js +291 -0
- package/build/entities/models/meetings/entities/meetingRequests/meeting-request.entity.js.map +1 -0
- package/build/entities/models/meetings/entities/meetings/meeting.entity.d.ts +106 -0
- package/build/entities/models/meetings/entities/meetings/meeting.entity.js +346 -0
- package/build/entities/models/meetings/entities/meetings/meeting.entity.js.map +1 -0
- package/build/entities/models/meetings/entities/userAvailabilities/user-availability.entity.d.ts +78 -0
- package/build/entities/models/meetings/entities/userAvailabilities/user-availability.entity.js +126 -0
- package/build/entities/models/meetings/entities/userAvailabilities/user-availability.entity.js.map +1 -0
- package/build/entities/models/model.providers.d.ts +112 -0
- package/build/entities/models/users/entities/rolePermissions/role-permission.entity.d.ts +67 -0
- package/build/entities/models/users/entities/rolePermissions/role-permission.entity.js +101 -0
- package/build/entities/models/users/entities/rolePermissions/role-permission.entity.js.map +1 -0
- package/build/entities/models/users/entities/users/user.entity.d.ts +96 -0
- package/build/entities/models/users/entities/users/user.entity.js +192 -0
- package/build/entities/models/users/entities/users/user.entity.js.map +1 -0
- package/build/events/create-company-event.interface.d.ts +12 -0
- package/build/events/create-company.interface.d.ts +18 -0
- package/build/events/create-contact.interface.d.ts +24 -0
- package/build/events/create-meeting-event.interface.d.ts +12 -0
- package/build/events/create-notification-event.interface.d.ts +12 -0
- package/build/events/create-subscription-event.interface.d.ts +16 -0
- package/build/events/sync-event-with-notification.interface.d.ts +12 -0
- package/build/events/sync-subscription-event.interface.d.ts +12 -0
- package/build/index.d.ts +285 -0
- package/build/index.js +302 -0
- package/build/index.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/validators/validateNewItem.d.ts +1 -0
- package/build/validators/validateNewItem.js +24 -0
- package/build/validators/validateNewItem.js.map +1 -0
- package/build/validators/validateProjection.d.ts +1 -0
- package/build/validators/validateProjection.js +33 -0
- package/build/validators/validateProjection.js.map +1 -0
- package/build/validators/validateProjectionResult.d.ts +1 -0
- package/build/validators/validateProjectionResult.js +37 -0
- package/build/validators/validateProjectionResult.js.map +1 -0
- package/build/validators/validateUpdateItem.d.ts +1 -0
- package/build/validators/validateUpdateItem.js +24 -0
- package/build/validators/validateUpdateItem.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/aggregate" />
|
|
26
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/callback" />
|
|
27
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/collection" />
|
|
28
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/connection" />
|
|
29
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/cursor" />
|
|
30
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/document" />
|
|
31
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/error" />
|
|
32
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/expressions" />
|
|
33
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/helpers" />
|
|
34
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/middlewares" />
|
|
35
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/indexes" />
|
|
36
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/models" />
|
|
37
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/mongooseoptions" />
|
|
38
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/pipelinestage" />
|
|
39
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/populate" />
|
|
40
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/query" />
|
|
41
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schemaoptions" />
|
|
42
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schematypes" />
|
|
43
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/session" />
|
|
44
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/types" />
|
|
45
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/utility" />
|
|
46
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/validation" />
|
|
47
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/virtuals" />
|
|
48
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose" />
|
|
49
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
50
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
51
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/inferschematype" />
|
|
52
|
+
export declare const modelProviders: ({
|
|
53
|
+
provide: import("../..").DatabaseModel;
|
|
54
|
+
useFactory: (connection: import("mongoose").Connection) => import("mongoose").Model<import("./events").EventType, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./events").EventType> & import("./events").EventType & Required<{
|
|
55
|
+
_id: string;
|
|
56
|
+
}>, any>;
|
|
57
|
+
inject: import("../..").DatabaseConnection[];
|
|
58
|
+
} | {
|
|
59
|
+
provide: import("../..").DatabaseModel;
|
|
60
|
+
useFactory: (connection: import("mongoose").Connection) => import("mongoose").Model<import("./events").EventProfile, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./events").EventProfile> & import("./events").EventProfile & Required<{
|
|
61
|
+
_id: string;
|
|
62
|
+
}>, any>;
|
|
63
|
+
inject: import("../..").DatabaseConnection[];
|
|
64
|
+
} | {
|
|
65
|
+
provide: import("../..").DatabaseModel;
|
|
66
|
+
useFactory: (connection: import("mongoose").Connection, companyConnection: import("mongoose").Connection, userConnection: import("mongoose").Connection) => import("mongoose").Model<import("./events").Event, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./events").Event> & import("./events").Event & Required<{
|
|
67
|
+
_id: string;
|
|
68
|
+
}>, any>;
|
|
69
|
+
inject: import("../..").DatabaseConnection[];
|
|
70
|
+
} | {
|
|
71
|
+
provide: import("../..").DatabaseModel;
|
|
72
|
+
useFactory: (connection: import("mongoose").Connection, eventConnection: import("mongoose").Connection) => import("mongoose").Model<import("./companies").Company, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./companies").Company> & import("./companies").Company & Required<{
|
|
73
|
+
_id: string;
|
|
74
|
+
}>, any>;
|
|
75
|
+
inject: import("../..").DatabaseConnection[];
|
|
76
|
+
} | {
|
|
77
|
+
provide: import("../..").DatabaseModel;
|
|
78
|
+
useFactory: (connection: import("mongoose").Connection, eventConnection: import("mongoose").Connection) => import("mongoose").Model<import("./companies").Contact, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./companies").Contact> & import("./companies").Contact & Required<{
|
|
79
|
+
_id: string;
|
|
80
|
+
}>, any>;
|
|
81
|
+
inject: import("../..").DatabaseConnection[];
|
|
82
|
+
} | {
|
|
83
|
+
provide: import("../..").DatabaseModel;
|
|
84
|
+
useFactory: (connection: import("mongoose").Connection) => import("mongoose").Model<import("./users").RolePermission, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./users").RolePermission> & import("./users").RolePermission & Required<{
|
|
85
|
+
_id: string;
|
|
86
|
+
}>, any>;
|
|
87
|
+
inject: import("../..").DatabaseConnection[];
|
|
88
|
+
} | {
|
|
89
|
+
provide: import("../..").DatabaseModel;
|
|
90
|
+
useFactory: (connection: import("mongoose").Connection, companyConnection: import("mongoose").Connection, eventConnection: import("mongoose").Connection) => import("mongoose").Model<import("./users").User, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./users").User> & import("./users").User & Required<{
|
|
91
|
+
_id: string;
|
|
92
|
+
}>, any>;
|
|
93
|
+
inject: import("../..").DatabaseConnection[];
|
|
94
|
+
} | {
|
|
95
|
+
provide: import("../..").DatabaseModel;
|
|
96
|
+
useFactory: (connection: import("mongoose").Connection, companyConnection: import("mongoose").Connection, eventConnection: import("mongoose").Connection) => import("mongoose").Model<import("./meetings").Meeting, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./meetings").Meeting> & import("./meetings").Meeting & Required<{
|
|
97
|
+
_id: string;
|
|
98
|
+
}>, any>;
|
|
99
|
+
inject: import("../..").DatabaseConnection[];
|
|
100
|
+
} | {
|
|
101
|
+
provide: import("../..").DatabaseModel;
|
|
102
|
+
useFactory: (connection: import("mongoose").Connection, companyConnection: import("mongoose").Connection, eventConnection: import("mongoose").Connection) => import("mongoose").Model<import("./meetings").MeetingRequest, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./meetings").MeetingRequest> & import("./meetings").MeetingRequest & Required<{
|
|
103
|
+
_id: string;
|
|
104
|
+
}>, any>;
|
|
105
|
+
inject: import("../..").DatabaseConnection[];
|
|
106
|
+
} | {
|
|
107
|
+
provide: import("../..").DatabaseModel;
|
|
108
|
+
useFactory: (connection: import("mongoose").Connection, companyConnection: import("mongoose").Connection, eventConnection: import("mongoose").Connection) => import("mongoose").Model<import("./meetings").UserAvailability, {}, {}, {}, import("mongoose").Document<unknown, {}, import("./meetings").UserAvailability> & import("./meetings").UserAvailability & Required<{
|
|
109
|
+
_id: string;
|
|
110
|
+
}>, any>;
|
|
111
|
+
inject: import("../..").DatabaseConnection[];
|
|
112
|
+
})[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/aggregate" />
|
|
25
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/callback" />
|
|
26
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/collection" />
|
|
27
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/connection" />
|
|
28
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/cursor" />
|
|
29
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/document" />
|
|
30
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/error" />
|
|
31
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/expressions" />
|
|
32
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/helpers" />
|
|
33
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/middlewares" />
|
|
34
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/indexes" />
|
|
35
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/models" />
|
|
36
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/mongooseoptions" />
|
|
37
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/pipelinestage" />
|
|
38
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/populate" />
|
|
39
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/query" />
|
|
40
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schemaoptions" />
|
|
41
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schematypes" />
|
|
42
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/session" />
|
|
43
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/types" />
|
|
44
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/utility" />
|
|
45
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/validation" />
|
|
46
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/virtuals" />
|
|
47
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose" />
|
|
48
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
49
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
50
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/inferschematype" />
|
|
51
|
+
import { Connection } from 'mongoose';
|
|
52
|
+
import { Permission } from './permission.entity';
|
|
53
|
+
import { UserRole } from '../../../../../types/user-role.enum';
|
|
54
|
+
import { UserType } from '../../../../../types/user-type.enum';
|
|
55
|
+
import { CustomModel } from '../../../../../db/CustomModel';
|
|
56
|
+
export type RolePermissionModel = CustomModel<RolePermission>;
|
|
57
|
+
export declare class RolePermission {
|
|
58
|
+
_id: string;
|
|
59
|
+
title: UserRole;
|
|
60
|
+
type: UserType;
|
|
61
|
+
permissions: Permission[];
|
|
62
|
+
createdAt: Date;
|
|
63
|
+
updatedAt: Date;
|
|
64
|
+
}
|
|
65
|
+
export declare const rolePermissionFactory: (connection: Connection) => import("mongoose").Model<RolePermission, {}, {}, {}, import("mongoose").Document<unknown, {}, RolePermission> & RolePermission & Required<{
|
|
66
|
+
_id: string;
|
|
67
|
+
}>, any>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rolePermissionFactory = exports.RolePermission = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const validateProjectionResult_1 = require("../../../../../validators/validateProjectionResult");
|
|
6
|
+
const validateProjection_1 = require("../../../../../validators/validateProjection");
|
|
7
|
+
const validateNewItem_1 = require("../../../../../validators/validateNewItem");
|
|
8
|
+
const validateUpdateItem_1 = require("../../../../../validators/validateUpdateItem");
|
|
9
|
+
const permission_entity_1 = require("./permission.entity");
|
|
10
|
+
const generate_model_1 = require("../../../../../entities/services/generate-model");
|
|
11
|
+
const user_role_enum_1 = require("../../../../../types/user-role.enum");
|
|
12
|
+
const user_type_enum_1 = require("../../../../../types/user-type.enum");
|
|
13
|
+
class RolePermission {
|
|
14
|
+
}
|
|
15
|
+
exports.RolePermission = RolePermission;
|
|
16
|
+
const rolePermissionFactory = (connection) => {
|
|
17
|
+
const rolePermissionSchema = new mongoose_1.Schema({
|
|
18
|
+
title: {
|
|
19
|
+
type: String,
|
|
20
|
+
enum: Object.values(user_role_enum_1.UserRole),
|
|
21
|
+
required: true,
|
|
22
|
+
validate: [
|
|
23
|
+
function validateRoleType() {
|
|
24
|
+
let enumValues;
|
|
25
|
+
if (this.type == user_type_enum_1.UserType.ADMIN) {
|
|
26
|
+
enumValues = [
|
|
27
|
+
user_role_enum_1.UserRole.ADMIN,
|
|
28
|
+
user_role_enum_1.UserRole.MANAGER,
|
|
29
|
+
user_role_enum_1.UserRole.OPERATION,
|
|
30
|
+
user_role_enum_1.UserRole.ONGROUND,
|
|
31
|
+
user_role_enum_1.UserRole.EDITOR,
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
else if (this.type == user_type_enum_1.UserType.ORGANIZER) {
|
|
35
|
+
enumValues = [
|
|
36
|
+
user_role_enum_1.UserRole.ADMIN,
|
|
37
|
+
user_role_enum_1.UserRole.MANAGER,
|
|
38
|
+
user_role_enum_1.UserRole.OPERATION,
|
|
39
|
+
user_role_enum_1.UserRole.ONGROUND,
|
|
40
|
+
user_role_enum_1.UserRole.VIEWER,
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
else if (this.type == user_type_enum_1.UserType.USER) {
|
|
44
|
+
enumValues = [user_role_enum_1.UserRole.USER, user_role_enum_1.UserRole.ADMIN];
|
|
45
|
+
}
|
|
46
|
+
if (enumValues.includes(this.title)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
'Role title is incorrect',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
type: {
|
|
57
|
+
type: String,
|
|
58
|
+
enum: Object.values(user_type_enum_1.UserType),
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
permissions: [{ type: permission_entity_1.PermissionSchema, required: true }],
|
|
62
|
+
createdAt: { type: Date, required: true, default: Date.now },
|
|
63
|
+
updatedAt: { type: Date, required: true, default: Date.now },
|
|
64
|
+
});
|
|
65
|
+
const allProjectionFieldArray = [
|
|
66
|
+
'_id',
|
|
67
|
+
'title',
|
|
68
|
+
'permissions',
|
|
69
|
+
'type',
|
|
70
|
+
'createdAt',
|
|
71
|
+
'updatedAt',
|
|
72
|
+
];
|
|
73
|
+
const allValidateNewItemFieldArray = [
|
|
74
|
+
'_id',
|
|
75
|
+
'title',
|
|
76
|
+
'permissions',
|
|
77
|
+
'type',
|
|
78
|
+
'createdAt',
|
|
79
|
+
'updatedAt',
|
|
80
|
+
];
|
|
81
|
+
const allValidateUpdateItemFieldArray = [
|
|
82
|
+
'_id',
|
|
83
|
+
'title',
|
|
84
|
+
'permissions',
|
|
85
|
+
'type',
|
|
86
|
+
'createdAt',
|
|
87
|
+
'updatedAt',
|
|
88
|
+
];
|
|
89
|
+
rolePermissionSchema.statics.validateProjectionResult =
|
|
90
|
+
necessaryProjectionObj => (0, validateProjectionResult_1.validateProjectionResult)(allProjectionFieldArray, necessaryProjectionObj);
|
|
91
|
+
rolePermissionSchema.statics.validateProjection = necessaryProjectionArray => (0, validateProjection_1.validateProjection)(allProjectionFieldArray, necessaryProjectionArray);
|
|
92
|
+
rolePermissionSchema.statics.validateNewItem = newItemObj => (0, validateNewItem_1.validateNewItem)(allValidateNewItemFieldArray, newItemObj);
|
|
93
|
+
rolePermissionSchema.statics.validateUpdateItem = updateItemObj => (0, validateUpdateItem_1.validateUpdateItem)(allValidateUpdateItemFieldArray, updateItemObj);
|
|
94
|
+
rolePermissionSchema.pre('findOneAndUpdate', async function (next) {
|
|
95
|
+
this._update.updatedAt = new Date();
|
|
96
|
+
next();
|
|
97
|
+
});
|
|
98
|
+
return (0, generate_model_1.generateModel)('RolePermission', connection, rolePermissionSchema);
|
|
99
|
+
};
|
|
100
|
+
exports.rolePermissionFactory = rolePermissionFactory;
|
|
101
|
+
//# sourceMappingURL=role-permission.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role-permission.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/users/entities/rolePermissions/role-permission.entity.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,iGAA6F;AAC7F,qFAAiF;AACjF,+EAA2E;AAC3E,qFAAiF;AACjF,2DAAkE;AAClE,oFAA+E;AAC/E,wEAA8D;AAC9D,wEAA8D;AAK9D,MAAa,cAAc;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AoB,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,WAAiB,IAAI;QAGrE,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAA;QACnC,IAAI,EAAE,CAAA;IACR,CAAC,CAAC,CAAA;IAEF,OAAO,IAAA,8BAAa,EAClB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,CACrB,CAAA;AACH,CAAC,CAAA;AAnGY,QAAA,qBAAqB,yBAmGjC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/aggregate" />
|
|
25
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/callback" />
|
|
26
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/collection" />
|
|
27
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/connection" />
|
|
28
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/cursor" />
|
|
29
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/document" />
|
|
30
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/error" />
|
|
31
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/expressions" />
|
|
32
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/helpers" />
|
|
33
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/middlewares" />
|
|
34
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/indexes" />
|
|
35
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/models" />
|
|
36
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/mongooseoptions" />
|
|
37
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/pipelinestage" />
|
|
38
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/populate" />
|
|
39
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/query" />
|
|
40
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schemaoptions" />
|
|
41
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/schematypes" />
|
|
42
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/session" />
|
|
43
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/types" />
|
|
44
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/utility" />
|
|
45
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/validation" />
|
|
46
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/virtuals" />
|
|
47
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose" />
|
|
48
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
49
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
50
|
+
/// <reference types="@aldb2b/common/node_modules/mongoose/types/inferschematype" />
|
|
51
|
+
import { Connection } from 'mongoose';
|
|
52
|
+
import { ChatPreferences } from '../../../../../enums/chat-preferences-enum';
|
|
53
|
+
import { UserLanguage } from '../../../../../types/user-language.enum';
|
|
54
|
+
import { ChatInfo } from './chat-info.entity';
|
|
55
|
+
import { EventInfo } from './event-info.entity';
|
|
56
|
+
import { Company, Contact } from '../../../companies';
|
|
57
|
+
import { Event } from '../../../../../entities/models/events';
|
|
58
|
+
import { RolePermission } from '../rolePermissions';
|
|
59
|
+
import { UserStatus } from '../../../../../types/user-status.enum';
|
|
60
|
+
import { CustomModel } from '../../../../../db/CustomModel';
|
|
61
|
+
export type UserModel = CustomModel<User>;
|
|
62
|
+
export declare class User {
|
|
63
|
+
_id: string;
|
|
64
|
+
email: string;
|
|
65
|
+
cognitoUserIds: string[];
|
|
66
|
+
firstname: string;
|
|
67
|
+
lastname: string;
|
|
68
|
+
mobile: string;
|
|
69
|
+
company: Company;
|
|
70
|
+
avatar: string;
|
|
71
|
+
twitter: string;
|
|
72
|
+
linkedIn: string;
|
|
73
|
+
jobPosition: string;
|
|
74
|
+
wish: string;
|
|
75
|
+
description: string;
|
|
76
|
+
impression: string;
|
|
77
|
+
location: Location;
|
|
78
|
+
chatInfo: ChatInfo;
|
|
79
|
+
role: RolePermission;
|
|
80
|
+
eventInfos: EventInfo[];
|
|
81
|
+
status: UserStatus;
|
|
82
|
+
language: UserLanguage;
|
|
83
|
+
chatPreferences: ChatPreferences;
|
|
84
|
+
lastLoggedIn: Date;
|
|
85
|
+
lastActive: Date;
|
|
86
|
+
deletedAt: Date;
|
|
87
|
+
deletedBy: any;
|
|
88
|
+
lastLoggedInContactId: Contact;
|
|
89
|
+
lastLoggedInCompanyId: Company;
|
|
90
|
+
lastLoggedInEventId: Event;
|
|
91
|
+
createdAt: Date;
|
|
92
|
+
updatedAt: Date;
|
|
93
|
+
}
|
|
94
|
+
export declare const userFactory: (connection: Connection, companyConnection: Connection, eventConnection: Connection) => import("mongoose").Model<User, {}, {}, {}, import("mongoose").Document<unknown, {}, User> & User & Required<{
|
|
95
|
+
_id: string;
|
|
96
|
+
}>, any>;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userFactory = exports.User = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const chat_preferences_enum_1 = require("../../../../../enums/chat-preferences-enum");
|
|
6
|
+
const user_language_enum_1 = require("../../../../../types/user-language.enum");
|
|
7
|
+
const validateProjectionResult_1 = require("../../../../../validators/validateProjectionResult");
|
|
8
|
+
const validateProjection_1 = require("../../../../../validators/validateProjection");
|
|
9
|
+
const validateNewItem_1 = require("../../../../../validators/validateNewItem");
|
|
10
|
+
const validateUpdateItem_1 = require("../../../../../validators/validateUpdateItem");
|
|
11
|
+
const location_entity_1 = require("./location.entity");
|
|
12
|
+
const chat_info_entity_1 = require("./chat-info.entity");
|
|
13
|
+
const event_info_entity_1 = require("./event-info.entity");
|
|
14
|
+
const get_model_ref_1 = require("../../../../services/get-model-ref");
|
|
15
|
+
const generate_model_1 = require("../../../../../entities/services/generate-model");
|
|
16
|
+
const user_status_enum_1 = require("../../../../../types/user-status.enum");
|
|
17
|
+
const ObjectId = mongoose_1.Schema.Types.ObjectId;
|
|
18
|
+
class User {
|
|
19
|
+
}
|
|
20
|
+
exports.User = User;
|
|
21
|
+
const userFactory = (connection, companyConnection, eventConnection) => {
|
|
22
|
+
const eventInfoSchema = (0, event_info_entity_1.getEventInfoSchema)(connection, companyConnection, eventConnection);
|
|
23
|
+
const userSchema = new mongoose_1.Schema({
|
|
24
|
+
email: { type: String, required: true, unique: true },
|
|
25
|
+
cognitoUserIds: { type: [String], trim: true },
|
|
26
|
+
firstname: { type: String },
|
|
27
|
+
lastname: { type: String },
|
|
28
|
+
mobile: { type: String },
|
|
29
|
+
company: { type: ObjectId },
|
|
30
|
+
avatar: { type: String },
|
|
31
|
+
twitter: { type: String },
|
|
32
|
+
linkedIn: { type: String },
|
|
33
|
+
jobPosition: { type: String },
|
|
34
|
+
wish: { type: String },
|
|
35
|
+
description: { type: String },
|
|
36
|
+
impression: { type: String },
|
|
37
|
+
location: { type: location_entity_1.LocationSchema },
|
|
38
|
+
chatInfo: { type: chat_info_entity_1.ChatInfoSchema },
|
|
39
|
+
role: {
|
|
40
|
+
type: ObjectId,
|
|
41
|
+
ref: (0, get_model_ref_1.getModelRef)('RolePermission', connection),
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
eventInfos: [
|
|
45
|
+
{
|
|
46
|
+
type: eventInfoSchema,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
status: {
|
|
50
|
+
type: String,
|
|
51
|
+
enum: Object.values(user_status_enum_1.UserStatus),
|
|
52
|
+
required: true,
|
|
53
|
+
default: user_status_enum_1.UserStatus.INACTIVE,
|
|
54
|
+
},
|
|
55
|
+
language: {
|
|
56
|
+
type: String,
|
|
57
|
+
enum: Object.values(user_language_enum_1.UserLanguage),
|
|
58
|
+
required: true,
|
|
59
|
+
default: user_language_enum_1.UserLanguage.ENGLISH,
|
|
60
|
+
},
|
|
61
|
+
chatPreferences: {
|
|
62
|
+
type: String,
|
|
63
|
+
enum: Object.values(chat_preferences_enum_1.ChatPreferences),
|
|
64
|
+
required: true,
|
|
65
|
+
default: chat_preferences_enum_1.ChatPreferences.ALL,
|
|
66
|
+
},
|
|
67
|
+
lastLoggedIn: { type: Date },
|
|
68
|
+
lastActive: { type: Date },
|
|
69
|
+
deletedAt: { type: Date },
|
|
70
|
+
deletedBy: {
|
|
71
|
+
type: ObjectId,
|
|
72
|
+
ref: (0, get_model_ref_1.getModelRef)('User', connection),
|
|
73
|
+
},
|
|
74
|
+
lastLoggedInContactId: {
|
|
75
|
+
type: ObjectId,
|
|
76
|
+
ref: (0, get_model_ref_1.getModelRef)('Contact', companyConnection),
|
|
77
|
+
},
|
|
78
|
+
lastLoggedInCompanyId: {
|
|
79
|
+
type: ObjectId,
|
|
80
|
+
ref: (0, get_model_ref_1.getModelRef)('Company', companyConnection),
|
|
81
|
+
},
|
|
82
|
+
lastLoggedInEventId: {
|
|
83
|
+
type: ObjectId,
|
|
84
|
+
ref: (0, get_model_ref_1.getModelRef)('Event', eventConnection),
|
|
85
|
+
},
|
|
86
|
+
createdAt: { type: Date, required: true, default: Date.now },
|
|
87
|
+
updatedAt: { type: Date, required: true, default: Date.now },
|
|
88
|
+
});
|
|
89
|
+
const allProjectionFieldArray = [
|
|
90
|
+
'_id',
|
|
91
|
+
'email',
|
|
92
|
+
'cognitoUserIds',
|
|
93
|
+
'firstname',
|
|
94
|
+
'lastname',
|
|
95
|
+
'mobile',
|
|
96
|
+
'location',
|
|
97
|
+
'company',
|
|
98
|
+
'avatar',
|
|
99
|
+
'twitter',
|
|
100
|
+
'linkedIn',
|
|
101
|
+
'role',
|
|
102
|
+
'description',
|
|
103
|
+
'impression',
|
|
104
|
+
'wish',
|
|
105
|
+
'jobPosition',
|
|
106
|
+
'status',
|
|
107
|
+
'eventInfos',
|
|
108
|
+
'language',
|
|
109
|
+
'chatPreferences',
|
|
110
|
+
'lastLoggedIn',
|
|
111
|
+
'lastActive',
|
|
112
|
+
'deletedAt',
|
|
113
|
+
'deletedBy',
|
|
114
|
+
'lastLoggedInContactId',
|
|
115
|
+
'lastLoggedInCompanyId',
|
|
116
|
+
'lastLoggedInEventId',
|
|
117
|
+
'createdAt',
|
|
118
|
+
'updatedAt',
|
|
119
|
+
];
|
|
120
|
+
const allValidateNewItemFieldArray = [
|
|
121
|
+
'_id',
|
|
122
|
+
'email',
|
|
123
|
+
'cognitoUserIds',
|
|
124
|
+
'firstname',
|
|
125
|
+
'lastname',
|
|
126
|
+
'mobile',
|
|
127
|
+
'company',
|
|
128
|
+
'avatar',
|
|
129
|
+
'twitter',
|
|
130
|
+
'linkedIn',
|
|
131
|
+
'role',
|
|
132
|
+
'description',
|
|
133
|
+
'impression',
|
|
134
|
+
'wish',
|
|
135
|
+
'jobPosition',
|
|
136
|
+
'status',
|
|
137
|
+
'eventInfos',
|
|
138
|
+
'language',
|
|
139
|
+
'chatPreferences',
|
|
140
|
+
'lastLoggedIn',
|
|
141
|
+
'lastActive',
|
|
142
|
+
'deletedAt',
|
|
143
|
+
'deletedBy',
|
|
144
|
+
'lastLoggedInContactId',
|
|
145
|
+
'lastLoggedInCompanyId',
|
|
146
|
+
'lastLoggedInEventId',
|
|
147
|
+
'createdAt',
|
|
148
|
+
'updatedAt',
|
|
149
|
+
];
|
|
150
|
+
const allValidateUpdateItemFieldArray = [
|
|
151
|
+
'_id',
|
|
152
|
+
'email',
|
|
153
|
+
'cognitoUserIds',
|
|
154
|
+
'firstname',
|
|
155
|
+
'lastname',
|
|
156
|
+
'mobile',
|
|
157
|
+
'company',
|
|
158
|
+
'avatar',
|
|
159
|
+
'twitter',
|
|
160
|
+
'linkedIn',
|
|
161
|
+
'role',
|
|
162
|
+
'description',
|
|
163
|
+
'impression',
|
|
164
|
+
'wish',
|
|
165
|
+
'jobPosition',
|
|
166
|
+
'status',
|
|
167
|
+
'eventInfos',
|
|
168
|
+
'language',
|
|
169
|
+
'chatPreferences',
|
|
170
|
+
'lastLoggedIn',
|
|
171
|
+
'lastActive',
|
|
172
|
+
'deletedAt',
|
|
173
|
+
'deletedBy',
|
|
174
|
+
'lastLoggedInContactId',
|
|
175
|
+
'lastLoggedInCompanyId',
|
|
176
|
+
'lastLoggedInEventId',
|
|
177
|
+
'createdAt',
|
|
178
|
+
'updatedAt',
|
|
179
|
+
];
|
|
180
|
+
userSchema.statics.validateProjectionResult = necessaryProjectionObj => (0, validateProjectionResult_1.validateProjectionResult)(allProjectionFieldArray, necessaryProjectionObj);
|
|
181
|
+
userSchema.statics.validateProjection = necessaryProjectionArray => (0, validateProjection_1.validateProjection)(allProjectionFieldArray, necessaryProjectionArray);
|
|
182
|
+
userSchema.statics.validateNewItem = newItemObj => (0, validateNewItem_1.validateNewItem)(allValidateNewItemFieldArray, newItemObj);
|
|
183
|
+
userSchema.statics.validateUpdateItem = updateItemObj => (0, validateUpdateItem_1.validateUpdateItem)(allValidateUpdateItemFieldArray, updateItemObj);
|
|
184
|
+
userSchema.pre('findOneAndUpdate', async function (next) {
|
|
185
|
+
this._update.updatedAt = new Date();
|
|
186
|
+
next();
|
|
187
|
+
});
|
|
188
|
+
userSchema.index({ 'eventInfos.eventId': 1 });
|
|
189
|
+
return (0, generate_model_1.generateModel)('User', connection, userSchema);
|
|
190
|
+
};
|
|
191
|
+
exports.userFactory = userFactory;
|
|
192
|
+
//# sourceMappingURL=user.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../../../../src/entities/models/users/entities/users/user.entity.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,sFAA4E;AAC5E,gFAAsE;AACtE,iGAA6F;AAC7F,qFAAiF;AACjF,+EAA2E;AAC3E,qFAAiF;AACjF,uDAAkD;AAClD,yDAA6D;AAC7D,2DAAmE;AAQnE,sEAAgE;AAChE,oFAA+E;AAE/E,4EAAkE;AAGlE,MAAM,QAAQ,GAAG,iBAAM,CAAC,KAAK,CAAC,QAAQ,CAAA;AAGtC,MAAa,IAAI;CA+BhB;AA/BD,oBA+BC;AAEM,MAAM,WAAW,GAAG,CACzB,UAAsB,EACtB,iBAA6B,EAC7B,eAA2B,EAC3B,EAAE;IACF,MAAM,eAAe,GAAG,IAAA,sCAAkB,EACxC,UAAU,EACV,iBAAiB,EACjB,eAAe,CAChB,CAAA;IACD,MAAM,UAAU,GAAG,IAAI,iBAAM,CAAkB;QAC7C,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QACrD,cAAc,EAAE,EAAE,IAAI,EAAE,CAA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3D,UAAU,CAAC,OAAO,CAAC,kBAAkB,GAAG,aAAa,CAAC,EAAE,CACtD,IAAA,uCAAkB,EAAC,+BAA+B,EAAE,aAAa,CAAC,CAAA;IAEpE,UAAU,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,WAAiB,IAAI;QAG3D,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAA;QACnC,IAAI,EAAE,CAAA;IACR,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,CAAC,CAAA;IAE7C,OAAO,IAAA,8BAAa,EAAkB,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;AACvE,CAAC,CAAA;AApMY,QAAA,WAAW,eAoMvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Subjects } from './subjects';
|
|
2
|
+
import { operationTypes } from "..";
|
|
3
|
+
export declare namespace CreateCompanyEvent {
|
|
4
|
+
interface Context {
|
|
5
|
+
subject: Subjects.CreateEventInCompany;
|
|
6
|
+
data: Data;
|
|
7
|
+
}
|
|
8
|
+
interface Data {
|
|
9
|
+
operation: operationTypes;
|
|
10
|
+
data: any;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Subjects } from './subjects';
|
|
2
|
+
import { HeaderUser, operationTypes } from "..";
|
|
3
|
+
export declare namespace CreateCompany {
|
|
4
|
+
interface Context {
|
|
5
|
+
subject: Subjects.CreateCompany;
|
|
6
|
+
data: Data;
|
|
7
|
+
}
|
|
8
|
+
interface Data {
|
|
9
|
+
id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
website?: string;
|
|
12
|
+
eventId?: string;
|
|
13
|
+
usertype?: string;
|
|
14
|
+
contact?: string;
|
|
15
|
+
operationType: operationTypes;
|
|
16
|
+
userHeader?: HeaderUser;
|
|
17
|
+
}
|
|
18
|
+
}
|