@euler-edu/nest 7.0.7 → 7.0.9
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/lib/.tsbuildinfo +1 -1
- package/lib/connection/mongo/oj-main/user.d.ts +4 -12
- package/lib/connection/mongo/oj-main/user.d.ts.map +1 -1
- package/lib/connection/mongo/oj-main/user.js +1 -3
- package/lib/connection/mongo/oj-main/user.js.map +1 -1
- package/lib/decorators/client.decorator.d.ts +2 -0
- package/lib/decorators/client.decorator.d.ts.map +1 -1
- package/lib/decorators/client.decorator.js +19 -1
- package/lib/decorators/client.decorator.js.map +1 -1
- package/package.json +4 -4
|
@@ -9,7 +9,6 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
9
9
|
feeling: string;
|
|
10
10
|
auth_email: boolean;
|
|
11
11
|
auth_naver: string;
|
|
12
|
-
auth_facebook: string;
|
|
13
12
|
auth_kakao: string;
|
|
14
13
|
auth_google: string;
|
|
15
14
|
bookmark: any[];
|
|
@@ -17,10 +16,9 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
17
16
|
problems_submit_len: number;
|
|
18
17
|
trophy_len: number;
|
|
19
18
|
timelog_len: number;
|
|
20
|
-
timelog: any[];
|
|
21
19
|
email?: string | null | undefined;
|
|
22
20
|
school?: string | null | undefined;
|
|
23
|
-
|
|
21
|
+
academy_access_at?: NativeDate | null | undefined;
|
|
24
22
|
agree_terms_at?: NativeDate | null | undefined;
|
|
25
23
|
profile_image_key?: string | null | undefined;
|
|
26
24
|
profile_image_updated_at?: NativeDate | null | undefined;
|
|
@@ -38,7 +36,6 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
38
36
|
feeling: string;
|
|
39
37
|
auth_email: boolean;
|
|
40
38
|
auth_naver: string;
|
|
41
|
-
auth_facebook: string;
|
|
42
39
|
auth_kakao: string;
|
|
43
40
|
auth_google: string;
|
|
44
41
|
bookmark: any[];
|
|
@@ -46,10 +43,9 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
46
43
|
problems_submit_len: number;
|
|
47
44
|
trophy_len: number;
|
|
48
45
|
timelog_len: number;
|
|
49
|
-
timelog: any[];
|
|
50
46
|
email?: string | null | undefined;
|
|
51
47
|
school?: string | null | undefined;
|
|
52
|
-
|
|
48
|
+
academy_access_at?: NativeDate | null | undefined;
|
|
53
49
|
agree_terms_at?: NativeDate | null | undefined;
|
|
54
50
|
profile_image_key?: string | null | undefined;
|
|
55
51
|
profile_image_updated_at?: NativeDate | null | undefined;
|
|
@@ -69,7 +65,6 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
69
65
|
feeling: string;
|
|
70
66
|
auth_email: boolean;
|
|
71
67
|
auth_naver: string;
|
|
72
|
-
auth_facebook: string;
|
|
73
68
|
auth_kakao: string;
|
|
74
69
|
auth_google: string;
|
|
75
70
|
bookmark: any[];
|
|
@@ -77,10 +72,9 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
77
72
|
problems_submit_len: number;
|
|
78
73
|
trophy_len: number;
|
|
79
74
|
timelog_len: number;
|
|
80
|
-
timelog: any[];
|
|
81
75
|
email?: string | null | undefined;
|
|
82
76
|
school?: string | null | undefined;
|
|
83
|
-
|
|
77
|
+
academy_access_at?: NativeDate | null | undefined;
|
|
84
78
|
agree_terms_at?: NativeDate | null | undefined;
|
|
85
79
|
profile_image_key?: string | null | undefined;
|
|
86
80
|
profile_image_updated_at?: NativeDate | null | undefined;
|
|
@@ -104,7 +98,6 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
104
98
|
feeling: string;
|
|
105
99
|
auth_email: boolean;
|
|
106
100
|
auth_naver: string;
|
|
107
|
-
auth_facebook: string;
|
|
108
101
|
auth_kakao: string;
|
|
109
102
|
auth_google: string;
|
|
110
103
|
bookmark: any[];
|
|
@@ -112,10 +105,9 @@ export declare const userSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
112
105
|
problems_submit_len: number;
|
|
113
106
|
trophy_len: number;
|
|
114
107
|
timelog_len: number;
|
|
115
|
-
timelog: any[];
|
|
116
108
|
email?: string | null | undefined;
|
|
117
109
|
school?: string | null | undefined;
|
|
118
|
-
|
|
110
|
+
academy_access_at?: NativeDate | null | undefined;
|
|
119
111
|
agree_terms_at?: NativeDate | null | undefined;
|
|
120
112
|
profile_image_key?: string | null | undefined;
|
|
121
113
|
profile_image_updated_at?: NativeDate | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/connection/mongo/oj-main/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/connection/mongo/oj-main/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BrB,CAAC"}
|
|
@@ -9,14 +9,13 @@ exports.userSchema = new mongoose_1.Schema({
|
|
|
9
9
|
name: { type: String, required: true },
|
|
10
10
|
email: String,
|
|
11
11
|
school: String,
|
|
12
|
-
facebook: String,
|
|
13
12
|
access_at: { type: Date, required: true },
|
|
13
|
+
academy_access_at: { type: Date, required: false },
|
|
14
14
|
created_at: { type: Date, default: Date.now() },
|
|
15
15
|
agree_terms_at: { type: Date },
|
|
16
16
|
feeling: { type: String, default: '' },
|
|
17
17
|
auth_email: { type: Boolean, required: true, default: true },
|
|
18
18
|
auth_naver: { type: String, default: '' },
|
|
19
|
-
auth_facebook: { type: String, default: '' },
|
|
20
19
|
auth_kakao: { type: String, default: '' },
|
|
21
20
|
auth_google: { type: String, default: '' },
|
|
22
21
|
profile_image_key: { type: String, required: false },
|
|
@@ -30,6 +29,5 @@ exports.userSchema = new mongoose_1.Schema({
|
|
|
30
29
|
problems_submit_len: { type: Number, required: true, default: 0 },
|
|
31
30
|
trophy_len: { type: Number, required: true, default: 0 },
|
|
32
31
|
timelog_len: { type: Number, required: true, default: 0 },
|
|
33
|
-
timelog: { type: Array, required: true, default: [] },
|
|
34
32
|
});
|
|
35
33
|
//# sourceMappingURL=user.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../src/connection/mongo/oj-main/user.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAErB,QAAA,UAAU,GAAG,IAAI,iBAAM,CAAC;IACnC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACxD,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../src/connection/mongo/oj-main/user.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAErB,QAAA,UAAU,GAAG,IAAI,iBAAM,CAAC;IACnC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACxD,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC1C,IAAI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AAQ,EAAE,KAAK,EAAE;IAC/C,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAChD,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAE7C,kBAAkB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;IAChE,mBAAmB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;IACjE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;IACxD,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;CAC1D,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type ClientIPType = string | undefined;
|
|
2
2
|
export declare const ClientIP: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
3
|
+
export type IsAcademyAccessType = boolean;
|
|
4
|
+
export declare const IsAcademyAccess: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
3
5
|
export type ClientUserAgentType = {
|
|
4
6
|
browser?: string;
|
|
5
7
|
os?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/client.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/client.decorator.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9C,eAAO,MAAM,QAAQ,mDAWpB,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC1C,eAAO,MAAM,eAAe,mDAuB3B,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,eAAO,MAAM,eAAe,mDA0B3B,CAAC"}
|
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ClientUserAgent = exports.ClientIP = void 0;
|
|
6
|
+
exports.ClientUserAgent = exports.IsAcademyAccess = exports.ClientIP = void 0;
|
|
7
7
|
const common_1 = require("@nestjs/common");
|
|
8
8
|
const request_ip_1 = __importDefault(require("request-ip"));
|
|
9
9
|
const client_1 = require("@euler-edu/utils/client");
|
|
10
|
+
const constants_1 = __importDefault(require("@euler-edu/utils/constants"));
|
|
10
11
|
const clientIPLogger = new common_1.Logger('ClientIP');
|
|
11
12
|
exports.ClientIP = (0, common_1.createParamDecorator)((data, context) => {
|
|
12
13
|
try {
|
|
@@ -19,6 +20,23 @@ exports.ClientIP = (0, common_1.createParamDecorator)((data, context) => {
|
|
|
19
20
|
}
|
|
20
21
|
return undefined;
|
|
21
22
|
});
|
|
23
|
+
const isAcademyAccessLogger = new common_1.Logger('IsAcademyAccess');
|
|
24
|
+
exports.IsAcademyAccess = (0, common_1.createParamDecorator)((data, context) => {
|
|
25
|
+
try {
|
|
26
|
+
const request = context.switchToHttp().getRequest();
|
|
27
|
+
const forwardedFor = request.headers['x-forwarded-for'];
|
|
28
|
+
const forwardedIp = (Array.isArray(forwardedFor) ? forwardedFor.join(',') : forwardedFor)
|
|
29
|
+
?.split(',')
|
|
30
|
+
.at(-1)
|
|
31
|
+
?.trim();
|
|
32
|
+
const clientIp = (forwardedIp || request.socket.remoteAddress)?.replace(/^::ffff:/, '');
|
|
33
|
+
return !!clientIp && constants_1.default.ip.academies.includes(clientIp);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
isAcademyAccessLogger.warn(error);
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
});
|
|
22
40
|
const clientUserAgentLogger = new common_1.Logger('ClientUserAgent');
|
|
23
41
|
exports.ClientUserAgent = (0, common_1.createParamDecorator)((data, context) => {
|
|
24
42
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.decorator.js","sourceRoot":"","sources":["../../src/decorators/client.decorator.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAgF;
|
|
1
|
+
{"version":3,"file":"client.decorator.js","sourceRoot":"","sources":["../../src/decorators/client.decorator.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAgF;AAEhF,4DAAmC;AAEnC,oDAA6D;AAC7D,2EAAmD;AAEnD,MAAM,cAAc,GAAG,IAAI,eAAM,CAAC,UAAU,CAAC,CAAC;AAEjC,QAAA,QAAQ,GAAG,IAAA,6BAAoB,EAC1C,CAAC,IAAa,EAAE,OAAyB,EAAgB,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,oBAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,QAAQ,IAAI,SAAS,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CACF,CAAC;AAEF,MAAM,qBAAqB,GAAG,IAAI,eAAM,CAAC,iBAAiB,CAAC,CAAC;AAE/C,QAAA,eAAe,GAAG,IAAA,6BAAoB,EACjD,CAAC,IAAa,EAAE,OAAyB,EAAuB,EAAE;IAChE,IAAI,CAAC;QACH,MAAM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O,EAAE,OAAO,EAAE,IAAI;gBACpB,CAAC,CAAC,OAAO,EAAE,OAAO;oBAChB,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE;oBACtC,CAAC,CAAC,OAAO,CAAC,IAAI;gBAChB,CAAC,CAAC,SAAS;YACb,EAAE,EAAE,EAAE,EAAE,IAAI;gBACV,CAAC,CAAC,EAAE,EAAE,OAAO;oBACX,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;oBAC5B,CAAC,CAAC,EAAE,CAAC,IAAI;gBACX,CAAC,CAAC,SAAS;YACb,MAAM,EAAE,MAAM,EAAE,IAAI;SACrB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@euler-edu/nest",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.9",
|
|
4
4
|
"description": "Euler-edu Shared NestJS Modules/Utils",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Geon Kim",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"request-ip": "^2.2.0",
|
|
47
47
|
"sharp": "^0.34.5",
|
|
48
48
|
"sqs-consumer": "^15.0.4",
|
|
49
|
-
"@euler-edu/constant": "7.0.
|
|
50
|
-
"@euler-edu/
|
|
51
|
-
"@euler-edu/
|
|
49
|
+
"@euler-edu/constant": "7.0.9",
|
|
50
|
+
"@euler-edu/schema": "7.0.9",
|
|
51
|
+
"@euler-edu/utils": "7.0.9"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/express": "^5.0.6",
|