@llm-dev-ops/agentics-cli 1.4.95 → 1.5.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/dist/agents/system-prompts.d.ts.map +1 -1
- package/dist/agents/system-prompts.js +25 -3
- package/dist/agents/system-prompts.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +20 -1
- package/dist/commands/export.js.map +1 -1
- package/dist/infrastructure/db-adapter.d.ts +67 -0
- package/dist/infrastructure/db-adapter.d.ts.map +1 -0
- package/dist/infrastructure/db-adapter.js +151 -0
- package/dist/infrastructure/db-adapter.js.map +1 -0
- package/dist/infrastructure/sap-adapter.d.ts +95 -0
- package/dist/infrastructure/sap-adapter.d.ts.map +1 -0
- package/dist/infrastructure/sap-adapter.js +651 -0
- package/dist/infrastructure/sap-adapter.js.map +1 -0
- package/dist/server/routes/erpsurface.d.ts +3 -1
- package/dist/server/routes/erpsurface.d.ts.map +1 -1
- package/dist/server/routes/erpsurface.js +548 -7
- package/dist/server/routes/erpsurface.js.map +1 -1
- package/package.json +1 -1
- package/dist/__tests__/api_gateway.test.d.ts +0 -1
- package/dist/__tests__/api_gateway.test.js +0 -50
- package/dist/__tests__/domain_enterprise_solution.test.d.ts +0 -1
- package/dist/__tests__/domain_enterprise_solution.test.js +0 -50
- package/dist/__tests__/health.test.d.ts +0 -1
- package/dist/__tests__/health.test.js +0 -19
- package/dist/__tests__/monitoring_alerts.test.d.ts +0 -1
- package/dist/__tests__/monitoring_alerts.test.js +0 -50
- package/dist/__tests__/ongoing_regular_stakeholder.test.d.ts +0 -1
- package/dist/__tests__/ongoing_regular_stakeholder.test.js +0 -50
- package/dist/__tests__/re_evaluate_risk.test.d.ts +0 -1
- package/dist/__tests__/re_evaluate_risk.test.js +0 -50
- package/dist/__tests__/recommendation.test.d.ts +0 -1
- package/dist/__tests__/recommendation.test.js +0 -50
- package/dist/__tests__/risk_mitigation_plan.test.d.ts +0 -1
- package/dist/__tests__/risk_mitigation_plan.test.js +0 -50
- package/dist/__tests__/scoped_pilot_reduce.test.d.ts +0 -1
- package/dist/__tests__/scoped_pilot_reduce.test.js +0 -50
- package/dist/__tests__/target_enterprise_system.test.d.ts +0 -1
- package/dist/__tests__/target_enterprise_system.test.js +0 -50
- package/dist/__tests__/underwriting.test.d.ts +0 -1
- package/dist/__tests__/underwriting.test.js +0 -50
- package/dist/api-gateway/infra/api-gateway-adapter.d.ts +0 -27
- package/dist/api-gateway/infra/api-gateway-adapter.js +0 -54
- package/dist/api-gateway/ports/api-gateway.d.ts +0 -26
- package/dist/api-gateway/ports/api-gateway.js +0 -2
- package/dist/contracts/contract-validation.d.ts +0 -11
- package/dist/contracts/contract-validation.js +0 -21
- package/dist/domain-enterprise-solution/infra/api-gateway-seam-adapter.d.ts +0 -21
- package/dist/domain-enterprise-solution/infra/api-gateway-seam-adapter.js +0 -42
- package/dist/domain-enterprise-solution/infra/domain-enterprise-solution-adapter.d.ts +0 -25
- package/dist/domain-enterprise-solution/infra/domain-enterprise-solution-adapter.js +0 -47
- package/dist/domain-enterprise-solution/ports/api-gateway-seam.d.ts +0 -20
- package/dist/domain-enterprise-solution/ports/api-gateway-seam.js +0 -2
- package/dist/domain-enterprise-solution/ports/domain-enterprise-solution.d.ts +0 -24
- package/dist/domain-enterprise-solution/ports/domain-enterprise-solution.js +0 -2
- package/dist/enterprise/index.d.ts +0 -15
- package/dist/enterprise/index.js +0 -16
- package/dist/erp-client/client.d.ts +0 -42
- package/dist/erp-client/client.js +0 -235
- package/dist/erp-client/mapper.d.ts +0 -9
- package/dist/erp-client/mapper.js +0 -116
- package/dist/erp-client/retry.d.ts +0 -17
- package/dist/erp-client/retry.js +0 -74
- package/dist/erp-client/types.d.ts +0 -155
- package/dist/erp-client/types.js +0 -2
- package/dist/infra/clients.d.ts +0 -27
- package/dist/infra/clients.js +0 -16
- package/dist/infra/connection-pool.d.ts +0 -16
- package/dist/infra/connection-pool.js +0 -13
- package/dist/infra/iam-helper.d.ts +0 -1
- package/dist/infra/iam-helper.js +0 -138
- package/dist/infra/telemetry.d.ts +0 -26
- package/dist/infra/telemetry.js +0 -39
- package/dist/monitoring-alerts/infra/monitoring-alerts-adapter.d.ts +0 -25
- package/dist/monitoring-alerts/infra/monitoring-alerts-adapter.js +0 -47
- package/dist/monitoring-alerts/ports/monitoring-alerts.d.ts +0 -24
- package/dist/monitoring-alerts/ports/monitoring-alerts.js +0 -2
- package/dist/ongoing-regular-stakeholder/infra/ongoing-regular-stakeholder-adapter.d.ts +0 -25
- package/dist/ongoing-regular-stakeholder/infra/ongoing-regular-stakeholder-adapter.js +0 -47
- package/dist/ongoing-regular-stakeholder/ports/ongoing-regular-stakeholder.d.ts +0 -24
- package/dist/ongoing-regular-stakeholder/ports/ongoing-regular-stakeholder.js +0 -2
- package/dist/re-evaluate-risk/infra/re-evaluate-risk-adapter.d.ts +0 -25
- package/dist/re-evaluate-risk/infra/re-evaluate-risk-adapter.js +0 -47
- package/dist/re-evaluate-risk/ports/re-evaluate-risk.d.ts +0 -24
- package/dist/re-evaluate-risk/ports/re-evaluate-risk.js +0 -2
- package/dist/recommendation/infra/recommendation-adapter.d.ts +0 -25
- package/dist/recommendation/infra/recommendation-adapter.js +0 -47
- package/dist/recommendation/ports/recommendation.d.ts +0 -24
- package/dist/recommendation/ports/recommendation.js +0 -2
- package/dist/risk-mitigation-plan/infra/risk-mitigation-plan-adapter.d.ts +0 -25
- package/dist/risk-mitigation-plan/infra/risk-mitigation-plan-adapter.js +0 -47
- package/dist/risk-mitigation-plan/ports/risk-mitigation-plan.d.ts +0 -24
- package/dist/risk-mitigation-plan/ports/risk-mitigation-plan.js +0 -2
- package/dist/scoped-pilot-reduce/infra/scoped-pilot-reduce-adapter.d.ts +0 -25
- package/dist/scoped-pilot-reduce/infra/scoped-pilot-reduce-adapter.js +0 -47
- package/dist/scoped-pilot-reduce/ports/scoped-pilot-reduce.d.ts +0 -24
- package/dist/scoped-pilot-reduce/ports/scoped-pilot-reduce.js +0 -2
- package/dist/server/dependencies.d.ts +0 -178
- package/dist/server/dependencies.js +0 -321
- package/dist/server/health.d.ts +0 -2
- package/dist/server/health.js +0 -9
- package/dist/server/main.d.ts +0 -1
- package/dist/server/main.js +0 -21
- package/dist/server/middleware.d.ts +0 -4
- package/dist/server/middleware.js +0 -106
- package/dist/server/routes.d.ts +0 -5
- package/dist/server/routes.js +0 -1100
- package/dist/server/schemas.d.ts +0 -217
- package/dist/server/schemas.js +0 -185
- package/dist/target-enterprise-system/infra/target-enterprise-system-adapter.d.ts +0 -25
- package/dist/target-enterprise-system/infra/target-enterprise-system-adapter.js +0 -47
- package/dist/target-enterprise-system/ports/target-enterprise-system.d.ts +0 -24
- package/dist/target-enterprise-system/ports/target-enterprise-system.js +0 -2
- package/dist/underwriting/infra/underwriting-adapter.d.ts +0 -25
- package/dist/underwriting/infra/underwriting-adapter.js +0 -47
- package/dist/underwriting/ports/underwriting.d.ts +0 -24
- package/dist/underwriting/ports/underwriting.js +0 -2
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Port interface for bounded context: api-gateway
|
|
3
|
-
*/
|
|
4
|
-
export interface ApiGatewayInput {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly api_gateway_id: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ApiGateway {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly created_at: string;
|
|
11
|
-
readonly updated_at: string;
|
|
12
|
-
readonly status: 'active' | 'inactive' | 'pending' | 'completed' | 'error';
|
|
13
|
-
readonly api_gateway_id: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ApiGatewayPort {
|
|
16
|
-
/** Creates or updates api-gateway record */
|
|
17
|
-
routeRequests(input: ApiGatewayInput): Promise<ApiGateway>;
|
|
18
|
-
/** Creates or updates api-gateway record */
|
|
19
|
-
authenticate(input: ApiGatewayInput): Promise<ApiGateway>;
|
|
20
|
-
/** Creates or updates api-gateway record */
|
|
21
|
-
rateLimit(input: ApiGatewayInput): Promise<ApiGateway>;
|
|
22
|
-
/** Returns api-gateway data */
|
|
23
|
-
listApiGateway(input: Record<string, unknown>): Promise<ApiGateway[]>;
|
|
24
|
-
/** Returns api-gateway data */
|
|
25
|
-
id(input: Record<string, unknown>): Promise<ApiGateway[]>;
|
|
26
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Contract validation for ERP deployment artifacts.
|
|
3
|
-
* Schema source: runtime
|
|
4
|
-
*/
|
|
5
|
-
type JsonSchema = Record<string, any>;
|
|
6
|
-
export interface ValidationResult {
|
|
7
|
-
readonly valid: boolean;
|
|
8
|
-
readonly errors: string[];
|
|
9
|
-
}
|
|
10
|
-
export declare function validateDeploymentArtifact(payload: unknown, schema?: JsonSchema): ValidationResult;
|
|
11
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Generated by Phase 6 pipeline — do not edit manually
|
|
2
|
-
const EMBEDDED_SCHEMA = null;
|
|
3
|
-
export function validateDeploymentArtifact(payload, schema) {
|
|
4
|
-
const activeSchema = schema ?? EMBEDDED_SCHEMA;
|
|
5
|
-
const errors = [];
|
|
6
|
-
if (activeSchema === null) {
|
|
7
|
-
return { valid: true, errors: ['Schema not available — validation skipped'] };
|
|
8
|
-
}
|
|
9
|
-
if (typeof payload !== 'object' || payload === null) {
|
|
10
|
-
return { valid: false, errors: ['Payload must be a non-null object'] };
|
|
11
|
-
}
|
|
12
|
-
const obj = payload;
|
|
13
|
-
const requiredFields = activeSchema['required'];
|
|
14
|
-
if (Array.isArray(requiredFields)) {
|
|
15
|
-
for (const field of requiredFields) {
|
|
16
|
-
if (!(field in obj))
|
|
17
|
-
errors.push(`Missing required field: ${field}`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return { valid: errors.length === 0, errors };
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ApiGatewaySeamPort, DomainEnterpriseSolution, DomainEnterpriseSolutionInput } from '../ports/api-gateway-seam.js';
|
|
2
|
-
import type { Telemetry } from '../../infra/telemetry.js';
|
|
3
|
-
import type { DbClient, ErpClient } from '../../infra/clients.js';
|
|
4
|
-
/**
|
|
5
|
-
* Infrastructure adapter: ApiGatewaySeamAdapter
|
|
6
|
-
* Bounded context: domain-enterprise-solution
|
|
7
|
-
* ERP system: infor
|
|
8
|
-
*
|
|
9
|
-
* Bridges the ApiGatewaySeamPort port to the infor ERP system
|
|
10
|
-
* and the underlying database client.
|
|
11
|
-
*/
|
|
12
|
-
export declare class ApiGatewaySeamAdapter implements ApiGatewaySeamPort {
|
|
13
|
-
private readonly db;
|
|
14
|
-
private readonly erp;
|
|
15
|
-
private readonly telemetry;
|
|
16
|
-
constructor(db: DbClient, erp: ErpClient, telemetry: Telemetry);
|
|
17
|
-
findById(id: string): Promise<DomainEnterpriseSolution | null>;
|
|
18
|
-
findAll(filters?: Record<string, unknown>): Promise<DomainEnterpriseSolution[]>;
|
|
19
|
-
save(input: DomainEnterpriseSolutionInput): Promise<DomainEnterpriseSolution>;
|
|
20
|
-
deleteById(id: string): Promise<void>;
|
|
21
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
-
/**
|
|
3
|
-
* Infrastructure adapter: ApiGatewaySeamAdapter
|
|
4
|
-
* Bounded context: domain-enterprise-solution
|
|
5
|
-
* ERP system: infor
|
|
6
|
-
*
|
|
7
|
-
* Bridges the ApiGatewaySeamPort port to the infor ERP system
|
|
8
|
-
* and the underlying database client.
|
|
9
|
-
*/
|
|
10
|
-
export class ApiGatewaySeamAdapter {
|
|
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
|
-
async findById(id) {
|
|
20
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'findById', { id }, async () => {
|
|
21
|
-
const rows = await this.db.query('SELECT * FROM api_gateway_seam WHERE id = :1', [id]);
|
|
22
|
-
return rows[0] ?? null;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
async findAll(filters) {
|
|
26
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'findAll', {}, async () => {
|
|
27
|
-
const rows = await this.db.query('SELECT * FROM api_gateway_seam', []);
|
|
28
|
-
return rows;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
async save(input) {
|
|
32
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'save', {}, async () => {
|
|
33
|
-
const result = await this.erp.invoke('save', input);
|
|
34
|
-
return result;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async deleteById(id) {
|
|
38
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'deleteById', { id }, async () => {
|
|
39
|
-
await this.db.execute('DELETE FROM api_gateway_seam WHERE id = :1', [id]);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { DomainEnterpriseSolutionPort, DomainEnterpriseSolutionInput, DomainEnterpriseSolution } from '../ports/domain-enterprise-solution.js';
|
|
2
|
-
import type { Telemetry } from '../../infra/telemetry.js';
|
|
3
|
-
import type { DbClient, ErpClient } from '../../infra/clients.js';
|
|
4
|
-
/**
|
|
5
|
-
* Infrastructure adapter: DomainEnterpriseSolutionAdapter
|
|
6
|
-
* Bounded context: domain-enterprise-solution
|
|
7
|
-
* ERP system: infor
|
|
8
|
-
*
|
|
9
|
-
* Bridges the DomainEnterpriseSolutionPort port to the infor ERP system
|
|
10
|
-
* and the underlying database client.
|
|
11
|
-
*/
|
|
12
|
-
export declare class DomainEnterpriseSolutionAdapter implements DomainEnterpriseSolutionPort {
|
|
13
|
-
private readonly db;
|
|
14
|
-
private readonly erp;
|
|
15
|
-
private readonly telemetry;
|
|
16
|
-
constructor(db: DbClient, erp: ErpClient, telemetry: Telemetry);
|
|
17
|
-
/** Creates or updates domain-enterprise-solution record */
|
|
18
|
-
manageDomainEnterprise(input: DomainEnterpriseSolutionInput): Promise<DomainEnterpriseSolution>;
|
|
19
|
-
/** Creates or updates domain-enterprise-solution record */
|
|
20
|
-
queryDomainEnterprise(input: DomainEnterpriseSolutionInput): Promise<DomainEnterpriseSolution>;
|
|
21
|
-
/** Returns domain-enterprise-solution data */
|
|
22
|
-
listDomainEnterpriseSolution(input: Record<string, unknown>): Promise<DomainEnterpriseSolution[]>;
|
|
23
|
-
/** Returns domain-enterprise-solution data */
|
|
24
|
-
id(input: Record<string, unknown>): Promise<DomainEnterpriseSolution[]>;
|
|
25
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
-
/**
|
|
3
|
-
* Infrastructure adapter: DomainEnterpriseSolutionAdapter
|
|
4
|
-
* Bounded context: domain-enterprise-solution
|
|
5
|
-
* ERP system: infor
|
|
6
|
-
*
|
|
7
|
-
* Bridges the DomainEnterpriseSolutionPort port to the infor ERP system
|
|
8
|
-
* and the underlying database client.
|
|
9
|
-
*/
|
|
10
|
-
export class DomainEnterpriseSolutionAdapter {
|
|
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 domain-enterprise-solution record */
|
|
20
|
-
async manageDomainEnterprise(input) {
|
|
21
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'manageDomainEnterprise', {}, async () => {
|
|
22
|
-
const result = await this.erp.invoke('manageDomainEnterprise', input);
|
|
23
|
-
return result;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
/** Creates or updates domain-enterprise-solution record */
|
|
27
|
-
async queryDomainEnterprise(input) {
|
|
28
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'queryDomainEnterprise', {}, async () => {
|
|
29
|
-
const rows = await this.db.query('SELECT * FROM domain_enterprise_solution WHERE 1=1', []);
|
|
30
|
-
return rows;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/** Returns domain-enterprise-solution data */
|
|
34
|
-
async listDomainEnterpriseSolution(input) {
|
|
35
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'listDomainEnterpriseSolution', {}, async () => {
|
|
36
|
-
const rows = await this.db.query('SELECT * FROM domain_enterprise_solution WHERE 1=1', []);
|
|
37
|
-
return rows;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/** Returns domain-enterprise-solution data */
|
|
41
|
-
async id(input) {
|
|
42
|
-
return this.telemetry.withSpan('domain_enterprise_solution', 'id', {}, async () => {
|
|
43
|
-
const result = await this.erp.invoke('id', input);
|
|
44
|
-
return result;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Port interface for bounded context: domain-enterprise-solution
|
|
3
|
-
*/
|
|
4
|
-
export interface DomainEnterpriseSolution {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly created_at: string;
|
|
7
|
-
readonly updated_at: string;
|
|
8
|
-
readonly status: 'active' | 'inactive' | 'pending' | 'completed' | 'error';
|
|
9
|
-
readonly domain_enterprise_solution_id: string;
|
|
10
|
-
}
|
|
11
|
-
export interface DomainEnterpriseSolutionInput {
|
|
12
|
-
readonly id: string;
|
|
13
|
-
readonly domain_enterprise_solution_id: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ApiGatewaySeamPort {
|
|
16
|
-
findById(id: string): Promise<DomainEnterpriseSolution | null>;
|
|
17
|
-
findAll(filters?: Record<string, unknown>): Promise<DomainEnterpriseSolution[]>;
|
|
18
|
-
save(input: DomainEnterpriseSolutionInput): Promise<DomainEnterpriseSolution>;
|
|
19
|
-
deleteById(id: string): Promise<void>;
|
|
20
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Port interface for bounded context: domain-enterprise-solution
|
|
3
|
-
*/
|
|
4
|
-
export interface DomainEnterpriseSolutionInput {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly domain_enterprise_solution_id: string;
|
|
7
|
-
}
|
|
8
|
-
export interface DomainEnterpriseSolution {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly created_at: string;
|
|
11
|
-
readonly updated_at: string;
|
|
12
|
-
readonly status: 'active' | 'inactive' | 'pending' | 'completed' | 'error';
|
|
13
|
-
readonly domain_enterprise_solution_id: string;
|
|
14
|
-
}
|
|
15
|
-
export interface DomainEnterpriseSolutionPort {
|
|
16
|
-
/** Creates or updates domain-enterprise-solution record */
|
|
17
|
-
manageDomainEnterprise(input: DomainEnterpriseSolutionInput): Promise<DomainEnterpriseSolution>;
|
|
18
|
-
/** Creates or updates domain-enterprise-solution record */
|
|
19
|
-
queryDomainEnterprise(input: DomainEnterpriseSolutionInput): Promise<DomainEnterpriseSolution>;
|
|
20
|
-
/** Returns domain-enterprise-solution data */
|
|
21
|
-
listDomainEnterpriseSolution(input: Record<string, unknown>): Promise<DomainEnterpriseSolution[]>;
|
|
22
|
-
/** Returns domain-enterprise-solution data */
|
|
23
|
-
id(input: Record<string, unknown>): Promise<DomainEnterpriseSolution[]>;
|
|
24
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enterprise Integration & Memory Architecture Exports (ADR-004)
|
|
3
|
-
*
|
|
4
|
-
* This module implements the enterprise integration domain model
|
|
5
|
-
* described in ADR-004. All exports serve the five bounded contexts:
|
|
6
|
-
*
|
|
7
|
-
* 1. Enterprise Simulation Domain - simulation memory records
|
|
8
|
-
* 2. Memory & Lineage Domain - lineage tracking, traceability
|
|
9
|
-
* 3. Integration Domain - integration registry, proposals
|
|
10
|
-
* 4. ERP Surface Domain - ERP mappings
|
|
11
|
-
* 5. CLI as Orchestrator - validation helpers
|
|
12
|
-
*/
|
|
13
|
-
export { createLineageRecord, createSimulationMemoryRecord, completeSimulationMemoryRecord, failSimulationMemoryRecord, createIntegrationProposal, createErpSurfaceMapping, validateTraceability, validateLineageChain, } from './lineage.js';
|
|
14
|
-
export { INTEGRATION_REGISTRY, lookupIntegration, getIntegrationsByCategory, getIntegrationNames, isKnownIntegration, getAffectedEntities, } from './integration-registry.js';
|
|
15
|
-
export type { IntegrationDefinition, IntegrationCategory, } from './integration-registry.js';
|
package/dist/enterprise/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enterprise Integration & Memory Architecture Exports (ADR-004)
|
|
3
|
-
*
|
|
4
|
-
* This module implements the enterprise integration domain model
|
|
5
|
-
* described in ADR-004. All exports serve the five bounded contexts:
|
|
6
|
-
*
|
|
7
|
-
* 1. Enterprise Simulation Domain - simulation memory records
|
|
8
|
-
* 2. Memory & Lineage Domain - lineage tracking, traceability
|
|
9
|
-
* 3. Integration Domain - integration registry, proposals
|
|
10
|
-
* 4. ERP Surface Domain - ERP mappings
|
|
11
|
-
* 5. CLI as Orchestrator - validation helpers
|
|
12
|
-
*/
|
|
13
|
-
// Lineage tracking (ADR-004, Domain 2)
|
|
14
|
-
export { createLineageRecord, createSimulationMemoryRecord, completeSimulationMemoryRecord, failSimulationMemoryRecord, createIntegrationProposal, createErpSurfaceMapping, validateTraceability, validateLineageChain, } from './lineage.js';
|
|
15
|
-
// Integration registry (ADR-004, Domain 3)
|
|
16
|
-
export { INTEGRATION_REGISTRY, lookupIntegration, getIntegrationsByCategory, getIntegrationNames, isKnownIntegration, getAffectedEntities, } from './integration-registry.js';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { ErpSurfaceResponse, DomainTransferOrder, DomainPurchaseOrder, DomainItemReceipt, DomainInventoryBalance, GovernanceConfig, SyncQueueEntry, SyncStatus } from './types.js';
|
|
2
|
-
export interface AuditLogger {
|
|
3
|
-
log(entityType: string, entityId: string, action: string, actor: string, payload: unknown): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare class InforClient {
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
private readonly serviceAccountEmail;
|
|
8
|
-
private readonly mapper;
|
|
9
|
-
private readonly breaker;
|
|
10
|
-
private readonly governance;
|
|
11
|
-
private readonly audit;
|
|
12
|
-
private readonly syncQueue;
|
|
13
|
-
private readonly recentErrors;
|
|
14
|
-
private lastSuccessfulSync;
|
|
15
|
-
constructor(config: {
|
|
16
|
-
baseUrl: string;
|
|
17
|
-
serviceAccountEmail: string;
|
|
18
|
-
governance: GovernanceConfig;
|
|
19
|
-
audit?: AuditLogger;
|
|
20
|
-
circuitBreakerThreshold?: number;
|
|
21
|
-
circuitBreakerResetMs?: number;
|
|
22
|
-
});
|
|
23
|
-
private assertWriteAllowed;
|
|
24
|
-
createTransferOrder(domain: DomainTransferOrder, correlationId: string): Promise<ErpSurfaceResponse>;
|
|
25
|
-
createPurchaseOrder(domain: DomainPurchaseOrder, correlationId: string): Promise<ErpSurfaceResponse>;
|
|
26
|
-
getInventoryBalance(subsidiary: string, location: string, item: string, correlationId: string): Promise<DomainInventoryBalance | null>;
|
|
27
|
-
updateItemReceipt(domain: DomainItemReceipt, transferNsId: string, correlationId: string): Promise<ErpSurfaceResponse>;
|
|
28
|
-
getSyncStatus(): SyncStatus;
|
|
29
|
-
getPendingQueue(): ReadonlyArray<SyncQueueEntry>;
|
|
30
|
-
drainSyncQueue(): Promise<{
|
|
31
|
-
processed: number;
|
|
32
|
-
failed: number;
|
|
33
|
-
}>;
|
|
34
|
-
private post;
|
|
35
|
-
private get;
|
|
36
|
-
private getIdentityToken;
|
|
37
|
-
private executeWithFallback;
|
|
38
|
-
private recordError;
|
|
39
|
-
private operationToPath;
|
|
40
|
-
private auditBefore;
|
|
41
|
-
private auditAfter;
|
|
42
|
-
}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
// Generated by Phase 4 pipeline — do not edit manually
|
|
2
|
-
import { InforMapper } from './mapper.js';
|
|
3
|
-
import { withRetry, CircuitBreaker } from './retry.js';
|
|
4
|
-
const GCP_METADATA_TOKEN_URL = 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity';
|
|
5
|
-
const REQUEST_TIMEOUT_MS = 30_000;
|
|
6
|
-
// ============================================================================
|
|
7
|
-
// InforClient — Anti-Corruption Layer
|
|
8
|
-
// ============================================================================
|
|
9
|
-
export class InforClient {
|
|
10
|
-
baseUrl;
|
|
11
|
-
serviceAccountEmail;
|
|
12
|
-
mapper;
|
|
13
|
-
breaker;
|
|
14
|
-
governance;
|
|
15
|
-
audit;
|
|
16
|
-
syncQueue = [];
|
|
17
|
-
recentErrors = [];
|
|
18
|
-
lastSuccessfulSync = null;
|
|
19
|
-
constructor(config) {
|
|
20
|
-
this.baseUrl = config.baseUrl.replace(/\/$/, '');
|
|
21
|
-
this.serviceAccountEmail = config.serviceAccountEmail;
|
|
22
|
-
this.governance = config.governance;
|
|
23
|
-
this.mapper = new InforMapper(config.governance);
|
|
24
|
-
this.breaker = new CircuitBreaker(config.circuitBreakerThreshold ?? 5, config.circuitBreakerResetMs ?? 60_000);
|
|
25
|
-
this.audit = config.audit ?? null;
|
|
26
|
-
}
|
|
27
|
-
// --------------------------------------------------------------------------
|
|
28
|
-
// Governance Guard
|
|
29
|
-
// --------------------------------------------------------------------------
|
|
30
|
-
assertWriteAllowed(operation) {
|
|
31
|
-
if (this.governance.read_only) {
|
|
32
|
-
throw new Error(`Governance: write operation '${operation}' blocked — read_only mode is enabled`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// --------------------------------------------------------------------------
|
|
36
|
-
// Domain Operations (ACL boundary)
|
|
37
|
-
// --------------------------------------------------------------------------
|
|
38
|
-
async createTransferOrder(domain, correlationId) {
|
|
39
|
-
this.assertWriteAllowed('createTransferOrder');
|
|
40
|
-
const wire = this.mapper.toTransferOrder(domain);
|
|
41
|
-
return this.executeWithFallback('createTransferOrder', domain.id, correlationId, async () => {
|
|
42
|
-
return this.post('/M3/m3api-rest/v2/execute/MMS850MI/AddTransferOrder', wire, correlationId);
|
|
43
|
-
}, wire);
|
|
44
|
-
}
|
|
45
|
-
async createPurchaseOrder(domain, correlationId) {
|
|
46
|
-
this.assertWriteAllowed('createPurchaseOrder');
|
|
47
|
-
const wire = this.mapper.toPurchaseOrder(domain);
|
|
48
|
-
return this.executeWithFallback('createPurchaseOrder', domain.id, correlationId, async () => {
|
|
49
|
-
return this.post('/M3/m3api-rest/v2/execute/PPS200MI/AddPurchaseOrder', wire, correlationId);
|
|
50
|
-
}, wire);
|
|
51
|
-
}
|
|
52
|
-
async getInventoryBalance(subsidiary, location, item, correlationId) {
|
|
53
|
-
await this.auditBefore('getInventoryBalance', 'inventory', correlationId, { subsidiary, location, item });
|
|
54
|
-
try {
|
|
55
|
-
const response = await this.breaker.execute(() => withRetry(() => this.get(`/M3/m3api-rest/v2/execute/MMS200MI/GetItemBalance?subsidiary=${encodeURIComponent(subsidiary)}&location=${encodeURIComponent(location)}&item=${encodeURIComponent(item)}`, correlationId)));
|
|
56
|
-
this.lastSuccessfulSync = new Date().toISOString();
|
|
57
|
-
await this.auditAfter('getInventoryBalance', 'inventory', correlationId, response);
|
|
58
|
-
if (response.status === 200 && response.data) {
|
|
59
|
-
return this.mapper.fromInventoryBalance(response.data);
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
this.recordError('getInventoryBalance', err);
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
async updateItemReceipt(domain, transferNsId, correlationId) {
|
|
69
|
-
this.assertWriteAllowed('updateItemReceipt');
|
|
70
|
-
const wire = this.mapper.toItemReceipt(domain, transferNsId);
|
|
71
|
-
return this.executeWithFallback('updateItemReceipt', domain.transfer_id, correlationId, async () => {
|
|
72
|
-
return this.post('/M3/m3api-rest/v2/execute/PPS300MI/AddReceipt', wire, correlationId);
|
|
73
|
-
}, wire);
|
|
74
|
-
}
|
|
75
|
-
// --------------------------------------------------------------------------
|
|
76
|
-
// Sync Queue & Status
|
|
77
|
-
// --------------------------------------------------------------------------
|
|
78
|
-
getSyncStatus() {
|
|
79
|
-
return {
|
|
80
|
-
last_successful_sync: this.lastSuccessfulSync,
|
|
81
|
-
pending_queue_depth: this.syncQueue.length,
|
|
82
|
-
circuit_breaker_state: this.breaker.state,
|
|
83
|
-
recent_errors: this.recentErrors.slice(-20),
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
getPendingQueue() {
|
|
87
|
-
return this.syncQueue;
|
|
88
|
-
}
|
|
89
|
-
async drainSyncQueue() {
|
|
90
|
-
let processed = 0;
|
|
91
|
-
let failed = 0;
|
|
92
|
-
const remaining = [];
|
|
93
|
-
for (const entry of this.syncQueue) {
|
|
94
|
-
try {
|
|
95
|
-
await this.breaker.execute(() => withRetry(() => this.post(this.operationToPath(entry.operation), entry.payload, entry.id)));
|
|
96
|
-
processed++;
|
|
97
|
-
this.lastSuccessfulSync = new Date().toISOString();
|
|
98
|
-
}
|
|
99
|
-
catch (err) {
|
|
100
|
-
failed++;
|
|
101
|
-
remaining.push({
|
|
102
|
-
...entry,
|
|
103
|
-
retry_count: entry.retry_count + 1,
|
|
104
|
-
last_error: err instanceof Error ? err.message : String(err),
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
this.syncQueue.length = 0;
|
|
109
|
-
this.syncQueue.push(...remaining);
|
|
110
|
-
return { processed, failed };
|
|
111
|
-
}
|
|
112
|
-
// --------------------------------------------------------------------------
|
|
113
|
-
// Internal: HTTP Transport
|
|
114
|
-
// --------------------------------------------------------------------------
|
|
115
|
-
async post(path, body, correlationId) {
|
|
116
|
-
const token = await this.getIdentityToken();
|
|
117
|
-
const controller = new AbortController();
|
|
118
|
-
const timeoutId = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
119
|
-
try {
|
|
120
|
-
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
121
|
-
method: 'POST',
|
|
122
|
-
headers: {
|
|
123
|
-
'Content-Type': 'application/json',
|
|
124
|
-
'Authorization': `Bearer ${token}`,
|
|
125
|
-
'X-Correlation-ID': correlationId,
|
|
126
|
-
},
|
|
127
|
-
body: JSON.stringify(body),
|
|
128
|
-
signal: controller.signal,
|
|
129
|
-
});
|
|
130
|
-
if (!response.ok) {
|
|
131
|
-
throw new Error(`Infor returned HTTP ${response.status}: ${await response.text()}`);
|
|
132
|
-
}
|
|
133
|
-
return response.json();
|
|
134
|
-
}
|
|
135
|
-
finally {
|
|
136
|
-
clearTimeout(timeoutId);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
async get(path, correlationId) {
|
|
140
|
-
const token = await this.getIdentityToken();
|
|
141
|
-
const controller = new AbortController();
|
|
142
|
-
const timeoutId = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
143
|
-
try {
|
|
144
|
-
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
145
|
-
method: 'GET',
|
|
146
|
-
headers: {
|
|
147
|
-
'Authorization': `Bearer ${token}`,
|
|
148
|
-
'X-Correlation-ID': correlationId,
|
|
149
|
-
},
|
|
150
|
-
signal: controller.signal,
|
|
151
|
-
});
|
|
152
|
-
if (!response.ok) {
|
|
153
|
-
throw new Error(`Infor returned HTTP ${response.status}: ${await response.text()}`);
|
|
154
|
-
}
|
|
155
|
-
return response.json();
|
|
156
|
-
}
|
|
157
|
-
finally {
|
|
158
|
-
clearTimeout(timeoutId);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
async getIdentityToken() {
|
|
162
|
-
const url = new URL(GCP_METADATA_TOKEN_URL);
|
|
163
|
-
url.searchParams.set('audience', this.serviceAccountEmail);
|
|
164
|
-
const response = await fetch(url.toString(), {
|
|
165
|
-
headers: { 'Metadata-Flavor': 'Google' },
|
|
166
|
-
});
|
|
167
|
-
if (!response.ok) {
|
|
168
|
-
throw new Error(`Failed to obtain GCP identity token: HTTP ${response.status}`);
|
|
169
|
-
}
|
|
170
|
-
return response.text();
|
|
171
|
-
}
|
|
172
|
-
// --------------------------------------------------------------------------
|
|
173
|
-
// Internal: Fallback & Queue
|
|
174
|
-
// --------------------------------------------------------------------------
|
|
175
|
-
async executeWithFallback(operation, entityId, correlationId, fn, payload) {
|
|
176
|
-
await this.auditBefore(operation, entityId, correlationId, payload);
|
|
177
|
-
try {
|
|
178
|
-
const result = await this.breaker.execute(() => withRetry(fn));
|
|
179
|
-
this.lastSuccessfulSync = new Date().toISOString();
|
|
180
|
-
await this.auditAfter(operation, entityId, correlationId, result);
|
|
181
|
-
return result;
|
|
182
|
-
}
|
|
183
|
-
catch (err) {
|
|
184
|
-
this.recordError(operation, err);
|
|
185
|
-
// Queue for retry when ERP is unreachable
|
|
186
|
-
this.syncQueue.push({
|
|
187
|
-
id: correlationId,
|
|
188
|
-
operation,
|
|
189
|
-
payload,
|
|
190
|
-
created_at: new Date().toISOString(),
|
|
191
|
-
retry_count: 0,
|
|
192
|
-
last_error: err instanceof Error ? err.message : String(err),
|
|
193
|
-
});
|
|
194
|
-
// Return a queued response so domain services can continue
|
|
195
|
-
return {
|
|
196
|
-
id: correlationId,
|
|
197
|
-
status: 202,
|
|
198
|
-
message: `Queued for sync — Infor temporarily unreachable`,
|
|
199
|
-
data: { queued: true, operation, entity_id: entityId },
|
|
200
|
-
correlation_id: correlationId,
|
|
201
|
-
timestamp: new Date().toISOString(),
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
recordError(operation, err) {
|
|
206
|
-
this.recentErrors.push({
|
|
207
|
-
timestamp: new Date().toISOString(),
|
|
208
|
-
operation,
|
|
209
|
-
error: err instanceof Error ? err.message : String(err),
|
|
210
|
-
});
|
|
211
|
-
if (this.recentErrors.length > 100)
|
|
212
|
-
this.recentErrors.splice(0, this.recentErrors.length - 100);
|
|
213
|
-
}
|
|
214
|
-
operationToPath(operation) {
|
|
215
|
-
const paths = {
|
|
216
|
-
createTransferOrder: '/M3/m3api-rest/v2/execute/MMS850MI/AddTransferOrder',
|
|
217
|
-
createPurchaseOrder: '/M3/m3api-rest/v2/execute/PPS200MI/AddPurchaseOrder',
|
|
218
|
-
updateItemReceipt: '/M3/m3api-rest/v2/execute/PPS300MI/AddReceipt',
|
|
219
|
-
};
|
|
220
|
-
return paths[operation] ?? '/M3/m3api-rest/v2/execute/ENTITY';
|
|
221
|
-
}
|
|
222
|
-
// --------------------------------------------------------------------------
|
|
223
|
-
// Internal: Audit Logging
|
|
224
|
-
// --------------------------------------------------------------------------
|
|
225
|
-
async auditBefore(operation, entityId, correlationId, payload) {
|
|
226
|
-
if (!this.governance.audit_enabled || !this.audit)
|
|
227
|
-
return;
|
|
228
|
-
await this.audit.log('infor_cloudsuite_call', entityId, `${operation}:before`, correlationId, payload);
|
|
229
|
-
}
|
|
230
|
-
async auditAfter(operation, entityId, correlationId, result) {
|
|
231
|
-
if (!this.governance.audit_enabled || !this.audit)
|
|
232
|
-
return;
|
|
233
|
-
await this.audit.log('infor_cloudsuite_call', entityId, `${operation}:after`, correlationId, result);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DomainTransferOrder, DomainPurchaseOrder, DomainInventoryBalance, DomainItemReceipt, InforTransferOrder, InforPurchaseOrder, InforInventoryBalance, InforItemReceipt, GovernanceConfig } from './types.js';
|
|
2
|
-
export declare class InforMapper {
|
|
3
|
-
private readonly governance;
|
|
4
|
-
constructor(governance: GovernanceConfig);
|
|
5
|
-
toTransferOrder(domain: DomainTransferOrder): InforTransferOrder;
|
|
6
|
-
toPurchaseOrder(domain: DomainPurchaseOrder): InforPurchaseOrder;
|
|
7
|
-
toItemReceipt(domain: DomainItemReceipt, transferNsId: string): InforItemReceipt;
|
|
8
|
-
fromInventoryBalance(ns: InforInventoryBalance): DomainInventoryBalance;
|
|
9
|
-
}
|