chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
58
scripts/seed-gateway-capability.ts
Normal file
58
scripts/seed-gateway-capability.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { capabilityRegistryService } from '@/core/solacenet/registry/capability-registry.service';
|
||||
import { logger } from '@/infrastructure/monitoring/logger';
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
logger.info('Registering DBIS Gateway Microservices capability...');
|
||||
await capabilityRegistryService.createCapability({
|
||||
capabilityId: 'gateway-microservices',
|
||||
name: 'DBIS Gateway Microservices',
|
||||
version: '1.0.0',
|
||||
description:
|
||||
'Regulated-grade integration fabric for SWIFT, DTC/DTCC, and extensible financial rails',
|
||||
defaultState: 'enabled' as any,
|
||||
dependencies: ['ledger', 'iso20022', 'reconciliation'].filter(Boolean),
|
||||
});
|
||||
|
||||
const subCapabilities = [
|
||||
{ capabilityId: 'gateway-edge', name: 'Gateway Edge Plane' },
|
||||
{ capabilityId: 'gateway-control', name: 'Gateway Control Plane' },
|
||||
{ capabilityId: 'gateway-operations', name: 'Gateway Operations Plane' },
|
||||
{ capabilityId: 'gateway-adapters', name: 'Gateway Adapter Plane' },
|
||||
];
|
||||
|
||||
for (const sub of subCapabilities) {
|
||||
try {
|
||||
await capabilityRegistryService.createCapability({
|
||||
capabilityId: sub.capabilityId,
|
||||
name: sub.name,
|
||||
version: '1.0.0',
|
||||
description: sub.name,
|
||||
defaultState: 'enabled' as any,
|
||||
dependencies: ['gateway-microservices'],
|
||||
});
|
||||
} catch (err: any) {
|
||||
if (err?.message?.includes('already exists')) {
|
||||
logger.info(`Capability ${sub.capabilityId} already exists, skipping`);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.info('Gateway capabilities registered.');
|
||||
} catch (error: any) {
|
||||
if (error?.message?.includes('already exists')) {
|
||||
logger.info('Capability gateway-microservices already exists, skipping');
|
||||
} else {
|
||||
logger.error('Failed to register gateway capability', { error: error?.message || error });
|
||||
process.exitCode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
main();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user