@bwi-mentorspaces/application-utils-npm 0.0.13 → 0.0.15
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,6 +1,19 @@
|
|
|
1
1
|
import { User, StreamChat, PartialUserUpdate, UserFilters } from "stream-chat";
|
|
2
2
|
import { IUserResponse } from "./models";
|
|
3
3
|
import { StreamBase } from "./stream.base";
|
|
4
|
+
/**
|
|
5
|
+
* Necessary user information on a getStream user
|
|
6
|
+
*/
|
|
7
|
+
interface IUserInfo {
|
|
8
|
+
email: string;
|
|
9
|
+
firstName: string;
|
|
10
|
+
lastName: string;
|
|
11
|
+
avatar: string;
|
|
12
|
+
name: string;
|
|
13
|
+
headline: string;
|
|
14
|
+
pronouns: string;
|
|
15
|
+
companyHeadline: string;
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* Channel Api declarations
|
|
6
19
|
*/
|
|
@@ -45,7 +58,7 @@ export declare class StreamUser extends StreamBase implements IStreamUser {
|
|
|
45
58
|
* @param {info} userInfo user info object
|
|
46
59
|
* @returns {Promise<boolean>} promise of the type boolean
|
|
47
60
|
*/
|
|
48
|
-
createUser(userRef: string, userInfo:
|
|
61
|
+
createUser(userRef: string, userInfo: IUserInfo): Promise<boolean>;
|
|
49
62
|
/**
|
|
50
63
|
* Delete stream user
|
|
51
64
|
* https://getstream.io/chat/docs/node/update_users/?language=javascript#delete-a-user
|
|
@@ -82,7 +82,7 @@ class StreamUser extends stream_base_1.StreamBase {
|
|
|
82
82
|
server: { get: () => super.server }
|
|
83
83
|
});
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
const payload = userInfo;
|
|
85
|
+
const payload = Object.create(userInfo);
|
|
86
86
|
payload.id = userRef;
|
|
87
87
|
payload.role = "user";
|
|
88
88
|
const r = yield _super.server.upsertUser(payload);
|
|
@@ -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;AA+B3C;;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;;;;;;OAMG;IACG,UAAU,CAAC,OAAe,EAAE,QAAmB;;;;;YACjD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YACvC,OAAO,CAAC,EAAE,GAAG,OAAO,CAAA;YACpB,OAAO,CAAC,IAAI,GAAG,MAAM,CAAA;YACrB,MAAM,CAAC,GAAG,MAAM,OAAM,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACjD,kBAAkB;YAClB,IAAI,CAAC,EAAE;gBACH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;IAGD;;;;;;;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;AAxGD,gCAwGC"}
|
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.15",
|
|
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",
|