@rsdk/grpc.loader 4.0.0-next.14 → 4.0.0-next.15

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.0-next.15](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.14...v4.0.0-next.15) (2023-11-30)
7
+
8
+ ### Features
9
+
10
+ * added protocol detector ([#166](https://github.com/R-Vision/rsdk/issues/166)) ([f348995](https://github.com/R-Vision/rsdk/commit/f348995f29648c7392b7375c5b2001197d60eb36))
11
+
6
12
  ## [4.0.0-next.14](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.13...v4.0.0-next.14) (2023-11-29)
7
13
 
8
14
  **Note:** Version bump only for package @rsdk/grpc.loader
@@ -31,19 +37,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
31
37
 
32
38
  ### Features
33
39
 
34
- * Kafka batch producer ([#150](https://github.com/R-Vision/rsdk/issues/150)) ([2faa2f4](https://github.com/R-Vision/rsdk/commit/2faa2f41ca0dbb6d8a92cbf0ab20cf5cefeaf4e9))
40
+ * Kafka batch
41
+ producer ([#150](https://github.com/R-Vision/rsdk/issues/150)) ([2faa2f4](https://github.com/R-Vision/rsdk/commit/2faa2f41ca0dbb6d8a92cbf0ab20cf5cefeaf4e9))
35
42
 
36
43
  ## [4.0.0-next.5](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.4...v4.0.0-next.5) (2023-11-13)
37
44
 
38
45
  ### Features
39
46
 
40
- * **PFM-126:** reflection added ([ffaaa99](https://github.com/R-Vision/rsdk/commit/ffaaa996e0a81f98be46b0b73badb59f3e680eac))
47
+ * **PFM-126:** reflection
48
+ added ([ffaaa99](https://github.com/R-Vision/rsdk/commit/ffaaa996e0a81f98be46b0b73badb59f3e680eac))
41
49
 
42
50
  ## [4.0.0-next.4](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.3...v4.0.0-next.4) (2023-11-12)
43
51
 
44
52
  ### Bug Fixes
45
53
 
46
- * some more peer dependencies ([3617dcb](https://github.com/R-Vision/rsdk/commit/3617dcbfdd08231e8f334ff35ac46eb99d810567))
54
+ * some more peer
55
+ dependencies ([3617dcb](https://github.com/R-Vision/rsdk/commit/3617dcbfdd08231e8f334ff35ac46eb99d810567))
47
56
 
48
57
  ## [4.0.0-next.2](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.1...v4.0.0-next.2) (2023-11-10)
49
58
 
@@ -81,13 +90,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
81
90
 
82
91
  ### Bug Fixes
83
92
 
84
- * **deps:** correctly peerDependencies ([349628f](https://github.com/R-Vision/rsdk/commit/349628f10da46a30d6c8b9f9387e010869318212))
93
+ * **deps:** correctly
94
+ peerDependencies ([349628f](https://github.com/R-Vision/rsdk/commit/349628f10da46a30d6c8b9f9387e010869318212))
85
95
 
86
96
  ## [3.0.1-next.0](https://github.com/R-Vision/rsdk/compare/v3.0.0...v3.0.1-next.0) (2023-08-07)
87
97
 
88
98
  ### Bug Fixes
89
99
 
90
- * **deps:** correctly peerDependencies ([7483e35](https://github.com/R-Vision/rsdk/commit/7483e3560b5cf23ebebe6149bd41ebb517821e99))
100
+ * **deps:** correctly
101
+ peerDependencies ([7483e35](https://github.com/R-Vision/rsdk/commit/7483e3560b5cf23ebebe6149bd41ebb517821e99))
91
102
 
92
103
  ## [3.0.0](https://github.com/R-Vision/rsdk/compare/v3.0.0-next.0...v3.0.0) (2023-08-04)
93
104
 
@@ -133,7 +144,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
133
144
 
134
145
  ### Bug Fixes
135
146
 
136
- * remove private dependencies from `peerDependencies` section ([0bce6ff](https://github.com/R-Vision/rsdk/commit/0bce6ffb5b699e2ed1dc9aca77cbdbf085267ff7))
147
+ * remove private dependencies from `peerDependencies`
148
+ section ([0bce6ff](https://github.com/R-Vision/rsdk/commit/0bce6ffb5b699e2ed1dc9aca77cbdbf085267ff7))
137
149
 
138
150
  ## 1.0.11 (2023-05-23)
139
151
 
@@ -143,7 +155,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
143
155
 
144
156
  ### Bug Fixes
145
157
 
146
- * add "access: public" to new packages ([04d5983](https://github.com/R-Vision/rsdk/commit/04d5983cfa3e97c5d8219e07208a0499a8c6bc83))
158
+ * add "access: public" to new
159
+ packages ([04d5983](https://github.com/R-Vision/rsdk/commit/04d5983cfa3e97c5d8219e07208a0499a8c6bc83))
147
160
 
148
161
  ## 1.0.9 (2023-05-21)
149
162
 
@@ -173,7 +186,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
173
186
 
174
187
  ### Bug Fixes
175
188
 
176
- * builtin make not private in npm ([50c83b6](https://github.com/R-Vision/rsdk/commit/50c83b6454f9a89f1e99d3b33a497ce2c029d8c6))
189
+ * builtin make not private in
190
+ npm ([50c83b6](https://github.com/R-Vision/rsdk/commit/50c83b6454f9a89f1e99d3b33a497ce2c029d8c6))
177
191
 
178
192
  ## 1.0.2 (2023-05-10)
179
193
 
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,SAAgB,QAAQ,CACtB,KAAwB,EACxB,MAA2C;IAE3C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE;QACjC,sCAAsC;QACtC,oDAAoD;QACpD,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAE/C,KAAK,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC/D,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;SAC/C;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAjBD,4BAiBC"}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,SAAgB,QAAQ,CACtB,KAAwB,EACxB,MAA2C;IAE3C,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClC,sCAAsC;QACtC,oDAAoD;QACpD,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAE/C,KAAK,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YAChE,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAjBD,4BAiBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdk/grpc.loader",
3
- "version": "4.0.0-next.14",
3
+ "version": "4.0.0-next.15",
4
4
  "description": "Load generated ts code to nestjs and initialize microservice",
5
5
  "license": "Apache License 2.0",
6
6
  "publishConfig": {
@@ -20,7 +20,7 @@
20
20
  "@nestjs/microservices": "^10.0.0",
21
21
  "reflect-metadata": "^0.1.13"
22
22
  },
23
- "gitHead": "567e6d331c4caa6fdadbe0329f91c471b877f7a4",
23
+ "gitHead": "8abd89d7800375749b024410dc3465ff40389277",
24
24
  "dependencies": {
25
25
  "rxjs": "^7.8.1"
26
26
  }
package/src/loader.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * CUSTOM PROTO "LOADER"
3
- *
3
+ *
4
4
  * Стандартный loader, который использует нест (@grpc/proto-loader) требует для работы
5
5
  * исходных .proto-файлов. Нам это не подходит, т.к. контракты мы храним в отдельных
6
6
  * репозиториях.
7
- *
7
+ *
8
8
  * Данный модуль, подсовывается несту, вместо @grpc/proto-loader.
9
- *
9
+ *
10
10
  * Как это работает:
11
- *
11
+ *
12
12
  * Для работы gRPC-транспорту неста нужны "определения"/"дефинишены" - они же definitions.
13
13
  * Определения представляют собой объект такого вида:
14
- *
14
+ *
15
15
  {
16
16
  'package1.v1.SomeService': {
17
17
  something: {
@@ -26,22 +26,22 @@
26
26
  },
27
27
  ...
28
28
  }
29
- *
29
+ *
30
30
  * Первый уровень ключей - <имя grpc-пакета>.<имя grpc-сервиса>.
31
31
  * Второй уровень - название gRPC метода (приведённое к camelCase)
32
- *
32
+ *
33
33
  * Подобные объекты генерируется из .proto-файлов при помощи библиотеки
34
34
  * @grpc/grpc-js, которую мы используем в нашем генераторе.
35
35
  * TODO: ссылку на репозиторий генератора
36
- *
36
+ *
37
37
  * Функция loadSync не предназначена для проброса этих дефинишенов напрямую.
38
38
  * Но объект передаваемый в поле loader попадёт в функцию без изменений.
39
39
  * Этим фактом мы и пользуемся для проброса массива объектов классы Package,
40
40
  * которые содержат всю необходимую информацию.
41
- *
41
+ *
42
42
  * Остаётся только смержить данные по всем пакетам в один объект и сделать правильные
43
43
  * ключи.
44
- *
44
+ *
45
45
  * NOTE: В первом аргументе, соответственно, будет undefined, поскольку поле protoPath
46
46
  * мы не передаём
47
47
  */
package/tsconfig.json CHANGED
@@ -1,10 +1,19 @@
1
1
  {
2
-
3
2
  "extends": "@rsdk/tsconfig/base.json",
4
3
  "compilerOptions": {
5
4
  "declaration": true,
6
5
  "outDir": "dist"
7
6
  },
8
- "include": ["src/**/*"],
9
- "exclude": ["node_modules", "dist", "test", "**/*.spec.ts", "**/*.test.ts", "**/*.spec.e2e.ts", "**/*.test.e2e.ts"]
7
+ "include": [
8
+ "src/**/*"
9
+ ],
10
+ "exclude": [
11
+ "node_modules",
12
+ "dist",
13
+ "test",
14
+ "**/*.spec.ts",
15
+ "**/*.test.ts",
16
+ "**/*.spec.e2e.ts",
17
+ "**/*.test.e2e.ts"
18
+ ]
10
19
  }