@fjell/core 4.4.73 → 4.4.74
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 +6 -6
- package/dist/AItemService.d.ts +1 -1
- package/dist/Coordinate.d.ts +1 -6
- package/dist/event/emitter.d.ts +1 -2
- package/dist/event/events.d.ts +1 -2
- package/dist/event/matching.d.ts +1 -1
- package/dist/event/subscription.d.ts +1 -2
- package/dist/index.d.ts +7 -20
- package/dist/index.js +1113 -1276
- package/dist/item/IFactory.d.ts +1 -2
- package/dist/item/IQFactory.d.ts +1 -1
- package/dist/item/IQUtils.d.ts +1 -2
- package/dist/item/IUtils.d.ts +1 -7
- package/dist/key/KUtils.d.ts +3 -3
- package/dist/operations/OperationContext.d.ts +1 -1
- package/dist/operations/index.d.ts +1 -0
- package/dist/operations/wrappers/createActionWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createAllActionWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createAllFacetWrapper.d.ts +1 -2
- package/dist/operations/wrappers/createAllWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createCreateWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createFacetWrapper.d.ts +1 -2
- package/dist/operations/wrappers/createFindOneWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createFindWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createGetWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createOneWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createRemoveWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createUpdateWrapper.d.ts +1 -3
- package/dist/operations/wrappers/createUpsertWrapper.d.ts +1 -3
- package/dist/operations/wrappers/types.d.ts +1 -1
- package/package.json +4 -7
- package/dist/item/ItemQuery.d.ts +0 -62
- package/dist/items.d.ts +0 -74
- package/dist/keys.d.ts +0 -66
- package/dist/operations/Operations.d.ts +0 -530
- package/dist/operations/contained.d.ts +0 -65
- package/dist/operations/methods.d.ts +0 -204
- package/dist/operations/primary.d.ts +0 -57
- package/dist/operations/specialized.d.ts +0 -41
- package/dist/validation/ItemValidator.d.ts +0 -43
- package/dist/validation/KeyValidator.d.ts +0 -56
- package/dist/validation/LocationValidator.d.ts +0 -39
- package/dist/validation/QueryValidator.d.ts +0 -57
- package/dist/validation/index.d.ts +0 -17
- package/dist/validation/index.js +0 -656
- package/dist/validation/schema.d.ts +0 -23
- package/dist/validation/types.d.ts +0 -69
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared validation types and options
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Options for validation functions
|
|
6
|
-
*/
|
|
7
|
-
export interface ValidationOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Custom error message prefix
|
|
10
|
-
*/
|
|
11
|
-
errorPrefix?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Whether to allow undefined (treated as empty array for location validation)
|
|
14
|
-
*/
|
|
15
|
-
allowUndefined?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to throw errors or return validation results
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
throwOnError?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Result of a validation operation (for non-throwing mode)
|
|
24
|
-
*/
|
|
25
|
-
export interface ValidationResult {
|
|
26
|
-
/**
|
|
27
|
-
* Whether validation passed
|
|
28
|
-
*/
|
|
29
|
-
valid: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Error message if validation failed
|
|
32
|
-
*/
|
|
33
|
-
error?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Detailed validation context
|
|
36
|
-
*/
|
|
37
|
-
context?: Record<string, unknown>;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Generic interface for schema validators (Zod, Yup, Joi, etc.)
|
|
41
|
-
*
|
|
42
|
-
* This interface enables duck typing - any validator that implements
|
|
43
|
-
* these methods will work with validateSchema.
|
|
44
|
-
*
|
|
45
|
-
* @template T - The validated/parsed type
|
|
46
|
-
*/
|
|
47
|
-
export interface SchemaValidator<T> {
|
|
48
|
-
/**
|
|
49
|
-
* Synchronous parse method.
|
|
50
|
-
* Should throw an error if invalid, or return the parsed data.
|
|
51
|
-
*/
|
|
52
|
-
parse: (data: unknown) => T;
|
|
53
|
-
/**
|
|
54
|
-
* Safe parse method that returns a result object instead of throwing.
|
|
55
|
-
* Used as fallback if parseAsync is not available.
|
|
56
|
-
*/
|
|
57
|
-
safeParse: (data: unknown) => {
|
|
58
|
-
success: true;
|
|
59
|
-
data: T;
|
|
60
|
-
} | {
|
|
61
|
-
success: false;
|
|
62
|
-
error: any;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Optional asynchronous parse method.
|
|
66
|
-
* Preferred over parse/safeParse if available.
|
|
67
|
-
*/
|
|
68
|
-
parseAsync?: (data: unknown) => Promise<T>;
|
|
69
|
-
}
|