ncloudchat 1.0.33 → 1.0.35
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/LICENSE.md +2 -2
- package/README.md +23 -393
- package/ncloudchat.d.ts +1298 -0
- package/ncloudchat.min.js +1 -0
- package/package.json +19 -40
- package/deploy.sh +0 -20
- package/esm/CloudChat.d.ts +0 -482
- package/esm/CloudChat.js +0 -1736
- package/esm/CloudChat.js.map +0 -1
- package/esm/CoreManager.d.ts +0 -11
- package/esm/CoreManager.js +0 -36
- package/esm/CoreManager.js.map +0 -1
- package/esm/Dispatcher.d.ts +0 -37
- package/esm/Dispatcher.js +0 -93
- package/esm/Dispatcher.js.map +0 -1
- package/esm/Network.d.ts +0 -7
- package/esm/Network.js +0 -96
- package/esm/Network.js.map +0 -1
- package/esm/Type.d.ts +0 -79
- package/esm/Type.js +0 -28
- package/esm/Type.js.map +0 -1
- package/esm/Util.d.ts +0 -15
- package/esm/Util.js +0 -20
- package/esm/Util.js.map +0 -1
- package/esm/graphql/channel.d.ts +0 -13
- package/esm/graphql/channel.js +0 -16
- package/esm/graphql/channel.js.map +0 -1
- package/esm/graphql/friend.d.ts +0 -11
- package/esm/graphql/friend.js +0 -13
- package/esm/graphql/friend.js.map +0 -1
- package/esm/graphql/invite.d.ts +0 -7
- package/esm/graphql/invite.js +0 -8
- package/esm/graphql/invite.js.map +0 -1
- package/esm/graphql/member.d.ts +0 -11
- package/esm/graphql/member.js +0 -13
- package/esm/graphql/member.js.map +0 -1
- package/esm/graphql/message.d.ts +0 -11
- package/esm/graphql/message.js +0 -13
- package/esm/graphql/message.js.map +0 -1
- package/esm/graphql/pin.d.ts +0 -10
- package/esm/graphql/pin.js +0 -12
- package/esm/graphql/pin.js.map +0 -1
- package/esm/graphql/project.d.ts +0 -6
- package/esm/graphql/project.js +0 -8
- package/esm/graphql/project.js.map +0 -1
- package/esm/graphql/subscription.d.ts +0 -11
- package/esm/graphql/subscription.js +0 -13
- package/esm/graphql/subscription.js.map +0 -1
- package/esm/index.d.ts +0 -8
- package/esm/index.js +0 -9
- package/esm/index.js.map +0 -1
- package/esm/logger.d.ts +0 -10
- package/esm/logger.js +0 -17
- package/esm/logger.js.map +0 -1
- package/esm/mutations/channel.d.ts +0 -56
- package/esm/mutations/channel.js +0 -170
- package/esm/mutations/channel.js.map +0 -1
- package/esm/mutations/friend.d.ts +0 -42
- package/esm/mutations/friend.js +0 -122
- package/esm/mutations/friend.js.map +0 -1
- package/esm/mutations/index.d.ts +0 -13
- package/esm/mutations/index.js +0 -14
- package/esm/mutations/index.js.map +0 -1
- package/esm/mutations/invite.d.ts +0 -16
- package/esm/mutations/invite.js +0 -67
- package/esm/mutations/invite.js.map +0 -1
- package/esm/mutations/member.d.ts +0 -41
- package/esm/mutations/member.js +0 -129
- package/esm/mutations/member.js.map +0 -1
- package/esm/mutations/message.d.ts +0 -37
- package/esm/mutations/message.js +0 -132
- package/esm/mutations/message.js.map +0 -1
- package/esm/mutations/pin.d.ts +0 -28
- package/esm/mutations/pin.js +0 -88
- package/esm/mutations/pin.js.map +0 -1
- package/esm/mutations/subscription.d.ts +0 -37
- package/esm/mutations/subscription.js +0 -115
- package/esm/mutations/subscription.js.map +0 -1
- package/esm/queries/channel.d.ts +0 -26
- package/esm/queries/channel.js +0 -88
- package/esm/queries/channel.js.map +0 -1
- package/esm/queries/friend.d.ts +0 -17
- package/esm/queries/friend.js +0 -69
- package/esm/queries/friend.js.map +0 -1
- package/esm/queries/index.d.ts +0 -14
- package/esm/queries/index.js +0 -15
- package/esm/queries/index.js.map +0 -1
- package/esm/queries/member.d.ts +0 -17
- package/esm/queries/member.js +0 -69
- package/esm/queries/member.js.map +0 -1
- package/esm/queries/memberblocks.d.ts +0 -17
- package/esm/queries/memberblocks.js +0 -69
- package/esm/queries/memberblocks.js.map +0 -1
- package/esm/queries/message.d.ts +0 -36
- package/esm/queries/message.js +0 -109
- package/esm/queries/message.js.map +0 -1
- package/esm/queries/pin.d.ts +0 -28
- package/esm/queries/pin.js +0 -92
- package/esm/queries/pin.js.map +0 -1
- package/esm/queries/project.d.ts +0 -14
- package/esm/queries/project.js +0 -22
- package/esm/queries/project.js.map +0 -1
- package/esm/queries/subscription.d.ts +0 -27
- package/esm/queries/subscription.js +0 -90
- package/esm/queries/subscription.js.map +0 -1
- package/lib/CloudChat.js +0 -2661
- package/lib/CoreManager.js +0 -45
- package/lib/Dispatcher.js +0 -125
- package/lib/Network.js +0 -229
- package/lib/Type.js +0 -44
- package/lib/Util.js +0 -32
- package/lib/graphql/channel.js +0 -32
- package/lib/graphql/friend.js +0 -27
- package/lib/graphql/invite.js +0 -18
- package/lib/graphql/member.js +0 -27
- package/lib/graphql/message.js +0 -27
- package/lib/graphql/pin.js +0 -25
- package/lib/graphql/project.js +0 -7
- package/lib/graphql/subscription.js +0 -27
- package/lib/index.js +0 -18
- package/lib/logger.js +0 -33
- package/lib/mutations/channel.js +0 -354
- package/lib/mutations/friend.js +0 -299
- package/lib/mutations/index.js +0 -109
- package/lib/mutations/invite.js +0 -205
- package/lib/mutations/member.js +0 -304
- package/lib/mutations/message.js +0 -300
- package/lib/mutations/pin.js +0 -229
- package/lib/mutations/subscription.js +0 -281
- package/lib/queries/channel.js +0 -239
- package/lib/queries/friend.js +0 -207
- package/lib/queries/index.js +0 -123
- package/lib/queries/member.js +0 -207
- package/lib/queries/memberblocks.js +0 -207
- package/lib/queries/message.js +0 -273
- package/lib/queries/pin.js +0 -243
- package/lib/queries/project.js +0 -7
- package/lib/queries/subscription.js +0 -241
- package/ncloudchat_javascript.md +0 -289
- package/tsconfig.json +0 -32
- package/types/exif.d.ts +0 -10
- package/types/window.d.ts +0 -5
- package//353/260/260/355/217/254/354/210/234/354/204/234.md +0 -8
package/lib/queries/member.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports.getMembers = void 0;
|
|
12
|
-
|
|
13
|
-
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
14
|
-
|
|
15
|
-
var _symbol = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/symbol"));
|
|
16
|
-
|
|
17
|
-
var _iterator = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/symbol/iterator"));
|
|
18
|
-
|
|
19
|
-
var _Network = require("../Network");
|
|
20
|
-
|
|
21
|
-
var _CoreManager = _interopRequireDefault(require("../CoreManager"));
|
|
22
|
-
|
|
23
|
-
var _member = require("../graphql/member");
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Copyright (c) NBASE CORP. and its affiliates.
|
|
27
|
-
*
|
|
28
|
-
* This source code is licensed under the MIT license found in the
|
|
29
|
-
* LICENSE file in the root directory of this source tree.
|
|
30
|
-
*/
|
|
31
|
-
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
32
|
-
function adopt(value) {
|
|
33
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
34
|
-
resolve(value);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return new (P || (P = _promise["default"]))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function rejected(value) {
|
|
48
|
-
try {
|
|
49
|
-
step(generator["throw"](value));
|
|
50
|
-
} catch (e) {
|
|
51
|
-
reject(e);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function step(result) {
|
|
56
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
64
|
-
var _ = {
|
|
65
|
-
label: 0,
|
|
66
|
-
sent: function sent() {
|
|
67
|
-
if (t[0] & 1) throw t[1];
|
|
68
|
-
return t[1];
|
|
69
|
-
},
|
|
70
|
-
trys: [],
|
|
71
|
-
ops: []
|
|
72
|
-
},
|
|
73
|
-
f,
|
|
74
|
-
y,
|
|
75
|
-
t,
|
|
76
|
-
g;
|
|
77
|
-
return g = {
|
|
78
|
-
next: verb(0),
|
|
79
|
-
"throw": verb(1),
|
|
80
|
-
"return": verb(2)
|
|
81
|
-
}, typeof _symbol["default"] === "function" && (g[_iterator["default"]] = function () {
|
|
82
|
-
return this;
|
|
83
|
-
}), g;
|
|
84
|
-
|
|
85
|
-
function verb(n) {
|
|
86
|
-
return function (v) {
|
|
87
|
-
return step([n, v]);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function step(op) {
|
|
92
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
93
|
-
|
|
94
|
-
while (_) {
|
|
95
|
-
try {
|
|
96
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
97
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
98
|
-
|
|
99
|
-
switch (op[0]) {
|
|
100
|
-
case 0:
|
|
101
|
-
case 1:
|
|
102
|
-
t = op;
|
|
103
|
-
break;
|
|
104
|
-
|
|
105
|
-
case 4:
|
|
106
|
-
_.label++;
|
|
107
|
-
return {
|
|
108
|
-
value: op[1],
|
|
109
|
-
done: false
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
case 5:
|
|
113
|
-
_.label++;
|
|
114
|
-
y = op[1];
|
|
115
|
-
op = [0];
|
|
116
|
-
continue;
|
|
117
|
-
|
|
118
|
-
case 7:
|
|
119
|
-
op = _.ops.pop();
|
|
120
|
-
|
|
121
|
-
_.trys.pop();
|
|
122
|
-
|
|
123
|
-
continue;
|
|
124
|
-
|
|
125
|
-
default:
|
|
126
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
127
|
-
_ = 0;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
132
|
-
_.label = op[1];
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
137
|
-
_.label = t[1];
|
|
138
|
-
t = op;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (t && _.label < t[2]) {
|
|
143
|
-
_.label = t[2];
|
|
144
|
-
|
|
145
|
-
_.ops.push(op);
|
|
146
|
-
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (t[2]) _.ops.pop();
|
|
151
|
-
|
|
152
|
-
_.trys.pop();
|
|
153
|
-
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
op = body.call(thisArg, _);
|
|
158
|
-
} catch (e) {
|
|
159
|
-
op = [6, e];
|
|
160
|
-
y = 0;
|
|
161
|
-
} finally {
|
|
162
|
-
f = t = 0;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (op[0] & 5) throw op[1];
|
|
167
|
-
return {
|
|
168
|
-
value: op[0] ? op[1] : void 0,
|
|
169
|
-
done: true
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Get information data of the member.
|
|
176
|
-
*
|
|
177
|
-
* @async
|
|
178
|
-
* @function getMembers
|
|
179
|
-
* @param {string} filter - Field value for filter.
|
|
180
|
-
* @param {string} sort - Field value for sorting.
|
|
181
|
-
* @param {string} option - Optional option: ex) offset, per_page.
|
|
182
|
-
* @returns {Promise<any>}
|
|
183
|
-
*/
|
|
184
|
-
var getMembers = function getMembers(filter, sort, option) {
|
|
185
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
186
|
-
return __generator(this, function (_a) {
|
|
187
|
-
switch (_a.label) {
|
|
188
|
-
case 0:
|
|
189
|
-
return [4
|
|
190
|
-
/*yield*/
|
|
191
|
-
, (0, _Network.fetchData)("membersForQuery", _member.getMembersQuery, {
|
|
192
|
-
projectId: _CoreManager["default"].get("PROJECT_ID"),
|
|
193
|
-
filter: filter,
|
|
194
|
-
sort: sort,
|
|
195
|
-
option: option
|
|
196
|
-
})];
|
|
197
|
-
|
|
198
|
-
case 1:
|
|
199
|
-
return [2
|
|
200
|
-
/*return*/
|
|
201
|
-
, _a.sent()];
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
exports.getMembers = getMembers;
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports.getMemberBlocks = void 0;
|
|
12
|
-
|
|
13
|
-
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
14
|
-
|
|
15
|
-
var _symbol = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/symbol"));
|
|
16
|
-
|
|
17
|
-
var _iterator = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/symbol/iterator"));
|
|
18
|
-
|
|
19
|
-
var _member = require("../graphql/member");
|
|
20
|
-
|
|
21
|
-
var _Network = require("../Network");
|
|
22
|
-
|
|
23
|
-
var _CoreManager = _interopRequireDefault(require("../CoreManager"));
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Copyright (c) NBASE CORP. and its affiliates.
|
|
27
|
-
*
|
|
28
|
-
* This source code is licensed under the MIT license found in the
|
|
29
|
-
* LICENSE file in the root directory of this source tree.
|
|
30
|
-
*/
|
|
31
|
-
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
32
|
-
function adopt(value) {
|
|
33
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
34
|
-
resolve(value);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return new (P || (P = _promise["default"]))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function rejected(value) {
|
|
48
|
-
try {
|
|
49
|
-
step(generator["throw"](value));
|
|
50
|
-
} catch (e) {
|
|
51
|
-
reject(e);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function step(result) {
|
|
56
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
64
|
-
var _ = {
|
|
65
|
-
label: 0,
|
|
66
|
-
sent: function sent() {
|
|
67
|
-
if (t[0] & 1) throw t[1];
|
|
68
|
-
return t[1];
|
|
69
|
-
},
|
|
70
|
-
trys: [],
|
|
71
|
-
ops: []
|
|
72
|
-
},
|
|
73
|
-
f,
|
|
74
|
-
y,
|
|
75
|
-
t,
|
|
76
|
-
g;
|
|
77
|
-
return g = {
|
|
78
|
-
next: verb(0),
|
|
79
|
-
"throw": verb(1),
|
|
80
|
-
"return": verb(2)
|
|
81
|
-
}, typeof _symbol["default"] === "function" && (g[_iterator["default"]] = function () {
|
|
82
|
-
return this;
|
|
83
|
-
}), g;
|
|
84
|
-
|
|
85
|
-
function verb(n) {
|
|
86
|
-
return function (v) {
|
|
87
|
-
return step([n, v]);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function step(op) {
|
|
92
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
93
|
-
|
|
94
|
-
while (_) {
|
|
95
|
-
try {
|
|
96
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
97
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
98
|
-
|
|
99
|
-
switch (op[0]) {
|
|
100
|
-
case 0:
|
|
101
|
-
case 1:
|
|
102
|
-
t = op;
|
|
103
|
-
break;
|
|
104
|
-
|
|
105
|
-
case 4:
|
|
106
|
-
_.label++;
|
|
107
|
-
return {
|
|
108
|
-
value: op[1],
|
|
109
|
-
done: false
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
case 5:
|
|
113
|
-
_.label++;
|
|
114
|
-
y = op[1];
|
|
115
|
-
op = [0];
|
|
116
|
-
continue;
|
|
117
|
-
|
|
118
|
-
case 7:
|
|
119
|
-
op = _.ops.pop();
|
|
120
|
-
|
|
121
|
-
_.trys.pop();
|
|
122
|
-
|
|
123
|
-
continue;
|
|
124
|
-
|
|
125
|
-
default:
|
|
126
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
127
|
-
_ = 0;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
132
|
-
_.label = op[1];
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
137
|
-
_.label = t[1];
|
|
138
|
-
t = op;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (t && _.label < t[2]) {
|
|
143
|
-
_.label = t[2];
|
|
144
|
-
|
|
145
|
-
_.ops.push(op);
|
|
146
|
-
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (t[2]) _.ops.pop();
|
|
151
|
-
|
|
152
|
-
_.trys.pop();
|
|
153
|
-
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
op = body.call(thisArg, _);
|
|
158
|
-
} catch (e) {
|
|
159
|
-
op = [6, e];
|
|
160
|
-
y = 0;
|
|
161
|
-
} finally {
|
|
162
|
-
f = t = 0;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (op[0] & 5) throw op[1];
|
|
167
|
-
return {
|
|
168
|
-
value: op[0] ? op[1] : void 0,
|
|
169
|
-
done: true
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Get member blocks.
|
|
176
|
-
*
|
|
177
|
-
* @async
|
|
178
|
-
* @function getMemberBlocks
|
|
179
|
-
* @param {string} filter - Field value for filter.
|
|
180
|
-
* @param {string} sort - Field value for sorting.
|
|
181
|
-
* @param {string} option - Optional option: ex) offset, per_page.
|
|
182
|
-
* @returns {Promise<any>}
|
|
183
|
-
*/
|
|
184
|
-
var getMemberBlocks = function getMemberBlocks(filter, sort, option) {
|
|
185
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
186
|
-
return __generator(this, function (_a) {
|
|
187
|
-
switch (_a.label) {
|
|
188
|
-
case 0:
|
|
189
|
-
return [4
|
|
190
|
-
/*yield*/
|
|
191
|
-
, (0, _Network.fetchData)("memberblocks", _member.getMemberBlocksQuery, {
|
|
192
|
-
projectId: _CoreManager["default"].get("PROJECT_ID"),
|
|
193
|
-
filter: filter,
|
|
194
|
-
sort: sort,
|
|
195
|
-
option: option
|
|
196
|
-
})];
|
|
197
|
-
|
|
198
|
-
case 1:
|
|
199
|
-
return [2
|
|
200
|
-
/*return*/
|
|
201
|
-
, _a.sent()];
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
exports.getMemberBlocks = getMemberBlocks;
|
package/lib/queries/message.js
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports.unreadCount = exports.getMessages = exports.getMessage = void 0;
|
|
12
|
-
|
|
13
|
-
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
14
|
-
|
|
15
|
-
var _symbol = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/symbol"));
|
|
16
|
-
|
|
17
|
-
var _iterator = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/symbol/iterator"));
|
|
18
|
-
|
|
19
|
-
var _CoreManager = _interopRequireDefault(require("../CoreManager"));
|
|
20
|
-
|
|
21
|
-
var _Network = require("../Network");
|
|
22
|
-
|
|
23
|
-
var _message = require("../graphql/message");
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Copyright (c) NBASE CORP. and its affiliates.
|
|
27
|
-
*
|
|
28
|
-
* This source code is licensed under the MIT license found in the
|
|
29
|
-
* LICENSE file in the root directory of this source tree.
|
|
30
|
-
*/
|
|
31
|
-
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
32
|
-
function adopt(value) {
|
|
33
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
34
|
-
resolve(value);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return new (P || (P = _promise["default"]))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function rejected(value) {
|
|
48
|
-
try {
|
|
49
|
-
step(generator["throw"](value));
|
|
50
|
-
} catch (e) {
|
|
51
|
-
reject(e);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function step(result) {
|
|
56
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
64
|
-
var _ = {
|
|
65
|
-
label: 0,
|
|
66
|
-
sent: function sent() {
|
|
67
|
-
if (t[0] & 1) throw t[1];
|
|
68
|
-
return t[1];
|
|
69
|
-
},
|
|
70
|
-
trys: [],
|
|
71
|
-
ops: []
|
|
72
|
-
},
|
|
73
|
-
f,
|
|
74
|
-
y,
|
|
75
|
-
t,
|
|
76
|
-
g;
|
|
77
|
-
return g = {
|
|
78
|
-
next: verb(0),
|
|
79
|
-
"throw": verb(1),
|
|
80
|
-
"return": verb(2)
|
|
81
|
-
}, typeof _symbol["default"] === "function" && (g[_iterator["default"]] = function () {
|
|
82
|
-
return this;
|
|
83
|
-
}), g;
|
|
84
|
-
|
|
85
|
-
function verb(n) {
|
|
86
|
-
return function (v) {
|
|
87
|
-
return step([n, v]);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function step(op) {
|
|
92
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
93
|
-
|
|
94
|
-
while (_) {
|
|
95
|
-
try {
|
|
96
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
97
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
98
|
-
|
|
99
|
-
switch (op[0]) {
|
|
100
|
-
case 0:
|
|
101
|
-
case 1:
|
|
102
|
-
t = op;
|
|
103
|
-
break;
|
|
104
|
-
|
|
105
|
-
case 4:
|
|
106
|
-
_.label++;
|
|
107
|
-
return {
|
|
108
|
-
value: op[1],
|
|
109
|
-
done: false
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
case 5:
|
|
113
|
-
_.label++;
|
|
114
|
-
y = op[1];
|
|
115
|
-
op = [0];
|
|
116
|
-
continue;
|
|
117
|
-
|
|
118
|
-
case 7:
|
|
119
|
-
op = _.ops.pop();
|
|
120
|
-
|
|
121
|
-
_.trys.pop();
|
|
122
|
-
|
|
123
|
-
continue;
|
|
124
|
-
|
|
125
|
-
default:
|
|
126
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
127
|
-
_ = 0;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
132
|
-
_.label = op[1];
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
137
|
-
_.label = t[1];
|
|
138
|
-
t = op;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (t && _.label < t[2]) {
|
|
143
|
-
_.label = t[2];
|
|
144
|
-
|
|
145
|
-
_.ops.push(op);
|
|
146
|
-
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (t[2]) _.ops.pop();
|
|
151
|
-
|
|
152
|
-
_.trys.pop();
|
|
153
|
-
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
op = body.call(thisArg, _);
|
|
158
|
-
} catch (e) {
|
|
159
|
-
op = [6, e];
|
|
160
|
-
y = 0;
|
|
161
|
-
} finally {
|
|
162
|
-
f = t = 0;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (op[0] & 5) throw op[1];
|
|
167
|
-
return {
|
|
168
|
-
value: op[0] ? op[1] : void 0,
|
|
169
|
-
done: true
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Get data of the all messages.
|
|
176
|
-
*
|
|
177
|
-
* @async
|
|
178
|
-
* @function getMessages
|
|
179
|
-
* @param {string} filter - Field value for filter.
|
|
180
|
-
* @param {string} sort - Field value for sorting.
|
|
181
|
-
* @param {string} option - Optional option: ex) offset, per_page.
|
|
182
|
-
* @returns {Promise<any>}
|
|
183
|
-
*/
|
|
184
|
-
var getMessages = function getMessages(filter, sort, option) {
|
|
185
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
186
|
-
return __generator(this, function (_a) {
|
|
187
|
-
switch (_a.label) {
|
|
188
|
-
case 0:
|
|
189
|
-
return [4
|
|
190
|
-
/*yield*/
|
|
191
|
-
, (0, _Network.fetchData)("messages", _message.getMessagesQuery, {
|
|
192
|
-
projectId: _CoreManager["default"].get("PROJECT_ID"),
|
|
193
|
-
filter: filter,
|
|
194
|
-
sort: sort,
|
|
195
|
-
option: option
|
|
196
|
-
})];
|
|
197
|
-
|
|
198
|
-
case 1:
|
|
199
|
-
return [2
|
|
200
|
-
/*return*/
|
|
201
|
-
, _a.sent()];
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* Get data of a single message.
|
|
208
|
-
*
|
|
209
|
-
* @async
|
|
210
|
-
* @function getMessage
|
|
211
|
-
* @param {string} channelId - The id of a channel.
|
|
212
|
-
* @param {string} messageId - The id of a message.
|
|
213
|
-
* @returns {Promise<any>}
|
|
214
|
-
*/
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
exports.getMessages = getMessages;
|
|
218
|
-
|
|
219
|
-
var getMessage = function getMessage(channelId, messageId) {
|
|
220
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
221
|
-
return __generator(this, function (_a) {
|
|
222
|
-
switch (_a.label) {
|
|
223
|
-
case 0:
|
|
224
|
-
return [4
|
|
225
|
-
/*yield*/
|
|
226
|
-
, (0, _Network.fetchData)("message", _message.getMessageQuery, {
|
|
227
|
-
projectId: _CoreManager["default"].get("PROJECT_ID"),
|
|
228
|
-
channelId: channelId,
|
|
229
|
-
id: messageId
|
|
230
|
-
})];
|
|
231
|
-
|
|
232
|
-
case 1:
|
|
233
|
-
return [2
|
|
234
|
-
/*return*/
|
|
235
|
-
, _a.sent()];
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* Get a count of unread messages of a channel.
|
|
242
|
-
*
|
|
243
|
-
* @async
|
|
244
|
-
* @function unreadCount
|
|
245
|
-
* @param {string} channelId - The id of a channel.
|
|
246
|
-
* @returns {Promise<any>}
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
exports.getMessage = getMessage;
|
|
251
|
-
|
|
252
|
-
var unreadCount = function unreadCount(channelId) {
|
|
253
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
254
|
-
return __generator(this, function (_a) {
|
|
255
|
-
switch (_a.label) {
|
|
256
|
-
case 0:
|
|
257
|
-
return [4
|
|
258
|
-
/*yield*/
|
|
259
|
-
, (0, _Network.fetchData)("mark", _message.unreadCountQuery, {
|
|
260
|
-
projectId: _CoreManager["default"].get("PROJECT_ID"),
|
|
261
|
-
channelId: channelId
|
|
262
|
-
})];
|
|
263
|
-
|
|
264
|
-
case 1:
|
|
265
|
-
return [2
|
|
266
|
-
/*return*/
|
|
267
|
-
, _a.sent()];
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
exports.unreadCount = unreadCount;
|