@availity/api-core
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@availity/api-core", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Base API definitions for the Availity REST API", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@availity/localstorage-core": "^1.0.0" | ||
"@availity/localstorage-core": "^1.0.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "publishConfig": { |
@@ -26,2 +26,16 @@ import AvApi from './api'; | ||
} | ||
// make request to http | ||
request(config, afterResponse) { | ||
return this.http(config) | ||
.then(response => this.onResponse(response, afterResponse)) | ||
.catch(error => { | ||
let response; | ||
if (error) { | ||
response = error; | ||
response.error = true; | ||
} | ||
return afterResponse ? afterResponse(response) : response; | ||
}); | ||
} | ||
} |
@@ -10,3 +10,2 @@ import AvMicroservice from '../ms'; | ||
'Content-Type': undefined, | ||
'X-App-Context': 'ecs-qa-app-context', | ||
}, | ||
@@ -25,6 +24,11 @@ }, | ||
uploadFile(data, config) { | ||
if (!config.customerId || !config.clientId) { | ||
throw Error('[config.customerId] and [config.clientId] must be defined'); | ||
} | ||
config = this.config(config); | ||
config.headers['X-Availity-Customer-ID'] = config.customerId; | ||
config.headers['X-Client-ID'] = config.clientId; | ||
return this.create(data, config); | ||
} | ||
} |
@@ -101,3 +101,3 @@ # Availity API's | ||
Method to upload a file. `data` contains FormData elements with a key of either `reference` (if pointed to an existing file) or `filedata` (if uploading a new file) | ||
`config` should contain `customerId` and `id` (the bucketId) | ||
`config` should contain `customerId`, `id` (the bucketId), and `clientId` | ||
@@ -107,3 +107,3 @@ | ||
Store and retrieve settings to be reused. | ||
Use `query(params)` with at least an `applicationId` and `userId` in the `params` object | ||
Use `update(data)` with at least an `applicationId` and `userId` in the `scope` object, and key/value pairs of data | ||
Use `query(params)` with at least an `applicationId` in the `params` object | ||
Use `update(data)` with at least an `applicationId` in the `scope` object, and key/value pairs of data |
@@ -10,2 +10,4 @@ import AvFiles from '../files'; | ||
id: '123', | ||
clientId: '123-456', | ||
customerId: '1194', | ||
}; | ||
@@ -12,0 +14,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
80052
2428
0