@friggframework/core 2.0.0--canary.490.29e70f4.0 → 2.0.0--canary.490.b92b243.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.
- package/credential/repositories/credential-repository-mongo.js +12 -11
- package/database/prisma.js +0 -5
- package/database/repositories/base-repository-mongodb.js +25 -0
- package/database/repositories/health-check-repository-mongodb.js +7 -6
- package/integrations/repositories/integration-mapping-repository-mongo.js +5 -1
- package/integrations/repositories/integration-repository-mongo.js +5 -1
- package/integrations/repositories/process-repository-mongo.js +5 -1
- package/modules/repositories/module-repository-mongo.js +5 -1
- package/package.json +5 -5
- package/syncs/repositories/sync-repository-mongo.js +5 -1
- package/token/repositories/token-repository-mongo.js +5 -1
- package/user/repositories/user-repository-mongo.js +5 -1
- package/websocket/repositories/websocket-connection-repository-mongo.js +5 -1
|
@@ -2,7 +2,7 @@ const { prisma } = require('../../database/prisma');
|
|
|
2
2
|
const {
|
|
3
3
|
CredentialRepositoryInterface,
|
|
4
4
|
} = require('./credential-repository-interface');
|
|
5
|
-
const {
|
|
5
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* MongoDB Credential Repository Adapter
|
|
@@ -16,7 +16,10 @@ const { removeUndefinedValues } = require('../../database/utils/documentdb-compa
|
|
|
16
16
|
class CredentialRepositoryMongo extends CredentialRepositoryInterface {
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
21
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
22
|
+
this.prisma = mongoBase.prisma;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
/**
|
|
@@ -157,16 +160,14 @@ class CredentialRepositoryMongo extends CredentialRepositoryInterface {
|
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
// Create new credential
|
|
160
|
-
//
|
|
161
|
-
const credentialData = removeUndefinedValues({
|
|
162
|
-
userId: userId || user,
|
|
163
|
-
externalId,
|
|
164
|
-
authIsValid: authIsValid,
|
|
165
|
-
data: oauthData,
|
|
166
|
-
});
|
|
167
|
-
|
|
163
|
+
// DocumentDB compatibility handled by BaseRepositoryMongoDB wrapper
|
|
168
164
|
const created = await this.prisma.credential.create({
|
|
169
|
-
data:
|
|
165
|
+
data: {
|
|
166
|
+
userId: userId || user,
|
|
167
|
+
externalId,
|
|
168
|
+
authIsValid: authIsValid,
|
|
169
|
+
data: oauthData,
|
|
170
|
+
},
|
|
170
171
|
});
|
|
171
172
|
|
|
172
173
|
return {
|
package/database/prisma.js
CHANGED
|
@@ -207,11 +207,6 @@ const prismaClientSingleton = () => {
|
|
|
207
207
|
logger.info('Field-level encryption disabled');
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
// Wrap Prisma client for DocumentDB compatibility
|
|
211
|
-
// Automatically removes undefined values to prevent $$REMOVE operator errors
|
|
212
|
-
const { wrapPrismaForDocumentDB } = require('./utils/prisma-documentdb-wrapper');
|
|
213
|
-
client = wrapPrismaForDocumentDB(client);
|
|
214
|
-
|
|
215
210
|
return client;
|
|
216
211
|
};
|
|
217
212
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base MongoDB Repository
|
|
3
|
+
*
|
|
4
|
+
* Provides DocumentDB-compatible Prisma client for MongoDB repositories.
|
|
5
|
+
* Follows Hexagonal Architecture - infrastructure adapter for MongoDB/DocumentDB.
|
|
6
|
+
*
|
|
7
|
+
* All MongoDB repositories should extend this class to ensure DocumentDB compatibility.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { wrapPrismaForDocumentDB } = require('../utils/prisma-documentdb-wrapper');
|
|
11
|
+
|
|
12
|
+
class BaseRepositoryMongoDB {
|
|
13
|
+
/**
|
|
14
|
+
* @param {Object} params
|
|
15
|
+
* @param {Object} params.prismaClient - Prisma client instance
|
|
16
|
+
*/
|
|
17
|
+
constructor({ prismaClient }) {
|
|
18
|
+
// Wrap Prisma client for DocumentDB compatibility
|
|
19
|
+
// Only activates for DocumentDB connections (zero overhead for MongoDB)
|
|
20
|
+
this.prisma = wrapPrismaForDocumentDB(prismaClient);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = { BaseRepositoryMongoDB };
|
|
25
|
+
|
|
@@ -2,7 +2,7 @@ const { mongoose } = require('../mongoose');
|
|
|
2
2
|
const {
|
|
3
3
|
HealthCheckRepositoryInterface,
|
|
4
4
|
} = require('./health-check-repository-interface');
|
|
5
|
-
const {
|
|
5
|
+
const { BaseRepositoryMongoDB } = require('./base-repository-mongodb');
|
|
6
6
|
|
|
7
7
|
class HealthCheckRepositoryMongoDB extends HealthCheckRepositoryInterface {
|
|
8
8
|
/**
|
|
@@ -11,7 +11,10 @@ class HealthCheckRepositoryMongoDB extends HealthCheckRepositoryInterface {
|
|
|
11
11
|
*/
|
|
12
12
|
constructor({ prismaClient }) {
|
|
13
13
|
super();
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
16
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient });
|
|
17
|
+
this.prisma = mongoBase.prisma;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
/**
|
|
@@ -49,11 +52,9 @@ class HealthCheckRepositoryMongoDB extends HealthCheckRepositoryInterface {
|
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
async createCredential(credentialData) {
|
|
52
|
-
//
|
|
53
|
-
const cleanedData = removeUndefinedValues(credentialData);
|
|
54
|
-
|
|
55
|
+
// DocumentDB compatibility handled by BaseRepositoryMongoDB wrapper
|
|
55
56
|
return await this.prisma.credential.create({
|
|
56
|
-
data:
|
|
57
|
+
data: credentialData,
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -2,6 +2,7 @@ const { prisma } = require('../../database/prisma');
|
|
|
2
2
|
const {
|
|
3
3
|
IntegrationMappingRepositoryInterface,
|
|
4
4
|
} = require('./integration-mapping-repository-interface');
|
|
5
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* MongoDB Integration Mapping Repository Adapter
|
|
@@ -15,7 +16,10 @@ const {
|
|
|
15
16
|
class IntegrationMappingRepositoryMongo extends IntegrationMappingRepositoryInterface {
|
|
16
17
|
constructor() {
|
|
17
18
|
super();
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
21
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
22
|
+
this.prisma = mongoBase.prisma;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
/**
|
|
@@ -2,6 +2,7 @@ const { prisma } = require('../../database/prisma');
|
|
|
2
2
|
const {
|
|
3
3
|
IntegrationRepositoryInterface,
|
|
4
4
|
} = require('./integration-repository-interface');
|
|
5
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* MongoDB Integration Repository Adapter
|
|
@@ -21,7 +22,10 @@ const {
|
|
|
21
22
|
class IntegrationRepositoryMongo extends IntegrationRepositoryInterface {
|
|
22
23
|
constructor() {
|
|
23
24
|
super();
|
|
24
|
-
|
|
25
|
+
|
|
26
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
27
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
28
|
+
this.prisma = mongoBase.prisma;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { prisma } = require('../../database/prisma');
|
|
2
2
|
const { ProcessRepositoryInterface } = require('./process-repository-interface');
|
|
3
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* MongoDB Process Repository Adapter
|
|
@@ -19,7 +20,10 @@ const { ProcessRepositoryInterface } = require('./process-repository-interface')
|
|
|
19
20
|
class ProcessRepositoryMongo extends ProcessRepositoryInterface {
|
|
20
21
|
constructor() {
|
|
21
22
|
super();
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
25
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
26
|
+
this.prisma = mongoBase.prisma;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { prisma } = require('../../database/prisma');
|
|
2
2
|
const { ModuleRepositoryInterface } = require('./module-repository-interface');
|
|
3
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* MongoDB Module Repository Adapter
|
|
@@ -15,7 +16,10 @@ const { ModuleRepositoryInterface } = require('./module-repository-interface');
|
|
|
15
16
|
class ModuleRepositoryMongo extends ModuleRepositoryInterface {
|
|
16
17
|
constructor() {
|
|
17
18
|
super();
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
21
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
22
|
+
this.prisma = mongoBase.prisma;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
/**
|
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.490.
|
|
4
|
+
"version": "2.0.0--canary.490.b92b243.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@friggframework/eslint-config": "2.0.0--canary.490.
|
|
42
|
-
"@friggframework/prettier-config": "2.0.0--canary.490.
|
|
43
|
-
"@friggframework/test": "2.0.0--canary.490.
|
|
41
|
+
"@friggframework/eslint-config": "2.0.0--canary.490.b92b243.0",
|
|
42
|
+
"@friggframework/prettier-config": "2.0.0--canary.490.b92b243.0",
|
|
43
|
+
"@friggframework/test": "2.0.0--canary.490.b92b243.0",
|
|
44
44
|
"@prisma/client": "^6.17.0",
|
|
45
45
|
"@types/lodash": "4.17.15",
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "b92b243ac0a55d06298725db2dcadd76cde8091d"
|
|
84
84
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { prisma } = require('../../database/prisma');
|
|
2
2
|
const { SyncRepositoryInterface } = require('./sync-repository-interface');
|
|
3
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* MongoDB Sync Repository Adapter
|
|
@@ -18,7 +19,10 @@ const { SyncRepositoryInterface } = require('./sync-repository-interface');
|
|
|
18
19
|
class SyncRepositoryMongo extends SyncRepositoryInterface {
|
|
19
20
|
constructor() {
|
|
20
21
|
super();
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
24
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
25
|
+
this.prisma = mongoBase.prisma;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { prisma } = require('../../database/prisma');
|
|
2
2
|
const bcrypt = require('bcryptjs');
|
|
3
3
|
const { TokenRepositoryInterface } = require('./token-repository-interface');
|
|
4
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
4
5
|
|
|
5
6
|
const BCRYPT_ROUNDS = 10;
|
|
6
7
|
|
|
@@ -16,7 +17,10 @@ const BCRYPT_ROUNDS = 10;
|
|
|
16
17
|
class TokenRepositoryMongo extends TokenRepositoryInterface {
|
|
17
18
|
constructor() {
|
|
18
19
|
super();
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
22
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
23
|
+
this.prisma = mongoBase.prisma;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
/**
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
createTokenRepository,
|
|
5
5
|
} = require('../../token/repositories/token-repository-factory');
|
|
6
6
|
const { UserRepositoryInterface } = require('./user-repository-interface');
|
|
7
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* MongoDB User Repository Adapter
|
|
@@ -17,7 +18,10 @@ const { UserRepositoryInterface } = require('./user-repository-interface');
|
|
|
17
18
|
class UserRepositoryMongo extends UserRepositoryInterface {
|
|
18
19
|
constructor() {
|
|
19
20
|
super();
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
23
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
24
|
+
this.prisma = mongoBase.prisma;
|
|
21
25
|
this.tokenRepository = createTokenRepository();
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
const {
|
|
7
7
|
WebsocketConnectionRepositoryInterface,
|
|
8
8
|
} = require('./websocket-connection-repository-interface');
|
|
9
|
+
const { BaseRepositoryMongoDB } = require('../../database/repositories/base-repository-mongodb');
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* MongoDB WebSocket Connection Repository Adapter
|
|
@@ -19,7 +20,10 @@ const {
|
|
|
19
20
|
class WebsocketConnectionRepositoryMongo extends WebsocketConnectionRepositoryInterface {
|
|
20
21
|
constructor() {
|
|
21
22
|
super();
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
// Use MongoDB base repository for DocumentDB compatibility
|
|
25
|
+
const mongoBase = new BaseRepositoryMongoDB({ prismaClient: prisma });
|
|
26
|
+
this.prisma = mongoBase.prisma;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
/**
|