@riocrypto/common-server 1.0.1762 → 1.0.1764
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.
|
@@ -16,7 +16,14 @@ declare class CoincoverClient {
|
|
|
16
16
|
};
|
|
17
17
|
}>;
|
|
18
18
|
registerIndividualUser(user: User): Promise<void>;
|
|
19
|
-
registerBusinessUser(user: User,
|
|
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
|
|
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(
|
|
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/build/models/user.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ interface UserAttrs {
|
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
+
attioRecordId?: string;
|
|
110
111
|
}
|
|
111
112
|
interface UserModel extends Model<UserDoc> {
|
|
112
113
|
build(attrs: UserAttrs): UserDoc;
|
|
@@ -115,6 +116,7 @@ interface UserDoc extends Document {
|
|
|
115
116
|
_id: string;
|
|
116
117
|
createdAt: Date;
|
|
117
118
|
authIds?: string[];
|
|
119
|
+
attioRecordId?: string;
|
|
118
120
|
registeredWithCoincover?: boolean;
|
|
119
121
|
individualData?: {
|
|
120
122
|
firstName: string;
|
package/build/models/user.js
CHANGED