@friggframework/core 2.0.0--canary.490.dfd8df5.0 → 2.0.0--canary.490.1d4d68c.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.
Files changed (30) hide show
  1. package/credential/repositories/credential-repository-factory.js +11 -13
  2. package/credential/repositories/{credential-repository-documentdb.js → credential-repository-mongodb-native.js} +4 -4
  3. package/database/repositories/health-check-repository-factory.js +10 -33
  4. package/database/repositories/{health-check-repository-documentdb.js → health-check-repository-mongodb-native.js} +4 -4
  5. package/integrations/repositories/integration-mapping-repository-factory.js +5 -30
  6. package/integrations/repositories/{integration-mapping-repository-documentdb.js → integration-mapping-repository-mongodb-native.js} +4 -4
  7. package/integrations/repositories/integration-repository-factory.js +11 -12
  8. package/integrations/repositories/{integration-repository-documentdb.js → integration-repository-mongodb-native.js} +12 -4
  9. package/integrations/repositories/process-repository-factory.js +5 -30
  10. package/integrations/repositories/{process-repository-documentdb.js → process-repository-mongodb-native.js} +4 -4
  11. package/modules/repositories/module-repository-factory.js +5 -11
  12. package/modules/repositories/{module-repository-documentdb.js → module-repository-mongodb-native.js} +4 -4
  13. package/package.json +5 -5
  14. package/syncs/repositories/sync-repository-factory.js +5 -11
  15. package/syncs/repositories/{sync-repository-documentdb.js → sync-repository-mongodb-native.js} +4 -4
  16. package/token/repositories/token-repository-factory.js +5 -11
  17. package/token/repositories/{token-repository-documentdb.js → token-repository-mongodb-native.js} +4 -4
  18. package/user/repositories/user-repository-factory.js +7 -32
  19. package/user/repositories/{user-repository-documentdb.js → user-repository-mongodb-native.js} +4 -4
  20. package/websocket/repositories/websocket-connection-repository-factory.js +5 -11
  21. package/websocket/repositories/{websocket-connection-repository-documentdb.js → websocket-connection-repository-mongodb-native.js} +4 -4
  22. package/credential/repositories/credential-repository-mongo.js +0 -311
  23. package/integrations/repositories/integration-mapping-repository-mongo.js +0 -165
  24. package/integrations/repositories/integration-repository-mongo.js +0 -307
  25. package/integrations/repositories/process-repository-mongo.js +0 -194
  26. package/modules/repositories/module-repository-mongo.js +0 -381
  27. package/syncs/repositories/sync-repository-mongo.js +0 -243
  28. package/token/repositories/token-repository-mongo.js +0 -216
  29. package/user/repositories/user-repository-mongo.js +0 -295
  30. package/websocket/repositories/websocket-connection-repository-mongo.js +0 -160
@@ -1,7 +1,5 @@
1
- const { CredentialRepositoryMongo } = require('./credential-repository-mongo');
1
+ const { CredentialRepositoryMongoDBNative } = require('./credential-repository-mongodb-native');
2
2
  const { CredentialRepositoryPostgres } = require('./credential-repository-postgres');
3
- const { CredentialRepositoryDocumentDB } = require('./credential-repository-documentdb');
4
- const { isDocumentDB } = require('../../database/utils/documentdb-compatibility');
5
3
  const config = require('../../database/config');
6
4
 
7
5
  /**
@@ -9,12 +7,15 @@ const config = require('../../database/config');
9
7
  * Creates the appropriate repository adapter based on database type
10
8
  *
11
9
  * Database-specific implementations:
12
- * - MongoDB: Uses String IDs (ObjectId), no conversion needed
13
- * - PostgreSQL: Uses Int IDs, converts String ↔ Int
10
+ * - MongoDB/DocumentDB: Uses native MongoDB driver (String IDs/ObjectId), no conversion needed
11
+ * - PostgreSQL: Uses Prisma with Int IDs, converts String ↔ Int
14
12
  *
15
13
  * All repository methods return String IDs regardless of database type,
16
14
  * ensuring application layer consistency.
17
15
  *
16
+ * MongoDB/DocumentDB: Uses native driver to avoid Prisma $$REMOVE operator issues
17
+ * PostgreSQL: Uses Prisma (no $$REMOVE issues)
18
+ *
18
19
  * Usage:
19
20
  * ```javascript
20
21
  * const repository = createCredentialRepository();
@@ -23,29 +24,26 @@ const config = require('../../database/config');
23
24
  * @returns {CredentialRepositoryInterface} Configured repository adapter
24
25
  */
25
26
  function createCredentialRepository() {
26
- if (isDocumentDB()) {
27
- return new CredentialRepositoryDocumentDB();
28
- }
29
-
30
27
  const dbType = config.DB_TYPE;
31
28
 
32
29
  switch (dbType) {
33
30
  case 'mongodb':
34
- return new CredentialRepositoryMongo();
31
+ case 'documentdb':
32
+ // Both MongoDB and DocumentDB use native driver
33
+ return new CredentialRepositoryMongoDBNative();
35
34
 
36
35
  case 'postgresql':
37
36
  return new CredentialRepositoryPostgres();
38
37
 
39
38
  default:
40
39
  throw new Error(
41
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
40
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'documentdb', 'postgresql'`
42
41
  );
43
42
  }
44
43
  }
45
44
 
46
45
  module.exports = {
47
46
  createCredentialRepository,
48
- CredentialRepositoryMongo,
47
+ CredentialRepositoryMongoDBNative,
49
48
  CredentialRepositoryPostgres,
50
- CredentialRepositoryDocumentDB,
51
49
  };
@@ -1,11 +1,11 @@
1
1
  const { ObjectId } = require('mongodb');
2
- const { BaseRepositoryDocumentDB } = require('../../database/repositories/base-repository-documentdb');
2
+ const { BaseRepositoryMongoDBNative } = require('../../database/repositories/base-repository-documentdb');
3
3
  const { CredentialRepositoryInterface } = require('./credential-repository-interface');
4
4
 
5
- class CredentialRepositoryDocumentDB extends CredentialRepositoryInterface {
5
+ class CredentialRepositoryMongoDBNative extends CredentialRepositoryInterface {
6
6
  constructor() {
7
7
  super();
8
- this._base = new BaseRepositoryDocumentDB('Credential', 'Credential');
8
+ this._base = new BaseRepositoryMongoDBNative('Credential', 'Credential');
9
9
  }
10
10
 
11
11
  get collection() {
@@ -129,5 +129,5 @@ class CredentialRepositoryDocumentDB extends CredentialRepositoryInterface {
129
129
  }
130
130
  }
131
131
 
132
- module.exports = { CredentialRepositoryDocumentDB };
132
+ module.exports = { CredentialRepositoryMongoDBNative };
133
133
 
@@ -1,50 +1,27 @@
1
- const { HealthCheckRepositoryMongoDB } = require('./health-check-repository-mongodb');
2
- const { HealthCheckRepositoryPostgreSQL } = require('./health-check-repository-postgres');
3
- const { HealthCheckRepositoryDocumentDB } = require('./health-check-repository-documentdb');
4
- const { isDocumentDB } = require('../utils/documentdb-compatibility');
5
- const config = require('../config');
6
-
7
- /**
8
- * Factory function to create a health check repository for the configured database type.
9
- * Requires explicit prismaClient injection to support IoC container patterns.
10
- *
11
- * @param {Object} options
12
- * @param {Object} options.prismaClient - Prisma client instance (required for dependency injection)
13
- * @returns {HealthCheckRepositoryInterface} Database-specific health check repository
14
- * @throws {Error} If prismaClient is not provided
15
- *
16
- * @example
17
- * const { prisma } = require('../prisma');
18
- * const repository = createHealthCheckRepository({ prismaClient: prisma });
19
- */
20
- function createHealthCheckRepository({ prismaClient } = {}) {
21
- if (isDocumentDB()) {
22
- return new HealthCheckRepositoryDocumentDB();
23
- }
24
-
25
- if (!prismaClient) {
26
- throw new Error('prismaClient is required');
27
- }
1
+ const { HealthCheckRepositoryMongoDBNative } = require('./health-check-repository-mongodb-native');
2
+ const { HealthCheckRepositoryPostgres } = require('./health-check-repository-postgres');
3
+ const config = require('../../database/config');
28
4
 
5
+ function createHealthCheckRepository() {
29
6
  const dbType = config.DB_TYPE;
30
7
 
31
8
  switch (dbType) {
32
9
  case 'mongodb':
33
- return new HealthCheckRepositoryMongoDB({ prismaClient });
10
+ case 'documentdb':
11
+ return new HealthCheckRepositoryMongoDBNative();
34
12
 
35
13
  case 'postgresql':
36
- return new HealthCheckRepositoryPostgreSQL({ prismaClient });
14
+ return new HealthCheckRepositoryPostgres();
37
15
 
38
16
  default:
39
17
  throw new Error(
40
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
18
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'documentdb', 'postgresql'`
41
19
  );
42
20
  }
43
21
  }
44
22
 
45
23
  module.exports = {
46
24
  createHealthCheckRepository,
47
- HealthCheckRepositoryMongoDB,
48
- HealthCheckRepositoryPostgreSQL,
49
- HealthCheckRepositoryDocumentDB,
25
+ HealthCheckRepositoryMongoDBNative,
26
+ HealthCheckRepositoryPostgres,
50
27
  };
@@ -1,12 +1,12 @@
1
1
  const { ObjectId } = require('mongodb');
2
2
  const { getNativeMongoClient } = require('../mongodb-native-client');
3
- const { BaseRepositoryDocumentDB } = require('./base-repository-documentdb');
3
+ const { BaseRepositoryMongoDBNative } = require('./base-repository-documentdb');
4
4
  const { HealthCheckRepositoryInterface } = require('./health-check-repository-interface');
5
5
 
6
- class HealthCheckRepositoryDocumentDB extends HealthCheckRepositoryInterface {
6
+ class HealthCheckRepositoryMongoDBNative extends HealthCheckRepositoryInterface {
7
7
  constructor() {
8
8
  super();
9
- this._base = new BaseRepositoryDocumentDB('Credential', 'Credential');
9
+ this._base = new BaseRepositoryMongoDBNative('Credential', 'Credential');
10
10
  this.nativeClient = getNativeMongoClient();
11
11
  }
12
12
 
@@ -59,5 +59,5 @@ class HealthCheckRepositoryDocumentDB extends HealthCheckRepositoryInterface {
59
59
  }
60
60
  }
61
61
 
62
- module.exports = { HealthCheckRepositoryDocumentDB };
62
+ module.exports = { HealthCheckRepositoryMongoDBNative };
63
63
 
@@ -1,52 +1,27 @@
1
- const { IntegrationMappingRepositoryMongo } = require('./integration-mapping-repository-mongo');
1
+ const { IntegrationMappingRepositoryMongoDBNative } = require('./integration-mapping-repository-mongodb-native');
2
2
  const { IntegrationMappingRepositoryPostgres } = require('./integration-mapping-repository-postgres');
3
- const { IntegrationMappingRepositoryDocumentDB } = require('./integration-mapping-repository-documentdb');
4
- const { isDocumentDB } = require('../../database/utils/documentdb-compatibility');
5
3
  const config = require('../../database/config');
6
4
 
7
- /**
8
- * Integration Mapping Repository Factory
9
- * Creates the appropriate repository adapter based on database type
10
- *
11
- * Database-specific implementations:
12
- * - MongoDB: Uses String IDs (ObjectId), no conversion needed
13
- * - PostgreSQL: Uses Int IDs, converts String ↔ Int
14
- *
15
- * All repository methods return String IDs regardless of database type,
16
- * ensuring application layer consistency.
17
- *
18
- * Usage:
19
- * ```javascript
20
- * const repository = createIntegrationMappingRepository();
21
- * const mapping = await repository.findMappingBy(integrationId, sourceId);
22
- * ```
23
- *
24
- * @returns {IntegrationMappingRepositoryInterface} Configured repository adapter
25
- */
26
5
  function createIntegrationMappingRepository() {
27
- if (isDocumentDB()) {
28
- return new IntegrationMappingRepositoryDocumentDB();
29
- }
30
-
31
6
  const dbType = config.DB_TYPE;
32
7
 
33
8
  switch (dbType) {
34
9
  case 'mongodb':
35
- return new IntegrationMappingRepositoryMongo();
10
+ case 'documentdb':
11
+ return new IntegrationMappingRepositoryMongoDBNative();
36
12
 
37
13
  case 'postgresql':
38
14
  return new IntegrationMappingRepositoryPostgres();
39
15
 
40
16
  default:
41
17
  throw new Error(
42
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
18
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'documentdb', 'postgresql'`
43
19
  );
44
20
  }
45
21
  }
46
22
 
47
23
  module.exports = {
48
24
  createIntegrationMappingRepository,
49
- IntegrationMappingRepositoryMongo,
25
+ IntegrationMappingRepositoryMongoDBNative,
50
26
  IntegrationMappingRepositoryPostgres,
51
- IntegrationMappingRepositoryDocumentDB,
52
27
  };
@@ -1,11 +1,11 @@
1
1
  const { ObjectId } = require('mongodb');
2
- const { BaseRepositoryDocumentDB } = require('../../database/repositories/base-repository-documentdb');
2
+ const { BaseRepositoryMongoDBNative } = require('../../database/repositories/base-repository-documentdb');
3
3
  const { IntegrationMappingRepositoryInterface } = require('./integration-mapping-repository-interface');
4
4
 
5
- class IntegrationMappingRepositoryDocumentDB extends IntegrationMappingRepositoryInterface {
5
+ class IntegrationMappingRepositoryMongoDBNative extends IntegrationMappingRepositoryInterface {
6
6
  constructor() {
7
7
  super();
8
- this._base = new BaseRepositoryDocumentDB('IntegrationMapping', 'IntegrationMapping');
8
+ this._base = new BaseRepositoryMongoDBNative('IntegrationMapping', 'IntegrationMapping');
9
9
  }
10
10
 
11
11
  get collection() {
@@ -46,5 +46,5 @@ class IntegrationMappingRepositoryDocumentDB extends IntegrationMappingRepositor
46
46
  }
47
47
  }
48
48
 
49
- module.exports = { IntegrationMappingRepositoryDocumentDB };
49
+ module.exports = { IntegrationMappingRepositoryMongoDBNative };
50
50
 
@@ -1,7 +1,5 @@
1
- const { IntegrationRepositoryMongo } = require('./integration-repository-mongo');
1
+ const { IntegrationRepositoryMongoDBNative } = require('./integration-repository-mongodb-native');
2
2
  const { IntegrationRepositoryPostgres } = require('./integration-repository-postgres');
3
- const { IntegrationRepositoryDocumentDB } = require('./integration-repository-documentdb');
4
- const { isDocumentDB } = require('../../database/utils/documentdb-compatibility');
5
3
  const config = require('../../database/config');
6
4
 
7
5
  /**
@@ -10,9 +8,12 @@ const config = require('../../database/config');
10
8
  *
11
9
  * This implements the Factory pattern for Hexagonal Architecture:
12
10
  * - Reads database type from app definition (backend/index.js)
13
- * - Returns correct adapter (MongoDB or PostgreSQL)
11
+ * - Returns correct adapter (MongoDB Native Driver or Prisma for PostgreSQL)
14
12
  * - Provides clear error for unsupported databases
15
13
  *
14
+ * MongoDB/MongoDBNative: Uses native MongoDB driver (avoids Prisma $$REMOVE operator issues)
15
+ * PostgreSQL: Uses Prisma (no $$REMOVE issues)
16
+ *
16
17
  * Usage:
17
18
  * ```javascript
18
19
  * const repository = createIntegrationRepository();
@@ -22,29 +23,27 @@ const config = require('../../database/config');
22
23
  * @throws {Error} If database type is not supported
23
24
  */
24
25
  function createIntegrationRepository() {
25
- if (isDocumentDB()) {
26
- return new IntegrationRepositoryDocumentDB();
27
- }
28
-
29
26
  const dbType = config.DB_TYPE;
30
27
 
31
28
  switch (dbType) {
32
29
  case 'mongodb':
33
- return new IntegrationRepositoryMongo();
30
+ case 'documentdb':
31
+ case 'mongodb-native':
32
+ // Both MongoDB and MongoDBNative use native driver
33
+ return new IntegrationRepositoryMongoDBNative();
34
34
 
35
35
  case 'postgresql':
36
36
  return new IntegrationRepositoryPostgres();
37
37
 
38
38
  default:
39
39
  throw new Error(
40
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
40
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'mongodb-native', 'postgresql'`
41
41
  );
42
42
  }
43
43
  }
44
44
 
45
45
  module.exports = {
46
46
  createIntegrationRepository,
47
- IntegrationRepositoryMongo,
47
+ IntegrationRepositoryMongoDBNative,
48
48
  IntegrationRepositoryPostgres,
49
- IntegrationRepositoryDocumentDB,
50
49
  };
@@ -1,11 +1,19 @@
1
1
  const { ObjectId } = require('mongodb');
2
- const { BaseRepositoryDocumentDB } = require('../../database/repositories/base-repository-documentdb');
2
+ const { BaseRepositoryMongoDBNative } = require('../../database/repositories/base-repository-documentdb');
3
3
  const { IntegrationRepositoryInterface } = require('./integration-repository-interface');
4
4
 
5
- class IntegrationRepositoryDocumentDB extends IntegrationRepositoryInterface {
5
+ /**
6
+ * MongoDB Native Driver Repository for Integration
7
+ *
8
+ * Uses native MongoDB driver instead of Prisma to avoid $$REMOVE operator issues.
9
+ * Works with both MongoDB and MongoDBNative.
10
+ *
11
+ * Architecture: Hexagonal (Adapter layer)
12
+ */
13
+ class IntegrationRepositoryMongoDBNative extends IntegrationRepositoryInterface {
6
14
  constructor() {
7
15
  super();
8
- this._base = new BaseRepositoryDocumentDB('Integration', 'Integration');
16
+ this._base = new BaseRepositoryMongoDBNative('Integration', 'Integration');
9
17
  }
10
18
 
11
19
  get collection() {
@@ -89,5 +97,5 @@ class IntegrationRepositoryDocumentDB extends IntegrationRepositoryInterface {
89
97
  }
90
98
  }
91
99
 
92
- module.exports = { IntegrationRepositoryDocumentDB };
100
+ module.exports = { IntegrationRepositoryMongoDBNative };
93
101
 
@@ -1,52 +1,27 @@
1
- const { ProcessRepositoryMongo } = require('./process-repository-mongo');
1
+ const { ProcessRepositoryMongoDBNative } = require('./process-repository-mongodb-native');
2
2
  const { ProcessRepositoryPostgres } = require('./process-repository-postgres');
3
- const { ProcessRepositoryDocumentDB } = require('./process-repository-documentdb');
4
- const { isDocumentDB } = require('../../database/utils/documentdb-compatibility');
5
3
  const config = require('../../database/config');
6
4
 
7
- /**
8
- * Process Repository Factory
9
- * Creates the appropriate repository adapter based on database type
10
- *
11
- * This implements the Factory pattern for Hexagonal Architecture:
12
- * - Reads database type from app definition (backend/index.js)
13
- * - Returns correct adapter (MongoDB or PostgreSQL)
14
- * - Provides clear error for unsupported databases
15
- *
16
- * Usage:
17
- * ```javascript
18
- * const repository = createProcessRepository();
19
- * await repository.create({ userId, integrationId, name, type, state });
20
- * ```
21
- *
22
- * @returns {ProcessRepositoryInterface} Configured repository adapter
23
- * @throws {Error} If database type is not supported
24
- */
25
5
  function createProcessRepository() {
26
- if (isDocumentDB()) {
27
- return new ProcessRepositoryDocumentDB();
28
- }
29
-
30
6
  const dbType = config.DB_TYPE;
31
7
 
32
8
  switch (dbType) {
33
9
  case 'mongodb':
34
- return new ProcessRepositoryMongo();
10
+ case 'documentdb':
11
+ return new ProcessRepositoryMongoDBNative();
35
12
 
36
13
  case 'postgresql':
37
14
  return new ProcessRepositoryPostgres();
38
15
 
39
16
  default:
40
17
  throw new Error(
41
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
18
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'documentdb', 'postgresql'`
42
19
  );
43
20
  }
44
21
  }
45
22
 
46
23
  module.exports = {
47
24
  createProcessRepository,
48
- ProcessRepositoryMongo,
25
+ ProcessRepositoryMongoDBNative,
49
26
  ProcessRepositoryPostgres,
50
- ProcessRepositoryDocumentDB,
51
27
  };
52
-
@@ -1,11 +1,11 @@
1
1
  const { ObjectId } = require('mongodb');
2
- const { BaseRepositoryDocumentDB } = require('../../database/repositories/base-repository-documentdb');
2
+ const { BaseRepositoryMongoDBNative } = require('../../database/repositories/base-repository-documentdb');
3
3
  const { ProcessRepositoryInterface } = require('./process-repository-interface');
4
4
 
5
- class ProcessRepositoryDocumentDB extends ProcessRepositoryInterface {
5
+ class ProcessRepositoryMongoDBNative extends ProcessRepositoryInterface {
6
6
  constructor() {
7
7
  super();
8
- this._base = new BaseRepositoryDocumentDB('Process', 'Process');
8
+ this._base = new BaseRepositoryMongoDBNative('Process', 'Process');
9
9
  }
10
10
 
11
11
  get collection() {
@@ -47,5 +47,5 @@ class ProcessRepositoryDocumentDB extends ProcessRepositoryInterface {
47
47
  }
48
48
  }
49
49
 
50
- module.exports = { ProcessRepositoryDocumentDB };
50
+ module.exports = { ProcessRepositoryMongoDBNative };
51
51
 
@@ -1,33 +1,27 @@
1
- const { ModuleRepositoryMongo } = require('./module-repository-mongo');
1
+ const { ModuleRepositoryMongoDBNative } = require('./module-repository-mongodb-native');
2
2
  const { ModuleRepositoryPostgres } = require('./module-repository-postgres');
3
- const { ModuleRepositoryDocumentDB } = require('./module-repository-documentdb');
4
- const { isDocumentDB } = require('../../database/utils/documentdb-compatibility');
5
3
  const config = require('../../database/config');
6
4
 
7
5
  function createModuleRepository() {
8
- if (isDocumentDB()) {
9
- return new ModuleRepositoryDocumentDB();
10
- }
11
-
12
6
  const dbType = config.DB_TYPE;
13
7
 
14
8
  switch (dbType) {
15
9
  case 'mongodb':
16
- return new ModuleRepositoryMongo();
10
+ case 'documentdb':
11
+ return new ModuleRepositoryMongoDBNative();
17
12
 
18
13
  case 'postgresql':
19
14
  return new ModuleRepositoryPostgres();
20
15
 
21
16
  default:
22
17
  throw new Error(
23
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
18
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'documentdb', 'postgresql'`
24
19
  );
25
20
  }
26
21
  }
27
22
 
28
23
  module.exports = {
29
24
  createModuleRepository,
30
- ModuleRepositoryMongo,
25
+ ModuleRepositoryMongoDBNative,
31
26
  ModuleRepositoryPostgres,
32
- ModuleRepositoryDocumentDB,
33
27
  };
@@ -1,11 +1,11 @@
1
1
  const { ObjectId } = require('mongodb');
2
- const { BaseRepositoryDocumentDB } = require('../../database/repositories/base-repository-documentdb');
2
+ const { BaseRepositoryMongoDBNative } = require('../../database/repositories/base-repository-documentdb');
3
3
  const { ModuleRepositoryInterface } = require('./module-repository-interface');
4
4
 
5
- class ModuleRepositoryDocumentDB extends ModuleRepositoryInterface {
5
+ class ModuleRepositoryMongoDBNative extends ModuleRepositoryInterface {
6
6
  constructor() {
7
7
  super();
8
- this._base = new BaseRepositoryDocumentDB('Entity', 'Entity');
8
+ this._base = new BaseRepositoryMongoDBNative('Entity', 'Entity');
9
9
  }
10
10
 
11
11
  get collection() {
@@ -68,5 +68,5 @@ class ModuleRepositoryDocumentDB extends ModuleRepositoryInterface {
68
68
  }
69
69
  }
70
70
 
71
- module.exports = { ModuleRepositoryDocumentDB };
71
+ module.exports = { ModuleRepositoryMongoDBNative };
72
72
 
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.dfd8df5.0",
4
+ "version": "2.0.0--canary.490.1d4d68c.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.dfd8df5.0",
42
- "@friggframework/prettier-config": "2.0.0--canary.490.dfd8df5.0",
43
- "@friggframework/test": "2.0.0--canary.490.dfd8df5.0",
41
+ "@friggframework/eslint-config": "2.0.0--canary.490.1d4d68c.0",
42
+ "@friggframework/prettier-config": "2.0.0--canary.490.1d4d68c.0",
43
+ "@friggframework/test": "2.0.0--canary.490.1d4d68c.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": "dfd8df51792994e68efdcfe2aaf4725c10da74ca"
83
+ "gitHead": "1d4d68ca55433804a888e3b897fc3bfcd91cd0ba"
84
84
  }
@@ -1,33 +1,27 @@
1
- const { SyncRepositoryMongo } = require('./sync-repository-mongo');
1
+ const { SyncRepositoryMongoDBNative } = require('./sync-repository-mongodb-native');
2
2
  const { SyncRepositoryPostgres } = require('./sync-repository-postgres');
3
- const { SyncRepositoryDocumentDB } = require('./sync-repository-documentdb');
4
- const { isDocumentDB } = require('../../database/utils/documentdb-compatibility');
5
3
  const config = require('../../database/config');
6
4
 
7
5
  function createSyncRepository() {
8
- if (isDocumentDB()) {
9
- return new SyncRepositoryDocumentDB();
10
- }
11
-
12
6
  const dbType = config.DB_TYPE;
13
7
 
14
8
  switch (dbType) {
15
9
  case 'mongodb':
16
- return new SyncRepositoryMongo();
10
+ case 'documentdb':
11
+ return new SyncRepositoryMongoDBNative();
17
12
 
18
13
  case 'postgresql':
19
14
  return new SyncRepositoryPostgres();
20
15
 
21
16
  default:
22
17
  throw new Error(
23
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
18
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'documentdb', 'postgresql'`
24
19
  );
25
20
  }
26
21
  }
27
22
 
28
23
  module.exports = {
29
24
  createSyncRepository,
30
- SyncRepositoryMongo,
25
+ SyncRepositoryMongoDBNative,
31
26
  SyncRepositoryPostgres,
32
- SyncRepositoryDocumentDB,
33
27
  };
@@ -1,11 +1,11 @@
1
1
  const { ObjectId } = require('mongodb');
2
- const { BaseRepositoryDocumentDB } = require('../../database/repositories/base-repository-documentdb');
2
+ const { BaseRepositoryMongoDBNative } = require('../../database/repositories/base-repository-documentdb');
3
3
  const { SyncRepositoryInterface } = require('./sync-repository-interface');
4
4
 
5
- class SyncRepositoryDocumentDB extends SyncRepositoryInterface {
5
+ class SyncRepositoryMongoDBNative extends SyncRepositoryInterface {
6
6
  constructor() {
7
7
  super();
8
- this._base = new BaseRepositoryDocumentDB('Sync', 'Sync');
8
+ this._base = new BaseRepositoryMongoDBNative('Sync', 'Sync');
9
9
  }
10
10
 
11
11
  get collection() {
@@ -48,5 +48,5 @@ class SyncRepositoryDocumentDB extends SyncRepositoryInterface {
48
48
  }
49
49
  }
50
50
 
51
- module.exports = { SyncRepositoryDocumentDB };
51
+ module.exports = { SyncRepositoryMongoDBNative };
52
52
 
@@ -1,33 +1,27 @@
1
- const { TokenRepositoryMongo } = require('./token-repository-mongo');
1
+ const { TokenRepositoryMongoDBNative } = require('./token-repository-mongodb-native');
2
2
  const { TokenRepositoryPostgres } = require('./token-repository-postgres');
3
- const { TokenRepositoryDocumentDB } = require('./token-repository-documentdb');
4
- const { isDocumentDB } = require('../../database/utils/documentdb-compatibility');
5
3
  const config = require('../../database/config');
6
4
 
7
5
  function createTokenRepository() {
8
- if (isDocumentDB()) {
9
- return new TokenRepositoryDocumentDB();
10
- }
11
-
12
6
  const dbType = config.DB_TYPE;
13
7
 
14
8
  switch (dbType) {
15
9
  case 'mongodb':
16
- return new TokenRepositoryMongo();
10
+ case 'documentdb':
11
+ return new TokenRepositoryMongoDBNative();
17
12
 
18
13
  case 'postgresql':
19
14
  return new TokenRepositoryPostgres();
20
15
 
21
16
  default:
22
17
  throw new Error(
23
- `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'postgresql'`
18
+ `Unsupported database type: ${dbType}. Supported values: 'mongodb', 'documentdb', 'postgresql'`
24
19
  );
25
20
  }
26
21
  }
27
22
 
28
23
  module.exports = {
29
24
  createTokenRepository,
30
- TokenRepositoryMongo,
25
+ TokenRepositoryMongoDBNative,
31
26
  TokenRepositoryPostgres,
32
- TokenRepositoryDocumentDB,
33
27
  };
@@ -1,14 +1,14 @@
1
1
  const { ObjectId } = require('mongodb');
2
2
  const bcrypt = require('bcryptjs');
3
- const { BaseRepositoryDocumentDB } = require('../../database/repositories/base-repository-documentdb');
3
+ const { BaseRepositoryMongoDBNative } = require('../../database/repositories/base-repository-documentdb');
4
4
  const { TokenRepositoryInterface } = require('./token-repository-interface');
5
5
 
6
6
  const BCRYPT_ROUNDS = 10;
7
7
 
8
- class TokenRepositoryDocumentDB extends TokenRepositoryInterface {
8
+ class TokenRepositoryMongoDBNative extends TokenRepositoryInterface {
9
9
  constructor() {
10
10
  super();
11
- this._base = new BaseRepositoryDocumentDB('Token', 'Token');
11
+ this._base = new BaseRepositoryMongoDBNative('Token', 'Token');
12
12
  }
13
13
 
14
14
  get collection() {
@@ -77,5 +77,5 @@ class TokenRepositoryDocumentDB extends TokenRepositoryInterface {
77
77
  }
78
78
  }
79
79
 
80
- module.exports = { TokenRepositoryDocumentDB };
80
+ module.exports = { TokenRepositoryMongoDBNative };
81
81