New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

messaging-api-messenger

Package Overview
Dependencies
Maintainers
3
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

messaging-api-messenger - npm Package Compare versions

Comparing version

to
1.0.0-beta.4

2

dist/MessengerClient.js

@@ -86,2 +86,3 @@ "use strict";

(data) => data && isPlainObject_1.default(data) ? messaging_api_common_1.snakecaseKeysDeep(data) : data,
...axios_1.default.defaults.transformRequest,
],

@@ -91,2 +92,3 @@ // `transformResponse` allows changes to the response data to be made before

transformResponse: [
...axios_1.default.defaults.transformResponse,
(data) => data && isPlainObject_1.default(data) ? messaging_api_common_1.camelcaseKeysDeep(data) : data,

@@ -93,0 +95,0 @@ ],

9

package.json

@@ -9,3 +9,3 @@ {

},
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.4",
"main": "dist/index.js",

@@ -17,7 +17,7 @@ "browser": "lib/browser.js",

"axios": "^0.19.0",
"axios-error": "^1.0.0-beta.2",
"axios-error": "file:../axios-error",
"form-data": "^3.0.0",
"invariant": "^2.2.4",
"lodash": "^4.17.15",
"messaging-api-common": "^1.0.0-beta.2",
"messaging-api-common": "file:../messaging-api-common",
"warning": "^4.0.3"

@@ -36,4 +36,3 @@ },

"node": ">=8"
},
"gitHead": "142b0193efd5babac07cf7280545f7ea202deaea"
}
}

@@ -51,3 +51,3 @@ import MockAdapter from 'axios-mock-adapter';

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -91,3 +91,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -128,3 +128,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -167,3 +167,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -204,3 +204,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -242,3 +242,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -278,3 +278,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -316,3 +316,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -319,0 +319,0 @@ id: USER_ID,

@@ -47,3 +47,3 @@ import MockAdapter from 'axios-mock-adapter';

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
name: 'kpman',

@@ -50,0 +50,0 @@ profile_picture_url: 'https://i.imgur.com/zV6uy4T.jpg',

@@ -132,3 +132,3 @@ import MockAdapter from 'axios-mock-adapter';

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
get_started: {

@@ -180,3 +180,3 @@ payload: 'GET_STARTED',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['get_started', 'persistent_menu'],

@@ -266,3 +266,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
get_started: {

@@ -298,3 +298,3 @@ payload: 'GET_STARTED',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['get_started'],

@@ -425,3 +425,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
persistent_menu: [

@@ -487,3 +487,3 @@ {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
persistent_menu: [

@@ -542,3 +542,3 @@ {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
persistent_menu: [

@@ -584,3 +584,3 @@ {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['persistent_menu'],

@@ -676,3 +676,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
greeting: [

@@ -718,3 +718,3 @@ {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
greeting: [

@@ -757,3 +757,3 @@ {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['greeting'],

@@ -866,3 +866,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
ice_breakers: [

@@ -905,3 +905,3 @@ {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['ice_breakers'],

@@ -987,3 +987,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
whitelisted_domains: ['www.yoctol.com'],

@@ -1017,3 +1017,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['whitelisted_domains'],

@@ -1105,3 +1105,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
account_linking_url:

@@ -1136,3 +1136,3 @@ 'https://www.example.com/oauth?response_type=code&client_id=1234567890&scope=basic',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['account_linking_url'],

@@ -1226,3 +1226,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
payment_settings: {

@@ -1258,3 +1258,3 @@ privacy_url: 'https://www.example.com',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
payment_settings: {

@@ -1290,3 +1290,3 @@ public_key: 'YOUR_PUBLIC_KEY',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
payment_settings: {

@@ -1322,3 +1322,3 @@ test_users: ['12345678'],

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['payment_settings'],

@@ -1413,3 +1413,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
home_url: {

@@ -1447,3 +1447,3 @@ url: 'http://petershats.com/send-a-hat',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
fields: ['home_url'],

@@ -1450,0 +1450,0 @@ });

@@ -61,3 +61,3 @@ import fs from 'fs';

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -108,3 +108,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -151,3 +151,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -197,3 +197,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'MESSAGE_TAG',

@@ -244,3 +244,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'RESPONSE',

@@ -290,3 +290,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -344,3 +344,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -398,3 +398,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -444,3 +444,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -489,3 +489,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -534,3 +534,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -574,3 +574,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'MESSAGE_TAG',

@@ -618,3 +618,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -663,3 +663,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -740,3 +740,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -785,3 +785,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -862,3 +862,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -907,3 +907,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -984,3 +984,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -1029,3 +1029,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -1105,3 +1105,3 @@ recipient: {

expect(url).toEqual(`https://graph.facebook.com/v4.0/`);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
access_token: ACCESS_TOKEN,

@@ -1145,3 +1145,3 @@ batch: [

expect(url).toEqual(`https://graph.facebook.com/v4.0/`);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
access_token: ACCESS_TOKEN,

@@ -1193,3 +1193,3 @@ batch: [

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1228,3 +1228,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1264,3 +1264,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1299,3 +1299,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1335,3 +1335,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1370,3 +1370,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1406,3 +1406,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1441,3 +1441,3 @@ id: USER_ID,

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
recipient: {

@@ -1444,0 +1444,0 @@ id: USER_ID,

@@ -57,3 +57,3 @@ import MockAdapter from 'axios-mock-adapter';

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -116,3 +116,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -189,3 +189,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -279,3 +279,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -370,3 +370,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'MESSAGE_TAG',

@@ -449,3 +449,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -556,3 +556,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -712,3 +712,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -884,3 +884,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -1076,3 +1076,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -1266,3 +1266,3 @@ recipient: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
messaging_type: 'UPDATE',

@@ -1269,0 +1269,0 @@ recipient: {

@@ -136,3 +136,3 @@ import fs from 'fs';

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
object: 'page',

@@ -175,3 +175,3 @@ callback_url: 'https://mycallback.com',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
object: 'user',

@@ -477,3 +477,3 @@ callback_url: 'https://mycallback.com',

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
message: {

@@ -519,3 +519,3 @@ attachment: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
message: {

@@ -591,3 +591,3 @@ attachment: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
message: {

@@ -633,3 +633,3 @@ attachment: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
message: {

@@ -675,3 +675,3 @@ attachment: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
message: {

@@ -717,3 +717,3 @@ attachment: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
message: {

@@ -762,3 +762,3 @@ attachment: {

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
access_token: ACCESS_TOKEN,

@@ -792,3 +792,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
access_token: ACCESS_TOKEN,

@@ -822,3 +822,3 @@ });

);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
access_token: ACCESS_TOKEN,

@@ -863,3 +863,3 @@ });

expect(url).toEqual(`https://graph.facebook.com/v4.0/12345/activities`);
expect(data).toEqual({
expect(JSON.parse(data)).toEqual({
event: 'CUSTOM_APP_EVENTS',

@@ -866,0 +866,0 @@ custom_events:

@@ -9,3 +9,3 @@ import crypto from 'crypto';

import appendQuery from 'append-query';
import axios, { AxiosInstance } from 'axios';
import axios, { AxiosInstance, AxiosTransformer } from 'axios';
import get from 'lodash/get';

@@ -152,2 +152,3 @@ import invariant from 'invariant';

data && isPlainObject(data) ? snakecaseKeysDeep(data) : data,
...(axios.defaults.transformRequest as AxiosTransformer[]),
],

@@ -158,2 +159,3 @@

transformResponse: [
...(axios.defaults.transformResponse as AxiosTransformer[]),
(data: any) =>

@@ -160,0 +162,0 @@ data && isPlainObject(data) ? camelcaseKeysDeep(data) : data,

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