@riocrypto/common-server 1.0.1539 → 1.0.1543

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.
@@ -173,7 +173,15 @@ declare class BridgeClient {
173
173
  bank_name: string;
174
174
  account_owner_name: string;
175
175
  last_4: string;
176
+ active: boolean;
176
177
  }[]>;
178
+ getExternalAccount(bridgeCustomerId: string, externalAccountId: string): Promise<{
179
+ id: string;
180
+ bank_name: string;
181
+ account_owner_name: string;
182
+ last_4: string;
183
+ active: boolean;
184
+ }>;
177
185
  exchangePlaidPublicToken(linkToken: string, publicToken: string): Promise<void>;
178
186
  createExternalAccount(bridgeCustomerId: string, bankName: string, accountNumber: string, routingNumber: string, accountOwnerName: string, address: {
179
187
  street_line_1: string;
@@ -167,6 +167,16 @@ class BridgeClient {
167
167
  return data.data;
168
168
  });
169
169
  }
170
+ getExternalAccount(bridgeCustomerId, externalAccountId) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ const { data } = yield axios_1.default.get(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/external_accounts/${externalAccountId}`, {
173
+ headers: {
174
+ "Api-Key": this.apiKey,
175
+ },
176
+ });
177
+ return data.data;
178
+ });
179
+ }
170
180
  exchangePlaidPublicToken(linkToken, publicToken) {
171
181
  return __awaiter(this, void 0, void 0, function* () {
172
182
  const { data } = yield axios_1.default.post(`${this.baseUrl}/v0/plaid_exchange_public_token/${linkToken}`, {
@@ -6,7 +6,6 @@ const sanitizeUserDoc = (doc) => {
6
6
  delete obj.platformFeeRanges;
7
7
  delete obj.authorizedPhoneNumbers;
8
8
  delete obj.authIds;
9
- delete obj.attributes;
10
9
  delete obj.cosignerGroupId;
11
10
  delete obj.hasPassedEDD;
12
11
  delete obj.risk;
@@ -111,8 +111,11 @@ const buildAuth = (mongoose) => {
111
111
  this.set("password", hashed);
112
112
  }
113
113
  if (this.isModified("securityAnswer")) {
114
- const hashed = yield password_1.Password.toHash(this.get("securityAnswer"));
115
- this.set("securityAnswer", hashed);
114
+ const securityAnswer = this.get("securityAnswer");
115
+ if (securityAnswer) {
116
+ const hashed = yield password_1.Password.toHash(securityAnswer);
117
+ this.set("securityAnswer", hashed);
118
+ }
116
119
  }
117
120
  done();
118
121
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1539",
3
+ "version": "1.0.1543",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/storage": "^6.9.5",
29
29
  "@google-cloud/vision": "^4.0.2",
30
30
  "@hyperdx/node-opentelemetry": "^0.4.2",
31
- "@riocrypto/common": "^1.0.1377",
31
+ "@riocrypto/common": "^1.0.1379",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.6.0",
34
34
  "ccxt": "^3.0.30",