@availity/api-core
Advanced tools
Comparing version 6.0.4-alpha.0 to 6.0.4
@@ -6,2 +6,10 @@ # Change Log | ||
## [6.0.4](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.3...@availity/api-core@6.0.4) (2020-01-03) | ||
**Note:** Version bump only for package @availity/api-core | ||
## [6.0.3](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.2...@availity/api-core@6.0.3) (2019-12-03) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@availity/api-core", | ||
"version": "6.0.4-alpha.0+9350765", | ||
"version": "6.0.4", | ||
"description": "Base API definitions for the Availity REST API", | ||
@@ -11,3 +11,4 @@ "keywords": [ | ||
], | ||
"main": "src/index.js", | ||
"main": "lib/index.js", | ||
"module": "src/index.js", | ||
"author": "Kasey Powers <kasey.powers@availity.com>", | ||
@@ -21,7 +22,6 @@ "repository": "https://github.com/Availity/sdk-js", | ||
"dependencies": { | ||
"@availity/localstorage-core": "^3.0.0", | ||
"@availity/resolve-url": "^1.1.1", | ||
"@availity/resolve-url": "^1.1.2", | ||
"qs": "^6.5.2" | ||
}, | ||
"gitHead": "93507657b78a68ff431e92f0bd3336b74e2199c4" | ||
"gitHead": "239e4a2312aec4d16ff2ca3d219faae7570c0ccd" | ||
} |
@@ -1,2 +0,1 @@ | ||
import * as avLocalStorage from '@availity/localstorage-core'; | ||
import qs from 'qs'; | ||
@@ -36,2 +35,6 @@ import resolveUrl from '@availity/resolve-url'; | ||
getSessionBust() { | ||
return window.localStorage.getItem('avCacheBust'); | ||
} | ||
// set the cache parameters | ||
@@ -56,3 +59,3 @@ cacheParams(config) { | ||
config.sessionBust, | ||
() => avLocalStorage.getSessionBust() || this.getPageBust() | ||
() => this.getSessionBust() || this.getPageBust() | ||
); | ||
@@ -199,25 +202,2 @@ } | ||
sendBeacon(data, config) { | ||
if (!data) { | ||
throw new Error('called method without [data]'); | ||
} | ||
config = this.config(config); | ||
config.method = 'POST'; | ||
config.url = this.getUrl(config); | ||
config.data = data; | ||
const beforeFunc = this.beforeCreate || this.beforePost; | ||
if (beforeFunc) { | ||
config.data = beforeFunc(config.data); | ||
} | ||
if (navigator.sendBeacon) { | ||
const result = navigator.sendBeacon(config.url, config.data); | ||
// A truthy return value from navigator.sendBeacon means the browser successfully queued the request | ||
if (result) return this.Promise.resolve(); | ||
} | ||
// Fall back to XHR if browser does not support navigator.sendBeacon or browser fails to queue the request | ||
return this.request(config, this.afterCreate || this.afterPost); | ||
} | ||
post(data, config) { | ||
@@ -224,0 +204,0 @@ return this.create(data, config); |
import AvApi from '../api'; | ||
import flattenObject from '../flattenObject'; | ||
@@ -20,25 +19,20 @@ export default class AvLogMessages extends AvApi { | ||
delete entries.level; | ||
const payload = { level, entries }; | ||
const flattened = flattenObject(payload); | ||
return Object.keys(flattened).reduce((accum, key) => { | ||
accum.append(key, flattened[key]); | ||
return accum; | ||
}, new FormData()); | ||
return { level, entries }; | ||
} | ||
debug(entries) { | ||
return this.sendBeacon(this.send('debug', entries)); | ||
return this.create(this.send('debug', entries)); | ||
} | ||
info(entries) { | ||
return this.sendBeacon(this.send('info', entries)); | ||
return this.create(this.send('info', entries)); | ||
} | ||
warn(entries) { | ||
return this.sendBeacon(this.send('warn', entries)); | ||
return this.create(this.send('warn', entries)); | ||
} | ||
error(entries) { | ||
return this.sendBeacon(this.send('error', entries)); | ||
return this.create(this.send('error', entries)); | ||
} | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
1
0
52044
29
943
- Removed@availity/localstorage-core@^3.0.0
- Removed@availity/localstorage-core@3.0.0(transitive)
Updated@availity/resolve-url@^1.1.2