Files
dbis_core/scripts/seed-solacenet-gateway-provider.ts
defiQUG 6ebf71dda8 feat: SolaceNet gateway rails, IRU marketplace hardening, and docs
- Gateway adapter registry, rails routes, optional SOLACENET_GATEWAY_RAILS_ENFORCE; HTTP integration tests.
- IRU marketplace: rate limits, public routes, notifications/SMTP env docs; marketplace UI constants and flows.
- Quantum proxy legacy protocol types; debank/tezos/GSDS touch-ups; .env.example operator notes.
- SolaceNet doc set (gaps, runbooks, telecom schema example).

Tests: npm run test:iru-marketplace, npm run test:gateway (pass).
Note: full-repo tsc still reports unrelated legacy errors outside this change set.
Made-with: Cursor
2026-04-07 23:21:55 -07:00

64 lines
1.8 KiB
TypeScript

/**
* Upsert solacenet_provider_connector for the gateway rail plane (PG-SN-002).
* Run: npx ts-node -r tsconfig-paths/register scripts/seed-solacenet-gateway-provider.ts
* Requires DATABASE_URL and prisma client.
*/
import { v4 as uuidv4 } from 'uuid';
import type { Prisma } from '@prisma/client';
import prisma from '@/shared/database/prisma';
import { logger } from '@/infrastructure/monitoring/logger';
const CONNECTOR_ID = 'dbis-gateway-rail-plane';
async function main() {
const metadata: Prisma.InputJsonValue = {
capabilityId: 'gateway-microservices',
governanceDoc: 'docs/solacenet/RAIL_AND_PROTOCOL_GOVERNANCE.md',
note: 'Logical provider for SolaceNet-maintained gateway rail adapters; bindings use solacenet_capability_binding.',
};
const existing = await prisma.solacenet_provider_connector.findUnique({
where: { connectorId: CONNECTOR_ID },
});
if (existing) {
await prisma.solacenet_provider_connector.update({
where: { connectorId: CONNECTOR_ID },
data: {
name: 'DBIS Gateway Rail Plane (SolaceNet)',
providerType: 'gateway-rail',
status: 'active',
metadata,
},
});
logger.info('Updated solacenet_provider_connector', { connectorId: CONNECTOR_ID });
return;
}
await prisma.solacenet_provider_connector.create({
data: {
id: uuidv4(),
connectorId: CONNECTOR_ID,
name: 'DBIS Gateway Rail Plane (SolaceNet)',
providerType: 'gateway-rail',
status: 'active',
metadata,
},
});
logger.info('Created solacenet_provider_connector', { connectorId: CONNECTOR_ID });
}
if (require.main === module) {
main()
.catch((e) => {
logger.error('seed-solacenet-gateway-provider failed', {
error: e instanceof Error ? e.message : e,
});
process.exitCode = 1;
})
.finally(async () => {
await prisma.$disconnect();
});
}