@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,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
+ */
13
+ export declare function isHttps(url?: string | URL): boolean;
@@ -0,0 +1,68 @@
1
+ import { CatalystService } from '@zcatalyst/utils';
2
+ import { RequestType, ResponseType } from './enums';
3
+ export interface Component {
4
+ getComponentName(): string;
5
+ getComponentVersion?(): string;
6
+ }
7
+ export interface jwtAccessTokenResponse {
8
+ access_token: string;
9
+ }
10
+ export type SimpleType = {
11
+ url: string;
12
+ body: object | string | null;
13
+ };
14
+ export interface FileType {
15
+ url: string;
16
+ body: FormData;
17
+ }
18
+ export interface CoreType {
19
+ url: string;
20
+ body?: BodyInit | string | null;
21
+ method?: string;
22
+ headers: Record<string, string> | HeadersInit;
23
+ }
24
+ export interface RequestHandlerOptions {
25
+ request?: RequestInit;
26
+ retry?: number;
27
+ abortSignal?: AbortSignal;
28
+ requestTimeout?: number;
29
+ expecting?: ResponseType;
30
+ auth?: boolean;
31
+ duplex?: string;
32
+ service?: CatalystService;
33
+ }
34
+ export interface HTTP_CODE_MAP_BODY_TYPE {
35
+ CODE: number;
36
+ TEXT: string;
37
+ }
38
+ export interface HTTP_CODE_MAP_TYPE {
39
+ [code: string]: HTTP_CODE_MAP_BODY_TYPE;
40
+ }
41
+ export interface HTTP_CODE_REV_MAP_TYPE {
42
+ [code: number]: HTTP_CODE_MAP_BODY_TYPE;
43
+ }
44
+ export interface FORMDATA {
45
+ code: string;
46
+ name: string;
47
+ }
48
+ export interface IRequestConfig {
49
+ duplex?: string;
50
+ data?: string | Array<{
51
+ [x: string]: unknown;
52
+ }> | Array<string | number> | Record<string, unknown> | unknown;
53
+ type?: RequestType;
54
+ qs?: Record<string, string | number | boolean | undefined>;
55
+ path?: string;
56
+ origin?: string;
57
+ url?: string;
58
+ method?: string;
59
+ headers?: Record<string, string>;
60
+ user?: string;
61
+ service?: CatalystService;
62
+ auth?: boolean;
63
+ track?: boolean;
64
+ external?: boolean;
65
+ abortSignal?: AbortSignal;
66
+ expecting?: ResponseType;
67
+ retry?: boolean;
68
+ }
@@ -0,0 +1,12 @@
1
+ import { Agent as httpAgent } from 'http';
2
+ import { Agent as httpsAgent } from 'https';
3
+ export default class RequestAgent {
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
+ */
11
+ constructor(isHttps: boolean, host: string, replaceAgent: boolean);
12
+ }
@@ -0,0 +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
+ */
13
+ export declare function requestTimeout(timeoutInMs?: number): Promise<never>;
@@ -0,0 +1,75 @@
1
+ import { PassThrough, Readable } from 'stream';
2
+ declare class StreamClone extends PassThrough {
3
+ parent: CloneableStream;
4
+ /**
5
+ * Creates a StreamClone instance.
6
+ * @param parent - The parent value.
7
+ */
8
+ constructor(parent: CloneableStream);
9
+ private onDataClone;
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
+ */
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
+ */
35
+ isCloneable(stream: unknown): stream is CloneableStream | StreamClone;
36
+ }
37
+ export default class CloneableStream extends PassThrough {
38
+ _original: Readable | undefined;
39
+ _clonesCount: number;
40
+ _internalPipe: boolean;
41
+ _hasListener: boolean;
42
+ /**
43
+ * Creates a CloneableStream instance.
44
+ * @param stream - The stream value.
45
+ */
46
+ constructor(stream: Readable);
47
+ private onData;
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
+ */
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
+ */
73
+ clone(): StreamClone;
74
+ }
75
+ export {};
@@ -0,0 +1,11 @@
1
+ import { HTTP_CODE_MAP_TYPE, HTTP_CODE_REV_MAP_TYPE } from './interfaces';
2
+ export declare const HTTP_CODE_MAP: HTTP_CODE_MAP_TYPE;
3
+ export declare const HTTP_HEADER_MAP: {
4
+ CONTENT_JSON: string;
5
+ AUTHORIZATION_KEY: string;
6
+ };
7
+ export declare const REQUEST_PROPERTY: unknown;
8
+ export declare const X_ZCSRF_TOKEN = "X-ZCSRF-TOKEN";
9
+ export declare const ZD_CSRPARAM = "zd_csrparam";
10
+ declare const HTTP_CODE_REV_MAP: HTTP_CODE_REV_MAP_TYPE;
11
+ export { HTTP_CODE_REV_MAP };
@@ -0,0 +1,16 @@
1
+ export declare const enum ResponseType {
2
+ RAW = "raw",
3
+ JSON = "json",
4
+ STRING = "string",
5
+ BUFFER = "buffer"
6
+ }
7
+ export declare const enum RequestType {
8
+ FILE = "file",
9
+ JSON = "json",
10
+ URL_ENCODED = "url_encoded",
11
+ RAW = "raw"
12
+ }
13
+ export declare const enum FormDataKeys {
14
+ CODE = "code",
15
+ FILE_NAME = "file_name"
16
+ }
@@ -0,0 +1,11 @@
1
+ import { PrefixedCatalystError } from '@zcatalyst/utils';
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
+ */
10
+ constructor(code: string, message: string, value?: unknown, statusCode?: number);
11
+ }
@@ -0,0 +1,285 @@
1
+ import { IncomingMessage } from 'http';
2
+ import { PassThrough, Readable, Stream } from 'stream';
3
+ export type formDataType = string | Buffer | Readable | IncomingMessage | PassThrough | Record<string, string>;
4
+ export default class FormData extends Stream {
5
+ writable: boolean;
6
+ readable: boolean;
7
+ released: boolean;
8
+ streams: Array<formDataType>;
9
+ currentStream: undefined | formDataType;
10
+ insideLoop: boolean;
11
+ pendingNext: boolean;
12
+ boundary: string | undefined;
13
+ /**
14
+ * Creates a FormData instance.
15
+ * @param streams - The streams value.
16
+ */
17
+ constructor(streams?: Array<formDataType>);
18
+ static LINE_BREAK: string;
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
+ */
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
+ */
46
+ _multiPartHeader(field: string, value: formDataType): string;
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
193
+ getHeaders(userHeaders: {
194
+ [x: string]: string;
195
+ }): {
196
+ [x: string]: string;
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
+ */
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
+ */
223
+ pipe<T extends NodeJS.WritableStream>(dest: T, options?: {
224
+ end?: boolean;
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
+ */
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
+ */
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
+ */
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
+ */
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
+ */
282
+ destroy(): void;
283
+ /** function toString() { [native code] } */
284
+ toString(): string;
285
+ }
@@ -0,0 +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
+ */
13
+ export declare function isHttps(url?: string | URL): boolean;
@@ -0,0 +1,68 @@
1
+ import { CatalystService } from '@zcatalyst/utils';
2
+ import { RequestType, ResponseType } from './enums';
3
+ export interface Component {
4
+ getComponentName(): string;
5
+ getComponentVersion?(): string;
6
+ }
7
+ export interface jwtAccessTokenResponse {
8
+ access_token: string;
9
+ }
10
+ export type SimpleType = {
11
+ url: string;
12
+ body: object | string | null;
13
+ };
14
+ export interface FileType {
15
+ url: string;
16
+ body: FormData;
17
+ }
18
+ export interface CoreType {
19
+ url: string;
20
+ body?: BodyInit | string | null;
21
+ method?: string;
22
+ headers: Record<string, string> | HeadersInit;
23
+ }
24
+ export interface RequestHandlerOptions {
25
+ request?: RequestInit;
26
+ retry?: number;
27
+ abortSignal?: AbortSignal;
28
+ requestTimeout?: number;
29
+ expecting?: ResponseType;
30
+ auth?: boolean;
31
+ duplex?: string;
32
+ service?: CatalystService;
33
+ }
34
+ export interface HTTP_CODE_MAP_BODY_TYPE {
35
+ CODE: number;
36
+ TEXT: string;
37
+ }
38
+ export interface HTTP_CODE_MAP_TYPE {
39
+ [code: string]: HTTP_CODE_MAP_BODY_TYPE;
40
+ }
41
+ export interface HTTP_CODE_REV_MAP_TYPE {
42
+ [code: number]: HTTP_CODE_MAP_BODY_TYPE;
43
+ }
44
+ export interface FORMDATA {
45
+ code: string;
46
+ name: string;
47
+ }
48
+ export interface IRequestConfig {
49
+ duplex?: string;
50
+ data?: string | Array<{
51
+ [x: string]: unknown;
52
+ }> | Array<string | number> | Record<string, unknown> | unknown;
53
+ type?: RequestType;
54
+ qs?: Record<string, string | number | boolean | undefined>;
55
+ path?: string;
56
+ origin?: string;
57
+ url?: string;
58
+ method?: string;
59
+ headers?: Record<string, string>;
60
+ user?: string;
61
+ service?: CatalystService;
62
+ auth?: boolean;
63
+ track?: boolean;
64
+ external?: boolean;
65
+ abortSignal?: AbortSignal;
66
+ expecting?: ResponseType;
67
+ retry?: boolean;
68
+ }
@@ -0,0 +1,12 @@
1
+ import { Agent as httpAgent } from 'http';
2
+ import { Agent as httpsAgent } from 'https';
3
+ export default class RequestAgent {
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
+ */
11
+ constructor(isHttps: boolean, host: string, replaceAgent: boolean);
12
+ }
@@ -0,0 +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
+ */
13
+ export declare function requestTimeout(timeoutInMs?: number): Promise<never>;
package/package.json CHANGED
@@ -1,28 +1,58 @@
1
1
  {
2
2
  "name": "@zcatalyst/transport",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "main": "./dist-cjs/index.js",
5
5
  "module": "./dist-es/index.js",
6
6
  "types": "./dist-types/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "node": {
10
+ "import": "./dist-es/index.js",
11
+ "require": "./dist-cjs/index.js",
12
+ "types": "./dist-types/index.d.ts"
13
+ },
14
+ "browser": {
15
+ "import": "./dist-es/index.browser.js",
16
+ "require": "./dist-cjs/index.browser.js",
17
+ "types": "./dist-types/index.browser.d.ts"
18
+ },
19
+ "default": {
20
+ "import": "./dist-es/index.js",
21
+ "require": "./dist-cjs/index.js",
22
+ "types": "./dist-types/index.d.ts"
23
+ }
24
+ }
25
+ },
7
26
  "license": "Apache-2.0",
27
+ "sideEffects": false,
8
28
  "dependencies": {
9
- "@zcatalyst/auth": "^0.0.1",
10
- "@zcatalyst/utils": "^0.0.1",
11
- "@zcatalyst/auth-client": "^0.0.1"
29
+ "@zcatalyst/utils": "^0.0.3",
30
+ "@zcatalyst/auth-admin": "^0.0.3",
31
+ "@zcatalyst/auth-client": "^0.0.3"
12
32
  },
13
33
  "browser": {
14
34
  "./dist-cjs/index.js": "./dist-cjs/index.browser.js",
15
35
  "./dist-es/index.js": "./dist-es/index.browser.js",
16
- "./dist-types/index.d.ts": "./dist-types/index.browser.d.ts"
36
+ "./dist-types/index.d.ts": "./dist-types/index.browser.d.ts",
37
+ "stream": false,
38
+ "crypto": false,
39
+ "fs": false,
40
+ "path": false,
41
+ "process": false
17
42
  },
18
43
  "engines": {
19
- "node": ">=21"
44
+ "node": ">=20"
20
45
  },
21
46
  "files": [
22
47
  "dist-*/**"
23
48
  ],
49
+ "keywords": [
50
+ "transport",
51
+ "zcatalyst",
52
+ "catalyst"
53
+ ],
24
54
  "scripts": {
25
- "build": "concurrently 'pnpm:build:cjs' 'pnpm:build:es' 'pnpm:build:types && pnpm build:types:downlevel'",
55
+ "build": "pnpm clean && concurrently 'pnpm:build:cjs' 'pnpm:build:es' 'pnpm:build:types && pnpm build:types:downlevel'",
26
56
  "build:cjs": "pnpm tsc -p tsconfig.cjs.json",
27
57
  "build:es": "pnpm tsc -p tsconfig.es.json",
28
58
  "build:types": "pnpm tsc -p tsconfig.types.json",