ncloudchat 1.0.18 → 1.0.21
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/esm/CloudChat.d.ts +2 -0
- package/esm/CloudChat.js +52 -8
- package/esm/CloudChat.js.map +1 -1
- package/esm/CoreManager.js.map +1 -1
- package/esm/mutations/channel.d.ts +1 -1
- package/esm/mutations/channel.js +7 -8
- package/esm/mutations/channel.js.map +1 -1
- package/esm/mutations/friend.js +4 -4
- package/esm/mutations/friend.js.map +1 -1
- package/esm/mutations/index.d.ts +1 -1
- package/esm/mutations/index.js +1 -1
- package/esm/mutations/index.js.map +1 -1
- package/esm/mutations/member.d.ts +4 -0
- package/esm/mutations/member.js +176 -0
- package/esm/mutations/member.js.map +1 -0
- package/esm/mutations/message.js +4 -0
- package/esm/mutations/message.js.map +1 -1
- package/esm/mutations/subscription.d.ts +1 -0
- package/esm/mutations/subscription.js +4 -3
- package/esm/mutations/subscription.js.map +1 -1
- package/esm/queries/channel.js +2 -2
- package/esm/queries/channel.js.map +1 -1
- package/esm/queries/friend.js +1 -1
- package/esm/queries/friend.js.map +1 -1
- package/esm/queries/subscription.js +2 -2
- package/esm/queries/subscription.js.map +1 -1
- package/lib/CloudChat.js +83 -10
- package/lib/mutations/channel.js +7 -8
- package/lib/mutations/friend.js +4 -4
- package/lib/mutations/index.js +3 -3
- package/lib/mutations/{user.js → member.js} +106 -2
- package/lib/mutations/message.js +8 -0
- package/lib/mutations/subscription.js +7 -4
- package/lib/queries/channel.js +2 -2
- package/lib/queries/friend.js +1 -1
- package/lib/queries/subscription.js +2 -2
- package/package.json +1 -1
- package/esm/mutations/user.d.ts +0 -1
- package/esm/mutations/user.js +0 -87
- package/esm/mutations/user.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/mutations/message.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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,EAAC;;;KACN,CAAC;AAEF,MAAM,CAAC,IAAM,MAAM,GAAG,UAAO,SAAiB,EAAE,IAAS;;;;;gBAC/C,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACvC,IAAG,CAAC,KAAK,EAAE;oBACP,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;oBACpC,sBAAO;iBACV;gBACK,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gBAC1C,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;gBAEvD,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAA;gBACzB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAC1B,IAAI,CAAC,MAAM,CAAC,WAAW,EAAC,SAAS,CAAC,CAAC;gBACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBACZ,qBAAM,KAAK,CACtB,QAAQ,EAAE;wBACV,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE;4BACL,eAAe,EAAG,SAAS,GAAG,KAAK;4BACnC,cAAc,EAAG,SAAS;4BAC1B,WAAW,EAAG,SAAS;yBAC1B;wBACD,IAAI,EAAE,IAAI;qBACb,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC,EAAA;;gBATpB,MAAM,GAAG,SASW;gBAC1B,sBAAO,MAAM,EAAC;;;KACjB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MarkInput } from "../Type";
|
|
2
|
+
export declare const getSubscriptionSchema = "\n id\n channel_id\n user_id\n language\n push\n mute\n online\n channel {\n name\n type\n image_url\n push\n disabled\n }\n mark {\n user_id\n message_id\n sort_id\n unread\n }\n uniquekey\n created_at\n updated_at\n";
|
|
2
3
|
export declare const createSubscription: (channelId: string, option?: string) => Promise<any>;
|
|
3
4
|
export declare const deleteSubscription: (channelId: string) => Promise<any>;
|
|
4
5
|
export declare const updateSubscription: (channelId: string, mark: MarkInput, option?: string) => Promise<any>;
|
|
@@ -35,6 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import CoreManager from '../CoreManager';
|
|
38
|
+
export var getSubscriptionSchema = "\n id\n channel_id\n user_id\n language\n push\n mute\n online\n channel {\n name\n type\n image_url\n push\n disabled\n }\n mark {\n user_id\n message_id\n sort_id\n unread\n }\n uniquekey\n created_at\n updated_at\n";
|
|
38
39
|
export var createSubscription = function (channelId, option) {
|
|
39
40
|
if (option === void 0) { option = ""; }
|
|
40
41
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -45,7 +46,7 @@ export var createSubscription = function (channelId, option) {
|
|
|
45
46
|
token = CoreManager.get("TOKEN");
|
|
46
47
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
47
48
|
projectId = CoreManager.get('PROJECT_ID');
|
|
48
|
-
query = "\n mutation (\n $projectId: String!, \n $channelId: String!,\n $option: String,\n ) {\n createSubscription (\n input: {\n projectId: $projectId, \n channelId: $channelId,\n option: $option\n }\n ) {\n subscription {\n
|
|
49
|
+
query = "\n mutation (\n $projectId: String!, \n $channelId: String!,\n $option: String,\n ) {\n createSubscription (\n input: {\n projectId: $projectId, \n channelId: $channelId,\n option: $option\n }\n ) {\n subscription {\n " + getSubscriptionSchema + "\n }\n }\n }\n ";
|
|
49
50
|
return [4 /*yield*/, fetch(endpoint, {
|
|
50
51
|
method: 'POST',
|
|
51
52
|
headers: {
|
|
@@ -83,7 +84,7 @@ export var deleteSubscription = function (channelId) { return __awaiter(void 0,
|
|
|
83
84
|
token = CoreManager.get("TOKEN");
|
|
84
85
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
85
86
|
projectId = CoreManager.get('PROJECT_ID');
|
|
86
|
-
query = "\n mutation (\n $projectId: String!, \n $channelId: String!\n ) {\n deleteSubscription (\n input: {\n projectId: $projectId, \n channelId: $channelId\n }\n ) {\n subscription {\n
|
|
87
|
+
query = "\n mutation (\n $projectId: String!, \n $channelId: String!\n ) {\n deleteSubscription (\n input: {\n projectId: $projectId, \n channelId: $channelId\n }\n ) {\n subscription {\n " + getSubscriptionSchema + "\n }\n }\n }\n ";
|
|
87
88
|
return [4 /*yield*/, fetch(endpoint, {
|
|
88
89
|
method: 'POST',
|
|
89
90
|
headers: {
|
|
@@ -121,7 +122,7 @@ export var updateSubscription = function (channelId, mark, option) {
|
|
|
121
122
|
token = CoreManager.get("TOKEN");
|
|
122
123
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
123
124
|
projectId = CoreManager.get('PROJECT_ID');
|
|
124
|
-
query = "\n mutation ($projectId: String!, $channelId: String!, $mark: MarkInput, $option: String!) {\n updateSubscription(input: {projectId: $projectId,channelId: $channelId, mark: $mark, option: $option}) {\n subscription {\n
|
|
125
|
+
query = "\n mutation ($projectId: String!, $channelId: String!, $mark: MarkInput, $option: String!) {\n updateSubscription(input: {projectId: $projectId, channelId: $channelId, mark: $mark, option: $option}) {\n subscription {\n " + getSubscriptionSchema + "\n }\n }\n }\n ";
|
|
125
126
|
return [4 /*yield*/, fetch(endpoint, {
|
|
126
127
|
method: 'POST',
|
|
127
128
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../src/mutations/subscription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../src/mutations/subscription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC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qBAAM,KAAK,CACd,QAAQ,EAAE;4BACV,MAAM,EAAE,MAAM;4BACd,OAAO,EAAE;gCACL,eAAe,EAAG,SAAS,GAAG,KAAK;gCACnC,cAAc,EAAG,SAAS;gCAC1B,cAAc,EAAE,kBAAkB;gCAClC,QAAQ,EAAE,kBAAkB;6BAC/B;4BACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gCACjB,KAAK,OAAA;gCACL,SAAS,EAAE;oCACP,SAAS,WAAA;oCACT,SAAS,WAAA;oCACT,IAAI,MAAA;oCACJ,MAAM,QAAA;iCACR;6BACH,CAAC;yBACP,CAAC;6BACD,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC;6BACvB,IAAI,CAAC,UAAA,IAAI;4BACR,IAAG,IAAI,CAAC,MAAM;gCAAE,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;4BACrC,IAAG,IAAI,CAAC,IAAI;gCAAE,MAAM,IAAI,CAAC;4BACvB,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC;wBACrD,CAAC,CAAC,EAAA;wBAxBF,sBAAO,SAwBL,EAAC;;;;CACR,CAAC"}
|
package/esm/queries/channel.js
CHANGED
|
@@ -48,7 +48,7 @@ export var getChannel = function (id) { return __awaiter(void 0, void 0, void 0,
|
|
|
48
48
|
if (!projectId)
|
|
49
49
|
return [2 /*return*/, null];
|
|
50
50
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
51
|
-
query = "\n query channel ($projectId: String!, $id: String!) {\n channel(projectId: $projectId, id:$id) {\n id\n project_id\n name\n user_id { \n id\n name\n
|
|
51
|
+
query = "\n query channel ($projectId: String!, $id: String!) {\n channel(projectId: $projectId, id:$id) {\n id\n project_id\n name\n user_id { \n id\n name\n profile\n device_type\n language\n }\n last_message {\n message_id\n sort_id\n project_id\n channel_id\n message_type\n mentions\n mentions_everyone\n has\n sender {\n id\n name\n profile\n }\n admin {\n id\n name\n profile\n }\n content\n created_at\n }\n unique_id\n type\n translation\n members\n push\n link_url\n image_url \n created_at\n updated_at\n }\n }\n ";
|
|
52
52
|
return [4 /*yield*/, fetch(endpoint, {
|
|
53
53
|
method: 'POST',
|
|
54
54
|
headers: {
|
|
@@ -93,7 +93,7 @@ export var getChannels = function (filter, sort, option) { return __awaiter(void
|
|
|
93
93
|
if (!projectId)
|
|
94
94
|
return [2 /*return*/, null];
|
|
95
95
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
96
|
-
query = "\n query channels ($projectId: String!, $filter: String!, $sort: String, $option:String) {\n channels(projectId: $projectId, filter:$filter, sort:$sort, option:$option) {\n totalCount\n edges {\n node {\n id\n project_id\n name\n user_id { \n id\n name\n
|
|
96
|
+
query = "\n query channels ($projectId: String!, $filter: String!, $sort: String, $option:String) {\n channels(projectId: $projectId, filter:$filter, sort:$sort, option:$option) {\n totalCount\n edges {\n node {\n id\n project_id\n name\n user_id { \n id\n name\n profile\n device_type\n language\n }\n last_message {\n message_id\n sort_id\n project_id\n channel_id\n message_type\n mentions\n mentions_everyone\n has\n sender {\n id\n name\n profile\n }\n admin {\n id\n name\n profile\n }\n content\n }\n unique_id\n type\n translation\n members\n push\n link_url\n image_url \n created_at\n updated_at\n }\n }\n }\n }\n ";
|
|
97
97
|
return [4 /*yield*/, fetch(endpoint, {
|
|
98
98
|
method: 'POST',
|
|
99
99
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../src/queries/channel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,MAAM,CAAC,IAAM,UAAU,GAAG,UAAO,EAAU;;;;;gBACnC,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC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S,CAAC;4BACnB,KAAK,EAAC,KAAK;4BACX,SAAS,EAAE;gCACT,SAAS,WAAA;gCACT,MAAM,QAAA;gCACN,IAAI,MAAA;gCACJ,MAAM,QAAA;6BACP;yBACF,CAAC;qBACH,CAAC;yBACC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC;yBACzB,IAAI,CAAC,UAAC,IAAI;wBACT,IAAG,IAAI,CAAC,MAAM;4BAAE,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;wBACrC,IAAG,IAAI,CAAC,IAAI;4BAAE,MAAM,IAAI,CAAC;wBAEzB,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EACrB;4BACE,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;yBACjC;wBACD,OAAO,EAAE,CAAC;oBAEZ,CAAC,CAAC,EAAA;oBA7BJ,sBAAO,SA6BH,EAAC;;;KACN,CAAC"}
|
package/esm/queries/friend.js
CHANGED
|
@@ -47,7 +47,7 @@ export var getFriendships = function (filter, sort, option) { return __awaiter(v
|
|
|
47
47
|
if (!projectId)
|
|
48
48
|
return [2 /*return*/, null];
|
|
49
49
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
50
|
-
lquery = "\n query friendships ($projectId: String!, $filter: String!, $sort: String, $option: String) {\n friendships(projectId: $projectId, filter:$filter, sort:$sort, option: $option) {\n totalCount\n edges {\n node {\n project_id\n id\n status\n user {\n id\n
|
|
50
|
+
lquery = "\n query friendships ($projectId: String!, $filter: String!, $sort: String, $option: String) {\n friendships(projectId: $projectId, filter:$filter, sort:$sort, option: $option) {\n totalCount\n edges {\n node {\n project_id\n id\n status\n user {\n id\n name\n profile\n }\n friend {\n id\n name\n profile\n }\n user_id\n friend_id\n created_at\n updated_at\n requested_at\n }\n }\n }\n }\n ";
|
|
51
51
|
return [4 /*yield*/, fetch(endpoint, {
|
|
52
52
|
method: 'POST',
|
|
53
53
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"friend.js","sourceRoot":"","sources":["../../src/queries/friend.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,MAAM,CAAC,IAAM,cAAc,GAAG,UAAO,MAAc,EAAE,IAAY,EAAE,MAAa;;;;;gBACxE,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACvC,IAAI,CAAC,KAAK;oBAAE,sBAAO,IAAI,EAAC;gBAClB,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gBAChD,IAAI,CAAC,SAAS;oBAAE,sBAAO,IAAI,EAAC;gBACtB,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;gBACtD,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"friend.js","sourceRoot":"","sources":["../../src/queries/friend.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,MAAM,CAAC,IAAM,cAAc,GAAG,UAAO,MAAc,EAAE,IAAY,EAAE,MAAa;;;;;gBACxE,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACvC,IAAI,CAAC,KAAK;oBAAE,sBAAO,IAAI,EAAC;gBAClB,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gBAChD,IAAI,CAAC,SAAS;oBAAE,sBAAO,IAAI,EAAC;gBACtB,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;gBACtD,MAAM,GAAG,y2BA4BZ,CAAC;gBAEG,qBAAM,KAAK,CAAC,QAAQ,EAAE;wBAC3B,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE;4BACP,aAAa,EAAE,SAAS,GAAG,KAAK;4BAChC,cAAc,EAAG,SAAS;4BAC1B,cAAc,EAAE,kBAAkB;4BAClC,MAAM,EAAE,kBAAkB;yBAC3B;wBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACnB,KAAK,EAAC,MAAM;4BACZ,SAAS,EAAE;gCACT,SAAS,WAAA;gCACT,MAAM,QAAA;gCACN,IAAI,MAAA;gCACJ,MAAM,QAAA;6BACP;yBACF,CAAC;qBACH,CAAC;yBACC,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC;yBACzB,IAAI,CAAC,UAAC,IAAI;wBACT,IAAG,IAAI,CAAC,MAAM;4BAAE,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;wBACrC,IAAG,IAAI,CAAC,IAAI;4BAAE,MAAM,IAAI,CAAC;wBACzB,IAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EACxB;4BACE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;yBACpC;wBACD,OAAO,EAAE,CAAC;oBAEZ,CAAC,CAAC,EAAA;oBA5BJ,sBAAO,SA4BH,EAAC;;;KACN,CAAC"}
|
|
@@ -48,7 +48,7 @@ export var getSubscription = function (channelId, id) { return __awaiter(void 0,
|
|
|
48
48
|
if (!projectId)
|
|
49
49
|
return [2 /*return*/, null];
|
|
50
50
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
51
|
-
query = "\n query subscription ($projectId: String!,$channelId: String!, $id: String!) {\n subscription(projectId: $projectId, channelId: $channelId, id:$id) {\n id\n user {\n
|
|
51
|
+
query = "\n query subscription ($projectId: String!,$channelId: String!, $id: String!) {\n subscription(projectId: $projectId, channelId: $channelId, id:$id) {\n id\n user {\n name\n profile\n country\n }\n mark {\n user_id\n message_id\n sort_id\n }\n channel_id\n user_id\n online\n push\n created_at\n }\n }\n ";
|
|
52
52
|
return [4 /*yield*/, fetch(endpoint, {
|
|
53
53
|
method: 'POST',
|
|
54
54
|
headers: {
|
|
@@ -93,7 +93,7 @@ export var getSubscriptions = function (filter, sort, option) { return __awaiter
|
|
|
93
93
|
if (!projectId)
|
|
94
94
|
return [2 /*return*/, null];
|
|
95
95
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
96
|
-
query = "\n query subscriptions ($projectId: String!, $option: String!, $filter: String!, $sort: String ) {\n subscriptions (projectId: $projectId, option:$option, filter:$filter, sort:$sort) {\n totalCount\n edges {\n node {\n id\n user {\n
|
|
96
|
+
query = "\n query subscriptions ($projectId: String!, $option: String!, $filter: String!, $sort: String ) {\n subscriptions (projectId: $projectId, option:$option, filter:$filter, sort:$sort) {\n totalCount\n edges {\n node {\n id\n user {\n name\n profile\n country\n }\n channel_id\n user_id\n online\n push\n created_at\n }\n }\n }\n }\n ";
|
|
97
97
|
return [4 /*yield*/, fetch(endpoint, {
|
|
98
98
|
method: 'POST',
|
|
99
99
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../src/queries/subscription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAQ,EAAC,QAAQ,EAAC,MAAO,SAAS,CAAC;AACnC,MAAM,CAAC,IAAO,eAAe,GAAG,UAAO,SAAiB,EAAE,EAAU;;;;;gBAC1D,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACvC,IAAG,CAAC,KAAK;oBAAE,sBAAO,IAAI,EAAC;gBACjB,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gBAChD,IAAG,CAAC,SAAS;oBAAE,sBAAO,IAAI,EAAC;gBACrB,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,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AU,CAAC;yBACvB,IAAI,CAAC,UAAA,IAAI;wBACN,IAAG,IAAI,CAAC,MAAM;4BAAE,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;wBACrC,IAAG,IAAI,CAAC,IAAI;4BAAE,MAAM,IAAI,CAAC;wBACzB,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;oBACzC,CAAC,CAAC,EAAA;oBAxBF,sBAAO,SAwBL,EAAC;;;KACN,CAAA"}
|
package/lib/CloudChat.js
CHANGED
|
@@ -346,7 +346,7 @@ function () {
|
|
|
346
346
|
this.socket.on("connect", function (data) {
|
|
347
347
|
_this.connectedCount++;
|
|
348
348
|
_this.connected = true;
|
|
349
|
-
(0, _logger.info)("Connected to " + url + " with id: " + _this.socket.id
|
|
349
|
+
(0, _logger.info)("Connected to " + url + " with id: " + _this.socket.id);
|
|
350
350
|
|
|
351
351
|
_this.dp.dispatch("onConnected", data);
|
|
352
352
|
});
|
|
@@ -1578,27 +1578,22 @@ function () {
|
|
|
1578
1578
|
_a.label = 1;
|
|
1579
1579
|
|
|
1580
1580
|
case 1:
|
|
1581
|
-
_a.trys.push([1,
|
|
1581
|
+
_a.trys.push([1, 3,, 4]);
|
|
1582
1582
|
|
|
1583
1583
|
return [4
|
|
1584
1584
|
/*yield*/
|
|
1585
|
-
, (0, _mutations.removeChannelMembers)(channelId, memberIds
|
|
1585
|
+
, (0, _mutations.removeChannelMembers)(channelId, memberIds)];
|
|
1586
1586
|
|
|
1587
1587
|
case 2:
|
|
1588
|
-
return [4
|
|
1589
|
-
/*yield*/
|
|
1590
|
-
, _a.sent()];
|
|
1591
|
-
|
|
1592
|
-
case 3:
|
|
1593
1588
|
return [2
|
|
1594
1589
|
/*return*/
|
|
1595
1590
|
, _a.sent()];
|
|
1596
1591
|
|
|
1597
|
-
case
|
|
1592
|
+
case 3:
|
|
1598
1593
|
e_25 = _a.sent();
|
|
1599
1594
|
throw e_25;
|
|
1600
1595
|
|
|
1601
|
-
case
|
|
1596
|
+
case 4:
|
|
1602
1597
|
return [2
|
|
1603
1598
|
/*return*/
|
|
1604
1599
|
];
|
|
@@ -1669,6 +1664,84 @@ function () {
|
|
|
1669
1664
|
});
|
|
1670
1665
|
};
|
|
1671
1666
|
|
|
1667
|
+
NCloudChat.prototype.banUser = function (channelId, memberId, options) {
|
|
1668
|
+
if (options === void 0) {
|
|
1669
|
+
options = {};
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1673
|
+
var e_26;
|
|
1674
|
+
return __generator(this, function (_a) {
|
|
1675
|
+
switch (_a.label) {
|
|
1676
|
+
case 0:
|
|
1677
|
+
if (!this.isConnected()) {
|
|
1678
|
+
throw Error("You are not connected.");
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
_a.label = 1;
|
|
1682
|
+
|
|
1683
|
+
case 1:
|
|
1684
|
+
_a.trys.push([1, 3,, 4]);
|
|
1685
|
+
|
|
1686
|
+
return [4
|
|
1687
|
+
/*yield*/
|
|
1688
|
+
, (0, _mutations.createMemberBlock)(channelId, memberId, (0, _stringify["default"])(options))];
|
|
1689
|
+
|
|
1690
|
+
case 2:
|
|
1691
|
+
return [2
|
|
1692
|
+
/*return*/
|
|
1693
|
+
, _a.sent()];
|
|
1694
|
+
|
|
1695
|
+
case 3:
|
|
1696
|
+
e_26 = _a.sent();
|
|
1697
|
+
throw e_26;
|
|
1698
|
+
|
|
1699
|
+
case 4:
|
|
1700
|
+
return [2
|
|
1701
|
+
/*return*/
|
|
1702
|
+
];
|
|
1703
|
+
}
|
|
1704
|
+
});
|
|
1705
|
+
});
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
NCloudChat.prototype.unbanUser = function (channelId, memberId) {
|
|
1709
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1710
|
+
var e_27;
|
|
1711
|
+
return __generator(this, function (_a) {
|
|
1712
|
+
switch (_a.label) {
|
|
1713
|
+
case 0:
|
|
1714
|
+
if (!this.isConnected()) {
|
|
1715
|
+
throw Error("You are not connected.");
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
_a.label = 1;
|
|
1719
|
+
|
|
1720
|
+
case 1:
|
|
1721
|
+
_a.trys.push([1, 3,, 4]);
|
|
1722
|
+
|
|
1723
|
+
return [4
|
|
1724
|
+
/*yield*/
|
|
1725
|
+
, (0, _mutations.deleteMemberBlock)(channelId, memberId)];
|
|
1726
|
+
|
|
1727
|
+
case 2:
|
|
1728
|
+
return [2
|
|
1729
|
+
/*return*/
|
|
1730
|
+
, _a.sent()];
|
|
1731
|
+
|
|
1732
|
+
case 3:
|
|
1733
|
+
e_27 = _a.sent();
|
|
1734
|
+
throw e_27;
|
|
1735
|
+
|
|
1736
|
+
case 4:
|
|
1737
|
+
return [2
|
|
1738
|
+
/*return*/
|
|
1739
|
+
];
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
});
|
|
1743
|
+
};
|
|
1744
|
+
|
|
1672
1745
|
return NCloudChat;
|
|
1673
1746
|
}();
|
|
1674
1747
|
|
package/lib/mutations/channel.js
CHANGED
|
@@ -175,7 +175,7 @@ var createChannel = function createChannel(channel) {
|
|
|
175
175
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
176
176
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
177
177
|
if (!channel.members) channel.members = [];
|
|
178
|
-
query = "\n mutation (\n $id: String,\n $projectId: String!, \n $name: String!, \n $type: String!,\n $uniqueId: String,\n $translation: Boolean,\n $push: Boolean,\n $mutes: Boolean,\n $linkUrl: String,\n $imageUrl: String,\n $members: [String]\n ) {\n createChannel(\n input: { \n id: $id,\n projectId: $projectId, \n name: $name, \n type: $type,\n uniqueId: $uniqueId,\n translation:$translation,\n push:$push,\n mutes: $mutes,\n linkUrl:$linkUrl,\n imageUrl:$imageUrl\n members: $members,\n }\n ) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n
|
|
178
|
+
query = "\n mutation (\n $id: String,\n $projectId: String!, \n $name: String!, \n $type: String!,\n $uniqueId: String,\n $translation: Boolean,\n $push: Boolean,\n $mutes: Boolean,\n $linkUrl: String,\n $imageUrl: String,\n $members: [String]\n ) {\n createChannel(\n input: { \n id: $id,\n projectId: $projectId, \n name: $name, \n type: $type,\n uniqueId: $uniqueId,\n translation:$translation,\n push:$push,\n mutes: $mutes,\n linkUrl:$linkUrl,\n imageUrl:$imageUrl\n members: $members,\n }\n ) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n profile\n device_type\n language\n }\n last_message {\n message_id\n sort_id\n project_id\n channel_id\n message_type\n mentions\n mentions_everyone\n has\n sender {\n id\n name\n profile\n }\n admin {\n id\n name\n profile\n }\n content\n }\n unique_id\n type\n translation\n members\n push\n link_url\n image_url \n created_at\n updated_at\n }\n }\n } \n ";
|
|
179
179
|
return [4
|
|
180
180
|
/*yield*/
|
|
181
181
|
, fetch(endpoint, {
|
|
@@ -231,7 +231,7 @@ var updateChannel = function updateChannel(channelId, channel) {
|
|
|
231
231
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
232
232
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
233
233
|
if (!channel.members) channel.members = [];
|
|
234
|
-
query = "\n mutation (\n $projectId: String!, \n $name: String!, \n $type: String!,\n $uniqueId: String,\n $translation: Boolean,\n $push: Boolean,\n $linkUrl: String,\n $imageUrl: String,\n $id: ID!,\n $members: [String]\n ) {\n updateChannel(\n input: { \n projectId: $projectId, \n name: $name, \n type: $type,\n id: $id,\n members: $members,\n uniqueId: $uniqueId,\n translation:$translation,\n push:$push,\n linkUrl:$linkUrl,\n imageUrl:$imageUrl\n }\n ) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n
|
|
234
|
+
query = "\n mutation (\n $projectId: String!, \n $name: String!, \n $type: String!,\n $uniqueId: String,\n $translation: Boolean,\n $push: Boolean,\n $linkUrl: String,\n $imageUrl: String,\n $id: ID!,\n $members: [String]\n ) {\n updateChannel(\n input: { \n projectId: $projectId, \n name: $name, \n type: $type,\n id: $id,\n members: $members,\n uniqueId: $uniqueId,\n translation:$translation,\n push:$push,\n linkUrl:$linkUrl,\n imageUrl:$imageUrl\n }\n ) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n profile\n device_type\n language\n }\n last_message {\n message_id\n sort_id\n project_id\n channel_id\n message_type\n mentions\n mentions_everyone\n has\n sender {\n id\n name\n profile\n }\n admin {\n id\n name\n profile\n }\n content\n }\n unique_id\n type\n translation\n members\n push\n link_url\n image_url \n created_at\n updated_at\n }\n }\n } \n ";
|
|
235
235
|
return [4
|
|
236
236
|
/*yield*/
|
|
237
237
|
, fetch(endpoint, {
|
|
@@ -287,7 +287,7 @@ var deleteChannel = function deleteChannel(channelId) {
|
|
|
287
287
|
token = _CoreManager["default"].get("TOKEN");
|
|
288
288
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
289
289
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
290
|
-
query = "\n mutation (\n $projectId: String!, \n $id: ID!\n ) {\n deleteChannel(\n input: { \n projectId: $projectId, \n id: $id,\n }\n ) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n
|
|
290
|
+
query = "\n mutation (\n $projectId: String!, \n $id: ID!\n ) {\n deleteChannel(\n input: { \n projectId: $projectId, \n id: $id,\n }\n ) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n profile\n device_type\n language\n }\n last_message {\n message_id\n sort_id\n project_id\n channel_id\n message_type\n mentions\n mentions_everyone\n has\n sender {\n id\n name\n profile\n }\n admin {\n id\n name\n profile\n }\n content\n }\n unique_id\n type\n translation\n members\n push\n link_url\n image_url \n created_at\n updated_at\n }\n }\n } \n ";
|
|
291
291
|
return [4
|
|
292
292
|
/*yield*/
|
|
293
293
|
, fetch(endpoint, {
|
|
@@ -333,7 +333,7 @@ var addChannelMembers = function addChannelMembers(channelId, memberIds, options
|
|
|
333
333
|
token = _CoreManager["default"].get("TOKEN");
|
|
334
334
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
335
335
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
336
|
-
query = "\n mutation ($projectId: String!, $channelId: String!, $memberIds: [String]!) {\n addChannelMembers(input: {projectId: $projectId, channelId: $channelId, memberIds:$memberIds }) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n
|
|
336
|
+
query = "\n mutation ($projectId: String!, $channelId: String!, $memberIds: [String]!) {\n addChannelMembers(input: {projectId: $projectId, channelId: $channelId, memberIds:$memberIds }) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n profile\n device_type\n language\n }\n unique_id\n type\n translation\n members\n push\n link_url\n image_url \n created_at\n updated_at\n }\n }\n }\n ";
|
|
337
337
|
return [4
|
|
338
338
|
/*yield*/
|
|
339
339
|
, fetch(endpoint, {
|
|
@@ -372,7 +372,7 @@ var addChannelMembers = function addChannelMembers(channelId, memberIds, options
|
|
|
372
372
|
|
|
373
373
|
exports.addChannelMembers = addChannelMembers;
|
|
374
374
|
|
|
375
|
-
var removeChannelMembers = function removeChannelMembers(channelId, memberIds
|
|
375
|
+
var removeChannelMembers = function removeChannelMembers(channelId, memberIds) {
|
|
376
376
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
377
377
|
var token, projectId, endpoint, query;
|
|
378
378
|
return __generator(this, function (_a) {
|
|
@@ -381,7 +381,7 @@ var removeChannelMembers = function removeChannelMembers(channelId, memberIds, o
|
|
|
381
381
|
token = _CoreManager["default"].get("TOKEN");
|
|
382
382
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
383
383
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
384
|
-
query = "\n mutation ($projectId: String!, $channelId: String!, $memberIds: [String]!) {\n removeChannelMembers(input: {projectId: $projectId, channelId: $channelId, memberIds:$memberIds }) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n
|
|
384
|
+
query = "\n mutation ($projectId: String!, $channelId: String!, $memberIds: [String]!) {\n removeChannelMembers(input: {projectId: $projectId, channelId: $channelId, memberIds:$memberIds }) {\n channel {\n id\n project_id\n name\n user_id { \n id\n name\n profile\n device_type\n language\n }\n unique_id\n type\n translation\n members\n push\n link_url\n image_url \n created_at\n updated_at\n }\n }\n }\n ";
|
|
385
385
|
return [4
|
|
386
386
|
/*yield*/
|
|
387
387
|
, fetch(endpoint, {
|
|
@@ -397,8 +397,7 @@ var removeChannelMembers = function removeChannelMembers(channelId, memberIds, o
|
|
|
397
397
|
variables: {
|
|
398
398
|
projectId: projectId,
|
|
399
399
|
channelId: channelId,
|
|
400
|
-
memberIds: memberIds
|
|
401
|
-
options: options
|
|
400
|
+
memberIds: memberIds
|
|
402
401
|
}
|
|
403
402
|
})
|
|
404
403
|
}).then(function (res) {
|
package/lib/mutations/friend.js
CHANGED
|
@@ -172,7 +172,7 @@ var requestFriend = function requestFriend(friendId) {
|
|
|
172
172
|
token = _CoreManager["default"].get("TOKEN");
|
|
173
173
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
174
174
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
175
|
-
query = "\n mutation ($projectId: String!, $friendId: String!) {\n requestFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n
|
|
175
|
+
query = "\n mutation ($projectId: String!, $friendId: String!) {\n requestFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n name\n profile\n }\n friend {\n id\n name\n profile\n }\n friend_id\n created_at\n updated_at\n requested_at\n }\n }\n }\n ";
|
|
176
176
|
return [4
|
|
177
177
|
/*yield*/
|
|
178
178
|
, fetch(endpoint, {
|
|
@@ -220,7 +220,7 @@ var acceptFriend = function acceptFriend(friendId) {
|
|
|
220
220
|
token = _CoreManager["default"].get("TOKEN");
|
|
221
221
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
222
222
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
223
|
-
query = "\n mutation ($projectId: String!, $friendId: String!) {\n acceptFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n
|
|
223
|
+
query = "\n mutation ($projectId: String!, $friendId: String!) {\n acceptFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n name\n profile\n }\n friend {\n id\n name\n profile\n }\n friend_id\n created_at\n updated_at\n requested_at\n }\n }\n }\n ";
|
|
224
224
|
return [4
|
|
225
225
|
/*yield*/
|
|
226
226
|
, fetch(endpoint, {
|
|
@@ -268,7 +268,7 @@ var rejectFriend = function rejectFriend(friendId) {
|
|
|
268
268
|
token = _CoreManager["default"].get("TOKEN");
|
|
269
269
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
270
270
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
271
|
-
query = "\n mutation ($projectId: String!, $friendId: String!) {\n rejectFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n
|
|
271
|
+
query = "\n mutation ($projectId: String!, $friendId: String!) {\n rejectFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n name\n profile\n }\n friend {\n id\n name\n profile\n }\n friend_id\n created_at\n updated_at\n requested_at\n }\n }\n }\n ";
|
|
272
272
|
return [4
|
|
273
273
|
/*yield*/
|
|
274
274
|
, fetch(endpoint, {
|
|
@@ -314,7 +314,7 @@ var removeFriend = function removeFriend(friendId) {
|
|
|
314
314
|
token = _CoreManager["default"].get("TOKEN");
|
|
315
315
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
316
316
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
317
|
-
query = "\n mutation ($projectId: String!, $friendId: String!) {\n removeFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n
|
|
317
|
+
query = "\n mutation ($projectId: String!, $friendId: String!) {\n removeFriend(input: {projectId: $projectId, friendId: $friendId}) {\n friendship {\n project_id\n id\n status\n user {\n id\n name\n profile\n }\n friend {\n id\n name\n profile\n }\n friend_id\n created_at\n updated_at\n requested_at\n }\n }\n }\n ";
|
|
318
318
|
return [4
|
|
319
319
|
/*yield*/
|
|
320
320
|
, fetch(endpoint, {
|
package/lib/mutations/index.js
CHANGED
|
@@ -10,15 +10,15 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
10
10
|
value: true
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _member = require("./member");
|
|
14
14
|
|
|
15
|
-
_Object$keys(
|
|
15
|
+
_Object$keys(_member).forEach(function (key) {
|
|
16
16
|
if (key === "default" || key === "__esModule") return;
|
|
17
17
|
|
|
18
18
|
_Object$defineProperty(exports, key, {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _member[key];
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
});
|
|
@@ -8,7 +8,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
exports.login = void 0;
|
|
11
|
+
exports.deleteMemberBlock = exports.createMemberBlock = exports.login = exports.getMemberBlockSchema = void 0;
|
|
12
12
|
|
|
13
13
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
14
14
|
|
|
@@ -163,6 +163,9 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
+
var getMemberBlockSchema = "\n id\n project_id\n member_id\n type\n status\n block_type\n reason\n messageMulti {\n lang\n value\n default\n }\n started_at\n ended_at\n created_at\n updated_at\n deleted_at\n";
|
|
167
|
+
exports.getMemberBlockSchema = getMemberBlockSchema;
|
|
168
|
+
|
|
166
169
|
var login = function login(user_id, name, profile, token) {
|
|
167
170
|
if (name === void 0) {
|
|
168
171
|
name = '';
|
|
@@ -224,4 +227,105 @@ var login = function login(user_id, name, profile, token) {
|
|
|
224
227
|
});
|
|
225
228
|
};
|
|
226
229
|
|
|
227
|
-
exports.login = login;
|
|
230
|
+
exports.login = login;
|
|
231
|
+
|
|
232
|
+
var createMemberBlock = function createMemberBlock(channelId, memberId, options) {
|
|
233
|
+
if (options === void 0) {
|
|
234
|
+
options = "";
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
238
|
+
var token, projectId, endpoint, mutation;
|
|
239
|
+
return __generator(this, function (_a) {
|
|
240
|
+
switch (_a.label) {
|
|
241
|
+
case 0:
|
|
242
|
+
token = _CoreManager["default"].get("TOKEN");
|
|
243
|
+
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
244
|
+
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
245
|
+
mutation = "mutation createMemberBlock(\n $projectId: String!\n $memberId: String!\n $channelId: String\n $options: String\n ) {\n createMemberBlock(\n input: {\n projectId: $projectId\n memberId: $memberId\n channelId: $channelId\n options: $options\n }\n ) {\n memberBlock {\n " + getMemberBlockSchema + "\n }\n }\n }";
|
|
246
|
+
return [4
|
|
247
|
+
/*yield*/
|
|
248
|
+
, fetch(endpoint, {
|
|
249
|
+
method: 'POST',
|
|
250
|
+
headers: {
|
|
251
|
+
'Authorization': 'Bearer ' + token,
|
|
252
|
+
'X-PROJECT-ID': projectId,
|
|
253
|
+
'Content-Type': 'application/json',
|
|
254
|
+
'Accept': 'application/json'
|
|
255
|
+
},
|
|
256
|
+
body: (0, _stringify["default"])({
|
|
257
|
+
query: mutation,
|
|
258
|
+
variables: {
|
|
259
|
+
projectId: projectId,
|
|
260
|
+
channelId: channelId,
|
|
261
|
+
memberId: memberId,
|
|
262
|
+
options: options
|
|
263
|
+
}
|
|
264
|
+
})
|
|
265
|
+
}).then(function (res) {
|
|
266
|
+
return res.json();
|
|
267
|
+
}).then(function (data) {
|
|
268
|
+
if (data.errors) throw data.errors[0];
|
|
269
|
+
if (data.code) throw data;else if (data.data.createMemberBlock) {
|
|
270
|
+
return data.data.createMemberBlock;
|
|
271
|
+
} else return false;
|
|
272
|
+
})];
|
|
273
|
+
|
|
274
|
+
case 1:
|
|
275
|
+
return [2
|
|
276
|
+
/*return*/
|
|
277
|
+
, _a.sent()];
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
exports.createMemberBlock = createMemberBlock;
|
|
284
|
+
|
|
285
|
+
var deleteMemberBlock = function deleteMemberBlock(channelId, memberId) {
|
|
286
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
287
|
+
var token, projectId, endpoint, mutation;
|
|
288
|
+
return __generator(this, function (_a) {
|
|
289
|
+
switch (_a.label) {
|
|
290
|
+
case 0:
|
|
291
|
+
token = _CoreManager["default"].get("TOKEN");
|
|
292
|
+
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
293
|
+
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
294
|
+
mutation = "mutation deleteMemberBlock(\n $projectId: String!\n $memberId: String!\n $channelId: String\n ) {\n deleteMemberBlock(\n input: {\n projectId: $projectId\n memberId: $memberId\n channelId: $channelId\n }\n ) {\n memberBlock {\n " + getMemberBlockSchema + "\n }\n }\n }";
|
|
295
|
+
return [4
|
|
296
|
+
/*yield*/
|
|
297
|
+
, fetch(endpoint, {
|
|
298
|
+
method: 'POST',
|
|
299
|
+
headers: {
|
|
300
|
+
'Authorization': 'Bearer ' + token,
|
|
301
|
+
'X-PROJECT-ID': projectId,
|
|
302
|
+
'Content-Type': 'application/json',
|
|
303
|
+
'Accept': 'application/json'
|
|
304
|
+
},
|
|
305
|
+
body: (0, _stringify["default"])({
|
|
306
|
+
query: mutation,
|
|
307
|
+
variables: {
|
|
308
|
+
projectId: projectId,
|
|
309
|
+
channelId: channelId,
|
|
310
|
+
memberId: memberId
|
|
311
|
+
}
|
|
312
|
+
})
|
|
313
|
+
}).then(function (res) {
|
|
314
|
+
return res.json();
|
|
315
|
+
}).then(function (data) {
|
|
316
|
+
if (data.errors) throw data.errors[0];
|
|
317
|
+
if (data.code) throw data;else if (data.data.deleteMemberBlock) {
|
|
318
|
+
return data.data.deleteMemberBlock;
|
|
319
|
+
} else return false;
|
|
320
|
+
})];
|
|
321
|
+
|
|
322
|
+
case 1:
|
|
323
|
+
return [2
|
|
324
|
+
/*return*/
|
|
325
|
+
, _a.sent()];
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
exports.deleteMemberBlock = deleteMemberBlock;
|
package/lib/mutations/message.js
CHANGED
|
@@ -219,6 +219,14 @@ var upload = function upload(channelId, file) {
|
|
|
219
219
|
switch (_a.label) {
|
|
220
220
|
case 0:
|
|
221
221
|
token = _CoreManager["default"].get("TOKEN");
|
|
222
|
+
|
|
223
|
+
if (!token) {
|
|
224
|
+
console.error('Token is not found');
|
|
225
|
+
return [2
|
|
226
|
+
/*return*/
|
|
227
|
+
];
|
|
228
|
+
}
|
|
229
|
+
|
|
222
230
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
223
231
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/upload';
|
|
224
232
|
form = new FormData();
|