@contember/bindx 0.1.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/dist/adapter/ContemberAdapter.d.ts +40 -0
- package/dist/adapter/ContemberAdapter.d.ts.map +1 -0
- package/dist/adapter/MockAdapter.d.ts +81 -0
- package/dist/adapter/MockAdapter.d.ts.map +1 -0
- package/dist/adapter/MockQueryEngine.d.ts +43 -0
- package/dist/adapter/MockQueryEngine.d.ts.map +1 -0
- package/dist/adapter/index.d.ts +5 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/types.d.ts +184 -0
- package/dist/adapter/types.d.ts.map +1 -0
- package/dist/brand/ComponentBrand.d.ts +25 -0
- package/dist/brand/ComponentBrand.d.ts.map +1 -0
- package/dist/contember/index.d.ts +10 -0
- package/dist/contember/index.d.ts.map +1 -0
- package/dist/core/ActionDispatcher.d.ts +64 -0
- package/dist/core/ActionDispatcher.d.ts.map +1 -0
- package/dist/core/Disposable.d.ts +57 -0
- package/dist/core/Disposable.d.ts.map +1 -0
- package/dist/core/EntityLoader.d.ts +80 -0
- package/dist/core/EntityLoader.d.ts.map +1 -0
- package/dist/core/PersistenceManager.d.ts +126 -0
- package/dist/core/PersistenceManager.d.ts.map +1 -0
- package/dist/core/SelectionResolver.d.ts +21 -0
- package/dist/core/SelectionResolver.d.ts.map +1 -0
- package/dist/core/actionClassification.d.ts +48 -0
- package/dist/core/actionClassification.d.ts.map +1 -0
- package/dist/core/actions.d.ts +301 -0
- package/dist/core/actions.d.ts.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/dataview/filterHandlers.d.ts +18 -0
- package/dist/dataview/filterHandlers.d.ts.map +1 -0
- package/dist/dataview/index.d.ts +3 -0
- package/dist/dataview/index.d.ts.map +1 -0
- package/dist/dataview/types.d.ts +164 -0
- package/dist/dataview/types.d.ts.map +1 -0
- package/dist/errors/UnfetchedFieldError.d.ts +11 -0
- package/dist/errors/UnfetchedFieldError.d.ts.map +1 -0
- package/dist/errors/errorPathResolver.d.ts +52 -0
- package/dist/errors/errorPathResolver.d.ts.map +1 -0
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/pathMapper.d.ts +42 -0
- package/dist/errors/pathMapper.d.ts.map +1 -0
- package/dist/errors/types.d.ts +131 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/events/EventEmitter.d.ts +97 -0
- package/dist/events/EventEmitter.d.ts.map +1 -0
- package/dist/events/eventFactory.d.ts +40 -0
- package/dist/events/eventFactory.d.ts.map +1 -0
- package/dist/events/index.d.ts +15 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/types.d.ts +264 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/handles/BaseHandle.d.ts +64 -0
- package/dist/handles/BaseHandle.d.ts.map +1 -0
- package/dist/handles/EntityHandle.d.ts +208 -0
- package/dist/handles/EntityHandle.d.ts.map +1 -0
- package/dist/handles/FieldHandle.d.ts +111 -0
- package/dist/handles/FieldHandle.d.ts.map +1 -0
- package/dist/handles/HasManyListHandle.d.ts +166 -0
- package/dist/handles/HasManyListHandle.d.ts.map +1 -0
- package/dist/handles/HasOneHandle.d.ts +168 -0
- package/dist/handles/HasOneHandle.d.ts.map +1 -0
- package/dist/handles/PlaceholderHandle.d.ts +117 -0
- package/dist/handles/PlaceholderHandle.d.ts.map +1 -0
- package/dist/handles/index.d.ts +8 -0
- package/dist/handles/index.d.ts.map +1 -0
- package/dist/handles/proxyFactory.d.ts +66 -0
- package/dist/handles/proxyFactory.d.ts.map +1 -0
- package/dist/handles/types.d.ts +430 -0
- package/dist/handles/types.d.ts.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/internal.d.ts +11 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/persistence/BatchPersister.d.ts +142 -0
- package/dist/persistence/BatchPersister.d.ts.map +1 -0
- package/dist/persistence/ChangeRegistry.d.ts +87 -0
- package/dist/persistence/ChangeRegistry.d.ts.map +1 -0
- package/dist/persistence/ContemberSchemaMutationAdapter.d.ts +16 -0
- package/dist/persistence/ContemberSchemaMutationAdapter.d.ts.map +1 -0
- package/dist/persistence/MutationCollector.d.ts +96 -0
- package/dist/persistence/MutationCollector.d.ts.map +1 -0
- package/dist/persistence/MutationSchemaProvider.d.ts +30 -0
- package/dist/persistence/MutationSchemaProvider.d.ts.map +1 -0
- package/dist/persistence/index.d.ts +7 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/types.d.ts +189 -0
- package/dist/persistence/types.d.ts.map +1 -0
- package/dist/roles/RoleSchemaRegistry.d.ts +77 -0
- package/dist/roles/RoleSchemaRegistry.d.ts.map +1 -0
- package/dist/roles/index.d.ts +11 -0
- package/dist/roles/index.d.ts.map +1 -0
- package/dist/roles/types.d.ts +242 -0
- package/dist/roles/types.d.ts.map +1 -0
- package/dist/schema/ContemberSchema.d.ts +98 -0
- package/dist/schema/ContemberSchema.d.ts.map +1 -0
- package/dist/schema/SchemaLoader.d.ts +28 -0
- package/dist/schema/SchemaLoader.d.ts.map +1 -0
- package/dist/schema/SchemaRegistry.d.ts +95 -0
- package/dist/schema/SchemaRegistry.d.ts.map +1 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/roles.d.ts +62 -0
- package/dist/schema/roles.d.ts.map +1 -0
- package/dist/schema/types.d.ts +179 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/selection/SelectionMetaCollector.d.ts +32 -0
- package/dist/selection/SelectionMetaCollector.d.ts.map +1 -0
- package/dist/selection/SelectionScope.d.ts +77 -0
- package/dist/selection/SelectionScope.d.ts.map +1 -0
- package/dist/selection/buildQuery.d.ts +45 -0
- package/dist/selection/buildQuery.d.ts.map +1 -0
- package/dist/selection/createFragment.d.ts +29 -0
- package/dist/selection/createFragment.d.ts.map +1 -0
- package/dist/selection/createSelectionBuilder.d.ts +18 -0
- package/dist/selection/createSelectionBuilder.d.ts.map +1 -0
- package/dist/selection/index.d.ts +8 -0
- package/dist/selection/index.d.ts.map +1 -0
- package/dist/selection/queryTypes.d.ts +84 -0
- package/dist/selection/queryTypes.d.ts.map +1 -0
- package/dist/selection/types.d.ts +238 -0
- package/dist/selection/types.d.ts.map +1 -0
- package/dist/store/DirtyTracker.d.ts +26 -0
- package/dist/store/DirtyTracker.d.ts.map +1 -0
- package/dist/store/EntityMetaStore.d.ts +52 -0
- package/dist/store/EntityMetaStore.d.ts.map +1 -0
- package/dist/store/EntitySnapshotStore.d.ts +63 -0
- package/dist/store/EntitySnapshotStore.d.ts.map +1 -0
- package/dist/store/ErrorStore.d.ts +82 -0
- package/dist/store/ErrorStore.d.ts.map +1 -0
- package/dist/store/RelationStore.d.ts +175 -0
- package/dist/store/RelationStore.d.ts.map +1 -0
- package/dist/store/SnapshotStore.d.ts +143 -0
- package/dist/store/SnapshotStore.d.ts.map +1 -0
- package/dist/store/SubscriptionManager.d.ts +90 -0
- package/dist/store/SubscriptionManager.d.ts.map +1 -0
- package/dist/store/TouchedStore.d.ts +24 -0
- package/dist/store/TouchedStore.d.ts.map +1 -0
- package/dist/store/entityId.d.ts +29 -0
- package/dist/store/entityId.d.ts.map +1 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/snapshots.d.ts +144 -0
- package/dist/store/snapshots.d.ts.map +1 -0
- package/dist/undo/UndoManager.d.ts +120 -0
- package/dist/undo/UndoManager.d.ts.map +1 -0
- package/dist/undo/index.d.ts +3 -0
- package/dist/undo/index.d.ts.map +1 -0
- package/dist/undo/types.d.ts +74 -0
- package/dist/undo/types.d.ts.map +1 -0
- package/dist/utils/aliasGenerator.d.ts +25 -0
- package/dist/utils/aliasGenerator.d.ts.map +1 -0
- package/dist/utils/deepEqual.d.ts +6 -0
- package/dist/utils/deepEqual.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +29 -0
- package/src/adapter/ContemberAdapter.ts +239 -0
- package/src/adapter/MockAdapter.ts +394 -0
- package/src/adapter/MockQueryEngine.ts +236 -0
- package/src/adapter/index.ts +21 -0
- package/src/adapter/types.ts +199 -0
- package/src/brand/ComponentBrand.ts +28 -0
- package/src/contember/index.ts +17 -0
- package/src/core/ActionDispatcher.ts +450 -0
- package/src/core/Disposable.ts +126 -0
- package/src/core/EntityLoader.ts +169 -0
- package/src/core/SelectionResolver.ts +78 -0
- package/src/core/actionClassification.ts +196 -0
- package/src/core/actions.ts +491 -0
- package/src/core/index.ts +20 -0
- package/src/dataview/filterHandlers.ts +443 -0
- package/src/dataview/index.ts +36 -0
- package/src/dataview/types.ts +220 -0
- package/src/errors/UnfetchedFieldError.ts +18 -0
- package/src/errors/errorPathResolver.ts +239 -0
- package/src/errors/index.ts +40 -0
- package/src/errors/pathMapper.ts +40 -0
- package/src/errors/types.ts +223 -0
- package/src/events/EventEmitter.ts +447 -0
- package/src/events/eventFactory.ts +430 -0
- package/src/events/index.ts +89 -0
- package/src/events/types.ts +374 -0
- package/src/handles/BaseHandle.ts +100 -0
- package/src/handles/EntityHandle.ts +538 -0
- package/src/handles/FieldHandle.ts +268 -0
- package/src/handles/HasManyListHandle.ts +500 -0
- package/src/handles/HasOneHandle.ts +500 -0
- package/src/handles/PlaceholderHandle.ts +321 -0
- package/src/handles/index.ts +37 -0
- package/src/handles/proxyFactory.ts +218 -0
- package/src/handles/types.ts +743 -0
- package/src/index.ts +384 -0
- package/src/internal.ts +19 -0
- package/src/persistence/BatchPersister.ts +911 -0
- package/src/persistence/ChangeRegistry.ts +150 -0
- package/src/persistence/ContemberSchemaMutationAdapter.ts +57 -0
- package/src/persistence/MutationCollector.ts +567 -0
- package/src/persistence/MutationSchemaProvider.ts +33 -0
- package/src/persistence/index.ts +23 -0
- package/src/persistence/types.ts +220 -0
- package/src/schema/ContemberSchema.ts +132 -0
- package/src/schema/SchemaLoader.ts +93 -0
- package/src/schema/SchemaRegistry.ts +286 -0
- package/src/schema/index.ts +51 -0
- package/src/schema/roles.ts +83 -0
- package/src/schema/types.ts +238 -0
- package/src/selection/SelectionMetaCollector.ts +122 -0
- package/src/selection/SelectionScope.ts +208 -0
- package/src/selection/buildQuery.ts +134 -0
- package/src/selection/createFragment.ts +50 -0
- package/src/selection/createSelectionBuilder.ts +283 -0
- package/src/selection/index.ts +31 -0
- package/src/selection/queryTypes.ts +135 -0
- package/src/selection/types.ts +320 -0
- package/src/store/DirtyTracker.ts +117 -0
- package/src/store/EntityMetaStore.ts +143 -0
- package/src/store/EntitySnapshotStore.ts +260 -0
- package/src/store/ErrorStore.ts +251 -0
- package/src/store/RelationStore.ts +696 -0
- package/src/store/SnapshotStore.ts +765 -0
- package/src/store/SubscriptionManager.ts +241 -0
- package/src/store/TouchedStore.ts +42 -0
- package/src/store/entityId.ts +43 -0
- package/src/store/index.ts +2 -0
- package/src/store/snapshots.ts +203 -0
- package/src/undo/UndoManager.ts +418 -0
- package/src/undo/index.ts +9 -0
- package/src/undo/types.ts +84 -0
- package/src/utils/aliasGenerator.ts +56 -0
- package/src/utils/deepEqual.ts +33 -0
- package/src/utils/index.ts +2 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the DataView/DataGrid system.
|
|
3
|
+
*
|
|
4
|
+
* These types are framework-agnostic and define the filter artifact system,
|
|
5
|
+
* filter handlers, sorting state, and paging state.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
import type { OrderDirection } from '../selection/queryTypes.js';
|
|
9
|
+
/**
|
|
10
|
+
* Text filter artifact - stored as user's filter state
|
|
11
|
+
*/
|
|
12
|
+
export interface TextFilterArtifact {
|
|
13
|
+
readonly mode: 'contains' | 'startsWith' | 'endsWith' | 'equals' | 'notContains';
|
|
14
|
+
readonly query: string;
|
|
15
|
+
readonly nullCondition?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Number filter artifact
|
|
19
|
+
*/
|
|
20
|
+
export interface NumberFilterArtifact {
|
|
21
|
+
readonly mode: 'eq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
22
|
+
readonly value: number | null;
|
|
23
|
+
readonly nullCondition?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Number range filter artifact
|
|
27
|
+
*/
|
|
28
|
+
export interface NumberRangeFilterArtifact {
|
|
29
|
+
readonly min: number | null;
|
|
30
|
+
readonly max: number | null;
|
|
31
|
+
readonly nullCondition?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Date filter artifact
|
|
35
|
+
*/
|
|
36
|
+
export interface DateFilterArtifact {
|
|
37
|
+
readonly start: string | null;
|
|
38
|
+
readonly end: string | null;
|
|
39
|
+
readonly nullCondition?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Boolean filter artifact
|
|
43
|
+
*/
|
|
44
|
+
export interface BooleanFilterArtifact {
|
|
45
|
+
readonly includeTrue?: boolean;
|
|
46
|
+
readonly includeFalse?: boolean;
|
|
47
|
+
readonly nullCondition?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Enum filter artifact
|
|
51
|
+
*/
|
|
52
|
+
export interface EnumFilterArtifact {
|
|
53
|
+
readonly values?: readonly string[];
|
|
54
|
+
readonly notValues?: readonly string[];
|
|
55
|
+
readonly nullCondition?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Relation filter artifact (hasOne/hasMany)
|
|
59
|
+
*/
|
|
60
|
+
export interface RelationFilterArtifact {
|
|
61
|
+
readonly id?: readonly string[];
|
|
62
|
+
readonly notId?: readonly string[];
|
|
63
|
+
readonly nullCondition?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Enum list filter artifact - for array enum fields (uses 'includes' condition)
|
|
67
|
+
*/
|
|
68
|
+
export interface EnumListFilterArtifact {
|
|
69
|
+
readonly values?: readonly string[];
|
|
70
|
+
readonly notValues?: readonly string[];
|
|
71
|
+
readonly nullCondition?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* IsDefined filter artifact
|
|
75
|
+
*/
|
|
76
|
+
export interface IsDefinedFilterArtifact {
|
|
77
|
+
readonly defined: boolean | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Union of all filter artifact types
|
|
81
|
+
*/
|
|
82
|
+
export type FilterArtifact = TextFilterArtifact | NumberFilterArtifact | NumberRangeFilterArtifact | DateFilterArtifact | BooleanFilterArtifact | EnumFilterArtifact | EnumListFilterArtifact | RelationFilterArtifact | IsDefinedFilterArtifact;
|
|
83
|
+
/**
|
|
84
|
+
* Filter handler converts a filter artifact into an EntityWhere clause.
|
|
85
|
+
* Returns undefined when the filter is not active (artifact is empty/default).
|
|
86
|
+
*/
|
|
87
|
+
export interface FilterHandler<TArtifact = FilterArtifact> {
|
|
88
|
+
/** Convert artifact to where clause */
|
|
89
|
+
toWhere(artifact: TArtifact): Record<string, unknown> | undefined;
|
|
90
|
+
/** Check if artifact represents an active filter */
|
|
91
|
+
isActive(artifact: TArtifact): boolean;
|
|
92
|
+
/** Create default (empty/inactive) artifact */
|
|
93
|
+
defaultArtifact(): TArtifact;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Column type discriminator
|
|
97
|
+
*/
|
|
98
|
+
export type ColumnType = 'text' | 'number' | 'date' | 'dateTime' | 'boolean' | 'enum' | 'enumList' | 'uuid' | 'isDefined' | 'hasOne' | 'hasMany' | 'action' | 'custom';
|
|
99
|
+
/**
|
|
100
|
+
* Base column definition - framework-agnostic metadata
|
|
101
|
+
*/
|
|
102
|
+
export interface ColumnDefinition {
|
|
103
|
+
/** Column type */
|
|
104
|
+
readonly type: ColumnType;
|
|
105
|
+
/** Field name on the entity (null for action columns) */
|
|
106
|
+
readonly field: string | null;
|
|
107
|
+
/** Whether this column supports sorting */
|
|
108
|
+
readonly sortable: boolean;
|
|
109
|
+
/** Filter handler for this column (null if no filtering) */
|
|
110
|
+
readonly filterHandler: FilterHandler | null;
|
|
111
|
+
/** Initial filter artifact (null if no filtering) */
|
|
112
|
+
readonly filterArtifact: FilterArtifact | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Sorting directions - map of field → direction.
|
|
116
|
+
* Supports multi-column sorting (order of keys = sort priority).
|
|
117
|
+
*/
|
|
118
|
+
export type SortingDirections = Readonly<Record<string, OrderDirection>>;
|
|
119
|
+
/**
|
|
120
|
+
* Sorting direction action for triggers
|
|
121
|
+
*/
|
|
122
|
+
export type SortingDirectionAction = OrderDirection | 'next' | 'toggleAsc' | 'toggleDesc' | 'clear';
|
|
123
|
+
/**
|
|
124
|
+
* Sorting state - supports multiple sorted columns
|
|
125
|
+
*/
|
|
126
|
+
export interface SortingState {
|
|
127
|
+
readonly directions: SortingDirections;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Layout definition for DataView
|
|
131
|
+
*/
|
|
132
|
+
export interface DataViewLayout {
|
|
133
|
+
readonly name: string;
|
|
134
|
+
readonly label?: ReactNode;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Selection values - current layout + column visibility
|
|
138
|
+
*/
|
|
139
|
+
export interface SelectionValues {
|
|
140
|
+
readonly layout?: string;
|
|
141
|
+
readonly visibility: Readonly<Record<string, boolean>>;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Selection state - includes values + available layouts
|
|
145
|
+
*/
|
|
146
|
+
export interface SelectionState {
|
|
147
|
+
readonly values: SelectionValues;
|
|
148
|
+
readonly layouts: readonly DataViewLayout[];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Paging state
|
|
152
|
+
*/
|
|
153
|
+
export interface PagingState {
|
|
154
|
+
readonly pageIndex: number;
|
|
155
|
+
readonly itemsPerPage: number;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Paging info (computed from state + data)
|
|
159
|
+
*/
|
|
160
|
+
export interface PagingInfo {
|
|
161
|
+
readonly totalCount: number | null;
|
|
162
|
+
readonly totalPages: number | null;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dataview/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAA8B,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAM5F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,CAAA;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QA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AE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;CAC3C;AAMD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when accessing a field that wasn't included in the GraphQL selection.
|
|
3
|
+
* This helps debug field collection issues by clearly indicating which field is missing.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UnfetchedFieldError extends Error {
|
|
6
|
+
readonly entityType: string;
|
|
7
|
+
readonly entityId: string;
|
|
8
|
+
readonly fieldPath: string[];
|
|
9
|
+
constructor(entityType: string, entityId: string, fieldPath: string[]);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=UnfetchedFieldError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnfetchedFieldError.d.ts","sourceRoot":"","sources":["../../src/errors/UnfetchedFieldError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aAE5B,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;aAChB,SAAS,EAAE,MAAM,EAAE;gBAFnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EAAE;CASpC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep error path resolution for Contember mutation errors.
|
|
3
|
+
*
|
|
4
|
+
* Walks error paths through the schema and store to resolve
|
|
5
|
+
* the exact target entity and field where the error occurred,
|
|
6
|
+
* instead of mapping everything to the root entity.
|
|
7
|
+
*/
|
|
8
|
+
import type { SchemaRegistry } from '../schema/SchemaRegistry.js';
|
|
9
|
+
import type { SnapshotStore } from '../store/SnapshotStore.js';
|
|
10
|
+
import type { PathElement, ContemberMutationResult } from './pathMapper.js';
|
|
11
|
+
import { type ServerError } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* The resolved target of an error path.
|
|
14
|
+
*/
|
|
15
|
+
export interface ResolvedErrorTarget {
|
|
16
|
+
readonly entityType: string;
|
|
17
|
+
readonly entityId: string;
|
|
18
|
+
readonly fieldName?: string;
|
|
19
|
+
readonly type: 'field' | 'relation' | 'entity';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A fully resolved error with its target and error object.
|
|
23
|
+
*/
|
|
24
|
+
export interface ResolvedError {
|
|
25
|
+
readonly target: ResolvedErrorTarget;
|
|
26
|
+
readonly error: ServerError;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Context needed for resolving error paths.
|
|
30
|
+
*/
|
|
31
|
+
export interface ErrorPathContext {
|
|
32
|
+
readonly schema: SchemaRegistry;
|
|
33
|
+
readonly store: SnapshotStore;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolves an error path to the specific entity and field where the error occurred.
|
|
37
|
+
*
|
|
38
|
+
* Walks path elements through schema relations and store state:
|
|
39
|
+
* - `{field: name}` on scalar + last element → field error on current entity
|
|
40
|
+
* - `{field: name}` on has-one → traverse into related entity via store
|
|
41
|
+
* - `{field: name}` on has-many → consume next `{index, alias}` element
|
|
42
|
+
* - `{index, alias}` → resolve entity ID from alias or index-based lookup
|
|
43
|
+
*
|
|
44
|
+
* Falls back to last successfully resolved entity on failure.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveErrorPath(path: PathElement[], rootEntityType: string, rootEntityId: string, context: ErrorPathContext): ResolvedErrorTarget;
|
|
47
|
+
/**
|
|
48
|
+
* Resolves all errors from a Contember mutation result to specific entity targets.
|
|
49
|
+
* Processes both execution errors and validation errors.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveAllErrors(result: ContemberMutationResult, rootEntityType: string, rootEntityId: string, context: ErrorPathContext): ResolvedError[];
|
|
52
|
+
//# sourceMappingURL=errorPathResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorPathResolver.d.ts","sourceRoot":"","sources":["../../src/errors/errorPathResolver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAA;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;IACpC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,WAAW,EAAE,EACnB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,gBAAgB,GACvB,mBAAmB,CA+FrB;AAiDD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,uBAAuB,EAC/B,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,gBAAgB,GACvB,aAAa,EAAE,CA8BjB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type ExecutionErrorType, type ErrorCategory, type BindxError, type ClientError, type ServerError, type LoadError, type FieldError, type ErrorState, type ErrorInput, ExecutionErrorTypes, isExecutionErrorType, classifyError, isRetryableCategory, createClientError, createServerError, createLoadError, isClientError, isServerError, isLoadError, filterErrorsBySource, filterStickyErrors, } from './types.js';
|
|
2
|
+
export { UnfetchedFieldError } from './UnfetchedFieldError.js';
|
|
3
|
+
export { type PathElement, type ContemberMutationError, type ContemberValidationError, type ContemberMutationResult, } from './pathMapper.js';
|
|
4
|
+
export { type ResolvedErrorTarget, type ResolvedError, type ErrorPathContext, resolveErrorPath, resolveAllErrors, } from './errorPathResolver.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC5B,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for Contember error paths and mutation results.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Contember path element - either a field name or an array index.
|
|
6
|
+
*/
|
|
7
|
+
export type PathElement = {
|
|
8
|
+
field: string;
|
|
9
|
+
} | {
|
|
10
|
+
index: number;
|
|
11
|
+
alias: string | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Contember mutation error structure.
|
|
15
|
+
*/
|
|
16
|
+
export interface ContemberMutationError {
|
|
17
|
+
readonly paths: PathElement[][];
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly type: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Contember validation error structure.
|
|
23
|
+
*/
|
|
24
|
+
export interface ContemberValidationError {
|
|
25
|
+
readonly path: PathElement[];
|
|
26
|
+
readonly message: {
|
|
27
|
+
text: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Processes a Contember mutation result and extracts errors.
|
|
32
|
+
*/
|
|
33
|
+
export interface ContemberMutationResult {
|
|
34
|
+
readonly ok: boolean;
|
|
35
|
+
readonly errorMessage: string | null;
|
|
36
|
+
readonly errors: ContemberMutationError[];
|
|
37
|
+
readonly validation: {
|
|
38
|
+
readonly valid: boolean;
|
|
39
|
+
readonly errors: ContemberValidationError[];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=pathMapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathMapper.d.ts","sourceRoot":"","sources":["../../src/errors/pathMapper.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GACpB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,CAAA;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAA;IACzC,QAAQ,CAAC,UAAU,EAAE;QACpB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;QACvB,QAAQ,CAAC,MAAM,EAAE,wBAAwB,EAAE,CAAA;KAC3C,CAAA;CACD"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for bindx error handling system.
|
|
3
|
+
*
|
|
4
|
+
* Supports both client-side validation errors and server-side errors
|
|
5
|
+
* from Contember mutations.
|
|
6
|
+
*/
|
|
7
|
+
import { Result } from '@contember/schema';
|
|
8
|
+
/**
|
|
9
|
+
* Execution error types from Contember.
|
|
10
|
+
* Re-exported from @contember/schema to ensure type compatibility.
|
|
11
|
+
*/
|
|
12
|
+
export type ExecutionErrorType = `${Result.ExecutionErrorType}`;
|
|
13
|
+
/**
|
|
14
|
+
* All possible execution error type values.
|
|
15
|
+
* Used for runtime validation and error classification.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ExecutionErrorTypes: Record<ExecutionErrorType, ExecutionErrorType>;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a string is a valid ExecutionErrorType.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isExecutionErrorType(value: string): value is ExecutionErrorType;
|
|
22
|
+
/**
|
|
23
|
+
* Error classification for retry logic.
|
|
24
|
+
*/
|
|
25
|
+
export type ErrorCategory = 'validation' | 'constraint' | 'not_found' | 'transient' | 'unknown';
|
|
26
|
+
/**
|
|
27
|
+
* Classifies an execution error type into a category.
|
|
28
|
+
* - 'validation': Data validation errors (not retryable)
|
|
29
|
+
* - 'constraint': Database constraint violations (not retryable without data change)
|
|
30
|
+
* - 'not_found': Entity not found or access denied (not retryable)
|
|
31
|
+
* - 'transient': Temporary errors that may succeed on retry
|
|
32
|
+
* - 'unknown': Unclassified errors
|
|
33
|
+
*/
|
|
34
|
+
export declare function classifyError(errorType?: string): ErrorCategory;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if an error category is potentially retryable.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isRetryableCategory(category: ErrorCategory): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Base interface for all bindx errors.
|
|
41
|
+
*/
|
|
42
|
+
export interface BindxError {
|
|
43
|
+
/** Human-readable error message */
|
|
44
|
+
readonly message: string;
|
|
45
|
+
/** Optional error code for programmatic handling (e.g., 'REQUIRED', 'UNIQUE_CONSTRAINT') */
|
|
46
|
+
readonly code?: string;
|
|
47
|
+
/** If true, error won't auto-clear when field value changes */
|
|
48
|
+
readonly sticky?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Client-side error - added by user code for validation.
|
|
52
|
+
*/
|
|
53
|
+
export interface ClientError extends BindxError {
|
|
54
|
+
readonly source: 'client';
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Server-side error - from Contember mutation response.
|
|
58
|
+
*/
|
|
59
|
+
export interface ServerError extends BindxError {
|
|
60
|
+
readonly source: 'server';
|
|
61
|
+
/** Contember execution error type for database errors (string to support forward-compatible unknown types) */
|
|
62
|
+
readonly type?: string;
|
|
63
|
+
/** Error category for classification */
|
|
64
|
+
readonly category: ErrorCategory;
|
|
65
|
+
/** Whether this error might succeed on retry */
|
|
66
|
+
readonly retryable: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Load error - from data fetching (queries).
|
|
70
|
+
*/
|
|
71
|
+
export interface LoadError extends BindxError {
|
|
72
|
+
readonly source: 'load';
|
|
73
|
+
/** Error category for classification */
|
|
74
|
+
readonly category: ErrorCategory;
|
|
75
|
+
/** Whether this error might succeed on retry */
|
|
76
|
+
readonly retryable: boolean;
|
|
77
|
+
/** Original Error object for stack trace access */
|
|
78
|
+
readonly originalError?: Error;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Union type for all error sources.
|
|
82
|
+
*/
|
|
83
|
+
export type FieldError = ClientError | ServerError | LoadError;
|
|
84
|
+
/**
|
|
85
|
+
* Error state stored in the SnapshotStore.
|
|
86
|
+
*/
|
|
87
|
+
export interface ErrorState {
|
|
88
|
+
readonly errors: readonly FieldError[];
|
|
89
|
+
readonly version: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Input type for addError - allows string shorthand or full error object.
|
|
93
|
+
*/
|
|
94
|
+
export type ErrorInput = string | Omit<ClientError, 'source'>;
|
|
95
|
+
/**
|
|
96
|
+
* Creates a ClientError from ErrorInput.
|
|
97
|
+
*/
|
|
98
|
+
export declare function createClientError(input: ErrorInput): ClientError;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a ServerError from Contember error data.
|
|
101
|
+
* Automatically computes error category and retryable flag.
|
|
102
|
+
*/
|
|
103
|
+
export declare function createServerError(message: string, type?: string, code?: string): ServerError;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a LoadError from a plain Error.
|
|
106
|
+
* Load errors are always classified as 'transient' and retryable.
|
|
107
|
+
*/
|
|
108
|
+
export declare function createLoadError(error: Error): LoadError;
|
|
109
|
+
/**
|
|
110
|
+
* Checks if an error is a client error.
|
|
111
|
+
*/
|
|
112
|
+
export declare function isClientError(error: FieldError): error is ClientError;
|
|
113
|
+
/**
|
|
114
|
+
* Checks if an error is a server error.
|
|
115
|
+
*/
|
|
116
|
+
export declare function isServerError(error: FieldError): error is ServerError;
|
|
117
|
+
/**
|
|
118
|
+
* Checks if an error is a load error.
|
|
119
|
+
*/
|
|
120
|
+
export declare function isLoadError(error: FieldError): error is LoadError;
|
|
121
|
+
/**
|
|
122
|
+
* Filters errors by source.
|
|
123
|
+
*/
|
|
124
|
+
export declare function filterErrorsBySource(errors: readonly FieldError[], source: 'client' | 'server' | 'load'): FieldError[];
|
|
125
|
+
/**
|
|
126
|
+
* Filters out non-sticky client errors.
|
|
127
|
+
* Used when auto-clearing errors on value change.
|
|
128
|
+
* Load and server errors are always preserved.
|
|
129
|
+
*/
|
|
130
|
+
export declare function filterStickyErrors(errors: readonly FieldError[]): FieldError[];
|
|
131
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/errors/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MA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AED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,EAAE,CAE9E"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventEmitter manages event subscriptions and dispatching.
|
|
3
|
+
* Supports both scoped (entity/field-level) and global subscriptions.
|
|
4
|
+
*/
|
|
5
|
+
import type { AfterEvent, AfterEventTypes, BeforeEvent, BeforeEventTypes, EventListener, EventTypeMap, Interceptor, Unsubscribe } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* EventEmitter for the bindx event system.
|
|
8
|
+
*
|
|
9
|
+
* Provides:
|
|
10
|
+
* - Global event subscriptions (all events of a type)
|
|
11
|
+
* - Entity-scoped subscriptions (events for a specific entity)
|
|
12
|
+
* - Field-scoped subscriptions (events for a specific field/relation)
|
|
13
|
+
* - Interceptors for before-events (can cancel or modify)
|
|
14
|
+
*/
|
|
15
|
+
export declare class EventEmitter {
|
|
16
|
+
private readonly globalListeners;
|
|
17
|
+
private readonly scopedListeners;
|
|
18
|
+
private readonly globalInterceptors;
|
|
19
|
+
private readonly scopedInterceptors;
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe to an event globally (receives all events of that type).
|
|
22
|
+
*/
|
|
23
|
+
on<T extends AfterEventTypes>(eventType: T, listener: EventListener<EventTypeMap[T] & AfterEvent>): Unsubscribe;
|
|
24
|
+
/**
|
|
25
|
+
* Subscribe to an event for a specific entity.
|
|
26
|
+
*/
|
|
27
|
+
onEntity<T extends AfterEventTypes>(eventType: T, entityType: string, entityId: string, listener: EventListener<EventTypeMap[T] & AfterEvent>): Unsubscribe;
|
|
28
|
+
/**
|
|
29
|
+
* Subscribe to an event for a specific field or relation.
|
|
30
|
+
*/
|
|
31
|
+
onField<T extends AfterEventTypes>(eventType: T, entityType: string, entityId: string, fieldName: string, listener: EventListener<EventTypeMap[T] & AfterEvent>): Unsubscribe;
|
|
32
|
+
/**
|
|
33
|
+
* Add a global interceptor for a before event.
|
|
34
|
+
* Interceptors can cancel or modify the action.
|
|
35
|
+
*/
|
|
36
|
+
intercept<T extends BeforeEventTypes>(eventType: T, interceptor: Interceptor<EventTypeMap[T] & BeforeEvent>): Unsubscribe;
|
|
37
|
+
/**
|
|
38
|
+
* Add an entity-scoped interceptor.
|
|
39
|
+
*/
|
|
40
|
+
interceptEntity<T extends BeforeEventTypes>(eventType: T, entityType: string, entityId: string, interceptor: Interceptor<EventTypeMap[T] & BeforeEvent>): Unsubscribe;
|
|
41
|
+
/**
|
|
42
|
+
* Add a field-scoped interceptor.
|
|
43
|
+
*/
|
|
44
|
+
interceptField<T extends BeforeEventTypes>(eventType: T, entityType: string, entityId: string, fieldName: string, interceptor: Interceptor<EventTypeMap[T] & BeforeEvent>): Unsubscribe;
|
|
45
|
+
/**
|
|
46
|
+
* Runs interceptors for a before event.
|
|
47
|
+
* Returns the (possibly modified) event or null if cancelled.
|
|
48
|
+
*/
|
|
49
|
+
runInterceptors<T extends BeforeEvent>(event: T): Promise<T | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Emits an after event to all listeners.
|
|
52
|
+
*/
|
|
53
|
+
emit<T extends AfterEvent>(event: T): void;
|
|
54
|
+
/**
|
|
55
|
+
* Builds a scope key for listener/interceptor lookup.
|
|
56
|
+
*/
|
|
57
|
+
private buildScopeKey;
|
|
58
|
+
/**
|
|
59
|
+
* Gets or creates a Set in a Map.
|
|
60
|
+
*/
|
|
61
|
+
private getOrCreateSet;
|
|
62
|
+
/**
|
|
63
|
+
* Extracts fieldName from a field-scoped event.
|
|
64
|
+
*/
|
|
65
|
+
private getFieldNameFromEvent;
|
|
66
|
+
/**
|
|
67
|
+
* Notifies all listeners in a set.
|
|
68
|
+
*/
|
|
69
|
+
private notifyListeners;
|
|
70
|
+
/**
|
|
71
|
+
* Runs interceptors for a before event synchronously.
|
|
72
|
+
* Returns the (possibly modified) event or null if cancelled.
|
|
73
|
+
* If an interceptor returns a Promise, logs a warning and skips it.
|
|
74
|
+
*/
|
|
75
|
+
runInterceptorsSync<T extends BeforeEvent>(event: T): T | null;
|
|
76
|
+
/**
|
|
77
|
+
* Runs all interceptors in a set.
|
|
78
|
+
* Returns the (possibly modified) event or null if cancelled.
|
|
79
|
+
*/
|
|
80
|
+
private runInterceptorSet;
|
|
81
|
+
/**
|
|
82
|
+
* Runs all interceptors in a set synchronously.
|
|
83
|
+
* If an interceptor returns a Promise, logs a warning and skips it.
|
|
84
|
+
*/
|
|
85
|
+
private runInterceptorSetSync;
|
|
86
|
+
/**
|
|
87
|
+
* Clears all listeners and interceptors.
|
|
88
|
+
* Useful for testing or cleanup.
|
|
89
|
+
*/
|
|
90
|
+
clear(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the number of listeners for a given event type.
|
|
93
|
+
* Useful for debugging.
|
|
94
|
+
*/
|
|
95
|
+
listenerCount(eventType: string): number;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=EventEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../src/events/EventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,YAAY,EAEZ,WAAW,EAEX,WAAW,EACX,MAAM,YAAY,CAAA;AAQnB;;;;;;;;GAQG;AACH,qBAAa,YAAY;IAExB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoD;IAGpF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoD;IAGpF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAmD;IAGtF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAmD;IAMtF;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,eAAe,EAC3B,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG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AAE,KAAK,EAAE,CAAC,GAAG,IAAI;IA8B1C;;OAEG;IACH,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAO7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAcvB;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI;IA4C9D;;;OAGG;YACW,iBAAiB;IAoC/B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IA6C7B;;;OAGG;IACH,KAAK,IAAI,IAAI;IAOb;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;CAcxC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory functions for creating events from actions.
|
|
3
|
+
*/
|
|
4
|
+
import type { Action } from '../core/actions.js';
|
|
5
|
+
import type { SnapshotStore } from '../store/SnapshotStore.js';
|
|
6
|
+
import type { BeforeEvent, AfterEvent, HasManyConnectingEvent, HasManyConnectedEvent, HasManyDisconnectingEvent, HasManyDisconnectedEvent } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* State captured before action execution.
|
|
9
|
+
* Used to create after events with old values.
|
|
10
|
+
*/
|
|
11
|
+
export interface CapturedState {
|
|
12
|
+
oldValue?: unknown;
|
|
13
|
+
previousId?: string | null;
|
|
14
|
+
currentId?: string | null;
|
|
15
|
+
previousStatus?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates a before event from an action.
|
|
19
|
+
* Returns null for actions that don't have before events.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createBeforeEvent(action: Action, store: SnapshotStore): BeforeEvent | null;
|
|
22
|
+
/**
|
|
23
|
+
* Captures relevant state before action execution.
|
|
24
|
+
* Used to create after events with accurate old values.
|
|
25
|
+
*/
|
|
26
|
+
export declare function captureStateBeforeAction(action: Action, store: SnapshotStore): CapturedState;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an after event from an action and captured state.
|
|
29
|
+
* Returns null for actions that don't have after events.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createAfterEvent(action: Action, stateBefore: CapturedState, store: SnapshotStore): AfterEvent | null;
|
|
32
|
+
/**
|
|
33
|
+
* Creates hasMany connection events.
|
|
34
|
+
* These are separate since hasMany operations may not go through standard actions.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createHasManyConnectingEvent(entityType: string, entityId: string, fieldName: string, itemId: string): HasManyConnectingEvent;
|
|
37
|
+
export declare function createHasManyConnectedEvent(entityType: string, entityId: string, fieldName: string, itemId: string): HasManyConnectedEvent;
|
|
38
|
+
export declare function createHasManyDisconnectingEvent(entityType: string, entityId: string, fieldName: string, itemId: string): HasManyDisconnectingEvent;
|
|
39
|
+
export declare function createHasManyDisconnectedEvent(entityType: string, entityId: string, fieldName: string, itemId: string): HasManyDisconnectedEvent;
|
|
40
|
+
//# sourceMappingURL=eventFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventFactory.d.ts","sourceRoot":"","sources":["../../src/events/eventFactory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EACX,WAAW,EACX,UAAU,EASV,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EAMxB,MAAM,YAAY,CAAA;AAEnB;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,aAAa,GAClB,WAAW,GAAG,IAAI,CAuFpB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,aAAa,GAClB,aAAa,CAgCf;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,aAAa,EAC1B,KAAK,EAAE,aAAa,GAClB,UAAU,GAAG,IAAI,CA6JnB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,sBAAsB,CASxB;AAED,wBAAgB,2BAA2B,CAC1C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,qBAAqB,CASvB;AAED,wBAAgB,+BAA+B,CAC9C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,yBAAyB,CAS3B;AAED,wBAAgB,8BAA8B,CAC7C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,wBAAwB,CAS1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event system for bindx.
|
|
3
|
+
*
|
|
4
|
+
* Provides type-safe event subscriptions and interceptors for:
|
|
5
|
+
* - Field value changes
|
|
6
|
+
* - Relation changes (hasOne, hasMany)
|
|
7
|
+
* - Entity lifecycle (persist, reset, delete)
|
|
8
|
+
* - Errors
|
|
9
|
+
* - Load state changes
|
|
10
|
+
*/
|
|
11
|
+
export { EventEmitter } from './EventEmitter.js';
|
|
12
|
+
export { createBeforeEvent, createAfterEvent, captureStateBeforeAction, createHasManyConnectingEvent, createHasManyConnectedEvent, createHasManyDisconnectingEvent, createHasManyDisconnectedEvent, } from './eventFactory.js';
|
|
13
|
+
export type { BindxEvent, FieldScopedEvent, FieldChangingEvent, FieldChangedEvent, RelationConnectingEvent, RelationConnectedEvent, RelationDisconnectingEvent, RelationDisconnectedEvent, RelationDeletingEvent, RelationDeletedEvent, HasManyConnectingEvent, HasManyConnectedEvent, HasManyDisconnectingEvent, HasManyDisconnectedEvent, EntityPersistingEvent, EntityPersistedEvent, EntityPersistFailedEvent, EntityResettingEvent, EntityResetEvent, EntityDeletingEvent, EntityDeletedEvent, ErrorAddedEvent, ErrorsClearedEvent, LoadStateChangedEvent, BeforeEvent, AfterEvent, AnyBindxEvent, BeforeEventType, AfterEventType, AnyEventType, EventTypeMap, EventByType, InterceptorResult, Interceptor, EventListener, Unsubscribe, BeforeEventTypes, AfterEventTypes, FieldScopedEventTypes, } from './types.js';
|
|
14
|
+
export type { CapturedState } from './eventFactory.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,GAC9B,MAAM,mBAAmB,CAAA;AAE1B,YAAY,EAEX,UAAU,EACV,gBAAgB,EAGhB,kBAAkB,EAClB,iBAAiB,EAGjB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EAGpB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EAGxB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAGlB,eAAe,EACf,kBAAkB,EAGlB,qBAAqB,EAGrB,WAAW,EACX,UAAU,EACV,aAAa,EAGb,eAAe,EACf,cAAc,EACd,YAAY,EAGZ,YAAY,EACZ,WAAW,EAGX,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,WAAW,EAGX,gBAAgB,EAChB,eAAe,EACf,qBAAqB,GACrB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA"}
|