ADempiere node.js write in JavaScript for gRPC service, use it for connect with:
- ADempiere-gRPC-Server, docker image erpya/adempiere-grpc-all-in-one.
See also:
- eCommerce-ADempiere, docker image erpya/adempiere-ecommerce.
- Proxy-Adempiere-API, docker image erpya/proxy-adempiere-api.
# installing via NPM
npm install @adempiere/grpc-web-store-api --save
# installing via Yarn
yarn add @adempiere/grpc-web-store-api
Here a example for it using from Proxy of ADempiere API: https://github.com/adempiere/proxy-adempiere-api/blob/master/src/modules/adempiere-api/index.ts#L17
For recreate stub class you must have follow:
# install dependecies and dev dependencies
npm i
# generate all stub
npm run stub
Note to generate specific proto definition:
- To access:
npm run stub:access
- To client:
npm run stub:client
- To web store:
npm run stub:web_store
It can be installed as a global dependency although it is already managed as a project dependency.
Via npm:
sudo npm install -g grpc-tools
Via yarn:
yarn global add grpc-tools
Generate all stub:
grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:src/grpc/ \
--grpc_out=src/grpc/ \
proto/access.proto proto/client.proto proto/web_store.proto
# --grpc-web_out=import_style=commonjs,mode=grpcwebtext:src/grpc/
- To access:
# Generate stub to access.proto file
grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:src/grpc/ \
--grpc_out=grpc_js:src/grpc/ \
proto/access.proto
# --grpc-web_out=import_style=commonjs,mode=grpcwebtext:src/grpc/
- To client:
# Generate stub to client.proto file
grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:src/grpc/ \
--grpc_out=grpc_js:src/grpc/ \
proto/client.proto
# --grpc-web_out=import_style=commonjs,mode=grpcwebtext:src/grpc/
- To web store:
# Generate stub to web_store.proto file
grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:src/grpc/ \
--grpc_out=grpc_js:src/grpc/ \
proto/web_store.proto
# --grpc-web_out=import_style=commonjs,mode=grpcwebtext:src/grpc/
The result is generated on: src/grpc/proto/
folder:
access_grpc_pb.js
access_pb.js
client_grpc_pb.js
client_pb.js
web_store_grpc_pb.js
web_store_pb.js
Become a sponsor and get your logo on our README on GitHub with a link to your site. Become a sponsor