@grabjs/superapp-sdk 2.0.0-beta.55 → 2.0.0-beta.57
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/api-reference/api.json +4661 -6795
- package/dist/index.d.ts +331 -1210
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,37 +6,18 @@ import { GenericSchema } from 'valibot';
|
|
|
6
6
|
* @group Modules
|
|
7
7
|
* @category Identity
|
|
8
8
|
*
|
|
9
|
-
* @example
|
|
10
|
-
* **Production environment with redirect mode:**
|
|
11
|
-
* ```typescript
|
|
12
|
-
* {
|
|
13
|
-
* clientId: 'your-client-id',
|
|
14
|
-
* redirectUri: 'https://your-app.com/callback',
|
|
15
|
-
* scope: 'openid profile',
|
|
16
|
-
* environment: 'production',
|
|
17
|
-
* responseMode: 'redirect'
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* **Staging environment with in_place mode:**
|
|
23
|
-
* ```typescript
|
|
24
|
-
* {
|
|
25
|
-
* clientId: 'staging-client-id',
|
|
26
|
-
* redirectUri: 'https://staging-app.com/callback',
|
|
27
|
-
* scope: 'openid',
|
|
28
|
-
* environment: 'staging',
|
|
29
|
-
* responseMode: 'in_place'
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
9
|
* @public
|
|
34
10
|
*/
|
|
35
11
|
export declare type AuthorizeRequest = {
|
|
12
|
+
/** OAuth client identifier issued to your application. */
|
|
36
13
|
clientId: string;
|
|
14
|
+
/** OAuth redirect URI registered for your application. */
|
|
37
15
|
redirectUri: string;
|
|
16
|
+
/** OAuth scopes requested for the authorization flow (for example, `"openid profile.read phone mobile.storage"`). */
|
|
38
17
|
scope: string;
|
|
18
|
+
/** Target authorization environment (for example, `"staging"` or `"production"`). */
|
|
39
19
|
environment: 'staging' | 'production';
|
|
20
|
+
/** Authorization response mode for result delivery (for example, `"redirect"` or `"in_place"`). */
|
|
40
21
|
responseMode?: 'redirect' | 'in_place';
|
|
41
22
|
};
|
|
42
23
|
|
|
@@ -46,16 +27,6 @@ export declare type AuthorizeRequest = {
|
|
|
46
27
|
* @group Modules
|
|
47
28
|
* @category Identity
|
|
48
29
|
*
|
|
49
|
-
* @remarks
|
|
50
|
-
* This response can have the following status codes:
|
|
51
|
-
* - `200`: Authorization completed successfully (native in_place flow). The `result` contains the authorization code, state, and PKCE artifacts (`codeVerifier`, `nonce`, `redirectUri`).
|
|
52
|
-
* - `204`: No content - user cancelled or flow completed without result data.
|
|
53
|
-
* - `302`: Redirect in progress (web redirect flow). The page will navigate away.
|
|
54
|
-
* - `400`: Bad request - missing required OAuth parameters or invalid configuration.
|
|
55
|
-
* - `403`: Forbidden - client not authorized for the requested scope.
|
|
56
|
-
* - `500`: Internal server error - unexpected error during native authorization.
|
|
57
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
58
|
-
*
|
|
59
30
|
* @public
|
|
60
31
|
*/
|
|
61
32
|
export declare type AuthorizeResponse = SDKOkResponse<AuthorizeResult> | SDKNoContentResponse | SDKRedirectResponse | SDKErrorResponse<400> | SDKErrorResponse<403> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -67,24 +38,18 @@ export declare type AuthorizeResponse = SDKOkResponse<AuthorizeResult> | SDKNoCo
|
|
|
67
38
|
* @group Modules
|
|
68
39
|
* @category Identity
|
|
69
40
|
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* {
|
|
73
|
-
* code: 'auth-code-abc123',
|
|
74
|
-
* state: 'csrf-state-xyz789',
|
|
75
|
-
* codeVerifier: 'code-verifier-123',
|
|
76
|
-
* nonce: 'nonce-abc',
|
|
77
|
-
* redirectUri: 'https://your-app.com/current-page'
|
|
78
|
-
* }
|
|
79
|
-
* ```
|
|
80
|
-
*
|
|
81
41
|
* @public
|
|
82
42
|
*/
|
|
83
43
|
export declare type AuthorizeResult = {
|
|
44
|
+
/** Authorization code returned by the OAuth flow. */
|
|
84
45
|
code: string;
|
|
46
|
+
/** State value used to correlate and validate the flow. */
|
|
85
47
|
state: string;
|
|
48
|
+
/** PKCE code verifier used for token exchange. */
|
|
86
49
|
codeVerifier: string;
|
|
50
|
+
/** Nonce value used to bind and validate the authorization response. */
|
|
87
51
|
nonce: string;
|
|
52
|
+
/** OAuth redirect URI registered for your application. */
|
|
88
53
|
redirectUri: string;
|
|
89
54
|
};
|
|
90
55
|
|
|
@@ -94,27 +59,10 @@ export declare type AuthorizeResult = {
|
|
|
94
59
|
* @group Modules
|
|
95
60
|
* @category Platform
|
|
96
61
|
*
|
|
97
|
-
* @remarks
|
|
98
|
-
* This response can have the following status codes:
|
|
99
|
-
* - `204`: Back navigation triggered successfully.
|
|
100
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
101
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
102
|
-
*
|
|
103
62
|
* @public
|
|
104
63
|
*/
|
|
105
64
|
export declare type BackResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
106
65
|
|
|
107
|
-
/**
|
|
108
|
-
* Result when triggering platform back navigation.
|
|
109
|
-
* This operation returns no data on success.
|
|
110
|
-
*
|
|
111
|
-
* @group Modules
|
|
112
|
-
* @category Platform
|
|
113
|
-
*
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
export declare type BackResult = void;
|
|
117
|
-
|
|
118
66
|
/**
|
|
119
67
|
* Base class for all modules.
|
|
120
68
|
*
|
|
@@ -251,12 +199,17 @@ export declare class CameraModule extends BaseModule {
|
|
|
251
199
|
/**
|
|
252
200
|
* Opens the native camera to scan a QR code.
|
|
253
201
|
*
|
|
254
|
-
* @param request - Configuration for the QR code scanning
|
|
202
|
+
* @param request - Configuration for the QR code scanning.
|
|
255
203
|
*
|
|
256
|
-
* @returns
|
|
204
|
+
* @returns This method can return the following `status_code` values:
|
|
205
|
+
* - `200` (OK): Successfully scanned QR code. The `result` contains {@link ScanQRCodeResult}.
|
|
206
|
+
* - `204` (No Content): User cancelled the QR code scanning.
|
|
207
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
208
|
+
* - `403` (Forbidden): Camera permission is not enabled for the Grab app.
|
|
209
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
210
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
257
211
|
*
|
|
258
212
|
* @example
|
|
259
|
-
* **Simple usage**
|
|
260
213
|
* ```typescript
|
|
261
214
|
* import { CameraModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
262
215
|
*
|
|
@@ -335,12 +288,15 @@ export declare class CheckoutModule extends BaseModule {
|
|
|
335
288
|
* Pass the transaction parameters returned from that API call as the `request` argument.
|
|
336
289
|
* Calling this method without a valid pre-created transaction will result in a checkout failure.
|
|
337
290
|
*
|
|
338
|
-
* @param request - Payment transaction details
|
|
291
|
+
* @param request - Payment transaction details.
|
|
339
292
|
*
|
|
340
|
-
* @returns
|
|
293
|
+
* @returns This method can return the following `status_code` values:
|
|
294
|
+
* - `200` (OK): Checkout completed successfully. The `result` contains {@link TriggerCheckoutResult}.
|
|
295
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
296
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
297
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
341
298
|
*
|
|
342
299
|
* @example
|
|
343
|
-
* **Simple usage**
|
|
344
300
|
* ```typescript
|
|
345
301
|
* import { CheckoutModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
346
302
|
*
|
|
@@ -393,51 +349,21 @@ export declare class CheckoutModule extends BaseModule {
|
|
|
393
349
|
* @group Modules
|
|
394
350
|
* @category Identity
|
|
395
351
|
*
|
|
396
|
-
* @remarks
|
|
397
|
-
* This response returns status code `204` when artifacts are cleared successfully.
|
|
398
352
|
*
|
|
399
353
|
* @public
|
|
400
354
|
*/
|
|
401
355
|
export declare type ClearAuthorizationArtifactsResponse = SDKNoContentResponse;
|
|
402
356
|
|
|
403
|
-
/**
|
|
404
|
-
* Result object for clearing authorization artifacts.
|
|
405
|
-
* This operation returns no data on success.
|
|
406
|
-
*
|
|
407
|
-
* @group Modules
|
|
408
|
-
* @category Identity
|
|
409
|
-
*
|
|
410
|
-
* @public
|
|
411
|
-
*/
|
|
412
|
-
export declare type ClearAuthorizationArtifactsResult = void;
|
|
413
|
-
|
|
414
357
|
/**
|
|
415
358
|
* Response when closing the container.
|
|
416
359
|
*
|
|
417
360
|
* @group Modules
|
|
418
361
|
* @category Container
|
|
419
362
|
*
|
|
420
|
-
* @remarks
|
|
421
|
-
* This response can have the following status codes:
|
|
422
|
-
* - `204`: Container closed successfully.
|
|
423
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
424
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
425
|
-
*
|
|
426
363
|
* @public
|
|
427
364
|
*/
|
|
428
365
|
export declare type CloseResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
429
366
|
|
|
430
|
-
/**
|
|
431
|
-
* Result when closing the container.
|
|
432
|
-
* This operation returns no data on success.
|
|
433
|
-
*
|
|
434
|
-
* @group Modules
|
|
435
|
-
* @category Container
|
|
436
|
-
*
|
|
437
|
-
* @public
|
|
438
|
-
*/
|
|
439
|
-
export declare type CloseResult = void;
|
|
440
|
-
|
|
441
367
|
/**
|
|
442
368
|
* Constants for container analytics event data.
|
|
443
369
|
*
|
|
@@ -513,12 +439,15 @@ export declare class ContainerModule extends BaseModule {
|
|
|
513
439
|
/**
|
|
514
440
|
* Set the background color of the container header.
|
|
515
441
|
*
|
|
516
|
-
* @param request - The background color to set (hex format, e.g., '#ffffff').
|
|
442
|
+
* @param request - The background color to set (hex format, e.g., '#ffffff').
|
|
517
443
|
*
|
|
518
|
-
* @returns
|
|
444
|
+
* @returns This method can return the following `status_code` values:
|
|
445
|
+
* - `204` (No Content): Background color set successfully.
|
|
446
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
447
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
448
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
519
449
|
*
|
|
520
450
|
* @example
|
|
521
|
-
* **Simple usage**
|
|
522
451
|
* ```typescript
|
|
523
452
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
524
453
|
*
|
|
@@ -544,12 +473,15 @@ export declare class ContainerModule extends BaseModule {
|
|
|
544
473
|
/**
|
|
545
474
|
* Set the title of the container header.
|
|
546
475
|
*
|
|
547
|
-
* @param request - The title text to display in the header.
|
|
476
|
+
* @param request - The title text to display in the header.
|
|
548
477
|
*
|
|
549
|
-
* @returns
|
|
478
|
+
* @returns This method can return the following `status_code` values:
|
|
479
|
+
* - `204` (No Content): Title set successfully.
|
|
480
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
481
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
482
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
550
483
|
*
|
|
551
484
|
* @example
|
|
552
|
-
* **Simple usage**
|
|
553
485
|
* ```typescript
|
|
554
486
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
555
487
|
*
|
|
@@ -575,10 +507,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
575
507
|
/**
|
|
576
508
|
* Hide the back button on the container header.
|
|
577
509
|
*
|
|
578
|
-
* @returns
|
|
510
|
+
* @returns This method can return the following `status_code` values:
|
|
511
|
+
* - `204` (No Content): Back button hidden successfully.
|
|
512
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
513
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
579
514
|
*
|
|
580
515
|
* @example
|
|
581
|
-
* **Simple usage**
|
|
582
516
|
* ```typescript
|
|
583
517
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
584
518
|
*
|
|
@@ -604,10 +538,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
604
538
|
/**
|
|
605
539
|
* Show the back button on the container header.
|
|
606
540
|
*
|
|
607
|
-
* @returns
|
|
541
|
+
* @returns This method can return the following `status_code` values:
|
|
542
|
+
* - `204` (No Content): Back button shown successfully.
|
|
543
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
544
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
608
545
|
*
|
|
609
546
|
* @example
|
|
610
|
-
* **Simple usage**
|
|
611
547
|
* ```typescript
|
|
612
548
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
613
549
|
*
|
|
@@ -633,10 +569,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
633
569
|
/**
|
|
634
570
|
* Hide the refresh button on the container header.
|
|
635
571
|
*
|
|
636
|
-
* @returns
|
|
572
|
+
* @returns This method can return the following `status_code` values:
|
|
573
|
+
* - `204` (No Content): Refresh button hidden successfully.
|
|
574
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
575
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
637
576
|
*
|
|
638
577
|
* @example
|
|
639
|
-
* **Simple usage**
|
|
640
578
|
* ```typescript
|
|
641
579
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
642
580
|
*
|
|
@@ -662,10 +600,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
662
600
|
/**
|
|
663
601
|
* Show the refresh button on the container header.
|
|
664
602
|
*
|
|
665
|
-
* @returns
|
|
603
|
+
* @returns This method can return the following `status_code` values:
|
|
604
|
+
* - `204` (No Content): Refresh button shown successfully.
|
|
605
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
606
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
666
607
|
*
|
|
667
608
|
* @example
|
|
668
|
-
* **Simple usage**
|
|
669
609
|
* ```typescript
|
|
670
610
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
671
611
|
*
|
|
@@ -691,10 +631,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
691
631
|
/**
|
|
692
632
|
* Close the container and return to the previous screen.
|
|
693
633
|
*
|
|
694
|
-
* @returns
|
|
634
|
+
* @returns This method can return the following `status_code` values:
|
|
635
|
+
* - `204` (No Content): Container closed successfully.
|
|
636
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
637
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
695
638
|
*
|
|
696
639
|
* @example
|
|
697
|
-
* **Simple usage**
|
|
698
640
|
* ```typescript
|
|
699
641
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
700
642
|
*
|
|
@@ -720,10 +662,13 @@ export declare class ContainerModule extends BaseModule {
|
|
|
720
662
|
/**
|
|
721
663
|
* Notify the Grab SuperApp that the page content has loaded.
|
|
722
664
|
*
|
|
723
|
-
* @returns
|
|
665
|
+
* @returns This method can return the following `status_code` values:
|
|
666
|
+
* - `200` (OK): Notification sent successfully.
|
|
667
|
+
* - `204` (No Content): Operation completed successfully.
|
|
668
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
669
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
724
670
|
*
|
|
725
671
|
* @example
|
|
726
|
-
* **Simple usage**
|
|
727
672
|
* ```typescript
|
|
728
673
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
729
674
|
*
|
|
@@ -752,10 +697,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
752
697
|
* @remarks
|
|
753
698
|
* Remember to call {@link ContainerModule.hideLoader} when the operation completes.
|
|
754
699
|
*
|
|
755
|
-
* @returns
|
|
700
|
+
* @returns This method can return the following `status_code` values:
|
|
701
|
+
* - `204` (No Content): Loader shown successfully.
|
|
702
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
703
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
756
704
|
*
|
|
757
705
|
* @example
|
|
758
|
-
* **Simple usage**
|
|
759
706
|
* ```typescript
|
|
760
707
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
761
708
|
*
|
|
@@ -784,10 +731,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
784
731
|
* @remarks
|
|
785
732
|
* Should be called when the entry point has finished loading.
|
|
786
733
|
*
|
|
787
|
-
* @returns
|
|
734
|
+
* @returns This method can return the following `status_code` values:
|
|
735
|
+
* - `204` (No Content): Loader hidden successfully.
|
|
736
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
737
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
788
738
|
*
|
|
789
739
|
* @example
|
|
790
|
-
* **Simple usage**
|
|
791
740
|
* ```typescript
|
|
792
741
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
793
742
|
*
|
|
@@ -816,12 +765,15 @@ export declare class ContainerModule extends BaseModule {
|
|
|
816
765
|
* @remarks
|
|
817
766
|
* Call this method to open the specified URL in an external browser (outside of the Grab app).
|
|
818
767
|
*
|
|
819
|
-
* @param request - The URL to open in the external browser.
|
|
768
|
+
* @param request - The URL to open in the external browser.
|
|
820
769
|
*
|
|
821
|
-
* @returns
|
|
770
|
+
* @returns This method can return the following `status_code` values:
|
|
771
|
+
* - `204` (No Content): External link opened successfully.
|
|
772
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
773
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
774
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
822
775
|
*
|
|
823
776
|
* @example
|
|
824
|
-
* **Simple usage**
|
|
825
777
|
* ```typescript
|
|
826
778
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
827
779
|
*
|
|
@@ -847,12 +799,14 @@ export declare class ContainerModule extends BaseModule {
|
|
|
847
799
|
/**
|
|
848
800
|
* Notify the client that the user has tapped a call-to-action (CTA).
|
|
849
801
|
*
|
|
850
|
-
* @param request - The action identifier for the CTA that was tapped.
|
|
802
|
+
* @param request - The action identifier for the CTA that was tapped.
|
|
851
803
|
*
|
|
852
|
-
* @returns
|
|
804
|
+
* @returns This method can return the following `status_code` values:
|
|
805
|
+
* - `200` (OK): CTA tap notification sent successfully.
|
|
806
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
807
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
853
808
|
*
|
|
854
809
|
* @example
|
|
855
|
-
* **Simple usage**
|
|
856
810
|
* ```typescript
|
|
857
811
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
858
812
|
*
|
|
@@ -885,14 +839,17 @@ export declare class ContainerModule extends BaseModule {
|
|
|
885
839
|
* - **States:** {@link ContainerAnalyticsEventState}
|
|
886
840
|
* - **Names:** {@link ContainerAnalyticsEventName}
|
|
887
841
|
*
|
|
888
|
-
* @param request - Analytics event details
|
|
889
|
-
*
|
|
890
|
-
* @returns Confirmation of whether the analytics event was sent successfully. See {@link SendAnalyticsEventResponse}.
|
|
842
|
+
* @param request - Analytics event details.
|
|
891
843
|
*
|
|
892
844
|
* @see {@link ContainerAnalyticsEventState}, {@link ContainerAnalyticsEventName}
|
|
893
845
|
*
|
|
846
|
+
* @returns This method can return the following `status_code` values:
|
|
847
|
+
* - `204` (No Content): Analytics event sent successfully.
|
|
848
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
849
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
850
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
851
|
+
*
|
|
894
852
|
* @example
|
|
895
|
-
* **Simple usage**
|
|
896
853
|
* ```typescript
|
|
897
854
|
* import {
|
|
898
855
|
* ContainerModule,
|
|
@@ -930,10 +887,11 @@ export declare class ContainerModule extends BaseModule {
|
|
|
930
887
|
* @remarks
|
|
931
888
|
* Call this method to verify the connection status before using other features.
|
|
932
889
|
*
|
|
933
|
-
* @returns
|
|
890
|
+
* @returns This method can return the following `status_code` values:
|
|
891
|
+
* - `200` (OK): Connected to Grab SuperApp. The `result` contains {@link IsConnectedResult}.
|
|
892
|
+
* - `404` (Not Found): Not connected to Grab SuperApp.
|
|
934
893
|
*
|
|
935
894
|
* @example
|
|
936
|
-
* **Simple usage**
|
|
937
895
|
* ```typescript
|
|
938
896
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
939
897
|
*
|
|
@@ -964,10 +922,12 @@ export declare class ContainerModule extends BaseModule {
|
|
|
964
922
|
* Parse with `JSON.parse(result.result)` to use as an object.
|
|
965
923
|
* Session parameters can contain primitives, base64 encoded strings, or nested objects.
|
|
966
924
|
*
|
|
967
|
-
* @returns
|
|
925
|
+
* @returns This method can return the following `status_code` values:
|
|
926
|
+
* - `200` (OK): Session parameters retrieved successfully.
|
|
927
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
928
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
968
929
|
*
|
|
969
930
|
* @example
|
|
970
|
-
* **Simple usage**
|
|
971
931
|
* ```typescript
|
|
972
932
|
* import { ContainerModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
973
933
|
*
|
|
@@ -1036,10 +996,15 @@ export declare class DeviceModule extends BaseModule {
|
|
|
1036
996
|
*
|
|
1037
997
|
* @requiredOAuthScope mobile.device
|
|
1038
998
|
*
|
|
1039
|
-
* @returns
|
|
999
|
+
* @returns This method can return the following `status_code` values:
|
|
1000
|
+
* - `200` (OK): eSIM capability was checked successfully. The `result` contains {@link IsEsimSupportedResult}.
|
|
1001
|
+
* - `403` (Forbidden): Client is not authorized to query eSIM capability.
|
|
1002
|
+
* - `424` (Failed Dependency): Dependency error occurred while checking eSIM support.
|
|
1003
|
+
* - `426` (Upgrade Required): Feature requires Grab app version 5.402 or above.
|
|
1004
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
1005
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
1040
1006
|
*
|
|
1041
1007
|
* @example
|
|
1042
|
-
* **Simple usage**
|
|
1043
1008
|
* ```typescript
|
|
1044
1009
|
* import { DeviceModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
1045
1010
|
*
|
|
@@ -1081,38 +1046,6 @@ export declare class DeviceModule extends BaseModule {
|
|
|
1081
1046
|
* @group Modules
|
|
1082
1047
|
* @category Splash Screen
|
|
1083
1048
|
*
|
|
1084
|
-
* @remarks
|
|
1085
|
-
* Possible status codes:
|
|
1086
|
-
* - `204`: No splash screen shown, or it was closed successfully.
|
|
1087
|
-
* - `400`: Invalid input (Grablet / client validation error).
|
|
1088
|
-
* - `403`: Missing consent for the required OAuth scope.
|
|
1089
|
-
* - `500`: Unexpected error while invoking `JSBridge`.
|
|
1090
|
-
* - `501`: Not in the Grab app WebView environment.
|
|
1091
|
-
*
|
|
1092
|
-
* @example
|
|
1093
|
-
* **Success (204):**
|
|
1094
|
-
* ```typescript
|
|
1095
|
-
* { status_code: 204 }
|
|
1096
|
-
* ```
|
|
1097
|
-
*
|
|
1098
|
-
* @example
|
|
1099
|
-
* **Bad request (400):**
|
|
1100
|
-
* ```typescript
|
|
1101
|
-
* {
|
|
1102
|
-
* status_code: 400,
|
|
1103
|
-
* error: 'InvalidInput: client input not valid'
|
|
1104
|
-
* }
|
|
1105
|
-
* ```
|
|
1106
|
-
*
|
|
1107
|
-
* @example
|
|
1108
|
-
* **Forbidden (403):**
|
|
1109
|
-
* ```typescript
|
|
1110
|
-
* {
|
|
1111
|
-
* status_code: 403,
|
|
1112
|
-
* error: 'NoAccess: client requesting for not consented scope'
|
|
1113
|
-
* }
|
|
1114
|
-
* ```
|
|
1115
|
-
*
|
|
1116
1049
|
* @public
|
|
1117
1050
|
*/
|
|
1118
1051
|
export declare type DismissSplashScreenResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<403> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1123,18 +1056,12 @@ export declare type DismissSplashScreenResponse = SDKNoContentResponse | SDKErro
|
|
|
1123
1056
|
* @group Modules
|
|
1124
1057
|
* @category File
|
|
1125
1058
|
*
|
|
1126
|
-
* @example
|
|
1127
|
-
* ```typescript
|
|
1128
|
-
* {
|
|
1129
|
-
* fileUrl: 'https://example.com/report.pdf',
|
|
1130
|
-
* fileName: 'report.pdf'
|
|
1131
|
-
* }
|
|
1132
|
-
* ```
|
|
1133
|
-
*
|
|
1134
1059
|
* @public
|
|
1135
1060
|
*/
|
|
1136
1061
|
export declare type DownloadFileRequest = {
|
|
1062
|
+
/** Target file name used for the downloaded file (for example, `"report.pdf"`). */
|
|
1137
1063
|
fileName: string;
|
|
1064
|
+
/** Source file URL to download (for example, `"https://example.com/report.pdf"`). */
|
|
1138
1065
|
fileUrl: string;
|
|
1139
1066
|
};
|
|
1140
1067
|
|
|
@@ -1144,62 +1071,16 @@ export declare type DownloadFileRequest = {
|
|
|
1144
1071
|
* @group Modules
|
|
1145
1072
|
* @category File
|
|
1146
1073
|
*
|
|
1147
|
-
* @remarks
|
|
1148
|
-
* This response can have the following status codes:
|
|
1149
|
-
* - `204`: File downloaded successfully.
|
|
1150
|
-
* - `400`: Invalid request parameters such as invalid file URL, invalid domain, or missing file name.
|
|
1151
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1152
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1153
|
-
*
|
|
1154
1074
|
* @public
|
|
1155
1075
|
*/
|
|
1156
1076
|
export declare type DownloadFileResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1157
1077
|
|
|
1158
|
-
/**
|
|
1159
|
-
* Result data structure for file download operations.
|
|
1160
|
-
*
|
|
1161
|
-
* @group Modules
|
|
1162
|
-
* @category File
|
|
1163
|
-
*
|
|
1164
|
-
* @remarks
|
|
1165
|
-
* This is a void result type as successful downloads return status code `204` with no content.
|
|
1166
|
-
*
|
|
1167
|
-
* @public
|
|
1168
|
-
*/
|
|
1169
|
-
export declare type DownloadFileResult = void;
|
|
1170
|
-
|
|
1171
1078
|
/**
|
|
1172
1079
|
* DRM content configuration for playback.
|
|
1173
1080
|
*
|
|
1174
1081
|
* @group Modules
|
|
1175
1082
|
* @category Media
|
|
1176
1083
|
*
|
|
1177
|
-
* @remarks
|
|
1178
|
-
* Configuration object containing DRM license information, content URLs, and playback settings.
|
|
1179
|
-
* The exact structure depends on the DRM provider (e.g., FairPlay, Widevine).
|
|
1180
|
-
*
|
|
1181
|
-
* @example
|
|
1182
|
-
* **Widevine DRM configuration:**
|
|
1183
|
-
* ```typescript
|
|
1184
|
-
* {
|
|
1185
|
-
* contentId: 'movie-123',
|
|
1186
|
-
* licenseUrl: 'https://license.example.com/widevine',
|
|
1187
|
-
* contentUrl: 'https://cdn.example.com/video.mp4',
|
|
1188
|
-
* headers: { 'Authorization': 'Bearer token123' }
|
|
1189
|
-
* }
|
|
1190
|
-
* ```
|
|
1191
|
-
*
|
|
1192
|
-
* @example
|
|
1193
|
-
* **FairPlay DRM configuration:**
|
|
1194
|
-
* ```typescript
|
|
1195
|
-
* {
|
|
1196
|
-
* assetId: 'content-456',
|
|
1197
|
-
* certificateUrl: 'https://fairplay.example.com/cert',
|
|
1198
|
-
* licenseUrl: 'https://fairplay.example.com/license',
|
|
1199
|
-
* contentUrl: 'https://cdn.example.com/video.m3u8'
|
|
1200
|
-
* }
|
|
1201
|
-
* ```
|
|
1202
|
-
*
|
|
1203
1084
|
* @public
|
|
1204
1085
|
*/
|
|
1205
1086
|
export declare type DRMContentConfig = Record<string, unknown>;
|
|
@@ -1210,45 +1091,16 @@ export declare type DRMContentConfig = Record<string, unknown>;
|
|
|
1210
1091
|
* @group Modules
|
|
1211
1092
|
* @category Media
|
|
1212
1093
|
*
|
|
1213
|
-
* @example
|
|
1214
|
-
* **Playback started event:**
|
|
1215
|
-
* ```typescript
|
|
1216
|
-
* {
|
|
1217
|
-
* type: 'START_PLAYBACK',
|
|
1218
|
-
* titleId: 'movie-123',
|
|
1219
|
-
* position: 0,
|
|
1220
|
-
* length: 3600
|
|
1221
|
-
* }
|
|
1222
|
-
* ```
|
|
1223
|
-
*
|
|
1224
|
-
* @example
|
|
1225
|
-
* **Playback progress event:**
|
|
1226
|
-
* ```typescript
|
|
1227
|
-
* {
|
|
1228
|
-
* type: 'PROGRESS_PLAYBACK',
|
|
1229
|
-
* titleId: 'movie-123',
|
|
1230
|
-
* position: 120,
|
|
1231
|
-
* length: 3600
|
|
1232
|
-
* }
|
|
1233
|
-
* ```
|
|
1234
|
-
*
|
|
1235
|
-
* @example
|
|
1236
|
-
* **Playback error event:**
|
|
1237
|
-
* ```typescript
|
|
1238
|
-
* {
|
|
1239
|
-
* type: 'ERROR_PLAYBACK',
|
|
1240
|
-
* titleId: 'movie-123',
|
|
1241
|
-
* position: 300,
|
|
1242
|
-
* length: 3600
|
|
1243
|
-
* }
|
|
1244
|
-
* ```
|
|
1245
|
-
*
|
|
1246
1094
|
* @public
|
|
1247
1095
|
*/
|
|
1248
1096
|
export declare type DRMPlaybackEvent = {
|
|
1097
|
+
/** Length value. */
|
|
1249
1098
|
length: number;
|
|
1099
|
+
/** Playback position in milliseconds. */
|
|
1250
1100
|
position: number;
|
|
1101
|
+
/** Title id value. */
|
|
1251
1102
|
titleId: string;
|
|
1103
|
+
/** Playback event type. */
|
|
1252
1104
|
type: 'START_PLAYBACK' | 'PROGRESS_PLAYBACK' | 'START_SEEK' | 'STOP_SEEK' | 'STOP_PLAYBACK' | 'CLOSE_PLAYBACK' | 'PAUSE_PLAYBACK' | 'RESUME_PLAYBACK' | 'FAST_FORWARD_PLAYBACK' | 'REWIND_PLAYBACK' | 'ERROR_PLAYBACK' | 'CHANGE_VOLUME';
|
|
1253
1105
|
};
|
|
1254
1106
|
|
|
@@ -1258,16 +1110,6 @@ export declare type DRMPlaybackEvent = {
|
|
|
1258
1110
|
* @group Modules
|
|
1259
1111
|
* @category Profile
|
|
1260
1112
|
*
|
|
1261
|
-
* @remarks
|
|
1262
|
-
* This response can have the following status codes:
|
|
1263
|
-
* - `200`: Email fetched successfully. The `result` contains the email address.
|
|
1264
|
-
* - `204`: No content - email not available.
|
|
1265
|
-
* - `400`: Invalid request - the request was malformed.
|
|
1266
|
-
* - `403`: Forbidden - client not authorized to access user profile data.
|
|
1267
|
-
* - `426`: Upgrade Required - feature requires Grab app version 5.399 or above.
|
|
1268
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1269
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1270
|
-
*
|
|
1271
1113
|
* @public
|
|
1272
1114
|
*/
|
|
1273
1115
|
export declare type FetchEmailResponse = SDKOkResponse<FetchEmailResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<403> | SDKErrorResponse<426> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1278,14 +1120,10 @@ export declare type FetchEmailResponse = SDKOkResponse<FetchEmailResult> | SDKNo
|
|
|
1278
1120
|
* @group Modules
|
|
1279
1121
|
* @category Profile
|
|
1280
1122
|
*
|
|
1281
|
-
* @example
|
|
1282
|
-
* ```typescript
|
|
1283
|
-
* { email: 'user@example.com' }
|
|
1284
|
-
* ```
|
|
1285
|
-
*
|
|
1286
1123
|
* @public
|
|
1287
1124
|
*/
|
|
1288
1125
|
export declare type FetchEmailResult = {
|
|
1126
|
+
/** Email address used for profile verification (for example, `"john.doe@example.com"`). */
|
|
1289
1127
|
email: string;
|
|
1290
1128
|
};
|
|
1291
1129
|
|
|
@@ -1323,12 +1161,15 @@ export declare class FileModule extends BaseModule {
|
|
|
1323
1161
|
/**
|
|
1324
1162
|
* Downloads a file through `JSBridge`.
|
|
1325
1163
|
*
|
|
1326
|
-
* @param request - File
|
|
1164
|
+
* @param request - File download request parameters.
|
|
1327
1165
|
*
|
|
1328
|
-
* @returns
|
|
1166
|
+
* @returns This method can return the following `status_code` values:
|
|
1167
|
+
* - `204` (No Content): File downloaded successfully.
|
|
1168
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
1169
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
1170
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
1329
1171
|
*
|
|
1330
1172
|
* @example
|
|
1331
|
-
* **Simple usage**
|
|
1332
1173
|
* ```typescript
|
|
1333
1174
|
* import { FileModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
1334
1175
|
*
|
|
@@ -1362,12 +1203,6 @@ export declare class FileModule extends BaseModule {
|
|
|
1362
1203
|
* @group Modules
|
|
1363
1204
|
* @category Identity
|
|
1364
1205
|
*
|
|
1365
|
-
* @remarks
|
|
1366
|
-
* This response can have the following status codes:
|
|
1367
|
-
* - `200`: All artifacts present. The `result` contains the PKCE artifacts needed for token exchange.
|
|
1368
|
-
* - `204`: No artifacts yet - authorization has not been initiated.
|
|
1369
|
-
* - `400`: Inconsistent state - possible data corruption in storage.
|
|
1370
|
-
*
|
|
1371
1206
|
* @public
|
|
1372
1207
|
*/
|
|
1373
1208
|
export declare type GetAuthorizationArtifactsResponse = SDKOkResponse<GetAuthorizationArtifactsResult> | SDKNoContentResponse | SDKErrorResponse<400>;
|
|
@@ -1379,23 +1214,16 @@ export declare type GetAuthorizationArtifactsResponse = SDKOkResponse<GetAuthori
|
|
|
1379
1214
|
* @group Modules
|
|
1380
1215
|
* @category Identity
|
|
1381
1216
|
*
|
|
1382
|
-
* @example
|
|
1383
|
-
* **All artifacts present:**
|
|
1384
|
-
* ```typescript
|
|
1385
|
-
* {
|
|
1386
|
-
* state: 'csrf-state-xyz789',
|
|
1387
|
-
* codeVerifier: 'code-verifier-123',
|
|
1388
|
-
* nonce: 'nonce-abc',
|
|
1389
|
-
* redirectUri: 'https://your-app.com/callback'
|
|
1390
|
-
* }
|
|
1391
|
-
* ```
|
|
1392
|
-
*
|
|
1393
1217
|
* @public
|
|
1394
1218
|
*/
|
|
1395
1219
|
export declare type GetAuthorizationArtifactsResult = {
|
|
1220
|
+
/** State value used to correlate and validate the flow. */
|
|
1396
1221
|
state: string;
|
|
1222
|
+
/** PKCE code verifier used for token exchange. */
|
|
1397
1223
|
codeVerifier: string;
|
|
1224
|
+
/** Nonce value used to bind and validate the authorization response. */
|
|
1398
1225
|
nonce: string;
|
|
1226
|
+
/** OAuth redirect URI registered for your application. */
|
|
1399
1227
|
redirectUri: string;
|
|
1400
1228
|
};
|
|
1401
1229
|
|
|
@@ -1405,14 +1233,10 @@ export declare type GetAuthorizationArtifactsResult = {
|
|
|
1405
1233
|
* @group Modules
|
|
1406
1234
|
* @category Storage
|
|
1407
1235
|
*
|
|
1408
|
-
* @example
|
|
1409
|
-
* ```typescript
|
|
1410
|
-
* { key: 'isDarkMode' }
|
|
1411
|
-
* ```
|
|
1412
|
-
*
|
|
1413
1236
|
* @public
|
|
1414
1237
|
*/
|
|
1415
1238
|
export declare type GetBooleanRequest = {
|
|
1239
|
+
/** Storage key used for read/write operations. */
|
|
1416
1240
|
key: string;
|
|
1417
1241
|
};
|
|
1418
1242
|
|
|
@@ -1422,15 +1246,6 @@ export declare type GetBooleanRequest = {
|
|
|
1422
1246
|
* @group Modules
|
|
1423
1247
|
* @category Storage
|
|
1424
1248
|
*
|
|
1425
|
-
* @remarks
|
|
1426
|
-
* This response can have the following status codes:
|
|
1427
|
-
* - `200`: Value retrieved successfully. The `result` contains the boolean value.
|
|
1428
|
-
* - `204`: Value not found in storage.
|
|
1429
|
-
* - `400`: Missing required parameters - key not provided.
|
|
1430
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
1431
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1432
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1433
|
-
*
|
|
1434
1249
|
* @public
|
|
1435
1250
|
*/
|
|
1436
1251
|
export declare type GetBooleanResponse = SDKOkResponse<GetBooleanResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1441,14 +1256,6 @@ export declare type GetBooleanResponse = SDKOkResponse<GetBooleanResult> | SDKNo
|
|
|
1441
1256
|
* @group Modules
|
|
1442
1257
|
* @category Storage
|
|
1443
1258
|
*
|
|
1444
|
-
* @remarks
|
|
1445
|
-
* When the key has no stored value, the response `status_code` is `204` instead.
|
|
1446
|
-
*
|
|
1447
|
-
* @example
|
|
1448
|
-
* ```typescript
|
|
1449
|
-
* true
|
|
1450
|
-
* ```
|
|
1451
|
-
*
|
|
1452
1259
|
* @public
|
|
1453
1260
|
*/
|
|
1454
1261
|
export declare type GetBooleanResult = boolean;
|
|
@@ -1459,14 +1266,6 @@ export declare type GetBooleanResult = boolean;
|
|
|
1459
1266
|
* @group Modules
|
|
1460
1267
|
* @category Location
|
|
1461
1268
|
*
|
|
1462
|
-
* @remarks
|
|
1463
|
-
* This response can have the following status codes:
|
|
1464
|
-
* - `200`: Coordinates retrieved successfully. The `result` contains latitude and longitude.
|
|
1465
|
-
* - `403`: Forbidden - client not authorized to access location data.
|
|
1466
|
-
* - `424`: GeoKit error - location services unavailable.
|
|
1467
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1468
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1469
|
-
*
|
|
1470
1269
|
* @public
|
|
1471
1270
|
*/
|
|
1472
1271
|
export declare type GetCoordinateResponse = SDKOkResponse<GetCoordinateResult> | SDKErrorResponse<403> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1477,15 +1276,12 @@ export declare type GetCoordinateResponse = SDKOkResponse<GetCoordinateResult> |
|
|
|
1477
1276
|
* @group Modules
|
|
1478
1277
|
* @category Location
|
|
1479
1278
|
*
|
|
1480
|
-
* @example
|
|
1481
|
-
* ```typescript
|
|
1482
|
-
* { latitude: 1.3521, longitude: 103.8198 }
|
|
1483
|
-
* ```
|
|
1484
|
-
*
|
|
1485
1279
|
* @public
|
|
1486
1280
|
*/
|
|
1487
1281
|
export declare type GetCoordinateResult = {
|
|
1282
|
+
/** Latitude coordinate in decimal degrees (for example, `1.3521`). */
|
|
1488
1283
|
latitude: number;
|
|
1284
|
+
/** Longitude coordinate in decimal degrees (for example, `103.8198`). */
|
|
1489
1285
|
longitude: number;
|
|
1490
1286
|
};
|
|
1491
1287
|
|
|
@@ -1495,35 +1291,16 @@ export declare type GetCoordinateResult = {
|
|
|
1495
1291
|
* @group Modules
|
|
1496
1292
|
* @category Location
|
|
1497
1293
|
*
|
|
1498
|
-
* @remarks
|
|
1499
|
-
* This response can have the following status codes:
|
|
1500
|
-
* - `200`: Country code retrieved successfully. The `result` is the ISO country code string.
|
|
1501
|
-
* - `204`: No content - country code not available.
|
|
1502
|
-
* - `403`: Forbidden - client not authorized to access location data.
|
|
1503
|
-
* - `424`: GeoKit/Resolver error - location services unavailable.
|
|
1504
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1505
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1506
|
-
*
|
|
1507
1294
|
* @public
|
|
1508
1295
|
*/
|
|
1509
1296
|
export declare type GetCountryCodeResponse = SDKOkResponse<GetCountryCodeResult> | SDKNoContentResponse | SDKErrorResponse<403> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1510
1297
|
|
|
1511
1298
|
/**
|
|
1512
|
-
* The ISO country code string returned from `JSBridge
|
|
1299
|
+
* The ISO country code string returned from `JSBridge` (for example, `"SG"` or `"ID"`).
|
|
1513
1300
|
*
|
|
1514
1301
|
* @group Modules
|
|
1515
1302
|
* @category Location
|
|
1516
1303
|
*
|
|
1517
|
-
* @example
|
|
1518
|
-
* ```typescript
|
|
1519
|
-
* 'SG'
|
|
1520
|
-
* ```
|
|
1521
|
-
*
|
|
1522
|
-
* @example
|
|
1523
|
-
* ```typescript
|
|
1524
|
-
* 'ID'
|
|
1525
|
-
* ```
|
|
1526
|
-
*
|
|
1527
1304
|
* @public
|
|
1528
1305
|
*/
|
|
1529
1306
|
export declare type GetCountryCodeResult = string;
|
|
@@ -1534,14 +1311,10 @@ export declare type GetCountryCodeResult = string;
|
|
|
1534
1311
|
* @group Modules
|
|
1535
1312
|
* @category Storage
|
|
1536
1313
|
*
|
|
1537
|
-
* @example
|
|
1538
|
-
* ```typescript
|
|
1539
|
-
* { key: 'price' }
|
|
1540
|
-
* ```
|
|
1541
|
-
*
|
|
1542
1314
|
* @public
|
|
1543
1315
|
*/
|
|
1544
1316
|
export declare type GetDoubleRequest = {
|
|
1317
|
+
/** Storage key used for read/write operations. */
|
|
1545
1318
|
key: string;
|
|
1546
1319
|
};
|
|
1547
1320
|
|
|
@@ -1551,15 +1324,6 @@ export declare type GetDoubleRequest = {
|
|
|
1551
1324
|
* @group Modules
|
|
1552
1325
|
* @category Storage
|
|
1553
1326
|
*
|
|
1554
|
-
* @remarks
|
|
1555
|
-
* This response can have the following status codes:
|
|
1556
|
-
* - `200`: Value retrieved successfully. The `result` contains the double value.
|
|
1557
|
-
* - `204`: Value not found in storage.
|
|
1558
|
-
* - `400`: Missing required parameters - key not provided.
|
|
1559
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
1560
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1561
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1562
|
-
*
|
|
1563
1327
|
* @public
|
|
1564
1328
|
*/
|
|
1565
1329
|
export declare type GetDoubleResponse = SDKOkResponse<GetDoubleResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1570,14 +1334,6 @@ export declare type GetDoubleResponse = SDKOkResponse<GetDoubleResult> | SDKNoCo
|
|
|
1570
1334
|
* @group Modules
|
|
1571
1335
|
* @category Storage
|
|
1572
1336
|
*
|
|
1573
|
-
* @remarks
|
|
1574
|
-
* When the key has no stored value, the response `status_code` is `204` instead.
|
|
1575
|
-
*
|
|
1576
|
-
* @example
|
|
1577
|
-
* ```typescript
|
|
1578
|
-
* 19.99
|
|
1579
|
-
* ```
|
|
1580
|
-
*
|
|
1581
1337
|
* @public
|
|
1582
1338
|
*/
|
|
1583
1339
|
export declare type GetDoubleResult = number;
|
|
@@ -1588,14 +1344,10 @@ export declare type GetDoubleResult = number;
|
|
|
1588
1344
|
* @group Modules
|
|
1589
1345
|
* @category Storage
|
|
1590
1346
|
*
|
|
1591
|
-
* @example
|
|
1592
|
-
* ```typescript
|
|
1593
|
-
* { key: 'userCount' }
|
|
1594
|
-
* ```
|
|
1595
|
-
*
|
|
1596
1347
|
* @public
|
|
1597
1348
|
*/
|
|
1598
1349
|
export declare type GetIntRequest = {
|
|
1350
|
+
/** Storage key used for read/write operations. */
|
|
1599
1351
|
key: string;
|
|
1600
1352
|
};
|
|
1601
1353
|
|
|
@@ -1605,15 +1357,6 @@ export declare type GetIntRequest = {
|
|
|
1605
1357
|
* @group Modules
|
|
1606
1358
|
* @category Storage
|
|
1607
1359
|
*
|
|
1608
|
-
* @remarks
|
|
1609
|
-
* This response can have the following status codes:
|
|
1610
|
-
* - `200`: Value retrieved successfully. The `result` contains the integer value.
|
|
1611
|
-
* - `204`: Value not found in storage.
|
|
1612
|
-
* - `400`: Missing required parameters - key not provided.
|
|
1613
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
1614
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1615
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1616
|
-
*
|
|
1617
1360
|
* @public
|
|
1618
1361
|
*/
|
|
1619
1362
|
export declare type GetIntResponse = SDKOkResponse<GetIntResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1624,14 +1367,6 @@ export declare type GetIntResponse = SDKOkResponse<GetIntResult> | SDKNoContentR
|
|
|
1624
1367
|
* @group Modules
|
|
1625
1368
|
* @category Storage
|
|
1626
1369
|
*
|
|
1627
|
-
* @remarks
|
|
1628
|
-
* When the key has no stored value, the response `status_code` is `204` instead.
|
|
1629
|
-
*
|
|
1630
|
-
* @example
|
|
1631
|
-
* ```typescript
|
|
1632
|
-
* 42
|
|
1633
|
-
* ```
|
|
1634
|
-
*
|
|
1635
1370
|
* @public
|
|
1636
1371
|
*/
|
|
1637
1372
|
export declare type GetIntResult = number;
|
|
@@ -1642,85 +1377,36 @@ export declare type GetIntResult = number;
|
|
|
1642
1377
|
* @group Modules
|
|
1643
1378
|
* @category Locale
|
|
1644
1379
|
*
|
|
1645
|
-
* @remarks
|
|
1646
|
-
* This response can have the following status codes:
|
|
1647
|
-
* - `200`: Locale identifier retrieved successfully.
|
|
1648
|
-
* - `204`: No content - locale identifier not available.
|
|
1649
|
-
* - `400`: Invalid request parameters.
|
|
1650
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1651
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1652
|
-
*
|
|
1653
1380
|
* @public
|
|
1654
1381
|
*/
|
|
1655
1382
|
export declare type GetLanguageLocaleIdentifierResponse = SDKOkResponse<GetLanguageLocaleIdentifierResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1656
1383
|
|
|
1657
1384
|
/**
|
|
1658
|
-
* Result object containing the language locale identifier.
|
|
1385
|
+
* Result object containing the language locale identifier (for example, `"en"` or `"id"`).
|
|
1659
1386
|
*
|
|
1660
1387
|
* @group Modules
|
|
1661
1388
|
* @category Locale
|
|
1662
1389
|
*
|
|
1663
|
-
* @remarks
|
|
1664
|
-
* The locale identifier is the language code of the device's language settings.
|
|
1665
|
-
* Common values include:
|
|
1666
|
-
* - "en" (English)
|
|
1667
|
-
* - "id" (Indonesian)
|
|
1668
|
-
* - "zh" (Chinese)
|
|
1669
|
-
* - "ms" (Malay)
|
|
1670
|
-
* - "th" (Thai)
|
|
1671
|
-
* - "vi" (Vietnamese)
|
|
1672
|
-
* - "my" (Burmese)
|
|
1673
|
-
* - "ja" (Japanese)
|
|
1674
|
-
* - "ko" (Korean)
|
|
1675
|
-
* - "km" (Khmer)
|
|
1676
|
-
*
|
|
1677
|
-
* @example
|
|
1678
|
-
* ```typescript
|
|
1679
|
-
* 'en'
|
|
1680
|
-
* ```
|
|
1681
|
-
*
|
|
1682
|
-
* @example
|
|
1683
|
-
* ```typescript
|
|
1684
|
-
* 'id'
|
|
1685
|
-
* ```
|
|
1686
|
-
*
|
|
1687
1390
|
* @public
|
|
1688
1391
|
*/
|
|
1689
1392
|
export declare type GetLanguageLocaleIdentifierResult = string;
|
|
1690
1393
|
|
|
1691
1394
|
/**
|
|
1692
|
-
* Response when reading the selected travel destination
|
|
1395
|
+
* Response when reading the selected travel destination.
|
|
1693
1396
|
*
|
|
1694
1397
|
* @group Modules
|
|
1695
1398
|
* @category User Attributes
|
|
1696
1399
|
*
|
|
1697
|
-
* @remarks
|
|
1698
|
-
* This response can have the following status codes:
|
|
1699
|
-
* - `200`: The selected travel destination lowercase ISO 3166-1 alpha-2 country code was returned successfully.
|
|
1700
|
-
* - `204`: No selected travel destination is currently available.
|
|
1701
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1702
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1703
|
-
*
|
|
1704
1400
|
* @public
|
|
1705
1401
|
*/
|
|
1706
1402
|
export declare type GetSelectedTravelDestinationResponse = SDKOkResponse<GetSelectedTravelDestinationResult> | SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1707
1403
|
|
|
1708
1404
|
/**
|
|
1709
|
-
* Result containing the selected travel destination
|
|
1405
|
+
* Result containing the selected travel destination ISO 3166-1 alpha-2 country code (for example, `"sg"` or `"id"`).
|
|
1710
1406
|
*
|
|
1711
1407
|
* @group Modules
|
|
1712
1408
|
* @category User Attributes
|
|
1713
1409
|
*
|
|
1714
|
-
* @example
|
|
1715
|
-
* ```typescript
|
|
1716
|
-
* 'id'
|
|
1717
|
-
* ```
|
|
1718
|
-
*
|
|
1719
|
-
* @example
|
|
1720
|
-
* ```typescript
|
|
1721
|
-
* 'sg'
|
|
1722
|
-
* ```
|
|
1723
|
-
*
|
|
1724
1410
|
* @public
|
|
1725
1411
|
*/
|
|
1726
1412
|
export declare type GetSelectedTravelDestinationResult = string;
|
|
@@ -1731,12 +1417,6 @@ export declare type GetSelectedTravelDestinationResult = string;
|
|
|
1731
1417
|
* @group Modules
|
|
1732
1418
|
* @category Container
|
|
1733
1419
|
*
|
|
1734
|
-
* @remarks
|
|
1735
|
-
* This response can have the following status codes:
|
|
1736
|
-
* - `200`: Session parameters retrieved successfully.
|
|
1737
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1738
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1739
|
-
*
|
|
1740
1420
|
* @public
|
|
1741
1421
|
*/
|
|
1742
1422
|
export declare type GetSessionParamsResponse = SDKOkResponse<GetSessionParamsResult> | SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1752,11 +1432,6 @@ export declare type GetSessionParamsResponse = SDKOkResponse<GetSessionParamsRes
|
|
|
1752
1432
|
* Session parameters can contain primitives, base64 encoded strings, or nested objects depending on the
|
|
1753
1433
|
* SuperApp's configuration.
|
|
1754
1434
|
*
|
|
1755
|
-
* @example
|
|
1756
|
-
* ```typescript
|
|
1757
|
-
* { result: '{"userId": "123", "sessionToken": "abc"}' }
|
|
1758
|
-
* ```
|
|
1759
|
-
*
|
|
1760
1435
|
* @public
|
|
1761
1436
|
*/
|
|
1762
1437
|
export declare type GetSessionParamsResult = string;
|
|
@@ -1767,14 +1442,10 @@ export declare type GetSessionParamsResult = string;
|
|
|
1767
1442
|
* @group Modules
|
|
1768
1443
|
* @category Storage
|
|
1769
1444
|
*
|
|
1770
|
-
* @example
|
|
1771
|
-
* ```typescript
|
|
1772
|
-
* { key: 'username' }
|
|
1773
|
-
* ```
|
|
1774
|
-
*
|
|
1775
1445
|
* @public
|
|
1776
1446
|
*/
|
|
1777
1447
|
export declare type GetStringRequest = {
|
|
1448
|
+
/** Storage key used for read/write operations. */
|
|
1778
1449
|
key: string;
|
|
1779
1450
|
};
|
|
1780
1451
|
|
|
@@ -1784,15 +1455,6 @@ export declare type GetStringRequest = {
|
|
|
1784
1455
|
* @group Modules
|
|
1785
1456
|
* @category Storage
|
|
1786
1457
|
*
|
|
1787
|
-
* @remarks
|
|
1788
|
-
* This response can have the following status codes:
|
|
1789
|
-
* - `200`: Value retrieved successfully. The `result` contains the string value.
|
|
1790
|
-
* - `204`: Value not found in storage.
|
|
1791
|
-
* - `400`: Missing required parameters - key not provided.
|
|
1792
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
1793
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1794
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1795
|
-
*
|
|
1796
1458
|
* @public
|
|
1797
1459
|
*/
|
|
1798
1460
|
export declare type GetStringResponse = SDKOkResponse<GetStringResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1803,14 +1465,6 @@ export declare type GetStringResponse = SDKOkResponse<GetStringResult> | SDKNoCo
|
|
|
1803
1465
|
* @group Modules
|
|
1804
1466
|
* @category Storage
|
|
1805
1467
|
*
|
|
1806
|
-
* @remarks
|
|
1807
|
-
* When the key has no stored value, the response `status_code` is `204` instead.
|
|
1808
|
-
*
|
|
1809
|
-
* @example
|
|
1810
|
-
* ```typescript
|
|
1811
|
-
* 'john_doe'
|
|
1812
|
-
* ```
|
|
1813
|
-
*
|
|
1814
1468
|
* @public
|
|
1815
1469
|
*/
|
|
1816
1470
|
export declare type GetStringResult = string;
|
|
@@ -1834,18 +1488,12 @@ export declare interface GrabAppInfo {
|
|
|
1834
1488
|
* @group Modules
|
|
1835
1489
|
* @category Scope
|
|
1836
1490
|
*
|
|
1837
|
-
* @example
|
|
1838
|
-
* ```typescript
|
|
1839
|
-
* {
|
|
1840
|
-
* module: 'CameraModule',
|
|
1841
|
-
* method: 'scanQRCode'
|
|
1842
|
-
* }
|
|
1843
|
-
* ```
|
|
1844
|
-
*
|
|
1845
1491
|
* @public
|
|
1846
1492
|
*/
|
|
1847
1493
|
export declare type HasAccessToRequest = {
|
|
1494
|
+
/** Method name to check scope access for (for example, `"scanQRCode"`). */
|
|
1848
1495
|
method: string;
|
|
1496
|
+
/** Module name to check scope access for (for example, `"CameraModule"`). */
|
|
1849
1497
|
module: string;
|
|
1850
1498
|
};
|
|
1851
1499
|
|
|
@@ -1855,14 +1503,6 @@ export declare type HasAccessToRequest = {
|
|
|
1855
1503
|
* @group Modules
|
|
1856
1504
|
* @category Scope
|
|
1857
1505
|
*
|
|
1858
|
-
* @remarks
|
|
1859
|
-
* This response can have the following status codes:
|
|
1860
|
-
* - `200`: Access check completed successfully. The `result` contains the access status.
|
|
1861
|
-
* - `400`: Missing required parameters - module or method not provided.
|
|
1862
|
-
* - `424`: ScopeKit error - unable to check access due to a dependency error.
|
|
1863
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1864
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1865
|
-
*
|
|
1866
1506
|
* @public
|
|
1867
1507
|
*/
|
|
1868
1508
|
export declare type HasAccessToResponse = SDKOkResponse<HasAccessToResult> | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -1873,18 +1513,6 @@ export declare type HasAccessToResponse = SDKOkResponse<HasAccessToResult> | SDK
|
|
|
1873
1513
|
* @group Modules
|
|
1874
1514
|
* @category Scope
|
|
1875
1515
|
*
|
|
1876
|
-
* @example
|
|
1877
|
-
* **Has access:**
|
|
1878
|
-
* ```typescript
|
|
1879
|
-
* true
|
|
1880
|
-
* ```
|
|
1881
|
-
*
|
|
1882
|
-
* @example
|
|
1883
|
-
* **No access:**
|
|
1884
|
-
* ```typescript
|
|
1885
|
-
* false
|
|
1886
|
-
* ```
|
|
1887
|
-
*
|
|
1888
1516
|
* @public
|
|
1889
1517
|
*/
|
|
1890
1518
|
export declare type HasAccessToResult = boolean;
|
|
@@ -1918,91 +1546,40 @@ export declare function hasResult<T extends SDKResponse>(response: T): response
|
|
|
1918
1546
|
* @group Modules
|
|
1919
1547
|
* @category Container
|
|
1920
1548
|
*
|
|
1921
|
-
* @remarks
|
|
1922
|
-
* This response can have the following status codes:
|
|
1923
|
-
* - `204`: Back button hidden successfully.
|
|
1924
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1925
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1926
|
-
*
|
|
1927
1549
|
* @public
|
|
1928
1550
|
*/
|
|
1929
1551
|
export declare type HideBackButtonResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1930
1552
|
|
|
1931
|
-
/**
|
|
1932
|
-
* Result when hiding the back button.
|
|
1933
|
-
* This operation returns no data on success.
|
|
1934
|
-
*
|
|
1935
|
-
* @group Modules
|
|
1936
|
-
* @category Container
|
|
1937
|
-
*
|
|
1938
|
-
* @public
|
|
1939
|
-
*/
|
|
1940
|
-
export declare type HideBackButtonResult = void;
|
|
1941
|
-
|
|
1942
1553
|
/**
|
|
1943
1554
|
* Response when hiding the loader.
|
|
1944
1555
|
*
|
|
1945
1556
|
* @group Modules
|
|
1946
1557
|
* @category Container
|
|
1947
1558
|
*
|
|
1948
|
-
* @remarks
|
|
1949
|
-
* This response can have the following status codes:
|
|
1950
|
-
* - `204`: Loader hidden successfully.
|
|
1951
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
1952
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1953
|
-
*
|
|
1954
1559
|
* @public
|
|
1955
1560
|
*/
|
|
1956
1561
|
export declare type HideLoaderResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1957
1562
|
|
|
1958
1563
|
/**
|
|
1959
|
-
*
|
|
1960
|
-
* This operation returns no data on success.
|
|
1564
|
+
* Response when hiding the refresh button.
|
|
1961
1565
|
*
|
|
1962
1566
|
* @group Modules
|
|
1963
1567
|
* @category Container
|
|
1964
1568
|
*
|
|
1965
1569
|
* @public
|
|
1966
1570
|
*/
|
|
1967
|
-
export declare type
|
|
1571
|
+
export declare type HideRefreshButtonResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1968
1572
|
|
|
1969
1573
|
/**
|
|
1970
|
-
*
|
|
1574
|
+
* SDK module for authenticating users with GrabID via `JSBridge`.
|
|
1971
1575
|
*
|
|
1972
1576
|
* @group Modules
|
|
1973
|
-
* @category
|
|
1577
|
+
* @category Identity
|
|
1974
1578
|
*
|
|
1975
1579
|
* @remarks
|
|
1976
|
-
*
|
|
1977
|
-
* -
|
|
1978
|
-
*
|
|
1979
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
1980
|
-
*
|
|
1981
|
-
* @public
|
|
1982
|
-
*/
|
|
1983
|
-
export declare type HideRefreshButtonResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
1984
|
-
|
|
1985
|
-
/**
|
|
1986
|
-
* Result when hiding the refresh button.
|
|
1987
|
-
* This operation returns no data on success.
|
|
1988
|
-
*
|
|
1989
|
-
* @group Modules
|
|
1990
|
-
* @category Container
|
|
1991
|
-
*
|
|
1992
|
-
* @public
|
|
1993
|
-
*/
|
|
1994
|
-
export declare type HideRefreshButtonResult = void;
|
|
1995
|
-
|
|
1996
|
-
/**
|
|
1997
|
-
* SDK module for authenticating users with GrabID via `JSBridge`.
|
|
1998
|
-
*
|
|
1999
|
-
* @group Modules
|
|
2000
|
-
* @category Identity
|
|
2001
|
-
*
|
|
2002
|
-
* @remarks
|
|
2003
|
-
* Handles OAuth2/OIDC authentication flows with PKCE support, enabling MiniApps to obtain user identity tokens.
|
|
2004
|
-
* Supports both native in-app consent and web-based fallback flows.
|
|
2005
|
-
* This code must run on the Grab SuperApp's WebView to function correctly.
|
|
1580
|
+
* Handles OAuth2/OIDC authentication flows with PKCE support, enabling MiniApps to obtain user identity tokens.
|
|
1581
|
+
* Supports both native in-app consent and web-based fallback flows.
|
|
1582
|
+
* This code must run on the Grab SuperApp's WebView to function correctly.
|
|
2006
1583
|
*
|
|
2007
1584
|
* @example
|
|
2008
1585
|
* **ES Module:**
|
|
@@ -2054,16 +1631,18 @@ export declare class IdentityModule extends BaseModule {
|
|
|
2054
1631
|
* Retrieves stored PKCE authorization artifacts from local storage.
|
|
2055
1632
|
* These artifacts are used to complete the OAuth2 authorization code exchange.
|
|
2056
1633
|
*
|
|
2057
|
-
* @returns The stored PKCE artifacts including state, code verifier, nonce, and redirect URI. See {@link GetAuthorizationArtifactsResponse}.
|
|
2058
|
-
*
|
|
2059
1634
|
* @remarks
|
|
2060
1635
|
* **Important:** The `redirectUri` returned by this method is the actual redirect URI
|
|
2061
1636
|
* that was sent to the authorization server. This may differ from the `redirectUri`
|
|
2062
1637
|
* you provided to `authorize()` if you used `responseMode: 'in_place'` with native flow.
|
|
2063
1638
|
* You must use this returned `redirectUri` for token exchange to ensure OAuth compliance.
|
|
2064
1639
|
*
|
|
1640
|
+
* @returns This method can return the following `status_code` values:
|
|
1641
|
+
* - `200` (OK): All artifacts present. The `result` contains {@link GetAuthorizationArtifactsResult}.
|
|
1642
|
+
* - `204` (No Content): No artifacts yet - authorization has not been initiated.
|
|
1643
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
1644
|
+
*
|
|
2065
1645
|
* @example
|
|
2066
|
-
* **Simple usage**
|
|
2067
1646
|
* ```typescript
|
|
2068
1647
|
* import { IdentityModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
2069
1648
|
*
|
|
@@ -2107,7 +1686,6 @@ export declare class IdentityModule extends BaseModule {
|
|
|
2107
1686
|
* @returns Confirmation that the authorization artifacts have been cleared. See {@link ClearAuthorizationArtifactsResponse}.
|
|
2108
1687
|
*
|
|
2109
1688
|
* @example
|
|
2110
|
-
* **Simple usage**
|
|
2111
1689
|
* ```typescript
|
|
2112
1690
|
* import { IdentityModule, isSuccess } from '@grabjs/superapp-sdk';
|
|
2113
1691
|
*
|
|
@@ -2176,8 +1754,7 @@ export declare class IdentityModule extends BaseModule {
|
|
|
2176
1754
|
* Performs web-based OAuth2 authorization by redirecting to the authorization server.
|
|
2177
1755
|
*
|
|
2178
1756
|
* @param params - The authorization parameters.
|
|
2179
|
-
*
|
|
2180
|
-
* @returns The authorization result, including status and redirect information.
|
|
1757
|
+
* @returns The authorization response for the redirect flow.
|
|
2181
1758
|
*
|
|
2182
1759
|
* @internal
|
|
2183
1760
|
*/
|
|
@@ -2196,9 +1773,7 @@ export declare class IdentityModule extends BaseModule {
|
|
|
2196
1773
|
* Initiates an OAuth2 authorization flow with PKCE (Proof Key for Code Exchange).
|
|
2197
1774
|
* This method handles both native in-app consent and web-based fallback flows.
|
|
2198
1775
|
*
|
|
2199
|
-
* @param request - Authorization parameters
|
|
2200
|
-
*
|
|
2201
|
-
* @returns The authorization result, containing the authorization code on success or redirect status. See {@link AuthorizeResponse}.
|
|
1776
|
+
* @param request - Authorization parameters.
|
|
2202
1777
|
*
|
|
2203
1778
|
* @remarks
|
|
2204
1779
|
* **Important Note on redirectUri and responseMode:**
|
|
@@ -2226,8 +1801,16 @@ export declare class IdentityModule extends BaseModule {
|
|
|
2226
1801
|
* - For supported versions, the SDK attempts native consent first and falls back to
|
|
2227
1802
|
* web on specific native errors (400, 401, 403)
|
|
2228
1803
|
*
|
|
1804
|
+
* @returns This method can return the following `status_code` values:
|
|
1805
|
+
* - `200` (OK): Authorization completed successfully (native in_place flow). The `result` contains {@link AuthorizeResult}.
|
|
1806
|
+
* - `204` (No Content): User cancelled the authorization flow.
|
|
1807
|
+
* - `302` (Found): Redirect in progress (web redirect flow). The page will navigate away.
|
|
1808
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
1809
|
+
* - `403` (Forbidden): Client is not authorized for the requested scope.
|
|
1810
|
+
* - `500` (Internal Server Error): Unexpected error during native authorization.
|
|
1811
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
1812
|
+
*
|
|
2229
1813
|
* @example
|
|
2230
|
-
* **Simple usage**
|
|
2231
1814
|
* ```typescript
|
|
2232
1815
|
* import { IdentityModule, isSuccess, isRedirection, isError } from '@grabjs/superapp-sdk';
|
|
2233
1816
|
*
|
|
@@ -2309,11 +1892,6 @@ export declare function isClientError<T extends SDKResponse>(response: T): respo
|
|
|
2309
1892
|
* @group Modules
|
|
2310
1893
|
* @category Container
|
|
2311
1894
|
*
|
|
2312
|
-
* @remarks
|
|
2313
|
-
* This response can have the following status codes:
|
|
2314
|
-
* - `200`: Connected to Grab SuperApp. The `result` contains the connection status.
|
|
2315
|
-
* - `404`: Not connected to Grab SuperApp.
|
|
2316
|
-
*
|
|
2317
1895
|
* @public
|
|
2318
1896
|
*/
|
|
2319
1897
|
export declare type IsConnectedResponse = SDKOkResponse<IsConnectedResult> | SDKErrorResponse<404>;
|
|
@@ -2324,21 +1902,10 @@ export declare type IsConnectedResponse = SDKOkResponse<IsConnectedResult> | SDK
|
|
|
2324
1902
|
* @group Modules
|
|
2325
1903
|
* @category Container
|
|
2326
1904
|
*
|
|
2327
|
-
* @example
|
|
2328
|
-
* **Connected to Grab SuperApp:**
|
|
2329
|
-
* ```typescript
|
|
2330
|
-
* { connected: true }
|
|
2331
|
-
* ```
|
|
2332
|
-
*
|
|
2333
|
-
* @example
|
|
2334
|
-
* **Not connected:**
|
|
2335
|
-
* ```typescript
|
|
2336
|
-
* { connected: false }
|
|
2337
|
-
* ```
|
|
2338
|
-
*
|
|
2339
1905
|
* @public
|
|
2340
1906
|
*/
|
|
2341
1907
|
export declare type IsConnectedResult = {
|
|
1908
|
+
/** Connected value. */
|
|
2342
1909
|
connected: boolean;
|
|
2343
1910
|
};
|
|
2344
1911
|
|
|
@@ -2371,15 +1938,6 @@ export declare function isError<T extends SDKResponse>(response: T): response is
|
|
|
2371
1938
|
* @group Modules
|
|
2372
1939
|
* @category Device
|
|
2373
1940
|
*
|
|
2374
|
-
* @remarks
|
|
2375
|
-
* This response can have the following status codes:
|
|
2376
|
-
* - `200`: eSIM capability was checked successfully. The `result` contains `true` or `false`.
|
|
2377
|
-
* - `403`: Forbidden - client not authorized to query eSIM capability.
|
|
2378
|
-
* - `424`: Failed Dependency - underlying telephony/eSIM service unavailable.
|
|
2379
|
-
* - `426`: Upgrade Required - feature requires Grab app version 5.402 or above.
|
|
2380
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
2381
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
2382
|
-
*
|
|
2383
1941
|
* @public
|
|
2384
1942
|
*/
|
|
2385
1943
|
export declare type IsEsimSupportedResponse = SDKOkResponse<IsEsimSupportedResult> | SDKErrorResponse<403> | SDKErrorResponse<424> | SDKErrorResponse<426> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -2390,16 +1948,6 @@ export declare type IsEsimSupportedResponse = SDKOkResponse<IsEsimSupportedResul
|
|
|
2390
1948
|
* @group Modules
|
|
2391
1949
|
* @category Device
|
|
2392
1950
|
*
|
|
2393
|
-
* @example
|
|
2394
|
-
* ```typescript
|
|
2395
|
-
* true
|
|
2396
|
-
* ```
|
|
2397
|
-
*
|
|
2398
|
-
* @example
|
|
2399
|
-
* ```typescript
|
|
2400
|
-
* false
|
|
2401
|
-
* ```
|
|
2402
|
-
*
|
|
2403
1951
|
* @public
|
|
2404
1952
|
*/
|
|
2405
1953
|
export declare type IsEsimSupportedResult = boolean;
|
|
@@ -2576,10 +2124,14 @@ export declare class LocaleModule extends BaseModule {
|
|
|
2576
2124
|
/**
|
|
2577
2125
|
* Retrieves the current language locale identifier from the device.
|
|
2578
2126
|
*
|
|
2579
|
-
* @returns
|
|
2127
|
+
* @returns This method can return the following `status_code` values:
|
|
2128
|
+
* - `200` (OK): Locale identifier retrieved successfully.
|
|
2129
|
+
* - `204` (No Content): Locale identifier not available.
|
|
2130
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
2131
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
2132
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
2580
2133
|
*
|
|
2581
2134
|
* @example
|
|
2582
|
-
* **Simple usage**
|
|
2583
2135
|
* ```typescript
|
|
2584
2136
|
* import { LocaleModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
2585
2137
|
*
|
|
@@ -2640,10 +2192,14 @@ export declare class LocationModule extends BaseModule {
|
|
|
2640
2192
|
*
|
|
2641
2193
|
* @requiredOAuthScope mobile.geolocation
|
|
2642
2194
|
*
|
|
2643
|
-
* @returns
|
|
2195
|
+
* @returns This method can return the following `status_code` values:
|
|
2196
|
+
* - `200` (OK): Coordinates retrieved successfully. The `result` contains {@link GetCoordinateResult}.
|
|
2197
|
+
* - `403` (Forbidden): Client is not authorized to access location data.
|
|
2198
|
+
* - `424` (Failed Dependency): Dependency error occurred while retrieving coordinates.
|
|
2199
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
2200
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
2644
2201
|
*
|
|
2645
2202
|
* @example
|
|
2646
|
-
* **Simple usage**
|
|
2647
2203
|
* ```typescript
|
|
2648
2204
|
* import { LocationModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
2649
2205
|
*
|
|
@@ -2683,11 +2239,15 @@ export declare class LocationModule extends BaseModule {
|
|
|
2683
2239
|
* Remember to call `unsubscribe()` on the subscription when you no longer need updates
|
|
2684
2240
|
* to conserve battery and free resources.
|
|
2685
2241
|
*
|
|
2686
|
-
* @returns
|
|
2687
|
-
*
|
|
2242
|
+
* @returns This stream can emit the following `status_code` values:
|
|
2243
|
+
* - `200` (OK): Stream emitted a location update. The `result` contains {@link GetCoordinateResult}.
|
|
2244
|
+
* - `400` (Bad Request): Stream emitted an invalid request error.
|
|
2245
|
+
* - `403` (Forbidden): Stream emitted an authorization error.
|
|
2246
|
+
* - `424` (Failed Dependency): Stream emitted a dependency error.
|
|
2247
|
+
* - `500` (Internal Server Error): Stream emitted an unexpected error.
|
|
2248
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
2688
2249
|
*
|
|
2689
2250
|
* @example
|
|
2690
|
-
* **Simple usage**
|
|
2691
2251
|
* ```typescript
|
|
2692
2252
|
* import { LocationModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
2693
2253
|
*
|
|
@@ -2725,10 +2285,15 @@ export declare class LocationModule extends BaseModule {
|
|
|
2725
2285
|
*
|
|
2726
2286
|
* @requiredOAuthScope mobile.geolocation
|
|
2727
2287
|
*
|
|
2728
|
-
* @returns
|
|
2288
|
+
* @returns This method can return the following `status_code` values:
|
|
2289
|
+
* - `200` (OK): Country code retrieved successfully. The `result` contains {@link GetCountryCodeResult}.
|
|
2290
|
+
* - `204` (No Content): Country code not available.
|
|
2291
|
+
* - `403` (Forbidden): Client is not authorized to access location data.
|
|
2292
|
+
* - `424` (Failed Dependency): Dependency error occurred while resolving country code.
|
|
2293
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
2294
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
2729
2295
|
*
|
|
2730
2296
|
* @example
|
|
2731
|
-
* **Simple usage**
|
|
2732
2297
|
* ```typescript
|
|
2733
2298
|
* import { LocationModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
2734
2299
|
*
|
|
@@ -2819,12 +2384,15 @@ export declare class MediaModule extends BaseModule {
|
|
|
2819
2384
|
* Requires proper DRM content configuration including license URL and content metadata.
|
|
2820
2385
|
* For playback events and status updates, use {@link MediaModule.observePlayDRMContent}.
|
|
2821
2386
|
*
|
|
2822
|
-
* @param data - Configuration for the DRM content including license URL and content metadata.
|
|
2387
|
+
* @param data - Configuration for the DRM content including license URL and content metadata.
|
|
2823
2388
|
*
|
|
2824
|
-
* @returns
|
|
2389
|
+
* @returns This method can return the following `status_code` values:
|
|
2390
|
+
* - `200` (OK): Playback initiated successfully.
|
|
2391
|
+
* - `204` (No Content): Request completed.
|
|
2392
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
2393
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
2825
2394
|
*
|
|
2826
2395
|
* @example
|
|
2827
|
-
* **Simple usage**
|
|
2828
2396
|
* ```typescript
|
|
2829
2397
|
* import { MediaModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
2830
2398
|
*
|
|
@@ -2865,12 +2433,14 @@ export declare class MediaModule extends BaseModule {
|
|
|
2865
2433
|
* Subscribe to this stream to receive real-time playback events such as progress,
|
|
2866
2434
|
* completion, and errors. Remember to call `unsubscribe()` when done to free resources.
|
|
2867
2435
|
*
|
|
2868
|
-
* @param data - Configuration for the DRM content to observe.
|
|
2436
|
+
* @param data - Configuration for the DRM content to observe.
|
|
2869
2437
|
*
|
|
2870
|
-
* @returns
|
|
2438
|
+
* @returns This stream can emit the following `status_code` values:
|
|
2439
|
+
* - `200` (OK): Stream emitted a playback event. The `result` contains {@link DRMPlaybackEvent}.
|
|
2440
|
+
* - `500` (Internal Server Error): Stream emitted an unexpected error.
|
|
2441
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
2871
2442
|
*
|
|
2872
2443
|
* @example
|
|
2873
|
-
* **Simple usage**
|
|
2874
2444
|
* ```typescript
|
|
2875
2445
|
* import { MediaModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
2876
2446
|
*
|
|
@@ -2950,12 +2520,11 @@ export declare class NetworkModule extends BaseModule {
|
|
|
2950
2520
|
/**
|
|
2951
2521
|
* Sends a network request through `JSBridge`.
|
|
2952
2522
|
*
|
|
2953
|
-
* @param request -
|
|
2523
|
+
* @param request - Network request parameters.
|
|
2954
2524
|
*
|
|
2955
2525
|
* @returns The network response containing the result data or error information. See {@link SendResponse}.
|
|
2956
2526
|
*
|
|
2957
2527
|
* @example
|
|
2958
|
-
* **Simple usage**
|
|
2959
2528
|
* ```typescript
|
|
2960
2529
|
* import { NetworkModule, isSuccess, isError, hasResult } from '@grabjs/superapp-sdk';
|
|
2961
2530
|
*
|
|
@@ -2992,13 +2561,6 @@ export declare class NetworkModule extends BaseModule {
|
|
|
2992
2561
|
* @group Modules
|
|
2993
2562
|
* @category Media
|
|
2994
2563
|
*
|
|
2995
|
-
* @remarks
|
|
2996
|
-
* This is an `SDKStream` that can be:
|
|
2997
|
-
* - Subscribed to via `.subscribe()` for continuous updates
|
|
2998
|
-
* - Awaited via `await` to get the first value only
|
|
2999
|
-
*
|
|
3000
|
-
* The stream can emit status codes `200` (event data), `500` (server error), or `501` (not implemented).
|
|
3001
|
-
*
|
|
3002
2564
|
* @public
|
|
3003
2565
|
*/
|
|
3004
2566
|
export declare type ObserveDRMPlaybackResponse = SDKStream<SDKOkResponse<DRMPlaybackEvent> | SDKErrorResponse<500> | SDKErrorResponse<501>>;
|
|
@@ -3009,13 +2571,6 @@ export declare type ObserveDRMPlaybackResponse = SDKStream<SDKOkResponse<DRMPlay
|
|
|
3009
2571
|
* @group Modules
|
|
3010
2572
|
* @category Location
|
|
3011
2573
|
*
|
|
3012
|
-
* @remarks
|
|
3013
|
-
* This is an `SDKStream` that can be:
|
|
3014
|
-
* - Subscribed to via `.subscribe()` for continuous updates
|
|
3015
|
-
* - Awaited via `await` to get the first value only
|
|
3016
|
-
*
|
|
3017
|
-
* The stream can emit `200`, `400`, `403`, `424`, `500`, and `501` status codes.
|
|
3018
|
-
*
|
|
3019
2574
|
* @public
|
|
3020
2575
|
*/
|
|
3021
2576
|
export declare type ObserveLocationChangeResponse = SDKStream<SDKOkResponse<GetCoordinateResult> | SDKErrorResponse<400> | SDKErrorResponse<403> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>>;
|
|
@@ -3026,39 +2581,16 @@ export declare type ObserveLocationChangeResponse = SDKStream<SDKOkResponse<GetC
|
|
|
3026
2581
|
* @group Modules
|
|
3027
2582
|
* @category Container
|
|
3028
2583
|
*
|
|
3029
|
-
* @remarks
|
|
3030
|
-
* This response can have the following status codes:
|
|
3031
|
-
* - `200`: Notification sent successfully.
|
|
3032
|
-
* - `204`: Operation completed successfully (no content).
|
|
3033
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3034
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3035
|
-
*
|
|
3036
2584
|
* @public
|
|
3037
2585
|
*/
|
|
3038
2586
|
export declare type OnContentLoadedResponse = SDKOkResponse<boolean> | SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3039
2587
|
|
|
3040
|
-
/**
|
|
3041
|
-
* Result when notifying content loaded.
|
|
3042
|
-
* This operation returns no data on success.
|
|
3043
|
-
*
|
|
3044
|
-
* @group Modules
|
|
3045
|
-
* @category Container
|
|
3046
|
-
*
|
|
3047
|
-
* @public
|
|
3048
|
-
*/
|
|
3049
|
-
export declare type OnContentLoadedResult = void;
|
|
3050
|
-
|
|
3051
2588
|
/**
|
|
3052
2589
|
* Request parameters for notifying CTA tap.
|
|
3053
2590
|
*
|
|
3054
2591
|
* @group Modules
|
|
3055
2592
|
* @category Container
|
|
3056
2593
|
*
|
|
3057
|
-
* @example
|
|
3058
|
-
* ```typescript
|
|
3059
|
-
* 'AV_LANDING_PAGE_CONTINUE'
|
|
3060
|
-
* ```
|
|
3061
|
-
*
|
|
3062
2594
|
* @public
|
|
3063
2595
|
*/
|
|
3064
2596
|
export declare type OnCtaTapRequest = string;
|
|
@@ -3069,38 +2601,16 @@ export declare type OnCtaTapRequest = string;
|
|
|
3069
2601
|
* @group Modules
|
|
3070
2602
|
* @category Container
|
|
3071
2603
|
*
|
|
3072
|
-
* @remarks
|
|
3073
|
-
* This response can have the following status codes:
|
|
3074
|
-
* - `200`: CTA tap notification sent successfully.
|
|
3075
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3076
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3077
|
-
*
|
|
3078
2604
|
* @public
|
|
3079
2605
|
*/
|
|
3080
2606
|
export declare type OnCtaTapResponse = SDKOkResponse<boolean> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3081
2607
|
|
|
3082
|
-
/**
|
|
3083
|
-
* Result when notifying CTA tap.
|
|
3084
|
-
* This operation returns no data on success.
|
|
3085
|
-
*
|
|
3086
|
-
* @group Modules
|
|
3087
|
-
* @category Container
|
|
3088
|
-
*
|
|
3089
|
-
* @public
|
|
3090
|
-
*/
|
|
3091
|
-
export declare type OnCtaTapResult = void;
|
|
3092
|
-
|
|
3093
2608
|
/**
|
|
3094
2609
|
* Request parameters for opening an external link.
|
|
3095
2610
|
*
|
|
3096
2611
|
* @group Modules
|
|
3097
2612
|
* @category Container
|
|
3098
2613
|
*
|
|
3099
|
-
* @example
|
|
3100
|
-
* ```typescript
|
|
3101
|
-
* 'https://example.com'
|
|
3102
|
-
* ```
|
|
3103
|
-
*
|
|
3104
2614
|
* @public
|
|
3105
2615
|
*/
|
|
3106
2616
|
export declare type OpenExternalLinkRequest = string;
|
|
@@ -3111,28 +2621,10 @@ export declare type OpenExternalLinkRequest = string;
|
|
|
3111
2621
|
* @group Modules
|
|
3112
2622
|
* @category Container
|
|
3113
2623
|
*
|
|
3114
|
-
* @remarks
|
|
3115
|
-
* This response can have the following status codes:
|
|
3116
|
-
* - `204`: External link opened successfully.
|
|
3117
|
-
* - `400`: Invalid URL parameter.
|
|
3118
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3119
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3120
|
-
*
|
|
3121
2624
|
* @public
|
|
3122
2625
|
*/
|
|
3123
2626
|
export declare type OpenExternalLinkResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3124
2627
|
|
|
3125
|
-
/**
|
|
3126
|
-
* Result when opening an external link.
|
|
3127
|
-
* This operation returns no data on success.
|
|
3128
|
-
*
|
|
3129
|
-
* @group Modules
|
|
3130
|
-
* @category Container
|
|
3131
|
-
*
|
|
3132
|
-
* @public
|
|
3133
|
-
*/
|
|
3134
|
-
export declare type OpenExternalLinkResult = void;
|
|
3135
|
-
|
|
3136
2628
|
/**
|
|
3137
2629
|
* Represents the mobile operating system platform.
|
|
3138
2630
|
*
|
|
@@ -3177,10 +2669,12 @@ export declare class PlatformModule extends BaseModule {
|
|
|
3177
2669
|
* Triggers the native platform back navigation.
|
|
3178
2670
|
* This navigates back in the native navigation stack.
|
|
3179
2671
|
*
|
|
3180
|
-
* @returns
|
|
2672
|
+
* @returns This method can return the following `status_code` values:
|
|
2673
|
+
* - `204` (No Content): Back navigation triggered successfully.
|
|
2674
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
2675
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
3181
2676
|
*
|
|
3182
2677
|
* @example
|
|
3183
|
-
* **Simple usage**
|
|
3184
2678
|
* ```typescript
|
|
3185
2679
|
* import { PlatformModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
3186
2680
|
*
|
|
@@ -3211,13 +2705,6 @@ export declare class PlatformModule extends BaseModule {
|
|
|
3211
2705
|
* @group Modules
|
|
3212
2706
|
* @category Media
|
|
3213
2707
|
*
|
|
3214
|
-
* @remarks
|
|
3215
|
-
* This response can have the following status codes:
|
|
3216
|
-
* - `200`: Playback initiated successfully (streaming content).
|
|
3217
|
-
* - `204`: Invalid parameters - the DRM configuration is malformed or missing required fields.
|
|
3218
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3219
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3220
|
-
*
|
|
3221
2708
|
* @public
|
|
3222
2709
|
*/
|
|
3223
2710
|
export declare type PlayDRMContentResponse = SDKOkResponse<PlayDRMContentResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -3272,10 +2759,16 @@ export declare class ProfileModule extends BaseModule {
|
|
|
3272
2759
|
*
|
|
3273
2760
|
* @requiredOAuthScope mobile.profile
|
|
3274
2761
|
*
|
|
3275
|
-
* @returns
|
|
2762
|
+
* @returns This method can return the following `status_code` values:
|
|
2763
|
+
* - `200` (OK): Email fetched successfully. The `result` contains {@link FetchEmailResult}.
|
|
2764
|
+
* - `204` (No Content): Email not available.
|
|
2765
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
2766
|
+
* - `403` (Forbidden): Client is not authorized to access user profile data.
|
|
2767
|
+
* - `426` (Upgrade Required): Feature requires Grab app version 5.399 or above.
|
|
2768
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
2769
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
3276
2770
|
*
|
|
3277
2771
|
* @example
|
|
3278
|
-
* **Simple usage**
|
|
3279
2772
|
* ```typescript
|
|
3280
2773
|
* import { ProfileModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
3281
2774
|
*
|
|
@@ -3317,12 +2810,19 @@ export declare class ProfileModule extends BaseModule {
|
|
|
3317
2810
|
* @requiredOAuthScope mobile.profile
|
|
3318
2811
|
*
|
|
3319
2812
|
* @remarks
|
|
3320
|
-
* If the user closes the verify OTP bottom sheet, the
|
|
2813
|
+
* If the user closes the verify OTP bottom sheet, the verification flow ends early.
|
|
3321
2814
|
* Successful verification will also update the email address for the user on Grab.
|
|
3322
2815
|
*
|
|
3323
|
-
* @param request - Optional request parameters for email verification.
|
|
2816
|
+
* @param request - Optional request parameters for email verification.
|
|
3324
2817
|
*
|
|
3325
|
-
* @returns
|
|
2818
|
+
* @returns This method can return the following `status_code` values:
|
|
2819
|
+
* - `200` (OK): Success, email verified and returned in `result` as {@link VerifyEmailResult}.
|
|
2820
|
+
* - `204` (No Content): User closed the native bottom sheet.
|
|
2821
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
2822
|
+
* - `403` (Forbidden): Client is not authorized to access user profile data.
|
|
2823
|
+
* - `426` (Upgrade Required): Feature requires Grab app version 5.399 or above.
|
|
2824
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
2825
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
3326
2826
|
*
|
|
3327
2827
|
* @example
|
|
3328
2828
|
* **Simple usage with email provided**
|
|
@@ -3385,16 +2885,10 @@ export declare class ProfileModule extends BaseModule {
|
|
|
3385
2885
|
* @group Modules
|
|
3386
2886
|
* @category System WebView Kit
|
|
3387
2887
|
*
|
|
3388
|
-
* @example
|
|
3389
|
-
* ```typescript
|
|
3390
|
-
* {
|
|
3391
|
-
* url: 'https://www.example.com'
|
|
3392
|
-
* }
|
|
3393
|
-
* ```
|
|
3394
|
-
*
|
|
3395
2888
|
* @public
|
|
3396
2889
|
*/
|
|
3397
2890
|
export declare type RedirectToSystemWebViewRequest = {
|
|
2891
|
+
/** URL to open or process (for example, `"https://www.example.com"`). */
|
|
3398
2892
|
url: string;
|
|
3399
2893
|
};
|
|
3400
2894
|
|
|
@@ -3404,14 +2898,6 @@ export declare type RedirectToSystemWebViewRequest = {
|
|
|
3404
2898
|
* @group Modules
|
|
3405
2899
|
* @category System WebView Kit
|
|
3406
2900
|
*
|
|
3407
|
-
* @remarks
|
|
3408
|
-
* This response can have the following status codes:
|
|
3409
|
-
* - `200`: Redirect initiated successfully.
|
|
3410
|
-
* - `400`: Invalid URL, domain not whitelisted, or missing callback URL.
|
|
3411
|
-
* - `424`: ASWebAuthenticationSession error - dependency error on iOS.
|
|
3412
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3413
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3414
|
-
*
|
|
3415
2901
|
* @public
|
|
3416
2902
|
*/
|
|
3417
2903
|
export declare type RedirectToSystemWebViewResponse = SDKOkResponse<RedirectToSystemWebViewResult> | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -3432,106 +2918,40 @@ export declare type RedirectToSystemWebViewResult = string;
|
|
|
3432
2918
|
* @group Modules
|
|
3433
2919
|
* @category Scope
|
|
3434
2920
|
*
|
|
3435
|
-
* @remarks
|
|
3436
|
-
* This response can have the following status codes:
|
|
3437
|
-
* - `204`: Scopes reloaded successfully (no content).
|
|
3438
|
-
* - `424`: ScopeKit error - unable to reload scopes due to a dependency error.
|
|
3439
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3440
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3441
|
-
*
|
|
3442
2921
|
* @public
|
|
3443
2922
|
*/
|
|
3444
2923
|
export declare type ReloadScopesResponse = SDKNoContentResponse | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3445
2924
|
|
|
3446
|
-
/**
|
|
3447
|
-
* Result object for reloading scopes.
|
|
3448
|
-
* This operation returns no data on success.
|
|
3449
|
-
*
|
|
3450
|
-
* @group Modules
|
|
3451
|
-
* @category Scope
|
|
3452
|
-
*
|
|
3453
|
-
* @public
|
|
3454
|
-
*/
|
|
3455
|
-
export declare type ReloadScopesResult = void;
|
|
3456
|
-
|
|
3457
2925
|
/**
|
|
3458
2926
|
* Response when removing all values.
|
|
3459
2927
|
*
|
|
3460
2928
|
* @group Modules
|
|
3461
2929
|
* @category Storage
|
|
3462
2930
|
*
|
|
3463
|
-
* @remarks
|
|
3464
|
-
* This response can have the following status codes:
|
|
3465
|
-
* - `204`: All values removed successfully.
|
|
3466
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
3467
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3468
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3469
|
-
*
|
|
3470
2931
|
* @public
|
|
3471
2932
|
*/
|
|
3472
2933
|
export declare type RemoveAllResponse = SDKNoContentResponse | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3473
2934
|
|
|
3474
|
-
/**
|
|
3475
|
-
* Result object for removing all values.
|
|
3476
|
-
* This operation returns no data on success.
|
|
3477
|
-
*
|
|
3478
|
-
* @group Modules
|
|
3479
|
-
* @category Storage
|
|
3480
|
-
*
|
|
3481
|
-
* @public
|
|
3482
|
-
*/
|
|
3483
|
-
export declare type RemoveAllResult = void;
|
|
3484
|
-
|
|
3485
2935
|
/**
|
|
3486
2936
|
* Response when removing a value.
|
|
3487
2937
|
*
|
|
3488
2938
|
* @group Modules
|
|
3489
2939
|
* @category Storage
|
|
3490
2940
|
*
|
|
3491
|
-
* @remarks
|
|
3492
|
-
* This response can have the following status codes:
|
|
3493
|
-
* - `204`: Value removed successfully.
|
|
3494
|
-
* - `400`: Missing required parameters - key not provided.
|
|
3495
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
3496
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3497
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3498
|
-
*
|
|
3499
2941
|
* @public
|
|
3500
2942
|
*/
|
|
3501
2943
|
export declare type RemoveResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3502
2944
|
|
|
3503
|
-
/**
|
|
3504
|
-
* Result object for removing a value.
|
|
3505
|
-
* This operation returns no data on success.
|
|
3506
|
-
*
|
|
3507
|
-
* @group Modules
|
|
3508
|
-
* @category Storage
|
|
3509
|
-
*
|
|
3510
|
-
* @public
|
|
3511
|
-
*/
|
|
3512
|
-
export declare type RemoveResult = void;
|
|
3513
|
-
|
|
3514
2945
|
/**
|
|
3515
2946
|
* Request parameters for scanning QR codes.
|
|
3516
2947
|
*
|
|
3517
2948
|
* @group Modules
|
|
3518
2949
|
* @category Camera
|
|
3519
2950
|
*
|
|
3520
|
-
* @example
|
|
3521
|
-
* **Request with custom title:**
|
|
3522
|
-
* ```typescript
|
|
3523
|
-
* { title: 'Scan Payment QR' }
|
|
3524
|
-
* ```
|
|
3525
|
-
*
|
|
3526
|
-
* @example
|
|
3527
|
-
* **Minimal request (uses default title):**
|
|
3528
|
-
* ```typescript
|
|
3529
|
-
* {}
|
|
3530
|
-
* ```
|
|
3531
|
-
*
|
|
3532
2951
|
* @public
|
|
3533
2952
|
*/
|
|
3534
2953
|
export declare type ScanQRCodeRequest = {
|
|
2954
|
+
/** Title text to display on the QR code scanning UI (for example, `"Scan Payment QR"`). */
|
|
3535
2955
|
title?: string;
|
|
3536
2956
|
};
|
|
3537
2957
|
|
|
@@ -3541,15 +2961,6 @@ export declare type ScanQRCodeRequest = {
|
|
|
3541
2961
|
* @group Modules
|
|
3542
2962
|
* @category Camera
|
|
3543
2963
|
*
|
|
3544
|
-
* @remarks
|
|
3545
|
-
* This response can have the following status codes:
|
|
3546
|
-
* - `200`: Successfully scanned QR code. The `result` contains the scanned QR code data.
|
|
3547
|
-
* - `204`: User cancelled the QR code scanning. No result data is returned.
|
|
3548
|
-
* - `400`: Bad request - invalid request parameters.
|
|
3549
|
-
* - `403`: Camera permission is not enabled for the Grab app.
|
|
3550
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3551
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3552
|
-
*
|
|
3553
2964
|
* @public
|
|
3554
2965
|
*/
|
|
3555
2966
|
export declare type ScanQRCodeResponse = SDKOkResponse<ScanQRCodeResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<403> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -3560,14 +2971,10 @@ export declare type ScanQRCodeResponse = SDKOkResponse<ScanQRCodeResult> | SDKNo
|
|
|
3560
2971
|
* @group Modules
|
|
3561
2972
|
* @category Camera
|
|
3562
2973
|
*
|
|
3563
|
-
* @example
|
|
3564
|
-
* ```typescript
|
|
3565
|
-
* { qrCode: 'https://example.com/payment/123' }
|
|
3566
|
-
* ```
|
|
3567
|
-
*
|
|
3568
2974
|
* @public
|
|
3569
2975
|
*/
|
|
3570
2976
|
export declare type ScanQRCodeResult = {
|
|
2977
|
+
/** QR code value returned by the scanner (for example, `"https://example.com/payment/123"`). */
|
|
3571
2978
|
qrCode: string;
|
|
3572
2979
|
};
|
|
3573
2980
|
|
|
@@ -3608,10 +3015,14 @@ export declare class ScopeModule extends BaseModule {
|
|
|
3608
3015
|
* @param module - The name of the SDK module to check access for (e.g., 'CameraModule').
|
|
3609
3016
|
* @param method - The method name within the module to check access for (e.g., 'scanQRCode').
|
|
3610
3017
|
*
|
|
3611
|
-
* @returns
|
|
3018
|
+
* @returns This method can return the following `status_code` values:
|
|
3019
|
+
* - `200` (OK): Access check completed successfully. The `result` contains {@link HasAccessToResult}.
|
|
3020
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3021
|
+
* - `424` (Failed Dependency): Dependency error occurred while checking access.
|
|
3022
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
3023
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
3612
3024
|
*
|
|
3613
3025
|
* @example
|
|
3614
|
-
* **Simple usage**
|
|
3615
3026
|
* ```typescript
|
|
3616
3027
|
* import { ScopeModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
3617
3028
|
*
|
|
@@ -3638,10 +3049,13 @@ export declare class ScopeModule extends BaseModule {
|
|
|
3638
3049
|
* Requests to reload the consented OAuth scopes for the current client.
|
|
3639
3050
|
* This refreshes the permissions from the server.
|
|
3640
3051
|
*
|
|
3641
|
-
* @returns
|
|
3052
|
+
* @returns This method can return the following `status_code` values:
|
|
3053
|
+
* - `204` (No Content): Scopes reloaded successfully.
|
|
3054
|
+
* - `424` (Failed Dependency): Dependency error occurred while reloading scopes.
|
|
3055
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
3056
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
3642
3057
|
*
|
|
3643
3058
|
* @example
|
|
3644
|
-
* **Simple usage**
|
|
3645
3059
|
* ```typescript
|
|
3646
3060
|
* import { ScopeModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
3647
3061
|
*
|
|
@@ -3814,30 +3228,14 @@ export declare type SDKStreamHandlers<T extends SDKResponse = SDKResponse> = Rea
|
|
|
3814
3228
|
* - **States:** {@link ContainerAnalyticsEventState}
|
|
3815
3229
|
* - **Names:** {@link ContainerAnalyticsEventName}
|
|
3816
3230
|
*
|
|
3817
|
-
* @example
|
|
3818
|
-
* **Analytics event with state and name:**
|
|
3819
|
-
* ```typescript
|
|
3820
|
-
* {
|
|
3821
|
-
* state: 'HOMEPAGE',
|
|
3822
|
-
* name: 'DEFAULT'
|
|
3823
|
-
* }
|
|
3824
|
-
* ```
|
|
3825
|
-
*
|
|
3826
|
-
* @example
|
|
3827
|
-
* **Analytics event with additional data:**
|
|
3828
|
-
* ```typescript
|
|
3829
|
-
* {
|
|
3830
|
-
* state: 'CHECKOUT_PAGE',
|
|
3831
|
-
* name: 'BOOK',
|
|
3832
|
-
* data: { itemId: '123', quantity: 2 }
|
|
3833
|
-
* }
|
|
3834
|
-
* ```
|
|
3835
|
-
*
|
|
3836
3231
|
* @public
|
|
3837
3232
|
*/
|
|
3838
3233
|
export declare type SendAnalyticsEventRequest = {
|
|
3234
|
+
/** State value (for example, `"HOMEPAGE"`). */
|
|
3839
3235
|
state: string;
|
|
3236
|
+
/** Name value (for example, `"DEFAULT"`). */
|
|
3840
3237
|
name: string;
|
|
3238
|
+
/** Data value (for example, `{ "darkMode": true }`). */
|
|
3841
3239
|
data?: Record<string, unknown>;
|
|
3842
3240
|
};
|
|
3843
3241
|
|
|
@@ -3847,74 +3245,30 @@ export declare type SendAnalyticsEventRequest = {
|
|
|
3847
3245
|
* @group Modules
|
|
3848
3246
|
* @category Container
|
|
3849
3247
|
*
|
|
3850
|
-
* @remarks
|
|
3851
|
-
* This response can have the following status codes:
|
|
3852
|
-
* - `204`: Analytics event sent successfully.
|
|
3853
|
-
* - `400`: Invalid analytics event parameters.
|
|
3854
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3855
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3856
|
-
*
|
|
3857
3248
|
* @public
|
|
3858
3249
|
*/
|
|
3859
3250
|
export declare type SendAnalyticsEventResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3860
3251
|
|
|
3861
|
-
/**
|
|
3862
|
-
* Result when sending analytics events.
|
|
3863
|
-
* This operation returns no data on success.
|
|
3864
|
-
*
|
|
3865
|
-
* @group Modules
|
|
3866
|
-
* @category Container
|
|
3867
|
-
*
|
|
3868
|
-
* @public
|
|
3869
|
-
*/
|
|
3870
|
-
export declare type SendAnalyticsEventResult = void;
|
|
3871
|
-
|
|
3872
3252
|
/**
|
|
3873
3253
|
* Request parameters for sending a network request.
|
|
3874
3254
|
*
|
|
3875
3255
|
* @group Modules
|
|
3876
3256
|
* @category Network
|
|
3877
3257
|
*
|
|
3878
|
-
* @example
|
|
3879
|
-
* **GET request with headers:**
|
|
3880
|
-
* ```typescript
|
|
3881
|
-
* {
|
|
3882
|
-
* endpoint: 'https://api.example.com/users',
|
|
3883
|
-
* method: 'GET',
|
|
3884
|
-
* headers: { 'Authorization': 'Bearer token123' }
|
|
3885
|
-
* }
|
|
3886
|
-
* ```
|
|
3887
|
-
*
|
|
3888
|
-
* @example
|
|
3889
|
-
* **POST request with body:**
|
|
3890
|
-
* ```typescript
|
|
3891
|
-
* {
|
|
3892
|
-
* endpoint: 'https://api.example.com/users',
|
|
3893
|
-
* method: 'POST',
|
|
3894
|
-
* headers: { 'Content-Type': 'application/json' },
|
|
3895
|
-
* body: { name: 'John Doe', email: 'john@example.com' }
|
|
3896
|
-
* }
|
|
3897
|
-
* ```
|
|
3898
|
-
*
|
|
3899
|
-
* @example
|
|
3900
|
-
* **Request with query parameters and timeout:**
|
|
3901
|
-
* ```typescript
|
|
3902
|
-
* {
|
|
3903
|
-
* endpoint: 'https://api.example.com/search',
|
|
3904
|
-
* method: 'GET',
|
|
3905
|
-
* query: { q: 'grab', limit: '10' },
|
|
3906
|
-
* timeout: 30
|
|
3907
|
-
* }
|
|
3908
|
-
* ```
|
|
3909
|
-
*
|
|
3910
3258
|
* @public
|
|
3911
3259
|
*/
|
|
3912
3260
|
export declare type SendRequest = {
|
|
3261
|
+
/** Request payload body. */
|
|
3913
3262
|
body?: unknown;
|
|
3263
|
+
/** Request endpoint URL. */
|
|
3914
3264
|
endpoint: string;
|
|
3265
|
+
/** HTTP headers sent with the request. */
|
|
3915
3266
|
headers?: Record<string, string>;
|
|
3267
|
+
/** HTTP method used for the request (for example, `"GET"` or `"POST"`). */
|
|
3916
3268
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3269
|
+
/** Query parameters appended to the request URL. */
|
|
3917
3270
|
query?: Record<string, string>;
|
|
3271
|
+
/** Request timeout in milliseconds. */
|
|
3918
3272
|
timeout?: number;
|
|
3919
3273
|
};
|
|
3920
3274
|
|
|
@@ -3924,13 +3278,6 @@ export declare type SendRequest = {
|
|
|
3924
3278
|
* @group Modules
|
|
3925
3279
|
* @category Network
|
|
3926
3280
|
*
|
|
3927
|
-
* @remarks
|
|
3928
|
-
* This response can have any HTTP status code returned by the external API:
|
|
3929
|
-
* - Success codes (2xx): Contains the `result` with response data, except 204 which has no body.
|
|
3930
|
-
* - Client error codes (4xx): Contains an `error` message from the API.
|
|
3931
|
-
* - Server error codes (5xx): Contains an `error` message from the API.
|
|
3932
|
-
* - SDK error codes (400, 500, 501): Invalid request, internal SDK error, or not implemented.
|
|
3933
|
-
*
|
|
3934
3281
|
* @public
|
|
3935
3282
|
*/
|
|
3936
3283
|
export declare type SendResponse = SDKOkResponse<SendResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<401> | SDKErrorResponse<403> | SDKErrorResponse<404> | SDKErrorResponse<424> | SDKErrorResponse<426> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -3952,15 +3299,11 @@ export declare type SendResult = Record<string, unknown>;
|
|
|
3952
3299
|
|
|
3953
3300
|
/**
|
|
3954
3301
|
* Request parameters for setting the background color.
|
|
3302
|
+
* The value must be a hexadecimal color string (for example, `#1A73E8`).
|
|
3955
3303
|
*
|
|
3956
3304
|
* @group Modules
|
|
3957
3305
|
* @category Container
|
|
3958
3306
|
*
|
|
3959
|
-
* @example
|
|
3960
|
-
* ```typescript
|
|
3961
|
-
* '#ffffff'
|
|
3962
|
-
* ```
|
|
3963
|
-
*
|
|
3964
3307
|
* @public
|
|
3965
3308
|
*/
|
|
3966
3309
|
export declare type SetBackgroundColorRequest = string;
|
|
@@ -3971,43 +3314,22 @@ export declare type SetBackgroundColorRequest = string;
|
|
|
3971
3314
|
* @group Modules
|
|
3972
3315
|
* @category Container
|
|
3973
3316
|
*
|
|
3974
|
-
* @remarks
|
|
3975
|
-
* This response can have the following status codes:
|
|
3976
|
-
* - `204`: Background color set successfully.
|
|
3977
|
-
* - `400`: Invalid background color format.
|
|
3978
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
3979
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
3980
|
-
*
|
|
3981
3317
|
* @public
|
|
3982
3318
|
*/
|
|
3983
3319
|
export declare type SetBackgroundColorResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
3984
3320
|
|
|
3985
|
-
/**
|
|
3986
|
-
* Result when setting the background color.
|
|
3987
|
-
* This operation returns no data on success.
|
|
3988
|
-
*
|
|
3989
|
-
* @group Modules
|
|
3990
|
-
* @category Container
|
|
3991
|
-
*
|
|
3992
|
-
* @public
|
|
3993
|
-
*/
|
|
3994
|
-
export declare type SetBackgroundColorResult = void;
|
|
3995
|
-
|
|
3996
3321
|
/**
|
|
3997
3322
|
* Request parameters for storing a boolean value in storage.
|
|
3998
3323
|
*
|
|
3999
3324
|
* @group Modules
|
|
4000
3325
|
* @category Storage
|
|
4001
3326
|
*
|
|
4002
|
-
* @example
|
|
4003
|
-
* ```typescript
|
|
4004
|
-
* { key: 'isDarkMode', value: true }
|
|
4005
|
-
* ```
|
|
4006
|
-
*
|
|
4007
3327
|
* @public
|
|
4008
3328
|
*/
|
|
4009
3329
|
export declare type SetBooleanRequest = {
|
|
3330
|
+
/** Storage key used for read/write operations. */
|
|
4010
3331
|
key: string;
|
|
3332
|
+
/** Value associated with the storage key. */
|
|
4011
3333
|
value: boolean;
|
|
4012
3334
|
};
|
|
4013
3335
|
|
|
@@ -4017,44 +3339,22 @@ export declare type SetBooleanRequest = {
|
|
|
4017
3339
|
* @group Modules
|
|
4018
3340
|
* @category Storage
|
|
4019
3341
|
*
|
|
4020
|
-
* @remarks
|
|
4021
|
-
* This response can have the following status codes:
|
|
4022
|
-
* - `204`: Value stored successfully.
|
|
4023
|
-
* - `400`: Missing required parameters - key or value not provided.
|
|
4024
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
4025
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4026
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4027
|
-
*
|
|
4028
3342
|
* @public
|
|
4029
3343
|
*/
|
|
4030
3344
|
export declare type SetBooleanResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4031
3345
|
|
|
4032
|
-
/**
|
|
4033
|
-
* Result object for setting a boolean value.
|
|
4034
|
-
* This operation returns no data on success.
|
|
4035
|
-
*
|
|
4036
|
-
* @group Modules
|
|
4037
|
-
* @category Storage
|
|
4038
|
-
*
|
|
4039
|
-
* @public
|
|
4040
|
-
*/
|
|
4041
|
-
export declare type SetBooleanResult = void;
|
|
4042
|
-
|
|
4043
3346
|
/**
|
|
4044
3347
|
* Request parameters for storing a double value in storage.
|
|
4045
3348
|
*
|
|
4046
3349
|
* @group Modules
|
|
4047
3350
|
* @category Storage
|
|
4048
3351
|
*
|
|
4049
|
-
* @example
|
|
4050
|
-
* ```typescript
|
|
4051
|
-
* { key: 'price', value: 19.99 }
|
|
4052
|
-
* ```
|
|
4053
|
-
*
|
|
4054
3352
|
* @public
|
|
4055
3353
|
*/
|
|
4056
3354
|
export declare type SetDoubleRequest = {
|
|
3355
|
+
/** Storage key used for read/write operations. */
|
|
4057
3356
|
key: string;
|
|
3357
|
+
/** Value associated with the storage key. */
|
|
4058
3358
|
value: number;
|
|
4059
3359
|
};
|
|
4060
3360
|
|
|
@@ -4064,44 +3364,22 @@ export declare type SetDoubleRequest = {
|
|
|
4064
3364
|
* @group Modules
|
|
4065
3365
|
* @category Storage
|
|
4066
3366
|
*
|
|
4067
|
-
* @remarks
|
|
4068
|
-
* This response can have the following status codes:
|
|
4069
|
-
* - `204`: Value stored successfully.
|
|
4070
|
-
* - `400`: Missing required parameters - key or value not provided.
|
|
4071
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
4072
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4073
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4074
|
-
*
|
|
4075
3367
|
* @public
|
|
4076
3368
|
*/
|
|
4077
3369
|
export declare type SetDoubleResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4078
3370
|
|
|
4079
|
-
/**
|
|
4080
|
-
* Result object for setting a double value.
|
|
4081
|
-
* This operation returns no data on success.
|
|
4082
|
-
*
|
|
4083
|
-
* @group Modules
|
|
4084
|
-
* @category Storage
|
|
4085
|
-
*
|
|
4086
|
-
* @public
|
|
4087
|
-
*/
|
|
4088
|
-
export declare type SetDoubleResult = void;
|
|
4089
|
-
|
|
4090
3371
|
/**
|
|
4091
3372
|
* Request parameters for storing an integer value in storage.
|
|
4092
3373
|
*
|
|
4093
3374
|
* @group Modules
|
|
4094
3375
|
* @category Storage
|
|
4095
3376
|
*
|
|
4096
|
-
* @example
|
|
4097
|
-
* ```typescript
|
|
4098
|
-
* { key: 'userCount', value: 42 }
|
|
4099
|
-
* ```
|
|
4100
|
-
*
|
|
4101
3377
|
* @public
|
|
4102
3378
|
*/
|
|
4103
3379
|
export declare type SetIntRequest = {
|
|
3380
|
+
/** Storage key used for read/write operations. */
|
|
4104
3381
|
key: string;
|
|
3382
|
+
/** Value associated with the storage key. */
|
|
4105
3383
|
value: number;
|
|
4106
3384
|
};
|
|
4107
3385
|
|
|
@@ -4111,44 +3389,22 @@ export declare type SetIntRequest = {
|
|
|
4111
3389
|
* @group Modules
|
|
4112
3390
|
* @category Storage
|
|
4113
3391
|
*
|
|
4114
|
-
* @remarks
|
|
4115
|
-
* This response can have the following status codes:
|
|
4116
|
-
* - `204`: Value stored successfully.
|
|
4117
|
-
* - `400`: Missing required parameters - key or value not provided.
|
|
4118
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
4119
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4120
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4121
|
-
*
|
|
4122
3392
|
* @public
|
|
4123
3393
|
*/
|
|
4124
3394
|
export declare type SetIntResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4125
3395
|
|
|
4126
|
-
/**
|
|
4127
|
-
* Result object for setting an integer value.
|
|
4128
|
-
* This operation returns no data on success.
|
|
4129
|
-
*
|
|
4130
|
-
* @group Modules
|
|
4131
|
-
* @category Storage
|
|
4132
|
-
*
|
|
4133
|
-
* @public
|
|
4134
|
-
*/
|
|
4135
|
-
export declare type SetIntResult = void;
|
|
4136
|
-
|
|
4137
3396
|
/**
|
|
4138
3397
|
* Request parameters for storing a string value in storage.
|
|
4139
3398
|
*
|
|
4140
3399
|
* @group Modules
|
|
4141
3400
|
* @category Storage
|
|
4142
3401
|
*
|
|
4143
|
-
* @example
|
|
4144
|
-
* ```typescript
|
|
4145
|
-
* { key: 'username', value: 'john_doe' }
|
|
4146
|
-
* ```
|
|
4147
|
-
*
|
|
4148
3402
|
* @public
|
|
4149
3403
|
*/
|
|
4150
3404
|
export declare type SetStringRequest = {
|
|
3405
|
+
/** Storage key used for read/write operations. */
|
|
4151
3406
|
key: string;
|
|
3407
|
+
/** Value associated with the storage key. */
|
|
4152
3408
|
value: string;
|
|
4153
3409
|
};
|
|
4154
3410
|
|
|
@@ -4158,40 +3414,16 @@ export declare type SetStringRequest = {
|
|
|
4158
3414
|
* @group Modules
|
|
4159
3415
|
* @category Storage
|
|
4160
3416
|
*
|
|
4161
|
-
* @remarks
|
|
4162
|
-
* This response can have the following status codes:
|
|
4163
|
-
* - `204`: Value stored successfully.
|
|
4164
|
-
* - `400`: Missing required parameters - key or value not provided.
|
|
4165
|
-
* - `424`: Failed Dependency - storage operation failed due to underlying storage error.
|
|
4166
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4167
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4168
|
-
*
|
|
4169
3417
|
* @public
|
|
4170
3418
|
*/
|
|
4171
3419
|
export declare type SetStringResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<424> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4172
3420
|
|
|
4173
|
-
/**
|
|
4174
|
-
* Result object for setting a string value.
|
|
4175
|
-
* This operation returns no data on success.
|
|
4176
|
-
*
|
|
4177
|
-
* @group Modules
|
|
4178
|
-
* @category Storage
|
|
4179
|
-
*
|
|
4180
|
-
* @public
|
|
4181
|
-
*/
|
|
4182
|
-
export declare type SetStringResult = void;
|
|
4183
|
-
|
|
4184
3421
|
/**
|
|
4185
3422
|
* Request parameters for setting the title.
|
|
4186
3423
|
*
|
|
4187
3424
|
* @group Modules
|
|
4188
3425
|
* @category Container
|
|
4189
3426
|
*
|
|
4190
|
-
* @example
|
|
4191
|
-
* ```typescript
|
|
4192
|
-
* 'Home Page'
|
|
4193
|
-
* ```
|
|
4194
|
-
*
|
|
4195
3427
|
* @public
|
|
4196
3428
|
*/
|
|
4197
3429
|
export declare type SetTitleRequest = string;
|
|
@@ -4202,109 +3434,40 @@ export declare type SetTitleRequest = string;
|
|
|
4202
3434
|
* @group Modules
|
|
4203
3435
|
* @category Container
|
|
4204
3436
|
*
|
|
4205
|
-
* @remarks
|
|
4206
|
-
* This response can have the following status codes:
|
|
4207
|
-
* - `204`: Title set successfully.
|
|
4208
|
-
* - `400`: Invalid title parameter.
|
|
4209
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4210
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4211
|
-
*
|
|
4212
3437
|
* @public
|
|
4213
3438
|
*/
|
|
4214
3439
|
export declare type SetTitleResponse = SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4215
3440
|
|
|
4216
|
-
/**
|
|
4217
|
-
* Result when setting the title.
|
|
4218
|
-
* This operation returns no data on success.
|
|
4219
|
-
*
|
|
4220
|
-
* @group Modules
|
|
4221
|
-
* @category Container
|
|
4222
|
-
*
|
|
4223
|
-
* @public
|
|
4224
|
-
*/
|
|
4225
|
-
export declare type SetTitleResult = void;
|
|
4226
|
-
|
|
4227
3441
|
/**
|
|
4228
3442
|
* Response when showing the back button.
|
|
4229
3443
|
*
|
|
4230
3444
|
* @group Modules
|
|
4231
3445
|
* @category Container
|
|
4232
3446
|
*
|
|
4233
|
-
* @remarks
|
|
4234
|
-
* This response can have the following status codes:
|
|
4235
|
-
* - `204`: Back button shown successfully.
|
|
4236
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4237
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4238
|
-
*
|
|
4239
3447
|
* @public
|
|
4240
3448
|
*/
|
|
4241
3449
|
export declare type ShowBackButtonResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4242
3450
|
|
|
4243
|
-
/**
|
|
4244
|
-
* Result when showing the back button.
|
|
4245
|
-
* This operation returns no data on success.
|
|
4246
|
-
*
|
|
4247
|
-
* @group Modules
|
|
4248
|
-
* @category Container
|
|
4249
|
-
*
|
|
4250
|
-
* @public
|
|
4251
|
-
*/
|
|
4252
|
-
export declare type ShowBackButtonResult = void;
|
|
4253
|
-
|
|
4254
3451
|
/**
|
|
4255
3452
|
* Response when showing the loader.
|
|
4256
3453
|
*
|
|
4257
3454
|
* @group Modules
|
|
4258
3455
|
* @category Container
|
|
4259
3456
|
*
|
|
4260
|
-
* @remarks
|
|
4261
|
-
* This response can have the following status codes:
|
|
4262
|
-
* - `204`: Loader shown successfully.
|
|
4263
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4264
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4265
|
-
*
|
|
4266
3457
|
* @public
|
|
4267
3458
|
*/
|
|
4268
3459
|
export declare type ShowLoaderResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4269
3460
|
|
|
4270
|
-
/**
|
|
4271
|
-
* Result when showing the loader.
|
|
4272
|
-
* This operation returns no data on success.
|
|
4273
|
-
*
|
|
4274
|
-
* @group Modules
|
|
4275
|
-
* @category Container
|
|
4276
|
-
*
|
|
4277
|
-
* @public
|
|
4278
|
-
*/
|
|
4279
|
-
export declare type ShowLoaderResult = void;
|
|
4280
|
-
|
|
4281
3461
|
/**
|
|
4282
3462
|
* Response when showing the refresh button.
|
|
4283
3463
|
*
|
|
4284
3464
|
* @group Modules
|
|
4285
3465
|
* @category Container
|
|
4286
3466
|
*
|
|
4287
|
-
* @remarks
|
|
4288
|
-
* This response can have the following status codes:
|
|
4289
|
-
* - `204`: Refresh button shown successfully.
|
|
4290
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4291
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4292
|
-
*
|
|
4293
3467
|
* @public
|
|
4294
3468
|
*/
|
|
4295
3469
|
export declare type ShowRefreshButtonResponse = SDKNoContentResponse | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
4296
3470
|
|
|
4297
|
-
/**
|
|
4298
|
-
* Result when showing the refresh button.
|
|
4299
|
-
* This operation returns no data on success.
|
|
4300
|
-
*
|
|
4301
|
-
* @group Modules
|
|
4302
|
-
* @category Container
|
|
4303
|
-
*
|
|
4304
|
-
* @public
|
|
4305
|
-
*/
|
|
4306
|
-
export declare type ShowRefreshButtonResult = void;
|
|
4307
|
-
|
|
4308
3471
|
/**
|
|
4309
3472
|
* SDK module for controlling the native splash / Lottie loading screen via `JSBridge`.
|
|
4310
3473
|
*
|
|
@@ -4338,7 +3501,12 @@ export declare class SplashScreenModule extends BaseModule {
|
|
|
4338
3501
|
/**
|
|
4339
3502
|
* Dismisses the native splash (Lottie) loading view if it is presented.
|
|
4340
3503
|
*
|
|
4341
|
-
* @returns
|
|
3504
|
+
* @returns This method can return the following `status_code` values:
|
|
3505
|
+
* - `204` (No Content): No splash screen shown, or it was closed successfully.
|
|
3506
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3507
|
+
* - `403` (Forbidden): Missing consent for the required OAuth scope.
|
|
3508
|
+
* - `500` (Internal Server Error): Unexpected error while invoking `JSBridge`.
|
|
3509
|
+
* - `501` (Not Implemented): Not in the Grab app WebView environment.
|
|
4342
3510
|
*
|
|
4343
3511
|
* @example
|
|
4344
3512
|
* ```typescript
|
|
@@ -4401,10 +3569,14 @@ export declare class StorageModule extends BaseModule {
|
|
|
4401
3569
|
* @param key - The key to store the value under.
|
|
4402
3570
|
* @param value - The boolean value to store.
|
|
4403
3571
|
*
|
|
4404
|
-
* @returns
|
|
3572
|
+
* @returns This method can return the following `status_code` values:
|
|
3573
|
+
* - `204` (No Content): Value stored successfully.
|
|
3574
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3575
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3576
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3577
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4405
3578
|
*
|
|
4406
3579
|
* @example
|
|
4407
|
-
* **Simple usage**
|
|
4408
3580
|
* ```typescript
|
|
4409
3581
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4410
3582
|
*
|
|
@@ -4434,10 +3606,15 @@ export declare class StorageModule extends BaseModule {
|
|
|
4434
3606
|
*
|
|
4435
3607
|
* @param key - The key to retrieve the value for.
|
|
4436
3608
|
*
|
|
4437
|
-
* @returns
|
|
3609
|
+
* @returns This method can return the following `status_code` values:
|
|
3610
|
+
* - `200` (OK): Value retrieved successfully. The `result` contains {@link GetBooleanResult}.
|
|
3611
|
+
* - `204` (No Content): Value not found in storage.
|
|
3612
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3613
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3614
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3615
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4438
3616
|
*
|
|
4439
3617
|
* @example
|
|
4440
|
-
* **Simple usage**
|
|
4441
3618
|
* ```typescript
|
|
4442
3619
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4443
3620
|
*
|
|
@@ -4472,10 +3649,14 @@ export declare class StorageModule extends BaseModule {
|
|
|
4472
3649
|
* @param key - The key to store the value under.
|
|
4473
3650
|
* @param value - The integer value to store.
|
|
4474
3651
|
*
|
|
4475
|
-
* @returns
|
|
3652
|
+
* @returns This method can return the following `status_code` values:
|
|
3653
|
+
* - `204` (No Content): Value stored successfully.
|
|
3654
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3655
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3656
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3657
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4476
3658
|
*
|
|
4477
3659
|
* @example
|
|
4478
|
-
* **Simple usage**
|
|
4479
3660
|
* ```typescript
|
|
4480
3661
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4481
3662
|
*
|
|
@@ -4505,10 +3686,15 @@ export declare class StorageModule extends BaseModule {
|
|
|
4505
3686
|
*
|
|
4506
3687
|
* @param key - The key to retrieve the value for.
|
|
4507
3688
|
*
|
|
4508
|
-
* @returns
|
|
3689
|
+
* @returns This method can return the following `status_code` values:
|
|
3690
|
+
* - `200` (OK): Value retrieved successfully. The `result` contains {@link GetIntResult}.
|
|
3691
|
+
* - `204` (No Content): Value not found in storage.
|
|
3692
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3693
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3694
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3695
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4509
3696
|
*
|
|
4510
3697
|
* @example
|
|
4511
|
-
* **Simple usage**
|
|
4512
3698
|
* ```typescript
|
|
4513
3699
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4514
3700
|
*
|
|
@@ -4543,10 +3729,14 @@ export declare class StorageModule extends BaseModule {
|
|
|
4543
3729
|
* @param key - The key to store the value under.
|
|
4544
3730
|
* @param value - The string value to store.
|
|
4545
3731
|
*
|
|
4546
|
-
* @returns
|
|
3732
|
+
* @returns This method can return the following `status_code` values:
|
|
3733
|
+
* - `204` (No Content): Value stored successfully.
|
|
3734
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3735
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3736
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3737
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4547
3738
|
*
|
|
4548
3739
|
* @example
|
|
4549
|
-
* **Simple usage**
|
|
4550
3740
|
* ```typescript
|
|
4551
3741
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4552
3742
|
*
|
|
@@ -4576,10 +3766,15 @@ export declare class StorageModule extends BaseModule {
|
|
|
4576
3766
|
*
|
|
4577
3767
|
* @param key - The key to retrieve the value for.
|
|
4578
3768
|
*
|
|
4579
|
-
* @returns
|
|
3769
|
+
* @returns This method can return the following `status_code` values:
|
|
3770
|
+
* - `200` (OK): Value retrieved successfully. The `result` contains {@link GetStringResult}.
|
|
3771
|
+
* - `204` (No Content): Value not found in storage.
|
|
3772
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3773
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3774
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3775
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4580
3776
|
*
|
|
4581
3777
|
* @example
|
|
4582
|
-
* **Simple usage**
|
|
4583
3778
|
* ```typescript
|
|
4584
3779
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4585
3780
|
*
|
|
@@ -4614,10 +3809,14 @@ export declare class StorageModule extends BaseModule {
|
|
|
4614
3809
|
* @param key - The key to store the value under.
|
|
4615
3810
|
* @param value - The double value to store.
|
|
4616
3811
|
*
|
|
4617
|
-
* @returns
|
|
3812
|
+
* @returns This method can return the following `status_code` values:
|
|
3813
|
+
* - `204` (No Content): Value stored successfully.
|
|
3814
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3815
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3816
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3817
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4618
3818
|
*
|
|
4619
3819
|
* @example
|
|
4620
|
-
* **Simple usage**
|
|
4621
3820
|
* ```typescript
|
|
4622
3821
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4623
3822
|
*
|
|
@@ -4647,10 +3846,15 @@ export declare class StorageModule extends BaseModule {
|
|
|
4647
3846
|
*
|
|
4648
3847
|
* @param key - The key to retrieve the value for.
|
|
4649
3848
|
*
|
|
4650
|
-
* @returns
|
|
3849
|
+
* @returns This method can return the following `status_code` values:
|
|
3850
|
+
* - `200` (OK): Value retrieved successfully. The `result` contains {@link GetDoubleResult}.
|
|
3851
|
+
* - `204` (No Content): Value not found in storage.
|
|
3852
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3853
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3854
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3855
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4651
3856
|
*
|
|
4652
3857
|
* @example
|
|
4653
|
-
* **Simple usage**
|
|
4654
3858
|
* ```typescript
|
|
4655
3859
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4656
3860
|
*
|
|
@@ -4684,10 +3888,14 @@ export declare class StorageModule extends BaseModule {
|
|
|
4684
3888
|
*
|
|
4685
3889
|
* @param key - The key to remove from storage.
|
|
4686
3890
|
*
|
|
4687
|
-
* @returns
|
|
3891
|
+
* @returns This method can return the following `status_code` values:
|
|
3892
|
+
* - `204` (No Content): Value removed successfully.
|
|
3893
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
3894
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3895
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3896
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4688
3897
|
*
|
|
4689
3898
|
* @example
|
|
4690
|
-
* **Simple usage**
|
|
4691
3899
|
* ```typescript
|
|
4692
3900
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4693
3901
|
*
|
|
@@ -4715,10 +3923,13 @@ export declare class StorageModule extends BaseModule {
|
|
|
4715
3923
|
*
|
|
4716
3924
|
* @requiredOAuthScope mobile.storage
|
|
4717
3925
|
*
|
|
4718
|
-
* @returns
|
|
3926
|
+
* @returns This method can return the following `status_code` values:
|
|
3927
|
+
* - `204` (No Content): All values removed successfully.
|
|
3928
|
+
* - `424` (Failed Dependency): Storage operation failed.
|
|
3929
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
3930
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4719
3931
|
*
|
|
4720
3932
|
* @example
|
|
4721
|
-
* **Simple usage**
|
|
4722
3933
|
* ```typescript
|
|
4723
3934
|
* import { StorageModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4724
3935
|
*
|
|
@@ -4795,12 +4006,16 @@ export declare class SystemWebViewKitModule extends BaseModule {
|
|
|
4795
4006
|
/**
|
|
4796
4007
|
* Opens a URL in the device's system web browser or web view.
|
|
4797
4008
|
*
|
|
4798
|
-
* @param request - The URL to open in the system web view.
|
|
4009
|
+
* @param request - The URL to open in the system web view.
|
|
4799
4010
|
*
|
|
4800
|
-
* @returns
|
|
4011
|
+
* @returns This method can return the following `status_code` values:
|
|
4012
|
+
* - `200` (OK): Redirect initiated successfully.
|
|
4013
|
+
* - `400` (Bad Request): Invalid request parameters.
|
|
4014
|
+
* - `424` (Failed Dependency): Dependency error occurred while processing the request.
|
|
4015
|
+
* - `500` (Internal Server Error): An unexpected error occurred.
|
|
4016
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4801
4017
|
*
|
|
4802
4018
|
* @example
|
|
4803
|
-
* **Simple usage**
|
|
4804
4019
|
* ```typescript
|
|
4805
4020
|
* import { SystemWebViewKitModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4806
4021
|
*
|
|
@@ -4837,19 +4052,6 @@ export declare class SystemWebViewKitModule extends BaseModule {
|
|
|
4837
4052
|
* This type is intentionally flexible as the checkout parameters vary depending on the specific payment flow and partner requirements.
|
|
4838
4053
|
* Consult the Grab SuperApp SDK documentation for the specific parameters required for your use case.
|
|
4839
4054
|
*
|
|
4840
|
-
* @example
|
|
4841
|
-
* **Typical checkout request:**
|
|
4842
|
-
* ```typescript
|
|
4843
|
-
* {
|
|
4844
|
-
* partnerTxID: 'txn-123456',
|
|
4845
|
-
* partnerGroupTxID: 'group-txn-789',
|
|
4846
|
-
* amount: 10000,
|
|
4847
|
-
* currency: 'SGD',
|
|
4848
|
-
* description: 'Payment for services',
|
|
4849
|
-
* // ... additional checkout-specific parameters
|
|
4850
|
-
* }
|
|
4851
|
-
* ```
|
|
4852
|
-
*
|
|
4853
4055
|
* @public
|
|
4854
4056
|
*/
|
|
4855
4057
|
export declare type TriggerCheckoutRequest = Record<string, unknown>;
|
|
@@ -4860,13 +4062,6 @@ export declare type TriggerCheckoutRequest = Record<string, unknown>;
|
|
|
4860
4062
|
* @group Modules
|
|
4861
4063
|
* @category Checkout
|
|
4862
4064
|
*
|
|
4863
|
-
* @remarks
|
|
4864
|
-
* This response can have the following status codes:
|
|
4865
|
-
* - `200`: Checkout completed successfully. The `result` contains transaction details.
|
|
4866
|
-
* - `400`: Bad request - invalid checkout parameters.
|
|
4867
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
4868
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
4869
|
-
*
|
|
4870
4065
|
* @public
|
|
4871
4066
|
*/
|
|
4872
4067
|
export declare type TriggerCheckoutResponse = SDKOkResponse<TriggerCheckoutResult> | SDKErrorResponse<400> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -4877,48 +4072,6 @@ export declare type TriggerCheckoutResponse = SDKOkResponse<TriggerCheckoutResul
|
|
|
4877
4072
|
* @group Modules
|
|
4878
4073
|
* @category Checkout
|
|
4879
4074
|
*
|
|
4880
|
-
* @remarks
|
|
4881
|
-
* - `status: 'success'` → `transactionID`
|
|
4882
|
-
* - `status: 'failure'` → `transactionID`, `errorMessage`, `errorCode`
|
|
4883
|
-
* - `status: 'pending'` → `transactionID`
|
|
4884
|
-
* - `status: 'userInitiatedCancel'` → only `status`
|
|
4885
|
-
*
|
|
4886
|
-
* @example
|
|
4887
|
-
* **Successful transaction:**
|
|
4888
|
-
* ```typescript
|
|
4889
|
-
* {
|
|
4890
|
-
* transactionID: 'grab-txn-abc123',
|
|
4891
|
-
* status: 'success'
|
|
4892
|
-
* }
|
|
4893
|
-
* ```
|
|
4894
|
-
*
|
|
4895
|
-
* @example
|
|
4896
|
-
* **Failed transaction:**
|
|
4897
|
-
* ```typescript
|
|
4898
|
-
* {
|
|
4899
|
-
* transactionID: 'grab-txn-abc123',
|
|
4900
|
-
* status: 'failure',
|
|
4901
|
-
* errorMessage: 'Insufficient funds',
|
|
4902
|
-
* errorCode: 'PAYMENT_FAILED'
|
|
4903
|
-
* }
|
|
4904
|
-
* ```
|
|
4905
|
-
*
|
|
4906
|
-
* @example
|
|
4907
|
-
* **Pending transaction:**
|
|
4908
|
-
* ```typescript
|
|
4909
|
-
* {
|
|
4910
|
-
* transactionID: 'grab-txn-abc123',
|
|
4911
|
-
* status: 'pending'
|
|
4912
|
-
* }
|
|
4913
|
-
* ```
|
|
4914
|
-
*
|
|
4915
|
-
* @example
|
|
4916
|
-
* **User cancelled or closed checkout:**
|
|
4917
|
-
* ```typescript
|
|
4918
|
-
* {
|
|
4919
|
-
* status: 'userInitiatedCancel'
|
|
4920
|
-
* }
|
|
4921
|
-
* ```
|
|
4922
4075
|
*
|
|
4923
4076
|
* @public
|
|
4924
4077
|
*/
|
|
@@ -4971,10 +4124,13 @@ export declare class UserAttributesModule extends BaseModule {
|
|
|
4971
4124
|
/**
|
|
4972
4125
|
* Returns the currently selected travel destination as a lowercase ISO 3166-1 alpha-2 country code.
|
|
4973
4126
|
*
|
|
4974
|
-
* @returns
|
|
4127
|
+
* @returns This method can return the following `status_code` values:
|
|
4128
|
+
* - `200` (OK): The selected travel destination code was returned in `result` as {@link GetSelectedTravelDestinationResult}.
|
|
4129
|
+
* - `204` (No Content): No selected travel destination is currently available.
|
|
4130
|
+
* - `500` (Internal Server Error): Unexpected error occurred.
|
|
4131
|
+
* - `501` (Not Implemented): Requires Grab app environment.
|
|
4975
4132
|
*
|
|
4976
4133
|
* @example
|
|
4977
|
-
* **Simple usage**
|
|
4978
4134
|
* ```typescript
|
|
4979
4135
|
* import { UserAttributesModule, isSuccess, isError } from '@grabjs/superapp-sdk';
|
|
4980
4136
|
*
|
|
@@ -5013,21 +4169,15 @@ export declare class UserAttributesModule extends BaseModule {
|
|
|
5013
4169
|
* @category Profile
|
|
5014
4170
|
*
|
|
5015
4171
|
* @remarks
|
|
5016
|
-
* Both properties are optional. If email is provided and skipUserInput is true
|
|
4172
|
+
* Both properties are optional. If email is provided and `skipUserInput` is `true`,
|
|
5017
4173
|
* the verify OTP bottom sheet will be triggered directly without user editing.
|
|
5018
4174
|
*
|
|
5019
|
-
* @example
|
|
5020
|
-
* ```typescript
|
|
5021
|
-
* {
|
|
5022
|
-
* email: 'user@example.com',
|
|
5023
|
-
* skipUserInput: true
|
|
5024
|
-
* }
|
|
5025
|
-
* ```
|
|
5026
|
-
*
|
|
5027
4175
|
* @public
|
|
5028
4176
|
*/
|
|
5029
4177
|
export declare type VerifyEmailRequest = {
|
|
4178
|
+
/** Email address used for profile verification (for example, `"john.doe@example.com"`). */
|
|
5030
4179
|
email?: string;
|
|
4180
|
+
/** Whether to skip email input and proceed directly to verification. */
|
|
5031
4181
|
skipUserInput?: boolean;
|
|
5032
4182
|
};
|
|
5033
4183
|
|
|
@@ -5037,31 +4187,6 @@ export declare type VerifyEmailRequest = {
|
|
|
5037
4187
|
* @group Modules
|
|
5038
4188
|
* @category Profile
|
|
5039
4189
|
*
|
|
5040
|
-
* @remarks
|
|
5041
|
-
* This response can have the following status codes:
|
|
5042
|
-
* - `200`: Success, email verified and returned in `result`.
|
|
5043
|
-
* - `204`: User closed the native bottom sheet.
|
|
5044
|
-
* - `400`: Client error (e.g. invalid email format).
|
|
5045
|
-
* - `403`: Forbidden - client not authorized to access user profile data.
|
|
5046
|
-
* - `426`: Upgrade Required - feature requires Grab app version 5.399 or above.
|
|
5047
|
-
* - `500`: Internal server error - an unexpected error occurred on the native side.
|
|
5048
|
-
* - `501`: Not implemented - this method requires the Grab app environment.
|
|
5049
|
-
*
|
|
5050
|
-
* @example
|
|
5051
|
-
* **Successful verification:**
|
|
5052
|
-
* ```typescript
|
|
5053
|
-
* {
|
|
5054
|
-
* status_code: 200,
|
|
5055
|
-
* result: { email: 'user@example.com' }
|
|
5056
|
-
* }
|
|
5057
|
-
* ```
|
|
5058
|
-
*
|
|
5059
|
-
* @example
|
|
5060
|
-
* **User closed bottom sheet:**
|
|
5061
|
-
* ```typescript
|
|
5062
|
-
* { status_code: 204 }
|
|
5063
|
-
* ```
|
|
5064
|
-
*
|
|
5065
4190
|
* @public
|
|
5066
4191
|
*/
|
|
5067
4192
|
export declare type VerifyEmailResponse = SDKOkResponse<VerifyEmailResult> | SDKNoContentResponse | SDKErrorResponse<400> | SDKErrorResponse<403> | SDKErrorResponse<426> | SDKErrorResponse<500> | SDKErrorResponse<501>;
|
|
@@ -5072,14 +4197,10 @@ export declare type VerifyEmailResponse = SDKOkResponse<VerifyEmailResult> | SDK
|
|
|
5072
4197
|
* @group Modules
|
|
5073
4198
|
* @category Profile
|
|
5074
4199
|
*
|
|
5075
|
-
* @example
|
|
5076
|
-
* ```typescript
|
|
5077
|
-
* { email: 'user@example.com' }
|
|
5078
|
-
* ```
|
|
5079
|
-
*
|
|
5080
4200
|
* @public
|
|
5081
4201
|
*/
|
|
5082
4202
|
export declare type VerifyEmailResult = {
|
|
4203
|
+
/** Email address used for profile verification (for example, `"john.doe@example.com"`). */
|
|
5083
4204
|
email: string;
|
|
5084
4205
|
};
|
|
5085
4206
|
|