Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ebenos/messenger-adapter

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ebenos/messenger-adapter - npm Package Compare versions

Comparing version 4.0.0-alpha.1 to 4.0.0-alpha.2

6

build/adapter/adapter.d.ts
import { GenericAdapter, IInteraction } from '@ebenos/framework';
import { Router } from 'express';
import { SenderFunction } from './sender';
import MessengerUser from './MessengerUser';
import { UserDataFields, MessagingOptions } from './interfaces/messengerAPI';

@@ -16,3 +15,3 @@ export interface MessengerWebhookOptions {

}
export default class MessengerAdapter<T extends MessengerUser> extends GenericAdapter<MessengerOperations> {
export default class MessengerAdapter extends GenericAdapter<MessengerOperations> {
private webhookKey;

@@ -22,2 +21,3 @@ private pageToken;

private pageId;
private userLoader;
getUserData: (id: string, fields: UserDataFields[]) => Promise<void>;

@@ -27,3 +27,3 @@ operations: MessengerOperations;

webhook: Router;
constructor(options: MessengerWebhookOptions, sendFunction?: SenderFunction, domain?: string);
constructor(options: MessengerWebhookOptions, userLoader?: (id: string) => Promise<any>, sendFunction?: SenderFunction, domain?: string);
initialization(): void;

@@ -30,0 +30,0 @@ private validationEndpoint;

@@ -13,3 +13,3 @@ "use strict";

class MessengerAdapter extends framework_1.GenericAdapter {
constructor(options, sendFunction, domain) {
constructor(options, userLoader, sendFunction, domain) {
const { route = '/fb', webhookKey = 'ebony123', pageId, pageToken } = options;

@@ -28,6 +28,12 @@ super();

this.webhook = express_1.Router();
if (userLoader) {
this.userLoader = userLoader;
}
else {
this.userLoader = MessengerUser_1.userLoader(this.pageToken);
}
}
initialization() {
const messaging = messaging_1.default({
userLoader: MessengerUser_1.userLoader(this.pageToken),
userLoader: this.userLoader,
routers: this.routers,

@@ -34,0 +40,0 @@ handlers: this.handlers

{
"name": "@ebenos/messenger-adapter",
"version": "4.0.0-alpha.1",
"version": "4.0.0-alpha.2",
"description": "Facebook SendAPI Library for the Ebony framework.",

@@ -49,3 +49,3 @@ "main": "./build/index.js",

],
"gitHead": "04583595fb6aef30da25b21674815e34db7b621b"
"gitHead": "84bdb35abcd71f8a83c40be4b6ce36e493abbf95"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc