@relationc/prototypes
TypeScript icon, indicating that this package has built-in type declarations

1.1.9 • Public • Published

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;

Readme

Keywords

none

Package Sidebar

Install

npm i @relationc/prototypes

Weekly Downloads

0

Version

1.1.9

License

ISC

Unpacked Size

269 kB

Total Files

50

Last publish

Collaborators

  • hoaian412003