Skip to content

Commit

Permalink
Adding docs script and initial docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dminones committed May 21, 2019
1 parent 0c4b612 commit b3663f8
Show file tree
Hide file tree
Showing 9 changed files with 2,394 additions and 18 deletions.
9 changes: 9 additions & 0 deletions docs/server/README.md
@@ -0,0 +1,9 @@

### Table of Contents

- ./server
- [./server/gun.md](./server/gun.md)
- [./server/mautic.md](./server/mautic.md)
- [./server/send.md](./server/send.md)
- [./server/utils.md](./server/utils.md)
- [./server/verification.md](./server/verification.md)
47 changes: 47 additions & 0 deletions docs/server/server/gun.md
@@ -0,0 +1,47 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [GunDB][1]
- [init][2]
- [Parameters][3]
- [recordSanitize][4]
- [Parameters][5]

## GunDB

### init

#### Parameters

- `server` **(any | null)**
- `password` **[string][6]** SEA password for GoodDollar user
- `name` **[string][6]** folder to store gundb
- `s3` **\[S3Conf]** optional S3 settings instead of local file storage

Returns **[Promise][7]&lt;[boolean][8]>**

### recordSanitize

remove the soul field(\_) from gun records

#### Parameters

- `obj` **any** (optional, default `{}`)
- `gun` **any** record

[1]: #gundb

[2]: #init

[3]: #parameters

[4]: #recordsanitize

[5]: #parameters-1

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
9 changes: 9 additions & 0 deletions docs/server/server/mautic.md
@@ -0,0 +1,9 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [Mautic][1]

## Mautic

[1]: #mautic
48 changes: 48 additions & 0 deletions docs/server/server/send.md
@@ -0,0 +1,48 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [sendRecoveryInstructionsByEmail][1]
- [sendRecoveryInstructionsByEmail][2]
- [Parameters][3]
- [sendEmailConfirmationLink][4]
- [Parameters][5]

## sendRecoveryInstructionsByEmail

## sendRecoveryInstructionsByEmail

Sends an email with recovery instructions to the user's registered email through SendGrid.
Send it by an API using a Transactional Template

### Parameters

- `to` **[string][6]** User email
- `name` **[string][6]** User name
- `key` **[string][6]** Mnemonic key

Returns **([Promise][7]&lt;R> | [Promise][7]&lt;(R | any)>)**

## sendEmailConfirmationLink

Sends an email to the user's registered email through SendGrid.send API using a Transactional Template

### Parameters

- `user` **UserRecord** User profile

Returns **([Promise][7]&lt;R> | [Promise][7]&lt;(R | any)>)**

[1]: #sendrecoveryinstructionsbyemail

[2]: #sendrecoveryinstructionsbyemail-1

[3]: #parameters

[4]: #sendemailconfirmationlink

[5]: #parameters-1

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
60 changes: 60 additions & 0 deletions docs/server/server/utils.md
@@ -0,0 +1,60 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [wrapAsync][1]
- [Parameters][2]
- [lightLogs][3]
- [Parameters][4]
- [onlyInEnv][5]
- [Parameters][6]

## wrapAsync

Make sure to `.catch()` any errors and pass them along to the `next()`
middleware in the chain, in this case the error handler.

### Parameters

- `fn` **[Function][7]**

Returns **[Function][7]**

## lightLogs

Prevents logging header information when logging

### Parameters

- `fn` **[Function][7]**

Returns **[Function][7]**

## onlyInEnv

If in production execute the following middleware

### Parameters

- `environments` **...[Array][8]&lt;[string][9]>**
- `req`
- `res`
- `next`

[1]: #wrapasync

[2]: #parameters

[3]: #lightlogs

[4]: #parameters-1

[5]: #onlyinenv

[6]: #parameters-2

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
39 changes: 39 additions & 0 deletions docs/server/server/verification.md
@@ -0,0 +1,39 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [verifyEmail][1]
- [Parameters][2]
- [post][3]

## verifyEmail

Verifies a user's email using its profile and the verification code

### Parameters

- `user` **UserRecord** User profile
- `verificationData` **[object][4]** object sent by the client with required verification data
- `verificationData.code` **[string][5]** code used to verify that the email is valid

Returns **[Promise][6]&lt;([boolean][7] \| [Error][8])>**

## post

Send verification email endpoint

[1]: #verifyemail

[2]: #parameters

[3]: #post

[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error

0 comments on commit b3663f8

Please sign in to comment.