@llm-dev-ops/agentics-cli 1.4.86 → 1.4.89
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/dist/__tests__/api_gateway.test.d.ts +1 -0
- package/dist/__tests__/api_gateway.test.js +50 -0
- package/dist/__tests__/domain_enterprise_solution.test.d.ts +1 -0
- package/dist/__tests__/domain_enterprise_solution.test.js +50 -0
- package/dist/__tests__/health.test.d.ts +1 -0
- package/dist/__tests__/health.test.js +19 -0
- package/dist/__tests__/monitoring_alerts.test.d.ts +1 -0
- package/dist/__tests__/monitoring_alerts.test.js +50 -0
- package/dist/__tests__/ongoing_regular_stakeholder.test.d.ts +1 -0
- package/dist/__tests__/ongoing_regular_stakeholder.test.js +50 -0
- package/dist/__tests__/re_evaluate_risk.test.d.ts +1 -0
- package/dist/__tests__/re_evaluate_risk.test.js +50 -0
- package/dist/__tests__/recommendation.test.d.ts +1 -0
- package/dist/__tests__/recommendation.test.js +50 -0
- package/dist/__tests__/risk_mitigation_plan.test.d.ts +1 -0
- package/dist/__tests__/risk_mitigation_plan.test.js +50 -0
- package/dist/__tests__/scoped_pilot_reduce.test.d.ts +1 -0
- package/dist/__tests__/scoped_pilot_reduce.test.js +50 -0
- package/dist/__tests__/target_enterprise_system.test.d.ts +1 -0
- package/dist/__tests__/target_enterprise_system.test.js +50 -0
- package/dist/__tests__/underwriting.test.d.ts +1 -0
- package/dist/__tests__/underwriting.test.js +50 -0
- package/dist/api-gateway/infra/api-gateway-adapter.d.ts +27 -0
- package/dist/api-gateway/infra/api-gateway-adapter.js +54 -0
- package/dist/api-gateway/ports/api-gateway.d.ts +26 -0
- package/dist/api-gateway/ports/api-gateway.js +2 -0
- package/dist/contracts/contract-validation.d.ts +11 -0
- package/dist/contracts/contract-validation.js +21 -0
- package/dist/domain-enterprise-solution/infra/api-gateway-seam-adapter.d.ts +21 -0
- package/dist/domain-enterprise-solution/infra/api-gateway-seam-adapter.js +42 -0
- package/dist/domain-enterprise-solution/infra/domain-enterprise-solution-adapter.d.ts +25 -0
- package/dist/domain-enterprise-solution/infra/domain-enterprise-solution-adapter.js +47 -0
- package/dist/domain-enterprise-solution/ports/api-gateway-seam.d.ts +20 -0
- package/dist/domain-enterprise-solution/ports/api-gateway-seam.js +2 -0
- package/dist/domain-enterprise-solution/ports/domain-enterprise-solution.d.ts +24 -0
- package/dist/domain-enterprise-solution/ports/domain-enterprise-solution.js +2 -0
- package/dist/enterprise/index.d.ts +15 -0
- package/dist/enterprise/index.js +16 -0
- package/dist/erp-client/client.d.ts +42 -0
- package/dist/erp-client/client.js +235 -0
- package/dist/erp-client/mapper.d.ts +9 -0
- package/dist/erp-client/mapper.js +116 -0
- package/dist/erp-client/retry.d.ts +17 -0
- package/dist/erp-client/retry.js +74 -0
- package/dist/erp-client/types.d.ts +155 -0
- package/dist/erp-client/types.js +2 -0
- package/dist/infra/clients.d.ts +27 -0
- package/dist/infra/clients.js +16 -0
- package/dist/infra/connection-pool.d.ts +16 -0
- package/dist/infra/connection-pool.js +13 -0
- package/dist/infra/iam-helper.d.ts +1 -0
- package/dist/infra/iam-helper.js +138 -0
- package/dist/infra/telemetry.d.ts +26 -0
- package/dist/infra/telemetry.js +39 -0
- package/dist/monitoring-alerts/infra/monitoring-alerts-adapter.d.ts +25 -0
- package/dist/monitoring-alerts/infra/monitoring-alerts-adapter.js +47 -0
- package/dist/monitoring-alerts/ports/monitoring-alerts.d.ts +24 -0
- package/dist/monitoring-alerts/ports/monitoring-alerts.js +2 -0
- package/dist/ongoing-regular-stakeholder/infra/ongoing-regular-stakeholder-adapter.d.ts +25 -0
- package/dist/ongoing-regular-stakeholder/infra/ongoing-regular-stakeholder-adapter.js +47 -0
- package/dist/ongoing-regular-stakeholder/ports/ongoing-regular-stakeholder.d.ts +24 -0
- package/dist/ongoing-regular-stakeholder/ports/ongoing-regular-stakeholder.js +2 -0
- package/dist/pipeline/auto-chain.d.ts.map +1 -1
- package/dist/pipeline/auto-chain.js +16 -103
- package/dist/pipeline/auto-chain.js.map +1 -1
- package/dist/pipeline/execution-context.d.ts +1 -1
- package/dist/pipeline/execution-context.js +1 -1
- package/dist/pipeline/phase2/phase2-coordinator.d.ts.map +1 -1
- package/dist/pipeline/phase2/phase2-coordinator.js +7 -3
- package/dist/pipeline/phase2/phase2-coordinator.js.map +1 -1
- package/dist/pipeline/ruflo-phase-executor.js +1 -1
- package/dist/pipeline/ruflo-phase-executor.js.map +1 -1
- package/dist/re-evaluate-risk/infra/re-evaluate-risk-adapter.d.ts +25 -0
- package/dist/re-evaluate-risk/infra/re-evaluate-risk-adapter.js +47 -0
- package/dist/re-evaluate-risk/ports/re-evaluate-risk.d.ts +24 -0
- package/dist/re-evaluate-risk/ports/re-evaluate-risk.js +2 -0
- package/dist/recommendation/infra/recommendation-adapter.d.ts +25 -0
- package/dist/recommendation/infra/recommendation-adapter.js +47 -0
- package/dist/recommendation/ports/recommendation.d.ts +24 -0
- package/dist/recommendation/ports/recommendation.js +2 -0
- package/dist/risk-mitigation-plan/infra/risk-mitigation-plan-adapter.d.ts +25 -0
- package/dist/risk-mitigation-plan/infra/risk-mitigation-plan-adapter.js +47 -0
- package/dist/risk-mitigation-plan/ports/risk-mitigation-plan.d.ts +24 -0
- package/dist/risk-mitigation-plan/ports/risk-mitigation-plan.js +2 -0
- package/dist/scoped-pilot-reduce/infra/scoped-pilot-reduce-adapter.d.ts +25 -0
- package/dist/scoped-pilot-reduce/infra/scoped-pilot-reduce-adapter.js +47 -0
- package/dist/scoped-pilot-reduce/ports/scoped-pilot-reduce.d.ts +24 -0
- package/dist/scoped-pilot-reduce/ports/scoped-pilot-reduce.js +2 -0
- package/dist/server/dependencies.d.ts +178 -0
- package/dist/server/dependencies.js +321 -0
- package/dist/server/health.d.ts +2 -0
- package/dist/server/health.js +9 -0
- package/dist/server/main.d.ts +1 -0
- package/dist/server/main.js +21 -0
- package/dist/server/middleware.d.ts +4 -0
- package/dist/server/middleware.js +106 -0
- package/dist/server/routes.d.ts +5 -0
- package/dist/server/routes.js +1100 -0
- package/dist/server/schemas.d.ts +217 -0
- package/dist/server/schemas.js +185 -0
- package/dist/target-enterprise-system/infra/target-enterprise-system-adapter.d.ts +25 -0
- package/dist/target-enterprise-system/infra/target-enterprise-system-adapter.js +47 -0
- package/dist/target-enterprise-system/ports/target-enterprise-system.d.ts +24 -0
- package/dist/target-enterprise-system/ports/target-enterprise-system.js +2 -0
- package/dist/underwriting/infra/underwriting-adapter.d.ts +25 -0
- package/dist/underwriting/infra/underwriting-adapter.js +47 -0
- package/dist/underwriting/ports/underwriting.d.ts +24 -0
- package/dist/underwriting/ports/underwriting.js +2 -0
- package/docs/ecosystem.graph.json +295 -214
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ScopedPilotReducePort, ScopedPilotReduceInput, ScopedPilotReduce } from '../ports/scoped-pilot-reduce.js';
|
|
2
|
+
import type { Telemetry } from '../../infra/telemetry.js';
|
|
3
|
+
import type { DbClient, ErpClient } from '../../infra/clients.js';
|
|
4
|
+
/**
|
|
5
|
+
* Infrastructure adapter: ScopedPilotReduceAdapter
|
|
6
|
+
* Bounded context: scoped-pilot-reduce
|
|
7
|
+
* ERP system: infor
|
|
8
|
+
*
|
|
9
|
+
* Bridges the ScopedPilotReducePort port to the infor ERP system
|
|
10
|
+
* and the underlying database client.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ScopedPilotReduceAdapter implements ScopedPilotReducePort {
|
|
13
|
+
private readonly db;
|
|
14
|
+
private readonly erp;
|
|
15
|
+
private readonly telemetry;
|
|
16
|
+
constructor(db: DbClient, erp: ErpClient, telemetry: Telemetry);
|
|
17
|
+
/** Creates or updates scoped-pilot-reduce record */
|
|
18
|
+
manageScopedPilot(input: ScopedPilotReduceInput): Promise<ScopedPilotReduce>;
|
|
19
|
+
/** Creates or updates scoped-pilot-reduce record */
|
|
20
|
+
queryScopedPilot(input: ScopedPilotReduceInput): Promise<ScopedPilotReduce>;
|
|
21
|
+
/** Returns scoped-pilot-reduce data */
|
|
22
|
+
listScopedPilotReduce(input: Record<string, unknown>): Promise<ScopedPilotReduce[]>;
|
|
23
|
+
/** Returns scoped-pilot-reduce data */
|
|
24
|
+
id(input: Record<string, unknown>): Promise<ScopedPilotReduce[]>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
/**
|
|
3
|
+
* Infrastructure adapter: ScopedPilotReduceAdapter
|
|
4
|
+
* Bounded context: scoped-pilot-reduce
|
|
5
|
+
* ERP system: infor
|
|
6
|
+
*
|
|
7
|
+
* Bridges the ScopedPilotReducePort port to the infor ERP system
|
|
8
|
+
* and the underlying database client.
|
|
9
|
+
*/
|
|
10
|
+
export class ScopedPilotReduceAdapter {
|
|
11
|
+
db;
|
|
12
|
+
erp;
|
|
13
|
+
telemetry;
|
|
14
|
+
constructor(db, erp, telemetry) {
|
|
15
|
+
this.db = db;
|
|
16
|
+
this.erp = erp;
|
|
17
|
+
this.telemetry = telemetry;
|
|
18
|
+
}
|
|
19
|
+
/** Creates or updates scoped-pilot-reduce record */
|
|
20
|
+
async manageScopedPilot(input) {
|
|
21
|
+
return this.telemetry.withSpan('scoped_pilot_reduce', 'manageScopedPilot', {}, async () => {
|
|
22
|
+
const result = await this.erp.invoke('manageScopedPilot', input);
|
|
23
|
+
return result;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Creates or updates scoped-pilot-reduce record */
|
|
27
|
+
async queryScopedPilot(input) {
|
|
28
|
+
return this.telemetry.withSpan('scoped_pilot_reduce', 'queryScopedPilot', {}, async () => {
|
|
29
|
+
const rows = await this.db.query('SELECT * FROM scoped_pilot_reduce WHERE 1=1', []);
|
|
30
|
+
return rows;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Returns scoped-pilot-reduce data */
|
|
34
|
+
async listScopedPilotReduce(input) {
|
|
35
|
+
return this.telemetry.withSpan('scoped_pilot_reduce', 'listScopedPilotReduce', {}, async () => {
|
|
36
|
+
const rows = await this.db.query('SELECT * FROM scoped_pilot_reduce WHERE 1=1', []);
|
|
37
|
+
return rows;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** Returns scoped-pilot-reduce data */
|
|
41
|
+
async id(input) {
|
|
42
|
+
return this.telemetry.withSpan('scoped_pilot_reduce', 'id', {}, async () => {
|
|
43
|
+
const result = await this.erp.invoke('id', input);
|
|
44
|
+
return result;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port interface for bounded context: scoped-pilot-reduce
|
|
3
|
+
*/
|
|
4
|
+
export interface ScopedPilotReduceInput {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly scoped_pilot_reduce_id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ScopedPilotReduce {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly created_at: string;
|
|
11
|
+
readonly updated_at: string;
|
|
12
|
+
readonly status: 'active' | 'inactive' | 'pending' | 'completed' | 'error';
|
|
13
|
+
readonly scoped_pilot_reduce_id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ScopedPilotReducePort {
|
|
16
|
+
/** Creates or updates scoped-pilot-reduce record */
|
|
17
|
+
manageScopedPilot(input: ScopedPilotReduceInput): Promise<ScopedPilotReduce>;
|
|
18
|
+
/** Creates or updates scoped-pilot-reduce record */
|
|
19
|
+
queryScopedPilot(input: ScopedPilotReduceInput): Promise<ScopedPilotReduce>;
|
|
20
|
+
/** Returns scoped-pilot-reduce data */
|
|
21
|
+
listScopedPilotReduce(input: Record<string, unknown>): Promise<ScopedPilotReduce[]>;
|
|
22
|
+
/** Returns scoped-pilot-reduce data */
|
|
23
|
+
id(input: Record<string, unknown>): Promise<ScopedPilotReduce[]>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { DbClient, ErpClient } from '../infra/clients.js';
|
|
2
|
+
export interface AuditEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
entity_type: string;
|
|
5
|
+
entity_id: string;
|
|
6
|
+
action: string;
|
|
7
|
+
actor: string;
|
|
8
|
+
payload: unknown;
|
|
9
|
+
created_at: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IAuditPort {
|
|
12
|
+
log(entityType: string, entityId: string, action: string, actor: string, payload: unknown): Promise<AuditEntry>;
|
|
13
|
+
}
|
|
14
|
+
export interface DomainEnterpriseSolutionRecord {
|
|
15
|
+
id: string;
|
|
16
|
+
status: string;
|
|
17
|
+
created_at: string;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
data: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export interface IDomainEnterpriseSolutionPort {
|
|
22
|
+
execute(command: string, payload: Record<string, unknown>): Promise<DomainEnterpriseSolutionRecord>;
|
|
23
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
24
|
+
rows: DomainEnterpriseSolutionRecord[];
|
|
25
|
+
total: number;
|
|
26
|
+
}>;
|
|
27
|
+
getById(id: string): Promise<DomainEnterpriseSolutionRecord | null>;
|
|
28
|
+
}
|
|
29
|
+
export interface MonitoringAlertsRecord {
|
|
30
|
+
id: string;
|
|
31
|
+
status: string;
|
|
32
|
+
created_at: string;
|
|
33
|
+
updated_at: string;
|
|
34
|
+
data: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface IMonitoringAlertsPort {
|
|
37
|
+
execute(command: string, payload: Record<string, unknown>): Promise<MonitoringAlertsRecord>;
|
|
38
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
39
|
+
rows: MonitoringAlertsRecord[];
|
|
40
|
+
total: number;
|
|
41
|
+
}>;
|
|
42
|
+
getById(id: string): Promise<MonitoringAlertsRecord | null>;
|
|
43
|
+
}
|
|
44
|
+
export interface OngoingRegularStakeholderRecord {
|
|
45
|
+
id: string;
|
|
46
|
+
status: string;
|
|
47
|
+
created_at: string;
|
|
48
|
+
updated_at: string;
|
|
49
|
+
data: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export interface IOngoingRegularStakeholderPort {
|
|
52
|
+
execute(command: string, payload: Record<string, unknown>): Promise<OngoingRegularStakeholderRecord>;
|
|
53
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
54
|
+
rows: OngoingRegularStakeholderRecord[];
|
|
55
|
+
total: number;
|
|
56
|
+
}>;
|
|
57
|
+
getById(id: string): Promise<OngoingRegularStakeholderRecord | null>;
|
|
58
|
+
}
|
|
59
|
+
export interface RiskMitigationPlanRecord {
|
|
60
|
+
id: string;
|
|
61
|
+
status: string;
|
|
62
|
+
created_at: string;
|
|
63
|
+
updated_at: string;
|
|
64
|
+
data: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
export interface IRiskMitigationPlanPort {
|
|
67
|
+
execute(command: string, payload: Record<string, unknown>): Promise<RiskMitigationPlanRecord>;
|
|
68
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
69
|
+
rows: RiskMitigationPlanRecord[];
|
|
70
|
+
total: number;
|
|
71
|
+
}>;
|
|
72
|
+
getById(id: string): Promise<RiskMitigationPlanRecord | null>;
|
|
73
|
+
}
|
|
74
|
+
export interface TargetEnterpriseSystemRecord {
|
|
75
|
+
id: string;
|
|
76
|
+
status: string;
|
|
77
|
+
created_at: string;
|
|
78
|
+
updated_at: string;
|
|
79
|
+
data: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
export interface ITargetEnterpriseSystemPort {
|
|
82
|
+
execute(command: string, payload: Record<string, unknown>): Promise<TargetEnterpriseSystemRecord>;
|
|
83
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
84
|
+
rows: TargetEnterpriseSystemRecord[];
|
|
85
|
+
total: number;
|
|
86
|
+
}>;
|
|
87
|
+
getById(id: string): Promise<TargetEnterpriseSystemRecord | null>;
|
|
88
|
+
}
|
|
89
|
+
export interface UnderwritingRecord {
|
|
90
|
+
id: string;
|
|
91
|
+
status: string;
|
|
92
|
+
created_at: string;
|
|
93
|
+
updated_at: string;
|
|
94
|
+
data: Record<string, unknown>;
|
|
95
|
+
}
|
|
96
|
+
export interface IUnderwritingPort {
|
|
97
|
+
execute(command: string, payload: Record<string, unknown>): Promise<UnderwritingRecord>;
|
|
98
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
99
|
+
rows: UnderwritingRecord[];
|
|
100
|
+
total: number;
|
|
101
|
+
}>;
|
|
102
|
+
getById(id: string): Promise<UnderwritingRecord | null>;
|
|
103
|
+
}
|
|
104
|
+
export interface ScopedPilotReduceRecord {
|
|
105
|
+
id: string;
|
|
106
|
+
status: string;
|
|
107
|
+
created_at: string;
|
|
108
|
+
updated_at: string;
|
|
109
|
+
data: Record<string, unknown>;
|
|
110
|
+
}
|
|
111
|
+
export interface IScopedPilotReducePort {
|
|
112
|
+
execute(command: string, payload: Record<string, unknown>): Promise<ScopedPilotReduceRecord>;
|
|
113
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
114
|
+
rows: ScopedPilotReduceRecord[];
|
|
115
|
+
total: number;
|
|
116
|
+
}>;
|
|
117
|
+
getById(id: string): Promise<ScopedPilotReduceRecord | null>;
|
|
118
|
+
}
|
|
119
|
+
export interface ReEvaluateRiskRecord {
|
|
120
|
+
id: string;
|
|
121
|
+
status: string;
|
|
122
|
+
created_at: string;
|
|
123
|
+
updated_at: string;
|
|
124
|
+
data: Record<string, unknown>;
|
|
125
|
+
}
|
|
126
|
+
export interface IReEvaluateRiskPort {
|
|
127
|
+
execute(command: string, payload: Record<string, unknown>): Promise<ReEvaluateRiskRecord>;
|
|
128
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
129
|
+
rows: ReEvaluateRiskRecord[];
|
|
130
|
+
total: number;
|
|
131
|
+
}>;
|
|
132
|
+
getById(id: string): Promise<ReEvaluateRiskRecord | null>;
|
|
133
|
+
}
|
|
134
|
+
export interface RecommendationRecord {
|
|
135
|
+
id: string;
|
|
136
|
+
status: string;
|
|
137
|
+
created_at: string;
|
|
138
|
+
updated_at: string;
|
|
139
|
+
data: Record<string, unknown>;
|
|
140
|
+
}
|
|
141
|
+
export interface IRecommendationPort {
|
|
142
|
+
execute(command: string, payload: Record<string, unknown>): Promise<RecommendationRecord>;
|
|
143
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
144
|
+
rows: RecommendationRecord[];
|
|
145
|
+
total: number;
|
|
146
|
+
}>;
|
|
147
|
+
getById(id: string): Promise<RecommendationRecord | null>;
|
|
148
|
+
}
|
|
149
|
+
export interface ApiGatewayRecord {
|
|
150
|
+
id: string;
|
|
151
|
+
status: string;
|
|
152
|
+
created_at: string;
|
|
153
|
+
updated_at: string;
|
|
154
|
+
data: Record<string, unknown>;
|
|
155
|
+
}
|
|
156
|
+
export interface IApiGatewayPort {
|
|
157
|
+
execute(command: string, payload: Record<string, unknown>): Promise<ApiGatewayRecord>;
|
|
158
|
+
query(filters: Record<string, unknown>, limit: number, offset: number): Promise<{
|
|
159
|
+
rows: ApiGatewayRecord[];
|
|
160
|
+
total: number;
|
|
161
|
+
}>;
|
|
162
|
+
getById(id: string): Promise<ApiGatewayRecord | null>;
|
|
163
|
+
}
|
|
164
|
+
export interface Dependencies {
|
|
165
|
+
readonly domainEnterpriseSolution: IDomainEnterpriseSolutionPort;
|
|
166
|
+
readonly monitoringAlerts: IMonitoringAlertsPort;
|
|
167
|
+
readonly ongoingRegularStakeholder: IOngoingRegularStakeholderPort;
|
|
168
|
+
readonly riskMitigationPlan: IRiskMitigationPlanPort;
|
|
169
|
+
readonly targetEnterpriseSystem: ITargetEnterpriseSystemPort;
|
|
170
|
+
readonly underwriting: IUnderwritingPort;
|
|
171
|
+
readonly scopedPilotReduce: IScopedPilotReducePort;
|
|
172
|
+
readonly reEvaluateRisk: IReEvaluateRiskPort;
|
|
173
|
+
readonly recommendation: IRecommendationPort;
|
|
174
|
+
readonly apiGateway: IApiGatewayPort;
|
|
175
|
+
readonly audit: IAuditPort;
|
|
176
|
+
readonly erp: ErpClient;
|
|
177
|
+
}
|
|
178
|
+
export declare function createDependencies(db: DbClient, erp: ErpClient): Dependencies;
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { ConsoleTelemetry } from '../infra/telemetry.js';
|
|
3
|
+
class AuditAdapter {
|
|
4
|
+
db;
|
|
5
|
+
constructor(db) {
|
|
6
|
+
this.db = db;
|
|
7
|
+
}
|
|
8
|
+
async log(entityType, entityId, action, actor, payload) {
|
|
9
|
+
const id = crypto.randomUUID();
|
|
10
|
+
const now = new Date().toISOString();
|
|
11
|
+
await this.db.execute('INSERT INTO audit_log (id, entity_type, entity_id, action, actor, payload, created_at) VALUES (:1, :2, :3, :4, :5, :6, :7)', [id, entityType, entityId, action, actor, JSON.stringify(payload), now]);
|
|
12
|
+
return { id, entity_type: entityType, entity_id: entityId, action, actor, payload, created_at: now };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class DomainEnterpriseSolutionAdapter {
|
|
16
|
+
db;
|
|
17
|
+
telemetry;
|
|
18
|
+
constructor(db, telemetry) {
|
|
19
|
+
this.db = db;
|
|
20
|
+
this.telemetry = telemetry;
|
|
21
|
+
}
|
|
22
|
+
async execute(command, payload) {
|
|
23
|
+
return this.telemetry.withSpan('domain_enterprise_solution', command, {}, async () => {
|
|
24
|
+
const id = crypto.randomUUID();
|
|
25
|
+
const now = new Date().toISOString();
|
|
26
|
+
await this.db.execute('INSERT INTO domain_enterprise_solution_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
27
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async query(filters, limit, offset) {
|
|
31
|
+
return this.telemetry.withSpan('domain_enterprise_solution', 'query', {}, async () => {
|
|
32
|
+
void filters;
|
|
33
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM domain_enterprise_solution_records', []);
|
|
34
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
35
|
+
const dataRows = await this.db.query(`SELECT * FROM domain_enterprise_solution_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
36
|
+
return { rows: dataRows, total };
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async getById(id) {
|
|
40
|
+
const rows = await this.db.query('SELECT * FROM domain_enterprise_solution_records WHERE id = :1', [id]);
|
|
41
|
+
return rows[0] ?? null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class MonitoringAlertsAdapter {
|
|
45
|
+
db;
|
|
46
|
+
telemetry;
|
|
47
|
+
constructor(db, telemetry) {
|
|
48
|
+
this.db = db;
|
|
49
|
+
this.telemetry = telemetry;
|
|
50
|
+
}
|
|
51
|
+
async execute(command, payload) {
|
|
52
|
+
return this.telemetry.withSpan('monitoring_alerts', command, {}, async () => {
|
|
53
|
+
const id = crypto.randomUUID();
|
|
54
|
+
const now = new Date().toISOString();
|
|
55
|
+
await this.db.execute('INSERT INTO monitoring_alerts_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
56
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async query(filters, limit, offset) {
|
|
60
|
+
return this.telemetry.withSpan('monitoring_alerts', 'query', {}, async () => {
|
|
61
|
+
void filters;
|
|
62
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM monitoring_alerts_records', []);
|
|
63
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
64
|
+
const dataRows = await this.db.query(`SELECT * FROM monitoring_alerts_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
65
|
+
return { rows: dataRows, total };
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async getById(id) {
|
|
69
|
+
const rows = await this.db.query('SELECT * FROM monitoring_alerts_records WHERE id = :1', [id]);
|
|
70
|
+
return rows[0] ?? null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
class OngoingRegularStakeholderAdapter {
|
|
74
|
+
db;
|
|
75
|
+
telemetry;
|
|
76
|
+
constructor(db, telemetry) {
|
|
77
|
+
this.db = db;
|
|
78
|
+
this.telemetry = telemetry;
|
|
79
|
+
}
|
|
80
|
+
async execute(command, payload) {
|
|
81
|
+
return this.telemetry.withSpan('ongoing_regular_stakeholder', command, {}, async () => {
|
|
82
|
+
const id = crypto.randomUUID();
|
|
83
|
+
const now = new Date().toISOString();
|
|
84
|
+
await this.db.execute('INSERT INTO ongoing_regular_stakeholder_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
85
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async query(filters, limit, offset) {
|
|
89
|
+
return this.telemetry.withSpan('ongoing_regular_stakeholder', 'query', {}, async () => {
|
|
90
|
+
void filters;
|
|
91
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM ongoing_regular_stakeholder_records', []);
|
|
92
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
93
|
+
const dataRows = await this.db.query(`SELECT * FROM ongoing_regular_stakeholder_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
94
|
+
return { rows: dataRows, total };
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async getById(id) {
|
|
98
|
+
const rows = await this.db.query('SELECT * FROM ongoing_regular_stakeholder_records WHERE id = :1', [id]);
|
|
99
|
+
return rows[0] ?? null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
class RiskMitigationPlanAdapter {
|
|
103
|
+
db;
|
|
104
|
+
telemetry;
|
|
105
|
+
constructor(db, telemetry) {
|
|
106
|
+
this.db = db;
|
|
107
|
+
this.telemetry = telemetry;
|
|
108
|
+
}
|
|
109
|
+
async execute(command, payload) {
|
|
110
|
+
return this.telemetry.withSpan('risk_mitigation_plan', command, {}, async () => {
|
|
111
|
+
const id = crypto.randomUUID();
|
|
112
|
+
const now = new Date().toISOString();
|
|
113
|
+
await this.db.execute('INSERT INTO risk_mitigation_plan_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
114
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
async query(filters, limit, offset) {
|
|
118
|
+
return this.telemetry.withSpan('risk_mitigation_plan', 'query', {}, async () => {
|
|
119
|
+
void filters;
|
|
120
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM risk_mitigation_plan_records', []);
|
|
121
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
122
|
+
const dataRows = await this.db.query(`SELECT * FROM risk_mitigation_plan_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
123
|
+
return { rows: dataRows, total };
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
async getById(id) {
|
|
127
|
+
const rows = await this.db.query('SELECT * FROM risk_mitigation_plan_records WHERE id = :1', [id]);
|
|
128
|
+
return rows[0] ?? null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
class TargetEnterpriseSystemAdapter {
|
|
132
|
+
db;
|
|
133
|
+
telemetry;
|
|
134
|
+
constructor(db, telemetry) {
|
|
135
|
+
this.db = db;
|
|
136
|
+
this.telemetry = telemetry;
|
|
137
|
+
}
|
|
138
|
+
async execute(command, payload) {
|
|
139
|
+
return this.telemetry.withSpan('target_enterprise_system', command, {}, async () => {
|
|
140
|
+
const id = crypto.randomUUID();
|
|
141
|
+
const now = new Date().toISOString();
|
|
142
|
+
await this.db.execute('INSERT INTO target_enterprise_system_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
143
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
async query(filters, limit, offset) {
|
|
147
|
+
return this.telemetry.withSpan('target_enterprise_system', 'query', {}, async () => {
|
|
148
|
+
void filters;
|
|
149
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM target_enterprise_system_records', []);
|
|
150
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
151
|
+
const dataRows = await this.db.query(`SELECT * FROM target_enterprise_system_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
152
|
+
return { rows: dataRows, total };
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
async getById(id) {
|
|
156
|
+
const rows = await this.db.query('SELECT * FROM target_enterprise_system_records WHERE id = :1', [id]);
|
|
157
|
+
return rows[0] ?? null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
class UnderwritingAdapter {
|
|
161
|
+
db;
|
|
162
|
+
telemetry;
|
|
163
|
+
constructor(db, telemetry) {
|
|
164
|
+
this.db = db;
|
|
165
|
+
this.telemetry = telemetry;
|
|
166
|
+
}
|
|
167
|
+
async execute(command, payload) {
|
|
168
|
+
return this.telemetry.withSpan('underwriting', command, {}, async () => {
|
|
169
|
+
const id = crypto.randomUUID();
|
|
170
|
+
const now = new Date().toISOString();
|
|
171
|
+
await this.db.execute('INSERT INTO underwriting_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
172
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
async query(filters, limit, offset) {
|
|
176
|
+
return this.telemetry.withSpan('underwriting', 'query', {}, async () => {
|
|
177
|
+
void filters;
|
|
178
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM underwriting_records', []);
|
|
179
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
180
|
+
const dataRows = await this.db.query(`SELECT * FROM underwriting_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
181
|
+
return { rows: dataRows, total };
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
async getById(id) {
|
|
185
|
+
const rows = await this.db.query('SELECT * FROM underwriting_records WHERE id = :1', [id]);
|
|
186
|
+
return rows[0] ?? null;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
class ScopedPilotReduceAdapter {
|
|
190
|
+
db;
|
|
191
|
+
telemetry;
|
|
192
|
+
constructor(db, telemetry) {
|
|
193
|
+
this.db = db;
|
|
194
|
+
this.telemetry = telemetry;
|
|
195
|
+
}
|
|
196
|
+
async execute(command, payload) {
|
|
197
|
+
return this.telemetry.withSpan('scoped_pilot_reduce', command, {}, async () => {
|
|
198
|
+
const id = crypto.randomUUID();
|
|
199
|
+
const now = new Date().toISOString();
|
|
200
|
+
await this.db.execute('INSERT INTO scoped_pilot_reduce_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
201
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
async query(filters, limit, offset) {
|
|
205
|
+
return this.telemetry.withSpan('scoped_pilot_reduce', 'query', {}, async () => {
|
|
206
|
+
void filters;
|
|
207
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM scoped_pilot_reduce_records', []);
|
|
208
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
209
|
+
const dataRows = await this.db.query(`SELECT * FROM scoped_pilot_reduce_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
210
|
+
return { rows: dataRows, total };
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
async getById(id) {
|
|
214
|
+
const rows = await this.db.query('SELECT * FROM scoped_pilot_reduce_records WHERE id = :1', [id]);
|
|
215
|
+
return rows[0] ?? null;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
class ReEvaluateRiskAdapter {
|
|
219
|
+
db;
|
|
220
|
+
telemetry;
|
|
221
|
+
constructor(db, telemetry) {
|
|
222
|
+
this.db = db;
|
|
223
|
+
this.telemetry = telemetry;
|
|
224
|
+
}
|
|
225
|
+
async execute(command, payload) {
|
|
226
|
+
return this.telemetry.withSpan('re_evaluate_risk', command, {}, async () => {
|
|
227
|
+
const id = crypto.randomUUID();
|
|
228
|
+
const now = new Date().toISOString();
|
|
229
|
+
await this.db.execute('INSERT INTO re_evaluate_risk_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
230
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
async query(filters, limit, offset) {
|
|
234
|
+
return this.telemetry.withSpan('re_evaluate_risk', 'query', {}, async () => {
|
|
235
|
+
void filters;
|
|
236
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM re_evaluate_risk_records', []);
|
|
237
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
238
|
+
const dataRows = await this.db.query(`SELECT * FROM re_evaluate_risk_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
239
|
+
return { rows: dataRows, total };
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
async getById(id) {
|
|
243
|
+
const rows = await this.db.query('SELECT * FROM re_evaluate_risk_records WHERE id = :1', [id]);
|
|
244
|
+
return rows[0] ?? null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
class RecommendationAdapter {
|
|
248
|
+
db;
|
|
249
|
+
telemetry;
|
|
250
|
+
constructor(db, telemetry) {
|
|
251
|
+
this.db = db;
|
|
252
|
+
this.telemetry = telemetry;
|
|
253
|
+
}
|
|
254
|
+
async execute(command, payload) {
|
|
255
|
+
return this.telemetry.withSpan('recommendation', command, {}, async () => {
|
|
256
|
+
const id = crypto.randomUUID();
|
|
257
|
+
const now = new Date().toISOString();
|
|
258
|
+
await this.db.execute('INSERT INTO recommendation_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
259
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
async query(filters, limit, offset) {
|
|
263
|
+
return this.telemetry.withSpan('recommendation', 'query', {}, async () => {
|
|
264
|
+
void filters;
|
|
265
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM recommendation_records', []);
|
|
266
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
267
|
+
const dataRows = await this.db.query(`SELECT * FROM recommendation_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
268
|
+
return { rows: dataRows, total };
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
async getById(id) {
|
|
272
|
+
const rows = await this.db.query('SELECT * FROM recommendation_records WHERE id = :1', [id]);
|
|
273
|
+
return rows[0] ?? null;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
class ApiGatewayAdapter {
|
|
277
|
+
db;
|
|
278
|
+
telemetry;
|
|
279
|
+
constructor(db, telemetry) {
|
|
280
|
+
this.db = db;
|
|
281
|
+
this.telemetry = telemetry;
|
|
282
|
+
}
|
|
283
|
+
async execute(command, payload) {
|
|
284
|
+
return this.telemetry.withSpan('api_gateway', command, {}, async () => {
|
|
285
|
+
const id = crypto.randomUUID();
|
|
286
|
+
const now = new Date().toISOString();
|
|
287
|
+
await this.db.execute('INSERT INTO api_gateway_records (id, status, created_at, updated_at, data) VALUES (:1, :2, :3, :4, :5)', [id, 'active', now, now, JSON.stringify(payload)]);
|
|
288
|
+
return { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
async query(filters, limit, offset) {
|
|
292
|
+
return this.telemetry.withSpan('api_gateway', 'query', {}, async () => {
|
|
293
|
+
void filters;
|
|
294
|
+
const countRows = await this.db.query('SELECT COUNT(*) as cnt FROM api_gateway_records', []);
|
|
295
|
+
const total = countRows[0]?.cnt ?? 0;
|
|
296
|
+
const dataRows = await this.db.query(`SELECT * FROM api_gateway_records ORDER BY created_at DESC LIMIT ${limit} OFFSET ${offset}`, []);
|
|
297
|
+
return { rows: dataRows, total };
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
async getById(id) {
|
|
301
|
+
const rows = await this.db.query('SELECT * FROM api_gateway_records WHERE id = :1', [id]);
|
|
302
|
+
return rows[0] ?? null;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
export function createDependencies(db, erp) {
|
|
306
|
+
const telemetry = new ConsoleTelemetry();
|
|
307
|
+
return {
|
|
308
|
+
domainEnterpriseSolution: new DomainEnterpriseSolutionAdapter(db, telemetry),
|
|
309
|
+
monitoringAlerts: new MonitoringAlertsAdapter(db, telemetry),
|
|
310
|
+
ongoingRegularStakeholder: new OngoingRegularStakeholderAdapter(db, telemetry),
|
|
311
|
+
riskMitigationPlan: new RiskMitigationPlanAdapter(db, telemetry),
|
|
312
|
+
targetEnterpriseSystem: new TargetEnterpriseSystemAdapter(db, telemetry),
|
|
313
|
+
underwriting: new UnderwritingAdapter(db, telemetry),
|
|
314
|
+
scopedPilotReduce: new ScopedPilotReduceAdapter(db, telemetry),
|
|
315
|
+
reEvaluateRisk: new ReEvaluateRiskAdapter(db, telemetry),
|
|
316
|
+
recommendation: new RecommendationAdapter(db, telemetry),
|
|
317
|
+
apiGateway: new ApiGatewayAdapter(db, telemetry),
|
|
318
|
+
audit: new AuditAdapter(db),
|
|
319
|
+
erp,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { Hono } from 'hono';
|
|
3
|
+
export const healthRouter = new Hono();
|
|
4
|
+
healthRouter.get('/healthz', (c) => {
|
|
5
|
+
return c.json({ status: 'ok' }, 200);
|
|
6
|
+
});
|
|
7
|
+
healthRouter.get('/readyz', (c) => {
|
|
8
|
+
return c.json({ status: 'ready' }, 200);
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { serve } from '@hono/node-server';
|
|
3
|
+
import { app } from './routes.js';
|
|
4
|
+
const PORT = parseInt(process.env.PORT ?? '8080', 10);
|
|
5
|
+
serve({ fetch: app.fetch, port: PORT }, (info) => {
|
|
6
|
+
process.stdout.write(JSON.stringify({
|
|
7
|
+
severity: 'INFO',
|
|
8
|
+
message: 'HTTP server started',
|
|
9
|
+
port: info.port,
|
|
10
|
+
pid: process.pid,
|
|
11
|
+
timestamp: new Date().toISOString(),
|
|
12
|
+
}) + '\n');
|
|
13
|
+
});
|
|
14
|
+
process.on('SIGTERM', () => {
|
|
15
|
+
process.stdout.write(JSON.stringify({
|
|
16
|
+
severity: 'INFO',
|
|
17
|
+
message: 'Received SIGTERM — shutting down gracefully',
|
|
18
|
+
timestamp: new Date().toISOString(),
|
|
19
|
+
}) + '\n');
|
|
20
|
+
process.exit(0);
|
|
21
|
+
});
|