@zcatalyst/transport 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +55 -1
- package/README.md +266 -0
- package/dist-cjs/fetch-handler.js +67 -64
- package/dist-cjs/http-handler.js +25 -23
- package/dist-cjs/index.browser.js +8 -3
- package/dist-cjs/index.js +9 -7
- package/dist-cjs/utils/clonable-stream.js +1 -1
- package/dist-cjs/utils/form-data.js +11 -5
- package/dist-cjs/utils/request-agent.js +1 -1
- package/dist-es/fetch-handler.js +64 -64
- package/dist-es/http-handler.js +25 -24
- package/dist-es/index.browser.js +3 -2
- package/dist-es/index.js +3 -5
- package/dist-es/utils/clonable-stream.js +0 -1
- package/dist-es/utils/form-data.js +10 -5
- package/dist-es/utils/request-agent.js +0 -1
- package/dist-types/fetch-handler.d.ts +115 -6
- package/dist-types/http-handler.d.ts +48 -8
- package/dist-types/index.browser.d.ts +17 -1
- package/dist-types/index.d.ts +22 -2
- package/dist-types/ts3.4/fetch-handler.d.ts +115 -6
- package/dist-types/ts3.4/http-handler.d.ts +48 -8
- package/dist-types/ts3.4/index.browser.d.ts +17 -1
- package/dist-types/ts3.4/index.d.ts +22 -2
- package/dist-types/ts3.4/utils/clonable-stream.d.ts +54 -0
- package/dist-types/ts3.4/utils/errors.d.ts +7 -0
- package/dist-types/ts3.4/utils/form-data.d.ts +242 -1
- package/dist-types/ts3.4/utils/helpers.d.ts +12 -0
- package/dist-types/ts3.4/utils/interfaces.d.ts +5 -1
- package/dist-types/ts3.4/utils/request-agent.d.ts +6 -0
- package/dist-types/ts3.4/utils/request-timeout.d.ts +12 -0
- package/dist-types/utils/clonable-stream.d.ts +54 -0
- package/dist-types/utils/errors.d.ts +7 -0
- package/dist-types/utils/form-data.d.ts +242 -1
- package/dist-types/utils/helpers.d.ts +12 -0
- package/dist-types/utils/interfaces.d.ts +5 -1
- package/dist-types/utils/request-agent.d.ts +6 -0
- package/dist-types/utils/request-timeout.d.ts +12 -0
- package/package.json +31 -6
|
@@ -10,35 +10,276 @@ export default class FormData extends Stream {
|
|
|
10
10
|
insideLoop: boolean;
|
|
11
11
|
pendingNext: boolean;
|
|
12
12
|
boundary: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a FormData instance.
|
|
15
|
+
* @param streams - The streams value.
|
|
16
|
+
*/
|
|
13
17
|
constructor(streams?: Array<formDataType>);
|
|
14
18
|
static LINE_BREAK: string;
|
|
15
19
|
static CONTENT_TYPE: string;
|
|
20
|
+
/**
|
|
21
|
+
* Performs is stream for the transport package.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The value to validate.
|
|
24
|
+
* @returns The is stream result.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
29
|
+
* const result = undefined;
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
16
32
|
isStream(value: unknown): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Performs multi part header for the transport package.
|
|
35
|
+
*
|
|
36
|
+
* @param field - The field value.
|
|
37
|
+
* @param value - The value to validate.
|
|
38
|
+
* @returns The multi part header result.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
43
|
+
* const result = undefined;
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
17
46
|
_multiPartHeader(field: string, value: formDataType): string;
|
|
18
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Performs get content disposition for the transport package.
|
|
49
|
+
*
|
|
50
|
+
* @param value - The value to validate.
|
|
51
|
+
* @returns The get content disposition result.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
56
|
+
* const result = undefined;
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
_getContentDisposition(value: unknown): string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Performs get content type for the transport package.
|
|
62
|
+
*
|
|
63
|
+
* @param value - The value to validate.
|
|
64
|
+
* @returns The get content type result.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
69
|
+
* const result = undefined;
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
19
72
|
_getContentType(value: formDataType): string;
|
|
73
|
+
/**
|
|
74
|
+
* Performs last boundary for the transport package.
|
|
75
|
+
*
|
|
76
|
+
* @returns The last boundary result.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
81
|
+
* const result = undefined;
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
20
84
|
_lastBoundary(): string;
|
|
85
|
+
/**
|
|
86
|
+
* Performs generate boundary for the transport package.
|
|
87
|
+
*
|
|
88
|
+
* @returns The generate boundary result.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
93
|
+
* const result = undefined;
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
21
96
|
_generateBoundary(): string;
|
|
97
|
+
/**
|
|
98
|
+
* Performs error for the transport package.
|
|
99
|
+
*
|
|
100
|
+
* @param err - The err value.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
105
|
+
* const result = undefined;
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
22
108
|
_error(err: Error): void;
|
|
109
|
+
/**
|
|
110
|
+
* Performs handle stream errors for the transport package.
|
|
111
|
+
*
|
|
112
|
+
* @param stream - The stream value.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
117
|
+
* const result = undefined;
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
23
120
|
_handleStreamErrors(stream: Stream): void;
|
|
121
|
+
/**
|
|
122
|
+
* Performs pipe next for the transport package.
|
|
123
|
+
*
|
|
124
|
+
* @param stream - The stream value.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
129
|
+
* const result = undefined;
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
24
132
|
_pipeNext(stream: formDataType): void;
|
|
133
|
+
/**
|
|
134
|
+
* Performs get next for the transport package.
|
|
135
|
+
*
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
140
|
+
* const result = undefined;
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
25
143
|
_getNext(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Performs reset for the transport package.
|
|
146
|
+
*
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
151
|
+
* const result = undefined;
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
26
154
|
_reset(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Performs create clone for the transport package.
|
|
157
|
+
*
|
|
158
|
+
* @returns The create clone result.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
163
|
+
* const result = undefined;
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
27
166
|
createClone(): FormData;
|
|
167
|
+
/**
|
|
168
|
+
* Performs append for the transport package.
|
|
169
|
+
*
|
|
170
|
+
* @param field - The field value.
|
|
171
|
+
* @param value - The value to validate.
|
|
172
|
+
* @returns The append result.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
177
|
+
* const result = undefined;
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
28
180
|
append(field: string, value: unknown): this;
|
|
181
|
+
/**
|
|
182
|
+
* Performs get headers for the transport package.
|
|
183
|
+
*
|
|
184
|
+
* @param userHeaders - The user headers value.
|
|
185
|
+
* @returns The get headers result.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
190
|
+
* const result = undefined;
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
29
193
|
getHeaders(userHeaders: {
|
|
30
194
|
[x: string]: string;
|
|
31
195
|
}): {
|
|
32
196
|
[x: string]: string;
|
|
33
197
|
};
|
|
198
|
+
/**
|
|
199
|
+
* Performs get boundary for the transport package.
|
|
200
|
+
*
|
|
201
|
+
* @returns The get boundary result.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
206
|
+
* const result = undefined;
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
34
209
|
getBoundary(): string;
|
|
210
|
+
/**
|
|
211
|
+
* Performs pipe for the transport package.
|
|
212
|
+
*
|
|
213
|
+
* @param dest - The dest value.
|
|
214
|
+
* @param options - The initialization or request options.
|
|
215
|
+
* @returns The pipe result.
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
220
|
+
* const result = undefined;
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
35
223
|
pipe<T extends NodeJS.WritableStream>(dest: T, options?: {
|
|
36
224
|
end?: boolean;
|
|
37
225
|
}): T;
|
|
226
|
+
/**
|
|
227
|
+
* Performs write for the transport package.
|
|
228
|
+
*
|
|
229
|
+
* @param data - The data value.
|
|
230
|
+
* @returns The write result.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```ts
|
|
234
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
235
|
+
* const result = undefined;
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
38
238
|
write(data: Uint8Array | string): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Performs pause for the transport package.
|
|
241
|
+
*
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```ts
|
|
245
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
246
|
+
* const result = undefined;
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
39
249
|
pause(): void;
|
|
250
|
+
/**
|
|
251
|
+
* Performs resume for the transport package.
|
|
252
|
+
*
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```ts
|
|
256
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
257
|
+
* const result = undefined;
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
40
260
|
resume(): void;
|
|
261
|
+
/**
|
|
262
|
+
* Performs end for the transport package.
|
|
263
|
+
*
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```ts
|
|
267
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
268
|
+
* const result = undefined;
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
41
271
|
end(): void;
|
|
272
|
+
/**
|
|
273
|
+
* Performs destroy for the transport package.
|
|
274
|
+
*
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```ts
|
|
278
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
279
|
+
* const result = undefined;
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
42
282
|
destroy(): void;
|
|
283
|
+
/** function toString() { [native code] } */
|
|
43
284
|
toString(): string;
|
|
44
285
|
}
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports whether a URL uses the HTTPS protocol.
|
|
3
|
+
*
|
|
4
|
+
* @param url - The URL to update or request.
|
|
5
|
+
* @returns True when the URL uses HTTPS.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
10
|
+
* const result = isHttps("https://example.com");
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
1
13
|
export declare function isHttps(url?: string | URL): boolean;
|
|
@@ -2,6 +2,7 @@ import { CatalystService } from '@zcatalyst/utils';
|
|
|
2
2
|
import { RequestType, ResponseType } from './enums';
|
|
3
3
|
export interface Component {
|
|
4
4
|
getComponentName(): string;
|
|
5
|
+
getComponentVersion?(): string;
|
|
5
6
|
}
|
|
6
7
|
export interface jwtAccessTokenResponse {
|
|
7
8
|
access_token: string;
|
|
@@ -27,6 +28,8 @@ export interface RequestHandlerOptions {
|
|
|
27
28
|
requestTimeout?: number;
|
|
28
29
|
expecting?: ResponseType;
|
|
29
30
|
auth?: boolean;
|
|
31
|
+
duplex?: string;
|
|
32
|
+
service?: CatalystService;
|
|
30
33
|
}
|
|
31
34
|
export interface HTTP_CODE_MAP_BODY_TYPE {
|
|
32
35
|
CODE: number;
|
|
@@ -43,9 +46,10 @@ export interface FORMDATA {
|
|
|
43
46
|
name: string;
|
|
44
47
|
}
|
|
45
48
|
export interface IRequestConfig {
|
|
49
|
+
duplex?: string;
|
|
46
50
|
data?: string | Array<{
|
|
47
51
|
[x: string]: unknown;
|
|
48
|
-
}> | Array<string | number> | Record<string, unknown> |
|
|
52
|
+
}> | Array<string | number> | Record<string, unknown> | unknown;
|
|
49
53
|
type?: RequestType;
|
|
50
54
|
qs?: Record<string, string | number | boolean | undefined>;
|
|
51
55
|
path?: string;
|
|
@@ -2,5 +2,11 @@ import { Agent as httpAgent } from 'http';
|
|
|
2
2
|
import { Agent as httpsAgent } from 'https';
|
|
3
3
|
export default class RequestAgent {
|
|
4
4
|
agent: httpAgent | httpsAgent;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a RequestAgent instance.
|
|
7
|
+
* @param isHttps - The isHttps value.
|
|
8
|
+
* @param host - The host value.
|
|
9
|
+
* @param replaceAgent - The replaceAgent value.
|
|
10
|
+
*/
|
|
5
11
|
constructor(isHttps: boolean, host: string, replaceAgent: boolean);
|
|
6
12
|
}
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a promise that rejects when a request exceeds the configured timeout.
|
|
3
|
+
*
|
|
4
|
+
* @param timeoutInMs - The timeout duration in milliseconds.
|
|
5
|
+
* @returns A promise that rejects when the timeout elapses.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
10
|
+
* const result = undefined;
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
1
13
|
export declare function requestTimeout(timeoutInMs?: number): Promise<never>;
|
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
import { PassThrough, Readable } from 'stream';
|
|
2
2
|
declare class StreamClone extends PassThrough {
|
|
3
3
|
parent: CloneableStream;
|
|
4
|
+
/**
|
|
5
|
+
* Creates a StreamClone instance.
|
|
6
|
+
* @param parent - The parent value.
|
|
7
|
+
*/
|
|
4
8
|
constructor(parent: CloneableStream);
|
|
5
9
|
private onDataClone;
|
|
6
10
|
private onResumeClone;
|
|
11
|
+
/**
|
|
12
|
+
* Performs clone for the transport package.
|
|
13
|
+
*
|
|
14
|
+
* @returns The clone result.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
19
|
+
* const result = undefined;
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
7
22
|
clone(): StreamClone;
|
|
23
|
+
/**
|
|
24
|
+
* Performs is cloneable for the transport package.
|
|
25
|
+
*
|
|
26
|
+
* @param stream - The stream value.
|
|
27
|
+
* @returns The is cloneable result.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
32
|
+
* const result = undefined;
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
8
35
|
isCloneable(stream: unknown): stream is CloneableStream | StreamClone;
|
|
9
36
|
}
|
|
10
37
|
export default class CloneableStream extends PassThrough {
|
|
@@ -12,10 +39,37 @@ export default class CloneableStream extends PassThrough {
|
|
|
12
39
|
_clonesCount: number;
|
|
13
40
|
_internalPipe: boolean;
|
|
14
41
|
_hasListener: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a CloneableStream instance.
|
|
44
|
+
* @param stream - The stream value.
|
|
45
|
+
*/
|
|
15
46
|
constructor(stream: Readable);
|
|
16
47
|
private onData;
|
|
17
48
|
private onResume;
|
|
49
|
+
/**
|
|
50
|
+
* Performs resume for the transport package.
|
|
51
|
+
*
|
|
52
|
+
* @returns The resume result.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
57
|
+
* const result = undefined;
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
18
60
|
resume(): this;
|
|
61
|
+
/**
|
|
62
|
+
* Performs clone for the transport package.
|
|
63
|
+
*
|
|
64
|
+
* @returns The clone result.
|
|
65
|
+
* @throws {Error} when validation fails.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
70
|
+
* const result = undefined;
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
19
73
|
clone(): StreamClone;
|
|
20
74
|
}
|
|
21
75
|
export {};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { PrefixedCatalystError } from '@zcatalyst/utils';
|
|
2
2
|
export declare class CatalystAPIError extends PrefixedCatalystError {
|
|
3
|
+
/**
|
|
4
|
+
* Creates a CatalystAPIError instance.
|
|
5
|
+
* @param code - The code value.
|
|
6
|
+
* @param message - The message value.
|
|
7
|
+
* @param value - The value value.
|
|
8
|
+
* @param statusCode - The statusCode value.
|
|
9
|
+
*/
|
|
3
10
|
constructor(code: string, message: string, value?: unknown, statusCode?: number);
|
|
4
11
|
}
|
|
@@ -10,35 +10,276 @@ export default class FormData extends Stream {
|
|
|
10
10
|
insideLoop: boolean;
|
|
11
11
|
pendingNext: boolean;
|
|
12
12
|
boundary: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a FormData instance.
|
|
15
|
+
* @param streams - The streams value.
|
|
16
|
+
*/
|
|
13
17
|
constructor(streams?: Array<formDataType>);
|
|
14
18
|
static LINE_BREAK: string;
|
|
15
19
|
static CONTENT_TYPE: string;
|
|
20
|
+
/**
|
|
21
|
+
* Performs is stream for the transport package.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The value to validate.
|
|
24
|
+
* @returns The is stream result.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
29
|
+
* const result = undefined;
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
16
32
|
isStream(value: unknown): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Performs multi part header for the transport package.
|
|
35
|
+
*
|
|
36
|
+
* @param field - The field value.
|
|
37
|
+
* @param value - The value to validate.
|
|
38
|
+
* @returns The multi part header result.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
43
|
+
* const result = undefined;
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
17
46
|
_multiPartHeader(field: string, value: formDataType): string;
|
|
18
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Performs get content disposition for the transport package.
|
|
49
|
+
*
|
|
50
|
+
* @param value - The value to validate.
|
|
51
|
+
* @returns The get content disposition result.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
56
|
+
* const result = undefined;
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
_getContentDisposition(value: unknown): string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Performs get content type for the transport package.
|
|
62
|
+
*
|
|
63
|
+
* @param value - The value to validate.
|
|
64
|
+
* @returns The get content type result.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
69
|
+
* const result = undefined;
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
19
72
|
_getContentType(value: formDataType): string;
|
|
73
|
+
/**
|
|
74
|
+
* Performs last boundary for the transport package.
|
|
75
|
+
*
|
|
76
|
+
* @returns The last boundary result.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
81
|
+
* const result = undefined;
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
20
84
|
_lastBoundary(): string;
|
|
85
|
+
/**
|
|
86
|
+
* Performs generate boundary for the transport package.
|
|
87
|
+
*
|
|
88
|
+
* @returns The generate boundary result.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
93
|
+
* const result = undefined;
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
21
96
|
_generateBoundary(): string;
|
|
97
|
+
/**
|
|
98
|
+
* Performs error for the transport package.
|
|
99
|
+
*
|
|
100
|
+
* @param err - The err value.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
105
|
+
* const result = undefined;
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
22
108
|
_error(err: Error): void;
|
|
109
|
+
/**
|
|
110
|
+
* Performs handle stream errors for the transport package.
|
|
111
|
+
*
|
|
112
|
+
* @param stream - The stream value.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
117
|
+
* const result = undefined;
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
23
120
|
_handleStreamErrors(stream: Stream): void;
|
|
121
|
+
/**
|
|
122
|
+
* Performs pipe next for the transport package.
|
|
123
|
+
*
|
|
124
|
+
* @param stream - The stream value.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
129
|
+
* const result = undefined;
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
24
132
|
_pipeNext(stream: formDataType): void;
|
|
133
|
+
/**
|
|
134
|
+
* Performs get next for the transport package.
|
|
135
|
+
*
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
140
|
+
* const result = undefined;
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
25
143
|
_getNext(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Performs reset for the transport package.
|
|
146
|
+
*
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
151
|
+
* const result = undefined;
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
26
154
|
_reset(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Performs create clone for the transport package.
|
|
157
|
+
*
|
|
158
|
+
* @returns The create clone result.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
163
|
+
* const result = undefined;
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
27
166
|
createClone(): FormData;
|
|
167
|
+
/**
|
|
168
|
+
* Performs append for the transport package.
|
|
169
|
+
*
|
|
170
|
+
* @param field - The field value.
|
|
171
|
+
* @param value - The value to validate.
|
|
172
|
+
* @returns The append result.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
177
|
+
* const result = undefined;
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
28
180
|
append(field: string, value: unknown): this;
|
|
181
|
+
/**
|
|
182
|
+
* Performs get headers for the transport package.
|
|
183
|
+
*
|
|
184
|
+
* @param userHeaders - The user headers value.
|
|
185
|
+
* @returns The get headers result.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
190
|
+
* const result = undefined;
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
29
193
|
getHeaders(userHeaders: {
|
|
30
194
|
[x: string]: string;
|
|
31
195
|
}): {
|
|
32
196
|
[x: string]: string;
|
|
33
197
|
};
|
|
198
|
+
/**
|
|
199
|
+
* Performs get boundary for the transport package.
|
|
200
|
+
*
|
|
201
|
+
* @returns The get boundary result.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
206
|
+
* const result = undefined;
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
34
209
|
getBoundary(): string;
|
|
210
|
+
/**
|
|
211
|
+
* Performs pipe for the transport package.
|
|
212
|
+
*
|
|
213
|
+
* @param dest - The dest value.
|
|
214
|
+
* @param options - The initialization or request options.
|
|
215
|
+
* @returns The pipe result.
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
220
|
+
* const result = undefined;
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
35
223
|
pipe<T extends NodeJS.WritableStream>(dest: T, options?: {
|
|
36
224
|
end?: boolean;
|
|
37
225
|
}): T;
|
|
226
|
+
/**
|
|
227
|
+
* Performs write for the transport package.
|
|
228
|
+
*
|
|
229
|
+
* @param data - The data value.
|
|
230
|
+
* @returns The write result.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```ts
|
|
234
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
235
|
+
* const result = undefined;
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
38
238
|
write(data: Uint8Array | string): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Performs pause for the transport package.
|
|
241
|
+
*
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```ts
|
|
245
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
246
|
+
* const result = undefined;
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
39
249
|
pause(): void;
|
|
250
|
+
/**
|
|
251
|
+
* Performs resume for the transport package.
|
|
252
|
+
*
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```ts
|
|
256
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
257
|
+
* const result = undefined;
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
40
260
|
resume(): void;
|
|
261
|
+
/**
|
|
262
|
+
* Performs end for the transport package.
|
|
263
|
+
*
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```ts
|
|
267
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
268
|
+
* const result = undefined;
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
41
271
|
end(): void;
|
|
272
|
+
/**
|
|
273
|
+
* Performs destroy for the transport package.
|
|
274
|
+
*
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```ts
|
|
278
|
+
* import { Handler } from '@zcatalyst/transport';
|
|
279
|
+
* const result = undefined;
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
42
282
|
destroy(): void;
|
|
283
|
+
/** function toString() { [native code] } */
|
|
43
284
|
toString(): string;
|
|
44
285
|
}
|