@btsd/aitu-bridge 0.7.2-canary.2 → 0.7.2-canary.3
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/dist/index.d.ts +295 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aitu Bridge is a JavaScript library designed to simplify integration with the Aitu Superapp.
|
|
3
|
+
* It allows your application to access platform features such as retrieving a user’s phone number or geolocation.
|
|
4
|
+
* {@link https://docs.aitu.io/aituapps/aitu.apps/methods | Read the official documentation to learn more.}
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
1
7
|
export * from './error';
|
|
2
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare enum EInvokeRequest {
|
|
3
12
|
getMe = "GetMe",
|
|
4
13
|
getPhone = "GetPhone",
|
|
5
14
|
getContacts = "GetContacts",
|
|
@@ -9,11 +18,16 @@ declare enum EInvokeRequest {
|
|
|
9
18
|
enablePrivateMessaging = "EnablePrivateMessaging",
|
|
10
19
|
disablePrivateMessaging = "DisablePrivateMessaging"
|
|
11
20
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
* Represents a header menu item click handler.
|
|
24
|
+
*/
|
|
25
|
+
export type HeaderMenuItemClickHandlerType = (id: string) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
* Represents a back arrow click handler.
|
|
29
|
+
*/
|
|
30
|
+
export type BackArrowClickHandlerType = () => Promise<void>;
|
|
17
31
|
/**
|
|
18
32
|
* @public
|
|
19
33
|
* Represents an error that can occur during NFC passport operations.
|
|
@@ -39,6 +53,26 @@ export interface NFCPassportError {
|
|
|
39
53
|
}
|
|
40
54
|
/**
|
|
41
55
|
* @public
|
|
56
|
+
* Represents an error indicating that the app URL does not match the expected value.
|
|
57
|
+
*/
|
|
58
|
+
export interface AppUrlDoesntMatchError {
|
|
59
|
+
code: 'url_does_not_match';
|
|
60
|
+
msg: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @public
|
|
64
|
+
* Represents a permission denied error.
|
|
65
|
+
*/
|
|
66
|
+
export interface PermissionDeniedError {
|
|
67
|
+
code: 'permission_denied';
|
|
68
|
+
msg: string;
|
|
69
|
+
meta: {
|
|
70
|
+
can_retry: boolean;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @public
|
|
75
|
+
* Represents phone number response.
|
|
42
76
|
*/
|
|
43
77
|
export interface GetPhoneResponse {
|
|
44
78
|
phone: string;
|
|
@@ -46,6 +80,7 @@ export interface GetPhoneResponse {
|
|
|
46
80
|
}
|
|
47
81
|
/**
|
|
48
82
|
* @public
|
|
83
|
+
* Represents user information response.
|
|
49
84
|
*/
|
|
50
85
|
export interface GetMeResponse {
|
|
51
86
|
name: string;
|
|
@@ -59,6 +94,7 @@ export interface GetMeResponse {
|
|
|
59
94
|
}
|
|
60
95
|
/**
|
|
61
96
|
* @public
|
|
97
|
+
* Represents a generic response object.
|
|
62
98
|
*/
|
|
63
99
|
export interface ResponseObject {
|
|
64
100
|
phone?: string;
|
|
@@ -67,6 +103,7 @@ export interface ResponseObject {
|
|
|
67
103
|
}
|
|
68
104
|
/**
|
|
69
105
|
* @public
|
|
106
|
+
* Represents a geographic location response.
|
|
70
107
|
*/
|
|
71
108
|
export interface GetGeoResponse {
|
|
72
109
|
latitude: number;
|
|
@@ -74,6 +111,7 @@ export interface GetGeoResponse {
|
|
|
74
111
|
}
|
|
75
112
|
/**
|
|
76
113
|
* @public
|
|
114
|
+
* Represents a contacts list response.
|
|
77
115
|
*/
|
|
78
116
|
export interface GetContactsResponse {
|
|
79
117
|
contacts: Array<{
|
|
@@ -85,6 +123,7 @@ export interface GetContactsResponse {
|
|
|
85
123
|
}
|
|
86
124
|
/**
|
|
87
125
|
* @public
|
|
126
|
+
* Represents a selected contact response.
|
|
88
127
|
*/
|
|
89
128
|
export interface SelectContactResponse {
|
|
90
129
|
phone: string;
|
|
@@ -93,6 +132,7 @@ export interface SelectContactResponse {
|
|
|
93
132
|
}
|
|
94
133
|
/**
|
|
95
134
|
* @public
|
|
135
|
+
* Represents a user profile response.
|
|
96
136
|
*/
|
|
97
137
|
export interface GetUserProfileResponse {
|
|
98
138
|
name: string;
|
|
@@ -103,6 +143,7 @@ export interface GetUserProfileResponse {
|
|
|
103
143
|
}
|
|
104
144
|
/**
|
|
105
145
|
* @public
|
|
146
|
+
* Represents header menu item icons.
|
|
106
147
|
*/
|
|
107
148
|
export declare enum HeaderMenuIcon {
|
|
108
149
|
Search = "Search",
|
|
@@ -120,6 +161,7 @@ export declare enum HeaderMenuIcon {
|
|
|
120
161
|
}
|
|
121
162
|
/**
|
|
122
163
|
* @public
|
|
164
|
+
* Represents navigation item display modes.
|
|
123
165
|
*/
|
|
124
166
|
export declare enum NavigationItemMode {
|
|
125
167
|
SystemBackArrow = "SystemBackArrow",
|
|
@@ -129,6 +171,7 @@ export declare enum NavigationItemMode {
|
|
|
129
171
|
}
|
|
130
172
|
/**
|
|
131
173
|
* @public
|
|
174
|
+
* Represents a header menu item.
|
|
132
175
|
*/
|
|
133
176
|
export interface HeaderMenuItem {
|
|
134
177
|
id: string;
|
|
@@ -137,6 +180,7 @@ export interface HeaderMenuItem {
|
|
|
137
180
|
}
|
|
138
181
|
/**
|
|
139
182
|
* @public
|
|
183
|
+
* Represents user steps per day.
|
|
140
184
|
*/
|
|
141
185
|
export interface UserStepsPerDay {
|
|
142
186
|
date: string;
|
|
@@ -144,10 +188,16 @@ export interface UserStepsPerDay {
|
|
|
144
188
|
}
|
|
145
189
|
/**
|
|
146
190
|
* @public
|
|
191
|
+
* Represents a user step information response.
|
|
147
192
|
*/
|
|
148
193
|
export interface UserStepInfoResponse {
|
|
149
194
|
steps: UserStepsPerDay[];
|
|
150
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* @public
|
|
198
|
+
* Represents a successful response.
|
|
199
|
+
*/
|
|
200
|
+
export type SuccessResponse = 'success';
|
|
151
201
|
/**
|
|
152
202
|
* @public
|
|
153
203
|
* Represents the status of a response.
|
|
@@ -155,13 +205,15 @@ export interface UserStepInfoResponse {
|
|
|
155
205
|
* - `success` — The operation completed successfully.
|
|
156
206
|
* - `failed` — The operation failed.
|
|
157
207
|
*/
|
|
158
|
-
export type ResponseType =
|
|
208
|
+
export type ResponseType = SuccessResponse | 'failed';
|
|
159
209
|
/**
|
|
160
210
|
* @public
|
|
211
|
+
* Represents biometry check response.
|
|
161
212
|
*/
|
|
162
|
-
type BiometryResponse = ResponseType | 'unavailable' | 'cancelled';
|
|
213
|
+
export type BiometryResponse = ResponseType | 'unavailable' | 'cancelled';
|
|
163
214
|
/**
|
|
164
215
|
* @public
|
|
216
|
+
* Represents passport data read from an NFC chip.
|
|
165
217
|
*/
|
|
166
218
|
export interface PassportDataResponse {
|
|
167
219
|
documentNumber: string;
|
|
@@ -173,67 +225,295 @@ export interface PassportDataResponse {
|
|
|
173
225
|
nationality: string;
|
|
174
226
|
documentType: string;
|
|
175
227
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
228
|
+
/**
|
|
229
|
+
* @public
|
|
230
|
+
* Generic bridge invocation type.
|
|
231
|
+
*/
|
|
232
|
+
export type BridgeInvoke<T extends EInvokeRequest, R> = (method: T, data?: {}) => Promise<R>;
|
|
233
|
+
/**
|
|
234
|
+
* @public
|
|
235
|
+
* Interface for persistent key-value storage.
|
|
236
|
+
*/
|
|
237
|
+
export interface BridgeStorage {
|
|
238
|
+
setItem: (keyName: string, keyValue: string) => Promise<void>;
|
|
239
|
+
getItem: (keyName: string) => Promise<string | null>;
|
|
240
|
+
clear: () => Promise<void>;
|
|
181
241
|
}
|
|
182
242
|
/**
|
|
183
243
|
* @public
|
|
244
|
+
* Main interface for interacting with the Aitu Bridge API.
|
|
184
245
|
*/
|
|
185
246
|
export interface AituBridge {
|
|
247
|
+
/**
|
|
248
|
+
* Version of the Aitu Bridge API available in SemVer format.
|
|
249
|
+
*/
|
|
186
250
|
version: string;
|
|
251
|
+
/**
|
|
252
|
+
* Low-level bridge invocation method used internally
|
|
253
|
+
* to communicate with native Aitu functionality.
|
|
254
|
+
*/
|
|
187
255
|
invoke: BridgeInvoke<EInvokeRequest, ResponseObject>;
|
|
256
|
+
/**
|
|
257
|
+
* Provides access to persistent key-value storage
|
|
258
|
+
* scoped to the current mini-app.
|
|
259
|
+
*/
|
|
188
260
|
storage: BridgeStorage;
|
|
261
|
+
/**
|
|
262
|
+
* Returns basic information about the currently authorized user.
|
|
263
|
+
* @returns A promise resolving to a {@link GetMeResponse} containing user details.
|
|
264
|
+
*/
|
|
189
265
|
getMe: () => Promise<GetMeResponse>;
|
|
266
|
+
/**
|
|
267
|
+
* Requests the user's phone number after explicit user confirmation.
|
|
268
|
+
* @returns A promise resolving to a {@link GetPhoneResponse} containing the phone number.
|
|
269
|
+
*/
|
|
190
270
|
getPhone: () => Promise<GetPhoneResponse>;
|
|
271
|
+
/**
|
|
272
|
+
* Requests access to the user's contact list.
|
|
273
|
+
* @returns A promise resolving to a {@link GetContactsResponse} containing the contacts.
|
|
274
|
+
*/
|
|
191
275
|
getContacts: () => Promise<GetContactsResponse>;
|
|
276
|
+
/**
|
|
277
|
+
* Retrieves the user's current geographic location.
|
|
278
|
+
* @returns A promise resolving to a {@link GetGeoResponse} containing latitude and longitude.
|
|
279
|
+
*/
|
|
192
280
|
getGeo: () => Promise<GetGeoResponse>;
|
|
281
|
+
/**
|
|
282
|
+
* Opens the native contact picker UI and allows the user
|
|
283
|
+
* to select a single contact.
|
|
284
|
+
* @returns A promise resolving to a {@link SelectContactResponse} containing the selected contact details.
|
|
285
|
+
*/
|
|
193
286
|
selectContact: () => Promise<SelectContactResponse>;
|
|
287
|
+
/**
|
|
288
|
+
* Opens the device camera and scans a QR code.
|
|
289
|
+
* @returns A string with the result of scanning the QR code is returned.
|
|
290
|
+
*/
|
|
194
291
|
getQr: () => Promise<string>;
|
|
292
|
+
/**
|
|
293
|
+
* Requests an SMS verification code from the user.
|
|
294
|
+
* @returns A string with code is returned.
|
|
295
|
+
*/
|
|
195
296
|
getSMSCode: () => Promise<string>;
|
|
297
|
+
/**
|
|
298
|
+
* Retrieves public profile information for a specific user.
|
|
299
|
+
*
|
|
300
|
+
* @param userId - Aitu user identifier
|
|
301
|
+
* @returns A promise resolving to a {@link GetUserProfileResponse} containing the user's profile data.
|
|
302
|
+
*/
|
|
196
303
|
getUserProfile: (userId: string) => Promise<GetUserProfileResponse>;
|
|
197
304
|
/**
|
|
198
305
|
* Opens the user's profile within the host application.
|
|
199
306
|
* @returns A promise that resolves with a {@link ResponseType} indicating the result of the operation.
|
|
200
307
|
*/
|
|
201
308
|
openUserProfile: () => Promise<ResponseType>;
|
|
309
|
+
/**
|
|
310
|
+
* Opens the system share dialog with a text payload.
|
|
311
|
+
*
|
|
312
|
+
* @param text - Text to share
|
|
313
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.
|
|
314
|
+
*/
|
|
202
315
|
share: (text: string) => Promise<ResponseType>;
|
|
316
|
+
/**
|
|
317
|
+
* Sets the title displayed in the mini-app header.
|
|
318
|
+
*
|
|
319
|
+
* @param text - Header title
|
|
320
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.
|
|
321
|
+
*/
|
|
203
322
|
setTitle: (text: string) => Promise<ResponseType>;
|
|
323
|
+
/**
|
|
324
|
+
* Copies the specified text to the system clipboard.
|
|
325
|
+
*
|
|
326
|
+
* @param text - Text to copy
|
|
327
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the copy operation.
|
|
328
|
+
*/
|
|
204
329
|
copyToClipboard: (text: string) => Promise<ResponseType>;
|
|
330
|
+
/**
|
|
331
|
+
* Shares an image with an optional text description.
|
|
332
|
+
*
|
|
333
|
+
* @deprecated Use {@link AituBridge.shareFile} instead.
|
|
334
|
+
* @param text - Description text
|
|
335
|
+
* @param image - Image data encoded in Base64
|
|
336
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.
|
|
337
|
+
*/
|
|
205
338
|
shareImage: (text: string, image: string) => Promise<ResponseType>;
|
|
339
|
+
/**
|
|
340
|
+
* Shares a file via the system sharing interface.
|
|
341
|
+
*
|
|
342
|
+
* @param text - Description text
|
|
343
|
+
* @param filename - Name of the file
|
|
344
|
+
* @param base64Data - File data encoded in Base64
|
|
345
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the sharing operation.
|
|
346
|
+
*/
|
|
206
347
|
shareFile: (text: string, filename: string, base64Data: string) => Promise<ResponseType>;
|
|
348
|
+
/**
|
|
349
|
+
* Enables push notifications for the mini-app.
|
|
350
|
+
*/
|
|
207
351
|
enableNotifications: () => Promise<{}>;
|
|
352
|
+
/**
|
|
353
|
+
* Disables push notifications for the mini-app.
|
|
354
|
+
*/
|
|
208
355
|
disableNotifications: () => Promise<{}>;
|
|
356
|
+
/**
|
|
357
|
+
* Enables private messaging between the mini-app and the user.
|
|
358
|
+
*
|
|
359
|
+
* @param appId - Mini-app identifier
|
|
360
|
+
*/
|
|
209
361
|
enablePrivateMessaging: (appId: string) => Promise<string>;
|
|
362
|
+
/**
|
|
363
|
+
* Disables private messaging between the mini-app and the user.
|
|
364
|
+
*
|
|
365
|
+
* @param appId - Mini-app identifier
|
|
366
|
+
*/
|
|
210
367
|
disablePrivateMessaging: (appId: string) => Promise<string>;
|
|
368
|
+
/**
|
|
369
|
+
* Opens the Aitu application settings screen.
|
|
370
|
+
* @returns A promise resolving to a ResponseType indicating the result of the operation.
|
|
371
|
+
*/
|
|
211
372
|
openSettings: () => Promise<ResponseType>;
|
|
373
|
+
/**
|
|
374
|
+
* Closes the current mini-app.
|
|
375
|
+
* @returns A promise resolving to a ResponseType indicating the result of the operation.
|
|
376
|
+
*/
|
|
212
377
|
closeApplication: () => Promise<ResponseType>;
|
|
378
|
+
/**
|
|
379
|
+
* Registers a handler that is triggered when the device is shaken.
|
|
380
|
+
* @param handler - Shake event handler
|
|
381
|
+
*/
|
|
213
382
|
setShakeHandler: (handler: any) => void;
|
|
383
|
+
/**
|
|
384
|
+
* Registers a handler that is triggered when a tab becomes active.
|
|
385
|
+
*
|
|
386
|
+
* @param handler - Callback with active tab name
|
|
387
|
+
*/
|
|
214
388
|
setTabActiveHandler: (handler: (tabname: string) => void) => void;
|
|
215
|
-
|
|
389
|
+
/**
|
|
390
|
+
* Triggers device vibration using a custom vibration pattern.
|
|
391
|
+
*
|
|
392
|
+
* @param pattern - Array of vibration durations in milliseconds
|
|
393
|
+
* @returns A promise resolving to a {@link SuccessResponse} indicating the result of the vibration operation.
|
|
394
|
+
*/
|
|
395
|
+
vibrate: (pattern: number[]) => Promise<SuccessResponse>;
|
|
396
|
+
/**
|
|
397
|
+
* Indicates whether the current environment supports Aitu Bridge.
|
|
398
|
+
* @returns A boolean indicating support status.
|
|
399
|
+
*/
|
|
216
400
|
isSupported: () => boolean;
|
|
401
|
+
/**
|
|
402
|
+
* Checks whether a specific bridge method is supported.
|
|
403
|
+
*
|
|
404
|
+
* @param method - Method name
|
|
405
|
+
* @returns A boolean indicating support status.
|
|
406
|
+
*/
|
|
217
407
|
supports: (method: string) => boolean;
|
|
408
|
+
/**
|
|
409
|
+
* Subscribes to Aitu Bridge events.
|
|
410
|
+
*/
|
|
218
411
|
sub: any;
|
|
412
|
+
/**
|
|
413
|
+
* Enables protection against screenshots and screen recording.
|
|
414
|
+
*/
|
|
219
415
|
enableScreenCapture: () => Promise<{}>;
|
|
416
|
+
/**
|
|
417
|
+
* Disables protection against screenshots and screen recording.
|
|
418
|
+
*/
|
|
220
419
|
disableScreenCapture: () => Promise<{}>;
|
|
420
|
+
/**
|
|
421
|
+
* Sets custom menu items in the mini-app header.
|
|
422
|
+
*
|
|
423
|
+
* @param items - Header menu configuration
|
|
424
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.
|
|
425
|
+
*/
|
|
221
426
|
setHeaderMenuItems: (items: Array<HeaderMenuItem>) => Promise<ResponseType>;
|
|
427
|
+
/**
|
|
428
|
+
* Registers a click handler for header menu items.
|
|
429
|
+
* @param handler - Header menu item click handler
|
|
430
|
+
*/
|
|
222
431
|
setHeaderMenuItemClickHandler: (handler: HeaderMenuItemClickHandlerType) => void;
|
|
432
|
+
/**
|
|
433
|
+
* Enables or disables custom back arrow handling.
|
|
434
|
+
*
|
|
435
|
+
* @param enabled - Whether custom handling is enabled
|
|
436
|
+
* @returns A promise resolving to a ResponseType indicating the result of the operation.
|
|
437
|
+
*/
|
|
223
438
|
setCustomBackArrowMode: (enabled: boolean) => Promise<ResponseType>;
|
|
439
|
+
/**
|
|
440
|
+
* Returns whether custom back arrow mode is enabled.
|
|
441
|
+
* @returns A promise resolving to a boolean indicating the current mode.
|
|
442
|
+
*/
|
|
224
443
|
getCustomBackArrowMode: () => Promise<boolean>;
|
|
444
|
+
/**
|
|
445
|
+
* Controls the visibility of the custom back arrow.
|
|
446
|
+
*
|
|
447
|
+
* @param visible - Arrow visibility state
|
|
448
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.
|
|
449
|
+
*/
|
|
225
450
|
setCustomBackArrowVisible: (visible: boolean) => Promise<ResponseType>;
|
|
451
|
+
/**
|
|
452
|
+
* Opens the payment interface for a specified transaction.
|
|
453
|
+
* @param transactionId - Transaction identifier
|
|
454
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the payment operation.
|
|
455
|
+
*/
|
|
226
456
|
openPayment: (transactionId: string) => Promise<ResponseType>;
|
|
457
|
+
/**
|
|
458
|
+
* Sets a custom handler for back arrow click events.
|
|
459
|
+
* @param handler - Back arrow click handler
|
|
460
|
+
*/
|
|
227
461
|
setCustomBackArrowOnClickHandler: (handler: BackArrowClickHandlerType) => void;
|
|
462
|
+
/**
|
|
463
|
+
* Checks biometric authentication status.
|
|
464
|
+
* @returns A promise resolving to a {@link BiometryResponse} indicating the result of the check.
|
|
465
|
+
*/
|
|
228
466
|
checkBiometry: () => Promise<BiometryResponse>;
|
|
467
|
+
/**
|
|
468
|
+
* Opens an external URL outside the mini-app context.
|
|
469
|
+
*
|
|
470
|
+
* @param url - External URL to open
|
|
471
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the operation.
|
|
472
|
+
*/
|
|
229
473
|
openExternalUrl: (url: string) => Promise<ResponseType>;
|
|
474
|
+
/**
|
|
475
|
+
* Enables swipe-back navigation gesture.
|
|
476
|
+
* @returns A promise resolving to a {@link ResponseType} when the gesture is enabled.
|
|
477
|
+
*/
|
|
230
478
|
enableSwipeBack: () => Promise<ResponseType>;
|
|
479
|
+
/**
|
|
480
|
+
* Disables swipe-back navigation gesture.
|
|
481
|
+
* @returns A promise resolving to a {@link ResponseType} when the gesture is disabled.
|
|
482
|
+
*/
|
|
231
483
|
disableSwipeBack: () => Promise<ResponseType>;
|
|
484
|
+
/**
|
|
485
|
+
* Sets the navigation item display mode.
|
|
486
|
+
*
|
|
487
|
+
* @param mode - Navigation item mode
|
|
488
|
+
* @returns A promise that resolves when the mode is set.
|
|
489
|
+
*/
|
|
232
490
|
setNavigationItemMode: (mode: NavigationItemMode) => Promise<void>;
|
|
491
|
+
/**
|
|
492
|
+
* Returns the current navigation item mode.
|
|
493
|
+
* @returns A promise resolving to the current {@link NavigationItemMode}.
|
|
494
|
+
*/
|
|
233
495
|
getNavigationItemMode: () => Promise<NavigationItemMode>;
|
|
496
|
+
/**
|
|
497
|
+
* Retrieves step count data from HealthKit or Google Fit.
|
|
498
|
+
* @returns A promise resolving to a {@link UserStepInfoResponse} containing the user's step data.
|
|
499
|
+
*/
|
|
234
500
|
getUserStepInfo: () => Promise<UserStepInfoResponse>;
|
|
501
|
+
/**
|
|
502
|
+
* Checks whether eSIM is supported on the device.
|
|
503
|
+
* @returns A promise resolving to a {@link ResponseType} indicating if eSIM is supported.
|
|
504
|
+
*/
|
|
235
505
|
isESimSupported: () => Promise<ResponseType>;
|
|
506
|
+
/**
|
|
507
|
+
* Activates an eSIM using the provided activation code.
|
|
508
|
+
*
|
|
509
|
+
* @param activationCode - eSIM activation code
|
|
510
|
+
* @returns A promise resolving to a {@link ResponseType} indicating the result of the activation.
|
|
511
|
+
*/
|
|
236
512
|
activateESim: (activationCode: string) => Promise<ResponseType>;
|
|
513
|
+
/**
|
|
514
|
+
* Reads raw data from an NFC tag.
|
|
515
|
+
* @returns A promise resolving to a string containing the raw NFC data.
|
|
516
|
+
*/
|
|
237
517
|
readNFCData: () => Promise<string>;
|
|
238
518
|
/**
|
|
239
519
|
* Subscribes to user step updates from HealthKit/Google Fit.
|
|
@@ -290,6 +570,7 @@ export interface AituBridge {
|
|
|
290
570
|
}
|
|
291
571
|
/**
|
|
292
572
|
* @public
|
|
573
|
+
* AituBridge instance for interacting with the Aitu mini-app environment.
|
|
293
574
|
*/
|
|
294
575
|
declare const bridge: AituBridge;
|
|
295
576
|
export default bridge;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,cAAc,SAAS,CAAC;AAIxB;;GAEG;AACH,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,mBAA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,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAEhE;;;OAGG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACnC;;;;;;;;;;OAUG;IACH,qBAAqB,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACnD;;;;;;;;;OASG;IACH,uBAAuB,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACrD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,eAAe,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACzH;AA0sBD;;;GAGG;AACH,QAAA,MAAM,MAAM,YAAgB,CAAC;AAE7B,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(){return e=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},e.apply(null,arguments)}function n(e){var n=function(e){return void 0===e&&(e="m:"),{current:0,next:function(){return e+ ++this.current}}}(e),o={};return{add:function(e,t){void 0===t&&(t="");var r=t+n.next();return o[r]=e,r},resolve:function(e,n,t,r){var i=o[e];i&&(t(r)?i.resolve(n):i.reject(r),o[e]=null)}}}function o(e,n){e(function(e){if(e.detail&&"reqId"in e.detail){var o=e.detail,t=o.reqId;t&&n.resolve(t,o.data,function(e){return!e},o.error)}})}function t(e,t,r){var i=n(t+":");return o(r,i),function(){var n=arguments;return new Promise(function(o,t){var r=i.add({resolve:o,reject:t});e.apply(void 0,[r].concat([].slice.call(n)))})}}var r=new URLSearchParams(window.location.search).get("__aitu-domain");r?localStorage.setItem("mini-app-domain",r):r=localStorage.getItem("mini-app-domain");var i=null;r&&(i={origin:r,execute:function(e,n){window.top.postMessage({source:"aitu-bridge",method:e,reqId:n,payload:[].concat([].slice.call(arguments,2))},i.origin)}},window.addEventListener("message",function(e){if(e.origin===r&&e.data){if(window.dispatchEvent(new CustomEvent("aituEvents",{detail:e.data})),"string"!=typeof e.data||""===e.data)return;try{var n=JSON.parse(e.data);n&&n.method&&("setCustomBackArrowOnClickHandler"===n.method?window.onAituBridgeBackArrowClick():"setHeaderMenuItemClickHandler"===n.method&&window.onAituBridgeHeaderMenuItemClick(n.param))}catch(e){console.log("Error parsing message data: "+e)}}}));var s,a,d,c,u=i;exports.BridgeErrors=void 0,(s=exports.BridgeErrors||(exports.BridgeErrors={}))[s.PermissionDenyError=0]="PermissionDenyError",s[s.PermissionSecurityDenyError=1]="PermissionSecurityDenyError",s[s.OtherError=2]="OtherError",function(e){e.getMe="GetMe",e.getPhone="GetPhone",e.getContacts="GetContacts",e.getUserProfile="GetUserProfile",e.enableNotifications="AllowNotifications",e.disableNotifications="DisableNotifications",e.enablePrivateMessaging="EnablePrivateMessaging",e.disablePrivateMessaging="DisablePrivateMessaging"}(a||(a={})),exports.HeaderMenuIcon=void 0,(d=exports.HeaderMenuIcon||(exports.HeaderMenuIcon={})).Search="Search",d.ShoppingCart="ShoppingCart",d.Menu="Menu",d.Share="Share",d.Notifications="Notifications",d.Help="Help",d.Error="Error",d.Person="Person",d.Sort="Sort",d.Filter="Filter",d.Close="Close",d.SystemNotifications="SystemNotifications",exports.NavigationItemMode=void 0,(c=exports.NavigationItemMode||(exports.NavigationItemMode={})).SystemBackArrow="SystemBackArrow",c.CustomBackArrow="CustomBackArrow",c.NoItem="NoItem",c.UserProfile="UserProfile";var l="invoke",f="storage",p="getGeo",g="getQr",w="getSMSCode",m="selectContact",v="openSettings",k="closeApplication",y="share",M="setTitle",I="copyToClipboard",b="shareFile",S="setShakeHandler",C="vibrate",x="enableScreenCapture",h="disableScreenCapture",U="setTabActiveHandler",B="setHeaderMenuItems",P="setHeaderMenuItemClickHandler",A="setCustomBackArrowMode",N="getCustomBackArrowMode",E="setCustomBackArrowVisible",q="openPayment",H="setCustomBackArrowOnClickHandler",O="checkBiometry",D="openExternalUrl",T="enableSwipeBack",j="disableSwipeBack",F="setNavigationItemMode",G="getNavigationItemMode",J="getUserStepInfo",V="undefined"!=typeof window&&window.AndroidBridge,W="undefined"!=typeof window&&window.webkit&&window.webkit.messageHandlers,L="undefined"!=typeof window&&window.top!==window&&u,Q=function(){var r=[];"undefined"!=typeof window&&window.addEventListener("aituEvents",function(e){[].concat(r).map(function(n){return n.call(null,e)})});var i,s=function(e){r.push(e)},d=function(n,o){return t(function(t){var r=[].slice.call(arguments,1),i=!!W&&!!W[n],s=!(null==o||!o.isWebSupported||!L);V&&V[n]?V[n].apply(V,[t].concat(r)):i?W[n].postMessage(e({reqId:t},null==o||null==o.transformToObject?void 0:o.transformToObject(r))):s?L.execute.apply(L,[n,t].concat(r)):"undefined"!=typeof window&&console.log("--"+n+"-isUnknown")},n,s)},c=(o(s,i=n("invoke:")),function(e,n){return void 0===n&&(n={}),new Promise(function(o,t){!function(e,n,o){void 0===o&&(o={});var t=W&&W[l];V&&V[l]?V[l](e,n,JSON.stringify(o)):t?W[l].postMessage({reqId:e,method:n,data:o}):L?L.execute(l,e,n,o):"undefined"!=typeof window&&console.log("--invoke-isUnknown")}(i.add({resolve:o,reject:t},e+":"),e,n)})}),u=function(e,t){var r=n("storage:");return o(t,r),{setItem:function(n,o){return new Promise(function(t,i){var s=r.add({resolve:t,reject:i});e(s,"setItem",{keyName:n,keyValue:o})})},getItem:function(n){return new Promise(function(o,t){var i=r.add({resolve:o,reject:t});e(i,"getItem",{keyName:n})})},clear:function(){return new Promise(function(n,o){var t=r.add({resolve:n,reject:o});e(t,"clear",{})})}}}(function(e,n,o){void 0===o&&(o={});var t=W&&W[f];V&&V[f]?V[f](e,n,JSON.stringify(o)):t?W[f].postMessage({reqId:e,method:n,data:o}):L?L.execute(f,e,n,o):"undefined"!=typeof window&&console.log("--storage-isUnknown")},s),Q=t(function(e){var n=W&&W[p];V&&V[p]?V[p](e):n?W[p].postMessage({reqId:e}):L?L.execute(p,e):"undefined"!=typeof window&&console.log("--getGeo-isUnknown")},p,s),_=t(function(e){var n=W&&W[g];V&&V[g]?V[g](e):n?W[g].postMessage({reqId:e}):L?L.execute(g,e):"undefined"!=typeof window&&console.log("--getQr-isUnknown")},g,s),R=t(function(e){var n=W&&W[w];V&&V[w]?V[w](e):n?W[w].postMessage({reqId:e}):L?L.execute(w,e):"undefined"!=typeof window&&console.log("--getSMSCode-isUnknown")},w,s),z=t(function(e){var n=W&&W[m];V&&V[m]?V[m](e):n?W[m].postMessage({reqId:e}):L?L.execute(m,e):"undefined"!=typeof window&&console.log("--selectContact-isUnknown")},m,s),K=t(function(e){var n=W&&W[v];V&&V[v]?V[v](e):n?W[v].postMessage({reqId:e}):L?L.execute(v,e):"undefined"!=typeof window&&console.log("--openSettings-isUnknown")},v,s),X=t(function(e){var n=W&&W[k];V&&V[k]?V[k](e):n?W[k].postMessage({reqId:e}):L?L.execute(k,e):"undefined"!=typeof window&&console.log("--closeApplication-isUnknown")},k,s),Y=t(function(e,n){var o=W&&W[y];V&&V[y]?V[y](e,n):o?W[y].postMessage({reqId:e,text:n}):L?L.execute(y,e,n):"undefined"!=typeof window&&console.log("--share-isUnknown")},y,s),Z=t(function(e,n){var o=W&&W[M];V&&V[M]?V[M](e,n):o?W[M].postMessage({reqId:e,text:n}):L?L.execute(M,e,n):"undefined"!=typeof window&&console.log("--setTitle-isUnknown")},M,s),$=t(function(e,n){var o=W&&W[I];V&&V[I]?V[I](e,n):o?W[I].postMessage({reqId:e,text:n}):L?L.execute(I,e,n):"undefined"!=typeof window&&console.log("--copyToClipboard-isUnknown")},I,s),ee=t(function(e,n,o){var t=V&&V[b],r=W&&W[b],i="image."+o.split(";")[0].split("/")[1],s=o.substr(o.indexOf(",")+1);t?V[b](e,n,i,s):r?W[b].postMessage({reqId:e,text:n,filename:i,base64Data:s}):L?L.execute(b,e,{text:n,filename:i,base64Data:s}):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},"shareImage",s),ne=t(function(e,n,o,t){var r=W&&W[b];V&&V[b]?V[b](e,n,o,t):r?W[b].postMessage({reqId:e,text:n,filename:o,base64Data:t}):L?L.execute(b,e,n,o,t):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},b,s),oe=t(function(e,n){if(!Array.isArray(n)||n.some(function(e){return e<1||e!==Math.floor(e)})||n.reduce(function(e,n){return e+n})>1e4)console.error("Pattern should be an array of positive integers no longer than 10000ms total");else{var o=W&&W[C];V&&V[C]?V[C](e,JSON.stringify(n)):o?W[C].postMessage({reqId:e,pattern:n}):L?L.execute(C,e,n):"undefined"!=typeof window&&console.log("--vibrate-isUnknown")}},C,s),te=t(function(e){var n=W&&W[x];V&&V[x]?V[x](e):n?W[x].postMessage({reqId:e}):L?L.execute(x,e):"undefined"!=typeof window&&console.log("--enableScreenCapture-isUnknown")},x,s),re=t(function(e){var n=W&&W[h];V&&V[h]?V[h](e):n?W[h].postMessage({reqId:e}):L?L.execute(h,e):"undefined"!=typeof window&&console.log("--disableScreenCapture-isUnknown")},h,s),ie=t(function(e,n){if(n.length>3)console.error("SetHeaderMenuItems: items count should not be more than 3");else{var o=V&&V[B],t=W&&W[B],r=JSON.stringify(n);o?V[B](e,r):t?W[B].postMessage({reqId:e,itemsJsonArray:r}):L?L.execute(B,e,r):"undefined"!=typeof window&&console.log("--setHeaderMenuItems-isUnknown")}},B,s),se=t(function(e,n){var o=W&&W[A];V&&V[A]?V[A](e,n):o?W[A].postMessage({reqId:e,enabled:n}):L?L.execute(A,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowMode-isUnknown")},A,s),ae=t(function(e){var n=W&&W[N];V&&V[N]?V[N](e):n?W[N].postMessage({reqId:e}):L?L.execute(N,e):"undefined"!=typeof window&&console.log("--getCustomBackArrowMode-isUnknown")},N,s),de=t(function(e,n){var o=W&&W[E];V&&V[E]?V[E](e,n):o?W[E].postMessage({reqId:e,visible:n}):L?L.execute(E,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowVisible-isUnknown")},E,s),ce=t(function(e,n){var o=W&&W[q];V&&V[q]?V[q](e,n):o?W[q].postMessage({reqId:e,transactionId:n}):console.log("--openPayment-isUnknown")},q,s),ue=t(function(e){var n=W&&W[O];V&&V[O]?V[O](e):n?W[O].postMessage({reqId:e}):L?L.execute(O,e):"undefined"!=typeof window&&console.log("--checkBiometry-isUnknown")},O,s),le=t(function(e,n){var o=W&&W[D];V&&V[D]?V[D](e,n):o?W[D].postMessage({reqId:e,url:n}):console.log("--openExternalUrlMethod-isUnknown")},D,s),fe=t(function(e){var n=W&&W[T];V&&V[T]?V[T](e):n?W[T].postMessage({reqId:e}):L?L.execute(T,e):"undefined"!=typeof window&&console.log("--enableSwipeBack-isUnknown")},T,s),pe=t(function(e){var n=W&&W[j];V&&V[j]?V[j](e):n?W[j].postMessage({reqId:e}):L?L.execute(j,e):"undefined"!=typeof window&&console.log("--disableSwipeBack-isUnknown")},j,s),ge=t(function(e,n){var o=W&&W[F];V&&V[F]?V[F](e,n):o?W[F].postMessage({reqId:e,mode:n}):L?L.execute(F,e,n):"undefined"!=typeof window&&console.log("--setNavigationItemMode-isUnknown")},F,s),we=t(function(e){var n=W&&W[G];V&&V[G]?V[G](e):n?W[G].postMessage({reqId:e}):L?L.execute(G,e):"undefined"!=typeof window&&console.log("--getNavigationItemMode-isUnknown")},G,s),me=t(function(e){var n=W&&W[J];V&&V[J]?V[J](e):n?W[J].postMessage({reqId:e}):L?console.log("--getUserStepInfo-isWeb"):"undefined"!=typeof window&&console.log("--getUserStepInfo-isUnknown")},J,s),ve=d("isESimSupported"),ke=d("activateESim",{transformToObject:function(e){return{activationCode:e[0]}}}),ye=d("readNFCData"),Me=d("readNFCPassport",{transformToObject:function(e){return{passportNumber:e[0],dateOfBirth:e[1],expirationDate:e[2]}}}),Ie=d("subscribeUserStepInfo"),be=d("unsubscribeUserStepInfo"),Se=d("openUserProfile");return{version:"0.7.2-canary.2",copyToClipboard:$,invoke:c,storage:u,getMe:function(){return c(a.getMe)},getPhone:function(){return c(a.getPhone)},getContacts:function(){return c(a.getContacts)},getGeo:Q,getQr:_,getSMSCode:R,getUserProfile:function(e){return c(a.getUserProfile,{id:e})},openUserProfile:Se,selectContact:z,enableNotifications:function(){return c(a.enableNotifications)},disableNotifications:function(){return c(a.disableNotifications)},enablePrivateMessaging:function(e){return c(a.enablePrivateMessaging,{appId:e})},disablePrivateMessaging:function(e){return c(a.disablePrivateMessaging,{appId:e})},openSettings:K,closeApplication:X,setTitle:Z,share:Y,shareImage:ee,shareFile:ne,setShakeHandler:function(e){V&&V[S]||W&&W[S]||L?window.onAituBridgeShake=e:"undefined"!=typeof window&&console.log("--setShakeHandler-isUnknown")},setTabActiveHandler:function(e){V&&V[U]||W&&W[U]||L?window.onAituBridgeTabActive=e:"undefined"!=typeof window&&console.log("--setTabActiveHandler-isUnknown")},vibrate:oe,isSupported:function(){var e=W&&window.webkit.messageHandlers.invoke;return Boolean(V||e||L)},supports:function(e){return V&&"function"==typeof V[e]||W&&W[e]&&"function"==typeof W[e].postMessage||L&&"function"==typeof L[e]},sub:s,enableScreenCapture:te,disableScreenCapture:re,setHeaderMenuItems:ie,setHeaderMenuItemClickHandler:function(e){V&&V[P]||W&&W[P]||L?window.onAituBridgeHeaderMenuItemClick=e:"undefined"!=typeof window&&console.log("--setHeaderMenuItemClickHandler-isUnknown")},setCustomBackArrowMode:se,getCustomBackArrowMode:ae,setCustomBackArrowVisible:de,openPayment:ce,setCustomBackArrowOnClickHandler:function(e){V&&V[H]||W&&W[H]||L?window.onAituBridgeBackArrowClick=e:"undefined"!=typeof window&&console.log("--setCustomBackArrowOnClickHandler-isUnknown")},checkBiometry:ue,openExternalUrl:le,enableSwipeBack:fe,disableSwipeBack:pe,setNavigationItemMode:ge,getNavigationItemMode:we,getUserStepInfo:me,isESimSupported:ve,activateESim:ke,readNFCData:ye,subscribeUserStepInfo:Ie,unsubscribeUserStepInfo:be,readNFCPassport:Me}}();exports.classifyBridgeError=function(e){if(e.msg){if(e.msg.startsWith("permission deny"))return exports.BridgeErrors.PermissionDenyError;if(e.msg.startsWith("permission security deny"))return exports.BridgeErrors.PermissionSecurityDenyError}return exports.BridgeErrors.OtherError},exports.default=Q;
|
|
1
|
+
function e(){return e=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},e.apply(null,arguments)}function n(e){var n=function(e){return void 0===e&&(e="m:"),{current:0,next:function(){return e+ ++this.current}}}(e),o={};return{add:function(e,t){void 0===t&&(t="");var r=t+n.next();return o[r]=e,r},resolve:function(e,n,t,r){var i=o[e];i&&(t(r)?i.resolve(n):i.reject(r),o[e]=null)}}}function o(e,n){e(function(e){if(e.detail&&"reqId"in e.detail){var o=e.detail,t=o.reqId;t&&n.resolve(t,o.data,function(e){return!e},o.error)}})}function t(e,t,r){var i=n(t+":");return o(r,i),function(){var n=arguments;return new Promise(function(o,t){var r=i.add({resolve:o,reject:t});e.apply(void 0,[r].concat([].slice.call(n)))})}}var r=new URLSearchParams(window.location.search).get("__aitu-domain");r?localStorage.setItem("mini-app-domain",r):r=localStorage.getItem("mini-app-domain");var i=null;r&&(i={origin:r,execute:function(e,n){window.top.postMessage({source:"aitu-bridge",method:e,reqId:n,payload:[].concat([].slice.call(arguments,2))},i.origin)}},window.addEventListener("message",function(e){if(e.origin===r&&e.data){if(window.dispatchEvent(new CustomEvent("aituEvents",{detail:e.data})),"string"!=typeof e.data||""===e.data)return;try{var n=JSON.parse(e.data);n&&n.method&&("setCustomBackArrowOnClickHandler"===n.method?window.onAituBridgeBackArrowClick():"setHeaderMenuItemClickHandler"===n.method&&window.onAituBridgeHeaderMenuItemClick(n.param))}catch(e){console.log("Error parsing message data: "+e)}}}));var s,a,d,c,u=i;exports.BridgeErrors=void 0,(s=exports.BridgeErrors||(exports.BridgeErrors={}))[s.PermissionDenyError=0]="PermissionDenyError",s[s.PermissionSecurityDenyError=1]="PermissionSecurityDenyError",s[s.OtherError=2]="OtherError",exports.EInvokeRequest=void 0,(a=exports.EInvokeRequest||(exports.EInvokeRequest={})).getMe="GetMe",a.getPhone="GetPhone",a.getContacts="GetContacts",a.getUserProfile="GetUserProfile",a.enableNotifications="AllowNotifications",a.disableNotifications="DisableNotifications",a.enablePrivateMessaging="EnablePrivateMessaging",a.disablePrivateMessaging="DisablePrivateMessaging",exports.HeaderMenuIcon=void 0,(d=exports.HeaderMenuIcon||(exports.HeaderMenuIcon={})).Search="Search",d.ShoppingCart="ShoppingCart",d.Menu="Menu",d.Share="Share",d.Notifications="Notifications",d.Help="Help",d.Error="Error",d.Person="Person",d.Sort="Sort",d.Filter="Filter",d.Close="Close",d.SystemNotifications="SystemNotifications",exports.NavigationItemMode=void 0,(c=exports.NavigationItemMode||(exports.NavigationItemMode={})).SystemBackArrow="SystemBackArrow",c.CustomBackArrow="CustomBackArrow",c.NoItem="NoItem",c.UserProfile="UserProfile";var l="invoke",f="storage",p="getGeo",g="getQr",w="getSMSCode",v="selectContact",m="openSettings",k="closeApplication",I="share",y="setTitle",M="copyToClipboard",b="shareFile",x="setShakeHandler",S="vibrate",C="enableScreenCapture",h="disableScreenCapture",U="setTabActiveHandler",B="setHeaderMenuItems",E="setHeaderMenuItemClickHandler",q="setCustomBackArrowMode",P="getCustomBackArrowMode",A="setCustomBackArrowVisible",N="openPayment",H="setCustomBackArrowOnClickHandler",O="checkBiometry",D="openExternalUrl",T="enableSwipeBack",j="disableSwipeBack",R="setNavigationItemMode",F="getNavigationItemMode",G="getUserStepInfo",J="undefined"!=typeof window&&window.AndroidBridge,V="undefined"!=typeof window&&window.webkit&&window.webkit.messageHandlers,W="undefined"!=typeof window&&window.top!==window&&u,L=function(){var r=[];"undefined"!=typeof window&&window.addEventListener("aituEvents",function(e){[].concat(r).map(function(n){return n.call(null,e)})});var i,s=function(e){r.push(e)},a=function(n,o){return t(function(t){var r=[].slice.call(arguments,1),i=!!V&&!!V[n],s=!(null==o||!o.isWebSupported||!W);J&&J[n]?J[n].apply(J,[t].concat(r)):i?V[n].postMessage(e({reqId:t},null==o||null==o.transformToObject?void 0:o.transformToObject(r))):s?W.execute.apply(W,[n,t].concat(r)):"undefined"!=typeof window&&console.log("--"+n+"-isUnknown")},n,s)},d=(o(s,i=n("invoke:")),function(e,n){return void 0===n&&(n={}),new Promise(function(o,t){!function(e,n,o){void 0===o&&(o={});var t=V&&V[l];J&&J[l]?J[l](e,n,JSON.stringify(o)):t?V[l].postMessage({reqId:e,method:n,data:o}):W?W.execute(l,e,n,o):"undefined"!=typeof window&&console.log("--invoke-isUnknown")}(i.add({resolve:o,reject:t},e+":"),e,n)})}),c=function(e,t){var r=n("storage:");return o(t,r),{setItem:function(n,o){return new Promise(function(t,i){var s=r.add({resolve:t,reject:i});e(s,"setItem",{keyName:n,keyValue:o})})},getItem:function(n){return new Promise(function(o,t){var i=r.add({resolve:o,reject:t});e(i,"getItem",{keyName:n})})},clear:function(){return new Promise(function(n,o){var t=r.add({resolve:n,reject:o});e(t,"clear",{})})}}}(function(e,n,o){void 0===o&&(o={});var t=V&&V[f];J&&J[f]?J[f](e,n,JSON.stringify(o)):t?V[f].postMessage({reqId:e,method:n,data:o}):W?W.execute(f,e,n,o):"undefined"!=typeof window&&console.log("--storage-isUnknown")},s),u=t(function(e){var n=V&&V[p];J&&J[p]?J[p](e):n?V[p].postMessage({reqId:e}):W?W.execute(p,e):"undefined"!=typeof window&&console.log("--getGeo-isUnknown")},p,s),L=t(function(e){var n=V&&V[g];J&&J[g]?J[g](e):n?V[g].postMessage({reqId:e}):W?W.execute(g,e):"undefined"!=typeof window&&console.log("--getQr-isUnknown")},g,s),Q=t(function(e){var n=V&&V[w];J&&J[w]?J[w](e):n?V[w].postMessage({reqId:e}):W?W.execute(w,e):"undefined"!=typeof window&&console.log("--getSMSCode-isUnknown")},w,s),_=t(function(e){var n=V&&V[v];J&&J[v]?J[v](e):n?V[v].postMessage({reqId:e}):W?W.execute(v,e):"undefined"!=typeof window&&console.log("--selectContact-isUnknown")},v,s),z=t(function(e){var n=V&&V[m];J&&J[m]?J[m](e):n?V[m].postMessage({reqId:e}):W?W.execute(m,e):"undefined"!=typeof window&&console.log("--openSettings-isUnknown")},m,s),K=t(function(e){var n=V&&V[k];J&&J[k]?J[k](e):n?V[k].postMessage({reqId:e}):W?W.execute(k,e):"undefined"!=typeof window&&console.log("--closeApplication-isUnknown")},k,s),X=t(function(e,n){var o=V&&V[I];J&&J[I]?J[I](e,n):o?V[I].postMessage({reqId:e,text:n}):W?W.execute(I,e,n):"undefined"!=typeof window&&console.log("--share-isUnknown")},I,s),Y=t(function(e,n){var o=V&&V[y];J&&J[y]?J[y](e,n):o?V[y].postMessage({reqId:e,text:n}):W?W.execute(y,e,n):"undefined"!=typeof window&&console.log("--setTitle-isUnknown")},y,s),Z=t(function(e,n){var o=V&&V[M];J&&J[M]?J[M](e,n):o?V[M].postMessage({reqId:e,text:n}):W?W.execute(M,e,n):"undefined"!=typeof window&&console.log("--copyToClipboard-isUnknown")},M,s),$=t(function(e,n,o){var t=J&&J[b],r=V&&V[b],i="image."+o.split(";")[0].split("/")[1],s=o.substr(o.indexOf(",")+1);t?J[b](e,n,i,s):r?V[b].postMessage({reqId:e,text:n,filename:i,base64Data:s}):W?W.execute(b,e,{text:n,filename:i,base64Data:s}):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},"shareImage",s),ee=t(function(e,n,o,t){var r=V&&V[b];J&&J[b]?J[b](e,n,o,t):r?V[b].postMessage({reqId:e,text:n,filename:o,base64Data:t}):W?W.execute(b,e,n,o,t):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},b,s),ne=t(function(e,n){if(!Array.isArray(n)||n.some(function(e){return e<1||e!==Math.floor(e)})||n.reduce(function(e,n){return e+n})>1e4)console.error("Pattern should be an array of positive integers no longer than 10000ms total");else{var o=V&&V[S];J&&J[S]?J[S](e,JSON.stringify(n)):o?V[S].postMessage({reqId:e,pattern:n}):W?W.execute(S,e,n):"undefined"!=typeof window&&console.log("--vibrate-isUnknown")}},S,s),oe=t(function(e){var n=V&&V[C];J&&J[C]?J[C](e):n?V[C].postMessage({reqId:e}):W?W.execute(C,e):"undefined"!=typeof window&&console.log("--enableScreenCapture-isUnknown")},C,s),te=t(function(e){var n=V&&V[h];J&&J[h]?J[h](e):n?V[h].postMessage({reqId:e}):W?W.execute(h,e):"undefined"!=typeof window&&console.log("--disableScreenCapture-isUnknown")},h,s),re=t(function(e,n){if(n.length>3)console.error("SetHeaderMenuItems: items count should not be more than 3");else{var o=J&&J[B],t=V&&V[B],r=JSON.stringify(n);o?J[B](e,r):t?V[B].postMessage({reqId:e,itemsJsonArray:r}):W?W.execute(B,e,r):"undefined"!=typeof window&&console.log("--setHeaderMenuItems-isUnknown")}},B,s),ie=t(function(e,n){var o=V&&V[q];J&&J[q]?J[q](e,n):o?V[q].postMessage({reqId:e,enabled:n}):W?W.execute(q,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowMode-isUnknown")},q,s),se=t(function(e){var n=V&&V[P];J&&J[P]?J[P](e):n?V[P].postMessage({reqId:e}):W?W.execute(P,e):"undefined"!=typeof window&&console.log("--getCustomBackArrowMode-isUnknown")},P,s),ae=t(function(e,n){var o=V&&V[A];J&&J[A]?J[A](e,n):o?V[A].postMessage({reqId:e,visible:n}):W?W.execute(A,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowVisible-isUnknown")},A,s),de=t(function(e,n){var o=V&&V[N];J&&J[N]?J[N](e,n):o?V[N].postMessage({reqId:e,transactionId:n}):console.log("--openPayment-isUnknown")},N,s),ce=t(function(e){var n=V&&V[O];J&&J[O]?J[O](e):n?V[O].postMessage({reqId:e}):W?W.execute(O,e):"undefined"!=typeof window&&console.log("--checkBiometry-isUnknown")},O,s),ue=t(function(e,n){var o=V&&V[D];J&&J[D]?J[D](e,n):o?V[D].postMessage({reqId:e,url:n}):console.log("--openExternalUrlMethod-isUnknown")},D,s),le=t(function(e){var n=V&&V[T];J&&J[T]?J[T](e):n?V[T].postMessage({reqId:e}):W?W.execute(T,e):"undefined"!=typeof window&&console.log("--enableSwipeBack-isUnknown")},T,s),fe=t(function(e){var n=V&&V[j];J&&J[j]?J[j](e):n?V[j].postMessage({reqId:e}):W?W.execute(j,e):"undefined"!=typeof window&&console.log("--disableSwipeBack-isUnknown")},j,s),pe=t(function(e,n){var o=V&&V[R];J&&J[R]?J[R](e,n):o?V[R].postMessage({reqId:e,mode:n}):W?W.execute(R,e,n):"undefined"!=typeof window&&console.log("--setNavigationItemMode-isUnknown")},R,s),ge=t(function(e){var n=V&&V[F];J&&J[F]?J[F](e):n?V[F].postMessage({reqId:e}):W?W.execute(F,e):"undefined"!=typeof window&&console.log("--getNavigationItemMode-isUnknown")},F,s),we=t(function(e){var n=V&&V[G];J&&J[G]?J[G](e):n?V[G].postMessage({reqId:e}):W?console.log("--getUserStepInfo-isWeb"):"undefined"!=typeof window&&console.log("--getUserStepInfo-isUnknown")},G,s),ve=a("isESimSupported"),me=a("activateESim",{transformToObject:function(e){return{activationCode:e[0]}}}),ke=a("readNFCData"),Ie=a("readNFCPassport",{transformToObject:function(e){return{passportNumber:e[0],dateOfBirth:e[1],expirationDate:e[2]}}}),ye=a("subscribeUserStepInfo"),Me=a("unsubscribeUserStepInfo"),be=a("openUserProfile");return{version:"0.7.2-canary.3",copyToClipboard:Z,invoke:d,storage:c,getMe:function(){return d(exports.EInvokeRequest.getMe)},getPhone:function(){return d(exports.EInvokeRequest.getPhone)},getContacts:function(){return d(exports.EInvokeRequest.getContacts)},getGeo:u,getQr:L,getSMSCode:Q,getUserProfile:function(e){return d(exports.EInvokeRequest.getUserProfile,{id:e})},openUserProfile:be,selectContact:_,enableNotifications:function(){return d(exports.EInvokeRequest.enableNotifications)},disableNotifications:function(){return d(exports.EInvokeRequest.disableNotifications)},enablePrivateMessaging:function(e){return d(exports.EInvokeRequest.enablePrivateMessaging,{appId:e})},disablePrivateMessaging:function(e){return d(exports.EInvokeRequest.disablePrivateMessaging,{appId:e})},openSettings:z,closeApplication:K,setTitle:Y,share:X,shareImage:$,shareFile:ee,setShakeHandler:function(e){J&&J[x]||V&&V[x]||W?window.onAituBridgeShake=e:"undefined"!=typeof window&&console.log("--setShakeHandler-isUnknown")},setTabActiveHandler:function(e){J&&J[U]||V&&V[U]||W?window.onAituBridgeTabActive=e:"undefined"!=typeof window&&console.log("--setTabActiveHandler-isUnknown")},vibrate:ne,isSupported:function(){var e=V&&window.webkit.messageHandlers.invoke;return Boolean(J||e||W)},supports:function(e){return J&&"function"==typeof J[e]||V&&V[e]&&"function"==typeof V[e].postMessage||W&&"function"==typeof W[e]},sub:s,enableScreenCapture:oe,disableScreenCapture:te,setHeaderMenuItems:re,setHeaderMenuItemClickHandler:function(e){J&&J[E]||V&&V[E]||W?window.onAituBridgeHeaderMenuItemClick=e:"undefined"!=typeof window&&console.log("--setHeaderMenuItemClickHandler-isUnknown")},setCustomBackArrowMode:ie,getCustomBackArrowMode:se,setCustomBackArrowVisible:ae,openPayment:de,setCustomBackArrowOnClickHandler:function(e){J&&J[H]||V&&V[H]||W?window.onAituBridgeBackArrowClick=e:"undefined"!=typeof window&&console.log("--setCustomBackArrowOnClickHandler-isUnknown")},checkBiometry:ce,openExternalUrl:ue,enableSwipeBack:le,disableSwipeBack:fe,setNavigationItemMode:pe,getNavigationItemMode:ge,getUserStepInfo:we,isESimSupported:ve,activateESim:me,readNFCData:ke,subscribeUserStepInfo:ye,unsubscribeUserStepInfo:Me,readNFCPassport:Ie}}();exports.classifyBridgeError=function(e){if(e.msg){if(e.msg.startsWith("permission deny"))return exports.BridgeErrors.PermissionDenyError;if(e.msg.startsWith("permission security deny"))return exports.BridgeErrors.PermissionSecurityDenyError}return exports.BridgeErrors.OtherError},exports.default=L;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|