# process-reporting-ts

> Process reporting with typescript

Latest version **2.12.0** (published 2026-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install process-reporting-ts
pnpm add process-reporting-ts
yarn add process-reporting-ts
bun add process-reporting-ts
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.12.0 |
| Published | 2026-03-20 |
| First published | 2023-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 74.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | microtema@web.de |
| Maintainers | microtema |
| Keywords | AOP, Typescript, NPM, Open-Source, Process-Reporting |

## Links

- npm: https://www.npmjs.com/package/process-reporting-ts
- Repository: https://github.com/microtema/process-reporting-ts
- Homepage: https://github.com/microtema/process-reporting-ts#readme
- Issues: https://github.com/microtema/process-reporting-ts/issues
- npm.io page: https://npm.io/package/process-reporting-ts

## Dependencies (7)

- [test](https://npm.io/package/test.md) ^3.3.0
- [uuid](https://npm.io/package/uuid.md) ^9.0.1
- [mustache](https://npm.io/package/mustache.md) ^4.2.0
- [bpmn-moddle](https://npm.io/package/bpmn-moddle.md) ^9.0.1
- [axios-observable](https://npm.io/package/axios-observable.md) ^2.0.0
- [@types/bpmn-moddle](https://npm.io/package/@types/bpmn-moddle.md) ^5.1.11
- [pure-function-decorator](https://npm.io/package/pure-function-decorator.md) ^2.0.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.12.0 (latest) — 2026-03-20
- 2.11.7 — 2026-03-20
- 2.11.6 — 2026-03-20
- 2.11.5 — 2026-03-20
- 2.11.4 — 2026-03-20
- 2.11.3 — 2026-03-20
- 2.11.2 — 2026-03-20
- 2.11.1 — 2026-03-20
- 2.11.0 — 2026-03-20
- 2.10.2 — 2025-01-15
- 2.10.1 — 2025-01-15
- 2.10.0 — 2025-01-15
- 2.9.0 — 2025-01-15
- 2.8.0 — 2025-01-15
- 2.7.0 — 2025-01-12
- … 25 more at https://npm.io/package/process-reporting-ts/versions

## README

# Process Report Starter

> Dependency management is a critical aspects of any complex project. And doing this manually is less than ideal; the
> more time you spent on it the less time you have on the other important aspects of the project.
> Process report Starter were built to address exactly this problem. You get a one-stop-shop for all the functionality
> that you need to audit your process flow.

![Event Reporting Workflow](Resources/reporting-service-building-block.png)

![Event Reporting Process View](Resources/reporting-01.png)

![Event Reporting Instance View](Resources/reporting-02.png)

![Event Reporting Instance Details View](Resources/reporting-03.png)

![Event Reporting Porcess Diagram View](Resources/reporting-04.png)

![Event Reporting Porcess Report View](Resources/reporting-05.png)

## Requirements

* NPM package
  ```
    npm install process-reporting-ts
  ```
* @BpmnElement on method
  ```
    import {BpmnElement} from "process-reporting-ts";
  
    @BpmnElement(id = "Event_1anjljr", startEvent = true, keyExpression = "{{ event.PO_NUMBER }}")
    public execute(PurchaseOrderEvent event) {

        return ...;
    }

    ----

    @BpmnElement(id = "Activity_194xhhj")
    public execute(PurchaseOrder data) {

        return ...;
    }

    ---

    @BpmnElement(id = "Event_0byexdn", endEvent = true)
    public execute(ProcurementOrder procurementOrder, boolean purchaseOrderExists) {

        return ...;
    }
  ```
* AOP on function
```
import {interceptHandler} from "process-reporting-ts";

function execute(PurchaseOrderEvent data) {

   return ...
}

const aopHandler = interceptHandler(execute, {
    startEvent: true,
    instanceIdExpression: '{{ headers.TX_ID }}',
    keyExpression: '{{ data.PO_NUMBER }}'
})

```

* .env
  ```
  REPORTING_PROCESS_ID: Process_0e2hw2v
  REPORTING_PROCESS_SERVER: http://localhost:9090/reporting-service/rest
  REPORTING_PROCESS_VERSION: 1.0
  ```
* BPMN process-flow.bpmn
    * ![Event Reporting Workflow](Resources/process-flow-diagram.png)

## Testing

### Unit Test

```npm test```

## API

### REST Report API

```
@POST ${reporting.server}/api/report

@BODY {
    ...@ReportEvent
}
```

### REST Process API

```
@POST ${reporting.server}/api/process

@BODY {
    ...@ProcessEvent
}
```

### REST Heart Beat API

```
@POST ${reporting.server}/api/definition/heart-beat

@BODY {
    ...@HeartBeatEvent
}
```

### REST Process Definition API

```
@POST ${reporting.server}/api/definition

@BODY {
    ...@RegisterEvent
}
```

### Reporting Properties

| Name                 | Type   | Required | Default Value | Description                           |
|----------------------|--------|----------|---------------|---------------------------------------|
| processId            | String | true     |               | Unique Process Id                     |
| processName          | String | true     |               | Process Name                          |
| processVersion       | String | true     | 1.0           | Process Version                       |
| server               | String | true     |               | Process Reporting Service             |
| heartBeatCron        | String | false    | 0 */2 * ? * * | report heart beat for current service |
| maxEventContentLimit | int    | false    | 2000          | Max event content size                |

### BaseReportEvent

| Name           | Type          | Required | Default Value | Description                                       |
|----------------|---------------|----------|---------------|---------------------------------------------------|
| transactionId  | String        | true     |               | Unique Transaction Id generated by system         |
| processId      | String        | true     |               | Unique Process Id                                 |
| processVersion | String        | true     | 1.0           | Process Version                                   |
| executionId    | String        | true     |               | Process Unique execution Id generated by system   |
| errorMessage   | String        | false    |               | Error Message during execution                    |
| status         | ReportStatus  | false    |               | report status STARTED, COMPLETED, ...             |
| eventTime      | LocalDateTime | true     | now           | Event time generated by system                    |
| retryCount     | int           | false    | 0             | Retry Count                                       |
| partCount      | int           | false    | 0             | Part Count im Event maxEventContentLimit exceeded |

### ProcessEvent extends BaseReportEvent

| Name               | Type          | Required | Default Value | Description                                    |
|--------------------|---------------|----------|---------------|------------------------------------------------|
| eventTriggeredTime | LocalDateTime | true     |               | Event Triggered time from source system        |
| startBy            | String        | true     |               | who started the process?                       |
| boundedContext     | String        | true     |               | Bounded Context that process belong to         |
| eventType          | String        | true     |               | Event Type CREATED, UPDATED, DELETED, ...      |
| eventSource        | String        | true     |               | Event Source  who throw this event? (System-A) |
| runtimeId          | String        | true     |               | Runtime Id generated by system                 |
| referenceId        | String        | true     |               | Reference Id                                   |

### ReportEvent extends BaseReportEvent

| Name                  | Type   | Required | Default Value | Description                                  |
|-----------------------|--------|----------|---------------|----------------------------------------------|
| elementId             | String | true     |               | BPMN Element unique Id                       |
| multipleInstanceIndex | String | true     |               | Task may be executed multiple times          |
| payload               | String | true     |               | Event Payload like Json or primitive Objects |

### HeartBeatEvent

| Name           | Type          | Required | Default Value | Description                    |
|----------------|---------------|----------|---------------|--------------------------------|
| processId      | String        | true     |               | Unique Process Id              |
| processVersion | String        | true     | 1.0           | Process Version                |
| eventTime      | LocalDateTime | true     | 0             | Event time generated by system |

### RegisterEvent

| Name           | Type   | Required | Default Value | Description                            |
|----------------|--------|----------|---------------|----------------------------------------|
| processDiagram | String | true     |               | Process XML Diagram                    |
| processId      | String | true     |               | Unique Process Id                      |
| processVersion | String | true     | 1.0           | Process Version                        |
| boundedContext | String | true     |               | Bounded Context that process belong to |
| fileName       | String | true     |               | Process XML Diagram file name          |

### ReportStatus

| Type      | Description                                               |
|-----------|-----------------------------------------------------------|
| QUEUED    | Process has been queued                                   |
| STARTED   | Process/Task has been started                             |
| RESTARTED | Process/Task has been restarted                           |
| COMPLETED | Process/Task has been completed                           |
| WARNING   | Task has ended with warning but Process keep running      |
| ERROR     | Task has ended with error and Process has been terminated |

## Technology Stack

* Nodejs v16.20.2
* Third Party Libraries
    * jest 29.5.8
    * model-converter (MIT License)
    * mustache 4.2.5
    * typescript 5.2.2
    * axios-observable 2.0.0
* Code-Analyses
    * Sonar
    * jest coverage

## License

MIT (unless noted otherwise)

---
_Source: https://npm.io/package/process-reporting-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
