@bytexbyte/ike-app-api 1.0.81 → 1.0.83

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/App.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- declare type GetVersionResult = {
2
+ type GetVersionResult = {
3
3
  version: string;
4
4
  };
5
- declare type GetMaintenanceVersionResult = {
5
+ type GetMaintenanceVersionResult = {
6
6
  version: string;
7
7
  };
8
- declare type GetCheckNetwork = {
8
+ type GetCheckNetwork = {
9
9
  message: string;
10
10
  };
11
- declare type GetConfig = {
11
+ type GetConfig = {
12
12
  isRewardEnabled: boolean;
13
13
  };
14
14
  declare class IKEAppApi extends BxBApi {
package/lib/App.js CHANGED
@@ -35,12 +35,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35
35
  });
36
36
  };
37
37
  var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
39
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
43
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
44
44
  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;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -1,6 +1,6 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
2
  import { SignInAppleMobile, SignInEmailBiometrics, SignInEmailPassword, SignInFacebookMobile, SignInGoogleAndroid, SignInGoogleIos, SignInKyc, SignInPhoneBiometrics, SignInPhoneOTP, SignInPhoneWebAuthn } from './type';
3
- declare type User = {
3
+ type User = {
4
4
  id: string;
5
5
  image: string | null;
6
6
  email: string | null;
@@ -18,7 +18,7 @@ declare type User = {
18
18
  isAgeVerified: boolean;
19
19
  incodeId: string | null;
20
20
  };
21
- declare type Session = {
21
+ type Session = {
22
22
  expires?: Date;
23
23
  user?: User;
24
24
  };
@@ -173,14 +173,6 @@ declare class IKEAppAuthApi extends BxBApi {
173
173
  } | {
174
174
  error: 'Field(s) cannot be empty.' | 'User not found.';
175
175
  }>;
176
- /** Incode age estimation (face) flow completed in Link app; session user must match `userId`. Sets `isAgeVerified` on the server. */
177
- confirmAgeEstimationComplete(body: {
178
- userId: string;
179
- }): Promise<{
180
- success: true;
181
- } | {
182
- error: 'Field(s) cannot be empty.' | 'You are not logged in.' | 'You cannot make changes to this user.' | 'User not found.';
183
- }>;
184
176
  isPhoneExisted(body: {
185
177
  phone: string;
186
178
  }): Promise<{
package/lib/Auth/index.js CHANGED
@@ -35,12 +35,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35
35
  });
36
36
  };
37
37
  var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
39
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
43
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
44
44
  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;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -426,26 +426,6 @@ var IKEAppAuthApi = /** @class */ (function (_super) {
426
426
  });
427
427
  });
428
428
  };
429
- /** Incode age estimation (face) flow completed in Link app; session user must match `userId`. Sets `isAgeVerified` on the server. */
430
- IKEAppAuthApi.prototype.confirmAgeEstimationComplete = function (body) {
431
- return __awaiter(this, void 0, void 0, function () {
432
- var response;
433
- return __generator(this, function (_a) {
434
- switch (_a.label) {
435
- case 0: return [4 /*yield*/, this.bxbFetch({
436
- method: 'POST',
437
- headers: {
438
- 'Content-Type': 'application/json',
439
- },
440
- body: JSON.stringify(body),
441
- }, "verify/age-estimation-complete")];
442
- case 1:
443
- response = _a.sent();
444
- return [2 /*return*/, response.json()];
445
- }
446
- });
447
- });
448
- };
449
429
  IKEAppAuthApi.prototype.isPhoneExisted = function (body) {
450
430
  return __awaiter(this, void 0, void 0, function () {
451
431
  var response;
@@ -1,4 +1,4 @@
1
- export declare type SignInEmailPassword = (provider: 'email-password', form: {
1
+ export type SignInEmailPassword = (provider: 'email-password', form: {
2
2
  email: string;
3
3
  password: string;
4
4
  csrfToken?: string;
@@ -9,7 +9,7 @@ export declare type SignInEmailPassword = (provider: 'email-password', form: {
9
9
  id?: undefined;
10
10
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'Email not found.' | 'Email not verified.' | 'Email associated with third-party login.' | 'Password incorrect.' | 'URL not found.';
11
11
  }>;
12
- export declare type SignInGoogleIos = (provider: 'google-ios', form: {
12
+ export type SignInGoogleIos = (provider: 'google-ios', form: {
13
13
  scope: string;
14
14
  token: string;
15
15
  csrfToken?: string;
@@ -20,7 +20,7 @@ export declare type SignInGoogleIos = (provider: 'google-ios', form: {
20
20
  id?: undefined;
21
21
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'URL not found.';
22
22
  }>;
23
- export declare type SignInGoogleAndroid = (provider: 'google-android', form: {
23
+ export type SignInGoogleAndroid = (provider: 'google-android', form: {
24
24
  scope: string;
25
25
  token: string;
26
26
  csrfToken?: string;
@@ -31,7 +31,7 @@ export declare type SignInGoogleAndroid = (provider: 'google-android', form: {
31
31
  id?: undefined;
32
32
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'URL not found.';
33
33
  }>;
34
- export declare type SignInFacebookMobile = (provider: 'facebook-mobile', form: {
34
+ export type SignInFacebookMobile = (provider: 'facebook-mobile', form: {
35
35
  scope: string;
36
36
  token: string;
37
37
  expires_at: string;
@@ -43,7 +43,7 @@ export declare type SignInFacebookMobile = (provider: 'facebook-mobile', form: {
43
43
  id?: undefined;
44
44
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'payload error.' | 'URL not found.';
45
45
  }>;
46
- export declare type SignInAppleMobile = (provider: 'apple-mobile', form: {
46
+ export type SignInAppleMobile = (provider: 'apple-mobile', form: {
47
47
  token: string;
48
48
  account_token: string;
49
49
  providerAccountId: string;
@@ -58,7 +58,7 @@ export declare type SignInAppleMobile = (provider: 'apple-mobile', form: {
58
58
  id?: undefined;
59
59
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'URL not found.';
60
60
  }>;
61
- export declare type SignInEmailBiometrics = (provider: 'email-biometrics', form: {
61
+ export type SignInEmailBiometrics = (provider: 'email-biometrics', form: {
62
62
  publicKey: string;
63
63
  id: string;
64
64
  signature: string;
@@ -70,7 +70,7 @@ export declare type SignInEmailBiometrics = (provider: 'email-biometrics', form:
70
70
  id?: undefined;
71
71
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'id not found.' | 'Email not verified.' | 'Sign in to turn on biometrics.' | 'New device login requires password credentials.' | 'signature error.' | 'URL not found.';
72
72
  }>;
73
- export declare type SignInKyc = (provider: 'kyc', form: {
73
+ export type SignInKyc = (provider: 'kyc', form: {
74
74
  kycId: string;
75
75
  firstName: string;
76
76
  lastName: string;
@@ -82,7 +82,7 @@ export declare type SignInKyc = (provider: 'kyc', form: {
82
82
  id?: undefined;
83
83
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'KYC ID not verified.' | 'signature error.' | 'URL not found.';
84
84
  }>;
85
- export declare type SignInPhoneOTP = (provider: 'phone-otp', form: {
85
+ export type SignInPhoneOTP = (provider: 'phone-otp', form: {
86
86
  phone: string;
87
87
  code: string;
88
88
  csrfToken?: string;
@@ -92,7 +92,7 @@ export declare type SignInPhoneOTP = (provider: 'phone-otp', form: {
92
92
  } | {
93
93
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'OTP incorrect';
94
94
  }>;
95
- export declare type SignInPhoneBiometrics = (provider: 'phone-biometrics', form: {
95
+ export type SignInPhoneBiometrics = (provider: 'phone-biometrics', form: {
96
96
  publicKey: string;
97
97
  id: string;
98
98
  signature: string;
@@ -103,7 +103,7 @@ export declare type SignInPhoneBiometrics = (provider: 'phone-biometrics', form:
103
103
  } | {
104
104
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'id not found.' | 'Sign in to turn on biometrics.' | 'New device login requires password credentials.' | 'signature error.' | 'URL not found.';
105
105
  }>;
106
- export declare type SignInPhoneWebAuthn = (provider: 'phone-webauthn', form: {
106
+ export type SignInPhoneWebAuthn = (provider: 'phone-webauthn', form: {
107
107
  phone: string;
108
108
  authResp: any;
109
109
  expectedOrigin?: string;
@@ -115,4 +115,4 @@ export declare type SignInPhoneWebAuthn = (provider: 'phone-webauthn', form: {
115
115
  } | {
116
116
  error: 'Authentication error.' | 'Field(s) cannot be empty.' | 'User not found.' | 'Authenticator not found.' | 'Authentication verification failed.';
117
117
  }>;
118
- export declare type SignIn = SignInEmailPassword | SignInGoogleIos | SignInGoogleAndroid | SignInFacebookMobile | SignInAppleMobile | SignInEmailBiometrics | SignInKyc | SignInPhoneOTP | SignInPhoneBiometrics | SignInPhoneWebAuthn;
118
+ export type SignIn = SignInEmailPassword | SignInGoogleIos | SignInGoogleAndroid | SignInFacebookMobile | SignInAppleMobile | SignInEmailBiometrics | SignInKyc | SignInPhoneOTP | SignInPhoneBiometrics | SignInPhoneWebAuthn;
@@ -1,9 +1,9 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
2
  import { ikeApi } from '../config';
3
- declare type PutBody = Parameters<typeof ikeApi.batch.assignToMember>[1];
4
- declare type PutResult = Awaited<ReturnType<typeof ikeApi.batch.assignToMember>>;
5
- declare type RenamePutBody = Parameters<typeof ikeApi.batch.rename>[1];
6
- declare type RenamePutResult = Awaited<ReturnType<typeof ikeApi.batch.rename>>;
3
+ type PutBody = Parameters<typeof ikeApi.batch.assignToMember>[1];
4
+ type PutResult = Awaited<ReturnType<typeof ikeApi.batch.assignToMember>>;
5
+ type RenamePutBody = Parameters<typeof ikeApi.batch.rename>[1];
6
+ type RenamePutResult = Awaited<ReturnType<typeof ikeApi.batch.rename>>;
7
7
  declare enum ScanningStatusType {
8
8
  LOADING = 0,
9
9
  EMPTY = 1,
@@ -25,12 +25,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
25
25
  });
26
26
  };
27
27
  var __generator = (this && this.__generator) || function (thisArg, body) {
28
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
29
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
29
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
30
30
  function verb(n) { return function (v) { return step([n, v]); }; }
31
31
  function step(op) {
32
32
  if (f) throw new TypeError("Generator is already executing.");
33
- while (_) try {
33
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
34
34
  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;
35
35
  if (y = 0, t) op = [op[0] & 2, t.value];
36
36
  switch (op[0]) {
@@ -1,7 +1,7 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
2
  import { BleConnectionErrorLog } from '../types';
3
- declare type BleConnectionErrorLogBody = Pick<BleConnectionErrorLog, 'title' | 'detail'>;
4
- declare type BleConnectionErrorLogResult = {
3
+ type BleConnectionErrorLogBody = Pick<BleConnectionErrorLog, 'title' | 'detail'>;
4
+ type BleConnectionErrorLogResult = {
5
5
  bleConnectionErrorLog: BleConnectionErrorLog;
6
6
  error?: undefined;
7
7
  } | {
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  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;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -25,12 +25,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
25
25
  });
26
26
  };
27
27
  var __generator = (this && this.__generator) || function (thisArg, body) {
28
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
29
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
29
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
30
30
  function verb(n) { return function (v) { return step([n, v]); }; }
31
31
  function step(op) {
32
32
  if (f) throw new TypeError("Generator is already executing.");
33
- while (_) try {
33
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
34
34
  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;
35
35
  if (y = 0, t) op = [op[0] & 2, t.value];
36
36
  switch (op[0]) {
@@ -1,16 +1,16 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
2
  import { ShopifyProductType } from './shopifyType';
3
- declare type GetShopifyResult = {
3
+ type GetShopifyResult = {
4
4
  shopifyStore: {
5
5
  name: string;
6
6
  };
7
7
  shopifyProducts: ShopifyProductType[];
8
8
  } | null;
9
- declare type CreateDraftOrderResult = {
9
+ type CreateDraftOrderResult = {
10
10
  invoice_url?: string;
11
11
  error?: 'Digital customization id is missing.' | 'Store access token not found.' | 'Draft order id not found.' | 'Unkown error.';
12
12
  };
13
- declare type PayReferralPointResult = {
13
+ type PayReferralPointResult = {
14
14
  success: boolean;
15
15
  error?: 'pay point failed.' | 'Missing digitalCustomizationId.';
16
16
  };
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  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;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -4,7 +4,7 @@ exports.decodeBase64 = exports.getUploadFileStr = exports.UPLOAD_FILE_TYPE = voi
4
4
  var UPLOAD_FILE_TYPE;
5
5
  (function (UPLOAD_FILE_TYPE) {
6
6
  UPLOAD_FILE_TYPE[UPLOAD_FILE_TYPE["GENERAL_USER_IMAGE"] = 0] = "GENERAL_USER_IMAGE";
7
- })(UPLOAD_FILE_TYPE = exports.UPLOAD_FILE_TYPE || (exports.UPLOAD_FILE_TYPE = {}));
7
+ })(UPLOAD_FILE_TYPE || (exports.UPLOAD_FILE_TYPE = UPLOAD_FILE_TYPE = {}));
8
8
  var getUploadFileStr = function (type) {
9
9
  var GENERAL_USER_IMAGE = UPLOAD_FILE_TYPE.GENERAL_USER_IMAGE;
10
10
  switch (type) {
@@ -1,8 +1,8 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- declare type S3UploadBody = {
2
+ type S3UploadBody = {
3
3
  name: string;
4
4
  };
5
- declare type S3UploadResult = {
5
+ type S3UploadResult = {
6
6
  downloadUrl: string;
7
7
  url: string;
8
8
  error?: undefined;
@@ -11,10 +11,10 @@ declare type S3UploadResult = {
11
11
  url?: undefined;
12
12
  error: 'session not found.';
13
13
  };
14
- declare type UploadToS3Result = {
14
+ type UploadToS3Result = {
15
15
  status: number;
16
16
  };
17
- declare type UploadResult = {
17
+ type UploadResult = {
18
18
  url: string;
19
19
  error?: undefined;
20
20
  } | {
package/lib/File/index.js CHANGED
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  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;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -69,11 +69,11 @@ var IKEAppFileApi = /** @class */ (function (_super) {
69
69
  }) || this;
70
70
  }
71
71
  IKEAppFileApi.prototype.getS3UploadUrl = function (_a) {
72
- var name = _a.name;
73
- return __awaiter(this, void 0, void 0, function () {
72
+ return __awaiter(this, arguments, void 0, function (_b) {
74
73
  var response;
75
- return __generator(this, function (_b) {
76
- switch (_b.label) {
74
+ var name = _b.name;
75
+ return __generator(this, function (_c) {
76
+ switch (_c.label) {
77
77
  case 0: return [4 /*yield*/, this.bxbFetch({
78
78
  method: 'POST',
79
79
  headers: {
@@ -84,7 +84,7 @@ var IKEAppFileApi = /** @class */ (function (_super) {
84
84
  }),
85
85
  })];
86
86
  case 1:
87
- response = _b.sent();
87
+ response = _c.sent();
88
88
  return [2 /*return*/, response.json()];
89
89
  }
90
90
  });
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  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;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -1,25 +1,25 @@
1
- export declare type CreateInAppNotificationResult = {
1
+ export type CreateInAppNotificationResult = {
2
2
  success: 'ok';
3
3
  } | {
4
4
  error: 'You are not authorized to call this API.' | 'Type is required.' | 'UserId is required.' | 'PushNotificationId is required.';
5
5
  };
6
- export declare type PutInAppNotificationsResult = {
6
+ export type PutInAppNotificationsResult = {
7
7
  success: 'ok';
8
8
  error?: undefined;
9
9
  } | {
10
10
  success?: undefined;
11
11
  error: 'You are not authorized to call this API.';
12
12
  };
13
- export declare type DeleteInAppNotificationsResult = PutInAppNotificationsResult;
14
- export declare type PutInAppNotificationResult = PutInAppNotificationsResult | {
13
+ export type DeleteInAppNotificationsResult = PutInAppNotificationsResult;
14
+ export type PutInAppNotificationResult = PutInAppNotificationsResult | {
15
15
  error: 'Id is required.';
16
16
  };
17
- export declare type DeleteInAppNotificationResult = PutInAppNotificationResult;
18
- export declare type CheckReadedInAppNotificationsResult = {
17
+ export type DeleteInAppNotificationResult = PutInAppNotificationResult;
18
+ export type CheckReadedInAppNotificationsResult = {
19
19
  isAllRead: boolean;
20
20
  error?: undefined;
21
21
  } | {
22
22
  isAllRead?: undefined;
23
23
  error: 'You are not authorized to call this API.';
24
24
  };
25
- export declare type InAppNotificationType = 'pushNotification';
25
+ export type InAppNotificationType = 'pushNotification';
@@ -10,20 +10,33 @@ declare class IKEAppIncodeApi extends BxBApi {
10
10
  onError?: (error: any) => void;
11
11
  });
12
12
  getOcrData(form: GetOcrDataBody): Promise<any>;
13
- start(): Promise<Session>;
13
+ /**
14
+ * GET /api/incode/start — optional `flow` matches backend (`faceAgeEstimation`, `faceAgeCheck`, `faceAgeCapture`, …).
15
+ */
16
+ start(options?: {
17
+ flow?: string;
18
+ }): Promise<Session>;
14
19
  finish({ token }: {
15
20
  token: string;
16
21
  }): Promise<Session | {
17
22
  error: 'Missing required parameter token';
18
23
  }>;
19
- approve({ id, token, uniqueId, }: {
24
+ /**
25
+ * GET /api/incode/score — proxies Incode `omni/get/score` (session `token` as query param).
26
+ */
27
+ score(params: {
28
+ token: string;
29
+ interviewId?: string;
30
+ }): Promise<unknown>;
31
+ approve({ id, token, uniqueId, interviewId, }: {
20
32
  id: string;
21
33
  token: string;
22
34
  uniqueId: string;
35
+ interviewId?: string;
23
36
  }): Promise<{
24
37
  incodeId: string;
25
38
  } | {
26
- error: 'Field(s) cannot be empty.';
39
+ error: string;
27
40
  }>;
28
41
  }
29
42
  export default IKEAppIncodeApi;
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  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;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -86,30 +86,37 @@ var IKEAppIncodeApi = /** @class */ (function (_super) {
86
86
  });
87
87
  });
88
88
  };
89
- IKEAppIncodeApi.prototype.start = function () {
89
+ /**
90
+ * GET /api/incode/start — optional `flow` matches backend (`faceAgeEstimation`, `faceAgeCheck`, `faceAgeCapture`, …).
91
+ */
92
+ IKEAppIncodeApi.prototype.start = function (options) {
90
93
  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")];
94
+ var flow, path, response;
95
+ var _a;
96
+ return __generator(this, function (_b) {
97
+ switch (_b.label) {
98
+ case 0:
99
+ flow = (_a = options === null || options === void 0 ? void 0 : options.flow) === null || _a === void 0 ? void 0 : _a.trim();
100
+ path = flow !== undefined && flow !== '' ? "start?".concat(new URLSearchParams({ flow: flow }).toString()) : "start";
101
+ return [4 /*yield*/, this.bxbFetch({
102
+ method: 'GET',
103
+ headers: {
104
+ 'Content-Type': 'application/json',
105
+ },
106
+ }, path)];
100
107
  case 1:
101
- response = _a.sent();
108
+ response = _b.sent();
102
109
  return [2 /*return*/, response.json()];
103
110
  }
104
111
  });
105
112
  });
106
113
  };
107
114
  IKEAppIncodeApi.prototype.finish = function (_a) {
108
- var token = _a.token;
109
- return __awaiter(this, void 0, void 0, function () {
115
+ return __awaiter(this, arguments, void 0, function (_b) {
110
116
  var params, response;
111
- return __generator(this, function (_b) {
112
- switch (_b.label) {
117
+ var token = _b.token;
118
+ return __generator(this, function (_c) {
119
+ switch (_c.label) {
113
120
  case 0:
114
121
  params = new URLSearchParams({ token: token });
115
122
  return [4 /*yield*/, this.bxbFetch({
@@ -119,20 +126,52 @@ var IKEAppIncodeApi = /** @class */ (function (_super) {
119
126
  },
120
127
  }, "finish?".concat(params.toString()))];
121
128
  case 1:
122
- response = _b.sent();
129
+ response = _c.sent();
123
130
  return [2 /*return*/, response.json()];
124
131
  }
125
132
  });
126
133
  });
127
134
  };
128
- IKEAppIncodeApi.prototype.approve = function (_a) {
129
- var id = _a.id, token = _a.token, uniqueId = _a.uniqueId;
135
+ /**
136
+ * GET /api/incode/score proxies Incode `omni/get/score` (session `token` as query param).
137
+ */
138
+ IKEAppIncodeApi.prototype.score = function (params) {
130
139
  return __awaiter(this, void 0, void 0, function () {
131
- var params, response;
140
+ var search, iv, response;
141
+ var _a;
132
142
  return __generator(this, function (_b) {
133
143
  switch (_b.label) {
144
+ case 0:
145
+ search = new URLSearchParams({ token: params.token });
146
+ iv = (_a = params.interviewId) === null || _a === void 0 ? void 0 : _a.trim();
147
+ if (iv) {
148
+ search.set('interviewId', iv);
149
+ }
150
+ return [4 /*yield*/, this.bxbFetch({
151
+ method: 'GET',
152
+ headers: {
153
+ 'Content-Type': 'application/json',
154
+ },
155
+ }, "score?".concat(search.toString()))];
156
+ case 1:
157
+ response = _b.sent();
158
+ return [2 /*return*/, response.json()];
159
+ }
160
+ });
161
+ });
162
+ };
163
+ IKEAppIncodeApi.prototype.approve = function (_a) {
164
+ return __awaiter(this, arguments, void 0, function (_b) {
165
+ var params, iv, response;
166
+ var id = _b.id, token = _b.token, uniqueId = _b.uniqueId, interviewId = _b.interviewId;
167
+ return __generator(this, function (_c) {
168
+ switch (_c.label) {
134
169
  case 0:
135
170
  params = new URLSearchParams({ id: id, token: token, uniqueId: uniqueId });
171
+ iv = interviewId === null || interviewId === void 0 ? void 0 : interviewId.trim();
172
+ if (iv) {
173
+ params.set('interviewId', iv);
174
+ }
136
175
  return [4 /*yield*/, this.bxbFetch({
137
176
  method: 'GET',
138
177
  headers: {
@@ -140,7 +179,7 @@ var IKEAppIncodeApi = /** @class */ (function (_super) {
140
179
  },
141
180
  }, "approve?".concat(params.toString()))];
142
181
  case 1:
143
- response = _b.sent();
182
+ response = _c.sent();
144
183
  return [2 /*return*/, response.json()];
145
184
  }
146
185
  });
@@ -1,8 +1,8 @@
1
- export declare type GetOcrDataBody = {
1
+ export type GetOcrDataBody = {
2
2
  id: string;
3
3
  token: string;
4
4
  };
5
- export declare type Session = {
5
+ export type Session = {
6
6
  token: string;
7
7
  uniqueId?: string;
8
8
  interviewId?: string;