-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move jsdoc examples to methods rather than class
- Loading branch information
Showing
1 changed file
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,33 +112,6 @@ export interface WebhookAPIEventNotificationReturn { | |
* | ||
* @since 1.0.0 | ||
* @author Dom Webber <[email protected]> | ||
* @example | ||
* // Receive Registration Requests via Webhook | ||
* app.get( | ||
* "/path/to/webhook", | ||
* async (req, res) => { | ||
* const reg = await sdk.webhook.register(req, res); | ||
* // DIY: Check the reg.verifyToken value | ||
* if (reg.verifyToken !== "abcd") { | ||
* return reg.reject(); | ||
* } | ||
* return reg.accept(); | ||
* } | ||
* ); | ||
* @example | ||
* // Receive a Message via Webhook | ||
* app.post( | ||
* "/path/to/webhook", | ||
* async (req, res) => { | ||
* const event = sdk.webhook.eventNotification(req, res); | ||
* // DIY: Load the Meta App Secret | ||
* event.verifyIntegrity("abcd-app-secret"); | ||
* if (someFailedCondition) { | ||
* return event.reject(); | ||
* } | ||
* return event.accept(); | ||
* } | ||
* ); | ||
*/ | ||
export default class CloudAPIWebhook extends AbstractAPI { | ||
/** | ||
|
@@ -150,6 +123,19 @@ export default class CloudAPIWebhook extends AbstractAPI { | |
* @since 4.0.0 | ||
* @author Dom Webber <[email protected]> | ||
* @throws {CloudWebhookAPIError} | ||
* @example | ||
* // Receive Registration Requests via Webhook | ||
* app.get( | ||
* "/path/to/webhook", | ||
* async (req, res) => { | ||
* const reg = await sdk.webhook.register(req, res); | ||
* // DIY: Check the reg.verifyToken value | ||
* if (reg.verifyToken !== "abcd") { | ||
* return reg.reject(); | ||
* } | ||
* return reg.accept(); | ||
* } | ||
* ); | ||
*/ | ||
public async register( | ||
req: IncomingMessage, | ||
|
@@ -194,6 +180,20 @@ export default class CloudAPIWebhook extends AbstractAPI { | |
* | ||
* @since 4.0.0 | ||
* @author Dom Webber <[email protected]> | ||
* @example | ||
* // Receive a Message via Webhook | ||
* app.post( | ||
* "/path/to/webhook", | ||
* async (req, res) => { | ||
* const event = sdk.webhook.eventNotification(req, res); | ||
* // DIY: Load the Meta App Secret | ||
* event.verifyIntegrity("abcd-app-secret"); | ||
* if (someFailedCondition) { | ||
* return event.reject(); | ||
* } | ||
* return event.accept(); | ||
* } | ||
* ); | ||
*/ | ||
public async eventNotification( | ||
req: IncomingMessage, | ||
|