@relationc/prototypes
v1.1.9
Published
Prototype package for project
Downloads
1
Readme
Prototypes for workflow
Build protobuf to ts:
# Clearly
source run.sh
# Easier
./run.sh
# Don't have permission?
chmod +x run.sh
Formatter common type for dev and format response, observable ..
import Response from "crm-prototypes"; // Example
Service
GRPC Config:
// Server
app.connectMicroservice<MicroserviceOptions>({
transport: Transport.GRPC,
options: {
url: process.env.NODE_ENV !== "local" ? "0.0.0.0:50051" : "localhost:5000",
package: ["<package_name>"],
protoPath: ["node_modules/crm-prototypes/interfaces/<package_name>.proto"],
maxReceiveMessageLength: 1024 * 1024 * 1024,
maxSendMessageLength: 1024 * 1024 * 1024,
},
});
// Client
@Client({
transport: Transport.GRPC,
options: {
url: process.env.<GRPC_ENV>,
package: '<package_name>',
protoPath: 'node_modules/crm-prototypes/interfaces/<package_name>.proto',
maxReceiveMessageLength: 1024 * 1024 * 1024,
maxSendMessageLength: 1024 * 1024 * 1024,
},
})
private client: ClientGrpc;
Type script
// Define package
export * as Storage from "./gen/ts/interfaces/storage";
import Storage from "crm-prototypes"; // replace with your define
// Example type:
Storage.IStorageController;