Skip to content

Commit

Permalink
579-added the global error class and axios request and response types
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy-tw committed Jan 31, 2024
1 parent dfbd5a8 commit 2f971ad
Show file tree
Hide file tree
Showing 34 changed files with 15,933 additions and 12,108 deletions.
2,072 changes: 1,036 additions & 1,036 deletions docs/accounting/index.html

Large diffs are not rendered by default.

130 changes: 65 additions & 65 deletions docs/appstore/index.html

Large diffs are not rendered by default.

158 changes: 79 additions & 79 deletions docs/assets/index.html

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions docs/bankfeeds/index.html

Large diffs are not rendered by default.

204 changes: 102 additions & 102 deletions docs/files/index.html

Large diffs are not rendered by default.

162 changes: 81 additions & 81 deletions docs/finance/index.html

Large diffs are not rendered by default.

364 changes: 182 additions & 182 deletions docs/payroll-au/index.html

Large diffs are not rendered by default.

582 changes: 291 additions & 291 deletions docs/payroll-nz/index.html

Large diffs are not rendered by default.

582 changes: 291 additions & 291 deletions docs/payroll-uk/index.html

Large diffs are not rendered by default.

194 changes: 97 additions & 97 deletions docs/projects/index.html

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ module.exports = {
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
testPathIgnorePatterns: ["/lib/", "/node_modules/"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: {
"axios": "axios/dist/node/axios.cjs"
},
testEnvironment: "node"
// collectCoverage: true,
};
};
251 changes: 207 additions & 44 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
},
"dependencies": {
"openid-client": "^4.9.1",
"request": "^2.88.0"
"axios": "^1.6.5"
}
}
11,632 changes: 6,727 additions & 4,905 deletions src/gen/api/accountingApi.ts

Large diffs are not rendered by default.

197 changes: 114 additions & 83 deletions src/gen/api/appStoreApi.ts

Large diffs are not rendered by default.

282 changes: 165 additions & 117 deletions src/gen/api/assetApi.ts

Large diffs are not rendered by default.

336 changes: 196 additions & 140 deletions src/gen/api/bankfeedsApi.ts

Large diffs are not rendered by default.

852 changes: 497 additions & 355 deletions src/gen/api/filesApi.ts

Large diffs are not rendered by default.

558 changes: 328 additions & 230 deletions src/gen/api/financeApi.ts

Large diffs are not rendered by default.

1,570 changes: 907 additions & 663 deletions src/gen/api/payrollAUApi.ts

Large diffs are not rendered by default.

3,350 changes: 1,934 additions & 1,416 deletions src/gen/api/payrollNZApi.ts

Large diffs are not rendered by default.

3,432 changes: 1,984 additions & 1,448 deletions src/gen/api/payrollUKApi.ts

Large diffs are not rendered by default.

740 changes: 431 additions & 309 deletions src/gen/api/projectApi.ts

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions src/gen/model/accounting/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ export * from '././trackingOptions';
export * from '././user';
export * from '././users';
export * from '././validationError';

import localVarRequest = require('request');

import { AxiosRequestConfig } from 'axios';
import { Account } from '././account';
import { AccountType } from '././accountType';
import { Accounts } from '././accounts';
Expand Down Expand Up @@ -608,14 +606,14 @@ export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
applyToRequest(requestOptions: AxiosRequestConfig): Promise<void> | void;
}

export class HttpBasicAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
requestOptions.auth = {
username: this.username, password: this.password
}
Expand All @@ -628,9 +626,9 @@ export class ApiKeyAuth implements Authentication {
constructor(private location: string, private paramName: string) {
}

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (this.location == "query") {
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
(<any>requestOptions.params)[this.paramName] = this.apiKey;
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
requestOptions.headers[this.paramName] = this.apiKey;
}
Expand All @@ -640,7 +638,7 @@ export class ApiKeyAuth implements Authentication {
export class OAuth implements Authentication {
public accessToken: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (requestOptions && requestOptions.headers) {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
Expand All @@ -651,7 +649,7 @@ export class VoidAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(_: localVarRequest.Options): void {
applyToRequest(_): void {
// Do nothing
}
}
}
18 changes: 8 additions & 10 deletions src/gen/model/appstore/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ export * from '././subscriptionItem';
export * from '././updateUsageRecord';
export * from '././usageRecord';
export * from '././usageRecordsList';

import localVarRequest = require('request');

import { AxiosRequestConfig } from 'axios';
import { CreateUsageRecord } from '././createUsageRecord';
import { Plan } from '././plan';
import { Price } from '././price';
Expand Down Expand Up @@ -187,14 +185,14 @@ export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
applyToRequest(requestOptions: AxiosRequestConfig): Promise<void> | void;
}

export class HttpBasicAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
requestOptions.auth = {
username: this.username, password: this.password
}
Expand All @@ -207,9 +205,9 @@ export class ApiKeyAuth implements Authentication {
constructor(private location: string, private paramName: string) {
}

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (this.location == "query") {
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
(<any>requestOptions.params)[this.paramName] = this.apiKey;
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
requestOptions.headers[this.paramName] = this.apiKey;
}
Expand All @@ -219,7 +217,7 @@ export class ApiKeyAuth implements Authentication {
export class OAuth implements Authentication {
public accessToken: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (requestOptions && requestOptions.headers) {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
Expand All @@ -230,7 +228,7 @@ export class VoidAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(_: localVarRequest.Options): void {
applyToRequest(_): void {
// Do nothing
}
}
}
18 changes: 8 additions & 10 deletions src/gen/model/assets/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export * from '././modelError';
export * from '././pagination';
export * from '././resourceValidationErrorsElement';
export * from '././setting';

import localVarRequest = require('request');

import { AxiosRequestConfig } from 'axios';
import { Asset } from '././asset';
import { AssetStatus } from '././assetStatus';
import { AssetStatusQueryParam } from '././assetStatusQueryParam';
Expand Down Expand Up @@ -192,14 +190,14 @@ export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
applyToRequest(requestOptions: AxiosRequestConfig): Promise<void> | void;
}

export class HttpBasicAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
requestOptions.auth = {
username: this.username, password: this.password
}
Expand All @@ -212,9 +210,9 @@ export class ApiKeyAuth implements Authentication {
constructor(private location: string, private paramName: string) {
}

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (this.location == "query") {
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
(<any>requestOptions.params)[this.paramName] = this.apiKey;
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
requestOptions.headers[this.paramName] = this.apiKey;
}
Expand All @@ -224,7 +222,7 @@ export class ApiKeyAuth implements Authentication {
export class OAuth implements Authentication {
public accessToken: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (requestOptions && requestOptions.headers) {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
Expand All @@ -235,7 +233,7 @@ export class VoidAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(_: localVarRequest.Options): void {
applyToRequest(_): void {
// Do nothing
}
}
}
18 changes: 8 additions & 10 deletions src/gen/model/bankfeeds/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export * from '././startBalance';
export * from '././statement';
export * from '././statementLine';
export * from '././statements';

import localVarRequest = require('request');

import { AxiosRequestConfig } from 'axios';
import { CountryCode } from '././countryCode';
import { CreditDebitIndicator } from '././creditDebitIndicator';
import { CurrencyCode } from '././currencyCode';
Expand Down Expand Up @@ -193,14 +191,14 @@ export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
applyToRequest(requestOptions: AxiosRequestConfig): Promise<void> | void;
}

export class HttpBasicAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
requestOptions.auth = {
username: this.username, password: this.password
}
Expand All @@ -213,9 +211,9 @@ export class ApiKeyAuth implements Authentication {
constructor(private location: string, private paramName: string) {
}

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (this.location == "query") {
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
(<any>requestOptions.params)[this.paramName] = this.apiKey;
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
requestOptions.headers[this.paramName] = this.apiKey;
}
Expand All @@ -225,7 +223,7 @@ export class ApiKeyAuth implements Authentication {
export class OAuth implements Authentication {
public accessToken: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (requestOptions && requestOptions.headers) {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
Expand All @@ -236,7 +234,7 @@ export class VoidAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(_: localVarRequest.Options): void {
applyToRequest(_): void {
// Do nothing
}
}
}
18 changes: 8 additions & 10 deletions src/gen/model/files/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ export * from '././objectGroup';
export * from '././objectType';
export * from '././uploadObject';
export * from '././user';

import localVarRequest = require('request');

import { AxiosRequestConfig } from 'axios';
import { Association } from '././association';
import { FileObject } from '././fileObject';
import { Files } from '././files';
Expand Down Expand Up @@ -180,14 +178,14 @@ export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
applyToRequest(requestOptions: AxiosRequestConfig): Promise<void> | void;
}

export class HttpBasicAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
requestOptions.auth = {
username: this.username, password: this.password
}
Expand All @@ -200,9 +198,9 @@ export class ApiKeyAuth implements Authentication {
constructor(private location: string, private paramName: string) {
}

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (this.location == "query") {
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
(<any>requestOptions.params)[this.paramName] = this.apiKey;
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
requestOptions.headers[this.paramName] = this.apiKey;
}
Expand All @@ -212,7 +210,7 @@ export class ApiKeyAuth implements Authentication {
export class OAuth implements Authentication {
public accessToken: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (requestOptions && requestOptions.headers) {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
Expand All @@ -223,7 +221,7 @@ export class VoidAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(_: localVarRequest.Options): void {
applyToRequest(_): void {
// Do nothing
}
}
}
18 changes: 8 additions & 10 deletions src/gen/model/finance/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export * from '././trialBalanceMovement';
export * from '././trialBalanceResponse';
export * from '././userActivitiesResponse';
export * from '././userResponse';

import localVarRequest = require('request');

import { AxiosRequestConfig } from 'axios';
import { AccountUsage } from '././accountUsage';
import { AccountUsageResponse } from '././accountUsageResponse';
import { BalanceSheetAccountDetail } from '././balanceSheetAccountDetail';
Expand Down Expand Up @@ -315,14 +313,14 @@ export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
applyToRequest(requestOptions: AxiosRequestConfig): Promise<void> | void;
}

export class HttpBasicAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
requestOptions.auth = {
username: this.username, password: this.password
}
Expand All @@ -335,9 +333,9 @@ export class ApiKeyAuth implements Authentication {
constructor(private location: string, private paramName: string) {
}

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (this.location == "query") {
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
(<any>requestOptions.params)[this.paramName] = this.apiKey;
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
requestOptions.headers[this.paramName] = this.apiKey;
}
Expand All @@ -347,7 +345,7 @@ export class ApiKeyAuth implements Authentication {
export class OAuth implements Authentication {
public accessToken: string = '';

applyToRequest(requestOptions: localVarRequest.Options): void {
applyToRequest(requestOptions: AxiosRequestConfig): void {
if (requestOptions && requestOptions.headers) {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
Expand All @@ -358,7 +356,7 @@ export class VoidAuth implements Authentication {
public username: string = '';
public password: string = '';

applyToRequest(_: localVarRequest.Options): void {
applyToRequest(_): void {
// Do nothing
}
}
}
Loading

0 comments on commit 2f971ad

Please sign in to comment.