@bwi-mentorspaces/application-utils-npm 0.0.133 → 0.0.134
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { User, StreamChat, PartialUserUpdate, UserFilters, UserResponse
|
|
2
|
-
import {
|
|
1
|
+
import { User, StreamChat, PartialUserUpdate, UserFilters, UserResponse } from "stream-chat";
|
|
2
|
+
import { IUserResponse } from "./models";
|
|
3
3
|
import { StreamBase } from "./stream.base";
|
|
4
|
-
import { CustomEventType } from "./enum";
|
|
5
4
|
/**
|
|
6
5
|
* Channel Api declarations
|
|
7
6
|
*/
|
|
@@ -25,25 +24,6 @@ export declare class StreamUser extends StreamBase implements IStreamUser {
|
|
|
25
24
|
* @param {StreamChat} server Stream API server
|
|
26
25
|
*/
|
|
27
26
|
constructor(server: StreamChat);
|
|
28
|
-
/**
|
|
29
|
-
* Send event to user
|
|
30
|
-
*
|
|
31
|
-
* @param {string} userId the user id
|
|
32
|
-
* @param {CustomEventType} eventType the event type
|
|
33
|
-
* @param {IEventTypesData} data the data to send with the event
|
|
34
|
-
* @returns {Promise<APIResponse>} object response
|
|
35
|
-
*/
|
|
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>;
|
|
47
27
|
/**
|
|
48
28
|
* Sync a user list
|
|
49
29
|
*
|
|
@@ -26,45 +26,6 @@ class StreamUser extends stream_base_1.StreamBase {
|
|
|
26
26
|
super.server = server;
|
|
27
27
|
}
|
|
28
28
|
// methods
|
|
29
|
-
/**
|
|
30
|
-
* Send event to user
|
|
31
|
-
*
|
|
32
|
-
* @param {string} userId the user id
|
|
33
|
-
* @param {CustomEventType} eventType the event type
|
|
34
|
-
* @param {IEventTypesData} data the data to send with the event
|
|
35
|
-
* @returns {Promise<APIResponse>} object response
|
|
36
|
-
*/
|
|
37
|
-
sendUserEvent(userId, eventType, data) {
|
|
38
|
-
const _super = Object.create(null, {
|
|
39
|
-
server: { get: () => super.server }
|
|
40
|
-
});
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
return yield _super.server.sendUserCustomEvent(userId, { type: eventType, customData: data });
|
|
43
|
-
});
|
|
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
|
-
}
|
|
68
29
|
/**
|
|
69
30
|
* Sync a user list
|
|
70
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.user.js","sourceRoot":"","sources":["../../../chat/stream/stream.user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+CAA2C;
|
|
1
|
+
{"version":3,"file":"stream.user.js","sourceRoot":"","sources":["../../../chat/stream/stream.user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+CAA2C;AAiB3C;;GAEG;AACH,MAAa,UAAW,SAAQ,wBAAU;IACtC,aAAa;IAEb;;;;OAIG;IACH,YAAY,MAAkB;QAC1B,KAAK,EAAE,CAAC;QACR,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,UAAU;IAEV;;;;;OAKG;IACG,QAAQ,CAAC,KAAa;;;;;YACxB,kBAAkB;YAClB,MAAM,CAAC,GAAG,MAAM,OAAM,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAChD,kBAAkB;YAClB,IAAI,CAAC,EAAE;gBACH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;IAED;;;;;OAKG;IACG,kBAAkB,CAAC,WAAgC;;;;;YACrD,kBAAkB;YAClB,MAAM,CAAC,GAAG,MAAM,OAAM,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YAC7D,kBAAkB;YAClB,IAAI,CAAC,EAAE;gBACH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;IAED;;;;;OAKG;IACG,UAAU,CAAC,QAAsB;;;;;YACnC,MAAM,CAAC,GAAG,MAAM,OAAM,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAClD,kBAAkB;YAClB,IAAI,CAAC,EAAE;gBACH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;IAED;;;;;;;OAOG;IACG,UAAU,CAAC,IAAU,EAAE,MAAgB;;;;;YACzC,kBAAkB;YAClB,MAAM,CAAC,GAAG,MAAM,OAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE;gBAC7C,WAAW,EAAE,MAAM;gBACnB,4BAA4B,EAAE,IAAI;aACrC,CAAC,CAAC;YACH,kBAAkB;YAClB,IAAI,CAAC,EAAE;gBACH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;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;AAnGD,gCAmGC"}
|
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.134",
|
|
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",
|