Socket
Socket
Sign inDemoInstall

@availity/api-core

Package Overview
Dependencies
Maintainers
17
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@availity/api-core - npm Package Compare versions

Comparing version 7.0.0-alpha.10 to 7.0.0

lib/flattenObject.js

679

CHANGELOG.md

@@ -6,30 +6,36 @@ # Change Log

## [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)
# [7.0.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.6.6...@availity/api-core@7.0.0) (2021-05-17)
### Performance Improvements
### Code Refactoring
* **api-core:** use userId if it exists in get,set application settings ([6cdd059](https://github.com/Availity/sdk-js/commit/6cdd059))
* **analytics-core,api-core,authorizations-core,message-core,native-form,upload-core:** eslint fixes ([00e3395](https://github.com/Availity/sdk-js/commit/00e339595962501c96acf2895650f104d4c49809))
### BREAKING CHANGES
* **analytics-core,api-core,authorizations-core,message-core,native-form,upload-core:** .filter()[0] replaced with .find(), .forEach() replaced with for...of
## [6.0.2](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.1...@availity/api-core@6.0.2) (2019-12-02)
### Performance Improvements
* **api-core:** use userId from params if it exists in getOrganizations ([5e5225f](https://github.com/Availity/sdk-js/commit/5e5225f))
## 6.6.6 (2021-04-01)
### Bug Fixes
* **api-core:** pass region param to axi-user-permissions call if additionalPostGetArgs ([3a41740](https://github.com/Availity/sdk-js/commit/3a41740f0b241e112cef64643985c49908ed3578))
* **api-core:** use correct region param for permissions call inside organizations ([724cc65](https://github.com/Availity/sdk-js/commit/724cc657bfc594ec10ed085003094a2dfac4b41d))
## [6.0.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.0...@availity/api-core@6.0.1) (2019-11-05)
## 6.6.5 (2020-12-16)
### Bug Fixes
* **api-core:** do not use config url when resolving location header ([199536f](https://github.com/Availity/sdk-js/commit/199536f))
* **api-core:** fix clientId ([ed46ad4](https://github.com/Availity/sdk-js/commit/ed46ad490b3c026025c0b46a350507da2cc256cd))

@@ -40,20 +46,26 @@

# [6.0.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.4.1...@availity/api-core@6.0.0) (2019-10-21)
## [6.6.4](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.6.3...@availity/api-core@6.6.4) (2020-08-24)
### Code Refactoring
### Bug Fixes
* **localstorage-core:** converted class to function ([9f1fdf0](https://github.com/Availity/sdk-js/commit/9f1fdf0))
* **api-core:** filesDelivery polling issue ([8e5f451](https://github.com/Availity/sdk-js/commit/8e5f4512e98537c5d8c530e97e51986b8debf16e))
### BREAKING CHANGES
* **localstorage-core:** Class is now a Function and doesn't require to be instantiated.
## [6.6.3](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.6.2...@availity/api-core@6.6.3) (2020-07-08)
### Bug Fixes
## [5.4.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.4.0...@availity/api-core@5.4.1) (2019-09-27)
* **api-core:** fix filteredOrgs arePermissionsEqual check ([c934bcc](https://github.com/Availity/sdk-js/commit/c934bcce302f42c34e71f551504f4828b596c157))
## [6.6.2](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.6.1...@availity/api-core@6.6.2) (2020-06-22)
**Note:** Version bump only for package @availity/api-core

@@ -65,8 +77,8 @@

# [5.4.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.2.1...@availity/api-core@5.4.0) (2019-08-01)
## [6.6.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.6.0...@availity/api-core@6.6.1) (2020-06-15)
### Features
### Bug Fixes
* **api-core:** add webQL resource ([67b9797](https://github.com/Availity/sdk-js/commit/67b9797))
* **api-core:** adds @availity/env-var as dependency ([4160e21](https://github.com/Availity/sdk-js/commit/4160e21e68376f62749c8690ca4babbc8ac76a99))

@@ -77,8 +89,15 @@

# [5.3.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.2.1...@availity/api-core@5.3.0) (2019-08-01)
# [6.6.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.5.2...@availity/api-core@6.6.0) (2020-06-08)
### Bug Fixes
* **api-core:** fix org filtering when permission/resource not returned ([7b08f09](https://github.com/Availity/sdk-js/commit/7b08f09fcb7545818a6d3aaacf9c6eabb3969ba7))
* **api-core:** organization filtering fix for resource OR ([cb16c6a](https://github.com/Availity/sdk-js/commit/cb16c6a36fbf7d653c9ff70a0555981001c21606))
* **api-core:** organization permissions fix equal check, allow number ([6fc93c1](https://github.com/Availity/sdk-js/commit/6fc93c114523350cad0d37d8167b5047707c33a9))
### Features
* **api-core:** add webQL resource ([67b9797](https://github.com/Availity/sdk-js/commit/67b9797))
* **api-core:** add permission AND/OR logic to organization filter ([90acf02](https://github.com/Availity/sdk-js/commit/90acf029028413c9fb98443d136abb795295eb5c))

@@ -89,3 +108,3 @@

## [5.2.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.2.0...@availity/api-core@5.2.1) (2019-06-21)
## [6.5.2](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.5.1...@availity/api-core@6.5.2) (2020-06-04)

@@ -95,3 +114,3 @@

* **api-core:** fix namespace of slotmachine resource ([3c3af84](https://github.com/Availity/sdk-js/commit/3c3af84))
* **api-core:** remove incorrect limit for axiUserPermissions in orgFilter ([edbddbf](https://github.com/Availity/sdk-js/commit/edbddbf2c7181d6ab634fc9fb5f0967d1d92d02b))

@@ -102,8 +121,19 @@

# [5.2.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.6...@availity/api-core@5.2.0) (2019-06-14)
## [6.5.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.5.0...@availity/api-core@6.5.1) (2020-06-04)
### Bug Fixes
* **api-core:** filteredOrgs not sending region to axiUserPerms ([3706a72](https://github.com/Availity/sdk-js/commit/3706a7274ac4cd67271e9088d6fa8b8392c49c83))
# 6.5.0 (2020-06-04)
### Features
* **api-core:** add codes resource ([4ea7ba4](https://github.com/Availity/sdk-js/commit/4ea7ba4))
* **api-core:** route api calls to on-prem when called from cloud apps ([94fa9df](https://github.com/Availity/sdk-js/commit/94fa9dff730e514fd21abe0910d460e7958e9a94))

@@ -114,3 +144,3 @@

## [5.1.6](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.5...@availity/api-core@5.1.6) (2019-05-31)
# 6.4.0 (2020-06-03)

@@ -120,10 +150,28 @@

* **api-core:** graceful exit when polling ([9708eff](https://github.com/Availity/sdk-js/commit/9708eff))
* **api-core:** fix org filtering when permission/resource not returned ([7b08f09](https://github.com/Availity/sdk-js/commit/7b08f09fcb7545818a6d3aaacf9c6eabb3969ba7))
* **api-core:** organization filtering fix for resource OR ([cb16c6a](https://github.com/Availity/sdk-js/commit/cb16c6a36fbf7d653c9ff70a0555981001c21606))
* **api-core:** organization permissions fix equal check, allow number ([6fc93c1](https://github.com/Availity/sdk-js/commit/6fc93c114523350cad0d37d8167b5047707c33a9))
### Features
* **api-core:** add permission AND/OR logic to organization filter ([90acf02](https://github.com/Availity/sdk-js/commit/90acf029028413c9fb98443d136abb795295eb5c))
## [5.1.5](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.4...@availity/api-core@5.1.5) (2019-04-29)
# [6.3.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.2.6...@availity/api-core@6.3.0) (2020-05-11)
### Features
* **api-core:** add support for filtering organizations by permission and resource ([b607943](https://github.com/Availity/sdk-js/commit/b607943c9908d7d684013ec18678a1c05b9f1baf))
## 6.2.6 (2020-05-01)
**Note:** Version bump only for package @availity/api-core

@@ -135,3 +183,3 @@

## [5.1.4](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.3...@availity/api-core@5.1.4) (2019-04-26)
## 6.2.5 (2020-04-30)

@@ -144,3 +192,3 @@ **Note:** Version bump only for package @availity/api-core

## [5.1.3](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.2...@availity/api-core@5.1.3) (2019-04-25)
## 6.2.4 (2020-04-22)

@@ -153,3 +201,3 @@ **Note:** Version bump only for package @availity/api-core

## [5.1.2](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.1...@availity/api-core@5.1.2) (2019-04-25)
## 6.2.3 (2020-04-08)

@@ -162,20 +210,25 @@ **Note:** Version bump only for package @availity/api-core

## [5.1.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.0...@availity/api-core@5.1.1) (2019-04-23)
## 6.2.2 (2020-04-06)
**Note:** Version bump only for package @availity/api-core
### Bug Fixes
* **api-core:** relative location header ([2ac4c5f](https://github.com/Availity/sdk-js/commit/2ac4c5f)), closes [#77](https://github.com/Availity/sdk-js/issues/77)
* **api-core:** resolve relative url from request url ([8e6abbb](https://github.com/Availity/sdk-js/commit/8e6abbb)), closes [#77](https://github.com/Availity/sdk-js/issues/77)
## 6.2.1 (2020-04-06)
**Note:** Version bump only for package @availity/api-core
# [5.1.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.0.1...@availity/api-core@5.1.0) (2019-04-17)
# [6.2.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.16...@availity/api-core@6.2.0) (2020-03-25)
### Features
* **analytics-core:** added dma logging service ([68aee41](https://github.com/Availity/sdk-js/commit/68aee41))
* **api-core:** added tests for new patch method, see issue [#225](https://github.com/Availity/sdk-js/issues/225) ([5498a78](https://github.com/Availity/sdk-js/commit/5498a78f3e63567e40eb1b6bb1e035c3f70c124b))
* **api-core:** proposed support for patch method, see issue [#225](https://github.com/Availity/sdk-js/issues/225) ([2ff4085](https://github.com/Availity/sdk-js/commit/2ff40857dd9d36b383278f4c4743e45de511ddee))

@@ -186,3 +239,3 @@

## [5.0.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.0.0...@availity/api-core@5.0.1) (2019-04-17)
## [6.1.16](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.15...@availity/api-core@6.1.16) (2020-03-06)

@@ -195,50 +248,47 @@ **Note:** Version bump only for package @availity/api-core

# [5.0.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@4.0.1...@availity/api-core@5.0.0) (2019-03-18)
## [6.1.15](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.14...@availity/api-core@6.1.15) (2020-03-04)
**Note:** Version bump only for package @availity/api-core
### Bug Fixes
* **dl-core:** fixed dev dep ([15d572a](https://github.com/Availity/sdk-js/commit/15d572a))
* add lerna ignore for package-locks ([3217d96](https://github.com/Availity/sdk-js/commit/3217d96))
* fixed package-lock issues boiling down to this repo ([8c896f4](https://github.com/Availity/sdk-js/commit/8c896f4))
### Features
* **api-core:** add ability to send in variables in AvSlotMachine.query ([f83e00b](https://github.com/Availity/sdk-js/commit/f83e00b))
## [6.1.14](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.13...@availity/api-core@6.1.14) (2020-03-02)
**Note:** Version bump only for package @availity/api-core
### BREAKING CHANGES
* upgrades other packages that are using old package-locks
## [6.1.13](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.12...@availity/api-core@6.1.13) (2020-02-18)
# [4.1.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@4.0.1...@availity/api-core@4.1.0) (2019-03-04)
### Performance Improvements
* **api-core:** use userId if it exists in call to getRegions ([e94de9e](https://github.com/Availity/sdk-js/commit/e94de9eb3f4d04247ba6bc1f76ce3deb4341e609))
### Bug Fixes
* **dl-core:** fixed dev dep ([15d572a](https://github.com/Availity/sdk-js/commit/15d572a))
* add lerna ignore for package-locks ([3217d96](https://github.com/Availity/sdk-js/commit/3217d96))
* fixed package-lock issues boiling down to this repo ([8c896f4](https://github.com/Availity/sdk-js/commit/8c896f4))
### Features
* **api-core:** add ability to send in variables in AvSlotMachine.query ([f83e00b](https://github.com/Availity/sdk-js/commit/f83e00b))
## [6.1.12](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.9...@availity/api-core@6.1.12) (2020-02-13)
**Note:** Version bump only for package @availity/api-core
### BREAKING CHANGES
* upgrades other packages that are using old package-locks
## [6.1.11](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.10...@availity/api-core@6.1.11) (2020-02-13)
**Note:** Version bump only for package @availity/api-core
## [4.0.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@4.0.0...@availity/api-core@4.0.1) (2019-02-12)
## [6.1.10](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.8...@availity/api-core@6.1.10) (2020-02-13)
**Note:** Version bump only for package @availity/api-core

@@ -250,294 +300,414 @@

# 4.0.0 (2019-02-12)
## [6.1.9](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.7...@availity/api-core@6.1.9) (2020-02-13)
**Note:** Version bump only for package @availity/api-core
### Bug Fixes
* **api-core:** Allow array for permissions ([#67](https://github.com/Availity/sdk-js/issues/67)) ([98adf76](https://github.com/Availity/sdk-js/commit/98adf76))
* **api-core:** http should throw errors ([#83](https://github.com/Availity/sdk-js/issues/83)) ([868aa8f](https://github.com/Availity/sdk-js/commit/868aa8f))
* **api-core:** rename error object ([460fc9d](https://github.com/Availity/sdk-js/commit/460fc9d))
* **api-core:** return error from async/await ([06c35fe](https://github.com/Availity/sdk-js/commit/06c35fe))
* **api-core:** reverted changelog/canary changes ([0f775ea](https://github.com/Availity/sdk-js/commit/0f775ea))
* **api-core:** typo fix ([f543296](https://github.com/Availity/sdk-js/commit/f543296))
### Features
* **api-core:** add example response for file delivery ([edc4df5](https://github.com/Availity/sdk-js/commit/edc4df5))
* **api-core:** add file upload delivery batch api ([eff0a3c](https://github.com/Availity/sdk-js/commit/eff0a3c))
* **api-core:** added graphql resource for slotmachine ([356a686](https://github.com/Availity/sdk-js/commit/356a686))
* **api-core:** added new resource for disclaimers ([b7de72e](https://github.com/Availity/sdk-js/commit/b7de72e))
## [6.1.8](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.7...@availity/api-core@6.1.8) (2020-02-13)
**Note:** Version bump only for package @availity/api-core
### BREAKING CHANGES
* **api-core:** The httpp error is no longer caught by api-core. Also, the error object is no longer manipulated. Developers must handle the http error by catching the error when using async/await or by leveraging the error callback in the promise chain. The callback `afterResponse` is not called when and error is thrown from http call.
* **api-core:** The query to the API has been changed. To get the previous behavior, supply a custom paramSerializer.
# 2.6.0 (2018-08-23)
## [6.1.7](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.4...@availity/api-core@6.1.7) (2020-02-13)
**Note:** Version bump only for package @availity/api-core
### Features
* **api-core:** helper function for settings api ([4d405a7](https://github.com/Availity/sdk-js/commit/4d405a7))
* **api-core:** helper function for settings api ([#64](https://github.com/Availity/sdk-js/issues/64)) ([f247235](https://github.com/Availity/sdk-js/commit/f247235))
# 2.5.0 (2018-08-20)
## [6.1.6](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.5...@availity/api-core@6.1.6) (2020-02-13)
**Note:** Version bump only for package @availity/api-core
## 2.4.8 (2018-08-06)
### Bug Fixes
* **api-core:** spread args for aliases ([5c7516b](https://github.com/Availity/sdk-js/commit/5c7516b))
## [6.1.5](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.4...@availity/api-core@6.1.5) (2020-02-13)
**Note:** Version bump only for package @availity/api-core
## 2.4.7 (2018-08-02)
### Bug Fixes
* **api-core:** check for lowercase location as well ([4a4a9a0](https://github.com/Availity/sdk-js/commit/4a4a9a0))
## [6.1.4](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.3...@availity/api-core@6.1.4) (2020-02-12)
**Note:** Version bump only for package @availity/api-core
## 2.4.6 (2018-08-02)
### Bug Fixes
* **analytics-core:** fix non-click events ([fce9b26](https://github.com/Availity/sdk-js/commit/fce9b26))
## [6.1.3](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.2...@availity/api-core@6.1.3) (2020-01-28)
**Note:** Version bump only for package @availity/api-core
# 2.4.0 (2018-07-12)
# 2.2.0 (2018-06-29)
## [6.1.2](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.1...@availity/api-core@6.1.2) (2020-01-23)
**Note:** Version bump only for package @availity/api-core
## [6.1.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.1.0...@availity/api-core@6.1.1) (2020-01-14)
### Bug Fixes
* **api-core:** format postGet payload to standard ([5b885cf](https://github.com/Availity/sdk-js/commit/5b885cf))
- **api-core:** fixed error trying to call toString on undefined ([0792f85](https://github.com/Availity/sdk-js/commit/0792f85))
- **api-core:** updated handling of falsey values ([b810189](https://github.com/Availity/sdk-js/commit/b810189))
- **api-core:** updated test suite name ([b0a75c6](https://github.com/Availity/sdk-js/commit/b0a75c6))
# [6.1.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.5...@availity/api-core@6.1.0) (2020-01-06)
### Features
## 2.1.2 (2018-06-13)
- **api-core:** add beacon support to log messages ([9350765](https://github.com/Availity/sdk-js/commit/9350765))
## [6.0.5](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.4...@availity/api-core@6.0.5) (2020-01-03)
### Bug Fixes
**Note:** Version bump only for package @availity/api-core
* **api-core:** attempts count not increasing ([2e414a3](https://github.com/Availity/sdk-js/commit/2e414a3))
## [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)
## 2.1.1 (2018-05-25)
### Performance Improvements
- **api-core:** use userId if it exists in get,set application settings ([6cdd059](https://github.com/Availity/sdk-js/commit/6cdd059))
### Bug Fixes
## [6.0.2](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.1...@availity/api-core@6.0.2) (2019-12-02)
* **api-core:** fix usage of Promise ([8fb3de8](https://github.com/Availity/sdk-js/commit/8fb3de8))
### Performance Improvements
- **api-core:** use userId from params if it exists in getOrganizations ([5e5225f](https://github.com/Availity/sdk-js/commit/5e5225f))
## [6.0.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@6.0.0...@availity/api-core@6.0.1) (2019-11-05)
# 2.1.0 (2018-05-24)
### Bug Fixes
- **api-core:** do not use config url when resolving location header ([199536f](https://github.com/Availity/sdk-js/commit/199536f))
### Features
# [6.0.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.4.1...@availity/api-core@6.0.0) (2019-10-21)
* **api-core:** add all method to get all the data from all of the pages ([114519d](https://github.com/Availity/sdk-js/commit/114519d))
### Code Refactoring
- **localstorage-core:** converted class to function ([9f1fdf0](https://github.com/Availity/sdk-js/commit/9f1fdf0))
### BREAKING CHANGES
## 2.0.3 (2018-05-10)
- **localstorage-core:** Class is now a Function and doesn't require to be instantiated.
## [5.4.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.4.0...@availity/api-core@5.4.1) (2019-09-27)
### Bug Fixes
**Note:** Version bump only for package @availity/api-core
* **api-core:** allow id to be in the config ([55b55af](https://github.com/Availity/sdk-js/commit/55b55af))
# [5.4.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.2.1...@availity/api-core@5.4.0) (2019-08-01)
### Features
- **api-core:** add webQL resource ([67b9797](https://github.com/Availity/sdk-js/commit/67b9797))
## 2.0.1 (2018-05-04)
# [5.3.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.2.1...@availity/api-core@5.3.0) (2019-08-01)
### Features
- **api-core:** add webQL resource ([67b9797](https://github.com/Availity/sdk-js/commit/67b9797))
## [5.2.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.2.0...@availity/api-core@5.2.1) (2019-06-21)
### Bug Fixes
* **api-core:** get id out of arguments ([3e525c2](https://github.com/Availity/sdk-js/commit/3e525c2))
- **api-core:** fix namespace of slotmachine resource ([3c3af84](https://github.com/Availity/sdk-js/commit/3c3af84))
# [5.2.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.6...@availity/api-core@5.2.0) (2019-06-14)
### Features
# 2.0.0 (2018-05-04)
- **api-core:** add codes resource ([4ea7ba4](https://github.com/Availity/sdk-js/commit/4ea7ba4))
## [5.1.6](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.5...@availity/api-core@5.1.6) (2019-05-31)
### Bug Fixes
* **api-core:** avSpaces - throw error when no spaceId given ([7c47280](https://github.com/Availity/sdk-js/commit/7c47280))
- **api-core:** graceful exit when polling ([9708eff](https://github.com/Availity/sdk-js/commit/9708eff))
## [5.1.5](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.4...@availity/api-core@5.1.5) (2019-04-29)
**Note:** Version bump only for package @availity/api-core
# 1.4.0 (2018-04-17)
## [5.1.4](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.3...@availity/api-core@5.1.4) (2019-04-26)
**Note:** Version bump only for package @availity/api-core
## [5.1.3](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.2...@availity/api-core@5.1.3) (2019-04-25)
# 1.2.0 (2018-04-12)
**Note:** Version bump only for package @availity/api-core
## [5.1.2](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.1...@availity/api-core@5.1.2) (2019-04-25)
### Features
**Note:** Version bump only for package @availity/api-core
* **api-core:** refactor polling for extending MS ([04c1474](https://github.com/Availity/sdk-js/commit/04c1474))
## [5.1.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.1.0...@availity/api-core@5.1.1) (2019-04-23)
### Bug Fixes
- **api-core:** relative location header ([2ac4c5f](https://github.com/Availity/sdk-js/commit/2ac4c5f)), closes [#77](https://github.com/Availity/sdk-js/issues/77)
- **api-core:** resolve relative url from request url ([8e6abbb](https://github.com/Availity/sdk-js/commit/8e6abbb)), closes [#77](https://github.com/Availity/sdk-js/issues/77)
## 1.1.1 (2018-03-28)
# [5.1.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.0.1...@availity/api-core@5.1.0) (2019-04-17)
### Features
- **analytics-core:** added dma logging service ([68aee41](https://github.com/Availity/sdk-js/commit/68aee41))
## 1.0.1 (2018-03-26)
## [5.0.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@5.0.0...@availity/api-core@5.0.1) (2019-04-17)
**Note:** Version bump only for package @availity/api-core
# [5.0.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@4.0.1...@availity/api-core@5.0.0) (2019-03-18)
### Bug Fixes
* **api-core:** avFiles error handling ([3dd5392](https://github.com/Availity/sdk-js/commit/3dd5392))
- **dl-core:** fixed dev dep ([15d572a](https://github.com/Availity/sdk-js/commit/15d572a))
- add lerna ignore for package-locks ([3217d96](https://github.com/Availity/sdk-js/commit/3217d96))
- fixed package-lock issues boiling down to this repo ([8c896f4](https://github.com/Availity/sdk-js/commit/8c896f4))
### Features
- **api-core:** add ability to send in variables in AvSlotMachine.query ([f83e00b](https://github.com/Availity/sdk-js/commit/f83e00b))
# 1.0.0-alpha.17 (2018-01-18)
### BREAKING CHANGES
- upgrades other packages that are using old package-locks
# [4.1.0](https://github.com/Availity/sdk-js/compare/@availity/api-core@4.0.1...@availity/api-core@4.1.0) (2019-03-04)
# 1.0.0-alpha.16 (2018-01-17)
### Bug Fixes
- **dl-core:** fixed dev dep ([15d572a](https://github.com/Availity/sdk-js/commit/15d572a))
- add lerna ignore for package-locks ([3217d96](https://github.com/Availity/sdk-js/commit/3217d96))
- fixed package-lock issues boiling down to this repo ([8c896f4](https://github.com/Availity/sdk-js/commit/8c896f4))
### Features
# 1.0.0-alpha.15 (2018-01-12)
- **api-core:** add ability to send in variables in AvSlotMachine.query ([f83e00b](https://github.com/Availity/sdk-js/commit/f83e00b))
### BREAKING CHANGES
- upgrades other packages that are using old package-locks
# 1.0.0-alpha.14 (2018-01-11)
## [4.0.1](https://github.com/Availity/sdk-js/compare/@availity/api-core@4.0.0...@availity/api-core@4.0.1) (2019-02-12)
**Note:** Version bump only for package @availity/api-core
# 4.0.0 (2019-02-12)
# 1.0.0-alpha.13 (2018-01-10)
### Bug Fixes
- **api-core:** Allow array for permissions ([#67](https://github.com/Availity/sdk-js/issues/67)) ([98adf76](https://github.com/Availity/sdk-js/commit/98adf76))
- **api-core:** http should throw errors ([#83](https://github.com/Availity/sdk-js/issues/83)) ([868aa8f](https://github.com/Availity/sdk-js/commit/868aa8f))
- **api-core:** rename error object ([460fc9d](https://github.com/Availity/sdk-js/commit/460fc9d))
- **api-core:** return error from async/await ([06c35fe](https://github.com/Availity/sdk-js/commit/06c35fe))
- **api-core:** reverted changelog/canary changes ([0f775ea](https://github.com/Availity/sdk-js/commit/0f775ea))
- **api-core:** typo fix ([f543296](https://github.com/Availity/sdk-js/commit/f543296))
### Features
* **api-core:** add helper function adds name attribute to providers collection ([3b24341](https://github.com/Availity/sdk-js/commit/3b24341))
- **api-core:** add example response for file delivery ([edc4df5](https://github.com/Availity/sdk-js/commit/edc4df5))
- **api-core:** add file upload delivery batch api ([eff0a3c](https://github.com/Availity/sdk-js/commit/eff0a3c))
- **api-core:** added graphql resource for slotmachine ([356a686](https://github.com/Availity/sdk-js/commit/356a686))
- **api-core:** added new resource for disclaimers ([b7de72e](https://github.com/Availity/sdk-js/commit/b7de72e))
### BREAKING CHANGES
- **api-core:** The httpp error is no longer caught by api-core. Also, the error object is no longer manipulated. Developers must handle the http error by catching the error when using async/await or by leveraging the error callback in the promise chain. The callback `afterResponse` is not called when and error is thrown from http call.
- **api-core:** The query to the API has been changed. To get the previous behavior, supply a custom paramSerializer.
# 1.0.0-alpha.12 (2018-01-09)
# 2.6.0 (2018-08-23)
### Features
- **api-core:** helper function for settings api ([4d405a7](https://github.com/Availity/sdk-js/commit/4d405a7))
- **api-core:** helper function for settings api ([#64](https://github.com/Availity/sdk-js/issues/64)) ([f247235](https://github.com/Availity/sdk-js/commit/f247235))
# 1.0.0-alpha.11 (2018-01-06)
# 2.5.0 (2018-08-20)
## 2.4.8 (2018-08-06)
### Bug Fixes
* **api-core:** resources incorrectly handling config ([9a5de1c](https://github.com/Availity/sdk-js/commit/9a5de1c))
- **api-core:** spread args for aliases ([5c7516b](https://github.com/Availity/sdk-js/commit/5c7516b))
## 2.4.7 (2018-08-02)
### Code Refactoring
### Bug Fixes
* **api-core:** pass config object to core classes ([d7b859c](https://github.com/Availity/sdk-js/commit/d7b859c))
- **api-core:** check for lowercase location as well ([4a4a9a0](https://github.com/Availity/sdk-js/commit/4a4a9a0))
## 2.4.6 (2018-08-02)
### BREAKING CHANGES
### Bug Fixes
* **api-core:** Options to core classes are being passed in as config object instead of parameters.
- **analytics-core:** fix non-click events ([fce9b26](https://github.com/Availity/sdk-js/commit/fce9b26))
# 2.4.0 (2018-07-12)
# 2.2.0 (2018-06-29)
# 1.0.0-alpha.10 (2018-01-04)
### Bug Fixes
- **api-core:** format postGet payload to standard ([5b885cf](https://github.com/Availity/sdk-js/commit/5b885cf))
## 2.1.2 (2018-06-13)
### Bug Fixes
* **api-core:** remove/delete should not assume data payloads ([e45a9f6](https://github.com/Availity/sdk-js/commit/e45a9f6))
- **api-core:** attempts count not increasing ([2e414a3](https://github.com/Availity/sdk-js/commit/2e414a3))
## 2.1.1 (2018-05-25)
### BREAKING CHANGES
### Bug Fixes
* **api-core:** previously remove/delete would assume that data was being passed in the body of the request if the first param of the message signature was NOT a string or number. Now, the method assumes a config object is passed in instead of data. This allows the developers to pass in params or data as they see fit.
- **api-core:** fix usage of Promise ([8fb3de8](https://github.com/Availity/sdk-js/commit/8fb3de8))
# 2.1.0 (2018-05-24)
### Features
# 1.0.0-alpha.9 (2018-01-03)
- **api-core:** add all method to get all the data from all of the pages ([114519d](https://github.com/Availity/sdk-js/commit/114519d))
## 2.0.3 (2018-05-10)
### Bug Fixes
* **api-core:** provides api param not properly merged with defaults ([5f53e3d](https://github.com/Availity/sdk-js/commit/5f53e3d))
- **api-core:** allow id to be in the config ([55b55af](https://github.com/Availity/sdk-js/commit/55b55af))
## 2.0.1 (2018-05-04)
### Bug Fixes
# 1.0.0-alpha.8 (2018-01-03)
- **api-core:** get id out of arguments ([3e525c2](https://github.com/Availity/sdk-js/commit/3e525c2))
# 2.0.0 (2018-05-04)
### Bug Fixes
# 1.0.0-alpha.7 (2018-01-03)
- **api-core:** avSpaces - throw error when no spaceId given ([7c47280](https://github.com/Availity/sdk-js/commit/7c47280))
# 1.4.0 (2018-04-17)
# 1.2.0 (2018-04-12)
### Features
- **api-core:** refactor polling for extending MS ([04c1474](https://github.com/Availity/sdk-js/commit/04c1474))
## 1.1.1 (2018-03-28)
## 1.0.1 (2018-03-26)
### Bug Fixes
* **api-core:** use get instead of query for space name ([84dd26a](https://github.com/Availity/sdk-js/commit/84dd26a))
- **api-core:** avFiles error handling ([3dd5392](https://github.com/Availity/sdk-js/commit/3dd5392))
# 1.0.0-alpha.17 (2018-01-18)
# 1.0.0-alpha.16 (2018-01-17)
# 1.0.0-alpha.6 (2017-12-20)
# 1.0.0-alpha.15 (2018-01-12)
# 1.0.0-alpha.14 (2018-01-11)
# 1.0.0-alpha.13 (2018-01-10)
# 1.0.0-alpha.5 (2017-12-20)
### Features
- **api-core:** add helper function adds name attribute to providers collection ([3b24341](https://github.com/Availity/sdk-js/commit/3b24341))
# 1.0.0-alpha.12 (2018-01-09)
# 1.0.0-alpha.11 (2018-01-06)
### Bug Fixes
* **api-core:** wrong url for notifcations api ([acafc97](https://github.com/Availity/sdk-js/commit/acafc97))
- **api-core:** resources incorrectly handling config ([9a5de1c](https://github.com/Availity/sdk-js/commit/9a5de1c))
### Code Refactoring
- **api-core:** pass config object to core classes ([d7b859c](https://github.com/Availity/sdk-js/commit/d7b859c))
# 1.0.0-alpha.4 (2017-12-20)
### BREAKING CHANGES
- **api-core:** Options to core classes are being passed in as config object instead of parameters.
# 1.0.0-alpha.10 (2018-01-04)
### Bug Fixes
* **api-core:** wrong url for pdf api ([9f4af1c](https://github.com/Availity/sdk-js/commit/9f4af1c))
- **api-core:** remove/delete should not assume data payloads ([e45a9f6](https://github.com/Availity/sdk-js/commit/e45a9f6))
### BREAKING CHANGES
- **api-core:** previously remove/delete would assume that data was being passed in the body of the request if the first param of the message signature was NOT a string or number. Now, the method assumes a config object is passed in instead of data. This allows the developers to pass in params or data as they see fit.
# 1.0.0-alpha.3 (2017-12-19)
# 1.0.0-alpha.9 (2018-01-03)
### Bug Fixes
- **api-core:** provides api param not properly merged with defaults ([5f53e3d](https://github.com/Availity/sdk-js/commit/5f53e3d))
# 1.0.0-alpha.8 (2018-01-03)
# 1.0.0-alpha.7 (2018-01-03)
### Bug Fixes
* **api-core:** user.me() should return user object ([715c616](https://github.com/Availity/sdk-js/commit/715c616))
- **api-core:** use get instead of query for space name ([84dd26a](https://github.com/Availity/sdk-js/commit/84dd26a))
# 1.0.0-alpha.6 (2017-12-20)
# 1.0.0-alpha.5 (2017-12-20)
# 1.0.0-alpha.2 (2017-12-19)
### Bug Fixes
- **api-core:** wrong url for notifcations api ([acafc97](https://github.com/Availity/sdk-js/commit/acafc97))
# 1.0.0-alpha.4 (2017-12-20)
# 1.0.0-alpha.1 (2017-12-19)
### Bug Fixes
- **api-core:** wrong url for pdf api ([9f4af1c](https://github.com/Availity/sdk-js/commit/9f4af1c))
# 1.0.0-alpha.3 (2017-12-19)
### Bug Fixes
* **api-core:** remove default after* response transformations ([6f17d3a](https://github.com/Availity/sdk-js/commit/6f17d3a))
- **api-core:** user.me() should return user object ([715c616](https://github.com/Availity/sdk-js/commit/715c616))
# 1.0.0-alpha.2 (2017-12-19)
# 1.0.0-alpha.1 (2017-12-19)
### Bug Fixes
- **api-core:** remove default after\* response transformations ([6f17d3a](https://github.com/Availity/sdk-js/commit/6f17d3a))
### BREAKING CHANGES
* **api-core:** The core API classes no longer apply after* transformations on the response. Previously, only the collection data was being returned when making API calls which made it difficult to react to the metadata around the response (e.g. pagination). Developers will have to unwrap the response manually.
- **api-core:** The core API classes no longer apply after\* transformations on the response. Previously, only the collection data was being returned when making API calls which made it difficult to react to the metadata around the response (e.g. pagination). Developers will have to unwrap the response manually.

@@ -552,342 +722,273 @@ Example response callback:

# 1.0.0-alpha.0 (2017-12-05)
### Features
* **api-core:** add post and delete as synonyms for create and update ([0150680](https://github.com/Availity/sdk-js/commit/0150680))
* **api-core:** add spaces helper methods ([72de394](https://github.com/Availity/sdk-js/commit/72de394))
* **api-core, api-angular api-react:** add pdf api ([b84a16f](https://github.com/Availity/sdk-js/commit/b84a16f))
- **api-core:** add post and delete as synonyms for create and update ([0150680](https://github.com/Availity/sdk-js/commit/0150680))
- **api-core:** add spaces helper methods ([72de394](https://github.com/Availity/sdk-js/commit/72de394))
- **api-core, api-angular api-react:** add pdf api ([b84a16f](https://github.com/Availity/sdk-js/commit/b84a16f))
<a name="3.0.0"></a>
<a name="3.0.0"></a>
# 3.0.0 (2018-11-20)
### Bug Fixes
* **api-core:** Allow array for permissions ([#67](https://github.com/Availity/sdk-js/issues/67)) ([98adf76](https://github.com/Availity/sdk-js/commit/98adf76))
* **api-core:** typo fix ([f543296](https://github.com/Availity/sdk-js/commit/f543296))
- **api-core:** Allow array for permissions ([#67](https://github.com/Availity/sdk-js/issues/67)) ([98adf76](https://github.com/Availity/sdk-js/commit/98adf76))
- **api-core:** typo fix ([f543296](https://github.com/Availity/sdk-js/commit/f543296))
### Features
* **api-core:** add example response for file delivery ([edc4df5](https://github.com/Availity/sdk-js/commit/edc4df5))
* **api-core:** add file upload delivery batch api ([eff0a3c](https://github.com/Availity/sdk-js/commit/eff0a3c))
- **api-core:** add example response for file delivery ([edc4df5](https://github.com/Availity/sdk-js/commit/edc4df5))
- **api-core:** add file upload delivery batch api ([eff0a3c](https://github.com/Availity/sdk-js/commit/eff0a3c))
### BREAKING CHANGES
* **api-core:** The query to the API has been changed. To get the previous behavior, supply a custom paramSerializer.
- **api-core:** The query to the API has been changed. To get the previous behavior, supply a custom paramSerializer.
<a name="2.6.0"></a>
<a name="2.6.0"></a>
# 2.6.0 (2018-08-23)
### Features
* **api-core:** helper function for settings api ([4d405a7](https://github.com/Availity/sdk-js/commit/4d405a7))
* **api-core:** helper function for settings api ([#64](https://github.com/Availity/sdk-js/issues/64)) ([f247235](https://github.com/Availity/sdk-js/commit/f247235))
- **api-core:** helper function for settings api ([4d405a7](https://github.com/Availity/sdk-js/commit/4d405a7))
- **api-core:** helper function for settings api ([#64](https://github.com/Availity/sdk-js/issues/64)) ([f247235](https://github.com/Availity/sdk-js/commit/f247235))
<a name="2.5.0"></a>
<a name="2.5.0"></a>
# 2.5.0 (2018-08-20)
<a name="2.4.8"></a>
<a name="2.4.8"></a>
## 2.4.8 (2018-08-06)
### Bug Fixes
* **api-core:** spread args for aliases ([5c7516b](https://github.com/Availity/sdk-js/commit/5c7516b))
- **api-core:** spread args for aliases ([5c7516b](https://github.com/Availity/sdk-js/commit/5c7516b))
<a name="2.4.7"></a>
<a name="2.4.7"></a>
## 2.4.7 (2018-08-02)
### Bug Fixes
* **api-core:** check for lowercase location as well ([4a4a9a0](https://github.com/Availity/sdk-js/commit/4a4a9a0))
- **api-core:** check for lowercase location as well ([4a4a9a0](https://github.com/Availity/sdk-js/commit/4a4a9a0))
<a name="2.4.6"></a>
<a name="2.4.6"></a>
## 2.4.6 (2018-08-02)
### Bug Fixes
* **analytics-core:** fix non-click events ([fce9b26](https://github.com/Availity/sdk-js/commit/fce9b26))
- **analytics-core:** fix non-click events ([fce9b26](https://github.com/Availity/sdk-js/commit/fce9b26))
<a name="2.4.0"></a>
<a name="2.4.0"></a>
# 2.4.0 (2018-07-12)
<a name="2.3.3"></a>
<a name="2.3.3"></a>
## 2.3.3 (2018-07-12)
<a name="2.2.0"></a>
<a name="2.2.0"></a>
# 2.2.0 (2018-06-29)
### Bug Fixes
* **api-core:** format postGet payload to standard ([5b885cf](https://github.com/Availity/sdk-js/commit/5b885cf))
- **api-core:** format postGet payload to standard ([5b885cf](https://github.com/Availity/sdk-js/commit/5b885cf))
<a name="2.1.2"></a>
<a name="2.1.2"></a>
## 2.1.2 (2018-06-13)
### Bug Fixes
* **api-core:** attempts count not increasing ([2e414a3](https://github.com/Availity/sdk-js/commit/2e414a3))
- **api-core:** attempts count not increasing ([2e414a3](https://github.com/Availity/sdk-js/commit/2e414a3))
<a name="2.1.1"></a>
<a name="2.1.1"></a>
## 2.1.1 (2018-05-25)
### Bug Fixes
* **api-core:** fix usage of Promise ([8fb3de8](https://github.com/Availity/sdk-js/commit/8fb3de8))
- **api-core:** fix usage of Promise ([8fb3de8](https://github.com/Availity/sdk-js/commit/8fb3de8))
<a name="2.1.0"></a>
<a name="2.1.0"></a>
# 2.1.0 (2018-05-24)
### Features
* **api-core:** add all method to get all the data from all of the pages ([114519d](https://github.com/Availity/sdk-js/commit/114519d))
- **api-core:** add all method to get all the data from all of the pages ([114519d](https://github.com/Availity/sdk-js/commit/114519d))
<a name="2.0.3"></a>
<a name="2.0.3"></a>
## 2.0.3 (2018-05-10)
### Bug Fixes
* **api-core:** allow id to be in the config ([55b55af](https://github.com/Availity/sdk-js/commit/55b55af))
- **api-core:** allow id to be in the config ([55b55af](https://github.com/Availity/sdk-js/commit/55b55af))
<a name="2.0.1"></a>
<a name="2.0.1"></a>
## 2.0.1 (2018-05-04)
### Bug Fixes
* **api-core:** get id out of arguments ([3e525c2](https://github.com/Availity/sdk-js/commit/3e525c2))
- **api-core:** get id out of arguments ([3e525c2](https://github.com/Availity/sdk-js/commit/3e525c2))
<a name="2.0.0"></a>
<a name="2.0.0"></a>
# 2.0.0 (2018-05-04)
### Bug Fixes
* **api-core:** avSpaces - throw error when no spaceId given ([7c47280](https://github.com/Availity/sdk-js/commit/7c47280))
- **api-core:** avSpaces - throw error when no spaceId given ([7c47280](https://github.com/Availity/sdk-js/commit/7c47280))
<a name="1.4.0"></a>
<a name="1.4.0"></a>
# 1.4.0 (2018-04-17)
<a name="1.2.0"></a>
<a name="1.2.0"></a>
# 1.2.0 (2018-04-12)
### Features
* **api-core:** refactor polling for extending MS ([04c1474](https://github.com/Availity/sdk-js/commit/04c1474))
- **api-core:** refactor polling for extending MS ([04c1474](https://github.com/Availity/sdk-js/commit/04c1474))
<a name="1.1.1"></a>
<a name="1.1.1"></a>
## 1.1.1 (2018-03-28)
<a name="1.0.1"></a>
<a name="1.0.1"></a>
## 1.0.1 (2018-03-26)
### Bug Fixes
* **api-core:** avFiles error handling ([3dd5392](https://github.com/Availity/sdk-js/commit/3dd5392))
- **api-core:** avFiles error handling ([3dd5392](https://github.com/Availity/sdk-js/commit/3dd5392))
<a name="1.0.0-alpha.17"></a>
<a name="1.0.0-alpha.17"></a>
# 1.0.0-alpha.17 (2018-01-18)
<a name="1.0.0-alpha.16"></a>
<a name="1.0.0-alpha.16"></a>
# 1.0.0-alpha.16 (2018-01-17)
<a name="1.0.0-alpha.15"></a>
<a name="1.0.0-alpha.15"></a>
# 1.0.0-alpha.15 (2018-01-12)
<a name="1.0.0-alpha.14"></a>
<a name="1.0.0-alpha.14"></a>
# 1.0.0-alpha.14 (2018-01-11)
<a name="1.0.0-alpha.13"></a>
<a name="1.0.0-alpha.13"></a>
# 1.0.0-alpha.13 (2018-01-10)
### Features
* **api-core:** add helper function adds name attribute to providers collection ([3b24341](https://github.com/Availity/sdk-js/commit/3b24341))
- **api-core:** add helper function adds name attribute to providers collection ([3b24341](https://github.com/Availity/sdk-js/commit/3b24341))
<a name="1.0.0-alpha.12"></a>
<a name="1.0.0-alpha.12"></a>
# 1.0.0-alpha.12 (2018-01-09)
<a name="1.0.0-alpha.11"></a>
<a name="1.0.0-alpha.11"></a>
# 1.0.0-alpha.11 (2018-01-06)
### Bug Fixes
* **api-core:** resources incorrectly handling config ([9a5de1c](https://github.com/Availity/sdk-js/commit/9a5de1c))
- **api-core:** resources incorrectly handling config ([9a5de1c](https://github.com/Availity/sdk-js/commit/9a5de1c))
### Code Refactoring
* **api-core:** pass config object to core classes ([d7b859c](https://github.com/Availity/sdk-js/commit/d7b859c))
- **api-core:** pass config object to core classes ([d7b859c](https://github.com/Availity/sdk-js/commit/d7b859c))
### BREAKING CHANGES
* **api-core:** Options to core classes are being passed in as config object instead of parameters.
- **api-core:** Options to core classes are being passed in as config object instead of parameters.
<a name="1.0.0-alpha.10"></a>
<a name="1.0.0-alpha.10"></a>
# 1.0.0-alpha.10 (2018-01-04)
### Bug Fixes
* **api-core:** remove/delete should not assume data payloads ([e45a9f6](https://github.com/Availity/sdk-js/commit/e45a9f6))
- **api-core:** remove/delete should not assume data payloads ([e45a9f6](https://github.com/Availity/sdk-js/commit/e45a9f6))
### BREAKING CHANGES
* **api-core:** previously remove/delete would assume that data was being passed in the body of the request if the first param of the message signature was NOT a string or number. Now, the method assumes a config object is passed in instead of data. This allows the developers to pass in params or data as they see fit.
- **api-core:** previously remove/delete would assume that data was being passed in the body of the request if the first param of the message signature was NOT a string or number. Now, the method assumes a config object is passed in instead of data. This allows the developers to pass in params or data as they see fit.
<a name="1.0.0-alpha.9"></a>
<a name="1.0.0-alpha.9"></a>
# 1.0.0-alpha.9 (2018-01-03)
### Bug Fixes
* **api-core:** provides api param not properly merged with defaults ([5f53e3d](https://github.com/Availity/sdk-js/commit/5f53e3d))
- **api-core:** provides api param not properly merged with defaults ([5f53e3d](https://github.com/Availity/sdk-js/commit/5f53e3d))
<a name="1.0.0-alpha.8"></a>
<a name="1.0.0-alpha.8"></a>
# 1.0.0-alpha.8 (2018-01-03)
<a name="1.0.0-alpha.7"></a>
<a name="1.0.0-alpha.7"></a>
# 1.0.0-alpha.7 (2018-01-03)
### Bug Fixes
* **api-core:** use get instead of query for space name ([84dd26a](https://github.com/Availity/sdk-js/commit/84dd26a))
- **api-core:** use get instead of query for space name ([84dd26a](https://github.com/Availity/sdk-js/commit/84dd26a))
<a name="1.0.0-alpha.6"></a>
<a name="1.0.0-alpha.6"></a>
# 1.0.0-alpha.6 (2017-12-20)
<a name="1.0.0-alpha.5"></a>
<a name="1.0.0-alpha.5"></a>
# 1.0.0-alpha.5 (2017-12-20)
### Bug Fixes
* **api-core:** wrong url for notifcations api ([acafc97](https://github.com/Availity/sdk-js/commit/acafc97))
- **api-core:** wrong url for notifcations api ([acafc97](https://github.com/Availity/sdk-js/commit/acafc97))
<a name="1.0.0-alpha.4"></a>
<a name="1.0.0-alpha.4"></a>
# 1.0.0-alpha.4 (2017-12-20)
### Bug Fixes
* **api-core:** wrong url for pdf api ([9f4af1c](https://github.com/Availity/sdk-js/commit/9f4af1c))
- **api-core:** wrong url for pdf api ([9f4af1c](https://github.com/Availity/sdk-js/commit/9f4af1c))
<a name="1.0.0-alpha.3"></a>
<a name="1.0.0-alpha.3"></a>
# 1.0.0-alpha.3 (2017-12-19)
### Bug Fixes
* **api-core:** user.me() should return user object ([715c616](https://github.com/Availity/sdk-js/commit/715c616))
- **api-core:** user.me() should return user object ([715c616](https://github.com/Availity/sdk-js/commit/715c616))
<a name="1.0.0-alpha.2"></a>
<a name="1.0.0-alpha.2"></a>
# 1.0.0-alpha.2 (2017-12-19)
<a name="1.0.0-alpha.1"></a>
<a name="1.0.0-alpha.1"></a>
# 1.0.0-alpha.1 (2017-12-19)
### Bug Fixes
* **api-core:** remove default after* response transformations ([6f17d3a](https://github.com/Availity/sdk-js/commit/6f17d3a))
- **api-core:** remove default after\* response transformations ([6f17d3a](https://github.com/Availity/sdk-js/commit/6f17d3a))
### BREAKING CHANGES
* **api-core:** The core API classes no longer apply after* transformations on the response. Previously, only the collection data was being returned when making API calls which made it difficult to react to the metadata around the response (e.g. pagination). Developers will have to unwrap the response manually.
- **api-core:** The core API classes no longer apply after\* transformations on the response. Previously, only the collection data was being returned when making API calls which made it difficult to react to the metadata around the response (e.g. pagination). Developers will have to unwrap the response manually.

@@ -902,12 +1003,10 @@ Example response callback:

<a name="1.0.0-alpha.0"></a>
<a name="1.0.0-alpha.0"></a>
# 1.0.0-alpha.0 (2017-12-05)
### Features
* **api-core:** add post and delete as synonyms for create and update ([0150680](https://github.com/Availity/sdk-js/commit/0150680))
* **api-core:** add spaces helper methods ([72de394](https://github.com/Availity/sdk-js/commit/72de394))
* **api-core, api-angular api-react:** add pdf api ([b84a16f](https://github.com/Availity/sdk-js/commit/b84a16f))
- **api-core:** add post and delete as synonyms for create and update ([0150680](https://github.com/Availity/sdk-js/commit/0150680))
- **api-core:** add spaces helper methods ([72de394](https://github.com/Availity/sdk-js/commit/72de394))
- **api-core, api-angular api-react:** add pdf api ([b84a16f](https://github.com/Availity/sdk-js/commit/b84a16f))

@@ -8,6 +8,28 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
require("core-js/modules/es.function.name.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.array.join.js");
require("core-js/modules/es.array.map.js");
require("core-js/modules/es.array.concat.js");
require("core-js/modules/es.array.find.js");
require("core-js/modules/es.object.keys.js");
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _qs = _interopRequireDefault(require("qs"));

@@ -19,13 +41,13 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var _resolveHost = _interopRequireDefault(require("./resolve-host"));
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/* eslint-disable promise/no-nesting */
var AvApi = /*#__PURE__*/function () {
function AvApi(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvApi);
class AvApi {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
if (!http || !config || !promise || !merge) {

@@ -38,320 +60,427 @@ throw new Error('[http], [promise], [config], and [merge] must be defined');

this.merge = merge;
this.defaultConfig = this.merge({}, _options.default.API, config);
this.defaultConfig = this.merge({}, _options["default"].API, config);
} // get the merged config
config(config = {}) {
return this.merge({}, this.defaultConfig, config);
}
(0, _createClass2["default"])(AvApi, [{
key: "config",
value: function config() {
var _config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
addParams(params = {}, config = {}, newObj = true) {
const output = newObj ? _objectSpread({
params: {}
}, config) : config;
if (!newObj) {
output.params = output.params || {};
return this.merge({}, this.defaultConfig, _config);
}
}, {
key: "addParams",
value: function addParams() {
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var newObj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var output = newObj ? (0, _objectSpread2["default"])({
params: {}
}, config) : config;
output.params = _objectSpread({}, output.params, {}, params);
return output;
} // set the cache parameters
if (!newObj) {
output.params = output.params || {};
}
cacheParams(config) {
const params = {};
if (config.cacheBust) {
params.cacheBust = this.getCacheBustVal(config.cacheBust, () => Date.now());
output.params = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, output.params), params);
return output;
}
}, {
key: "getSessionBust",
value: function getSessionBust() {
return window.localStorage.getItem('avCacheBust');
} // set the cache parameters
if (config.pageBust) {
params.pageBust = this.getCacheBustVal(config.pageBust, () => this.getPageBust());
}
}, {
key: "cacheParams",
value: function cacheParams(config) {
var _this = this;
if (config.sessionBust) {
params.sessionBust = this.getCacheBustVal(config.sessionBust, () => avLocalStorage.getSessionBust() || this.getPageBust());
}
var params = {};
return this.addParams(params, config, false);
} // get the cache value with default function
if (config.cacheBust) {
params.cacheBust = this.getCacheBustVal(config.cacheBust, function () {
return Date.now();
});
}
if (config.pageBust) {
params.pageBust = this.getCacheBustVal(config.pageBust, function () {
return _this.getPageBust();
});
}
getCacheBustVal(cacheBust, defaultFn) {
if (!cacheBust) {
return undefined;
}
if (config.sessionBust) {
params.sessionBust = this.getCacheBustVal(config.sessionBust, function () {
return _this.getSessionBust() || _this.getPageBust();
});
}
if (typeof cacheBust === 'boolean' && defaultFn) {
return defaultFn();
}
return this.addParams(params, config, false);
} // get the cache value with default function
if (typeof cacheBust === 'function') {
return cacheBust();
}
}, {
key: "getCacheBustVal",
value: function getCacheBustVal(cacheBust, defaultFn) {
if (!cacheBust) {
return undefined;
}
return cacheBust;
} // get pagebust value, make sure it is instantiated first
if (typeof cacheBust === 'boolean' && defaultFn) {
return defaultFn();
}
if (typeof cacheBust === 'function') {
return cacheBust();
}
getPageBust() {
if (typeof this.pageBustValue === 'undefined') {
this.setPageBust();
}
return cacheBust;
} // get pagebust value, make sure it is instantiated first
return this.pageBustValue;
} // set the page bust value to given value or timestamp
}, {
key: "getPageBust",
value: function getPageBust() {
if (typeof this.pageBustValue === 'undefined') {
this.setPageBust();
}
return this.pageBustValue;
} // set the page bust value to given value or timestamp
setPageBust(value) {
this.pageBustValue = typeof value === 'undefined' ? Date.now() : value;
} // get final url from config
}, {
key: "setPageBust",
value: function setPageBust(value) {
this.pageBustValue = typeof value === 'undefined' ? Date.now() : value;
} // get final url from config
}, {
key: "getUrl",
value: function getUrl(config) {
var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
getUrl(config, id = '') {
if (!config.api) {
return config.url;
}
if (!config.api) {
return config.url;
}
const path = config.path,
var path = config.path,
version = config.version,
name = config.name,
url = config.url;
let parts = [];
url = config.url,
host = config.host;
var parts = [];
parts = name ? ['', path, version, name, id] : [url, id]; // join parts, remove multiple /'s and trailing /
if (name) {
parts = ['', path, version, name, id];
} else {
parts = [url, id];
} // join parts, remove multiple /'s and trailing /
var uri = parts.join('/').replace(/\/+/g, '/').replace(/\/$/, '');
var hostname = url ? null : (0, _resolveHost["default"])(host, config.window || window);
return (hostname ? "https://".concat(hostname) : '') + uri;
}
}, {
key: "getRequestUrl",
value: function getRequestUrl() {
return this.getUrl(this.config());
} // return location if should poll otherwise false
return parts.join('/').replace(/[/]+/g, '/').replace(/\/$/, '');
}
getRequestUrl() {
return this.getUrl(this.config());
} // return location if should poll otherwise false
getLocation(response) {
let locationUrl;
const config = response.config,
}, {
key: "getLocation",
value: function getLocation(response) {
var config = response.config,
_response$headers = response.headers,
headers = _response$headers === void 0 ? {} : _response$headers;
const getHeader = config.getHeader,
var getHeader = config.getHeader,
base = config.base;
const location = headers.location,
var location = headers.location,
Location = headers.Location;
var locationUrl = getHeader ? getHeader(response, 'Location') : location || Location;
return (0, _resolveUrl["default"])({
relative: locationUrl,
base: base
});
} // condition for calls that should continue polling
if (getHeader) {
locationUrl = getHeader(response, 'Location');
} else {
locationUrl = location || Location;
}
}, {
key: "shouldPoll",
value: function shouldPoll(response) {
return response && response.config && response.config.polling && response.status === 202 && response.config.attempt < response.config.pollingIntervals.length;
} // handle response with possible polling
return (0, _resolveUrl.default)({
relative: locationUrl,
base: base
});
} // condition for calls that should continue polling
}, {
key: "onResponse",
value: function onResponse(response, afterResponse) {
var _this2 = this;
if (this.shouldPoll(response)) {
var newConfig = this.config(response.config);
var pollingUrl = this.getLocation(response);
shouldPoll(response) {
return response && response.config && response.config.polling && response.status === 202 && response.config.attempt < response.config.pollingIntervals.length;
} // handle response with possible polling
if (pollingUrl) {
newConfig.method = this.defaultConfig.pollingMethod;
newConfig.url = pollingUrl;
newConfig.cache = false;
return new this.Promise(function (resolve) {
setTimeout(resolve, newConfig.pollingIntervals[newConfig.attempt] || 1000);
}).then(function () {
return _this2.request(newConfig, afterResponse);
});
}
}
return afterResponse ? afterResponse(response) : response;
} // make request to http
onResponse(response, afterResponse) {
if (this.shouldPoll(response)) {
const newConfig = this.config(response.config);
const pollingUrl = this.getLocation(response);
}, {
key: "request",
value: function request(config, afterResponse) {
var _this3 = this;
if (pollingUrl) {
newConfig.method = this.defaultConfig.pollingMethod;
newConfig.url = pollingUrl;
newConfig.cache = false;
return new this.Promise(resolve => {
setTimeout(resolve, newConfig.pollingIntervals[newConfig.attempt] || 1000);
}).then(() => this.request(newConfig, afterResponse));
if (config.polling) {
config.attempt = config.attempt || 0;
config.attempt += 1;
}
}
return afterResponse ? afterResponse(response) : response;
} // make request to http
return this.http(config).then(function (response) {
return _this3.onResponse(response, afterResponse);
});
} // post request
}, {
key: "create",
value: function create(data, config) {
if (!data) {
throw new Error('called method without [data]');
}
request(config, afterResponse) {
if (config.polling) {
config.attempt = config.attempt || 0;
config.attempt += 1;
}
config = this.config(config);
config.method = 'POST';
config.url = this.getUrl(config);
config.data = data;
var beforeFunc = this.beforeCreate || this.beforePost;
return this.http(config).then(response => this.onResponse(response, afterResponse));
} // post request
if (beforeFunc) {
config.data = beforeFunc(config.data);
}
create(data, config) {
if (!data) {
throw new Error('called method without [data]');
return this.request(config, this.afterCreate || this.afterPost);
}
}, {
key: "sendBeacon",
value: function 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;
config = this.config(config);
config.method = 'POST';
config.url = this.getUrl(config);
config.data = data;
var beforeFunc = this.beforeCreate || this.beforePost;
if (beforeFunc) {
config.data = beforeFunc(config.data);
}
if (beforeFunc) {
config.data = beforeFunc(config.data);
}
return this.request(config, this.afterCreate || this.afterPost);
}
if (navigator.sendBeacon) {
var result = navigator.sendBeacon(config.url, new Blob([config.data], {
type: 'application/x-www-form-urlencoded'
})); // A truthy return value from navigator.sendBeacon means the browser successfully queued the request
post(data, config) {
return this.create(data, config);
} // post request with method-override to get
if (result) return this.Promise.resolve();
} // Fall back to XHR if browser does not support navigator.sendBeacon or browser fails to queue the request
postGet(data, config) {
if (!data) {
throw new Error('called method without [data]');
return this.request(config, this.afterCreate || this.afterPost);
}
}, {
key: "post",
value: function post(data, config) {
return this.create(data, config);
} // post request with method-override to get
config = this.config(config);
config.method = 'POST';
config.headers = config.headers || {};
config.headers['X-HTTP-Method-Override'] = 'GET';
config.headers['Content-Type'] = config.headers['Content-Type'] || 'application/x-www-form-urlencoded';
config.url = this.getUrl(config);
config.data = data;
}, {
key: "postGet",
value: function postGet(data, config) {
if (!data) {
throw new Error('called method without [data]');
}
if (this.beforePostGet) {
config.data = this.beforePostGet(config.data);
}
config = this.config(config);
config.method = 'POST';
config.headers = config.headers || {};
config.headers['X-HTTP-Method-Override'] = 'GET';
config.headers['Content-Type'] = config.headers['Content-Type'] || 'application/x-www-form-urlencoded';
config.url = this.getUrl(config);
config.data = data;
if (typeof config.data !== 'string' && config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
config.data = _qs.default.stringify(config.data, {
encode: false,
arrayFormat: 'repeat',
indices: false,
allowDots: true
});
}
if (this.beforePostGet) {
config.data = this.beforePostGet(config.data);
}
return this.request(config, this.afterPostGet);
} // get request with id
if (typeof config.data !== 'string' && config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
config.data = _qs["default"].stringify(config.data, {
encode: false,
arrayFormat: 'repeat',
indices: false,
allowDots: true
});
}
return this.request(config, this.afterPostGet);
} // get request with id
get(id, config) {
if (!id) {
throw new Error('called method without [id]');
}, {
key: "get",
value: function get(id, config) {
if (!id) {
throw new Error('called method without [id]');
}
config = this.config(config);
config.method = 'GET';
config.url = this.getUrl(config, id);
config = this.cacheParams(config);
return this.request(config, this.afterGet);
} // get request with just params
}, {
key: "query",
value: function query(config) {
config = this.config(config);
config.method = 'GET';
config.url = this.getUrl(config);
config = this.cacheParams(config);
return this.request(config, this.afterQuery);
}
}, {
key: "all",
value: function all(config) {
var _this4 = this;
config = this.config(config);
config.method = 'GET';
config.url = this.getUrl(config, id);
config = this.cacheParams(config);
return this.request(config, this.afterGet);
} // get request with just params
return this.query(config).then(function (resp) {
var key = _this4.getQueryResultKey(resp.data);
var totalPages = Math.ceil(resp.data.totalCount / resp.data.limit);
var result = resp.data[key] || [];
query(config) {
config = this.config(config);
config.method = 'GET';
config.url = this.getUrl(config);
config = this.cacheParams(config);
return this.request(config, this.afterQuery);
}
if (totalPages > 1) {
var otherPages = [];
all(config) {
return this.query(config).then(resp => {
const key = this.getQueryResultKey(resp.data);
const totalPages = Math.ceil(resp.data.totalCount / resp.data.limit);
const result = resp.data[key] || [];
for (var i = 0; i < totalPages - 1; i += 1) {
otherPages[i] = i + 2;
}
if (totalPages > 1) {
const otherPages = [];
for (let i = 0; i < totalPages - 1; i += 1) {
otherPages[i] = i + 2;
return _this4.Promise.all(otherPages.map(function (page) {
return _this4.getPage(page, config, resp.data.limit).then(function (pageResp) {
return pageResp.data[key] || [];
});
})).then(function (pages) {
return [].concat((0, _toConsumableArray2["default"])(result), (0, _toConsumableArray2["default"])(pages));
});
}
/* eslint-disable promise/no-nesting */
return result;
});
}
}, {
key: "getQueryResultKey",
value: function getQueryResultKey(data) {
return Object.keys(data).find(function (key) {
return Array.isArray(data[key]);
});
}
}, {
key: "getResult",
value: function getResult(data) {
return data[this.getQueryResultKey(data)];
}
}, {
key: "getPage",
value: function getPage() {
var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var limit = arguments.length > 2 ? arguments[2] : undefined;
limit = limit || config.params && config.params.limit || 50;
var offset = (page - 1) * limit;
return this.query(this.addParams({
offset: offset,
limit: limit
}, config, false));
} // put request
return this.Promise.all(otherPages.map(page => this.getPage(page, config, resp.data.limit).then(pageResp => pageResp.data[key] || []))).then(pages => result.concat(...pages));
}, {
key: "update",
value: function update(id, data, config) {
if (typeof id !== 'string' && typeof id !== 'number') {
config = data;
data = id;
id = '';
}
return result;
});
}
config = this.config(config);
config.method = 'PUT';
config.url = this.getUrl(config, id);
config.data = data;
var beforeFunc = this.beforeUpdate || this.beforePut;
getQueryResultKey(data) {
return Object.keys(data).filter(key => Array.isArray(data[key]))[0];
}
if (beforeFunc) {
config.data = beforeFunc(config.data);
}
getResult(data) {
return data[this.getQueryResultKey(data)];
}
getPage(page = 1, config = {}, limit) {
limit = limit || config.params && config.params.limit || 50;
const offset = (page - 1) * limit;
return this.query(this.addParams({
offset: offset,
limit: limit
}, config, false));
} // put request
update(id, data, config) {
if (typeof id !== 'string' && typeof id !== 'number') {
config = data;
data = id;
id = '';
return this.request(config, this.afterUpdate || this.afterPut);
}
}, {
key: "put",
value: function put() {
return this.update.apply(this, arguments);
} // patch request
config = this.config(config);
config.method = 'PUT';
config.url = this.getUrl(config, id);
config.data = data;
const beforeFunc = this.beforeUpdate || this.beforePut;
}, {
key: "patch",
value: function patch(id, data, config) {
if (typeof id !== 'string' && typeof id !== 'number') {
config = data;
data = id;
id = '';
}
if (beforeFunc) {
config.data = beforeFunc(config.data);
}
config = this.config(config);
config.method = 'PATCH';
config.url = this.getUrl(config, id);
config.data = data;
var beforeFunc = this.beforePatch;
return this.request(config, this.afterUpdate || this.afterPut);
}
if (beforeFunc) {
config.data = beforeFunc(config.data);
}
put(...args) {
return this.update(...args);
} // delete request
return this.request(config, this.afterPatch);
} // delete request
}, {
key: "remove",
value: function remove(id, config) {
if (typeof id !== 'string' && typeof id !== 'number') {
config = id;
id = '';
}
remove(id, config) {
if (typeof id !== 'string' && typeof id !== 'number') {
config = id;
id = '';
}
config = this.config(config);
config.method = 'DELETE';
config.url = this.getUrl(config, id);
var beforeFunc = this.beforeRemove || this.beforeDelete;
config = this.config(config);
config.method = 'DELETE';
config.url = this.getUrl(config, id);
const beforeFunc = this.beforeRemove || this.beforeDelete;
if (beforeFunc) {
config = beforeFunc(config);
}
if (beforeFunc) {
config = beforeFunc(config);
return this.request(config, this.afterRemove || this.afterDelete);
}
}, {
key: "delete",
value: function _delete() {
return this.remove.apply(this, arguments);
}
}]);
return AvApi;
}();
return this.request(config, this.afterRemove || this.afterDelete);
}
delete(...args) {
return this.remove(...args);
}
}
exports.default = AvApi;
exports["default"] = AvApi;

@@ -10,4 +10,4 @@ "use strict";

enumerable: true,
get: function () {
return _ms.default;
get: function get() {
return _ms["default"];
}

@@ -17,4 +17,4 @@ });

enumerable: true,
get: function () {
return _webQL.default;
get: function get() {
return _webQL["default"];
}

@@ -24,4 +24,4 @@ });

enumerable: true,
get: function () {
return _logs.default;
get: function get() {
return _logs["default"];
}

@@ -31,4 +31,4 @@ });

enumerable: true,
get: function () {
return _dma.default;
get: function get() {
return _dma["default"];
}

@@ -38,4 +38,4 @@ });

enumerable: true,
get: function () {
return _navigation.default;
get: function get() {
return _navigation["default"];
}

@@ -45,4 +45,4 @@ });

enumerable: true,
get: function () {
return _notifications.default;
get: function get() {
return _notifications["default"];
}

@@ -52,4 +52,4 @@ });

enumerable: true,
get: function () {
return _organizations.default;
get: function get() {
return _organizations["default"];
}

@@ -59,4 +59,4 @@ });

enumerable: true,
get: function () {
return _permissions.default;
get: function get() {
return _permissions["default"];
}

@@ -66,4 +66,4 @@ });

enumerable: true,
get: function () {
return _pdfs.default;
get: function get() {
return _pdfs["default"];
}

@@ -73,4 +73,4 @@ });

enumerable: true,
get: function () {
return _providers.default;
get: function get() {
return _providers["default"];
}

@@ -80,4 +80,4 @@ });

enumerable: true,
get: function () {
return _proxy.default;
get: function get() {
return _proxy["default"];
}

@@ -87,4 +87,4 @@ });

enumerable: true,
get: function () {
return _regions.default;
get: function get() {
return _regions["default"];
}

@@ -94,4 +94,4 @@ });

enumerable: true,
get: function () {
return _spaces.default;
get: function get() {
return _spaces["default"];
}

@@ -101,4 +101,4 @@ });

enumerable: true,
get: function () {
return _user.default;
get: function get() {
return _user["default"];
}

@@ -108,4 +108,4 @@ });

enumerable: true,
get: function () {
return _userPermissions.default;
get: function get() {
return _userPermissions["default"];
}

@@ -115,4 +115,4 @@ });

enumerable: true,
get: function () {
return _files.default;
get: function get() {
return _files["default"];
}

@@ -122,4 +122,4 @@ });

enumerable: true,
get: function () {
return _filesDelivery.default;
get: function get() {
return _filesDelivery["default"];
}

@@ -129,4 +129,4 @@ });

enumerable: true,
get: function () {
return _settings.default;
get: function get() {
return _settings["default"];
}

@@ -136,4 +136,4 @@ });

enumerable: true,
get: function () {
return _slotmachine.default;
get: function get() {
return _slotmachine["default"];
}

@@ -143,4 +143,4 @@ });

enumerable: true,
get: function () {
return _disclaimers.default;
get: function get() {
return _disclaimers["default"];
}

@@ -150,7 +150,7 @@ });

enumerable: true,
get: function () {
return _codes.default;
get: function get() {
return _codes["default"];
}
});
exports.default = void 0;
exports["default"] = void 0;

@@ -201,3 +201,3 @@ var _api = _interopRequireDefault(require("./api"));

var _default = _api.default;
exports.default = _default;
var _default = _api["default"];
exports["default"] = _default;

@@ -8,4 +8,20 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
require("core-js/modules/es.function.name.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.array.join.js");
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("./api"));

@@ -15,10 +31,18 @@

class AvMicroservice extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
super({
var _resolveHost = _interopRequireDefault(require("./resolve-host"));
var AvMicroservice = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvMicroservice, _AvApi);
var _super = (0, _createSuper2["default"])(AvMicroservice);
function AvMicroservice(_ref) {
var _this;
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvMicroservice);
_this = _super.call(this, {
http: http,

@@ -29,8 +53,13 @@ promise: promise,

});
this.defaultConfig = this.merge({}, _options.default.MS, config);
_this.defaultConfig = _this.merge({}, _options["default"].MS, config);
return _this;
} // override aries 1 url concatenation
getUrl(config, id = '') {
const _this$config = this.config(config),
(0, _createClass2["default"])(AvMicroservice, [{
key: "getUrl",
value: function getUrl(config) {
var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var _this$config = this.config(config),
path = _this$config.path,

@@ -41,18 +70,22 @@ version = _this$config.version,

let parts = [path, version || '', name];
var parts = [path, version || '', name];
if (id || configId) {
parts = [path, version || '', name, id || configId];
}
if (id || configId) {
parts = [path, version || '', name, id || configId];
}
return parts.join('/').replace(/[/]+/g, '/').replace(/\/$/, '');
} // polling location is the same url
var uri = parts.join('/').replace(/\/+/g, '/').replace(/\/$/, '');
var hostname = (0, _resolveHost["default"])(config.host, config.window || window);
return (hostname ? "https://".concat(hostname) : '') + uri;
} // polling location is the same url
}, {
key: "getLocation",
value: function getLocation(response) {
return this.getUrl(response.config);
}
}]);
return AvMicroservice;
}(_api["default"]);
getLocation(response) {
return this.getUrl(response.config);
}
}
exports.default = AvMicroservice;
exports["default"] = AvMicroservice;

@@ -6,4 +6,4 @@ "use strict";

});
exports.default = void 0;
const API_OPTIONS = {
exports["default"] = void 0;
var API_OPTIONS = {
API: {

@@ -32,3 +32,5 @@ // default base segment for Availity API endpoints

},
sessionBust: true
sessionBust: true,
// send credentials on CORS requests
withCredentials: true
},

@@ -58,6 +60,8 @@ MS: {

},
sessionBust: false
sessionBust: false,
// send credentials on CORS requests
withCredentials: true
}
};
var _default = API_OPTIONS;
exports.default = _default;
exports["default"] = _default;

@@ -8,24 +8,29 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvCodes = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvCodes, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvCodes);
class AvCodes extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvCodes(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvCodes);
var options = (0, _objectSpread2["default"])({
name: 'codes'
}, config);
super({
return _super.call(this, {
http: http,

@@ -38,4 +43,5 @@ promise: promise,

}
return AvCodes;
}(_api["default"]);
exports.default = AvCodes;
exports["default"] = AvCodes;

@@ -8,25 +8,32 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvDisclaimers = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvDisclaimers, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvDisclaimers);
class AvDisclaimers extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvDisclaimers(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvDisclaimers);
var options = (0, _objectSpread2["default"])({
path: '/api/sdk/platform',
name: '/disclaimers'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,11 +46,14 @@ promise: promise,

getDisclaimers(id, config) {
const queryConfig = this.addParams({
id: id
}, config);
return this.query(queryConfig);
}
(0, _createClass2["default"])(AvDisclaimers, [{
key: "getDisclaimers",
value: function getDisclaimers(id, config) {
var queryConfig = this.addParams({
id: id
}, config);
return this.query(queryConfig);
}
}]);
return AvDisclaimers;
}(_api["default"]);
}
exports.default = AvDisclaimers;
exports["default"] = AvDisclaimers;

@@ -8,26 +8,45 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.array.join.js");
require("core-js/modules/es.array.map.js");
require("core-js/modules/es.object.keys.js");
require("core-js/modules/es.array.concat.js");
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _flattenObject = _interopRequireDefault(require("@availity/api-core/lib/flattenObject"));
var _ms = _interopRequireDefault(require("../ms"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var DmaLogMessages = /*#__PURE__*/function (_AvMicroservice) {
(0, _inherits2["default"])(DmaLogMessages, _AvMicroservice);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(DmaLogMessages);
class AvLogMessages extends _ms.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
path: '/ms/api/availity/internal/dma/log-message-service/portal',
name: 'log-messages',
version: '/v2'
function DmaLogMessages(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, DmaLogMessages);
var options = (0, _objectSpread2["default"])({
name: 'spc/analytics/log'
}, config);
super({
return _super.call(this, {
http: http,

@@ -40,8 +59,45 @@ promise: promise,

send(entries) {
return this.create(entries);
}
(0, _createClass2["default"])(DmaLogMessages, [{
key: "send",
value: function send(level, entries) {
delete entries.level;
var payload = {
level: level,
entries: entries
};
var flattened = (0, _flattenObject["default"])(payload);
flattened.X_Client_ID = this.clientId;
flattened.X_XSRF_TOKEN = document.cookie.replace(/(?:(?:^|.*;\s*)XSRF-TOKEN\s*=\s*([^;]*).*$)|^.*$/, '$1');
var fields = Object.keys(flattened).map(function (key) {
var name = key.replace(/\[\d+]/g, '[]');
var value = flattened[key];
return "".concat(name, "=").concat(encodeURIComponent(value));
}).join('&');
return fields;
}
}, {
key: "debug",
value: function debug(entries) {
return this.sendBeacon(this.send('debug', entries));
}
}, {
key: "info",
value: function info(entries) {
return this.sendBeacon(this.send('info', entries));
}
}, {
key: "warn",
value: function warn(entries) {
return this.sendBeacon(this.send('warn', entries));
}
}, {
key: "error",
value: function error(entries) {
return this.sendBeacon(this.send('error', entries));
}
}]);
return DmaLogMessages;
}(_ms["default"]);
}
exports.default = AvLogMessages;
var _default = DmaLogMessages;
exports["default"] = _default;

@@ -8,20 +8,28 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _ms = _interopRequireDefault(require("../ms"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvFiles = /*#__PURE__*/function (_AvMicroservice) {
(0, _inherits2["default"])(AvFiles, _AvMicroservice);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvFiles);
class AvFiles extends _ms.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvFiles(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvFiles);
var options = (0, _objectSpread2["default"])({
name: 'core/vault/upload/v1',

@@ -32,4 +40,3 @@ headers: {

}, config);
super({
return _super.call(this, {
http: http,

@@ -42,15 +49,18 @@ promise: promise,

uploadFile(data, config) {
if (!config.customerId || !config.clientId) {
throw new Error('[config.customerId] and [config.clientId] must be defined');
(0, _createClass2["default"])(AvFiles, [{
key: "uploadFile",
value: function uploadFile(data, config) {
if (!config.customerId || !config.clientId) {
throw new 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);
}
}]);
return AvFiles;
}(_ms["default"]);
config = this.config(config);
config.headers['X-Availity-Customer-ID'] = config.customerId;
config.headers['X-Client-ID'] = config.clientId;
return this.create(data, config);
}
}
exports.default = AvFiles;
exports["default"] = AvFiles;

@@ -8,20 +8,34 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
require("core-js/modules/es.array.concat.js");
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _ms = _interopRequireDefault(require("../ms"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvFilesDelivery = /*#__PURE__*/function (_AvMicroservice) {
(0, _inherits2["default"])(AvFilesDelivery, _AvMicroservice);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvFilesDelivery);
class AvFilesDelivery extends _ms.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvFilesDelivery(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvFilesDelivery);
var options = (0, _objectSpread2["default"])({
name: 'platform/file-upload-delivery/v1/batch/deliveries',

@@ -34,4 +48,3 @@ headers: {

}, config);
super({
return _super.call(this, {
http: http,

@@ -44,20 +57,24 @@ promise: promise,

uploadFilesDelivery(data, config) {
if (!config.customerId || !config.clientId) {
throw new Error('[config.customerId] and [config.clientId] must be defined');
(0, _createClass2["default"])(AvFilesDelivery, [{
key: "uploadFilesDelivery",
value: function uploadFilesDelivery(data, config) {
if (!config.customerId || !config.clientId) {
throw new 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);
}
}, {
key: "getLocation",
value: function getLocation(response) {
var baseUrl = (0, _get2["default"])((0, _getPrototypeOf2["default"])(AvFilesDelivery.prototype), "getLocation", this).call(this, response);
return "".concat(baseUrl, "/").concat(response.data.id);
}
}]);
return AvFilesDelivery;
}(_ms["default"]);
config = this.config(config);
config.headers['X-Availity-Customer-ID'] = config.customerId;
config.headers['X-Client-ID'] = config.clientId;
return this.create(data || {}, config);
}
getLocation(response) {
const baseUrl = super.getLocation(response.config);
return `${baseUrl}/${response.data.id}`;
}
}
exports.default = AvFilesDelivery;
exports["default"] = AvFilesDelivery;

@@ -8,24 +8,45 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.array.join.js");
require("core-js/modules/es.array.map.js");
require("core-js/modules/es.object.keys.js");
require("core-js/modules/es.array.concat.js");
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var _flattenObject = _interopRequireDefault(require("../flattenObject"));
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var AvLogMessages = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvLogMessages, _AvApi);
class AvLogMessages extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
var _super = (0, _createSuper2["default"])(AvLogMessages);
function AvLogMessages(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvLogMessages);
var options = (0, _objectSpread2["default"])({
name: 'log-messages'
}, config);
super({
return _super.call(this, {
http: http,

@@ -38,28 +59,44 @@ promise: promise,

send(level, entries) {
delete entries.level;
return {
level: level,
entries: entries
};
}
(0, _createClass2["default"])(AvLogMessages, [{
key: "send",
value: function send(level, entries) {
delete entries.level;
var payload = {
level: level,
entries: entries
};
var flattened = (0, _flattenObject["default"])(payload);
flattened.X_Client_ID = this.clientId;
flattened.X_XSRF_TOKEN = document.cookie.replace(/(?:(?:^|.*;\s*)XSRF-TOKEN\s*=\s*([^;]*).*$)|^.*$/, '$1');
var fields = Object.keys(flattened).map(function (key) {
var name = key.replace(/\[\d+]/g, '[]');
var value = flattened[key];
return "".concat(name, "=").concat(encodeURIComponent(value));
}).join('&');
return fields;
}
}, {
key: "debug",
value: function debug(entries) {
return this.sendBeacon(this.send('debug', entries));
}
}, {
key: "info",
value: function info(entries) {
return this.sendBeacon(this.send('info', entries));
}
}, {
key: "warn",
value: function warn(entries) {
return this.sendBeacon(this.send('warn', entries));
}
}, {
key: "error",
value: function error(entries) {
return this.sendBeacon(this.send('error', entries));
}
}]);
return AvLogMessages;
}(_api["default"]);
debug(entries) {
return this.create(this.send('debug', entries));
}
info(entries) {
return this.create(this.send('info', entries));
}
warn(entries) {
return this.create(this.send('warn', entries));
}
error(entries) {
return this.create(this.send('error', entries));
}
}
exports.default = AvLogMessages;
exports["default"] = AvLogMessages;

@@ -8,25 +8,30 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvNavigation = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvNavigation, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvNavigation);
class AvNavigation extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvNavigation(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvNavigation);
var options = (0, _objectSpread2["default"])({
path: 'api/sdk/platform',
name: 'navigation/spaces'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,4 +44,5 @@ promise: promise,

}
return AvNavigation;
}(_api["default"]);
exports.default = AvNavigation;
exports["default"] = AvNavigation;

@@ -8,25 +8,32 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvNotifications = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvNotifications, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvNotifications);
class AvNotifications extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvNotifications(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvNotifications);
var options = (0, _objectSpread2["default"])({
path: 'api',
name: 'notifications'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,11 +46,14 @@ promise: promise,

deleteByTopic(topic, config) {
const removeConfig = this.addParams({
topicId: topic
}, config);
return this.remove(removeConfig);
}
(0, _createClass2["default"])(AvNotifications, [{
key: "deleteByTopic",
value: function deleteByTopic(topic, config) {
var removeConfig = this.addParams({
topicId: topic
}, config);
return this.remove(removeConfig);
}
}]);
return AvNotifications;
}(_api["default"]);
}
exports.default = AvNotifications;
exports["default"] = AvNotifications;

@@ -8,26 +8,107 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
require("core-js/modules/es.array.filter.js");
require("core-js/modules/es.array.concat.js");
require("core-js/modules/es.object.keys.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.match.js");
require("core-js/modules/web.dom-collections.for-each.js");
require("core-js/modules/es.array.iterator.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.set.js");
require("core-js/modules/es.string.iterator.js");
require("core-js/modules/esnext.set.add-all.js");
require("core-js/modules/esnext.set.delete-all.js");
require("core-js/modules/esnext.set.difference.js");
require("core-js/modules/esnext.set.every.js");
require("core-js/modules/esnext.set.filter.js");
require("core-js/modules/esnext.set.find.js");
require("core-js/modules/esnext.set.intersection.js");
require("core-js/modules/esnext.set.is-disjoint-from.js");
require("core-js/modules/esnext.set.is-subset-of.js");
require("core-js/modules/esnext.set.is-superset-of.js");
require("core-js/modules/esnext.set.join.js");
require("core-js/modules/esnext.set.map.js");
require("core-js/modules/esnext.set.reduce.js");
require("core-js/modules/esnext.set.some.js");
require("core-js/modules/esnext.set.symmetric-difference.js");
require("core-js/modules/esnext.set.union.js");
require("core-js/modules/web.dom-collections.iterator.js");
require("core-js/modules/es.array.map.js");
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _qs = _interopRequireDefault(require("qs"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
/* eslint-disable unicorn/consistent-destructuring */
var AvOrganizations = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvOrganizations, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvOrganizations);
class AvOrganizations extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
avUsers: avUsers,
config: config
}) {
const options = _objectSpread({
function AvOrganizations(_ref) {
var _this;
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
avUsers = _ref.avUsers,
avUserPermissions = _ref.avUserPermissions,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvOrganizations);
var options = (0, _objectSpread2["default"])({
path: 'api/sdk/platform',
name: 'organizations'
}, config);
super({
_this = _super.call(this, {
http: http,

@@ -38,26 +119,443 @@ promise: promise,

});
this.avUsers = avUsers;
}
_this.previousPermissionIds = [];
_this.previousRegionId = '';
_this.userPermissions = [];
_this.avUsers = avUsers;
_this.avUserPermissions = avUserPermissions;
return _this;
} // Instance variables to help with caching for filtered organizations
queryOrganizations(user, config) {
const queryConfig = this.addParams({
userId: user.id
}, config);
return this.query(queryConfig);
}
getOrganizations(config) {
if (config && config.params && config.params.userId) {
return this.query(config);
(0, _createClass2["default"])(AvOrganizations, [{
key: "queryOrganizations",
value: function queryOrganizations(user, config) {
var queryConfig = this.addParams({
userId: user.id
}, config);
return this.query(queryConfig);
}
}, {
key: "getOrganizations",
value: function getOrganizations(config) {
var _this2 = this;
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
if (config && config.params && config.params.userId) {
return this.query(config);
}
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
}
return this.avUsers.me().then(function (user) {
return _this2.queryOrganizations(user, config);
});
}
}, {
key: "postGet",
value: function () {
var _postGet = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data, config, additionalPostGetArgs) {
var permissionIds, dataTemp, region, _data, _region, _yield$_get$call, organizationsData, organizations, limit, offset, totalCount, authorizedOrgs, authorizedFilteredOrgs;
return this.avUsers.me().then(user => this.queryOrganizations(user, config));
}
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!additionalPostGetArgs) {
_context.next = 14;
break;
}
}
this.region = undefined;
permissionIds = additionalPostGetArgs.permissionIds;
exports.default = AvOrganizations;
if (typeof data === 'string') {
dataTemp = _qs["default"].parse(data);
region = dataTemp.region;
if (region) {
this.region = region;
delete dataTemp.region;
}
if (permissionIds) {
dataTemp.permissionId = permissionIds;
}
data = _qs["default"].stringify(dataTemp, {
arrayFormat: 'repeat'
});
} else if (typeof data === 'object') {
_data = data, _region = _data.region;
if (_region) {
this.region = _region;
delete data.region;
}
if (permissionIds) {
data.permissionId = permissionIds;
}
}
_context.next = 6;
return (0, _get2["default"])((0, _getPrototypeOf2["default"])(AvOrganizations.prototype), "postGet", this).call(this, data, config);
case 6:
_yield$_get$call = _context.sent;
organizationsData = _yield$_get$call.data;
organizations = organizationsData.organizations, limit = organizationsData.limit, offset = organizationsData.offset, totalCount = organizationsData.totalCount;
_context.next = 11;
return this.getFilteredOrganizations(additionalPostGetArgs, data);
case 11:
authorizedOrgs = _context.sent;
// avUserPermissions call doesn't return much useful organization data
// but we can match valid ids to useful data returned from avOrganizations
authorizedFilteredOrgs = organizations.filter(function (org) {
return authorizedOrgs.some(function (authOrg) {
return authOrg.id === org.id;
});
}); // Transform back into data object that ResourceSelect can use and paginate
return _context.abrupt("return", {
data: {
authorizedFilteredOrgs: authorizedFilteredOrgs,
totalCount: totalCount,
limit: limit,
offset: offset
}
});
case 14:
return _context.abrupt("return", (0, _get2["default"])((0, _getPrototypeOf2["default"])(AvOrganizations.prototype), "postGet", this).call(this, data, config));
case 15:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function postGet(_x, _x2, _x3) {
return _postGet.apply(this, arguments);
}
return postGet;
}()
}, {
key: "getFilteredOrganizations",
value: function () {
var _getFilteredOrganizations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(additionalPostGetArgs, data) {
var _this3 = this;
var _additionalPostGetArg, resourceIds, permissionIds, _data2, permissionId, region, permissionIdsToUse, resourceIdsToUse, resourceIdsArray, permissionIdsOR, _yield$this$avUserPer, userPermissions, authorizedOrgs, _i2, _Object$keys2, orgId;
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
// for filtered orgs, can pass both permissions and resources in postGetArgs, and we will use the permissionIds here over the data.permissionId
_additionalPostGetArg = additionalPostGetArgs.resourceIds, resourceIds = _additionalPostGetArg === void 0 ? [] : _additionalPostGetArg, permissionIds = additionalPostGetArgs.permissionIds;
if (typeof data === 'string') {
data = _qs["default"].parse(data);
}
_data2 = data, permissionId = _data2.permissionId;
region = this.region;
permissionIdsToUse = permissionIds || permissionId;
permissionIdsToUse = this.sanitizeIds(permissionIdsToUse);
resourceIdsToUse = this.sanitizeIds(resourceIds); // resourceIds is passed as readOnly, convert so that we can use Array methods on it
resourceIdsArray = Array.isArray(resourceIdsToUse) ? resourceIdsToUse : [resourceIdsToUse];
permissionIdsOR = Array.isArray(permissionIdsToUse) ? permissionIdsToUse : [permissionIdsToUse];
if (!(region !== this.previousRegionId || !this.arePermissionsEqual(permissionIdsOR))) {
_context2.next = 21;
break;
}
_context2.next = 12;
return this.avUserPermissions.postGet({
permissionId: permissionIdsOR,
region: region
});
case 12:
_yield$this$avUserPer = _context2.sent;
userPermissions = _yield$this$avUserPer.data.axiUserPermissions;
if (!userPermissions) {
_context2.next = 20;
break;
}
this.userPermissions = userPermissions.reduce(function (accum, cur) {
accum[cur.id] = cur;
return accum;
}, {});
this.previousPermissionIds = permissionIdsOR;
this.previousRegionId = region;
_context2.next = 21;
break;
case 20:
throw new Error('avUserPermissions call failed');
case 21:
// loop thru the permissionId list of ORs, finding and adding matching orgs in the userPermissions. ANDs are beneath/within the ORs
authorizedOrgs = permissionIdsOR.reduce(function (accum, permissionIdOR) {
if (Array.isArray(permissionIdOR)) {
var matchedOrgs = permissionIdOR.reduce(function (matchedANDOrgsByPerm, permissionIdAND, index) {
if (_this3.userPermissions[permissionIdAND]) {
var _iterator = (0, _createForOfIteratorHelper2["default"])(_this3.userPermissions[permissionIdAND].organizations),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var org = _step.value;
if (index === 0) {
// add the orgs for the first permission
matchedANDOrgsByPerm[org.id] = org;
} else if (matchedANDOrgsByPerm[org.id]) {
// if duplicate, add resources
matchedANDOrgsByPerm[org.id].resources = [].concat((0, _toConsumableArray2["default"])(matchedANDOrgsByPerm[org.id].resources), (0, _toConsumableArray2["default"])(org.resources));
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
} // filter unmatched orgs out
matchedANDOrgsByPerm = Object.keys(matchedANDOrgsByPerm).filter(function (orgId) {
if (_this3.userPermissions[permissionIdAND]) {
return _this3.userPermissions[permissionIdAND].organizations.some(function (org) {
return org.id === orgId;
});
}
return false;
}).reduce(function (obj, orgId) {
obj[orgId] = matchedANDOrgsByPerm[orgId];
return obj;
}, {});
return matchedANDOrgsByPerm;
}, {});
for (var _i = 0, _Object$keys = Object.keys(matchedOrgs); _i < _Object$keys.length; _i++) {
var orgId = _Object$keys[_i];
if (!accum[orgId]) {
accum[orgId] = matchedOrgs[orgId];
accum[orgId].match = false;
}
}
} else if (_this3.userPermissions[permissionIdOR]) {
var _iterator2 = (0, _createForOfIteratorHelper2["default"])(_this3.userPermissions[permissionIdOR].organizations),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var org = _step2.value;
if (!accum[org.id]) {
accum[org.id] = org;
accum[org.id].match = false;
} else {
// add the resources
accum[org.id].resources = [].concat((0, _toConsumableArray2["default"])(accum[org.id].resources), (0, _toConsumableArray2["default"])(org.resources));
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
return accum;
}, {}); // loop thru the orgs from permission filtering and check resourceIds list to further filter
if (resourceIdsArray.length === 0) {
for (_i2 = 0, _Object$keys2 = Object.keys(authorizedOrgs); _i2 < _Object$keys2.length; _i2++) {
orgId = _Object$keys2[_i2];
authorizedOrgs[orgId].match = true;
}
} else {
// TODO: fix test when refactoring to for...of
// eslint-disable-next-line unicorn/no-array-for-each
resourceIdsArray.forEach(function (resourceIdOR) {
if (Array.isArray(resourceIdOR)) {
var _loop = function _loop() {
var orgId = _Object$keys3[_i3];
if (authorizedOrgs[orgId]) {
var isMatch = resourceIdOR.every(function (resId) {
return authorizedOrgs[orgId].resources.some(function (res) {
return res.id === resId;
});
});
if (isMatch) {
authorizedOrgs[orgId].match = true;
}
}
};
// there is AND logic
for (var _i3 = 0, _Object$keys3 = Object.keys(authorizedOrgs); _i3 < _Object$keys3.length; _i3++) {
_loop();
}
} else {
for (var _i4 = 0, _Object$keys4 = Object.keys(authorizedOrgs); _i4 < _Object$keys4.length; _i4++) {
var _orgId = _Object$keys4[_i4];
var isMatch = authorizedOrgs[_orgId].resources.some(function (res) {
return res.id === resourceIdOR;
});
if (isMatch || !resourceIdOR) {
authorizedOrgs[_orgId].match = true;
}
}
}
}, {});
}
return _context2.abrupt("return", Object.keys(authorizedOrgs).reduce(function (accum, orgId) {
if (authorizedOrgs[orgId].match) {
accum.push(authorizedOrgs[orgId]);
}
return accum;
}, []));
case 24:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function getFilteredOrganizations(_x4, _x5) {
return _getFilteredOrganizations.apply(this, arguments);
}
return getFilteredOrganizations;
}()
}, {
key: "arePermissionsEqual",
value: function arePermissionsEqual(permissionId) {
// handle nested arrays by collecting all permission values for both new and previous, then Set-ing them
var permissionArray = [];
if (typeof permissionId === 'string' || typeof permissionId === 'number') {
permissionArray.push(permissionId);
} else if (Array.isArray(permissionId)) {
var _iterator3 = (0, _createForOfIteratorHelper2["default"])(permissionId),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var permissionOR = _step3.value;
if (Array.isArray(permissionOR)) {
var _iterator4 = (0, _createForOfIteratorHelper2["default"])(permissionOR),
_step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
var permissionAND = _step4.value;
permissionArray.push(permissionAND);
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
} else {
permissionArray.push(permissionOR);
}
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
}
var prevPermissionArray = [];
if (typeof this.previousPermissionIds === 'string' || typeof this.previousPermissionIds === 'number') {
prevPermissionArray.push(this.previousPermissionIds);
} else if (Array.isArray(this.previousPermissionIds)) {
var _iterator5 = (0, _createForOfIteratorHelper2["default"])(this.previousPermissionIds),
_step5;
try {
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
var _permissionOR = _step5.value;
if (Array.isArray(_permissionOR)) {
var _iterator6 = (0, _createForOfIteratorHelper2["default"])(_permissionOR),
_step6;
try {
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
var _permissionAND = _step6.value;
prevPermissionArray.push(_permissionAND);
}
} catch (err) {
_iterator6.e(err);
} finally {
_iterator6.f();
}
} else {
prevPermissionArray.push(_permissionOR);
}
}
} catch (err) {
_iterator5.e(err);
} finally {
_iterator5.f();
}
}
var idSet = new Set([].concat(permissionArray));
var idSetPrev = new Set([].concat(prevPermissionArray));
var idSetCombined = new Set([].concat(permissionArray, prevPermissionArray));
return idSet.size === idSetPrev.size && idSet.size === idSetCombined.size;
}
}, {
key: "sanitizeIds",
value: function sanitizeIds(unsanitized) {
var _this4 = this;
if (typeof unsanitized === 'string') {
return unsanitized;
}
if (typeof unsanitized === 'number') {
return "".concat(unsanitized);
}
if (Array.isArray(unsanitized)) {
return unsanitized.map(function (dirty) {
return _this4.sanitizeIds(dirty);
});
}
throw new TypeError('permission/resourcesId(s) must be either an array of ids, a string, or a number');
}
}]);
return AvOrganizations;
}(_api["default"]);
exports["default"] = AvOrganizations;

@@ -8,25 +8,32 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvPdfs = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvPdfs, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvPdfs);
class AvPdfs extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvPdfs(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvPdfs);
var options = (0, _objectSpread2["default"])({
path: 'api/utils',
name: 'pdfs'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,16 +46,20 @@ promise: promise,

onPdf(response) {
window.location = response.data.pdf.href;
}
(0, _createClass2["default"])(AvPdfs, [{
key: "onPdf",
value: function onPdf(response) {
window.location = response.data.links.pdf.href;
}
}, {
key: "getPdf",
value: function getPdf(data, config) {
if (!data.applicationId || !data.fileName || !data.html) {
throw new Error('[applicationId], [fileName] and [html] must be defined');
}
getPdf(data, config) {
if (!data.applicationId || !data.fileName || !data.html) {
throw new Error('[applicationId], [fileName] and [html] must be defined');
return this.post(data, config).then(this.onPdf);
}
}]);
return AvPdfs;
}(_api["default"]);
return this.post(data, config).then(this.onPdf);
}
}
exports.default = AvPdfs;
exports["default"] = AvPdfs;

@@ -8,25 +8,32 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvPermissions = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvPermissions, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvPermissions);
class AvPermissions extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvPermissions(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvPermissions);
var options = (0, _objectSpread2["default"])({
path: 'api/sdk/platform',
name: 'permissions'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,13 +46,16 @@ promise: promise,

getPermissions(id, region) {
return this.query({
params: {
id: id,
region: region
}
});
}
(0, _createClass2["default"])(AvPermissions, [{
key: "getPermissions",
value: function getPermissions(id, region) {
return this.query({
params: {
id: id,
region: region
}
});
}
}]);
return AvPermissions;
}(_api["default"]);
}
exports.default = AvPermissions;
exports["default"] = AvPermissions;

@@ -8,25 +8,40 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
require("core-js/modules/es.function.name.js");
require("core-js/modules/es.array.concat.js");
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvProviders = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvProviders, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvProviders);
class AvProviders extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvProviders(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvProviders);
var options = (0, _objectSpread2["default"])({
path: 'api/internal',
name: 'providers'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,19 +54,35 @@ promise: promise,

getProviders(customerId, config) {
const queryConfig = this.addParams({
customerId: customerId
}, config);
return this.query(queryConfig);
}
(0, _createClass2["default"])(AvProviders, [{
key: "getProviders",
value: function getProviders(customerId, config) {
var queryConfig = this.addParams({
customerId: customerId
}, config);
return this.query(queryConfig);
}
}, {
key: "normalize",
value: function normalize(providers) {
var cloned = (0, _toConsumableArray2["default"])(providers);
normalize(providers) {
const cloned = providers.slice();
cloned.forEach(provider => {
provider.name = provider.businessName ? provider.businessName : `${provider.lastName}, ${provider.firstName}`;
});
return cloned;
}
var _iterator = (0, _createForOfIteratorHelper2["default"])(cloned),
_step;
}
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var provider = _step.value;
provider.name = provider.businessName ? provider.businessName : "".concat(provider.lastName, ", ").concat(provider.firstName);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
exports.default = AvProviders;
return cloned;
}
}]);
return AvProviders;
}(_api["default"]);
exports["default"] = AvProviders;

@@ -8,19 +8,26 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvProxy = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvProxy, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvProxy);
class AvProxy extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
function AvProxy(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvProxy);
if (!config || !config.tenant) {

@@ -30,8 +37,7 @@ throw new Error('Must specify tenant name for Proxy');

const options = _objectSpread({
path: `api/v1/proxy/${config.tenant}`,
var options = (0, _objectSpread2["default"])({
path: "api/v1/proxy/".concat(config.tenant),
version: ''
}, config);
super({
return _super.call(this, {
http: http,

@@ -44,4 +50,5 @@ promise: promise,

}
return AvProxy;
}(_api["default"]);
exports.default = AvProxy;
exports["default"] = AvProxy;

@@ -8,21 +8,31 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvRegions = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvRegions, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvRegions);
class AvRegions extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
avUsers: avUsers,
config: config
}) {
const options = _objectSpread({
function AvRegions(_ref) {
var _this;
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
avUsers = _ref.avUsers,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvRegions);
var options = (0, _objectSpread2["default"])({
path: 'api/sdk/platform',

@@ -33,4 +43,3 @@ name: 'regions',

}, config);
super({
_this = _super.call(this, {
http: http,

@@ -41,33 +50,46 @@ promise: promise,

});
this.avUsers = avUsers;
_this.avUsers = avUsers;
return _this;
}
afterUpdate(response) {
this.setPageBust();
return response;
}
getRegions(config) {
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
(0, _createClass2["default"])(AvRegions, [{
key: "afterUpdate",
value: function afterUpdate(response) {
this.setPageBust();
return response;
}
}, {
key: "getRegions",
value: function getRegions(config) {
var _this2 = this;
return this.avUsers.me().then(user => {
const queryConfig = this.addParams({
userId: user.id
}, config);
return this.query(queryConfig);
});
}
if (config && config.params && config.params.userId) {
return this.query(config);
}
getCurrentRegion() {
return this.query({
params: {
currentlySelected: true
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
}
});
}
}
return this.avUsers.me().then(function (user) {
var queryConfig = _this2.addParams({
userId: user.id
}, config);
exports.default = AvRegions;
return _this2.query(queryConfig);
});
}
}, {
key: "getCurrentRegion",
value: function getCurrentRegion() {
return this.query({
params: {
currentlySelected: true
}
});
}
}]);
return AvRegions;
}(_api["default"]);
exports["default"] = AvRegions;

@@ -8,21 +8,31 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvSettings = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvSettings, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvSettings);
class AvSettings extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
avUsers: avUsers,
config: config
}) {
const options = _objectSpread({
function AvSettings(_ref) {
var _this;
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
avUsers = _ref.avUsers,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvSettings);
var options = (0, _objectSpread2["default"])({
path: 'api/utils',

@@ -33,4 +43,3 @@ name: 'settings',

}, config);
super({
_this = _super.call(this, {
http: http,

@@ -41,61 +50,71 @@ promise: promise,

});
this.avUsers = avUsers;
_this.avUsers = avUsers;
return _this;
}
getApplication(applicationId, config) {
if (!applicationId) {
throw new Error('applicationId must be defined');
}
(0, _createClass2["default"])(AvSettings, [{
key: "getApplication",
value: function getApplication(applicationId, config) {
var _this2 = this;
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
}
if (!applicationId) {
throw new Error('applicationId must be defined');
}
if (config && config.params && config.params.userId) {
const queryConfig = this.addParams({
applicationId: applicationId
}, config);
return this.query(queryConfig);
}
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
}
return this.avUsers.me().then(user => {
const queryConfig = this.addParams({
applicationId: applicationId,
userId: user.id
}, config);
return this.query(queryConfig);
});
}
if (config && config.params && config.params.userId) {
var queryConfig = this.addParams({
applicationId: applicationId
}, config);
return this.query(queryConfig);
}
setApplication(applicationId, data, config) {
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
}
return this.avUsers.me().then(function (user) {
var queryConfig = _this2.addParams({
applicationId: applicationId,
userId: user.id
}, config);
if (typeof applicationId !== 'string' && typeof applicationId !== 'number') {
config = data;
data = applicationId;
applicationId = '';
return _this2.query(queryConfig);
});
}
}, {
key: "setApplication",
value: function setApplication(applicationId, data, config) {
var _this3 = this;
if (!applicationId && (!data || !data.scope || !data.scope.applicationId)) {
throw new Error('applicationId must be defined');
}
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
}
if (data && data.scope && data.scope.userId) {
data.scope.applicationId = applicationId;
return this.update(data, config);
}
if (typeof applicationId !== 'string' && typeof applicationId !== 'number') {
config = data;
data = applicationId;
applicationId = '';
}
return this.avUsers.me().then(user => {
data = data || {};
data.scope = data.scope || {};
data.scope.applicationId = applicationId;
data.scope.userId = user.id;
return this.update(data, config);
});
}
if (!applicationId && (!data || !data.scope || !data.scope.applicationId)) {
throw new Error('applicationId must be defined');
}
}
if (data && data.scope && data.scope.userId) {
data.scope.applicationId = applicationId;
return this.update(data, config);
}
exports.default = AvSettings;
return this.avUsers.me().then(function (user) {
data = data || {};
data.scope = data.scope || {};
data.scope.applicationId = applicationId;
data.scope.userId = user.id;
return _this3.update(data, config);
});
}
}]);
return AvSettings;
}(_api["default"]);
exports["default"] = AvSettings;

@@ -8,24 +8,31 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _ms = _interopRequireDefault(require("../ms"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvSlotMachine = /*#__PURE__*/function (_AvMicroservice) {
(0, _inherits2["default"])(AvSlotMachine, _AvMicroservice);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvSlotMachine);
class AvSlotMachine extends _ms.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvSlotMachine(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvSlotMachine);
var options = (0, _objectSpread2["default"])({
name: 'spc/slotmachine/graphql'
}, config);
super({
return _super.call(this, {
http: http,

@@ -38,11 +45,14 @@ promise: promise,

query(data, variables) {
return this.create({
query: data,
variables: variables
});
}
(0, _createClass2["default"])(AvSlotMachine, [{
key: "query",
value: function query(data, variables) {
return this.create({
query: data,
variables: variables
});
}
}]);
return AvSlotMachine;
}(_ms["default"]);
}
exports.default = AvSlotMachine;
exports["default"] = AvSlotMachine;

@@ -8,25 +8,40 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.split.js");
require("core-js/modules/es.function.name.js");
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvSpaces = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvSpaces, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvSpaces);
class AvSpaces extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvSpaces(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvSpaces);
var options = (0, _objectSpread2["default"])({
path: 'api/sdk/platform',
name: 'spaces'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,30 +54,46 @@ promise: promise,

parseSpaceId(query) {
const pairs = query.substr(1).split('&');
let spaceId = '';
(0, _createClass2["default"])(AvSpaces, [{
key: "parseSpaceId",
value: function parseSpaceId(query) {
var pairs = query.substr(1).split('&');
var spaceId = '';
if (Array.isArray(pairs)) {
pairs.forEach(item => {
const pair = item.split('=');
const key = pair[0];
if (Array.isArray(pairs)) {
var _iterator = (0, _createForOfIteratorHelper2["default"])(pairs),
_step;
if (key === 'spaceId') {
spaceId = pair[1] && decodeURIComponent(pair[1]);
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var item = _step.value;
var pair = item.split('=');
var key = pair[0];
if (key === 'spaceId') {
spaceId = pair[1] && decodeURIComponent(pair[1]);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
});
}
return spaceId;
}
}, {
key: "getSpaceName",
value: function getSpaceName(spaceId) {
if (!spaceId) {
throw new Error('[spaceId] must be defined');
}
return spaceId;
}
getSpaceName(spaceId) {
if (!spaceId) {
throw new Error('[spaceId] must be defined');
return this.get(spaceId).then(function (response) {
return response.data.name;
});
}
}]);
return AvSpaces;
}(_api["default"]);
return this.get(spaceId).then(response => response.data.name);
}
}
exports.default = AvSpaces;
exports["default"] = AvSpaces;

@@ -8,25 +8,32 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _api = _interopRequireDefault(require("../api"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvUsers = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvUsers, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvUsers);
class AvUsers extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvUsers(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvUsers);
var options = (0, _objectSpread2["default"])({
path: 'api/sdk/platform',
name: 'users'
}, config);
super({
return _super.call(this, {
http: http,

@@ -39,8 +46,13 @@ promise: promise,

me(config) {
return this.get('me', config).then(response => response.data);
}
(0, _createClass2["default"])(AvUsers, [{
key: "me",
value: function me(config) {
return this.get('me', config).then(function (response) {
return response.data;
});
}
}]);
return AvUsers;
}(_api["default"]);
}
exports.default = AvUsers;
exports["default"] = AvUsers;

@@ -8,6 +8,14 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _qs = _interopRequireDefault(require("qs"));

@@ -17,22 +25,23 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvUserPermissions = /*#__PURE__*/function (_AvApi) {
(0, _inherits2["default"])(AvUserPermissions, _AvApi);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvUserPermissions);
class AvUserPermissions extends _api.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvUserPermissions(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvUserPermissions);
var options = (0, _objectSpread2["default"])({
path: 'api/internal',
name: 'axi-user-permissions',
paramsSerializer: params => _qs.default.stringify(params, {
arrayFormat: 'repeat'
})
paramsSerializer: function paramsSerializer(params) {
return _qs["default"].stringify(params, {
arrayFormat: 'repeat'
});
}
}, config);
super({
return _super.call(this, {
http: http,

@@ -45,17 +54,21 @@ promise: promise,

afterQuery(response) {
return response && response.data && response.data.axiUserPermissions ? response.data.axiUserPermissions : [];
}
(0, _createClass2["default"])(AvUserPermissions, [{
key: "afterQuery",
value: function afterQuery(response) {
return response && response.data && response.data.axiUserPermissions ? response.data.axiUserPermissions : [];
}
}, {
key: "getPermissions",
value: function getPermissions(permissionId, region) {
return this.query({
params: {
permissionId: permissionId,
region: region
}
});
}
}]);
return AvUserPermissions;
}(_api["default"]);
getPermissions(permissionId, region) {
return this.query({
params: {
permissionId: permissionId,
region: region
}
});
}
}
exports.default = AvUserPermissions;
exports["default"] = AvUserPermissions;

@@ -8,24 +8,29 @@ "use strict";

});
exports.default = void 0;
exports["default"] = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _ms = _interopRequireDefault(require("../ms"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
var AvWebQL = /*#__PURE__*/function (_AvMicroservice) {
(0, _inherits2["default"])(AvWebQL, _AvMicroservice);
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var _super = (0, _createSuper2["default"])(AvWebQL);
class AvWebQL extends _ms.default {
constructor({
http: http,
promise: promise,
merge: merge,
config: config
}) {
const options = _objectSpread({
function AvWebQL(_ref) {
var http = _ref.http,
promise = _ref.promise,
merge = _ref.merge,
config = _ref.config;
(0, _classCallCheck2["default"])(this, AvWebQL);
var options = (0, _objectSpread2["default"])({
name: 'spc/web/graphql'
}, config);
super({
return _super.call(this, {
http: http,

@@ -38,4 +43,5 @@ promise: promise,

}
return AvWebQL;
}(_ms["default"]);
exports.default = AvWebQL;
exports["default"] = AvWebQL;
{
"name": "@availity/api-core",
"version": "7.0.0-alpha.10+8e4e32a",
"version": "7.0.0",
"description": "Base API definitions for the Availity REST API",

@@ -21,6 +21,9 @@ "keywords": [

"dependencies": {
"@availity/resolve-url": "^2.0.0-alpha.27+8e4e32a",
"@availity/env-var": "^1.11.1",
"@availity/resolve-url": "^1.1.21",
"@babel/runtime": "^7.10.2",
"core-js": "^3.12.1",
"qs": "^6.5.2"
},
"gitHead": "8e4e32a30771beef013cc5d28e2994b1a209fac0"
"gitHead": "4e1d7493ccf0ba9e776476efc86088f4324618cd"
}
# api-core
> Base API definitions for the Availity REST API.

@@ -6,2 +7,16 @@

## Install
### NPM
```bash
$ npm install @availity/api-core
```
### Yarn
```bash
$ yarn add @availity/api-core
```
## [Documentation](https://availity.github.io/sdk-js/api/getting-started)

@@ -0,1 +1,2 @@

/* eslint-disable promise/no-nesting */
import qs from 'qs';

@@ -5,2 +6,3 @@ import resolveUrl from '@availity/resolve-url';

import API_OPTIONS from './options';
import resolveHost from './resolve-host';

@@ -103,15 +105,12 @@ export default class AvApi {

const { path, version, name, url } = config;
const { path, version, name, url, host } = config;
let parts = [];
if (name) {
parts = ['', path, version, name, id];
} else {
parts = [url, id];
}
parts = name ? ['', path, version, name, id] : [url, id];
// join parts, remove multiple /'s and trailing /
return parts
.join('/')
.replace(/[/]+/g, '/')
.replace(/\/$/, '');
const uri = parts.join('/').replace(/\/+/g, '/').replace(/\/$/, '');
const hostname = url ? null : resolveHost(host, config.window || window);
return (hostname ? `https://${hostname}` : '') + uri;
}

@@ -125,3 +124,2 @@

getLocation(response) {
let locationUrl;
const { config, headers = {} } = response;

@@ -131,7 +129,5 @@ const { getHeader, base } = config;

if (getHeader) {
locationUrl = getHeader(response, 'Location');
} else {
locationUrl = location || Location;
}
const locationUrl = getHeader
? getHeader(response, 'Location')
: location || Location;

@@ -162,3 +158,3 @@ return resolveUrl({ relative: locationUrl, base });

newConfig.cache = false;
return new this.Promise(resolve => {
return new this.Promise((resolve) => {
setTimeout(

@@ -182,3 +178,3 @@ resolve,

return this.http(config).then(response =>
return this.http(config).then((response) =>
this.onResponse(response, afterResponse)

@@ -206,2 +202,30 @@ );

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,
new Blob([config.data], {
type: 'application/x-www-form-urlencoded',
})
);
// 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) {

@@ -263,3 +287,3 @@ return this.create(data, config);

all(config) {
return this.query(config).then(resp => {
return this.query(config).then((resp) => {
const key = this.getQueryResultKey(resp.data);

@@ -273,10 +297,9 @@ const totalPages = Math.ceil(resp.data.totalCount / resp.data.limit);

}
/* eslint-disable promise/no-nesting */
return this.Promise.all(
otherPages.map(page =>
otherPages.map((page) =>
this.getPage(page, config, resp.data.limit).then(
pageResp => pageResp.data[key] || []
(pageResp) => pageResp.data[key] || []
)
)
).then(pages => result.concat(...pages));
).then((pages) => [...result, ...pages]);
}

@@ -288,3 +311,3 @@ return result;

getQueryResultKey(data) {
return Object.keys(data).filter(key => Array.isArray(data[key]))[0];
return Object.keys(data).find((key) => Array.isArray(data[key]));
}

@@ -325,2 +348,22 @@

// patch request
patch(id, data, config) {
if (typeof id !== 'string' && typeof id !== 'number') {
config = data;
data = id;
id = '';
}
config = this.config(config);
config.method = 'PATCH';
config.url = this.getUrl(config, id);
config.data = data;
const beforeFunc = this.beforePatch;
if (beforeFunc) {
config.data = beforeFunc(config.data);
}
return this.request(config, this.afterPatch);
}
// delete request

@@ -327,0 +370,0 @@ remove(id, config) {

import AvApi from './api';
import API_OPTIONS from './options';
import resolveHost from './resolve-host';

@@ -22,6 +23,9 @@ export default class AvMicroservice extends AvApi {

}
return parts
const uri = parts
.join('/')
.replace(/[/]+/g, '/')
.replace(/\/+/g, '/')
.replace(/\/$/, '');
const hostname = resolveHost(config.host, config.window || window);
return (hostname ? `https://${hostname}` : '') + uri;
}

@@ -28,0 +32,0 @@

@@ -34,2 +34,5 @@ const API_OPTIONS = {

sessionBust: true,
// send credentials on CORS requests
withCredentials: true,
},

@@ -68,2 +71,5 @@ MS: {

sessionBust: false,
// send credentials on CORS requests
withCredentials: true,
},

@@ -70,0 +76,0 @@ };

@@ -0,9 +1,8 @@

import flattenObject from '@availity/api-core/lib/flattenObject';
import AvMicroservice from '../ms';
export default class AvLogMessages extends AvMicroservice {
class DmaLogMessages extends AvMicroservice {
constructor({ http, promise, merge, config }) {
const options = {
path: '/ms/api/availity/internal/dma/log-message-service/portal',
name: 'log-messages',
version: '/v2',
name: 'spc/analytics/log',
...config,

@@ -19,5 +18,41 @@ };

send(entries) {
return this.create(entries);
send(level, entries) {
delete entries.level;
const payload = { level, entries };
const flattened = flattenObject(payload);
flattened.X_Client_ID = this.clientId;
flattened.X_XSRF_TOKEN = document.cookie.replace(
/(?:(?:^|.*;\s*)XSRF-TOKEN\s*=\s*([^;]*).*$)|^.*$/,
'$1'
);
const fields = Object.keys(flattened)
.map(key => {
const name = key.replace(/\[\d+]/g, '[]');
const value = flattened[key];
return `${name}=${encodeURIComponent(value)}`;
})
.join('&');
return fields;
}
debug(entries) {
return this.sendBeacon(this.send('debug', entries));
}
info(entries) {
return this.sendBeacon(this.send('info', entries));
}
warn(entries) {
return this.sendBeacon(this.send('warn', entries));
}
error(entries) {
return this.sendBeacon(this.send('error', entries));
}
}
export default DmaLogMessages;

@@ -36,5 +36,5 @@ import AvMicroservice from '../ms';

getLocation(response) {
const baseUrl = super.getLocation(response.config);
const baseUrl = super.getLocation(response);
return `${baseUrl}/${response.data.id}`;
}
}
import AvApi from '../api';
import flattenObject from '../flattenObject';

@@ -19,20 +20,37 @@ export default class AvLogMessages extends AvApi {

delete entries.level;
return { level, entries };
const payload = { level, entries };
const flattened = flattenObject(payload);
flattened.X_Client_ID = this.clientId;
flattened.X_XSRF_TOKEN = document.cookie.replace(
/(?:(?:^|.*;\s*)XSRF-TOKEN\s*=\s*([^;]*).*$)|^.*$/,
'$1'
);
const fields = Object.keys(flattened)
.map(key => {
const name = key.replace(/\[\d+]/g, '[]');
const value = flattened[key];
return `${name}=${encodeURIComponent(value)}`;
})
.join('&');
return fields;
}
debug(entries) {
return this.create(this.send('debug', entries));
return this.sendBeacon(this.send('debug', entries));
}
info(entries) {
return this.create(this.send('info', entries));
return this.sendBeacon(this.send('info', entries));
}
warn(entries) {
return this.create(this.send('warn', entries));
return this.sendBeacon(this.send('warn', entries));
}
error(entries) {
return this.create(this.send('error', entries));
return this.sendBeacon(this.send('error', entries));
}
}

@@ -0,5 +1,7 @@

/* eslint-disable unicorn/consistent-destructuring */
import qs from 'qs';
import AvApi from '../api';
export default class AvOrganizations extends AvApi {
constructor({ http, promise, merge, avUsers, config }) {
constructor({ http, promise, merge, avUsers, avUserPermissions, config }) {
const options = {

@@ -18,4 +20,12 @@ path: 'api/sdk/platform',

this.avUsers = avUsers;
this.avUserPermissions = avUserPermissions;
}
// Instance variables to help with caching for filtered organizations
previousPermissionIds = [];
previousRegionId = '';
userPermissions = [];
queryOrganizations(user, config) {

@@ -37,4 +47,268 @@ const queryConfig = this.addParams({ userId: user.id }, config);

.me()
.then(user => this.queryOrganizations(user, config));
.then((user) => this.queryOrganizations(user, config));
}
async postGet(data, config, additionalPostGetArgs) {
if (additionalPostGetArgs) {
this.region = undefined;
const { permissionIds } = additionalPostGetArgs;
if (typeof data === 'string') {
const dataTemp = qs.parse(data);
const { region } = dataTemp;
if (region) {
this.region = region;
delete dataTemp.region;
}
if (permissionIds) {
dataTemp.permissionId = permissionIds;
}
data = qs.stringify(dataTemp, { arrayFormat: 'repeat' });
} else if (typeof data === 'object') {
const { region } = data;
if (region) {
this.region = region;
delete data.region;
}
if (permissionIds) {
data.permissionId = permissionIds;
}
}
const { data: organizationsData } = await super.postGet(data, config);
const { organizations, limit, offset, totalCount } = organizationsData;
const authorizedOrgs = await this.getFilteredOrganizations(
additionalPostGetArgs,
data
);
// avUserPermissions call doesn't return much useful organization data
// but we can match valid ids to useful data returned from avOrganizations
const authorizedFilteredOrgs = organizations.filter((org) =>
authorizedOrgs.some((authOrg) => authOrg.id === org.id)
);
// Transform back into data object that ResourceSelect can use and paginate
return {
data: {
authorizedFilteredOrgs,
totalCount,
limit,
offset,
},
};
}
// Else return normal organizations call
return super.postGet(data, config);
}
async getFilteredOrganizations(additionalPostGetArgs, data) {
// for filtered orgs, can pass both permissions and resources in postGetArgs, and we will use the permissionIds here over the data.permissionId
const { resourceIds = [], permissionIds } = additionalPostGetArgs;
if (typeof data === 'string') {
data = qs.parse(data);
}
const { permissionId } = data;
const { region } = this;
let permissionIdsToUse = permissionIds || permissionId;
permissionIdsToUse = this.sanitizeIds(permissionIdsToUse);
const resourceIdsToUse = this.sanitizeIds(resourceIds);
// resourceIds is passed as readOnly, convert so that we can use Array methods on it
const resourceIdsArray = Array.isArray(resourceIdsToUse)
? resourceIdsToUse
: [resourceIdsToUse];
const permissionIdsOR = Array.isArray(permissionIdsToUse)
? permissionIdsToUse
: [permissionIdsToUse];
if (
region !== this.previousRegionId ||
!this.arePermissionsEqual(permissionIdsOR)
) {
// avUserPermissions will return a list of user organizations that match given permission and region
// This call does not need to be paginated and
// we should not need to call it every time we paginate orgs if region and permissions are the same
const {
data: { axiUserPermissions: userPermissions },
} = await this.avUserPermissions.postGet({
permissionId: permissionIdsOR,
region,
});
if (userPermissions) {
this.userPermissions = userPermissions.reduce((accum, cur) => {
accum[cur.id] = cur;
return accum;
}, {});
this.previousPermissionIds = permissionIdsOR;
this.previousRegionId = region;
} else {
throw new Error('avUserPermissions call failed');
}
}
// loop thru the permissionId list of ORs, finding and adding matching orgs in the userPermissions. ANDs are beneath/within the ORs
const authorizedOrgs = permissionIdsOR.reduce((accum, permissionIdOR) => {
if (Array.isArray(permissionIdOR)) {
const matchedOrgs = permissionIdOR.reduce(
(matchedANDOrgsByPerm, permissionIdAND, index) => {
if (this.userPermissions[permissionIdAND]) {
for (const org of this.userPermissions[permissionIdAND]
.organizations) {
if (index === 0) {
// add the orgs for the first permission
matchedANDOrgsByPerm[org.id] = org;
} else if (matchedANDOrgsByPerm[org.id]) {
// if duplicate, add resources
matchedANDOrgsByPerm[org.id].resources = [
...matchedANDOrgsByPerm[org.id].resources,
...org.resources,
];
}
}
}
// filter unmatched orgs out
matchedANDOrgsByPerm = Object.keys(matchedANDOrgsByPerm)
.filter((orgId) => {
if (this.userPermissions[permissionIdAND]) {
return this.userPermissions[
permissionIdAND
].organizations.some((org) => org.id === orgId);
}
return false;
})
.reduce((obj, orgId) => {
obj[orgId] = matchedANDOrgsByPerm[orgId];
return obj;
}, {});
return matchedANDOrgsByPerm;
},
{}
);
for (const orgId of Object.keys(matchedOrgs)) {
if (!accum[orgId]) {
accum[orgId] = matchedOrgs[orgId];
accum[orgId].match = false;
}
}
} else if (this.userPermissions[permissionIdOR]) {
for (const org of this.userPermissions[permissionIdOR].organizations) {
if (!accum[org.id]) {
accum[org.id] = org;
accum[org.id].match = false;
} else {
// add the resources
accum[org.id].resources = [
...accum[org.id].resources,
...org.resources,
];
}
}
}
return accum;
}, {});
// loop thru the orgs from permission filtering and check resourceIds list to further filter
if (resourceIdsArray.length === 0) {
for (const orgId of Object.keys(authorizedOrgs)) {
authorizedOrgs[orgId].match = true;
}
} else {
// TODO: fix test when refactoring to for...of
// eslint-disable-next-line unicorn/no-array-for-each
resourceIdsArray.forEach((resourceIdOR) => {
if (Array.isArray(resourceIdOR)) {
// there is AND logic
for (const orgId of Object.keys(authorizedOrgs)) {
if (authorizedOrgs[orgId]) {
const isMatch = resourceIdOR.every((resId) =>
authorizedOrgs[orgId].resources.some((res) => res.id === resId)
);
if (isMatch) {
authorizedOrgs[orgId].match = true;
}
}
}
} else {
for (const orgId of Object.keys(authorizedOrgs)) {
const isMatch = authorizedOrgs[orgId].resources.some(
(res) => res.id === resourceIdOR
);
if (isMatch || !resourceIdOR) {
authorizedOrgs[orgId].match = true;
}
}
}
}, {});
}
return Object.keys(authorizedOrgs).reduce((accum, orgId) => {
if (authorizedOrgs[orgId].match) {
accum.push(authorizedOrgs[orgId]);
}
return accum;
}, []);
}
arePermissionsEqual(permissionId) {
// handle nested arrays by collecting all permission values for both new and previous, then Set-ing them
const permissionArray = [];
if (typeof permissionId === 'string' || typeof permissionId === 'number') {
permissionArray.push(permissionId);
} else if (Array.isArray(permissionId)) {
for (const permissionOR of permissionId) {
if (Array.isArray(permissionOR)) {
for (const permissionAND of permissionOR) {
permissionArray.push(permissionAND);
}
} else {
permissionArray.push(permissionOR);
}
}
}
const prevPermissionArray = [];
if (
typeof this.previousPermissionIds === 'string' ||
typeof this.previousPermissionIds === 'number'
) {
prevPermissionArray.push(this.previousPermissionIds);
} else if (Array.isArray(this.previousPermissionIds)) {
for (const permissionOR of this.previousPermissionIds) {
if (Array.isArray(permissionOR)) {
for (const permissionAND of permissionOR) {
prevPermissionArray.push(permissionAND);
}
} else {
prevPermissionArray.push(permissionOR);
}
}
}
const idSet = new Set([...permissionArray]);
const idSetPrev = new Set([...prevPermissionArray]);
const idSetCombined = new Set([...permissionArray, ...prevPermissionArray]);
return idSet.size === idSetPrev.size && idSet.size === idSetCombined.size;
}
sanitizeIds(unsanitized) {
if (typeof unsanitized === 'string') {
return unsanitized;
}
if (typeof unsanitized === 'number') {
return `${unsanitized}`;
}
if (Array.isArray(unsanitized)) {
return unsanitized.map((dirty) => this.sanitizeIds(dirty));
}
throw new TypeError(
'permission/resourcesId(s) must be either an array of ids, a string, or a number'
);
}
}

@@ -19,3 +19,3 @@ import AvApi from '../api';

onPdf(response) {
window.location = response.data.pdf.href;
window.location = response.data.links.pdf.href;
}

@@ -22,0 +22,0 @@

@@ -24,9 +24,9 @@ import AvApi from '../api';

normalize(providers) {
const cloned = providers.slice();
const cloned = [...providers];
cloned.forEach(provider => {
for (const provider of cloned) {
provider.name = provider.businessName
? provider.businessName
: `${provider.lastName}, ${provider.firstName}`;
});
}

@@ -33,0 +33,0 @@ return cloned;

@@ -31,2 +31,3 @@ # Availity API's

##### `me()`
Helper function that returns information about logged in user.

@@ -62,3 +63,3 @@

Service that allows you to get logged=in user's active organizations.
Service that allows you to get logged in user's active organizations.

@@ -75,2 +76,6 @@ #### Methods

##### `postGet(data, config, additionalPostGetArgs)`
Filters the returned organizations by permissions/resources if additionalPostGetArgs are passed
### `AvProviders`

@@ -128,2 +133,3 @@

### `AvFilesDelivery`
Upload a batch of files to a designated channel configured on the server.

@@ -134,39 +140,53 @@

#### `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" },
} ]
};
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": [
{
"id": "123456", // batchId
"status": "COMPLETE", // COMPLETE/INPROGRESS
"deliveries": [
{
"message": "error message",
"subject": "subject of error"
"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"
}
}
],
"metadata": {
payerId: "PAYERID", requestId: "123", patientLastName: "lastName", patientFirstName: "firstName"
}
}
]
]
}

@@ -181,3 +201,2 @@ ```

### `AvSlotMachine`

@@ -184,0 +203,0 @@

@@ -27,5 +27,10 @@ import AvApi from '../api';

getRegions(config) {
if (config && config.params && config.params.userId) {
return this.query(config);
}
if (!this.avUsers || !this.avUsers.me) {
throw new Error('avUsers must be defined');
}
return this.avUsers.me().then(user => {

@@ -32,0 +37,0 @@ const queryConfig = this.addParams({ userId: user.id }, config);

@@ -24,3 +24,3 @@ import AvApi from '../api';

if (Array.isArray(pairs)) {
pairs.forEach(item => {
for (const item of pairs) {
const pair = item.split('=');

@@ -31,3 +31,3 @@ const key = pair[0];

}
});
}
}

@@ -34,0 +34,0 @@ return spaceId;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc