rxome-generator 1.0.4-beta.3 → 1.0.4-beta.4
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/lib/rxome-api.js +4 -3
- package/lib/rxome-generator.js +1 -1
- package/package.json +1 -1
package/lib/rxome-api.js
CHANGED
|
@@ -8,7 +8,8 @@ export async function getFetch() {
|
|
|
8
8
|
if (typeof window !== 'undefined') {
|
|
9
9
|
return window.fetch;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
// webpackIgnore comment prevents webpack from bundling node-fetch
|
|
12
|
+
return (await import(/* webpackIgnore: true */ 'node-fetch')).default;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const API = 'https://app.findme2care.de';
|
|
@@ -51,7 +52,7 @@ export { base64ToBuffer, bufferToBase64, unpack };
|
|
|
51
52
|
// Node.js specific functions that require fs module
|
|
52
53
|
readSigKey = async name => {
|
|
53
54
|
try {
|
|
54
|
-
const FS = await import('fs');
|
|
55
|
+
const FS = await import(/* webpackIgnore: true */ 'fs');
|
|
55
56
|
if (!FS.existsSync( name )) {
|
|
56
57
|
throw 'Key file not found!';
|
|
57
58
|
}
|
|
@@ -75,7 +76,7 @@ export const generateApiKeys = async () => {
|
|
|
75
76
|
|
|
76
77
|
export const writeApiKeys = async (name = 'rxome', dir = '.') => {
|
|
77
78
|
try {
|
|
78
|
-
const FS = await import('fs');
|
|
79
|
+
const FS = await import(/* webpackIgnore: true */ 'fs');
|
|
79
80
|
const key = await generateApiKeys();
|
|
80
81
|
await Promise.all([
|
|
81
82
|
FS.writeFile( `${dir}/${name}.private.apikey`, bufferToBase64( key.privateKey ), { mode: 0o600 }, err => { if (err) throw err; } ),
|
package/lib/rxome-generator.js
CHANGED
|
@@ -42,7 +42,7 @@ export { ENUM_ACMG };
|
|
|
42
42
|
|
|
43
43
|
export const generateRxomeKeyFiles = async (name = 'rxome', dir = '.') => {
|
|
44
44
|
try {
|
|
45
|
-
const FS = await import('fs/promises');
|
|
45
|
+
const FS = await import(/* webpackIgnore: true */ 'fs/promises');
|
|
46
46
|
const { privateKey, publicKey } = await generateRxomeKeys( name );
|
|
47
47
|
await Promise.all([
|
|
48
48
|
FS.writeFile(`${dir}/${name}.private.key`, privateKey, { mode: 0o600 }, err => { console.log(err); }),
|
package/package.json
CHANGED