mayo-firebase-config 1.2.9 → 1.2.11
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.
@@ -14,16 +14,23 @@ const react_native_1 = require("react-native");
|
|
14
14
|
const mayo_logger_1 = require("mayo-logger");
|
15
15
|
const { FirebaseConfigExtractor } = react_native_1.NativeModules;
|
16
16
|
const extractFirebaseConfig = () => __awaiter(void 0, void 0, void 0, function* () {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
try {
|
18
|
+
mayo_logger_1.Logger.info('Starting Firebase config extraction...', null, { tag: 'mayo-firebase-config-extractor' });
|
19
|
+
const config = yield FirebaseConfigExtractor.extractConfig();
|
20
|
+
if (config && typeof config === 'object' && Object.keys(config).length > 0) {
|
21
|
+
mayo_logger_1.Logger.info('Successfully extracted Firebase config', null, { tag: 'mayo-firebase-config-extractor' });
|
22
|
+
}
|
23
|
+
else {
|
24
|
+
mayo_logger_1.Logger.warn('Failed to extract valid Firebase config or the config is empty', null, { tag: 'mayo-firebase-config-extractor' });
|
25
|
+
}
|
26
|
+
// Be cautious about logging potentially sensitive information
|
27
|
+
mayo_logger_1.Logger.error('Extracted Firebase config:', { config }, { tag: 'mayo-firebase-config-extractor' });
|
28
|
+
return config;
|
21
29
|
}
|
22
|
-
|
23
|
-
|
30
|
+
catch (error) {
|
31
|
+
// Handle the error appropriately
|
32
|
+
mayo_logger_1.Logger.error('Error extracting Firebase config', error, { tag: 'mayo-firebase-config-extractor' });
|
33
|
+
throw error;
|
24
34
|
}
|
25
|
-
// This log may expose sensitive information, so be cautious about using it in a production environment
|
26
|
-
mayo_logger_1.Logger.info('Extracted Firebase config:', { config }, { tag: 'mayo-firebase-config-extractor' });
|
27
|
-
return config;
|
28
35
|
});
|
29
36
|
exports.extractFirebaseConfig = extractFirebaseConfig;
|
package/package.json
CHANGED
package/react-native.config.js
CHANGED
@@ -5,18 +5,24 @@ import { FirebaseConfig } from 'mayo-firebase-config';
|
|
5
5
|
const { FirebaseConfigExtractor } = NativeModules;
|
6
6
|
|
7
7
|
export const extractFirebaseConfig = async (): Promise<FirebaseConfig> => {
|
8
|
-
|
8
|
+
try {
|
9
|
+
Logger.info('Starting Firebase config extraction...', null, { tag: 'mayo-firebase-config-extractor' });
|
9
10
|
|
10
|
-
|
11
|
+
const config: FirebaseConfig = await FirebaseConfigExtractor.extractConfig();
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
if (config && typeof config === 'object' && Object.keys(config).length > 0) {
|
14
|
+
Logger.info('Successfully extracted Firebase config', null, { tag: 'mayo-firebase-config-extractor' });
|
15
|
+
} else {
|
16
|
+
Logger.warn('Failed to extract valid Firebase config or the config is empty', null, { tag: 'mayo-firebase-config-extractor' });
|
17
|
+
}
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
// Be cautious about logging potentially sensitive information
|
20
|
+
Logger.error('Extracted Firebase config:', { config }, { tag: 'mayo-firebase-config-extractor' });
|
20
21
|
|
21
|
-
|
22
|
+
return config;
|
23
|
+
} catch (error) {
|
24
|
+
// Handle the error appropriately
|
25
|
+
Logger.error('Error extracting Firebase config', error, { tag: 'mayo-firebase-config-extractor' });
|
26
|
+
throw error;
|
27
|
+
}
|
22
28
|
};
|