@friggframework/core 2.0.0--canary.396.20d0301.0 → 2.0.0--canary.396.d72f334.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.
@@ -324,6 +324,23 @@ class Module extends Delegate {
324
324
  }
325
325
  }
326
326
  }
327
+
328
+ /**
329
+ * Custom JSON serializer for Module instances.
330
+ * Omits heavy or circular properties such as `api`, `delegate`, `CredentialModel`, etc.
331
+ * Returns only lightweight, non-sensitive data that might be useful in API responses.
332
+ */
333
+ toJSON() {
334
+ return {
335
+ name: this.name,
336
+ userId: this.userId,
337
+ entity: this.entity && typeof this.entity.toJSON === 'function'
338
+ ? this.entity.toJSON()
339
+ : this.entity,
340
+ // Expose credential ID only (not full encrypted values)
341
+ credentialId: this.credential?._id?.toString(),
342
+ };
343
+ }
327
344
  }
328
345
 
329
346
  module.exports = { Module };
@@ -23,7 +23,7 @@ class GetEntitiesForUser {
23
23
  definition: definition,
24
24
  entity: entity,
25
25
  });
26
- return moduleInstance;
26
+ return moduleInstance.toJSON();
27
27
  });
28
28
  }
29
29
  }
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.396.20d0301.0",
4
+ "version": "2.0.0--canary.396.d72f334.0",
5
5
  "dependencies": {
6
6
  "@hapi/boom": "^10.0.1",
7
7
  "aws-sdk": "^2.1200.0",
@@ -22,9 +22,9 @@
22
22
  "uuid": "^9.0.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@friggframework/eslint-config": "2.0.0--canary.396.20d0301.0",
26
- "@friggframework/prettier-config": "2.0.0--canary.396.20d0301.0",
27
- "@friggframework/test": "2.0.0--canary.396.20d0301.0",
25
+ "@friggframework/eslint-config": "2.0.0--canary.396.d72f334.0",
26
+ "@friggframework/prettier-config": "2.0.0--canary.396.d72f334.0",
27
+ "@friggframework/test": "2.0.0--canary.396.d72f334.0",
28
28
  "@types/lodash": "4.17.15",
29
29
  "@typescript-eslint/eslint-plugin": "^8.0.0",
30
30
  "chai": "^4.3.6",
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "homepage": "https://github.com/friggframework/frigg#readme",
55
55
  "description": "",
56
- "gitHead": "20d0301107157627ac80db74ae19d806ac9d7bc2"
56
+ "gitHead": "d72f33468fa647bb981825150321f20a61276470"
57
57
  }