Skip to content

Commit

Permalink
Merge branch 'master' into fix/upload-chunk-size
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-a-young authored Feb 7, 2025
2 parents 6a19dfd + 5127ec7 commit be3d2d8
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 125 deletions.
21 changes: 21 additions & 0 deletions packages/analytics-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [5.0.7](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2025-02-04)

### Dependency Updates

* `@availity/api-axios` updated to version `5.0.6`


## [5.0.6](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-16)

### Dependency Updates

* `@availity/api-axios` updated to version `5.0.5`


## [5.0.5](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-13)

### Dependency Updates

* `@availity/api-axios` updated to version `5.0.4`


## [5.0.4](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-10-23)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@availity/analytics-core",
"version": "5.0.4",
"version": "5.0.7",
"description": "Analytics base configuration for sdk-js",
"keywords": [
"availity",
Expand Down
31 changes: 31 additions & 0 deletions packages/api-axios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [9.0.7](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2025-02-04)


### Bug Fixes

* **api-axios:** allow absolute urls ([b85c82f](https://github.com/Availity/sdk-js/commit/b85c82f5e1d4fb3e70d49a3ed66d0bb5016df28b))



## [9.0.6](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-16)


### Bug Fixes

* **api-axios:** all logic for limit ([e7e83fb](https://github.com/Availity/sdk-js/commit/e7e83fbf699fed973b3d04ef77d8775a5565fc21))



## [9.0.5](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-13)


### Bug Fixes

* **api-axios:** all logic math.min ([a722c65](https://github.com/Availity/sdk-js/commit/a722c65b36b405382a0a1d1273b5e358f9f3d5e9))
* **api-axios:** default 1 if response.limit not present on all ([0f2ca5d](https://github.com/Availity/sdk-js/commit/0f2ca5d4c53eceb7d184b6c62a1295ece9436acf))
* **api-axios:** use request.length if response.limit not present on all ([bd7812d](https://github.com/Availity/sdk-js/commit/bd7812d9f30a561f15c5803b9a0b87b52326d51d))
* **api-axios:** use request.limit if response.limit not present on all ([0994453](https://github.com/Availity/sdk-js/commit/0994453ffdf54f4d3036d40fa5ceab1873a565b1))
* use request limit if response limit is not present for all ([2cef9cb](https://github.com/Availity/sdk-js/commit/2cef9cb64b0cc360cf146da7277e67b79f96cef5))



## [9.0.4](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-10-23)


Expand Down
2 changes: 1 addition & 1 deletion packages/api-axios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@availity/api-axios",
"version": "9.0.4",
"version": "9.0.7",
"description": "Wrappers for axios designed to work with the Availity portal",
"keywords": [
"availity",
Expand Down
5 changes: 3 additions & 2 deletions packages/api-axios/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ export default class AvApi {
const response = await this.query(config);

const key = this.getQueryResultKey(response.data);
const totalPages = Math.ceil(response.data.totalCount / response.data.limit);
const result = response.data[key] || [];
const limit = response.data.limit || result.length <= response.data.totalCount ? Math.min(result.length, response.data.totalCount) || 1 : 1;
const totalPages = Math.ceil(response.data.totalCount / limit);

if (totalPages > 1) {
const otherPages = [];
Expand All @@ -298,7 +299,7 @@ export default class AvApi {

const pages = await Promise.all(
otherPages.map(async (page) => {
const resp = await this.getPage(page, config, response.data.limit);
const resp = await this.getPage(page, config, limit);
return resp.data[key] || [];
})
);
Expand Down
21 changes: 16 additions & 5 deletions packages/api-axios/src/ms.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,26 @@ export default class AvMicroserviceApi extends AvApi {
this.defaultConfig = merge({}, API_OPTIONS.MS, options);
}

// Override aries 1 url concatenation
getUrl(config, id = '') {
const { path, version, name, id: configId } = this.config(config);
let parts = [path, version || '', name];
const { path, version, name, id: configId, url } = this.config(config);

const parts = url ? [url, path, version || '', name] : [path, version || '', name];

if (id || configId) {
parts = [path, version || '', name, id || configId];
parts.push(id || configId);
}

return parts.join('/').replaceAll(/\/+/g, '/').replace(/\/$/, '');
// Filter out empty strings and join with slashes
const newUrl = parts.join('/');

if (url) {
// Clean up absolute URLs
return newUrl.replaceAll(/([^:]\/)\/+/g, '$1'); // Remove multiple slashes but preserve https://
}
// Clean up relative URLs
return newUrl
.replaceAll(/\/+/g, '/') // Replace multiple slashes with single slash
.replace(/^\/+/, '/') // Ensure single leading slash
.replace(/\/+$/, ''); // Remove trailing slash
}
}
9 changes: 8 additions & 1 deletion packages/api-axios/src/tests/ms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ describe('AvMicroserviceAPi', () => {
});

test('url should be correct', () => {
expect(ms.getUrl(ms.config())).toBe('/ms/api/availity/internal/urlPath');
expect(ms.getRequestUrl()).toBe('/ms/api/availity/internal/urlPath');
});

test('should use an absolute url', () => {
const api = new AvMicroserviceApi({ url: 'http://test-apps.com' });

expect(api.getRequestUrl()).toBe('http://test-apps.com/ms/api/availity/internal/');
expect(api.getUrl({ id: 'serviceName' })).toBe('http://test-apps.com/ms/api/availity/internal/serviceName');
});
});
21 changes: 21 additions & 0 deletions packages/authorizations-axios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [8.0.7](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2025-02-04)

### Dependency Updates

* `@availity/api-axios` updated to version `8.0.6`


## [8.0.6](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-16)

### Dependency Updates

* `@availity/api-axios` updated to version `8.0.5`


## [8.0.5](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-13)

### Dependency Updates

* `@availity/api-axios` updated to version `8.0.4`


## [8.0.4](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-10-23)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/authorizations-axios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@availity/authorizations-axios",
"version": "8.0.4",
"version": "8.0.7",
"description": "Availity authorizations react logic",
"homepage": "https://availity.github.io/sdk-js/api/authorizations",
"bugs": {
Expand Down
21 changes: 21 additions & 0 deletions packages/exceptions-axios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [5.0.7](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2025-02-04)

### Dependency Updates

* `@availity/api-axios` updated to version `5.0.6`


## [5.0.6](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-16)

### Dependency Updates

* `@availity/api-axios` updated to version `5.0.5`


## [5.0.5](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-13)

### Dependency Updates

* `@availity/api-axios` updated to version `5.0.4`


## [5.0.4](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-10-23)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/exceptions-axios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@availity/exceptions-axios",
"version": "5.0.4",
"version": "5.0.7",
"description": "Availity class to log exceptions via axios",
"license": "MIT",
"author": "Evan Sharp <[email protected]>",
Expand Down
21 changes: 21 additions & 0 deletions packages/native-form/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [6.0.7](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2025-02-04)

### Dependency Updates

* `@availity/api-axios` updated to version `6.0.6`


## [6.0.6](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-16)

### Dependency Updates

* `@availity/api-axios` updated to version `6.0.5`


## [6.0.5](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-13)

### Dependency Updates

* `@availity/api-axios` updated to version `6.0.4`


## [6.0.4](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-10-23)

### Dependency Updates
Expand Down
2 changes: 1 addition & 1 deletion packages/native-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@availity/native-form",
"version": "6.0.4",
"version": "6.0.7",
"description": "Submit JSON data via a native form, not AJAX. Useful when you need to open a new page with a POST action.",
"keywords": [
"availity",
Expand Down
109 changes: 1 addition & 108 deletions packages/upload-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,15 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

# [7.0.0-alpha.6](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2025-01-07)


### Bug Fixes

* add credentials to fetch ([5d24cba](https://github.com/Availity/sdk-js/commit/5d24cba12ee96e0c73c86046dc8a9e69b4a5a846))



# [7.0.0-alpha.5](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-13)


### Features

* **upload-core:** do not auto generate id ([f6f2b26](https://github.com/Availity/sdk-js/commit/f6f2b26979609f552861aca629589089ae540edb))



# [7.0.0-alpha.4](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-12)


### Features

* **upload-core:** remove logging ([5749a93](https://github.com/Availity/sdk-js/commit/5749a9355f17993878ddb08262dc268d0ea2f015))



# [7.0.0-alpha.3](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-12)


### Features

* **upload-core:** add logging ([faafb19](https://github.com/Availity/sdk-js/commit/faafb191bb1fe008e8ef28295f93ef4f5434061f))



# [7.0.0-alpha.2](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-12)


### Features

* **upload-core:** add logging ([00b4aad](https://github.com/Availity/sdk-js/commit/00b4aadb2134638ec2300953b44991f597493c73))



# [7.0.0-alpha.1](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-09)


### Features

* **upload-core:** convert to ts ([e8f2b6c](https://github.com/Availity/sdk-js/commit/e8f2b6c3b30aeec8c26d306035a876ddcc0202fc))


### BREAKING CHANGES

* **upload-core:** update to the latest version of tus-js-client



# [7.0.0-alpha.0](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-02)


### Bug Fixes

* **upload-core:** default chunk size to 6MB ([1a3e718](https://github.com/Availity/sdk-js/commit/1a3e718ac6914b1f18a7d4547328f48d9fc9129c))


### Features

* **upload-core:** upgrade to tus-js-client v4 ([c1babe8](https://github.com/Availity/sdk-js/commit/c1babe8e7848df5a0413cb1bc4b35074f12d8064))


### BREAKING CHANGES

* **upload-core:** update to the latest version of tus-js-client



# [7.0.0-alpha.0](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-02)
## [6.1.4](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-11-21)


### Bug Fixes

* **upload-core:** default chunk size to 6MB ([1a3e718](https://github.com/Availity/sdk-js/commit/1a3e718ac6914b1f18a7d4547328f48d9fc9129c))


### Features

* **upload-core:** upgrade to tus-js-client v4 ([c1babe8](https://github.com/Availity/sdk-js/commit/c1babe8e7848df5a0413cb1bc4b35074f12d8064))


### BREAKING CHANGES

* **upload-core:** update to the latest version of tus-js-client



# [7.0.0-alpha.0](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-12-02)


### Bug Fixes

* **upload-core:** default chunk size to 6MB ([1a3e718](https://github.com/Availity/sdk-js/commit/1a3e718ac6914b1f18a7d4547328f48d9fc9129c))


### Features

* **upload-core:** upgrade to tus-js-client v4 ([c1babe8](https://github.com/Availity/sdk-js/commit/c1babe8e7848df5a0413cb1bc4b35074f12d8064))


### BREAKING CHANGES

* **upload-core:** update to the latest version of tus-js-client



## [6.1.3](https://github.com/Availity/sdk-js/compare/@availity/[email protected]...@availity/[email protected]) (2024-11-12)


Expand Down
2 changes: 1 addition & 1 deletion packages/upload-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@availity/upload-core",
"version": "7.0.0-alpha.6",
"version": "6.1.4",
"description": "Wrapper for tus-js-client",
"keywords": [
"tus",
Expand Down
Loading

0 comments on commit be3d2d8

Please sign in to comment.