x
This commit is contained in:
@@ -34,3 +34,5 @@ test
|
|||||||
test*
|
test*
|
||||||
node_modules
|
node_modules
|
||||||
plugins
|
plugins
|
||||||
|
bin
|
||||||
|
language
|
||||||
+27
-12
@@ -53,6 +53,7 @@ type Factory struct {
|
|||||||
msgChan chan MsgChan
|
msgChan chan MsgChan
|
||||||
demo *CustomSender
|
demo *CustomSender
|
||||||
reply func(map[string]interface{}) string
|
reply func(map[string]interface{}) string
|
||||||
|
action func(map[string]interface{}) string
|
||||||
lm chan bool
|
lm chan bool
|
||||||
nm int64
|
nm int64
|
||||||
isAdmin func(string) bool
|
isAdmin func(string) bool
|
||||||
@@ -354,6 +355,23 @@ func (f *Factory) SetReplyHandler(function func(map[string]interface{}) string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *Factory) SetActionHandler(function func(map[string]interface{}) string) {
|
||||||
|
f.action = func(m map[string]interface{}) string {
|
||||||
|
if f.uuid != "" {
|
||||||
|
mutex := GetMutex(f.uuid)
|
||||||
|
mutex.Lock()
|
||||||
|
defer mutex.Unlock()
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
err := recover()
|
||||||
|
if err != nil {
|
||||||
|
pluginConsole(f.uuid).Error("Sender(\""+f.botplt+"\").SetAction error:", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return function(m)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// func (f *Factory) GetReplies() {
|
// func (f *Factory) GetReplies() {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
@@ -535,7 +553,7 @@ func (f *Factory) SetIsAdmin(function func(string) bool) {
|
|||||||
func (f *Factory) Sender2(options map[string]string) *CustomSender {
|
func (f *Factory) Sender2(options map[string]string) *CustomSender {
|
||||||
var demo = *f.demo
|
var demo = *f.demo
|
||||||
sender := &demo
|
sender := &demo
|
||||||
sender.SetID()
|
// sender.SetID()
|
||||||
if options != nil {
|
if options != nil {
|
||||||
fsp := &common.FakerSenderParams{}
|
fsp := &common.FakerSenderParams{}
|
||||||
if v, ok := options[CONETNT]; ok {
|
if v, ok := options[CONETNT]; ok {
|
||||||
@@ -570,8 +588,8 @@ func (f *Factory) Sender() interface{} {
|
|||||||
func (f *Factory) Receive(props map[string]interface{}) *CustomSender {
|
func (f *Factory) Receive(props map[string]interface{}) *CustomSender {
|
||||||
var demo = *f.demo
|
var demo = *f.demo
|
||||||
sender := &demo
|
sender := &demo
|
||||||
sender.SetID()
|
// sender.SetID()
|
||||||
console.Log("senderId", sender.GetID())
|
// console.Log("senderId", sender.GetID())
|
||||||
emf := map[string]interface{}{}
|
emf := map[string]interface{}{}
|
||||||
for i := range props {
|
for i := range props {
|
||||||
h := false
|
h := false
|
||||||
@@ -653,6 +671,9 @@ func (sender *CustomSender) GetBotID() string {
|
|||||||
type PUSH string
|
type PUSH string
|
||||||
|
|
||||||
func (sender *CustomSender) Action(options map[string]interface{}) (interface{}, error) {
|
func (sender *CustomSender) Action(options map[string]interface{}) (interface{}, error) {
|
||||||
|
if sender.f.action != nil {
|
||||||
|
return sender.f.action(options), nil
|
||||||
|
}
|
||||||
var platform = sender.f.botplt
|
var platform = sender.f.botplt
|
||||||
var any *common.Function
|
var any *common.Function
|
||||||
var one *common.Function
|
var one *common.Function
|
||||||
@@ -692,6 +713,7 @@ func (sender *CustomSender) Action(options map[string]interface{}) (interface{},
|
|||||||
vm.Set("action", proxy)
|
vm.Set("action", proxy)
|
||||||
vm.Set("adapter", sender.f)
|
vm.Set("adapter", sender.f)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
@@ -918,16 +940,9 @@ func (sender *CustomSender) GetID() string {
|
|||||||
return sender.id
|
return sender.id
|
||||||
}
|
}
|
||||||
|
|
||||||
var test = "4d6371a8-2778-11ee-a3c2-821680fbbf6b"
|
func (sender *CustomSender) SetID() string {
|
||||||
|
|
||||||
func (sender *CustomSender) SetID() {
|
|
||||||
if test != "" {
|
|
||||||
sender.id = test
|
|
||||||
test = ""
|
|
||||||
} else {
|
|
||||||
sender.id = utils.GenUUID()
|
sender.id = utils.GenUUID()
|
||||||
}
|
|
||||||
|
|
||||||
sender.CreatedAt = time.Now()
|
sender.CreatedAt = time.Now()
|
||||||
senders.Store(sender.id, sender)
|
senders.Store(sender.id, sender)
|
||||||
|
return sender.id
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -162,6 +162,14 @@ type BaseSender struct {
|
|||||||
emf map[string]interface{}
|
emf map[string]interface{}
|
||||||
id string
|
id string
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
|
plugin_id string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sender *BaseSender) SetPluginID(plugin_id string) {
|
||||||
|
sender.plugin_id = plugin_id
|
||||||
|
}
|
||||||
|
func (sender *BaseSender) GetPluginID() string {
|
||||||
|
return sender.plugin_id
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sender *BaseSender) SetLevel(l int) {
|
func (sender *BaseSender) SetLevel(l int) {
|
||||||
@@ -379,10 +387,11 @@ func (sender *BaseSender) GetID() string {
|
|||||||
return sender.id
|
return sender.id
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sender *BaseSender) SetID() {
|
func (sender *BaseSender) SetID() string {
|
||||||
sender.id = utils.GenUUID()
|
sender.id = utils.GenUUID()
|
||||||
sender.CreatedAt = time.Now()
|
sender.CreatedAt = time.Now()
|
||||||
senders.Store(sender.id, sender)
|
senders.Store(sender.id, sender)
|
||||||
|
return sender.id
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sender *BaseSender) GetTime() time.Time {
|
func (sender *BaseSender) GetTime() time.Time {
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package common
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type Sender interface {
|
type Sender interface {
|
||||||
|
SetPluginID(string)
|
||||||
|
GetPluginID() string
|
||||||
GetID() string
|
GetID() string
|
||||||
GetTime() time.Time
|
GetTime() time.Time
|
||||||
SetID()
|
SetID() string
|
||||||
GetUserID() string
|
GetUserID() string
|
||||||
GetChatID() string
|
GetChatID() string
|
||||||
GetBotID() string
|
GetBotID() string
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
s := grpc.NewServer()
|
s := grpc.NewServer()
|
||||||
srpc.RegisterSillyGirlServiceServer(s, &SillyGirlService{})
|
srpc.RegisterSillyGirlServiceServer(s, &SillyGirlService{})
|
||||||
log.Printf("grpc server listening at %v", lis.Addr())
|
// log.Printf("grpc server listening at %v", lis.Addr())
|
||||||
if err := s.Serve(lis); err != nil {
|
if err := s.Serve(lis); err != nil {
|
||||||
log.Fatalf("failed to serve: %v", err)
|
log.Fatalf("failed to serve: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-10
@@ -3,6 +3,7 @@ package core
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -13,8 +14,13 @@ import (
|
|||||||
func (sg *SillyGirlService) AdapterRegist(stream srpc.SillyGirlService_AdapterRegistServer) error {
|
func (sg *SillyGirlService) AdapterRegist(stream srpc.SillyGirlService_AdapterRegistServer) error {
|
||||||
var adapter *Factory
|
var adapter *Factory
|
||||||
var echos sync.Map
|
var echos sync.Map
|
||||||
|
// defer func() {
|
||||||
|
// fmt.Println("test defer")
|
||||||
|
// }()
|
||||||
for {
|
for {
|
||||||
|
// fmt.Println("test for")
|
||||||
req, err := stream.Recv()
|
req, err := stream.Recv()
|
||||||
|
// fmt.Println("test fored", err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -41,6 +47,24 @@ func (sg *SillyGirlService) AdapterRegist(stream srpc.SillyGirlService_AdapterRe
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
})
|
})
|
||||||
|
adapter.action = func(m map[string]interface{}) string {
|
||||||
|
m["__type__"] = "action"
|
||||||
|
echo := utils.GenUUID()
|
||||||
|
ch := make(chan string)
|
||||||
|
echos.Store(echo, ch)
|
||||||
|
defer echos.Delete(echo)
|
||||||
|
m["echo"] = echo
|
||||||
|
stream.Send(&srpc.Default{
|
||||||
|
Value: string(utils.JsonMarshal(m)),
|
||||||
|
})
|
||||||
|
select {
|
||||||
|
case v := <-ch:
|
||||||
|
return v
|
||||||
|
case <-time.After(time.Second * 5):
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
// fmt.Println("test start")
|
||||||
} else {
|
} else {
|
||||||
echo := req.GetBotId()
|
echo := req.GetBotId()
|
||||||
message_id := req.GetPlatform()
|
message_id := req.GetPlatform()
|
||||||
@@ -63,7 +87,7 @@ func (sg *SillyGirlService) AdapterReceive(ctx context.Context, req *srpc.Adapte
|
|||||||
adapter, err := GetAdapter(bot_id, platform)
|
adapter, err := GetAdapter(bot_id, platform)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s := adapter.Receive(msgs)
|
s := adapter.Receive(msgs)
|
||||||
return &srpc.Default{Value: s.GetID()}, nil
|
return &srpc.Default{Value: s.SetID()}, nil
|
||||||
}
|
}
|
||||||
return &srpc.Default{Value: ""}, err
|
return &srpc.Default{Value: ""}, err
|
||||||
}
|
}
|
||||||
@@ -73,17 +97,17 @@ func (sg *SillyGirlService) AdapterPush(ctx context.Context, req *srpc.AdapterRe
|
|||||||
bot_id := req.GetBotId()
|
bot_id := req.GetBotId()
|
||||||
platform := req.GetPlatform()
|
platform := req.GetPlatform()
|
||||||
json.Unmarshal([]byte(req.Value), &msgs)
|
json.Unmarshal([]byte(req.Value), &msgs)
|
||||||
adapter, err := GetAdapter(bot_id, platform)
|
adapter, err := GetAdapter(platform, bot_id)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
result := adapter.Push(msgs)
|
result := adapter.Push(msgs)
|
||||||
message_id := result["message_id"]
|
message_id := result["message_id"]
|
||||||
error := result["error"]
|
errst := result["error"]
|
||||||
if error != "" {
|
if errst != "" {
|
||||||
return &srpc.Default{Value: ""}, err
|
return &srpc.Default{Value: ""}, errors.New(errst)
|
||||||
}
|
}
|
||||||
return &srpc.Default{Value: message_id}, err
|
return &srpc.Default{Value: message_id}, nil
|
||||||
}
|
}
|
||||||
return &srpc.Default{Value: ""}, err
|
return &srpc.Default{Value: ""}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sg *SillyGirlService) AdapterSender(ctx context.Context, req *srpc.AdapterRequest) (*srpc.Default, error) {
|
func (sg *SillyGirlService) AdapterSender(ctx context.Context, req *srpc.AdapterRequest) (*srpc.Default, error) {
|
||||||
@@ -91,10 +115,10 @@ func (sg *SillyGirlService) AdapterSender(ctx context.Context, req *srpc.Adapter
|
|||||||
bot_id := req.GetBotId()
|
bot_id := req.GetBotId()
|
||||||
platform := req.GetPlatform()
|
platform := req.GetPlatform()
|
||||||
json.Unmarshal([]byte(req.Value), &msgs)
|
json.Unmarshal([]byte(req.Value), &msgs)
|
||||||
adapter, err := GetAdapter(bot_id, platform)
|
adapter, err := GetAdapter(platform, bot_id)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s := adapter.Sender2(msgs)
|
s := adapter.Sender2(msgs)
|
||||||
return &srpc.Default{Value: s.GetID()}, nil
|
return &srpc.Default{Value: s.SetID()}, nil
|
||||||
}
|
}
|
||||||
return &srpc.Default{Value: ""}, err
|
return &srpc.Default{Value: ""}, err
|
||||||
}
|
}
|
||||||
@@ -102,7 +126,7 @@ func (sg *SillyGirlService) AdapterSender(ctx context.Context, req *srpc.Adapter
|
|||||||
func (sg *SillyGirlService) AdapterDestroy(ctx context.Context, req *srpc.AdapterRequest) (*srpc.Empty, error) {
|
func (sg *SillyGirlService) AdapterDestroy(ctx context.Context, req *srpc.AdapterRequest) (*srpc.Empty, error) {
|
||||||
bot_id := req.GetBotId()
|
bot_id := req.GetBotId()
|
||||||
platform := req.GetPlatform()
|
platform := req.GetPlatform()
|
||||||
adapter, err := GetAdapter(bot_id, platform)
|
adapter, err := GetAdapter(platform, bot_id)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
adapter.Destroy()
|
adapter.Destroy()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ package core
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/cdle/sillyplus/core/storage"
|
||||||
"github.com/cdle/sillyplus/proto3/srpc"
|
"github.com/cdle/sillyplus/proto3/srpc"
|
||||||
"github.com/cdle/sillyplus/utils"
|
"github.com/cdle/sillyplus/utils"
|
||||||
)
|
)
|
||||||
@@ -11,6 +15,57 @@ type SillyGirlService struct {
|
|||||||
srpc.UnsafeSillyGirlServiceServer
|
srpc.UnsafeSillyGirlServiceServer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sg *SillyGirlService) BucketWatch(stream srpc.SillyGirlService_BucketWatchServer) error {
|
||||||
|
var watcher func(old, new, key string) *storage.Final
|
||||||
|
var echos sync.Map
|
||||||
|
for {
|
||||||
|
req, err := stream.Recv()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if watcher == nil {
|
||||||
|
watcher = func(old, new, key string) *storage.Final {
|
||||||
|
echo := utils.GenUUID()
|
||||||
|
ch := make(chan *storage.Final)
|
||||||
|
echos.Store(echo, ch)
|
||||||
|
defer echos.Delete(echo)
|
||||||
|
stream.Send(&srpc.BucketWatchResponse{
|
||||||
|
Echo: echo,
|
||||||
|
Old: old,
|
||||||
|
Now: new,
|
||||||
|
Key: key,
|
||||||
|
})
|
||||||
|
select {
|
||||||
|
case v := <-ch:
|
||||||
|
return v
|
||||||
|
case <-time.After(time.Second * 5):
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
storage.Watch(MakeBucket(req.Name), req.Key, watcher, req.PluginId)
|
||||||
|
} else {
|
||||||
|
echo := req.Echo
|
||||||
|
v, ok := echos.Load(echo)
|
||||||
|
var fn *storage.Final
|
||||||
|
if req.Error != "VOID" {
|
||||||
|
fn = &storage.Final{
|
||||||
|
Now: req.Now,
|
||||||
|
Message: req.Message,
|
||||||
|
}
|
||||||
|
if req.Error != "" {
|
||||||
|
fn.Error = errors.New(req.Error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ok {
|
||||||
|
select {
|
||||||
|
case v.(chan *storage.Final) <- fn:
|
||||||
|
case <-time.After(time.Millisecond):
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get implements BucketServiceServer.Get.
|
// Get implements BucketServiceServer.Get.
|
||||||
func (sg *SillyGirlService) BucketGet(ctx context.Context, req *srpc.BucketKeyRequest) (*srpc.Default, error) {
|
func (sg *SillyGirlService) BucketGet(ctx context.Context, req *srpc.BucketKeyRequest) (*srpc.Default, error) {
|
||||||
value := MakeBucket(req.Name).GetString(req.Key)
|
value := MakeBucket(req.Name).GetString(req.Key)
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/cdle/sillyplus/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Language struct {
|
||||||
|
Name string // node
|
||||||
|
Version string // 20230725
|
||||||
|
Os string // linux
|
||||||
|
Arch string // amd64
|
||||||
|
Links []string // 下载链接
|
||||||
|
}
|
||||||
|
|
||||||
|
var languages = []Language{
|
||||||
|
{
|
||||||
|
Name: "node",
|
||||||
|
Version: "20230725",
|
||||||
|
Os: "linux",
|
||||||
|
Arch: "amd64",
|
||||||
|
Links: []string{"https://gitee.com/sillybot/binary/releases/download/20230725/node_linux_amd64"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Name: "node",
|
||||||
|
Version: "20230725",
|
||||||
|
Os: "darwin",
|
||||||
|
Arch: "arm64",
|
||||||
|
Links: []string{"https://gitee.com/sillybot/binary/releases/download/20230725/node_darwin_arm64"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
|
||||||
|
for _, item := range languages {
|
||||||
|
if !(item.Os == runtime.GOOS && item.Arch == runtime.GOARCH) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
func() {
|
||||||
|
dir := utils.ExecPath + "/language/" + item.Name
|
||||||
|
data, _ := os.ReadFile(dir + "/version")
|
||||||
|
if string(data) == item.Version {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
os.MkdirAll(utils.ExecPath+"/language/"+item.Name, 0755)
|
||||||
|
resp, err := http.Get(item.Links[0])
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
f, err := os.OpenFile(dir+"/"+item.Name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0755)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
_, err = io.Copy(f, resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
os.WriteFile(dir+"/version", []byte(item.Version), 0755)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
}
|
||||||
+92
-13
@@ -1,6 +1,7 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@@ -8,6 +9,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/cdle/sillyplus/core/common"
|
"github.com/cdle/sillyplus/core/common"
|
||||||
"github.com/cdle/sillyplus/core/storage"
|
"github.com/cdle/sillyplus/core/storage"
|
||||||
@@ -22,6 +24,8 @@ func init() {
|
|||||||
go initNodePlugins()
|
go initNodePlugins()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var processes sync.Map
|
||||||
|
|
||||||
func initNodePlugins() {
|
func initNodePlugins() {
|
||||||
root := utils.ExecPath + "/plugins"
|
root := utils.ExecPath + "/plugins"
|
||||||
plugins := []string{root}
|
plugins := []string{root}
|
||||||
@@ -40,7 +44,7 @@ func initNodePlugins() {
|
|||||||
plugins = append(plugins, path)
|
plugins = append(plugins, path)
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
if (files[1] == "main.ts" || files[1] == "main.js") && !info.IsDir() {
|
if (files[1] == "main.js") && !info.IsDir() { //files[1] == "main.ts" ||
|
||||||
AddNodePlugin(path, files[0])
|
AddNodePlugin(path, files[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,9 +56,7 @@ func initNodePlugins() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer watcher.Close()
|
defer watcher.Close()
|
||||||
|
|
||||||
// 要监控的文件夹路径
|
// 要监控的文件夹路径
|
||||||
|
|
||||||
for _, dir := range plugins {
|
for _, dir := range plugins {
|
||||||
err = watcher.Add(dir)
|
err = watcher.Add(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -77,12 +79,14 @@ func initNodePlugins() {
|
|||||||
switch len(files) {
|
switch len(files) {
|
||||||
case 1:
|
case 1:
|
||||||
plugin_dir = true
|
plugin_dir = true
|
||||||
fmt.Println("目录事件")
|
// fmt.Println("目录事件")
|
||||||
plugin_name = files[0]
|
plugin_name = files[0]
|
||||||
case 2:
|
case 2:
|
||||||
if files[1] == "main.ts" || files[1] == "main.js" {
|
if files[1] == "main.ts" || files[1] == "main.js" {
|
||||||
|
if files[1] == "main.js" {
|
||||||
plugin_index = true
|
plugin_index = true
|
||||||
fmt.Println("入口文件事件")
|
}
|
||||||
|
// fmt.Println("入口文件事件")
|
||||||
}
|
}
|
||||||
plugin_name = files[0]
|
plugin_name = files[0]
|
||||||
}
|
}
|
||||||
@@ -131,10 +135,10 @@ func RemNodePlugin(name string) error {
|
|||||||
pluginLock.Lock()
|
pluginLock.Lock()
|
||||||
defer pluginLock.Unlock()
|
defer pluginLock.Unlock()
|
||||||
key := nameUuid(name)
|
key := nameUuid(name)
|
||||||
fmt.Println("rem", key, name)
|
// fmt.Println("rem", key, name)
|
||||||
for i := range Functions {
|
for i := range Functions {
|
||||||
if Functions[i].UUID == key {
|
if Functions[i].UUID == key {
|
||||||
fmt.Println("pl", key)
|
// fmt.Println("pl", key)
|
||||||
DestroyAdapterByUUID(key)
|
DestroyAdapterByUUID(key)
|
||||||
Functions[i].Running = false
|
Functions[i].Running = false
|
||||||
if len(Functions[i].CronIds) != 0 {
|
if len(Functions[i].CronIds) != 0 {
|
||||||
@@ -177,16 +181,91 @@ func AddNodePlugin(path, name string) error {
|
|||||||
f.Suffix = ".ts"
|
f.Suffix = ".ts"
|
||||||
f.Type = "typescript"
|
f.Type = "typescript"
|
||||||
f.Handle = func(s common.Sender, f func(vm *goja.Runtime)) interface{} {
|
f.Handle = func(s common.Sender, f func(vm *goja.Runtime)) interface{} {
|
||||||
cmd := exec.Command("node", "/Users/a1-6/.nvm/versions/node/v18.16.1/lib/node_modules/ts-node/dist/bin.js", path)
|
s.SetPluginID(uuid)
|
||||||
cmd.Env = append(cmd.Env, "SENDER_ID="+s.GetID())
|
plt := s.GetImType()
|
||||||
// 执行命令,并捕获其输出
|
// , "/Users/a1-6/.nvm/versions/node/v18.16.1/lib/node_modules/ts-node/dist/bin.js",
|
||||||
output, err := cmd.Output()
|
cmd := exec.Command(utils.ExecPath+"/language/node/node", path)
|
||||||
|
// cmd := exec.Command(utils.ExecPath+"/language/node/node", path)
|
||||||
|
id := s.SetID()
|
||||||
|
cmd.Env = append(cmd.Env, "SENDER_ID="+id)
|
||||||
|
cmd.Env = append(cmd.Env, "PLUGIN_ID="+uuid)
|
||||||
|
|
||||||
|
// 获取标准输出和标准错误输出的管道
|
||||||
|
stdout, err := cmd.StdoutPipe()
|
||||||
|
if err != nil {
|
||||||
|
// fmt.Printf("获取标准输出管道失败:%v\n", err)
|
||||||
|
// os.Exit(1)
|
||||||
|
}
|
||||||
|
stderr, err := cmd.StderrPipe()
|
||||||
|
if err != nil {
|
||||||
|
// fmt.Printf("获取标准错误输出管道失败:%v\n", err)
|
||||||
|
// os.Exit(1)
|
||||||
|
}
|
||||||
|
err = cmd.Start()
|
||||||
|
if err != nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// file, err := os.Create("output.log")
|
||||||
|
// if err != nil {
|
||||||
|
// fmt.Printf("创建文件失败:%v\n", err)
|
||||||
|
// os.Exit(1)
|
||||||
|
// }
|
||||||
|
// defer file.Close()
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
wg.Add(2)
|
||||||
|
// 处理标准输出
|
||||||
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
|
|
||||||
|
scanner := bufio.NewScanner(stdout)
|
||||||
|
for scanner.Scan() {
|
||||||
|
data := scanner.Text()
|
||||||
|
fmt.Println("log", data)
|
||||||
|
// if _, err := file.WriteString(data + "\n"); err != nil {
|
||||||
|
// fmt.Printf("写入文件失败:%v\n", err)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
// 处理标准错误输出
|
||||||
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
|
scanner := bufio.NewScanner(stderr)
|
||||||
|
for scanner.Scan() {
|
||||||
|
data := scanner.Text()
|
||||||
|
fmt.Fprintln(os.Stderr, "err "+data)
|
||||||
|
// if _, err := file.WriteString(data + "\n"); err != nil {
|
||||||
|
// fmt.Printf("写入文件失败:%v\n", err)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
processes.Store(cmd, s)
|
||||||
|
if (plt) != "*" {
|
||||||
|
senders.Store(id, s)
|
||||||
|
defer senders.Delete(id)
|
||||||
|
defer processes.Delete(cmd)
|
||||||
|
err = cmd.Wait()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("命令执行失败:", err)
|
fmt.Println("命令执行失败:", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 输出命令的输出结果
|
} else {
|
||||||
fmt.Println(string(output))
|
processes.Range(func(key, value any) bool {
|
||||||
|
p := key.(*exec.Cmd)
|
||||||
|
if p == cmd {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
s := value.(common.Sender)
|
||||||
|
if s.GetPluginID() == uuid {
|
||||||
|
p.Process.Kill()
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
go func() {
|
||||||
|
defer processes.Delete(cmd)
|
||||||
|
err = cmd.Wait()
|
||||||
|
}()
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
for _, cb := range cbs {
|
for _, cb := range cbs {
|
||||||
|
|||||||
+105
-25
@@ -4,6 +4,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -14,23 +17,30 @@ import (
|
|||||||
|
|
||||||
var senders sync.Map
|
var senders sync.Map
|
||||||
|
|
||||||
func init() {
|
// func init() {
|
||||||
//垃圾回收
|
// //垃圾回收
|
||||||
go func() {
|
// go func() {
|
||||||
for {
|
// for {
|
||||||
time.Sleep(time.Minute)
|
// time.Sleep(time.Minute)
|
||||||
senders.Range(func(key, value any) bool {
|
// senders.Range(func(key, value any) bool {
|
||||||
s := value.(common.Sender)
|
// s := value.(common.Sender)
|
||||||
if s.GetTime().Add(time.Minute * 20).Before(time.Now()) {
|
// if s.GetTime().Add(time.Minute * 20).Before(time.Now()) {
|
||||||
senders.Delete(s.GetID())
|
// senders.Delete(s.GetID())
|
||||||
}
|
// }
|
||||||
return true
|
// return true
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}()
|
// }()
|
||||||
}
|
// }
|
||||||
|
|
||||||
func GetSender(uuid string) (common.Sender, error) {
|
func GetSender(uuid string) (common.Sender, error) {
|
||||||
|
if uuid == "" {
|
||||||
|
return &CustomSender{
|
||||||
|
f: &Factory{
|
||||||
|
botid: "*",
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
v, ok := senders.Load(uuid)
|
v, ok := senders.Load(uuid)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("not found sender")
|
return nil, errors.New("not found sender")
|
||||||
@@ -121,14 +131,42 @@ func (sg *SillyGirlService) SenderContinue(ctx context.Context, req *srpc.Sender
|
|||||||
}
|
}
|
||||||
|
|
||||||
// todo
|
// todo
|
||||||
func (sg *SillyGirlService) SenderListen(ctx context.Context, req *srpc.SenderListenRequest) (*srpc.Default, error) {
|
func (sg *SillyGirlService) SenderListen(stream srpc.SillyGirlService_SenderListenServer) error {
|
||||||
|
var carry *Carry
|
||||||
|
var echos sync.Map
|
||||||
|
var persistent bool
|
||||||
|
// defer fmt.Println("已关闭,", "===")
|
||||||
|
for {
|
||||||
|
req, err := stream.Recv()
|
||||||
|
// fmt.Println("carry", carry, err)
|
||||||
|
if err == io.EOF {
|
||||||
|
break // 如果流已经关闭,则退出循环
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if carry != nil {
|
||||||
|
echo := req.GetUuid()
|
||||||
|
value := req.GetValue()
|
||||||
|
// fmt.Println("echo", echo, "value", value)
|
||||||
|
v, ok := echos.Load(echo)
|
||||||
|
if ok {
|
||||||
|
select {
|
||||||
|
case v.(chan string) <- value:
|
||||||
|
case <-time.After(time.Millisecond):
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if !persistent {
|
||||||
|
// return nil
|
||||||
|
// }
|
||||||
|
continue
|
||||||
|
}
|
||||||
s, err := GetSender(req.Uuid)
|
s, err := GetSender(req.Uuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
options := []interface{}{}
|
options := []interface{}{}
|
||||||
var carry = &Carry{
|
carry = &Carry{
|
||||||
ListenPrivate: req.ListenPrivate,
|
ListenPrivate: req.ListenPrivate,
|
||||||
ListenGroup: req.ListenGroup,
|
ListenGroup: req.ListenGroup,
|
||||||
RequireAdmin: req.RequireAdmin,
|
RequireAdmin: req.RequireAdmin,
|
||||||
@@ -140,8 +178,8 @@ func (sg *SillyGirlService) SenderListen(ctx context.Context, req *srpc.SenderLi
|
|||||||
ProhibitUsers: req.ProhibitUsers,
|
ProhibitUsers: req.ProhibitUsers,
|
||||||
UserID: s.GetUserID(),
|
UserID: s.GetUserID(),
|
||||||
ChatID: s.GetChatID(),
|
ChatID: s.GetChatID(),
|
||||||
|
UUID: req.PluginId,
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Timeout != 0 {
|
if req.Timeout != 0 {
|
||||||
options = append(options, time.Duration(req.Timeout)*time.Millisecond)
|
options = append(options, time.Duration(req.Timeout)*time.Millisecond)
|
||||||
}
|
}
|
||||||
@@ -156,12 +194,33 @@ func (sg *SillyGirlService) SenderListen(ctx context.Context, req *srpc.SenderLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
options = append(options, carry)
|
options = append(options, carry)
|
||||||
id := ""
|
if req.Persistent {
|
||||||
s.Await(s, func(s common.Sender) interface{} {
|
persistent = req.Persistent
|
||||||
id = s.GetID()
|
options = append(options, "persistent")
|
||||||
return nil
|
}
|
||||||
|
go s.Await(s, func(s common.Sender) interface{} {
|
||||||
|
id := s.SetID()
|
||||||
|
defer senders.Delete(id)
|
||||||
|
echo := utils.GenUUID()
|
||||||
|
ch := make(chan string)
|
||||||
|
echos.Store(echo, ch)
|
||||||
|
defer echos.Delete(echo)
|
||||||
|
stream.Send(&srpc.SenderListenResponse{Echo: echo, Uuid: id})
|
||||||
|
value := <-ch
|
||||||
|
if !persistent {
|
||||||
|
if strings.HasPrefix(value, "go_again_") {
|
||||||
|
value = strings.Replace(value, "go_again_", "", 1)
|
||||||
|
return GoAgain(value)
|
||||||
|
} else {
|
||||||
|
stream.Send(&srpc.SenderListenResponse{Echo: "END"})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
value = strings.Replace(value, "go_again_", "", 1)
|
||||||
|
}
|
||||||
|
return value
|
||||||
}, options...)
|
}, options...)
|
||||||
return &srpc.Default{Value: id}, nil
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sg *SillyGirlService) SenderEvent(ctx context.Context, req *srpc.SenderRequest) (*srpc.Default, error) {
|
func (sg *SillyGirlService) SenderEvent(ctx context.Context, req *srpc.SenderRequest) (*srpc.Default, error) {
|
||||||
@@ -181,6 +240,21 @@ func (sg *SillyGirlService) SenderReply(ctx context.Context, req *srpc.ReplyRequ
|
|||||||
return &srpc.Default{Value: message_id}, err
|
return &srpc.Default{Value: message_id}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sg *SillyGirlService) SenderParam(ctx context.Context, req *srpc.ReplyRequest) (*srpc.Default, error) {
|
||||||
|
s, err := GetSender(req.Uuid)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
value := ""
|
||||||
|
i := utils.Int(req.Content)
|
||||||
|
if fmt.Sprint(i) == req.Content {
|
||||||
|
value = s.Get(i - 1)
|
||||||
|
} else {
|
||||||
|
value = s.Get(req.Content)
|
||||||
|
}
|
||||||
|
return &srpc.Default{Value: value}, err
|
||||||
|
}
|
||||||
|
|
||||||
func (sg *SillyGirlService) SenderAction(ctx context.Context, req *srpc.ReplyRequest) (*srpc.Default, error) {
|
func (sg *SillyGirlService) SenderAction(ctx context.Context, req *srpc.ReplyRequest) (*srpc.Default, error) {
|
||||||
s, err := GetSender(req.Uuid)
|
s, err := GetSender(req.Uuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -194,3 +268,9 @@ func (sg *SillyGirlService) SenderAction(ctx context.Context, req *srpc.ReplyReq
|
|||||||
result, err := s.Action(params)
|
result, err := s.Action(params)
|
||||||
return &srpc.Default{Value: string(utils.JsonMarshal(result))}, err
|
return &srpc.Default{Value: string(utils.JsonMarshal(result))}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sg *SillyGirlService) SenderDestroy(ctx context.Context, req *srpc.ReplyRequest) (*srpc.Empty, error) {
|
||||||
|
// fmt.Println("删除", req.Uuid)
|
||||||
|
senders.Delete(req.Uuid)
|
||||||
|
return &srpc.Empty{}, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@@ -11,6 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/cdle/sillyplus/core/common"
|
"github.com/cdle/sillyplus/core/common"
|
||||||
"github.com/cdle/sillyplus/core/logs"
|
"github.com/cdle/sillyplus/core/logs"
|
||||||
|
"github.com/cdle/sillyplus/proto3/srpc"
|
||||||
"github.com/cdle/sillyplus/utils"
|
"github.com/cdle/sillyplus/utils"
|
||||||
"github.com/dop251/goja"
|
"github.com/dop251/goja"
|
||||||
// "golang.org/x/image/webp"
|
// "golang.org/x/image/webp"
|
||||||
@@ -47,6 +49,21 @@ type Console struct {
|
|||||||
var console = &Console{}
|
var console = &Console{}
|
||||||
var Logs = &Console{}
|
var Logs = &Console{}
|
||||||
|
|
||||||
|
func (sg *SillyGirlService) Console(ctx context.Context, req *srpc.ConsoleRequest) (*srpc.Empty, error) {
|
||||||
|
log := &Console{
|
||||||
|
UUID: req.PluginId,
|
||||||
|
}
|
||||||
|
switch req.Type {
|
||||||
|
case "info", "log":
|
||||||
|
log.Info(req.Content)
|
||||||
|
case "error":
|
||||||
|
log.Error(req.Content)
|
||||||
|
case "debug":
|
||||||
|
log.Debug(req.Content)
|
||||||
|
}
|
||||||
|
return &srpc.Empty{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
func pluginConsole(uuid string) *Console {
|
func pluginConsole(uuid string) *Console {
|
||||||
return &Console{
|
return &Console{
|
||||||
UUID: uuid,
|
UUID: uuid,
|
||||||
|
|||||||
Generated
+15
-5
@@ -6,10 +6,12 @@
|
|||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.8.18",
|
"@grpc/grpc-js": "^1.8.18",
|
||||||
"google-protobuf": "^3.21.2"
|
"google-protobuf": "^3.21.2",
|
||||||
|
"webpack-node-externals": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/google-protobuf": "^3.15.6"
|
"@types/google-protobuf": "^3.15.6",
|
||||||
|
"@types/node": "^20.4.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@grpc/grpc-js": {
|
"node_modules/@grpc/grpc-js": {
|
||||||
@@ -108,9 +110,9 @@
|
|||||||
"integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA=="
|
"integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.4.3",
|
"version": "20.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.4.tgz",
|
||||||
"integrity": "sha512-Yu3+r4Mn/iY6Mf0aihncZQ1qOjOUrCiodbHHY1hds5O+7BbKp9t+Li7zLO13zO8j9L2C6euz8xsYQP0rjGvVXw=="
|
"integrity": "sha512-CukZhumInROvLq3+b5gLev+vgpsIqC2D0deQr/yS1WnxvmYLlJXZpaQrQiseMY+6xusl79E04UjWoqyr+t1/Ew=="
|
||||||
},
|
},
|
||||||
"node_modules/ansi-regex": {
|
"node_modules/ansi-regex": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
@@ -267,6 +269,14 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/webpack-node-externals": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wrap-ansi": {
|
"node_modules/wrap-ansi": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||||
|
|||||||
+4
-2
@@ -1,9 +1,11 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.8.18",
|
"@grpc/grpc-js": "^1.8.18",
|
||||||
"google-protobuf": "^3.21.2"
|
"google-protobuf": "^3.21.2",
|
||||||
|
"webpack-node-externals": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/google-protobuf": "^3.15.6"
|
"@types/google-protobuf": "^3.15.6",
|
||||||
|
"@types/node": "^20.4.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,645 @@
|
|||||||
|
"use strict";
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.sleep = exports.sender = exports.Bucket = exports.Adapter = void 0;
|
||||||
|
const srpc_1 = require("./srpc");
|
||||||
|
const grpc_1 = __importStar(require("@grpc/grpc-js"));
|
||||||
|
let client = new srpc_1.srpc.SillyGirlServiceClient("localhost:50051", grpc_1.credentials.createInsecure());
|
||||||
|
let senders = [];
|
||||||
|
let plugin_id = process.env?.PLUGIN_ID ?? "";
|
||||||
|
process.on("beforeExit", () => {
|
||||||
|
for (let sender of senders) {
|
||||||
|
sender.destructor();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
class Sender {
|
||||||
|
uuid;
|
||||||
|
destoried = false;
|
||||||
|
constructor(uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
senders.push(this);
|
||||||
|
}
|
||||||
|
destructor() {
|
||||||
|
if (this.destoried)
|
||||||
|
return;
|
||||||
|
this.destoried = true;
|
||||||
|
client.SenderDestroy(new srpc_1.srpc.ReplyRequest({ uuid: sender.uuid }), (err, resp) => { });
|
||||||
|
}
|
||||||
|
async getUserId() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetUserId(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getUserName() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetUserName(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getChatId() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetChatId(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getChatName() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetChatName(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getMessageId() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetMessageId(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getPlatform() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetPlatform(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getBotId() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetBotId(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getContent() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderGetContent(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async param(key) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderParam(new srpc_1.srpc.ReplyRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
content: `${key}`,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value ?? "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async setContent(content) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderSetContent(new srpc_1.srpc.SenderContentRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
content,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(undefined);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async continue() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderContinue(new srpc_1.srpc.SenderRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(undefined);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getAdapter() {
|
||||||
|
return new Adapter({
|
||||||
|
bot_id: await this.getBotId(),
|
||||||
|
platform: await this.getPlatform(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async listen(options) {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
let params = {
|
||||||
|
uuid: this.uuid,
|
||||||
|
rules: options?.rules,
|
||||||
|
timeout: options?.timeout,
|
||||||
|
listen_private: options?.listen_private,
|
||||||
|
listen_group: options?.listen_group,
|
||||||
|
allow_platforms: options?.allow_platforms,
|
||||||
|
prohibit_platforms: options?.prohibit_platforms,
|
||||||
|
allow_groups: options?.allow_groups,
|
||||||
|
prohibit_groups: options?.prohibit_groups,
|
||||||
|
allow_users: options?.allow_users,
|
||||||
|
prohibit_users: options?.prohibit_users,
|
||||||
|
persistent: options?.persistent,
|
||||||
|
plugin_id,
|
||||||
|
};
|
||||||
|
if (options?.handle && "*" == (await this.getPlatform())) {
|
||||||
|
params.persistent = true;
|
||||||
|
}
|
||||||
|
const call = client.SenderListen();
|
||||||
|
// let callback: any = options.replyHandler;
|
||||||
|
// console.log("===",this.uuid)
|
||||||
|
call.on("data", (response) => {
|
||||||
|
if (response.echo == "END") {
|
||||||
|
call.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let s = new Sender(response.uuid);
|
||||||
|
if (options?.handle) {
|
||||||
|
// console.log(`options?.handle`, options.persistent)
|
||||||
|
let obj = options?.handle(s);
|
||||||
|
if (typeof obj == "string") {
|
||||||
|
call.write(new srpc_1.srpc.SenderListenRequest({
|
||||||
|
uuid: response.echo,
|
||||||
|
value: obj,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else if (obj) {
|
||||||
|
obj
|
||||||
|
.then((v) => {
|
||||||
|
call.write(new srpc_1.srpc.SenderListenRequest({
|
||||||
|
uuid: response.echo,
|
||||||
|
value: v ?? "",
|
||||||
|
}));
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
call.write(new srpc_1.srpc.SenderListenRequest({
|
||||||
|
uuid: response.echo,
|
||||||
|
value: "",
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
call.write(new srpc_1.srpc.SenderListenRequest({
|
||||||
|
uuid: response.echo,
|
||||||
|
value: "",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
// console.log(`options?.handle`, options.persistent)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// console.log(`call.cancel()`, options?.persistent)
|
||||||
|
call.write(new srpc_1.srpc.SenderListenRequest({
|
||||||
|
uuid: response.echo,
|
||||||
|
value: "",
|
||||||
|
}));
|
||||||
|
// console.log(`call.cancel()`, options?.persistent)
|
||||||
|
}
|
||||||
|
// console.log("response", JSON.stringify(response));
|
||||||
|
// call.cancel()
|
||||||
|
resolve(s);
|
||||||
|
});
|
||||||
|
call.on("error", (err) => {
|
||||||
|
reject(err);
|
||||||
|
// console.error(err);
|
||||||
|
});
|
||||||
|
// console.log("params", JSON.stringify(params));
|
||||||
|
call.write(new srpc_1.srpc.SenderListenRequest(params));
|
||||||
|
}
|
||||||
|
// client.SenderListen(new srpc.SenderListenRequest(params), (err, resp) => {
|
||||||
|
// if (err) {
|
||||||
|
// reject(err);
|
||||||
|
// } else {
|
||||||
|
// if (resp?.value) {
|
||||||
|
// let handle = options?.handle;
|
||||||
|
// let s = new Sender(resp.value);
|
||||||
|
// resolve(s);
|
||||||
|
// if (handle) {
|
||||||
|
// handle(s);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// reject(new Error("timeout"));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
holdOn(str) {
|
||||||
|
return "go_again_" + str;
|
||||||
|
}
|
||||||
|
async reply(content) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderReply(new srpc_1.srpc.ReplyRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
content,
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async action(options) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.SenderAction(new srpc_1.srpc.ReplyRequest({
|
||||||
|
uuid: this.uuid,
|
||||||
|
content: JSON.stringify(options),
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async event() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Bucket {
|
||||||
|
name;
|
||||||
|
constructor(name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
transform(v) {
|
||||||
|
if (!v) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
let result;
|
||||||
|
if (v.startsWith("f:")) {
|
||||||
|
result = parseFloat(v.replace("f:", ""));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (v.startsWith("d:")) {
|
||||||
|
result = parseInt(v.replace("d:", ""));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (v.startsWith("b:")) {
|
||||||
|
result = v.replace("b:", "") === "true";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if (v.startsWith("o:")) {
|
||||||
|
result = JSON.parse(v.replace("o:", ""));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
reverseTransform(value) {
|
||||||
|
if (typeof value === "number" || typeof value === "boolean") {
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
if (typeof value === "object" && value !== null) {
|
||||||
|
return "o:" + JSON.stringify(value);
|
||||||
|
}
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (typeof value === "string") {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (!isNaN(parseFloat(value))) {
|
||||||
|
return "f:" + parseFloat(value);
|
||||||
|
}
|
||||||
|
if (!isNaN(parseInt(value))) {
|
||||||
|
return "d:" + parseInt(value);
|
||||||
|
}
|
||||||
|
if (value === "true" || value === "false") {
|
||||||
|
return "b:" + (value === "true");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
async get(key, defaultValue = undefined) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.BucketGet(new srpc_1.srpc.BucketKeyRequest({ name: this.name, key }), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(this.transform(resp?.value) || defaultValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async set(key, value) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.BucketSet(new srpc_1.srpc.BucketSetRequest({
|
||||||
|
name: this.name,
|
||||||
|
key,
|
||||||
|
value: this.reverseTransform(value),
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve({
|
||||||
|
message: resp?.message,
|
||||||
|
changed: resp?.changed,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async getAll() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.BucketGetAll(new srpc_1.srpc.BucketRequest({ name: this.name }), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let values = {};
|
||||||
|
if (resp?.value) {
|
||||||
|
values = JSON.parse(resp?.value);
|
||||||
|
for (let key in values) {
|
||||||
|
values[key] = this.transform(values[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resolve(values);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async delete() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.BucketDelete(new srpc_1.srpc.BucketRequest({ name: this.name }), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(undefined);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async keys() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.BucketKeys(new srpc_1.srpc.BucketRequest({ name: this.name }), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.keys);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async len() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.BucketLen(new srpc_1.srpc.BucketRequest({ name: this.name }), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.length);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async buckets() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.BucketBuckets(new srpc_1.srpc.Empty(), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.buckets);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
watch(key, handle) {
|
||||||
|
const call = client.BucketWatch();
|
||||||
|
call.on("data", async (response) => {
|
||||||
|
let fin = handle(this.transform(response.old), this.transform(response.now), response.key);
|
||||||
|
fin = await fin;
|
||||||
|
let result = {
|
||||||
|
echo: response.echo,
|
||||||
|
};
|
||||||
|
if (!fin) {
|
||||||
|
result.error = "VOID";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result.now = this.reverseTransform(fin.now);
|
||||||
|
result.message = fin.message;
|
||||||
|
result.error = fin.error;
|
||||||
|
}
|
||||||
|
call.write(new srpc_1.srpc.BucketWatchRequest(result));
|
||||||
|
});
|
||||||
|
call.on("error", (err) => {
|
||||||
|
// console.error(err);
|
||||||
|
});
|
||||||
|
call.write(new srpc_1.srpc.BucketWatchRequest({
|
||||||
|
name: this.name,
|
||||||
|
key: key,
|
||||||
|
plugin_id,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
async _name() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.Bucket = Bucket;
|
||||||
|
class Adapter {
|
||||||
|
platform;
|
||||||
|
bot_id;
|
||||||
|
call;
|
||||||
|
constructor(options) {
|
||||||
|
this.platform = options.platform;
|
||||||
|
this.bot_id = options.bot_id;
|
||||||
|
if (options.replyHandler) {
|
||||||
|
const call = client.AdapterRegist();
|
||||||
|
let callback = options.replyHandler;
|
||||||
|
call.on("data", (response) => {
|
||||||
|
// console.log("start on data")
|
||||||
|
let message = JSON.parse(response.value);
|
||||||
|
const { echo, __type__ } = message;
|
||||||
|
delete message.__type__;
|
||||||
|
delete message.echo;
|
||||||
|
if (__type__ == "reply") {
|
||||||
|
call.write(new srpc_1.srpc.AdapterRegistRequest({
|
||||||
|
bot_id: echo,
|
||||||
|
platform: callback(message),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
if (__type__ == "action" && options.actionHandler) {
|
||||||
|
call.write(new srpc_1.srpc.AdapterRegistRequest({
|
||||||
|
bot_id: echo,
|
||||||
|
platform: options.actionHandler(message),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
// console.log("end on data")
|
||||||
|
});
|
||||||
|
call.on("error", (err) => {
|
||||||
|
console.error("adapter disc", err);
|
||||||
|
});
|
||||||
|
// console.log("before write")
|
||||||
|
call.write(new srpc_1.srpc.AdapterRegistRequest({
|
||||||
|
bot_id: options.bot_id,
|
||||||
|
platform: options.platform,
|
||||||
|
}));
|
||||||
|
// console.log("after write write")
|
||||||
|
this.call = call;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setActionHandler(func) {
|
||||||
|
// 将从服务端不断接收action消息,并处理
|
||||||
|
// 事件处理巨饼
|
||||||
|
}
|
||||||
|
async receive(message) {
|
||||||
|
//投递消息
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.AdapterReceive(new srpc_1.srpc.AdapterRequest({
|
||||||
|
platform: this.platform,
|
||||||
|
bot_id: this.bot_id,
|
||||||
|
value: JSON.stringify(message),
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else if (resp?.value) {
|
||||||
|
resolve(new Sender(resp.value));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async push(message) {
|
||||||
|
//推送消息
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.AdapterPush(new srpc_1.srpc.AdapterRequest({
|
||||||
|
platform: this.platform,
|
||||||
|
bot_id: this.bot_id,
|
||||||
|
value: JSON.stringify(message),
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(resp?.value ?? "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async destroy() {
|
||||||
|
this.call.cancel();
|
||||||
|
}
|
||||||
|
async sender(options) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
client.AdapterSender(new srpc_1.srpc.AdapterRequest({
|
||||||
|
platform: this.platform,
|
||||||
|
bot_id: this.bot_id,
|
||||||
|
value: JSON.stringify(options),
|
||||||
|
}), (err, resp) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else if (resp?.value) {
|
||||||
|
resolve(new Sender(resp.value));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.Adapter = Adapter;
|
||||||
|
let sender = new Sender(process.env?.SENDER_ID ?? "");
|
||||||
|
exports.sender = sender;
|
||||||
|
async function sleep(ms) {
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
exports.sleep = sleep;
|
||||||
|
class Console {
|
||||||
|
error = (message, ...optionalParams) => {
|
||||||
|
};
|
||||||
|
info = (message, ...optionalParams) => { };
|
||||||
|
log = (message, ...optionalParams) => { };
|
||||||
|
debug = (message, ...optionalParams) => { };
|
||||||
|
}
|
||||||
+6
-12
@@ -736,19 +736,13 @@ async function sleep(ms: number | undefined) {
|
|||||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
let console = {
|
class Console {
|
||||||
error: (message?: any, ...optionalParams: any[])=>{
|
error = (message?: any, ...optionalParams: any[]) => {
|
||||||
|
|
||||||
},
|
|
||||||
info: (message?: any, ...optionalParams: any[])=>{
|
|
||||||
|
|
||||||
},
|
|
||||||
log: (message?: any, ...optionalParams: any[])=>{
|
|
||||||
|
|
||||||
},
|
|
||||||
debug: (message?: any, ...optionalParams: any[])=>{
|
|
||||||
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
info = (message?: any, ...optionalParams: any[]) => {};
|
||||||
|
log = (message?: any, ...optionalParams: any[]) => {};
|
||||||
|
debug = (message?: any, ...optionalParams: any[]) => {};
|
||||||
|
}
|
||||||
|
|
||||||
export { Adapter, Bucket, sender, sleep };
|
export { Adapter, Bucket, sender, sleep };
|
||||||
|
|||||||
Vendored
+912
@@ -0,0 +1,912 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
/**
|
||||||
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
|
* compiler version: 3.15.6
|
||||||
|
* source: srpc.proto
|
||||||
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
|
import * as pb_1 from "google-protobuf";
|
||||||
|
import * as grpc_1 from "@grpc/grpc-js";
|
||||||
|
export declare namespace srpc {
|
||||||
|
export class Empty extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {});
|
||||||
|
static fromObject(data: {}): Empty;
|
||||||
|
toObject(): {};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Empty;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Empty;
|
||||||
|
}
|
||||||
|
export class Default extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
value?: string;
|
||||||
|
});
|
||||||
|
get value(): string;
|
||||||
|
set value(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
value?: string;
|
||||||
|
}): Default;
|
||||||
|
toObject(): {
|
||||||
|
value?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Default;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Default;
|
||||||
|
}
|
||||||
|
export class BucketSetRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
name?: string;
|
||||||
|
key?: string;
|
||||||
|
value?: string;
|
||||||
|
});
|
||||||
|
get name(): string;
|
||||||
|
set name(value: string);
|
||||||
|
get key(): string;
|
||||||
|
set key(value: string);
|
||||||
|
get value(): string;
|
||||||
|
set value(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
name?: string;
|
||||||
|
key?: string;
|
||||||
|
value?: string;
|
||||||
|
}): BucketSetRequest;
|
||||||
|
toObject(): {
|
||||||
|
name?: string | undefined;
|
||||||
|
key?: string | undefined;
|
||||||
|
value?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketSetRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketSetRequest;
|
||||||
|
}
|
||||||
|
export class BucketWatchRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
name?: string;
|
||||||
|
key?: string;
|
||||||
|
message?: string;
|
||||||
|
error?: string;
|
||||||
|
now?: string;
|
||||||
|
echo?: string;
|
||||||
|
plugin_id?: string;
|
||||||
|
});
|
||||||
|
get name(): string;
|
||||||
|
set name(value: string);
|
||||||
|
get key(): string;
|
||||||
|
set key(value: string);
|
||||||
|
get message(): string;
|
||||||
|
set message(value: string);
|
||||||
|
get error(): string;
|
||||||
|
set error(value: string);
|
||||||
|
get now(): string;
|
||||||
|
set now(value: string);
|
||||||
|
get echo(): string;
|
||||||
|
set echo(value: string);
|
||||||
|
get plugin_id(): string;
|
||||||
|
set plugin_id(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
name?: string;
|
||||||
|
key?: string;
|
||||||
|
message?: string;
|
||||||
|
error?: string;
|
||||||
|
now?: string;
|
||||||
|
echo?: string;
|
||||||
|
plugin_id?: string;
|
||||||
|
}): BucketWatchRequest;
|
||||||
|
toObject(): {
|
||||||
|
name?: string | undefined;
|
||||||
|
key?: string | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
error?: string | undefined;
|
||||||
|
now?: string | undefined;
|
||||||
|
echo?: string | undefined;
|
||||||
|
plugin_id?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketWatchRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketWatchRequest;
|
||||||
|
}
|
||||||
|
export class BucketWatchResponse extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
echo?: string;
|
||||||
|
old?: string;
|
||||||
|
now?: string;
|
||||||
|
key?: string;
|
||||||
|
});
|
||||||
|
get echo(): string;
|
||||||
|
set echo(value: string);
|
||||||
|
get old(): string;
|
||||||
|
set old(value: string);
|
||||||
|
get now(): string;
|
||||||
|
set now(value: string);
|
||||||
|
get key(): string;
|
||||||
|
set key(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
echo?: string;
|
||||||
|
old?: string;
|
||||||
|
now?: string;
|
||||||
|
key?: string;
|
||||||
|
}): BucketWatchResponse;
|
||||||
|
toObject(): {
|
||||||
|
echo?: string | undefined;
|
||||||
|
old?: string | undefined;
|
||||||
|
now?: string | undefined;
|
||||||
|
key?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketWatchResponse;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketWatchResponse;
|
||||||
|
}
|
||||||
|
export class BucketSetResponse extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
changed?: boolean;
|
||||||
|
message?: string;
|
||||||
|
});
|
||||||
|
get changed(): boolean;
|
||||||
|
set changed(value: boolean);
|
||||||
|
get message(): string;
|
||||||
|
set message(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
changed?: boolean;
|
||||||
|
message?: string;
|
||||||
|
}): BucketSetResponse;
|
||||||
|
toObject(): {
|
||||||
|
changed?: boolean | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketSetResponse;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketSetResponse;
|
||||||
|
}
|
||||||
|
export class BucketKeyRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
name?: string;
|
||||||
|
key?: string;
|
||||||
|
});
|
||||||
|
get name(): string;
|
||||||
|
set name(value: string);
|
||||||
|
get key(): string;
|
||||||
|
set key(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
name?: string;
|
||||||
|
key?: string;
|
||||||
|
}): BucketKeyRequest;
|
||||||
|
toObject(): {
|
||||||
|
name?: string | undefined;
|
||||||
|
key?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketKeyRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketKeyRequest;
|
||||||
|
}
|
||||||
|
export class BucketRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
name?: string;
|
||||||
|
});
|
||||||
|
get name(): string;
|
||||||
|
set name(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
name?: string;
|
||||||
|
}): BucketRequest;
|
||||||
|
toObject(): {
|
||||||
|
name?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketRequest;
|
||||||
|
}
|
||||||
|
export class BucketKeysResponse extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
keys?: string[];
|
||||||
|
});
|
||||||
|
get keys(): string[];
|
||||||
|
set keys(value: string[]);
|
||||||
|
static fromObject(data: {
|
||||||
|
keys?: string[];
|
||||||
|
}): BucketKeysResponse;
|
||||||
|
toObject(): {
|
||||||
|
keys?: string[] | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketKeysResponse;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketKeysResponse;
|
||||||
|
}
|
||||||
|
export class LenResponse extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
length?: number;
|
||||||
|
});
|
||||||
|
get length(): number;
|
||||||
|
set length(value: number);
|
||||||
|
static fromObject(data: {
|
||||||
|
length?: number;
|
||||||
|
}): LenResponse;
|
||||||
|
toObject(): {
|
||||||
|
length?: number | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): LenResponse;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): LenResponse;
|
||||||
|
}
|
||||||
|
export class BucketsResponse extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
buckets?: string[];
|
||||||
|
});
|
||||||
|
get buckets(): string[];
|
||||||
|
set buckets(value: string[]);
|
||||||
|
static fromObject(data: {
|
||||||
|
buckets?: string[];
|
||||||
|
}): BucketsResponse;
|
||||||
|
toObject(): {
|
||||||
|
buckets?: string[] | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BucketsResponse;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BucketsResponse;
|
||||||
|
}
|
||||||
|
export class SenderRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
uuid?: string;
|
||||||
|
});
|
||||||
|
get uuid(): string;
|
||||||
|
set uuid(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
uuid?: string;
|
||||||
|
}): SenderRequest;
|
||||||
|
toObject(): {
|
||||||
|
uuid?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SenderRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SenderRequest;
|
||||||
|
}
|
||||||
|
export class ReplyRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
uuid?: string;
|
||||||
|
content?: string;
|
||||||
|
});
|
||||||
|
get uuid(): string;
|
||||||
|
set uuid(value: string);
|
||||||
|
get content(): string;
|
||||||
|
set content(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
uuid?: string;
|
||||||
|
content?: string;
|
||||||
|
}): ReplyRequest;
|
||||||
|
toObject(): {
|
||||||
|
uuid?: string | undefined;
|
||||||
|
content?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ReplyRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): ReplyRequest;
|
||||||
|
}
|
||||||
|
export class SenderContentRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
uuid?: string;
|
||||||
|
content?: string;
|
||||||
|
});
|
||||||
|
get uuid(): string;
|
||||||
|
set uuid(value: string);
|
||||||
|
get content(): string;
|
||||||
|
set content(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
uuid?: string;
|
||||||
|
content?: string;
|
||||||
|
}): SenderContentRequest;
|
||||||
|
toObject(): {
|
||||||
|
uuid?: string | undefined;
|
||||||
|
content?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SenderContentRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SenderContentRequest;
|
||||||
|
}
|
||||||
|
export class SenderListenResponse extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
echo?: string;
|
||||||
|
uuid?: string;
|
||||||
|
});
|
||||||
|
get echo(): string;
|
||||||
|
set echo(value: string);
|
||||||
|
get uuid(): string;
|
||||||
|
set uuid(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
echo?: string;
|
||||||
|
uuid?: string;
|
||||||
|
}): SenderListenResponse;
|
||||||
|
toObject(): {
|
||||||
|
echo?: string | undefined;
|
||||||
|
uuid?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SenderListenResponse;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SenderListenResponse;
|
||||||
|
}
|
||||||
|
export class SenderListenRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
uuid?: string;
|
||||||
|
rules?: string[];
|
||||||
|
timeout?: number;
|
||||||
|
listen_group?: boolean;
|
||||||
|
listen_private?: boolean;
|
||||||
|
require_admin?: boolean;
|
||||||
|
allow_platforms?: string[];
|
||||||
|
prohibit_platforms?: string[];
|
||||||
|
allow_users?: string[];
|
||||||
|
prohibit_users?: string[];
|
||||||
|
allow_groups?: string[];
|
||||||
|
prohibit_groups?: string[];
|
||||||
|
persistent?: boolean;
|
||||||
|
value?: string;
|
||||||
|
plugin_id?: string;
|
||||||
|
});
|
||||||
|
get uuid(): string;
|
||||||
|
set uuid(value: string);
|
||||||
|
get rules(): string[];
|
||||||
|
set rules(value: string[]);
|
||||||
|
get timeout(): number;
|
||||||
|
set timeout(value: number);
|
||||||
|
get listen_group(): boolean;
|
||||||
|
set listen_group(value: boolean);
|
||||||
|
get listen_private(): boolean;
|
||||||
|
set listen_private(value: boolean);
|
||||||
|
get require_admin(): boolean;
|
||||||
|
set require_admin(value: boolean);
|
||||||
|
get allow_platforms(): string[];
|
||||||
|
set allow_platforms(value: string[]);
|
||||||
|
get prohibit_platforms(): string[];
|
||||||
|
set prohibit_platforms(value: string[]);
|
||||||
|
get allow_users(): string[];
|
||||||
|
set allow_users(value: string[]);
|
||||||
|
get prohibit_users(): string[];
|
||||||
|
set prohibit_users(value: string[]);
|
||||||
|
get allow_groups(): string[];
|
||||||
|
set allow_groups(value: string[]);
|
||||||
|
get prohibit_groups(): string[];
|
||||||
|
set prohibit_groups(value: string[]);
|
||||||
|
get persistent(): boolean;
|
||||||
|
set persistent(value: boolean);
|
||||||
|
get value(): string;
|
||||||
|
set value(value: string);
|
||||||
|
get plugin_id(): string;
|
||||||
|
set plugin_id(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
uuid?: string;
|
||||||
|
rules?: string[];
|
||||||
|
timeout?: number;
|
||||||
|
listen_group?: boolean;
|
||||||
|
listen_private?: boolean;
|
||||||
|
require_admin?: boolean;
|
||||||
|
allow_platforms?: string[];
|
||||||
|
prohibit_platforms?: string[];
|
||||||
|
allow_users?: string[];
|
||||||
|
prohibit_users?: string[];
|
||||||
|
allow_groups?: string[];
|
||||||
|
prohibit_groups?: string[];
|
||||||
|
persistent?: boolean;
|
||||||
|
value?: string;
|
||||||
|
plugin_id?: string;
|
||||||
|
}): SenderListenRequest;
|
||||||
|
toObject(): {
|
||||||
|
uuid?: string | undefined;
|
||||||
|
rules?: string[] | undefined;
|
||||||
|
timeout?: number | undefined;
|
||||||
|
listen_group?: boolean | undefined;
|
||||||
|
listen_private?: boolean | undefined;
|
||||||
|
require_admin?: boolean | undefined;
|
||||||
|
allow_platforms?: string[] | undefined;
|
||||||
|
prohibit_platforms?: string[] | undefined;
|
||||||
|
allow_users?: string[] | undefined;
|
||||||
|
prohibit_users?: string[] | undefined;
|
||||||
|
allow_groups?: string[] | undefined;
|
||||||
|
prohibit_groups?: string[] | undefined;
|
||||||
|
persistent?: boolean | undefined;
|
||||||
|
value?: string | undefined;
|
||||||
|
plugin_id?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SenderListenRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SenderListenRequest;
|
||||||
|
}
|
||||||
|
export class AdapterRegistRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
platform?: string;
|
||||||
|
bot_id?: string;
|
||||||
|
});
|
||||||
|
get platform(): string;
|
||||||
|
set platform(value: string);
|
||||||
|
get bot_id(): string;
|
||||||
|
set bot_id(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
platform?: string;
|
||||||
|
bot_id?: string;
|
||||||
|
}): AdapterRegistRequest;
|
||||||
|
toObject(): {
|
||||||
|
platform?: string | undefined;
|
||||||
|
bot_id?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AdapterRegistRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): AdapterRegistRequest;
|
||||||
|
}
|
||||||
|
export class AdapterRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
platform?: string;
|
||||||
|
bot_id?: string;
|
||||||
|
value?: string;
|
||||||
|
});
|
||||||
|
get platform(): string;
|
||||||
|
set platform(value: string);
|
||||||
|
get bot_id(): string;
|
||||||
|
set bot_id(value: string);
|
||||||
|
get value(): string;
|
||||||
|
set value(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
platform?: string;
|
||||||
|
bot_id?: string;
|
||||||
|
value?: string;
|
||||||
|
}): AdapterRequest;
|
||||||
|
toObject(): {
|
||||||
|
platform?: string | undefined;
|
||||||
|
bot_id?: string | undefined;
|
||||||
|
value?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AdapterRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): AdapterRequest;
|
||||||
|
}
|
||||||
|
export class Any extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
type_url?: string;
|
||||||
|
value?: Uint8Array;
|
||||||
|
});
|
||||||
|
get type_url(): string;
|
||||||
|
set type_url(value: string);
|
||||||
|
get value(): Uint8Array;
|
||||||
|
set value(value: Uint8Array);
|
||||||
|
static fromObject(data: {
|
||||||
|
type_url?: string;
|
||||||
|
value?: Uint8Array;
|
||||||
|
}): Any;
|
||||||
|
toObject(): {
|
||||||
|
type_url?: string | undefined;
|
||||||
|
value?: Uint8Array | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Any;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Any;
|
||||||
|
}
|
||||||
|
export class ConsoleRequest extends pb_1.Message {
|
||||||
|
#private;
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
type?: string;
|
||||||
|
content?: string;
|
||||||
|
plugin_id?: string;
|
||||||
|
});
|
||||||
|
get type(): string;
|
||||||
|
set type(value: string);
|
||||||
|
get content(): string;
|
||||||
|
set content(value: string);
|
||||||
|
get plugin_id(): string;
|
||||||
|
set plugin_id(value: string);
|
||||||
|
static fromObject(data: {
|
||||||
|
type?: string;
|
||||||
|
content?: string;
|
||||||
|
plugin_id?: string;
|
||||||
|
}): ConsoleRequest;
|
||||||
|
toObject(): {
|
||||||
|
type?: string | undefined;
|
||||||
|
content?: string | undefined;
|
||||||
|
plugin_id?: string | undefined;
|
||||||
|
};
|
||||||
|
serialize(): Uint8Array;
|
||||||
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ConsoleRequest;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): ConsoleRequest;
|
||||||
|
}
|
||||||
|
interface GrpcUnaryServiceInterface<P, R> {
|
||||||
|
(message: P, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
||||||
|
(message: P, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
||||||
|
(message: P, options: grpc_1.CallOptions, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
||||||
|
(message: P, callback: grpc_1.requestCallback<R>): grpc_1.ClientUnaryCall;
|
||||||
|
}
|
||||||
|
interface GrpcChunkServiceInterface<P, R> {
|
||||||
|
(metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream<P, R>;
|
||||||
|
(options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream<P, R>;
|
||||||
|
}
|
||||||
|
export abstract class UnimplementedSillyGirlServiceService {
|
||||||
|
static definition: {
|
||||||
|
BucketGet: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: BucketKeyRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => BucketKeyRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
BucketSet: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: BucketSetRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => BucketSetRequest;
|
||||||
|
responseSerialize: (message: BucketSetResponse) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => BucketSetResponse;
|
||||||
|
};
|
||||||
|
BucketDelete: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: BucketRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => BucketRequest;
|
||||||
|
responseSerialize: (message: Empty) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Empty;
|
||||||
|
};
|
||||||
|
BucketKeys: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: BucketRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => BucketRequest;
|
||||||
|
responseSerialize: (message: BucketKeysResponse) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => BucketKeysResponse;
|
||||||
|
};
|
||||||
|
BucketLen: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: BucketRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => BucketRequest;
|
||||||
|
responseSerialize: (message: LenResponse) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => LenResponse;
|
||||||
|
};
|
||||||
|
BucketGetAll: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: BucketRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => BucketRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
BucketBuckets: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: Empty) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => Empty;
|
||||||
|
responseSerialize: (message: BucketsResponse) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => BucketsResponse;
|
||||||
|
};
|
||||||
|
BucketWatch: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: BucketWatchRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => BucketWatchRequest;
|
||||||
|
responseSerialize: (message: BucketWatchResponse) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => BucketWatchResponse;
|
||||||
|
};
|
||||||
|
SenderGetUserId: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderGetUserName: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderGetChatId: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderGetChatName: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderGetMessageId: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderGetPlatform: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderGetBotId: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderGetContent: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderSetContent: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderContentRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderContentRequest;
|
||||||
|
responseSerialize: (message: Empty) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Empty;
|
||||||
|
};
|
||||||
|
SenderContinue: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Empty) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Empty;
|
||||||
|
};
|
||||||
|
SenderListen: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderListenRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderListenRequest;
|
||||||
|
responseSerialize: (message: SenderListenResponse) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => SenderListenResponse;
|
||||||
|
};
|
||||||
|
SenderEvent: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: SenderRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => SenderRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderReply: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: ReplyRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => ReplyRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderParam: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: ReplyRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => ReplyRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderAction: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: ReplyRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => ReplyRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
SenderDestroy: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: ReplyRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => ReplyRequest;
|
||||||
|
responseSerialize: (message: Empty) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Empty;
|
||||||
|
};
|
||||||
|
AdapterRegist: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: AdapterRegistRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => AdapterRegistRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
AdapterReceive: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: AdapterRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => AdapterRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
AdapterPush: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: AdapterRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => AdapterRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
AdapterDestroy: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: AdapterRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => AdapterRequest;
|
||||||
|
responseSerialize: (message: Empty) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Empty;
|
||||||
|
};
|
||||||
|
AdapterSender: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: AdapterRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => AdapterRequest;
|
||||||
|
responseSerialize: (message: Default) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Default;
|
||||||
|
};
|
||||||
|
Console: {
|
||||||
|
path: string;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestSerialize: (message: ConsoleRequest) => Buffer;
|
||||||
|
requestDeserialize: (bytes: Buffer) => ConsoleRequest;
|
||||||
|
responseSerialize: (message: Empty) => Buffer;
|
||||||
|
responseDeserialize: (bytes: Buffer) => Empty;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
[method: string]: grpc_1.UntypedHandleCall;
|
||||||
|
abstract BucketGet(call: grpc_1.ServerUnaryCall<BucketKeyRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract BucketSet(call: grpc_1.ServerUnaryCall<BucketSetRequest, BucketSetResponse>, callback: grpc_1.sendUnaryData<BucketSetResponse>): void;
|
||||||
|
abstract BucketDelete(call: grpc_1.ServerUnaryCall<BucketRequest, Empty>, callback: grpc_1.sendUnaryData<Empty>): void;
|
||||||
|
abstract BucketKeys(call: grpc_1.ServerUnaryCall<BucketRequest, BucketKeysResponse>, callback: grpc_1.sendUnaryData<BucketKeysResponse>): void;
|
||||||
|
abstract BucketLen(call: grpc_1.ServerUnaryCall<BucketRequest, LenResponse>, callback: grpc_1.sendUnaryData<LenResponse>): void;
|
||||||
|
abstract BucketGetAll(call: grpc_1.ServerUnaryCall<BucketRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract BucketBuckets(call: grpc_1.ServerUnaryCall<Empty, BucketsResponse>, callback: grpc_1.sendUnaryData<BucketsResponse>): void;
|
||||||
|
abstract BucketWatch(call: grpc_1.ServerDuplexStream<BucketWatchRequest, BucketWatchResponse>): void;
|
||||||
|
abstract SenderGetUserId(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderGetUserName(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderGetChatId(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderGetChatName(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderGetMessageId(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderGetPlatform(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderGetBotId(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderGetContent(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderSetContent(call: grpc_1.ServerUnaryCall<SenderContentRequest, Empty>, callback: grpc_1.sendUnaryData<Empty>): void;
|
||||||
|
abstract SenderContinue(call: grpc_1.ServerUnaryCall<SenderRequest, Empty>, callback: grpc_1.sendUnaryData<Empty>): void;
|
||||||
|
abstract SenderListen(call: grpc_1.ServerDuplexStream<SenderListenRequest, SenderListenResponse>): void;
|
||||||
|
abstract SenderEvent(call: grpc_1.ServerUnaryCall<SenderRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderReply(call: grpc_1.ServerUnaryCall<ReplyRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderParam(call: grpc_1.ServerUnaryCall<ReplyRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderAction(call: grpc_1.ServerUnaryCall<ReplyRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract SenderDestroy(call: grpc_1.ServerUnaryCall<ReplyRequest, Empty>, callback: grpc_1.sendUnaryData<Empty>): void;
|
||||||
|
abstract AdapterRegist(call: grpc_1.ServerDuplexStream<AdapterRegistRequest, Default>): void;
|
||||||
|
abstract AdapterReceive(call: grpc_1.ServerUnaryCall<AdapterRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract AdapterPush(call: grpc_1.ServerUnaryCall<AdapterRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract AdapterDestroy(call: grpc_1.ServerUnaryCall<AdapterRequest, Empty>, callback: grpc_1.sendUnaryData<Empty>): void;
|
||||||
|
abstract AdapterSender(call: grpc_1.ServerUnaryCall<AdapterRequest, Default>, callback: grpc_1.sendUnaryData<Default>): void;
|
||||||
|
abstract Console(call: grpc_1.ServerUnaryCall<ConsoleRequest, Empty>, callback: grpc_1.sendUnaryData<Empty>): void;
|
||||||
|
}
|
||||||
|
const SillyGirlServiceClient_base: grpc_1.ServiceClientConstructor;
|
||||||
|
export class SillyGirlServiceClient extends SillyGirlServiceClient_base {
|
||||||
|
constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial<grpc_1.ChannelOptions>);
|
||||||
|
BucketGet: GrpcUnaryServiceInterface<BucketKeyRequest, Default>;
|
||||||
|
BucketSet: GrpcUnaryServiceInterface<BucketSetRequest, BucketSetResponse>;
|
||||||
|
BucketDelete: GrpcUnaryServiceInterface<BucketRequest, Empty>;
|
||||||
|
BucketKeys: GrpcUnaryServiceInterface<BucketRequest, BucketKeysResponse>;
|
||||||
|
BucketLen: GrpcUnaryServiceInterface<BucketRequest, LenResponse>;
|
||||||
|
BucketGetAll: GrpcUnaryServiceInterface<BucketRequest, Default>;
|
||||||
|
BucketBuckets: GrpcUnaryServiceInterface<Empty, BucketsResponse>;
|
||||||
|
BucketWatch: GrpcChunkServiceInterface<BucketWatchRequest, BucketWatchResponse>;
|
||||||
|
SenderGetUserId: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderGetUserName: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderGetChatId: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderGetChatName: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderGetMessageId: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderGetPlatform: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderGetBotId: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderGetContent: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderSetContent: GrpcUnaryServiceInterface<SenderContentRequest, Empty>;
|
||||||
|
SenderContinue: GrpcUnaryServiceInterface<SenderRequest, Empty>;
|
||||||
|
SenderListen: GrpcChunkServiceInterface<SenderListenRequest, SenderListenResponse>;
|
||||||
|
SenderEvent: GrpcUnaryServiceInterface<SenderRequest, Default>;
|
||||||
|
SenderReply: GrpcUnaryServiceInterface<ReplyRequest, Default>;
|
||||||
|
SenderParam: GrpcUnaryServiceInterface<ReplyRequest, Default>;
|
||||||
|
SenderAction: GrpcUnaryServiceInterface<ReplyRequest, Default>;
|
||||||
|
SenderDestroy: GrpcUnaryServiceInterface<ReplyRequest, Empty>;
|
||||||
|
AdapterRegist: GrpcChunkServiceInterface<AdapterRegistRequest, Default>;
|
||||||
|
AdapterReceive: GrpcUnaryServiceInterface<AdapterRequest, Default>;
|
||||||
|
AdapterPush: GrpcUnaryServiceInterface<AdapterRequest, Default>;
|
||||||
|
AdapterDestroy: GrpcUnaryServiceInterface<AdapterRequest, Empty>;
|
||||||
|
AdapterSender: GrpcUnaryServiceInterface<AdapterRequest, Default>;
|
||||||
|
Console: GrpcUnaryServiceInterface<ConsoleRequest, Empty>;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
|
}
|
||||||
+2306
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -114,7 +114,7 @@ message Any {
|
|||||||
|
|
||||||
message ConsoleRequest {
|
message ConsoleRequest {
|
||||||
string type = 1;
|
string type = 1;
|
||||||
repeated Any logs = 2;
|
string content = 2;
|
||||||
string plugin_id = 3;
|
string plugin_id = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-17
@@ -2038,17 +2038,17 @@ export namespace srpc {
|
|||||||
#one_of_decls: number[][] = [];
|
#one_of_decls: number[][] = [];
|
||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
type?: string;
|
type?: string;
|
||||||
logs?: Any[];
|
content?: string;
|
||||||
plugin_id?: string;
|
plugin_id?: string;
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||||
if (!Array.isArray(data) && typeof data == "object") {
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
if ("type" in data && data.type != undefined) {
|
if ("type" in data && data.type != undefined) {
|
||||||
this.type = data.type;
|
this.type = data.type;
|
||||||
}
|
}
|
||||||
if ("logs" in data && data.logs != undefined) {
|
if ("content" in data && data.content != undefined) {
|
||||||
this.logs = data.logs;
|
this.content = data.content;
|
||||||
}
|
}
|
||||||
if ("plugin_id" in data && data.plugin_id != undefined) {
|
if ("plugin_id" in data && data.plugin_id != undefined) {
|
||||||
this.plugin_id = data.plugin_id;
|
this.plugin_id = data.plugin_id;
|
||||||
@@ -2061,11 +2061,11 @@ export namespace srpc {
|
|||||||
set type(value: string) {
|
set type(value: string) {
|
||||||
pb_1.Message.setField(this, 1, value);
|
pb_1.Message.setField(this, 1, value);
|
||||||
}
|
}
|
||||||
get logs() {
|
get content() {
|
||||||
return pb_1.Message.getRepeatedWrapperField(this, Any, 2) as Any[];
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||||
}
|
}
|
||||||
set logs(value: Any[]) {
|
set content(value: string) {
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
pb_1.Message.setField(this, 2, value);
|
||||||
}
|
}
|
||||||
get plugin_id() {
|
get plugin_id() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||||
@@ -2075,15 +2075,15 @@ export namespace srpc {
|
|||||||
}
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
type?: string;
|
type?: string;
|
||||||
logs?: ReturnType<typeof Any.prototype.toObject>[];
|
content?: string;
|
||||||
plugin_id?: string;
|
plugin_id?: string;
|
||||||
}): ConsoleRequest {
|
}): ConsoleRequest {
|
||||||
const message = new ConsoleRequest({});
|
const message = new ConsoleRequest({});
|
||||||
if (data.type != null) {
|
if (data.type != null) {
|
||||||
message.type = data.type;
|
message.type = data.type;
|
||||||
}
|
}
|
||||||
if (data.logs != null) {
|
if (data.content != null) {
|
||||||
message.logs = data.logs.map(item => Any.fromObject(item));
|
message.content = data.content;
|
||||||
}
|
}
|
||||||
if (data.plugin_id != null) {
|
if (data.plugin_id != null) {
|
||||||
message.plugin_id = data.plugin_id;
|
message.plugin_id = data.plugin_id;
|
||||||
@@ -2093,14 +2093,14 @@ export namespace srpc {
|
|||||||
toObject() {
|
toObject() {
|
||||||
const data: {
|
const data: {
|
||||||
type?: string;
|
type?: string;
|
||||||
logs?: ReturnType<typeof Any.prototype.toObject>[];
|
content?: string;
|
||||||
plugin_id?: string;
|
plugin_id?: string;
|
||||||
} = {};
|
} = {};
|
||||||
if (this.type != null) {
|
if (this.type != null) {
|
||||||
data.type = this.type;
|
data.type = this.type;
|
||||||
}
|
}
|
||||||
if (this.logs != null) {
|
if (this.content != null) {
|
||||||
data.logs = this.logs.map((item: Any) => item.toObject());
|
data.content = this.content;
|
||||||
}
|
}
|
||||||
if (this.plugin_id != null) {
|
if (this.plugin_id != null) {
|
||||||
data.plugin_id = this.plugin_id;
|
data.plugin_id = this.plugin_id;
|
||||||
@@ -2113,8 +2113,8 @@ export namespace srpc {
|
|||||||
const writer = w || new pb_1.BinaryWriter();
|
const writer = w || new pb_1.BinaryWriter();
|
||||||
if (this.type.length)
|
if (this.type.length)
|
||||||
writer.writeString(1, this.type);
|
writer.writeString(1, this.type);
|
||||||
if (this.logs.length)
|
if (this.content.length)
|
||||||
writer.writeRepeatedMessage(2, this.logs, (item: Any) => item.serialize(writer));
|
writer.writeString(2, this.content);
|
||||||
if (this.plugin_id.length)
|
if (this.plugin_id.length)
|
||||||
writer.writeString(3, this.plugin_id);
|
writer.writeString(3, this.plugin_id);
|
||||||
if (!w)
|
if (!w)
|
||||||
@@ -2130,7 +2130,7 @@ export namespace srpc {
|
|||||||
message.type = reader.readString();
|
message.type = reader.readString();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
reader.readMessage(message.logs, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Any.deserialize(reader), Any));
|
message.content = reader.readString();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
message.plugin_id = reader.readString();
|
message.plugin_id = reader.readString();
|
||||||
|
|||||||
+176
-177
@@ -1182,7 +1182,7 @@ type ConsoleRequest struct {
|
|||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||||
Logs []*Any `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"`
|
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
|
||||||
PluginId string `protobuf:"bytes,3,opt,name=plugin_id,json=pluginId,proto3" json:"plugin_id,omitempty"`
|
PluginId string `protobuf:"bytes,3,opt,name=plugin_id,json=pluginId,proto3" json:"plugin_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1225,11 +1225,11 @@ func (x *ConsoleRequest) GetType() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ConsoleRequest) GetLogs() []*Any {
|
func (x *ConsoleRequest) GetContent() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Logs
|
return x.Content
|
||||||
}
|
}
|
||||||
return nil
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ConsoleRequest) GetPluginId() string {
|
func (x *ConsoleRequest) GetPluginId() string {
|
||||||
@@ -1347,119 +1347,119 @@ var file_srpc_proto_rawDesc = []byte{
|
|||||||
0x41, 0x6e, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18,
|
0x41, 0x6e, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x14,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x14,
|
||||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76,
|
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76,
|
||||||
0x61, 0x6c, 0x75, 0x65, 0x22, 0x60, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52,
|
0x61, 0x6c, 0x75, 0x65, 0x22, 0x5b, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x04, 0x6c, 0x6f,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
|
||||||
0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
|
||||||
0x41, 0x6e, 0x79, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x75,
|
0x74, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69,
|
||||||
0x67, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c,
|
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49,
|
||||||
0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x32, 0x96, 0x0d, 0x0a, 0x10, 0x53, 0x69, 0x6c, 0x6c, 0x79,
|
0x64, 0x32, 0x96, 0x0d, 0x0a, 0x10, 0x53, 0x69, 0x6c, 0x6c, 0x79, 0x47, 0x69, 0x72, 0x6c, 0x53,
|
||||||
0x47, 0x69, 0x72, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x42,
|
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74,
|
||||||
0x75, 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
0x47, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65,
|
||||||
0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72,
|
||||||
0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12,
|
0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x3c, 0x0a, 0x09, 0x42, 0x75,
|
||||||
0x3c, 0x0a, 0x09, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x73,
|
0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42,
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71,
|
0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b,
|
0x17, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x74,
|
||||||
0x65, 0x74, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0c, 0x42, 0x75, 0x63, 0x6b,
|
||||||
0x0c, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e,
|
0x65, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
||||||
0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e,
|
||||||
0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12,
|
0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x0a, 0x42, 0x75,
|
||||||
0x3b, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x13, 0x2e,
|
0x63, 0x6b, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
||||||
0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e,
|
||||||
0x73, 0x74, 0x1a, 0x18, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74,
|
0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x52,
|
||||||
0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x42, 0x75, 0x63, 0x6b, 0x65,
|
||||||
0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x6e, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
0x74, 0x4c, 0x65, 0x6e, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b,
|
||||||
0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11,
|
0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
||||||
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x2e, 0x4c, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x0c,
|
||||||
0x65, 0x12, 0x32, 0x0a, 0x0c, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x74, 0x41, 0x6c,
|
0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x13, 0x2e, 0x73,
|
||||||
0x6c, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52,
|
0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65,
|
0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
|
||||||
0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42,
|
0x12, 0x33, 0x0a, 0x0d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74,
|
||||||
0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d,
|
0x73, 0x12, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15,
|
||||||
0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65,
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73,
|
||||||
0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x42, 0x75,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x57,
|
||||||
0x63, 0x6b, 0x65, 0x74, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
0x61, 0x74, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b,
|
||||||
0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75,
|
0x65, 0x74, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65,
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x57, 0x61, 0x74, 0x63,
|
||||||
0x74, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01,
|
0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a,
|
||||||
0x30, 0x01, 0x12, 0x35, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x55,
|
0x0f, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
|
||||||
0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e,
|
0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65,
|
||||||
0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70,
|
|
||||||
0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x11, 0x53, 0x65, 0x6e,
|
|
||||||
0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x13,
|
|
||||||
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
|
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75,
|
|
||||||
0x6c, 0x74, 0x12, 0x35, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x43,
|
|
||||||
0x68, 0x61, 0x74, 0x49, 0x64, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e,
|
|
||||||
0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70,
|
|
||||||
0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x11, 0x53, 0x65, 0x6e,
|
|
||||||
0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x13,
|
|
||||||
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
|
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75,
|
|
||||||
0x6c, 0x74, 0x12, 0x38, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x4d,
|
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
|
||||||
0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e,
|
|
||||||
0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x11,
|
|
||||||
0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72,
|
|
||||||
0x6d, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52,
|
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65,
|
|
||||||
0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x34, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47,
|
|
||||||
0x65, 0x74, 0x42, 0x6f, 0x74, 0x49, 0x64, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53,
|
|
||||||
0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73,
|
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x10, 0x53,
|
|
||||||
0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12,
|
|
||||||
0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71,
|
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61,
|
|
||||||
0x75, 0x6c, 0x74, 0x12, 0x3b, 0x0a, 0x10, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x65, 0x74,
|
|
||||||
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53,
|
|
||||||
0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75,
|
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
|
|
||||||
0x12, 0x32, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e,
|
|
||||||
0x75, 0x65, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72,
|
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45,
|
|
||||||
0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69,
|
|
||||||
0x73, 0x74, 0x65, 0x6e, 0x12, 0x19, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64,
|
|
||||||
0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
|
||||||
0x1a, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73,
|
|
||||||
0x74, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12,
|
|
||||||
0x31, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x13,
|
|
||||||
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
|
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75,
|
|
||||||
0x6c, 0x74, 0x12, 0x30, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c,
|
|
||||||
0x79, 0x12, 0x12, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x65,
|
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66,
|
||||||
0x61, 0x75, 0x6c, 0x74, 0x12, 0x30, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x61,
|
0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65,
|
||||||
0x72, 0x61, 0x6d, 0x12, 0x12, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79,
|
0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
||||||
|
0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d,
|
||||||
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x35, 0x0a,
|
||||||
|
0x0f, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x49, 0x64,
|
||||||
|
0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66,
|
||||||
|
0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65,
|
||||||
|
0x74, 0x43, 0x68, 0x61, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
||||||
|
0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d,
|
||||||
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x38, 0x0a,
|
||||||
|
0x12, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||||
|
0x65, 0x49, 0x64, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65,
|
||||||
|
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
||||||
|
0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x65,
|
||||||
|
0x72, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x13, 0x2e, 0x73,
|
||||||
|
0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
|
||||||
|
0x12, 0x34, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x74,
|
||||||
|
0x49, 0x64, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44,
|
||||||
0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72,
|
0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x10, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72,
|
||||||
0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70,
|
||||||
0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70,
|
0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x30, 0x0a, 0x0d, 0x53, 0x65, 0x6e,
|
0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x3b,
|
||||||
0x64, 0x65, 0x72, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x12, 0x2e, 0x73, 0x72, 0x70,
|
0x0a, 0x10, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65,
|
||||||
0x63, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b,
|
0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72,
|
||||||
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3e, 0x0a, 0x0d, 0x41,
|
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b,
|
||||||
0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x73,
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x32, 0x0a, 0x0e, 0x53,
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73,
|
0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x12, 0x13, 0x2e,
|
||||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a, 0x0e, 0x41,
|
0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12,
|
||||||
0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x12, 0x14, 0x2e,
|
0x49, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x12,
|
||||||
0x73, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
|
0x19, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73,
|
||||||
|
0x74, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x72, 0x70,
|
||||||
|
0x63, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x52, 0x65,
|
||||||
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x31, 0x0a, 0x0b, 0x53, 0x65,
|
||||||
|
0x6e, 0x64, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
||||||
|
0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d,
|
||||||
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x30, 0x0a,
|
||||||
|
0x0b, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x2e, 0x73,
|
||||||
|
0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
|
0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12,
|
||||||
|
0x30, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x12,
|
||||||
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
|
0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
||||||
|
0x74, 0x12, 0x31, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x12, 0x12, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66,
|
||||||
|
0x61, 0x75, 0x6c, 0x74, 0x12, 0x30, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x44, 0x65,
|
||||||
|
0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x12, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x70,
|
||||||
|
0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
||||||
|
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3e, 0x0a, 0x0d, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65,
|
||||||
|
0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x41,
|
||||||
|
0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75,
|
0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75,
|
||||||
0x6c, 0x74, 0x12, 0x32, 0x0a, 0x0b, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x50, 0x75, 0x73,
|
0x6c, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x35, 0x0a, 0x0e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65,
|
||||||
0x68, 0x12, 0x14, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72,
|
0x72, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44,
|
0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d,
|
||||||
0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x33, 0x0a, 0x0e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65,
|
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a,
|
||||||
0x72, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x14, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e,
|
0x0b, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x14, 0x2e, 0x73,
|
||||||
0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b,
|
|
||||||
0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x0d, 0x41,
|
|
||||||
0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x73,
|
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,
|
||||||
0x74, 0x12, 0x2c, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x2e, 0x73,
|
0x74, 0x12, 0x33, 0x0a, 0x0e, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x44, 0x65, 0x73, 0x74,
|
||||||
0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x72, 0x6f, 0x79, 0x12, 0x14, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x64, 0x61, 0x70, 0x74,
|
||||||
0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42,
|
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x73, 0x72, 0x70, 0x63,
|
||||||
0x07, 0x5a, 0x05, 0x73, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x0d, 0x41, 0x64, 0x61, 0x70, 0x74, 0x65,
|
||||||
|
0x72, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x41,
|
||||||
|
0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e,
|
||||||
|
0x73, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x2c, 0x0a, 0x07,
|
||||||
|
0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x2e, 0x73, 0x72, 0x70, 0x63, 0x2e, 0x43,
|
||||||
|
0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e,
|
||||||
|
0x73, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x07, 0x5a, 0x05, 0x73, 0x72,
|
||||||
|
0x70, 0x63, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -1498,72 +1498,71 @@ var file_srpc_proto_goTypes = []interface{}{
|
|||||||
(*ConsoleRequest)(nil), // 19: srpc.ConsoleRequest
|
(*ConsoleRequest)(nil), // 19: srpc.ConsoleRequest
|
||||||
}
|
}
|
||||||
var file_srpc_proto_depIdxs = []int32{
|
var file_srpc_proto_depIdxs = []int32{
|
||||||
18, // 0: srpc.ConsoleRequest.logs:type_name -> srpc.Any
|
6, // 0: srpc.SillyGirlService.BucketGet:input_type -> srpc.BucketKeyRequest
|
||||||
6, // 1: srpc.SillyGirlService.BucketGet:input_type -> srpc.BucketKeyRequest
|
2, // 1: srpc.SillyGirlService.BucketSet:input_type -> srpc.BucketSetRequest
|
||||||
2, // 2: srpc.SillyGirlService.BucketSet:input_type -> srpc.BucketSetRequest
|
7, // 2: srpc.SillyGirlService.BucketDelete:input_type -> srpc.BucketRequest
|
||||||
7, // 3: srpc.SillyGirlService.BucketDelete:input_type -> srpc.BucketRequest
|
7, // 3: srpc.SillyGirlService.BucketKeys:input_type -> srpc.BucketRequest
|
||||||
7, // 4: srpc.SillyGirlService.BucketKeys:input_type -> srpc.BucketRequest
|
7, // 4: srpc.SillyGirlService.BucketLen:input_type -> srpc.BucketRequest
|
||||||
7, // 5: srpc.SillyGirlService.BucketLen:input_type -> srpc.BucketRequest
|
7, // 5: srpc.SillyGirlService.BucketGetAll:input_type -> srpc.BucketRequest
|
||||||
7, // 6: srpc.SillyGirlService.BucketGetAll:input_type -> srpc.BucketRequest
|
0, // 6: srpc.SillyGirlService.BucketBuckets:input_type -> srpc.Empty
|
||||||
0, // 7: srpc.SillyGirlService.BucketBuckets:input_type -> srpc.Empty
|
3, // 7: srpc.SillyGirlService.BucketWatch:input_type -> srpc.BucketWatchRequest
|
||||||
3, // 8: srpc.SillyGirlService.BucketWatch:input_type -> srpc.BucketWatchRequest
|
11, // 8: srpc.SillyGirlService.SenderGetUserId:input_type -> srpc.SenderRequest
|
||||||
11, // 9: srpc.SillyGirlService.SenderGetUserId:input_type -> srpc.SenderRequest
|
11, // 9: srpc.SillyGirlService.SenderGetUserName:input_type -> srpc.SenderRequest
|
||||||
11, // 10: srpc.SillyGirlService.SenderGetUserName:input_type -> srpc.SenderRequest
|
11, // 10: srpc.SillyGirlService.SenderGetChatId:input_type -> srpc.SenderRequest
|
||||||
11, // 11: srpc.SillyGirlService.SenderGetChatId:input_type -> srpc.SenderRequest
|
11, // 11: srpc.SillyGirlService.SenderGetChatName:input_type -> srpc.SenderRequest
|
||||||
11, // 12: srpc.SillyGirlService.SenderGetChatName:input_type -> srpc.SenderRequest
|
11, // 12: srpc.SillyGirlService.SenderGetMessageId:input_type -> srpc.SenderRequest
|
||||||
11, // 13: srpc.SillyGirlService.SenderGetMessageId:input_type -> srpc.SenderRequest
|
11, // 13: srpc.SillyGirlService.SenderGetPlatform:input_type -> srpc.SenderRequest
|
||||||
11, // 14: srpc.SillyGirlService.SenderGetPlatform:input_type -> srpc.SenderRequest
|
11, // 14: srpc.SillyGirlService.SenderGetBotId:input_type -> srpc.SenderRequest
|
||||||
11, // 15: srpc.SillyGirlService.SenderGetBotId:input_type -> srpc.SenderRequest
|
11, // 15: srpc.SillyGirlService.SenderGetContent:input_type -> srpc.SenderRequest
|
||||||
11, // 16: srpc.SillyGirlService.SenderGetContent:input_type -> srpc.SenderRequest
|
13, // 16: srpc.SillyGirlService.SenderSetContent:input_type -> srpc.SenderContentRequest
|
||||||
13, // 17: srpc.SillyGirlService.SenderSetContent:input_type -> srpc.SenderContentRequest
|
11, // 17: srpc.SillyGirlService.SenderContinue:input_type -> srpc.SenderRequest
|
||||||
11, // 18: srpc.SillyGirlService.SenderContinue:input_type -> srpc.SenderRequest
|
15, // 18: srpc.SillyGirlService.SenderListen:input_type -> srpc.SenderListenRequest
|
||||||
15, // 19: srpc.SillyGirlService.SenderListen:input_type -> srpc.SenderListenRequest
|
11, // 19: srpc.SillyGirlService.SenderEvent:input_type -> srpc.SenderRequest
|
||||||
11, // 20: srpc.SillyGirlService.SenderEvent:input_type -> srpc.SenderRequest
|
12, // 20: srpc.SillyGirlService.SenderReply:input_type -> srpc.ReplyRequest
|
||||||
12, // 21: srpc.SillyGirlService.SenderReply:input_type -> srpc.ReplyRequest
|
12, // 21: srpc.SillyGirlService.SenderParam:input_type -> srpc.ReplyRequest
|
||||||
12, // 22: srpc.SillyGirlService.SenderParam:input_type -> srpc.ReplyRequest
|
12, // 22: srpc.SillyGirlService.SenderAction:input_type -> srpc.ReplyRequest
|
||||||
12, // 23: srpc.SillyGirlService.SenderAction:input_type -> srpc.ReplyRequest
|
12, // 23: srpc.SillyGirlService.SenderDestroy:input_type -> srpc.ReplyRequest
|
||||||
12, // 24: srpc.SillyGirlService.SenderDestroy:input_type -> srpc.ReplyRequest
|
16, // 24: srpc.SillyGirlService.AdapterRegist:input_type -> srpc.AdapterRegistRequest
|
||||||
16, // 25: srpc.SillyGirlService.AdapterRegist:input_type -> srpc.AdapterRegistRequest
|
17, // 25: srpc.SillyGirlService.AdapterReceive:input_type -> srpc.AdapterRequest
|
||||||
17, // 26: srpc.SillyGirlService.AdapterReceive:input_type -> srpc.AdapterRequest
|
17, // 26: srpc.SillyGirlService.AdapterPush:input_type -> srpc.AdapterRequest
|
||||||
17, // 27: srpc.SillyGirlService.AdapterPush:input_type -> srpc.AdapterRequest
|
17, // 27: srpc.SillyGirlService.AdapterDestroy:input_type -> srpc.AdapterRequest
|
||||||
17, // 28: srpc.SillyGirlService.AdapterDestroy:input_type -> srpc.AdapterRequest
|
17, // 28: srpc.SillyGirlService.AdapterSender:input_type -> srpc.AdapterRequest
|
||||||
17, // 29: srpc.SillyGirlService.AdapterSender:input_type -> srpc.AdapterRequest
|
19, // 29: srpc.SillyGirlService.Console:input_type -> srpc.ConsoleRequest
|
||||||
19, // 30: srpc.SillyGirlService.Console:input_type -> srpc.ConsoleRequest
|
1, // 30: srpc.SillyGirlService.BucketGet:output_type -> srpc.Default
|
||||||
1, // 31: srpc.SillyGirlService.BucketGet:output_type -> srpc.Default
|
5, // 31: srpc.SillyGirlService.BucketSet:output_type -> srpc.BucketSetResponse
|
||||||
5, // 32: srpc.SillyGirlService.BucketSet:output_type -> srpc.BucketSetResponse
|
0, // 32: srpc.SillyGirlService.BucketDelete:output_type -> srpc.Empty
|
||||||
0, // 33: srpc.SillyGirlService.BucketDelete:output_type -> srpc.Empty
|
8, // 33: srpc.SillyGirlService.BucketKeys:output_type -> srpc.BucketKeysResponse
|
||||||
8, // 34: srpc.SillyGirlService.BucketKeys:output_type -> srpc.BucketKeysResponse
|
9, // 34: srpc.SillyGirlService.BucketLen:output_type -> srpc.LenResponse
|
||||||
9, // 35: srpc.SillyGirlService.BucketLen:output_type -> srpc.LenResponse
|
1, // 35: srpc.SillyGirlService.BucketGetAll:output_type -> srpc.Default
|
||||||
1, // 36: srpc.SillyGirlService.BucketGetAll:output_type -> srpc.Default
|
10, // 36: srpc.SillyGirlService.BucketBuckets:output_type -> srpc.BucketsResponse
|
||||||
10, // 37: srpc.SillyGirlService.BucketBuckets:output_type -> srpc.BucketsResponse
|
4, // 37: srpc.SillyGirlService.BucketWatch:output_type -> srpc.BucketWatchResponse
|
||||||
4, // 38: srpc.SillyGirlService.BucketWatch:output_type -> srpc.BucketWatchResponse
|
1, // 38: srpc.SillyGirlService.SenderGetUserId:output_type -> srpc.Default
|
||||||
1, // 39: srpc.SillyGirlService.SenderGetUserId:output_type -> srpc.Default
|
1, // 39: srpc.SillyGirlService.SenderGetUserName:output_type -> srpc.Default
|
||||||
1, // 40: srpc.SillyGirlService.SenderGetUserName:output_type -> srpc.Default
|
1, // 40: srpc.SillyGirlService.SenderGetChatId:output_type -> srpc.Default
|
||||||
1, // 41: srpc.SillyGirlService.SenderGetChatId:output_type -> srpc.Default
|
1, // 41: srpc.SillyGirlService.SenderGetChatName:output_type -> srpc.Default
|
||||||
1, // 42: srpc.SillyGirlService.SenderGetChatName:output_type -> srpc.Default
|
1, // 42: srpc.SillyGirlService.SenderGetMessageId:output_type -> srpc.Default
|
||||||
1, // 43: srpc.SillyGirlService.SenderGetMessageId:output_type -> srpc.Default
|
1, // 43: srpc.SillyGirlService.SenderGetPlatform:output_type -> srpc.Default
|
||||||
1, // 44: srpc.SillyGirlService.SenderGetPlatform:output_type -> srpc.Default
|
1, // 44: srpc.SillyGirlService.SenderGetBotId:output_type -> srpc.Default
|
||||||
1, // 45: srpc.SillyGirlService.SenderGetBotId:output_type -> srpc.Default
|
1, // 45: srpc.SillyGirlService.SenderGetContent:output_type -> srpc.Default
|
||||||
1, // 46: srpc.SillyGirlService.SenderGetContent:output_type -> srpc.Default
|
0, // 46: srpc.SillyGirlService.SenderSetContent:output_type -> srpc.Empty
|
||||||
0, // 47: srpc.SillyGirlService.SenderSetContent:output_type -> srpc.Empty
|
0, // 47: srpc.SillyGirlService.SenderContinue:output_type -> srpc.Empty
|
||||||
0, // 48: srpc.SillyGirlService.SenderContinue:output_type -> srpc.Empty
|
14, // 48: srpc.SillyGirlService.SenderListen:output_type -> srpc.SenderListenResponse
|
||||||
14, // 49: srpc.SillyGirlService.SenderListen:output_type -> srpc.SenderListenResponse
|
1, // 49: srpc.SillyGirlService.SenderEvent:output_type -> srpc.Default
|
||||||
1, // 50: srpc.SillyGirlService.SenderEvent:output_type -> srpc.Default
|
1, // 50: srpc.SillyGirlService.SenderReply:output_type -> srpc.Default
|
||||||
1, // 51: srpc.SillyGirlService.SenderReply:output_type -> srpc.Default
|
1, // 51: srpc.SillyGirlService.SenderParam:output_type -> srpc.Default
|
||||||
1, // 52: srpc.SillyGirlService.SenderParam:output_type -> srpc.Default
|
1, // 52: srpc.SillyGirlService.SenderAction:output_type -> srpc.Default
|
||||||
1, // 53: srpc.SillyGirlService.SenderAction:output_type -> srpc.Default
|
0, // 53: srpc.SillyGirlService.SenderDestroy:output_type -> srpc.Empty
|
||||||
0, // 54: srpc.SillyGirlService.SenderDestroy:output_type -> srpc.Empty
|
1, // 54: srpc.SillyGirlService.AdapterRegist:output_type -> srpc.Default
|
||||||
1, // 55: srpc.SillyGirlService.AdapterRegist:output_type -> srpc.Default
|
1, // 55: srpc.SillyGirlService.AdapterReceive:output_type -> srpc.Default
|
||||||
1, // 56: srpc.SillyGirlService.AdapterReceive:output_type -> srpc.Default
|
1, // 56: srpc.SillyGirlService.AdapterPush:output_type -> srpc.Default
|
||||||
1, // 57: srpc.SillyGirlService.AdapterPush:output_type -> srpc.Default
|
0, // 57: srpc.SillyGirlService.AdapterDestroy:output_type -> srpc.Empty
|
||||||
0, // 58: srpc.SillyGirlService.AdapterDestroy:output_type -> srpc.Empty
|
1, // 58: srpc.SillyGirlService.AdapterSender:output_type -> srpc.Default
|
||||||
1, // 59: srpc.SillyGirlService.AdapterSender:output_type -> srpc.Default
|
0, // 59: srpc.SillyGirlService.Console:output_type -> srpc.Empty
|
||||||
0, // 60: srpc.SillyGirlService.Console:output_type -> srpc.Empty
|
30, // [30:60] is the sub-list for method output_type
|
||||||
31, // [31:61] is the sub-list for method output_type
|
0, // [0:30] is the sub-list for method input_type
|
||||||
1, // [1:31] is the sub-list for method input_type
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
1, // [1:1] is the sub-list for extension type_name
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
1, // [1:1] is the sub-list for extension extendee
|
0, // [0:0] is the sub-list for field type_name
|
||||||
0, // [0:1] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_srpc_proto_init() }
|
func init() { file_srpc_proto_init() }
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||||
|
|
||||||
|
/* Projects */
|
||||||
|
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
||||||
|
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||||
|
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
||||||
|
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
||||||
|
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||||
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||||
|
|
||||||
|
/* Language and Environment */
|
||||||
|
"target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||||
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||||
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||||
|
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
||||||
|
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||||
|
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||||
|
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||||
|
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||||
|
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||||
|
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||||
|
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||||
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||||
|
|
||||||
|
/* Modules */
|
||||||
|
"module": "commonjs", /* Specify what module code is generated. */
|
||||||
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||||
|
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||||
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||||
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||||
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||||
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||||
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||||
|
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
||||||
|
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
||||||
|
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
||||||
|
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
||||||
|
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||||
|
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
||||||
|
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||||
|
|
||||||
|
/* JavaScript Support */
|
||||||
|
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||||
|
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||||
|
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||||
|
|
||||||
|
/* Emit */
|
||||||
|
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||||
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||||
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||||
|
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||||
|
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||||
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||||
|
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
||||||
|
// "removeComments": true, /* Disable emitting comments. */
|
||||||
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||||
|
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||||
|
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
||||||
|
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||||
|
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||||
|
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||||
|
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||||
|
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||||
|
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||||
|
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
||||||
|
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
||||||
|
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||||
|
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
||||||
|
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||||
|
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
||||||
|
|
||||||
|
/* Interop Constraints */
|
||||||
|
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||||
|
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
||||||
|
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||||
|
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
||||||
|
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||||
|
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||||
|
|
||||||
|
/* Type Checking */
|
||||||
|
"strict": true, /* Enable all strict type-checking options. */
|
||||||
|
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
||||||
|
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
||||||
|
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||||
|
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
||||||
|
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||||
|
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
||||||
|
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
||||||
|
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||||
|
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
||||||
|
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
||||||
|
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||||
|
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||||
|
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||||
|
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
||||||
|
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||||
|
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
||||||
|
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||||
|
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||||
|
|
||||||
|
/* Completeness */
|
||||||
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||||
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const vm = require('vm');
|
||||||
|
|
||||||
|
// 读取目录中的所有脚本文件
|
||||||
|
const dirPath = './scripts';
|
||||||
|
const scripts = fs.readdirSync(dirPath)
|
||||||
|
.filter(file => path.extname(file) === '.js')
|
||||||
|
.map(file => fs.readFileSync(path.join(dirPath, file), 'utf8'));
|
||||||
|
|
||||||
|
// 创建一个沙盒对象
|
||||||
|
const sandbox = {
|
||||||
|
console: console // 在沙盒中暴露 console 对象
|
||||||
|
};
|
||||||
|
const context = vm.createContext(sandbox);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 预读取和运行所有脚本
|
||||||
|
scripts.forEach(script => {
|
||||||
|
const scriptObj = new vm.Script(script, {
|
||||||
|
filename: path.join(dirPath, 'script.js')
|
||||||
|
});
|
||||||
|
scriptObj.runInContext(context);
|
||||||
|
});
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const nodeExternals = require("webpack-node-externals");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: "./sillygirl.js",
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, "dist"),
|
||||||
|
filename: "sillygirl.js",
|
||||||
|
library: { name: "sillygirl", type: "umd" },
|
||||||
|
// chunkFormat: "module",
|
||||||
|
},
|
||||||
|
// experiments: { outputModule: true },
|
||||||
|
target: "node",
|
||||||
|
mode: "production",
|
||||||
|
resolve: {
|
||||||
|
fallback: {
|
||||||
|
assert: false,
|
||||||
|
async_hooks: false,
|
||||||
|
buffer: false,
|
||||||
|
child_process: false,
|
||||||
|
cluster: false,
|
||||||
|
console: false,
|
||||||
|
constants: false,
|
||||||
|
crypto: false,
|
||||||
|
dgram: false,
|
||||||
|
dns: false,
|
||||||
|
domain: false,
|
||||||
|
events: false,
|
||||||
|
fs: false,
|
||||||
|
http: false,
|
||||||
|
http2: false,
|
||||||
|
https: false,
|
||||||
|
inspector: false,
|
||||||
|
module: false,
|
||||||
|
net: false,
|
||||||
|
os: false,
|
||||||
|
path: false,
|
||||||
|
perf_hooks: false,
|
||||||
|
process: false,
|
||||||
|
punycode: false,
|
||||||
|
querystring: false,
|
||||||
|
readline: false,
|
||||||
|
repl: false,
|
||||||
|
stream: false,
|
||||||
|
string_decoder: false,
|
||||||
|
timers: false,
|
||||||
|
tls: false,
|
||||||
|
trace_events: false,
|
||||||
|
tty: false,
|
||||||
|
url: false,
|
||||||
|
util: false,
|
||||||
|
v8: false,
|
||||||
|
vm: false,
|
||||||
|
zlib: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
externalsPresets: { node: true },
|
||||||
|
externals: [
|
||||||
|
nodeExternals({
|
||||||
|
allowlist: [/grpc/, "google-protobuf"],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
// npx webpack --config webpack.config.js
|
||||||
Reference in New Issue
Block a user