@gastroly.io/contracts 1.0.13 → 1.0.16
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/dist/{proto/constants.d.ts → constants/index.d.ts} +0 -5
- package/dist/{proto/constants.js → constants/index.js} +0 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/proto/index.d.ts +0 -1
- package/dist/proto/index.js +0 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +22 -0
- package/package.json +7 -4
- /package/dist/{proto → src}/account.proto +0 -0
- /package/dist/{proto → src}/auth.proto +0 -0
|
@@ -9,10 +9,5 @@ export declare const GRPC_PACKAGES: {
|
|
|
9
9
|
readonly PACKAGE: "account.v1";
|
|
10
10
|
readonly SERVICE: "AccountService";
|
|
11
11
|
};
|
|
12
|
-
readonly PAYMENT: {
|
|
13
|
-
readonly NAME: "PAYMENT_PACKAGE";
|
|
14
|
-
readonly PACKAGE: "payment.v1";
|
|
15
|
-
readonly SERVICE: "PaymentService";
|
|
16
|
-
};
|
|
17
12
|
};
|
|
18
13
|
export type GrpcPackageName = keyof typeof GRPC_PACKAGES;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants"), exports);
|
|
17
18
|
__exportStar(require("./proto"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./utils"), exports);
|
package/dist/proto/index.d.ts
CHANGED
package/dist/proto/index.js
CHANGED
|
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./constants"), exports);
|
|
18
17
|
__exportStar(require("./paths"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGrpcClientOptions = getGrpcClientOptions;
|
|
4
|
+
const config_1 = require("@nestjs/config");
|
|
5
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const paths_1 = require("../proto/paths");
|
|
8
|
+
function getGrpcClientOptions(packageName, configKey) {
|
|
9
|
+
return {
|
|
10
|
+
name: constants_1.GRPC_PACKAGES[packageName].NAME,
|
|
11
|
+
imports: [],
|
|
12
|
+
useFactory: (configService) => ({
|
|
13
|
+
transport: microservices_1.Transport.GRPC,
|
|
14
|
+
options: {
|
|
15
|
+
package: constants_1.GRPC_PACKAGES[packageName].PACKAGE,
|
|
16
|
+
protoPath: paths_1.PROTO_PATHS[packageName],
|
|
17
|
+
url: configService.getOrThrow(configKey),
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
inject: [config_1.ConfigService],
|
|
21
|
+
};
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gastroly.io/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "Protobuf definition and generated TypeScript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"generate": "mkdir -p generated && protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,addGrpcMetadata=true,addNextTick=true,esModuleInterop=true,package=omit -I ./proto ./proto/*.proto",
|
|
8
|
+
"generate": "mkdir -p generated && protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,addGrpcMetadata=true,addNextTick=true,esModuleInterop=true,package=omit,useDate=true -I ./proto ./proto/*.proto",
|
|
9
9
|
"prebuild": "npm run generate",
|
|
10
|
-
"build": "tsc -p tsconfig.build.json && cp -r proto dist/"
|
|
11
|
-
"clean": "rm -rf dist generated"
|
|
10
|
+
"build": "tsc -p tsconfig.build.json && cp -r proto dist/src/"
|
|
12
11
|
},
|
|
13
12
|
"files": [
|
|
14
13
|
"dist",
|
|
@@ -22,10 +21,14 @@
|
|
|
22
21
|
"ts-proto": "^2.10.1"
|
|
23
22
|
},
|
|
24
23
|
"peerDependencies": {
|
|
24
|
+
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
25
|
+
"@nestjs/config": "^3.0.0 || ^4.0.0",
|
|
25
26
|
"@nestjs/microservices": "^10.0.0 || ^11.0.0",
|
|
26
27
|
"rxjs": "^7.0.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
30
|
+
"@nestjs/common": "^11.0.5",
|
|
31
|
+
"@nestjs/config": "^4.0.2",
|
|
29
32
|
"@nestjs/microservices": "^11.0.5",
|
|
30
33
|
"@types/node": "^22.0.0",
|
|
31
34
|
"rxjs": "^7.8.1",
|
|
File without changes
|
|
File without changes
|