@llm-dev-ops/agentics-cli 1.4.87 → 1.4.90
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/config/endpoints.js +30 -30
- package/dist/config/endpoints.js.map +1 -1
- 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/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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for api gateway
|
|
4
|
+
class MockApiGatewayAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('api gateway Port', () => {
|
|
22
|
+
const adapter = new MockApiGatewayAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockApiGatewayAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for domain enterprise solution
|
|
4
|
+
class MockDomainEnterpriseSolutionAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('domain enterprise solution Port', () => {
|
|
22
|
+
const adapter = new MockDomainEnterpriseSolutionAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockDomainEnterpriseSolutionAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
import { Hono } from 'hono';
|
|
4
|
+
import { healthRouter } from '../server/health.js';
|
|
5
|
+
describe('Health Endpoints', () => {
|
|
6
|
+
const app = new Hono().route('/health', healthRouter);
|
|
7
|
+
it('GET /health/healthz returns 200', async () => {
|
|
8
|
+
const res = await app.request('/health/healthz');
|
|
9
|
+
expect(res.status).toBe(200);
|
|
10
|
+
const body = await res.json();
|
|
11
|
+
expect(body.status).toBe('ok');
|
|
12
|
+
});
|
|
13
|
+
it('GET /health/readyz returns 200', async () => {
|
|
14
|
+
const res = await app.request('/health/readyz');
|
|
15
|
+
expect(res.status).toBe(200);
|
|
16
|
+
const body = await res.json();
|
|
17
|
+
expect(body.status).toBe('ready');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for monitoring alerts
|
|
4
|
+
class MockMonitoringAlertsAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('monitoring alerts Port', () => {
|
|
22
|
+
const adapter = new MockMonitoringAlertsAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockMonitoringAlertsAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for ongoing regular stakeholder
|
|
4
|
+
class MockOngoingRegularStakeholderAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('ongoing regular stakeholder Port', () => {
|
|
22
|
+
const adapter = new MockOngoingRegularStakeholderAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockOngoingRegularStakeholderAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for re evaluate risk
|
|
4
|
+
class MockReEvaluateRiskAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('re evaluate risk Port', () => {
|
|
22
|
+
const adapter = new MockReEvaluateRiskAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockReEvaluateRiskAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for recommendation
|
|
4
|
+
class MockRecommendationAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('recommendation Port', () => {
|
|
22
|
+
const adapter = new MockRecommendationAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockRecommendationAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for risk mitigation plan
|
|
4
|
+
class MockRiskMitigationPlanAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('risk mitigation plan Port', () => {
|
|
22
|
+
const adapter = new MockRiskMitigationPlanAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockRiskMitigationPlanAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for scoped pilot reduce
|
|
4
|
+
class MockScopedPilotReduceAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('scoped pilot reduce Port', () => {
|
|
22
|
+
const adapter = new MockScopedPilotReduceAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockScopedPilotReduceAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for target enterprise system
|
|
4
|
+
class MockTargetEnterpriseSystemAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('target enterprise system Port', () => {
|
|
22
|
+
const adapter = new MockTargetEnterpriseSystemAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockTargetEnterpriseSystemAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
// Mock adapter for underwriting
|
|
4
|
+
class MockUnderwritingAdapter {
|
|
5
|
+
store = new Map();
|
|
6
|
+
async execute(command, payload) {
|
|
7
|
+
const id = crypto.randomUUID();
|
|
8
|
+
const now = new Date().toISOString();
|
|
9
|
+
const record = { id, status: 'active', created_at: now, updated_at: now, data: payload };
|
|
10
|
+
this.store.set(id, record);
|
|
11
|
+
return record;
|
|
12
|
+
}
|
|
13
|
+
async query(_filters, limit, offset) {
|
|
14
|
+
const all = [...this.store.values()];
|
|
15
|
+
return { rows: all.slice(offset, offset + limit), total: all.length };
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
return this.store.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
describe('underwriting Port', () => {
|
|
22
|
+
const adapter = new MockUnderwritingAdapter();
|
|
23
|
+
it('execute() creates a record with active status', async () => {
|
|
24
|
+
const result = await adapter.execute('create', { name: 'test-entity' });
|
|
25
|
+
expect(result.id).toBeDefined();
|
|
26
|
+
expect(result.status).toBe('active');
|
|
27
|
+
expect(result.data.name).toBe('test-entity');
|
|
28
|
+
expect(result.created_at).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
it('getById() retrieves a created record', async () => {
|
|
31
|
+
const created = await adapter.execute('create', { value: 42 });
|
|
32
|
+
const found = await adapter.getById(created.id);
|
|
33
|
+
expect(found).not.toBeNull();
|
|
34
|
+
expect(found.id).toBe(created.id);
|
|
35
|
+
expect(found.data.value).toBe(42);
|
|
36
|
+
});
|
|
37
|
+
it('getById() returns null for non-existent id', async () => {
|
|
38
|
+
const found = await adapter.getById('non-existent-id');
|
|
39
|
+
expect(found).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it('query() returns paginated results', async () => {
|
|
42
|
+
const mockAdapter = new MockUnderwritingAdapter();
|
|
43
|
+
await mockAdapter.execute('create', { idx: 1 });
|
|
44
|
+
await mockAdapter.execute('create', { idx: 2 });
|
|
45
|
+
await mockAdapter.execute('create', { idx: 3 });
|
|
46
|
+
const result = await mockAdapter.query({}, 2, 0);
|
|
47
|
+
expect(result.total).toBe(3);
|
|
48
|
+
expect(result.rows).toHaveLength(2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ApiGatewayPort, ApiGatewayInput, ApiGateway } from '../ports/api-gateway.js';
|
|
2
|
+
import type { Telemetry } from '../../infra/telemetry.js';
|
|
3
|
+
import type { DbClient, ErpClient } from '../../infra/clients.js';
|
|
4
|
+
/**
|
|
5
|
+
* Infrastructure adapter: ApiGatewayAdapter
|
|
6
|
+
* Bounded context: api-gateway
|
|
7
|
+
* ERP system: infor
|
|
8
|
+
*
|
|
9
|
+
* Bridges the ApiGatewayPort port to the infor ERP system
|
|
10
|
+
* and the underlying database client.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ApiGatewayAdapter implements ApiGatewayPort {
|
|
13
|
+
private readonly db;
|
|
14
|
+
private readonly erp;
|
|
15
|
+
private readonly telemetry;
|
|
16
|
+
constructor(db: DbClient, erp: ErpClient, telemetry: Telemetry);
|
|
17
|
+
/** Creates or updates api-gateway record */
|
|
18
|
+
routeRequests(input: ApiGatewayInput): Promise<ApiGateway>;
|
|
19
|
+
/** Creates or updates api-gateway record */
|
|
20
|
+
authenticate(input: ApiGatewayInput): Promise<ApiGateway>;
|
|
21
|
+
/** Creates or updates api-gateway record */
|
|
22
|
+
rateLimit(input: ApiGatewayInput): Promise<ApiGateway>;
|
|
23
|
+
/** Returns api-gateway data */
|
|
24
|
+
listApiGateway(input: Record<string, unknown>): Promise<ApiGateway[]>;
|
|
25
|
+
/** Returns api-gateway data */
|
|
26
|
+
id(input: Record<string, unknown>): Promise<ApiGateway[]>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
+
/**
|
|
3
|
+
* Infrastructure adapter: ApiGatewayAdapter
|
|
4
|
+
* Bounded context: api-gateway
|
|
5
|
+
* ERP system: infor
|
|
6
|
+
*
|
|
7
|
+
* Bridges the ApiGatewayPort port to the infor ERP system
|
|
8
|
+
* and the underlying database client.
|
|
9
|
+
*/
|
|
10
|
+
export class ApiGatewayAdapter {
|
|
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 api-gateway record */
|
|
20
|
+
async routeRequests(input) {
|
|
21
|
+
return this.telemetry.withSpan('api_gateway', 'routeRequests', {}, async () => {
|
|
22
|
+
const result = await this.erp.invoke('routeRequests', input);
|
|
23
|
+
return result;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Creates or updates api-gateway record */
|
|
27
|
+
async authenticate(input) {
|
|
28
|
+
return this.telemetry.withSpan('api_gateway', 'authenticate', {}, async () => {
|
|
29
|
+
const result = await this.erp.invoke('authenticate', input);
|
|
30
|
+
return result;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Creates or updates api-gateway record */
|
|
34
|
+
async rateLimit(input) {
|
|
35
|
+
return this.telemetry.withSpan('api_gateway', 'rateLimit', {}, async () => {
|
|
36
|
+
const result = await this.erp.invoke('rateLimit', input);
|
|
37
|
+
return result;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** Returns api-gateway data */
|
|
41
|
+
async listApiGateway(input) {
|
|
42
|
+
return this.telemetry.withSpan('api_gateway', 'listApiGateway', {}, async () => {
|
|
43
|
+
const rows = await this.db.query('SELECT * FROM api_gateway WHERE 1=1', []);
|
|
44
|
+
return rows;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Returns api-gateway data */
|
|
48
|
+
async id(input) {
|
|
49
|
+
return this.telemetry.withSpan('api_gateway', 'id', {}, async () => {
|
|
50
|
+
const result = await this.erp.invoke('id', input);
|
|
51
|
+
return result;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|