@paralect/hive 0.0.13 → 0.0.15

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.
@@ -4,6 +4,7 @@ module.exports = (options) => {
4
4
  return axios({
5
5
  ...options,
6
6
  url: options.url.startsWith('http') ? options.url : `https://hive-api-core.paralect.co/${options.url}`,
7
+ // url: options.url.startsWith('http') ? options.url : `http://localhost:3001/${options.url}`,
7
8
  headers: {
8
9
  ...(options?.headers || {}),
9
10
  ...(process.env.HIVE_TOKEN ? { Authorization: `Bearer ${process.env.HIVE_TOKEN}` } : {})}
@@ -12,7 +12,7 @@ module.exports = async () => {
12
12
  ]);
13
13
 
14
14
  try {
15
- await axios({ url: `https://hive-api-test.paralect.co/auth/login-code`, method: 'post', data: { email } });
15
+ await axios({ url: `https://hive-api-core.paralect.co/auth/login-code`, method: 'post', data: { email } });
16
16
 
17
17
  const { code } = await inquirer.prompt([
18
18
  {
@@ -22,7 +22,7 @@ module.exports = async () => {
22
22
  }
23
23
  ]);
24
24
 
25
- const { token, user } = (await axios({ url: `https://hive-api-test.paralect.co/auth/verify-login`, method: 'post', data: { email, code } })).data;
25
+ const { token, user } = (await axios({ url: `https://hive-api-core.paralect.co/auth/verify-login`, method: 'post', data: { email, code } })).data;
26
26
 
27
27
  process.env.HIVE_TOKEN = token;
28
28
  console.log(`
package/cli/hive.js CHANGED
@@ -74,7 +74,7 @@ program
74
74
  console.log('outDir', path.resolve(outDir, `./deploy/script`))
75
75
  await execCommand(`npm install --prefix ${path.resolve(outDir, `./deploy/script`)}`);
76
76
 
77
- process.env.SKIP_KUBERNETES = true;
77
+ // process.env.SKIP_KUBERNETES = true;
78
78
  await execCommand('node ./index.js', {
79
79
  cwd: path.resolve(outDir, `./deploy/script/src`)
80
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paralect/hive",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -35,9 +35,10 @@ const config = {
35
35
  },
36
36
 
37
37
  smtp: {
38
+ fromEmail: process.env.SMTP_FROM_EMAIL,
38
39
  host: process.env.SMTP_SERVER,
39
40
  port: process.env.SMTP_PORT,
40
- secure: true,
41
+ secure: false,
41
42
  auth: {
42
43
  user: process.env.SMTP_USER,
43
44
  pass: process.env.SMTP_KEY,
@@ -1,9 +1,19 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
1
3
  const _ = require("lodash");
2
4
  const db = require("db");
3
5
 
4
6
  const ifUpdated = require("helpers/db/ifUpdated");
5
7
 
6
- const schemaMappings = require("./schemaMappings");
8
+ let schemaMappings = {};
9
+
10
+ if (process.env.HIVE_SRC) {
11
+ let schemaMappingsPath = path.resolve(process.env.HIVE_SRC, "./autoMap/schemaMappings.js");
12
+
13
+ if (fs.existsSync(schemaMappingsPath)) {
14
+ schemaMappings = require(schemaMappingsPath);
15
+ }
16
+ }
7
17
 
8
18
  const getDependentFields = (schema, dependentFieldName) => {
9
19
  let targetSchema = schema[dependentFieldName];
@@ -8,7 +8,7 @@ module.exports = {
8
8
  const transporter = nodemailer.createTransport(config.smtp)
9
9
 
10
10
  return await transporter.sendMail({
11
- from: process.env.SMTP_USER,
11
+ from: config.smtp.fromEmail,
12
12
  to, subject, html
13
13
  })
14
14
  }