@friggframework/core 2.0.0--canary.419.99533fd.1 → 2.0.0--canary.424.a864ff6.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 (2) hide show
  1. package/database/mongo.js +0 -32
  2. package/package.json +5 -5
package/database/mongo.js CHANGED
@@ -5,29 +5,10 @@
5
5
  const { Encrypt } = require('../encrypt');
6
6
  const { mongoose } = require('./mongoose');
7
7
  const { debug, flushDebugLog } = require('../logs');
8
- const { findNearestBackendPackageJson } = require('../utils');
9
- const path = require('path');
10
- const fs = require('fs');
11
8
 
12
9
  mongoose.plugin(Encrypt);
13
10
  mongoose.set('applyPluginsToDiscriminators', true); // Needed for LHEncrypt
14
11
 
15
- // Load app definition to check for DocumentDB configuration
16
- let appDefinition = {};
17
- try {
18
- const backendPath = findNearestBackendPackageJson();
19
- if (backendPath) {
20
- const backendDir = path.dirname(backendPath);
21
- const backendFilePath = path.join(backendDir, 'index.js');
22
- if (fs.existsSync(backendFilePath)) {
23
- const backendJsFile = require(backendFilePath);
24
- appDefinition = backendJsFile.Definition || {};
25
- }
26
- }
27
- } catch (error) {
28
- debug('Could not load app definition for DocumentDB configuration:', error.message);
29
- }
30
-
31
12
  // Buffering means mongoose will queue up operations if it gets
32
13
  // With serverless, better to fail fast if not connected.
33
14
  // disconnected from MongoDB and send them when it reconnects.
@@ -39,19 +20,6 @@ const mongoConfig = {
39
20
  serverSelectionTimeoutMS: 5000,
40
21
  };
41
22
 
42
- // Add DocumentDB TLS configuration if enabled
43
- if (appDefinition.database?.documentDB?.enable === true) {
44
- debug('DocumentDB configuration detected, enabling TLS');
45
- mongoConfig.tls = true;
46
-
47
- // Set TLS CA file path if specified
48
- if (appDefinition.database.documentDB.tlsCAFile) {
49
- const tlsCAFilePath = path.resolve(process.cwd(), appDefinition.database.documentDB.tlsCAFile);
50
- mongoConfig.tlsCAFile = tlsCAFilePath;
51
- debug(`DocumentDB TLS CA file: ${tlsCAFilePath}`);
52
- }
53
- }
54
-
55
23
  const checkIsConnected = () => mongoose.connection?.readyState > 0;
56
24
 
57
25
  const connectToDatabase = async () => {
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.419.99533fd.1",
4
+ "version": "2.0.0--canary.424.a864ff6.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.419.99533fd.1",
26
- "@friggframework/prettier-config": "2.0.0--canary.419.99533fd.1",
27
- "@friggframework/test": "2.0.0--canary.419.99533fd.1",
25
+ "@friggframework/eslint-config": "2.0.0--canary.424.a864ff6.0",
26
+ "@friggframework/prettier-config": "2.0.0--canary.424.a864ff6.0",
27
+ "@friggframework/test": "2.0.0--canary.424.a864ff6.0",
28
28
  "@types/lodash": "4.17.15",
29
29
  "@typescript-eslint/eslint-plugin": "^8.0.0",
30
30
  "chai": "^4.3.6",
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "99533fda0918f6050d72721b0389e9c20da2dda2"
59
+ "gitHead": "a864ff67f2327f9b02568dffb499fcd51c567af5"
60
60
  }