Skip to content

Commit

Permalink
Merge pull request #2 from avadev/feature/24.12.1
Browse files Browse the repository at this point in the history
Update to handle optional AvalaraVersion
  • Loading branch information
svc-developer authored Jan 3, 2025
2 parents 83c69de + afb66d3 commit 8fd9013
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 72 deletions.
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"name": "avalara-sdk",
"version": "24.12.10",
"description": "OpenAPI client for avalara-sdk",
"author": "OpenAPI-Generator",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"prepare": "npm run build",
"test": "jest"
},
"dependencies": {
"node-fetch": "^2.7.0"
},
"devDependencies": {
"@babel/preset-env": "^7.26.0",
"@types/jest": "^29.5.14",
"@types/node": "^18.0.0",
"babel-jest": "^29.7.0",
"dotenv": "^16.0.1",
"fetch-mock-jest": "^1.5.1",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^4.7.3"
}
}
{
"name": "avalara-sdk",
"version": "24.12.11",
"description": "OpenAPI client for avalara-sdk",
"author": "OpenAPI-Generator",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"prepare": "npm run build",
"test": "jest"
},
"dependencies": {
"node-fetch": "^2.7.0"
},
"devDependencies": {
"@babel/preset-env": "^7.26.0",
"@types/jest": "^29.5.14",
"@types/node": "^18.0.0",
"babel-jest": "^29.7.0",
"dotenv": "^16.0.1",
"fetch-mock-jest": "^1.5.1",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^4.7.3"
}
}
5 changes: 2 additions & 3 deletions src/apis/EInvoicing/V1/DataInputFieldsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
} from '../../../packages/EInvoicing/V1';

export interface GetDataInputFieldsInterface {
avalaraVersion: string;
avalaraVersion?: string;
xAvalaraClient?: string;
$filter?: string;
$top?: number;
Expand All @@ -54,6 +54,7 @@ export class DataInputFieldsApi extends runtime.ApiClient {
* Returns the optionality of document fields for different country mandates
*/
async getDataInputFieldsRaw(requestParameters: GetDataInputFieldsInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<DataInputFieldsResponse>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling getDataInputFields.');
}
Expand Down Expand Up @@ -83,8 +84,6 @@ export class DataInputFieldsApi extends runtime.ApiClient {

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down
25 changes: 10 additions & 15 deletions src/apis/EInvoicing/V1/DocumentsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ import {
} from '../../../packages/EInvoicing/V1';

export interface DownloadDocumentInterface {
avalaraVersion: string;
avalaraVersion?: string;
accept: string;
documentId: string;
xAvalaraClient?: string;
}

export interface FetchDocumentsInterface {
avalaraVersion: string;
avalaraVersion?: string;
documentFetchRequest: DocumentFetchRequest;
xAvalaraClient?: string;
}

export interface GetDocumentListInterface {
avalaraVersion: string;
avalaraVersion?: string;
xAvalaraClient?: string;
startDate?: Date;
endDate?: Date;
Expand All @@ -83,13 +83,13 @@ export interface GetDocumentListInterface {
}

export interface GetDocumentStatusInterface {
avalaraVersion: string;
avalaraVersion?: string;
documentId: string;
xAvalaraClient?: string;
}

export interface SubmitDocumentInterface {
avalaraVersion: string;
avalaraVersion?: string;
metadata: SubmitDocumentMetadata;
data: string;
xAvalaraClient?: string;
Expand All @@ -110,6 +110,7 @@ export class DocumentsApi extends runtime.ApiClient {
* Returns a copy of the document
*/
async downloadDocumentRaw(requestParameters: DownloadDocumentInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<Blob>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling downloadDocument.');
}
Expand All @@ -127,8 +128,6 @@ export class DocumentsApi extends runtime.ApiClient {
const authNames: string[] = ['http'];
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down Expand Up @@ -169,6 +168,7 @@ export class DocumentsApi extends runtime.ApiClient {
* Fetch the inbound document from a tax authority
*/
async fetchDocumentsRaw(requestParameters: FetchDocumentsInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<DocumentFetch>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling fetchDocuments.');
}
Expand All @@ -182,8 +182,6 @@ export class DocumentsApi extends runtime.ApiClient {
const authNames: string[] = ['http'];
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

headerParameters['Content-Type'] = 'application/json';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
Expand Down Expand Up @@ -223,6 +221,7 @@ export class DocumentsApi extends runtime.ApiClient {
* Returns a summary of documents for a date range
*/
async getDocumentListRaw(requestParameters: GetDocumentListInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<DocumentListResponse>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling getDocumentList.');
}
Expand Down Expand Up @@ -264,8 +263,6 @@ export class DocumentsApi extends runtime.ApiClient {

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down Expand Up @@ -302,6 +299,7 @@ export class DocumentsApi extends runtime.ApiClient {
* Checks the status of a document
*/
async getDocumentStatusRaw(requestParameters: GetDocumentStatusInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<DocumentStatusResponse>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling getDocumentStatus.');
}
Expand All @@ -315,8 +313,6 @@ export class DocumentsApi extends runtime.ApiClient {
const authNames: string[] = ['http'];
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down Expand Up @@ -353,6 +349,7 @@ export class DocumentsApi extends runtime.ApiClient {
* Submits a document to Avalara E-Invoicing API
*/
async submitDocumentRaw(requestParameters: SubmitDocumentInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<DocumentSubmitResponse>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling submitDocument.');
}
Expand All @@ -370,8 +367,6 @@ export class DocumentsApi extends runtime.ApiClient {
const authNames: string[] = ['http'];
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down
5 changes: 2 additions & 3 deletions src/apis/EInvoicing/V1/InteropApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
export interface SubmitInteropDocumentInterface {
documentType: SubmitInteropDocumentDocumentTypeEnum;
interchangeType: SubmitInteropDocumentInterchangeTypeEnum;
avalaraVersion: string;
avalaraVersion?: string;
xAvalaraClient?: string;
xCorrelationID?: string;
fileName?: Blob;
Expand All @@ -50,6 +50,7 @@ export class InteropApi extends runtime.ApiClient {
* Submit a document
*/
async submitInteropDocumentRaw(requestParameters: SubmitInteropDocumentInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<SubmitInteropDocument202Response>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.documentType === null || requestParameters.documentType === undefined) {
throw new runtime.RequiredError('documentType','Required parameter requestParameters.documentType was null or undefined when calling submitInteropDocument.');
}
Expand All @@ -75,8 +76,6 @@ export class InteropApi extends runtime.ApiClient {

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down
10 changes: 4 additions & 6 deletions src/apis/EInvoicing/V1/MandatesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ import {
} from '../../../packages/EInvoicing/V1';

export interface GetMandateDataInputFieldsInterface {
avalaraVersion: string;
avalaraVersion?: string;
mandateId: string;
documentType: string;
documentVersion: string;
xAvalaraClient?: string;
}

export interface GetMandatesInterface {
avalaraVersion: string;
avalaraVersion?: string;
xAvalaraClient?: string;
$filter?: string;
$top?: number;
Expand All @@ -71,6 +71,7 @@ export class MandatesApi extends runtime.ApiClient {
* Returns document field information for a country mandate, a selected document type, and its version
*/
async getMandateDataInputFieldsRaw(requestParameters: GetMandateDataInputFieldsInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<Array<MandateDataInputField>>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling getMandateDataInputFields.');
}
Expand Down Expand Up @@ -100,8 +101,6 @@ export class MandatesApi extends runtime.ApiClient {

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down Expand Up @@ -138,6 +137,7 @@ export class MandatesApi extends runtime.ApiClient {
* List country mandates that are supported by the Avalara E-Invoicing platform
*/
async getMandatesRaw(requestParameters: GetMandatesInterface, initOverrides?: RequestInit): Promise<{ response: runtime.ApiResponse<MandatesResponse>, logObject: LogObject }> {
requestParameters.avalaraVersion = requestParameters.avalaraVersion || '1.2';
if (requestParameters.avalaraVersion === null || requestParameters.avalaraVersion === undefined) {
throw new runtime.RequiredError('avalaraVersion','Required parameter requestParameters.avalaraVersion was null or undefined when calling getMandates.');
}
Expand Down Expand Up @@ -167,8 +167,6 @@ export class MandatesApi extends runtime.ApiClient {

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['avalara-version'] = '1.2';

if (requestParameters.avalaraVersion !== undefined && requestParameters.avalaraVersion !== null) {
headerParameters['avalara-version'] = String(requestParameters.avalaraVersion);
}
Expand Down
Loading

0 comments on commit 8fd9013

Please sign in to comment.