@saltsquareio/nestjs-backend-platform 0.0.1
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/LICENSE +21 -0
- package/README.md +72 -0
- package/dist/cli/migrate.d.ts +2 -0
- package/dist/cli/migrate.js +34 -0
- package/dist/cli/migrate.js.map +1 -0
- package/dist/core/ai/ai.module.d.ts +5 -0
- package/dist/core/ai/ai.module.js +53 -0
- package/dist/core/ai/ai.module.js.map +1 -0
- package/dist/core/ai/ai.options.d.ts +33 -0
- package/dist/core/ai/ai.options.js +14 -0
- package/dist/core/ai/ai.options.js.map +1 -0
- package/dist/core/ai/ai.service.d.ts +49 -0
- package/dist/core/ai/ai.service.js +381 -0
- package/dist/core/ai/ai.service.js.map +1 -0
- package/dist/core/ai/ai.types.d.ts +133 -0
- package/dist/core/ai/ai.types.js +3 -0
- package/dist/core/ai/ai.types.js.map +1 -0
- package/dist/core/ai/context/context-formatter.service.d.ts +9 -0
- package/dist/core/ai/context/context-formatter.service.js +66 -0
- package/dist/core/ai/context/context-formatter.service.js.map +1 -0
- package/dist/core/ai/cost/cost-tracking.service.d.ts +12 -0
- package/dist/core/ai/cost/cost-tracking.service.js +65 -0
- package/dist/core/ai/cost/cost-tracking.service.js.map +1 -0
- package/dist/core/ai/entities/ai-invocation-log.entity.d.ts +19 -0
- package/dist/core/ai/entities/ai-invocation-log.entity.js +116 -0
- package/dist/core/ai/entities/ai-invocation-log.entity.js.map +1 -0
- package/dist/core/ai/entities/prompt-template.entity.d.ts +13 -0
- package/dist/core/ai/entities/prompt-template.entity.js +75 -0
- package/dist/core/ai/entities/prompt-template.entity.js.map +1 -0
- package/dist/core/ai/index.d.ts +18 -0
- package/dist/core/ai/index.js +36 -0
- package/dist/core/ai/index.js.map +1 -0
- package/dist/core/ai/llm/dummy-llm-model.d.ts +9 -0
- package/dist/core/ai/llm/dummy-llm-model.js +18 -0
- package/dist/core/ai/llm/dummy-llm-model.js.map +1 -0
- package/dist/core/ai/llm/index.d.ts +2 -0
- package/dist/core/ai/llm/index.js +19 -0
- package/dist/core/ai/llm/index.js.map +1 -0
- package/dist/core/ai/llm/openai-llm-model.d.ts +10 -0
- package/dist/core/ai/llm/openai-llm-model.js +46 -0
- package/dist/core/ai/llm/openai-llm-model.js.map +1 -0
- package/dist/core/ai/llm-model.d.ts +17 -0
- package/dist/core/ai/llm-model.js +3 -0
- package/dist/core/ai/llm-model.js.map +1 -0
- package/dist/core/ai/memory/memory.service.d.ts +18 -0
- package/dist/core/ai/memory/memory.service.js +157 -0
- package/dist/core/ai/memory/memory.service.js.map +1 -0
- package/dist/core/ai/memory/memory.types.d.ts +6 -0
- package/dist/core/ai/memory/memory.types.js +3 -0
- package/dist/core/ai/memory/memory.types.js.map +1 -0
- package/dist/core/ai/memory/memory.utils.d.ts +1 -0
- package/dist/core/ai/memory/memory.utils.js +17 -0
- package/dist/core/ai/memory/memory.utils.js.map +1 -0
- package/dist/core/ai/model-registry.service.d.ts +19 -0
- package/dist/core/ai/model-registry.service.js +60 -0
- package/dist/core/ai/model-registry.service.js.map +1 -0
- package/dist/core/ai/model-resolver.service.d.ts +6 -0
- package/dist/core/ai/model-resolver.service.js +28 -0
- package/dist/core/ai/model-resolver.service.js.map +1 -0
- package/dist/core/ai/prompt-builder.service.d.ts +16 -0
- package/dist/core/ai/prompt-builder.service.js +34 -0
- package/dist/core/ai/prompt-builder.service.js.map +1 -0
- package/dist/core/ai/provider/provider-factory.service.d.ts +18 -0
- package/dist/core/ai/provider/provider-factory.service.js +60 -0
- package/dist/core/ai/provider/provider-factory.service.js.map +1 -0
- package/dist/core/ai/safety/safety-guardrail.service.d.ts +9 -0
- package/dist/core/ai/safety/safety-guardrail.service.js +65 -0
- package/dist/core/ai/safety/safety-guardrail.service.js.map +1 -0
- package/dist/core/ai/summarization/summarization.service.d.ts +24 -0
- package/dist/core/ai/summarization/summarization.service.js +66 -0
- package/dist/core/ai/summarization/summarization.service.js.map +1 -0
- package/dist/core/ai/template/template.service.d.ts +14 -0
- package/dist/core/ai/template/template.service.js +88 -0
- package/dist/core/ai/template/template.service.js.map +1 -0
- package/dist/core/audit-log/audit-log.entity.d.ts +13 -0
- package/dist/core/audit-log/audit-log.entity.js +72 -0
- package/dist/core/audit-log/audit-log.entity.js.map +1 -0
- package/dist/core/audit-log/audit-log.module.d.ts +2 -0
- package/dist/core/audit-log/audit-log.module.js +25 -0
- package/dist/core/audit-log/audit-log.module.js.map +1 -0
- package/dist/core/audit-log/audit-log.service.d.ts +20 -0
- package/dist/core/audit-log/audit-log.service.js +59 -0
- package/dist/core/audit-log/audit-log.service.js.map +1 -0
- package/dist/core/audit-log/index.d.ts +6 -0
- package/dist/core/audit-log/index.js +11 -0
- package/dist/core/audit-log/index.js.map +1 -0
- package/dist/core/auth/auth.provider.d.ts +4 -0
- package/dist/core/auth/auth.provider.js +3 -0
- package/dist/core/auth/auth.provider.js.map +1 -0
- package/dist/core/auth/decorators.d.ts +4 -0
- package/dist/core/auth/decorators.js +11 -0
- package/dist/core/auth/decorators.js.map +1 -0
- package/dist/core/auth/index.d.ts +6 -0
- package/dist/core/auth/index.js +23 -0
- package/dist/core/auth/index.js.map +1 -0
- package/dist/core/auth/params.d.ts +2 -0
- package/dist/core/auth/params.js +23 -0
- package/dist/core/auth/params.js.map +1 -0
- package/dist/core/auth/role.can-activate.d.ts +10 -0
- package/dist/core/auth/role.can-activate.js +42 -0
- package/dist/core/auth/role.can-activate.js.map +1 -0
- package/dist/core/auth/types.d.ts +6 -0
- package/dist/core/auth/types.js +3 -0
- package/dist/core/auth/types.js.map +1 -0
- package/dist/core/auth/utils.d.ts +4 -0
- package/dist/core/auth/utils.js +22 -0
- package/dist/core/auth/utils.js.map +1 -0
- package/dist/core/configuration/coerce.d.ts +2 -0
- package/dist/core/configuration/coerce.js +8 -0
- package/dist/core/configuration/coerce.js.map +1 -0
- package/dist/core/configuration/configuration.module.d.ts +9 -0
- package/dist/core/configuration/configuration.module.js +38 -0
- package/dist/core/configuration/configuration.module.js.map +1 -0
- package/dist/core/configuration/define-config.d.ts +2 -0
- package/dist/core/configuration/define-config.js +20 -0
- package/dist/core/configuration/define-config.js.map +1 -0
- package/dist/core/configuration/env-files.d.ts +1 -0
- package/dist/core/configuration/env-files.js +7 -0
- package/dist/core/configuration/env-files.js.map +1 -0
- package/dist/core/configuration/index.d.ts +5 -0
- package/dist/core/configuration/index.js +22 -0
- package/dist/core/configuration/index.js.map +1 -0
- package/dist/core/configuration/schemas/app.schema.d.ts +16 -0
- package/dist/core/configuration/schemas/app.schema.js +23 -0
- package/dist/core/configuration/schemas/app.schema.js.map +1 -0
- package/dist/core/database/common.d.ts +12 -0
- package/dist/core/database/common.js +15 -0
- package/dist/core/database/common.js.map +1 -0
- package/dist/core/database/custom-snake-case-naming-strategy.d.ts +9 -0
- package/dist/core/database/custom-snake-case-naming-strategy.js +28 -0
- package/dist/core/database/custom-snake-case-naming-strategy.js.map +1 -0
- package/dist/core/database/database.config.d.ts +4 -0
- package/dist/core/database/database.config.js +39 -0
- package/dist/core/database/database.config.js.map +1 -0
- package/dist/core/database/database.module.d.ts +7 -0
- package/dist/core/database/database.module.js +58 -0
- package/dist/core/database/database.module.js.map +1 -0
- package/dist/core/database/database.schema.d.ts +41 -0
- package/dist/core/database/database.schema.js +33 -0
- package/dist/core/database/database.schema.js.map +1 -0
- package/dist/core/database/index.d.ts +5 -0
- package/dist/core/database/index.js +22 -0
- package/dist/core/database/index.js.map +1 -0
- package/dist/core/database/ssl-config.d.ts +3 -0
- package/dist/core/database/ssl-config.js +8 -0
- package/dist/core/database/ssl-config.js.map +1 -0
- package/dist/core/exception/all-exceptions.filter.d.ts +8 -0
- package/dist/core/exception/all-exceptions.filter.js +56 -0
- package/dist/core/exception/all-exceptions.filter.js.map +1 -0
- package/dist/core/exception/index.d.ts +1 -0
- package/dist/core/exception/index.js +18 -0
- package/dist/core/exception/index.js.map +1 -0
- package/dist/core/exception/utils.d.ts +6 -0
- package/dist/core/exception/utils.js +15 -0
- package/dist/core/exception/utils.js.map +1 -0
- package/dist/core/health/health.controller.d.ts +9 -0
- package/dist/core/health/health.controller.js +52 -0
- package/dist/core/health/health.controller.js.map +1 -0
- package/dist/core/health/health.module.d.ts +2 -0
- package/dist/core/health/health.module.js +24 -0
- package/dist/core/health/health.module.js.map +1 -0
- package/dist/core/health/index.d.ts +1 -0
- package/dist/core/health/index.js +18 -0
- package/dist/core/health/index.js.map +1 -0
- package/dist/core/health/shutdown-handler.d.ts +2 -0
- package/dist/core/health/shutdown-handler.js +20 -0
- package/dist/core/health/shutdown-handler.js.map +1 -0
- package/dist/core/health/shutdown.service.d.ts +11 -0
- package/dist/core/health/shutdown.service.js +54 -0
- package/dist/core/health/shutdown.service.js.map +1 -0
- package/dist/core/http/http.circuit-breaker.d.ts +4 -0
- package/dist/core/http/http.circuit-breaker.js +25 -0
- package/dist/core/http/http.circuit-breaker.js.map +1 -0
- package/dist/core/http/http.client.factory.d.ts +3 -0
- package/dist/core/http/http.client.factory.js +32 -0
- package/dist/core/http/http.client.factory.js.map +1 -0
- package/dist/core/http/http.module.d.ts +2 -0
- package/dist/core/http/http.module.js +19 -0
- package/dist/core/http/http.module.js.map +1 -0
- package/dist/core/http/http.open-api.d.ts +8 -0
- package/dist/core/http/http.open-api.js +22 -0
- package/dist/core/http/http.open-api.js.map +1 -0
- package/dist/core/http/http.types.d.ts +6 -0
- package/dist/core/http/http.types.js +3 -0
- package/dist/core/http/http.types.js.map +1 -0
- package/dist/core/http/index.d.ts +4 -0
- package/dist/core/http/index.js +21 -0
- package/dist/core/http/index.js.map +1 -0
- package/dist/core/info/index.d.ts +1 -0
- package/dist/core/info/index.js +18 -0
- package/dist/core/info/index.js.map +1 -0
- package/dist/core/info/info.controller.d.ts +3 -0
- package/dist/core/info/info.controller.js +33 -0
- package/dist/core/info/info.controller.js.map +1 -0
- package/dist/core/info/info.module.d.ts +6 -0
- package/dist/core/info/info.module.js +27 -0
- package/dist/core/info/info.module.js.map +1 -0
- package/dist/core/info/info.utils.d.ts +13 -0
- package/dist/core/info/info.utils.js +32 -0
- package/dist/core/info/info.utils.js.map +1 -0
- package/dist/core/logger/hash-pii.d.ts +1 -0
- package/dist/core/logger/hash-pii.js +13 -0
- package/dist/core/logger/hash-pii.js.map +1 -0
- package/dist/core/logger/index.d.ts +4 -0
- package/dist/core/logger/index.js +21 -0
- package/dist/core/logger/index.js.map +1 -0
- package/dist/core/logger/logger.module.d.ts +2 -0
- package/dist/core/logger/logger.module.js +30 -0
- package/dist/core/logger/logger.module.js.map +1 -0
- package/dist/core/logger/logging.interceptor.d.ts +8 -0
- package/dist/core/logger/logging.interceptor.js +51 -0
- package/dist/core/logger/logging.interceptor.js.map +1 -0
- package/dist/core/logger/pino.config.d.ts +9 -0
- package/dist/core/logger/pino.config.js +47 -0
- package/dist/core/logger/pino.config.js.map +1 -0
- package/dist/core/migrations/create-migration-data-source.d.ts +8 -0
- package/dist/core/migrations/create-migration-data-source.js +18 -0
- package/dist/core/migrations/create-migration-data-source.js.map +1 -0
- package/dist/core/migrations/index.d.ts +3 -0
- package/dist/core/migrations/index.js +20 -0
- package/dist/core/migrations/index.js.map +1 -0
- package/dist/core/migrations/platform-entities.d.ts +2 -0
- package/dist/core/migrations/platform-entities.js +10 -0
- package/dist/core/migrations/platform-entities.js.map +1 -0
- package/dist/core/migrations/run-migrations.d.ts +3 -0
- package/dist/core/migrations/run-migrations.js +80 -0
- package/dist/core/migrations/run-migrations.js.map +1 -0
- package/dist/core/newrelic/index.d.ts +1 -0
- package/dist/core/newrelic/index.js +18 -0
- package/dist/core/newrelic/index.js.map +1 -0
- package/dist/core/newrelic/newrelic.utils.d.ts +2 -0
- package/dist/core/newrelic/newrelic.utils.js +31 -0
- package/dist/core/newrelic/newrelic.utils.js.map +1 -0
- package/dist/core/scheduler/index.d.ts +3 -0
- package/dist/core/scheduler/index.js +20 -0
- package/dist/core/scheduler/index.js.map +1 -0
- package/dist/core/scheduler/scheduled-cron.decorator.d.ts +6 -0
- package/dist/core/scheduler/scheduled-cron.decorator.js +31 -0
- package/dist/core/scheduler/scheduled-cron.decorator.js.map +1 -0
- package/dist/core/scheduler/scheduler-control.service.d.ts +14 -0
- package/dist/core/scheduler/scheduler-control.service.js +42 -0
- package/dist/core/scheduler/scheduler-control.service.js.map +1 -0
- package/dist/core/scheduler/scheduler.module.d.ts +4 -0
- package/dist/core/scheduler/scheduler.module.js +27 -0
- package/dist/core/scheduler/scheduler.module.js.map +1 -0
- package/dist/core/throttler/index.d.ts +7 -0
- package/dist/core/throttler/index.js +25 -0
- package/dist/core/throttler/index.js.map +1 -0
- package/dist/core/throttler/pg-throttler.storage.d.ts +10 -0
- package/dist/core/throttler/pg-throttler.storage.js +58 -0
- package/dist/core/throttler/pg-throttler.storage.js.map +1 -0
- package/dist/core/throttler/rate-limit-hit.entity.d.ts +6 -0
- package/dist/core/throttler/rate-limit-hit.entity.js +36 -0
- package/dist/core/throttler/rate-limit-hit.entity.js.map +1 -0
- package/dist/core/throttler/throttler-cleanup.service.d.ts +7 -0
- package/dist/core/throttler/throttler-cleanup.service.js +41 -0
- package/dist/core/throttler/throttler-cleanup.service.js.map +1 -0
- package/dist/core/throttler/throttler-tracker.d.ts +2 -0
- package/dist/core/throttler/throttler-tracker.js +29 -0
- package/dist/core/throttler/throttler-tracker.js.map +1 -0
- package/dist/core/throttler/throttler.module.d.ts +2 -0
- package/dist/core/throttler/throttler.module.js +41 -0
- package/dist/core/throttler/throttler.module.js.map +1 -0
- package/dist/core/utils/app-initializer.d.ts +5 -0
- package/dist/core/utils/app-initializer.js +37 -0
- package/dist/core/utils/app-initializer.js.map +1 -0
- package/dist/core/utils/feature-flag.d.ts +1 -0
- package/dist/core/utils/feature-flag.js +10 -0
- package/dist/core/utils/feature-flag.js.map +1 -0
- package/dist/core/utils/index.d.ts +5 -0
- package/dist/core/utils/index.js +22 -0
- package/dist/core/utils/index.js.map +1 -0
- package/dist/core/utils/parse-allowed-origins.d.ts +1 -0
- package/dist/core/utils/parse-allowed-origins.js +21 -0
- package/dist/core/utils/parse-allowed-origins.js.map +1 -0
- package/dist/core/utils/security-middleware.d.ts +2 -0
- package/dist/core/utils/security-middleware.js +19 -0
- package/dist/core/utils/security-middleware.js.map +1 -0
- package/dist/core/utils/with-timeout.d.ts +4 -0
- package/dist/core/utils/with-timeout.js +23 -0
- package/dist/core/utils/with-timeout.js.map +1 -0
- package/dist/core/ws/index.d.ts +4 -0
- package/dist/core/ws/index.js +23 -0
- package/dist/core/ws/index.js.map +1 -0
- package/dist/core/ws/validate-ws-dto.d.ts +1 -0
- package/dist/core/ws/validate-ws-dto.js +14 -0
- package/dist/core/ws/validate-ws-dto.js.map +1 -0
- package/dist/core/ws/ws-token.module.d.ts +2 -0
- package/dist/core/ws/ws-token.module.js +21 -0
- package/dist/core/ws/ws-token.module.js.map +1 -0
- package/dist/core/ws/ws-token.service.d.ts +8 -0
- package/dist/core/ws/ws-token.service.js +57 -0
- package/dist/core/ws/ws-token.service.js.map +1 -0
- package/dist/core/ws/ws.constants.d.ts +7 -0
- package/dist/core/ws/ws.constants.js +11 -0
- package/dist/core/ws/ws.constants.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/package.json +167 -0
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
var SchedulerControlService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SchedulerControlService = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const config_1 = require("@nestjs/config");
|
|
16
|
+
const schedule_1 = require("@nestjs/schedule");
|
|
17
|
+
let SchedulerControlService = SchedulerControlService_1 = class SchedulerControlService {
|
|
18
|
+
constructor(schedulerRegistry, configService) {
|
|
19
|
+
this.schedulerRegistry = schedulerRegistry;
|
|
20
|
+
this.configService = configService;
|
|
21
|
+
this.logger = new common_1.Logger(SchedulerControlService_1.name);
|
|
22
|
+
}
|
|
23
|
+
onApplicationBootstrap() {
|
|
24
|
+
const enabled = this.configService.get('SCHEDULER_ENABLED', { infer: true }) !== 'false';
|
|
25
|
+
const jobs = this.schedulerRegistry.getCronJobs();
|
|
26
|
+
if (!enabled) {
|
|
27
|
+
this.logger.log(`Scheduler disabled (SCHEDULER_ENABLED=false). ${jobs.size} cron job(s) will remain stopped.`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
for (const [name, job] of jobs) {
|
|
31
|
+
job.start();
|
|
32
|
+
this.logger.log(`Started cron job: ${name}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.SchedulerControlService = SchedulerControlService;
|
|
37
|
+
exports.SchedulerControlService = SchedulerControlService = SchedulerControlService_1 = __decorate([
|
|
38
|
+
(0, common_1.Injectable)(),
|
|
39
|
+
__metadata("design:paramtypes", [schedule_1.SchedulerRegistry,
|
|
40
|
+
config_1.ConfigService])
|
|
41
|
+
], SchedulerControlService);
|
|
42
|
+
//# sourceMappingURL=scheduler-control.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler-control.service.js","sourceRoot":"","sources":["../../../src/core/scheduler/scheduler-control.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4E;AAC5E,2CAA+C;AAC/C,+CAAqD;AAO9C,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAGlC,YACmB,iBAAoC,EACpC,aAAkD;QADlD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,kBAAa,GAAb,aAAa,CAAqC;QAJpD,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IAKhE,CAAC;IAEJ,sBAAsB;QACpB,MAAM,OAAO,GACX,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;QAE3E,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;QAElD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,iDAAiD,IAAI,CAAC,IAAI,mCAAmC,CAC9F,CAAC;YACF,OAAO;QACT,CAAC;QAED,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;YAC/B,GAAG,CAAC,KAAK,EAAE,CAAC;YACZ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF,CAAA;AA1BY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;qCAK2B,4BAAiB;QACrB,sBAAa;GALpC,uBAAuB,CA0BnC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 SchedulerModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SchedulerModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const schedule_1 = require("@nestjs/schedule");
|
|
13
|
+
const scheduler_control_service_1 = require("./scheduler-control.service");
|
|
14
|
+
let SchedulerModule = SchedulerModule_1 = class SchedulerModule {
|
|
15
|
+
static forRoot() {
|
|
16
|
+
return {
|
|
17
|
+
module: SchedulerModule_1,
|
|
18
|
+
imports: [schedule_1.ScheduleModule.forRoot()],
|
|
19
|
+
providers: [scheduler_control_service_1.SchedulerControlService],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.SchedulerModule = SchedulerModule;
|
|
24
|
+
exports.SchedulerModule = SchedulerModule = SchedulerModule_1 = __decorate([
|
|
25
|
+
(0, common_1.Module)({})
|
|
26
|
+
], SchedulerModule);
|
|
27
|
+
//# sourceMappingURL=scheduler.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.module.js","sourceRoot":"","sources":["../../../src/core/scheduler/scheduler.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,+CAAkD;AAClD,2EAAsE;AAG/D,IAAM,eAAe,uBAArB,MAAM,eAAe;IAC1B,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,iBAAe;YACvB,OAAO,EAAE,CAAC,yBAAc,CAAC,OAAO,EAAE,CAAC;YACnC,SAAS,EAAE,CAAC,mDAAuB,CAAC;SACrC,CAAC;IACJ,CAAC;CACF,CAAA;AARY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,eAAe,CAQ3B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RateLimitHit } from './rate-limit-hit.entity';
|
|
2
|
+
export * from './pg-throttler.storage';
|
|
3
|
+
export * from './rate-limit-hit.entity';
|
|
4
|
+
export * from './throttler.module';
|
|
5
|
+
export * from './throttler-cleanup.service';
|
|
6
|
+
export * from './throttler-tracker';
|
|
7
|
+
export declare const THROTTLER_ENTITIES: (typeof RateLimitHit)[];
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
exports.THROTTLER_ENTITIES = void 0;
|
|
18
|
+
const rate_limit_hit_entity_1 = require("./rate-limit-hit.entity");
|
|
19
|
+
__exportStar(require("./pg-throttler.storage"), exports);
|
|
20
|
+
__exportStar(require("./rate-limit-hit.entity"), exports);
|
|
21
|
+
__exportStar(require("./throttler.module"), exports);
|
|
22
|
+
__exportStar(require("./throttler-cleanup.service"), exports);
|
|
23
|
+
__exportStar(require("./throttler-tracker"), exports);
|
|
24
|
+
exports.THROTTLER_ENTITIES = [rate_limit_hit_entity_1.RateLimitHit];
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/throttler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mEAAuD;AAEvD,yDAAuC;AACvC,0DAAwC;AACxC,qDAAmC;AACnC,8DAA4C;AAC5C,sDAAoC;AAEvB,QAAA,kBAAkB,GAAG,CAAC,oCAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ThrottlerStorage } from '@nestjs/throttler';
|
|
2
|
+
import type { ThrottlerStorageRecord } from '@nestjs/throttler/dist/throttler-storage-record.interface';
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
4
|
+
import { RateLimitHit } from './rate-limit-hit.entity';
|
|
5
|
+
export declare class PgThrottlerStorage implements ThrottlerStorage {
|
|
6
|
+
private readonly repo;
|
|
7
|
+
constructor(repo: Repository<RateLimitHit>);
|
|
8
|
+
increment(key: string, ttl: number, limit: number, _blockDuration: number, _throttlerName: string): Promise<ThrottlerStorageRecord>;
|
|
9
|
+
prune(olderThan?: Date): Promise<number>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PgThrottlerStorage = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const rate_limit_hit_entity_1 = require("./rate-limit-hit.entity");
|
|
20
|
+
let PgThrottlerStorage = class PgThrottlerStorage {
|
|
21
|
+
constructor(repo) {
|
|
22
|
+
this.repo = repo;
|
|
23
|
+
}
|
|
24
|
+
async increment(key, ttl, limit, _blockDuration, _throttlerName) {
|
|
25
|
+
const now = Date.now();
|
|
26
|
+
const windowStartMs = Math.floor(now / ttl) * ttl;
|
|
27
|
+
const expiresAtMs = windowStartMs + ttl;
|
|
28
|
+
const rows = await this.repo.query(`INSERT INTO "rate_limit_hits" ("key", "window_start", "hits", "expires_at")
|
|
29
|
+
VALUES ($1, $2, 1, $3)
|
|
30
|
+
ON CONFLICT ("key", "window_start")
|
|
31
|
+
DO UPDATE SET "hits" = "rate_limit_hits"."hits" + 1
|
|
32
|
+
RETURNING "hits"`, [key, new Date(windowStartMs), new Date(expiresAtMs)]);
|
|
33
|
+
const totalHits = rows[0]?.hits ?? 1;
|
|
34
|
+
const timeToExpire = Math.max(0, expiresAtMs - now);
|
|
35
|
+
const isBlocked = totalHits > limit;
|
|
36
|
+
return {
|
|
37
|
+
totalHits,
|
|
38
|
+
timeToExpire,
|
|
39
|
+
isBlocked,
|
|
40
|
+
timeToBlockExpire: isBlocked ? timeToExpire : 0,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async prune(olderThan = new Date()) {
|
|
44
|
+
const result = await this.repo
|
|
45
|
+
.createQueryBuilder()
|
|
46
|
+
.delete()
|
|
47
|
+
.where('expires_at < :olderThan', { olderThan })
|
|
48
|
+
.execute();
|
|
49
|
+
return result.affected ?? 0;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.PgThrottlerStorage = PgThrottlerStorage;
|
|
53
|
+
exports.PgThrottlerStorage = PgThrottlerStorage = __decorate([
|
|
54
|
+
(0, common_1.Injectable)(),
|
|
55
|
+
__param(0, (0, typeorm_1.InjectRepository)(rate_limit_hit_entity_1.RateLimitHit)),
|
|
56
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
57
|
+
], PgThrottlerStorage);
|
|
58
|
+
//# sourceMappingURL=pg-throttler.storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg-throttler.storage.js","sourceRoot":"","sources":["../../../src/core/throttler/pg-throttler.storage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AAGnD,qCAAqC;AACrC,mEAAuD;AAShD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAEmB,IAA8B;QAA9B,SAAI,GAAJ,IAAI,CAA0B;IAC9C,CAAC;IAEJ,KAAK,CAAC,SAAS,CACb,GAAW,EACX,GAAW,EACX,KAAa,EACb,cAAsB,EACtB,cAAsB;QAEtB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAClD,MAAM,WAAW,GAAG,aAAa,GAAG,GAAG,CAAC;QAExC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAChC;;;;wBAIkB,EAClB,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CACtD,CAAC;QAEF,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,GAAG,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;QAEpC,OAAO;YACL,SAAS;YACT,YAAY;YACZ,SAAS;YACT,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SAChD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,YAAkB,IAAI,IAAI,EAAE;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI;aAC3B,kBAAkB,EAAE;aACpB,MAAM,EAAE;aACR,KAAK,CAAC,yBAAyB,EAAE,EAAE,SAAS,EAAE,CAAC;aAC/C,OAAO,EAAE,CAAC;QACb,OAAO,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF,CAAA;AA9CY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,oCAAY,CAAC,CAAA;qCACR,oBAAU;GAHxB,kBAAkB,CA8C9B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.RateLimitHit = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let RateLimitHit = class RateLimitHit {
|
|
15
|
+
};
|
|
16
|
+
exports.RateLimitHit = RateLimitHit;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryColumn)({ name: 'key', type: 'varchar', length: 255 }),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], RateLimitHit.prototype, "key", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryColumn)({ name: 'window_start', type: 'timestamptz' }),
|
|
23
|
+
__metadata("design:type", Date)
|
|
24
|
+
], RateLimitHit.prototype, "windowStart", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ name: 'hits', type: 'int', default: 1 }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], RateLimitHit.prototype, "hits", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ name: 'expires_at', type: 'timestamptz' }),
|
|
31
|
+
__metadata("design:type", Date)
|
|
32
|
+
], RateLimitHit.prototype, "expiresAt", void 0);
|
|
33
|
+
exports.RateLimitHit = RateLimitHit = __decorate([
|
|
34
|
+
(0, typeorm_1.Entity)({ name: 'rate_limit_hits' })
|
|
35
|
+
], RateLimitHit);
|
|
36
|
+
//# sourceMappingURL=rate-limit-hit.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limit-hit.entity.js","sourceRoot":"","sources":["../../../src/core/throttler/rate-limit-hit.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwD;AAGjD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAYxB,CAAA;AAZY,oCAAY;AAEvB;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;yCACjD;AAGZ;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BAChD,IAAI;iDAAC;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0CACrC;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACzC,IAAI;+CAAC;uBAXL,YAAY;IADxB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;GACvB,YAAY,CAYxB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
var ThrottlerCleanupService_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ThrottlerCleanupService = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const schedule_1 = require("@nestjs/schedule");
|
|
16
|
+
const pg_throttler_storage_1 = require("./pg-throttler.storage");
|
|
17
|
+
let ThrottlerCleanupService = ThrottlerCleanupService_1 = class ThrottlerCleanupService {
|
|
18
|
+
constructor(storage) {
|
|
19
|
+
this.storage = storage;
|
|
20
|
+
this.logger = new common_1.Logger(ThrottlerCleanupService_1.name);
|
|
21
|
+
}
|
|
22
|
+
async pruneExpiredRateLimitHits() {
|
|
23
|
+
const olderThan = new Date(Date.now() - 24 * 60 * 60 * 1000);
|
|
24
|
+
const deleted = await this.storage.prune(olderThan);
|
|
25
|
+
if (deleted > 0) {
|
|
26
|
+
this.logger.log({ deleted }, 'Pruned expired rate-limit buckets older than 24h');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.ThrottlerCleanupService = ThrottlerCleanupService;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, schedule_1.Cron)(schedule_1.CronExpression.EVERY_DAY_AT_3AM),
|
|
33
|
+
__metadata("design:type", Function),
|
|
34
|
+
__metadata("design:paramtypes", []),
|
|
35
|
+
__metadata("design:returntype", Promise)
|
|
36
|
+
], ThrottlerCleanupService.prototype, "pruneExpiredRateLimitHits", null);
|
|
37
|
+
exports.ThrottlerCleanupService = ThrottlerCleanupService = ThrottlerCleanupService_1 = __decorate([
|
|
38
|
+
(0, common_1.Injectable)(),
|
|
39
|
+
__metadata("design:paramtypes", [pg_throttler_storage_1.PgThrottlerStorage])
|
|
40
|
+
], ThrottlerCleanupService);
|
|
41
|
+
//# sourceMappingURL=throttler-cleanup.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttler-cleanup.service.js","sourceRoot":"","sources":["../../../src/core/throttler/throttler-cleanup.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+CAAwD;AACxD,iEAA4D;AAGrD,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAGlC,YAA6B,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;QAFvC,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IAER,CAAC;IAGtD,AAAN,KAAK,CAAC,yBAAyB;QAC7B,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,EAAE,OAAO,EAAE,EACX,kDAAkD,CACnD,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAhBY,0DAAuB;AAM5B;IADL,IAAA,eAAI,EAAC,yBAAc,CAAC,gBAAgB,CAAC;;;;wEAUrC;kCAfU,uBAAuB;IADnC,IAAA,mBAAU,GAAE;qCAI2B,yCAAkB;GAH7C,uBAAuB,CAgBnC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveClientIp = resolveClientIp;
|
|
4
|
+
function resolveClientIp(req) {
|
|
5
|
+
const cf = headerValue(req.headers['cf-connecting-ip']);
|
|
6
|
+
if (cf)
|
|
7
|
+
return cf;
|
|
8
|
+
const xff = headerValue(req.headers['x-forwarded-for']);
|
|
9
|
+
if (xff) {
|
|
10
|
+
const first = xff.split(',')[0]?.trim();
|
|
11
|
+
if (first)
|
|
12
|
+
return first;
|
|
13
|
+
}
|
|
14
|
+
const reqIp = req.ip;
|
|
15
|
+
if (reqIp)
|
|
16
|
+
return reqIp;
|
|
17
|
+
const socketIp = req.socket?.remoteAddress;
|
|
18
|
+
if (socketIp)
|
|
19
|
+
return socketIp;
|
|
20
|
+
return 'unknown';
|
|
21
|
+
}
|
|
22
|
+
function headerValue(value) {
|
|
23
|
+
if (!value)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (Array.isArray(value))
|
|
26
|
+
return value[0];
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=throttler-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttler-tracker.js","sourceRoot":"","sources":["../../../src/core/throttler/throttler-tracker.ts"],"names":[],"mappings":";;AAOA,0CAiBC;AAjBD,SAAgB,eAAe,CAAC,GAAoB;IAClD,MAAM,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACxD,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC;IAElB,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxD,IAAI,GAAG,EAAE,CAAC;QACR,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QACxC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;IAC1B,CAAC;IAED,MAAM,KAAK,GAAI,GAAyC,CAAC,EAAE,CAAC;IAC5D,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IAExB,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC;IAC3C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,WAAW,CAAC,KAAoC;IACvD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.ThrottlerModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const core_1 = require("@nestjs/core");
|
|
12
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
13
|
+
const throttler_1 = require("@nestjs/throttler");
|
|
14
|
+
const pg_throttler_storage_1 = require("./pg-throttler.storage");
|
|
15
|
+
const rate_limit_hit_entity_1 = require("./rate-limit-hit.entity");
|
|
16
|
+
const throttler_cleanup_service_1 = require("./throttler-cleanup.service");
|
|
17
|
+
const throttler_tracker_1 = require("./throttler-tracker");
|
|
18
|
+
const ONE_MIN_MS = 60 * 1000;
|
|
19
|
+
let ThrottlerModule = class ThrottlerModule {
|
|
20
|
+
};
|
|
21
|
+
exports.ThrottlerModule = ThrottlerModule;
|
|
22
|
+
exports.ThrottlerModule = ThrottlerModule = __decorate([
|
|
23
|
+
(0, common_1.Module)({
|
|
24
|
+
imports: [
|
|
25
|
+
typeorm_1.TypeOrmModule.forFeature([rate_limit_hit_entity_1.RateLimitHit]),
|
|
26
|
+
throttler_1.ThrottlerModule.forRoot({
|
|
27
|
+
throttlers: [{ name: 'default', limit: 120, ttl: ONE_MIN_MS }],
|
|
28
|
+
getTracker: (req) => (0, throttler_tracker_1.resolveClientIp)(req),
|
|
29
|
+
skipIf: () => process.env.NODE_ENV === 'test',
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
providers: [
|
|
33
|
+
pg_throttler_storage_1.PgThrottlerStorage,
|
|
34
|
+
throttler_cleanup_service_1.ThrottlerCleanupService,
|
|
35
|
+
{ provide: throttler_1.ThrottlerStorage, useExisting: pg_throttler_storage_1.PgThrottlerStorage },
|
|
36
|
+
{ provide: core_1.APP_GUARD, useClass: throttler_1.ThrottlerGuard },
|
|
37
|
+
],
|
|
38
|
+
exports: [pg_throttler_storage_1.PgThrottlerStorage, throttler_1.ThrottlerModule],
|
|
39
|
+
})
|
|
40
|
+
], ThrottlerModule);
|
|
41
|
+
//# sourceMappingURL=throttler.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttler.module.js","sourceRoot":"","sources":["../../../src/core/throttler/throttler.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,2CAAwC;AACxC,uCAAyC;AACzC,6CAAgD;AAChD,iDAI2B;AAC3B,iEAA4D;AAC5D,mEAAuD;AACvD,2EAAsE;AACtE,2DAAsD;AAEtD,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC;AAqBtB,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAnB3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC,CAAC,oCAAY,CAAC,CAAC;YACxC,2BAAmB,CAAC,OAAO,CAAC;gBAC1B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;gBAC9D,UAAU,EAAE,CAAC,GAAoB,EAAE,EAAE,CAAC,IAAA,mCAAe,EAAC,GAAG,CAAC;gBAE1D,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;aAC9C,CAAC;SACH;QACD,SAAS,EAAE;YACT,yCAAkB;YAClB,mDAAuB;YAEvB,EAAE,OAAO,EAAE,4BAAgB,EAAE,WAAW,EAAE,yCAAkB,EAAE;YAC9D,EAAE,OAAO,EAAE,gBAAS,EAAE,QAAQ,EAAE,0BAAc,EAAE;SACjD;QACD,OAAO,EAAE,CAAC,yCAAkB,EAAE,2BAAmB,CAAC;KACnD,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DynamicModule, ForwardReference, Type } from '@nestjs/common';
|
|
2
|
+
import { InitializeOptions } from '../exception';
|
|
3
|
+
type IEntryNestModule = Type<any> | DynamicModule | ForwardReference | Promise<IEntryNestModule>;
|
|
4
|
+
export declare function initialize(appModule: IEntryNestModule, options?: InitializeOptions): Promise<import("@nestjs/common").INestApplication<any>>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initialize = initialize;
|
|
4
|
+
const core_1 = require("@nestjs/core");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const nestjs_pino_1 = require("nestjs-pino");
|
|
7
|
+
const info_utils_1 = require("../info/info.utils");
|
|
8
|
+
const http_open_api_1 = require("../http/http.open-api");
|
|
9
|
+
const shutdown_handler_1 = require("../health/shutdown-handler");
|
|
10
|
+
const exception_1 = require("../exception");
|
|
11
|
+
const feature_flag_1 = require("./feature-flag");
|
|
12
|
+
const security_middleware_1 = require("./security-middleware");
|
|
13
|
+
async function initialize(appModule, options) {
|
|
14
|
+
const app = await core_1.NestFactory.create(appModule, {
|
|
15
|
+
bufferLogs: true,
|
|
16
|
+
});
|
|
17
|
+
app.useLogger(app.get(nestjs_pino_1.Logger));
|
|
18
|
+
(0, security_middleware_1.applySecurityMiddleware)(app);
|
|
19
|
+
const globalPrefix = 'api';
|
|
20
|
+
app.setGlobalPrefix(globalPrefix);
|
|
21
|
+
app.enableVersioning({
|
|
22
|
+
type: common_1.VersioningType.URI,
|
|
23
|
+
defaultVersion: '1',
|
|
24
|
+
});
|
|
25
|
+
(0, exception_1.registerFilters)(app, options);
|
|
26
|
+
if ((0, feature_flag_1.isEnabledByEnv)(process.env.SWAGGER_ENABLED)) {
|
|
27
|
+
const info = info_utils_1.AppInfoSingleton.getInfo();
|
|
28
|
+
(0, http_open_api_1.setupOpenApi)(app, {
|
|
29
|
+
title: info.name,
|
|
30
|
+
description: info.description,
|
|
31
|
+
version: info.version,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
(0, shutdown_handler_1.setupShutdownHandler)(app);
|
|
35
|
+
return app;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=app-initializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-initializer.js","sourceRoot":"","sources":["../../../src/core/utils/app-initializer.ts"],"names":[],"mappings":";;AAqBA,gCAiCC;AAtDD,uCAA2C;AAC3C,2CAKwB;AACxB,6CAAqC;AACrC,mDAAsD;AACtD,yDAAqD;AACrD,iEAAkE;AAClE,4CAAkE;AAClE,iDAAgD;AAChD,+DAAgE;AAQzD,KAAK,UAAU,UAAU,CAC9B,SAA2B,EAC3B,OAA2B;IAE3B,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,SAAS,EAAE;QAC9C,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IAEH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAM,CAAC,CAAC,CAAC;IAE/B,IAAA,6CAAuB,EAAC,GAAG,CAAC,CAAC;IAE7B,MAAM,YAAY,GAAG,KAAK,CAAC;IAC3B,GAAG,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAClC,GAAG,CAAC,gBAAgB,CAAC;QACnB,IAAI,EAAE,uBAAc,CAAC,GAAG;QACxB,cAAc,EAAE,GAAG;KACpB,CAAC,CAAC;IAEH,IAAA,2BAAe,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE9B,IAAI,IAAA,6BAAc,EAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,6BAAgB,CAAC,OAAO,EAAE,CAAC;QACxC,IAAA,4BAAY,EAAC,GAAG,EAAE;YAChB,KAAK,EAAE,IAAI,CAAC,IAAI;YAChB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;IACL,CAAC;IAED,IAAA,uCAAoB,EAAC,GAAG,CAAC,CAAC;IAE1B,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isEnabledByEnv(envValue: string | undefined, nodeEnv?: string | undefined): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEnabledByEnv = isEnabledByEnv;
|
|
4
|
+
function isEnabledByEnv(envValue, nodeEnv = process.env.NODE_ENV) {
|
|
5
|
+
if (envValue !== undefined) {
|
|
6
|
+
return envValue === 'true';
|
|
7
|
+
}
|
|
8
|
+
return nodeEnv !== 'production';
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=feature-flag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-flag.js","sourceRoot":"","sources":["../../../src/core/utils/feature-flag.ts"],"names":[],"mappings":";;AAIA,wCAQC;AARD,SAAgB,cAAc,CAC5B,QAA4B,EAC5B,UAA8B,OAAO,CAAC,GAAG,CAAC,QAAQ;IAElD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,KAAK,MAAM,CAAC;IAC7B,CAAC;IACD,OAAO,OAAO,KAAK,YAAY,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./app-initializer"), exports);
|
|
18
|
+
__exportStar(require("./feature-flag"), exports);
|
|
19
|
+
__exportStar(require("./parse-allowed-origins"), exports);
|
|
20
|
+
__exportStar(require("./security-middleware"), exports);
|
|
21
|
+
__exportStar(require("./with-timeout"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,iDAA+B;AAC/B,0DAAwC;AACxC,wDAAsC;AACtC,iDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseAllowedOrigins(raw?: string | undefined, nodeEnv?: string | undefined): string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAllowedOrigins = parseAllowedOrigins;
|
|
4
|
+
const DEV_DEFAULTS = [
|
|
5
|
+
'http://localhost:3000',
|
|
6
|
+
'http://localhost:3001',
|
|
7
|
+
'http://localhost:4000',
|
|
8
|
+
];
|
|
9
|
+
function parseAllowedOrigins(raw = process.env.ALLOWED_ORIGINS, nodeEnv = process.env.NODE_ENV) {
|
|
10
|
+
if (raw && raw.trim().length > 0) {
|
|
11
|
+
return raw
|
|
12
|
+
.split(',')
|
|
13
|
+
.map((origin) => origin.trim())
|
|
14
|
+
.filter((origin) => origin.length > 0);
|
|
15
|
+
}
|
|
16
|
+
if (nodeEnv === 'production' || nodeEnv === 'staging') {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return DEV_DEFAULTS;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=parse-allowed-origins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-allowed-origins.js","sourceRoot":"","sources":["../../../src/core/utils/parse-allowed-origins.ts"],"names":[],"mappings":";;AAWA,kDAcC;AAzBD,MAAM,YAAY,GAAG;IACnB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;CACxB,CAAC;AAOF,SAAgB,mBAAmB,CACjC,MAA0B,OAAO,CAAC,GAAG,CAAC,eAAe,EACrD,UAA8B,OAAO,CAAC,GAAG,CAAC,QAAQ;IAElD,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,GAAG;aACP,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;aAC9B,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,OAAO,KAAK,YAAY,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACtD,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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.applySecurityMiddleware = applySecurityMiddleware;
|
|
7
|
+
const helmet_1 = __importDefault(require("helmet"));
|
|
8
|
+
const parse_allowed_origins_1 = require("./parse-allowed-origins");
|
|
9
|
+
function applySecurityMiddleware(app) {
|
|
10
|
+
app.use((0, helmet_1.default)({
|
|
11
|
+
hsts: { maxAge: 31536000, includeSubDomains: true, preload: true },
|
|
12
|
+
contentSecurityPolicy: {
|
|
13
|
+
directives: { defaultSrc: ["'self'"], scriptSrc: ["'self'"] },
|
|
14
|
+
},
|
|
15
|
+
referrerPolicy: { policy: 'no-referrer' },
|
|
16
|
+
}));
|
|
17
|
+
app.enableCors({ origin: (0, parse_allowed_origins_1.parseAllowedOrigins)(), credentials: true });
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=security-middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-middleware.js","sourceRoot":"","sources":["../../../src/core/utils/security-middleware.ts"],"names":[],"mappings":";;;;;AAQA,0DAWC;AAlBD,oDAA4B;AAC5B,mEAA8D;AAM9D,SAAgB,uBAAuB,CAAC,GAAqB;IAC3D,GAAG,CAAC,GAAG,CACL,IAAA,gBAAM,EAAC;QACL,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;QAClE,qBAAqB,EAAE;YACrB,UAAU,EAAE,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;SAC9D;QACD,cAAc,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;KAC1C,CAAC,CACH,CAAC;IACF,GAAG,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,IAAA,2CAAmB,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withTimeout = withTimeout;
|
|
4
|
+
async function withTimeout(promise, ms, fallback, onTimeout) {
|
|
5
|
+
let timer;
|
|
6
|
+
const timeout = new Promise((resolve) => {
|
|
7
|
+
timer = setTimeout(() => {
|
|
8
|
+
onTimeout?.();
|
|
9
|
+
resolve({ result: fallback, timedOut: true });
|
|
10
|
+
}, ms);
|
|
11
|
+
});
|
|
12
|
+
try {
|
|
13
|
+
return await Promise.race([
|
|
14
|
+
promise.then((result) => ({ result, timedOut: false })),
|
|
15
|
+
timeout,
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
if (timer)
|
|
20
|
+
clearTimeout(timer);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=with-timeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-timeout.js","sourceRoot":"","sources":["../../../src/core/utils/with-timeout.ts"],"names":[],"mappings":";;AAIA,kCAqBC;AArBM,KAAK,UAAU,WAAW,CAC/B,OAAmB,EACnB,EAAU,EACV,QAAW,EACX,SAAsB;IAEtB,IAAI,KAAgD,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAmC,CAAC,OAAO,EAAE,EAAE;QACxE,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YACtB,SAAS,EAAE,EAAE,CAAC;YACd,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;IACH,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;YACvD,OAAO;SACR,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
exports.validateWsDto = void 0;
|
|
18
|
+
__exportStar(require("./ws.constants"), exports);
|
|
19
|
+
__exportStar(require("./ws-token.service"), exports);
|
|
20
|
+
__exportStar(require("./ws-token.module"), exports);
|
|
21
|
+
var validate_ws_dto_1 = require("./validate-ws-dto");
|
|
22
|
+
Object.defineProperty(exports, "validateWsDto", { enumerable: true, get: function () { return validate_ws_dto_1.validateWsDto; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|