@fiado/type-kit 3.516.0 → 3.518.0
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/_test_/unit/rewardsEligibility/backofficeBarrel.test.ts +17 -0
- package/_test_/unit/rewardsEligibility/campaignAndEventTypeDtos.test.ts +52 -0
- package/_test_/unit/rewardsEligibility/campaignConfigDecorators.test.ts +49 -0
- package/_test_/unit/rewardsEligibility/catalogDtos.test.ts +27 -0
- package/_test_/unit/rewardsEligibility/evaluationDtos.test.ts +53 -0
- package/_test_/unit/rewardsEligibility/events.test.ts +3 -3
- package/_test_/unit/rewardsEligibility/generateRulesRequest.test.ts +50 -0
- package/_test_/unit/rewardsEligibility/generateRulesResponse.test.ts +12 -0
- package/_test_/unit/rewardsEligibility/metricsDtos.test.ts +17 -0
- package/_test_/unit/rewardsEligibility/ruleCatalogRich.test.ts +18 -0
- package/_test_/unit/rewardsEligibility/rulesAiEnums.test.ts +15 -0
- package/_test_/unit/rewardsEligibility/runDtos.test.ts +36 -0
- package/bin/rewardsEligibility/constants/BackofficeLimits.d.ts +16 -0
- package/bin/rewardsEligibility/constants/BackofficeLimits.js +19 -0
- package/bin/rewardsEligibility/dtos/CampaignAlerts.js +20 -0
- package/bin/rewardsEligibility/dtos/CampaignQuota.d.ts +1 -1
- package/bin/rewardsEligibility/dtos/CampaignQuota.js +29 -0
- package/bin/rewardsEligibility/dtos/backoffice/ApproveRunRequest.d.ts +4 -0
- package/bin/rewardsEligibility/dtos/backoffice/ApproveRunRequest.js +27 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignListResponse.d.ts +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignListResponse.js +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignRequest.d.ts +16 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignRequest.js +72 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignResponse.d.ts +23 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignStatusRequest.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignStatusRequest.js +24 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignSummaryResponse.d.ts +28 -0
- package/bin/rewardsEligibility/dtos/backoffice/CampaignSummaryResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/CreateRunRequest.d.ts +11 -0
- package/bin/rewardsEligibility/dtos/backoffice/CreateRunRequest.js +45 -0
- package/bin/rewardsEligibility/dtos/backoffice/CreateRunResponse.d.ts +9 -0
- package/bin/rewardsEligibility/dtos/backoffice/CreateRunResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationListResponse.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationListResponse.js +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationRequest.d.ts +27 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationRequest.js +86 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationResponse.d.ts +26 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationResponse.js +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationStatusRequest.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/EvaluationStatusRequest.js +24 -0
- package/bin/rewardsEligibility/dtos/backoffice/EventTypeListResponse.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/EventTypeListResponse.js +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/EventTypeRequest.d.ts +12 -0
- package/bin/rewardsEligibility/dtos/backoffice/EventTypeRequest.js +58 -0
- package/bin/rewardsEligibility/dtos/backoffice/EventTypeResponse.d.ts +12 -0
- package/bin/rewardsEligibility/dtos/backoffice/EventTypeResponse.js +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/FailedConditionStatResponse.d.ts +8 -0
- package/bin/rewardsEligibility/dtos/backoffice/FailedConditionStatResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/GenerateRulesRequest.d.ts +17 -0
- package/bin/rewardsEligibility/dtos/backoffice/GenerateRulesRequest.js +44 -0
- package/bin/rewardsEligibility/dtos/backoffice/GenerateRulesResponse.d.ts +18 -0
- package/bin/rewardsEligibility/dtos/backoffice/GenerateRulesResponse.js +12 -0
- package/bin/rewardsEligibility/dtos/backoffice/InputTypeResponse.d.ts +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/InputTypeResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/MetricsPointResponse.d.ts +14 -0
- package/bin/rewardsEligibility/dtos/backoffice/MetricsPointResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/MetricsQuery.d.ts +9 -0
- package/bin/rewardsEligibility/dtos/backoffice/MetricsQuery.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/PopulationRunRequest.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/PopulationRunRequest.js +24 -0
- package/bin/rewardsEligibility/dtos/backoffice/PopulationSourceResponse.d.ts +11 -0
- package/bin/rewardsEligibility/dtos/backoffice/PopulationSourceResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/QuotaImpactResponse.d.ts +9 -0
- package/bin/rewardsEligibility/dtos/backoffice/QuotaImpactResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/QuotaUsageResponse.d.ts +10 -0
- package/bin/rewardsEligibility/dtos/backoffice/QuotaUsageResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/ResultTraceResponse.d.ts +34 -0
- package/bin/rewardsEligibility/dtos/backoffice/ResultTraceResponse.js +14 -0
- package/bin/rewardsEligibility/dtos/backoffice/RuleCatalogResponse.d.ts +33 -0
- package/bin/rewardsEligibility/dtos/backoffice/RuleCatalogResponse.js +13 -0
- package/bin/rewardsEligibility/dtos/backoffice/RulesChatTurn.d.ts +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/RulesChatTurn.js +32 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunListResponse.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunListResponse.js +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunResponse.d.ts +24 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunResultListResponse.d.ts +5 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunResultListResponse.js +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunResultResponse.d.ts +22 -0
- package/bin/rewardsEligibility/dtos/backoffice/RunResultResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/SimulateRequest.d.ts +8 -0
- package/bin/rewardsEligibility/dtos/backoffice/SimulateRequest.js +40 -0
- package/bin/rewardsEligibility/dtos/backoffice/SimulateResponse.d.ts +11 -0
- package/bin/rewardsEligibility/dtos/backoffice/SimulateResponse.js +6 -0
- package/bin/rewardsEligibility/enums/MetricsDimensionEnum.d.ts +8 -0
- package/bin/rewardsEligibility/enums/MetricsDimensionEnum.js +12 -0
- package/bin/rewardsEligibility/enums/RewardsEligibilityErrorCodeEnum.d.ts +56 -1
- package/bin/rewardsEligibility/enums/RewardsEligibilityErrorCodeEnum.js +56 -0
- package/bin/rewardsEligibility/enums/RuleValueTypeEnum.d.ts +9 -0
- package/bin/rewardsEligibility/enums/RuleValueTypeEnum.js +13 -0
- package/bin/rewardsEligibility/enums/RulesChatRoleEnum.d.ts +5 -0
- package/bin/rewardsEligibility/enums/RulesChatRoleEnum.js +9 -0
- package/bin/rewardsEligibility/index.d.ts +38 -0
- package/bin/rewardsEligibility/index.js +39 -0
- package/package.json +1 -1
- package/src/rewardsEligibility/constants/BackofficeLimits.ts +16 -0
- package/src/rewardsEligibility/dtos/CampaignAlerts.ts +9 -0
- package/src/rewardsEligibility/dtos/CampaignQuota.ts +13 -1
- package/src/rewardsEligibility/dtos/backoffice/ApproveRunRequest.ts +13 -0
- package/src/rewardsEligibility/dtos/backoffice/CampaignListResponse.ts +7 -0
- package/src/rewardsEligibility/dtos/backoffice/CampaignRequest.ts +53 -0
- package/src/rewardsEligibility/dtos/backoffice/CampaignResponse.ts +24 -0
- package/src/rewardsEligibility/dtos/backoffice/CampaignStatusRequest.ts +10 -0
- package/src/rewardsEligibility/dtos/backoffice/CampaignSummaryResponse.ts +26 -0
- package/src/rewardsEligibility/dtos/backoffice/CreateRunRequest.ts +30 -0
- package/src/rewardsEligibility/dtos/backoffice/CreateRunResponse.ts +10 -0
- package/src/rewardsEligibility/dtos/backoffice/EvaluationListResponse.ts +6 -0
- package/src/rewardsEligibility/dtos/backoffice/EvaluationRequest.ts +69 -0
- package/src/rewardsEligibility/dtos/backoffice/EvaluationResponse.ts +25 -0
- package/src/rewardsEligibility/dtos/backoffice/EvaluationStatusRequest.ts +10 -0
- package/src/rewardsEligibility/dtos/backoffice/EventTypeListResponse.ts +6 -0
- package/src/rewardsEligibility/dtos/backoffice/EventTypeRequest.ts +41 -0
- package/src/rewardsEligibility/dtos/backoffice/EventTypeResponse.ts +13 -0
- package/src/rewardsEligibility/dtos/backoffice/FailedConditionStatResponse.ts +8 -0
- package/src/rewardsEligibility/dtos/backoffice/GenerateRulesRequest.ts +33 -0
- package/src/rewardsEligibility/dtos/backoffice/GenerateRulesResponse.ts +17 -0
- package/src/rewardsEligibility/dtos/backoffice/InputTypeResponse.ts +7 -0
- package/src/rewardsEligibility/dtos/backoffice/MetricsPointResponse.ts +14 -0
- package/src/rewardsEligibility/dtos/backoffice/MetricsQuery.ts +10 -0
- package/src/rewardsEligibility/dtos/backoffice/PopulationRunRequest.ts +11 -0
- package/src/rewardsEligibility/dtos/backoffice/PopulationSourceResponse.ts +12 -0
- package/src/rewardsEligibility/dtos/backoffice/QuotaImpactResponse.ts +9 -0
- package/src/rewardsEligibility/dtos/backoffice/QuotaUsageResponse.ts +11 -0
- package/src/rewardsEligibility/dtos/backoffice/ResultTraceResponse.ts +34 -0
- package/src/rewardsEligibility/dtos/backoffice/RuleCatalogResponse.ts +32 -0
- package/src/rewardsEligibility/dtos/backoffice/RulesChatTurn.ts +17 -0
- package/src/rewardsEligibility/dtos/backoffice/RunListResponse.ts +6 -0
- package/src/rewardsEligibility/dtos/backoffice/RunResponse.ts +25 -0
- package/src/rewardsEligibility/dtos/backoffice/RunResultListResponse.ts +6 -0
- package/src/rewardsEligibility/dtos/backoffice/RunResultResponse.ts +23 -0
- package/src/rewardsEligibility/dtos/backoffice/SimulateRequest.ts +25 -0
- package/src/rewardsEligibility/dtos/backoffice/SimulateResponse.ts +12 -0
- package/src/rewardsEligibility/enums/MetricsDimensionEnum.ts +8 -0
- package/src/rewardsEligibility/enums/RewardsEligibilityErrorCodeEnum.ts +57 -0
- package/src/rewardsEligibility/enums/RuleValueTypeEnum.ts +9 -0
- package/src/rewardsEligibility/enums/RulesChatRoleEnum.ts +5 -0
- package/src/rewardsEligibility/index.ts +40 -0
|
@@ -0,0 +1,72 @@
|
|
|
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.CampaignRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const BackofficeLimits_1 = require("../../constants/BackofficeLimits");
|
|
16
|
+
const QuotaExhaustedActionEnum_1 = require("../../enums/QuotaExhaustedActionEnum");
|
|
17
|
+
const CampaignAlerts_1 = require("../CampaignAlerts");
|
|
18
|
+
const CampaignQuota_1 = require("../CampaignQuota");
|
|
19
|
+
/** Crear (POST) o reemplazar (PUT) una campaña. `status`, `pausedReason` y las fechas de auditoría las pone el servidor (el estado cambia con `POST /campaigns/{id}/status`). */
|
|
20
|
+
class CampaignRequest {
|
|
21
|
+
}
|
|
22
|
+
exports.CampaignRequest = CampaignRequest;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.Matches)(BackofficeLimits_1.ELIGIBILITY_ID_PATTERN),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CampaignRequest.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
33
|
+
(0, class_validator_1.MaxLength)(120),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CampaignRequest.prototype, "name", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_transformer_1.Expose)(),
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
40
|
+
(0, class_validator_1.MaxLength)(500),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CampaignRequest.prototype, "objective", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_transformer_1.Expose)(),
|
|
45
|
+
(0, class_validator_1.Matches)(BackofficeLimits_1.DATE_PATTERN),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], CampaignRequest.prototype, "startsAt", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_transformer_1.Expose)(),
|
|
50
|
+
(0, class_validator_1.Matches)(BackofficeLimits_1.DATE_PATTERN),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], CampaignRequest.prototype, "endsAt", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_transformer_1.Expose)(),
|
|
55
|
+
(0, class_validator_1.IsArray)(),
|
|
56
|
+
(0, class_validator_1.ArrayMaxSize)(BackofficeLimits_1.MAX_QUOTAS_PER_CAMPAIGN),
|
|
57
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
58
|
+
(0, class_transformer_1.Type)(() => CampaignQuota_1.CampaignQuota),
|
|
59
|
+
__metadata("design:type", Array)
|
|
60
|
+
], CampaignRequest.prototype, "quotas", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_transformer_1.Expose)(),
|
|
63
|
+
(0, class_validator_1.IsEnum)(QuotaExhaustedActionEnum_1.QuotaExhaustedActionEnum),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], CampaignRequest.prototype, "onExhausted", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_transformer_1.Expose)(),
|
|
68
|
+
(0, class_validator_1.IsDefined)(),
|
|
69
|
+
(0, class_validator_1.ValidateNested)(),
|
|
70
|
+
(0, class_transformer_1.Type)(() => CampaignAlerts_1.CampaignAlerts),
|
|
71
|
+
__metadata("design:type", CampaignAlerts_1.CampaignAlerts)
|
|
72
|
+
], CampaignRequest.prototype, "alerts", void 0);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CampaignPausedReasonEnum } from '../../enums/CampaignPausedReasonEnum';
|
|
2
|
+
import { CampaignStatusEnum } from '../../enums/CampaignStatusEnum';
|
|
3
|
+
import { QuotaExhaustedActionEnum } from '../../enums/QuotaExhaustedActionEnum';
|
|
4
|
+
import { CampaignAlerts } from '../CampaignAlerts';
|
|
5
|
+
import { CampaignQuota } from '../CampaignQuota';
|
|
6
|
+
/** Una campaña (spec B 5.6). */
|
|
7
|
+
export declare class CampaignResponse {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
objective: string;
|
|
11
|
+
status: CampaignStatusEnum;
|
|
12
|
+
/** Solo si `status` es `PAUSED`. */
|
|
13
|
+
pausedReason?: CampaignPausedReasonEnum;
|
|
14
|
+
startsAt: string;
|
|
15
|
+
endsAt: string;
|
|
16
|
+
quotas: CampaignQuota[];
|
|
17
|
+
onExhausted: QuotaExhaustedActionEnum;
|
|
18
|
+
alerts: CampaignAlerts;
|
|
19
|
+
/** Epoch en milisegundos. */
|
|
20
|
+
createdAt: number;
|
|
21
|
+
updatedAt: number;
|
|
22
|
+
updatedBy: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.CampaignStatusRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const CampaignStatusEnum_1 = require("../../enums/CampaignStatusEnum");
|
|
16
|
+
/** Cuerpo de `POST /campaigns/{id}/status`: activar, pausar, terminar o archivar. */
|
|
17
|
+
class CampaignStatusRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.CampaignStatusRequest = CampaignStatusRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
(0, class_validator_1.IsEnum)(CampaignStatusEnum_1.CampaignStatusEnum),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CampaignStatusRequest.prototype, "status", void 0);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CampaignPausedReasonEnum } from '../../enums/CampaignPausedReasonEnum';
|
|
2
|
+
import { CampaignStatusEnum } from '../../enums/CampaignStatusEnum';
|
|
3
|
+
/** Fila de la tabla ejecutiva `GET /campaigns/summary` (spec 10.1). */
|
|
4
|
+
export declare class CampaignSummaryResponse {
|
|
5
|
+
campaignId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
status: CampaignStatusEnum;
|
|
8
|
+
pausedReason?: CampaignPausedReasonEnum;
|
|
9
|
+
startsAt: string;
|
|
10
|
+
endsAt: string;
|
|
11
|
+
evaluated: number;
|
|
12
|
+
matched: number;
|
|
13
|
+
requested: number;
|
|
14
|
+
quotaExhausted: number;
|
|
15
|
+
/** Cupo más restrictivo, de 0 a 1 (0 si la campaña no tiene cupos). */
|
|
16
|
+
quotaUsed: number;
|
|
17
|
+
/** Ritmo diario de pedidos de los últimos 7 días (para proyectar el agotamiento). */
|
|
18
|
+
dailyRate: number;
|
|
19
|
+
/** `AAAA-MM-DD` estimada en que se agota el cupo más restrictivo al ritmo actual; ausente si no aplica. */
|
|
20
|
+
projectedExhaustionDate?: string;
|
|
21
|
+
/** Valor entregado: lo calcula rewards por `campaignId`; este lambda no lo informa. */
|
|
22
|
+
value?: {
|
|
23
|
+
amount: number;
|
|
24
|
+
currency: string;
|
|
25
|
+
}[];
|
|
26
|
+
/** Entregados de verdad según rewards; este lambda no lo informa. */
|
|
27
|
+
granted?: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignSummaryResponse = void 0;
|
|
4
|
+
/** Fila de la tabla ejecutiva `GET /campaigns/summary` (spec 10.1). */
|
|
5
|
+
class CampaignSummaryResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.CampaignSummaryResponse = CampaignSummaryResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DynamicFormValue } from '../../../dynamicForm/types/DynamicFormValue';
|
|
2
|
+
import { RunModeEnum } from '../../enums/RunModeEnum';
|
|
3
|
+
import { PopulationRunRequest } from './PopulationRunRequest';
|
|
4
|
+
/** `POST /evaluations/{id}/runs` (spec 10): una corrida manual de UN sujeto (`inputs`) o de una población (`population`, fase 4). */
|
|
5
|
+
export declare class CreateRunRequest {
|
|
6
|
+
/** Id de solicitud que genera el backoffice al abrir el formulario: es la llave de idempotencia (doble clic = misma corrida). */
|
|
7
|
+
requestId: string;
|
|
8
|
+
mode: RunModeEnum;
|
|
9
|
+
inputs?: Record<string, DynamicFormValue>;
|
|
10
|
+
population?: PopulationRunRequest;
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.CreateRunRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const IsDynamicFormValues_1 = require("../../../dynamicForm/validators/IsDynamicFormValues");
|
|
16
|
+
const BackofficeLimits_1 = require("../../constants/BackofficeLimits");
|
|
17
|
+
const RunModeEnum_1 = require("../../enums/RunModeEnum");
|
|
18
|
+
const PopulationRunRequest_1 = require("./PopulationRunRequest");
|
|
19
|
+
/** `POST /evaluations/{id}/runs` (spec 10): una corrida manual de UN sujeto (`inputs`) o de una población (`population`, fase 4). */
|
|
20
|
+
class CreateRunRequest {
|
|
21
|
+
}
|
|
22
|
+
exports.CreateRunRequest = CreateRunRequest;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.Matches)(BackofficeLimits_1.REQUEST_ID_PATTERN),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CreateRunRequest.prototype, "requestId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, class_validator_1.IsEnum)(RunModeEnum_1.RunModeEnum),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateRunRequest.prototype, "mode", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Expose)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.Validate)(IsDynamicFormValues_1.IsDynamicFormValues),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], CreateRunRequest.prototype, "inputs", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_transformer_1.Expose)(),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.ValidateNested)(),
|
|
43
|
+
(0, class_transformer_1.Type)(() => PopulationRunRequest_1.PopulationRunRequest),
|
|
44
|
+
__metadata("design:type", PopulationRunRequest_1.PopulationRunRequest)
|
|
45
|
+
], CreateRunRequest.prototype, "population", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RunResponse } from './RunResponse';
|
|
2
|
+
import { RunResultResponse } from './RunResultResponse';
|
|
3
|
+
/** Respuesta de `POST /evaluations/{id}/runs`: la corrida y, si es de un sujeto, su resultado con traza (spec 7.3). */
|
|
4
|
+
export declare class CreateRunResponse {
|
|
5
|
+
run: RunResponse;
|
|
6
|
+
result?: RunResultResponse;
|
|
7
|
+
/** `true` si el `requestId` ya existía: es la MISMA corrida de antes. */
|
|
8
|
+
idempotentReplay: boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateRunResponse = void 0;
|
|
4
|
+
/** Respuesta de `POST /evaluations/{id}/runs`: la corrida y, si es de un sujeto, su resultado con traza (spec 7.3). */
|
|
5
|
+
class CreateRunResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.CreateRunResponse = CreateRunResponse;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JsonValue } from '../../../common';
|
|
2
|
+
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
3
|
+
import { EvaluationReward } from '../EvaluationReward';
|
|
4
|
+
import { EvaluationTrigger } from '../EvaluationTrigger';
|
|
5
|
+
import { GrantPolicy } from '../GrantPolicy';
|
|
6
|
+
/**
|
|
7
|
+
* Crear (POST) o reemplazar (PUT) una evaluación (spec 5.1). `status`, `version` y auditoría los pone el servidor.
|
|
8
|
+
* Aquí solo se valida la FORMA gruesa; las reglas del spec 5.1 (llaves únicas, `validateRule`, paquete ACTIVO, disparadores…)
|
|
9
|
+
* las valida el lambda, que devuelve TODOS los problemas juntos.
|
|
10
|
+
*/
|
|
11
|
+
export declare class EvaluationRequest {
|
|
12
|
+
id: string;
|
|
13
|
+
campaignId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
/** Contrato de entrada (`InputField[]`, dominio `dynamicForm`). */
|
|
17
|
+
inputs: InputField[];
|
|
18
|
+
/** Reglas de `@fiado/rules-engine` (`{ match, groups[] }`). */
|
|
19
|
+
rules: {
|
|
20
|
+
[key: string]: JsonValue;
|
|
21
|
+
};
|
|
22
|
+
/** Llave del input `DIRECTORY` al que se le entrega el premio. */
|
|
23
|
+
beneficiaryInput: string;
|
|
24
|
+
reward: EvaluationReward;
|
|
25
|
+
grantPolicy: GrantPolicy;
|
|
26
|
+
triggers: EvaluationTrigger[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.EvaluationRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const BackofficeLimits_1 = require("../../constants/BackofficeLimits");
|
|
16
|
+
const EvaluationReward_1 = require("../EvaluationReward");
|
|
17
|
+
const GrantPolicy_1 = require("../GrantPolicy");
|
|
18
|
+
/**
|
|
19
|
+
* Crear (POST) o reemplazar (PUT) una evaluación (spec 5.1). `status`, `version` y auditoría los pone el servidor.
|
|
20
|
+
* Aquí solo se valida la FORMA gruesa; las reglas del spec 5.1 (llaves únicas, `validateRule`, paquete ACTIVO, disparadores…)
|
|
21
|
+
* las valida el lambda, que devuelve TODOS los problemas juntos.
|
|
22
|
+
*/
|
|
23
|
+
class EvaluationRequest {
|
|
24
|
+
}
|
|
25
|
+
exports.EvaluationRequest = EvaluationRequest;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_transformer_1.Expose)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.Matches)(BackofficeLimits_1.ELIGIBILITY_ID_PATTERN),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], EvaluationRequest.prototype, "id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_transformer_1.Expose)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.Matches)(BackofficeLimits_1.ELIGIBILITY_ID_PATTERN),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], EvaluationRequest.prototype, "campaignId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_transformer_1.Expose)(),
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
42
|
+
(0, class_validator_1.MaxLength)(160),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], EvaluationRequest.prototype, "name", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_transformer_1.Expose)(),
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
(0, class_validator_1.MaxLength)(500),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], EvaluationRequest.prototype, "description", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_transformer_1.Expose)(),
|
|
53
|
+
(0, class_validator_1.IsArray)(),
|
|
54
|
+
(0, class_validator_1.ArrayMaxSize)(30),
|
|
55
|
+
(0, class_validator_1.IsObject)({ each: true }),
|
|
56
|
+
__metadata("design:type", Array)
|
|
57
|
+
], EvaluationRequest.prototype, "inputs", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_transformer_1.Expose)(),
|
|
60
|
+
(0, class_validator_1.IsObject)(),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], EvaluationRequest.prototype, "rules", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_transformer_1.Expose)(),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], EvaluationRequest.prototype, "beneficiaryInput", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_transformer_1.Expose)(),
|
|
71
|
+
(0, class_validator_1.IsObject)(),
|
|
72
|
+
__metadata("design:type", EvaluationReward_1.EvaluationReward)
|
|
73
|
+
], EvaluationRequest.prototype, "reward", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_transformer_1.Expose)(),
|
|
76
|
+
(0, class_validator_1.IsObject)(),
|
|
77
|
+
__metadata("design:type", GrantPolicy_1.GrantPolicy)
|
|
78
|
+
], EvaluationRequest.prototype, "grantPolicy", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, class_transformer_1.Expose)(),
|
|
81
|
+
(0, class_validator_1.IsArray)(),
|
|
82
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
83
|
+
(0, class_validator_1.ArrayMaxSize)(10),
|
|
84
|
+
(0, class_validator_1.IsObject)({ each: true }),
|
|
85
|
+
__metadata("design:type", Array)
|
|
86
|
+
], EvaluationRequest.prototype, "triggers", void 0);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { JsonValue } from '../../../common';
|
|
2
|
+
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
3
|
+
import { EvaluationStatusEnum } from '../../enums/EvaluationStatusEnum';
|
|
4
|
+
import { EvaluationReward } from '../EvaluationReward';
|
|
5
|
+
import { EvaluationTrigger } from '../EvaluationTrigger';
|
|
6
|
+
import { GrantPolicy } from '../GrantPolicy';
|
|
7
|
+
export declare class EvaluationResponse {
|
|
8
|
+
id: string;
|
|
9
|
+
campaignId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
status: EvaluationStatusEnum;
|
|
13
|
+
/** Sube con cada edición de una evaluación `ACTIVE`. */
|
|
14
|
+
version: number;
|
|
15
|
+
inputs: InputField[];
|
|
16
|
+
rules: {
|
|
17
|
+
[key: string]: JsonValue;
|
|
18
|
+
};
|
|
19
|
+
beneficiaryInput: string;
|
|
20
|
+
reward: EvaluationReward;
|
|
21
|
+
grantPolicy: GrantPolicy;
|
|
22
|
+
triggers: EvaluationTrigger[];
|
|
23
|
+
createdAt: number;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
updatedBy: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.EvaluationStatusRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const EvaluationStatusEnum_1 = require("../../enums/EvaluationStatusEnum");
|
|
16
|
+
/** Cuerpo de `POST /evaluations/{id}/status`: activar, pausar o archivar. */
|
|
17
|
+
class EvaluationStatusRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.EvaluationStatusRequest = EvaluationStatusRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
(0, class_validator_1.IsEnum)(EvaluationStatusEnum_1.EvaluationStatusEnum),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], EvaluationStatusRequest.prototype, "status", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
2
|
+
import { RewardStatusEnum } from '../../../rewards/enums/RewardStatusEnum';
|
|
3
|
+
/** Alta (POST) o reemplazo (PUT) de un tipo de evento (spec 5.2). Los `fields` se validan a fondo en el lambda (`InputFieldValidationService`). */
|
|
4
|
+
export declare class EventTypeRequest {
|
|
5
|
+
eventKey: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
/** Servicio que lo emite (ej. `phone-sales`). */
|
|
9
|
+
emitter: string;
|
|
10
|
+
fields: InputField[];
|
|
11
|
+
status: RewardStatusEnum;
|
|
12
|
+
}
|
|
@@ -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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EventTypeRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const RewardStatusEnum_1 = require("../../../rewards/enums/RewardStatusEnum");
|
|
16
|
+
const BackofficeLimits_1 = require("../../constants/BackofficeLimits");
|
|
17
|
+
/** Alta (POST) o reemplazo (PUT) de un tipo de evento (spec 5.2). Los `fields` se validan a fondo en el lambda (`InputFieldValidationService`). */
|
|
18
|
+
class EventTypeRequest {
|
|
19
|
+
}
|
|
20
|
+
exports.EventTypeRequest = EventTypeRequest;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_transformer_1.Expose)(),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.Matches)(BackofficeLimits_1.EVENT_KEY_PATTERN),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], EventTypeRequest.prototype, "eventKey", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_transformer_1.Expose)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
(0, class_validator_1.MaxLength)(120),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], EventTypeRequest.prototype, "name", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_transformer_1.Expose)(),
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
(0, class_validator_1.MaxLength)(500),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], EventTypeRequest.prototype, "description", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
44
|
+
(0, class_validator_1.MaxLength)(60),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], EventTypeRequest.prototype, "emitter", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_transformer_1.Expose)(),
|
|
49
|
+
(0, class_validator_1.IsArray)(),
|
|
50
|
+
(0, class_validator_1.ArrayMaxSize)(30),
|
|
51
|
+
(0, class_validator_1.IsObject)({ each: true }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], EventTypeRequest.prototype, "fields", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_transformer_1.Expose)(),
|
|
56
|
+
(0, class_validator_1.IsEnum)(RewardStatusEnum_1.RewardStatusEnum),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], EventTypeRequest.prototype, "status", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
2
|
+
import { RewardStatusEnum } from '../../../rewards/enums/RewardStatusEnum';
|
|
3
|
+
export declare class EventTypeResponse {
|
|
4
|
+
eventKey: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
emitter: string;
|
|
8
|
+
fields: InputField[];
|
|
9
|
+
status: RewardStatusEnum;
|
|
10
|
+
createdAt: number;
|
|
11
|
+
updatedAt: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Condición que más hace fallar la regla (`GET /metrics/failed-conditions`). */
|
|
2
|
+
export declare class FailedConditionStatResponse {
|
|
3
|
+
/** `{source}.{field}`. */
|
|
4
|
+
key: string;
|
|
5
|
+
/** Etiqueta legible (del catálogo de reglas; si no está, la propia `key`). */
|
|
6
|
+
label: string;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FailedConditionStatResponse = void 0;
|
|
4
|
+
/** Condición que más hace fallar la regla (`GET /metrics/failed-conditions`). */
|
|
5
|
+
class FailedConditionStatResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.FailedConditionStatResponse = FailedConditionStatResponse;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JsonValue } from '../../../common';
|
|
2
|
+
import { InputField } from '../../../dynamicForm/dtos/InputField';
|
|
3
|
+
import { RulesChatTurn } from './RulesChatTurn';
|
|
4
|
+
/**
|
|
5
|
+
* `POST /rules/generate`: el chat del editor de reglas. El lambda arma el prompt con el catálogo de fuentes y ESTE contrato de entrada
|
|
6
|
+
* (qué sujetos `DIRECTORY` y qué campos de `input` existen), genera `{ match, groups[] }` y lo valida con el mismo `validateRule` de la evaluación.
|
|
7
|
+
*/
|
|
8
|
+
export declare class GenerateRulesRequest {
|
|
9
|
+
/** Del turno más viejo al más nuevo; el último es del admin (`user`). Entre 1 y 10 turnos (el lambda responde `AI_CHAT_HISTORY_EMPTY` / `AI_CHAT_HISTORY_TOO_LONG`). */
|
|
10
|
+
history: RulesChatTurn[];
|
|
11
|
+
/** Las reglas que el editor tiene ahora (`{ match, groups[] }`), para refinarlas. Ausente = regla nueva. */
|
|
12
|
+
currentRules?: {
|
|
13
|
+
[key: string]: JsonValue;
|
|
14
|
+
};
|
|
15
|
+
/** Contrato de entrada de la evaluación que se está editando (`InputField[]`, dominio `dynamicForm`): de aquí salen los `subject` y los campos de la fuente `input`. */
|
|
16
|
+
inputs: InputField[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.GenerateRulesRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const BackofficeLimits_1 = require("../../constants/BackofficeLimits");
|
|
16
|
+
const RulesChatTurn_1 = require("./RulesChatTurn");
|
|
17
|
+
/**
|
|
18
|
+
* `POST /rules/generate`: el chat del editor de reglas. El lambda arma el prompt con el catálogo de fuentes y ESTE contrato de entrada
|
|
19
|
+
* (qué sujetos `DIRECTORY` y qué campos de `input` existen), genera `{ match, groups[] }` y lo valida con el mismo `validateRule` de la evaluación.
|
|
20
|
+
*/
|
|
21
|
+
class GenerateRulesRequest {
|
|
22
|
+
}
|
|
23
|
+
exports.GenerateRulesRequest = GenerateRulesRequest;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsArray)(),
|
|
27
|
+
(0, class_validator_1.ArrayMaxSize)(BackofficeLimits_1.RULES_CHAT_MAX_TURNS_HARD),
|
|
28
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
29
|
+
(0, class_transformer_1.Type)(() => RulesChatTurn_1.RulesChatTurn),
|
|
30
|
+
__metadata("design:type", Array)
|
|
31
|
+
], GenerateRulesRequest.prototype, "history", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_transformer_1.Expose)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsObject)(),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], GenerateRulesRequest.prototype, "currentRules", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_transformer_1.Expose)(),
|
|
40
|
+
(0, class_validator_1.IsArray)(),
|
|
41
|
+
(0, class_validator_1.ArrayMaxSize)(30),
|
|
42
|
+
(0, class_validator_1.IsObject)({ each: true }),
|
|
43
|
+
__metadata("design:type", Array)
|
|
44
|
+
], GenerateRulesRequest.prototype, "inputs", void 0);
|