# Documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## DummyService

**Extends TMMicroServiceAPI**

-   **See: <https://jsonplaceholder.typicode.com/>**

Dummy Micro Service API that you may adopt for your needs

**Parameters**

-   `url` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** service url
-   `token` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | null)** user access tocken if available (optional, default `null`)

### Array

Posts list object

Type: PostList

**Properties**

-   `null-null` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;Post>** array of posts

### Post

Post object

Type: Post

**Properties**

-   `id` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** post id
-   `title` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** post title
-   `body` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** post body

### messages

Object with class service messages

### get

Get posts list

**Examples**

_Read posts list_

```javascript
(async () => {
  const Dummy = new DummyService('https://jsonplaceholder.typicode.com/');
  const list = await Dummy.get();
})();
```

Returns **PostList** array of posts

### post

Create post

**Parameters**

-   `title` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** post title
-   `body` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** post body

**Examples**

_Create post_

```javascript
(async () => {
  const Dummy = new DummyService('https://jsonplaceholder.typicode.com/');
  const details = await Dummy.post('My Title', 'My Text');
})();
```

Returns **Post** created post

### details

Read specific post

**Parameters**

-   `id` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** post id

**Examples**

_Get post_

```javascript
(async () => {
  const Dummy = new DummyService('https://jsonplaceholder.typicode.com/');
  const details = await Dummy.details(2);
})();
```

Returns **Post** post content
