@bwi-mentorspaces/application-utils-npm 0.0.106 → 0.0.108
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.
|
@@ -16,6 +16,7 @@ export interface IEventTypesData {
|
|
|
16
16
|
[CustomEventType.TopicUpdated]: undefined;
|
|
17
17
|
[CustomEventType.ConnectionRequest]: {
|
|
18
18
|
text: string;
|
|
19
|
+
programRef: string;
|
|
19
20
|
};
|
|
20
21
|
[CustomEventType.ConnectionReminder]: {
|
|
21
22
|
recipientRef: string;
|
|
@@ -211,6 +212,13 @@ export interface IEventTypesData {
|
|
|
211
212
|
documentId: string;
|
|
212
213
|
description: string;
|
|
213
214
|
timestamp: string;
|
|
215
|
+
senderInfo?: {
|
|
216
|
+
id: string;
|
|
217
|
+
name: string;
|
|
218
|
+
picture: string;
|
|
219
|
+
ref: string;
|
|
220
|
+
type: string;
|
|
221
|
+
};
|
|
214
222
|
};
|
|
215
223
|
[CustomEventType.ProgramAnnouncementComment]: {
|
|
216
224
|
id: number;
|
|
@@ -221,5 +229,12 @@ export interface IEventTypesData {
|
|
|
221
229
|
title: string;
|
|
222
230
|
description: string;
|
|
223
231
|
recipients: string[];
|
|
232
|
+
senderInfo?: {
|
|
233
|
+
id: string;
|
|
234
|
+
name: string;
|
|
235
|
+
picture: string;
|
|
236
|
+
ref: string;
|
|
237
|
+
type: string;
|
|
238
|
+
};
|
|
224
239
|
};
|
|
225
240
|
}
|
|
@@ -34,6 +34,16 @@ export declare class StreamUser extends StreamBase implements IStreamUser {
|
|
|
34
34
|
* @returns {Promise<APIResponse>} object response
|
|
35
35
|
*/
|
|
36
36
|
sendUserEvent<T extends CustomEventType>(userId: string, eventType: T, data?: IEventTypesData[T]): Promise<APIResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Send event to user as a different user (system/admin account)
|
|
39
|
+
*
|
|
40
|
+
* @param {string} userId the user id to send to
|
|
41
|
+
* @param {string} senderId the user id sending the event (your account)
|
|
42
|
+
* @param {CustomEventType} eventType the event type
|
|
43
|
+
* @param {IEventTypesData} data the data to send with the event
|
|
44
|
+
* @returns {Promise<APIResponse>} object response
|
|
45
|
+
*/
|
|
46
|
+
sendUserEventAsUser<T extends CustomEventType>(userId: string, senderId: string, eventType: T, data?: IEventTypesData[T]): Promise<APIResponse>;
|
|
37
47
|
/**
|
|
38
48
|
* Sync a user list
|
|
39
49
|
*
|
|
@@ -42,6 +42,29 @@ class StreamUser extends stream_base_1.StreamBase {
|
|
|
42
42
|
return yield _super.server.sendUserCustomEvent(userId, { type: eventType, customData: data });
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Send event to user as a different user (system/admin account)
|
|
47
|
+
*
|
|
48
|
+
* @param {string} userId the user id to send to
|
|
49
|
+
* @param {string} senderId the user id sending the event (your account)
|
|
50
|
+
* @param {CustomEventType} eventType the event type
|
|
51
|
+
* @param {IEventTypesData} data the data to send with the event
|
|
52
|
+
* @returns {Promise<APIResponse>} object response
|
|
53
|
+
*/
|
|
54
|
+
sendUserEventAsUser(userId, senderId, eventType, data) {
|
|
55
|
+
const _super = Object.create(null, {
|
|
56
|
+
server: { get: () => super.server }
|
|
57
|
+
});
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
// Create a custom event with sender information
|
|
60
|
+
const eventData = {
|
|
61
|
+
type: eventType,
|
|
62
|
+
customData: Object.assign(Object.assign({}, data), { _senderId: senderId, _sentFrom: 'system' // Mark as system message
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
return yield _super.server.sendUserCustomEvent(userId, eventData);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
45
68
|
/**
|
|
46
69
|
* Sync a user list
|
|
47
70
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.user.js","sourceRoot":"","sources":["../../../chat/stream/stream.user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+CAA2C;AAkB3C;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A;IAED;;;;;OAKG;IACG,UAAU,CAAC,IAAiB;;;;;YAC9B,wBAAwB;YACxB,MAAM,CAAC,GAAG,MAAM,OAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAE9C,OAAO,CAAC,CAAC,KAAK,CAAC;QACnB,CAAC;KAAA;CACJ;AA/ID,gCA+IC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bwi-mentorspaces/application-utils-npm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.108",
|
|
4
4
|
"description": "Mentor Spaces npm packages for reusable models, utils, and abstracted, commonly used processes for DB Repo, Logging, etc.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mentor Spaces",
|