@friggframework/core 2.0.0--canary.395.a8332aa.0 → 2.0.0--canary.454.4c72357.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.
@@ -37,7 +37,35 @@ function getDatabaseType() {
37
37
  );
38
38
  }
39
39
 
40
- const backendModule = require(backendIndexPath);
40
+ let backendModule;
41
+ try {
42
+ backendModule = require(backendIndexPath);
43
+ } catch (requireError) {
44
+ // Extract the actual file with the error from the stack trace
45
+ // Skip internal Node.js files (node:internal/*) and find first user file
46
+ let errorFile = 'unknown file';
47
+ const stackLines = requireError.stack?.split('\n') || [];
48
+
49
+ for (const line of stackLines) {
50
+ // Match file paths in stack trace, excluding node:internal
51
+ const match = line.match(/\(([^)]+\.js):\d+:\d+\)/) || line.match(/at ([^(]+\.js):\d+:\d+/);
52
+ if (match && match[1] && !match[1].includes('node:internal')) {
53
+ errorFile = match[1];
54
+ break;
55
+ }
56
+ }
57
+
58
+ // Provide better error context for syntax/runtime errors
59
+ throw new Error(
60
+ `[Frigg] Failed to load app definition from ${backendIndexPath}\n` +
61
+ `Error: ${requireError.message}\n` +
62
+ `File with error: ${errorFile}\n` +
63
+ `\nFull stack trace:\n${requireError.stack}\n\n` +
64
+ 'This error occurred while loading your app definition or its dependencies. ' +
65
+ 'Check the file listed above for syntax errors (trailing commas, missing brackets, etc.)'
66
+ );
67
+ }
68
+
41
69
  database = backendModule?.Definition?.database;
42
70
 
43
71
  if (!database) {
@@ -83,13 +83,14 @@ class TestEncryptionUseCase {
83
83
  * @private
84
84
  */
85
85
  _mapTestDataToCredential(testData) {
86
+ // Note: Using camelCase for Prisma compatibility (both MongoDB and PostgreSQL)
87
+ // Changed from snake_case (user_id, entity_id) to camelCase (userId, externalId)
86
88
  return {
87
- user_id: 'test-encryption-user',
88
- entity_id: 'test-encryption-entity',
89
+ externalId: 'test-encryption-entity',
89
90
  data: {
90
- access_token: testData.testSecret,
91
- refresh_token: testData.nestedSecret?.value,
92
- domain: testData.normalField,
91
+ access_token: testData.testSecret, // Encrypted field
92
+ refresh_token: testData.nestedSecret?.value, // Encrypted field
93
+ domain: testData.normalField, // Not encrypted
93
94
  },
94
95
  };
95
96
  }
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.395.a8332aa.0",
4
+ "version": "2.0.0--canary.454.4c72357.0",
5
5
  "dependencies": {
6
6
  "@hapi/boom": "^10.0.1",
7
7
  "@prisma/client": "^6.16.3",
@@ -23,9 +23,9 @@
23
23
  "uuid": "^9.0.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@friggframework/eslint-config": "2.0.0--canary.395.a8332aa.0",
27
- "@friggframework/prettier-config": "2.0.0--canary.395.a8332aa.0",
28
- "@friggframework/test": "2.0.0--canary.395.a8332aa.0",
26
+ "@friggframework/eslint-config": "2.0.0--canary.454.4c72357.0",
27
+ "@friggframework/prettier-config": "2.0.0--canary.454.4c72357.0",
28
+ "@friggframework/test": "2.0.0--canary.454.4c72357.0",
29
29
  "@types/lodash": "4.17.15",
30
30
  "@typescript-eslint/eslint-plugin": "^8.0.0",
31
31
  "chai": "^4.3.6",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "a8332aa9af6d1b987bd1881e6880e6c7d1686f53"
67
+ "gitHead": "4c72357ce52149d1f4fcaec73fc28b0309e63efb"
68
68
  }