Skip to content

Commit

Permalink
update pubnub initialization configuration types for eventengine
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Jan 11, 2024
1 parent e4717ca commit 39caedb
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 147 deletions.
210 changes: 133 additions & 77 deletions types/pubnub/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,15 @@ declare namespace Pubnub {
heartbeatInterval?: number | undefined;
restore?: boolean | undefined;
keepAlive?: boolean | undefined;
keepAliveSettings?: {
keepAliveMsecs?: number | undefined;
freeSocketKeepAliveTimeout?: number | undefined;
timeout?: number | undefined;
maxSockets?: number | undefined;
maxFreeSockets?: number | undefined;
} | undefined;
keepAliveSettings?:
| {
keepAliveMsecs?: number | undefined;
freeSocketKeepAliveTimeout?: number | undefined;
timeout?: number | undefined;
maxSockets?: number | undefined;
maxFreeSockets?: number | undefined;
}
| undefined;
subscribeRequestTimeout?: number | undefined;
suppressLeaveEvents?: boolean | undefined;
secretKey?: string | undefined;
Expand All @@ -352,6 +354,9 @@ declare namespace Pubnub {
useRandomIVs?: boolean | undefined;
dedupeOnSubscribe?: boolean | undefined;
cryptoModule?: CryptoModule | undefined;
retryConfiguration?: RetryConfiguration | undefined;
enableEventEngine?: boolean | undefined;
maintainPresenceState?: boolean | undefined;
};

interface MessageEvent {
Expand Down Expand Up @@ -598,9 +603,11 @@ declare namespace Pubnub {
messageType?: string | number | undefined;
uuid?: string | undefined;
error?: string | undefined;
meta?: {
[key: string]: any;
} | undefined;
meta?:
| {
[key: string]: any;
}
| undefined;
actions: {
[type: string]: {
[value: string]: Array<{
Expand Down Expand Up @@ -842,30 +849,44 @@ declare namespace Pubnub {
ttl: number;
authorized_uuid?: string | undefined;
resources?: {
channels?: {
[key: string]: GrantTokenPermissions;
} | undefined;
groups?: {
[key: string]: GrantTokenPermissions;
} | undefined;
uuids?: {
[key: string]: GrantTokenPermissions;
} | undefined;
channels?:
| {
[key: string]: GrantTokenPermissions;
}
| undefined;
groups?:
| {
[key: string]: GrantTokenPermissions;
}
| undefined;
uuids?:
| {
[key: string]: GrantTokenPermissions;
}
| undefined;
};
patterns?: {
channels?: {
[key: string]: GrantTokenPermissions;
} | undefined;
groups?: {
[key: string]: GrantTokenPermissions;
} | undefined;
uuids?: {
[key: string]: GrantTokenPermissions;
} | undefined;
channels?:
| {
[key: string]: GrantTokenPermissions;
}
| undefined;
groups?:
| {
[key: string]: GrantTokenPermissions;
}
| undefined;
uuids?:
| {
[key: string]: GrantTokenPermissions;
}
| undefined;
};
meta?: {
[key: string]: any;
} | undefined;
meta?:
| {
[key: string]: any;
}
| undefined;
}

interface ParsedGrantToken extends GrantTokenParameters {
Expand Down Expand Up @@ -1045,9 +1066,11 @@ declare namespace Pubnub {
interface SetUUIDMetadataParameters<Custom extends ObjectCustom> {
uuid?: string | undefined;
data: UUIDMetadata<Custom>;
include?: {
customFields?: boolean | undefined;
} | undefined;
include?:
| {
customFields?: boolean | undefined;
}
| undefined;
}

type SetUUIDMetadataResponse<Custom extends ObjectCustom> = ObjectsResponse<UUIDMetadataObject<Custom>>;
Expand All @@ -1059,26 +1082,32 @@ declare namespace Pubnub {
type RemoveUUIDMetadataResponse = ObjectsResponse<{}>;

interface GetAllMetadataParameters {
include?: {
totalCount?: boolean | undefined;
customFields?: boolean | undefined;
} | undefined;
include?:
| {
totalCount?: boolean | undefined;
customFields?: boolean | undefined;
}
| undefined;
filter?: string | undefined;
sort?: object | undefined;
limit?: number | undefined;
page?: {
next?: string | undefined;
prev?: string | undefined;
} | undefined;
page?:
| {
next?: string | undefined;
prev?: string | undefined;
}
| undefined;
}

type GetAllUUIDMetadataResponse<Custom extends ObjectCustom> = PagedObjectsResponse<UUIDMetadataObject<Custom>>;

interface GetUUIDMetadataParameters {
uuid?: string | undefined;
include?: {
customFields?: boolean | undefined;
} | undefined;
include?:
| {
customFields?: boolean | undefined;
}
| undefined;
}

type GetUUIDMetadataResponse<Custom extends ObjectCustom> = ObjectsResponse<UUIDMetadataObject<Custom>>;
Expand All @@ -1103,9 +1132,11 @@ declare namespace Pubnub {
interface SetChannelMetadataParameters<Custom extends ObjectCustom> {
channel: string;
data: ChannelMetadata<Custom>;
include?: {
customFields?: boolean | undefined;
} | undefined;
include?:
| {
customFields?: boolean | undefined;
}
| undefined;
}

type SetChannelMetadataResponse<Custom extends ObjectCustom> = ObjectsResponse<ChannelMetadataObject<Custom>>;
Expand All @@ -1122,9 +1153,11 @@ declare namespace Pubnub {

interface GetChannelMetadataParameters {
channel: string;
include?: {
customFields: boolean;
} | undefined;
include?:
| {
customFields: boolean;
}
| undefined;
}

type GetChannelMetadataResponse<Custom extends ObjectCustom> = ObjectsResponse<ChannelMetadataObject<Custom>>;
Expand All @@ -1146,41 +1179,49 @@ declare namespace Pubnub {
}

interface UUIDMembersParameters {
include?: {
totalCount?: boolean | undefined;
customFields?: boolean | undefined;
UUIDFields?: boolean | undefined;
customUUIDFields?: boolean | undefined;
statusField?: boolean | undefined;
UUIDStatusField?: boolean | undefined;
UUIDTypeField?: boolean | undefined;
} | undefined;
include?:
| {
totalCount?: boolean | undefined;
customFields?: boolean | undefined;
UUIDFields?: boolean | undefined;
customUUIDFields?: boolean | undefined;
statusField?: boolean | undefined;
UUIDStatusField?: boolean | undefined;
UUIDTypeField?: boolean | undefined;
}
| undefined;
filter?: string | undefined;
sort?: object | undefined;
limit?: number | undefined;
page?: {
next?: string | undefined;
prev?: string | undefined;
} | undefined;
page?:
| {
next?: string | undefined;
prev?: string | undefined;
}
| undefined;
}

interface ChannelMembersParameters {
include?: {
totalCount?: boolean | undefined;
customFields?: boolean | undefined;
channelFields?: boolean | undefined;
customChannelFields?: boolean | undefined;
statusField?: boolean | undefined;
channelStatusField?: boolean | undefined;
channelTypeField?: boolean | undefined;
} | undefined;
include?:
| {
totalCount?: boolean | undefined;
customFields?: boolean | undefined;
channelFields?: boolean | undefined;
customChannelFields?: boolean | undefined;
statusField?: boolean | undefined;
channelStatusField?: boolean | undefined;
channelTypeField?: boolean | undefined;
}
| undefined;
filter?: string | undefined;
sort?: object | undefined;
limit?: number | undefined;
page?: {
next?: string | undefined;
prev?: string | undefined;
} | undefined;
page?:
| {
next?: string | undefined;
prev?: string | undefined;
}
| undefined;
}

interface GetChannelMembersParameters extends UUIDMembersParameters {
Expand Down Expand Up @@ -1373,6 +1414,8 @@ declare namespace Pubnub {
PNConnectedCategory: string;
PNRequestMessageCountExceedCategory: string;
PNMalformedResponseCategory: string;
PNDisconnectedUnexpectedlyCategory: string;
PNConnectionErrorCategory: string;
}

interface Operations {
Expand Down Expand Up @@ -1413,6 +1456,19 @@ declare namespace Pubnub {
PNRemoveMessageActionOperation: string;
PNGetMessageActionsOperation: string;
}

type RetryConfiguration = LinearRetryPolicyConfiguration | ExponentialRetryPolicyConfiguration;

interface LinearRetryPolicyConfiguration {
delay: number;
maximumRetry: number;
}

interface ExponentialRetryPolicyConfiguration {
minimumDelay: number;
maximumDelay: number;
maximumRetry: number;
}
}

export = Pubnub;
Loading

0 comments on commit 39caedb

Please sign in to comment.