Skip to content

Commit

Permalink
📝 docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Jan 20, 2023
1 parent da397f2 commit 6fbd9a3
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 8 deletions.
34 changes: 32 additions & 2 deletions docs-v3/docs/api/classes/api_Client.Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,7 @@ If you have set `onAnyMessage` or `onMessage` with the second parameter (PQueue
| `onChatState` | `default`<`default`, `DefaultAddOptions`\> |
| `onContactAdded` | `default`<`default`, `DefaultAddOptions`\> |
| `onGlobalParticipantsChanged` | `default`<`default`, `DefaultAddOptions`\> |
| `onGroupChange` | `default`<`default`, `DefaultAddOptions`\> |
| `onIncomingCall` | `default`<`default`, `DefaultAddOptions`\> |
| `onLabel` | `default`<`default`, `DefaultAddOptions`\> |
| `onLogout` | `default`<`default`, `DefaultAddOptions`\> |
Expand Down Expand Up @@ -2380,7 +2381,7 @@ ___

### middleware

**middleware**(`useSessionIdInPath?`): (`req`: `Request`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>, `res`: `Response`<`any`, `Record`<`string`, `any`\>\>, `next`: `NextFunction`) => `Promise`<`any`\>
**middleware**(`useSessionIdInPath?`, `PORT?`): (`req`: `Request`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>, `res`: `Response`<`any`, `Record`<`string`, `any`\>\>, `next`: `NextFunction`) => `Promise`<`any`\>

This exposes a simple express middlware that will allow users to quickly boot up an api based off this client. Checkout demo/index.ts for an example
How to use the middleware:
Expand Down Expand Up @@ -2460,6 +2461,7 @@ axios.post('localhost:8082', {
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `useSessionIdInPath` | `boolean` | `false` | boolean Set this to true if you want to keep each session in it's own path. For example, if you have a session with id `host` if you set useSessionIdInPath to true, then all requests will need to be prefixed with the path `host`. E.g `localhost:8082/sendText` becomes `localhost:8082/host/sendText` |
| `PORT?` | `number` | `undefined` | - |

#### Returns

Expand Down Expand Up @@ -3516,7 +3518,7 @@ Attempts to send a file as a voice note. Useful if you want to send an mp3 file.
| :------ | :------ | :------ |
| `to` | [`ChatId`](/api/types/api_model_aliases.ChatId.md) | chat id `xxxxx@c.us` |
| `file` | [`AdvancedFile`](/api/types/api_model_aliases.AdvancedFile.md) | base64 data:image/xxx;base64,xxx or the path of the file you want to send. |
| `quotedMsgId` | [`MessageId`](/api/types/api_model_aliases.MessageId.md) | string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message |
| `quotedMsgId?` | [`MessageId`](/api/types/api_model_aliases.MessageId.md) | string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message |

#### Returns

Expand Down Expand Up @@ -4353,8 +4355,16 @@ ___

**onBattery**(`fn`): `Promise`<`boolean` \| `Listener`\>

**`Deprecated`**

Listens to battery changes

:::caution

This will most likely not work with multi-device mode (the only remaining mode) since the session is no longer connected to the phone but directly to WA servers.

:::

**`Fires`**

number
Expand Down Expand Up @@ -4561,6 +4571,26 @@ Listens to add and remove events on Groups on a global level. It is memory effic
___
### onGroupChange
▸ **onGroupChange**(`fn`): `Promise`<`boolean` \| `Listener`\>
Listens to all group (gp2) events. This can be useful if you want to catch when a group title, subject or picture is changed.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `fn` | (`genericGroupChangeEvent`: [`GenericGroupChangeEvent`](/api/interfaces/api_model_group_metadata.GenericGroupChangeEvent.md)) => `void` | callback function that handles a ParticipantChangedEventModel as the first and only parameter. |
#### Returns
`Promise`<`boolean` \| `Listener`\>
`true` if the callback was registered
___
### onIncomingCall
▸ **onIncomingCall**(`fn`): `Promise`<`boolean` \| `Listener`\>
Expand Down
6 changes: 3 additions & 3 deletions docs-v3/docs/api/classes/structures_Collector.Collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ BaseCollection<K, V\>.constructor

#### Inherited from

BaseCollection.\_\_@toStringTag@1041
BaseCollection.\_\_@toStringTag@1042

___

Expand Down Expand Up @@ -100,7 +100,7 @@ ___

#### Inherited from

BaseCollection.\_\_@species@1948
BaseCollection.\_\_@species@1951

___

Expand All @@ -126,7 +126,7 @@ Returns an iterable of entries in the map.

#### Inherited from

BaseCollection.\_\_@iterator@57
BaseCollection.\_\_@iterator@48

___

Expand Down
9 changes: 9 additions & 0 deletions docs-v3/docs/api/enums/api_model_events.SimpleListener.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ Represents onGlobalParticipantsChanged

___

### GroupChange

**GroupChange** = ``"onGroupChange"``

Requires licence
Represents onGroupChange

___

### IncomingCall

**IncomingCall** = ``"onIncomingCall"``
Expand Down
4 changes: 2 additions & 2 deletions docs-v3/docs/api/functions/controllers_initializer.timeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ custom_edit_url: null

[controllers/initializer](/api/modules/controllers_initializer.md).timeout

**timeout**(`ms`): `Promise`<`unknown`\>
**timeout**(`ms`): `Promise`<`string`\>

#### Parameters

Expand All @@ -17,4 +17,4 @@ custom_edit_url: null

#### Returns

`Promise`<`unknown`\>
`Promise`<`string`\>
12 changes: 12 additions & 0 deletions docs-v3/docs/api/interfaces/api_model_config.ConfigObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,18 @@ What to do when an error is detected on a client method.

___

### oorTimeout

`Optional` **oorTimeout**: `number`

phoneIsOutOfReach check timeout

**`Default`**

`60`

___

### pQueueDefault

`Optional` **pQueueDefault**: `any`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
id: "api_model_group_metadata.GenericGroupChangeEvent"
title: "Interface: GenericGroupChangeEvent"
sidebar_label: "GenericGroupChangeEvent"
custom_edit_url: null
---

[api/model/group-metadata](/api/modules/api_model_group_metadata.md).GenericGroupChangeEvent

## Properties

### author

**author**: [`Contact`](/api/interfaces/api_model_contact.Contact.md)

The contact who triggered this event. (E.g the contact who changed the group picture)

___

### body

**body**: `string`

Some more information about the event

___

### groupMetadata

**groupMetadata**: [`GroupMetadata`](/api/interfaces/api_model_group_metadata.GroupMetadata.md)

___

### groupPic

**groupPic**: `string`

Base 64 encoded image

___

### id

**id**: [`MessageId`](/api/types/api_model_aliases.MessageId.md)

___

### type

**type**: ``"picutre"`` \| ``"create"`` \| ``"delete"`` \| ``"subject"`` \| ``"revoke_invite"`` \| ``"description"`` \| ``"restrict"`` \| ``"announce"`` \| ``"no_frequently_forwarded"`` \| ``"announce_msg_bounce"`` \| ``"add"`` \| ``"remove"`` \| ``"demote"`` \| ``"promote"`` \| ``"invite"`` \| ``"leave"`` \| ``"modify"`` \| ``"v4_add_invite_sent"`` \| ``"v4_add_invite_join"`` \| ``"growth_locked"`` \| ``"growth_unlocked"`` \| ``"linked_group_join"``

Type of the event
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ custom_edit_url: null

## Properties

### contact

**contact**: [`Contact`](/api/interfaces/api_model_contact.Contact.md)

___

### id

**id**: [`NonSerializedId`](/api/types/api_model_aliases.NonSerializedId.md)
Expand Down
1 change: 1 addition & 0 deletions docs-v3/docs/api/modules/api_model_group_metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ custom_edit_url: null

## Interfaces

- [GenericGroupChangeEvent](/api/interfaces/api_model_group_metadata.GenericGroupChangeEvent.md)
- [GroupMetadata](/api/interfaces/api_model_group_metadata.GroupMetadata.md)
- [NewCommunityGroup](/api/interfaces/api_model_group_metadata.NewCommunityGroup.md)
- [Participant](/api/interfaces/api_model_group_metadata.Participant.md)
Expand Down
2 changes: 1 addition & 1 deletion docs-v3/docs/api/reference
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: "reference"
title: "@open-wa/wa-automate - v4.52.1"
title: "@open-wa/wa-automate - v4.55.0"
sidebar_label: "Readme"
sidebar_position: 0
custom_edit_url: null
Expand Down

0 comments on commit 6fbd9a3

Please sign in to comment.