@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 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
@@ -33,6 +33,10 @@ exports.EventsEventSelectorType = exports.KvdbEventSelectorType = exports.KvdbEv
33
33
  ;
34
34
  ;
35
35
  ;
36
+ ;
37
+ ;
38
+ ;
39
+ ;
36
40
  // Enums
37
41
  var ConnectionEventType;
38
42
  (function (ConnectionEventType) {
@@ -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, UserWithPubKey[]]): Promise<void>;
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>;