-
Notifications
You must be signed in to change notification settings - Fork 399
Expand file tree
/
Copy pathindex.d.ts
More file actions
9082 lines (8791 loc) · 273 KB
/
index.d.ts
File metadata and controls
9082 lines (8791 loc) · 273 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { Readable } from 'stream';
import { Buffer } from 'buffer';
import { ProxyAgentOptions } from 'proxy-agent';
/**
* PubNub client for Node.js platform.
*/
declare class PubNub extends PubNubCore<
string | ArrayBuffer | Buffer | Readable,
PubNub.PubNubFileParameters,
PubNub.PubNubFile
> {
/**
* Data encryption / decryption module constructor.
*/
static CryptoModule: typeof PubNub.CryptoModuleType;
/**
* PubNub File constructor.
*/
File: PubNub.PubNubFileConstructor<PubNub.PubNubFile, PubNub.PubNubFileParameters>;
/**
* Create and configure PubNub client core.
*
* @param configuration - User-provided PubNub client configuration.
*
* @returns Configured and ready to use PubNub client.
*/
constructor(configuration: PubNub.PubNubConfiguration);
/**
* Update request proxy configuration.
*
* @param configuration - Updated request proxy configuration.
*
* @throws An error if {@link PubNub} client already configured to use `keepAlive`.
* `keepAlive` and `proxy` can't be used simultaneously.
*/
setProxy(configuration?: ProxyAgentOptions): void;
}
/**
* Platform-agnostic PubNub client core.
*/
declare class PubNubCore<
CryptographyTypes,
FileConstructorParameters,
PlatformFile extends Partial<PubNub.PubNubFileInterface> = Record<string, unknown>,
> implements PubNub.EventEmitCapable
{
/**
* Type of REST API endpoint which reported status.
*/
static OPERATIONS: typeof PubNub.RequestOperation;
/**
* API call status category.
*/
static CATEGORIES: typeof PubNub.StatusCategory;
/**
* Enum with API endpoint groups which can be used with retry policy to set up exclusions (which shouldn't be
* retried).
*/
static Endpoint: typeof PubNub.Endpoint;
/**
* Exponential retry policy constructor.
*/
static ExponentialRetryPolicy: typeof PubNub.RetryPolicy.ExponentialRetryPolicy;
/**
* Linear retry policy constructor.
*/
static LinearRetryPolicy: typeof PubNub.RetryPolicy.LinearRetryPolicy;
/**
* Disabled / inactive retry policy.
*
* **Note:** By default `ExponentialRetryPolicy` is set for subscribe requests and this one can be used to disable
* retry policy for all requests (setting `undefined` for retry configuration will set default policy).
*/
static NoneRetryPolicy: typeof PubNub.RetryPolicy.None;
/**
* Available minimum log levels.
*/
static LogLevel: typeof PubNub.LoggerLogLevel;
/**
* Construct notification payload which will trigger push notification.
*
* @param title - Title which will be shown on notification.
* @param body - Payload which will be sent as part of notification.
*
* @returns Pre-formatted message payload which will trigger push notification.
*/
static notificationPayload(title: string, body: string): PubNub.NotificationsPayload;
/**
* Generate unique identifier.
*
* @returns Unique identifier.
*/
static generateUUID(): any;
/**
* PubNub client configuration.
*
* @returns Currently user PubNub client configuration.
*/
get configuration(): PubNub.ClientConfiguration;
/**
* Current PubNub client configuration.
*
* @returns Currently user PubNub client configuration.
*
* @deprecated Use {@link configuration} getter instead.
*/
get _config(): PubNub.ClientConfiguration;
/**
* REST API endpoint access authorization key.
*
* It is required to have `authorization key` with required permissions to access REST API
* endpoints when `PAM` enabled for user key set.
*/
get authKey(): string | undefined;
/**
* REST API endpoint access authorization key.
*
* It is required to have `authorization key` with required permissions to access REST API
* endpoints when `PAM` enabled for user key set.
*/
getAuthKey(): string | undefined;
/**
* Change REST API endpoint access authorization key.
*
* @param authKey - New authorization key which should be used with new requests.
*/
setAuthKey(authKey: string): void;
/**
* Get a PubNub client user identifier.
*
* @returns Current PubNub client user identifier.
*/
get userId(): string;
/**
* Change the current PubNub client user identifier.
*
* **Important:** Change won't affect ongoing REST API calls.
* **Warning:** Because ongoing REST API calls won't be canceled there could happen unexpected events like implicit
* `join` event for the previous `userId` after a long-poll subscribe request will receive a response. To avoid this
* it is advised to unsubscribe from all/disconnect before changing `userId`.
*
* @param value - New PubNub client user identifier.
*
* @throws Error empty user identifier has been provided.
*/
set userId(value: string);
/**
* Get a PubNub client user identifier.
*
* @returns Current PubNub client user identifier.
*/
getUserId(): string;
/**
* Change the current PubNub client user identifier.
*
* **Important:** Change won't affect ongoing REST API calls.
*
* @param value - New PubNub client user identifier.
*
* @throws Error empty user identifier has been provided.
*/
setUserId(value: string): void;
/**
* Real-time updates filtering expression.
*
* @returns Filtering expression.
*/
get filterExpression(): string | undefined;
/**
* Real-time updates filtering expression.
*
* @returns Filtering expression.
*/
getFilterExpression(): string | undefined;
/**
* Update real-time updates filtering expression.
*
* @param expression - New expression which should be used or `undefined` to disable filtering.
*/
set filterExpression(expression: string | null | undefined);
/**
* Update real-time updates filtering expression.
*
* @param expression - New expression which should be used or `undefined` to disable filtering.
*/
setFilterExpression(expression: string | null): void;
/**
* Dta encryption / decryption key.
*
* @returns Currently used key for data encryption / decryption.
*/
get cipherKey(): string | undefined;
/**
* Change data encryption / decryption key.
*
* @param key - New key which should be used for data encryption / decryption.
*/
set cipherKey(key: string | undefined);
/**
* Change data encryption / decryption key.
*
* @param key - New key which should be used for data encryption / decryption.
*/
setCipherKey(key: string): void;
/**
* Change a heartbeat requests interval.
*
* @param interval - New presence request heartbeat intervals.
*/
set heartbeatInterval(interval: number);
/**
* Change a heartbeat requests interval.
*
* @param interval - New presence request heartbeat intervals.
*/
setHeartbeatInterval(interval: number): void;
/**
* Get registered loggers' manager.
*
* @returns Registered loggers' manager.
*/
get logger(): PubNub.LoggerManager;
/**
* Get PubNub SDK version.
*
* @returns Current SDK version.
*/
getVersion(): string;
/**
* Add framework's prefix.
*
* @param name - Name of the framework which would want to add own data into `pnsdk` suffix.
* @param suffix - Suffix with information about a framework.
*/
_addPnsdkSuffix(name: string, suffix: string | number): void;
/**
* Get a PubNub client user identifier.
*
* @returns Current PubNub client user identifier.
*
* @deprecated Use the {@link getUserId} or {@link userId} getter instead.
*/
getUUID(): string;
/**
* Change the current PubNub client user identifier.
*
* **Important:** Change won't affect ongoing REST API calls.
*
* @param value - New PubNub client user identifier.
*
* @throws Error empty user identifier has been provided.
*
* @deprecated Use the {@link PubNubCore#setUserId setUserId} or {@link PubNubCore#userId userId} setter instead.
*/
setUUID(value: string): void;
/**
* Custom data encryption method.
*
* @deprecated Instead use {@link cryptoModule} for data encryption.
*/
get customEncrypt(): ((data: string) => string) | undefined;
/**
* Custom data decryption method.
*
* @deprecated Instead use {@link cryptoModule} for data decryption.
*/
get customDecrypt(): ((data: string) => string) | undefined;
/**
* Create a `Channel` entity.
*
* Entity can be used for the interaction with the following API:
* - `subscribe`
*
* @param name - Unique channel name.
* @returns `Channel` entity.
*/
channel(name: string): PubNub.Channel;
/**
* Create a `ChannelGroup` entity.
*
* Entity can be used for the interaction with the following API:
* - `subscribe`
*
* @param name - Unique channel group name.
* @returns `ChannelGroup` entity.
*/
channelGroup(name: string): PubNub.ChannelGroup;
/**
* Create a `ChannelMetadata` entity.
*
* Entity can be used for the interaction with the following API:
* - `subscribe`
*
* @param id - Unique channel metadata object identifier.
* @returns `ChannelMetadata` entity.
*/
channelMetadata(id: string): PubNub.ChannelMetadata;
/**
* Create a `UserMetadata` entity.
*
* Entity can be used for the interaction with the following API:
* - `subscribe`
*
* @param id - Unique user metadata object identifier.
* @returns `UserMetadata` entity.
*/
userMetadata(id: string): PubNub.UserMetadata;
/**
* Create subscriptions set object.
*
* @param parameters - Subscriptions set configuration parameters.
*/
subscriptionSet(parameters: {
channels?: string[];
channelGroups?: string[];
subscriptionOptions?: PubNub.SubscriptionOptions;
}): PubNub.SubscriptionSet;
/**
* Unsubscribe from all channels and groups.
*
* @param [isOffline] - Whether `offline` presence should be notified or not.
*/
destroy(isOffline?: boolean): void;
/**
* Unsubscribe from all channels and groups.
*
* @deprecated Use {@link destroy} method instead.
*/
stop(): void;
/**
* Publish data to a specific channel.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
publish(
parameters: PubNub.Publish.PublishParameters,
callback: PubNub.ResultCallback<PubNub.Publish.PublishResponse>,
): void;
/**
* Publish data to a specific channel.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous publish data response.
*/
publish(parameters: PubNub.Publish.PublishParameters): Promise<PubNub.Publish.PublishResponse>;
/**
* Signal data to a specific channel.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
signal(
parameters: PubNub.Signal.SignalParameters,
callback: PubNub.ResultCallback<PubNub.Signal.SignalResponse>,
): void;
/**
* Signal data to a specific channel.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous signal data response.
*/
signal(parameters: PubNub.Signal.SignalParameters): Promise<PubNub.Signal.SignalResponse>;
/**
* `Fire` a data to a specific channel.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link publish} method instead.
*/
fire(
parameters: PubNub.Publish.PublishParameters,
callback: PubNub.ResultCallback<PubNub.Publish.PublishResponse>,
): void;
/**
* `Fire` a data to a specific channel.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous signal data response.
*
* @deprecated Use {@link publish} method instead.
*/
fire(parameters: PubNub.Publish.PublishParameters): Promise<PubNub.Publish.PublishResponse>;
/**
* Get list of channels on which PubNub client currently subscribed.
*
* @returns List of active channels.
*/
getSubscribedChannels(): string[];
/**
* Get list of channel groups on which PubNub client currently subscribed.
*
* @returns List of active channel groups.
*/
getSubscribedChannelGroups(): string[];
/**
* Subscribe to specified channels and groups real-time events.
*
* @param parameters - Request configuration parameters.
*/
subscribe(parameters: PubNub.Subscription.SubscribeParameters): void;
/**
* Unsubscribe from specified channels and groups real-time events.
*
* @param parameters - Request configuration parameters.
*/
unsubscribe(parameters: PubNub.Presence.PresenceLeaveParameters): void;
/**
* Unsubscribe from all channels and groups.
*/
unsubscribeAll(): void;
/**
* Temporarily disconnect from the real-time events stream.
*
* **Note:** `isOffline` is set to `true` only when a client experiences network issues.
*
* @param [isOffline] - Whether `offline` presence should be notified or not.
*/
disconnect(isOffline?: boolean): void;
/**
* Restore connection to the real-time events stream.
*
* @param parameters - Reconnection catch-up configuration. **Note:** available only with the enabled event engine.
*/
reconnect(parameters?: { timetoken?: string; region?: number }): void;
/**
* Get reactions to a specific message.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
getMessageActions(
parameters: PubNub.MessageAction.GetMessageActionsParameters,
callback: PubNub.ResultCallback<PubNub.MessageAction.GetMessageActionsResponse>,
): void;
/**
* Get reactions to a specific message.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous get reactions response.
*/
getMessageActions(
parameters: PubNub.MessageAction.GetMessageActionsParameters,
): Promise<PubNub.MessageAction.GetMessageActionsResponse>;
/**
* Add a reaction to a specific message.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
addMessageAction(
parameters: PubNub.MessageAction.AddMessageActionParameters,
callback: PubNub.ResultCallback<PubNub.MessageAction.AddMessageActionResponse>,
): void;
/**
* Add a reaction to a specific message.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous add a reaction response.
*/
addMessageAction(
parameters: PubNub.MessageAction.AddMessageActionParameters,
): Promise<PubNub.MessageAction.AddMessageActionResponse>;
/**
* Remove a reaction from a specific message.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
removeMessageAction(
parameters: PubNub.MessageAction.RemoveMessageActionParameters,
callback: PubNub.ResultCallback<PubNub.MessageAction.RemoveMessageActionResponse>,
): void;
/**
* Remove a reaction from a specific message.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous remove a reaction response.
*/
removeMessageAction(
parameters: PubNub.MessageAction.RemoveMessageActionParameters,
): Promise<PubNub.MessageAction.RemoveMessageActionResponse>;
/**
* Fetch messages history for channels.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
fetchMessages(
parameters: PubNub.History.FetchMessagesParameters,
callback: PubNub.ResultCallback<PubNub.History.FetchMessagesResponse>,
): void;
/**
* Fetch messages history for channels.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous fetch messages response.
*/
fetchMessages(parameters: PubNub.History.FetchMessagesParameters): Promise<PubNub.History.FetchMessagesResponse>;
/**
* Delete messages from the channel history.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
*/
deleteMessages(
parameters: PubNub.History.DeleteMessagesParameters,
callback: PubNub.ResultCallback<PubNub.History.DeleteMessagesResponse>,
): void;
/**
* Delete messages from the channel history.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous delete messages response.
*
*/
deleteMessages(parameters: PubNub.History.DeleteMessagesParameters): Promise<PubNub.History.DeleteMessagesResponse>;
/**
* Count messages from the channels' history.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
messageCounts(
parameters: PubNub.History.MessageCountParameters,
callback: PubNub.ResultCallback<PubNub.History.MessageCountResponse>,
): void;
/**
* Count messages from the channels' history.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous count messages response.
*/
messageCounts(parameters: PubNub.History.MessageCountParameters): Promise<PubNub.History.MessageCountResponse>;
/**
* Fetch single channel history.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated
*/
history(
parameters: PubNub.History.GetHistoryParameters,
callback: PubNub.ResultCallback<PubNub.History.GetHistoryResponse>,
): void;
/**
* Fetch single channel history.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous fetch channel history response.
*
* @deprecated
*/
history(parameters: PubNub.History.GetHistoryParameters): Promise<PubNub.History.GetHistoryResponse>;
/**
* Get channel's presence information.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
hereNow(
parameters: PubNub.Presence.HereNowParameters,
callback: PubNub.ResultCallback<PubNub.Presence.HereNowResponse>,
): void;
/**
* Get channel presence information.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous get channel's presence response.
*/
hereNow(parameters: PubNub.Presence.HereNowParameters): Promise<PubNub.Presence.HereNowResponse>;
/**
* Get user's presence information.
*
* Get list of channels to which `uuid` currently subscribed.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
whereNow(
parameters: PubNub.Presence.WhereNowParameters,
callback: PubNub.ResultCallback<PubNub.Presence.WhereNowResponse>,
): void;
/**
* Get user's presence information.
*
* Get list of channels to which `uuid` currently subscribed.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous get user's presence response.
*/
whereNow(parameters: PubNub.Presence.WhereNowParameters): Promise<PubNub.Presence.WhereNowResponse>;
/**
* Get associated user's data for channels and groups.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
getState(
parameters: PubNub.Presence.GetPresenceStateParameters,
callback: PubNub.ResultCallback<PubNub.Presence.GetPresenceStateResponse>,
): void;
/**
* Get associated user's data for channels and groups.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous get associated user's data response.
*/
getState(parameters: PubNub.Presence.GetPresenceStateParameters): Promise<PubNub.Presence.GetPresenceStateResponse>;
/**
* Set associated user's data for channels and groups.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
setState(
parameters: PubNub.Presence.SetPresenceStateParameters | PubNub.Presence.SetPresenceStateWithHeartbeatParameters,
callback: PubNub.ResultCallback<
PubNub.Presence.SetPresenceStateResponse | PubNub.Presence.PresenceHeartbeatResponse
>,
): void;
/**
* Set associated user's data for channels and groups.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous set associated user's data response.
*/
setState(
parameters: PubNub.Presence.SetPresenceStateParameters | PubNub.Presence.SetPresenceStateWithHeartbeatParameters,
): Promise<PubNub.Presence.SetPresenceStateResponse | PubNub.Presence.PresenceHeartbeatResponse>;
/**
* Manual presence management.
*
* @param parameters - Desired presence state for a provided list of channels and groups.
*/
presence(parameters: { connected: boolean; channels?: string[]; channelGroups?: string[] }): void;
/**
* Grant token permission.
*
* Generate access token with requested permissions.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*/
grantToken(
parameters: PubNub.PAM.GrantTokenParameters,
callback: PubNub.ResultCallback<PubNub.PAM.GrantTokenResponse>,
): void;
/**
* Grant token permission.
*
* Generate an access token with requested permissions.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous grant token response.
*/
grantToken(parameters: PubNub.PAM.GrantTokenParameters): Promise<PubNub.PAM.GrantTokenResponse>;
/**
* Revoke token permission.
*
* @param token - Access token for which permissions should be revoked.
* @param callback - Request completion handler callback.
*/
revokeToken(
token: PubNub.PAM.RevokeParameters,
callback: PubNub.ResultCallback<PubNub.PAM.RevokeTokenResponse>,
): void;
/**
* Revoke token permission.
*
* @param token - Access token for which permissions should be revoked.
*
* @returns Asynchronous revoke token response.
*/
revokeToken(token: PubNub.PAM.RevokeParameters): Promise<PubNub.PAM.RevokeTokenResponse>;
/**
* Get a current access token.
*
* @returns Previously configured access token using {@link setToken} method.
*/
get token(): string | undefined;
/**
* Get a current access token.
*
* @returns Previously configured access token using {@link setToken} method.
*/
getToken(): string | undefined;
/**
* Set current access token.
*
* @param token - New access token which should be used with next REST API endpoint calls.
*/
set token(token: string | undefined);
/**
* Set current access token.
*
* @param token - New access token which should be used with next REST API endpoint calls.
*/
setToken(token: string | undefined): void;
/**
* Parse access token.
*
* Parse token to see what permissions token owner has.
*
* @param token - Token which should be parsed.
*
* @returns Token's permissions information for the resources.
*/
parseToken(token: string): PubNub.PAM.Token | undefined;
/**
* Grant auth key(s) permission.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link grantToken} and {@link setToken} methods instead.
*/
grant(parameters: PubNub.PAM.GrantParameters, callback: PubNub.ResultCallback<PubNub.PAM.PermissionsResponse>): void;
/**
* Grant auth key(s) permission.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous grant auth key(s) permissions response.
*
* @deprecated Use {@link grantToken} and {@link setToken} methods instead.
*/
grant(parameters: PubNub.PAM.GrantParameters): Promise<PubNub.PAM.PermissionsResponse>;
/**
* Audit auth key(s) permission.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated
*/
audit(parameters: PubNub.PAM.AuditParameters, callback: PubNub.ResultCallback<PubNub.PAM.PermissionsResponse>): void;
/**
* Audit auth key(s) permission.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous audit auth key(s) permissions response.
*
* @deprecated
*/
audit(parameters: PubNub.PAM.AuditParameters): Promise<PubNub.PAM.PermissionsResponse>;
/**
* PubNub App Context API group.
*/
get objects(): PubNub.PubNubObjects;
/**
* Fetch a paginated list of User objects.
*
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.getAllUUIDMetadata getAllUUIDMetadata} method instead.
*/
fetchUsers<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
callback: PubNub.ResultCallback<PubNub.AppContext.GetAllUUIDMetadataResponse<Custom>>,
): void;
/**
* Fetch a paginated list of User objects.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.getAllUUIDMetadata getAllUUIDMetadata} method instead.
*/
fetchUsers<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.GetAllMetadataParameters<PubNub.AppContext.UUIDMetadataObject<Custom>>,
callback: PubNub.ResultCallback<PubNub.AppContext.GetAllUUIDMetadataResponse<Custom>>,
): void;
/**
* Fetch a paginated list of User objects.
*
* @param [parameters] - Request configuration parameters.
*
* @returns Asynchronous get all User objects response.
*
* @deprecated Use {@link PubNubCore#objects.getAllUUIDMetadata getAllUUIDMetadata} method instead.
*/
fetchUsers<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters?: PubNub.AppContext.GetAllMetadataParameters<PubNub.AppContext.UUIDMetadataObject<Custom>>,
): Promise<PubNub.AppContext.GetAllUUIDMetadataResponse<Custom>>;
/**
* Fetch User object for a currently configured PubNub client `uuid`.
*
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.getUUIDMetadata getUUIDMetadata} method instead.
*/
fetchUser<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
callback: PubNub.ResultCallback<PubNub.AppContext.GetUUIDMetadataResponse<Custom>>,
): void;
/**
* Fetch User object for a currently configured PubNub client `uuid`.
*
* @param parameters - Request configuration parameters. Will fetch a User object for a currently
* configured PubNub client `uuid` if not set.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.getUUIDMetadata|getUUIDMetadata} method instead.
*/
fetchUser<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.GetUUIDMetadataParameters,
callback: PubNub.ResultCallback<PubNub.AppContext.GetUUIDMetadataResponse<Custom>>,
): void;
/**
* Fetch User object for a currently configured PubNub client `uuid`.
*
* @param [parameters] - Request configuration parameters. Will fetch a User object for a currently
* configured PubNub client `uuid` if not set.
*
* @returns Asynchronous get User object response.
*
* @deprecated Use {@link PubNubCore#objects.getUUIDMetadata getUUIDMetadata} method instead.
*/
fetchUser<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters?: PubNub.AppContext.GetUUIDMetadataParameters,
): Promise<PubNub.AppContext.GetUUIDMetadataResponse<Custom>>;
/**
* Create a User object.
*
* @param parameters - Request configuration parameters. Will create a User object for a currently
* configured PubNub client `uuid` if not set.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.setUUIDMetadata setUUIDMetadata} method instead.
*/
createUser<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.SetUUIDMetadataParameters<Custom>,
callback: PubNub.ResultCallback<PubNub.AppContext.SetUUIDMetadataResponse<Custom>>,
): void;
/**
* Create a User object.
*
* @param parameters - Request configuration parameters. Will create User object for a currently
* configured PubNub client `uuid` if not set.
*
* @returns Asynchronous create User object response.
*
* @deprecated Use {@link PubNubCore#objects.setUUIDMetadata setUUIDMetadata} method instead.
*/
createUser<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.SetUUIDMetadataParameters<Custom>,
): Promise<PubNub.AppContext.SetUUIDMetadataResponse<Custom>>;
/**
* Update a User object.
*
* @param parameters - Request configuration parameters. Will update User object for currently
* configured PubNub client `uuid` if not set.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.setUUIDMetadata setUUIDMetadata} method instead.
*/
updateUser<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.SetUUIDMetadataParameters<Custom>,
callback: PubNub.ResultCallback<PubNub.AppContext.SetUUIDMetadataResponse<Custom>>,
): void;
/**
* Update a User object.
*
* @param parameters - Request configuration parameters. Will update a User object for a currently
* configured PubNub client `uuid` if not set.
*
* @returns Asynchronous update User object response.
*
* @deprecated Use {@link PubNubCore#objects.setUUIDMetadata setUUIDMetadata} method instead.
*/
updateUser<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.SetUUIDMetadataParameters<Custom>,
): Promise<PubNub.AppContext.SetUUIDMetadataResponse<Custom>>;
/**
* Remove a specific User object.
*
* @param callback - Request completion handler callback. Will remove a User object for a currently
* configured PubNub client `uuid` if not set.
*
* @deprecated Use {@link PubNubCore#objects.removeUUIDMetadata removeUUIDMetadata} method instead.
*/
removeUser(callback: PubNub.ResultCallback<PubNub.AppContext.RemoveUUIDMetadataResponse>): void;
/**
* Remove a specific User object.
*
* @param parameters - Request configuration parameters. Will remove a User object for a currently
* configured PubNub client `uuid` if not set.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.removeUUIDMetadata removeUUIDMetadata} method instead.
*/
removeUser(
parameters: PubNub.AppContext.RemoveUUIDMetadataParameters,
callback: PubNub.ResultCallback<PubNub.AppContext.RemoveUUIDMetadataResponse>,
): void;
/**
* Remove a specific User object.
*
* @param [parameters] - Request configuration parameters. Will remove a User object for a currently
* configured PubNub client `uuid` if not set.
*
* @returns Asynchronous User object remove response.
*
* @deprecated Use {@link PubNubCore#objects.removeUUIDMetadata removeUUIDMetadata} method instead.
*/
removeUser(
parameters?: PubNub.AppContext.RemoveUUIDMetadataParameters,
): Promise<PubNub.AppContext.RemoveUUIDMetadataResponse>;
/**
* Fetch a paginated list of Space objects.
*
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.getAllChannelMetadata getAllChannelMetadata} method instead.
*/
fetchSpaces<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
callback: PubNub.ResultCallback<PubNub.AppContext.GetAllChannelMetadataResponse<Custom>>,
): void;
/**
* Fetch a paginated list of Space objects.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.getAllChannelMetadata getAllChannelMetadata} method instead.
*/
fetchSpaces<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.GetAllMetadataParameters<PubNub.AppContext.ChannelMetadataObject<Custom>>,
callback: PubNub.ResultCallback<PubNub.AppContext.GetAllChannelMetadataResponse<Custom>>,
): void;
/**
* Fetch a paginated list of Space objects.
*
* @param [parameters] - Request configuration parameters.
*
* @returns Asynchronous get all Space objects responses.
*
* @deprecated Use {@link PubNubCore#objects.getAllChannelMetadata getAllChannelMetadata} method instead.
*/
fetchSpaces<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters?: PubNub.AppContext.GetAllMetadataParameters<PubNub.AppContext.ChannelMetadataObject<Custom>>,
): Promise<PubNub.AppContext.GetAllChannelMetadataResponse<Custom>>;
/**
* Fetch a specific Space object.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.getChannelMetadata getChannelMetadata} method instead.
*/
fetchSpace<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.GetChannelMetadataParameters,
callback: PubNub.ResultCallback<PubNub.AppContext.GetChannelMetadataResponse<Custom>>,
): void;
/**
* Fetch a specific Space object.
*
* @param parameters - Request configuration parameters.
*
* @returns Asynchronous get Channel metadata response.
*
* @deprecated Use {@link PubNubCore#objects.getChannelMetadata getChannelMetadata} method instead.
*/
fetchSpace<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.GetChannelMetadataParameters,
): Promise<PubNub.AppContext.GetChannelMetadataResponse<Custom>>;
/**
* Create a specific Space object.
*
* @param parameters - Request configuration parameters.
* @param callback - Request completion handler callback.
*
* @deprecated Use {@link PubNubCore#objects.setChannelMetadata setChannelMetadata} method instead.
*/
createSpace<Custom extends PubNub.AppContext.CustomData = PubNub.AppContext.CustomData>(
parameters: PubNub.AppContext.SetChannelMetadataParameters<Custom>,
callback: PubNub.ResultCallback<PubNub.AppContext.SetChannelMetadataResponse<Custom>>,
): void;
/**
* Create specific Space object.