Skip to content

Commit

Permalink
fix: move jsdoc examples to methods rather than class
Browse files Browse the repository at this point in the history
  • Loading branch information
domwebber committed Dec 4, 2023
1 parent 4984731 commit 8696d20
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions src/CloudAPI/CloudAPIWebhook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8696d20

Please sign in to comment.