Skip to content

Commit

Permalink
Update axios package vulnerability to node-fetch (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
fern-api[bot] authored Jan 29, 2024
1 parent 5ce6aaa commit 4ca9614
Show file tree
Hide file tree
Showing 1,520 changed files with 32,620 additions and 27,496 deletions.
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mergeapi/merge-node-client",
"version": "1.0.4",
"version": "1.0.5",
"private": false,
"repository": "https://github.com/merge-api/merge-node-client",
"main": "./index.js",
Expand All @@ -12,12 +12,15 @@
},
"dependencies": {
"url-join": "4.0.1",
"@types/url-join": "4.0.1",
"@ungap/url-search-params": "0.2.2",
"axios": "0.27.2",
"form-data": "4.0.0",
"node-fetch": "2.7.0",
"qs": "6.11.2",
"js-base64": "3.7.2"
},
"devDependencies": {
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
Expand Down
1 change: 1 addition & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export declare namespace MergeClient {

interface RequestOptions {
timeoutInSeconds?: number;
maxRetries?: number;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/api/resources/accounting/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export declare namespace Accounting {

interface RequestOptions {
timeoutInSeconds?: number;
maxRetries?: number;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/accounting/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./resources";
export * from "./types";
export * from "./client";
export * from "./resources";
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export declare namespace AccountDetails {

interface RequestOptions {
timeoutInSeconds?: number;
maxRetries?: number;
}
}

Expand All @@ -26,6 +27,9 @@ export class AccountDetails {

/**
* Get details for a linked account.
*
* @example
* await merge.accounting.accountDetails.retrieve()
*/
public async retrieve(requestOptions?: AccountDetails.RequestOptions): Promise<Merge.accounting.AccountDetails> {
const _response = await core.fetcher({
Expand All @@ -42,10 +46,11 @@ export class AccountDetails {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mergeapi/merge-node-client",
"X-Fern-SDK-Version": "1.0.4",
"X-Fern-SDK-Version": "1.0.5",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.accounting.AccountDetails.parseOrThrow(_response.body, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export declare namespace AccountToken {

interface RequestOptions {
timeoutInSeconds?: number;
maxRetries?: number;
}
}

Expand Down Expand Up @@ -45,10 +46,11 @@ export class AccountToken {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mergeapi/merge-node-client",
"X-Fern-SDK-Version": "1.0.4",
"X-Fern-SDK-Version": "1.0.5",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.accounting.AccountToken.parseOrThrow(_response.body, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import * as environments from "../../../../../../environments";
import * as core from "../../../../../../core";
import * as Merge from "../../../../..";
import { default as URLSearchParams } from "@ungap/url-search-params";
import urlJoin from "url-join";
import * as serializers from "../../../../../../serialization";
import * as errors from "../../../../../../errors";
Expand All @@ -19,6 +18,7 @@ export declare namespace AccountingPeriods {

interface RequestOptions {
timeoutInSeconds?: number;
maxRetries?: number;
}
}

Expand All @@ -27,27 +27,30 @@ export class AccountingPeriods {

/**
* Returns a list of `AccountingPeriod` objects.
*
* @example
* await merge.accounting.accountingPeriods.list({})
*/
public async list(
request: Merge.accounting.AccountingPeriodsListRequest = {},
requestOptions?: AccountingPeriods.RequestOptions
): Promise<Merge.accounting.PaginatedAccountingPeriodList> {
const { cursor, includeDeletedData, includeRemoteData, pageSize } = request;
const _queryParams = new URLSearchParams();
const _queryParams: Record<string, string | string[]> = {};
if (cursor != null) {
_queryParams.append("cursor", cursor);
_queryParams["cursor"] = cursor;
}

if (includeDeletedData != null) {
_queryParams.append("include_deleted_data", includeDeletedData.toString());
_queryParams["include_deleted_data"] = includeDeletedData.toString();
}

if (includeRemoteData != null) {
_queryParams.append("include_remote_data", includeRemoteData.toString());
_queryParams["include_remote_data"] = includeRemoteData.toString();
}

if (pageSize != null) {
_queryParams.append("page_size", pageSize.toString());
_queryParams["page_size"] = pageSize.toString();
}

const _response = await core.fetcher({
Expand All @@ -64,11 +67,12 @@ export class AccountingPeriods {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mergeapi/merge-node-client",
"X-Fern-SDK-Version": "1.0.4",
"X-Fern-SDK-Version": "1.0.5",
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.accounting.PaginatedAccountingPeriodList.parseOrThrow(_response.body, {
Expand Down Expand Up @@ -103,16 +107,19 @@ export class AccountingPeriods {

/**
* Returns an `AccountingPeriod` object with the given `id`.
*
* @example
* await merge.accounting.accountingPeriods.retrieve("id", {})
*/
public async retrieve(
id: string,
request: Merge.accounting.AccountingPeriodsRetrieveRequest = {},
requestOptions?: AccountingPeriods.RequestOptions
): Promise<Merge.accounting.AccountingPeriod> {
const { includeRemoteData } = request;
const _queryParams = new URLSearchParams();
const _queryParams: Record<string, string | string[]> = {};
if (includeRemoteData != null) {
_queryParams.append("include_remote_data", includeRemoteData.toString());
_queryParams["include_remote_data"] = includeRemoteData.toString();
}

const _response = await core.fetcher({
Expand All @@ -129,11 +136,12 @@ export class AccountingPeriods {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mergeapi/merge-node-client",
"X-Fern-SDK-Version": "1.0.4",
"X-Fern-SDK-Version": "1.0.5",
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.accounting.AccountingPeriod.parseOrThrow(_response.body, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* @example
* {}
*/
export interface AccountingPeriodsListRequest {
/**
* The pagination cursor value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* @example
* {}
*/
export interface AccountingPeriodsRetrieveRequest {
/**
* Whether to include the original data Merge fetched from the third-party to produce these models.
Expand Down
Loading

0 comments on commit 4ca9614

Please sign in to comment.