ti2 1.0.43 → 1.0.45
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.
|
@@ -15,6 +15,7 @@ const typeDefs = `
|
|
|
15
15
|
unitName: String
|
|
16
16
|
subtitle: String!
|
|
17
17
|
restrictions: Restriction
|
|
18
|
+
type: String
|
|
18
19
|
pricing: [Pricing]
|
|
19
20
|
}
|
|
20
21
|
type Option {
|
|
@@ -27,6 +28,7 @@ const typeDefs = `
|
|
|
27
28
|
productName: String
|
|
28
29
|
availableCurrencies: [String]
|
|
29
30
|
defaultCurrency: String
|
|
31
|
+
settlementMethods: [String]
|
|
30
32
|
options: [Option]
|
|
31
33
|
}
|
|
32
34
|
`;
|
package/index.js
CHANGED
|
@@ -241,13 +241,13 @@ module.exports = async ({
|
|
|
241
241
|
return next(err);
|
|
242
242
|
}
|
|
243
243
|
if (process.env.CONSOLE_ERRORS || process.env.JEST_WORKER_ID) {
|
|
244
|
-
console.error(err);
|
|
244
|
+
console.error(R.path(['response', 'data'], err), err.message);
|
|
245
245
|
}
|
|
246
246
|
return res.status((() => {
|
|
247
247
|
if (!isNumber(err.status)) return 500;
|
|
248
248
|
return Number(err.status);
|
|
249
249
|
})()).json({
|
|
250
|
-
message: err.message || 'Internal Error',
|
|
250
|
+
message: R.path(['response', 'data', 'errorMessage'], err) || err.message || 'Internal Error',
|
|
251
251
|
});
|
|
252
252
|
});
|
|
253
253
|
});
|
package/models/userappkey.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
const jwt = require('jsonwebtoken');
|
|
2
2
|
const Sequelize = require('sequelize');
|
|
3
|
-
const
|
|
3
|
+
const R = require('ramda');
|
|
4
4
|
const { encrypt, decrypt } = require('../lib/security');
|
|
5
5
|
const db = require('./db');
|
|
6
6
|
|
|
7
7
|
const { env: { dbCryptoKey } } = process;
|
|
8
|
+
const removeEmptyAttributes = obj => R.reject(R.anyPass([R.isEmpty, R.isNil]))(obj);
|
|
8
9
|
|
|
9
10
|
const UserAppKey = db.define('UserAppKey', {
|
|
10
11
|
id: {
|
|
@@ -55,8 +56,8 @@ const UserAppKey = db.define('UserAppKey', {
|
|
|
55
56
|
});
|
|
56
57
|
const appKey = JSON.parse(decrypt(this.getDataValue('appKey')));
|
|
57
58
|
return {
|
|
58
|
-
...pathOr({}, ['settings'], userIntegrationSettings),
|
|
59
|
-
...appKey,
|
|
59
|
+
...R.pathOr({}, ['settings'], userIntegrationSettings),
|
|
60
|
+
...removeEmptyAttributes(appKey),
|
|
60
61
|
};
|
|
61
62
|
},
|
|
62
63
|
},
|