ncloudchat 0.0.19-beta

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.
Files changed (104) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +69 -0
  3. package/esm/CloudChat.d.ts +38 -0
  4. package/esm/CloudChat.js +592 -0
  5. package/esm/CloudChat.js.map +1 -0
  6. package/esm/CoreManager.d.ts +5 -0
  7. package/esm/CoreManager.js +27 -0
  8. package/esm/CoreManager.js.map +1 -0
  9. package/esm/Dispatcher.d.ts +21 -0
  10. package/esm/Dispatcher.js +78 -0
  11. package/esm/Dispatcher.js.map +1 -0
  12. package/esm/Type.d.ts +35 -0
  13. package/esm/Type.js +12 -0
  14. package/esm/Type.js.map +1 -0
  15. package/esm/index.d.ts +2 -0
  16. package/esm/index.js +3 -0
  17. package/esm/index.js.map +1 -0
  18. package/esm/logger.d.ts +4 -0
  19. package/esm/logger.js +11 -0
  20. package/esm/logger.js.map +1 -0
  21. package/esm/mutations/channel.d.ts +4 -0
  22. package/esm/mutations/channel.js +162 -0
  23. package/esm/mutations/channel.js.map +1 -0
  24. package/esm/mutations/friend.d.ts +5 -0
  25. package/esm/mutations/friend.js +146 -0
  26. package/esm/mutations/friend.js.map +1 -0
  27. package/esm/mutations/index.d.ts +14 -0
  28. package/esm/mutations/index.js +15 -0
  29. package/esm/mutations/index.js.map +1 -0
  30. package/esm/mutations/invite.d.ts +1 -0
  31. package/esm/mutations/invite.js +71 -0
  32. package/esm/mutations/invite.js.map +1 -0
  33. package/esm/mutations/memberinvitation.d.ts +2 -0
  34. package/esm/mutations/memberinvitation.js +103 -0
  35. package/esm/mutations/memberinvitation.js.map +1 -0
  36. package/esm/mutations/memberreport.d.ts +10 -0
  37. package/esm/mutations/memberreport.js +110 -0
  38. package/esm/mutations/memberreport.js.map +1 -0
  39. package/esm/mutations/message.d.ts +2 -0
  40. package/esm/mutations/message.js +97 -0
  41. package/esm/mutations/message.js.map +1 -0
  42. package/esm/mutations/messageread.d.ts +1 -0
  43. package/esm/mutations/messageread.js +69 -0
  44. package/esm/mutations/messageread.js.map +1 -0
  45. package/esm/mutations/subscription.d.ts +4 -0
  46. package/esm/mutations/subscription.js +139 -0
  47. package/esm/mutations/subscription.js.map +1 -0
  48. package/esm/mutations/user.d.ts +1 -0
  49. package/esm/mutations/user.js +74 -0
  50. package/esm/mutations/user.js.map +1 -0
  51. package/esm/queries/channel.d.ts +2 -0
  52. package/esm/queries/channel.js +119 -0
  53. package/esm/queries/channel.js.map +1 -0
  54. package/esm/queries/friend.d.ts +1 -0
  55. package/esm/queries/friend.js +80 -0
  56. package/esm/queries/friend.js.map +1 -0
  57. package/esm/queries/index.d.ts +7 -0
  58. package/esm/queries/index.js +8 -0
  59. package/esm/queries/index.js.map +1 -0
  60. package/esm/queries/memberinvitation.d.ts +2 -0
  61. package/esm/queries/memberinvitation.js +110 -0
  62. package/esm/queries/memberinvitation.js.map +1 -0
  63. package/esm/queries/message.d.ts +2 -0
  64. package/esm/queries/message.js +117 -0
  65. package/esm/queries/message.js.map +1 -0
  66. package/esm/queries/messageread.d.ts +1 -0
  67. package/esm/queries/messageread.js +74 -0
  68. package/esm/queries/messageread.js.map +1 -0
  69. package/esm/queries/project.d.ts +1 -0
  70. package/esm/queries/project.js +74 -0
  71. package/esm/queries/project.js.map +1 -0
  72. package/esm/queries/subscription.d.ts +2 -0
  73. package/esm/queries/subscription.js +112 -0
  74. package/esm/queries/subscription.js.map +1 -0
  75. package/lib/CloudChat.js +1032 -0
  76. package/lib/CoreManager.js +35 -0
  77. package/lib/Dispatcher.js +109 -0
  78. package/lib/Type.js +25 -0
  79. package/lib/index.js +18 -0
  80. package/lib/logger.js +27 -0
  81. package/lib/mutations/channel.js +324 -0
  82. package/lib/mutations/friend.js +319 -0
  83. package/lib/mutations/index.js +128 -0
  84. package/lib/mutations/invite.js +208 -0
  85. package/lib/mutations/memberinvitation.js +271 -0
  86. package/lib/mutations/memberreport.js +272 -0
  87. package/lib/mutations/message.js +246 -0
  88. package/lib/mutations/messageread.js +215 -0
  89. package/lib/mutations/subscription.js +299 -0
  90. package/lib/mutations/user.js +207 -0
  91. package/lib/queries/channel.js +274 -0
  92. package/lib/queries/friend.js +220 -0
  93. package/lib/queries/index.js +102 -0
  94. package/lib/queries/memberinvitation.js +273 -0
  95. package/lib/queries/message.js +267 -0
  96. package/lib/queries/messageread.js +219 -0
  97. package/lib/queries/project.js +217 -0
  98. package/lib/queries/subscription.js +264 -0
  99. package/ncloudchat_javascript.md +290 -0
  100. package/package copy.json +74 -0
  101. package/package.json +76 -0
  102. package/tsconfig.json +31 -0
  103. package/types/exif.d.ts +10 -0
  104. package/types/window.d.ts +5 -0
@@ -0,0 +1,290 @@
1
+ ---
2
+ search:
3
+ keyword: ["ncloudchat"]
4
+ ---
5
+
6
+ # NCLOUD Chat Javascript SDK
7
+
8
+ ## Authentification
9
+
10
+ ### 1. 대시보드에서 설정에서 프로젝트ID 를 확인 합니다.
11
+ [ncloudchat.min.js](https://kr.object.ncloudstorage.com/ncloudchat/ncloudchat.min.js) 을 다운로드 합니다.
12
+
13
+ <script src="ncloudchat.min.js"></script>
14
+
15
+ 를 <head> </head> 사이에 추가 합니다.
16
+
17
+ 엔클라우드챗을 사용하기전에 인스턴스를 초기화 해야 합니다. 대시보드에서 확인한 프로젝트ID 를 추가해 주세요.
18
+
19
+ ```javascript
20
+ const chat = new ncloudchat.Chat();
21
+ chat.initialize(projectId);
22
+ ```
23
+
24
+ ### 2. Connect to NCloud Chat Server
25
+
26
+ - 초기화가 완료되면 사용자명, 이름, 프로필 이미지주소(옵션) 을 입력 후에 접속해야 합니다.
27
+
28
+ ```javascript
29
+ chat.setUser({
30
+ id: USERNAME,
31
+ name: NAME,
32
+ profile: PROFILE_URL
33
+ });
34
+ const user = await chat.connect(user_id);
35
+ ```
36
+
37
+ | ID | type | desc |
38
+ | :--------- | :----- | :---------- |
39
+ | USERNAME | string | 아이디 |
40
+ | NAME | string | 이름 |
41
+ | PROFILE_URL | string | 프로필 주소 |
42
+
43
+
44
+
45
+ ### 3. Disconnect from NCloud Chat Server
46
+
47
+ - 사용자의 연결을 끊을려면 disconnect() 함수를 호출하면 됩니다
48
+
49
+ ```javascript
50
+ await chat.disconnect();
51
+ ```
52
+
53
+ ## Communication
54
+
55
+ ### 1. Subscribe / Unsubscribe
56
+
57
+ - 원하는 채널에 가입(방 참여) 합니다. 참여된 채널에는 unsubscribe 할때까지 재접속시에도 자동으로 참여됩니다.
58
+
59
+ ```javascript
60
+ chat.subscribe(CHANNEL_ID);
61
+ ```
62
+
63
+ - 해당 채널에 대한 가입을 해지 합니다. 해당 채널에 메시지를 더 이상 받을 수 없습니다.
64
+ ```javascript
65
+ chat.unsubscribe(CHANNEL_ID);
66
+ ```
67
+
68
+ | ID | type | desc |
69
+ | :--------- | :----- | :---------- |
70
+ | CHANNEL_ID | string | 채널 아이디 |
71
+
72
+
73
+ ### 2. SendMessage
74
+
75
+ - 특정 채널로 간단한 메시지 보내는 방법을 보여줍니다.
76
+
77
+ ```javascript
78
+ await chat.sendMessage(CHANNEL_ID, {
79
+ type: "text",
80
+ message: MESSAGE
81
+ });
82
+ ```
83
+
84
+ | ID | type | desc |
85
+ | :--------- | :----- | :----------------- |
86
+ | CHANNEL_ID | string | 채널 아이디 |
87
+ | type | string | 보내는 메시지 종류 |
88
+ | MESSAGE | string | 전송 메시지 텍스트 |
89
+
90
+ ### 2. SendImage
91
+
92
+ - 특정 채널로 이미지 파일을 전송할 수 있습니다.
93
+ ```html
94
+ <input type="file" id="uploadfile" name="file" onChange={fileUpload} />
95
+ ```
96
+
97
+ ```javascript
98
+ await chat.sendImage(CHANNEL_ID,file);
99
+ ```
100
+
101
+ | ID | type | desc |
102
+ | :--------- | :----- | :----------------- |
103
+ | CHANNEL_ID | string | 채널 아이디 |
104
+ | file | string | 보내는 메시지 종류 |
105
+
106
+ ## Event
107
+
108
+ ### Binding Event
109
+
110
+ - 다양한 수신하는 이벤트에 대해, 이벤트 핸들러를 등록/해제 할 수 있습니다,
111
+
112
+ ```javascript
113
+ // 메시지 수신
114
+ chat.bind('onMessageReceived',function(channel, message) {
115
+ });
116
+ // 오류 메시지
117
+ chat.bind('onErrorReceived',function(error) {
118
+ });
119
+ // 접속 성공
120
+ chat.bind('onConnected',function(socket) {
121
+ });
122
+ // 접속 종료
123
+ chat.bind('onDisconnected',function(reason) {
124
+ });
125
+ ```
126
+
127
+ ## Client API
128
+
129
+ ### 1-1. Subscription
130
+
131
+ - Subscription Data Class
132
+
133
+ | ID | type | desc |
134
+ | :--------- | :----- | :------------ |
135
+ | id | string | 유니크 아이디 |
136
+ | channel_id | string | 채널 아이디 |
137
+ | user_id | string | 유저 고유 아이디 |
138
+ | created_at | string | 생성 일자 |
139
+ | online | boolean | 온라인 여부 |
140
+ | push | boolean | 푸시 참여 여부 |
141
+ | language | string | 접속 언어 |
142
+ | mark.user_id | string | 마지막 메시지 보낸 사용자 |
143
+ | mark.message_id | string | 마지막 메시지 아이디 |
144
+ | mark.sort_id | string | 마지막 메시지 정렬ID |
145
+
146
+ ### 1-2. getSubscriptions
147
+
148
+ - (특정 채널에 대해) 참여자 리스트를 가져올 수 있습니다.
149
+
150
+ ```javascript
151
+ const filter = {channel_id:channelId};
152
+ const sort = {created_at:-1};
153
+ const option = { offset:0, limit:100};
154
+ const subscriptions = await chat.getSubscriptions(filter, sort, option);
155
+ console.log(subscriptions);
156
+ ```
157
+
158
+ ### 2-1. Channel
159
+
160
+ - Channel Data Class
161
+
162
+ | ID | type | desc |
163
+ | :--------- | :----- | :--------------------------- |
164
+ | id | string | 채널 아이디(unique) |
165
+ | project_id | string | 프로젝트 아이디 |
166
+ | unique_id | string | 개발사에서 설정 가능한 채널 아이디 (unique) |
167
+ | name | string | 채널 이름 |
168
+ | user_id | string | (채널 생성한) 유저 아이디 |
169
+ | unique_id | string | 채널 고유ID |
170
+ | default_lang | string | 기본 언어 |
171
+ | lang | string | 현재 접속중인 이용자의 언어 |
172
+ | members | string | Private 일 경우 참여된 사용자 목록 |
173
+ | push | boolean | 푸시 메시지 지원 여부 (Private 채널 일 경우)
174
+ | state | boolean | 채널 상태 |
175
+ | created_at | string | 생성 일자 |
176
+ | updated_at | string | 갱신 일자 |
177
+
178
+
179
+ ### 2-2. getChannels
180
+
181
+ - (프로젝트 내) 전체 채널 리스트를 가져올 수 있습니다.
182
+
183
+ ```javascript
184
+ const filter = {state:true};
185
+ const sort = {created_at:-1};
186
+ const option = { offset:0, limit:100};
187
+ const channels = await chat.getChannels(filter,sort,option);
188
+ console.log(channels);
189
+ ```
190
+
191
+ | ID | type | desc |
192
+ | :--------- | :----- | :--------------------------- |
193
+ | FILTER | string | 사용자가 사용할 필터 입니다. 모든 필드에 대해서 쿼리를 하실 수 있습니다. |
194
+ | SORT | string | 정렬을 할 수 있습니다. (ascending (1) or descending (-1)) |
195
+ | OPTION | string | 페이징 및 선택 옵션들 추가할 수 있습니다. |
196
+
197
+ ### 2-3. getChannel
198
+
199
+ - 개별 채널에 대한 정보를 가져올 수 있습니다.
200
+
201
+ ```javascript
202
+ const channel = await chat.getChannel(id);
203
+ ```
204
+
205
+ ### 2-4. createChannel
206
+
207
+ - 신규 채널을 생성합니다.
208
+
209
+ ```javascript
210
+ const channel = await chat.createChannel({type:"PUBLIC",name:"CHANNEL NAME"});
211
+ ```
212
+
213
+ ### 2-5. deleteChannel
214
+
215
+ - 해당 채널을 삭제합니다. ( 한 개부터 여러개 삭제가 가능합니다.)
216
+
217
+ ```javascript
218
+ const channel = await chat.deleteChannel([CHANNEL_ID, CHANNEL_ID, CHANNEL_ID]);
219
+ ```
220
+
221
+ ### 2-6. updateChannel
222
+ - 채널 정보를 업데이트 합니다.
223
+
224
+ ```javascript
225
+ const channel = await chat.updateChannel({id: CHANNEL_ID, type:"PUBLIC",name:"CHANNEL NAME"});
226
+ ```
227
+
228
+ ### 3-1. Message
229
+
230
+ - Message Data Class
231
+
232
+ | ID | type | desc |
233
+ | :--------- | :----- | :--------------------------- |
234
+ | id | string | 아이디(unique) |
235
+ | message_id | string | 메시지 아이디 |
236
+ | sort_id | string | 메시지 정렬을 위한 ID |
237
+ | message_type | string | 메시지 종류 |
238
+ | sender.id | string | 보낸 사람 ID |
239
+ | sender.name | string | 보낸 사람 이름 |
240
+ | sender.profile | string | 보낸 사람 프로필 이미지 |
241
+ | metions | string | 맨션된 리스트 |
242
+ | metions_everyone | string | 전체 맨션 여부 |
243
+ | content | string | 메시지
244
+ | created_at | string | 생성 일자 |
245
+ | sended_at | string | 보낸 일자 |
246
+ ### 2-3. getChannel
247
+
248
+ - 개별 메시지에 대한 정보를 가져올 수 있습니다.
249
+
250
+ ```javascript
251
+ const channel = await chat.getMessage(message_id);
252
+ ```
253
+
254
+ ### 3-1. getMessages
255
+
256
+ - (특정 채널에 대해) Message 데이터를 리스트 형태로 가져올 수 있습니다.
257
+
258
+ ```javascript
259
+ const filter = {channel_id: CHANNEL_ID};
260
+ const sort = {created_at:-1};
261
+ const option = { offset:0, limit:100};
262
+ const messages = await chat.getMessages(filter, sort, option);
263
+ console.log(messages);
264
+ ```
265
+
266
+ | ID | type | desc |
267
+ | :--------- | :----- | :--------------------------- |
268
+ | FILTER | string | 사용자가 사용할 필터 입니다. 모든 필드에 대해서 쿼리를 하실 수 있습니다. |
269
+ | SORT | string | created_at: -1 or created_at:1 옵션만 사용가능 합니다. |
270
+ | OPTION | string | 페이징 및 선택 옵션들 추가할 수 있습니다. |
271
+
272
+ ### 3-3. translateMessage
273
+
274
+ - (자동번역 기능이 활성화 되어 있을 경우) 임의의 텍스트를 (지정한 언어로) 번역할 수 있습니다.
275
+
276
+ > 해당 기능은, NaverCloud PAPAGO NMT 상품을 함께 연동할 경우 사용 가능합니다. [[ NCP Papago NMT ]](https://www.ncloud.com/product/aiService/papagoNmt)
277
+
278
+ - (Received) Translation Data Class
279
+
280
+ ```javascript
281
+ const message = await chat.translateMessage(CHANNEL_ID, { source_lang: SORCE_LANG, target_lang: TARTGET_LANG, message: MESSAGE, direct: DIRECT });
282
+ ```
283
+
284
+ | ID | type | desc |
285
+ | :--------- | :----- | :--------------------------- |
286
+ | SORCE_LANG | string | 원본 언어(source language)의 언어 코드 |
287
+ | TARTGET_LANG | string | 목적 언어(target language)의 언어 코드 |
288
+ | MESSAGE | string | 번역할 텍스트. 1회 호출 시 최대 5,000자까지 번역할 수 있습니다.|
289
+ | DIRECT | boolean | 번역된 메시지를 즉시 발송 합니다. (option) |
290
+
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "ncloudchat",
3
+ "jsName": "ncloudchat",
4
+ "version": "1.0.0",
5
+ "private": false,
6
+ "description": "",
7
+ "keywords": [
8
+ "cloudchat",
9
+ "ncloudchat",
10
+ "navercloud",
11
+ "navercloud chat",
12
+ "ncloud",
13
+ "chat"
14
+ ],
15
+ "homepage": "https://www.ncloud.com/product/ncloudchat",
16
+ "main": "lib/index.js",
17
+ "types": "esm/index.d.ts",
18
+ "module": "esm/index.js",
19
+ "scripts": {
20
+ "clean": "del \"./(lib|dist|esm)\"",
21
+ "test": "jest --coverage",
22
+ "build": "npm run clean && tsc && babel esm --out-dir lib && webpack --optimize-minimize --config webpack.prod.js",
23
+ "start": "npm run lint && webpack-dev-server --open --config webpack.dev.js",
24
+ "lint": "tsc --noEmit && eslint --ext .ts",
25
+ "server": "node test/server.js",
26
+ "publish-dev": "aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat.min.js s3://ncloudchat/dev/ --acl public-read"
27
+ },
28
+ "repository": {
29
+ "type": "git"
30
+ },
31
+ "author": "NAVER Cloud",
32
+ "devDependencies": {
33
+ "@babel/cli": "^7.10.1",
34
+ "@babel/core": "^7.10.2",
35
+ "@babel/plugin-proposal-object-rest-spread": "^7.10.1",
36
+ "@babel/plugin-transform-runtime": "^7.10.1",
37
+ "@babel/preset-env": "^7.10.2",
38
+ "@qiniu/eslint-config": "0.0.4",
39
+ "@types/jest": "^25.2.3",
40
+ "@types/node": "^13.1.4",
41
+ "@types/spark-md5": "^3.0.2",
42
+ "@typescript-eslint/eslint-plugin": "^2.34.0",
43
+ "@typescript-eslint/parser": "^2.14.0",
44
+ "babel-loader": "^8.1.0",
45
+ "babel-plugin-syntax-flow": "^6.18.0",
46
+ "body-parser": "^1.18.2",
47
+ "connect-multiparty": "^2.1.0",
48
+ "del-cli": "^3.0.1",
49
+ "eslint": "^6.8.0",
50
+ "eslint-plugin-import": "^2.20.2",
51
+ "express": "^4.16.2",
52
+ "jest": "^26.0.1",
53
+ "multiparty": "^4.1.3",
54
+ "qiniu": "^7.3.1",
55
+ "request": "^2.88.1",
56
+ "terser-webpack-plugin": "^3.0.6",
57
+ "ts-loader": "^6.2.1",
58
+ "typedoc": "^0.17.7",
59
+ "typescript": "^3.9.5",
60
+ "uglifyjs-webpack-plugin": "^2.2.0",
61
+ "webpack": "^4.41.5",
62
+ "webpack-cli": "^3.3.11",
63
+ "webpack-dev-server": "^3.11.0",
64
+ "webpack-merge": "^4.2.2"
65
+ },
66
+ "license": "MIT",
67
+ "dependencies": {
68
+ "@babel/runtime-corejs2": "^7.10.2",
69
+ "@types/graphql": "^14.5.0",
70
+ "exif-js": "^2.3.0",
71
+ "socket.io-client": "^4.4.0",
72
+ "spark-md5": "^3.0.0"
73
+ }
74
+ }
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "ncloudchat",
3
+ "jsName": "ncloudchat",
4
+ "version": "0.0.19-beta",
5
+ "private": false,
6
+ "description": "",
7
+ "keywords": [
8
+ "cloudchat",
9
+ "ncloudchat",
10
+ "navercloud",
11
+ "ncloud",
12
+ "chat"
13
+ ],
14
+ "homepage": "https://www.ncloud.com/product/ncloudchat",
15
+ "main": "lib/index.js",
16
+ "types": "esm/index.d.ts",
17
+ "module": "esm/index.js",
18
+ "scripts": {
19
+ "clean": "del \"./(lib|dist|esm)\"",
20
+ "test": "jest --coverage",
21
+ "build": "npm run clean && tsc && babel esm --out-dir lib && webpack --optimize-minimize --config webpack.prod.js",
22
+ "start": "npm run lint && webpack-dev-server --open --config webpack.dev.js",
23
+ "lint": "tsc --noEmit && eslint --ext .ts",
24
+ "server": "node test/server.js",
25
+ "publish-dev": "aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp dist/ncloudchat.min.js s3://ncloudchat/dev/ --acl public-read"
26
+ },
27
+ "repository": {
28
+ "type": "git"
29
+ },
30
+ "author": "NAVER Cloud",
31
+ "devDependencies": {
32
+ "@babel/cli": "^7.10.1",
33
+ "@babel/core": "^7.10.2",
34
+ "@babel/plugin-proposal-object-rest-spread": "^7.10.1",
35
+ "@babel/plugin-transform-runtime": "^7.10.1",
36
+ "@babel/preset-env": "^7.10.2",
37
+ "@qiniu/eslint-config": "0.0.4",
38
+ "@types/jest": "^25.2.3",
39
+ "@types/node": "^13.1.4",
40
+ "@types/spark-md5": "^3.0.2",
41
+ "@typescript-eslint/eslint-plugin": "^2.34.0",
42
+ "@typescript-eslint/parser": "^2.14.0",
43
+ "babel-loader": "^8.1.0",
44
+ "babel-plugin-syntax-flow": "^6.18.0",
45
+ "body-parser": "^1.18.2",
46
+ "connect-multiparty": "^2.1.0",
47
+ "del-cli": "^3.0.1",
48
+ "eslint": "^6.8.0",
49
+ "eslint-plugin-import": "^2.20.2",
50
+ "express": "^4.16.2",
51
+ "jest": "^26.0.1",
52
+ "multiparty": "^4.1.3",
53
+ "qiniu": "^7.3.1",
54
+ "request": "^2.88.1",
55
+ "terser-webpack-plugin": "^3.0.6",
56
+ "ts-loader": "^6.2.1",
57
+ "typedoc": "^0.17.7",
58
+ "typescript": "^3.9.5",
59
+ "uglifyjs-webpack-plugin": "^2.2.0",
60
+ "webpack": "^4.41.5",
61
+ "webpack-cli": "^3.3.11",
62
+ "webpack-dev-server": "^3.11.0",
63
+ "webpack-merge": "^4.2.2"
64
+ },
65
+ "license": "MIT",
66
+ "dependencies": {
67
+ "@babel/runtime-corejs2": "^7.10.2",
68
+ "@types/graphql": "^14.5.0",
69
+ "exif-js": "^2.3.0",
70
+ "fs": "0.0.1-security",
71
+ "ip": "^1.1.5",
72
+ "socket.io-client": "^4.4.0",
73
+ "spark-md5": "^3.0.0",
74
+ "winston": "^3.7.1"
75
+ }
76
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "compileOnSave": true,
3
+ "compilerOptions": {
4
+ "outDir": "./esm",
5
+ "module": "es6",
6
+ "lib": ["dom", "es2015", "es2016", "es2017"],
7
+ "moduleResolution": "node",
8
+ "allowJs": false,
9
+ "declaration": true,
10
+ "downlevelIteration": true,
11
+ "strict": true,
12
+ "strictNullChecks": true,
13
+ "sourceMap": true,
14
+ "strictPropertyInitialization": false,
15
+ "noImplicitThis": true,
16
+ "baseUrl": "./src",
17
+ "esModuleInterop": true,
18
+ "suppressImplicitAnyIndexErrors": true,
19
+ "typeRoots": [
20
+ "./types",
21
+ "./node_modules/@types"
22
+ ]
23
+ },
24
+ "exclude": [
25
+ "node_modules",
26
+ "coverage",
27
+ "test",
28
+ "dist",
29
+ "lib"
30
+ ]
31
+ }
@@ -0,0 +1,10 @@
1
+ // 原类型有问题,这里覆盖下
2
+ declare module 'exif-js' {
3
+ interface EXIFStatic {
4
+ getData(img: HTMLImageElement, callback: () => void): void
5
+ getTag(img: HTMLImageElement, tag: string): number
6
+ }
7
+
8
+ const EXIF: EXIFStatic
9
+ export { EXIF }
10
+ }
@@ -0,0 +1,5 @@
1
+ interface Window {
2
+ webkitURL?: typeof URL
3
+ mozURL?: typeof URL
4
+ ActiveXObject?: any
5
+ }