mezon-js-protobuf 1.10.72 → 1.10.74
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 +43 -43
- package/dist/api/api.d.ts +25 -0
- package/dist/mezon-js-protobuf-node.cjs.js +1 -1
- package/dist/mezon-js-protobuf-node.esm.mjs +1 -1
- package/dist/mezon-js-protobuf.cjs.js +1 -1
- package/dist/mezon-js-protobuf.esm.mjs +1 -1
- package/dist/mezon-js-protobuf.iife.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web_socket_adapter_pb.d.ts +38 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
Mezon JavaScript Protobuf adapter
|
|
2
|
-
========================
|
|
3
|
-
|
|
4
|
-
> Websocket adapter adding protocol buffer support to the [mezon-js](https://www.npmjs.com/package/mezon-js) client.
|
|
5
|
-
|
|
6
|
-
[Mezon](https://github.com/mezon/mezon) is an open-source server designed to power modern games and apps. Features include user accounts, chat, social, matchmaker, realtime multiplayer, and much [more](https://mezon.vn).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Getting Started
|
|
10
|
-
|
|
11
|
-
1. Import the adapter into your project:
|
|
12
|
-
|
|
13
|
-
```shell
|
|
14
|
-
yarn add "mezon-js-protobuf"
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. Pass the Protobuf adapter to build the socket object.
|
|
18
|
-
|
|
19
|
-
```js
|
|
20
|
-
import {Client} from "mezon-js";
|
|
21
|
-
import {WebSocketAdapter} from "mezon-js-protobuf"
|
|
22
|
-
|
|
23
|
-
const useSSL = false; // Enable if server is run with an SSL certificate.
|
|
24
|
-
const client = new Client("defaultkey", "127.0.0.1", 7350, useSSL);
|
|
25
|
-
|
|
26
|
-
const trace = false;
|
|
27
|
-
const socket = client.createSocket(useSSL, trace, new WebSocketAdapter());
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
3. Use the WebSocket:
|
|
31
|
-
|
|
32
|
-
```js
|
|
33
|
-
socket.ondisconnect = (evt) => {
|
|
34
|
-
console.info("Disconnected", evt);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const session = await socket.connect(session);
|
|
38
|
-
// Socket is open.
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### License
|
|
42
|
-
|
|
43
|
-
This project is licensed under the [Apache-2 License](https://github.com/nccasia/mezon-js/blob/master/LICENSE).
|
|
1
|
+
Mezon JavaScript Protobuf adapter
|
|
2
|
+
========================
|
|
3
|
+
|
|
4
|
+
> Websocket adapter adding protocol buffer support to the [mezon-js](https://www.npmjs.com/package/mezon-js) client.
|
|
5
|
+
|
|
6
|
+
[Mezon](https://github.com/mezon/mezon) is an open-source server designed to power modern games and apps. Features include user accounts, chat, social, matchmaker, realtime multiplayer, and much [more](https://mezon.vn).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
1. Import the adapter into your project:
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
yarn add "mezon-js-protobuf"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Pass the Protobuf adapter to build the socket object.
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import {Client} from "mezon-js";
|
|
21
|
+
import {WebSocketAdapter} from "mezon-js-protobuf"
|
|
22
|
+
|
|
23
|
+
const useSSL = false; // Enable if server is run with an SSL certificate.
|
|
24
|
+
const client = new Client("defaultkey", "127.0.0.1", 7350, useSSL);
|
|
25
|
+
|
|
26
|
+
const trace = false;
|
|
27
|
+
const socket = client.createSocket(useSSL, trace, new WebSocketAdapter());
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. Use the WebSocket:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
socket.ondisconnect = (evt) => {
|
|
34
|
+
console.info("Disconnected", evt);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const session = await socket.connect(session);
|
|
38
|
+
// Socket is open.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### License
|
|
42
|
+
|
|
43
|
+
This project is licensed under the [Apache-2 License](https://github.com/nccasia/mezon-js/blob/master/LICENSE).
|
package/dist/api/api.d.ts
CHANGED
|
@@ -1105,6 +1105,8 @@ export interface UploadAttachmentRequest {
|
|
|
1105
1105
|
width: number;
|
|
1106
1106
|
height: number;
|
|
1107
1107
|
part_count: number;
|
|
1108
|
+
channel_id: string;
|
|
1109
|
+
transcode_hls: boolean;
|
|
1108
1110
|
}
|
|
1109
1111
|
export interface ListMessageMentionRequest {
|
|
1110
1112
|
limit: number;
|
|
@@ -1114,6 +1116,7 @@ export interface ListMessageMentionRequest {
|
|
|
1114
1116
|
export interface UploadAttachment {
|
|
1115
1117
|
filename: string;
|
|
1116
1118
|
url: string;
|
|
1119
|
+
type_cdn: number;
|
|
1117
1120
|
}
|
|
1118
1121
|
export interface MultipartUploadAttachment {
|
|
1119
1122
|
filename: string;
|
|
@@ -2405,6 +2408,12 @@ export interface MentionUser {
|
|
|
2405
2408
|
export interface SearchMentionUsersResponse {
|
|
2406
2409
|
users: MentionUser[];
|
|
2407
2410
|
}
|
|
2411
|
+
export interface GenerateCDNSignatureRequest {
|
|
2412
|
+
channel_id: string;
|
|
2413
|
+
}
|
|
2414
|
+
export interface GenerateCDNSignatureResponse {
|
|
2415
|
+
signature: string;
|
|
2416
|
+
}
|
|
2408
2417
|
export interface NoParams {
|
|
2409
2418
|
}
|
|
2410
2419
|
export declare const Account: {
|
|
@@ -5407,6 +5416,22 @@ export declare const SearchMentionUsersResponse: {
|
|
|
5407
5416
|
create<I extends Exact<DeepPartial<SearchMentionUsersResponse>, I>>(base?: I): SearchMentionUsersResponse;
|
|
5408
5417
|
fromPartial<I extends Exact<DeepPartial<SearchMentionUsersResponse>, I>>(object: I): SearchMentionUsersResponse;
|
|
5409
5418
|
};
|
|
5419
|
+
export declare const GenerateCDNSignatureRequest: {
|
|
5420
|
+
encode(message: GenerateCDNSignatureRequest, writer?: _m0.Writer): _m0.Writer;
|
|
5421
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): GenerateCDNSignatureRequest;
|
|
5422
|
+
fromJSON(object: any): GenerateCDNSignatureRequest;
|
|
5423
|
+
toJSON(message: GenerateCDNSignatureRequest): unknown;
|
|
5424
|
+
create<I extends Exact<DeepPartial<GenerateCDNSignatureRequest>, I>>(base?: I): GenerateCDNSignatureRequest;
|
|
5425
|
+
fromPartial<I extends Exact<DeepPartial<GenerateCDNSignatureRequest>, I>>(object: I): GenerateCDNSignatureRequest;
|
|
5426
|
+
};
|
|
5427
|
+
export declare const GenerateCDNSignatureResponse: {
|
|
5428
|
+
encode(message: GenerateCDNSignatureResponse, writer?: _m0.Writer): _m0.Writer;
|
|
5429
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): GenerateCDNSignatureResponse;
|
|
5430
|
+
fromJSON(object: any): GenerateCDNSignatureResponse;
|
|
5431
|
+
toJSON(message: GenerateCDNSignatureResponse): unknown;
|
|
5432
|
+
create<I extends Exact<DeepPartial<GenerateCDNSignatureResponse>, I>>(base?: I): GenerateCDNSignatureResponse;
|
|
5433
|
+
fromPartial<I extends Exact<DeepPartial<GenerateCDNSignatureResponse>, I>>(object: I): GenerateCDNSignatureResponse;
|
|
5434
|
+
};
|
|
5410
5435
|
export declare const NoParams: {
|
|
5411
5436
|
encode(_: NoParams, writer?: _m0.Writer): _m0.Writer;
|
|
5412
5437
|
decode(input: _m0.Reader | Uint8Array, length?: number): NoParams;
|