@simplito/privmx-webendpoint 2.6.1 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Types.d.ts +55 -1
- package/Types.js +4 -0
- package/api/EventApiNative.d.ts +1 -1
- package/assets/endpoint-wasm-module.js +2 -19
- package/assets/endpoint-wasm-module.wasm +0 -0
- package/extra/PrivmxClient.d.ts +13 -1
- package/extra/PrivmxClient.js +34 -2
- package/extra/__mocks__/constants.d.ts +5 -0
- package/extra/__mocks__/constants.js +52 -1
- package/extra/__tests__/connectionEventManager.test.d.ts +1 -0
- package/extra/__tests__/connectionEventManager.test.js +29 -0
- package/extra/__tests__/customEventManager.test.d.ts +1 -0
- package/extra/__tests__/customEventManager.test.js +65 -0
- package/extra/__tests__/userEventManager.test.d.ts +1 -0
- package/extra/__tests__/userEventManager.test.js +52 -0
- package/extra/events.d.ts +4 -2
- package/extra/events.js +13 -3
- package/extra/index.d.ts +1 -1
- package/extra/index.js +4 -1
- package/extra/managers.d.ts +18 -11
- package/extra/managers.js +55 -7
- package/extra/subscriptions.d.ts +36 -14
- package/extra/subscriptions.js +30 -13
- package/package.json +1 -1
- package/service/EventApi.d.ts +2 -2
- package/service/EventApi.js +3 -3
- package/assets/endpoint-wasm-module.worker.js +0 -1
package/Types.d.ts
CHANGED
|
@@ -115,6 +115,60 @@ export interface UserInfo {
|
|
|
115
115
|
isActive: boolean;
|
|
116
116
|
lastStatusChange?: UserStatusChange;
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Contains information about the user assigned to a Context.
|
|
120
|
+
*
|
|
121
|
+
* @type {ContextUserEventData}
|
|
122
|
+
*
|
|
123
|
+
* @param {string} contextId ID of the Context
|
|
124
|
+
* @param {UserWithPubKey} user user metadata
|
|
125
|
+
*/
|
|
126
|
+
export interface ContextUserEventData {
|
|
127
|
+
contextId: string;
|
|
128
|
+
user: UserWithPubKey;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Contains the user and their status change action.
|
|
132
|
+
*
|
|
133
|
+
* @type {UserWithAction}
|
|
134
|
+
*
|
|
135
|
+
* @param {UserWithPubKey} user user metadata
|
|
136
|
+
* @param {string} action User status change action, e.g. "login" or "logout"
|
|
137
|
+
*/
|
|
138
|
+
export interface UserWithAction {
|
|
139
|
+
user: UserWithPubKey;
|
|
140
|
+
action: 'login' | 'logout';
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Contains information about changed statuses of users in the Context.
|
|
144
|
+
*
|
|
145
|
+
* @type {ContextUsersStatusChangedEventData}
|
|
146
|
+
*
|
|
147
|
+
* @param {string} contextId ID of the Context
|
|
148
|
+
* @param {UserWithAction[]} users List of users with their status changes
|
|
149
|
+
*/
|
|
150
|
+
export interface ContextUsersStatusChangedEventData {
|
|
151
|
+
contextId: string;
|
|
152
|
+
users: UserWithAction[];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Contains information of custom context event payload.
|
|
156
|
+
*
|
|
157
|
+
* @type {ContextCustomEventData}
|
|
158
|
+
*
|
|
159
|
+
* @param {string} contextId ID of the Context where the event originated
|
|
160
|
+
* @param {string} userId ID of the user who emitted the event
|
|
161
|
+
* @param {Uint8Array} payload Raw payload of the custom event
|
|
162
|
+
* @param {number} statusCode Status code of payload decryption
|
|
163
|
+
* @param {number} schemaVersion Version describing payload encoding/encryption
|
|
164
|
+
*/
|
|
165
|
+
export interface ContextCustomEventData {
|
|
166
|
+
contextId: string;
|
|
167
|
+
userId: string;
|
|
168
|
+
payload: Uint8Array;
|
|
169
|
+
statusCode: number;
|
|
170
|
+
schemaVersion: number;
|
|
171
|
+
}
|
|
118
172
|
/**
|
|
119
173
|
* Holds all available information about a Thread.
|
|
120
174
|
*
|
|
@@ -656,5 +710,5 @@ export type CollectionChangedEventData = {
|
|
|
656
710
|
moduleType: string;
|
|
657
711
|
moduleId: string;
|
|
658
712
|
affectedItemsCount: number;
|
|
659
|
-
items: CollectionItemChange;
|
|
713
|
+
items: CollectionItemChange[];
|
|
660
714
|
};
|
package/Types.js
CHANGED
package/api/EventApiNative.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class EventApiNative extends BaseNative {
|
|
|
14
14
|
newApi(connectionPtr: number): Promise<number>;
|
|
15
15
|
deleteApi(ptr: number): Promise<void>;
|
|
16
16
|
create(ptr: number, args: []): Promise<void>;
|
|
17
|
-
emitEvent(ptr: number, args: [string, string, Uint8Array
|
|
17
|
+
emitEvent(ptr: number, args: [string, UserWithPubKey[], string, Uint8Array]): Promise<void>;
|
|
18
18
|
subscribeFor(ptr: number, args: [string[]]): Promise<string[]>;
|
|
19
19
|
unsubscribeFrom(ptr: number, args: [string[]]): Promise<void>;
|
|
20
20
|
buildSubscriptionQuery(ptr: number, args: [string, EventsEventSelectorType, string]): Promise<string>;
|