@bytexbyte/berifyme-react-sdk 1.0.0
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.
- package/README.md +20 -0
- package/dist/BerifymeModal/MainModal.js +29 -0
- package/dist/BerifymeModal/index.js +331 -0
- package/dist/api/api.js +1337 -0
- package/dist/api/client.js +21 -0
- package/dist/api/index.js +96 -0
- package/dist/common.js +216 -0
- package/dist/components/AllSet/index.js +169 -0
- package/dist/components/AuthenticationLogs.js +148 -0
- package/dist/components/Clear.js +107 -0
- package/dist/components/Footer/index.js +11 -0
- package/dist/components/Layout.js +9 -0
- package/dist/components/Login/authid/authid.js +196 -0
- package/dist/components/Login/authid/index.js +13 -0
- package/dist/components/Login/clear.js +35 -0
- package/dist/components/Login/clearAllSet.js +96 -0
- package/dist/components/Login/incode/Login.js +129 -0
- package/dist/components/Login/incode/index.js +16 -0
- package/dist/components/OnBoarding/authId/authIdSelectType.js +82 -0
- package/dist/components/OnBoarding/authId/idOrPassport.js +30 -0
- package/dist/components/OnBoarding/authId/index.js +323 -0
- package/dist/components/OnBoarding/clear/clearAllSet.js +118 -0
- package/dist/components/OnBoarding/clear/index.js +36 -0
- package/dist/components/OnBoarding/incode/BackId.js +25 -0
- package/dist/components/OnBoarding/incode/FinishOnboarding.js +26 -0
- package/dist/components/OnBoarding/incode/FrontId.js +27 -0
- package/dist/components/OnBoarding/incode/Passport.js +27 -0
- package/dist/components/OnBoarding/incode/ProcessFace.js +22 -0
- package/dist/components/OnBoarding/incode/ProcessId.js +22 -0
- package/dist/components/OnBoarding/incode/SelectType.js +68 -0
- package/dist/components/OnBoarding/incode/Selfie.js +25 -0
- package/dist/components/OnBoarding/incode/Steps.js +7 -0
- package/dist/components/OnBoarding/incode/UserConsent.js +30 -0
- package/dist/components/OnBoarding/incode/index.js +234 -0
- package/dist/components/OnBoarding/vender/grid/authIdGrid.js +94 -0
- package/dist/components/OnBoarding/vender/grid/clearGrid.js +14 -0
- package/dist/components/OnBoarding/vender/grid/incodeGrid.js +14 -0
- package/dist/components/OnBoarding/vender/grid/index.js +118 -0
- package/dist/components/OnBoarding/vender/grid/sumsubGrid.js +14 -0
- package/dist/components/OnBoarding/vender/grid/veriffGrid.js +14 -0
- package/dist/components/OnBoarding/vender/grid/yotiGrid.js +14 -0
- package/dist/components/OnBoarding/vender/index.js +123 -0
- package/dist/components/RedirectToMobile/index.js +139 -0
- package/dist/components/ScreenRotation.js +11 -0
- package/dist/components/SendSns/index.js +341 -0
- package/dist/components/SendSns/style.css +1 -0
- package/dist/components/TryAgain.js +16 -0
- package/dist/components/TryAgainInModal.js +15 -0
- package/dist/components/VerifyWithPhoneNumber/NewUser/index.js +189 -0
- package/dist/components/VerifyWithPhoneNumber/User/index.js +322 -0
- package/dist/components/createDeveloperLog.js +60 -0
- package/dist/components/phoneNumberProcesser.js +32 -0
- package/dist/components/speedTest/SpeedProvider.js +57 -0
- package/dist/components/theme.js +120 -0
- package/dist/enum/index.js +24 -0
- package/dist/index.js +7 -0
- package/dist/lib/environmentDomains.js +12 -0
- package/dist/lib/webauthb.js +158 -0
- package/dist/state.js +23 -0
- package/dist/theme.js +120 -0
- package/dist/types/BerifymeModal/MainModal.d.ts +7 -0
- package/dist/types/BerifymeModal/index.d.ts +12 -0
- package/dist/types/api/api.d.ts +606 -0
- package/dist/types/api/client.d.ts +2 -0
- package/dist/types/api/index.d.ts +16 -0
- package/dist/types/common.d.ts +3 -0
- package/dist/types/components/AllSet/index.d.ts +8 -0
- package/dist/types/components/AuthenticationLogs.d.ts +19 -0
- package/dist/types/components/Clear.d.ts +9 -0
- package/dist/types/components/Footer/index.d.ts +3 -0
- package/dist/types/components/Layout.d.ts +5 -0
- package/dist/types/components/Login/authid/authid.d.ts +11 -0
- package/dist/types/components/Login/authid/index.d.ts +9 -0
- package/dist/types/components/Login/clear.d.ts +7 -0
- package/dist/types/components/Login/clearAllSet.d.ts +6 -0
- package/dist/types/components/Login/incode/Login.d.ts +13 -0
- package/dist/types/components/Login/incode/index.d.ts +9 -0
- package/dist/types/components/OnBoarding/authId/authIdSelectType.d.ts +6 -0
- package/dist/types/components/OnBoarding/authId/idOrPassport.d.ts +7 -0
- package/dist/types/components/OnBoarding/authId/index.d.ts +11 -0
- package/dist/types/components/OnBoarding/clear/clearAllSet.d.ts +6 -0
- package/dist/types/components/OnBoarding/clear/index.d.ts +8 -0
- package/dist/types/components/OnBoarding/incode/BackId.d.ts +11 -0
- package/dist/types/components/OnBoarding/incode/FinishOnboarding.d.ts +11 -0
- package/dist/types/components/OnBoarding/incode/FrontId.d.ts +10 -0
- package/dist/types/components/OnBoarding/incode/Passport.d.ts +10 -0
- package/dist/types/components/OnBoarding/incode/ProcessFace.d.ts +11 -0
- package/dist/types/components/OnBoarding/incode/ProcessId.d.ts +11 -0
- package/dist/types/components/OnBoarding/incode/SelectType.d.ts +6 -0
- package/dist/types/components/OnBoarding/incode/Selfie.d.ts +11 -0
- package/dist/types/components/OnBoarding/incode/Steps.d.ts +7 -0
- package/dist/types/components/OnBoarding/incode/UserConsent.d.ts +8 -0
- package/dist/types/components/OnBoarding/incode/index.d.ts +9 -0
- package/dist/types/components/OnBoarding/vender/grid/authIdGrid.d.ts +8 -0
- package/dist/types/components/OnBoarding/vender/grid/clearGrid.d.ts +5 -0
- package/dist/types/components/OnBoarding/vender/grid/incodeGrid.d.ts +5 -0
- package/dist/types/components/OnBoarding/vender/grid/index.d.ts +10 -0
- package/dist/types/components/OnBoarding/vender/grid/sumsubGrid.d.ts +5 -0
- package/dist/types/components/OnBoarding/vender/grid/veriffGrid.d.ts +5 -0
- package/dist/types/components/OnBoarding/vender/grid/yotiGrid.d.ts +5 -0
- package/dist/types/components/OnBoarding/vender/index.d.ts +9 -0
- package/dist/types/components/RedirectToMobile/index.d.ts +7 -0
- package/dist/types/components/ScreenRotation.d.ts +3 -0
- package/dist/types/components/SendSns/index.d.ts +16 -0
- package/dist/types/components/TryAgain.d.ts +6 -0
- package/dist/types/components/TryAgainInModal.d.ts +6 -0
- package/dist/types/components/VerifyWithPhoneNumber/NewUser/index.d.ts +11 -0
- package/dist/types/components/VerifyWithPhoneNumber/User/index.d.ts +13 -0
- package/dist/types/components/createDeveloperLog.d.ts +11 -0
- package/dist/types/components/phoneNumberProcesser.d.ts +6 -0
- package/dist/types/components/speedTest/SpeedProvider.d.ts +9 -0
- package/dist/types/components/theme.d.ts +9 -0
- package/dist/types/enum/index.d.ts +22 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/lib/environmentDomains.d.ts +7 -0
- package/dist/types/lib/webauthb.d.ts +18 -0
- package/dist/types/state.d.ts +11 -0
- package/dist/types/theme.d.ts +9 -0
- package/dist/types/vender/incode/incode.d.ts +8 -0
- package/dist/vender/incode/incode.js +13 -0
- package/index.css +52 -0
- package/package.json +49 -0
- package/public/US-UK_Add_to_Apple_Wallet_RGB_101421.svg +259 -0
- package/public/berify-title.webp +0 -0
- package/public/clearme.svg +39 -0
- package/public/idme.svg +13 -0
- package/public/incode.svg +9 -0
- package/public/scan.svg +8 -0
- package/public/trackablehealth-one-logo-1024x229.jpg +0 -0
package/dist/api/api.js
ADDED
|
@@ -0,0 +1,1337 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import axios from "axios";
|
|
38
|
+
export var DeveloperLogSource;
|
|
39
|
+
(function (DeveloperLogSource) {
|
|
40
|
+
DeveloperLogSource[DeveloperLogSource["FRONTEND"] = 0] = "FRONTEND";
|
|
41
|
+
DeveloperLogSource[DeveloperLogSource["BACKEND"] = 1] = "BACKEND";
|
|
42
|
+
})(DeveloperLogSource || (DeveloperLogSource = {}));
|
|
43
|
+
export var ActionType;
|
|
44
|
+
(function (ActionType) {
|
|
45
|
+
ActionType[ActionType["ONBOARDING"] = 0] = "ONBOARDING";
|
|
46
|
+
ActionType[ActionType["LOGIN"] = 1] = "LOGIN";
|
|
47
|
+
})(ActionType || (ActionType = {}));
|
|
48
|
+
var config;
|
|
49
|
+
export function initializeBerifymeApi(userConfig) {
|
|
50
|
+
config = userConfig;
|
|
51
|
+
}
|
|
52
|
+
function getAuthIDToken() {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
+
var url, res;
|
|
55
|
+
return __generator(this, function (_a) {
|
|
56
|
+
switch (_a.label) {
|
|
57
|
+
case 0:
|
|
58
|
+
url = "".concat(config.backendDomain, "/api/authid/token");
|
|
59
|
+
return [4 /*yield*/, axios.get(url)];
|
|
60
|
+
case 1:
|
|
61
|
+
res = _a.sent();
|
|
62
|
+
return [2 /*return*/, res.data];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function getIdDocumentTypes(_a) {
|
|
68
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
69
|
+
var url, res;
|
|
70
|
+
var token = _b.token;
|
|
71
|
+
return __generator(this, function (_c) {
|
|
72
|
+
switch (_c.label) {
|
|
73
|
+
case 0:
|
|
74
|
+
url = "".concat(config.backendDomain, "/api/authid/getIdDocumentTypes");
|
|
75
|
+
return [4 /*yield*/, axios.get(url, {
|
|
76
|
+
headers: {
|
|
77
|
+
'Content-Type': 'application/json',
|
|
78
|
+
'Authorization': "Bearer ".concat(token)
|
|
79
|
+
}
|
|
80
|
+
})];
|
|
81
|
+
case 1:
|
|
82
|
+
res = _c.sent();
|
|
83
|
+
return [2 /*return*/, res.data];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function createAccount(_a) {
|
|
89
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
90
|
+
var url, res;
|
|
91
|
+
var token = _b.token, userId = _b.userId;
|
|
92
|
+
return __generator(this, function (_c) {
|
|
93
|
+
switch (_c.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
url = "".concat(config.backendDomain, "/api/authid/createAccount");
|
|
96
|
+
return [4 /*yield*/, axios.post(url, { userId: userId }, {
|
|
97
|
+
headers: {
|
|
98
|
+
'Content-Type': 'application/json',
|
|
99
|
+
'Authorization': "Bearer ".concat(token)
|
|
100
|
+
}
|
|
101
|
+
})];
|
|
102
|
+
case 1:
|
|
103
|
+
res = _c.sent();
|
|
104
|
+
return [2 /*return*/, res.data];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function checkBiometricExist(_a) {
|
|
110
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
111
|
+
var url, res;
|
|
112
|
+
var token = _b.token, userId = _b.userId;
|
|
113
|
+
return __generator(this, function (_c) {
|
|
114
|
+
switch (_c.label) {
|
|
115
|
+
case 0:
|
|
116
|
+
url = "".concat(config.backendDomain, "/api/authid/checkBiometricExist?userId=").concat(userId);
|
|
117
|
+
return [4 /*yield*/, axios.get(url, {
|
|
118
|
+
headers: {
|
|
119
|
+
'Content-Type': 'application/json',
|
|
120
|
+
'Authorization': "Bearer ".concat(token)
|
|
121
|
+
}
|
|
122
|
+
})];
|
|
123
|
+
case 1:
|
|
124
|
+
res = _c.sent();
|
|
125
|
+
return [2 /*return*/, res.data];
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function proofUser(_a) {
|
|
131
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
132
|
+
var url, res;
|
|
133
|
+
var token = _b.token, userId = _b.userId, idType = _b.idType;
|
|
134
|
+
return __generator(this, function (_c) {
|
|
135
|
+
switch (_c.label) {
|
|
136
|
+
case 0:
|
|
137
|
+
url = "".concat(config.backendDomain, "/api/authid/proofUser");
|
|
138
|
+
return [4 /*yield*/, axios.post(url, { userId: userId, idType: idType }, {
|
|
139
|
+
headers: {
|
|
140
|
+
'Content-Type': 'application/json',
|
|
141
|
+
'Authorization': "Bearer ".concat(token)
|
|
142
|
+
}
|
|
143
|
+
})];
|
|
144
|
+
case 1:
|
|
145
|
+
res = _c.sent();
|
|
146
|
+
return [2 /*return*/, res.data];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function getProofTransactionStatus(_a) {
|
|
152
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
153
|
+
var url, res;
|
|
154
|
+
var token = _b.token, operationId = _b.operationId, userId = _b.userId;
|
|
155
|
+
return __generator(this, function (_c) {
|
|
156
|
+
switch (_c.label) {
|
|
157
|
+
case 0:
|
|
158
|
+
url = "".concat(config.backendDomain, "/api/authid/getProofTransactionStatus?operationId=").concat(operationId, "&userId=").concat(userId);
|
|
159
|
+
return [4 /*yield*/, axios.get(url, {
|
|
160
|
+
headers: {
|
|
161
|
+
'Content-Type': 'application/json',
|
|
162
|
+
'Authorization': "Bearer ".concat(token)
|
|
163
|
+
}
|
|
164
|
+
})];
|
|
165
|
+
case 1:
|
|
166
|
+
res = _c.sent();
|
|
167
|
+
return [2 /*return*/, res.data];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function getProofTransactionTempId(_a) {
|
|
173
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
174
|
+
var url, res;
|
|
175
|
+
var token = _b.token, operationId = _b.operationId, userId = _b.userId;
|
|
176
|
+
return __generator(this, function (_c) {
|
|
177
|
+
switch (_c.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
url = "".concat(config.backendDomain, "/api/authid/getProofTransactionTempId?operationId=").concat(operationId, "&userId=").concat(userId);
|
|
180
|
+
return [4 /*yield*/, axios.get(url, {
|
|
181
|
+
headers: {
|
|
182
|
+
'Content-Type': 'application/json',
|
|
183
|
+
'Authorization': "Bearer ".concat(token)
|
|
184
|
+
}
|
|
185
|
+
})];
|
|
186
|
+
case 1:
|
|
187
|
+
res = _c.sent();
|
|
188
|
+
return [2 /*return*/, res.data];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function createBiometricFromProof(_a) {
|
|
194
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
195
|
+
var url, res;
|
|
196
|
+
var token = _b.token, tempId = _b.tempId, userId = _b.userId;
|
|
197
|
+
return __generator(this, function (_c) {
|
|
198
|
+
switch (_c.label) {
|
|
199
|
+
case 0:
|
|
200
|
+
url = "".concat(config.backendDomain, "/api/authid/createBiometricFromProof");
|
|
201
|
+
return [4 /*yield*/, axios.post(url, { userId: userId, tempId: tempId }, {
|
|
202
|
+
headers: {
|
|
203
|
+
'Content-Type': 'application/json',
|
|
204
|
+
'Authorization': "Bearer ".concat(token)
|
|
205
|
+
}
|
|
206
|
+
})];
|
|
207
|
+
case 1:
|
|
208
|
+
res = _c.sent();
|
|
209
|
+
return [2 /*return*/, res.data];
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function getAccount(_a) {
|
|
215
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
216
|
+
var url, res;
|
|
217
|
+
var token = _b.token, phone = _b.phone;
|
|
218
|
+
return __generator(this, function (_c) {
|
|
219
|
+
switch (_c.label) {
|
|
220
|
+
case 0:
|
|
221
|
+
url = "".concat(config.backendDomain, "/api/authid/getAccount?phone=").concat(phone);
|
|
222
|
+
return [4 /*yield*/, axios.get(url, {
|
|
223
|
+
headers: {
|
|
224
|
+
'Content-Type': 'application/json',
|
|
225
|
+
'Authorization': "Bearer ".concat(token)
|
|
226
|
+
},
|
|
227
|
+
})];
|
|
228
|
+
case 1:
|
|
229
|
+
res = _c.sent();
|
|
230
|
+
return [2 /*return*/, res.data];
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function createLoginTransaction(_a) {
|
|
236
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
237
|
+
var url, res;
|
|
238
|
+
var token = _b.token, phone = _b.phone;
|
|
239
|
+
return __generator(this, function (_c) {
|
|
240
|
+
switch (_c.label) {
|
|
241
|
+
case 0:
|
|
242
|
+
url = "".concat(config.backendDomain, "/api/authid/createLoginTransaction");
|
|
243
|
+
return [4 /*yield*/, axios.post(url, { phone: phone }, {
|
|
244
|
+
headers: {
|
|
245
|
+
'Content-Type': 'application/json',
|
|
246
|
+
'Authorization': "Bearer ".concat(token)
|
|
247
|
+
}
|
|
248
|
+
})];
|
|
249
|
+
case 1:
|
|
250
|
+
res = _c.sent();
|
|
251
|
+
return [2 /*return*/, res.data];
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function getTransactionStatus(_a) {
|
|
257
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
258
|
+
var url, res;
|
|
259
|
+
var token = _b.token, phone = _b.phone, transactionId = _b.transactionId;
|
|
260
|
+
return __generator(this, function (_c) {
|
|
261
|
+
switch (_c.label) {
|
|
262
|
+
case 0:
|
|
263
|
+
url = "".concat(config.backendDomain, "/api/authid/getTransactionStatus?phone=").concat(phone, "&transactionId=").concat(transactionId);
|
|
264
|
+
return [4 /*yield*/, axios.get(url, {
|
|
265
|
+
headers: {
|
|
266
|
+
'Content-Type': 'application/json',
|
|
267
|
+
'Authorization': "Bearer ".concat(token)
|
|
268
|
+
}
|
|
269
|
+
})];
|
|
270
|
+
case 1:
|
|
271
|
+
res = _c.sent();
|
|
272
|
+
return [2 /*return*/, res.data];
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
function getOperationStatus(_a) {
|
|
278
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
279
|
+
var url, res;
|
|
280
|
+
var token = _b.token, operationId = _b.operationId;
|
|
281
|
+
return __generator(this, function (_c) {
|
|
282
|
+
switch (_c.label) {
|
|
283
|
+
case 0:
|
|
284
|
+
url = "".concat(config.backendDomain, "/api/authid/getOperationStatus?operationId=").concat(operationId);
|
|
285
|
+
return [4 /*yield*/, axios.get(url, {
|
|
286
|
+
headers: {
|
|
287
|
+
'Content-Type': 'application/json',
|
|
288
|
+
'Authorization': "Bearer ".concat(token)
|
|
289
|
+
}
|
|
290
|
+
})];
|
|
291
|
+
case 1:
|
|
292
|
+
res = _c.sent();
|
|
293
|
+
return [2 /*return*/, res.data];
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function searchUser(_a) {
|
|
299
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
300
|
+
var url, res;
|
|
301
|
+
var token = _b.token, operationId = _b.operationId;
|
|
302
|
+
return __generator(this, function (_c) {
|
|
303
|
+
switch (_c.label) {
|
|
304
|
+
case 0:
|
|
305
|
+
url = "".concat(config.backendDomain, "/api/authid/searchUser?operationId=").concat(operationId);
|
|
306
|
+
return [4 /*yield*/, axios.get(url, {
|
|
307
|
+
headers: {
|
|
308
|
+
'Content-Type': 'application/json',
|
|
309
|
+
'Authorization': "Bearer ".concat(token),
|
|
310
|
+
}
|
|
311
|
+
})];
|
|
312
|
+
case 1:
|
|
313
|
+
res = _c.sent();
|
|
314
|
+
return [2 /*return*/, res.data];
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
function getDocumentDetails(_a) {
|
|
320
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
321
|
+
var url, res;
|
|
322
|
+
var token = _b.token, operationId = _b.operationId, userId = _b.userId;
|
|
323
|
+
return __generator(this, function (_c) {
|
|
324
|
+
switch (_c.label) {
|
|
325
|
+
case 0:
|
|
326
|
+
url = "".concat(config.backendDomain, "/api/authid/getDocumentDetails?operationId=").concat(operationId, "&userId=").concat(userId);
|
|
327
|
+
return [4 /*yield*/, axios.get(url, {
|
|
328
|
+
headers: {
|
|
329
|
+
'Content-Type': 'application/json',
|
|
330
|
+
'Authorization': "Bearer ".concat(token)
|
|
331
|
+
}
|
|
332
|
+
})];
|
|
333
|
+
case 1:
|
|
334
|
+
res = _c.sent();
|
|
335
|
+
return [2 /*return*/, res.data];
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function updateAccount(token, data) {
|
|
341
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
342
|
+
var url, res;
|
|
343
|
+
return __generator(this, function (_a) {
|
|
344
|
+
switch (_a.label) {
|
|
345
|
+
case 0:
|
|
346
|
+
url = "".concat(config.backendDomain, "/api/authid/updateAccount");
|
|
347
|
+
return [4 /*yield*/, axios.put(url, data, {
|
|
348
|
+
headers: {
|
|
349
|
+
'Content-Type': 'application/json',
|
|
350
|
+
'Authorization': "Bearer ".concat(token)
|
|
351
|
+
}
|
|
352
|
+
})];
|
|
353
|
+
case 1:
|
|
354
|
+
res = _a.sent();
|
|
355
|
+
return [2 /*return*/, res.data];
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
function getIncodeStart(uniqueId) {
|
|
361
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
362
|
+
var url, res;
|
|
363
|
+
return __generator(this, function (_a) {
|
|
364
|
+
switch (_a.label) {
|
|
365
|
+
case 0:
|
|
366
|
+
url = "".concat(config.backendDomain, "/api/incode/start?").concat(uniqueId ? "uniqueId=".concat(uniqueId) : '');
|
|
367
|
+
console.log('UrlString: ', url);
|
|
368
|
+
return [4 /*yield*/, axios.get(url)];
|
|
369
|
+
case 1:
|
|
370
|
+
res = _a.sent();
|
|
371
|
+
console.log('UrlRes data: ', res.data);
|
|
372
|
+
return [2 /*return*/, res.data];
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function getIncodeFinish(_a) {
|
|
378
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
379
|
+
var url, res;
|
|
380
|
+
var token = _b.token;
|
|
381
|
+
return __generator(this, function (_c) {
|
|
382
|
+
switch (_c.label) {
|
|
383
|
+
case 0:
|
|
384
|
+
url = "".concat(config.backendDomain, "/api/incode/finish?token=").concat(token);
|
|
385
|
+
console.log('UrlString: ', url);
|
|
386
|
+
return [4 /*yield*/, axios.get(url)];
|
|
387
|
+
case 1:
|
|
388
|
+
res = _c.sent();
|
|
389
|
+
console.log('UrlRes data: ', res.data);
|
|
390
|
+
return [2 /*return*/, res.data];
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function getIncodeApprove(_a) {
|
|
396
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
397
|
+
var url, res;
|
|
398
|
+
var id = _b.id, token = _b.token, uniqueId = _b.uniqueId;
|
|
399
|
+
return __generator(this, function (_c) {
|
|
400
|
+
switch (_c.label) {
|
|
401
|
+
case 0:
|
|
402
|
+
url = "".concat(config.backendDomain, "/api/incode/approve?id=").concat(id, "&token=").concat(token, "&uniqueId=").concat(uniqueId);
|
|
403
|
+
console.log('UrlString: ', url);
|
|
404
|
+
return [4 /*yield*/, axios.get(url)];
|
|
405
|
+
case 1:
|
|
406
|
+
res = _c.sent();
|
|
407
|
+
console.log('UrlRes data: ', res.data);
|
|
408
|
+
return [2 /*return*/, res.data];
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
function createVerificationSession(_a) {
|
|
414
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
415
|
+
var url, payload, res;
|
|
416
|
+
var redirectUrl = _b.redirectUrl, token = _b.token;
|
|
417
|
+
return __generator(this, function (_c) {
|
|
418
|
+
switch (_c.label) {
|
|
419
|
+
case 0:
|
|
420
|
+
url = "".concat(config.backendDomain, "/api/clear/createVerificationSession");
|
|
421
|
+
console.log('UrlString: ', url);
|
|
422
|
+
payload = {
|
|
423
|
+
redirectUrl: redirectUrl,
|
|
424
|
+
token: token,
|
|
425
|
+
};
|
|
426
|
+
return [4 /*yield*/, axios.post(url, payload)];
|
|
427
|
+
case 1:
|
|
428
|
+
res = _c.sent();
|
|
429
|
+
console.log('UrlRes data: ', res.data);
|
|
430
|
+
return [2 /*return*/, res.data];
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
function getClearApprove(_a) {
|
|
436
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
437
|
+
var url, res;
|
|
438
|
+
var id = _b.id, sessionId = _b.sessionId;
|
|
439
|
+
return __generator(this, function (_c) {
|
|
440
|
+
switch (_c.label) {
|
|
441
|
+
case 0:
|
|
442
|
+
url = "".concat(config.backendDomain, "/api/clear/approve?id=").concat(id, "&sessionId=").concat(sessionId);
|
|
443
|
+
console.log('UrlString: ', url);
|
|
444
|
+
return [4 /*yield*/, axios.get(url)];
|
|
445
|
+
case 1:
|
|
446
|
+
res = _c.sent();
|
|
447
|
+
console.log('UrlRes data: ', res.data);
|
|
448
|
+
return [2 /*return*/, res.data];
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
function createIdmeVerificationUrl(_a) {
|
|
454
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
455
|
+
var url, payload, res;
|
|
456
|
+
var redirectUrl = _b.redirectUrl, token = _b.token;
|
|
457
|
+
return __generator(this, function (_c) {
|
|
458
|
+
switch (_c.label) {
|
|
459
|
+
case 0:
|
|
460
|
+
url = "".concat(config.backendDomain, "/api/idme/createVerificationUrl");
|
|
461
|
+
console.log('UrlString: ', url);
|
|
462
|
+
payload = {
|
|
463
|
+
redirectUrl: redirectUrl,
|
|
464
|
+
token: token,
|
|
465
|
+
};
|
|
466
|
+
return [4 /*yield*/, axios.post(url, payload)];
|
|
467
|
+
case 1:
|
|
468
|
+
res = _c.sent();
|
|
469
|
+
console.log('UrlRes data: ', res.data);
|
|
470
|
+
return [2 /*return*/, res.data];
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
function sendIdmePhoneNumberVerify(_a) {
|
|
476
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
477
|
+
var url, payload, res;
|
|
478
|
+
var phoneNumber = _b.phoneNumber, idmeId = _b.idmeId, token = _b.token;
|
|
479
|
+
return __generator(this, function (_c) {
|
|
480
|
+
switch (_c.label) {
|
|
481
|
+
case 0:
|
|
482
|
+
url = "".concat(config.backendDomain, "/api/idme/sendIdmePhoneNumberVerify");
|
|
483
|
+
console.log('UrlString: ', url);
|
|
484
|
+
payload = { phoneNumber: phoneNumber, idmeId: idmeId, token: token };
|
|
485
|
+
return [4 /*yield*/, axios.post(url, payload, {
|
|
486
|
+
headers: {
|
|
487
|
+
'Content-Type': 'application/json'
|
|
488
|
+
}
|
|
489
|
+
})];
|
|
490
|
+
case 1:
|
|
491
|
+
res = _c.sent();
|
|
492
|
+
console.log('UrlRes data: ', res.data);
|
|
493
|
+
return [2 /*return*/, res.data];
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
function updateIdmeId(_a) {
|
|
499
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
500
|
+
var url, payload, res;
|
|
501
|
+
var id = _b.id, idmeId = _b.idmeId, token = _b.token;
|
|
502
|
+
return __generator(this, function (_c) {
|
|
503
|
+
switch (_c.label) {
|
|
504
|
+
case 0:
|
|
505
|
+
url = "".concat(config.backendDomain, "/api/idme/updateIdmeId");
|
|
506
|
+
console.log('UrlString: ', url);
|
|
507
|
+
payload = { id: id, idmeId: idmeId, token: token };
|
|
508
|
+
return [4 /*yield*/, axios.post(url, payload, {
|
|
509
|
+
headers: {
|
|
510
|
+
'Content-Type': 'application/json'
|
|
511
|
+
}
|
|
512
|
+
})];
|
|
513
|
+
case 1:
|
|
514
|
+
res = _c.sent();
|
|
515
|
+
console.log('UrlRes data: ', res.data);
|
|
516
|
+
return [2 /*return*/, res.data];
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function getIdmeApprove(_a) {
|
|
522
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
523
|
+
var url, res;
|
|
524
|
+
var id = _b.id, code = _b.code, redirectUrl = _b.redirectUrl;
|
|
525
|
+
return __generator(this, function (_c) {
|
|
526
|
+
switch (_c.label) {
|
|
527
|
+
case 0:
|
|
528
|
+
url = "".concat(config.backendDomain, "/api/idme/approve?id=").concat(id, "&code=").concat(code, "&redirecturl=").concat(redirectUrl);
|
|
529
|
+
console.log('UrlString: ', url);
|
|
530
|
+
return [4 /*yield*/, axios.get(url)];
|
|
531
|
+
case 1:
|
|
532
|
+
res = _c.sent();
|
|
533
|
+
console.log('UrlRes data: ', res.data);
|
|
534
|
+
return [2 /*return*/, res.data];
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
function checkThirdPartyVerificationToken(token) {
|
|
540
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
541
|
+
var url, res;
|
|
542
|
+
return __generator(this, function (_a) {
|
|
543
|
+
switch (_a.label) {
|
|
544
|
+
case 0:
|
|
545
|
+
url = "".concat(config.backendDomain, "/api/thirdParty/checkToken");
|
|
546
|
+
console.log('UrlString: ', url);
|
|
547
|
+
return [4 /*yield*/, axios.get(url, {
|
|
548
|
+
headers: {
|
|
549
|
+
'Content-Type': 'application/json',
|
|
550
|
+
'token': token,
|
|
551
|
+
}
|
|
552
|
+
})];
|
|
553
|
+
case 1:
|
|
554
|
+
res = _a.sent();
|
|
555
|
+
console.log('UrlRes data: ', res.data);
|
|
556
|
+
return [2 /*return*/, res.data];
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
function sendVerifyEmail(email) {
|
|
562
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
563
|
+
var url, res;
|
|
564
|
+
return __generator(this, function (_a) {
|
|
565
|
+
switch (_a.label) {
|
|
566
|
+
case 0:
|
|
567
|
+
url = "".concat(config.backendDomain, "/api/auth/sendEmailVerify?email=").concat(email);
|
|
568
|
+
console.log('UrlString: ', url);
|
|
569
|
+
return [4 /*yield*/, axios.get(url)];
|
|
570
|
+
case 1:
|
|
571
|
+
res = _a.sent();
|
|
572
|
+
console.log('UrlRes data: ', res.data);
|
|
573
|
+
return [2 /*return*/, res.data];
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
function sendPhoneNumberVerify(_a) {
|
|
579
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
580
|
+
var url, res;
|
|
581
|
+
var phoneNumber = _b.phoneNumber, token = _b.token, domain = _b.domain;
|
|
582
|
+
return __generator(this, function (_c) {
|
|
583
|
+
switch (_c.label) {
|
|
584
|
+
case 0:
|
|
585
|
+
url = "".concat(config.backendDomain, "/api/auth/sendPhoneNumberVerify?phoneNumber=").concat(phoneNumber).concat(token ? "&token=".concat(token) : '').concat(domain ? "&domain=".concat(domain) : '');
|
|
586
|
+
console.log('UrlString: ', url);
|
|
587
|
+
return [4 /*yield*/, axios.get(url)];
|
|
588
|
+
case 1:
|
|
589
|
+
res = _c.sent();
|
|
590
|
+
console.log('UrlRes data: ', res.data);
|
|
591
|
+
return [2 /*return*/, res.data];
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
function sendPhoneNumberCode(_a) {
|
|
597
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
598
|
+
var url, res;
|
|
599
|
+
var phoneNumber = _b.phoneNumber, token = _b.token;
|
|
600
|
+
return __generator(this, function (_c) {
|
|
601
|
+
switch (_c.label) {
|
|
602
|
+
case 0:
|
|
603
|
+
url = "".concat(config.backendDomain, "/api/auth/sendPhoneNumberCode?phoneNumber=").concat(phoneNumber).concat(token ? "&token=".concat(token) : '');
|
|
604
|
+
console.log('UrlString: ', url);
|
|
605
|
+
return [4 /*yield*/, axios.get(url)];
|
|
606
|
+
case 1:
|
|
607
|
+
res = _c.sent();
|
|
608
|
+
console.log('UrlRes data: ', res.data);
|
|
609
|
+
return [2 /*return*/, res.data];
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
function verify(id) {
|
|
615
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
616
|
+
var url, res;
|
|
617
|
+
return __generator(this, function (_a) {
|
|
618
|
+
switch (_a.label) {
|
|
619
|
+
case 0:
|
|
620
|
+
url = "".concat(config.backendDomain, "/api/auth/verify?id=").concat(id);
|
|
621
|
+
console.log('UrlString: ', url);
|
|
622
|
+
return [4 /*yield*/, axios.get(url)];
|
|
623
|
+
case 1:
|
|
624
|
+
res = _a.sent();
|
|
625
|
+
console.log('UrlRes data: ', res.data);
|
|
626
|
+
return [2 /*return*/, res.data];
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
function getUserBySessionId(sessionId) {
|
|
632
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
633
|
+
var url, res;
|
|
634
|
+
return __generator(this, function (_a) {
|
|
635
|
+
switch (_a.label) {
|
|
636
|
+
case 0:
|
|
637
|
+
url = "".concat(config.backendDomain, "/api/user/getUserByClearSessionId?id=").concat(sessionId);
|
|
638
|
+
console.log('UrlString: ', url);
|
|
639
|
+
return [4 /*yield*/, axios.get(url)];
|
|
640
|
+
case 1:
|
|
641
|
+
res = _a.sent();
|
|
642
|
+
console.log('UrlRes data: ', res.data);
|
|
643
|
+
return [2 /*return*/, res.data];
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
function getUserByCode(code, redirectUrl) {
|
|
649
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
650
|
+
var url, res;
|
|
651
|
+
return __generator(this, function (_a) {
|
|
652
|
+
switch (_a.label) {
|
|
653
|
+
case 0:
|
|
654
|
+
url = "".concat(config.backendDomain, "/api/user/getUserByCode?code=").concat(code, "&redirecturl=").concat(redirectUrl);
|
|
655
|
+
console.log('UrlString: ', url);
|
|
656
|
+
return [4 /*yield*/, axios.get(url)];
|
|
657
|
+
case 1:
|
|
658
|
+
res = _a.sent();
|
|
659
|
+
console.log('UrlRes data: ', res.data);
|
|
660
|
+
return [2 /*return*/, res.data];
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
function getUserByIncodeId(incodeId) {
|
|
666
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
667
|
+
var url, res;
|
|
668
|
+
return __generator(this, function (_a) {
|
|
669
|
+
switch (_a.label) {
|
|
670
|
+
case 0:
|
|
671
|
+
url = "".concat(config.backendDomain, "/api/user/getUserByIncodeId?incodeId=").concat(incodeId);
|
|
672
|
+
console.log('UrlString: ', url);
|
|
673
|
+
return [4 /*yield*/, axios.get(url)];
|
|
674
|
+
case 1:
|
|
675
|
+
res = _a.sent();
|
|
676
|
+
console.log('UrlRes data: ', res.data);
|
|
677
|
+
return [2 /*return*/, res.data];
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
function getUserByClearId(clearId) {
|
|
683
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
684
|
+
var url, res;
|
|
685
|
+
return __generator(this, function (_a) {
|
|
686
|
+
switch (_a.label) {
|
|
687
|
+
case 0:
|
|
688
|
+
url = "".concat(config.backendDomain, "/api/user/getUserByClearId?clearId=").concat(clearId);
|
|
689
|
+
console.log('UrlString: ', url);
|
|
690
|
+
return [4 /*yield*/, axios.get(url)];
|
|
691
|
+
case 1:
|
|
692
|
+
res = _a.sent();
|
|
693
|
+
console.log('UrlRes data: ', res.data);
|
|
694
|
+
return [2 /*return*/, res.data];
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function getUserVenderByPhone(_a) {
|
|
700
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
701
|
+
var url, res;
|
|
702
|
+
var phoneNumber = _b.phoneNumber;
|
|
703
|
+
return __generator(this, function (_c) {
|
|
704
|
+
switch (_c.label) {
|
|
705
|
+
case 0:
|
|
706
|
+
url = "".concat(config.backendDomain, "/api/user/getUserVenderByPhone?phoneNumber=").concat(phoneNumber);
|
|
707
|
+
console.log('UrlString: ', url);
|
|
708
|
+
return [4 /*yield*/, axios.get(url)];
|
|
709
|
+
case 1:
|
|
710
|
+
res = _c.sent();
|
|
711
|
+
console.log('UrlRes data: ', res.data);
|
|
712
|
+
return [2 /*return*/, res.data];
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
function getUserByPhoneNumberAndVerifyCode(_a) {
|
|
718
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
719
|
+
var url, res;
|
|
720
|
+
var phoneNumber = _b.phoneNumber, code = _b.code;
|
|
721
|
+
return __generator(this, function (_c) {
|
|
722
|
+
switch (_c.label) {
|
|
723
|
+
case 0:
|
|
724
|
+
url = "".concat(config.backendDomain, "/api/user/getUserByPhoneNumberAndVerifyCode?phoneNumber=").concat(phoneNumber, "&code=").concat(code);
|
|
725
|
+
console.log('UrlString: ', url);
|
|
726
|
+
return [4 /*yield*/, axios.get(url)];
|
|
727
|
+
case 1:
|
|
728
|
+
res = _c.sent();
|
|
729
|
+
console.log('UrlRes data: ', res.data);
|
|
730
|
+
return [2 /*return*/, res.data];
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
function uploadDeviceId(_a) {
|
|
736
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
737
|
+
var url, payload, res;
|
|
738
|
+
var id = _b.id, deviceId = _b.deviceId;
|
|
739
|
+
return __generator(this, function (_c) {
|
|
740
|
+
switch (_c.label) {
|
|
741
|
+
case 0:
|
|
742
|
+
url = "".concat(config.backendDomain, "/api/user/uploadDeviceId");
|
|
743
|
+
console.log('UrlString: ', url);
|
|
744
|
+
payload = { id: id, deviceId: deviceId };
|
|
745
|
+
return [4 /*yield*/, axios.post(url, payload, {
|
|
746
|
+
headers: {
|
|
747
|
+
'Content-Type': 'application/json'
|
|
748
|
+
}
|
|
749
|
+
})];
|
|
750
|
+
case 1:
|
|
751
|
+
res = _c.sent();
|
|
752
|
+
console.log('UrlRes data: ', res.data);
|
|
753
|
+
return [2 /*return*/, res.data];
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
function checkDeviceId(_a) {
|
|
759
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
760
|
+
var url, payload, res;
|
|
761
|
+
var phoneNumber = _b.phoneNumber, deviceId = _b.deviceId, token = _b.token;
|
|
762
|
+
return __generator(this, function (_c) {
|
|
763
|
+
switch (_c.label) {
|
|
764
|
+
case 0:
|
|
765
|
+
url = "".concat(config.backendDomain, "/api/user/checkDeviceId");
|
|
766
|
+
console.log('UrlString: ', url);
|
|
767
|
+
payload = { phoneNumber: phoneNumber, deviceId: deviceId, token: token };
|
|
768
|
+
return [4 /*yield*/, axios.post(url, payload, {
|
|
769
|
+
headers: {
|
|
770
|
+
'Content-Type': 'application/json'
|
|
771
|
+
}
|
|
772
|
+
})];
|
|
773
|
+
case 1:
|
|
774
|
+
res = _c.sent();
|
|
775
|
+
console.log('UrlRes data: ', res.data);
|
|
776
|
+
return [2 /*return*/, res.data];
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
function checkBlockchainToken(_a) {
|
|
782
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
783
|
+
var url, payload, res;
|
|
784
|
+
var phoneNumber = _b.phoneNumber, blockchainTokenId = _b.blockchainTokenId, token = _b.token;
|
|
785
|
+
return __generator(this, function (_c) {
|
|
786
|
+
switch (_c.label) {
|
|
787
|
+
case 0:
|
|
788
|
+
url = "".concat(config.backendDomain, "/api/user/checkBlockchainToken");
|
|
789
|
+
payload = { phoneNumber: phoneNumber, blockchainTokenId: blockchainTokenId, token: token };
|
|
790
|
+
return [4 /*yield*/, axios.post(url, payload, {
|
|
791
|
+
headers: {
|
|
792
|
+
'Content-Type': 'application/json'
|
|
793
|
+
}
|
|
794
|
+
})];
|
|
795
|
+
case 1:
|
|
796
|
+
res = _c.sent();
|
|
797
|
+
return [2 /*return*/, res.data];
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
function getRedirectUrl(_a) {
|
|
803
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
804
|
+
var url, res;
|
|
805
|
+
var userId = _b.userId, token = _b.token, desktopRedirectUrlId = _b.desktopRedirectUrlId;
|
|
806
|
+
return __generator(this, function (_c) {
|
|
807
|
+
switch (_c.label) {
|
|
808
|
+
case 0:
|
|
809
|
+
url = "".concat(config.backendDomain, "/api/thirdParty/getRedirectUrl?userId=").concat(userId).concat(desktopRedirectUrlId ? "&desktopRedirectUrlId=".concat(desktopRedirectUrlId) : '');
|
|
810
|
+
console.log('UrlString: ', url);
|
|
811
|
+
return [4 /*yield*/, axios.get(url, {
|
|
812
|
+
headers: {
|
|
813
|
+
'Content-Type': 'application/json',
|
|
814
|
+
'token': token,
|
|
815
|
+
}
|
|
816
|
+
})];
|
|
817
|
+
case 1:
|
|
818
|
+
res = _c.sent();
|
|
819
|
+
console.log('UrlRes data: ', res.data);
|
|
820
|
+
return [2 /*return*/, res.data];
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
function initUpdateAdminTokenSchedule() {
|
|
826
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
827
|
+
var url, res;
|
|
828
|
+
return __generator(this, function (_a) {
|
|
829
|
+
switch (_a.label) {
|
|
830
|
+
case 0:
|
|
831
|
+
url = "".concat(config.backendDomain, "/api/schedule/adminToken");
|
|
832
|
+
console.log('UrlString: ', url);
|
|
833
|
+
return [4 /*yield*/, axios.get(url)];
|
|
834
|
+
case 1:
|
|
835
|
+
res = _a.sent();
|
|
836
|
+
return [2 /*return*/, res.data];
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
function deleteUpdateAdminTokenSchedule() {
|
|
842
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
843
|
+
var url, res;
|
|
844
|
+
return __generator(this, function (_a) {
|
|
845
|
+
switch (_a.label) {
|
|
846
|
+
case 0:
|
|
847
|
+
url = "".concat(config.backendDomain, "/api/schedule/adminToken");
|
|
848
|
+
console.log('UrlString: ', url);
|
|
849
|
+
return [4 /*yield*/, axios.delete(url)];
|
|
850
|
+
case 1:
|
|
851
|
+
res = _a.sent();
|
|
852
|
+
return [2 /*return*/, res.data];
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
function generateAppleWalletPass(_a) {
|
|
858
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
859
|
+
var url, payload, res;
|
|
860
|
+
var id = _b.id, fullName = _b.fullName, birthDate = _b.birthDate;
|
|
861
|
+
return __generator(this, function (_c) {
|
|
862
|
+
switch (_c.label) {
|
|
863
|
+
case 0:
|
|
864
|
+
url = "".concat(config.backendDomain, "/api/pass/generateAppleWalletPass");
|
|
865
|
+
console.log('UrlString: ', url);
|
|
866
|
+
payload = { id: id, fullName: fullName, birthDate: birthDate };
|
|
867
|
+
return [4 /*yield*/, axios.post(url, payload, {
|
|
868
|
+
headers: {
|
|
869
|
+
'Content-Type': 'application/json',
|
|
870
|
+
}
|
|
871
|
+
})];
|
|
872
|
+
case 1:
|
|
873
|
+
res = _c.sent();
|
|
874
|
+
return [2 /*return*/, res.data];
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
function createSessionToken(_a) {
|
|
880
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
881
|
+
var url, res;
|
|
882
|
+
var apiKeyId = _b.apiKeyId, secretKey = _b.secretKey, redirectUrl = _b.redirectUrl;
|
|
883
|
+
return __generator(this, function (_c) {
|
|
884
|
+
switch (_c.label) {
|
|
885
|
+
case 0:
|
|
886
|
+
url = "".concat(config.backendDomain, "/api/thirdParty/createToken");
|
|
887
|
+
console.log('UrlString: ', url);
|
|
888
|
+
return [4 /*yield*/, axios.post(url, {
|
|
889
|
+
apiKeyId: apiKeyId,
|
|
890
|
+
secretKey: secretKey,
|
|
891
|
+
redirectUrl: redirectUrl,
|
|
892
|
+
})];
|
|
893
|
+
case 1:
|
|
894
|
+
res = _c.sent();
|
|
895
|
+
return [2 /*return*/, res.data];
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
function createAuthenticationLogs(_a) {
|
|
901
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
902
|
+
var url, res;
|
|
903
|
+
var actionType = _b.actionType, token = _b.token, userId = _b.userId, vender = _b.vender, os = _b.os, browser = _b.browser, device = _b.device, transactionId = _b.transactionId, incodeSessionId = _b.incodeSessionId, clearSessionId = _b.clearSessionId, isPass = _b.isPass;
|
|
904
|
+
return __generator(this, function (_c) {
|
|
905
|
+
switch (_c.label) {
|
|
906
|
+
case 0:
|
|
907
|
+
url = "".concat(config.backendDomain, "/api/authenticationLogs/create");
|
|
908
|
+
console.log('UrlString: ', url);
|
|
909
|
+
return [4 /*yield*/, axios.post(url, {
|
|
910
|
+
actionType: actionType,
|
|
911
|
+
token: token,
|
|
912
|
+
userId: userId,
|
|
913
|
+
provider: vender,
|
|
914
|
+
os: os,
|
|
915
|
+
browser: browser,
|
|
916
|
+
device: device,
|
|
917
|
+
transactionId: transactionId,
|
|
918
|
+
incodeSessionId: incodeSessionId,
|
|
919
|
+
clearSessionId: clearSessionId,
|
|
920
|
+
isPass: isPass
|
|
921
|
+
})];
|
|
922
|
+
case 1:
|
|
923
|
+
res = _c.sent();
|
|
924
|
+
return [2 /*return*/, res.data];
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
function updateAuthenticationLogs(_a) {
|
|
930
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
931
|
+
var url, res;
|
|
932
|
+
var isPass = _b.isPass, transactionId = _b.transactionId, incodeSessionId = _b.incodeSessionId, clearSessionId = _b.clearSessionId;
|
|
933
|
+
return __generator(this, function (_c) {
|
|
934
|
+
switch (_c.label) {
|
|
935
|
+
case 0:
|
|
936
|
+
url = "".concat(config.backendDomain, "/api/authenticationLogs/update");
|
|
937
|
+
console.log('UrlString: ', url);
|
|
938
|
+
return [4 /*yield*/, axios.post(url, {
|
|
939
|
+
isPass: isPass,
|
|
940
|
+
transactionId: transactionId,
|
|
941
|
+
incodeSessionId: incodeSessionId,
|
|
942
|
+
clearSessionId: clearSessionId
|
|
943
|
+
})];
|
|
944
|
+
case 1:
|
|
945
|
+
res = _c.sent();
|
|
946
|
+
return [2 /*return*/, res.data];
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
function createDeveloperLog(_a) {
|
|
952
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
953
|
+
var url, res, error_1;
|
|
954
|
+
var userId = _b.userId, sessionToken = _b.sessionToken, action = _b.action, firstDetail = _b.firstDetail, secondDetail = _b.secondDetail, userDataJson = _b.userDataJson, source = _b.source, browser = _b.browser;
|
|
955
|
+
return __generator(this, function (_c) {
|
|
956
|
+
switch (_c.label) {
|
|
957
|
+
case 0:
|
|
958
|
+
url = "".concat(config.backendDomain, "/api/developerLogs/create");
|
|
959
|
+
console.log('Requesting URL: ', url);
|
|
960
|
+
_c.label = 1;
|
|
961
|
+
case 1:
|
|
962
|
+
_c.trys.push([1, 3, , 4]);
|
|
963
|
+
return [4 /*yield*/, axios.post(url, {
|
|
964
|
+
userId: userId,
|
|
965
|
+
sessionToken: sessionToken,
|
|
966
|
+
action: action,
|
|
967
|
+
firstDetail: firstDetail,
|
|
968
|
+
secondDetail: secondDetail,
|
|
969
|
+
userDataJson: userDataJson,
|
|
970
|
+
source: source,
|
|
971
|
+
browser: browser,
|
|
972
|
+
}, {
|
|
973
|
+
headers: {
|
|
974
|
+
'developer-log-key': 'berifymedeveloperlogkey', // 替換為 API 所需的認證 key
|
|
975
|
+
},
|
|
976
|
+
})];
|
|
977
|
+
case 2:
|
|
978
|
+
res = _c.sent();
|
|
979
|
+
return [2 /*return*/, res.data];
|
|
980
|
+
case 3:
|
|
981
|
+
error_1 = _c.sent();
|
|
982
|
+
console.error('Error creating developer log:', error_1);
|
|
983
|
+
throw error_1;
|
|
984
|
+
case 4: return [2 /*return*/];
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
function checkAndIssueToken(_a) {
|
|
990
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
991
|
+
var url, res;
|
|
992
|
+
var userId = _b.userId;
|
|
993
|
+
return __generator(this, function (_c) {
|
|
994
|
+
switch (_c.label) {
|
|
995
|
+
case 0:
|
|
996
|
+
url = "".concat(config.backendDomain, "/api/blockchainToken/checkAndIssueToken");
|
|
997
|
+
return [4 /*yield*/, axios.post(url, { userId: userId })];
|
|
998
|
+
case 1:
|
|
999
|
+
res = _c.sent();
|
|
1000
|
+
return [2 /*return*/, res.data];
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
function getNFTToken(_a) {
|
|
1006
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1007
|
+
var url, res;
|
|
1008
|
+
var phoneNumber = _b.phoneNumber;
|
|
1009
|
+
return __generator(this, function (_c) {
|
|
1010
|
+
switch (_c.label) {
|
|
1011
|
+
case 0:
|
|
1012
|
+
url = "".concat(config.backendDomain, "/api/blockchainToken/getNFTToken");
|
|
1013
|
+
return [4 /*yield*/, axios.post(url, { phoneNumber: phoneNumber })];
|
|
1014
|
+
case 1:
|
|
1015
|
+
res = _c.sent();
|
|
1016
|
+
return [2 /*return*/, res.data];
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
function getWallet(_a) {
|
|
1022
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1023
|
+
var url, res;
|
|
1024
|
+
var phoneNumber = _b.phoneNumber;
|
|
1025
|
+
return __generator(this, function (_c) {
|
|
1026
|
+
switch (_c.label) {
|
|
1027
|
+
case 0:
|
|
1028
|
+
url = "".concat(config.backendDomain, "/api/wallet");
|
|
1029
|
+
return [4 /*yield*/, axios.post(url, { phoneNumber: phoneNumber })];
|
|
1030
|
+
case 1:
|
|
1031
|
+
res = _c.sent();
|
|
1032
|
+
return [2 /*return*/, res.data];
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
function createAccessToken(_a) {
|
|
1038
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1039
|
+
var url;
|
|
1040
|
+
var phoneNumber = _b.phoneNumber, levelName = _b.levelName;
|
|
1041
|
+
return __generator(this, function (_c) {
|
|
1042
|
+
url = "".concat(config.backendDomain, "/api/sumsub/accessToken");
|
|
1043
|
+
return [2 /*return*/, axios.post(url, { phoneNumber: phoneNumber, levelName: levelName })
|
|
1044
|
+
.then(function (res) {
|
|
1045
|
+
return res.data;
|
|
1046
|
+
})
|
|
1047
|
+
.catch(function (err) {
|
|
1048
|
+
var _a;
|
|
1049
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1050
|
+
})];
|
|
1051
|
+
});
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
function approveUserByPhoneNumber(_a) {
|
|
1055
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1056
|
+
var url;
|
|
1057
|
+
var phoneNumber = _b.phoneNumber;
|
|
1058
|
+
return __generator(this, function (_c) {
|
|
1059
|
+
url = "".concat(config.backendDomain, "/api/sumsub/approve");
|
|
1060
|
+
return [2 /*return*/, axios.post(url, { phoneNumber: phoneNumber })
|
|
1061
|
+
.then(function (res) {
|
|
1062
|
+
return res.data;
|
|
1063
|
+
})
|
|
1064
|
+
.catch(function (err) {
|
|
1065
|
+
var _a;
|
|
1066
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1067
|
+
})];
|
|
1068
|
+
});
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
function resetValidationStep(_a) {
|
|
1072
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1073
|
+
var url;
|
|
1074
|
+
var sumsubId = _b.sumsubId, idDocSetType = _b.idDocSetType;
|
|
1075
|
+
return __generator(this, function (_c) {
|
|
1076
|
+
url = "".concat(config.backendDomain, "/api/sumsub/resetValidationStep");
|
|
1077
|
+
return [2 /*return*/, axios.post(url, { sumsubId: sumsubId, idDocSetType: idDocSetType })
|
|
1078
|
+
.then(function (res) {
|
|
1079
|
+
return res.data;
|
|
1080
|
+
})
|
|
1081
|
+
.catch(function (err) {
|
|
1082
|
+
var _a;
|
|
1083
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1084
|
+
})];
|
|
1085
|
+
});
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
function getSumsubFaceLoginResult(_a) {
|
|
1089
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1090
|
+
var url;
|
|
1091
|
+
var sumsubId = _b.sumsubId, externalActionId = _b.externalActionId;
|
|
1092
|
+
return __generator(this, function (_c) {
|
|
1093
|
+
url = "".concat(config.backendDomain, "/api/sumsub/getFaceLoginResult");
|
|
1094
|
+
return [2 /*return*/, axios.get(url, { params: { sumsubId: sumsubId, externalActionId: externalActionId } })
|
|
1095
|
+
.then(function (res) {
|
|
1096
|
+
return res.data;
|
|
1097
|
+
})
|
|
1098
|
+
.catch(function (err) {
|
|
1099
|
+
var _a;
|
|
1100
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1101
|
+
})];
|
|
1102
|
+
});
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
function getUserBySumsubId(_a) {
|
|
1106
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1107
|
+
var url;
|
|
1108
|
+
var sumsubId = _b.sumsubId;
|
|
1109
|
+
return __generator(this, function (_c) {
|
|
1110
|
+
url = "".concat(config.backendDomain, "/api/user/getUserBySumsubId");
|
|
1111
|
+
return [2 /*return*/, axios.get(url, { params: { sumsubId: sumsubId } })
|
|
1112
|
+
.then(function (res) {
|
|
1113
|
+
return res.data;
|
|
1114
|
+
})
|
|
1115
|
+
.catch(function (err) {
|
|
1116
|
+
var _a;
|
|
1117
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1118
|
+
})];
|
|
1119
|
+
});
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
function approveVeriffUserByPhoneNumber(_a) {
|
|
1123
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1124
|
+
var url;
|
|
1125
|
+
var phoneNumber = _b.phoneNumber, sessionId = _b.sessionId;
|
|
1126
|
+
return __generator(this, function (_c) {
|
|
1127
|
+
url = "".concat(config.backendDomain, "/api/veriff/approve");
|
|
1128
|
+
return [2 /*return*/, axios.post(url, { phoneNumber: phoneNumber, sessionId: sessionId })
|
|
1129
|
+
.then(function (res) {
|
|
1130
|
+
return res.data;
|
|
1131
|
+
})
|
|
1132
|
+
.catch(function (err) {
|
|
1133
|
+
var _a;
|
|
1134
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1135
|
+
})];
|
|
1136
|
+
});
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
function getUserByVeriffId(_a) {
|
|
1140
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1141
|
+
var url;
|
|
1142
|
+
var veriffId = _b.veriffId;
|
|
1143
|
+
return __generator(this, function (_c) {
|
|
1144
|
+
url = "".concat(config.backendDomain, "/api/user/getUserByVeriffId");
|
|
1145
|
+
return [2 /*return*/, axios.get(url, { params: { veriffId: veriffId } })
|
|
1146
|
+
.then(function (res) {
|
|
1147
|
+
return res.data;
|
|
1148
|
+
})
|
|
1149
|
+
.catch(function (err) {
|
|
1150
|
+
var _a;
|
|
1151
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1152
|
+
})];
|
|
1153
|
+
});
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
function getVeriffFaceLoginResult(_a) {
|
|
1157
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1158
|
+
var url;
|
|
1159
|
+
var sessionId = _b.sessionId;
|
|
1160
|
+
return __generator(this, function (_c) {
|
|
1161
|
+
url = "".concat(config.backendDomain, "/api/veriff/getFaceLoginResult");
|
|
1162
|
+
return [2 /*return*/, axios.get(url, { params: { sessionId: sessionId } })
|
|
1163
|
+
.then(function (res) {
|
|
1164
|
+
return res.data;
|
|
1165
|
+
})
|
|
1166
|
+
.catch(function (err) {
|
|
1167
|
+
var _a;
|
|
1168
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1169
|
+
})];
|
|
1170
|
+
});
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
function getOrderByCountry(_a) {
|
|
1174
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1175
|
+
var url, res;
|
|
1176
|
+
var countryCode = _b.countryCode;
|
|
1177
|
+
return __generator(this, function (_c) {
|
|
1178
|
+
switch (_c.label) {
|
|
1179
|
+
case 0:
|
|
1180
|
+
url = "".concat(config.backendDomain, "/api/getOrderByCountry?code=").concat(countryCode);
|
|
1181
|
+
return [4 /*yield*/, axios.get(url)];
|
|
1182
|
+
case 1:
|
|
1183
|
+
res = _c.sent();
|
|
1184
|
+
return [2 /*return*/, res.data];
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
function createYotiSession(_a) {
|
|
1190
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1191
|
+
var url;
|
|
1192
|
+
var phoneNumber = _b.phoneNumber;
|
|
1193
|
+
return __generator(this, function (_c) {
|
|
1194
|
+
url = "".concat(config.backendDomain, "/api/yoti/session");
|
|
1195
|
+
return [2 /*return*/, axios.post(url, { phoneNumber: phoneNumber })
|
|
1196
|
+
.then(function (res) {
|
|
1197
|
+
return res.data;
|
|
1198
|
+
})
|
|
1199
|
+
.catch(function (err) {
|
|
1200
|
+
var _a;
|
|
1201
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1202
|
+
})];
|
|
1203
|
+
});
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
function approveYotiUser(_a) {
|
|
1207
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1208
|
+
var url;
|
|
1209
|
+
var sessionId = _b.sessionId;
|
|
1210
|
+
return __generator(this, function (_c) {
|
|
1211
|
+
url = "".concat(config.backendDomain, "/api/yoti/approve");
|
|
1212
|
+
return [2 /*return*/, axios.post(url, { sessionId: sessionId })
|
|
1213
|
+
.then(function (res) {
|
|
1214
|
+
return res.data;
|
|
1215
|
+
})
|
|
1216
|
+
.catch(function (err) {
|
|
1217
|
+
var _a;
|
|
1218
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1219
|
+
})];
|
|
1220
|
+
});
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
function getUserByYotiId(_a) {
|
|
1224
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
1225
|
+
var url;
|
|
1226
|
+
var yotiId = _b.yotiId;
|
|
1227
|
+
return __generator(this, function (_c) {
|
|
1228
|
+
url = "".concat(config.backendDomain, "/api/user/getUserByYotiId");
|
|
1229
|
+
return [2 /*return*/, axios.get(url, { params: { yotiId: yotiId } })
|
|
1230
|
+
.then(function (res) {
|
|
1231
|
+
return res.data;
|
|
1232
|
+
})
|
|
1233
|
+
.catch(function (err) {
|
|
1234
|
+
var _a;
|
|
1235
|
+
return (_a = err.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
1236
|
+
})];
|
|
1237
|
+
});
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
var berifymeApi = {
|
|
1241
|
+
authID: {
|
|
1242
|
+
getAuthIDToken: getAuthIDToken,
|
|
1243
|
+
getIdDocumentTypes: getIdDocumentTypes,
|
|
1244
|
+
createAccount: createAccount,
|
|
1245
|
+
checkBiometricExist: checkBiometricExist,
|
|
1246
|
+
proofUser: proofUser,
|
|
1247
|
+
getProofTransactionStatus: getProofTransactionStatus,
|
|
1248
|
+
getProofTransactionTempId: getProofTransactionTempId,
|
|
1249
|
+
createBiometricFromProof: createBiometricFromProof,
|
|
1250
|
+
getAccount: getAccount,
|
|
1251
|
+
createLoginTransaction: createLoginTransaction,
|
|
1252
|
+
getTransactionStatus: getTransactionStatus,
|
|
1253
|
+
getOperationStatus: getOperationStatus,
|
|
1254
|
+
searchUser: searchUser,
|
|
1255
|
+
getDocumentDetails: getDocumentDetails,
|
|
1256
|
+
updateAccount: updateAccount
|
|
1257
|
+
},
|
|
1258
|
+
incode: {
|
|
1259
|
+
getIncodeStart: getIncodeStart,
|
|
1260
|
+
getIncodeFinish: getIncodeFinish,
|
|
1261
|
+
getIncodeApprove: getIncodeApprove,
|
|
1262
|
+
},
|
|
1263
|
+
clear: {
|
|
1264
|
+
createVerificationSession: createVerificationSession,
|
|
1265
|
+
getClearApprove: getClearApprove,
|
|
1266
|
+
},
|
|
1267
|
+
idme: {
|
|
1268
|
+
createIdmeVerificationUrl: createIdmeVerificationUrl,
|
|
1269
|
+
sendIdmePhoneNumberVerify: sendIdmePhoneNumberVerify,
|
|
1270
|
+
getIdmeApprove: getIdmeApprove,
|
|
1271
|
+
updateIdmeId: updateIdmeId,
|
|
1272
|
+
},
|
|
1273
|
+
auth: {
|
|
1274
|
+
sendVerifyEmail: sendVerifyEmail,
|
|
1275
|
+
sendPhoneNumberCode: sendPhoneNumberCode,
|
|
1276
|
+
sendPhoneNumberVerify: sendPhoneNumberVerify,
|
|
1277
|
+
verify: verify,
|
|
1278
|
+
},
|
|
1279
|
+
user: {
|
|
1280
|
+
getUserByCode: getUserByCode,
|
|
1281
|
+
getUserBySessionId: getUserBySessionId,
|
|
1282
|
+
getUserByIncodeId: getUserByIncodeId,
|
|
1283
|
+
getUserByClearId: getUserByClearId,
|
|
1284
|
+
getUserBySumsubId: getUserBySumsubId,
|
|
1285
|
+
getUserByYotiId: getUserByYotiId,
|
|
1286
|
+
getUserVenderByPhone: getUserVenderByPhone,
|
|
1287
|
+
getUserByPhoneNumberAndVerifyCode: getUserByPhoneNumberAndVerifyCode,
|
|
1288
|
+
uploadDeviceId: uploadDeviceId,
|
|
1289
|
+
checkDeviceId: checkDeviceId,
|
|
1290
|
+
checkBlockchainToken: checkBlockchainToken,
|
|
1291
|
+
},
|
|
1292
|
+
thirdParty: {
|
|
1293
|
+
getRedirectUrl: getRedirectUrl,
|
|
1294
|
+
checkThirdPartyVerificationToken: checkThirdPartyVerificationToken,
|
|
1295
|
+
},
|
|
1296
|
+
scheduld: {
|
|
1297
|
+
initUpdateAdminTokenSchedule: initUpdateAdminTokenSchedule,
|
|
1298
|
+
deleteUpdateAdminTokenSchedule: deleteUpdateAdminTokenSchedule,
|
|
1299
|
+
},
|
|
1300
|
+
pass: {
|
|
1301
|
+
generateAppleWalletPass: generateAppleWalletPass,
|
|
1302
|
+
},
|
|
1303
|
+
tools: {
|
|
1304
|
+
createSessionToken: createSessionToken,
|
|
1305
|
+
},
|
|
1306
|
+
AuthenticationLogs: {
|
|
1307
|
+
createAuthenticationLogs: createAuthenticationLogs,
|
|
1308
|
+
updateAuthenticationLogs: updateAuthenticationLogs
|
|
1309
|
+
},
|
|
1310
|
+
developerLogs: {
|
|
1311
|
+
createDeveloperLog: createDeveloperLog,
|
|
1312
|
+
},
|
|
1313
|
+
blockchain: {
|
|
1314
|
+
checkAndIssueToken: checkAndIssueToken,
|
|
1315
|
+
getNFTToken: getNFTToken
|
|
1316
|
+
},
|
|
1317
|
+
wallet: {
|
|
1318
|
+
getWallet: getWallet,
|
|
1319
|
+
},
|
|
1320
|
+
sumsub: {
|
|
1321
|
+
createAccessToken: createAccessToken,
|
|
1322
|
+
approveUserByPhoneNumber: approveUserByPhoneNumber,
|
|
1323
|
+
resetValidationStep: resetValidationStep,
|
|
1324
|
+
getSumsubFaceLoginResult: getSumsubFaceLoginResult
|
|
1325
|
+
},
|
|
1326
|
+
veriff: {
|
|
1327
|
+
approveVeriffUserByPhoneNumber: approveVeriffUserByPhoneNumber,
|
|
1328
|
+
getUserByVeriffId: getUserByVeriffId,
|
|
1329
|
+
getVeriffFaceLoginResult: getVeriffFaceLoginResult
|
|
1330
|
+
},
|
|
1331
|
+
yoti: {
|
|
1332
|
+
createYotiSession: createYotiSession,
|
|
1333
|
+
approveYotiUser: approveYotiUser
|
|
1334
|
+
},
|
|
1335
|
+
getOrderByCountry: getOrderByCountry,
|
|
1336
|
+
};
|
|
1337
|
+
export default berifymeApi;
|