@bytexbyte/ike-app-api 1.0.67 → 1.0.69
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/lib/Auth/index.d.ts +13 -0
- package/lib/Auth/index.js +19 -0
- package/lib/Auth/type.d.ts +2 -2
- package/lib/Incode/index.d.ts +16 -1
- package/lib/Incode/index.js +60 -0
- package/lib/Incode/type.d.ts +5 -0
- package/package.json +1 -1
package/lib/Auth/index.d.ts
CHANGED
|
@@ -178,6 +178,19 @@ declare class IKEAppAuthApi extends BxBApi {
|
|
|
178
178
|
} | {
|
|
179
179
|
error: 'Phone number is required.';
|
|
180
180
|
}>;
|
|
181
|
+
signUp(provider: 'email-password', form: {
|
|
182
|
+
email: string;
|
|
183
|
+
phone: string;
|
|
184
|
+
firstName: string;
|
|
185
|
+
lastName: string;
|
|
186
|
+
password: string;
|
|
187
|
+
}): Promise<{
|
|
188
|
+
id: string;
|
|
189
|
+
error?: undefined;
|
|
190
|
+
} | {
|
|
191
|
+
id?: undefined;
|
|
192
|
+
error: 'Field(s) cannot be empty.' | 'user already created.' | 'Password requires at least 8 characters.' | 'Password requires one upper case and lower case letter' | 'Password must be in ASCII characters.' | 'Password requires at least one number';
|
|
193
|
+
}>;
|
|
181
194
|
getWebAuthnAuthenticationOptions(body: {
|
|
182
195
|
phoneNumber: string;
|
|
183
196
|
expectedRPID?: string;
|
package/lib/Auth/index.js
CHANGED
|
@@ -445,6 +445,25 @@ var IKEAppAuthApi = /** @class */ (function (_super) {
|
|
|
445
445
|
});
|
|
446
446
|
});
|
|
447
447
|
};
|
|
448
|
+
IKEAppAuthApi.prototype.signUp = function (provider, form) {
|
|
449
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
450
|
+
var response;
|
|
451
|
+
return __generator(this, function (_a) {
|
|
452
|
+
switch (_a.label) {
|
|
453
|
+
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
454
|
+
method: 'POST',
|
|
455
|
+
headers: {
|
|
456
|
+
'Content-Type': 'application/json',
|
|
457
|
+
},
|
|
458
|
+
body: JSON.stringify(form),
|
|
459
|
+
}, "sign-up/".concat(provider))];
|
|
460
|
+
case 1:
|
|
461
|
+
response = _a.sent();
|
|
462
|
+
return [2 /*return*/, response.json()];
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
};
|
|
448
467
|
IKEAppAuthApi.prototype.getWebAuthnAuthenticationOptions = function (body) {
|
|
449
468
|
return __awaiter(this, void 0, void 0, function () {
|
|
450
469
|
var response;
|
package/lib/Auth/type.d.ts
CHANGED
|
@@ -106,8 +106,8 @@ export declare type SignInPhoneBiometrics = (provider: 'phone-biometrics', form:
|
|
|
106
106
|
export declare type SignInPhoneWebAuthn = (provider: 'phone-webauthn', form: {
|
|
107
107
|
phone: string;
|
|
108
108
|
authResp: any;
|
|
109
|
-
expectedOrigin
|
|
110
|
-
expectedRPID
|
|
109
|
+
expectedOrigin?: string;
|
|
110
|
+
expectedRPID?: string;
|
|
111
111
|
csrfToken?: string;
|
|
112
112
|
}) => Promise<{
|
|
113
113
|
id: string;
|
package/lib/Incode/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BxBApi from '@bytexbyte/bxb-api';
|
|
2
|
-
import { GetOcrDataBody } from './type';
|
|
2
|
+
import { GetOcrDataBody, Session } from './type';
|
|
3
3
|
declare class IKEAppIncodeApi extends BxBApi {
|
|
4
4
|
constructor({ host, secretKey, secret, onSuccess, onError, }: {
|
|
5
5
|
host: string;
|
|
@@ -9,5 +9,20 @@ declare class IKEAppIncodeApi extends BxBApi {
|
|
|
9
9
|
onError?: (error: any) => void;
|
|
10
10
|
});
|
|
11
11
|
getOcrData(form: GetOcrDataBody): Promise<any>;
|
|
12
|
+
start(): Promise<Session>;
|
|
13
|
+
finish({ token }: {
|
|
14
|
+
token: string;
|
|
15
|
+
}): Promise<Session | {
|
|
16
|
+
error: 'Missing required parameter token';
|
|
17
|
+
}>;
|
|
18
|
+
approve({ id, token, uniqueId, }: {
|
|
19
|
+
id: string;
|
|
20
|
+
token: string;
|
|
21
|
+
uniqueId: string;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
incodeId: string;
|
|
24
|
+
} | {
|
|
25
|
+
error: 'Field(s) cannot be empty.';
|
|
26
|
+
}>;
|
|
12
27
|
}
|
|
13
28
|
export default IKEAppIncodeApi;
|
package/lib/Incode/index.js
CHANGED
|
@@ -86,6 +86,66 @@ var IKEAppIncodeApi = /** @class */ (function (_super) {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
|
+
IKEAppIncodeApi.prototype.start = function () {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
var response;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
95
|
+
method: 'GET',
|
|
96
|
+
headers: {
|
|
97
|
+
'Content-Type': 'application/json',
|
|
98
|
+
},
|
|
99
|
+
}, "start")];
|
|
100
|
+
case 1:
|
|
101
|
+
response = _a.sent();
|
|
102
|
+
return [2 /*return*/, response.json()];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
IKEAppIncodeApi.prototype.finish = function (_a) {
|
|
108
|
+
var token = _a.token;
|
|
109
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
+
var params, response;
|
|
111
|
+
return __generator(this, function (_b) {
|
|
112
|
+
switch (_b.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
params = new URLSearchParams({ token: token });
|
|
115
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
116
|
+
method: 'GET',
|
|
117
|
+
headers: {
|
|
118
|
+
'Content-Type': 'application/json',
|
|
119
|
+
},
|
|
120
|
+
}, "finish?".concat(params.toString()))];
|
|
121
|
+
case 1:
|
|
122
|
+
response = _b.sent();
|
|
123
|
+
return [2 /*return*/, response.json()];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
IKEAppIncodeApi.prototype.approve = function (_a) {
|
|
129
|
+
var id = _a.id, token = _a.token, uniqueId = _a.uniqueId;
|
|
130
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
131
|
+
var params, response;
|
|
132
|
+
return __generator(this, function (_b) {
|
|
133
|
+
switch (_b.label) {
|
|
134
|
+
case 0:
|
|
135
|
+
params = new URLSearchParams({ id: id, token: token, uniqueId: uniqueId });
|
|
136
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
137
|
+
method: 'GET',
|
|
138
|
+
headers: {
|
|
139
|
+
'Content-Type': 'application/json',
|
|
140
|
+
},
|
|
141
|
+
}, "approve?".concat(params.toString()))];
|
|
142
|
+
case 1:
|
|
143
|
+
response = _b.sent();
|
|
144
|
+
return [2 /*return*/, response.json()];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
};
|
|
89
149
|
return IKEAppIncodeApi;
|
|
90
150
|
}(bxb_api_1.default));
|
|
91
151
|
exports.default = IKEAppIncodeApi;
|
package/lib/Incode/type.d.ts
CHANGED