@control_yourself/contracts 0.3.0 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@control_yourself/contracts",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "author": "vladimir.pariy@gmail.com",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,9 +1,13 @@
1
1
  syntax = "proto3";
2
2
 
3
3
  package messenger.v1;
4
+ import "google/protobuf/empty.proto";
4
5
 
5
6
  service MessengerService {
6
7
  rpc GenerateTelegramLink (GenerateTelegramLinkRequest) returns (GenerateTelegramLinkResponse);
8
+ rpc LinkTelegramAccount (LinkTelegramAccountRequest) returns (LinkTelegramAccountResponse);
9
+ rpc GetIntegrations (GetIntegrationsRequest) returns (GetIntegrationsResponse);
10
+ rpc RemoveIntegration (RemoveIntegrationRequest) returns (google.protobuf.Empty);
7
11
  }
8
12
 
9
13
  message GenerateTelegramLinkRequest {
@@ -11,4 +15,61 @@ message GenerateTelegramLinkRequest {
11
15
  };
12
16
  message GenerateTelegramLinkResponse {
13
17
  string link = 1;
14
- };
18
+ };
19
+
20
+ message LinkTelegramAccountRequestPayload {
21
+ string token = 1;
22
+ }
23
+
24
+ enum LinkTelegramAccountStatus {
25
+ STATUS_UNSPECIFIED = 0;
26
+ STATUS_COMPLETED = 1;
27
+ STATUS_PROCESSING = 2;
28
+ STATUS_FAILED = 3;
29
+ }
30
+
31
+ message LinkTelegramAccountResponsePayload {
32
+ LinkTelegramAccountStatus status = 1;
33
+ string message = 2;
34
+ }
35
+
36
+ message TelegramMeta {
37
+ int64 timestamp = 1;
38
+ string correlation_id = 2;
39
+ int64 telegram_user_id = 3;
40
+ int64 chat_id = 4;
41
+ map<string, string> headers = 5;
42
+ }
43
+
44
+ message LinkTelegramAccountRequest {
45
+ TelegramMeta meta = 1;
46
+ LinkTelegramAccountRequestPayload payload = 2;
47
+ };
48
+
49
+ message LinkTelegramAccountResponse {
50
+ TelegramMeta meta = 1;
51
+ LinkTelegramAccountResponsePayload payload = 2;
52
+ };
53
+
54
+ message GetIntegrationsRequest {
55
+ int32 user_id = 1;
56
+ };
57
+
58
+ message Integration {
59
+ int32 id = 1;
60
+ map<string, string> meta = 2;
61
+ string messenger = 3;
62
+ string messenger_id = 4;
63
+ int32 user_id = 5;
64
+ int32 created_at = 6;
65
+ int32 updated_at = 7;
66
+ int32 deleted_at = 8;
67
+ };
68
+
69
+ message GetIntegrationsResponse {
70
+ repeated Integration integrations = 1;
71
+ };
72
+
73
+ message RemoveIntegrationRequest {
74
+ int32 id = 1;
75
+ };