Skip to content

Commit afa8af3

Browse files
committed
Renames applied in src/api.ts, src/multipart.ts, and src/JWTAuth.ts
1 parent 5fb2e23 commit afa8af3

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/JWTAuth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Configuration } from './Configuration';
22
import { Authentication } from './Authentication';
33
import { ApiErrorResponse } from './models';
44

5-
type StringKeyWithStringValue = Record<string, string>;
5+
type StringMap = Record<string, string>;
66

77
interface FetchHeaders {
88
forEach(callback: (value: string, key: string) => void): void;
@@ -18,7 +18,7 @@ interface FetchResponse {
1818

1919
type Fetcher = (
2020
input: string | URL,
21-
init?: { method?: string; headers?: StringKeyWithStringValue; body?: any }
21+
init?: { method?: string; headers?: StringMap; body?: any }
2222
) => Promise<FetchResponse>;
2323

2424
type AuthResponse = {

src/api.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Configuration } from './Configuration';
2-
import { Multipart, RequestFile, FormParamsType } from './multipart';
2+
import { Multipart, RequestFile, FormParamPairs } from './multipart';
33

44
export * from './models';
55

@@ -36,17 +36,17 @@ import {
3636
ScanMultipartRequestWrapper,
3737
} from './models';
3838

39-
type StringKeyWithStringValue = Record<string, string>;
39+
type StringMap = Record<string, string>;
4040

4141
type ApiRequestOptions = {
4242
uri: string;
4343
body?: any;
4444
encoding?: BufferEncoding | null;
45-
form?: StringKeyWithStringValue;
46-
headers?: StringKeyWithStringValue;
45+
form?: StringMap;
46+
headers?: StringMap;
4747
json?: boolean;
4848
method?: string;
49-
qs?: StringKeyWithStringValue;
49+
qs?: StringMap;
5050
};
5151

5252
type ApiResponse = {
@@ -79,13 +79,13 @@ interface FetchResponse {
7979
arrayBuffer(): Promise<ArrayBuffer>;
8080
}
8181

82-
interface FetchRequestOptions {
82+
interface FetchOptions {
8383
method?: string;
84-
headers?: StringKeyWithStringValue;
84+
headers?: StringMap;
8585
body?: any;
8686
}
8787

88-
type Fetcher = (input: string | URL, options?: FetchRequestOptions) => Promise<FetchResponse>;
88+
type Fetcher = (input: string | URL, options?: FetchOptions) => Promise<FetchResponse>;
8989

9090
export class ApiClient {
9191
public requestAsync(options: ApiRequestOptions): Promise<ApiResult> {
@@ -97,7 +97,7 @@ export class ApiClient {
9797

9898
const responseEncoding: BufferEncoding | null = options.encoding === null ? null : options.encoding || 'utf-8';
9999

100-
const requestOptions: FetchRequestOptions = {
100+
const requestOptions: FetchOptions = {
101101
method: options.method || 'GET',
102102
headers: options.headers,
103103
};
@@ -136,7 +136,7 @@ export class ApiClient {
136136

137137
private async doFetchRequest(
138138
url: URL,
139-
requestOptions: FetchRequestOptions,
139+
requestOptions: FetchOptions,
140140
responseEncoding: BufferEncoding | null
141141
): Promise<ApiResult> {
142142
const fetcher = this.getFetch();
@@ -581,7 +581,7 @@ export class GenerateApi {
581581
const requestPath = this._configuration.getApiBaseUrl() + '/barcode/generate-multipart';
582582
let queryParameters: any = {};
583583
let headerParams: any = (Object as any).assign({}, this.defaultHeaders);
584-
const formParams: FormParamsType = [];
584+
const formParams: FormParamPairs = [];
585585

586586
// verify required parameter 'request.barcodeType' is not null or undefined
587587
if (request.barcodeType == null) {
@@ -776,7 +776,7 @@ export class RecognizeApi {
776776
const requestPath = this._configuration.getApiBaseUrl() + '/barcode/recognize-multipart';
777777
let queryParameters: any = {};
778778
let headerParams: any = (Object as any).assign({}, this.defaultHeaders);
779-
const formParams: FormParamsType = [];
779+
const formParams: FormParamPairs = [];
780780

781781
// verify required parameter 'request.barcodeType' is not null or undefined
782782
if (request.barcodeType == null) {
@@ -929,7 +929,7 @@ export class ScanApi {
929929
const requestPath = this._configuration.getApiBaseUrl() + '/barcode/scan-multipart';
930930
let queryParameters: any = {};
931931
let headerParams: any = (Object as any).assign({}, this.defaultHeaders);
932-
const formParams: FormParamsType = [];
932+
const formParams: FormParamPairs = [];
933933

934934
// verify required parameter 'request.fileBytes' is not null or undefined
935935
if (request.fileBytes == null) {

src/multipart.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import crypto from 'crypto';
22

3-
type StringKeyWithStringValue = Record<string, string>;
3+
type StringMap = Record<string, string>;
44

5-
export interface FormParamsType extends Array<Array<string>> {}
5+
export interface FormParamPairs extends Array<Array<string>> {}
66

77
interface IRequestFile {
88
name: string;
@@ -23,9 +23,9 @@ export class RequestFile implements IRequestFile {
2323
export class Multipart {
2424
readonly boundary: string;
2525
readonly body: Buffer;
26-
readonly headers: StringKeyWithStringValue;
26+
readonly headers: StringMap;
2727

28-
constructor(textFields: FormParamsType, files?: IRequestFile[]) {
28+
constructor(textFields: FormParamPairs, files?: IRequestFile[]) {
2929
const random = crypto.randomUUID();
3030
this.boundary = '------------------------' + random.replace(/-/g, '');
3131

0 commit comments

Comments
 (0)