@rsdk/grpc.loader 4.0.0-next.9 → 4.0.1-next.0

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,56 @@
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.1-next.0](https://github.com/R-Vision/rsdk/compare/v4.0.0...v4.0.1-next.0) (2023-12-06)
7
+
8
+ **Note:** Version bump only for package @rsdk/grpc.loader
9
+
10
+ ## [4.0.0](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.19...v4.0.0) (2023-12-04)
11
+
12
+ **Note:** Version bump only for package @rsdk/grpc.loader
13
+
14
+ ## [4.0.0-next.19](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.18...v4.0.0-next.19) (2023-12-02)
15
+
16
+ **Note:** Version bump only for package @rsdk/grpc.loader
17
+
18
+ ## [4.0.0-next.18](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.17...v4.0.0-next.18) (2023-12-02)
19
+
20
+ **Note:** Version bump only for package @rsdk/grpc.loader
21
+
22
+ ## [4.0.0-next.17](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.16...v4.0.0-next.17) (2023-12-01)
23
+
24
+ **Note:** Version bump only for package @rsdk/grpc.loader
25
+
26
+ ## [4.0.0-next.16](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.15...v4.0.0-next.16) (2023-11-30)
27
+
28
+ **Note:** Version bump only for package @rsdk/grpc.loader
29
+
30
+ ## [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)
31
+
32
+ ### Features
33
+
34
+ * added protocol detector ([#166](https://github.com/R-Vision/rsdk/issues/166)) ([f348995](https://github.com/R-Vision/rsdk/commit/f348995f29648c7392b7375c5b2001197d60eb36))
35
+
36
+ ## [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)
37
+
38
+ **Note:** Version bump only for package @rsdk/grpc.loader
39
+
40
+ ## [4.0.0-next.13](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.12...v4.0.0-next.13) (2023-11-29)
41
+
42
+ **Note:** Version bump only for package @rsdk/grpc.loader
43
+
44
+ ## [4.0.0-next.12](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.11...v4.0.0-next.12) (2023-11-29)
45
+
46
+ **Note:** Version bump only for package @rsdk/grpc.loader
47
+
48
+ ## [4.0.0-next.11](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.10...v4.0.0-next.11) (2023-11-29)
49
+
50
+ **Note:** Version bump only for package @rsdk/grpc.loader
51
+
52
+ ## [4.0.0-next.10](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.9...v4.0.0-next.10) (2023-11-29)
53
+
54
+ **Note:** Version bump only for package @rsdk/grpc.loader
55
+
6
56
  ## [4.0.0-next.9](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.8...v4.0.0-next.9) (2023-11-29)
7
57
 
8
58
  **Note:** Version bump only for package @rsdk/grpc.loader
@@ -11,19 +61,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
61
 
12
62
  ### Features
13
63
 
14
- * Kafka batch producer ([#150](https://github.com/R-Vision/rsdk/issues/150)) ([2faa2f4](https://github.com/R-Vision/rsdk/commit/2faa2f41ca0dbb6d8a92cbf0ab20cf5cefeaf4e9))
64
+ * Kafka batch
65
+ producer ([#150](https://github.com/R-Vision/rsdk/issues/150)) ([2faa2f4](https://github.com/R-Vision/rsdk/commit/2faa2f41ca0dbb6d8a92cbf0ab20cf5cefeaf4e9))
15
66
 
16
67
  ## [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)
17
68
 
18
69
  ### Features
19
70
 
20
- * **PFM-126:** reflection added ([ffaaa99](https://github.com/R-Vision/rsdk/commit/ffaaa996e0a81f98be46b0b73badb59f3e680eac))
71
+ * **PFM-126:** reflection
72
+ added ([ffaaa99](https://github.com/R-Vision/rsdk/commit/ffaaa996e0a81f98be46b0b73badb59f3e680eac))
21
73
 
22
74
  ## [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)
23
75
 
24
76
  ### Bug Fixes
25
77
 
26
- * some more peer dependencies ([3617dcb](https://github.com/R-Vision/rsdk/commit/3617dcbfdd08231e8f334ff35ac46eb99d810567))
78
+ * some more peer
79
+ dependencies ([3617dcb](https://github.com/R-Vision/rsdk/commit/3617dcbfdd08231e8f334ff35ac46eb99d810567))
27
80
 
28
81
  ## [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)
29
82
 
@@ -61,13 +114,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
61
114
 
62
115
  ### Bug Fixes
63
116
 
64
- * **deps:** correctly peerDependencies ([349628f](https://github.com/R-Vision/rsdk/commit/349628f10da46a30d6c8b9f9387e010869318212))
117
+ * **deps:** correctly
118
+ peerDependencies ([349628f](https://github.com/R-Vision/rsdk/commit/349628f10da46a30d6c8b9f9387e010869318212))
65
119
 
66
120
  ## [3.0.1-next.0](https://github.com/R-Vision/rsdk/compare/v3.0.0...v3.0.1-next.0) (2023-08-07)
67
121
 
68
122
  ### Bug Fixes
69
123
 
70
- * **deps:** correctly peerDependencies ([7483e35](https://github.com/R-Vision/rsdk/commit/7483e3560b5cf23ebebe6149bd41ebb517821e99))
124
+ * **deps:** correctly
125
+ peerDependencies ([7483e35](https://github.com/R-Vision/rsdk/commit/7483e3560b5cf23ebebe6149bd41ebb517821e99))
71
126
 
72
127
  ## [3.0.0](https://github.com/R-Vision/rsdk/compare/v3.0.0-next.0...v3.0.0) (2023-08-04)
73
128
 
@@ -113,7 +168,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
113
168
 
114
169
  ### Bug Fixes
115
170
 
116
- * remove private dependencies from `peerDependencies` section ([0bce6ff](https://github.com/R-Vision/rsdk/commit/0bce6ffb5b699e2ed1dc9aca77cbdbf085267ff7))
171
+ * remove private dependencies from `peerDependencies`
172
+ section ([0bce6ff](https://github.com/R-Vision/rsdk/commit/0bce6ffb5b699e2ed1dc9aca77cbdbf085267ff7))
117
173
 
118
174
  ## 1.0.11 (2023-05-23)
119
175
 
@@ -123,7 +179,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
123
179
 
124
180
  ### Bug Fixes
125
181
 
126
- * add "access: public" to new packages ([04d5983](https://github.com/R-Vision/rsdk/commit/04d5983cfa3e97c5d8219e07208a0499a8c6bc83))
182
+ * add "access: public" to new
183
+ packages ([04d5983](https://github.com/R-Vision/rsdk/commit/04d5983cfa3e97c5d8219e07208a0499a8c6bc83))
127
184
 
128
185
  ## 1.0.9 (2023-05-21)
129
186
 
@@ -153,7 +210,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
153
210
 
154
211
  ### Bug Fixes
155
212
 
156
- * builtin make not private in npm ([50c83b6](https://github.com/R-Vision/rsdk/commit/50c83b6454f9a89f1e99d3b33a497ce2c029d8c6))
213
+ * builtin make not private in
214
+ npm ([50c83b6](https://github.com/R-Vision/rsdk/commit/50c83b6454f9a89f1e99d3b33a497ce2c029d8c6))
157
215
 
158
216
  ## 1.0.2 (2023-05-10)
159
217
 
@@ -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.9",
3
+ "version": "4.0.1-next.0",
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": "889228ebf4076fafc1c7fce4406b1ea5a3d985ff",
23
+ "gitHead": "772c1ca796c9a5b279274d6a6fb1a356e64aa71f",
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
  }