@availity/api-core
Advanced tools
Comparing version 2.6.0 to 3.0.0
{ | ||
"name": "@availity/api-core", | ||
"version": "2.6.0", | ||
"version": "3.0.0", | ||
"description": "Base API definitions for the Availity REST API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,0 +0,0 @@ # api-core |
@@ -16,2 +16,3 @@ import AvApi from './api'; | ||
import AvFiles from './resources/files'; | ||
import AvFilesDelivery from './resources/filesDelivery'; | ||
import AvSettings from './resources/settings'; | ||
@@ -36,3 +37,4 @@ | ||
AvFiles, | ||
AvFilesDelivery, | ||
AvSettings, | ||
}; |
@@ -0,0 +0,0 @@ import AvApi from './api'; |
@@ -0,0 +0,0 @@ const API_OPTIONS = { |
@@ -0,0 +0,0 @@ import AvMicroservice from '../ms'; |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -19,6 +19,2 @@ import AvApi from '../api'; | ||
if (!avUsers) { | ||
throw new Error('[avUsers] must be defined and be instance of avUsers'); | ||
} | ||
this.avUsers = avUsers; | ||
@@ -33,2 +29,5 @@ } | ||
getOrganizations(config) { | ||
if (!this.avUsers || !this.avUsers.me) { | ||
throw new Error('avUsers must be defined'); | ||
} | ||
return this.avUsers | ||
@@ -35,0 +34,0 @@ .me() |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -5,21 +5,23 @@ # Availity API's | ||
* [Intro](#intro) | ||
* [AvUser](#avuser) | ||
* [AvRegions](#avregions) | ||
* [AvPermissions](#avpermissions) | ||
* [AvUserPermissions](#avuserpermissions) | ||
* [AvNavigation](#avnavigation) | ||
* [AvSpaces](#avspaces) | ||
* [AvOrganizations](#avorganizations) | ||
* [AvProviders](#avproviders) | ||
* [AvLogMessage](#avlogmessage) | ||
* [AvProxy](#avproxy) | ||
* [AvFiles](#avfiles) | ||
* [AvSettings](#avsettings) | ||
- [Intro](#intro) | ||
- [AvUser](#avuser) | ||
- [AvRegions](#avregions) | ||
- [AvPermissions](#avpermissions) | ||
- [AvUserPermissions](#avuserpermissions) | ||
- [AvNavigation](#avnavigation) | ||
- [AvSpaces](#avspaces) | ||
- [AvOrganizations](#avorganizations) | ||
- [AvProviders](#avproviders) | ||
- [AvLogMessage](#avlogmessage) | ||
- [AvProxy](#avproxy) | ||
- [AvFiles](#avfiles) | ||
- [AvFilesDelivery](#avfilesdelivery) | ||
- [AvSettings](#avsettings) | ||
## Intro | ||
View [AvApi](../README.md) to see the details for configuring API definitions. | ||
### AvUser | ||
View [AvApi](../README.md) to see the details for configuring API definitions. | ||
### `AvUser` | ||
Get information about current logged in user. | ||
@@ -29,6 +31,7 @@ | ||
##### `me()` | ||
##### `me()` | ||
Helper function that returns information about logged in user. | ||
### AvRegions | ||
### `AvRegions` | ||
Gets the logged in user's current selected region as well as the regions the user is associated with. | ||
@@ -39,17 +42,23 @@ | ||
##### `getRegions(config)` | ||
Get regions for logged in user. | ||
##### `getCurrentRegion()` | ||
Returns just the current region for the logged in user. | ||
### AvPermissions | ||
### `AvPermissions` | ||
Get permissions belonging to the logged in user. | ||
### AvUserPermissions | ||
### `AvUserPermissions` | ||
Get permissions as well as resources of the logged in user. | ||
### AvSpaces | ||
Get metadata for the various content types for the Spaces platform. | ||
### `AvSpaces` | ||
### AvOrganizations | ||
Get metadata for the various content types for the Spaces platform. | ||
### `AvOrganizations` | ||
Service that allows you to get logged=in user's active organizations. | ||
@@ -60,8 +69,11 @@ | ||
#### `queryOrganizations(user, config)` | ||
Returns organizations belonging to the `user`. | ||
##### `getOrganizations(config)` | ||
Returns organizations belonging to the logged in user. | ||
### AvProviders | ||
### `AvProviders` | ||
Get providers associated to the logged in user's organization. | ||
@@ -72,8 +84,11 @@ | ||
##### `getProviders(customerId, config)` | ||
Helper method that gets the providers for the `customerId`. | ||
##### `normalize(providers)` | ||
Helper method that adds `name` field to the `providers` collection. The name field is computed from other properies of the provider object. | ||
### AvLogMessage | ||
### `AvLogMessage` | ||
Create a log message. | ||
@@ -85,17 +100,22 @@ | ||
##### `debug(keyValue)` | ||
##### `debug(keyValue)` | ||
##### `info(keyValue)` | ||
##### `warn(keyValue)` | ||
##### `error(keyValue)` | ||
##### `info(keyValue)` | ||
### AvProxy | ||
Create API definitions for services that are proxied to a tenant's API gateway. | ||
##### `warn(keyValue)` | ||
##### `error(keyValue)` | ||
### `AvProxy` | ||
Create API definitions for services that are proxied to a tenant's API gateway. | ||
#### Options | ||
##### `tenant` | ||
The Spaces platform customer name which is used as part of the url for API's proxied to 3rd party API gateway. | ||
### AvFiles | ||
### `AvFiles` | ||
Upload a file to a bucket in the vault | ||
@@ -106,9 +126,56 @@ | ||
#### `uploadFile(data, config)` | ||
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`, `id` (the bucketId), and `clientId` | ||
### `AvFilesDelivery` | ||
Upload a batch of files to a designated channel configured on the server. | ||
### AvSettings | ||
#### Methods | ||
#### `uploadFilesDelivery(data, config)` | ||
Method to upload a batch of file deliveries. `data` contains an array of `deliveries`. Provide the `fileUri` (reference field from AvFiles), `deliveryChannel`, and the required `metadata` for that channel. | ||
Example `data`: | ||
```html | ||
data = { | ||
deliveries: | ||
[ { | ||
fileURI: upload.references[0], | ||
deliveryChannel: 'DEMO', | ||
metadata: { payerId: "PAYERID", requestId: "123", patientLastName: "lastName", patientFirstName: "firstName" }, | ||
} ] | ||
}; | ||
``` | ||
`config` should contain `customerId` and `clientId` | ||
#### Example Response | ||
```html | ||
{ "id": "123456", // batchId | ||
"status": "COMPLETE", // COMPLETE/INPROGRESS | ||
"deliveries": [ | ||
{ | ||
"id": "56789", // deliveryId | ||
"deliveryBatchId": "123456", | ||
"fileURI": <fileUri>, | ||
"deliveryChannel": "DEMO", | ||
"deliveryStatus": "ERRORED", // INPROGRESS/REJECTED/ERRORED/DELIVERED | ||
"errors": [ | ||
{ | ||
"message": "error message", | ||
"subject": "subject of error" | ||
} | ||
], | ||
"metadata": { | ||
payerId: "PAYERID", requestId: "123", patientLastName: "lastName", patientFirstName: "firstName" | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
### `AvSettings` | ||
Store and retrieve settings to be reused. | ||
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 |
@@ -29,2 +29,5 @@ import AvApi from '../api'; | ||
getRegions(config) { | ||
if (!this.avUsers || !this.avUsers.me) { | ||
throw new Error('avUsers must be defined'); | ||
} | ||
return this.avUsers.me().then(user => { | ||
@@ -31,0 +34,0 @@ const queryConfig = this.addParams({ userId: user.id }, config); |
@@ -25,4 +25,7 @@ import AvApi from '../api'; | ||
if (!applicationId) { | ||
throw new Error('must define applicationId'); | ||
throw new Error('applicationId must be defined'); | ||
} | ||
if (!this.avUsers || !this.avUsers.me) { | ||
throw new Error('avUsers must be defined'); | ||
} | ||
return this.avUsers.me().then(user => { | ||
@@ -37,19 +40,24 @@ const queryConfig = this.addParams( | ||
setApplication(applicaitonId, data, config) { | ||
setApplication(applicationId, data, config) { | ||
if (!this.avUsers || !this.avUsers.me) { | ||
throw new Error('avUsers must be defined'); | ||
} | ||
if ( | ||
typeof applicaitonId !== 'string' && | ||
typeof applicaitonId !== 'number' | ||
typeof applicationId !== 'string' && | ||
typeof applicationId !== 'number' | ||
) { | ||
config = data; | ||
data = applicaitonId; | ||
applicaitonId = ''; | ||
data = applicationId; | ||
applicationId = ''; | ||
} | ||
if (!applicaitonId && (!data.scope || !data.scope.applicationId)) { | ||
throw new Error('must set applicationId in settings call'); | ||
if (!applicationId && (!data || !data.scope || !data.scope.applicationId)) { | ||
throw new Error('applicationId must be defined'); | ||
} | ||
return this.avUsers.me().then(user => { | ||
data = data || {}; | ||
data.scope = data.scope || {}; | ||
data.scope.applicationId = applicaitonId; | ||
data.scope.applicationId = applicationId; | ||
data.scope.userId = user.id; | ||
@@ -56,0 +64,0 @@ return this.update(data, config); |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -0,0 +0,0 @@ import AvApi from '../api'; |
@@ -0,1 +1,2 @@ | ||
import qs from 'qs'; | ||
import AvApi from '../api'; | ||
@@ -9,2 +10,4 @@ | ||
name: 'axi-user-permissions', | ||
paramsSerializer: params => | ||
qs.stringify(params, { arrayFormat: 'repeat' }), | ||
}, | ||
@@ -11,0 +14,0 @@ config |
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
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
40862
23
871