@euler-edu/nest 0.0.0-stage → 7.0.1-beta0
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 -0
- package/lib/connection/mongo/index.d.ts +3 -0
- package/lib/connection/mongo/index.d.ts.map +1 -0
- package/lib/connection/mongo/index.js +19 -0
- package/lib/connection/mongo/index.js.map +1 -0
- package/lib/connection/mongo/mongo.module.d.ts +5 -0
- package/lib/connection/mongo/mongo.module.d.ts.map +1 -0
- package/lib/connection/mongo/mongo.module.js +30 -0
- package/lib/connection/mongo/mongo.module.js.map +1 -0
- package/lib/connection/mongo/mongo.service.d.ts +21 -0
- package/lib/connection/mongo/mongo.service.d.ts.map +1 -0
- package/lib/connection/mongo/mongo.service.js +57 -0
- package/lib/connection/mongo/mongo.service.js.map +1 -0
- package/lib/connection/mongo/oj-main/contest.d.ts +399 -0
- package/lib/connection/mongo/oj-main/contest.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/contest.js +55 -0
- package/lib/connection/mongo/oj-main/contest.js.map +1 -0
- package/lib/connection/mongo/oj-main/index.d.ts +8 -0
- package/lib/connection/mongo/oj-main/index.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/index.js +18 -0
- package/lib/connection/mongo/oj-main/index.js.map +1 -0
- package/lib/connection/mongo/oj-main/mail.d.ts +55 -0
- package/lib/connection/mongo/oj-main/mail.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/mail.js +44 -0
- package/lib/connection/mongo/oj-main/mail.js.map +1 -0
- package/lib/connection/mongo/oj-main/problem.d.ts +103 -0
- package/lib/connection/mongo/oj-main/problem.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/problem.js +29 -0
- package/lib/connection/mongo/oj-main/problem.js.map +1 -0
- package/lib/connection/mongo/oj-main/record.d.ts +47 -0
- package/lib/connection/mongo/oj-main/record.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/record.js +26 -0
- package/lib/connection/mongo/oj-main/record.js.map +1 -0
- package/lib/connection/mongo/oj-main/sourceconsole.d.ts +67 -0
- package/lib/connection/mongo/oj-main/sourceconsole.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/sourceconsole.js +19 -0
- package/lib/connection/mongo/oj-main/sourceconsole.js.map +1 -0
- package/lib/connection/mongo/oj-main/sourcesubmit.d.ts +175 -0
- package/lib/connection/mongo/oj-main/sourcesubmit.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/sourcesubmit.js +47 -0
- package/lib/connection/mongo/oj-main/sourcesubmit.js.map +1 -0
- package/lib/connection/mongo/oj-main/user.d.ts +131 -0
- package/lib/connection/mongo/oj-main/user.d.ts.map +1 -0
- package/lib/connection/mongo/oj-main/user.js +35 -0
- package/lib/connection/mongo/oj-main/user.js.map +1 -0
- package/lib/connection/mongo/oj-sq/index.d.ts +3 -0
- package/lib/connection/mongo/oj-sq/index.d.ts.map +1 -0
- package/lib/connection/mongo/oj-sq/index.js +8 -0
- package/lib/connection/mongo/oj-sq/index.js.map +1 -0
- package/lib/connection/mongo/oj-sq/scoringRequest.d.ts +291 -0
- package/lib/connection/mongo/oj-sq/scoringRequest.d.ts.map +1 -0
- package/lib/connection/mongo/oj-sq/scoringRequest.js +58 -0
- package/lib/connection/mongo/oj-sq/scoringRequest.js.map +1 -0
- package/lib/connection/mongo/oj-sq/scoringServer.d.ts +39 -0
- package/lib/connection/mongo/oj-sq/scoringServer.d.ts.map +1 -0
- package/lib/connection/mongo/oj-sq/scoringServer.js +12 -0
- package/lib/connection/mongo/oj-sq/scoringServer.js.map +1 -0
- package/lib/connection/redis/index.d.ts +3 -0
- package/lib/connection/redis/index.d.ts.map +1 -0
- package/lib/connection/redis/index.js +19 -0
- package/lib/connection/redis/index.js.map +1 -0
- package/lib/connection/redis/redis.module.d.ts +5 -0
- package/lib/connection/redis/redis.module.d.ts.map +1 -0
- package/lib/connection/redis/redis.module.js +30 -0
- package/lib/connection/redis/redis.module.js.map +1 -0
- package/lib/connection/redis/redis.service.d.ts +35 -0
- package/lib/connection/redis/redis.service.d.ts.map +1 -0
- package/lib/connection/redis/redis.service.js +85 -0
- package/lib/connection/redis/redis.service.js.map +1 -0
- package/lib/connection/s3/index.d.ts +3 -0
- package/lib/connection/s3/index.d.ts.map +1 -0
- package/lib/connection/s3/index.js +19 -0
- package/lib/connection/s3/index.js.map +1 -0
- package/lib/connection/s3/s3.module.d.ts +11 -0
- package/lib/connection/s3/s3.module.d.ts.map +1 -0
- package/lib/connection/s3/s3.module.js +57 -0
- package/lib/connection/s3/s3.module.js.map +1 -0
- package/lib/connection/s3/s3.service.d.ts +54 -0
- package/lib/connection/s3/s3.service.d.ts.map +1 -0
- package/lib/connection/s3/s3.service.js +253 -0
- package/lib/connection/s3/s3.service.js.map +1 -0
- package/lib/connection/social/index.d.ts +3 -0
- package/lib/connection/social/index.d.ts.map +1 -0
- package/lib/connection/social/index.js +19 -0
- package/lib/connection/social/index.js.map +1 -0
- package/lib/connection/social/social.module.d.ts +3 -0
- package/lib/connection/social/social.module.d.ts.map +1 -0
- package/lib/connection/social/social.module.js +21 -0
- package/lib/connection/social/social.module.js.map +1 -0
- package/lib/connection/social/social.service.d.ts +16 -0
- package/lib/connection/social/social.service.d.ts.map +1 -0
- package/lib/connection/social/social.service.js +230 -0
- package/lib/connection/social/social.service.js.map +1 -0
- package/lib/connection/sqs/index.d.ts +3 -0
- package/lib/connection/sqs/index.d.ts.map +1 -0
- package/lib/connection/sqs/index.js +19 -0
- package/lib/connection/sqs/index.js.map +1 -0
- package/lib/connection/sqs/sqs.module.d.ts +5 -0
- package/lib/connection/sqs/sqs.module.d.ts.map +1 -0
- package/lib/connection/sqs/sqs.module.js +31 -0
- package/lib/connection/sqs/sqs.module.js.map +1 -0
- package/lib/connection/sqs/sqs.service.d.ts +28 -0
- package/lib/connection/sqs/sqs.service.d.ts.map +1 -0
- package/lib/connection/sqs/sqs.service.js +122 -0
- package/lib/connection/sqs/sqs.service.js.map +1 -0
- package/lib/constants/metadata.d.ts +5 -0
- package/lib/constants/metadata.d.ts.map +1 -0
- package/lib/constants/metadata.js +8 -0
- package/lib/constants/metadata.js.map +1 -0
- package/lib/decorators/auth.decorator.d.ts +15 -0
- package/lib/decorators/auth.decorator.d.ts.map +1 -0
- package/lib/decorators/auth.decorator.js +65 -0
- package/lib/decorators/auth.decorator.js.map +1 -0
- package/lib/decorators/client.decorator.d.ts +9 -0
- package/lib/decorators/client.decorator.d.ts.map +1 -0
- package/lib/decorators/client.decorator.js +49 -0
- package/lib/decorators/client.decorator.js.map +1 -0
- package/lib/decorators/endpoint.decorator.d.ts +3 -0
- package/lib/decorators/endpoint.decorator.d.ts.map +1 -0
- package/lib/decorators/endpoint.decorator.js +96 -0
- package/lib/decorators/endpoint.decorator.js.map +1 -0
- package/lib/decorators/index.d.ts +8 -0
- package/lib/decorators/index.d.ts.map +1 -0
- package/lib/decorators/index.js +24 -0
- package/lib/decorators/index.js.map +1 -0
- package/lib/decorators/mongo.decorator.d.ts +8 -0
- package/lib/decorators/mongo.decorator.d.ts.map +1 -0
- package/lib/decorators/mongo.decorator.js +115 -0
- package/lib/decorators/mongo.decorator.js.map +1 -0
- package/lib/decorators/socket.decorator.d.ts +5 -0
- package/lib/decorators/socket.decorator.d.ts.map +1 -0
- package/lib/decorators/socket.decorator.js +28 -0
- package/lib/decorators/socket.decorator.js.map +1 -0
- package/lib/decorators/sqs.decorator.d.ts +4 -0
- package/lib/decorators/sqs.decorator.d.ts.map +1 -0
- package/lib/decorators/sqs.decorator.js +8 -0
- package/lib/decorators/sqs.decorator.js.map +1 -0
- package/lib/decorators/swagger.decorator.d.ts +2 -0
- package/lib/decorators/swagger.decorator.d.ts.map +1 -0
- package/lib/decorators/swagger.decorator.js +8 -0
- package/lib/decorators/swagger.decorator.js.map +1 -0
- package/lib/filters/global.filters.d.ts +16 -0
- package/lib/filters/global.filters.d.ts.map +1 -0
- package/lib/filters/global.filters.js +75 -0
- package/lib/filters/global.filters.js.map +1 -0
- package/lib/filters/index.d.ts +2 -0
- package/lib/filters/index.d.ts.map +1 -0
- package/lib/filters/index.js +18 -0
- package/lib/filters/index.js.map +1 -0
- package/lib/guards/auth.guard.d.ts +13 -0
- package/lib/guards/auth.guard.d.ts.map +1 -0
- package/lib/guards/auth.guard.js +61 -0
- package/lib/guards/auth.guard.js.map +1 -0
- package/lib/guards/endpoint.guard.d.ts +4 -0
- package/lib/guards/endpoint.guard.d.ts.map +1 -0
- package/lib/guards/endpoint.guard.js +39 -0
- package/lib/guards/endpoint.guard.js.map +1 -0
- package/lib/guards/global.guard.d.ts +10 -0
- package/lib/guards/global.guard.d.ts.map +1 -0
- package/lib/guards/global.guard.js +139 -0
- package/lib/guards/global.guard.js.map +1 -0
- package/lib/guards/index.d.ts +5 -0
- package/lib/guards/index.d.ts.map +1 -0
- package/lib/guards/index.js +21 -0
- package/lib/guards/index.js.map +1 -0
- package/lib/guards/socket.guard.d.ts +4 -0
- package/lib/guards/socket.guard.d.ts.map +1 -0
- package/lib/guards/socket.guard.js +35 -0
- package/lib/guards/socket.guard.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/lib/logger/index.d.ts +3 -0
- package/lib/logger/index.d.ts.map +1 -0
- package/lib/logger/index.js +21 -0
- package/lib/logger/index.js.map +1 -0
- package/lib/logger/logger.module.d.ts +3 -0
- package/lib/logger/logger.module.d.ts.map +1 -0
- package/lib/logger/logger.module.js +46 -0
- package/lib/logger/logger.module.js.map +1 -0
- package/lib/recaptcha/index.d.ts +3 -0
- package/lib/recaptcha/index.d.ts.map +1 -0
- package/lib/recaptcha/index.js +19 -0
- package/lib/recaptcha/index.js.map +1 -0
- package/lib/recaptcha/recaptcha.module.d.ts +3 -0
- package/lib/recaptcha/recaptcha.module.d.ts.map +1 -0
- package/lib/recaptcha/recaptcha.module.js +21 -0
- package/lib/recaptcha/recaptcha.module.js.map +1 -0
- package/lib/recaptcha/recaptcha.service.d.ts +5 -0
- package/lib/recaptcha/recaptcha.service.d.ts.map +1 -0
- package/lib/recaptcha/recaptcha.service.js +46 -0
- package/lib/recaptcha/recaptcha.service.js.map +1 -0
- package/lib/utils/image/index.d.ts +4 -0
- package/lib/utils/image/index.d.ts.map +1 -0
- package/lib/utils/image/index.js +16 -0
- package/lib/utils/image/index.js.map +1 -0
- package/lib/utils/jwt/index.d.ts +2 -0
- package/lib/utils/jwt/index.d.ts.map +1 -0
- package/lib/utils/jwt/index.js +38 -0
- package/lib/utils/jwt/index.js.map +1 -0
- package/lib/utils/logger/index.d.ts +45 -0
- package/lib/utils/logger/index.d.ts.map +1 -0
- package/lib/utils/logger/index.js +59 -0
- package/lib/utils/logger/index.js.map +1 -0
- package/lib/utils/mongo/index.d.ts +2 -0
- package/lib/utils/mongo/index.d.ts.map +1 -0
- package/lib/utils/mongo/index.js +6 -0
- package/lib/utils/mongo/index.js.map +1 -0
- package/lib/utils/swagger/index.d.ts +7 -0
- package/lib/utils/swagger/index.d.ts.map +1 -0
- package/lib/utils/swagger/index.js +29 -0
- package/lib/utils/swagger/index.js.map +1 -0
- package/package.json +62 -3
- package/README.md +0 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./recaptcha.module"), exports);
|
|
18
|
+
__exportStar(require("./recaptcha.service"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recaptcha/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recaptcha.module.d.ts","sourceRoot":"","sources":["../../src/recaptcha/recaptcha.module.ts"],"names":[],"mappings":"AAIA,qBAIa,eAAe;CAAG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.RecaptchaModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const recaptcha_service_1 = require("./recaptcha.service");
|
|
12
|
+
let RecaptchaModule = class RecaptchaModule {
|
|
13
|
+
};
|
|
14
|
+
exports.RecaptchaModule = RecaptchaModule;
|
|
15
|
+
exports.RecaptchaModule = RecaptchaModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
providers: [recaptcha_service_1.RecaptchaService],
|
|
18
|
+
exports: [recaptcha_service_1.RecaptchaService],
|
|
19
|
+
})
|
|
20
|
+
], RecaptchaModule);
|
|
21
|
+
//# sourceMappingURL=recaptcha.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recaptcha.module.js","sourceRoot":"","sources":["../../src/recaptcha/recaptcha.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,2DAAuD;AAMhD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAJ3B,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,oCAAgB,CAAC;QAC7B,OAAO,EAAE,CAAC,oCAAgB,CAAC;KAC5B,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recaptcha.service.d.ts","sourceRoot":"","sources":["../../src/recaptcha/recaptcha.service.ts"],"names":[],"mappings":"AAKA,qBACa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAEtD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAwB9C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
var RecaptchaService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RecaptchaService = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const constants_1 = __importDefault(require("@euler-edu/utils/constants"));
|
|
16
|
+
const instance_1 = __importDefault(require("@euler-edu/utils/instance"));
|
|
17
|
+
let RecaptchaService = RecaptchaService_1 = class RecaptchaService {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.logger = new common_1.Logger(RecaptchaService_1.name);
|
|
20
|
+
}
|
|
21
|
+
async verify(token) {
|
|
22
|
+
if (!constants_1.default.secrets.recaptcha.secretKey) {
|
|
23
|
+
throw new Error('Recaptcha secret key is not configured.');
|
|
24
|
+
}
|
|
25
|
+
const { data } = await instance_1.default
|
|
26
|
+
.post('/recaptcha/api/siteverify', new URLSearchParams({
|
|
27
|
+
secret: constants_1.default.secrets.recaptcha.secretKey,
|
|
28
|
+
response: token,
|
|
29
|
+
}), {
|
|
30
|
+
baseURL: 'https://www.google.com',
|
|
31
|
+
headers: {
|
|
32
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
.catch(error => {
|
|
36
|
+
this.logger.error(error);
|
|
37
|
+
throw new Error('Failed to verify recaptcha token');
|
|
38
|
+
});
|
|
39
|
+
return data?.success === true;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.RecaptchaService = RecaptchaService;
|
|
43
|
+
exports.RecaptchaService = RecaptchaService = RecaptchaService_1 = __decorate([
|
|
44
|
+
(0, common_1.Injectable)()
|
|
45
|
+
], RecaptchaService);
|
|
46
|
+
//# sourceMappingURL=recaptcha.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recaptcha.service.js","sourceRoot":"","sources":["../../src/recaptcha/recaptcha.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,2EAAmD;AACnD,yEAAiD;AAG1C,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAAtB;QACY,WAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IA0B9D,CAAC;IAxBC,KAAK,CAAC,MAAM,CAAC,KAAa;QACxB,IAAI,CAAC,mBAAS,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,kBAAQ;aAC5B,IAAI,CACH,2BAA2B,EAC3B,IAAI,eAAe,CAAC;YAClB,MAAM,EAAE,mBAAS,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS;YAC7C,QAAQ,EAAE,KAAK;SAChB,CAAC,EACF;YACE,OAAO,EAAE,wBAAwB;YACjC,OAAO,EAAE;gBACP,cAAc,EAAE,mCAAmC;aACpD;SACF,CACF;aACA,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QACL,OAAO,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,CAAC;CACF,CAAA;AA3BY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;GACA,gBAAgB,CA2B5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/image/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,GAAG,WAAW,GAAG,UAAU,EACxC,WAAU;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,KAC/B,OAAO,CAAC,MAAM,CAMhB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.convertToPng = void 0;
|
|
7
|
+
const sharp_1 = __importDefault(require("sharp"));
|
|
8
|
+
const convertToPng = async (input, { size } = {}) => {
|
|
9
|
+
let image = (0, sharp_1.default)(input, { animated: false }).rotate();
|
|
10
|
+
if (size) {
|
|
11
|
+
image = image.resize(size, size, { fit: 'cover', position: 'centre' });
|
|
12
|
+
}
|
|
13
|
+
return image.png().toBuffer();
|
|
14
|
+
};
|
|
15
|
+
exports.convertToPng = convertToPng;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/image/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAEnB,MAAM,YAAY,GAAG,KAAK,EAC/B,KAAwC,EACxC,EAAE,IAAI,KAAwB,EAAE,EACf,EAAE;IACnB,IAAI,KAAK,GAAG,IAAA,eAAK,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACvD,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;AAChC,CAAC,CAAC;AATW,QAAA,YAAY,gBASvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/jwt/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.default = void 0;
|
|
37
|
+
exports.default = __importStar(require("jsonwebtoken"));
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/jwt/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAwC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const loggerOptions: {
|
|
2
|
+
level: string;
|
|
3
|
+
transport: {
|
|
4
|
+
targets: ({
|
|
5
|
+
target: string;
|
|
6
|
+
level: string;
|
|
7
|
+
options: {
|
|
8
|
+
colorize: boolean;
|
|
9
|
+
singleLine: boolean;
|
|
10
|
+
translateTime: string;
|
|
11
|
+
ignore: string;
|
|
12
|
+
host?: undefined;
|
|
13
|
+
labels?: undefined;
|
|
14
|
+
propsToLabels?: undefined;
|
|
15
|
+
batching?: undefined;
|
|
16
|
+
interval?: undefined;
|
|
17
|
+
timeout?: undefined;
|
|
18
|
+
silenceErrors?: undefined;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
target: string;
|
|
22
|
+
level: string;
|
|
23
|
+
options: {
|
|
24
|
+
host: string;
|
|
25
|
+
labels: {
|
|
26
|
+
app: string;
|
|
27
|
+
};
|
|
28
|
+
propsToLabels: never[];
|
|
29
|
+
batching: boolean;
|
|
30
|
+
interval: number;
|
|
31
|
+
timeout: number;
|
|
32
|
+
silenceErrors: boolean;
|
|
33
|
+
colorize?: undefined;
|
|
34
|
+
singleLine?: undefined;
|
|
35
|
+
translateTime?: undefined;
|
|
36
|
+
ignore?: undefined;
|
|
37
|
+
};
|
|
38
|
+
})[];
|
|
39
|
+
};
|
|
40
|
+
redact: {
|
|
41
|
+
paths: string[];
|
|
42
|
+
remove: boolean;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDzB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loggerOptions = void 0;
|
|
7
|
+
const constants_1 = __importDefault(require("@euler-edu/utils/constants"));
|
|
8
|
+
exports.loggerOptions = {
|
|
9
|
+
level: constants_1.default.configs.env === 'production' ? 'info' : 'debug',
|
|
10
|
+
transport: {
|
|
11
|
+
targets: [
|
|
12
|
+
{
|
|
13
|
+
target: 'pino-pretty',
|
|
14
|
+
level: 'debug',
|
|
15
|
+
options: {
|
|
16
|
+
colorize: true,
|
|
17
|
+
singleLine: true,
|
|
18
|
+
translateTime: 'SYS:HH:MM:ss',
|
|
19
|
+
ignore: 'pid,hostname',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
...(constants_1.default.url.lokiUrl && constants_1.default.configs.appName
|
|
23
|
+
? [
|
|
24
|
+
{
|
|
25
|
+
target: 'pino-loki',
|
|
26
|
+
level: 'info',
|
|
27
|
+
options: {
|
|
28
|
+
host: constants_1.default.url.lokiUrl,
|
|
29
|
+
labels: { app: constants_1.default.configs.appName },
|
|
30
|
+
propsToLabels: [],
|
|
31
|
+
batching: true,
|
|
32
|
+
interval: 5,
|
|
33
|
+
timeout: 10000,
|
|
34
|
+
silenceErrors: false,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
: []),
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
redact: {
|
|
42
|
+
paths: [
|
|
43
|
+
'req.headers.authorization',
|
|
44
|
+
'req.headers.cookie',
|
|
45
|
+
'req.headers["x-temp-access-token"]',
|
|
46
|
+
'res.headers["set-cookie"]',
|
|
47
|
+
'*.password',
|
|
48
|
+
'*.passwordConfirm',
|
|
49
|
+
'*.accessToken',
|
|
50
|
+
'*.refreshToken',
|
|
51
|
+
'*.secret',
|
|
52
|
+
'*.*.password',
|
|
53
|
+
'*.*.accessToken',
|
|
54
|
+
'*.*.refreshToken',
|
|
55
|
+
],
|
|
56
|
+
remove: true,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/logger/index.ts"],"names":[],"mappings":";;;;;;AAAA,2EAAmD;AAEtC,QAAA,aAAa,GAAG;IAC3B,KAAK,EAAE,mBAAS,CAAC,OAAO,CAAC,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;IAChE,SAAS,EAAE;QACT,OAAO,EAAE;YACP;gBACE,MAAM,EAAE,aAAa;gBACrB,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE;oBACP,QAAQ,EAAE,IAAI;oBACd,UAAU,EAAE,IAAI;oBAChB,aAAa,EAAE,cAAc;oBAC7B,MAAM,EAAE,cAAc;iBACvB;aACF;YACD,GAAG,CAAC,mBAAS,CAAC,GAAG,CAAC,OAAO,IAAI,mBAAS,CAAC,OAAO,CAAC,OAAO;gBACpD,CAAC,CAAC;oBACE;wBACE,MAAM,EAAE,WAAW;wBACnB,KAAK,EAAE,MAAM;wBACb,OAAO,EAAE;4BACP,IAAI,EAAE,mBAAS,CAAC,GAAG,CAAC,OAAO;4BAC3B,MAAM,EAAE,EAAE,GAAG,EAAE,mBAAS,CAAC,OAAO,CAAC,OAAO,EAAE;4BAC1C,aAAa,EAAE,EAAE;4BACjB,QAAQ,EAAE,IAAI;4BACd,QAAQ,EAAE,CAAC;4BACX,OAAO,EAAE,KAAK;4BACd,aAAa,EAAE,KAAK;yBACrB;qBACF;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,2BAA2B;YAC3B,oBAAoB;YACpB,oCAAoC;YACpC,2BAA2B;YAC3B,YAAY;YACZ,mBAAmB;YACnB,eAAe;YACf,gBAAgB;YAChB,UAAU;YACV,cAAc;YACd,iBAAiB;YACjB,kBAAkB;SACnB;QACD,MAAM,EAAE,IAAI;KACb;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/mongo/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MACC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/mongo/index.ts"],"names":[],"mappings":";;;AAMO,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE,CACpD,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AADlC,QAAA,YAAY,gBACsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/swagger/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,gBAAgB,EACrB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE,IAAI,CA0BN"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupSwagger = setupSwagger;
|
|
4
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
5
|
+
function setupSwagger(app, options) {
|
|
6
|
+
const config = new swagger_1.DocumentBuilder()
|
|
7
|
+
.setTitle(options?.title ?? 'EULER BACKEND API')
|
|
8
|
+
.setDescription(options?.description ?? 'The Euler API description')
|
|
9
|
+
.setVersion(options?.version ?? '1.0')
|
|
10
|
+
.addBearerAuth({
|
|
11
|
+
type: 'http',
|
|
12
|
+
scheme: 'bearer',
|
|
13
|
+
bearerFormat: 'JWT',
|
|
14
|
+
in: 'header',
|
|
15
|
+
}, 'Authorization')
|
|
16
|
+
.addSecurityRequirements('Authorization')
|
|
17
|
+
.build();
|
|
18
|
+
const document = swagger_1.SwaggerModule.createDocument(app, config);
|
|
19
|
+
swagger_1.SwaggerModule.setup('api-docs', app, document, {
|
|
20
|
+
swaggerOptions: {
|
|
21
|
+
withCredentials: true,
|
|
22
|
+
persistAuthorization: true,
|
|
23
|
+
operationsSorter: 'alpha',
|
|
24
|
+
apisSorter: 'alpha',
|
|
25
|
+
tagsSorter: 'alpha',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/swagger/index.ts"],"names":[],"mappings":";;AAGA,oCA6BC;AA/BD,6CAAiE;AAEjE,SAAgB,YAAY,CAC1B,GAAqB,EACrB,OAAoE;IAEpE,MAAM,MAAM,GAAG,IAAI,yBAAe,EAAE;SACjC,QAAQ,CAAC,OAAO,EAAE,KAAK,IAAI,mBAAmB,CAAC;SAC/C,cAAc,CAAC,OAAO,EAAE,WAAW,IAAI,2BAA2B,CAAC;SACnE,UAAU,CAAC,OAAO,EAAE,OAAO,IAAI,KAAK,CAAC;SACrC,aAAa,CACZ;QACE,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE,KAAK;QACnB,EAAE,EAAE,QAAQ;KACb,EACD,eAAe,CAChB;SACA,uBAAuB,CAAC,eAAe,CAAC;SACxC,KAAK,EAAE,CAAC;IACX,MAAM,QAAQ,GAAG,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3D,uBAAa,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE;QAC7C,cAAc,EAAE;YACd,eAAe,EAAE,IAAI;YACrB,oBAAoB,EAAE,IAAI;YAC1B,gBAAgB,EAAE,OAAO;YACzB,UAAU,EAAE,OAAO;YACnB,UAAU,EAAE,OAAO;SACpB;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@euler-edu/nest",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "7.0.1-beta0",
|
|
4
|
+
"description": "Euler-edu Shared NestJS Modules/Utils",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "Geon Kim",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"euler-edu",
|
|
9
|
+
"nestjs"
|
|
10
|
+
],
|
|
11
|
+
"main": "lib/index.js",
|
|
12
|
+
"types": "lib/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./lib/index.js",
|
|
15
|
+
"./*": [
|
|
16
|
+
"./lib/*/index.js",
|
|
17
|
+
"./lib/*.js"
|
|
18
|
+
],
|
|
19
|
+
"./*/*": [
|
|
20
|
+
"./lib/*/*/index.js",
|
|
21
|
+
"./lib/*/*.js"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"lib"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@aws-sdk/client-s3": "^3.1106.0",
|
|
29
|
+
"@aws-sdk/client-sqs": "^3.1094.0",
|
|
30
|
+
"@aws-sdk/s3-presigned-post": "^3.1106.0",
|
|
31
|
+
"@aws-sdk/s3-request-presigner": "^3.1106.0",
|
|
32
|
+
"@nestjs/common": "^11.1.28",
|
|
33
|
+
"@nestjs/config": "^4.0.4",
|
|
34
|
+
"@nestjs/core": "^11.1.28",
|
|
35
|
+
"@nestjs/platform-express": "^11.1.28",
|
|
36
|
+
"@nestjs/swagger": "^11.4.6",
|
|
37
|
+
"@nestjs/websockets": "^11.2.7",
|
|
38
|
+
"google-auth-library": "^11.0.0",
|
|
39
|
+
"jsonwebtoken": "^9.0.3",
|
|
40
|
+
"mongodb": "^7.5.0",
|
|
41
|
+
"mongoose": "^9.8.0",
|
|
42
|
+
"nestjs-pino": "^4.6.1",
|
|
43
|
+
"pino-loki": "^3.0.0",
|
|
44
|
+
"pino-pretty": "^13.1.3",
|
|
45
|
+
"redis": "^6.1.0",
|
|
46
|
+
"request-ip": "^2.2.0",
|
|
47
|
+
"sharp": "^0.34.5",
|
|
48
|
+
"sqs-consumer": "^15.0.4",
|
|
49
|
+
"@euler-edu/constant": "7.0.1-beta0",
|
|
50
|
+
"@euler-edu/schema": "7.0.1-beta0",
|
|
51
|
+
"@euler-edu/utils": "7.0.1-beta0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/express": "^5.0.6",
|
|
55
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
56
|
+
"@types/node": "^20.19.33",
|
|
57
|
+
"@types/request-ip": "^0.0.41"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"preinstall": "npx only-allow pnpm",
|
|
61
|
+
"clean": "rimraf lib",
|
|
62
|
+
"build": "tsc && tsc-alias",
|
|
63
|
+
"format": "prettier --write src"
|
|
64
|
+
}
|
|
6
65
|
}
|
package/README.md
DELETED