@marleena/trb-proto 1.0.3 → 1.0.4

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/README.md CHANGED
@@ -32,11 +32,11 @@ const req = new MessageRequest();
32
32
  req.setText('hello');
33
33
  ```
34
34
 
35
- Сервисы: `example`, `tinvest`, `moex`, `clickhouse` (native gRPC), `manager_indicators`, `api/nats`, `api/clickhouse`, `api/data`.
35
+ Сервисы: `example`, `tinvest`, `moex`, `clickhouse` (native gRPC), `manager_indicators`, `api/nats`, `api/clickhouse`, `api/db_api`, `api/test`.
36
36
 
37
- `api/clickhouse` (`trb.clickhouse.manager.public.contract.v1.ClickHouseManager`) — DDL: базы, таблицы, колонки. Запросы — `clickhouse.grpc.ClickHouse`, прикладные выборки — `api/data`.
37
+ `api/clickhouse` (`trb.clickhouse.manager.public.contract.v1.ClickHouseManager`) — DDL: базы, таблицы, колонки. Запросы — `clickhouse.grpc.ClickHouse`, прикладные выборки — `api/db_api`.
38
38
 
39
- `api/data` (`trb.db.api.public.contract.v1.DbApi`) — gRPC API веб-клиента к ClickHouse и Postgres. Новый метод добавляется RPC-ом в `services/api/data/data.proto`.
39
+ `api/db_api` (`trb.db.api.public.contract.v1.DbApi`) — gRPC API веб-клиента к ClickHouse и Postgres. Новый метод добавляется RPC-ом в `services/api/db_api/db_api.proto`.
40
40
 
41
41
  ## Релиз
42
42
 
@@ -0,0 +1,259 @@
1
+ /**
2
+ * @fileoverview gRPC-Web generated client stub for trb.db.api.public.contract.v1
3
+ * @enhanceable
4
+ * @public
5
+ */
6
+
7
+ // Code generated by protoc-gen-grpc-web. DO NOT EDIT.
8
+ // versions:
9
+ // protoc-gen-grpc-web v1.5.0
10
+ // protoc v7.34.1
11
+ // source: api/db_api/db_api.proto
12
+
13
+
14
+ /* eslint-disable */
15
+ // @ts-nocheck
16
+
17
+
18
+ import * as grpcWeb from 'grpc-web';
19
+
20
+ import * as tinvest_instruments_pb from '../../tinvest/instruments_pb'; // proto import: "tinvest/instruments.proto"
21
+ import * as api_db_api_db_api_pb from '../../api/db_api/db_api_pb'; // proto import: "api/db_api/db_api.proto"
22
+
23
+
24
+ export class DbApiClient {
25
+ client_: grpcWeb.AbstractClientBase;
26
+ hostname_: string;
27
+ credentials_: null | { [index: string]: string; };
28
+ options_: null | { [index: string]: any; };
29
+
30
+ constructor (hostname: string,
31
+ credentials?: null | { [index: string]: string; },
32
+ options?: null | { [index: string]: any; }) {
33
+ if (!options) options = {};
34
+ if (!credentials) credentials = {};
35
+ options['format'] = 'binary';
36
+
37
+ this.client_ = new grpcWeb.GrpcWebClientBase(options);
38
+ this.hostname_ = hostname.replace(/\/+$/, '');
39
+ this.credentials_ = credentials;
40
+ this.options_ = options;
41
+ }
42
+
43
+ methodDescriptorListInstruments = new grpcWeb.MethodDescriptor(
44
+ '/trb.db.api.public.contract.v1.DbApi/ListInstruments',
45
+ grpcWeb.MethodType.UNARY,
46
+ api_db_api_db_api_pb.ListInstrumentsRequest,
47
+ tinvest_instruments_pb.SharesResponse,
48
+ (request: api_db_api_db_api_pb.ListInstrumentsRequest) => {
49
+ return request.serializeBinary();
50
+ },
51
+ tinvest_instruments_pb.SharesResponse.deserializeBinary
52
+ );
53
+
54
+ listInstruments(
55
+ request: api_db_api_db_api_pb.ListInstrumentsRequest,
56
+ metadata?: grpcWeb.Metadata | null): Promise<tinvest_instruments_pb.SharesResponse>;
57
+
58
+ listInstruments(
59
+ request: api_db_api_db_api_pb.ListInstrumentsRequest,
60
+ metadata: grpcWeb.Metadata | null,
61
+ callback: (err: grpcWeb.RpcError,
62
+ response: tinvest_instruments_pb.SharesResponse) => void): grpcWeb.ClientReadableStream<tinvest_instruments_pb.SharesResponse>;
63
+
64
+ listInstruments(
65
+ request: api_db_api_db_api_pb.ListInstrumentsRequest,
66
+ metadata?: grpcWeb.Metadata | null,
67
+ callback?: (err: grpcWeb.RpcError,
68
+ response: tinvest_instruments_pb.SharesResponse) => void) {
69
+ if (callback !== undefined) {
70
+ return this.client_.rpcCall(
71
+ this.hostname_ +
72
+ '/trb.db.api.public.contract.v1.DbApi/ListInstruments',
73
+ request,
74
+ metadata || {},
75
+ this.methodDescriptorListInstruments,
76
+ callback);
77
+ }
78
+ return this.client_.unaryCall(
79
+ this.hostname_ +
80
+ '/trb.db.api.public.contract.v1.DbApi/ListInstruments',
81
+ request,
82
+ metadata || {},
83
+ this.methodDescriptorListInstruments);
84
+ }
85
+
86
+ methodDescriptorUpsertInstruments = new grpcWeb.MethodDescriptor(
87
+ '/trb.db.api.public.contract.v1.DbApi/UpsertInstruments',
88
+ grpcWeb.MethodType.UNARY,
89
+ tinvest_instruments_pb.SharesResponse,
90
+ api_db_api_db_api_pb.UpsertInstrumentsResponse,
91
+ (request: tinvest_instruments_pb.SharesResponse) => {
92
+ return request.serializeBinary();
93
+ },
94
+ api_db_api_db_api_pb.UpsertInstrumentsResponse.deserializeBinary
95
+ );
96
+
97
+ upsertInstruments(
98
+ request: tinvest_instruments_pb.SharesResponse,
99
+ metadata?: grpcWeb.Metadata | null): Promise<api_db_api_db_api_pb.UpsertInstrumentsResponse>;
100
+
101
+ upsertInstruments(
102
+ request: tinvest_instruments_pb.SharesResponse,
103
+ metadata: grpcWeb.Metadata | null,
104
+ callback: (err: grpcWeb.RpcError,
105
+ response: api_db_api_db_api_pb.UpsertInstrumentsResponse) => void): grpcWeb.ClientReadableStream<api_db_api_db_api_pb.UpsertInstrumentsResponse>;
106
+
107
+ upsertInstruments(
108
+ request: tinvest_instruments_pb.SharesResponse,
109
+ metadata?: grpcWeb.Metadata | null,
110
+ callback?: (err: grpcWeb.RpcError,
111
+ response: api_db_api_db_api_pb.UpsertInstrumentsResponse) => void) {
112
+ if (callback !== undefined) {
113
+ return this.client_.rpcCall(
114
+ this.hostname_ +
115
+ '/trb.db.api.public.contract.v1.DbApi/UpsertInstruments',
116
+ request,
117
+ metadata || {},
118
+ this.methodDescriptorUpsertInstruments,
119
+ callback);
120
+ }
121
+ return this.client_.unaryCall(
122
+ this.hostname_ +
123
+ '/trb.db.api.public.contract.v1.DbApi/UpsertInstruments',
124
+ request,
125
+ metadata || {},
126
+ this.methodDescriptorUpsertInstruments);
127
+ }
128
+
129
+ methodDescriptorListSchedulerTargets = new grpcWeb.MethodDescriptor(
130
+ '/trb.db.api.public.contract.v1.DbApi/ListSchedulerTargets',
131
+ grpcWeb.MethodType.UNARY,
132
+ api_db_api_db_api_pb.ListSchedulerTargetsRequest,
133
+ api_db_api_db_api_pb.ListSchedulerTargetsResponse,
134
+ (request: api_db_api_db_api_pb.ListSchedulerTargetsRequest) => {
135
+ return request.serializeBinary();
136
+ },
137
+ api_db_api_db_api_pb.ListSchedulerTargetsResponse.deserializeBinary
138
+ );
139
+
140
+ listSchedulerTargets(
141
+ request: api_db_api_db_api_pb.ListSchedulerTargetsRequest,
142
+ metadata?: grpcWeb.Metadata | null): Promise<api_db_api_db_api_pb.ListSchedulerTargetsResponse>;
143
+
144
+ listSchedulerTargets(
145
+ request: api_db_api_db_api_pb.ListSchedulerTargetsRequest,
146
+ metadata: grpcWeb.Metadata | null,
147
+ callback: (err: grpcWeb.RpcError,
148
+ response: api_db_api_db_api_pb.ListSchedulerTargetsResponse) => void): grpcWeb.ClientReadableStream<api_db_api_db_api_pb.ListSchedulerTargetsResponse>;
149
+
150
+ listSchedulerTargets(
151
+ request: api_db_api_db_api_pb.ListSchedulerTargetsRequest,
152
+ metadata?: grpcWeb.Metadata | null,
153
+ callback?: (err: grpcWeb.RpcError,
154
+ response: api_db_api_db_api_pb.ListSchedulerTargetsResponse) => void) {
155
+ if (callback !== undefined) {
156
+ return this.client_.rpcCall(
157
+ this.hostname_ +
158
+ '/trb.db.api.public.contract.v1.DbApi/ListSchedulerTargets',
159
+ request,
160
+ metadata || {},
161
+ this.methodDescriptorListSchedulerTargets,
162
+ callback);
163
+ }
164
+ return this.client_.unaryCall(
165
+ this.hostname_ +
166
+ '/trb.db.api.public.contract.v1.DbApi/ListSchedulerTargets',
167
+ request,
168
+ metadata || {},
169
+ this.methodDescriptorListSchedulerTargets);
170
+ }
171
+
172
+ methodDescriptorSyncSchedulerTargets = new grpcWeb.MethodDescriptor(
173
+ '/trb.db.api.public.contract.v1.DbApi/SyncSchedulerTargets',
174
+ grpcWeb.MethodType.UNARY,
175
+ api_db_api_db_api_pb.SyncSchedulerTargetsRequest,
176
+ api_db_api_db_api_pb.SyncSchedulerTargetsResponse,
177
+ (request: api_db_api_db_api_pb.SyncSchedulerTargetsRequest) => {
178
+ return request.serializeBinary();
179
+ },
180
+ api_db_api_db_api_pb.SyncSchedulerTargetsResponse.deserializeBinary
181
+ );
182
+
183
+ syncSchedulerTargets(
184
+ request: api_db_api_db_api_pb.SyncSchedulerTargetsRequest,
185
+ metadata?: grpcWeb.Metadata | null): Promise<api_db_api_db_api_pb.SyncSchedulerTargetsResponse>;
186
+
187
+ syncSchedulerTargets(
188
+ request: api_db_api_db_api_pb.SyncSchedulerTargetsRequest,
189
+ metadata: grpcWeb.Metadata | null,
190
+ callback: (err: grpcWeb.RpcError,
191
+ response: api_db_api_db_api_pb.SyncSchedulerTargetsResponse) => void): grpcWeb.ClientReadableStream<api_db_api_db_api_pb.SyncSchedulerTargetsResponse>;
192
+
193
+ syncSchedulerTargets(
194
+ request: api_db_api_db_api_pb.SyncSchedulerTargetsRequest,
195
+ metadata?: grpcWeb.Metadata | null,
196
+ callback?: (err: grpcWeb.RpcError,
197
+ response: api_db_api_db_api_pb.SyncSchedulerTargetsResponse) => void) {
198
+ if (callback !== undefined) {
199
+ return this.client_.rpcCall(
200
+ this.hostname_ +
201
+ '/trb.db.api.public.contract.v1.DbApi/SyncSchedulerTargets',
202
+ request,
203
+ metadata || {},
204
+ this.methodDescriptorSyncSchedulerTargets,
205
+ callback);
206
+ }
207
+ return this.client_.unaryCall(
208
+ this.hostname_ +
209
+ '/trb.db.api.public.contract.v1.DbApi/SyncSchedulerTargets',
210
+ request,
211
+ metadata || {},
212
+ this.methodDescriptorSyncSchedulerTargets);
213
+ }
214
+
215
+ methodDescriptorListLastDownloads = new grpcWeb.MethodDescriptor(
216
+ '/trb.db.api.public.contract.v1.DbApi/ListLastDownloads',
217
+ grpcWeb.MethodType.UNARY,
218
+ api_db_api_db_api_pb.ListLastDownloadsRequest,
219
+ api_db_api_db_api_pb.ListLastDownloadsResponse,
220
+ (request: api_db_api_db_api_pb.ListLastDownloadsRequest) => {
221
+ return request.serializeBinary();
222
+ },
223
+ api_db_api_db_api_pb.ListLastDownloadsResponse.deserializeBinary
224
+ );
225
+
226
+ listLastDownloads(
227
+ request: api_db_api_db_api_pb.ListLastDownloadsRequest,
228
+ metadata?: grpcWeb.Metadata | null): Promise<api_db_api_db_api_pb.ListLastDownloadsResponse>;
229
+
230
+ listLastDownloads(
231
+ request: api_db_api_db_api_pb.ListLastDownloadsRequest,
232
+ metadata: grpcWeb.Metadata | null,
233
+ callback: (err: grpcWeb.RpcError,
234
+ response: api_db_api_db_api_pb.ListLastDownloadsResponse) => void): grpcWeb.ClientReadableStream<api_db_api_db_api_pb.ListLastDownloadsResponse>;
235
+
236
+ listLastDownloads(
237
+ request: api_db_api_db_api_pb.ListLastDownloadsRequest,
238
+ metadata?: grpcWeb.Metadata | null,
239
+ callback?: (err: grpcWeb.RpcError,
240
+ response: api_db_api_db_api_pb.ListLastDownloadsResponse) => void) {
241
+ if (callback !== undefined) {
242
+ return this.client_.rpcCall(
243
+ this.hostname_ +
244
+ '/trb.db.api.public.contract.v1.DbApi/ListLastDownloads',
245
+ request,
246
+ metadata || {},
247
+ this.methodDescriptorListLastDownloads,
248
+ callback);
249
+ }
250
+ return this.client_.unaryCall(
251
+ this.hostname_ +
252
+ '/trb.db.api.public.contract.v1.DbApi/ListLastDownloads',
253
+ request,
254
+ metadata || {},
255
+ this.methodDescriptorListLastDownloads);
256
+ }
257
+
258
+ }
259
+
@@ -2,6 +2,7 @@ import * as jspb from 'google-protobuf'
2
2
 
3
3
  import * as google_api_annotations_pb from '../../google/api/annotations_pb'; // proto import: "google/api/annotations.proto"
4
4
  import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb'; // proto import: "google/protobuf/timestamp.proto"
5
+ import * as tinvest_instruments_pb from '../../tinvest/instruments_pb'; // proto import: "tinvest/instruments.proto"
5
6
 
6
7
 
7
8
  export class ListFilter extends jspb.Message {
@@ -54,113 +55,33 @@ export namespace ListInstrumentsRequest {
54
55
  }
55
56
  }
56
57
 
57
- export class ListInstrumentsResponse extends jspb.Message {
58
- getItemsList(): Array<Instrument>;
59
- setItemsList(value: Array<Instrument>): ListInstrumentsResponse;
60
- clearItemsList(): ListInstrumentsResponse;
61
- addItems(value?: Instrument, index?: number): Instrument;
58
+ export class UpsertInstrumentsResponse extends jspb.Message {
59
+ getFetched(): number;
60
+ setFetched(value: number): UpsertInstrumentsResponse;
62
61
 
63
- serializeBinary(): Uint8Array;
64
- toObject(includeInstance?: boolean): ListInstrumentsResponse.AsObject;
65
- static toObject(includeInstance: boolean, msg: ListInstrumentsResponse): ListInstrumentsResponse.AsObject;
66
- static serializeBinaryToWriter(message: ListInstrumentsResponse, writer: jspb.BinaryWriter): void;
67
- static deserializeBinary(bytes: Uint8Array): ListInstrumentsResponse;
68
- static deserializeBinaryFromReader(message: ListInstrumentsResponse, reader: jspb.BinaryReader): ListInstrumentsResponse;
69
- }
70
-
71
- export namespace ListInstrumentsResponse {
72
- export type AsObject = {
73
- itemsList: Array<Instrument.AsObject>,
74
- }
75
- }
76
-
77
- export class Instrument extends jspb.Message {
78
- getUid(): string;
79
- setUid(value: string): Instrument;
80
-
81
- getFigi(): string;
82
- setFigi(value: string): Instrument;
83
-
84
- getTicker(): string;
85
- setTicker(value: string): Instrument;
86
-
87
- getName(): string;
88
- setName(value: string): Instrument;
89
-
90
- getClassCode(): string;
91
- setClassCode(value: string): Instrument;
62
+ getInserted(): number;
63
+ setInserted(value: number): UpsertInstrumentsResponse;
92
64
 
93
- getIsin(): string;
94
- setIsin(value: string): Instrument;
65
+ getUpdated(): number;
66
+ setUpdated(value: number): UpsertInstrumentsResponse;
95
67
 
96
- getLot(): number;
97
- setLot(value: number): Instrument;
98
-
99
- getCurrency(): string;
100
- setCurrency(value: string): Instrument;
101
-
102
- getExchange(): string;
103
- setExchange(value: string): Instrument;
104
-
105
- getSector(): string;
106
- setSector(value: string): Instrument;
107
-
108
- getTradingStatus(): number;
109
- setTradingStatus(value: number): Instrument;
110
-
111
- getLiquidityFlag(): boolean;
112
- setLiquidityFlag(value: boolean): Instrument;
113
-
114
- getShortEnabledFlag(): boolean;
115
- setShortEnabledFlag(value: boolean): Instrument;
116
-
117
- getApiTradeAvailableFlag(): boolean;
118
- setApiTradeAvailableFlag(value: boolean): Instrument;
119
-
120
- getBuyAvailableFlag(): boolean;
121
- setBuyAvailableFlag(value: boolean): Instrument;
122
-
123
- getSellAvailableFlag(): boolean;
124
- setSellAvailableFlag(value: boolean): Instrument;
125
-
126
- getFirst1minCandleDate(): google_protobuf_timestamp_pb.Timestamp | undefined;
127
- setFirst1minCandleDate(value?: google_protobuf_timestamp_pb.Timestamp): Instrument;
128
- hasFirst1minCandleDate(): boolean;
129
- clearFirst1minCandleDate(): Instrument;
130
-
131
- getFirst1dayCandleDate(): google_protobuf_timestamp_pb.Timestamp | undefined;
132
- setFirst1dayCandleDate(value?: google_protobuf_timestamp_pb.Timestamp): Instrument;
133
- hasFirst1dayCandleDate(): boolean;
134
- clearFirst1dayCandleDate(): Instrument;
68
+ getUnchanged(): number;
69
+ setUnchanged(value: number): UpsertInstrumentsResponse;
135
70
 
136
71
  serializeBinary(): Uint8Array;
137
- toObject(includeInstance?: boolean): Instrument.AsObject;
138
- static toObject(includeInstance: boolean, msg: Instrument): Instrument.AsObject;
139
- static serializeBinaryToWriter(message: Instrument, writer: jspb.BinaryWriter): void;
140
- static deserializeBinary(bytes: Uint8Array): Instrument;
141
- static deserializeBinaryFromReader(message: Instrument, reader: jspb.BinaryReader): Instrument;
72
+ toObject(includeInstance?: boolean): UpsertInstrumentsResponse.AsObject;
73
+ static toObject(includeInstance: boolean, msg: UpsertInstrumentsResponse): UpsertInstrumentsResponse.AsObject;
74
+ static serializeBinaryToWriter(message: UpsertInstrumentsResponse, writer: jspb.BinaryWriter): void;
75
+ static deserializeBinary(bytes: Uint8Array): UpsertInstrumentsResponse;
76
+ static deserializeBinaryFromReader(message: UpsertInstrumentsResponse, reader: jspb.BinaryReader): UpsertInstrumentsResponse;
142
77
  }
143
78
 
144
- export namespace Instrument {
79
+ export namespace UpsertInstrumentsResponse {
145
80
  export type AsObject = {
146
- uid: string,
147
- figi: string,
148
- ticker: string,
149
- name: string,
150
- classCode: string,
151
- isin: string,
152
- lot: number,
153
- currency: string,
154
- exchange: string,
155
- sector: string,
156
- tradingStatus: number,
157
- liquidityFlag: boolean,
158
- shortEnabledFlag: boolean,
159
- apiTradeAvailableFlag: boolean,
160
- buyAvailableFlag: boolean,
161
- sellAvailableFlag: boolean,
162
- first1minCandleDate?: google_protobuf_timestamp_pb.Timestamp.AsObject,
163
- first1dayCandleDate?: google_protobuf_timestamp_pb.Timestamp.AsObject,
81
+ fetched: number,
82
+ inserted: number,
83
+ updated: number,
84
+ unchanged: number,
164
85
  }
165
86
  }
166
87