@intrig/react 0.0.15-28 → 0.0.15-29
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/_virtual/_rollupPluginBabelHelpers.js +11 -0
- package/extra.js +131 -0
- package/index.js +4 -0
- package/intrig-context.js +34 -0
- package/intrig-provider.js +407 -0
- package/logger.js +41 -0
- package/media-type-utils.js +127 -0
- package/network-state.js +353 -0
- package/package.json +19 -11
- package/index.esm.js +0 -4872
- /package/{index.esm.d.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
2
|
+
|
|
3
|
+
// type Encoders = {
|
|
4
|
+
// [k: string]: <T>(
|
|
5
|
+
// request: T,
|
|
6
|
+
// mediaType: string,
|
|
7
|
+
// schema: ZodSchema,
|
|
8
|
+
// ) => Promise<any>;
|
|
9
|
+
// };
|
|
10
|
+
|
|
11
|
+
const encoders = {};
|
|
12
|
+
function encode(request, mediaType, schema) {
|
|
13
|
+
if (encoders[mediaType]) {
|
|
14
|
+
return encoders[mediaType](request, mediaType, schema);
|
|
15
|
+
}
|
|
16
|
+
return request;
|
|
17
|
+
}
|
|
18
|
+
encoders['application/json'] = (request, mediaType, schema) => {
|
|
19
|
+
return request;
|
|
20
|
+
};
|
|
21
|
+
function appendFormData(formData, data, parentKey) {
|
|
22
|
+
if (data instanceof Blob || typeof data === 'string') {
|
|
23
|
+
formData.append(parentKey, data);
|
|
24
|
+
} else if (data !== null && typeof data === 'object') {
|
|
25
|
+
if (Array.isArray(data)) {
|
|
26
|
+
data.forEach((item, index) => {
|
|
27
|
+
const key = `${parentKey}`;
|
|
28
|
+
appendFormData(formData, item, key);
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
Object.keys(data).forEach(key => {
|
|
32
|
+
const newKey = parentKey ? `${parentKey}[${key}]` : key;
|
|
33
|
+
appendFormData(formData, data[key], newKey);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
formData.append(parentKey, data == null ? '' : String(data));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
encoders['multipart/form-data'] = (request, mediaType, schema) => {
|
|
41
|
+
const _request = request;
|
|
42
|
+
const formData = new FormData();
|
|
43
|
+
Object.keys(_request).forEach(key => {
|
|
44
|
+
appendFormData(formData, _request[key], key);
|
|
45
|
+
});
|
|
46
|
+
return formData;
|
|
47
|
+
};
|
|
48
|
+
encoders['application/octet-stream'] = (request, mediaType, schema) => {
|
|
49
|
+
return request;
|
|
50
|
+
};
|
|
51
|
+
encoders['application/x-www-form-urlencoded'] = (request, mediaType, schema) => {
|
|
52
|
+
const formData = new FormData();
|
|
53
|
+
for (const key in request) {
|
|
54
|
+
const value = request[key];
|
|
55
|
+
formData.append(key, value instanceof Blob || typeof value === 'string' ? value : String(value));
|
|
56
|
+
}
|
|
57
|
+
return formData;
|
|
58
|
+
};
|
|
59
|
+
const transformers = {};
|
|
60
|
+
function transform(request, mediaType, schema) {
|
|
61
|
+
if (transformers[mediaType]) {
|
|
62
|
+
return transformers[mediaType](request, mediaType, schema);
|
|
63
|
+
}
|
|
64
|
+
throw new Error(`Unsupported media type: ` + mediaType);
|
|
65
|
+
}
|
|
66
|
+
transformers['application/json'] = async (request, mediaType, schema) => {
|
|
67
|
+
return schema.parse(await request.json());
|
|
68
|
+
};
|
|
69
|
+
transformers['multipart/form-data'] = async (request, mediaType, schema) => {
|
|
70
|
+
const formData = await request.formData();
|
|
71
|
+
const content = {};
|
|
72
|
+
formData.forEach((value, key) => {
|
|
73
|
+
if (content[key]) {
|
|
74
|
+
if (!(content[key] instanceof Array)) {
|
|
75
|
+
content[key] = [content[key]];
|
|
76
|
+
}
|
|
77
|
+
content[key].push(value);
|
|
78
|
+
} else {
|
|
79
|
+
content[key] = value;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return schema.parse(content);
|
|
83
|
+
};
|
|
84
|
+
transformers['application/octet-stream'] = async (request, mediaType, schema) => {
|
|
85
|
+
return schema.parse(new Blob([await request.arrayBuffer()], {
|
|
86
|
+
type: 'application/octet-stream'
|
|
87
|
+
}));
|
|
88
|
+
};
|
|
89
|
+
transformers['application/x-www-form-urlencoded'] = async (request, mediaType, schema) => {
|
|
90
|
+
const formData = await request.formData();
|
|
91
|
+
const content = {};
|
|
92
|
+
formData.forEach((value, key) => content[key] = value);
|
|
93
|
+
return schema.parse(content);
|
|
94
|
+
};
|
|
95
|
+
transformers['application/xml'] = async (request, mediaType, schema) => {
|
|
96
|
+
const xmlParser = new XMLParser();
|
|
97
|
+
const content = await xmlParser.parse(await request.text());
|
|
98
|
+
return schema.parse(await content);
|
|
99
|
+
};
|
|
100
|
+
transformers['text/plain'] = async (request, mediaType, schema) => {
|
|
101
|
+
return schema.parse(await request.text());
|
|
102
|
+
};
|
|
103
|
+
transformers['text/html'] = async (request, mediaType, schema) => {
|
|
104
|
+
return schema.parse(await request.text());
|
|
105
|
+
};
|
|
106
|
+
transformers['text/css'] = async (request, mediaType, schema) => {
|
|
107
|
+
return schema.parse(await request.text());
|
|
108
|
+
};
|
|
109
|
+
transformers['text/javascript'] = async (request, mediaType, schema) => {
|
|
110
|
+
return schema.parse(await request.text());
|
|
111
|
+
};
|
|
112
|
+
const responseTransformers = {};
|
|
113
|
+
responseTransformers['application/json'] = async (data, mediaType, schema) => {
|
|
114
|
+
return schema.parse(data);
|
|
115
|
+
};
|
|
116
|
+
responseTransformers['application/xml'] = async (data, mediaType, schema) => {
|
|
117
|
+
const parsed = new XMLParser().parse(data);
|
|
118
|
+
return schema.parse(parsed);
|
|
119
|
+
};
|
|
120
|
+
async function transformResponse(data, mediaType, schema) {
|
|
121
|
+
if (responseTransformers[mediaType]) {
|
|
122
|
+
return await responseTransformers[mediaType](data, mediaType, schema);
|
|
123
|
+
}
|
|
124
|
+
return data;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { encode, transform, transformResponse };
|
package/network-state.js
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State of an asynchronous call. Network state follows the state diagram given below.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
* <pre>
|
|
6
|
+
* ┌──────┐
|
|
7
|
+
* ┌─────────────► Init ◄────────────┐
|
|
8
|
+
* │ └▲────┬┘ │
|
|
9
|
+
* │ │ │ │
|
|
10
|
+
* │ Reset Execute │
|
|
11
|
+
* Reset │ │ Reset
|
|
12
|
+
* │ ┌──┴────┴──┐ │
|
|
13
|
+
* │ ┌────► Pending ◄────┐ │
|
|
14
|
+
* │ │ └──┬────┬──┘ │ │
|
|
15
|
+
* │ Execute │ │ Execute │
|
|
16
|
+
* │ │ │ │ │ │
|
|
17
|
+
* │ │ OnSuccess OnError │ │
|
|
18
|
+
* │ ┌────┴──┐ │ │ ┌──┴───┐ │
|
|
19
|
+
* └─┤Success◄────┘ └────►Error ├─┘
|
|
20
|
+
* └───────┘ └──────┘
|
|
21
|
+
*
|
|
22
|
+
* </pre>
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Network call is not yet started
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Checks whether the state is init state
|
|
31
|
+
* @param state
|
|
32
|
+
*/
|
|
33
|
+
function isInit(state) {
|
|
34
|
+
return state.state === 'init';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Initializes a new state.
|
|
39
|
+
*
|
|
40
|
+
* @template T The type of the state.
|
|
41
|
+
* @return {InitState<T>} An object representing the initial state.
|
|
42
|
+
*/
|
|
43
|
+
function init() {
|
|
44
|
+
return {
|
|
45
|
+
state: 'init'
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Network call is not yet completed
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Interface representing progress information for an upload or download operation.
|
|
55
|
+
*
|
|
56
|
+
* @typedef {object} Progress
|
|
57
|
+
*
|
|
58
|
+
* @property {'upload' | 'download'} type - The type of the operation.
|
|
59
|
+
*
|
|
60
|
+
* @property {number} loaded - The amount of data that has been loaded so far.
|
|
61
|
+
*
|
|
62
|
+
* @property {number} [total] - The total amount of data to be loaded (if known).
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Checks whether the state is pending state
|
|
67
|
+
* @param state
|
|
68
|
+
*/
|
|
69
|
+
function isPending(state) {
|
|
70
|
+
return state.state === 'pending';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Generates a PendingState object with a state of "pending".
|
|
75
|
+
*
|
|
76
|
+
* @return {PendingState<T>} An object representing the pending state.
|
|
77
|
+
*/
|
|
78
|
+
function pending(progress = undefined, data = undefined) {
|
|
79
|
+
return {
|
|
80
|
+
state: 'pending',
|
|
81
|
+
progress,
|
|
82
|
+
data
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Network call is completed with success state
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Checks whether the state is success response
|
|
92
|
+
* @param state
|
|
93
|
+
*/
|
|
94
|
+
function isSuccess(state) {
|
|
95
|
+
return state.state === 'success';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Creates a success state object with the provided data.
|
|
100
|
+
*
|
|
101
|
+
* @param {T} data - The data to be included in the success state.
|
|
102
|
+
* @return {SuccessState<T>} An object representing a success state containing the provided data.
|
|
103
|
+
*/
|
|
104
|
+
function success(data) {
|
|
105
|
+
return {
|
|
106
|
+
state: 'success',
|
|
107
|
+
data
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Network call is completed with error response
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Checks whether the state is error state
|
|
117
|
+
* @param state
|
|
118
|
+
*/
|
|
119
|
+
function isError(state) {
|
|
120
|
+
return state.state === 'error';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Constructs an ErrorState object representing an error.
|
|
125
|
+
*
|
|
126
|
+
* @param {any} error - The error object or message.
|
|
127
|
+
* @param {string} [statusCode] - An optional status code associated with the error.
|
|
128
|
+
* @return {ErrorState<T>} An object representing the error state.
|
|
129
|
+
*/
|
|
130
|
+
function error(error, statusCode, request) {
|
|
131
|
+
return {
|
|
132
|
+
state: 'error',
|
|
133
|
+
error,
|
|
134
|
+
statusCode,
|
|
135
|
+
request
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Represents an error state with additional contextual information.
|
|
141
|
+
*
|
|
142
|
+
* @typedef {Object} ErrorWithContext
|
|
143
|
+
* @template T
|
|
144
|
+
* @extends ErrorState<T>
|
|
145
|
+
*
|
|
146
|
+
* @property {string} source - The origin of the error.
|
|
147
|
+
* @property {string} operation - The operation being performed when the error occurred.
|
|
148
|
+
* @property {string} key - A unique key identifying the specific error instance.
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Represents an action in the network context.
|
|
153
|
+
*
|
|
154
|
+
* @template T - The type of data associated with the network action
|
|
155
|
+
*
|
|
156
|
+
* @property {NetworkState<any>} state - The current state of the network action
|
|
157
|
+
* @property {string} key - The unique identifier for the network action
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Represents the dispatch state of a process.
|
|
162
|
+
*
|
|
163
|
+
* @template T The type of the state information.
|
|
164
|
+
* @interface
|
|
165
|
+
*
|
|
166
|
+
* @property {string} state The current state of the dispatch process.
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Represents a successful dispatch state.
|
|
171
|
+
*
|
|
172
|
+
* @template T - Type of the data associated with the dispatch.
|
|
173
|
+
*
|
|
174
|
+
* @extends DispatchState<T>
|
|
175
|
+
*
|
|
176
|
+
* @property {string} state - The state of the dispatch, always 'success'.
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Indicates a successful dispatch state.
|
|
181
|
+
*
|
|
182
|
+
* @return {DispatchState<T>} An object representing a successful state.
|
|
183
|
+
*/
|
|
184
|
+
function successfulDispatch() {
|
|
185
|
+
return {
|
|
186
|
+
state: 'success'
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Determines if the provided dispatch state represents a successful dispatch.
|
|
192
|
+
*
|
|
193
|
+
* @param {DispatchState<T>} value - The dispatch state to check.
|
|
194
|
+
* @return {value is SuccessfulDispatch<T>} - True if the dispatch state indicates success, false otherwise.
|
|
195
|
+
*/
|
|
196
|
+
function isSuccessfulDispatch(value) {
|
|
197
|
+
return value.state === 'success';
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* ValidationError interface represents a specific type of dispatch state
|
|
202
|
+
* where a validation error has occurred.
|
|
203
|
+
*
|
|
204
|
+
* @typeparam T - The type of the data associated with this dispatch state.
|
|
205
|
+
*/
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Generates a ValidationError object.
|
|
209
|
+
*
|
|
210
|
+
* @param error The error details that caused the validation to fail.
|
|
211
|
+
* @return The ValidationError object containing the error state and details.
|
|
212
|
+
*/
|
|
213
|
+
function validationError(error) {
|
|
214
|
+
return {
|
|
215
|
+
state: 'validation-error',
|
|
216
|
+
error
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Determines if a provided DispatchState object is a ValidationError.
|
|
222
|
+
*
|
|
223
|
+
* @param {DispatchState<T>} value - The DispatchState object to evaluate.
|
|
224
|
+
* @return {boolean} - Returns true if the provided DispatchState object is a ValidationError, otherwise returns false.
|
|
225
|
+
*/
|
|
226
|
+
function isValidationError(value) {
|
|
227
|
+
return value.state === 'validation-error';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Represents an error structure with a specified type and associated data.
|
|
232
|
+
*
|
|
233
|
+
* @template T - The type of the data associated with the error.
|
|
234
|
+
* @template E - The type of the error detail.
|
|
235
|
+
*
|
|
236
|
+
* @property {string} type - A string representing the type of the error.
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Represents an error encountered during a network operation.
|
|
241
|
+
* Extends from the `IntrigError` interface, adding network-specific properties.
|
|
242
|
+
*
|
|
243
|
+
* @template T - The type of the intrinsic data associated with the error.
|
|
244
|
+
* @template E - The type of the error details, defaulting to `unknown`.
|
|
245
|
+
*
|
|
246
|
+
* @property {string} type - A constant property representing the error type, always set to 'network'.
|
|
247
|
+
* @property {string} statusCode - A string representation of the HTTP status code associated with the error, indicating the nature of the network failure.
|
|
248
|
+
* @property {E} error - The detailed error information specific to the failure, type extends from the generic E, allowing flexibility in the error details.
|
|
249
|
+
* @property {any} request - The request object that was attempted when the network error occurred, providing context for what operation failed.
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Constructs a network error object.
|
|
254
|
+
*
|
|
255
|
+
* @param error The error object corresponding to the network request.
|
|
256
|
+
* @param statusCode A string representing the HTTP status code returned.
|
|
257
|
+
* @param request The request object associated with the network operation.
|
|
258
|
+
* @return A NetworkError object containing the error type, status code, error details, and the original request.
|
|
259
|
+
*/
|
|
260
|
+
function networkError(error, statusCode, request) {
|
|
261
|
+
return {
|
|
262
|
+
type: 'network',
|
|
263
|
+
statusCode,
|
|
264
|
+
error,
|
|
265
|
+
request
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Determines if the provided IntrigError is of type 'network'.
|
|
271
|
+
*
|
|
272
|
+
* @param {IntrigError<T, E>} value - The error value to check the type of.
|
|
273
|
+
* @return {boolean} - Returns true if the error is of type 'network', otherwise false.
|
|
274
|
+
*/
|
|
275
|
+
function isNetworkError(value) {
|
|
276
|
+
return value.type === 'network';
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Interface representing a request validation error.
|
|
281
|
+
*
|
|
282
|
+
* This error occurs when a validation process on a request fails. It extends the IntrigError interface
|
|
283
|
+
* by adding specific properties related to request validation.
|
|
284
|
+
*
|
|
285
|
+
* @template T - The type of the data associated with the error.
|
|
286
|
+
* @template E - The optional type of additional error information. Defaults to unknown.
|
|
287
|
+
*
|
|
288
|
+
* @extends IntrigError<T, E>
|
|
289
|
+
*
|
|
290
|
+
* @property {string} type - A string literal indicating the error type as 'request-validation'.
|
|
291
|
+
* @property {ZodError} error - An instance of ZodError containing detailed validation error information.
|
|
292
|
+
*/
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Constructs a RequestValidationError object encapsulating the ZodError.
|
|
296
|
+
*
|
|
297
|
+
* @param {ZodError} error - The error object resulting from Zod schema validation.
|
|
298
|
+
* @return {RequestValidationError<T, E>} A RequestValidationError object containing the validation error information.
|
|
299
|
+
*/
|
|
300
|
+
function requestValidationError(error) {
|
|
301
|
+
return {
|
|
302
|
+
type: 'request-validation',
|
|
303
|
+
error
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Determines if a given error is of type RequestValidationError.
|
|
309
|
+
*
|
|
310
|
+
* @param value The error object to check, which implements the IntrigError interface.
|
|
311
|
+
* @return A boolean indicating whether the error is a RequestValidationError.
|
|
312
|
+
*/
|
|
313
|
+
function isRequestValidationError(value) {
|
|
314
|
+
return value.type === 'request-validation';
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* ResponseValidationError interface is designed to extend the capabilities of the IntrigError interface,
|
|
319
|
+
* specifically for handling errors related to response validation.
|
|
320
|
+
*
|
|
321
|
+
* @template T - Represents the type of the data or payload associated with the error.
|
|
322
|
+
* @template E - Represents the type of any additional error information. Defaults to unknown.
|
|
323
|
+
*
|
|
324
|
+
* @extends IntrigError
|
|
325
|
+
*
|
|
326
|
+
* @property type - A string literal that identifies the type of error as 'response-validation'.
|
|
327
|
+
* @property error - An instance of ZodError representing the validation error encountered.
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Constructs a ResponseValidationError object with a specified error.
|
|
332
|
+
*
|
|
333
|
+
* @param {ZodError} error - The validation error encountered during response validation.
|
|
334
|
+
* @return {ResponseValidationError<T, E>} An error object containing the type of error and the validation error details.
|
|
335
|
+
*/
|
|
336
|
+
function responseValidationError(error) {
|
|
337
|
+
return {
|
|
338
|
+
type: 'response-validation',
|
|
339
|
+
error
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Determines if the given error is a response validation error.
|
|
345
|
+
*
|
|
346
|
+
* @param {IntrigError<T, E>} value - The error object to assess.
|
|
347
|
+
* @return {boolean} True if the error is a response validation error, otherwise false.
|
|
348
|
+
*/
|
|
349
|
+
function isResponseValidationError(value) {
|
|
350
|
+
return value.type === 'response-validation';
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export { error, init, isError, isInit, isNetworkError, isPending, isRequestValidationError, isResponseValidationError, isSuccess, isSuccessfulDispatch, isValidationError, networkError, pending, requestValidationError, responseValidationError, success, successfulDispatch, validationError };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intrig/react",
|
|
3
|
-
"version": "0.0.15-
|
|
3
|
+
"version": "0.0.15-29",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "./index.
|
|
6
|
-
"module": "./index.
|
|
7
|
-
"types": "./index.
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"axios": "^1.7.7",
|
|
10
10
|
"date-fns": "^4.1.0",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"fast-xml-parser": "^4.5.0",
|
|
13
13
|
"immer": "^10.1.1",
|
|
14
14
|
"loglevel": "1.8.1",
|
|
15
|
-
"module-alias": "^2.2.2",
|
|
16
15
|
"zod": "^3.23.8"
|
|
17
16
|
},
|
|
18
17
|
"devDependencies": {
|
|
@@ -28,15 +27,24 @@
|
|
|
28
27
|
"react": "^18.0.0 || ^19.0.0",
|
|
29
28
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
30
29
|
},
|
|
31
|
-
"_moduleAliases": {
|
|
32
|
-
"@intrig/react": "./src"
|
|
33
|
-
},
|
|
34
30
|
"exports": {
|
|
35
31
|
"./package.json": "./package.json",
|
|
36
32
|
".": {
|
|
37
|
-
"types": "./index.
|
|
38
|
-
"import": "./index.
|
|
39
|
-
"default": "./index.
|
|
33
|
+
"types": "./src/index.d.ts",
|
|
34
|
+
"import": "./index.js",
|
|
35
|
+
"default": "./index.js"
|
|
36
|
+
},
|
|
37
|
+
"./*": {
|
|
38
|
+
"types": "./src/*.d.ts",
|
|
39
|
+
"import": "./*.js",
|
|
40
|
+
"default": "./*.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"typesVersions": {
|
|
44
|
+
"*": {
|
|
45
|
+
"*": [
|
|
46
|
+
"src/*"
|
|
47
|
+
]
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
}
|