Skip to content

Commit

Permalink
chore: add missing docs, contributorsrc and license
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxken committed Jun 3, 2022
1 parent ba8073e commit a2c6a9d
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
],
"contributorsPerLine": 7,
"projectName": "events",
"projectOwner": "MyUnisoft",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 MyUnisoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Events
MyUnisoft Events data validation, and transparency on events & result of webhooks.
<p align="center"><h1 align="center">
Events
</h1>

<p align="center">
MyUnisoft Events validator, schemas and types (useful to work with Webhooks).
</p>

<p align="center">
<a href="https://github.com/MyUnisoft/events"><img src="https://img.shields.io/github/package-json/v/MyUnisoft/events?style=flat-square" alt="npm version"></a>
<a href="https://github.com/MyUnisoft/events"><img src="https://img.shields.io/github/license/MyUnisoft/events?style=flat-square" alt="license"></a>
<a href="https://github.com/MyUnisoft/events"><img src="https://img.shields.io/github/languages/code-size/MyUnisoft/events?style=flat-square" alt="size"></a>
<a href="./SECURITY.md"><img src="https://img.shields.io/badge/Security-Responsible%20Disclosure-yellow.svg?style=flat-square" alt="Responsible Disclosure Policy" /></a>
</p>

## Requirements
- [Node.js](https://nodejs.org/en/) version 14 or higher
Expand Down Expand Up @@ -34,9 +46,14 @@ const event: EventsDefinition.AccountingFolder = {
validateEventData<"connector" | "accountingFolder">(event);
```

## API

### validateEventData< T extends keyof EventsDefinition.Events >(options: EventsDefinition.Events[ T ]): void
Throw an error if a given event is not internaly known.

## Types

### EventOptions
<details><summary>EventOptions</summary>

```ts
export type EventOptions<K extends keyof EventsDefinition.Events> = {
Expand All @@ -60,7 +77,9 @@ const event: EventOptions<"connector"> = {
}
```

### EventsOptions
</details>

<details><summary>EventOptions</summary>

```ts
type TupleToObject<T extends readonly any[],
Expand Down Expand Up @@ -117,8 +136,9 @@ const event: EventsOptions<["connector", "accountingFolder"]> = {
}
}
```
</details>

### WebhooksResponse
<details><summary>WebhooksResponse</summary>

```ts
type WebhookResponse<K extends keyof EventsDefinition.Events> = {
Expand Down Expand Up @@ -158,3 +178,24 @@ const response: WebhooksResponse<["connector", "accountingFolder"]> = [
},
];
```
</details>

## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## License
MIT

0 comments on commit a2c6a9d

Please sign in to comment.