Skip to content

Commit

Permalink
Merge pull request #54 from juzibot/feat/wecom
Browse files Browse the repository at this point in the history
Feat/wecom
  • Loading branch information
hcfw007 authored Dec 6, 2023
2 parents 8ed18a2 + f9d7090 commit 34fe692
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions commonjs/generated/puppet.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const puppetFileList = [
'../../out/wechaty/puppet/verify-code_pb.js',
'../../out/wechaty/puppet/call_pb.js',
'../../out/wechaty/puppet/chat-history_pb.js',
'../../out/wechaty/puppet/wecom_pb.js',

'../../out/wechaty/puppet_grpc_pb.js',
'../../out/wechaty/puppet_pb.js',
Expand Down
1 change: 1 addition & 0 deletions commonjs/generated/puppet.cjs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export * from '../../out/wechaty/puppet/util_pb.js'
export * from '../../out/wechaty/puppet/verify-code_pb.js'
export * from '../../out/wechaty/puppet/call_pb.js'
export * from '../../out/wechaty/puppet/chat-history_pb.js'
export * from '../../out/wechaty/puppet/wecom_pb.js'

export * from '../../out/wechaty/puppet_grpc_pb.js'
export * from '../../out/wechaty/puppet_pb.js'
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.71",
"version": "1.0.72",
"description": "gRPC for Wechaty",
"type": "module",
"exports": {
Expand Down
11 changes: 11 additions & 0 deletions proto/wechaty/puppet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import "wechaty/puppet/conversation.proto";
import "wechaty/puppet/post.proto";
import "wechaty/puppet/moment.proto";
import "wechaty/puppet/verify-code.proto";
import "wechaty/puppet/wecom.proto";

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

/**
* Wecom
*/

rpc GetContactExternalUserId (puppet.GetContactExternalUserIdRequest) returns (puppet.GetContactExternalUserIdResponse) {
option (google.api.http) = {
post: "/contact/externalUserId"
body: "*"
};
}

/**
* File/Blob download & upload
Expand Down
20 changes: 20 additions & 0 deletions proto/wechaty/puppet/wecom.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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 ContactExternalUserIdPair {
string contact_id = 1;
string external_user_id = 2;
}

message GetContactExternalUserIdRequest {
repeated string contact_ids = 1;
string service_provider_id = 2;
}

message GetContactExternalUserIdResponse {
repeated ContactExternalUserIdPair contact_external_user_id_paris = 1;
}
6 changes: 6 additions & 0 deletions tests/puppet-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,12 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implemented.')
},

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

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

0 comments on commit 34fe692

Please sign in to comment.