@giphy/js-analytics
Advanced tools
Comparing version 1.2.0 to 1.3.0
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var append_query_1 = __importDefault(require("append-query")); | ||
var js_util_1 = require("@giphy/js-util"); | ||
// TODO remove api key | ||
var pingBackUrl = 'https://pingback.giphy.com/pingback?apikey=l0HlIwPWyBBUDAUgM'; | ||
exports.sendPingback = function (session) { | ||
return fetch(pingBackUrl, { | ||
var headers = new Headers(); | ||
var qs = js_util_1.getGiphySDKRequestParams(); | ||
headers.set('Content-Type', 'application/json'); | ||
return fetch(append_query_1.default(pingBackUrl, qs), { | ||
method: 'POST', | ||
body: JSON.stringify({ sessions: [session] }), | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
headers: headers, | ||
}); | ||
}; | ||
//# sourceMappingURL=send-pingback.js.map |
@@ -11,3 +11,3 @@ { | ||
"name": "@giphy/js-analytics", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "dist/index.js", | ||
@@ -25,3 +25,4 @@ "types": "dist/index.d.ts", | ||
"@giphy/js-types": "^1.2.0", | ||
"@giphy/js-util": "^1.4.1", | ||
"@giphy/js-util": "^1.5.0", | ||
"append-query": "^2.1.0", | ||
"cookie": "0.4.0", | ||
@@ -32,2 +33,3 @@ "dompurify": "^1.0.10", | ||
"devDependencies": { | ||
"@types/append-query": "^2.0.0", | ||
"@types/cookie": "^0.3.3", | ||
@@ -39,3 +41,3 @@ "@types/dompurify": "^0.0.32", | ||
}, | ||
"gitHead": "a31befebdb938e83d5cb115be2a0017e1188e993" | ||
"gitHead": "2f66705d00005eb35a91d63d6dc76b32c78b04e3" | ||
} |
@@ -71,3 +71,3 @@ import { IGif, IUser } from '@giphy/js-types' | ||
// remove api key | ||
expect(url).toBe('https://pingback.giphy.com/pingback?apikey=l0HlIwPWyBBUDAUgM') | ||
expect(url).toContain('https://pingback.giphy.com/pingback?apikey=l0HlIwPWyBBUDAUgM') | ||
expect(session.user).toEqual({ | ||
@@ -74,0 +74,0 @@ logged_in_user_id: String(user.id), |
import { Session } from './session' | ||
import appendQuery from 'append-query' | ||
import { getGiphySDKRequestParams } from '@giphy/js-util' | ||
// TODO remove api key | ||
const pingBackUrl = 'https://pingback.giphy.com/pingback?apikey=l0HlIwPWyBBUDAUgM' | ||
export const sendPingback = (session: Session) => | ||
fetch(pingBackUrl, { | ||
export const sendPingback = (session: Session) => { | ||
const headers = new Headers() | ||
const qs = getGiphySDKRequestParams() | ||
headers.set('Content-Type', 'application/json') | ||
return fetch(appendQuery(pingBackUrl, qs), { | ||
method: 'POST', | ||
body: JSON.stringify({ sessions: [session] }), | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
headers, | ||
}) | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25619
501
6
6
+ Addedappend-query@^2.1.0
+ Addedappend-query@2.1.1(transitive)
+ Addedextend@3.0.2(transitive)
Updated@giphy/js-util@^1.5.0