@zcatalyst/transport 0.0.1 → 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.
Files changed (55) hide show
  1. package/LICENCE +55 -1
  2. package/README.md +266 -0
  3. package/dist-cjs/fetch-handler.js +269 -0
  4. package/dist-cjs/http-handler.js +404 -0
  5. package/dist-cjs/index.browser.js +23 -0
  6. package/dist-cjs/index.js +34 -0
  7. package/dist-cjs/utils/clonable-stream.js +107 -0
  8. package/dist-cjs/utils/constants.js +55 -0
  9. package/dist-cjs/utils/enums.js +22 -0
  10. package/dist-cjs/utils/errors.js +10 -0
  11. package/dist-cjs/utils/form-data.js +223 -0
  12. package/dist-cjs/utils/helpers.js +10 -0
  13. package/dist-cjs/utils/interfaces.js +2 -0
  14. package/dist-cjs/utils/request-agent.js +22 -0
  15. package/dist-cjs/utils/request-timeout.js +14 -0
  16. package/dist-es/fetch-handler.js +261 -0
  17. package/dist-es/http-handler.js +362 -0
  18. package/dist-es/index.browser.js +13 -0
  19. package/dist-es/index.js +21 -0
  20. package/dist-es/utils/clonable-stream.js +104 -0
  21. package/dist-es/utils/constants.js +52 -0
  22. package/dist-es/utils/enums.js +19 -0
  23. package/dist-es/utils/errors.js +6 -0
  24. package/dist-es/utils/form-data.js +218 -0
  25. package/dist-es/utils/helpers.js +7 -0
  26. package/dist-es/utils/interfaces.js +1 -0
  27. package/dist-es/utils/request-agent.js +19 -0
  28. package/dist-es/utils/request-timeout.js +11 -0
  29. package/dist-types/fetch-handler.d.ts +149 -0
  30. package/dist-types/http-handler.d.ts +79 -0
  31. package/dist-types/index.browser.d.ts +29 -0
  32. package/dist-types/index.d.ts +36 -0
  33. package/dist-types/ts3.4/fetch-handler.d.ts +149 -0
  34. package/dist-types/ts3.4/http-handler.d.ts +79 -0
  35. package/dist-types/ts3.4/index.browser.d.ts +29 -0
  36. package/dist-types/ts3.4/index.d.ts +36 -0
  37. package/dist-types/ts3.4/utils/clonable-stream.d.ts +75 -0
  38. package/dist-types/ts3.4/utils/constants.d.ts +11 -0
  39. package/dist-types/ts3.4/utils/enums.d.ts +16 -0
  40. package/dist-types/ts3.4/utils/errors.d.ts +11 -0
  41. package/dist-types/ts3.4/utils/form-data.d.ts +285 -0
  42. package/dist-types/ts3.4/utils/helpers.d.ts +13 -0
  43. package/dist-types/ts3.4/utils/interfaces.d.ts +68 -0
  44. package/dist-types/ts3.4/utils/request-agent.d.ts +12 -0
  45. package/dist-types/ts3.4/utils/request-timeout.d.ts +13 -0
  46. package/dist-types/utils/clonable-stream.d.ts +75 -0
  47. package/dist-types/utils/constants.d.ts +11 -0
  48. package/dist-types/utils/enums.d.ts +16 -0
  49. package/dist-types/utils/errors.d.ts +11 -0
  50. package/dist-types/utils/form-data.d.ts +285 -0
  51. package/dist-types/utils/helpers.d.ts +13 -0
  52. package/dist-types/utils/interfaces.d.ts +68 -0
  53. package/dist-types/utils/request-agent.d.ts +12 -0
  54. package/dist-types/utils/request-timeout.d.ts +13 -0
  55. package/package.json +37 -7
@@ -0,0 +1,218 @@
1
+ import { basename } from 'path';
2
+ import { Readable, Stream } from 'stream';
3
+ import { inspect } from 'util';
4
+ import CloneableStream from './clonable-stream';
5
+ class FormData extends Stream {
6
+ constructor(streams) {
7
+ super();
8
+ this.writable = false;
9
+ this.readable = true;
10
+ this.released = false;
11
+ this.streams = streams || [];
12
+ this.insideLoop = false;
13
+ this.pendingNext = false;
14
+ }
15
+ isStream(value) {
16
+ return (value !== undefined &&
17
+ value !== null &&
18
+ ((typeof value.on === 'function' &&
19
+ typeof value.pipe === 'function') ||
20
+ value instanceof Readable));
21
+ }
22
+ _multiPartHeader(field, value) {
23
+ const contentDisposition = this._getContentDisposition(value);
24
+ const contentType = this._getContentType(value);
25
+ let contents = '';
26
+ const headers = {
27
+ 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
28
+ 'Content-Type': [contentType]
29
+ };
30
+ for (const prop in headers) {
31
+ if (headers[prop]) {
32
+ const header = headers[prop];
33
+ if (header.length > 0) {
34
+ contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
35
+ }
36
+ }
37
+ }
38
+ return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
39
+ }
40
+ _getContentDisposition(value) {
41
+ let filename = '';
42
+ let contentDisposition = '';
43
+ if (typeof value === 'object' && value !== null && ('name' in value || 'path' in value)) {
44
+ const val = value;
45
+ filename = basename(val.name || val.path || '');
46
+ }
47
+ else if (typeof value === 'object' &&
48
+ value !== null &&
49
+ 'readable' in value &&
50
+ 'httpVersion' in value &&
51
+ 'client' in value) {
52
+ const httpValue = value;
53
+ filename = basename(httpValue.client._httpMessage.path || '');
54
+ }
55
+ if (filename) {
56
+ contentDisposition = 'filename="' + filename + '"';
57
+ }
58
+ return contentDisposition;
59
+ }
60
+ _getContentType(value) {
61
+ let contentType = '';
62
+ if (value.readable && value.hasOwnProperty('httpVersion')) {
63
+ contentType = value.headers['content-type'];
64
+ }
65
+ if (!contentType) {
66
+ contentType = FormData.CONTENT_TYPE;
67
+ }
68
+ return contentType;
69
+ }
70
+ _lastBoundary() {
71
+ return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
72
+ }
73
+ _generateBoundary() {
74
+ let boundary = '--------------------------';
75
+ for (let i = 0; i < 24; i++) {
76
+ boundary += Math.floor(Math.random() * 10).toString(16);
77
+ }
78
+ this.boundary = boundary;
79
+ return boundary;
80
+ }
81
+ _error(err) {
82
+ this._reset();
83
+ this.emit('error', err);
84
+ }
85
+ _handleStreamErrors(stream) {
86
+ stream.on('error', (err) => {
87
+ this._error(err);
88
+ });
89
+ }
90
+ _pipeNext(stream) {
91
+ this.currentStream = stream;
92
+ if (this.isStream(stream)) {
93
+ stream.on('end', this._getNext.bind(this));
94
+ stream.pipe(this, {
95
+ end: false
96
+ });
97
+ return;
98
+ }
99
+ const value = stream;
100
+ this.write(value);
101
+ this._getNext();
102
+ }
103
+ _getNext() {
104
+ this.currentStream = undefined;
105
+ if (this.insideLoop) {
106
+ this.pendingNext = true;
107
+ return;
108
+ }
109
+ this.insideLoop = true;
110
+ try {
111
+ do {
112
+ this.pendingNext = false;
113
+ const stream = this.streams.shift();
114
+ if (typeof stream === 'undefined') {
115
+ this.end();
116
+ }
117
+ else {
118
+ this._pipeNext(stream);
119
+ }
120
+ } while (this.pendingNext);
121
+ }
122
+ finally {
123
+ this.insideLoop = false;
124
+ }
125
+ }
126
+ _reset() {
127
+ this.writable = false;
128
+ this.streams = [];
129
+ this.currentStream = undefined;
130
+ }
131
+ createClone() {
132
+ const newStreams = [];
133
+ this.streams.forEach((stream) => {
134
+ const clone = this.isStream(stream)
135
+ ? new CloneableStream(stream).clone()
136
+ : stream;
137
+ newStreams.push(clone);
138
+ });
139
+ return new FormData(newStreams);
140
+ }
141
+ append(field, value) {
142
+ if (Array.isArray(value)) {
143
+ this._error(new Error('Arrays are not supported.'));
144
+ return this;
145
+ }
146
+ if (typeof value !== 'string' && !Buffer.isBuffer(value) && !this.isStream(value)) {
147
+ value = inspect(value);
148
+ }
149
+ if (this.isStream(value)) {
150
+ this._handleStreamErrors(value);
151
+ }
152
+ this.streams.push(this._multiPartHeader(field, value));
153
+ this.streams.push(value);
154
+ this.streams.push(FormData.LINE_BREAK);
155
+ return this;
156
+ }
157
+ getHeaders(userHeaders) {
158
+ const formHeaders = {};
159
+ for (const header in userHeaders) {
160
+ if (userHeaders[header]) {
161
+ formHeaders[header.toLowerCase()] = userHeaders[header];
162
+ }
163
+ }
164
+ formHeaders['content-type'] = 'multipart/form-data; boundary=' + this.getBoundary();
165
+ return formHeaders;
166
+ }
167
+ getBoundary() {
168
+ if (this.boundary === undefined) {
169
+ return this._generateBoundary();
170
+ }
171
+ return this.boundary;
172
+ }
173
+ pipe(dest, options) {
174
+ Stream.prototype.pipe.call(this, dest, options);
175
+ this.resume();
176
+ return dest;
177
+ }
178
+ write(data) {
179
+ const lastPart = this.streams.length === 0;
180
+ this.emit('data', data);
181
+ if (lastPart) {
182
+ this.emit('data', this._lastBoundary());
183
+ }
184
+ return true;
185
+ }
186
+ pause() {
187
+ if (this.currentStream !== undefined &&
188
+ typeof this.currentStream.pause === 'function') {
189
+ this.currentStream.pause();
190
+ }
191
+ this.emit('pause');
192
+ }
193
+ resume() {
194
+ if (!this.released) {
195
+ this.released = true;
196
+ this.writable = true;
197
+ this._getNext();
198
+ }
199
+ if (this.currentStream && typeof this.currentStream.resume === 'function') {
200
+ this.currentStream.resume();
201
+ }
202
+ this.emit('resume');
203
+ }
204
+ end() {
205
+ this._reset();
206
+ this.emit('end');
207
+ }
208
+ destroy() {
209
+ this._reset();
210
+ this.emit('close');
211
+ }
212
+ toString() {
213
+ return '[object FormData]';
214
+ }
215
+ }
216
+ FormData.LINE_BREAK = '\r\n';
217
+ FormData.CONTENT_TYPE = 'application/octet-stream';
218
+ export default FormData;
@@ -0,0 +1,7 @@
1
+ export function isHttps(url) {
2
+ if (url === undefined) {
3
+ return false;
4
+ }
5
+ const parsedUrl = url instanceof URL ? url : new URL(url);
6
+ return parsedUrl.protocol === 'https:';
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { CONSTANTS } from '@zcatalyst/utils';
2
+ import { Agent as httpAgent } from 'http';
3
+ import { Agent as httpsAgent } from 'https';
4
+ const agentMap = {};
5
+ export default class RequestAgent {
6
+ constructor(isHttps, host, replaceAgent) {
7
+ const protocol = isHttps ? CONSTANTS.PROTOCOL.HTTPS : CONSTANTS.PROTOCOL.HTTP;
8
+ if (agentMap[protocol] === undefined) {
9
+ agentMap[protocol] = {};
10
+ }
11
+ const protocolMap = agentMap[protocol];
12
+ if (protocolMap[host] === undefined || replaceAgent) {
13
+ protocolMap[host] = isHttps
14
+ ? new httpsAgent({ keepAlive: true })
15
+ : new httpAgent({ keepAlive: true });
16
+ }
17
+ this.agent = protocolMap[host];
18
+ }
19
+ }
@@ -0,0 +1,11 @@
1
+ export function requestTimeout(timeoutInMs = 0) {
2
+ return new Promise((resolve, reject) => {
3
+ if (timeoutInMs) {
4
+ setTimeout(() => {
5
+ const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
6
+ timeoutError.name = 'TimeoutError';
7
+ reject(timeoutError);
8
+ }, timeoutInMs);
9
+ }
10
+ });
11
+ }
@@ -0,0 +1,149 @@
1
+ import { CoreType, IRequestConfig, jwtAccessTokenResponse, RequestHandlerOptions } from './utils/interfaces';
2
+ type ICatalystDataRes = Record<string, string> | string | Blob | ArrayBuffer | ReadableStreamDefaultReader<Uint8Array> | FormData;
3
+ export interface ICatalystClientRes {
4
+ request: RequestInit;
5
+ statusCode?: number;
6
+ headers: HeadersInit;
7
+ data?: ICatalystDataRes;
8
+ buffer?: Buffer;
9
+ blob?: Blob;
10
+ config: RequestHandlerOptions;
11
+ stream?: ArrayBuffer;
12
+ }
13
+ export declare class DefaultHttpResponse {
14
+ statusCode: number;
15
+ headers: HeadersInit;
16
+ config: RequestHandlerOptions;
17
+ resp: ICatalystClientRes;
18
+ /**
19
+ * Creates a DefaultHttpResponse instance.
20
+ * @param resp - The resp value.
21
+ */
22
+ constructor(resp: ICatalystClientRes);
23
+ /**
24
+ * Returns the data value for this DefaultHttpResponse instance.
25
+ *
26
+ * @returns The response payload.
27
+ * @throws {CatalystAPIError} when the request or response cannot be processed.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import { Handler } from '@zcatalyst/transport';
32
+ * const result = undefined;
33
+ * ```
34
+ */
35
+ get data(): ICatalystDataRes;
36
+ }
37
+ export declare class ResponseHandler {
38
+ #private;
39
+ static apiDomain: string;
40
+ /**
41
+ * Creates a ResponseHandler instance.
42
+ */
43
+ constructor();
44
+ /**
45
+ * Sends a browser fetch request with SDK authentication, timeout and response handling.
46
+ *
47
+ * @param options - The initialization or request options.
48
+ * @param options.requestCore - The Fetch API request configuration.
49
+ * @param options.url - The URL to update or request.
50
+ * @param requestOptions - The request handling options.
51
+ * @returns The fire general request result.
52
+ * @throws {CatalystAPIError} when the request or response cannot be processed.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * import { Handler } from '@zcatalyst/transport';
57
+ * const response = await ResponseHandler.fireGeneralRequest({ url: '/baas/v1/project/123', method: 'GET', headers: {} });
58
+ * ```
59
+ */
60
+ static fireGeneralRequest({ requestCore, url }: {
61
+ requestCore: RequestInit;
62
+ url: string;
63
+ }, requestOptions?: RequestHandlerOptions): Promise<DefaultHttpResponse | void>;
64
+ /**
65
+ * Wraps a Fetch API response in the SDK response object.
66
+ *
67
+ * @param response - The response to wrap.
68
+ * @param options - The initialization or request options.
69
+ * @returns The wrap response result.
70
+ * @throws {CatalystAPIError} when the request or response cannot be processed.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * import { Handler } from '@zcatalyst/transport';
75
+ * const response = await ResponseHandler.wrapResponse({ url: '/baas/v1/project/123', method: 'GET', headers: {} });
76
+ * ```
77
+ */
78
+ static wrapResponse(response: Response, options?: RequestHandlerOptions): Promise<DefaultHttpResponse>;
79
+ /**
80
+ * Sends a browser fetch request without retry handling.
81
+ *
82
+ * @param requestCore - The Fetch API request configuration.
83
+ * @param reqOptions - The raw request handling options.
84
+ * @returns The fire raw request result.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * import { Handler } from '@zcatalyst/transport';
89
+ * const response = await ResponseHandler.fireRawRequest({ url: '/baas/v1/project/123', method: 'GET', headers: {} });
90
+ * ```
91
+ */
92
+ static fireRawRequest(requestCore: CoreType, reqOptions: RequestHandlerOptions): Promise<DefaultHttpResponse>;
93
+ /**
94
+ * Attaches browser authentication headers according to the configured auth protocol.
95
+ *
96
+ * @param headers - The headers object to mutate or extend.
97
+ * @returns The attach zcauth headers result.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * import { Handler } from '@zcatalyst/transport';
102
+ * const response = await ResponseHandler.attachZCAuthHeaders({ url: '/baas/v1/project/123', method: 'GET', headers: {} });
103
+ * ```
104
+ */
105
+ static attachZCAuthHeaders(headers: HeadersInit): Promise<HeadersInit>;
106
+ /**
107
+ * Builds the browser JWT authorization token from the configured cookie.
108
+ *
109
+ * @returns The get jwtzcauth token result.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * import { Handler } from '@zcatalyst/transport';
114
+ * const response = await ResponseHandler.getJWTZCAuthToken({ url: '/baas/v1/project/123', method: 'GET', headers: {} });
115
+ * ```
116
+ */
117
+ static getJWTZCAuthToken(): Promise<jwtAccessTokenResponse>;
118
+ /**
119
+ * Appends query parameters to a URL.
120
+ *
121
+ * @param url - The URL to update or request.
122
+ * @param qs - The query string values to append.
123
+ * @returns The URL with encoded query parameters.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * import { Handler } from '@zcatalyst/transport';
128
+ * const response = await ResponseHandler.appendQueryString({ url: '/baas/v1/project/123', method: 'GET', headers: {} });
129
+ * ```
130
+ */
131
+ static appendQueryString(url: string, qs?: Record<string, string | number | boolean | undefined>): string;
132
+ /**
133
+ * Sends a Catalyst HTTP request and returns the wrapped response.
134
+ *
135
+ * @param options - The initialization or request options.
136
+ * @param componentName - The component name for user-agent metadata.
137
+ * @param componentVersion - The component version for user-agent metadata.
138
+ * @returns The send result.
139
+ * @throws {CatalystAPIError} when the request or response cannot be processed.
140
+ *
141
+ * @example
142
+ * ```ts
143
+ * import { Handler } from '@zcatalyst/transport';
144
+ * const response = await ResponseHandler.send({ url: '/baas/v1/project/123', method: 'GET', headers: {} });
145
+ * ```
146
+ */
147
+ static send(options: IRequestConfig, componentName?: string, componentVersion?: string): Promise<DefaultHttpResponse | void>;
148
+ }
149
+ export {};
@@ -0,0 +1,79 @@
1
+ import { CatalystApp } from '@zcatalyst/auth-admin';
2
+ import { ClientRequest, IncomingHttpHeaders, IncomingMessage } from 'http';
3
+ import { Component, IRequestConfig } from './utils/interfaces';
4
+ export interface IAPIResponse {
5
+ request: ClientRequest;
6
+ statusCode?: number;
7
+ headers: IncomingHttpHeaders;
8
+ data?: string;
9
+ buffer?: Buffer;
10
+ config: IRequestConfig;
11
+ stream?: IncomingMessage;
12
+ }
13
+ export declare class DefaultHttpResponse {
14
+ statusCode: number;
15
+ headers: IncomingHttpHeaders;
16
+ config: IRequestConfig;
17
+ resp: IAPIResponse;
18
+ /**
19
+ * Creates a DefaultHttpResponse instance.
20
+ * @param resp - The resp value.
21
+ */
22
+ constructor(resp: IAPIResponse);
23
+ /**
24
+ * Returns the parsed response payload.
25
+ *
26
+ * @returns The data result.
27
+ * @throws {CatalystAPIError} when the operation cannot be completed.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import { Handler } from '@zcatalyst/transport';
32
+ * // Use DefaultHttpResponse.data while preparing or sending an SDK request.
33
+ * ```
34
+ */
35
+ get data(): any;
36
+ }
37
+ export declare class HttpClient {
38
+ app?: CatalystApp;
39
+ /** * @param app - The app used to fetch access tokens to sign API requests. */
40
+ constructor(app?: CatalystApp);
41
+ /**
42
+ * Sends a Catalyst HTTP request and returns the wrapped response.
43
+ *
44
+ * @param req - The req value.
45
+ * @param apmTrackerName - The apmTrackerName value.
46
+ * @param componentVersion - The componentVersion value.
47
+ * @returns The send result.
48
+ * @throws {CatalystAPIError} when the operation cannot be completed.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * import { Handler } from '@zcatalyst/transport';
53
+ * // Use HttpClient.send while preparing or sending an SDK request.
54
+ * ```
55
+ */
56
+ send(req: IRequestConfig, apmTrackerName?: string, componentVersion?: string): Promise<DefaultHttpResponse>;
57
+ }
58
+ export declare class AuthorizedHttpClient extends HttpClient {
59
+ readonly componentName?: string;
60
+ readonly componentVersion?: string;
61
+ /**
62
+ * @param app - The app used to fetch access tokens to sign API requests.
63
+ * @param component - Optional component metadata used to attach version headers.
64
+ */
65
+ constructor(app?: CatalystApp, component?: Component);
66
+ /**
67
+ * Sends a Catalyst HTTP request and returns the wrapped response.
68
+ *
69
+ * @param request - The request value.
70
+ * @returns The send result.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * import { Handler } from '@zcatalyst/transport';
75
+ * // Use AuthorizedHttpClient.send while preparing or sending an SDK request.
76
+ * ```
77
+ */
78
+ send(request: IRequestConfig): Promise<DefaultHttpResponse>;
79
+ }
@@ -0,0 +1,29 @@
1
+ import { ICatalystClientRes } from './fetch-handler';
2
+ import { Component, IRequestConfig } from './utils/interfaces';
3
+ export { CatalystService, Component, CONSTANTS } from '@zcatalyst/utils';
4
+ export { PrefixedCatalystError } from '@zcatalyst/utils';
5
+ export declare class Handler {
6
+ component?: Component;
7
+ /**
8
+ * Creates a Handler instance.
9
+ * @param app - The app value.
10
+ * @param component - The component value.
11
+ */
12
+ constructor(app?: unknown, component?: Component);
13
+ /**
14
+ * Sends a Catalyst HTTP request and returns the wrapped response.
15
+ *
16
+ * @param options - The initialization or request options.
17
+ * @returns The send result.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * import { Handler } from '@zcatalyst/transport';
22
+ * const result = undefined;
23
+ * ```
24
+ */
25
+ send(options: IRequestConfig): Promise<ICatalystClientRes>;
26
+ }
27
+ export { RequestType, ResponseType } from './utils/enums';
28
+ export { CatalystAPIError } from './utils/errors';
29
+ export { IRequestConfig };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Internal HTTP / fetch transport layer used by every Catalyst component package.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import { DefaultHttpResponse } from './http-handler';
7
+ import FormData from './utils/form-data';
8
+ import { Component, IRequestConfig } from './utils/interfaces';
9
+ export { CatalystService, Component, CONSTANTS } from '@zcatalyst/utils';
10
+ export { PrefixedCatalystError } from '@zcatalyst/utils';
11
+ export declare class Handler {
12
+ component?: Component;
13
+ app?: any;
14
+ /**
15
+ * Creates a Handler instance.
16
+ * @param app - The app value.
17
+ * @param component - The component value.
18
+ */
19
+ constructor(app?: unknown, component?: Component);
20
+ /**
21
+ * Sends a Catalyst HTTP request through the Node transport handler.
22
+ *
23
+ * @param options - The request configuration to send.
24
+ * @returns The wrapped HTTP response.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import { Handler } from '@zcatalyst/transport';
29
+ * const response = await new Handler(app).send({ method: 'GET', url: 'https://example.com' });
30
+ * ```
31
+ */
32
+ send(options: IRequestConfig): Promise<DefaultHttpResponse>;
33
+ }
34
+ export { RequestType, ResponseType } from './utils/enums';
35
+ export { CatalystAPIError } from './utils/errors';
36
+ export { FormData, IRequestConfig };