@numerum-tech/yeriasdk 1.0.0
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/README.md +864 -0
- package/dist/core/action-grid-view.d.ts +57 -0
- package/dist/core/action-grid-view.d.ts.map +1 -0
- package/dist/core/action-grid-view.js +112 -0
- package/dist/core/action-grid-view.js.map +1 -0
- package/dist/core/action-list-view.d.ts +39 -0
- package/dist/core/action-list-view.d.ts.map +1 -0
- package/dist/core/action-list-view.js +77 -0
- package/dist/core/action-list-view.js.map +1 -0
- package/dist/core/base/base-action-view.d.ts +82 -0
- package/dist/core/base/base-action-view.d.ts.map +1 -0
- package/dist/core/base/base-action-view.js +143 -0
- package/dist/core/base/base-action-view.js.map +1 -0
- package/dist/core/base-view.d.ts +105 -0
- package/dist/core/base-view.d.ts.map +1 -0
- package/dist/core/base-view.js +426 -0
- package/dist/core/base-view.js.map +1 -0
- package/dist/core/card-view.d.ts +24 -0
- package/dist/core/card-view.d.ts.map +1 -0
- package/dist/core/card-view.js +127 -0
- package/dist/core/card-view.js.map +1 -0
- package/dist/core/carousel-view.d.ts +22 -0
- package/dist/core/carousel-view.d.ts.map +1 -0
- package/dist/core/carousel-view.js +99 -0
- package/dist/core/carousel-view.js.map +1 -0
- package/dist/core/form-view.d.ts +165 -0
- package/dist/core/form-view.d.ts.map +1 -0
- package/dist/core/form-view.js +365 -0
- package/dist/core/form-view.js.map +1 -0
- package/dist/core/jsonapp.d.ts +263 -0
- package/dist/core/jsonapp.d.ts.map +1 -0
- package/dist/core/jsonapp.js +528 -0
- package/dist/core/jsonapp.js.map +1 -0
- package/dist/core/key-store.d.ts +51 -0
- package/dist/core/key-store.d.ts.map +1 -0
- package/dist/core/key-store.js +138 -0
- package/dist/core/key-store.js.map +1 -0
- package/dist/core/map-view.d.ts +45 -0
- package/dist/core/map-view.d.ts.map +1 -0
- package/dist/core/map-view.js +318 -0
- package/dist/core/map-view.js.map +1 -0
- package/dist/core/media-view.d.ts +20 -0
- package/dist/core/media-view.d.ts.map +1 -0
- package/dist/core/media-view.js +75 -0
- package/dist/core/media-view.js.map +1 -0
- package/dist/core/message-view.d.ts +53 -0
- package/dist/core/message-view.d.ts.map +1 -0
- package/dist/core/message-view.js +109 -0
- package/dist/core/message-view.js.map +1 -0
- package/dist/core/notification.d.ts +17 -0
- package/dist/core/notification.d.ts.map +1 -0
- package/dist/core/notification.js +33 -0
- package/dist/core/notification.js.map +1 -0
- package/dist/core/qr-display-view.d.ts +32 -0
- package/dist/core/qr-display-view.d.ts.map +1 -0
- package/dist/core/qr-display-view.js +66 -0
- package/dist/core/qr-display-view.js.map +1 -0
- package/dist/core/qr-scan-view.d.ts +148 -0
- package/dist/core/qr-scan-view.d.ts.map +1 -0
- package/dist/core/qr-scan-view.js +259 -0
- package/dist/core/qr-scan-view.js.map +1 -0
- package/dist/core/reader-view.d.ts +73 -0
- package/dist/core/reader-view.d.ts.map +1 -0
- package/dist/core/reader-view.js +285 -0
- package/dist/core/reader-view.js.map +1 -0
- package/dist/core/timeline-view.d.ts +16 -0
- package/dist/core/timeline-view.d.ts.map +1 -0
- package/dist/core/timeline-view.js +68 -0
- package/dist/core/timeline-view.js.map +1 -0
- package/dist/errors/index.d.ts +276 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +431 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +576 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +48 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/fileFormats.d.ts +52 -0
- package/dist/utils/fileFormats.d.ts.map +1 -0
- package/dist/utils/fileFormats.js +198 -0
- package/dist/utils/fileFormats.js.map +1 -0
- package/dist/utils/logger.d.ts +38 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +109 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validators.d.ts +48 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/utils/validators.js +445 -0
- package/dist/utils/validators.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimelineView = void 0;
|
|
4
|
+
const base_view_1 = require("./base-view");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
6
|
+
// TimelineView captures chronological progress such as onboarding steps or activity feeds.
|
|
7
|
+
class TimelineView extends base_view_1.BaseView {
|
|
8
|
+
constructor(viewId, title, processId) {
|
|
9
|
+
super({
|
|
10
|
+
id: viewId,
|
|
11
|
+
type: 'Timeline',
|
|
12
|
+
processId,
|
|
13
|
+
metadata: {
|
|
14
|
+
version: '1.0.0',
|
|
15
|
+
createdAt: new Date()
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
this.content = {
|
|
19
|
+
title,
|
|
20
|
+
intro: '',
|
|
21
|
+
items: []
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// Adds optional context text displayed before the timeline items.
|
|
25
|
+
setIntro(intro) {
|
|
26
|
+
return this.setIntroText('intro', intro);
|
|
27
|
+
}
|
|
28
|
+
// Persists a fully configured timeline entry.
|
|
29
|
+
addItem(item) {
|
|
30
|
+
if (!item.id || !item.title || !item.timestamp) {
|
|
31
|
+
throw new errors_1.MissingRequiredParameterError('timeline item id, title, and timestamp');
|
|
32
|
+
}
|
|
33
|
+
this.content.items.push({
|
|
34
|
+
...item,
|
|
35
|
+
id: item.id.trim(),
|
|
36
|
+
title: item.title.trim(),
|
|
37
|
+
timestamp: item.timestamp.trim(),
|
|
38
|
+
description: item.description?.trim()
|
|
39
|
+
});
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
addEvent(id, title, timestamp, options = {}) {
|
|
43
|
+
return this.addItem({
|
|
44
|
+
id,
|
|
45
|
+
title,
|
|
46
|
+
timestamp,
|
|
47
|
+
description: options.description,
|
|
48
|
+
status: options.status,
|
|
49
|
+
icon: options.icon
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
// Replaces all events at once, enforcing validation per entry.
|
|
53
|
+
setItems(items) {
|
|
54
|
+
this.content.items = [];
|
|
55
|
+
items.forEach(item => this.addItem(item));
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
clearItems() {
|
|
59
|
+
this.content.items = [];
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
// Gives access to the final serializable data.
|
|
63
|
+
getContent() {
|
|
64
|
+
return this.content;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.TimelineView = TimelineView;
|
|
68
|
+
//# sourceMappingURL=timeline-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-view.js","sourceRoot":"","sources":["../../src/core/timeline-view.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAEvC,sCAA0D;AAE1D,2FAA2F;AAE3F,MAAa,YAAa,SAAQ,oBAAQ;IACtC,YAAY,MAAc,EAAE,KAAa,EAAE,SAAkB;QACzD,KAAK,CAAC;YACF,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,UAAU;YAChB,SAAS;YACT,QAAQ,EAAE;gBACN,OAAO,EAAE,OAAO;gBAChB,SAAS,EAAE,IAAI,IAAI,EAAE;aACxB;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG;YACX,KAAK;YACL,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;SACO,CAAC;IACzB,CAAC;IAED,kEAAkE;IAClE,QAAQ,CAAC,KAAa;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,8CAA8C;IAC9C,OAAO,CAAC,IAAkB;QACtB,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,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
2
|
+
* Custom error types for JSONApp SDK
|
|
3
|
+
* Provides structured, type-safe error handling
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Error codes for programmatic error handling
|
|
7
|
+
*/
|
|
8
|
+
export declare const ERROR_CODES: {
|
|
9
|
+
readonly VALIDATION_FAILED: "JSON_1001";
|
|
10
|
+
readonly FIELD_REQUIRED: "JSON_1002";
|
|
11
|
+
readonly INVALID_FORMAT: "JSON_1003";
|
|
12
|
+
readonly INVALID_PARAMETER: "JSON_1004";
|
|
13
|
+
readonly INVALID_RANGE: "JSON_1005";
|
|
14
|
+
readonly FIELD_VALIDATION_FAILED: "JSON_1006";
|
|
15
|
+
readonly VIEW_NOT_FOUND: "JSON_2001";
|
|
16
|
+
readonly VIEW_INVALID: "JSON_2002";
|
|
17
|
+
readonly MAX_VIEWS_EXCEEDED: "JSON_2003";
|
|
18
|
+
readonly VIEW_NOT_REGISTERED: "JSON_2004";
|
|
19
|
+
readonly SIGNATURE_INVALID: "JSON_3001";
|
|
20
|
+
readonly VIEW_EXPIRED: "JSON_3002";
|
|
21
|
+
readonly APPID_MISMATCH: "JSON_3003";
|
|
22
|
+
readonly CRYPTO_ERROR: "JSON_3004";
|
|
23
|
+
readonly FIELD_NOT_FOUND: "JSON_4001";
|
|
24
|
+
readonly ACTION_NOT_FOUND: "JSON_4002";
|
|
25
|
+
readonly ELEMENT_NOT_FOUND: "JSON_4003";
|
|
26
|
+
readonly INVALID_INPUT: "JSON_4004";
|
|
27
|
+
readonly EMPTY_COLLECTION: "JSON_4005";
|
|
28
|
+
readonly MISSING_REQUIRED_PARAM: "JSON_5001";
|
|
29
|
+
readonly INVALID_CONFIG: "JSON_5002";
|
|
30
|
+
readonly NO_PROCESS_CONTEXT: "JSON_5003";
|
|
31
|
+
readonly LAYER_NOT_FOUND: "JSON_7001";
|
|
32
|
+
readonly LAYER_TYPE_MISMATCH: "JSON_7002";
|
|
33
|
+
readonly DUPLICATE_LAYER_ID: "JSON_7003";
|
|
34
|
+
readonly INVALID_GEOPOINT: "JSON_7004";
|
|
35
|
+
readonly INVALID_VIEWPORT: "JSON_7005";
|
|
36
|
+
readonly MARKDOWN_PARSE_ERROR: "JSON_6001";
|
|
37
|
+
readonly URL_PARSE_ERROR: "JSON_6002";
|
|
38
|
+
readonly FILE_FORMAT_ERROR: "JSON_6003";
|
|
39
|
+
readonly NOTIFICATION_FAILED: "JSON_6004";
|
|
40
|
+
};
|
|
41
|
+
export type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];
|
|
42
|
+
/**
|
|
43
|
+
* Base error class for all JSONApp errors
|
|
44
|
+
*/
|
|
45
|
+
export declare class JsonAppError extends Error {
|
|
46
|
+
readonly code: ErrorCode;
|
|
47
|
+
readonly details?: Record<string, unknown>;
|
|
48
|
+
readonly timestamp: Date;
|
|
49
|
+
constructor(code: ErrorCode, message: string, details?: Record<string, unknown>);
|
|
50
|
+
/**
|
|
51
|
+
* Returns a JSON representation of the error
|
|
52
|
+
*/
|
|
53
|
+
toJSON(): Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Validation errors - for field and form validation failures
|
|
57
|
+
*/
|
|
58
|
+
export declare class ValidationError extends JsonAppError {
|
|
59
|
+
readonly field?: string | undefined;
|
|
60
|
+
readonly validationErrors?: string[] | undefined;
|
|
61
|
+
constructor(message: string, field?: string | undefined, validationErrors?: string[] | undefined);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Field validation error - specific field failed validation
|
|
65
|
+
*/
|
|
66
|
+
export declare class FieldValidationError extends JsonAppError {
|
|
67
|
+
readonly fieldId: string;
|
|
68
|
+
readonly fieldType: string;
|
|
69
|
+
readonly validationErrors: string[];
|
|
70
|
+
constructor(fieldId: string, fieldType: string, validationErrors: string[]);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Security errors - signature verification, expiration, etc.
|
|
74
|
+
*/
|
|
75
|
+
export declare class SecurityError extends JsonAppError {
|
|
76
|
+
constructor(code: ErrorCode, message: string, details?: Record<string, unknown>);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Signature verification failed
|
|
80
|
+
*/
|
|
81
|
+
export declare class SignatureVerificationError extends SecurityError {
|
|
82
|
+
readonly appId: string;
|
|
83
|
+
readonly viewId?: string | undefined;
|
|
84
|
+
constructor(appId: string, viewId?: string | undefined);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* View has expired
|
|
88
|
+
*/
|
|
89
|
+
export declare class ViewExpiredError extends SecurityError {
|
|
90
|
+
readonly viewId: string;
|
|
91
|
+
readonly age: number;
|
|
92
|
+
readonly maxAge: number;
|
|
93
|
+
constructor(viewId: string, age: number, maxAge: number);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* AppId mismatch
|
|
97
|
+
*/
|
|
98
|
+
export declare class AppIdMismatchError extends SecurityError {
|
|
99
|
+
readonly expected: string;
|
|
100
|
+
readonly received: string;
|
|
101
|
+
constructor(expected: string, received: string);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Configuration errors
|
|
105
|
+
*/
|
|
106
|
+
export declare class ConfigurationError extends JsonAppError {
|
|
107
|
+
readonly parameter?: string | undefined;
|
|
108
|
+
constructor(message: string, parameter?: string | undefined, details?: Record<string, unknown>);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Missing required parameter
|
|
112
|
+
*/
|
|
113
|
+
export declare class MissingRequiredParameterError extends JsonAppError {
|
|
114
|
+
readonly parameterName: string;
|
|
115
|
+
constructor(parameterName: string);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Invalid parameter value
|
|
119
|
+
*/
|
|
120
|
+
export declare class InvalidParameterError extends JsonAppError {
|
|
121
|
+
readonly parameterName: string;
|
|
122
|
+
readonly value: unknown;
|
|
123
|
+
readonly constraint: string;
|
|
124
|
+
constructor(parameterName: string, value: unknown, constraint: string);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Data errors - field not found, invalid data, etc.
|
|
128
|
+
*/
|
|
129
|
+
export declare class DataError extends JsonAppError {
|
|
130
|
+
constructor(code: ErrorCode, message: string, details?: Record<string, unknown>);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Field not found in form
|
|
134
|
+
*/
|
|
135
|
+
export declare class FieldNotFoundError extends DataError {
|
|
136
|
+
readonly fieldId: string;
|
|
137
|
+
readonly formId: string;
|
|
138
|
+
constructor(fieldId: string, formId: string);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Action not found in action view
|
|
142
|
+
*/
|
|
143
|
+
export declare class ActionNotFoundError extends DataError {
|
|
144
|
+
readonly actionCode: string;
|
|
145
|
+
readonly viewId: string;
|
|
146
|
+
constructor(actionCode: string, viewId: string);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Element not found in view
|
|
150
|
+
*/
|
|
151
|
+
export declare class ElementNotFoundError extends DataError {
|
|
152
|
+
readonly index: number;
|
|
153
|
+
readonly viewId: string;
|
|
154
|
+
constructor(index: number, viewId: string);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Empty collection error
|
|
158
|
+
*/
|
|
159
|
+
export declare class EmptyCollectionError extends DataError {
|
|
160
|
+
readonly collectionName: string;
|
|
161
|
+
readonly constraint: string;
|
|
162
|
+
constructor(collectionName: string, constraint: string);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* View errors
|
|
166
|
+
*/
|
|
167
|
+
export declare class ViewError extends JsonAppError {
|
|
168
|
+
readonly viewId: string;
|
|
169
|
+
constructor(code: ErrorCode, message: string, viewId: string, details?: Record<string, unknown>);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* View not found
|
|
173
|
+
*/
|
|
174
|
+
export declare class ViewNotFoundError extends ViewError {
|
|
175
|
+
readonly appId: string;
|
|
176
|
+
constructor(viewId: string, appId: string);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* View validation failed
|
|
180
|
+
*/
|
|
181
|
+
export declare class ViewValidationError extends ViewError {
|
|
182
|
+
readonly viewType: string;
|
|
183
|
+
readonly errors: string[];
|
|
184
|
+
constructor(viewId: string, viewType: string, errors: string[]);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Maximum views exceeded
|
|
188
|
+
*/
|
|
189
|
+
export declare class MaxViewsExceededError extends ViewError {
|
|
190
|
+
readonly limit: number;
|
|
191
|
+
readonly current: number;
|
|
192
|
+
readonly appId: string;
|
|
193
|
+
constructor(limit: number, current: number, appId: string);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* External library errors
|
|
197
|
+
*/
|
|
198
|
+
export declare class ExternalError extends JsonAppError {
|
|
199
|
+
readonly library: string;
|
|
200
|
+
readonly cause?: Error | undefined;
|
|
201
|
+
constructor(code: ErrorCode, message: string, library: string, cause?: Error | undefined);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Markdown parsing error
|
|
205
|
+
*/
|
|
206
|
+
export declare class MarkdownParseError extends JsonAppError {
|
|
207
|
+
readonly viewId: string;
|
|
208
|
+
readonly cause?: Error | undefined;
|
|
209
|
+
constructor(viewId: string, cause?: Error | undefined);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* No process context error
|
|
213
|
+
*/
|
|
214
|
+
export declare class NoProcessContextError extends JsonAppError {
|
|
215
|
+
readonly viewId: string;
|
|
216
|
+
readonly operation: string;
|
|
217
|
+
constructor(viewId: string, operation: string);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Map-specific errors
|
|
221
|
+
*/
|
|
222
|
+
export declare class LayerNotFoundError extends JsonAppError {
|
|
223
|
+
readonly layerId: string;
|
|
224
|
+
constructor(layerId: string);
|
|
225
|
+
}
|
|
226
|
+
export declare class LayerTypeMismatchError extends JsonAppError {
|
|
227
|
+
readonly layerId: string;
|
|
228
|
+
readonly expected: string;
|
|
229
|
+
readonly actual: string;
|
|
230
|
+
constructor(layerId: string, expected: string, actual: string);
|
|
231
|
+
}
|
|
232
|
+
export declare class DuplicateLayerIdError extends JsonAppError {
|
|
233
|
+
readonly layerId: string;
|
|
234
|
+
constructor(layerId: string);
|
|
235
|
+
}
|
|
236
|
+
export declare class InvalidGeoPointError extends JsonAppError {
|
|
237
|
+
readonly point: unknown;
|
|
238
|
+
readonly reason: string;
|
|
239
|
+
constructor(point: unknown, reason: string);
|
|
240
|
+
}
|
|
241
|
+
export declare class InvalidViewportError extends JsonAppError {
|
|
242
|
+
readonly reason: string;
|
|
243
|
+
constructor(reason: string);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Result type for operations that may fail
|
|
247
|
+
* Better than boolean - provides error context
|
|
248
|
+
*/
|
|
249
|
+
export type Result<T, E = string> = {
|
|
250
|
+
ok: true;
|
|
251
|
+
value: T;
|
|
252
|
+
} | {
|
|
253
|
+
ok: false;
|
|
254
|
+
error: E;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Helper to create success result
|
|
258
|
+
*/
|
|
259
|
+
export declare function Ok<T>(value: T): Result<T, never>;
|
|
260
|
+
/**
|
|
261
|
+
* Helper to create error result
|
|
262
|
+
*/
|
|
263
|
+
export declare function Err<E>(error: E): Result<never, E>;
|
|
264
|
+
/**
|
|
265
|
+
* Type guard for error checking
|
|
266
|
+
*/
|
|
267
|
+
export declare function isJsonAppError(error: unknown): error is JsonAppError;
|
|
268
|
+
/**
|
|
269
|
+
* Extract error message safely
|
|
270
|
+
*/
|
|
271
|
+
export declare function getErrorMessage(error: unknown): string;
|
|
272
|
+
/**
|
|
273
|
+
* Extract error code safely
|
|
274
|
+
*/
|
|
275
|
+
export declare function getErrorCode(error: unknown): string | undefined;
|
|
276
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"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