@friggframework/core 2.0.0--canary.397.6ecf8f5.0 → 2.0.0--canary.397.fadaaf6.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.
@@ -40,24 +40,35 @@ class ModuleRepository {
40
40
  }
41
41
 
42
42
  async findEntitiesByUserId(userId) {
43
- return Entity.find(
43
+ const entitiesRecords = await Entity.find(
44
44
  { user: userId },
45
45
  '-dateCreated -dateUpdated -user -credentials -credential -__t -__v',
46
46
  { lean: true }
47
- );
47
+ ).populate('credential');
48
+
49
+ return entitiesRecords.map(e => ({
50
+ id: e._id.toString(),
51
+ accountId: e.accountId,
52
+ credential: e.credential,
53
+ userId: e.user.toString(),
54
+ name: e.name,
55
+ externalId: e.externalId,
56
+ type: e.__t,
57
+ moduleName: e.moduleName,
58
+ }));
48
59
  }
49
60
 
50
- async findEntitiesByIds(entityIds) {
51
- const entities = await Entity.find(
52
- { _id: { $in: entityIds } },
61
+ async findEntitiesByIds(entitiesIds) {
62
+ const entitiesRecords = await Entity.find(
63
+ { _id: { $in: entitiesIds } },
53
64
  '',
54
65
  { lean: true }
55
- );
66
+ ).populate('credential');
56
67
 
57
- return entities.map(e => ({
68
+ return entitiesRecords.map(e => ({
58
69
  id: e._id.toString(),
59
70
  accountId: e.accountId,
60
- credentialId: e.credential.toString(),
71
+ credential: e.credential,
61
72
  userId: e.user.toString(),
62
73
  name: e.name,
63
74
  externalId: e.externalId,
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.397.6ecf8f5.0",
4
+ "version": "2.0.0--canary.397.fadaaf6.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.397.6ecf8f5.0",
26
- "@friggframework/prettier-config": "2.0.0--canary.397.6ecf8f5.0",
27
- "@friggframework/test": "2.0.0--canary.397.6ecf8f5.0",
25
+ "@friggframework/eslint-config": "2.0.0--canary.397.fadaaf6.0",
26
+ "@friggframework/prettier-config": "2.0.0--canary.397.fadaaf6.0",
27
+ "@friggframework/test": "2.0.0--canary.397.fadaaf6.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": "6ecf8f59b4e8e90f6a83c19af86c437504e776d6"
56
+ "gitHead": "fadaaf6990abc87d718814725fbd94173b9ca2bc"
57
57
  }