Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/room anti spam #55

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@juzi/wechaty-grpc",
"version": "1.0.74",
"version": "1.0.75",
"description": "gRPC for Wechaty",
"type": "module",
"exports": {
Expand Down
19 changes: 19 additions & 0 deletions proto/wechaty/puppet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,25 @@ service Puppet {
};
}

rpc GetRoomAntiSpamStrategyList (puppet.GetRoomAntiSpamStrategyListRequest) returns (puppet.GetRoomAntiSpamStrategyListResponse) {
option (google.api.http) = {
get: "/wecom/roomAntiSpamStrategyList"
};
}

rpc GetRoomAntiSpamStrategyEffectRoomList (puppet.GetRoomAntiSpamStrategyEffectRoomListRequest) returns (puppet.GetRoomAntiSpamStrategyEffectRoomListResponse) {
option (google.api.http) = {
get: "/wecom/roomAntiSpamStrategy/{strategy_id}/rooms"
};
}

rpc ApplyRoomAntiSpamStrategy (puppet.ApplyRoomAntiSpamStrategyRequest) returns (puppet.ApplyRoomAntiSpamStrategyResponse) {
option (google.api.http) = {
post: "/wecom/roomAntiSpamStrategy/apply",
body: "*"
};
}

/**
* File/Blob download & upload
*/
Expand Down
27 changes: 27 additions & 0 deletions proto/wechaty/puppet/wecom.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ message ContactExternalUserIdPair {
string external_user_id = 2;
}

message RoomAntiSpamStrategy {
string id = 1;
string name = 2;
}

message GetContactExternalUserIdRequest {
repeated string contact_ids = 1;
string service_provider_id = 2;
Expand All @@ -18,3 +23,25 @@ message GetContactExternalUserIdRequest {
message GetContactExternalUserIdResponse {
repeated ContactExternalUserIdPair contact_external_user_id_pairs = 1;
}

message GetRoomAntiSpamStrategyListRequest {}

message GetRoomAntiSpamStrategyListResponse {
repeated RoomAntiSpamStrategy strategies = 1;
}

message GetRoomAntiSpamStrategyEffectRoomListRequest {
string strategy_id = 1;
}

message GetRoomAntiSpamStrategyEffectRoomListResponse {
repeated string room_ids = 1;
}

message ApplyRoomAntiSpamStrategyRequest {
string strategy_id = 1;
repeated string room_ids = 2;
bool active = 3;
}

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

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

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

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

download: (call) => {
void call
throw new Error('not implemented.')
Expand Down
Loading