@availity/api-core
Advanced tools
Comparing version 6.0.4-alpha.0 to 7.0.0-alpha.2
{ | ||
"name": "@availity/api-core", | ||
"version": "6.0.4-alpha.0+9350765", | ||
"version": "7.0.0-alpha.2+fa3cf31", | ||
"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,7 @@ "repository": "https://github.com/Availity/sdk-js", | ||
"dependencies": { | ||
"@availity/localstorage-core": "^3.0.0", | ||
"@availity/resolve-url": "^1.1.1", | ||
"@availity/localstorage-core": "^4.0.0-alpha.19+fa3cf31", | ||
"@availity/resolve-url": "^2.0.0-alpha.19+fa3cf31", | ||
"qs": "^6.5.2" | ||
}, | ||
"gitHead": "93507657b78a68ff431e92f0bd3336b74e2199c4" | ||
"gitHead": "fa3cf31fb566cea8e0c963f98ee55cba94cf35db" | ||
} |
@@ -197,25 +197,2 @@ import * as avLocalStorage from '@availity/localstorage-core'; | ||
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) { | ||
@@ -222,0 +199,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
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
190844
75
4794
2
+ Added@availity/localstorage-core@4.0.0-alpha.19(transitive)
+ Added@availity/resolve-url@2.0.7(transitive)
- Removed@availity/localstorage-core@3.0.0(transitive)
- Removed@availity/resolve-url@1.1.25(transitive)
- Removed@babel/runtime@7.25.6(transitive)
- Removedcore-js@3.38.1(transitive)
- Removedregenerator-runtime@0.14.1(transitive)