@paralect/hive 0.0.14 → 0.0.16

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}` } : {})}
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.14",
3
+ "version": "0.0.16",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -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];
@@ -1,7 +1,18 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
1
3
  const _ = require("lodash");
2
4
 
3
5
  const db = require("db");
4
- const schemaMappings = require("./schemaMappings");
6
+
7
+ let schemaMappings = {};
8
+
9
+ if (process.env.HIVE_SRC) {
10
+ let schemaMappingsPath = path.resolve(process.env.HIVE_SRC, "./autoMap/schemaMappings.js");
11
+
12
+ if (fs.existsSync(schemaMappingsPath)) {
13
+ schemaMappings = require(schemaMappingsPath);
14
+ }
15
+ }
5
16
 
6
17
  const schemaMappingService = db.services.schemaMappings;
7
18