@riocrypto/common-server 1.0.1761 → 1.0.1763

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.
@@ -37,6 +37,7 @@ declare class ClusterClient {
37
37
  resetOrderFXData(orderId: string): Promise<void>;
38
38
  deleteInvoice(id: string): Promise<void>;
39
39
  deleteRecord(id: string): Promise<void>;
40
+ registerUserWithCoincover(userId: string): Promise<void>;
40
41
  }
41
42
  export declare const buildClusterClient: () => Promise<ClusterClient>;
42
43
  export {};
@@ -310,6 +310,15 @@ class ClusterClient {
310
310
  });
311
311
  });
312
312
  }
313
+ registerUserWithCoincover(userId) {
314
+ return __awaiter(this, void 0, void 0, function* () {
315
+ yield this.axios.post(`${this.baseUrl}/api/users/${userId}/coincover`, {}, {
316
+ headers: {
317
+ "x-cluster-api-key": this.clusterApiKey,
318
+ },
319
+ });
320
+ });
321
+ }
313
322
  }
314
323
  const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
315
324
  // Retrieve secrets asynchronously
@@ -16,7 +16,14 @@ declare class CoincoverClient {
16
16
  };
17
17
  }>;
18
18
  registerIndividualUser(user: User): Promise<void>;
19
- registerBusinessUser(user: User, contactPersonName: string, contactPersonEmail: string): Promise<void>;
19
+ registerBusinessUser(user: User, address: {
20
+ street1: string;
21
+ street2?: string;
22
+ city: string;
23
+ state: string;
24
+ postalCode: string;
25
+ country: string;
26
+ }, contactPersonName: string, contactPersonEmail: string): Promise<void>;
20
27
  private formatDate;
21
28
  private formatAddress;
22
29
  private getResidenceCountry;
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.buildCoincoverClient = void 0;
16
- const secret_manager_client_1 = require("./secret-manager-client");
17
- const axios_with_logging_1 = __importDefault(require("./axios-with-logging"));
18
16
  const common_1 = require("@riocrypto/common");
17
+ const axios_with_logging_1 = __importDefault(require("./axios-with-logging"));
18
+ const secret_manager_client_1 = require("./secret-manager-client");
19
19
  class CoincoverClient {
20
20
  constructor(apiKey) {
21
21
  this.apiKey = apiKey;
@@ -94,14 +94,13 @@ class CoincoverClient {
94
94
  return data;
95
95
  });
96
96
  }
97
- registerBusinessUser(user, contactPersonName, contactPersonEmail) {
98
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
97
+ registerBusinessUser(user, address, contactPersonName, contactPersonEmail) {
98
+ var _a;
99
99
  return __awaiter(this, void 0, void 0, function* () {
100
- const highestOnboardingCountry = (0, common_1.getHighestOnboardingStatus)(user).country;
101
100
  const { data } = yield axios_with_logging_1.default.post(`${this.baseUrl}/business`, {
102
101
  businessId: user.id,
103
102
  name: (_a = user.businessData) === null || _a === void 0 ? void 0 : _a.businessName,
104
- address: this.formatAddress((_c = (_b = user.onboarding[highestOnboardingCountry]) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c.street1, (_e = (_d = user.onboarding[highestOnboardingCountry]) === null || _d === void 0 ? void 0 : _d.address) === null || _e === void 0 ? void 0 : _e.city, (_g = (_f = user.onboarding[highestOnboardingCountry]) === null || _f === void 0 ? void 0 : _f.address) === null || _g === void 0 ? void 0 : _g.state, (_j = (_h = user.onboarding[highestOnboardingCountry]) === null || _h === void 0 ? void 0 : _h.address) === null || _j === void 0 ? void 0 : _j.postalCode, (_l = (_k = user.onboarding[highestOnboardingCountry]) === null || _k === void 0 ? void 0 : _k.address) === null || _l === void 0 ? void 0 : _l.country, (_o = (_m = user.onboarding[highestOnboardingCountry]) === null || _m === void 0 ? void 0 : _m.address) === null || _o === void 0 ? void 0 : _o.street2),
103
+ address: this.formatAddress(address.street1, address.city, address.state, address.postalCode, address.country, address.street2),
105
104
  contactPersonName,
106
105
  contactPersonEmail,
107
106
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1761",
3
+ "version": "1.0.1763",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "@google-cloud/secret-manager": "^5.3.0",
27
27
  "@google-cloud/storage": "^6.9.5",
28
28
  "@hyperdx/node-opentelemetry": "^0.4.2",
29
- "@riocrypto/common": "^1.0.1550",
29
+ "@riocrypto/common": "^1.0.1551",
30
30
  "@types/express": "^4.17.13",
31
31
  "axios": "^1.6.0",
32
32
  "crypto-js": "^4.2.0",