Skip to content

Commit

Permalink
build(yarn.lock、package.json):升级依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
BenJChen committed Nov 25, 2022
1 parent f8fa44b commit 9be9246
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 26 deletions.
164 changes: 158 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,152 @@ SDK 兼容主流浏览器(不支持IE)

#### 1.引入SDK

方法一:使用npm包:

```
npm i @addcnos/hongyan-web-sdk
```

方法二:直接引用js:
#### 2.初始化SDK

```js
// 初始化SDK
let im = new IM({wssUrl:_wssUrl,url:_httpUrl}); //wssUrl:websocket服务域名,url:im接口域名
```

#### 3.消息接收监听

```js
//websocket连接成功
im.on('ready',function(){
});

//websocket异常
im.on('error',function(){
});

//websocket消息通知
im.on('message',function(){
});

//连接websocket服务
im.connect({token:_token});
```

## 方法说明

#### 1.发送消息

```js
//发送消息
im.sendMessage({conversationID: _conversationID;type: _type,content:_content;push:_push})
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
| conversationID | String | 聊天目标id |
| type | String | 消息的类型 |
| content | String | 消息的内容 |
| push | Number | 是否进行推送(默认为0,不推送) |

#### 2.获取聊天列表

```js
//获取聊天列表
im.getConversationList({count: _count;page: _page})
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
| count | Number | 查询条数 |
| page | Number | 页数 |


#### 3.获取历史消息

```js
//拉取历史消息
let msgList = im.getMessageList({conversationID:this.targetId});
msgList.next();
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
| conversationID | String | 聊天目标id |


#### 4.发送消息已读

```js
//发送消息已读
im.setMessageRead({conversationID:_conversationID})
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
| conversationID | String | 聊天目标id |


#### 5.获取未读消息数

```js
//获取所有的新消息数
im.getUnreadCount()
```


#### 6.获取会员信息

```js
//获取会员信息
im.getProfile({conversationID:_conversationID})
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
| conversationID | String | 聊天目标id |


#### 7.删除联络人

```js
//删除联络人
im.deleteConversation({conversationID:_conversationID})
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
| conversationID | String | 聊天目标id |


在项目中直接导入 dist/im.js
#### 8.发送图片

```js
//上传图片
im.uploadImage(file)
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
| file | file | 图片文件流 |


## 版本更新说明
#### v1.0.1 版本(最新)

更新日期:2022年8月30日<br>
1.web sdk基础功能<br>

## 数睿鸿雁SDK Web文档
![LICENSE](https://img.shields.io/badge/License-MIT-orange)
![Language](https://img.shields.io/badge/Language-TypeScript-blue.svg)
![Stable](https://img.shields.io/badge/Stable-v1.0.0-brightgreen.svg)

#### SDK概述
鸿雁即时通讯是数睿科技公司旗下的一款专注于为开发者提供实时聊天技术和服务的产品。我们的团队来自数睿科技,致力于为用户提供高效稳定的实时聊天云服务,且弹性可扩展,对外提供较为简洁的API接口,让您轻松实现快速集成即时通讯功能。

#### 环境依赖

SDK 兼容主流浏览器(不支持IE)

## 集成流程

#### 1.引入SDK

```
npm i @addcnos/hongyan-web-sdk
```

#### 2.初始化SDK

Expand Down Expand Up @@ -56,7 +193,7 @@ im.connect({token:_token});

```js
//发送消息
im.sendMessage({conversationID: _conversationID;type: _type;content:_content;push:_push})
im.sendMessage({conversationID: _conversationID;type: _type,content:_content;push:_push})
```
| 参数 | 类型 | 说明 |
| -------- | -----: | :----: |
Expand Down Expand Up @@ -142,12 +279,27 @@ im.uploadImage(file)


## 版本更新说明
#### v1.0.0 版本(最新)
#### v1.0.1 版本(最新)

更新日期:2022年11月25日<br>
1.依赖升级<br>
2.文档修改<br>
#### v1.0.0 版本
更新日期:2022年8月30日<br>
1.web sdk基础功能



## 相关资料

#### [数睿鸿雁后端服务文档](https://github.com/addcnos/Hongyan-Server)
#### [数睿鸿雁SDK-flutter文档](https://github.com/addcnos/Hongyan-Flutter-SDK)
#### [数睿鸿雁SDK-Android文档](https://github.com/addcnos/Hongyan-Android-SDK)
#### [数睿鸿雁SDK-Objective-C文档](https://github.com/addcnos/Hongyan-IOS-SDK)
#### [数睿鸿雁SDK-Web文档](https://github.com/addcnos/Hongyan-Web-SDK)



## 相关资料

#### [数睿鸿雁后端服务文档](https://github.com/addcnos/Hongyan-Server)
Expand Down
2 changes: 1 addition & 1 deletion dist/im.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/im.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@babel/preset-env": "^7.13.15",
"@babel/preset-typescript": "^7.13.0",
"@types/qs": "^6.9.6",
"babel-loader": "^8.0.0",
"babel-loader": "8.2.5",
"webpack": "^5.36.1",
"webpack-cli": "^4.6.0"
},
Expand Down
29 changes: 11 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1258,13 +1258,13 @@ axios@^0.21.1:
dependencies:
follow-redirects "^1.10.0"

babel-loader@^8.0.0:
version "8.2.2"
resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81"
integrity sha512-JvTd0/D889PQBtUXJ2PXaKU/pjZDMtHA9V2ecm+eNRmmBCMR09a+fmpGTNwnJtFmFl5Ei7Vy47LjBb+L0wQ99g==
babel-loader@8.2.5:
version "8.2.5"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.5.tgz#d45f585e654d5a5d90f5350a779d7647c5ed512e"
integrity sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ==
dependencies:
find-cache-dir "^3.3.1"
loader-utils "^1.4.0"
loader-utils "^2.0.0"
make-dir "^3.1.0"
schema-utils "^2.6.5"

Expand Down Expand Up @@ -1738,13 +1738,6 @@ json-schema-traverse@^0.4.1:
resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==

json5@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
dependencies:
minimist "^1.2.0"

json5@^2.1.2:
version "2.2.0"
resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
Expand All @@ -1762,14 +1755,14 @@ loader-runner@^4.2.0:
resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384"
integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==

loader-utils@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==
loader-utils@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c"
integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==
dependencies:
big.js "^5.2.2"
emojis-list "^3.0.0"
json5 "^1.0.1"
json5 "^2.1.2"

locate-path@^5.0.0:
version "5.0.0"
Expand Down Expand Up @@ -1817,7 +1810,7 @@ mimic-fn@^2.1.0:
resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==

minimist@^1.2.0, minimist@^1.2.5:
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
Expand Down

0 comments on commit 9be9246

Please sign in to comment.