Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add info about TypeScript support #2247

Merged
merged 22 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/api/aggregate/command-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ id: command-handler
title: Command Handler
---

:::info TypeScript Support

Command handlers are grouped into an Aggregate container object that has an associated TypeScript type:

- Type Name - `Aggregate`
- Package - `@resolve-js/core`

:::

A command handler function has the following structure:

EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved
```js
Expand Down
9 changes: 9 additions & 0 deletions docs/api/aggregate/projection.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ id: projection
title: Projection
---

:::info TypeScript Support

An aggregate projection object has an associated TypeScript type:

- Type Name - `AggregateProjection`
- Package - `@resolve-js/core`

:::

An aggregate projection is an object of the following structure:

```js
Expand Down
18 changes: 18 additions & 0 deletions docs/api/api-handler/api-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ The handler receives a request and response objects. See the sections below for

### Request

:::info TypeScript Support

A request object has an associated TypeScript type:

- Type Name - `ResolveRequest`
- Package - `@resolve-js/runtime-base`

:::

The request object exposes the following fields:

| Field | Description |
Expand All @@ -30,6 +39,15 @@ The request object exposes the following fields:

### Response

:::info TypeScript Support

A response object has an associated TypeScript type:

- Type Name - `ResolveResponse`
- Package - `@resolve-js/runtime-base`

:::

The request object exposes the following functions:

| Function | Description |
Expand Down
9 changes: 9 additions & 0 deletions docs/api/api-handler/resolve-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ title: ReSolve Context
description: The 'resolve' context object is available to an API handler function through its request (req) argument. This object implements a communication layer between an API handler and the reSolve framework.
---

:::info TypeScript Support

A reSolve context object has an associated TypeScript type:

- Type Name - `UserBackendResolve`
- Package - `@resolve-js/runtime-base`

:::

The `resolve` context object is available to an [API handler](api-handler.md) function through its [request (`req`)](api-handler.md#request) argument. This object implements a communication layer between an API handler and the reSolve framework.

The `resolve` context object exposes the following API:
Expand Down
18 changes: 18 additions & 0 deletions docs/api/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ title: Command

## Command Object

:::info TypeScript Support

An command object has an associated TypeScript type:
EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved

- Type Name - `Command`
- Package - `@resolve-js/core`

:::

A command is an object of the following structure:

<!-- prettier-ignore-start -->
Expand All @@ -23,6 +32,15 @@ A command is an object of the following structure:

## Command Result Object

:::info TypeScript Support

An command result object has an associated TypeScript type:
EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved

- Type Name - `CommandResult`
- Package - `@resolve-js/core`

:::

A command result object has the following structure:

<!-- prettier-ignore-start -->
Expand Down
9 changes: 9 additions & 0 deletions docs/api/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ id: event
title: Event
---

:::info TypeScript Support

An event object has an associated TypeScript type:

- Type Name - `Event`
- Package - `@resolve-js/core`

:::

An event is an object of the following structure:

EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved
<!-- prettier-ignore-start -->
Expand Down
27 changes: 27 additions & 0 deletions docs/api/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ description: This document describes API used by Aggregate and Read Model middle

## Command Middleware

:::info TypeScript Support

A command middleware function has an associated TypeScript type:

- Type Name - `CommandMiddleware`
- Package - `@resolve-js/core`

:::

A command middleware function has the following structure:

```js
Expand Down Expand Up @@ -43,6 +52,15 @@ Both `req` and `res` fields are included only if the client sends the command. I

## Read Model Projection Middleware

:::info TypeScript Support

A read model projection middleware function has an associated TypeScript type:

- Type Name - `ReadModelProjectionMiddleware`
- Package - `@resolve-js/core`

:::

A read model projection middleware function has the following structure:

```js
Expand Down Expand Up @@ -78,6 +96,15 @@ A projection middleware handler's `middlewareContext` argument is an object with

## Read Model Resolver Middleware

:::info TypeScript Support

A read model resolver middleware function has an associated TypeScript type:

- Type Name - `ReadModelResolverMiddleware`
- Package - `@resolve-js/core`

:::

A read model resolver middleware function has the following structure:

```js
Expand Down
18 changes: 18 additions & 0 deletions docs/api/monitoring/metric.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ title: Monitoring Metric

## Metric Object

:::info TypeScript Support

A monitoring metric object has an associated TypeScript type:

- Type Name - `MonitoringMetric`
- Package - `@resolve-js/core`

:::

A monitoring metric object contains information about a particular metric collected during application execution. Metrics are stored and processed internally by monitoring adapters and can be accessed through a monitoring object's [`getMetrics`](monitoring.md#getmetrics) method:

```js
Expand All @@ -26,6 +35,15 @@ A metric object has the following structure:

## Custom Metric Object

:::info TypeScript Support

A custom metric object has an associated TypeScript type:

- Type Name - `MonitoringCustomMetric`
- Package - `@resolve-js/core`

:::

A custom metric object is used to pass metric data to the `metrics.custom()` method. This object has the following structure:

```js
Expand Down
9 changes: 9 additions & 0 deletions docs/api/monitoring/monitoring-adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ description: This document describes the interface that a monitoring adapter sho

## Monitoring Adapter API

:::info TypeScript Support

A monitoring adapter object has an associated TypeScript type:

- Type Name - `MonitoringAdapter`
- Package - `@resolve-js/core`

:::

A monitoring adapter implementation should expose the following interface:
EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved

EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved
| Member Name | Description |
Expand Down
9 changes: 9 additions & 0 deletions docs/api/monitoring/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ id: monitoring
title: Monitoring Interface
---

:::info TypeScript Support

A monitoring object has an associated TypeScript type:

- Type Name - `Monitoring`
- Package - `@resolve-js/core`

:::

A monitoring object's interface doubles the interface of a monitoring adapter except for the [`getMetrics`](#getmetrics) and [`clearMetrics`](#clearmetrics) methods that require a monitoring adapted ID as an argument.
EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved

A monitoring object exposes the following API:
Expand Down
9 changes: 9 additions & 0 deletions docs/api/read-model/projection.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ id: projection
title: Projection
---

:::info TypeScript Support

A read model projection has an associated TypeScript type:

- Type Name - `ReadModel`
- Package - `@resolve-js/core`

:::

A read model projection is an object of the following structure:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the following line below:

Line 14:
// and updates the store based on the event's data

Please add a period at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

```js
Expand Down
18 changes: 18 additions & 0 deletions docs/api/read-model/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ title: Query

## Query Object

:::info TypeScript Support

A read model query has an associated TypeScript type:

- Type Name - `ReadModelQuery`
- Package - `@resolve-js/core`

:::

A read model query object has the following structure:

<!-- prettier-ignore-start -->
Expand All @@ -22,6 +31,15 @@ A read model query object has the following structure:

## Result Object

:::info TypeScript Support

A read model query result has an associated TypeScript type:

- Type Name - `ReadModelQueryResult`
- Package - `@resolve-js/core`

:::

A read model query result can be a value of any serializable type depending on the implementation of the queried read model resolver:

```js title="common/read-models/shopping-lists.resolvers.js"
Expand Down
9 changes: 9 additions & 0 deletions docs/api/read-model/resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ title: Resolver
description: A resolver is the part of a Read Model that handles data requests.
---

:::info TypeScript Support

Read model resolvers are grouped into a Resolvers container object that has an associated TypeScript type:

- Type Name - `ReadModelResolvers`
- Package - `@resolve-js/core`

:::

A read model resolver function has the following structure:

```js
Expand Down
17 changes: 13 additions & 4 deletions docs/api/read-model/store.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ title: Store
description: This document describes functions that you can use to communicate with a Read Model store through a `store` object.
---

:::info TypeScript Support

A read model store has an associated TypeScript type:

- Type Name - `ResolveStore`
- Package - `@resolve-js/readmodel-base`

:::

The table below lists functions that you can use to communicate with a read model store through a `store` object.

| Function Name | Description |
Expand Down Expand Up @@ -143,10 +152,10 @@ Returns the number of items that meet the specified condition.

#### Arguments

| Argument Name | Description |
| --------------- | --------------------------------------------- |
| tableName | A table name. |
| searchCondition | An object that defines a search expression. |
| Argument Name | Description |
| --------------- | ------------------------------------------- |
| tableName | A table name. |
| searchCondition | An object that defines a search expression. |

#### Example

EugeniyBurmistrov marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
9 changes: 9 additions & 0 deletions docs/api/saga.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ title: Saga
description: This document describes API used by sagas.
---

:::info TypeScript Support

A saga object has an associated TypeScript type:

- Type Name - `Saga`
- Package - `@resolve-js/core`

:::

A saga's event handler receives an object that provides access to the saga-related API. This API includes the following objects:

| Object Name | Description |
Expand Down
9 changes: 9 additions & 0 deletions docs/api/view-model/projection.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ id: projection
title: Projection
---

:::info TypeScript Support

A view model projection object has an associated TypeScript type:

- Type Name - `ViewModelProjection`
- Package - `@resolve-js/core`

:::

A view model projection is an object of the following structure:

```js
Expand Down
18 changes: 18 additions & 0 deletions docs/api/view-model/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ title: Query

## Query Object

:::info TypeScript Support

A view model query has an associated TypeScript type:

- Type Name - `ViewModelQuery`
- Package - `@resolve-js/core`

:::

A view model query object has the following structure:

<!-- prettier-ignore-start -->
Expand All @@ -20,4 +29,13 @@ A view model query object has the following structure:

## Result Object

:::info TypeScript Support

A view model query result has an associated TypeScript type:

- Type Name - `ViewModelQueryResult`
- Package - `@resolve-js/core`

:::

A view model query result is a serializable value, whose type and internal structure depend on the [view model projection](projection.md)'s implementation.
Loading