@adempiere/grpc-web-store-api

ADempiere Web Store write in Javascript for a node service

Usage no npm install needed!

<script type="module">
  import adempiereGrpcWebStoreApi from 'https://cdn.skypack.dev/@adempiere/grpc-web-store-api';
</script>

README

ADempiere gRPC Web Store API library to Node.js

node version npm version License Downloads

ADempiere node.js write in JavaScript for gRPC service, use it for connect with:

See also:

Using it

# installing via NPM
npm install @adempiere/grpc-web-store-api --save
# installing via Yarn
yarn add @adempiere/grpc-web-store-api

A Example

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

Recreate proto stub class (only for contribute to project)

For recreate stub class you must have follow:

Generate Proto Stub:

Generate with npm (Recommended):

# 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

Generate directly with grpc_tools_node_protoc:

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/

Output proto stub

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

Sponsors

Become a sponsor and get your logo on our README on GitHub with a link to your site. Become a sponsor