protobuf-platform 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -3
- package/package.json +1 -1
- package/update_protobuf.sh +2 -1
- package/user/user.proto +50 -0
- package/user/user_grpc_pb.js +133 -0
- package/user/user_pb.js +1838 -0
package/index.js
CHANGED
@@ -3,13 +3,19 @@
|
|
3
3
|
const gRPC = require('@grpc/grpc-js');
|
4
4
|
const ConfigService = require('./config/config_grpc_pb');
|
5
5
|
const ConfigServiceMessages = require('./config/config_pb');
|
6
|
+
const UserService = require('./user/user_grpc_pb');
|
7
|
+
const UserServiceMessages = require('./user/user_pb');
|
6
8
|
module.exports = {
|
7
9
|
gRPC: gRPC,
|
10
|
+
maxSendMessageLength: 10388608,
|
11
|
+
maxReceiveMessageLength: 10388608,
|
12
|
+
maxConnectionIdleMs: 300000,
|
8
13
|
config: {
|
9
14
|
service: ConfigService,
|
10
15
|
messages: ConfigServiceMessages
|
11
16
|
},
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
user: {
|
18
|
+
service: UserService,
|
19
|
+
messages: UserServiceMessages
|
20
|
+
},
|
15
21
|
};
|
package/package.json
CHANGED
package/update_protobuf.sh
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:config --grpc_out=grpc_js:config --proto_path=./config ./config/*.proto
|
3
|
+
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:config --grpc_out=grpc_js:config --proto_path=./config ./config/*.proto &&
|
4
|
+
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:user --grpc_out=grpc_js:user --proto_path=./user ./user/*.proto
|
package/user/user.proto
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
syntax = "proto3";
|
2
|
+
|
3
|
+
package user;
|
4
|
+
|
5
|
+
service Config {
|
6
|
+
rpc checkConnection(PingRequest) returns (PongResponse);
|
7
|
+
//Fetch settings for particular service
|
8
|
+
rpc signUp(RegistrationRequest) returns (LoggedInResponse);
|
9
|
+
rpc signIn(LoginRequest) returns (LoggedInResponse);
|
10
|
+
rpc getUserData(UserDataRequest) returns (UserDataResponse);
|
11
|
+
}
|
12
|
+
|
13
|
+
message PingRequest { string ping = 1; }
|
14
|
+
message PongResponse { string pong = 1; }
|
15
|
+
|
16
|
+
//Auth [Registration & Login]
|
17
|
+
message RegistrationRequest {
|
18
|
+
string email = 1;
|
19
|
+
string password = 2;
|
20
|
+
string currency = 3;
|
21
|
+
string country = 4;
|
22
|
+
optional string first_name = 5;
|
23
|
+
optional string last_name = 6;
|
24
|
+
optional string birthday = 7;
|
25
|
+
optional string locale = 8;
|
26
|
+
}
|
27
|
+
message LoggedInResponse {
|
28
|
+
int32 id = 1;
|
29
|
+
string public_id = 2;
|
30
|
+
string currency = 3;
|
31
|
+
string country = 4;
|
32
|
+
}
|
33
|
+
message LoginRequest {
|
34
|
+
string email = 1;
|
35
|
+
string password = 2;
|
36
|
+
}
|
37
|
+
message UserDataRequest {
|
38
|
+
int32 id = 1;
|
39
|
+
}
|
40
|
+
message UserDataResponse {
|
41
|
+
int32 id = 1;
|
42
|
+
string public_id = 2;
|
43
|
+
string email = 3;
|
44
|
+
optional string currency = 4;
|
45
|
+
optional string country = 5;
|
46
|
+
optional string first_name = 6;
|
47
|
+
optional string last_name = 7;
|
48
|
+
optional string birthday = 8;
|
49
|
+
optional string locale = 9;
|
50
|
+
}
|
@@ -0,0 +1,133 @@
|
|
1
|
+
// GENERATED CODE -- DO NOT EDIT!
|
2
|
+
|
3
|
+
'use strict';
|
4
|
+
var grpc = require('@grpc/grpc-js');
|
5
|
+
var user_pb = require('./user_pb.js');
|
6
|
+
|
7
|
+
function serialize_user_LoggedInResponse(arg) {
|
8
|
+
if (!(arg instanceof user_pb.LoggedInResponse)) {
|
9
|
+
throw new Error('Expected argument of type user.LoggedInResponse');
|
10
|
+
}
|
11
|
+
return Buffer.from(arg.serializeBinary());
|
12
|
+
}
|
13
|
+
|
14
|
+
function deserialize_user_LoggedInResponse(buffer_arg) {
|
15
|
+
return user_pb.LoggedInResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
16
|
+
}
|
17
|
+
|
18
|
+
function serialize_user_LoginRequest(arg) {
|
19
|
+
if (!(arg instanceof user_pb.LoginRequest)) {
|
20
|
+
throw new Error('Expected argument of type user.LoginRequest');
|
21
|
+
}
|
22
|
+
return Buffer.from(arg.serializeBinary());
|
23
|
+
}
|
24
|
+
|
25
|
+
function deserialize_user_LoginRequest(buffer_arg) {
|
26
|
+
return user_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
27
|
+
}
|
28
|
+
|
29
|
+
function serialize_user_PingRequest(arg) {
|
30
|
+
if (!(arg instanceof user_pb.PingRequest)) {
|
31
|
+
throw new Error('Expected argument of type user.PingRequest');
|
32
|
+
}
|
33
|
+
return Buffer.from(arg.serializeBinary());
|
34
|
+
}
|
35
|
+
|
36
|
+
function deserialize_user_PingRequest(buffer_arg) {
|
37
|
+
return user_pb.PingRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
38
|
+
}
|
39
|
+
|
40
|
+
function serialize_user_PongResponse(arg) {
|
41
|
+
if (!(arg instanceof user_pb.PongResponse)) {
|
42
|
+
throw new Error('Expected argument of type user.PongResponse');
|
43
|
+
}
|
44
|
+
return Buffer.from(arg.serializeBinary());
|
45
|
+
}
|
46
|
+
|
47
|
+
function deserialize_user_PongResponse(buffer_arg) {
|
48
|
+
return user_pb.PongResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
49
|
+
}
|
50
|
+
|
51
|
+
function serialize_user_RegistrationRequest(arg) {
|
52
|
+
if (!(arg instanceof user_pb.RegistrationRequest)) {
|
53
|
+
throw new Error('Expected argument of type user.RegistrationRequest');
|
54
|
+
}
|
55
|
+
return Buffer.from(arg.serializeBinary());
|
56
|
+
}
|
57
|
+
|
58
|
+
function deserialize_user_RegistrationRequest(buffer_arg) {
|
59
|
+
return user_pb.RegistrationRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
60
|
+
}
|
61
|
+
|
62
|
+
function serialize_user_UserDataRequest(arg) {
|
63
|
+
if (!(arg instanceof user_pb.UserDataRequest)) {
|
64
|
+
throw new Error('Expected argument of type user.UserDataRequest');
|
65
|
+
}
|
66
|
+
return Buffer.from(arg.serializeBinary());
|
67
|
+
}
|
68
|
+
|
69
|
+
function deserialize_user_UserDataRequest(buffer_arg) {
|
70
|
+
return user_pb.UserDataRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
71
|
+
}
|
72
|
+
|
73
|
+
function serialize_user_UserDataResponse(arg) {
|
74
|
+
if (!(arg instanceof user_pb.UserDataResponse)) {
|
75
|
+
throw new Error('Expected argument of type user.UserDataResponse');
|
76
|
+
}
|
77
|
+
return Buffer.from(arg.serializeBinary());
|
78
|
+
}
|
79
|
+
|
80
|
+
function deserialize_user_UserDataResponse(buffer_arg) {
|
81
|
+
return user_pb.UserDataResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
82
|
+
}
|
83
|
+
|
84
|
+
|
85
|
+
var ConfigService = exports.ConfigService = {
|
86
|
+
checkConnection: {
|
87
|
+
path: '/user.Config/checkConnection',
|
88
|
+
requestStream: false,
|
89
|
+
responseStream: false,
|
90
|
+
requestType: user_pb.PingRequest,
|
91
|
+
responseType: user_pb.PongResponse,
|
92
|
+
requestSerialize: serialize_user_PingRequest,
|
93
|
+
requestDeserialize: deserialize_user_PingRequest,
|
94
|
+
responseSerialize: serialize_user_PongResponse,
|
95
|
+
responseDeserialize: deserialize_user_PongResponse,
|
96
|
+
},
|
97
|
+
// Fetch settings for particular service
|
98
|
+
signUp: {
|
99
|
+
path: '/user.Config/signUp',
|
100
|
+
requestStream: false,
|
101
|
+
responseStream: false,
|
102
|
+
requestType: user_pb.RegistrationRequest,
|
103
|
+
responseType: user_pb.LoggedInResponse,
|
104
|
+
requestSerialize: serialize_user_RegistrationRequest,
|
105
|
+
requestDeserialize: deserialize_user_RegistrationRequest,
|
106
|
+
responseSerialize: serialize_user_LoggedInResponse,
|
107
|
+
responseDeserialize: deserialize_user_LoggedInResponse,
|
108
|
+
},
|
109
|
+
signIn: {
|
110
|
+
path: '/user.Config/signIn',
|
111
|
+
requestStream: false,
|
112
|
+
responseStream: false,
|
113
|
+
requestType: user_pb.LoginRequest,
|
114
|
+
responseType: user_pb.LoggedInResponse,
|
115
|
+
requestSerialize: serialize_user_LoginRequest,
|
116
|
+
requestDeserialize: deserialize_user_LoginRequest,
|
117
|
+
responseSerialize: serialize_user_LoggedInResponse,
|
118
|
+
responseDeserialize: deserialize_user_LoggedInResponse,
|
119
|
+
},
|
120
|
+
getUserData: {
|
121
|
+
path: '/user.Config/getUserData',
|
122
|
+
requestStream: false,
|
123
|
+
responseStream: false,
|
124
|
+
requestType: user_pb.UserDataRequest,
|
125
|
+
responseType: user_pb.UserDataResponse,
|
126
|
+
requestSerialize: serialize_user_UserDataRequest,
|
127
|
+
requestDeserialize: deserialize_user_UserDataRequest,
|
128
|
+
responseSerialize: serialize_user_UserDataResponse,
|
129
|
+
responseDeserialize: deserialize_user_UserDataResponse,
|
130
|
+
},
|
131
|
+
};
|
132
|
+
|
133
|
+
exports.ConfigClient = grpc.makeGenericClientConstructor(ConfigService);
|