Skip to content

Commit

Permalink
Merge branch 'main' into feat-post-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
hcfw007 authored Dec 11, 2023
2 parents c54f7c7 + f1ecd6c commit 7df0670
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
id: go
- name: Install Protoc
uses: arduino/setup-protoc@v1
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Check out code into the Go module directory
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
- name: Install Protoc
uses: arduino/setup-protoc@v1

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: Install Protoc
uses: arduino/setup-protoc@v1
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Install Protoc 3rd party protos
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
id: go
- name: Install Dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
- uses: actions/cache@master
with:
path: ~/.cache/pip
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- uses: actions/cache@master
with:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- uses: actions/cache@master
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wechaty-grpc",
"version": "1.5.3",
"version": "1.5.4",
"description": "gRPC for Wechaty",
"type": "module",
"exports": {
Expand Down
13 changes: 13 additions & 0 deletions proto/wechaty/puppet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import "wechaty/puppet/room-member.proto";
import "wechaty/puppet/room.proto";
import "wechaty/puppet/tag.proto";
import "wechaty/puppet/post.proto";
import "wechaty/puppet/conversation.proto";

option java_package="io.github.wechaty.grpc";
option go_package="github.com/wechaty/go-grpc/wechaty";
Expand Down Expand Up @@ -359,6 +360,18 @@ service Puppet {
};
}

/**
*
* Conversation
*
*/
rpc ConversationRead (puppet.ConversationReadRequest) returns (puppet.ConversationReadResponse) {
option (google.api.http) = {
put: "/conversation/{conversation_id}/read"
body: "*"
};
}

/**
*
* Room
Expand Down
15 changes: 15 additions & 0 deletions proto/wechaty/puppet/conversation.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package wechaty.puppet;

option go_package="github.com/wechaty/go-grpc/wechaty/puppet";
option java_package="io.github.wechaty.grpc.puppet";
option csharp_namespace = "github.wechaty.grpc.puppet";

message ConversationReadRequest {
string conversation_id = 1;
bool has_read = 2;
}

message ConversationReadResponse {
bool has_read = 1;
}
2 changes: 2 additions & 0 deletions proto/wechaty/puppet/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ enum EventType {
EVENT_TYPE_LOGIN = 25;
EVENT_TYPE_LOGOUT = 26;
EVENT_TYPE_DIRTY = 27;

EVENT_TYPE_ROOM_ANNOUNCE = 32;
}

message EventRequest {}
Expand Down
4 changes: 4 additions & 0 deletions proto/wechaty/puppet/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ enum MessageType {
MESSAGE_TYPE_RED_ENVELOPE = 12;
MESSAGE_TYPE_RECALLED = 13;
MESSAGE_TYPE_URL = 14;
MESSAGE_TYPE_GROUP_NOTE = 15;
MESSAGE_TYPE_POST = 16;

MESSAGE_TYPE_SYSTEM = 18;
}

message MessagePayloadRequest {
Expand Down
6 changes: 4 additions & 2 deletions proto/wechaty/puppet/room.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ message RoomPayloadResponse {

message RoomAddRequest {
string id = 1;
string contact_id = 2;
string contact_id = 2 [deprecated = true];
bool invite_only = 3;
repeated string contact_ids = 4;
}
message RoomAddResponse {}

Expand All @@ -49,7 +50,8 @@ message RoomCreateResponse {

message RoomDelRequest {
string id = 1;
string contact_id = 2;
string contact_id = 2 [deprecated = true];
repeated string contact_ids = 3;
}
message RoomDelResponse {}

Expand Down
10 changes: 3 additions & 7 deletions scripts/install-protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ function check_protoc_version () {
majorVer=$(echo $protocVersion | cut -d. -f 1)
minorVer=$(echo $protocVersion | cut -d. -f 2)

(($majorVer == 3)) || {
echo "protoc major version must >= 3 (the installed version is $protocVersion)"
exit 1
}

# https://github.com/wechaty/grpc/issues/109
(($minorVer >= 17)) || {
echo "protoc minor version must >= 17 (the installed version is $protocVersion)"

((($majorVer == 3 && $minorVer >= 17) || $majorVer > 3)) || {
echo "protoc version must >= 3.17 (the installed version is $protocVersion)"
exit 1
}

Expand Down
6 changes: 6 additions & 0 deletions tests/puppet-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,10 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implemented.')
},

conversationRead: (call, callback) => {
void call
void callback
throw new Error('not implemented.')
},

}
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": "@chatie/tsconfig",
"compilerOptions": {
"outDir": "dist/esm",
"verbatimModuleSyntax": false,
// See: https://github.com/wechaty/wechaty/issues/2551
"ignoreDeprecations": "5.0"
},
"exclude": [
"node_modules/",
Expand Down

0 comments on commit 7df0670

Please sign in to comment.