@marleena/trb-proto 1.0.9 → 1.0.20
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/LICENSE +21 -21
- package/README.md +69 -64
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Анатолий
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Анатолий
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,64 +1,69 @@
|
|
|
1
|
-
# TrB proto
|
|
2
|
-
|
|
3
|
-
Контракты сервисов и сгенерированный код:
|
|
4
|
-
|
|
5
|
-
- Go — `gen/go`
|
|
6
|
-
- JavaScript / TypeScript (protobuf + gRPC-Web) — npm-пакет [`@marleena/trb-proto`](https://www.npmjs.com/package/@marleena/trb-proto)
|
|
7
|
-
|
|
8
|
-
## Генерация
|
|
9
|
-
|
|
10
|
-
Нужны `protoc` и плагины: `protoc-gen-go`, `protoc-gen-go-grpc`, `protoc-gen-grpc-gateway`, `protoc-gen-js`, `protoc-gen-grpc-web`.
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
make gene
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Собирает Go, JS/TS и descriptor set. Google API-аннотации для JS генерируются отдельно, чтобы не попасть в `gen/go`.
|
|
17
|
-
|
|
18
|
-
Другие цели: `make desc`, `make buf`.
|
|
19
|
-
|
|
20
|
-
## npm
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install @marleena/trb-proto
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
import { MessageRequest } from '@marleena/trb-proto/example/Example_pb';
|
|
28
|
-
import { exampleClient } from '@marleena/trb-proto/example/ExampleServiceClientPb';
|
|
29
|
-
|
|
30
|
-
const client = new exampleClient('https://api.example.com');
|
|
31
|
-
const req = new MessageRequest();
|
|
32
|
-
req.setText('hello');
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Сервисы: `example`, `tinvest`, `moex`, `clickhouse` (native gRPC), `manager_indicators`, `api/nats`, `api/clickhouse`, `api/db_api`, `api/test`.
|
|
36
|
-
|
|
37
|
-
`api/clickhouse` (`trb.clickhouse.manager.public.contract.v1.ClickHouseManager`) — DDL: базы, таблицы, колонки. Запросы — `clickhouse.grpc.ClickHouse`, прикладные выборки — `api/db_api`.
|
|
38
|
-
|
|
39
|
-
`api/db_api` (`trb.db.api.public.contract.v1.DbApi`) — gRPC API веб-клиента к ClickHouse и Postgres. Новый метод добавляется RPC-ом в `services/api/db_api/db_api.proto`.
|
|
40
|
-
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
# TrB proto
|
|
2
|
+
|
|
3
|
+
Контракты сервисов и сгенерированный код:
|
|
4
|
+
|
|
5
|
+
- Go — `gen/go`
|
|
6
|
+
- JavaScript / TypeScript (protobuf + gRPC-Web) — npm-пакет [`@marleena/trb-proto`](https://www.npmjs.com/package/@marleena/trb-proto)
|
|
7
|
+
|
|
8
|
+
## Генерация
|
|
9
|
+
|
|
10
|
+
Нужны `protoc` и плагины: `protoc-gen-go`, `protoc-gen-go-grpc`, `protoc-gen-grpc-gateway`, `protoc-gen-js`, `protoc-gen-grpc-web`.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
make gene
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Собирает Go, JS/TS и descriptor set. Google API-аннотации для JS генерируются отдельно, чтобы не попасть в `gen/go`.
|
|
17
|
+
|
|
18
|
+
Другие цели: `make desc`, `make buf`.
|
|
19
|
+
|
|
20
|
+
## npm
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @marleena/trb-proto
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { MessageRequest } from '@marleena/trb-proto/example/Example_pb';
|
|
28
|
+
import { exampleClient } from '@marleena/trb-proto/example/ExampleServiceClientPb';
|
|
29
|
+
|
|
30
|
+
const client = new exampleClient('https://api.example.com');
|
|
31
|
+
const req = new MessageRequest();
|
|
32
|
+
req.setText('hello');
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Сервисы: `example`, `tinvest`, `moex`, `clickhouse` (native gRPC), `manager_indicators`, `api/nats`, `api/clickhouse`, `api/db_api`, `api/test`.
|
|
36
|
+
|
|
37
|
+
`api/clickhouse` (`trb.clickhouse.manager.public.contract.v1.ClickHouseManager`) — DDL: базы, таблицы, колонки. Запросы — `clickhouse.grpc.ClickHouse`, прикладные выборки — `api/db_api`.
|
|
38
|
+
|
|
39
|
+
`api/db_api` (`trb.db.api.public.contract.v1.DbApi`) — gRPC API веб-клиента к ClickHouse и Postgres. Новый метод добавляется RPC-ом в `services/api/db_api/db_api.proto`.
|
|
40
|
+
|
|
41
|
+
## CI/CD
|
|
42
|
+
|
|
43
|
+
Один workflow [Release](.github/workflows/release.yml): при коммите в `main` с сообщением `v1.2.3`
|
|
44
|
+
|
|
45
|
+
- публикует `@marleena/trb-proto` в npm;
|
|
46
|
+
- просит [pkg.go.dev](https://pkg.go.dev/github.com/Mar1eena/trb_proto) проиндексировать `github.com/Mar1eena/trb_proto@v1.2.3` (для этого пушится git-тег той же версии).
|
|
47
|
+
|
|
48
|
+
Публикация в npm через [Trusted Publishing](https://docs.npmjs.com/trusted-publishers/) (OIDC, без `NPM_TOKEN`).
|
|
49
|
+
|
|
50
|
+
На [npmjs.com](https://www.npmjs.com) → пакет `@marleena/trb-proto` → **Settings** → **Trusted Publisher** → GitHub Actions:
|
|
51
|
+
|
|
52
|
+
- Organization or user: `Mar1eena`
|
|
53
|
+
- Repository: `TrB_proto`
|
|
54
|
+
- Workflow filename: `release.yml`
|
|
55
|
+
- Allowed actions: `npm publish`
|
|
56
|
+
|
|
57
|
+
После успешного релиза токен в GitHub можно удалить. Сообщение коммита должно совпадать с версией в `package.json`.
|
|
58
|
+
|
|
59
|
+
## Релиз
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
make rel
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Собирает proto, поднимает patch-версию, коммитит все изменения с сообщением `v1.2.3` и пушит в `main`. Actions публикует npm и обновляет pkg.go.dev.
|
|
66
|
+
|
|
67
|
+
Другой шаг версии: `make rel PART=minor` или `PART=major`.
|
|
68
|
+
|
|
69
|
+
Для коммита нужны `user.name` и `user.email` в Git.
|