ncloudchat 1.0.45 → 1.0.47
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/README.md +1 -0
- package/ncloudchat.d.ts +48 -9
- package/ncloudchat.min.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ npm install ncloudchat
|
|
|
35
35
|
yarn add ncloudchat
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
|
|
38
39
|
Ncloud Chat JavaScript SDK Link
|
|
39
40
|
|
|
40
41
|
<a target="_blank" href="https://guide.ncloud-docs.com/docs/bizapp-ncloudchat-javascriptsdk">https://guide.ncloud-docs.com/docs/bizapp-ncloudchat-javascriptsdk</a>
|
package/ncloudchat.d.ts
CHANGED
|
@@ -29,9 +29,13 @@ declare module 'cloudchat/CloudChat' {
|
|
|
29
29
|
* @function initialize
|
|
30
30
|
* @param {string} projectId - The id of a project.
|
|
31
31
|
*/
|
|
32
|
-
initialize(projectId: string): void;
|
|
32
|
+
initialize(projectId: string, region?: string): void;
|
|
33
|
+
getDebug(): any;
|
|
34
|
+
setDebug(debug: boolean): void;
|
|
33
35
|
getLang(): any;
|
|
34
36
|
setLang(lang: string): void;
|
|
37
|
+
getRegion(): any;
|
|
38
|
+
setRegion(region: string): void;
|
|
35
39
|
getUser(): any;
|
|
36
40
|
getProjectId(): any;
|
|
37
41
|
setServerUrl(url: string): void;
|
|
@@ -146,6 +150,16 @@ declare module 'cloudchat/CloudChat' {
|
|
|
146
150
|
* @returns {Promise<any>}
|
|
147
151
|
*/
|
|
148
152
|
sendImage(channelId: string, file: any): Promise<any>;
|
|
153
|
+
/**
|
|
154
|
+
* Send an file to a channel.
|
|
155
|
+
*
|
|
156
|
+
* @async
|
|
157
|
+
* @function sendFile
|
|
158
|
+
* @param {string} channelId - The id of a channel.
|
|
159
|
+
* @param {any} file - An image file.
|
|
160
|
+
* @returns {Promise<any>}
|
|
161
|
+
*/
|
|
162
|
+
sendFile(channelId: string, file: any): Promise<any>;
|
|
149
163
|
/**
|
|
150
164
|
* Update a message.
|
|
151
165
|
*
|
|
@@ -277,11 +291,11 @@ declare module 'cloudchat/CloudChat' {
|
|
|
277
291
|
* Get a count of unread messages of a channel.
|
|
278
292
|
*
|
|
279
293
|
* @async
|
|
280
|
-
* @function
|
|
294
|
+
* @function unreadCount
|
|
281
295
|
* @param {string} channelId - The id of a channel.
|
|
282
296
|
* @returns {Promise<any>}
|
|
283
297
|
*/
|
|
284
|
-
|
|
298
|
+
unreadCount(channelId: string): Promise<any>;
|
|
285
299
|
/**
|
|
286
300
|
* Get subscription data of the user.
|
|
287
301
|
*
|
|
@@ -502,6 +516,24 @@ declare module 'cloudchat/CloudChat' {
|
|
|
502
516
|
* @returns {Promise<any>} The data of the updated pin.
|
|
503
517
|
*/
|
|
504
518
|
sendIntegration(channelId: string, integrationId: string, to: string, message: any): Promise<any>;
|
|
519
|
+
/**
|
|
520
|
+
* set push state
|
|
521
|
+
*
|
|
522
|
+
* @async
|
|
523
|
+
* @function setPushState
|
|
524
|
+
* @param {string} channelId - An id of the channel.
|
|
525
|
+
* @param {string} integrationId - ID of the integration.
|
|
526
|
+
* @param {string} to - To of the integration.
|
|
527
|
+
* @param {string} message - Message of the integration.
|
|
528
|
+
* @returns {Promise<any>} The data of the updated pin.
|
|
529
|
+
*/
|
|
530
|
+
setPushState(push: boolean, ad: boolean, night: boolean): Promise<any>;
|
|
531
|
+
/**
|
|
532
|
+
* 비동기 방식으로 푸시 상태를 가져오는 메서드
|
|
533
|
+
* @returns {Promise<any>} 푸시 상태 정보
|
|
534
|
+
* @throws {Error} 오류가 발생한 경우 예외를 던짐
|
|
535
|
+
*/
|
|
536
|
+
getPushState(): Promise<any>;
|
|
505
537
|
}
|
|
506
538
|
|
|
507
539
|
}
|
|
@@ -668,7 +700,9 @@ declare module 'cloudchat/Util' {
|
|
|
668
700
|
* @returns {string} decoded string.
|
|
669
701
|
*/
|
|
670
702
|
const ObjectId: (id: string) => string;
|
|
671
|
-
|
|
703
|
+
const getOS: () => string;
|
|
704
|
+
const getTimeZone: () => string;
|
|
705
|
+
export { ObjectId, getOS, getTimeZone };
|
|
672
706
|
|
|
673
707
|
}
|
|
674
708
|
declare module 'cloudchat/graphql/channel' {
|
|
@@ -728,12 +762,14 @@ declare module 'cloudchat/graphql/member' {
|
|
|
728
762
|
* This source code is licensed under the MIT license found in the
|
|
729
763
|
* LICENSE file in the root directory of this source tree.
|
|
730
764
|
*/
|
|
765
|
+
export const getMeQuery = "query memberForQuery (\n $projectId: String!\n ) {\n memberForQuery (\n projectId: $projectId\n ) { \n id\n project_id\n name\n profile\n country\n memo\n remoteip\n adid\n device\n network\n push\n version\n model\n logined_at\n created_at\n updated_at\n notifications {\n token\n device\n os\n push\n ad\n night\n }\n }\n }\n";
|
|
731
766
|
export const loginQuery = "mutation login(\n $projectId: String!\n $userId: String!\n $name: String\n $profile: String\n $token: String\n $customField: String\n ) {\n login(\n input: {\n projectId: $projectId\n userId: $userId\n name: $name\n token: $token\n profile: $profile\n customField: $customField\n }\n ) {\n token\n }\n }";
|
|
732
767
|
export const createMemberBlockQuery: string;
|
|
733
|
-
export const updateMemberQuery = "mutation updateMember(\n $id: String!\n $projectId: String!\n $name: String\n $profile: String\n $remoteip: String\n $memo: String\n $adid: String\n $device: String\n $deviceType: [String]\n $network: String\n $version: String\n $model: String\n $
|
|
768
|
+
export const updateMemberQuery = "mutation updateMember(\n $id: String!\n $projectId: String!\n $name: String\n $profile: String\n $remoteip: String\n $memo: String\n $adid: String\n $device: String\n $deviceType: [String]\n $network: String\n $version: String\n $model: String\n $notifications: NotificationInput\n )\n {\n updateMember(input: {id: $id, projectId: $projectId, profile: $profile, memo: $memo, name: $name, remoteip: $remoteip, adid: $adid, device: $device, deviceType: $deviceType, network: $network, version: $version, model: $model, notifications: $notifications}) {\n member {\n id\n project_id\n name\n profile\n country\n memo\n remoteip\n adid\n device\n network\n push\n version\n model\n logined_at\n created_at\n updated_at\n notifications {\n token\n device\n os\n }\n }\n }\n}\n";
|
|
734
769
|
export const deleteMemberBlockQuery: string;
|
|
735
770
|
export const getMembersQuery = "query membersForQuery (\n $projectId: String!, \n $option: String!, \n $filter: String!, \n $sort: String \n ) {\n membersForQuery (\n projectId: $projectId, \n option:$option, \n filter:$filter, \n sort:$sort\n ) {\n totalCount\n edges {\n node {\n id\n name\n }\n }\n }\n }\n";
|
|
736
771
|
export const getMemberBlocksQuery = "query memberblocks (\n $projectId: String!, \n $filter: String!, \n $sort: String, \n $option:String\n ) {\n memberblocks(\n projectId: $projectId, \n filter:$filter, \n sort:$sort, \n option:$option\n ) {\n totalCount\n edges {\n node {\n id\n project_id\n member_id\n type\n status\n block_type\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 }\n }\n }\n }\n";
|
|
772
|
+
export const addNotificationTokenQuery = "mutation addNotificationToken (\n $projectId: String!,\n $token: String,\n $device: String,\n $os: String,\n $ad: Boolean,\n $push: Boolean,\n $night: Boolean,\n $timezone: String,\n $channel: String,\n) {\n addNotificationToken(\n input: {\n projectId: $projectId,\n token: $token,\n device: $device,\n os: $os,\n ad: $ad,\n push: $push,\n night: $night,\n timezone: $timezone,\n channel: $channel\n }\n ) {\n member {\n id\n notifications {\n token\n device\n os\n push\n ad\n night\n timezone\n }\n }\n }\n}\n";
|
|
737
773
|
|
|
738
774
|
}
|
|
739
775
|
declare module 'cloudchat/graphql/message' {
|
|
@@ -805,10 +841,11 @@ declare module 'cloudchat/logger' {
|
|
|
805
841
|
* This source code is licensed under the MIT license found in the
|
|
806
842
|
* LICENSE file in the root directory of this source tree.
|
|
807
843
|
*/
|
|
808
|
-
const debug: (value: any) => void;
|
|
809
|
-
const
|
|
810
|
-
const
|
|
811
|
-
|
|
844
|
+
const debug: (value: any, metadata?: any) => void;
|
|
845
|
+
const info: (value: any, metadata?: any) => void;
|
|
846
|
+
const warn: (value: any, metadata?: any) => void;
|
|
847
|
+
const error: (value: any, metadata?: any) => void;
|
|
848
|
+
export { debug, error, info, warn };
|
|
812
849
|
|
|
813
850
|
}
|
|
814
851
|
declare module 'cloudchat/mutations/channel' {
|
|
@@ -1012,6 +1049,7 @@ declare module 'cloudchat/mutations/member' {
|
|
|
1012
1049
|
*/
|
|
1013
1050
|
export const deleteMemberBlock: (channelId: string, memberId: string) => Promise<any>;
|
|
1014
1051
|
export const updateMember: (user_id: string, update: any) => Promise<any>;
|
|
1052
|
+
export const setPushState: (push: boolean, ad: boolean, night: boolean) => Promise<any>;
|
|
1015
1053
|
|
|
1016
1054
|
}
|
|
1017
1055
|
declare module 'cloudchat/mutations/message' {
|
|
@@ -1217,6 +1255,7 @@ declare module 'cloudchat/queries/member' {
|
|
|
1217
1255
|
* @returns {Promise<any>}
|
|
1218
1256
|
*/
|
|
1219
1257
|
export const getMembers: (filter: string, sort: string, option: string) => Promise<any>;
|
|
1258
|
+
export const getPushState: () => Promise<any>;
|
|
1220
1259
|
|
|
1221
1260
|
}
|
|
1222
1261
|
declare module 'cloudchat/queries/memberblocks' {
|