Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hauptmedia/zeebe-gateway-types

Zeebe gRPC Gateway Protocol Client, Typescript Types & JSON Schemas
https://github.com/hauptmedia/zeebe-gateway-types

grpc grpc-client json-schema jsonschema jsonschema-generator zeebe zeebe-client

Last synced: 2 days ago
JSON representation

Zeebe gRPC Gateway Protocol Client, Typescript Types & JSON Schemas

Awesome Lists containing this project

README

        

Zeebe gRPC Gateway Protocol Client, Typescript Types & JSON Schemas
===================================================================

![Compatible with: Camunda Platform 8](https://img.shields.io/badge/Compatible%20with-Camunda%20Platform%208-0072Ce)

Follow this link for the [Zeebe gRPC Gateway Protocol Documentation](https://docs.camunda.io/docs/apis-clients/grpc/).

This library provides:

* a ready to use [grpc-js client](https://www.npmjs.com/package/@grpc/grpc-js) for the Zeebe Gateway Protocol

* Typescript type definitions for requests and responses including JSON transformers

* [JSON Schemas](https://json-schema.org/) for all requests and responses objects

## Installation

```shell
npm i --save @hauptmedia/zeebe-gateway-types
```

## Supported Messages

| Message Type | Docs | JSON Schema |
|-----------------------------------------|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| ActivateJobsRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/activatejobsrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ActivateJobsRequest.json) |
| ActivateJobsResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/activatejobsresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ActivateJobsResponse.json) |
| CancelProcessInstanceRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/cancelprocessinstancerequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CancelProcessInstanceRequest.json) |
| CancelProcessInstanceResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/cancelprocessinstanceresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CancelProcessInstanceResponse.json) |
| CompleteJobRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/completejobrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CompleteJobRequest.json) |
| CompleteJobResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/completejobresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CompleteJobResponse.json) |
| CreateProcessInstanceRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/createprocessinstancerequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CreateProcessInstanceRequest.json) |
| CreateProcessInstanceResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/createprocessinstanceresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CreateProcessInstanceResponse.json) |
| CreateProcessInstanceWithResultRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/createprocessinstancewithresultrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CreateProcessInstanceWithResultRequest.json) |
| CreateProcessInstanceWithResultResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/createprocessinstancewithresultresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/CreateProcessInstanceWithResultResponse.json) |
| DeployResourceRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/deployresourcerequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/DeployResourceRequest.json) |
| DeployResourceResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/deployresourceresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/DeployResourceResponse.json) |
| FailJobRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/failjobrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/FailJobRequest.json) |
| FailJobResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/failjobresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/FailJobResponse.json) |
| ModifyProcessInstanceRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/modifyprocessinstancerequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ModifyProcessInstanceRequest.json) |
| ModifyProcessInstanceResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/modifyprocessinstanceresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ModifyProcessInstanceResponse.json) |
| PublishMessageRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/publishmessagerequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/PublishMessageRequest.json) |
| PublishMessageResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/publishmessageresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/PublishMessageResponse.json) |
| ResolveIncidentRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/resolveincidentrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ResolveIncidentRequest.json) |
| ResolveIncidentResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/resolveincidentresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ResolveIncidentResponse.json) |
| SetVariablesRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/setvariablesrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/SetVariablesRequest.json) |
| SetVariablesResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/setvariablesresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/SetVariablesResponse.json) |
| ThrowErrorRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/throwerrorrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ThrowErrorRequest.json) |
| ThrowErrorResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/throwerrorresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/ThrowErrorResponse.json) |
| TopologyRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/topologyrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/TopologyRequest.json) |
| TopologyResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/topologyresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/TopologyResponse.json) |
| UpdateJobRetriesRequest | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/updatejobretriesrequest.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/UpdateJobRetriesRequest.json) |
| UpdateJobRetriesResponse | [docs](https://hauptmedia.github.io/zeebe-gateway-types/interfaces/updatejobretriesresponse.html) | [JSON Schema](https://hauptmedia.github.io/zeebe-gateway-types/jsonschema/UpdateJobRetriesResponse.json) |

## Usage for the grpc-js client

```typescript
import {GatewayClient, DeployResourceRequest} from "@hauptmedia/zeebe-gateway-types";
import {ChannelCredentials} from "@grpc/grpc-js";

const zbc = new GatewayClient("localhost:26500", ChannelCredentials.createInsecure());

const req = DeployResourceRequest.fromJSON({
"resources": [
{
"name": "test.bpmn",
"content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGJwbW46ZGVmaW5pdGlvbnMgeG1sbnM6YnBtbj0iaHR0cDovL3d3dy5vbWcub3JnL3NwZWMvQlBNTi8yMDEwMDUyNC9NT0RFTCIgeG1sbnM6YnB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