@friggframework/core 2.0.0--canary.461.af4cde8.0 → 2.0.0--canary.461.97d93c9.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.
@@ -85,11 +85,13 @@ router.use(validateApiKey);
85
85
  router.post(
86
86
  '/db-migrate',
87
87
  catchAsyncError(async (req, res) => {
88
- const { dbType, stage } = req.body;
88
+ // Migration infrastructure is PostgreSQL-only, so hardcode dbType
89
+ const dbType = 'postgresql';
90
+ const { stage } = req.body;
89
91
  // TODO: Extract userId from JWT token when auth is implemented
90
92
  const userId = req.body.userId || 'admin';
91
93
 
92
- console.log(`Migration trigger request: dbType=${dbType}, stage=${stage}, userId=${userId}`);
94
+ console.log(`Migration trigger request: dbType=${dbType}, stage=${stage || 'auto-detect'}, userId=${userId}`);
93
95
 
94
96
  try {
95
97
  const result = await triggerMigrationUseCase.execute({
@@ -28,7 +28,7 @@ describe('Database Migration Router - Adapter Layer', () => {
28
28
  it('should load without requiring app definition (critical bug fix)', () => {
29
29
  // Before fix: createProcessRepository() → getDatabaseType() → loads app definition → requires integrations → CRASH
30
30
  // After fix: ProcessRepositoryPostgres instantiated directly → no app definition → SUCCESS
31
-
31
+
32
32
  expect(() => {
33
33
  require('./db-migration');
34
34
  }).not.toThrow();
@@ -40,4 +40,12 @@ describe('Database Migration Router - Adapter Layer', () => {
40
40
  expect(typeof router).toBe('function');
41
41
  expect(router.stack).toBeDefined();
42
42
  });
43
+
44
+ it('should hardcode dbType as postgresql (migrations are PostgreSQL-only)', () => {
45
+ // Migration infrastructure is only created for PostgreSQL deployments
46
+ // So we can safely hardcode dbType instead of requiring it from request
47
+ const router = require('./db-migration').router;
48
+ expect(router).toBeDefined();
49
+ // Test will pass if handler doesn't crash when dbType is omitted from request
50
+ });
43
51
  });
@@ -104,32 +104,32 @@ function sanitizeDatabaseUrl(url) {
104
104
  */
105
105
  function extractMigrationParams(event) {
106
106
  let processId = null;
107
- let dbType = null;
108
107
  let stage = null;
108
+
109
+ // Migration infrastructure is PostgreSQL-only, so hardcode dbType
110
+ const dbType = 'postgresql';
109
111
 
110
112
  // Check if this is an SQS event
111
113
  if (event.Records && event.Records.length > 0) {
112
114
  // SQS event - extract from message body
113
115
  const message = JSON.parse(event.Records[0].body);
114
116
  processId = message.processId;
115
- dbType = message.dbType;
116
117
  stage = message.stage;
117
118
 
118
119
  console.log('SQS event detected');
119
120
  console.log(` Process ID: ${processId}`);
120
- console.log(` DB Type: ${dbType}`);
121
+ console.log(` DB Type: ${dbType} (hardcoded - PostgreSQL-only)`);
121
122
  console.log(` Stage: ${stage}`);
122
123
  } else {
123
124
  // Direct invocation - use event properties or environment variables
124
125
  processId = event.processId || null;
125
- dbType = event.dbType || process.env.DB_TYPE || 'postgresql';
126
126
  stage = event.stage || process.env.STAGE || 'production';
127
127
 
128
128
  console.log('Direct invocation detected');
129
129
  if (processId) {
130
130
  console.log(` Process ID: ${processId}`);
131
131
  }
132
- console.log(` DB Type: ${dbType}`);
132
+ console.log(` DB Type: ${dbType} (hardcoded - PostgreSQL-only)`);
133
133
  console.log(` Stage: ${stage}`);
134
134
  }
135
135
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.461.af4cde8.0",
4
+ "version": "2.0.0--canary.461.97d93c9.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -37,9 +37,9 @@
37
37
  }
38
38
  },
39
39
  "devDependencies": {
40
- "@friggframework/eslint-config": "2.0.0--canary.461.af4cde8.0",
41
- "@friggframework/prettier-config": "2.0.0--canary.461.af4cde8.0",
42
- "@friggframework/test": "2.0.0--canary.461.af4cde8.0",
40
+ "@friggframework/eslint-config": "2.0.0--canary.461.97d93c9.0",
41
+ "@friggframework/prettier-config": "2.0.0--canary.461.97d93c9.0",
42
+ "@friggframework/test": "2.0.0--canary.461.97d93c9.0",
43
43
  "@prisma/client": "^6.17.0",
44
44
  "@types/lodash": "4.17.15",
45
45
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "af4cde8379559b787e0a3e968c7a1c0b90823a5b"
82
+ "gitHead": "97d93c9143829a56c166c50c1127961fba83bfa0"
83
83
  }