@riocrypto/common-server 1.0.1820 → 1.0.1822

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.
@@ -22,8 +22,7 @@ const secret_manager_client_1 = require("../clients/secret-manager-client");
22
22
  const admin_auth_1 = require("../models/admin-auth");
23
23
  const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(void 0, void 0, void 0, function* () {
24
24
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
25
- if (authorizationTypes.includes(common_1.AuthorizationType.GenesisAdmin) &&
26
- req.header("x-genesis-api-key")) {
25
+ if (authorizationTypes.includes(common_1.AuthorizationType.GenesisAdmin)) {
27
26
  let apiKey = req.header("x-genesis-api-key");
28
27
  const GENESIS_ADMIN_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("GENESIS_ADMIN_KEY");
29
28
  if (!GENESIS_ADMIN_KEY) {
@@ -33,8 +32,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
33
32
  req.validGenisisAdminKey = true;
34
33
  }
35
34
  }
36
- if (authorizationTypes.includes(common_1.AuthorizationType.Cluster) &&
37
- req.header("x-cluster-api-key")) {
35
+ if (authorizationTypes.includes(common_1.AuthorizationType.Cluster)) {
38
36
  let apiKey = req.header("x-cluster-api-key");
39
37
  const CLUSTER_API_KEY = yield secret_manager_client_1.secretManagerClient.getSecretValue("CLUSTER_API_KEY");
40
38
  if (!CLUSTER_API_KEY) {
@@ -44,8 +42,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
44
42
  req.validClusterApiKey = true;
45
43
  }
46
44
  }
47
- if (authorizationTypes.includes(common_1.AuthorizationType.AdminAuth) &&
48
- req.header("x-admin-api-key")) {
45
+ if (authorizationTypes.includes(common_1.AuthorizationType.AdminAuth)) {
49
46
  const adminApiKey = req.header("x-admin-api-key");
50
47
  const AdminAuth = yield (0, admin_auth_1.buildAdminAuth)(mongoose);
51
48
  if (adminApiKey) {
@@ -81,8 +78,8 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
81
78
  authorizationTypes.includes(common_1.AuthorizationType.UserNoKYC) ||
82
79
  authorizationTypes.includes(common_1.AuthorizationType.User)) {
83
80
  const apiKey = req.header("x-api-key");
81
+ const Auth = yield (0, auth_1.buildAuth)(mongoose);
84
82
  if (apiKey) {
85
- const Auth = yield (0, auth_1.buildAuth)(mongoose);
86
83
  try {
87
84
  const hashedApiKey = yield apiKey_1.ApiKey.toHash(apiKey);
88
85
  const auth = yield Auth.findOne({
@@ -95,7 +92,6 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
95
92
  catch (err) { }
96
93
  }
97
94
  else if ((_b = req.cookies) === null || _b === void 0 ? void 0 : _b.accessToken) {
98
- const Auth = yield (0, auth_1.buildAuth)(mongoose);
99
95
  try {
100
96
  const ACCESS_TOKEN_SECRET = yield secret_manager_client_1.secretManagerClient.getSecretValue("ACCESS_TOKEN_SECRET");
101
97
  if (!ACCESS_TOKEN_SECRET) {
@@ -49,6 +49,8 @@ interface OrderAttrs {
49
49
  paymentAddressId?: string;
50
50
  payoutAddressId?: string;
51
51
  payoutBankAccountId?: string;
52
+ binancePaymentId?: string;
53
+ binancePayoutId?: string;
52
54
  attributes?: OrderAttribute[];
53
55
  }
54
56
  interface OrderDoc extends Document {
@@ -100,6 +102,8 @@ interface OrderDoc extends Document {
100
102
  paymentAddressId?: string;
101
103
  payoutAddressId?: string;
102
104
  payoutBankAccountId?: string;
105
+ binancePaymentId?: string;
106
+ binancePayoutId?: string;
103
107
  attributes?: OrderAttribute[];
104
108
  }
105
109
  interface OrderModel extends Model<OrderDoc> {
@@ -214,6 +214,12 @@ const buildOrder = (mongoose) => {
214
214
  payoutBankAccountId: {
215
215
  type: String,
216
216
  },
217
+ binancePaymentId: {
218
+ type: String,
219
+ },
220
+ binancePayoutId: {
221
+ type: String,
222
+ },
217
223
  attributes: [
218
224
  {
219
225
  type: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1820",
3
+ "version": "1.0.1822",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",